@verdocs/web-sdk 1.14.10 → 1.14.12

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 (243) hide show
  1. package/dist/cjs/Roles-9b593b95.js +28 -0
  2. package/dist/cjs/{TemplateStore-19f84862.js → TemplateStore-f2fb6a62.js} +1 -1
  3. package/dist/cjs/{index-7c19ba1d.js → index-6528b430.js} +219 -63
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{utils-618c13f1.js → utils-f4efefe3.js} +1 -1
  6. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  8. package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +27 -14
  9. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-dropdown_2.cjs.entry.js +3 -3
  11. package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +2 -2
  13. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -2
  14. package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -2
  16. package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -2
  17. package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -2
  19. package/dist/cjs/verdocs-field-signature.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +3 -3
  21. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +3 -3
  22. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -2
  23. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-organization-card.cjs.entry.js +1 -1
  25. package/dist/cjs/verdocs-preview.cjs.entry.js +4 -4
  26. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +241 -0
  28. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-send.cjs.entry.js +4 -4
  30. package/dist/cjs/verdocs-sign.cjs.entry.js +3 -3
  31. package/dist/cjs/{verdocs-template-fields_4.cjs.entry.js → verdocs-template-attachments_4.cjs.entry.js} +233 -242
  32. package/dist/cjs/{verdocs-template-document-page_2.cjs.entry.js → verdocs-template-document-page.cjs.entry.js} +3 -48
  33. package/dist/cjs/verdocs-template-name.cjs.entry.js +2 -2
  34. package/dist/cjs/verdocs-template-reminders.cjs.entry.js +2 -12
  35. package/dist/cjs/verdocs-template-visibility.cjs.entry.js +2 -2
  36. package/dist/cjs/verdocs-toolbar-icon.cjs.entry.js +51 -0
  37. package/dist/cjs/verdocs-view.cjs.entry.js +3 -3
  38. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  39. package/dist/collection/collection-manifest.json +0 -1
  40. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +27 -14
  41. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.stories.js +1 -1
  42. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.css +2 -1
  43. package/dist/components/VerdocsEndpoint.js +30 -30
  44. package/dist/components/index.d.ts +0 -1
  45. package/dist/components/index.js +0 -1
  46. package/dist/components/index2.js +219 -63
  47. package/dist/components/verdocs-template-field-properties2.js +27 -13
  48. package/dist/components/verdocs-template-reminders.js +0 -10
  49. package/dist/components/verdocs-template-roles2.js +1 -1
  50. package/dist/docs.json +1 -102
  51. package/dist/esm/Roles-6eb459df.js +24 -0
  52. package/dist/esm/{TemplateStore-852097c3.js → TemplateStore-87c99dfc.js} +1 -1
  53. package/dist/esm/{index-914ed6f7.js → index-d264c496.js} +219 -63
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/esm/{utils-60683446.js → utils-1bb75f32.js} +2 -2
  56. package/dist/esm/verdocs-auth.entry.js +1 -1
  57. package/dist/esm/verdocs-build.entry.js +2 -2
  58. package/dist/esm/verdocs-button-panel_3.entry.js +27 -14
  59. package/dist/esm/verdocs-contact-picker.entry.js +1 -1
  60. package/dist/esm/verdocs-dropdown_2.entry.js +3 -3
  61. package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
  62. package/dist/esm/verdocs-envelope-sidebar.entry.js +2 -2
  63. package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
  64. package/dist/esm/verdocs-field-date.entry.js +2 -2
  65. package/dist/esm/verdocs-field-dropdown.entry.js +2 -2
  66. package/dist/esm/verdocs-field-initial.entry.js +2 -2
  67. package/dist/esm/verdocs-field-payment.entry.js +2 -2
  68. package/dist/esm/verdocs-field-radio-button.entry.js +2 -2
  69. package/dist/esm/verdocs-field-signature.entry.js +2 -2
  70. package/dist/esm/verdocs-field-textarea.entry.js +3 -3
  71. package/dist/esm/verdocs-field-textbox.entry.js +3 -3
  72. package/dist/esm/verdocs-field-timestamp.entry.js +2 -2
  73. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  74. package/dist/esm/verdocs-organization-card.entry.js +1 -1
  75. package/dist/esm/verdocs-preview.entry.js +4 -4
  76. package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
  77. package/dist/esm/verdocs-radio-button_3.entry.js +235 -0
  78. package/dist/esm/verdocs-search.entry.js +1 -1
  79. package/dist/esm/verdocs-send.entry.js +4 -4
  80. package/dist/esm/verdocs-sign.entry.js +3 -3
  81. package/dist/esm/{verdocs-template-fields_4.entry.js → verdocs-template-attachments_4.entry.js} +230 -239
  82. package/dist/esm/{verdocs-template-document-page_2.entry.js → verdocs-template-document-page.entry.js} +4 -48
  83. package/dist/esm/verdocs-template-name.entry.js +2 -2
  84. package/dist/esm/verdocs-template-reminders.entry.js +2 -12
  85. package/dist/esm/verdocs-template-visibility.entry.js +2 -2
  86. package/dist/esm/verdocs-toolbar-icon.entry.js +47 -0
  87. package/dist/esm/verdocs-view.entry.js +3 -3
  88. package/dist/esm/verdocs-web-sdk.js +1 -1
  89. package/dist/esm-es5/Roles-6eb459df.js +1 -0
  90. package/dist/esm-es5/{TemplateStore-852097c3.js → TemplateStore-87c99dfc.js} +1 -1
  91. package/dist/esm-es5/{VerdocsEndpoint-5b92f115.js → VerdocsEndpoint-6d7a17ce.js} +1 -1
  92. package/dist/esm-es5/index-d264c496.js +1 -0
  93. package/dist/esm-es5/loader.js +1 -1
  94. package/dist/esm-es5/{utils-60683446.js → utils-1bb75f32.js} +2 -2
  95. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-dropdown_2.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  104. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  111. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  112. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  113. package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
  114. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  115. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  116. package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -0
  117. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  118. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  119. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  120. package/dist/esm-es5/verdocs-template-attachments_4.entry.js +1 -0
  121. package/dist/esm-es5/verdocs-template-document-page.entry.js +1 -0
  122. package/dist/esm-es5/verdocs-template-name.entry.js +1 -1
  123. package/dist/esm-es5/verdocs-template-reminders.entry.js +1 -1
  124. package/dist/esm-es5/verdocs-template-visibility.entry.js +1 -1
  125. package/dist/esm-es5/verdocs-toolbar-icon.entry.js +1 -0
  126. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  127. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  128. package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +3 -2
  129. package/dist/types/components.d.ts +0 -29
  130. package/dist/verdocs-web-sdk/{p-be6d3848.entry.js → p-017dc2a9.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/{p-0177fb6c.entry.js → p-10bb1e56.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-9d7fa51d.system.entry.js → p-1236c197.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-2c0d7838.system.entry.js → p-12f0c4e0.system.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/{p-4a3b037b.system.entry.js → p-172f5d37.system.entry.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-c841a530.system.entry.js → p-19450d55.system.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/{p-717c9fe1.entry.js → p-1c4f6ae6.entry.js} +1 -1
  137. package/dist/verdocs-web-sdk/p-1cf38cea.system.js +1 -1
  138. package/dist/verdocs-web-sdk/p-1e8d9829.entry.js +1 -0
  139. package/dist/verdocs-web-sdk/{p-94365585.entry.js → p-204f69c7.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-5cff98bd.entry.js → p-237edd0b.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-0529a428.system.entry.js → p-255a66f9.system.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-3fe24d0c.system.entry.js → p-25870f11.system.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/p-27846894.system.entry.js +1 -0
  144. package/dist/verdocs-web-sdk/{p-1420d87e.system.entry.js → p-2a3de488.system.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/{p-9c87f6f8.system.entry.js → p-2d2bdf3c.system.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/{p-dc849a58.system.js → p-365a0216.system.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-0aee25b9.entry.js → p-365a8a00.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/{p-33640d84.entry.js → p-3a9d248d.entry.js} +1 -1
  149. package/dist/verdocs-web-sdk/{p-4b65e2f3.js → p-3ea489e9.js} +1 -1
  150. package/dist/verdocs-web-sdk/p-42aa31a9.entry.js +1 -0
  151. package/dist/verdocs-web-sdk/{p-8e386265.entry.js → p-43f5476c.entry.js} +1 -1
  152. package/dist/verdocs-web-sdk/p-51a3ea62.system.js +1 -0
  153. package/dist/verdocs-web-sdk/{p-e4ceaebf.system.entry.js → p-56c65857.system.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-8aba7c0a.entry.js → p-5d19f075.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/p-5df694ab.system.entry.js +1 -0
  156. package/dist/verdocs-web-sdk/{p-21e90bbf.system.entry.js → p-7399931a.system.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/{p-7fb69dde.entry.js → p-750fabdb.entry.js} +1 -1
  158. package/dist/verdocs-web-sdk/p-76b73d80.entry.js +1 -0
  159. package/dist/verdocs-web-sdk/{p-095a3eba.system.entry.js → p-773a2544.system.entry.js} +1 -1
  160. package/dist/verdocs-web-sdk/{p-0e381c36.entry.js → p-789dc7fe.entry.js} +1 -1
  161. package/dist/verdocs-web-sdk/{p-f37f1ebc.system.entry.js → p-7917673a.system.entry.js} +1 -1
  162. package/dist/verdocs-web-sdk/p-8027431e.js +1 -0
  163. package/dist/verdocs-web-sdk/{p-73ea1ea3.entry.js → p-807dbe83.entry.js} +1 -1
  164. package/dist/verdocs-web-sdk/{p-02a70b8e.system.entry.js → p-8109a994.system.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/p-8229e6df.system.js +1 -0
  166. package/dist/verdocs-web-sdk/p-83535db7.entry.js +1 -0
  167. package/dist/verdocs-web-sdk/{p-e2635788.system.entry.js → p-8387794f.system.entry.js} +1 -1
  168. package/dist/verdocs-web-sdk/{p-1a0cccea.system.entry.js → p-886461cd.system.entry.js} +1 -1
  169. package/dist/verdocs-web-sdk/p-89f34463.system.entry.js +1 -0
  170. package/dist/verdocs-web-sdk/{p-fdda1309.entry.js → p-8dacb527.entry.js} +1 -1
  171. package/dist/verdocs-web-sdk/{p-f9bea98a.js → p-8fb2cf32.js} +2 -2
  172. package/dist/verdocs-web-sdk/{p-438daf23.entry.js → p-8fcb22ea.entry.js} +1 -1
  173. package/dist/verdocs-web-sdk/{p-ebca6188.entry.js → p-991afbb9.entry.js} +1 -1
  174. package/dist/verdocs-web-sdk/{p-3e4f73cb.system.entry.js → p-9d90ed3d.system.entry.js} +1 -1
  175. package/dist/verdocs-web-sdk/{p-84457a67.system.entry.js → p-9dd19ab5.system.entry.js} +1 -1
  176. package/dist/verdocs-web-sdk/p-a3931094.system.entry.js +1 -0
  177. package/dist/verdocs-web-sdk/p-a58691dc.entry.js +1 -0
  178. package/dist/verdocs-web-sdk/{p-813c2fae.system.entry.js → p-a596cd4f.system.entry.js} +1 -1
  179. package/dist/verdocs-web-sdk/{p-a5bce263.entry.js → p-a5eebbfa.entry.js} +1 -1
  180. package/dist/verdocs-web-sdk/{p-4cc5d833.system.js → p-a6258dde.system.js} +1 -1
  181. package/dist/verdocs-web-sdk/p-a654311c.system.entry.js +1 -0
  182. package/dist/verdocs-web-sdk/{p-c3ef7b4f.entry.js → p-a78616fe.entry.js} +1 -1
  183. package/dist/verdocs-web-sdk/p-ab01f71e.js +1 -0
  184. package/dist/verdocs-web-sdk/{p-0c0ac290.system.entry.js → p-ac2b339a.system.entry.js} +1 -1
  185. package/dist/verdocs-web-sdk/p-ad11a39a.entry.js +1 -0
  186. package/dist/verdocs-web-sdk/{p-1f561c42.entry.js → p-b1ffa27a.entry.js} +1 -1
  187. package/dist/verdocs-web-sdk/{p-a3c06b62.entry.js → p-bbdafeac.entry.js} +1 -1
  188. package/dist/verdocs-web-sdk/{p-6a44fb56.system.entry.js → p-bcda78a9.system.entry.js} +1 -1
  189. package/dist/verdocs-web-sdk/{p-afa1f20b.system.entry.js → p-bf850bb9.system.entry.js} +1 -1
  190. package/dist/verdocs-web-sdk/{p-f0db17e6.system.entry.js → p-c0635249.system.entry.js} +1 -1
  191. package/dist/verdocs-web-sdk/{p-e727af9c.system.entry.js → p-c4c8af4c.system.entry.js} +1 -1
  192. package/dist/verdocs-web-sdk/{p-380efff2.system.entry.js → p-c7dbe82b.system.entry.js} +1 -1
  193. package/dist/verdocs-web-sdk/{p-f483cd49.entry.js → p-ca57cd6e.entry.js} +1 -1
  194. package/dist/verdocs-web-sdk/{p-13959c36.system.entry.js → p-d09a9e1b.system.entry.js} +1 -1
  195. package/dist/verdocs-web-sdk/{p-e72c075e.entry.js → p-d146b48e.entry.js} +1 -1
  196. package/dist/verdocs-web-sdk/{p-fa6b1145.system.js → p-d21e9e04.system.js} +2 -2
  197. package/dist/verdocs-web-sdk/{p-44ec0583.entry.js → p-d763dac2.entry.js} +1 -1
  198. package/dist/verdocs-web-sdk/{p-fcfd3193.system.entry.js → p-df439631.system.entry.js} +1 -1
  199. package/dist/verdocs-web-sdk/{p-49b3ac56.entry.js → p-dfbf689b.entry.js} +1 -1
  200. package/dist/verdocs-web-sdk/{p-7850f739.system.entry.js → p-e5365d23.system.entry.js} +1 -1
  201. package/dist/verdocs-web-sdk/{p-a4cbba4a.entry.js → p-e702cf26.entry.js} +1 -1
  202. package/dist/verdocs-web-sdk/{p-7ac080d6.entry.js → p-ededd783.entry.js} +1 -1
  203. package/dist/verdocs-web-sdk/{p-6e62e65a.entry.js → p-f61f02a7.entry.js} +1 -1
  204. package/dist/verdocs-web-sdk/{p-0b4ea5f9.js → p-ff662b13.js} +1 -1
  205. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  206. package/package.json +1 -1
  207. package/dist/cjs/ipc-test.cjs.entry.js +0 -37
  208. package/dist/cjs/verdocs-radio-button.cjs.entry.js +0 -23
  209. package/dist/cjs/verdocs-template-attachments_2.cjs.entry.js +0 -236
  210. package/dist/collection/components/other/ipctest/ipc-test.css +0 -4
  211. package/dist/collection/components/other/ipctest/ipc-test.js +0 -79
  212. package/dist/collection/components/other/ipctest/ipc-test.stories.js +0 -8
  213. package/dist/components/ipc-test.d.ts +0 -11
  214. package/dist/components/ipc-test.js +0 -142
  215. package/dist/custom-elements.json +0 -1619
  216. package/dist/esm/ipc-test.entry.js +0 -33
  217. package/dist/esm/verdocs-radio-button.entry.js +0 -19
  218. package/dist/esm/verdocs-template-attachments_2.entry.js +0 -231
  219. package/dist/esm-es5/index-914ed6f7.js +0 -1
  220. package/dist/esm-es5/ipc-test.entry.js +0 -1
  221. package/dist/esm-es5/verdocs-radio-button.entry.js +0 -1
  222. package/dist/esm-es5/verdocs-template-attachments_2.entry.js +0 -1
  223. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +0 -1
  224. package/dist/esm-es5/verdocs-template-fields_4.entry.js +0 -1
  225. package/dist/types/components/other/ipctest/ipc-test.d.ts +0 -17
  226. package/dist/types/components/other/ipctest/ipc-test.stories.d.ts +0 -4
  227. package/dist/verdocs-web-sdk/p-52428dff.entry.js +0 -1
  228. package/dist/verdocs-web-sdk/p-58bb657b.entry.js +0 -1
  229. package/dist/verdocs-web-sdk/p-59243dec.entry.js +0 -1
  230. package/dist/verdocs-web-sdk/p-66f9132c.system.entry.js +0 -1
  231. package/dist/verdocs-web-sdk/p-70b42a9c.system.entry.js +0 -1
  232. package/dist/verdocs-web-sdk/p-8c5ffa7b.system.entry.js +0 -1
  233. package/dist/verdocs-web-sdk/p-acaf51f7.system.entry.js +0 -1
  234. package/dist/verdocs-web-sdk/p-c220af42.js +0 -1
  235. package/dist/verdocs-web-sdk/p-c59f1a0a.system.entry.js +0 -1
  236. package/dist/verdocs-web-sdk/p-d4c8f358.entry.js +0 -1
  237. package/dist/verdocs-web-sdk/p-daf19924.entry.js +0 -1
  238. package/dist/verdocs-web-sdk/p-dc9c4361.system.js +0 -1
  239. package/dist/verdocs-web-sdk/p-decf6a56.entry.js +0 -1
  240. package/dist/verdocs-web-sdk/p-f9c6fa6c.system.entry.js +0 -1
  241. package/dist/verdocs-web-sdk/p-fdc4e659.entry.js +0 -1
  242. package/dist/cjs/{VerdocsEndpoint-f2af9468.js → VerdocsEndpoint-e6517a50.js} +30 -30
  243. package/dist/esm/{VerdocsEndpoint-5b92f115.js → VerdocsEndpoint-6d7a17ce.js} +30 -30
@@ -1,21 +1,14 @@
1
- function _typeof(obj) {
2
- "@babel/helpers - typeof";
3
-
4
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
5
- return typeof obj;
6
- } : function (obj) {
7
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
8
- }, _typeof(obj);
9
- }
10
-
11
1
  function toInteger(dirtyNumber) {
12
2
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
13
3
  return NaN;
14
4
  }
5
+
15
6
  var number = Number(dirtyNumber);
7
+
16
8
  if (isNaN(number)) {
17
9
  return number;
18
10
  }
11
+
19
12
  return number < 0 ? Math.ceil(number) : Math.floor(number);
20
13
  }
21
14
 
@@ -25,6 +18,7 @@ function requiredArgs(required, args) {
25
18
  }
26
19
  }
27
20
 
21
+ function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
28
22
  /**
29
23
  * @name toDate
30
24
  * @category Common Helpers
@@ -55,12 +49,12 @@ function requiredArgs(required, args) {
55
49
  * const result = toDate(1392098430000)
56
50
  * //=> Tue Feb 11 2014 11:30:30
57
51
  */
52
+
58
53
  function toDate(argument) {
59
54
  requiredArgs(1, arguments);
60
- var argStr = Object.prototype.toString.call(argument);
55
+ var argStr = Object.prototype.toString.call(argument); // Clone the date
61
56
 
62
- // Clone the date
63
- if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
57
+ if (argument instanceof Date || _typeof$1(argument) === 'object' && argStr === '[object Date]') {
64
58
  // Prevent the date to lose the milliseconds when passed to new Date() in IE10
65
59
  return new Date(argument.getTime());
66
60
  } else if (typeof argument === 'number' || argStr === '[object Number]') {
@@ -68,10 +62,11 @@ function toDate(argument) {
68
62
  } else {
69
63
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
70
64
  // 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
65
+ 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"); // eslint-disable-next-line no-console
66
+
73
67
  console.warn(new Error().stack);
74
68
  }
69
+
75
70
  return new Date(NaN);
76
71
  }
77
72
  }
@@ -94,6 +89,7 @@ function toDate(argument) {
94
89
  * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
95
90
  * //=> Thu Jul 10 2014 12:45:30.750
96
91
  */
92
+
97
93
  function addMilliseconds(dirtyDate, dirtyAmount) {
98
94
  requiredArgs(2, arguments);
99
95
  var timestamp = toDate(dirtyDate).getTime();
@@ -123,6 +119,7 @@ function getTimezoneOffsetInMilliseconds(date) {
123
119
  return date.getTime() - utcDate.getTime();
124
120
  }
125
121
 
122
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
126
123
  /**
127
124
  * @name isDate
128
125
  * @category Common Helpers
@@ -155,6 +152,7 @@ function getTimezoneOffsetInMilliseconds(date) {
155
152
  * const result = isDate({})
156
153
  * //=> false
157
154
  */
155
+
158
156
  function isDate(value) {
159
157
  requiredArgs(1, arguments);
160
158
  return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
@@ -191,11 +189,14 @@ function isDate(value) {
191
189
  * const result = isValid(new Date(''))
192
190
  * //=> false
193
191
  */
192
+
194
193
  function isValid(dirtyDate) {
195
194
  requiredArgs(1, arguments);
195
+
196
196
  if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
197
197
  return false;
198
198
  }
199
+
199
200
  var date = toDate(dirtyDate);
200
201
  return !isNaN(Number(date));
201
202
  }
@@ -218,6 +219,7 @@ function isValid(dirtyDate) {
218
219
  * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
219
220
  * //=> Thu Jul 10 2014 12:45:29.250
220
221
  */
222
+
221
223
  function subMilliseconds(dirtyDate, dirtyAmount) {
222
224
  requiredArgs(2, arguments);
223
225
  var amount = toInteger(dirtyAmount);
@@ -259,6 +261,7 @@ function getUTCISOWeekYear(dirtyDate) {
259
261
  fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
260
262
  fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
261
263
  var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
264
+
262
265
  if (date.getTime() >= startOfNextYear.getTime()) {
263
266
  return year + 1;
264
267
  } else if (date.getTime() >= startOfThisYear.getTime()) {
@@ -282,24 +285,24 @@ var MILLISECONDS_IN_WEEK$1 = 604800000;
282
285
  function getUTCISOWeek(dirtyDate) {
283
286
  requiredArgs(1, arguments);
284
287
  var date = toDate(dirtyDate);
285
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
286
-
287
- // Round the number of days to the nearest integer
288
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
288
289
  // because the number of milliseconds in a week is not constant
289
290
  // (e.g. it's different in the week of the daylight saving time clock shift)
291
+
290
292
  return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
291
293
  }
292
294
 
293
295
  function startOfUTCWeek(dirtyDate, options) {
294
296
  var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
297
+
295
298
  requiredArgs(1, arguments);
296
299
  var defaultOptions = getDefaultOptions();
297
- 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);
300
+ 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); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
298
301
 
299
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
300
302
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
301
303
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
302
304
  }
305
+
303
306
  var date = toDate(dirtyDate);
304
307
  var day = date.getUTCDay();
305
308
  var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
@@ -310,16 +313,17 @@ function startOfUTCWeek(dirtyDate, options) {
310
313
 
311
314
  function getUTCWeekYear(dirtyDate, options) {
312
315
  var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
316
+
313
317
  requiredArgs(1, arguments);
314
318
  var date = toDate(dirtyDate);
315
319
  var year = date.getUTCFullYear();
316
320
  var defaultOptions = getDefaultOptions();
317
- 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);
321
+ 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); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
318
322
 
319
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
320
323
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
321
324
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
322
325
  }
326
+
323
327
  var firstWeekOfNextYear = new Date(0);
324
328
  firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
325
329
  firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
@@ -328,6 +332,7 @@ function getUTCWeekYear(dirtyDate, options) {
328
332
  firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
329
333
  firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
330
334
  var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
335
+
331
336
  if (date.getTime() >= startOfNextYear.getTime()) {
332
337
  return year + 1;
333
338
  } else if (date.getTime() >= startOfThisYear.getTime()) {
@@ -339,6 +344,7 @@ function getUTCWeekYear(dirtyDate, options) {
339
344
 
340
345
  function startOfUTCWeekYear(dirtyDate, options) {
341
346
  var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
347
+
342
348
  requiredArgs(1, arguments);
343
349
  var defaultOptions = getDefaultOptions();
344
350
  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);
@@ -354,20 +360,21 @@ var MILLISECONDS_IN_WEEK = 604800000;
354
360
  function getUTCWeek(dirtyDate, options) {
355
361
  requiredArgs(1, arguments);
356
362
  var date = toDate(dirtyDate);
357
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
358
-
359
- // Round the number of days to the nearest integer
363
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
360
364
  // because the number of milliseconds in a week is not constant
361
365
  // (e.g. it's different in the week of the daylight saving time clock shift)
366
+
362
367
  return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
363
368
  }
364
369
 
365
370
  function addLeadingZeros(number, targetLength) {
366
371
  var sign = number < 0 ? '-' : '';
367
372
  var output = Math.abs(number).toString();
373
+
368
374
  while (output.length < targetLength) {
369
375
  output = '0' + output;
370
376
  }
377
+
371
378
  return sign + output;
372
379
  }
373
380
 
@@ -383,6 +390,7 @@ function addLeadingZeros(number, targetLength) {
383
390
  *
384
391
  * Letters marked by * are not implemented but reserved by Unicode standard.
385
392
  */
393
+
386
394
  var formatters$1 = {
387
395
  // Year
388
396
  y: function y(date, token) {
@@ -394,9 +402,8 @@ var formatters$1 = {
394
402
  // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
395
403
  // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
396
404
  // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
405
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
397
406
 
398
- var signedYear = date.getUTCFullYear();
399
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
400
407
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
401
408
  return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
402
409
  },
@@ -412,14 +419,18 @@ var formatters$1 = {
412
419
  // AM or PM
413
420
  a: function a(date, token) {
414
421
  var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
422
+
415
423
  switch (token) {
416
424
  case 'a':
417
425
  case 'aa':
418
426
  return dayPeriodEnumValue.toUpperCase();
427
+
419
428
  case 'aaa':
420
429
  return dayPeriodEnumValue;
430
+
421
431
  case 'aaaaa':
422
432
  return dayPeriodEnumValue[0];
433
+
423
434
  case 'aaaa':
424
435
  default:
425
436
  return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
@@ -460,6 +471,7 @@ var dayPeriodEnum = {
460
471
  evening: 'evening',
461
472
  night: 'night'
462
473
  };
474
+
463
475
  /*
464
476
  * | | Unit | | Unit |
465
477
  * |-----|--------------------------------|-----|--------------------------------|
@@ -505,11 +517,11 @@ var dayPeriodEnum = {
505
517
  * - `P` is long localized date format
506
518
  * - `p` is long localized time format
507
519
  */
508
-
509
520
  var formatters = {
510
521
  // Era
511
522
  G: function G(date, token, localize) {
512
523
  var era = date.getUTCFullYear() > 0 ? 1 : 0;
524
+
513
525
  switch (token) {
514
526
  // AD, BC
515
527
  case 'G':
@@ -519,11 +531,13 @@ var formatters = {
519
531
  width: 'abbreviated'
520
532
  });
521
533
  // A, B
534
+
522
535
  case 'GGGGG':
523
536
  return localize.era(era, {
524
537
  width: 'narrow'
525
538
  });
526
539
  // Anno Domini, Before Christ
540
+
527
541
  case 'GGGG':
528
542
  default:
529
543
  return localize.era(era, {
@@ -535,42 +549,41 @@ var formatters = {
535
549
  y: function y(date, token, localize) {
536
550
  // Ordinal number
537
551
  if (token === 'yo') {
538
- var signedYear = date.getUTCFullYear();
539
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
552
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
553
+
540
554
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
541
555
  return localize.ordinalNumber(year, {
542
556
  unit: 'year'
543
557
  });
544
558
  }
559
+
545
560
  return formatters$1.y(date, token);
546
561
  },
547
562
  // Local week-numbering year
548
563
  Y: function Y(date, token, localize, options) {
549
- var signedWeekYear = getUTCWeekYear(date, options);
550
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
551
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
564
+ var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
565
+
566
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
552
567
 
553
- // Two digit year
554
568
  if (token === 'YY') {
555
569
  var twoDigitYear = weekYear % 100;
556
570
  return addLeadingZeros(twoDigitYear, 2);
557
- }
571
+ } // Ordinal number
572
+
558
573
 
559
- // Ordinal number
560
574
  if (token === 'Yo') {
561
575
  return localize.ordinalNumber(weekYear, {
562
576
  unit: 'year'
563
577
  });
564
- }
578
+ } // Padding
579
+
565
580
 
566
- // Padding
567
581
  return addLeadingZeros(weekYear, token.length);
568
582
  },
569
583
  // ISO week-numbering year
570
584
  R: function R(date, token) {
571
- var isoWeekYear = getUTCISOWeekYear(date);
585
+ var isoWeekYear = getUTCISOWeekYear(date); // Padding
572
586
 
573
- // Padding
574
587
  return addLeadingZeros(isoWeekYear, token.length);
575
588
  },
576
589
  // Extended year. This is a single number designating the year of this calendar system.
@@ -589,31 +602,37 @@ var formatters = {
589
602
  // Quarter
590
603
  Q: function Q(date, token, localize) {
591
604
  var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
605
+
592
606
  switch (token) {
593
607
  // 1, 2, 3, 4
594
608
  case 'Q':
595
609
  return String(quarter);
596
610
  // 01, 02, 03, 04
611
+
597
612
  case 'QQ':
598
613
  return addLeadingZeros(quarter, 2);
599
614
  // 1st, 2nd, 3rd, 4th
615
+
600
616
  case 'Qo':
601
617
  return localize.ordinalNumber(quarter, {
602
618
  unit: 'quarter'
603
619
  });
604
620
  // Q1, Q2, Q3, Q4
621
+
605
622
  case 'QQQ':
606
623
  return localize.quarter(quarter, {
607
624
  width: 'abbreviated',
608
625
  context: 'formatting'
609
626
  });
610
627
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
628
+
611
629
  case 'QQQQQ':
612
630
  return localize.quarter(quarter, {
613
631
  width: 'narrow',
614
632
  context: 'formatting'
615
633
  });
616
634
  // 1st quarter, 2nd quarter, ...
635
+
617
636
  case 'QQQQ':
618
637
  default:
619
638
  return localize.quarter(quarter, {
@@ -625,31 +644,37 @@ var formatters = {
625
644
  // Stand-alone quarter
626
645
  q: function q(date, token, localize) {
627
646
  var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
647
+
628
648
  switch (token) {
629
649
  // 1, 2, 3, 4
630
650
  case 'q':
631
651
  return String(quarter);
632
652
  // 01, 02, 03, 04
653
+
633
654
  case 'qq':
634
655
  return addLeadingZeros(quarter, 2);
635
656
  // 1st, 2nd, 3rd, 4th
657
+
636
658
  case 'qo':
637
659
  return localize.ordinalNumber(quarter, {
638
660
  unit: 'quarter'
639
661
  });
640
662
  // Q1, Q2, Q3, Q4
663
+
641
664
  case 'qqq':
642
665
  return localize.quarter(quarter, {
643
666
  width: 'abbreviated',
644
667
  context: 'standalone'
645
668
  });
646
669
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
670
+
647
671
  case 'qqqqq':
648
672
  return localize.quarter(quarter, {
649
673
  width: 'narrow',
650
674
  context: 'standalone'
651
675
  });
652
676
  // 1st quarter, 2nd quarter, ...
677
+
653
678
  case 'qqqq':
654
679
  default:
655
680
  return localize.quarter(quarter, {
@@ -661,28 +686,33 @@ var formatters = {
661
686
  // Month
662
687
  M: function M(date, token, localize) {
663
688
  var month = date.getUTCMonth();
689
+
664
690
  switch (token) {
665
691
  case 'M':
666
692
  case 'MM':
667
693
  return formatters$1.M(date, token);
668
694
  // 1st, 2nd, ..., 12th
695
+
669
696
  case 'Mo':
670
697
  return localize.ordinalNumber(month + 1, {
671
698
  unit: 'month'
672
699
  });
673
700
  // Jan, Feb, ..., Dec
701
+
674
702
  case 'MMM':
675
703
  return localize.month(month, {
676
704
  width: 'abbreviated',
677
705
  context: 'formatting'
678
706
  });
679
707
  // J, F, ..., D
708
+
680
709
  case 'MMMMM':
681
710
  return localize.month(month, {
682
711
  width: 'narrow',
683
712
  context: 'formatting'
684
713
  });
685
714
  // January, February, ..., December
715
+
686
716
  case 'MMMM':
687
717
  default:
688
718
  return localize.month(month, {
@@ -694,31 +724,37 @@ var formatters = {
694
724
  // Stand-alone month
695
725
  L: function L(date, token, localize) {
696
726
  var month = date.getUTCMonth();
727
+
697
728
  switch (token) {
698
729
  // 1, 2, ..., 12
699
730
  case 'L':
700
731
  return String(month + 1);
701
732
  // 01, 02, ..., 12
733
+
702
734
  case 'LL':
703
735
  return addLeadingZeros(month + 1, 2);
704
736
  // 1st, 2nd, ..., 12th
737
+
705
738
  case 'Lo':
706
739
  return localize.ordinalNumber(month + 1, {
707
740
  unit: 'month'
708
741
  });
709
742
  // Jan, Feb, ..., Dec
743
+
710
744
  case 'LLL':
711
745
  return localize.month(month, {
712
746
  width: 'abbreviated',
713
747
  context: 'standalone'
714
748
  });
715
749
  // J, F, ..., D
750
+
716
751
  case 'LLLLL':
717
752
  return localize.month(month, {
718
753
  width: 'narrow',
719
754
  context: 'standalone'
720
755
  });
721
756
  // January, February, ..., December
757
+
722
758
  case 'LLLL':
723
759
  default:
724
760
  return localize.month(month, {
@@ -730,21 +766,25 @@ var formatters = {
730
766
  // Local week of year
731
767
  w: function w(date, token, localize, options) {
732
768
  var week = getUTCWeek(date, options);
769
+
733
770
  if (token === 'wo') {
734
771
  return localize.ordinalNumber(week, {
735
772
  unit: 'week'
736
773
  });
737
774
  }
775
+
738
776
  return addLeadingZeros(week, token.length);
739
777
  },
740
778
  // ISO week of year
741
779
  I: function I(date, token, localize) {
742
780
  var isoWeek = getUTCISOWeek(date);
781
+
743
782
  if (token === 'Io') {
744
783
  return localize.ordinalNumber(isoWeek, {
745
784
  unit: 'week'
746
785
  });
747
786
  }
787
+
748
788
  return addLeadingZeros(isoWeek, token.length);
749
789
  },
750
790
  // Day of the month
@@ -754,21 +794,25 @@ var formatters = {
754
794
  unit: 'date'
755
795
  });
756
796
  }
797
+
757
798
  return formatters$1.d(date, token);
758
799
  },
759
800
  // Day of year
760
801
  D: function D(date, token, localize) {
761
802
  var dayOfYear = getUTCDayOfYear(date);
803
+
762
804
  if (token === 'Do') {
763
805
  return localize.ordinalNumber(dayOfYear, {
764
806
  unit: 'dayOfYear'
765
807
  });
766
808
  }
809
+
767
810
  return addLeadingZeros(dayOfYear, token.length);
768
811
  },
769
812
  // Day of week
770
813
  E: function E(date, token, localize) {
771
814
  var dayOfWeek = date.getUTCDay();
815
+
772
816
  switch (token) {
773
817
  // Tue
774
818
  case 'E':
@@ -779,18 +823,21 @@ var formatters = {
779
823
  context: 'formatting'
780
824
  });
781
825
  // T
826
+
782
827
  case 'EEEEE':
783
828
  return localize.day(dayOfWeek, {
784
829
  width: 'narrow',
785
830
  context: 'formatting'
786
831
  });
787
832
  // Tu
833
+
788
834
  case 'EEEEEE':
789
835
  return localize.day(dayOfWeek, {
790
836
  width: 'short',
791
837
  context: 'formatting'
792
838
  });
793
839
  // Tuesday
840
+
794
841
  case 'EEEE':
795
842
  default:
796
843
  return localize.day(dayOfWeek, {
@@ -803,36 +850,43 @@ var formatters = {
803
850
  e: function e(date, token, localize, options) {
804
851
  var dayOfWeek = date.getUTCDay();
805
852
  var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
853
+
806
854
  switch (token) {
807
855
  // Numerical value (Nth day of week with current locale or weekStartsOn)
808
856
  case 'e':
809
857
  return String(localDayOfWeek);
810
858
  // Padded numerical value
859
+
811
860
  case 'ee':
812
861
  return addLeadingZeros(localDayOfWeek, 2);
813
862
  // 1st, 2nd, ..., 7th
863
+
814
864
  case 'eo':
815
865
  return localize.ordinalNumber(localDayOfWeek, {
816
866
  unit: 'day'
817
867
  });
868
+
818
869
  case 'eee':
819
870
  return localize.day(dayOfWeek, {
820
871
  width: 'abbreviated',
821
872
  context: 'formatting'
822
873
  });
823
874
  // T
875
+
824
876
  case 'eeeee':
825
877
  return localize.day(dayOfWeek, {
826
878
  width: 'narrow',
827
879
  context: 'formatting'
828
880
  });
829
881
  // Tu
882
+
830
883
  case 'eeeeee':
831
884
  return localize.day(dayOfWeek, {
832
885
  width: 'short',
833
886
  context: 'formatting'
834
887
  });
835
888
  // Tuesday
889
+
836
890
  case 'eeee':
837
891
  default:
838
892
  return localize.day(dayOfWeek, {
@@ -845,36 +899,43 @@ var formatters = {
845
899
  c: function c(date, token, localize, options) {
846
900
  var dayOfWeek = date.getUTCDay();
847
901
  var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
902
+
848
903
  switch (token) {
849
904
  // Numerical value (same as in `e`)
850
905
  case 'c':
851
906
  return String(localDayOfWeek);
852
907
  // Padded numerical value
908
+
853
909
  case 'cc':
854
910
  return addLeadingZeros(localDayOfWeek, token.length);
855
911
  // 1st, 2nd, ..., 7th
912
+
856
913
  case 'co':
857
914
  return localize.ordinalNumber(localDayOfWeek, {
858
915
  unit: 'day'
859
916
  });
917
+
860
918
  case 'ccc':
861
919
  return localize.day(dayOfWeek, {
862
920
  width: 'abbreviated',
863
921
  context: 'standalone'
864
922
  });
865
923
  // T
924
+
866
925
  case 'ccccc':
867
926
  return localize.day(dayOfWeek, {
868
927
  width: 'narrow',
869
928
  context: 'standalone'
870
929
  });
871
930
  // Tu
931
+
872
932
  case 'cccccc':
873
933
  return localize.day(dayOfWeek, {
874
934
  width: 'short',
875
935
  context: 'standalone'
876
936
  });
877
937
  // Tuesday
938
+
878
939
  case 'cccc':
879
940
  default:
880
941
  return localize.day(dayOfWeek, {
@@ -887,37 +948,44 @@ var formatters = {
887
948
  i: function i(date, token, localize) {
888
949
  var dayOfWeek = date.getUTCDay();
889
950
  var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
951
+
890
952
  switch (token) {
891
953
  // 2
892
954
  case 'i':
893
955
  return String(isoDayOfWeek);
894
956
  // 02
957
+
895
958
  case 'ii':
896
959
  return addLeadingZeros(isoDayOfWeek, token.length);
897
960
  // 2nd
961
+
898
962
  case 'io':
899
963
  return localize.ordinalNumber(isoDayOfWeek, {
900
964
  unit: 'day'
901
965
  });
902
966
  // Tue
967
+
903
968
  case 'iii':
904
969
  return localize.day(dayOfWeek, {
905
970
  width: 'abbreviated',
906
971
  context: 'formatting'
907
972
  });
908
973
  // T
974
+
909
975
  case 'iiiii':
910
976
  return localize.day(dayOfWeek, {
911
977
  width: 'narrow',
912
978
  context: 'formatting'
913
979
  });
914
980
  // Tu
981
+
915
982
  case 'iiiiii':
916
983
  return localize.day(dayOfWeek, {
917
984
  width: 'short',
918
985
  context: 'formatting'
919
986
  });
920
987
  // Tuesday
988
+
921
989
  case 'iiii':
922
990
  default:
923
991
  return localize.day(dayOfWeek, {
@@ -930,6 +998,7 @@ var formatters = {
930
998
  a: function a(date, token, localize) {
931
999
  var hours = date.getUTCHours();
932
1000
  var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1001
+
933
1002
  switch (token) {
934
1003
  case 'a':
935
1004
  case 'aa':
@@ -937,16 +1006,19 @@ var formatters = {
937
1006
  width: 'abbreviated',
938
1007
  context: 'formatting'
939
1008
  });
1009
+
940
1010
  case 'aaa':
941
1011
  return localize.dayPeriod(dayPeriodEnumValue, {
942
1012
  width: 'abbreviated',
943
1013
  context: 'formatting'
944
1014
  }).toLowerCase();
1015
+
945
1016
  case 'aaaaa':
946
1017
  return localize.dayPeriod(dayPeriodEnumValue, {
947
1018
  width: 'narrow',
948
1019
  context: 'formatting'
949
1020
  });
1021
+
950
1022
  case 'aaaa':
951
1023
  default:
952
1024
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -959,6 +1031,7 @@ var formatters = {
959
1031
  b: function b(date, token, localize) {
960
1032
  var hours = date.getUTCHours();
961
1033
  var dayPeriodEnumValue;
1034
+
962
1035
  if (hours === 12) {
963
1036
  dayPeriodEnumValue = dayPeriodEnum.noon;
964
1037
  } else if (hours === 0) {
@@ -966,6 +1039,7 @@ var formatters = {
966
1039
  } else {
967
1040
  dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
968
1041
  }
1042
+
969
1043
  switch (token) {
970
1044
  case 'b':
971
1045
  case 'bb':
@@ -973,16 +1047,19 @@ var formatters = {
973
1047
  width: 'abbreviated',
974
1048
  context: 'formatting'
975
1049
  });
1050
+
976
1051
  case 'bbb':
977
1052
  return localize.dayPeriod(dayPeriodEnumValue, {
978
1053
  width: 'abbreviated',
979
1054
  context: 'formatting'
980
1055
  }).toLowerCase();
1056
+
981
1057
  case 'bbbbb':
982
1058
  return localize.dayPeriod(dayPeriodEnumValue, {
983
1059
  width: 'narrow',
984
1060
  context: 'formatting'
985
1061
  });
1062
+
986
1063
  case 'bbbb':
987
1064
  default:
988
1065
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -995,6 +1072,7 @@ var formatters = {
995
1072
  B: function B(date, token, localize) {
996
1073
  var hours = date.getUTCHours();
997
1074
  var dayPeriodEnumValue;
1075
+
998
1076
  if (hours >= 17) {
999
1077
  dayPeriodEnumValue = dayPeriodEnum.evening;
1000
1078
  } else if (hours >= 12) {
@@ -1004,6 +1082,7 @@ var formatters = {
1004
1082
  } else {
1005
1083
  dayPeriodEnumValue = dayPeriodEnum.night;
1006
1084
  }
1085
+
1007
1086
  switch (token) {
1008
1087
  case 'B':
1009
1088
  case 'BB':
@@ -1012,11 +1091,13 @@ var formatters = {
1012
1091
  width: 'abbreviated',
1013
1092
  context: 'formatting'
1014
1093
  });
1094
+
1015
1095
  case 'BBBBB':
1016
1096
  return localize.dayPeriod(dayPeriodEnumValue, {
1017
1097
  width: 'narrow',
1018
1098
  context: 'formatting'
1019
1099
  });
1100
+
1020
1101
  case 'BBBB':
1021
1102
  default:
1022
1103
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -1034,6 +1115,7 @@ var formatters = {
1034
1115
  unit: 'hour'
1035
1116
  });
1036
1117
  }
1118
+
1037
1119
  return formatters$1.h(date, token);
1038
1120
  },
1039
1121
  // Hour [0-23]
@@ -1043,27 +1125,32 @@ var formatters = {
1043
1125
  unit: 'hour'
1044
1126
  });
1045
1127
  }
1128
+
1046
1129
  return formatters$1.H(date, token);
1047
1130
  },
1048
1131
  // Hour [0-11]
1049
1132
  K: function K(date, token, localize) {
1050
1133
  var hours = date.getUTCHours() % 12;
1134
+
1051
1135
  if (token === 'Ko') {
1052
1136
  return localize.ordinalNumber(hours, {
1053
1137
  unit: 'hour'
1054
1138
  });
1055
1139
  }
1140
+
1056
1141
  return addLeadingZeros(hours, token.length);
1057
1142
  },
1058
1143
  // Hour [1-24]
1059
1144
  k: function k(date, token, localize) {
1060
1145
  var hours = date.getUTCHours();
1061
1146
  if (hours === 0) hours = 24;
1147
+
1062
1148
  if (token === 'ko') {
1063
1149
  return localize.ordinalNumber(hours, {
1064
1150
  unit: 'hour'
1065
1151
  });
1066
1152
  }
1153
+
1067
1154
  return addLeadingZeros(hours, token.length);
1068
1155
  },
1069
1156
  // Minute
@@ -1073,6 +1160,7 @@ var formatters = {
1073
1160
  unit: 'minute'
1074
1161
  });
1075
1162
  }
1163
+
1076
1164
  return formatters$1.m(date, token);
1077
1165
  },
1078
1166
  // Second
@@ -1082,6 +1170,7 @@ var formatters = {
1082
1170
  unit: 'second'
1083
1171
  });
1084
1172
  }
1173
+
1085
1174
  return formatters$1.s(date, token);
1086
1175
  },
1087
1176
  // Fraction of second
@@ -1092,27 +1181,30 @@ var formatters = {
1092
1181
  X: function X(date, token, _localize, options) {
1093
1182
  var originalDate = options._originalDate || date;
1094
1183
  var timezoneOffset = originalDate.getTimezoneOffset();
1184
+
1095
1185
  if (timezoneOffset === 0) {
1096
1186
  return 'Z';
1097
1187
  }
1188
+
1098
1189
  switch (token) {
1099
1190
  // Hours and optional minutes
1100
1191
  case 'X':
1101
1192
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
1102
-
1103
1193
  // Hours, minutes and optional seconds without `:` delimiter
1104
1194
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1105
1195
  // so this token always has the same output as `XX`
1196
+
1106
1197
  case 'XXXX':
1107
1198
  case 'XX':
1108
1199
  // Hours and minutes without `:` delimiter
1109
1200
  return formatTimezone(timezoneOffset);
1110
-
1111
1201
  // Hours, minutes and optional seconds with `:` delimiter
1112
1202
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1113
1203
  // so this token always has the same output as `XXX`
1204
+
1114
1205
  case 'XXXXX':
1115
1206
  case 'XXX': // Hours and minutes with `:` delimiter
1207
+
1116
1208
  default:
1117
1209
  return formatTimezone(timezoneOffset, ':');
1118
1210
  }
@@ -1121,24 +1213,26 @@ var formatters = {
1121
1213
  x: function x(date, token, _localize, options) {
1122
1214
  var originalDate = options._originalDate || date;
1123
1215
  var timezoneOffset = originalDate.getTimezoneOffset();
1216
+
1124
1217
  switch (token) {
1125
1218
  // Hours and optional minutes
1126
1219
  case 'x':
1127
1220
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
1128
-
1129
1221
  // Hours, minutes and optional seconds without `:` delimiter
1130
1222
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1131
1223
  // so this token always has the same output as `xx`
1224
+
1132
1225
  case 'xxxx':
1133
1226
  case 'xx':
1134
1227
  // Hours and minutes without `:` delimiter
1135
1228
  return formatTimezone(timezoneOffset);
1136
-
1137
1229
  // Hours, minutes and optional seconds with `:` delimiter
1138
1230
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1139
1231
  // so this token always has the same output as `xxx`
1232
+
1140
1233
  case 'xxxxx':
1141
1234
  case 'xxx': // Hours and minutes with `:` delimiter
1235
+
1142
1236
  default:
1143
1237
  return formatTimezone(timezoneOffset, ':');
1144
1238
  }
@@ -1147,6 +1241,7 @@ var formatters = {
1147
1241
  O: function O(date, token, _localize, options) {
1148
1242
  var originalDate = options._originalDate || date;
1149
1243
  var timezoneOffset = originalDate.getTimezoneOffset();
1244
+
1150
1245
  switch (token) {
1151
1246
  // Short
1152
1247
  case 'O':
@@ -1154,6 +1249,7 @@ var formatters = {
1154
1249
  case 'OOO':
1155
1250
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1156
1251
  // Long
1252
+
1157
1253
  case 'OOOO':
1158
1254
  default:
1159
1255
  return 'GMT' + formatTimezone(timezoneOffset, ':');
@@ -1163,6 +1259,7 @@ var formatters = {
1163
1259
  z: function z(date, token, _localize, options) {
1164
1260
  var originalDate = options._originalDate || date;
1165
1261
  var timezoneOffset = originalDate.getTimezoneOffset();
1262
+
1166
1263
  switch (token) {
1167
1264
  // Short
1168
1265
  case 'z':
@@ -1170,6 +1267,7 @@ var formatters = {
1170
1267
  case 'zzz':
1171
1268
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1172
1269
  // Long
1270
+
1173
1271
  case 'zzzz':
1174
1272
  default:
1175
1273
  return 'GMT' + formatTimezone(timezoneOffset, ':');
@@ -1188,24 +1286,30 @@ var formatters = {
1188
1286
  return addLeadingZeros(timestamp, token.length);
1189
1287
  }
1190
1288
  };
1289
+
1191
1290
  function formatTimezoneShort(offset, dirtyDelimiter) {
1192
1291
  var sign = offset > 0 ? '-' : '+';
1193
1292
  var absOffset = Math.abs(offset);
1194
1293
  var hours = Math.floor(absOffset / 60);
1195
1294
  var minutes = absOffset % 60;
1295
+
1196
1296
  if (minutes === 0) {
1197
1297
  return sign + String(hours);
1198
1298
  }
1299
+
1199
1300
  var delimiter = dirtyDelimiter || '';
1200
1301
  return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1201
1302
  }
1303
+
1202
1304
  function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1203
1305
  if (offset % 60 === 0) {
1204
1306
  var sign = offset > 0 ? '-' : '+';
1205
1307
  return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1206
1308
  }
1309
+
1207
1310
  return formatTimezone(offset, dirtyDelimiter);
1208
1311
  }
1312
+
1209
1313
  function formatTimezone(offset, dirtyDelimiter) {
1210
1314
  var delimiter = dirtyDelimiter || '';
1211
1315
  var sign = offset > 0 ? '-' : '+';
@@ -1221,14 +1325,17 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1221
1325
  return formatLong.date({
1222
1326
  width: 'short'
1223
1327
  });
1328
+
1224
1329
  case 'PP':
1225
1330
  return formatLong.date({
1226
1331
  width: 'medium'
1227
1332
  });
1333
+
1228
1334
  case 'PPP':
1229
1335
  return formatLong.date({
1230
1336
  width: 'long'
1231
1337
  });
1338
+
1232
1339
  case 'PPPP':
1233
1340
  default:
1234
1341
  return formatLong.date({
@@ -1236,20 +1343,24 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1236
1343
  });
1237
1344
  }
1238
1345
  };
1346
+
1239
1347
  var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1240
1348
  switch (pattern) {
1241
1349
  case 'p':
1242
1350
  return formatLong.time({
1243
1351
  width: 'short'
1244
1352
  });
1353
+
1245
1354
  case 'pp':
1246
1355
  return formatLong.time({
1247
1356
  width: 'medium'
1248
1357
  });
1358
+
1249
1359
  case 'ppp':
1250
1360
  return formatLong.time({
1251
1361
  width: 'long'
1252
1362
  });
1363
+
1253
1364
  case 'pppp':
1254
1365
  default:
1255
1366
  return formatLong.time({
@@ -1257,30 +1368,37 @@ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1257
1368
  });
1258
1369
  }
1259
1370
  };
1371
+
1260
1372
  var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1261
1373
  var matchResult = pattern.match(/(P+)(p+)?/) || [];
1262
1374
  var datePattern = matchResult[1];
1263
1375
  var timePattern = matchResult[2];
1376
+
1264
1377
  if (!timePattern) {
1265
1378
  return dateLongFormatter(pattern, formatLong);
1266
1379
  }
1380
+
1267
1381
  var dateTimeFormat;
1382
+
1268
1383
  switch (datePattern) {
1269
1384
  case 'P':
1270
1385
  dateTimeFormat = formatLong.dateTime({
1271
1386
  width: 'short'
1272
1387
  });
1273
1388
  break;
1389
+
1274
1390
  case 'PP':
1275
1391
  dateTimeFormat = formatLong.dateTime({
1276
1392
  width: 'medium'
1277
1393
  });
1278
1394
  break;
1395
+
1279
1396
  case 'PPP':
1280
1397
  dateTimeFormat = formatLong.dateTime({
1281
1398
  width: 'long'
1282
1399
  });
1283
1400
  break;
1401
+
1284
1402
  case 'PPPP':
1285
1403
  default:
1286
1404
  dateTimeFormat = formatLong.dateTime({
@@ -1288,8 +1406,10 @@ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong)
1288
1406
  });
1289
1407
  break;
1290
1408
  }
1409
+
1291
1410
  return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1292
1411
  };
1412
+
1293
1413
  var longFormatters = {
1294
1414
  p: timeLongFormatter,
1295
1415
  P: dateTimeLongFormatter
@@ -1378,9 +1498,11 @@ var formatDistanceLocale = {
1378
1498
  other: 'almost {{count}} years'
1379
1499
  }
1380
1500
  };
1501
+
1381
1502
  var formatDistance = function formatDistance(token, count, options) {
1382
1503
  var result;
1383
1504
  var tokenValue = formatDistanceLocale[token];
1505
+
1384
1506
  if (typeof tokenValue === 'string') {
1385
1507
  result = tokenValue;
1386
1508
  } else if (count === 1) {
@@ -1388,6 +1510,7 @@ var formatDistance = function formatDistance(token, count, options) {
1388
1510
  } else {
1389
1511
  result = tokenValue.other.replace('{{count}}', count.toString());
1390
1512
  }
1513
+
1391
1514
  if (options !== null && options !== void 0 && options.addSuffix) {
1392
1515
  if (options.comparison && options.comparison > 0) {
1393
1516
  return 'in ' + result;
@@ -1395,6 +1518,7 @@ var formatDistance = function formatDistance(token, count, options) {
1395
1518
  return result + ' ago';
1396
1519
  }
1397
1520
  }
1521
+
1398
1522
  return result;
1399
1523
  };
1400
1524
 
@@ -1449,6 +1573,7 @@ var formatRelativeLocale = {
1449
1573
  nextWeek: "eeee 'at' p",
1450
1574
  other: 'P'
1451
1575
  };
1576
+
1452
1577
  var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1453
1578
  return formatRelativeLocale[token];
1454
1579
  };
@@ -1457,17 +1582,21 @@ function buildLocalizeFn(args) {
1457
1582
  return function (dirtyIndex, options) {
1458
1583
  var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1459
1584
  var valuesArray;
1585
+
1460
1586
  if (context === 'formatting' && args.formattingValues) {
1461
1587
  var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1462
1588
  var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1463
1589
  valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1464
1590
  } else {
1465
1591
  var _defaultWidth = args.defaultWidth;
1592
+
1466
1593
  var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1594
+
1467
1595
  valuesArray = args.values[_width] || args.values[_defaultWidth];
1468
1596
  }
1469
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1470
- // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
1597
+
1598
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
1599
+
1471
1600
  return valuesArray[index];
1472
1601
  };
1473
1602
  }
@@ -1481,12 +1610,11 @@ var quarterValues = {
1481
1610
  narrow: ['1', '2', '3', '4'],
1482
1611
  abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1483
1612
  wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1484
- };
1485
-
1486
- // Note: in English, the names of days of the week and months are capitalized.
1613
+ }; // Note: in English, the names of days of the week and months are capitalized.
1487
1614
  // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1488
1615
  // Generally, formatted dates should look like they are in the middle of a sentence,
1489
1616
  // e.g. in Spanish language the weekdays and months should be in the lowercase.
1617
+
1490
1618
  var monthValues = {
1491
1619
  narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1492
1620
  abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
@@ -1562,10 +1690,9 @@ var formattingDayPeriodValues = {
1562
1690
  night: 'at night'
1563
1691
  }
1564
1692
  };
1565
- var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1566
- var number = Number(dirtyNumber);
1567
1693
 
1568
- // If ordinal numbers depend on context, for example,
1694
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1695
+ var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
1569
1696
  // if they are different for different grammatical genders,
1570
1697
  // use `options.unit`.
1571
1698
  //
@@ -1573,18 +1700,23 @@ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1573
1700
  // 'day', 'hour', 'minute', 'second'.
1574
1701
 
1575
1702
  var rem100 = number % 100;
1703
+
1576
1704
  if (rem100 > 20 || rem100 < 10) {
1577
1705
  switch (rem100 % 10) {
1578
1706
  case 1:
1579
1707
  return number + 'st';
1708
+
1580
1709
  case 2:
1581
1710
  return number + 'nd';
1711
+
1582
1712
  case 3:
1583
1713
  return number + 'rd';
1584
1714
  }
1585
1715
  }
1716
+
1586
1717
  return number + 'th';
1587
1718
  };
1719
+
1588
1720
  var localize = {
1589
1721
  ordinalNumber: ordinalNumber,
1590
1722
  era: buildLocalizeFn({
@@ -1620,9 +1752,11 @@ function buildMatchFn(args) {
1620
1752
  var width = options.width;
1621
1753
  var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1622
1754
  var matchResult = string.match(matchPattern);
1755
+
1623
1756
  if (!matchResult) {
1624
1757
  return null;
1625
1758
  }
1759
+
1626
1760
  var matchedString = matchResult[0];
1627
1761
  var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1628
1762
  var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
@@ -1640,20 +1774,24 @@ function buildMatchFn(args) {
1640
1774
  };
1641
1775
  };
1642
1776
  }
1777
+
1643
1778
  function findKey(object, predicate) {
1644
1779
  for (var key in object) {
1645
1780
  if (object.hasOwnProperty(key) && predicate(object[key])) {
1646
1781
  return key;
1647
1782
  }
1648
1783
  }
1784
+
1649
1785
  return undefined;
1650
1786
  }
1787
+
1651
1788
  function findIndex(array, predicate) {
1652
1789
  for (var key = 0; key < array.length; key++) {
1653
1790
  if (predicate(array[key])) {
1654
1791
  return key;
1655
1792
  }
1656
1793
  }
1794
+
1657
1795
  return undefined;
1658
1796
  }
1659
1797
 
@@ -1788,7 +1926,9 @@ var locale = {
1788
1926
  localize: localize,
1789
1927
  match: match,
1790
1928
  options: {
1791
- weekStartsOn: 0 /* Sunday */,
1929
+ weekStartsOn: 0
1930
+ /* Sunday */
1931
+ ,
1792
1932
  firstWeekContainsDate: 1
1793
1933
  }
1794
1934
  };
@@ -1803,15 +1943,14 @@ var locale = {
1803
1943
  // If there is no matching single quote
1804
1944
  // then the sequence will continue until the end of the string.
1805
1945
  // - . matches any single character unmatched by previous parts of the RegExps
1806
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1807
1946
 
1808
- // This RegExp catches symbols escaped by quotes, and also
1947
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
1809
1948
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
1949
+
1810
1950
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1811
1951
  var escapedStringRegExp = /^'([^]*?)'?$/;
1812
1952
  var doubleQuoteRegExp = /''/g;
1813
1953
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1814
-
1815
1954
  /**
1816
1955
  * @name format
1817
1956
  * @category Common Helpers
@@ -2106,36 +2245,40 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2106
2245
 
2107
2246
  function format(dirtyDate, dirtyFormatStr, options) {
2108
2247
  var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
2248
+
2109
2249
  requiredArgs(2, arguments);
2110
2250
  var formatStr = String(dirtyFormatStr);
2111
2251
  var defaultOptions = getDefaultOptions();
2112
2252
  var locale$1 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : locale;
2113
- var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_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$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_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 && _ref2 !== void 0 ? _ref2 : 1);
2253
+ var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_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$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_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 && _ref2 !== void 0 ? _ref2 : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2114
2254
 
2115
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2116
2255
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2117
2256
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2118
2257
  }
2119
- var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_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$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
2120
2258
 
2121
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2259
+ var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_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$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2260
+
2122
2261
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2123
2262
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2124
2263
  }
2264
+
2125
2265
  if (!locale$1.localize) {
2126
2266
  throw new RangeError('locale must contain localize property');
2127
2267
  }
2268
+
2128
2269
  if (!locale$1.formatLong) {
2129
2270
  throw new RangeError('locale must contain formatLong property');
2130
2271
  }
2272
+
2131
2273
  var originalDate = toDate(dirtyDate);
2274
+
2132
2275
  if (!isValid(originalDate)) {
2133
2276
  throw new RangeError('Invalid time value');
2134
- }
2135
-
2136
- // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2277
+ } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2137
2278
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2138
2279
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2280
+
2281
+
2139
2282
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2140
2283
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
2141
2284
  var formatterOptions = {
@@ -2146,42 +2289,55 @@ function format(dirtyDate, dirtyFormatStr, options) {
2146
2289
  };
2147
2290
  var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2148
2291
  var firstCharacter = substring[0];
2292
+
2149
2293
  if (firstCharacter === 'p' || firstCharacter === 'P') {
2150
2294
  var longFormatter = longFormatters[firstCharacter];
2151
2295
  return longFormatter(substring, locale$1.formatLong);
2152
2296
  }
2297
+
2153
2298
  return substring;
2154
2299
  }).join('').match(formattingTokensRegExp).map(function (substring) {
2155
2300
  // Replace two single quote characters with one single quote character
2156
2301
  if (substring === "''") {
2157
2302
  return "'";
2158
2303
  }
2304
+
2159
2305
  var firstCharacter = substring[0];
2306
+
2160
2307
  if (firstCharacter === "'") {
2161
2308
  return cleanEscapedString(substring);
2162
2309
  }
2310
+
2163
2311
  var formatter = formatters[firstCharacter];
2312
+
2164
2313
  if (formatter) {
2165
2314
  if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2166
2315
  throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2167
2316
  }
2317
+
2168
2318
  if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2169
2319
  throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2170
2320
  }
2321
+
2171
2322
  return formatter(utcDate, substring, locale$1.localize, formatterOptions);
2172
2323
  }
2324
+
2173
2325
  if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2174
2326
  throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2175
2327
  }
2328
+
2176
2329
  return substring;
2177
2330
  }).join('');
2178
2331
  return result;
2179
2332
  }
2333
+
2180
2334
  function cleanEscapedString(input) {
2181
2335
  var matched = input.match(escapedStringRegExp);
2336
+
2182
2337
  if (!matched) {
2183
2338
  return input;
2184
2339
  }
2340
+
2185
2341
  return matched[1].replace(doubleQuoteRegExp, "'");
2186
2342
  }
2187
2343