@learncard/react 2.7.20 → 2.7.23

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 (247) hide show
  1. package/dist/base.css +1 -1
  2. package/dist/base.js +1 -1
  3. package/dist/cjs/{AchievementCard-2ad4cb64.js → AchievementCard-496e93b5.js} +4 -4
  4. package/dist/cjs/{AchievementCard-2ad4cb64.js.map → AchievementCard-496e93b5.js.map} +1 -1
  5. package/dist/cjs/{BoostGenericCard-e540e459.js → BoostGenericCard-1bfe4385.js} +8 -8
  6. package/dist/cjs/BoostGenericCard-1bfe4385.js.map +1 -0
  7. package/dist/cjs/{BoostSmallCard-9dc75a95.js → BoostSmallCard-bba7c0c9.js} +5 -5
  8. package/dist/cjs/BoostSmallCard-bba7c0c9.js.map +1 -0
  9. package/dist/cjs/Button-a7af702b.js.map +1 -1
  10. package/dist/cjs/{CertificateDisplayCard-11ebf814.js → CertificateDisplayCard-d7f6c028.js} +31 -19
  11. package/dist/{esm/CertificateDisplayCard-b69fd06f.js.map → cjs/CertificateDisplayCard-d7f6c028.js.map} +1 -1
  12. package/dist/cjs/Checkmark-f611aa4d.js.map +1 -1
  13. package/dist/cjs/CircleCheckButton-82d47ee2.js.map +1 -1
  14. package/dist/cjs/CircleIcon-617c38fa.js.map +1 -1
  15. package/dist/cjs/CircleSpinner-093cce04.js.map +1 -1
  16. package/dist/cjs/Coins-acd63f46.js.map +1 -1
  17. package/dist/cjs/CourseCard-338a32ee.js.map +1 -1
  18. package/dist/cjs/{CourseVerticalCard-5a73ab74.js → CourseVerticalCard-841960b1.js} +3 -3
  19. package/dist/cjs/{CourseVerticalCard-5a73ab74.js.map → CourseVerticalCard-841960b1.js.map} +1 -1
  20. package/dist/cjs/FlippyCard-209549c5.js.map +1 -1
  21. package/dist/cjs/GenericArrow-8dfb261d.js.map +1 -1
  22. package/dist/cjs/{GenericCard-46248807.js → GenericCard-5659339e.js} +7 -8
  23. package/dist/cjs/GenericCard-5659339e.js.map +1 -0
  24. package/dist/cjs/JobHistoryCard-05a3f98b.js.map +1 -1
  25. package/dist/cjs/JobListCard-458c8585.js.map +1 -1
  26. package/dist/cjs/LearnCardCreditCardBackFace-87cc8b9f.js.map +1 -1
  27. package/dist/cjs/{LearnCardCreditCardFrontFace-94be6a62.js → LearnCardCreditCardFrontFace-39eeb89a.js} +2 -2
  28. package/dist/cjs/{LearnCardCreditCardFrontFace-94be6a62.js.map → LearnCardCreditCardFrontFace-39eeb89a.js.map} +1 -1
  29. package/dist/cjs/LearnPill-21b47475.js.map +1 -1
  30. package/dist/cjs/{Lightbox-f19e13d2.js → Lightbox-880f4672.js} +22 -19
  31. package/dist/cjs/{Lightbox-f19e13d2.js.map → Lightbox-880f4672.js.map} +1 -1
  32. package/dist/cjs/Lightbulb-19c89d3c.js.map +1 -1
  33. package/dist/cjs/{MeritBadgeDisplayCard-70930ef2.js → MeritBadgeDisplayCard-b952091c.js} +102 -76
  34. package/dist/cjs/MeritBadgeDisplayCard-b952091c.js.map +1 -0
  35. package/dist/cjs/{MeritBadgeSkillsCount-41a273ae.js → MeritBadgeSkillsCount-59548cbb.js} +10 -4
  36. package/dist/cjs/{MeritBadgeSkillsCount-41a273ae.js.map → MeritBadgeSkillsCount-59548cbb.js.map} +1 -1
  37. package/dist/cjs/MiniVCThumbnail-a78e44f2.js.map +1 -1
  38. package/dist/cjs/Notification-d212fa7b.js.map +1 -1
  39. package/dist/cjs/NotificationBoostCard-70dfa17e.js.map +1 -1
  40. package/dist/cjs/NotificationUserAcceptedBoostCard-423b9320.js.map +1 -1
  41. package/dist/cjs/NotificationUserCard-d4dab06c.js.map +1 -1
  42. package/dist/cjs/PuzzlePiece-937c216a.js.map +1 -1
  43. package/dist/cjs/{QRCodeCard-2a818136.js → QRCodeCard-b56c11cc.js} +2 -2
  44. package/dist/cjs/{QRCodeCard-2a818136.js.map → QRCodeCard-b56c11cc.js.map} +1 -1
  45. package/dist/cjs/QRCodeIcon-81c6e96b.js.map +1 -1
  46. package/dist/cjs/RoundedPill-bda7c067.js.map +1 -1
  47. package/dist/cjs/{SchoolIDCard-c7b4153a.js → SchoolIDCard-5a0b8568.js} +1206 -10
  48. package/dist/cjs/SchoolIDCard-5a0b8568.js.map +1 -0
  49. package/dist/cjs/{SkillTabCard-d8f3f5d4.js → SkillTabCard-66677f3c.js} +2 -2
  50. package/dist/cjs/{SkillTabCard-d8f3f5d4.js.map → SkillTabCard-66677f3c.js.map} +1 -1
  51. package/dist/cjs/SkillVerticalCard-3eb3a8e9.js.map +1 -1
  52. package/dist/cjs/SkillsCard-4b6dbb4f.js.map +1 -1
  53. package/dist/cjs/SkillsStatsCard-97a35a88.js.map +1 -1
  54. package/dist/cjs/SmallAchievementCard-a1fa862b.js.map +1 -1
  55. package/dist/cjs/Trophy-3d323be3.js.map +1 -1
  56. package/dist/cjs/User-301088ac.js.map +1 -1
  57. package/dist/cjs/{VCCard-cf3590eb.js → VCCard-70f348fd.js} +4 -18
  58. package/dist/{esm/VCCard-6c8c3ff1.js.map → cjs/VCCard-70f348fd.js.map} +1 -1
  59. package/dist/cjs/{VCDisplayBackFace-9c064eef.js → VCDisplayBackFace-aab5806b.js} +3 -3
  60. package/dist/cjs/{VCDisplayBackFace-9c064eef.js.map → VCDisplayBackFace-aab5806b.js.map} +1 -1
  61. package/dist/cjs/{VCDisplayCard-929fe8b9.js → VCDisplayCard-ae0ee7c6.js} +3 -3
  62. package/dist/cjs/{VCDisplayCard-929fe8b9.js.map → VCDisplayCard-ae0ee7c6.js.map} +1 -1
  63. package/dist/cjs/{VCDisplayCard2-19613b61.js → VCDisplayCard2-653b08d5.js} +67 -48
  64. package/dist/{esm/VCDisplayCard2-06c93532.js.map → cjs/VCDisplayCard2-653b08d5.js.map} +1 -1
  65. package/dist/cjs/VCThumbnail-6bf86bb2.js.map +1 -1
  66. package/dist/cjs/VCVerificationCheck-46fa75d3.js.map +1 -1
  67. package/dist/cjs/{VCVerificationPill-09953688.js → VCVerificationPill-b8d9a33d.js} +2 -2
  68. package/dist/cjs/{VCVerificationPill-09953688.js.map → VCVerificationPill-b8d9a33d.js.map} +1 -1
  69. package/dist/cjs/{VerifierStateBadgeAndText-fd0bd814.js → VerifierStateBadgeAndText-e5f83fc7.js} +19 -9
  70. package/dist/cjs/VerifierStateBadgeAndText-e5f83fc7.js.map +1 -0
  71. package/dist/cjs/{constants-737d10f6.js → constants-5bc954cb.js} +10 -10
  72. package/dist/cjs/{constants-737d10f6.js.map → constants-5bc954cb.js.map} +1 -1
  73. package/dist/cjs/{credential.helpers-afb94f02.js → credential.helpers-39c07250.js} +874 -1296
  74. package/dist/cjs/credential.helpers-39c07250.js.map +1 -0
  75. package/dist/cjs/icons-0404f605.js.map +1 -1
  76. package/dist/cjs/index-5488badc.js.map +1 -1
  77. package/dist/cjs/index-7cd11826.js.map +1 -1
  78. package/dist/cjs/index-c831a2f6.js +2448 -0
  79. package/dist/cjs/index-c831a2f6.js.map +1 -0
  80. package/dist/cjs/{index-8082a131.js → index-ec1d26f1.js} +17 -21
  81. package/dist/cjs/index-ec1d26f1.js.map +1 -0
  82. package/dist/cjs/index.js +52 -52
  83. package/dist/cjs/index10.js +6 -6
  84. package/dist/cjs/index12.js +1 -1
  85. package/dist/cjs/index13.js +52 -52
  86. package/dist/cjs/index17.js +2 -2
  87. package/dist/cjs/index19.js +1 -1
  88. package/dist/cjs/index2.js +21 -21
  89. package/dist/cjs/index21.js +8 -7
  90. package/dist/cjs/index21.js.map +1 -1
  91. package/dist/cjs/index27.js +2 -2
  92. package/dist/cjs/index29.js +1 -1
  93. package/dist/cjs/index3.js +2 -2
  94. package/dist/cjs/index30.js +1 -2
  95. package/dist/cjs/index30.js.map +1 -1
  96. package/dist/cjs/index33.js +3 -3
  97. package/dist/cjs/index37.js +13 -13
  98. package/dist/cjs/index38.js +5 -4
  99. package/dist/cjs/index38.js.map +1 -1
  100. package/dist/cjs/index39.js +6 -5
  101. package/dist/cjs/index39.js.map +1 -1
  102. package/dist/cjs/index4.js +19 -19
  103. package/dist/cjs/index40.js +9 -9
  104. package/dist/cjs/index41.js +2 -1
  105. package/dist/cjs/index41.js.map +1 -1
  106. package/dist/cjs/index44.js +2 -2
  107. package/dist/cjs/index6.js +7 -6
  108. package/dist/cjs/index6.js.map +1 -1
  109. package/dist/cjs/notifications-56c6fc94.js.map +1 -1
  110. package/dist/cjs/types-8eab1382.js.map +1 -1
  111. package/dist/cjs/types-e4d9a257.js.map +1 -1
  112. package/dist/cjs/{types.esm-c33cbec2.js → types.esm-41aaa0d4.js} +50 -40
  113. package/dist/cjs/types.esm-41aaa0d4.js.map +1 -0
  114. package/dist/esm/{AchievementCard-1d5d1b61.js → AchievementCard-017092a3.js} +4 -4
  115. package/dist/esm/{AchievementCard-1d5d1b61.js.map → AchievementCard-017092a3.js.map} +1 -1
  116. package/dist/esm/{BoostGenericCard-de8e2a84.js → BoostGenericCard-f5200b85.js} +4 -4
  117. package/dist/esm/BoostGenericCard-f5200b85.js.map +1 -0
  118. package/dist/esm/{BoostSmallCard-902844fc.js → BoostSmallCard-7180158e.js} +6 -6
  119. package/dist/esm/BoostSmallCard-7180158e.js.map +1 -0
  120. package/dist/esm/Button-5f805204.js.map +1 -1
  121. package/dist/esm/{CertificateDisplayCard-b69fd06f.js → CertificateDisplayCard-7fbe6404.js} +31 -19
  122. package/dist/{cjs/CertificateDisplayCard-11ebf814.js.map → esm/CertificateDisplayCard-7fbe6404.js.map} +1 -1
  123. package/dist/esm/Checkmark-d8b8f43d.js.map +1 -1
  124. package/dist/esm/CircleCheckButton-5a97f071.js.map +1 -1
  125. package/dist/esm/CircleIcon-4200733b.js.map +1 -1
  126. package/dist/esm/CircleSpinner-9b8b1a6b.js.map +1 -1
  127. package/dist/esm/Coins-ed119ec6.js.map +1 -1
  128. package/dist/esm/CourseCard-663ff174.js.map +1 -1
  129. package/dist/esm/{CourseVerticalCard-6b11b2a1.js → CourseVerticalCard-130b0d91.js} +3 -3
  130. package/dist/esm/{CourseVerticalCard-6b11b2a1.js.map → CourseVerticalCard-130b0d91.js.map} +1 -1
  131. package/dist/esm/FlippyCard-a2de5cf1.js.map +1 -1
  132. package/dist/esm/GenericArrow-0dba1707.js.map +1 -1
  133. package/dist/esm/{GenericCard-7b21d3e2.js → GenericCard-fe56887c.js} +4 -5
  134. package/dist/esm/GenericCard-fe56887c.js.map +1 -0
  135. package/dist/esm/JobHistoryCard-80d4ef27.js.map +1 -1
  136. package/dist/esm/JobListCard-1299ff04.js.map +1 -1
  137. package/dist/esm/LearnCardCreditCardBackFace-9baa9e6b.js.map +1 -1
  138. package/dist/esm/{LearnCardCreditCardFrontFace-f61b789c.js → LearnCardCreditCardFrontFace-d50efb25.js} +2 -2
  139. package/dist/esm/{LearnCardCreditCardFrontFace-f61b789c.js.map → LearnCardCreditCardFrontFace-d50efb25.js.map} +1 -1
  140. package/dist/esm/LearnPill-b8885ed1.js.map +1 -1
  141. package/dist/esm/{Lightbox-a1aab9ea.js → Lightbox-883afe8f.js} +22 -19
  142. package/dist/esm/{Lightbox-a1aab9ea.js.map → Lightbox-883afe8f.js.map} +1 -1
  143. package/dist/esm/Lightbulb-b6eca510.js.map +1 -1
  144. package/dist/esm/{MeritBadgeDisplayCard-575a61ed.js → MeritBadgeDisplayCard-ec9d5238.js} +102 -76
  145. package/dist/esm/MeritBadgeDisplayCard-ec9d5238.js.map +1 -0
  146. package/dist/esm/{MeritBadgeSkillsCount-8f371ab1.js → MeritBadgeSkillsCount-1694dc2c.js} +10 -4
  147. package/dist/esm/{MeritBadgeSkillsCount-8f371ab1.js.map → MeritBadgeSkillsCount-1694dc2c.js.map} +1 -1
  148. package/dist/esm/MiniVCThumbnail-6a07e810.js.map +1 -1
  149. package/dist/esm/Notification-95d159d2.js.map +1 -1
  150. package/dist/esm/NotificationBoostCard-e614c341.js.map +1 -1
  151. package/dist/esm/NotificationUserAcceptedBoostCard-8c13bd3f.js.map +1 -1
  152. package/dist/esm/NotificationUserCard-dbcc80f9.js.map +1 -1
  153. package/dist/esm/PuzzlePiece-1fb12c2e.js.map +1 -1
  154. package/dist/esm/{QRCodeCard-79d4d253.js → QRCodeCard-aa2b9967.js} +2 -2
  155. package/dist/esm/{QRCodeCard-79d4d253.js.map → QRCodeCard-aa2b9967.js.map} +1 -1
  156. package/dist/esm/QRCodeIcon-e9569804.js.map +1 -1
  157. package/dist/esm/RoundedPill-6a6e8aaf.js.map +1 -1
  158. package/dist/esm/{SchoolIDCard-01422d53.js → SchoolIDCard-5abd1bd9.js} +1205 -9
  159. package/dist/esm/SchoolIDCard-5abd1bd9.js.map +1 -0
  160. package/dist/esm/{SkillTabCard-8177895b.js → SkillTabCard-cfe117a2.js} +2 -2
  161. package/dist/esm/{SkillTabCard-8177895b.js.map → SkillTabCard-cfe117a2.js.map} +1 -1
  162. package/dist/esm/SkillVerticalCard-108f49bb.js.map +1 -1
  163. package/dist/esm/SkillsCard-92a51db2.js.map +1 -1
  164. package/dist/esm/SkillsStatsCard-1628fe9c.js.map +1 -1
  165. package/dist/esm/SmallAchievementCard-d0220751.js.map +1 -1
  166. package/dist/esm/Trophy-ad67f46a.js.map +1 -1
  167. package/dist/esm/User-161c7f37.js.map +1 -1
  168. package/dist/esm/{VCCard-6c8c3ff1.js → VCCard-85d16242.js} +4 -18
  169. package/dist/{cjs/VCCard-cf3590eb.js.map → esm/VCCard-85d16242.js.map} +1 -1
  170. package/dist/esm/{VCDisplayBackFace-c618851f.js → VCDisplayBackFace-e5f8f858.js} +3 -3
  171. package/dist/esm/{VCDisplayBackFace-c618851f.js.map → VCDisplayBackFace-e5f8f858.js.map} +1 -1
  172. package/dist/esm/{VCDisplayCard-fb298063.js → VCDisplayCard-edcd787f.js} +3 -3
  173. package/dist/esm/{VCDisplayCard-fb298063.js.map → VCDisplayCard-edcd787f.js.map} +1 -1
  174. package/dist/esm/{VCDisplayCard2-06c93532.js → VCDisplayCard2-599e7a65.js} +67 -48
  175. package/dist/{cjs/VCDisplayCard2-19613b61.js.map → esm/VCDisplayCard2-599e7a65.js.map} +1 -1
  176. package/dist/esm/VCThumbnail-3c254bda.js.map +1 -1
  177. package/dist/esm/VCVerificationCheck-80249524.js.map +1 -1
  178. package/dist/esm/{VCVerificationPill-dc9dda81.js → VCVerificationPill-43167fd5.js} +2 -2
  179. package/dist/esm/{VCVerificationPill-dc9dda81.js.map → VCVerificationPill-43167fd5.js.map} +1 -1
  180. package/dist/esm/{VerifierStateBadgeAndText-86214479.js → VerifierStateBadgeAndText-b042bf32.js} +19 -9
  181. package/dist/esm/VerifierStateBadgeAndText-b042bf32.js.map +1 -0
  182. package/dist/esm/constants-a7601fa8.js.map +1 -1
  183. package/dist/esm/{credential.helpers-cdc2f4a3.js → credential.helpers-a5b16a5e.js} +820 -1242
  184. package/dist/esm/credential.helpers-a5b16a5e.js.map +1 -0
  185. package/dist/esm/icons-03afd795.js.map +1 -1
  186. package/dist/esm/index-28917993.js.map +1 -1
  187. package/dist/esm/{index-dff96076.js → index-2ef835bd.js} +17 -21
  188. package/dist/esm/index-2ef835bd.js.map +1 -0
  189. package/dist/esm/index-5d5219f7.js.map +1 -1
  190. package/dist/esm/index-705f3821.js +2438 -0
  191. package/dist/esm/index-705f3821.js.map +1 -0
  192. package/dist/esm/index.js +42 -42
  193. package/dist/esm/index10.js +6 -6
  194. package/dist/esm/index12.js +1 -1
  195. package/dist/esm/index13.js +42 -42
  196. package/dist/esm/index17.js +2 -2
  197. package/dist/esm/index19.js +1 -1
  198. package/dist/esm/index2.js +21 -21
  199. package/dist/esm/index21.js +8 -7
  200. package/dist/esm/index21.js.map +1 -1
  201. package/dist/esm/index27.js +2 -2
  202. package/dist/esm/index3.js +2 -2
  203. package/dist/esm/index30.js +1 -2
  204. package/dist/esm/index30.js.map +1 -1
  205. package/dist/esm/index33.js +3 -3
  206. package/dist/esm/index37.js +13 -13
  207. package/dist/esm/index38.js +5 -4
  208. package/dist/esm/index38.js.map +1 -1
  209. package/dist/esm/index39.js +6 -5
  210. package/dist/esm/index39.js.map +1 -1
  211. package/dist/esm/index4.js +19 -19
  212. package/dist/esm/index40.js +9 -9
  213. package/dist/esm/index41.js +2 -1
  214. package/dist/esm/index41.js.map +1 -1
  215. package/dist/esm/index44.js +2 -2
  216. package/dist/esm/index6.js +7 -6
  217. package/dist/esm/index6.js.map +1 -1
  218. package/dist/esm/notifications-009bbd80.js.map +1 -1
  219. package/dist/esm/types-b32d28d5.js.map +1 -1
  220. package/dist/esm/types-cfde3c2b.js.map +1 -1
  221. package/dist/esm/{types.esm-4ec5392e.js → types.esm-3a1994d5.js} +50 -40
  222. package/dist/esm/types.esm-3a1994d5.js.map +1 -0
  223. package/dist/main.css +1 -1
  224. package/dist/main.js +1 -1
  225. package/package.json +3 -3
  226. package/dist/cjs/BoostGenericCard-e540e459.js.map +0 -1
  227. package/dist/cjs/BoostSmallCard-9dc75a95.js.map +0 -1
  228. package/dist/cjs/GenericCard-46248807.js.map +0 -1
  229. package/dist/cjs/MeritBadgeDisplayCard-70930ef2.js.map +0 -1
  230. package/dist/cjs/SchoolIDCard-c7b4153a.js.map +0 -1
  231. package/dist/cjs/VerifierStateBadgeAndText-fd0bd814.js.map +0 -1
  232. package/dist/cjs/credential.helpers-afb94f02.js.map +0 -1
  233. package/dist/cjs/index-8082a131.js.map +0 -1
  234. package/dist/cjs/index-838fa72c.js +0 -1186
  235. package/dist/cjs/index-838fa72c.js.map +0 -1
  236. package/dist/cjs/types.esm-c33cbec2.js.map +0 -1
  237. package/dist/esm/BoostGenericCard-de8e2a84.js.map +0 -1
  238. package/dist/esm/BoostSmallCard-902844fc.js.map +0 -1
  239. package/dist/esm/GenericCard-7b21d3e2.js.map +0 -1
  240. package/dist/esm/MeritBadgeDisplayCard-575a61ed.js.map +0 -1
  241. package/dist/esm/SchoolIDCard-01422d53.js.map +0 -1
  242. package/dist/esm/VerifierStateBadgeAndText-86214479.js.map +0 -1
  243. package/dist/esm/credential.helpers-cdc2f4a3.js.map +0 -1
  244. package/dist/esm/index-4fa491c1.js +0 -1184
  245. package/dist/esm/index-4fa491c1.js.map +0 -1
  246. package/dist/esm/index-dff96076.js.map +0 -1
  247. package/dist/esm/types.esm-4ec5392e.js.map +0 -1
@@ -0,0 +1,2438 @@
1
+ function _typeof(o) {
2
+ "@babel/helpers - typeof";
3
+
4
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
5
+ return typeof o;
6
+ } : function (o) {
7
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8
+ }, _typeof(o);
9
+ }
10
+
11
+ function toInteger(dirtyNumber) {
12
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
13
+ return NaN;
14
+ }
15
+ var number = Number(dirtyNumber);
16
+ if (isNaN(number)) {
17
+ return number;
18
+ }
19
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
20
+ }
21
+
22
+ function requiredArgs(required, args) {
23
+ if (args.length < required) {
24
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
25
+ }
26
+ }
27
+
28
+ /**
29
+ * @name toDate
30
+ * @category Common Helpers
31
+ * @summary Convert the given argument to an instance of Date.
32
+ *
33
+ * @description
34
+ * Convert the given argument to an instance of Date.
35
+ *
36
+ * If the argument is an instance of Date, the function returns its clone.
37
+ *
38
+ * If the argument is a number, it is treated as a timestamp.
39
+ *
40
+ * If the argument is none of the above, the function returns Invalid Date.
41
+ *
42
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
43
+ *
44
+ * @param {Date|Number} argument - the value to convert
45
+ * @returns {Date} the parsed date in the local time zone
46
+ * @throws {TypeError} 1 argument required
47
+ *
48
+ * @example
49
+ * // Clone the date:
50
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
51
+ * //=> Tue Feb 11 2014 11:30:30
52
+ *
53
+ * @example
54
+ * // Convert the timestamp to date:
55
+ * const result = toDate(1392098430000)
56
+ * //=> Tue Feb 11 2014 11:30:30
57
+ */
58
+ function toDate(argument) {
59
+ requiredArgs(1, arguments);
60
+ var argStr = Object.prototype.toString.call(argument);
61
+
62
+ // Clone the date
63
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
64
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
65
+ return new Date(argument.getTime());
66
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
67
+ return new Date(argument);
68
+ } else {
69
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
70
+ // eslint-disable-next-line no-console
71
+ 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://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
72
+ // eslint-disable-next-line no-console
73
+ console.warn(new Error().stack);
74
+ }
75
+ return new Date(NaN);
76
+ }
77
+ }
78
+
79
+ var defaultOptions = {};
80
+ function getDefaultOptions() {
81
+ return defaultOptions;
82
+ }
83
+
84
+ /**
85
+ * Days in 1 week.
86
+ *
87
+ * @name daysInWeek
88
+ * @constant
89
+ * @type {number}
90
+ * @default
91
+ */
92
+
93
+ /**
94
+ * Milliseconds in 1 minute
95
+ *
96
+ * @name millisecondsInMinute
97
+ * @constant
98
+ * @type {number}
99
+ * @default
100
+ */
101
+ var millisecondsInMinute = 60000;
102
+
103
+ /**
104
+ * Milliseconds in 1 hour
105
+ *
106
+ * @name millisecondsInHour
107
+ * @constant
108
+ * @type {number}
109
+ * @default
110
+ */
111
+ var millisecondsInHour = 3600000;
112
+
113
+ /**
114
+ * Milliseconds in 1 second
115
+ *
116
+ * @name millisecondsInSecond
117
+ * @constant
118
+ * @type {number}
119
+ * @default
120
+ */
121
+ var millisecondsInSecond = 1000;
122
+
123
+ function startOfUTCISOWeek(dirtyDate) {
124
+ requiredArgs(1, arguments);
125
+ var weekStartsOn = 1;
126
+ var date = toDate(dirtyDate);
127
+ var day = date.getUTCDay();
128
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
129
+ date.setUTCDate(date.getUTCDate() - diff);
130
+ date.setUTCHours(0, 0, 0, 0);
131
+ return date;
132
+ }
133
+
134
+ function getUTCISOWeekYear(dirtyDate) {
135
+ requiredArgs(1, arguments);
136
+ var date = toDate(dirtyDate);
137
+ var year = date.getUTCFullYear();
138
+ var fourthOfJanuaryOfNextYear = new Date(0);
139
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
140
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
141
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
142
+ var fourthOfJanuaryOfThisYear = new Date(0);
143
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
144
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
145
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
146
+ if (date.getTime() >= startOfNextYear.getTime()) {
147
+ return year + 1;
148
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
149
+ return year;
150
+ } else {
151
+ return year - 1;
152
+ }
153
+ }
154
+
155
+ function startOfUTCISOWeekYear(dirtyDate) {
156
+ requiredArgs(1, arguments);
157
+ var year = getUTCISOWeekYear(dirtyDate);
158
+ var fourthOfJanuary = new Date(0);
159
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
160
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
161
+ var date = startOfUTCISOWeek(fourthOfJanuary);
162
+ return date;
163
+ }
164
+
165
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
166
+ function getUTCISOWeek(dirtyDate) {
167
+ requiredArgs(1, arguments);
168
+ var date = toDate(dirtyDate);
169
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
170
+
171
+ // Round the number of days to the nearest integer
172
+ // because the number of milliseconds in a week is not constant
173
+ // (e.g. it's different in the week of the daylight saving time clock shift)
174
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
175
+ }
176
+
177
+ function startOfUTCWeek(dirtyDate, options) {
178
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
179
+ requiredArgs(1, arguments);
180
+ var defaultOptions = getDefaultOptions();
181
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
182
+
183
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
184
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
185
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
186
+ }
187
+ var date = toDate(dirtyDate);
188
+ var day = date.getUTCDay();
189
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
190
+ date.setUTCDate(date.getUTCDate() - diff);
191
+ date.setUTCHours(0, 0, 0, 0);
192
+ return date;
193
+ }
194
+
195
+ function getUTCWeekYear(dirtyDate, options) {
196
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
197
+ requiredArgs(1, arguments);
198
+ var date = toDate(dirtyDate);
199
+ var year = date.getUTCFullYear();
200
+ var defaultOptions = getDefaultOptions();
201
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
202
+
203
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
204
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
205
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
206
+ }
207
+ var firstWeekOfNextYear = new Date(0);
208
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
209
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
210
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
211
+ var firstWeekOfThisYear = new Date(0);
212
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
213
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
214
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
215
+ if (date.getTime() >= startOfNextYear.getTime()) {
216
+ return year + 1;
217
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
218
+ return year;
219
+ } else {
220
+ return year - 1;
221
+ }
222
+ }
223
+
224
+ function startOfUTCWeekYear(dirtyDate, options) {
225
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
226
+ requiredArgs(1, arguments);
227
+ var defaultOptions = getDefaultOptions();
228
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
229
+ var year = getUTCWeekYear(dirtyDate, options);
230
+ var firstWeek = new Date(0);
231
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
232
+ firstWeek.setUTCHours(0, 0, 0, 0);
233
+ var date = startOfUTCWeek(firstWeek, options);
234
+ return date;
235
+ }
236
+
237
+ var MILLISECONDS_IN_WEEK = 604800000;
238
+ function getUTCWeek(dirtyDate, options) {
239
+ requiredArgs(1, arguments);
240
+ var date = toDate(dirtyDate);
241
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
242
+
243
+ // Round the number of days to the nearest integer
244
+ // because the number of milliseconds in a week is not constant
245
+ // (e.g. it's different in the week of the daylight saving time clock shift)
246
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
247
+ }
248
+
249
+ function _assertThisInitialized(e) {
250
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
251
+ return e;
252
+ }
253
+
254
+ function _setPrototypeOf(t, e) {
255
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
256
+ return t.__proto__ = e, t;
257
+ }, _setPrototypeOf(t, e);
258
+ }
259
+
260
+ function _inherits(t, e) {
261
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
262
+ t.prototype = Object.create(e && e.prototype, {
263
+ constructor: {
264
+ value: t,
265
+ writable: !0,
266
+ configurable: !0
267
+ }
268
+ }), Object.defineProperty(t, "prototype", {
269
+ writable: !1
270
+ }), e && _setPrototypeOf(t, e);
271
+ }
272
+
273
+ function _getPrototypeOf(t) {
274
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
275
+ return t.__proto__ || Object.getPrototypeOf(t);
276
+ }, _getPrototypeOf(t);
277
+ }
278
+
279
+ function _isNativeReflectConstruct() {
280
+ try {
281
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
282
+ } catch (t) {}
283
+ return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
284
+ return !!t;
285
+ })();
286
+ }
287
+
288
+ function _possibleConstructorReturn(t, e) {
289
+ if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
290
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
291
+ return _assertThisInitialized(t);
292
+ }
293
+
294
+ function _createSuper(t) {
295
+ var r = _isNativeReflectConstruct();
296
+ return function () {
297
+ var e,
298
+ o = _getPrototypeOf(t);
299
+ if (r) {
300
+ var s = _getPrototypeOf(this).constructor;
301
+ e = Reflect.construct(o, arguments, s);
302
+ } else e = o.apply(this, arguments);
303
+ return _possibleConstructorReturn(this, e);
304
+ };
305
+ }
306
+
307
+ function _classCallCheck(a, n) {
308
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
309
+ }
310
+
311
+ function toPrimitive(t, r) {
312
+ if ("object" != _typeof(t) || !t) return t;
313
+ var e = t[Symbol.toPrimitive];
314
+ if (void 0 !== e) {
315
+ var i = e.call(t, r || "default");
316
+ if ("object" != _typeof(i)) return i;
317
+ throw new TypeError("@@toPrimitive must return a primitive value.");
318
+ }
319
+ return ("string" === r ? String : Number)(t);
320
+ }
321
+
322
+ function toPropertyKey(t) {
323
+ var i = toPrimitive(t, "string");
324
+ return "symbol" == _typeof(i) ? i : i + "";
325
+ }
326
+
327
+ function _defineProperties(e, r) {
328
+ for (var t = 0; t < r.length; t++) {
329
+ var o = r[t];
330
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
331
+ }
332
+ }
333
+ function _createClass(e, r, t) {
334
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
335
+ writable: !1
336
+ }), e;
337
+ }
338
+
339
+ function _defineProperty(e, r, t) {
340
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
341
+ value: t,
342
+ enumerable: !0,
343
+ configurable: !0,
344
+ writable: !0
345
+ }) : e[r] = t, e;
346
+ }
347
+
348
+ var Setter = /*#__PURE__*/function () {
349
+ function Setter() {
350
+ _classCallCheck(this, Setter);
351
+ _defineProperty(this, "priority", void 0);
352
+ _defineProperty(this, "subPriority", 0);
353
+ }
354
+ _createClass(Setter, [{
355
+ key: "validate",
356
+ value: function validate(_utcDate, _options) {
357
+ return true;
358
+ }
359
+ }]);
360
+ return Setter;
361
+ }();
362
+ var ValueSetter = /*#__PURE__*/function (_Setter) {
363
+ _inherits(ValueSetter, _Setter);
364
+ var _super = _createSuper(ValueSetter);
365
+ function ValueSetter(value, validateValue, setValue, priority, subPriority) {
366
+ var _this;
367
+ _classCallCheck(this, ValueSetter);
368
+ _this = _super.call(this);
369
+ _this.value = value;
370
+ _this.validateValue = validateValue;
371
+ _this.setValue = setValue;
372
+ _this.priority = priority;
373
+ if (subPriority) {
374
+ _this.subPriority = subPriority;
375
+ }
376
+ return _this;
377
+ }
378
+ _createClass(ValueSetter, [{
379
+ key: "validate",
380
+ value: function validate(utcDate, options) {
381
+ return this.validateValue(utcDate, this.value, options);
382
+ }
383
+ }, {
384
+ key: "set",
385
+ value: function set(utcDate, flags, options) {
386
+ return this.setValue(utcDate, flags, this.value, options);
387
+ }
388
+ }]);
389
+ return ValueSetter;
390
+ }(Setter);
391
+
392
+ var Parser = /*#__PURE__*/function () {
393
+ function Parser() {
394
+ _classCallCheck(this, Parser);
395
+ _defineProperty(this, "incompatibleTokens", void 0);
396
+ _defineProperty(this, "priority", void 0);
397
+ _defineProperty(this, "subPriority", void 0);
398
+ }
399
+ _createClass(Parser, [{
400
+ key: "run",
401
+ value: function run(dateString, token, match, options) {
402
+ var result = this.parse(dateString, token, match, options);
403
+ if (!result) {
404
+ return null;
405
+ }
406
+ return {
407
+ setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
408
+ rest: result.rest
409
+ };
410
+ }
411
+ }, {
412
+ key: "validate",
413
+ value: function validate(_utcDate, _value, _options) {
414
+ return true;
415
+ }
416
+ }]);
417
+ return Parser;
418
+ }();
419
+
420
+ var EraParser = /*#__PURE__*/function (_Parser) {
421
+ _inherits(EraParser, _Parser);
422
+ var _super = _createSuper(EraParser);
423
+ function EraParser() {
424
+ var _this;
425
+ _classCallCheck(this, EraParser);
426
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
427
+ args[_key] = arguments[_key];
428
+ }
429
+ _this = _super.call.apply(_super, [this].concat(args));
430
+ _defineProperty(_assertThisInitialized(_this), "priority", 140);
431
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['R', 'u', 't', 'T']);
432
+ return _this;
433
+ }
434
+ _createClass(EraParser, [{
435
+ key: "parse",
436
+ value: function parse(dateString, token, match) {
437
+ switch (token) {
438
+ // AD, BC
439
+ case 'G':
440
+ case 'GG':
441
+ case 'GGG':
442
+ return match.era(dateString, {
443
+ width: 'abbreviated'
444
+ }) || match.era(dateString, {
445
+ width: 'narrow'
446
+ });
447
+ // A, B
448
+ case 'GGGGG':
449
+ return match.era(dateString, {
450
+ width: 'narrow'
451
+ });
452
+ // Anno Domini, Before Christ
453
+ case 'GGGG':
454
+ default:
455
+ return match.era(dateString, {
456
+ width: 'wide'
457
+ }) || match.era(dateString, {
458
+ width: 'abbreviated'
459
+ }) || match.era(dateString, {
460
+ width: 'narrow'
461
+ });
462
+ }
463
+ }
464
+ }, {
465
+ key: "set",
466
+ value: function set(date, flags, value) {
467
+ flags.era = value;
468
+ date.setUTCFullYear(value, 0, 1);
469
+ date.setUTCHours(0, 0, 0, 0);
470
+ return date;
471
+ }
472
+ }]);
473
+ return EraParser;
474
+ }(Parser);
475
+
476
+ var numericPatterns = {
477
+ month: /^(1[0-2]|0?\d)/,
478
+ // 0 to 12
479
+ date: /^(3[0-1]|[0-2]?\d)/,
480
+ // 0 to 31
481
+ dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
482
+ // 0 to 366
483
+ week: /^(5[0-3]|[0-4]?\d)/,
484
+ // 0 to 53
485
+ hour23h: /^(2[0-3]|[0-1]?\d)/,
486
+ // 0 to 23
487
+ hour24h: /^(2[0-4]|[0-1]?\d)/,
488
+ // 0 to 24
489
+ hour11h: /^(1[0-1]|0?\d)/,
490
+ // 0 to 11
491
+ hour12h: /^(1[0-2]|0?\d)/,
492
+ // 0 to 12
493
+ minute: /^[0-5]?\d/,
494
+ // 0 to 59
495
+ second: /^[0-5]?\d/,
496
+ // 0 to 59
497
+
498
+ singleDigit: /^\d/,
499
+ // 0 to 9
500
+ twoDigits: /^\d{1,2}/,
501
+ // 0 to 99
502
+ threeDigits: /^\d{1,3}/,
503
+ // 0 to 999
504
+ fourDigits: /^\d{1,4}/,
505
+ // 0 to 9999
506
+
507
+ anyDigitsSigned: /^-?\d+/,
508
+ singleDigitSigned: /^-?\d/,
509
+ // 0 to 9, -0 to -9
510
+ twoDigitsSigned: /^-?\d{1,2}/,
511
+ // 0 to 99, -0 to -99
512
+ threeDigitsSigned: /^-?\d{1,3}/,
513
+ // 0 to 999, -0 to -999
514
+ fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
515
+ };
516
+
517
+ var timezonePatterns = {
518
+ basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
519
+ basic: /^([+-])(\d{2})(\d{2})|Z/,
520
+ basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
521
+ extended: /^([+-])(\d{2}):(\d{2})|Z/,
522
+ extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
523
+ };
524
+
525
+ function mapValue(parseFnResult, mapFn) {
526
+ if (!parseFnResult) {
527
+ return parseFnResult;
528
+ }
529
+ return {
530
+ value: mapFn(parseFnResult.value),
531
+ rest: parseFnResult.rest
532
+ };
533
+ }
534
+ function parseNumericPattern(pattern, dateString) {
535
+ var matchResult = dateString.match(pattern);
536
+ if (!matchResult) {
537
+ return null;
538
+ }
539
+ return {
540
+ value: parseInt(matchResult[0], 10),
541
+ rest: dateString.slice(matchResult[0].length)
542
+ };
543
+ }
544
+ function parseTimezonePattern(pattern, dateString) {
545
+ var matchResult = dateString.match(pattern);
546
+ if (!matchResult) {
547
+ return null;
548
+ }
549
+
550
+ // Input is 'Z'
551
+ if (matchResult[0] === 'Z') {
552
+ return {
553
+ value: 0,
554
+ rest: dateString.slice(1)
555
+ };
556
+ }
557
+ var sign = matchResult[1] === '+' ? 1 : -1;
558
+ var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
559
+ var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
560
+ var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
561
+ return {
562
+ value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
563
+ rest: dateString.slice(matchResult[0].length)
564
+ };
565
+ }
566
+ function parseAnyDigitsSigned(dateString) {
567
+ return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
568
+ }
569
+ function parseNDigits(n, dateString) {
570
+ switch (n) {
571
+ case 1:
572
+ return parseNumericPattern(numericPatterns.singleDigit, dateString);
573
+ case 2:
574
+ return parseNumericPattern(numericPatterns.twoDigits, dateString);
575
+ case 3:
576
+ return parseNumericPattern(numericPatterns.threeDigits, dateString);
577
+ case 4:
578
+ return parseNumericPattern(numericPatterns.fourDigits, dateString);
579
+ default:
580
+ return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), dateString);
581
+ }
582
+ }
583
+ function parseNDigitsSigned(n, dateString) {
584
+ switch (n) {
585
+ case 1:
586
+ return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
587
+ case 2:
588
+ return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
589
+ case 3:
590
+ return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
591
+ case 4:
592
+ return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
593
+ default:
594
+ return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), dateString);
595
+ }
596
+ }
597
+ function dayPeriodEnumToHours(dayPeriod) {
598
+ switch (dayPeriod) {
599
+ case 'morning':
600
+ return 4;
601
+ case 'evening':
602
+ return 17;
603
+ case 'pm':
604
+ case 'noon':
605
+ case 'afternoon':
606
+ return 12;
607
+ case 'am':
608
+ case 'midnight':
609
+ case 'night':
610
+ default:
611
+ return 0;
612
+ }
613
+ }
614
+ function normalizeTwoDigitYear(twoDigitYear, currentYear) {
615
+ var isCommonEra = currentYear > 0;
616
+ // Absolute number of the current year:
617
+ // 1 -> 1 AC
618
+ // 0 -> 1 BC
619
+ // -1 -> 2 BC
620
+ var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
621
+ var result;
622
+ if (absCurrentYear <= 50) {
623
+ result = twoDigitYear || 100;
624
+ } else {
625
+ var rangeEnd = absCurrentYear + 50;
626
+ var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
627
+ var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
628
+ result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
629
+ }
630
+ return isCommonEra ? result : 1 - result;
631
+ }
632
+ function isLeapYearIndex(year) {
633
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
634
+ }
635
+
636
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
637
+ // | Year | y | yy | yyy | yyyy | yyyyy |
638
+ // |----------|-------|----|-------|-------|-------|
639
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
640
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
641
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
642
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
643
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
644
+ var YearParser = /*#__PURE__*/function (_Parser) {
645
+ _inherits(YearParser, _Parser);
646
+ var _super = _createSuper(YearParser);
647
+ function YearParser() {
648
+ var _this;
649
+ _classCallCheck(this, YearParser);
650
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
651
+ args[_key] = arguments[_key];
652
+ }
653
+ _this = _super.call.apply(_super, [this].concat(args));
654
+ _defineProperty(_assertThisInitialized(_this), "priority", 130);
655
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
656
+ return _this;
657
+ }
658
+ _createClass(YearParser, [{
659
+ key: "parse",
660
+ value: function parse(dateString, token, match) {
661
+ var valueCallback = function valueCallback(year) {
662
+ return {
663
+ year: year,
664
+ isTwoDigitYear: token === 'yy'
665
+ };
666
+ };
667
+ switch (token) {
668
+ case 'y':
669
+ return mapValue(parseNDigits(4, dateString), valueCallback);
670
+ case 'yo':
671
+ return mapValue(match.ordinalNumber(dateString, {
672
+ unit: 'year'
673
+ }), valueCallback);
674
+ default:
675
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
676
+ }
677
+ }
678
+ }, {
679
+ key: "validate",
680
+ value: function validate(_date, value) {
681
+ return value.isTwoDigitYear || value.year > 0;
682
+ }
683
+ }, {
684
+ key: "set",
685
+ value: function set(date, flags, value) {
686
+ var currentYear = date.getUTCFullYear();
687
+ if (value.isTwoDigitYear) {
688
+ var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
689
+ date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
690
+ date.setUTCHours(0, 0, 0, 0);
691
+ return date;
692
+ }
693
+ var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
694
+ date.setUTCFullYear(year, 0, 1);
695
+ date.setUTCHours(0, 0, 0, 0);
696
+ return date;
697
+ }
698
+ }]);
699
+ return YearParser;
700
+ }(Parser);
701
+
702
+ // Local week-numbering year
703
+ var LocalWeekYearParser = /*#__PURE__*/function (_Parser) {
704
+ _inherits(LocalWeekYearParser, _Parser);
705
+ var _super = _createSuper(LocalWeekYearParser);
706
+ function LocalWeekYearParser() {
707
+ var _this;
708
+ _classCallCheck(this, LocalWeekYearParser);
709
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
710
+ args[_key] = arguments[_key];
711
+ }
712
+ _this = _super.call.apply(_super, [this].concat(args));
713
+ _defineProperty(_assertThisInitialized(_this), "priority", 130);
714
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
715
+ return _this;
716
+ }
717
+ _createClass(LocalWeekYearParser, [{
718
+ key: "parse",
719
+ value: function parse(dateString, token, match) {
720
+ var valueCallback = function valueCallback(year) {
721
+ return {
722
+ year: year,
723
+ isTwoDigitYear: token === 'YY'
724
+ };
725
+ };
726
+ switch (token) {
727
+ case 'Y':
728
+ return mapValue(parseNDigits(4, dateString), valueCallback);
729
+ case 'Yo':
730
+ return mapValue(match.ordinalNumber(dateString, {
731
+ unit: 'year'
732
+ }), valueCallback);
733
+ default:
734
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
735
+ }
736
+ }
737
+ }, {
738
+ key: "validate",
739
+ value: function validate(_date, value) {
740
+ return value.isTwoDigitYear || value.year > 0;
741
+ }
742
+ }, {
743
+ key: "set",
744
+ value: function set(date, flags, value, options) {
745
+ var currentYear = getUTCWeekYear(date, options);
746
+ if (value.isTwoDigitYear) {
747
+ var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
748
+ date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
749
+ date.setUTCHours(0, 0, 0, 0);
750
+ return startOfUTCWeek(date, options);
751
+ }
752
+ var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
753
+ date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
754
+ date.setUTCHours(0, 0, 0, 0);
755
+ return startOfUTCWeek(date, options);
756
+ }
757
+ }]);
758
+ return LocalWeekYearParser;
759
+ }(Parser);
760
+
761
+ var ISOWeekYearParser = /*#__PURE__*/function (_Parser) {
762
+ _inherits(ISOWeekYearParser, _Parser);
763
+ var _super = _createSuper(ISOWeekYearParser);
764
+ function ISOWeekYearParser() {
765
+ var _this;
766
+ _classCallCheck(this, ISOWeekYearParser);
767
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
768
+ args[_key] = arguments[_key];
769
+ }
770
+ _this = _super.call.apply(_super, [this].concat(args));
771
+ _defineProperty(_assertThisInitialized(_this), "priority", 130);
772
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
773
+ return _this;
774
+ }
775
+ _createClass(ISOWeekYearParser, [{
776
+ key: "parse",
777
+ value: function parse(dateString, token) {
778
+ if (token === 'R') {
779
+ return parseNDigitsSigned(4, dateString);
780
+ }
781
+ return parseNDigitsSigned(token.length, dateString);
782
+ }
783
+ }, {
784
+ key: "set",
785
+ value: function set(_date, _flags, value) {
786
+ var firstWeekOfYear = new Date(0);
787
+ firstWeekOfYear.setUTCFullYear(value, 0, 4);
788
+ firstWeekOfYear.setUTCHours(0, 0, 0, 0);
789
+ return startOfUTCISOWeek(firstWeekOfYear);
790
+ }
791
+ }]);
792
+ return ISOWeekYearParser;
793
+ }(Parser);
794
+
795
+ var ExtendedYearParser = /*#__PURE__*/function (_Parser) {
796
+ _inherits(ExtendedYearParser, _Parser);
797
+ var _super = _createSuper(ExtendedYearParser);
798
+ function ExtendedYearParser() {
799
+ var _this;
800
+ _classCallCheck(this, ExtendedYearParser);
801
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
802
+ args[_key] = arguments[_key];
803
+ }
804
+ _this = _super.call.apply(_super, [this].concat(args));
805
+ _defineProperty(_assertThisInitialized(_this), "priority", 130);
806
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
807
+ return _this;
808
+ }
809
+ _createClass(ExtendedYearParser, [{
810
+ key: "parse",
811
+ value: function parse(dateString, token) {
812
+ if (token === 'u') {
813
+ return parseNDigitsSigned(4, dateString);
814
+ }
815
+ return parseNDigitsSigned(token.length, dateString);
816
+ }
817
+ }, {
818
+ key: "set",
819
+ value: function set(date, _flags, value) {
820
+ date.setUTCFullYear(value, 0, 1);
821
+ date.setUTCHours(0, 0, 0, 0);
822
+ return date;
823
+ }
824
+ }]);
825
+ return ExtendedYearParser;
826
+ }(Parser);
827
+
828
+ var QuarterParser = /*#__PURE__*/function (_Parser) {
829
+ _inherits(QuarterParser, _Parser);
830
+ var _super = _createSuper(QuarterParser);
831
+ function QuarterParser() {
832
+ var _this;
833
+ _classCallCheck(this, QuarterParser);
834
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
835
+ args[_key] = arguments[_key];
836
+ }
837
+ _this = _super.call.apply(_super, [this].concat(args));
838
+ _defineProperty(_assertThisInitialized(_this), "priority", 120);
839
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
840
+ return _this;
841
+ }
842
+ _createClass(QuarterParser, [{
843
+ key: "parse",
844
+ value: function parse(dateString, token, match) {
845
+ switch (token) {
846
+ // 1, 2, 3, 4
847
+ case 'Q':
848
+ case 'QQ':
849
+ // 01, 02, 03, 04
850
+ return parseNDigits(token.length, dateString);
851
+ // 1st, 2nd, 3rd, 4th
852
+ case 'Qo':
853
+ return match.ordinalNumber(dateString, {
854
+ unit: 'quarter'
855
+ });
856
+ // Q1, Q2, Q3, Q4
857
+ case 'QQQ':
858
+ return match.quarter(dateString, {
859
+ width: 'abbreviated',
860
+ context: 'formatting'
861
+ }) || match.quarter(dateString, {
862
+ width: 'narrow',
863
+ context: 'formatting'
864
+ });
865
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
866
+ case 'QQQQQ':
867
+ return match.quarter(dateString, {
868
+ width: 'narrow',
869
+ context: 'formatting'
870
+ });
871
+ // 1st quarter, 2nd quarter, ...
872
+ case 'QQQQ':
873
+ default:
874
+ return match.quarter(dateString, {
875
+ width: 'wide',
876
+ context: 'formatting'
877
+ }) || match.quarter(dateString, {
878
+ width: 'abbreviated',
879
+ context: 'formatting'
880
+ }) || match.quarter(dateString, {
881
+ width: 'narrow',
882
+ context: 'formatting'
883
+ });
884
+ }
885
+ }
886
+ }, {
887
+ key: "validate",
888
+ value: function validate(_date, value) {
889
+ return value >= 1 && value <= 4;
890
+ }
891
+ }, {
892
+ key: "set",
893
+ value: function set(date, _flags, value) {
894
+ date.setUTCMonth((value - 1) * 3, 1);
895
+ date.setUTCHours(0, 0, 0, 0);
896
+ return date;
897
+ }
898
+ }]);
899
+ return QuarterParser;
900
+ }(Parser);
901
+
902
+ var StandAloneQuarterParser = /*#__PURE__*/function (_Parser) {
903
+ _inherits(StandAloneQuarterParser, _Parser);
904
+ var _super = _createSuper(StandAloneQuarterParser);
905
+ function StandAloneQuarterParser() {
906
+ var _this;
907
+ _classCallCheck(this, StandAloneQuarterParser);
908
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
909
+ args[_key] = arguments[_key];
910
+ }
911
+ _this = _super.call.apply(_super, [this].concat(args));
912
+ _defineProperty(_assertThisInitialized(_this), "priority", 120);
913
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
914
+ return _this;
915
+ }
916
+ _createClass(StandAloneQuarterParser, [{
917
+ key: "parse",
918
+ value: function parse(dateString, token, match) {
919
+ switch (token) {
920
+ // 1, 2, 3, 4
921
+ case 'q':
922
+ case 'qq':
923
+ // 01, 02, 03, 04
924
+ return parseNDigits(token.length, dateString);
925
+ // 1st, 2nd, 3rd, 4th
926
+ case 'qo':
927
+ return match.ordinalNumber(dateString, {
928
+ unit: 'quarter'
929
+ });
930
+ // Q1, Q2, Q3, Q4
931
+ case 'qqq':
932
+ return match.quarter(dateString, {
933
+ width: 'abbreviated',
934
+ context: 'standalone'
935
+ }) || match.quarter(dateString, {
936
+ width: 'narrow',
937
+ context: 'standalone'
938
+ });
939
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
940
+ case 'qqqqq':
941
+ return match.quarter(dateString, {
942
+ width: 'narrow',
943
+ context: 'standalone'
944
+ });
945
+ // 1st quarter, 2nd quarter, ...
946
+ case 'qqqq':
947
+ default:
948
+ return match.quarter(dateString, {
949
+ width: 'wide',
950
+ context: 'standalone'
951
+ }) || match.quarter(dateString, {
952
+ width: 'abbreviated',
953
+ context: 'standalone'
954
+ }) || match.quarter(dateString, {
955
+ width: 'narrow',
956
+ context: 'standalone'
957
+ });
958
+ }
959
+ }
960
+ }, {
961
+ key: "validate",
962
+ value: function validate(_date, value) {
963
+ return value >= 1 && value <= 4;
964
+ }
965
+ }, {
966
+ key: "set",
967
+ value: function set(date, _flags, value) {
968
+ date.setUTCMonth((value - 1) * 3, 1);
969
+ date.setUTCHours(0, 0, 0, 0);
970
+ return date;
971
+ }
972
+ }]);
973
+ return StandAloneQuarterParser;
974
+ }(Parser);
975
+
976
+ var MonthParser = /*#__PURE__*/function (_Parser) {
977
+ _inherits(MonthParser, _Parser);
978
+ var _super = _createSuper(MonthParser);
979
+ function MonthParser() {
980
+ var _this;
981
+ _classCallCheck(this, MonthParser);
982
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
983
+ args[_key] = arguments[_key];
984
+ }
985
+ _this = _super.call.apply(_super, [this].concat(args));
986
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
987
+ _defineProperty(_assertThisInitialized(_this), "priority", 110);
988
+ return _this;
989
+ }
990
+ _createClass(MonthParser, [{
991
+ key: "parse",
992
+ value: function parse(dateString, token, match) {
993
+ var valueCallback = function valueCallback(value) {
994
+ return value - 1;
995
+ };
996
+ switch (token) {
997
+ // 1, 2, ..., 12
998
+ case 'M':
999
+ return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
1000
+ // 01, 02, ..., 12
1001
+ case 'MM':
1002
+ return mapValue(parseNDigits(2, dateString), valueCallback);
1003
+ // 1st, 2nd, ..., 12th
1004
+ case 'Mo':
1005
+ return mapValue(match.ordinalNumber(dateString, {
1006
+ unit: 'month'
1007
+ }), valueCallback);
1008
+ // Jan, Feb, ..., Dec
1009
+ case 'MMM':
1010
+ return match.month(dateString, {
1011
+ width: 'abbreviated',
1012
+ context: 'formatting'
1013
+ }) || match.month(dateString, {
1014
+ width: 'narrow',
1015
+ context: 'formatting'
1016
+ });
1017
+ // J, F, ..., D
1018
+ case 'MMMMM':
1019
+ return match.month(dateString, {
1020
+ width: 'narrow',
1021
+ context: 'formatting'
1022
+ });
1023
+ // January, February, ..., December
1024
+ case 'MMMM':
1025
+ default:
1026
+ return match.month(dateString, {
1027
+ width: 'wide',
1028
+ context: 'formatting'
1029
+ }) || match.month(dateString, {
1030
+ width: 'abbreviated',
1031
+ context: 'formatting'
1032
+ }) || match.month(dateString, {
1033
+ width: 'narrow',
1034
+ context: 'formatting'
1035
+ });
1036
+ }
1037
+ }
1038
+ }, {
1039
+ key: "validate",
1040
+ value: function validate(_date, value) {
1041
+ return value >= 0 && value <= 11;
1042
+ }
1043
+ }, {
1044
+ key: "set",
1045
+ value: function set(date, _flags, value) {
1046
+ date.setUTCMonth(value, 1);
1047
+ date.setUTCHours(0, 0, 0, 0);
1048
+ return date;
1049
+ }
1050
+ }]);
1051
+ return MonthParser;
1052
+ }(Parser);
1053
+
1054
+ var StandAloneMonthParser = /*#__PURE__*/function (_Parser) {
1055
+ _inherits(StandAloneMonthParser, _Parser);
1056
+ var _super = _createSuper(StandAloneMonthParser);
1057
+ function StandAloneMonthParser() {
1058
+ var _this;
1059
+ _classCallCheck(this, StandAloneMonthParser);
1060
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1061
+ args[_key] = arguments[_key];
1062
+ }
1063
+ _this = _super.call.apply(_super, [this].concat(args));
1064
+ _defineProperty(_assertThisInitialized(_this), "priority", 110);
1065
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
1066
+ return _this;
1067
+ }
1068
+ _createClass(StandAloneMonthParser, [{
1069
+ key: "parse",
1070
+ value: function parse(dateString, token, match) {
1071
+ var valueCallback = function valueCallback(value) {
1072
+ return value - 1;
1073
+ };
1074
+ switch (token) {
1075
+ // 1, 2, ..., 12
1076
+ case 'L':
1077
+ return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
1078
+ // 01, 02, ..., 12
1079
+ case 'LL':
1080
+ return mapValue(parseNDigits(2, dateString), valueCallback);
1081
+ // 1st, 2nd, ..., 12th
1082
+ case 'Lo':
1083
+ return mapValue(match.ordinalNumber(dateString, {
1084
+ unit: 'month'
1085
+ }), valueCallback);
1086
+ // Jan, Feb, ..., Dec
1087
+ case 'LLL':
1088
+ return match.month(dateString, {
1089
+ width: 'abbreviated',
1090
+ context: 'standalone'
1091
+ }) || match.month(dateString, {
1092
+ width: 'narrow',
1093
+ context: 'standalone'
1094
+ });
1095
+ // J, F, ..., D
1096
+ case 'LLLLL':
1097
+ return match.month(dateString, {
1098
+ width: 'narrow',
1099
+ context: 'standalone'
1100
+ });
1101
+ // January, February, ..., December
1102
+ case 'LLLL':
1103
+ default:
1104
+ return match.month(dateString, {
1105
+ width: 'wide',
1106
+ context: 'standalone'
1107
+ }) || match.month(dateString, {
1108
+ width: 'abbreviated',
1109
+ context: 'standalone'
1110
+ }) || match.month(dateString, {
1111
+ width: 'narrow',
1112
+ context: 'standalone'
1113
+ });
1114
+ }
1115
+ }
1116
+ }, {
1117
+ key: "validate",
1118
+ value: function validate(_date, value) {
1119
+ return value >= 0 && value <= 11;
1120
+ }
1121
+ }, {
1122
+ key: "set",
1123
+ value: function set(date, _flags, value) {
1124
+ date.setUTCMonth(value, 1);
1125
+ date.setUTCHours(0, 0, 0, 0);
1126
+ return date;
1127
+ }
1128
+ }]);
1129
+ return StandAloneMonthParser;
1130
+ }(Parser);
1131
+
1132
+ function setUTCWeek(dirtyDate, dirtyWeek, options) {
1133
+ requiredArgs(2, arguments);
1134
+ var date = toDate(dirtyDate);
1135
+ var week = toInteger(dirtyWeek);
1136
+ var diff = getUTCWeek(date, options) - week;
1137
+ date.setUTCDate(date.getUTCDate() - diff * 7);
1138
+ return date;
1139
+ }
1140
+
1141
+ var LocalWeekParser = /*#__PURE__*/function (_Parser) {
1142
+ _inherits(LocalWeekParser, _Parser);
1143
+ var _super = _createSuper(LocalWeekParser);
1144
+ function LocalWeekParser() {
1145
+ var _this;
1146
+ _classCallCheck(this, LocalWeekParser);
1147
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1148
+ args[_key] = arguments[_key];
1149
+ }
1150
+ _this = _super.call.apply(_super, [this].concat(args));
1151
+ _defineProperty(_assertThisInitialized(_this), "priority", 100);
1152
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
1153
+ return _this;
1154
+ }
1155
+ _createClass(LocalWeekParser, [{
1156
+ key: "parse",
1157
+ value: function parse(dateString, token, match) {
1158
+ switch (token) {
1159
+ case 'w':
1160
+ return parseNumericPattern(numericPatterns.week, dateString);
1161
+ case 'wo':
1162
+ return match.ordinalNumber(dateString, {
1163
+ unit: 'week'
1164
+ });
1165
+ default:
1166
+ return parseNDigits(token.length, dateString);
1167
+ }
1168
+ }
1169
+ }, {
1170
+ key: "validate",
1171
+ value: function validate(_date, value) {
1172
+ return value >= 1 && value <= 53;
1173
+ }
1174
+ }, {
1175
+ key: "set",
1176
+ value: function set(date, _flags, value, options) {
1177
+ return startOfUTCWeek(setUTCWeek(date, value, options), options);
1178
+ }
1179
+ }]);
1180
+ return LocalWeekParser;
1181
+ }(Parser);
1182
+
1183
+ function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
1184
+ requiredArgs(2, arguments);
1185
+ var date = toDate(dirtyDate);
1186
+ var isoWeek = toInteger(dirtyISOWeek);
1187
+ var diff = getUTCISOWeek(date) - isoWeek;
1188
+ date.setUTCDate(date.getUTCDate() - diff * 7);
1189
+ return date;
1190
+ }
1191
+
1192
+ var ISOWeekParser = /*#__PURE__*/function (_Parser) {
1193
+ _inherits(ISOWeekParser, _Parser);
1194
+ var _super = _createSuper(ISOWeekParser);
1195
+ function ISOWeekParser() {
1196
+ var _this;
1197
+ _classCallCheck(this, ISOWeekParser);
1198
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1199
+ args[_key] = arguments[_key];
1200
+ }
1201
+ _this = _super.call.apply(_super, [this].concat(args));
1202
+ _defineProperty(_assertThisInitialized(_this), "priority", 100);
1203
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
1204
+ return _this;
1205
+ }
1206
+ _createClass(ISOWeekParser, [{
1207
+ key: "parse",
1208
+ value: function parse(dateString, token, match) {
1209
+ switch (token) {
1210
+ case 'I':
1211
+ return parseNumericPattern(numericPatterns.week, dateString);
1212
+ case 'Io':
1213
+ return match.ordinalNumber(dateString, {
1214
+ unit: 'week'
1215
+ });
1216
+ default:
1217
+ return parseNDigits(token.length, dateString);
1218
+ }
1219
+ }
1220
+ }, {
1221
+ key: "validate",
1222
+ value: function validate(_date, value) {
1223
+ return value >= 1 && value <= 53;
1224
+ }
1225
+ }, {
1226
+ key: "set",
1227
+ value: function set(date, _flags, value) {
1228
+ return startOfUTCISOWeek(setUTCISOWeek(date, value));
1229
+ }
1230
+ }]);
1231
+ return ISOWeekParser;
1232
+ }(Parser);
1233
+
1234
+ var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1235
+ var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1236
+
1237
+ // Day of the month
1238
+ var DateParser = /*#__PURE__*/function (_Parser) {
1239
+ _inherits(DateParser, _Parser);
1240
+ var _super = _createSuper(DateParser);
1241
+ function DateParser() {
1242
+ var _this;
1243
+ _classCallCheck(this, DateParser);
1244
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1245
+ args[_key] = arguments[_key];
1246
+ }
1247
+ _this = _super.call.apply(_super, [this].concat(args));
1248
+ _defineProperty(_assertThisInitialized(_this), "priority", 90);
1249
+ _defineProperty(_assertThisInitialized(_this), "subPriority", 1);
1250
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
1251
+ return _this;
1252
+ }
1253
+ _createClass(DateParser, [{
1254
+ key: "parse",
1255
+ value: function parse(dateString, token, match) {
1256
+ switch (token) {
1257
+ case 'd':
1258
+ return parseNumericPattern(numericPatterns.date, dateString);
1259
+ case 'do':
1260
+ return match.ordinalNumber(dateString, {
1261
+ unit: 'date'
1262
+ });
1263
+ default:
1264
+ return parseNDigits(token.length, dateString);
1265
+ }
1266
+ }
1267
+ }, {
1268
+ key: "validate",
1269
+ value: function validate(date, value) {
1270
+ var year = date.getUTCFullYear();
1271
+ var isLeapYear = isLeapYearIndex(year);
1272
+ var month = date.getUTCMonth();
1273
+ if (isLeapYear) {
1274
+ return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
1275
+ } else {
1276
+ return value >= 1 && value <= DAYS_IN_MONTH[month];
1277
+ }
1278
+ }
1279
+ }, {
1280
+ key: "set",
1281
+ value: function set(date, _flags, value) {
1282
+ date.setUTCDate(value);
1283
+ date.setUTCHours(0, 0, 0, 0);
1284
+ return date;
1285
+ }
1286
+ }]);
1287
+ return DateParser;
1288
+ }(Parser);
1289
+
1290
+ var DayOfYearParser = /*#__PURE__*/function (_Parser) {
1291
+ _inherits(DayOfYearParser, _Parser);
1292
+ var _super = _createSuper(DayOfYearParser);
1293
+ function DayOfYearParser() {
1294
+ var _this;
1295
+ _classCallCheck(this, DayOfYearParser);
1296
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1297
+ args[_key] = arguments[_key];
1298
+ }
1299
+ _this = _super.call.apply(_super, [this].concat(args));
1300
+ _defineProperty(_assertThisInitialized(_this), "priority", 90);
1301
+ _defineProperty(_assertThisInitialized(_this), "subpriority", 1);
1302
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']);
1303
+ return _this;
1304
+ }
1305
+ _createClass(DayOfYearParser, [{
1306
+ key: "parse",
1307
+ value: function parse(dateString, token, match) {
1308
+ switch (token) {
1309
+ case 'D':
1310
+ case 'DD':
1311
+ return parseNumericPattern(numericPatterns.dayOfYear, dateString);
1312
+ case 'Do':
1313
+ return match.ordinalNumber(dateString, {
1314
+ unit: 'date'
1315
+ });
1316
+ default:
1317
+ return parseNDigits(token.length, dateString);
1318
+ }
1319
+ }
1320
+ }, {
1321
+ key: "validate",
1322
+ value: function validate(date, value) {
1323
+ var year = date.getUTCFullYear();
1324
+ var isLeapYear = isLeapYearIndex(year);
1325
+ if (isLeapYear) {
1326
+ return value >= 1 && value <= 366;
1327
+ } else {
1328
+ return value >= 1 && value <= 365;
1329
+ }
1330
+ }
1331
+ }, {
1332
+ key: "set",
1333
+ value: function set(date, _flags, value) {
1334
+ date.setUTCMonth(0, value);
1335
+ date.setUTCHours(0, 0, 0, 0);
1336
+ return date;
1337
+ }
1338
+ }]);
1339
+ return DayOfYearParser;
1340
+ }(Parser);
1341
+
1342
+ function setUTCDay(dirtyDate, dirtyDay, options) {
1343
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
1344
+ requiredArgs(2, arguments);
1345
+ var defaultOptions = getDefaultOptions();
1346
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
1347
+
1348
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
1349
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
1350
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
1351
+ }
1352
+ var date = toDate(dirtyDate);
1353
+ var day = toInteger(dirtyDay);
1354
+ var currentDay = date.getUTCDay();
1355
+ var remainder = day % 7;
1356
+ var dayIndex = (remainder + 7) % 7;
1357
+ var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
1358
+ date.setUTCDate(date.getUTCDate() + diff);
1359
+ return date;
1360
+ }
1361
+
1362
+ var DayParser = /*#__PURE__*/function (_Parser) {
1363
+ _inherits(DayParser, _Parser);
1364
+ var _super = _createSuper(DayParser);
1365
+ function DayParser() {
1366
+ var _this;
1367
+ _classCallCheck(this, DayParser);
1368
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1369
+ args[_key] = arguments[_key];
1370
+ }
1371
+ _this = _super.call.apply(_super, [this].concat(args));
1372
+ _defineProperty(_assertThisInitialized(_this), "priority", 90);
1373
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['D', 'i', 'e', 'c', 't', 'T']);
1374
+ return _this;
1375
+ }
1376
+ _createClass(DayParser, [{
1377
+ key: "parse",
1378
+ value: function parse(dateString, token, match) {
1379
+ switch (token) {
1380
+ // Tue
1381
+ case 'E':
1382
+ case 'EE':
1383
+ case 'EEE':
1384
+ return match.day(dateString, {
1385
+ width: 'abbreviated',
1386
+ context: 'formatting'
1387
+ }) || match.day(dateString, {
1388
+ width: 'short',
1389
+ context: 'formatting'
1390
+ }) || match.day(dateString, {
1391
+ width: 'narrow',
1392
+ context: 'formatting'
1393
+ });
1394
+ // T
1395
+ case 'EEEEE':
1396
+ return match.day(dateString, {
1397
+ width: 'narrow',
1398
+ context: 'formatting'
1399
+ });
1400
+ // Tu
1401
+ case 'EEEEEE':
1402
+ return match.day(dateString, {
1403
+ width: 'short',
1404
+ context: 'formatting'
1405
+ }) || match.day(dateString, {
1406
+ width: 'narrow',
1407
+ context: 'formatting'
1408
+ });
1409
+ // Tuesday
1410
+ case 'EEEE':
1411
+ default:
1412
+ return match.day(dateString, {
1413
+ width: 'wide',
1414
+ context: 'formatting'
1415
+ }) || match.day(dateString, {
1416
+ width: 'abbreviated',
1417
+ context: 'formatting'
1418
+ }) || match.day(dateString, {
1419
+ width: 'short',
1420
+ context: 'formatting'
1421
+ }) || match.day(dateString, {
1422
+ width: 'narrow',
1423
+ context: 'formatting'
1424
+ });
1425
+ }
1426
+ }
1427
+ }, {
1428
+ key: "validate",
1429
+ value: function validate(_date, value) {
1430
+ return value >= 0 && value <= 6;
1431
+ }
1432
+ }, {
1433
+ key: "set",
1434
+ value: function set(date, _flags, value, options) {
1435
+ date = setUTCDay(date, value, options);
1436
+ date.setUTCHours(0, 0, 0, 0);
1437
+ return date;
1438
+ }
1439
+ }]);
1440
+ return DayParser;
1441
+ }(Parser);
1442
+
1443
+ var LocalDayParser = /*#__PURE__*/function (_Parser) {
1444
+ _inherits(LocalDayParser, _Parser);
1445
+ var _super = _createSuper(LocalDayParser);
1446
+ function LocalDayParser() {
1447
+ var _this;
1448
+ _classCallCheck(this, LocalDayParser);
1449
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1450
+ args[_key] = arguments[_key];
1451
+ }
1452
+ _this = _super.call.apply(_super, [this].concat(args));
1453
+ _defineProperty(_assertThisInitialized(_this), "priority", 90);
1454
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']);
1455
+ return _this;
1456
+ }
1457
+ _createClass(LocalDayParser, [{
1458
+ key: "parse",
1459
+ value: function parse(dateString, token, match, options) {
1460
+ var valueCallback = function valueCallback(value) {
1461
+ var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
1462
+ return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
1463
+ };
1464
+ switch (token) {
1465
+ // 3
1466
+ case 'e':
1467
+ case 'ee':
1468
+ // 03
1469
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
1470
+ // 3rd
1471
+ case 'eo':
1472
+ return mapValue(match.ordinalNumber(dateString, {
1473
+ unit: 'day'
1474
+ }), valueCallback);
1475
+ // Tue
1476
+ case 'eee':
1477
+ return match.day(dateString, {
1478
+ width: 'abbreviated',
1479
+ context: 'formatting'
1480
+ }) || match.day(dateString, {
1481
+ width: 'short',
1482
+ context: 'formatting'
1483
+ }) || match.day(dateString, {
1484
+ width: 'narrow',
1485
+ context: 'formatting'
1486
+ });
1487
+ // T
1488
+ case 'eeeee':
1489
+ return match.day(dateString, {
1490
+ width: 'narrow',
1491
+ context: 'formatting'
1492
+ });
1493
+ // Tu
1494
+ case 'eeeeee':
1495
+ return match.day(dateString, {
1496
+ width: 'short',
1497
+ context: 'formatting'
1498
+ }) || match.day(dateString, {
1499
+ width: 'narrow',
1500
+ context: 'formatting'
1501
+ });
1502
+ // Tuesday
1503
+ case 'eeee':
1504
+ default:
1505
+ return match.day(dateString, {
1506
+ width: 'wide',
1507
+ context: 'formatting'
1508
+ }) || match.day(dateString, {
1509
+ width: 'abbreviated',
1510
+ context: 'formatting'
1511
+ }) || match.day(dateString, {
1512
+ width: 'short',
1513
+ context: 'formatting'
1514
+ }) || match.day(dateString, {
1515
+ width: 'narrow',
1516
+ context: 'formatting'
1517
+ });
1518
+ }
1519
+ }
1520
+ }, {
1521
+ key: "validate",
1522
+ value: function validate(_date, value) {
1523
+ return value >= 0 && value <= 6;
1524
+ }
1525
+ }, {
1526
+ key: "set",
1527
+ value: function set(date, _flags, value, options) {
1528
+ date = setUTCDay(date, value, options);
1529
+ date.setUTCHours(0, 0, 0, 0);
1530
+ return date;
1531
+ }
1532
+ }]);
1533
+ return LocalDayParser;
1534
+ }(Parser);
1535
+
1536
+ var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser) {
1537
+ _inherits(StandAloneLocalDayParser, _Parser);
1538
+ var _super = _createSuper(StandAloneLocalDayParser);
1539
+ function StandAloneLocalDayParser() {
1540
+ var _this;
1541
+ _classCallCheck(this, StandAloneLocalDayParser);
1542
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1543
+ args[_key] = arguments[_key];
1544
+ }
1545
+ _this = _super.call.apply(_super, [this].concat(args));
1546
+ _defineProperty(_assertThisInitialized(_this), "priority", 90);
1547
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']);
1548
+ return _this;
1549
+ }
1550
+ _createClass(StandAloneLocalDayParser, [{
1551
+ key: "parse",
1552
+ value: function parse(dateString, token, match, options) {
1553
+ var valueCallback = function valueCallback(value) {
1554
+ var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
1555
+ return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
1556
+ };
1557
+ switch (token) {
1558
+ // 3
1559
+ case 'c':
1560
+ case 'cc':
1561
+ // 03
1562
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
1563
+ // 3rd
1564
+ case 'co':
1565
+ return mapValue(match.ordinalNumber(dateString, {
1566
+ unit: 'day'
1567
+ }), valueCallback);
1568
+ // Tue
1569
+ case 'ccc':
1570
+ return match.day(dateString, {
1571
+ width: 'abbreviated',
1572
+ context: 'standalone'
1573
+ }) || match.day(dateString, {
1574
+ width: 'short',
1575
+ context: 'standalone'
1576
+ }) || match.day(dateString, {
1577
+ width: 'narrow',
1578
+ context: 'standalone'
1579
+ });
1580
+ // T
1581
+ case 'ccccc':
1582
+ return match.day(dateString, {
1583
+ width: 'narrow',
1584
+ context: 'standalone'
1585
+ });
1586
+ // Tu
1587
+ case 'cccccc':
1588
+ return match.day(dateString, {
1589
+ width: 'short',
1590
+ context: 'standalone'
1591
+ }) || match.day(dateString, {
1592
+ width: 'narrow',
1593
+ context: 'standalone'
1594
+ });
1595
+ // Tuesday
1596
+ case 'cccc':
1597
+ default:
1598
+ return match.day(dateString, {
1599
+ width: 'wide',
1600
+ context: 'standalone'
1601
+ }) || match.day(dateString, {
1602
+ width: 'abbreviated',
1603
+ context: 'standalone'
1604
+ }) || match.day(dateString, {
1605
+ width: 'short',
1606
+ context: 'standalone'
1607
+ }) || match.day(dateString, {
1608
+ width: 'narrow',
1609
+ context: 'standalone'
1610
+ });
1611
+ }
1612
+ }
1613
+ }, {
1614
+ key: "validate",
1615
+ value: function validate(_date, value) {
1616
+ return value >= 0 && value <= 6;
1617
+ }
1618
+ }, {
1619
+ key: "set",
1620
+ value: function set(date, _flags, value, options) {
1621
+ date = setUTCDay(date, value, options);
1622
+ date.setUTCHours(0, 0, 0, 0);
1623
+ return date;
1624
+ }
1625
+ }]);
1626
+ return StandAloneLocalDayParser;
1627
+ }(Parser);
1628
+
1629
+ function setUTCISODay(dirtyDate, dirtyDay) {
1630
+ requiredArgs(2, arguments);
1631
+ var day = toInteger(dirtyDay);
1632
+ if (day % 7 === 0) {
1633
+ day = day - 7;
1634
+ }
1635
+ var weekStartsOn = 1;
1636
+ var date = toDate(dirtyDate);
1637
+ var currentDay = date.getUTCDay();
1638
+ var remainder = day % 7;
1639
+ var dayIndex = (remainder + 7) % 7;
1640
+ var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
1641
+ date.setUTCDate(date.getUTCDate() + diff);
1642
+ return date;
1643
+ }
1644
+
1645
+ var ISODayParser = /*#__PURE__*/function (_Parser) {
1646
+ _inherits(ISODayParser, _Parser);
1647
+ var _super = _createSuper(ISODayParser);
1648
+ function ISODayParser() {
1649
+ var _this;
1650
+ _classCallCheck(this, ISODayParser);
1651
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1652
+ args[_key] = arguments[_key];
1653
+ }
1654
+ _this = _super.call.apply(_super, [this].concat(args));
1655
+ _defineProperty(_assertThisInitialized(_this), "priority", 90);
1656
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']);
1657
+ return _this;
1658
+ }
1659
+ _createClass(ISODayParser, [{
1660
+ key: "parse",
1661
+ value: function parse(dateString, token, match) {
1662
+ var valueCallback = function valueCallback(value) {
1663
+ if (value === 0) {
1664
+ return 7;
1665
+ }
1666
+ return value;
1667
+ };
1668
+ switch (token) {
1669
+ // 2
1670
+ case 'i':
1671
+ case 'ii':
1672
+ // 02
1673
+ return parseNDigits(token.length, dateString);
1674
+ // 2nd
1675
+ case 'io':
1676
+ return match.ordinalNumber(dateString, {
1677
+ unit: 'day'
1678
+ });
1679
+ // Tue
1680
+ case 'iii':
1681
+ return mapValue(match.day(dateString, {
1682
+ width: 'abbreviated',
1683
+ context: 'formatting'
1684
+ }) || match.day(dateString, {
1685
+ width: 'short',
1686
+ context: 'formatting'
1687
+ }) || match.day(dateString, {
1688
+ width: 'narrow',
1689
+ context: 'formatting'
1690
+ }), valueCallback);
1691
+ // T
1692
+ case 'iiiii':
1693
+ return mapValue(match.day(dateString, {
1694
+ width: 'narrow',
1695
+ context: 'formatting'
1696
+ }), valueCallback);
1697
+ // Tu
1698
+ case 'iiiiii':
1699
+ return mapValue(match.day(dateString, {
1700
+ width: 'short',
1701
+ context: 'formatting'
1702
+ }) || match.day(dateString, {
1703
+ width: 'narrow',
1704
+ context: 'formatting'
1705
+ }), valueCallback);
1706
+ // Tuesday
1707
+ case 'iiii':
1708
+ default:
1709
+ return mapValue(match.day(dateString, {
1710
+ width: 'wide',
1711
+ context: 'formatting'
1712
+ }) || match.day(dateString, {
1713
+ width: 'abbreviated',
1714
+ context: 'formatting'
1715
+ }) || match.day(dateString, {
1716
+ width: 'short',
1717
+ context: 'formatting'
1718
+ }) || match.day(dateString, {
1719
+ width: 'narrow',
1720
+ context: 'formatting'
1721
+ }), valueCallback);
1722
+ }
1723
+ }
1724
+ }, {
1725
+ key: "validate",
1726
+ value: function validate(_date, value) {
1727
+ return value >= 1 && value <= 7;
1728
+ }
1729
+ }, {
1730
+ key: "set",
1731
+ value: function set(date, _flags, value) {
1732
+ date = setUTCISODay(date, value);
1733
+ date.setUTCHours(0, 0, 0, 0);
1734
+ return date;
1735
+ }
1736
+ }]);
1737
+ return ISODayParser;
1738
+ }(Parser);
1739
+
1740
+ var AMPMParser = /*#__PURE__*/function (_Parser) {
1741
+ _inherits(AMPMParser, _Parser);
1742
+ var _super = _createSuper(AMPMParser);
1743
+ function AMPMParser() {
1744
+ var _this;
1745
+ _classCallCheck(this, AMPMParser);
1746
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1747
+ args[_key] = arguments[_key];
1748
+ }
1749
+ _this = _super.call.apply(_super, [this].concat(args));
1750
+ _defineProperty(_assertThisInitialized(_this), "priority", 80);
1751
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['b', 'B', 'H', 'k', 't', 'T']);
1752
+ return _this;
1753
+ }
1754
+ _createClass(AMPMParser, [{
1755
+ key: "parse",
1756
+ value: function parse(dateString, token, match) {
1757
+ switch (token) {
1758
+ case 'a':
1759
+ case 'aa':
1760
+ case 'aaa':
1761
+ return match.dayPeriod(dateString, {
1762
+ width: 'abbreviated',
1763
+ context: 'formatting'
1764
+ }) || match.dayPeriod(dateString, {
1765
+ width: 'narrow',
1766
+ context: 'formatting'
1767
+ });
1768
+ case 'aaaaa':
1769
+ return match.dayPeriod(dateString, {
1770
+ width: 'narrow',
1771
+ context: 'formatting'
1772
+ });
1773
+ case 'aaaa':
1774
+ default:
1775
+ return match.dayPeriod(dateString, {
1776
+ width: 'wide',
1777
+ context: 'formatting'
1778
+ }) || match.dayPeriod(dateString, {
1779
+ width: 'abbreviated',
1780
+ context: 'formatting'
1781
+ }) || match.dayPeriod(dateString, {
1782
+ width: 'narrow',
1783
+ context: 'formatting'
1784
+ });
1785
+ }
1786
+ }
1787
+ }, {
1788
+ key: "set",
1789
+ value: function set(date, _flags, value) {
1790
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
1791
+ return date;
1792
+ }
1793
+ }]);
1794
+ return AMPMParser;
1795
+ }(Parser);
1796
+
1797
+ var AMPMMidnightParser = /*#__PURE__*/function (_Parser) {
1798
+ _inherits(AMPMMidnightParser, _Parser);
1799
+ var _super = _createSuper(AMPMMidnightParser);
1800
+ function AMPMMidnightParser() {
1801
+ var _this;
1802
+ _classCallCheck(this, AMPMMidnightParser);
1803
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1804
+ args[_key] = arguments[_key];
1805
+ }
1806
+ _this = _super.call.apply(_super, [this].concat(args));
1807
+ _defineProperty(_assertThisInitialized(_this), "priority", 80);
1808
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']);
1809
+ return _this;
1810
+ }
1811
+ _createClass(AMPMMidnightParser, [{
1812
+ key: "parse",
1813
+ value: function parse(dateString, token, match) {
1814
+ switch (token) {
1815
+ case 'b':
1816
+ case 'bb':
1817
+ case 'bbb':
1818
+ return match.dayPeriod(dateString, {
1819
+ width: 'abbreviated',
1820
+ context: 'formatting'
1821
+ }) || match.dayPeriod(dateString, {
1822
+ width: 'narrow',
1823
+ context: 'formatting'
1824
+ });
1825
+ case 'bbbbb':
1826
+ return match.dayPeriod(dateString, {
1827
+ width: 'narrow',
1828
+ context: 'formatting'
1829
+ });
1830
+ case 'bbbb':
1831
+ default:
1832
+ return match.dayPeriod(dateString, {
1833
+ width: 'wide',
1834
+ context: 'formatting'
1835
+ }) || match.dayPeriod(dateString, {
1836
+ width: 'abbreviated',
1837
+ context: 'formatting'
1838
+ }) || match.dayPeriod(dateString, {
1839
+ width: 'narrow',
1840
+ context: 'formatting'
1841
+ });
1842
+ }
1843
+ }
1844
+ }, {
1845
+ key: "set",
1846
+ value: function set(date, _flags, value) {
1847
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
1848
+ return date;
1849
+ }
1850
+ }]);
1851
+ return AMPMMidnightParser;
1852
+ }(Parser);
1853
+
1854
+ var DayPeriodParser = /*#__PURE__*/function (_Parser) {
1855
+ _inherits(DayPeriodParser, _Parser);
1856
+ var _super = _createSuper(DayPeriodParser);
1857
+ function DayPeriodParser() {
1858
+ var _this;
1859
+ _classCallCheck(this, DayPeriodParser);
1860
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1861
+ args[_key] = arguments[_key];
1862
+ }
1863
+ _this = _super.call.apply(_super, [this].concat(args));
1864
+ _defineProperty(_assertThisInitialized(_this), "priority", 80);
1865
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 't', 'T']);
1866
+ return _this;
1867
+ }
1868
+ _createClass(DayPeriodParser, [{
1869
+ key: "parse",
1870
+ value: function parse(dateString, token, match) {
1871
+ switch (token) {
1872
+ case 'B':
1873
+ case 'BB':
1874
+ case 'BBB':
1875
+ return match.dayPeriod(dateString, {
1876
+ width: 'abbreviated',
1877
+ context: 'formatting'
1878
+ }) || match.dayPeriod(dateString, {
1879
+ width: 'narrow',
1880
+ context: 'formatting'
1881
+ });
1882
+ case 'BBBBB':
1883
+ return match.dayPeriod(dateString, {
1884
+ width: 'narrow',
1885
+ context: 'formatting'
1886
+ });
1887
+ case 'BBBB':
1888
+ default:
1889
+ return match.dayPeriod(dateString, {
1890
+ width: 'wide',
1891
+ context: 'formatting'
1892
+ }) || match.dayPeriod(dateString, {
1893
+ width: 'abbreviated',
1894
+ context: 'formatting'
1895
+ }) || match.dayPeriod(dateString, {
1896
+ width: 'narrow',
1897
+ context: 'formatting'
1898
+ });
1899
+ }
1900
+ }
1901
+ }, {
1902
+ key: "set",
1903
+ value: function set(date, _flags, value) {
1904
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
1905
+ return date;
1906
+ }
1907
+ }]);
1908
+ return DayPeriodParser;
1909
+ }(Parser);
1910
+
1911
+ var Hour1to12Parser = /*#__PURE__*/function (_Parser) {
1912
+ _inherits(Hour1to12Parser, _Parser);
1913
+ var _super = _createSuper(Hour1to12Parser);
1914
+ function Hour1to12Parser() {
1915
+ var _this;
1916
+ _classCallCheck(this, Hour1to12Parser);
1917
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1918
+ args[_key] = arguments[_key];
1919
+ }
1920
+ _this = _super.call.apply(_super, [this].concat(args));
1921
+ _defineProperty(_assertThisInitialized(_this), "priority", 70);
1922
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['H', 'K', 'k', 't', 'T']);
1923
+ return _this;
1924
+ }
1925
+ _createClass(Hour1to12Parser, [{
1926
+ key: "parse",
1927
+ value: function parse(dateString, token, match) {
1928
+ switch (token) {
1929
+ case 'h':
1930
+ return parseNumericPattern(numericPatterns.hour12h, dateString);
1931
+ case 'ho':
1932
+ return match.ordinalNumber(dateString, {
1933
+ unit: 'hour'
1934
+ });
1935
+ default:
1936
+ return parseNDigits(token.length, dateString);
1937
+ }
1938
+ }
1939
+ }, {
1940
+ key: "validate",
1941
+ value: function validate(_date, value) {
1942
+ return value >= 1 && value <= 12;
1943
+ }
1944
+ }, {
1945
+ key: "set",
1946
+ value: function set(date, _flags, value) {
1947
+ var isPM = date.getUTCHours() >= 12;
1948
+ if (isPM && value < 12) {
1949
+ date.setUTCHours(value + 12, 0, 0, 0);
1950
+ } else if (!isPM && value === 12) {
1951
+ date.setUTCHours(0, 0, 0, 0);
1952
+ } else {
1953
+ date.setUTCHours(value, 0, 0, 0);
1954
+ }
1955
+ return date;
1956
+ }
1957
+ }]);
1958
+ return Hour1to12Parser;
1959
+ }(Parser);
1960
+
1961
+ var Hour0to23Parser = /*#__PURE__*/function (_Parser) {
1962
+ _inherits(Hour0to23Parser, _Parser);
1963
+ var _super = _createSuper(Hour0to23Parser);
1964
+ function Hour0to23Parser() {
1965
+ var _this;
1966
+ _classCallCheck(this, Hour0to23Parser);
1967
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1968
+ args[_key] = arguments[_key];
1969
+ }
1970
+ _this = _super.call.apply(_super, [this].concat(args));
1971
+ _defineProperty(_assertThisInitialized(_this), "priority", 70);
1972
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 'h', 'K', 'k', 't', 'T']);
1973
+ return _this;
1974
+ }
1975
+ _createClass(Hour0to23Parser, [{
1976
+ key: "parse",
1977
+ value: function parse(dateString, token, match) {
1978
+ switch (token) {
1979
+ case 'H':
1980
+ return parseNumericPattern(numericPatterns.hour23h, dateString);
1981
+ case 'Ho':
1982
+ return match.ordinalNumber(dateString, {
1983
+ unit: 'hour'
1984
+ });
1985
+ default:
1986
+ return parseNDigits(token.length, dateString);
1987
+ }
1988
+ }
1989
+ }, {
1990
+ key: "validate",
1991
+ value: function validate(_date, value) {
1992
+ return value >= 0 && value <= 23;
1993
+ }
1994
+ }, {
1995
+ key: "set",
1996
+ value: function set(date, _flags, value) {
1997
+ date.setUTCHours(value, 0, 0, 0);
1998
+ return date;
1999
+ }
2000
+ }]);
2001
+ return Hour0to23Parser;
2002
+ }(Parser);
2003
+
2004
+ var Hour0To11Parser = /*#__PURE__*/function (_Parser) {
2005
+ _inherits(Hour0To11Parser, _Parser);
2006
+ var _super = _createSuper(Hour0To11Parser);
2007
+ function Hour0To11Parser() {
2008
+ var _this;
2009
+ _classCallCheck(this, Hour0To11Parser);
2010
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2011
+ args[_key] = arguments[_key];
2012
+ }
2013
+ _this = _super.call.apply(_super, [this].concat(args));
2014
+ _defineProperty(_assertThisInitialized(_this), "priority", 70);
2015
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['h', 'H', 'k', 't', 'T']);
2016
+ return _this;
2017
+ }
2018
+ _createClass(Hour0To11Parser, [{
2019
+ key: "parse",
2020
+ value: function parse(dateString, token, match) {
2021
+ switch (token) {
2022
+ case 'K':
2023
+ return parseNumericPattern(numericPatterns.hour11h, dateString);
2024
+ case 'Ko':
2025
+ return match.ordinalNumber(dateString, {
2026
+ unit: 'hour'
2027
+ });
2028
+ default:
2029
+ return parseNDigits(token.length, dateString);
2030
+ }
2031
+ }
2032
+ }, {
2033
+ key: "validate",
2034
+ value: function validate(_date, value) {
2035
+ return value >= 0 && value <= 11;
2036
+ }
2037
+ }, {
2038
+ key: "set",
2039
+ value: function set(date, _flags, value) {
2040
+ var isPM = date.getUTCHours() >= 12;
2041
+ if (isPM && value < 12) {
2042
+ date.setUTCHours(value + 12, 0, 0, 0);
2043
+ } else {
2044
+ date.setUTCHours(value, 0, 0, 0);
2045
+ }
2046
+ return date;
2047
+ }
2048
+ }]);
2049
+ return Hour0To11Parser;
2050
+ }(Parser);
2051
+
2052
+ var Hour1To24Parser = /*#__PURE__*/function (_Parser) {
2053
+ _inherits(Hour1To24Parser, _Parser);
2054
+ var _super = _createSuper(Hour1To24Parser);
2055
+ function Hour1To24Parser() {
2056
+ var _this;
2057
+ _classCallCheck(this, Hour1To24Parser);
2058
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2059
+ args[_key] = arguments[_key];
2060
+ }
2061
+ _this = _super.call.apply(_super, [this].concat(args));
2062
+ _defineProperty(_assertThisInitialized(_this), "priority", 70);
2063
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 'h', 'H', 'K', 't', 'T']);
2064
+ return _this;
2065
+ }
2066
+ _createClass(Hour1To24Parser, [{
2067
+ key: "parse",
2068
+ value: function parse(dateString, token, match) {
2069
+ switch (token) {
2070
+ case 'k':
2071
+ return parseNumericPattern(numericPatterns.hour24h, dateString);
2072
+ case 'ko':
2073
+ return match.ordinalNumber(dateString, {
2074
+ unit: 'hour'
2075
+ });
2076
+ default:
2077
+ return parseNDigits(token.length, dateString);
2078
+ }
2079
+ }
2080
+ }, {
2081
+ key: "validate",
2082
+ value: function validate(_date, value) {
2083
+ return value >= 1 && value <= 24;
2084
+ }
2085
+ }, {
2086
+ key: "set",
2087
+ value: function set(date, _flags, value) {
2088
+ var hours = value <= 24 ? value % 24 : value;
2089
+ date.setUTCHours(hours, 0, 0, 0);
2090
+ return date;
2091
+ }
2092
+ }]);
2093
+ return Hour1To24Parser;
2094
+ }(Parser);
2095
+
2096
+ var MinuteParser = /*#__PURE__*/function (_Parser) {
2097
+ _inherits(MinuteParser, _Parser);
2098
+ var _super = _createSuper(MinuteParser);
2099
+ function MinuteParser() {
2100
+ var _this;
2101
+ _classCallCheck(this, MinuteParser);
2102
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2103
+ args[_key] = arguments[_key];
2104
+ }
2105
+ _this = _super.call.apply(_super, [this].concat(args));
2106
+ _defineProperty(_assertThisInitialized(_this), "priority", 60);
2107
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']);
2108
+ return _this;
2109
+ }
2110
+ _createClass(MinuteParser, [{
2111
+ key: "parse",
2112
+ value: function parse(dateString, token, match) {
2113
+ switch (token) {
2114
+ case 'm':
2115
+ return parseNumericPattern(numericPatterns.minute, dateString);
2116
+ case 'mo':
2117
+ return match.ordinalNumber(dateString, {
2118
+ unit: 'minute'
2119
+ });
2120
+ default:
2121
+ return parseNDigits(token.length, dateString);
2122
+ }
2123
+ }
2124
+ }, {
2125
+ key: "validate",
2126
+ value: function validate(_date, value) {
2127
+ return value >= 0 && value <= 59;
2128
+ }
2129
+ }, {
2130
+ key: "set",
2131
+ value: function set(date, _flags, value) {
2132
+ date.setUTCMinutes(value, 0, 0);
2133
+ return date;
2134
+ }
2135
+ }]);
2136
+ return MinuteParser;
2137
+ }(Parser);
2138
+
2139
+ var SecondParser = /*#__PURE__*/function (_Parser) {
2140
+ _inherits(SecondParser, _Parser);
2141
+ var _super = _createSuper(SecondParser);
2142
+ function SecondParser() {
2143
+ var _this;
2144
+ _classCallCheck(this, SecondParser);
2145
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2146
+ args[_key] = arguments[_key];
2147
+ }
2148
+ _this = _super.call.apply(_super, [this].concat(args));
2149
+ _defineProperty(_assertThisInitialized(_this), "priority", 50);
2150
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']);
2151
+ return _this;
2152
+ }
2153
+ _createClass(SecondParser, [{
2154
+ key: "parse",
2155
+ value: function parse(dateString, token, match) {
2156
+ switch (token) {
2157
+ case 's':
2158
+ return parseNumericPattern(numericPatterns.second, dateString);
2159
+ case 'so':
2160
+ return match.ordinalNumber(dateString, {
2161
+ unit: 'second'
2162
+ });
2163
+ default:
2164
+ return parseNDigits(token.length, dateString);
2165
+ }
2166
+ }
2167
+ }, {
2168
+ key: "validate",
2169
+ value: function validate(_date, value) {
2170
+ return value >= 0 && value <= 59;
2171
+ }
2172
+ }, {
2173
+ key: "set",
2174
+ value: function set(date, _flags, value) {
2175
+ date.setUTCSeconds(value, 0);
2176
+ return date;
2177
+ }
2178
+ }]);
2179
+ return SecondParser;
2180
+ }(Parser);
2181
+
2182
+ var FractionOfSecondParser = /*#__PURE__*/function (_Parser) {
2183
+ _inherits(FractionOfSecondParser, _Parser);
2184
+ var _super = _createSuper(FractionOfSecondParser);
2185
+ function FractionOfSecondParser() {
2186
+ var _this;
2187
+ _classCallCheck(this, FractionOfSecondParser);
2188
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2189
+ args[_key] = arguments[_key];
2190
+ }
2191
+ _this = _super.call.apply(_super, [this].concat(args));
2192
+ _defineProperty(_assertThisInitialized(_this), "priority", 30);
2193
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']);
2194
+ return _this;
2195
+ }
2196
+ _createClass(FractionOfSecondParser, [{
2197
+ key: "parse",
2198
+ value: function parse(dateString, token) {
2199
+ var valueCallback = function valueCallback(value) {
2200
+ return Math.floor(value * Math.pow(10, -token.length + 3));
2201
+ };
2202
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
2203
+ }
2204
+ }, {
2205
+ key: "set",
2206
+ value: function set(date, _flags, value) {
2207
+ date.setUTCMilliseconds(value);
2208
+ return date;
2209
+ }
2210
+ }]);
2211
+ return FractionOfSecondParser;
2212
+ }(Parser);
2213
+
2214
+ var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser) {
2215
+ _inherits(ISOTimezoneWithZParser, _Parser);
2216
+ var _super = _createSuper(ISOTimezoneWithZParser);
2217
+ function ISOTimezoneWithZParser() {
2218
+ var _this;
2219
+ _classCallCheck(this, ISOTimezoneWithZParser);
2220
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2221
+ args[_key] = arguments[_key];
2222
+ }
2223
+ _this = _super.call.apply(_super, [this].concat(args));
2224
+ _defineProperty(_assertThisInitialized(_this), "priority", 10);
2225
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T', 'x']);
2226
+ return _this;
2227
+ }
2228
+ _createClass(ISOTimezoneWithZParser, [{
2229
+ key: "parse",
2230
+ value: function parse(dateString, token) {
2231
+ switch (token) {
2232
+ case 'X':
2233
+ return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
2234
+ case 'XX':
2235
+ return parseTimezonePattern(timezonePatterns.basic, dateString);
2236
+ case 'XXXX':
2237
+ return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
2238
+ case 'XXXXX':
2239
+ return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
2240
+ case 'XXX':
2241
+ default:
2242
+ return parseTimezonePattern(timezonePatterns.extended, dateString);
2243
+ }
2244
+ }
2245
+ }, {
2246
+ key: "set",
2247
+ value: function set(date, flags, value) {
2248
+ if (flags.timestampIsSet) {
2249
+ return date;
2250
+ }
2251
+ return new Date(date.getTime() - value);
2252
+ }
2253
+ }]);
2254
+ return ISOTimezoneWithZParser;
2255
+ }(Parser);
2256
+
2257
+ var ISOTimezoneParser = /*#__PURE__*/function (_Parser) {
2258
+ _inherits(ISOTimezoneParser, _Parser);
2259
+ var _super = _createSuper(ISOTimezoneParser);
2260
+ function ISOTimezoneParser() {
2261
+ var _this;
2262
+ _classCallCheck(this, ISOTimezoneParser);
2263
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2264
+ args[_key] = arguments[_key];
2265
+ }
2266
+ _this = _super.call.apply(_super, [this].concat(args));
2267
+ _defineProperty(_assertThisInitialized(_this), "priority", 10);
2268
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T', 'X']);
2269
+ return _this;
2270
+ }
2271
+ _createClass(ISOTimezoneParser, [{
2272
+ key: "parse",
2273
+ value: function parse(dateString, token) {
2274
+ switch (token) {
2275
+ case 'x':
2276
+ return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
2277
+ case 'xx':
2278
+ return parseTimezonePattern(timezonePatterns.basic, dateString);
2279
+ case 'xxxx':
2280
+ return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
2281
+ case 'xxxxx':
2282
+ return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
2283
+ case 'xxx':
2284
+ default:
2285
+ return parseTimezonePattern(timezonePatterns.extended, dateString);
2286
+ }
2287
+ }
2288
+ }, {
2289
+ key: "set",
2290
+ value: function set(date, flags, value) {
2291
+ if (flags.timestampIsSet) {
2292
+ return date;
2293
+ }
2294
+ return new Date(date.getTime() - value);
2295
+ }
2296
+ }]);
2297
+ return ISOTimezoneParser;
2298
+ }(Parser);
2299
+
2300
+ var TimestampSecondsParser = /*#__PURE__*/function (_Parser) {
2301
+ _inherits(TimestampSecondsParser, _Parser);
2302
+ var _super = _createSuper(TimestampSecondsParser);
2303
+ function TimestampSecondsParser() {
2304
+ var _this;
2305
+ _classCallCheck(this, TimestampSecondsParser);
2306
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2307
+ args[_key] = arguments[_key];
2308
+ }
2309
+ _this = _super.call.apply(_super, [this].concat(args));
2310
+ _defineProperty(_assertThisInitialized(_this), "priority", 40);
2311
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", '*');
2312
+ return _this;
2313
+ }
2314
+ _createClass(TimestampSecondsParser, [{
2315
+ key: "parse",
2316
+ value: function parse(dateString) {
2317
+ return parseAnyDigitsSigned(dateString);
2318
+ }
2319
+ }, {
2320
+ key: "set",
2321
+ value: function set(_date, _flags, value) {
2322
+ return [new Date(value * 1000), {
2323
+ timestampIsSet: true
2324
+ }];
2325
+ }
2326
+ }]);
2327
+ return TimestampSecondsParser;
2328
+ }(Parser);
2329
+
2330
+ var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser) {
2331
+ _inherits(TimestampMillisecondsParser, _Parser);
2332
+ var _super = _createSuper(TimestampMillisecondsParser);
2333
+ function TimestampMillisecondsParser() {
2334
+ var _this;
2335
+ _classCallCheck(this, TimestampMillisecondsParser);
2336
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2337
+ args[_key] = arguments[_key];
2338
+ }
2339
+ _this = _super.call.apply(_super, [this].concat(args));
2340
+ _defineProperty(_assertThisInitialized(_this), "priority", 20);
2341
+ _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", '*');
2342
+ return _this;
2343
+ }
2344
+ _createClass(TimestampMillisecondsParser, [{
2345
+ key: "parse",
2346
+ value: function parse(dateString) {
2347
+ return parseAnyDigitsSigned(dateString);
2348
+ }
2349
+ }, {
2350
+ key: "set",
2351
+ value: function set(_date, _flags, value) {
2352
+ return [new Date(value), {
2353
+ timestampIsSet: true
2354
+ }];
2355
+ }
2356
+ }]);
2357
+ return TimestampMillisecondsParser;
2358
+ }(Parser);
2359
+
2360
+ /*
2361
+ * | | Unit | | Unit |
2362
+ * |-----|--------------------------------|-----|--------------------------------|
2363
+ * | a | AM, PM | A* | Milliseconds in day |
2364
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
2365
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
2366
+ * | d | Day of month | D | Day of year |
2367
+ * | e | Local day of week | E | Day of week |
2368
+ * | f | | F* | Day of week in month |
2369
+ * | g* | Modified Julian day | G | Era |
2370
+ * | h | Hour [1-12] | H | Hour [0-23] |
2371
+ * | i! | ISO day of week | I! | ISO week of year |
2372
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
2373
+ * | k | Hour [1-24] | K | Hour [0-11] |
2374
+ * | l* | (deprecated) | L | Stand-alone month |
2375
+ * | m | Minute | M | Month |
2376
+ * | n | | N | |
2377
+ * | o! | Ordinal number modifier | O* | Timezone (GMT) |
2378
+ * | p | | P | |
2379
+ * | q | Stand-alone quarter | Q | Quarter |
2380
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
2381
+ * | s | Second | S | Fraction of second |
2382
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
2383
+ * | u | Extended year | U* | Cyclic year |
2384
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
2385
+ * | w | Local week of year | W* | Week of month |
2386
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
2387
+ * | y | Year (abs) | Y | Local week-numbering year |
2388
+ * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
2389
+ *
2390
+ * Letters marked by * are not implemented but reserved by Unicode standard.
2391
+ *
2392
+ * Letters marked by ! are non-standard, but implemented by date-fns:
2393
+ * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
2394
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
2395
+ * i.e. 7 for Sunday, 1 for Monday, etc.
2396
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
2397
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
2398
+ * `R` is supposed to be used in conjunction with `I` and `i`
2399
+ * for universal ISO week-numbering date, whereas
2400
+ * `Y` is supposed to be used in conjunction with `w` and `e`
2401
+ * for week-numbering date specific to the locale.
2402
+ */
2403
+ ({
2404
+ G: new EraParser(),
2405
+ y: new YearParser(),
2406
+ Y: new LocalWeekYearParser(),
2407
+ R: new ISOWeekYearParser(),
2408
+ u: new ExtendedYearParser(),
2409
+ Q: new QuarterParser(),
2410
+ q: new StandAloneQuarterParser(),
2411
+ M: new MonthParser(),
2412
+ L: new StandAloneMonthParser(),
2413
+ w: new LocalWeekParser(),
2414
+ I: new ISOWeekParser(),
2415
+ d: new DateParser(),
2416
+ D: new DayOfYearParser(),
2417
+ E: new DayParser(),
2418
+ e: new LocalDayParser(),
2419
+ c: new StandAloneLocalDayParser(),
2420
+ i: new ISODayParser(),
2421
+ a: new AMPMParser(),
2422
+ b: new AMPMMidnightParser(),
2423
+ B: new DayPeriodParser(),
2424
+ h: new Hour1to12Parser(),
2425
+ H: new Hour0to23Parser(),
2426
+ K: new Hour0To11Parser(),
2427
+ k: new Hour1To24Parser(),
2428
+ m: new MinuteParser(),
2429
+ s: new SecondParser(),
2430
+ S: new FractionOfSecondParser(),
2431
+ X: new ISOTimezoneWithZParser(),
2432
+ x: new ISOTimezoneParser(),
2433
+ t: new TimestampSecondsParser(),
2434
+ T: new TimestampMillisecondsParser()
2435
+ });
2436
+
2437
+ export { _typeof as _, toInteger as a, getUTCISOWeekYear as b, getUTCWeek as c, getUTCISOWeek as d, getDefaultOptions as e, getUTCWeekYear as g, requiredArgs as r, toDate as t };
2438
+ //# sourceMappingURL=index-705f3821.js.map