bromcom-ui 2.12.3-rc.3-test.0 → 2.12.4-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (365) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/{p-0e5f1168.entry.js → p-0089f9c5.entry.js} +1 -1
  3. package/dist/bromcom-ui/{p-b9a88f16.entry.js → p-03cc10f8.entry.js} +1 -1
  4. package/dist/bromcom-ui/{p-33166492.entry.js → p-075dd6ba.entry.js} +1 -1
  5. package/dist/bromcom-ui/{p-95a797b3.entry.js → p-07971537.entry.js} +1 -1
  6. package/dist/bromcom-ui/{p-2cd6cdee.js → p-0d952c81.js} +1 -1
  7. package/dist/bromcom-ui/p-0e97b110.js +5 -0
  8. package/dist/bromcom-ui/p-12687eaa.entry.js +5 -0
  9. package/dist/bromcom-ui/{p-a0f44b56.entry.js → p-1441edac.entry.js} +1 -1
  10. package/dist/bromcom-ui/{p-1345d51b.entry.js → p-17bc7e7e.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-b43e975b.entry.js → p-1ac9eb84.entry.js} +1 -1
  12. package/dist/bromcom-ui/p-1bf1e8ad.entry.js +5 -0
  13. package/dist/bromcom-ui/p-1c8ed0b3.entry.js +5 -0
  14. package/dist/bromcom-ui/{p-1e61a44c.entry.js → p-1d663e83.entry.js} +1 -1
  15. package/dist/bromcom-ui/{p-10f511ff.entry.js → p-1fb713c8.entry.js} +1 -1
  16. package/dist/bromcom-ui/p-21b4ca2e.entry.js +5 -0
  17. package/dist/bromcom-ui/{p-7c5763cc.entry.js → p-2a15a39d.entry.js} +1 -1
  18. package/dist/bromcom-ui/p-2ebe3b67.entry.js +5 -0
  19. package/dist/bromcom-ui/p-30a11f2e.entry.js +5 -0
  20. package/dist/bromcom-ui/p-30cc83af.js +5 -0
  21. package/dist/bromcom-ui/{p-c77541f4.js → p-3182df7e.js} +2 -2
  22. package/dist/bromcom-ui/{p-c49b6287.entry.js → p-32a5791b.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-228c74e9.entry.js → p-33d204f1.entry.js} +1 -1
  24. package/dist/bromcom-ui/{p-eef8f7c7.entry.js → p-348e74e9.entry.js} +1 -1
  25. package/dist/bromcom-ui/{p-dd24646a.entry.js → p-34b9cf32.entry.js} +1 -1
  26. package/dist/bromcom-ui/{p-2bd0545e.js → p-379b00d6.js} +1 -1
  27. package/dist/bromcom-ui/{p-74e6d2b6.js → p-38a52254.js} +1 -1
  28. package/dist/bromcom-ui/{p-8c018ae0.js → p-3c7a0345.js} +1 -1
  29. package/dist/bromcom-ui/{p-e94d2f48.js → p-3e12382d.js} +1 -1
  30. package/dist/bromcom-ui/{p-01e63843.entry.js → p-40a29024.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-87192588.entry.js → p-4211b6bb.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-aeb4be41.js → p-4680865d.js} +1 -1
  33. package/dist/bromcom-ui/{p-412abc6d.entry.js → p-49c6a7eb.entry.js} +1 -1
  34. package/dist/bromcom-ui/{p-9ebe6ef9.entry.js → p-4b5c5f62.entry.js} +1 -1
  35. package/dist/bromcom-ui/p-4c2e776d.entry.js +5 -0
  36. package/dist/bromcom-ui/{p-7dbfff1b.entry.js → p-4c9c2159.entry.js} +1 -1
  37. package/dist/bromcom-ui/{p-170cf07d.js → p-50a1591e.js} +1 -1
  38. package/dist/bromcom-ui/{p-32c55505.entry.js → p-55a44163.entry.js} +1 -1
  39. package/dist/bromcom-ui/{p-c39e73dc.entry.js → p-56b45430.entry.js} +1 -1
  40. package/dist/bromcom-ui/{p-7e44e6b5.js → p-5ae0a59b.js} +1 -1
  41. package/dist/bromcom-ui/{p-d59d9687.entry.js → p-63646141.entry.js} +1 -1
  42. package/dist/bromcom-ui/p-646c8ea2.entry.js +5 -0
  43. package/dist/bromcom-ui/{p-80edaf47.entry.js → p-652c1d30.entry.js} +1 -1
  44. package/dist/bromcom-ui/{p-9850cbce.js → p-65783175.js} +1 -1
  45. package/dist/bromcom-ui/{p-904b0c28.entry.js → p-69e3b4f9.entry.js} +1 -1
  46. package/dist/bromcom-ui/p-6b3bf457.entry.js +5 -0
  47. package/dist/bromcom-ui/{p-a0d6d680.js → p-6b5ed4d8.js} +1 -1
  48. package/dist/bromcom-ui/p-6e5f5f36.js +1 -1
  49. package/dist/bromcom-ui/{p-926b314d.entry.js → p-6fa98b12.entry.js} +1 -1
  50. package/dist/bromcom-ui/p-7247ac65.entry.js +5 -0
  51. package/dist/bromcom-ui/{p-e36c7523.entry.js → p-7505325c.entry.js} +1 -1
  52. package/dist/bromcom-ui/p-76edf59f.js +7 -0
  53. package/dist/bromcom-ui/p-7ae23e76.entry.js +5 -0
  54. package/dist/bromcom-ui/{p-ead59725.entry.js → p-7b6d3a77.entry.js} +1 -1
  55. package/dist/bromcom-ui/{p-0e110a9f.entry.js → p-7dd0467a.entry.js} +1 -1
  56. package/dist/bromcom-ui/{p-6bea284a.js → p-8129ed3a.js} +1 -1
  57. package/dist/bromcom-ui/p-815f1132.entry.js +5 -0
  58. package/dist/bromcom-ui/{p-9b59c689.entry.js → p-826a85ed.entry.js} +1 -1
  59. package/dist/bromcom-ui/p-852fd092.entry.js +5 -0
  60. package/dist/bromcom-ui/{p-ede7ca76.entry.js → p-85aa9dfd.entry.js} +1 -1
  61. package/dist/bromcom-ui/{p-507db92e.entry.js → p-874053cc.entry.js} +1 -1
  62. package/dist/bromcom-ui/{p-23759244.entry.js → p-8baa08ea.entry.js} +1 -1
  63. package/dist/bromcom-ui/{p-e5532875.entry.js → p-8c7e1bea.entry.js} +1 -1
  64. package/dist/bromcom-ui/p-8dda8873.js +14 -0
  65. package/dist/bromcom-ui/p-8ee40a96.js +5 -0
  66. package/dist/bromcom-ui/{p-270e1b24.entry.js → p-90b5befd.entry.js} +1 -1
  67. package/dist/bromcom-ui/{p-ae57f046.entry.js → p-935f57ad.entry.js} +1 -1
  68. package/dist/bromcom-ui/p-9402a607.entry.js +5 -0
  69. package/dist/bromcom-ui/{p-eca0acda.js → p-9695f7c9.js} +1 -1
  70. package/dist/bromcom-ui/{p-d2bd0293.entry.js → p-97bc1843.entry.js} +1 -1
  71. package/dist/bromcom-ui/{p-3da7b6c0.entry.js → p-9b080d5d.entry.js} +1 -1
  72. package/dist/bromcom-ui/p-9b8e6484.entry.js +5 -0
  73. package/dist/bromcom-ui/p-9d1e255a.js +5 -0
  74. package/dist/bromcom-ui/{p-fafa70ac.entry.js → p-9db3dcfa.entry.js} +1 -1
  75. package/dist/bromcom-ui/{p-cf11cdde.entry.js → p-9eb250d4.entry.js} +1 -1
  76. package/dist/bromcom-ui/p-a313fba6.js +1 -1
  77. package/dist/bromcom-ui/{p-1b558b0f.entry.js → p-a4f0590d.entry.js} +1 -1
  78. package/dist/bromcom-ui/{p-7e0e02b3.js → p-aa6887d7.js} +1 -1
  79. package/dist/bromcom-ui/p-ac949369.entry.js +5 -0
  80. package/dist/bromcom-ui/p-ad295560.entry.js +5 -0
  81. package/dist/bromcom-ui/{p-a6aa173f.entry.js → p-b1382dbd.entry.js} +1 -1
  82. package/dist/bromcom-ui/{p-25bbe3e6.entry.js → p-b1754fc5.entry.js} +1 -1
  83. package/dist/bromcom-ui/{p-822dda00.js → p-b3faa68b.js} +1 -1
  84. package/dist/bromcom-ui/{p-e8eaa3bb.entry.js → p-b4b9ca15.entry.js} +1 -1
  85. package/dist/bromcom-ui/p-b5bdc541.entry.js +5 -0
  86. package/dist/bromcom-ui/{p-9253d439.entry.js → p-b689c630.entry.js} +1 -1
  87. package/dist/bromcom-ui/p-b716412b.entry.js +5 -0
  88. package/dist/bromcom-ui/p-bed627ab.js +11 -0
  89. package/dist/bromcom-ui/p-bfdf9447.entry.js +5 -0
  90. package/dist/bromcom-ui/{p-2b42d77e.entry.js → p-c097f624.entry.js} +1 -1
  91. package/dist/bromcom-ui/{p-77ef609e.entry.js → p-c0aa5289.entry.js} +1 -1
  92. package/dist/bromcom-ui/{p-5d670fd7.entry.js → p-c3b74f76.entry.js} +1 -1
  93. package/dist/bromcom-ui/{p-15402dac.entry.js → p-c621138a.entry.js} +1 -1
  94. package/dist/bromcom-ui/p-c9d35a7a.entry.js +5 -0
  95. package/dist/bromcom-ui/{p-881853bd.entry.js → p-d0833fd3.entry.js} +1 -1
  96. package/dist/bromcom-ui/{p-b1084320.entry.js → p-d1dbebf6.entry.js} +1 -1
  97. package/dist/bromcom-ui/{p-8b6d3a37.js → p-d2f863d9.js} +1 -1
  98. package/dist/bromcom-ui/{p-9f5ee998.entry.js → p-d4c75e60.entry.js} +1 -1
  99. package/dist/bromcom-ui/{p-6687afd7.entry.js → p-d6c99f1f.entry.js} +1 -1
  100. package/dist/bromcom-ui/{p-46db5206.js → p-daa32fc1.js} +1 -1
  101. package/dist/bromcom-ui/{p-534f958a.entry.js → p-dc3275aa.entry.js} +1 -1
  102. package/dist/bromcom-ui/p-dccb9b5f.entry.js +5 -0
  103. package/dist/bromcom-ui/{p-c503526a.entry.js → p-de1f21b5.entry.js} +1 -1
  104. package/dist/bromcom-ui/{p-1f93fd33.entry.js → p-de23b7bf.entry.js} +1 -1
  105. package/dist/bromcom-ui/{p-59f7fa84.entry.js → p-defdd05b.entry.js} +1 -1
  106. package/dist/bromcom-ui/{p-e1b6f98e.entry.js → p-e3f8efa5.entry.js} +1 -1
  107. package/dist/bromcom-ui/{p-6657830f.js → p-e45c1546.js} +1 -1
  108. package/dist/bromcom-ui/{p-fc787048.entry.js → p-ee1b4a47.entry.js} +1 -1
  109. package/dist/bromcom-ui/p-f0469946.entry.js +5 -0
  110. package/dist/bromcom-ui/p-f2fc3d54.entry.js +5 -0
  111. package/dist/bromcom-ui/{p-c1a992e7.entry.js → p-f3c9ad5e.entry.js} +1 -1
  112. package/dist/bromcom-ui/{p-6ceb315f.entry.js → p-f6f37125.entry.js} +1 -1
  113. package/dist/bromcom-ui/{p-a486613b.entry.js → p-f815dc7a.entry.js} +1 -1
  114. package/dist/bromcom-ui/{p-052005c9.js → p-f82db5dd.js} +1 -1
  115. package/dist/bromcom-ui/{p-a352f45e.entry.js → p-f86515f0.entry.js} +1 -1
  116. package/dist/bromcom-ui/p-f908af03.entry.js +5 -0
  117. package/dist/bromcom-ui/{p-8cd80ac4.entry.js → p-f9c32e82.entry.js} +1 -1
  118. package/dist/bromcom-ui/{p-67343ad8.entry.js → p-fcbd8a75.entry.js} +1 -1
  119. package/dist/bromcom-ui/{p-beaec5b8.js → p-fcc6f71e.js} +1 -1
  120. package/dist/bromcom-ui/p-fd0c42ae.entry.js +5 -0
  121. package/dist/cjs/{Overflow-5a73947b.js → Overflow-ebad34dd.js} +579 -520
  122. package/dist/cjs/{bcm-1d1fcf21.js → bcm-489c9b1a.js} +4 -4
  123. package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
  124. package/dist/cjs/bcm-alert.cjs.entry.js +4 -4
  125. package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +8 -8
  126. package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +8 -8
  127. package/dist/cjs/bcm-attendance-actions.cjs.entry.js +7 -7
  128. package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
  129. package/dist/cjs/bcm-avatar_2.cjs.entry.js +10 -10
  130. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
  131. package/dist/cjs/bcm-button-group.cjs.entry.js +7 -7
  132. package/dist/cjs/bcm-button.cjs.entry.js +12 -12
  133. package/dist/cjs/bcm-caption.cjs.entry.js +8 -8
  134. package/dist/cjs/bcm-card.cjs.entry.js +5 -5
  135. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +7 -7
  136. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +6 -6
  137. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +10 -10
  138. package/dist/cjs/bcm-chip-group.cjs.entry.js +8 -8
  139. package/dist/cjs/bcm-chip.cjs.entry.js +2 -2
  140. package/dist/cjs/bcm-collapse.cjs.entry.js +2 -2
  141. package/dist/cjs/bcm-color-input.cjs.entry.js +6 -6
  142. package/dist/cjs/bcm-colorful_2.cjs.entry.js +12 -12
  143. package/dist/cjs/bcm-date-picker.cjs.entry.js +4 -4
  144. package/dist/cjs/bcm-date.cjs.entry.js +182 -0
  145. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +8 -8
  146. package/dist/cjs/bcm-default.cjs.entry.js +2 -2
  147. package/dist/cjs/bcm-drawer.cjs.entry.js +8 -8
  148. package/dist/cjs/bcm-dropdown.cjs.entry.js +7 -7
  149. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +4 -4
  150. package/dist/cjs/bcm-form-2.cjs.entry.js +5 -5
  151. package/dist/cjs/bcm-form.cjs.entry.js +492 -0
  152. package/dist/cjs/{bcm-list_3.cjs.entry.js → bcm-icon_6.cjs.entry.js} +282 -107
  153. package/dist/cjs/bcm-input-2.cjs.entry.js +6 -6
  154. package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
  155. package/dist/cjs/bcm-input-dropdown.cjs.entry.js +8 -8
  156. package/dist/cjs/bcm-input_2.cjs.entry.js +15 -15
  157. package/dist/cjs/bcm-item.cjs.entry.js +4 -4
  158. package/dist/cjs/bcm-items.cjs.entry.js +4 -4
  159. package/dist/cjs/bcm-link.cjs.entry.js +3 -3
  160. package/dist/cjs/bcm-menu.cjs.entry.js +8 -8
  161. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +6 -6
  162. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +6 -6
  163. package/dist/cjs/bcm-modal-2.cjs.entry.js +7 -7
  164. package/dist/cjs/bcm-modal.cjs.entry.js +7 -7
  165. package/dist/cjs/bcm-number-input.cjs.entry.js +7 -7
  166. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +5 -5
  167. package/dist/cjs/bcm-popconfirm.cjs.entry.js +5 -5
  168. package/dist/cjs/bcm-popover.cjs.entry.js +9 -9
  169. package/dist/cjs/bcm-progress.cjs.entry.js +4 -4
  170. package/dist/cjs/bcm-radio-group.cjs.entry.js +10 -10
  171. package/dist/cjs/bcm-radio.cjs.entry.js +13 -13
  172. package/dist/cjs/bcm-range.cjs.entry.js +6 -6
  173. package/dist/cjs/{bcm-date_6.cjs.entry.js → bcm-rc-picker.cjs.entry.js} +3615 -8743
  174. package/dist/cjs/bcm-select.cjs.entry.js +2 -2
  175. package/dist/cjs/bcm-shortcut.cjs.entry.js +10 -10
  176. package/dist/cjs/bcm-skeleton.cjs.entry.js +6 -6
  177. package/dist/cjs/bcm-step.cjs.entry.js +3 -3
  178. package/dist/cjs/bcm-stepper.cjs.entry.js +9 -9
  179. package/dist/cjs/bcm-switch.cjs.entry.js +9 -9
  180. package/dist/cjs/bcm-tab-group.cjs.entry.js +7 -7
  181. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +10 -10
  182. package/dist/cjs/bcm-tab-item.cjs.entry.js +6 -6
  183. package/dist/cjs/bcm-table.cjs.entry.js +6 -6
  184. package/dist/cjs/bcm-tag.cjs.entry.js +15 -15
  185. package/dist/cjs/bcm-text.cjs.entry.js +3 -3
  186. package/dist/cjs/bcm-time-picker.cjs.entry.js +4 -4
  187. package/dist/cjs/bcm-toast.cjs.entry.js +11 -11
  188. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  189. package/dist/cjs/{floating-ui-5b396838.js → floating-ui-21890d11.js} +2 -2
  190. package/dist/cjs/{generate-bff3fa38.js → generate-b55bc9ac.js} +14 -14
  191. package/dist/cjs/{global-825d9cd4.js → global-ae5a410a.js} +1 -1
  192. package/dist/cjs/{input-template-d05a507f.js → input-template-4f41f5f2.js} +6 -6
  193. package/dist/cjs/{json-parse-decarator-b9186302.js → json-parse-decarator-ca73e0ee.js} +1 -1
  194. package/dist/cjs/{label-template-e83447b5.js → label-template-6da4808b.js} +2 -2
  195. package/dist/cjs/loader.cjs.js +3 -3
  196. package/dist/cjs/moment-d06b012f.js +4601 -0
  197. package/dist/cjs/{number-helper-9bc46d37.js → number-helper-4a5c0bb5.js} +1 -1
  198. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +7 -7
  199. package/dist/cjs/old-bcm-popover.cjs.entry.js +5 -5
  200. package/dist/cjs/{package-dda6f822.js → package-1757d4e0.js} +1 -1
  201. package/dist/cjs/{popover-placement-02e6101b.js → popover-placement-e7d6eabd.js} +1 -1
  202. package/dist/cjs/{slot-template-df7b5b59.js → slot-template-c8e2816c.js} +1 -1
  203. package/dist/cjs/{stepper-states-a565a45f.js → stepper-states-969da6c3.js} +1 -1
  204. package/dist/cjs/{string-helper-9cdfb273.js → string-helper-f9184277.js} +2 -2
  205. package/dist/cjs/{tooltip-helper-2e1f4fda.js → tooltip-helper-a45a6cd4.js} +9 -9
  206. package/dist/cjs/{validators-c0eef77a.js → validators-51a16def.js} +1 -1
  207. package/dist/collection/components/organism/list/list.js +73 -19
  208. package/dist/components/Overflow.js +141 -83
  209. package/dist/components/generate.js +1 -1
  210. package/dist/components/list.js +56 -19
  211. package/dist/components/rc-picker.js +2650 -2403
  212. package/dist/esm/{Overflow-40c63001.js → Overflow-65c2db90.js} +581 -523
  213. package/dist/esm/{_commonjsHelpers-82aa9212.js → _commonjsHelpers-be0d4ec8.js} +1 -1
  214. package/dist/esm/bcm-a50d55ba.js +1 -1
  215. package/dist/esm/bcm-accordion.entry.js +5 -5
  216. package/dist/esm/bcm-alert.entry.js +8 -8
  217. package/dist/esm/bcm-attendance-actions-comment.entry.js +12 -12
  218. package/dist/esm/bcm-attendance-actions-dropdown.entry.js +13 -13
  219. package/dist/esm/bcm-attendance-actions.entry.js +13 -13
  220. package/dist/esm/bcm-attendance.entry.js +5 -5
  221. package/dist/esm/bcm-autocomplete.entry.js +3 -3
  222. package/dist/esm/bcm-avatar_2.entry.js +12 -12
  223. package/dist/esm/bcm-box.entry.js +1 -1
  224. package/dist/esm/bcm-breadcrumb.entry.js +6 -6
  225. package/dist/esm/bcm-button-group.entry.js +8 -8
  226. package/dist/esm/bcm-button.entry.js +12 -12
  227. package/dist/esm/bcm-caption.entry.js +14 -14
  228. package/dist/esm/bcm-card.entry.js +10 -10
  229. package/dist/esm/bcm-checkbox-group.entry.js +11 -11
  230. package/dist/esm/bcm-checkbox-lite_9.entry.js +8 -8
  231. package/dist/esm/bcm-checkbox_2.entry.js +13 -13
  232. package/dist/esm/bcm-chip-group.entry.js +15 -15
  233. package/dist/esm/bcm-chip.entry.js +8 -8
  234. package/dist/esm/bcm-collapse-group.entry.js +2 -2
  235. package/dist/esm/bcm-collapse.entry.js +7 -7
  236. package/dist/esm/bcm-color-input.entry.js +11 -11
  237. package/dist/esm/bcm-colorful_2.entry.js +14 -14
  238. package/dist/esm/bcm-colorpicker.entry.js +5 -5
  239. package/dist/esm/bcm-content.entry.js +1 -1
  240. package/dist/esm/bcm-date-picker.entry.js +9 -9
  241. package/dist/esm/bcm-date.entry.js +178 -0
  242. package/dist/esm/bcm-datetime-picker.entry.js +13 -13
  243. package/dist/esm/bcm-default.entry.js +5 -5
  244. package/dist/esm/bcm-drawer.entry.js +13 -13
  245. package/dist/esm/bcm-dropdown.entry.js +9 -9
  246. package/dist/esm/bcm-error-layout.entry.js +3 -3
  247. package/dist/esm/bcm-expansion-panel.entry.js +9 -9
  248. package/dist/esm/bcm-form-2.entry.js +8 -8
  249. package/dist/esm/bcm-form-group.entry.js +1 -1
  250. package/dist/esm/bcm-form.entry.js +488 -0
  251. package/dist/esm/{bcm-list_3.entry.js → bcm-icon_6.entry.js} +213 -41
  252. package/dist/esm/bcm-input-2.entry.js +9 -9
  253. package/dist/esm/bcm-input-custom.entry.js +6 -6
  254. package/dist/esm/bcm-input-dropdown.entry.js +14 -14
  255. package/dist/esm/bcm-input_2.entry.js +14 -14
  256. package/dist/esm/bcm-item.entry.js +9 -9
  257. package/dist/esm/bcm-items.entry.js +6 -6
  258. package/dist/esm/bcm-link.entry.js +4 -4
  259. package/dist/esm/bcm-menu.entry.js +14 -14
  260. package/dist/esm/bcm-message.entry.js +3 -3
  261. package/dist/esm/bcm-modal-2-footer.entry.js +12 -12
  262. package/dist/esm/bcm-modal-2-header.entry.js +11 -11
  263. package/dist/esm/bcm-modal-2.entry.js +13 -13
  264. package/dist/esm/bcm-modal.entry.js +9 -9
  265. package/dist/esm/bcm-notification.entry.js +3 -3
  266. package/dist/esm/bcm-number-input.entry.js +14 -14
  267. package/dist/esm/bcm-old-input.entry.js +5 -5
  268. package/dist/esm/bcm-old-tag_2.entry.js +4 -4
  269. package/dist/esm/bcm-overlay_2.entry.js +4 -4
  270. package/dist/esm/bcm-popconfirm-box.entry.js +10 -10
  271. package/dist/esm/bcm-popconfirm.entry.js +7 -7
  272. package/dist/esm/bcm-popover.entry.js +12 -12
  273. package/dist/esm/bcm-progress.entry.js +9 -9
  274. package/dist/esm/bcm-radio-group.entry.js +15 -15
  275. package/dist/esm/bcm-radio.entry.js +13 -13
  276. package/dist/esm/bcm-range.entry.js +8 -8
  277. package/dist/esm/{bcm-date_6.entry.js → bcm-rc-picker.entry.js} +3329 -8452
  278. package/dist/esm/bcm-react-number.entry.js +3 -3
  279. package/dist/esm/bcm-result.entry.js +3 -3
  280. package/dist/esm/bcm-select-group.entry.js +3 -3
  281. package/dist/esm/bcm-select-option.entry.js +3 -3
  282. package/dist/esm/bcm-select.entry.js +5 -5
  283. package/dist/esm/bcm-shortcut.entry.js +13 -13
  284. package/dist/esm/bcm-skeleton.entry.js +11 -11
  285. package/dist/esm/bcm-step.entry.js +8 -8
  286. package/dist/esm/bcm-stepper.entry.js +15 -15
  287. package/dist/esm/bcm-switch.entry.js +10 -10
  288. package/dist/esm/bcm-tab-group.entry.js +12 -12
  289. package/dist/esm/bcm-tab-item-header.entry.js +13 -13
  290. package/dist/esm/bcm-tab-item.entry.js +11 -11
  291. package/dist/esm/bcm-tab-pane.entry.js +3 -3
  292. package/dist/esm/bcm-tab.entry.js +3 -3
  293. package/dist/esm/bcm-table.entry.js +12 -12
  294. package/dist/esm/bcm-tabs-content.entry.js +4 -4
  295. package/dist/esm/bcm-tabs.entry.js +4 -4
  296. package/dist/esm/bcm-tag.entry.js +9 -9
  297. package/dist/esm/bcm-text.entry.js +8 -8
  298. package/dist/esm/bcm-time-picker.entry.js +9 -9
  299. package/dist/esm/bcm-timeline-item.entry.js +3 -3
  300. package/dist/esm/bcm-timeline.entry.js +3 -3
  301. package/dist/esm/bcm-toast.entry.js +9 -9
  302. package/dist/esm/bcm-treeview-group.entry.js +1 -1
  303. package/dist/esm/bromcom-ui.js +5 -5
  304. package/dist/esm/{caption-template-d7953d13.js → caption-template-9d0ea503.js} +2 -2
  305. package/dist/esm/{color-helper-74614f24.js → color-helper-e74656af.js} +2 -2
  306. package/dist/esm/{colors-dd598eea.js → colors-df32bb43.js} +1 -1
  307. package/dist/esm/{element-dragger-89bb52fd.js → element-dragger-7ea06c76.js} +1 -1
  308. package/dist/esm/floating-ui-3f4394da.js +1 -1
  309. package/dist/esm/{generate-1281254a.js → generate-27c06421.js} +15 -15
  310. package/dist/esm/{global-c031697c.js → global-0dac0bf2.js} +2 -2
  311. package/dist/esm/{index-7e71bbc8.js → index-91dbe540.js} +1 -1
  312. package/dist/esm/{index-036974d7.js → index-a6d9d0af.js} +1 -1
  313. package/dist/esm/{index-0615c2b8.js → index-b3026131.js} +1 -1
  314. package/dist/esm/{index-f549811f.js → index-b84bc8c9.js} +1 -1
  315. package/dist/esm/{input-template-b4045b25.js → input-template-4d3a4e34.js} +4 -4
  316. package/dist/esm/{is-load-decorator-8277e3b8.js → is-load-decorator-613d613a.js} +1 -1
  317. package/dist/esm/{json-parse-decarator-7d436ec7.js → json-parse-decarator-1f7310a8.js} +2 -2
  318. package/dist/esm/{label-template-a26f76c0.js → label-template-8c5948ab.js} +3 -3
  319. package/dist/esm/loader.js +5 -5
  320. package/dist/esm/{lodash-4197be99.js → lodash-0a4396a7.js} +1 -1
  321. package/dist/esm/moment-15cd9198.js +4598 -0
  322. package/dist/esm/{number-helper-778c8f87.js → number-helper-94a51ec2.js} +1 -1
  323. package/dist/esm/old-bcm-popover-box.entry.js +11 -11
  324. package/dist/esm/old-bcm-popover.entry.js +7 -7
  325. package/dist/esm/{package-08ddc3fa.js → package-34090aad.js} +1 -1
  326. package/dist/esm/{popover-placement-d12fec40.js → popover-placement-2f5939ea.js} +1 -1
  327. package/dist/esm/{slot-template-2a19b2db.js → slot-template-f85d540c.js} +2 -2
  328. package/dist/esm/{stepper-states-325c754b.js → stepper-states-b1aa55b0.js} +3 -3
  329. package/dist/esm/{string-helper-3592bdc2.js → string-helper-85990695.js} +2 -2
  330. package/dist/esm/{tooltip-helper-9c64ad15.js → tooltip-helper-112e52a6.js} +8 -8
  331. package/dist/esm/{utils-57652744.js → utils-b3338faf.js} +1 -1
  332. package/dist/esm/{validators-0c6e8dea.js → validators-7e605ca5.js} +1 -1
  333. package/dist/types/components/organism/list/list.d.ts +4 -0
  334. package/dist/types/components.d.ts +2 -0
  335. package/package.json +1 -1
  336. package/dist/bromcom-ui/p-04594f76.entry.js +0 -5
  337. package/dist/bromcom-ui/p-1baed29d.entry.js +0 -5
  338. package/dist/bromcom-ui/p-27596881.entry.js +0 -5
  339. package/dist/bromcom-ui/p-29791e4a.entry.js +0 -5
  340. package/dist/bromcom-ui/p-3179ce74.entry.js +0 -7
  341. package/dist/bromcom-ui/p-376a20ed.js +0 -5
  342. package/dist/bromcom-ui/p-41276d76.entry.js +0 -5
  343. package/dist/bromcom-ui/p-4393b33e.entry.js +0 -5
  344. package/dist/bromcom-ui/p-4834bc26.js +0 -5
  345. package/dist/bromcom-ui/p-4856568f.entry.js +0 -5
  346. package/dist/bromcom-ui/p-540fbc32.entry.js +0 -5
  347. package/dist/bromcom-ui/p-65da044b.js +0 -5
  348. package/dist/bromcom-ui/p-7c45705d.entry.js +0 -5
  349. package/dist/bromcom-ui/p-8b8dd8fe.entry.js +0 -5
  350. package/dist/bromcom-ui/p-8f32198d.js +0 -14
  351. package/dist/bromcom-ui/p-974a427c.entry.js +0 -5
  352. package/dist/bromcom-ui/p-a00b053e.entry.js +0 -5
  353. package/dist/bromcom-ui/p-a2065e9e.entry.js +0 -5
  354. package/dist/bromcom-ui/p-a2e5bb35.entry.js +0 -5
  355. package/dist/bromcom-ui/p-a31644e3.entry.js +0 -5
  356. package/dist/bromcom-ui/p-b301fa40.entry.js +0 -5
  357. package/dist/bromcom-ui/p-bbcb683f.entry.js +0 -5
  358. package/dist/bromcom-ui/p-bd50c28f.entry.js +0 -5
  359. package/dist/bromcom-ui/p-c63f5261.entry.js +0 -5
  360. package/dist/bromcom-ui/p-cbcf6d9c.js +0 -5
  361. package/dist/bromcom-ui/p-d19d45ed.entry.js +0 -5
  362. package/dist/bromcom-ui/p-e0ab7b38.js +0 -11
  363. package/dist/bromcom-ui/p-effc088c.entry.js +0 -5
  364. package/dist/bromcom-ui/p-fec89309.entry.js +0 -5
  365. package/dist/bromcom-ui/p-ff2b4565.entry.js +0 -5
@@ -0,0 +1,4598 @@
1
+ /*!
2
+ * Built with Stencil
3
+ * Copyright (c) Bromcom.
4
+ */
5
+ var hookCallback;
6
+
7
+ function hooks () {
8
+ return hookCallback.apply(null, arguments);
9
+ }
10
+
11
+ // This is done to register the method called with moment()
12
+ // without creating circular dependencies.
13
+ function setHookCallback (callback) {
14
+ hookCallback = callback;
15
+ }
16
+
17
+ function isArray(input) {
18
+ return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
19
+ }
20
+
21
+ function isObject(input) {
22
+ // IE8 will treat undefined and null as object if it wasn't for
23
+ // input != null
24
+ return input != null && Object.prototype.toString.call(input) === '[object Object]';
25
+ }
26
+
27
+ function isObjectEmpty(obj) {
28
+ if (Object.getOwnPropertyNames) {
29
+ return (Object.getOwnPropertyNames(obj).length === 0);
30
+ } else {
31
+ var k;
32
+ for (k in obj) {
33
+ if (obj.hasOwnProperty(k)) {
34
+ return false;
35
+ }
36
+ }
37
+ return true;
38
+ }
39
+ }
40
+
41
+ function isUndefined(input) {
42
+ return input === void 0;
43
+ }
44
+
45
+ function isNumber(input) {
46
+ return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
47
+ }
48
+
49
+ function isDate(input) {
50
+ return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
51
+ }
52
+
53
+ function map(arr, fn) {
54
+ var res = [], i;
55
+ for (i = 0; i < arr.length; ++i) {
56
+ res.push(fn(arr[i], i));
57
+ }
58
+ return res;
59
+ }
60
+
61
+ function hasOwnProp(a, b) {
62
+ return Object.prototype.hasOwnProperty.call(a, b);
63
+ }
64
+
65
+ function extend(a, b) {
66
+ for (var i in b) {
67
+ if (hasOwnProp(b, i)) {
68
+ a[i] = b[i];
69
+ }
70
+ }
71
+
72
+ if (hasOwnProp(b, 'toString')) {
73
+ a.toString = b.toString;
74
+ }
75
+
76
+ if (hasOwnProp(b, 'valueOf')) {
77
+ a.valueOf = b.valueOf;
78
+ }
79
+
80
+ return a;
81
+ }
82
+
83
+ function createUTC (input, format, locale, strict) {
84
+ return createLocalOrUTC(input, format, locale, strict, true).utc();
85
+ }
86
+
87
+ function defaultParsingFlags() {
88
+ // We need to deep clone this object.
89
+ return {
90
+ empty : false,
91
+ unusedTokens : [],
92
+ unusedInput : [],
93
+ overflow : -2,
94
+ charsLeftOver : 0,
95
+ nullInput : false,
96
+ invalidMonth : null,
97
+ invalidFormat : false,
98
+ userInvalidated : false,
99
+ iso : false,
100
+ parsedDateParts : [],
101
+ meridiem : null,
102
+ rfc2822 : false,
103
+ weekdayMismatch : false
104
+ };
105
+ }
106
+
107
+ function getParsingFlags(m) {
108
+ if (m._pf == null) {
109
+ m._pf = defaultParsingFlags();
110
+ }
111
+ return m._pf;
112
+ }
113
+
114
+ var some;
115
+ if (Array.prototype.some) {
116
+ some = Array.prototype.some;
117
+ } else {
118
+ some = function (fun) {
119
+ var t = Object(this);
120
+ var len = t.length >>> 0;
121
+
122
+ for (var i = 0; i < len; i++) {
123
+ if (i in t && fun.call(this, t[i], i, t)) {
124
+ return true;
125
+ }
126
+ }
127
+
128
+ return false;
129
+ };
130
+ }
131
+
132
+ function isValid$2(m) {
133
+ if (m._isValid == null) {
134
+ var flags = getParsingFlags(m);
135
+ var parsedParts = some.call(flags.parsedDateParts, function (i) {
136
+ return i != null;
137
+ });
138
+ var isNowValid = !isNaN(m._d.getTime()) &&
139
+ flags.overflow < 0 &&
140
+ !flags.empty &&
141
+ !flags.invalidMonth &&
142
+ !flags.invalidWeekday &&
143
+ !flags.weekdayMismatch &&
144
+ !flags.nullInput &&
145
+ !flags.invalidFormat &&
146
+ !flags.userInvalidated &&
147
+ (!flags.meridiem || (flags.meridiem && parsedParts));
148
+
149
+ if (m._strict) {
150
+ isNowValid = isNowValid &&
151
+ flags.charsLeftOver === 0 &&
152
+ flags.unusedTokens.length === 0 &&
153
+ flags.bigHour === undefined;
154
+ }
155
+
156
+ if (Object.isFrozen == null || !Object.isFrozen(m)) {
157
+ m._isValid = isNowValid;
158
+ }
159
+ else {
160
+ return isNowValid;
161
+ }
162
+ }
163
+ return m._isValid;
164
+ }
165
+
166
+ function createInvalid$1 (flags) {
167
+ var m = createUTC(NaN);
168
+ if (flags != null) {
169
+ extend(getParsingFlags(m), flags);
170
+ }
171
+ else {
172
+ getParsingFlags(m).userInvalidated = true;
173
+ }
174
+
175
+ return m;
176
+ }
177
+
178
+ // Plugins that add properties should also add the key here (null value),
179
+ // so we can properly clone ourselves.
180
+ var momentProperties = hooks.momentProperties = [];
181
+
182
+ function copyConfig(to, from) {
183
+ var i, prop, val;
184
+
185
+ if (!isUndefined(from._isAMomentObject)) {
186
+ to._isAMomentObject = from._isAMomentObject;
187
+ }
188
+ if (!isUndefined(from._i)) {
189
+ to._i = from._i;
190
+ }
191
+ if (!isUndefined(from._f)) {
192
+ to._f = from._f;
193
+ }
194
+ if (!isUndefined(from._l)) {
195
+ to._l = from._l;
196
+ }
197
+ if (!isUndefined(from._strict)) {
198
+ to._strict = from._strict;
199
+ }
200
+ if (!isUndefined(from._tzm)) {
201
+ to._tzm = from._tzm;
202
+ }
203
+ if (!isUndefined(from._isUTC)) {
204
+ to._isUTC = from._isUTC;
205
+ }
206
+ if (!isUndefined(from._offset)) {
207
+ to._offset = from._offset;
208
+ }
209
+ if (!isUndefined(from._pf)) {
210
+ to._pf = getParsingFlags(from);
211
+ }
212
+ if (!isUndefined(from._locale)) {
213
+ to._locale = from._locale;
214
+ }
215
+
216
+ if (momentProperties.length > 0) {
217
+ for (i = 0; i < momentProperties.length; i++) {
218
+ prop = momentProperties[i];
219
+ val = from[prop];
220
+ if (!isUndefined(val)) {
221
+ to[prop] = val;
222
+ }
223
+ }
224
+ }
225
+
226
+ return to;
227
+ }
228
+
229
+ var updateInProgress = false;
230
+
231
+ // Moment prototype object
232
+ function Moment(config) {
233
+ copyConfig(this, config);
234
+ this._d = new Date(config._d != null ? config._d.getTime() : NaN);
235
+ if (!this.isValid()) {
236
+ this._d = new Date(NaN);
237
+ }
238
+ // Prevent infinite loop in case updateOffset creates new moment
239
+ // objects.
240
+ if (updateInProgress === false) {
241
+ updateInProgress = true;
242
+ hooks.updateOffset(this);
243
+ updateInProgress = false;
244
+ }
245
+ }
246
+
247
+ function isMoment (obj) {
248
+ return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
249
+ }
250
+
251
+ function absFloor (number) {
252
+ if (number < 0) {
253
+ // -0 -> 0
254
+ return Math.ceil(number) || 0;
255
+ } else {
256
+ return Math.floor(number);
257
+ }
258
+ }
259
+
260
+ function toInt(argumentForCoercion) {
261
+ var coercedNumber = +argumentForCoercion,
262
+ value = 0;
263
+
264
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
265
+ value = absFloor(coercedNumber);
266
+ }
267
+
268
+ return value;
269
+ }
270
+
271
+ // compare two arrays, return the number of differences
272
+ function compareArrays(array1, array2, dontConvert) {
273
+ var len = Math.min(array1.length, array2.length),
274
+ lengthDiff = Math.abs(array1.length - array2.length),
275
+ diffs = 0,
276
+ i;
277
+ for (i = 0; i < len; i++) {
278
+ if ((dontConvert && array1[i] !== array2[i]) ||
279
+ (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
280
+ diffs++;
281
+ }
282
+ }
283
+ return diffs + lengthDiff;
284
+ }
285
+
286
+ function warn(msg) {
287
+ if (hooks.suppressDeprecationWarnings === false &&
288
+ (typeof console !== 'undefined') && console.warn) {
289
+ console.warn('Deprecation warning: ' + msg);
290
+ }
291
+ }
292
+
293
+ function deprecate(msg, fn) {
294
+ var firstTime = true;
295
+
296
+ return extend(function () {
297
+ if (hooks.deprecationHandler != null) {
298
+ hooks.deprecationHandler(null, msg);
299
+ }
300
+ if (firstTime) {
301
+ var args = [];
302
+ var arg;
303
+ for (var i = 0; i < arguments.length; i++) {
304
+ arg = '';
305
+ if (typeof arguments[i] === 'object') {
306
+ arg += '\n[' + i + '] ';
307
+ for (var key in arguments[0]) {
308
+ arg += key + ': ' + arguments[0][key] + ', ';
309
+ }
310
+ arg = arg.slice(0, -2); // Remove trailing comma and space
311
+ } else {
312
+ arg = arguments[i];
313
+ }
314
+ args.push(arg);
315
+ }
316
+ warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
317
+ firstTime = false;
318
+ }
319
+ return fn.apply(this, arguments);
320
+ }, fn);
321
+ }
322
+
323
+ var deprecations = {};
324
+
325
+ function deprecateSimple(name, msg) {
326
+ if (hooks.deprecationHandler != null) {
327
+ hooks.deprecationHandler(name, msg);
328
+ }
329
+ if (!deprecations[name]) {
330
+ warn(msg);
331
+ deprecations[name] = true;
332
+ }
333
+ }
334
+
335
+ hooks.suppressDeprecationWarnings = false;
336
+ hooks.deprecationHandler = null;
337
+
338
+ function isFunction(input) {
339
+ return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
340
+ }
341
+
342
+ function set$1 (config) {
343
+ var prop, i;
344
+ for (i in config) {
345
+ prop = config[i];
346
+ if (isFunction(prop)) {
347
+ this[i] = prop;
348
+ } else {
349
+ this['_' + i] = prop;
350
+ }
351
+ }
352
+ this._config = config;
353
+ // Lenient ordinal parsing accepts just a number in addition to
354
+ // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
355
+ // TODO: Remove "ordinalParse" fallback in next major release.
356
+ this._dayOfMonthOrdinalParseLenient = new RegExp(
357
+ (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
358
+ '|' + (/\d{1,2}/).source);
359
+ }
360
+
361
+ function mergeConfigs(parentConfig, childConfig) {
362
+ var res = extend({}, parentConfig), prop;
363
+ for (prop in childConfig) {
364
+ if (hasOwnProp(childConfig, prop)) {
365
+ if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
366
+ res[prop] = {};
367
+ extend(res[prop], parentConfig[prop]);
368
+ extend(res[prop], childConfig[prop]);
369
+ } else if (childConfig[prop] != null) {
370
+ res[prop] = childConfig[prop];
371
+ } else {
372
+ delete res[prop];
373
+ }
374
+ }
375
+ }
376
+ for (prop in parentConfig) {
377
+ if (hasOwnProp(parentConfig, prop) &&
378
+ !hasOwnProp(childConfig, prop) &&
379
+ isObject(parentConfig[prop])) {
380
+ // make sure changes to properties don't modify parent config
381
+ res[prop] = extend({}, res[prop]);
382
+ }
383
+ }
384
+ return res;
385
+ }
386
+
387
+ function Locale(config) {
388
+ if (config != null) {
389
+ this.set(config);
390
+ }
391
+ }
392
+
393
+ var keys;
394
+
395
+ if (Object.keys) {
396
+ keys = Object.keys;
397
+ } else {
398
+ keys = function (obj) {
399
+ var i, res = [];
400
+ for (i in obj) {
401
+ if (hasOwnProp(obj, i)) {
402
+ res.push(i);
403
+ }
404
+ }
405
+ return res;
406
+ };
407
+ }
408
+
409
+ var defaultCalendar = {
410
+ sameDay : '[Today at] LT',
411
+ nextDay : '[Tomorrow at] LT',
412
+ nextWeek : 'dddd [at] LT',
413
+ lastDay : '[Yesterday at] LT',
414
+ lastWeek : '[Last] dddd [at] LT',
415
+ sameElse : 'L'
416
+ };
417
+
418
+ function calendar$1 (key, mom, now) {
419
+ var output = this._calendar[key] || this._calendar['sameElse'];
420
+ return isFunction(output) ? output.call(mom, now) : output;
421
+ }
422
+
423
+ var defaultLongDateFormat = {
424
+ LTS : 'h:mm:ss A',
425
+ LT : 'h:mm A',
426
+ L : 'MM/DD/YYYY',
427
+ LL : 'MMMM D, YYYY',
428
+ LLL : 'MMMM D, YYYY h:mm A',
429
+ LLLL : 'dddd, MMMM D, YYYY h:mm A'
430
+ };
431
+
432
+ function longDateFormat (key) {
433
+ var format = this._longDateFormat[key],
434
+ formatUpper = this._longDateFormat[key.toUpperCase()];
435
+
436
+ if (format || !formatUpper) {
437
+ return format;
438
+ }
439
+
440
+ this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
441
+ return val.slice(1);
442
+ });
443
+
444
+ return this._longDateFormat[key];
445
+ }
446
+
447
+ var defaultInvalidDate = 'Invalid date';
448
+
449
+ function invalidDate () {
450
+ return this._invalidDate;
451
+ }
452
+
453
+ var defaultOrdinal = '%d';
454
+ var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
455
+
456
+ function ordinal (number) {
457
+ return this._ordinal.replace('%d', number);
458
+ }
459
+
460
+ var defaultRelativeTime = {
461
+ future : 'in %s',
462
+ past : '%s ago',
463
+ s : 'a few seconds',
464
+ ss : '%d seconds',
465
+ m : 'a minute',
466
+ mm : '%d minutes',
467
+ h : 'an hour',
468
+ hh : '%d hours',
469
+ d : 'a day',
470
+ dd : '%d days',
471
+ M : 'a month',
472
+ MM : '%d months',
473
+ y : 'a year',
474
+ yy : '%d years'
475
+ };
476
+
477
+ function relativeTime$1 (number, withoutSuffix, string, isFuture) {
478
+ var output = this._relativeTime[string];
479
+ return (isFunction(output)) ?
480
+ output(number, withoutSuffix, string, isFuture) :
481
+ output.replace(/%d/i, number);
482
+ }
483
+
484
+ function pastFuture (diff, output) {
485
+ var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
486
+ return isFunction(format) ? format(output) : format.replace(/%s/i, output);
487
+ }
488
+
489
+ var aliases = {};
490
+
491
+ function addUnitAlias (unit, shorthand) {
492
+ var lowerCase = unit.toLowerCase();
493
+ aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
494
+ }
495
+
496
+ function normalizeUnits(units) {
497
+ return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
498
+ }
499
+
500
+ function normalizeObjectUnits(inputObject) {
501
+ var normalizedInput = {},
502
+ normalizedProp,
503
+ prop;
504
+
505
+ for (prop in inputObject) {
506
+ if (hasOwnProp(inputObject, prop)) {
507
+ normalizedProp = normalizeUnits(prop);
508
+ if (normalizedProp) {
509
+ normalizedInput[normalizedProp] = inputObject[prop];
510
+ }
511
+ }
512
+ }
513
+
514
+ return normalizedInput;
515
+ }
516
+
517
+ var priorities = {};
518
+
519
+ function addUnitPriority(unit, priority) {
520
+ priorities[unit] = priority;
521
+ }
522
+
523
+ function getPrioritizedUnits(unitsObj) {
524
+ var units = [];
525
+ for (var u in unitsObj) {
526
+ units.push({unit: u, priority: priorities[u]});
527
+ }
528
+ units.sort(function (a, b) {
529
+ return a.priority - b.priority;
530
+ });
531
+ return units;
532
+ }
533
+
534
+ function zeroFill(number, targetLength, forceSign) {
535
+ var absNumber = '' + Math.abs(number),
536
+ zerosToFill = targetLength - absNumber.length,
537
+ sign = number >= 0;
538
+ return (sign ? (forceSign ? '+' : '') : '-') +
539
+ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
540
+ }
541
+
542
+ var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
543
+
544
+ var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
545
+
546
+ var formatFunctions = {};
547
+
548
+ var formatTokenFunctions = {};
549
+
550
+ // token: 'M'
551
+ // padded: ['MM', 2]
552
+ // ordinal: 'Mo'
553
+ // callback: function () { this.month() + 1 }
554
+ function addFormatToken (token, padded, ordinal, callback) {
555
+ var func = callback;
556
+ if (typeof callback === 'string') {
557
+ func = function () {
558
+ return this[callback]();
559
+ };
560
+ }
561
+ if (token) {
562
+ formatTokenFunctions[token] = func;
563
+ }
564
+ if (padded) {
565
+ formatTokenFunctions[padded[0]] = function () {
566
+ return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
567
+ };
568
+ }
569
+ if (ordinal) {
570
+ formatTokenFunctions[ordinal] = function () {
571
+ return this.localeData().ordinal(func.apply(this, arguments), token);
572
+ };
573
+ }
574
+ }
575
+
576
+ function removeFormattingTokens(input) {
577
+ if (input.match(/\[[\s\S]/)) {
578
+ return input.replace(/^\[|\]$/g, '');
579
+ }
580
+ return input.replace(/\\/g, '');
581
+ }
582
+
583
+ function makeFormatFunction(format) {
584
+ var array = format.match(formattingTokens), i, length;
585
+
586
+ for (i = 0, length = array.length; i < length; i++) {
587
+ if (formatTokenFunctions[array[i]]) {
588
+ array[i] = formatTokenFunctions[array[i]];
589
+ } else {
590
+ array[i] = removeFormattingTokens(array[i]);
591
+ }
592
+ }
593
+
594
+ return function (mom) {
595
+ var output = '', i;
596
+ for (i = 0; i < length; i++) {
597
+ output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
598
+ }
599
+ return output;
600
+ };
601
+ }
602
+
603
+ // format date using native date object
604
+ function formatMoment(m, format) {
605
+ if (!m.isValid()) {
606
+ return m.localeData().invalidDate();
607
+ }
608
+
609
+ format = expandFormat(format, m.localeData());
610
+ formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
611
+
612
+ return formatFunctions[format](m);
613
+ }
614
+
615
+ function expandFormat(format, locale) {
616
+ var i = 5;
617
+
618
+ function replaceLongDateFormatTokens(input) {
619
+ return locale.longDateFormat(input) || input;
620
+ }
621
+
622
+ localFormattingTokens.lastIndex = 0;
623
+ while (i >= 0 && localFormattingTokens.test(format)) {
624
+ format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
625
+ localFormattingTokens.lastIndex = 0;
626
+ i -= 1;
627
+ }
628
+
629
+ return format;
630
+ }
631
+
632
+ var match1 = /\d/; // 0 - 9
633
+ var match2 = /\d\d/; // 00 - 99
634
+ var match3 = /\d{3}/; // 000 - 999
635
+ var match4 = /\d{4}/; // 0000 - 9999
636
+ var match6 = /[+-]?\d{6}/; // -999999 - 999999
637
+ var match1to2 = /\d\d?/; // 0 - 99
638
+ var match3to4 = /\d\d\d\d?/; // 999 - 9999
639
+ var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
640
+ var match1to3 = /\d{1,3}/; // 0 - 999
641
+ var match1to4 = /\d{1,4}/; // 0 - 9999
642
+ var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
643
+
644
+ var matchUnsigned = /\d+/; // 0 - inf
645
+ var matchSigned = /[+-]?\d+/; // -inf - inf
646
+
647
+ var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
648
+ var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
649
+
650
+ var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
651
+
652
+ // any word (or two) characters or numbers including two/three word month in arabic.
653
+ // includes scottish gaelic two word and hyphenated months
654
+ var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
655
+
656
+ var regexes = {};
657
+
658
+ function addRegexToken (token, regex, strictRegex) {
659
+ regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
660
+ return (isStrict && strictRegex) ? strictRegex : regex;
661
+ };
662
+ }
663
+
664
+ function getParseRegexForToken (token, config) {
665
+ if (!hasOwnProp(regexes, token)) {
666
+ return new RegExp(unescapeFormat(token));
667
+ }
668
+
669
+ return regexes[token](config._strict, config._locale);
670
+ }
671
+
672
+ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
673
+ function unescapeFormat(s) {
674
+ return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
675
+ return p1 || p2 || p3 || p4;
676
+ }));
677
+ }
678
+
679
+ function regexEscape(s) {
680
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
681
+ }
682
+
683
+ var tokens = {};
684
+
685
+ function addParseToken (token, callback) {
686
+ var i, func = callback;
687
+ if (typeof token === 'string') {
688
+ token = [token];
689
+ }
690
+ if (isNumber(callback)) {
691
+ func = function (input, array) {
692
+ array[callback] = toInt(input);
693
+ };
694
+ }
695
+ for (i = 0; i < token.length; i++) {
696
+ tokens[token[i]] = func;
697
+ }
698
+ }
699
+
700
+ function addWeekParseToken (token, callback) {
701
+ addParseToken(token, function (input, array, config, token) {
702
+ config._w = config._w || {};
703
+ callback(input, config._w, config, token);
704
+ });
705
+ }
706
+
707
+ function addTimeToArrayFromToken(token, input, config) {
708
+ if (input != null && hasOwnProp(tokens, token)) {
709
+ tokens[token](input, config._a, config, token);
710
+ }
711
+ }
712
+
713
+ var YEAR = 0;
714
+ var MONTH = 1;
715
+ var DATE = 2;
716
+ var HOUR = 3;
717
+ var MINUTE = 4;
718
+ var SECOND = 5;
719
+ var MILLISECOND = 6;
720
+ var WEEK = 7;
721
+ var WEEKDAY = 8;
722
+
723
+ // FORMATTING
724
+
725
+ addFormatToken('Y', 0, 0, function () {
726
+ var y = this.year();
727
+ return y <= 9999 ? '' + y : '+' + y;
728
+ });
729
+
730
+ addFormatToken(0, ['YY', 2], 0, function () {
731
+ return this.year() % 100;
732
+ });
733
+
734
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
735
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
736
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
737
+
738
+ // ALIASES
739
+
740
+ addUnitAlias('year', 'y');
741
+
742
+ // PRIORITIES
743
+
744
+ addUnitPriority('year', 1);
745
+
746
+ // PARSING
747
+
748
+ addRegexToken('Y', matchSigned);
749
+ addRegexToken('YY', match1to2, match2);
750
+ addRegexToken('YYYY', match1to4, match4);
751
+ addRegexToken('YYYYY', match1to6, match6);
752
+ addRegexToken('YYYYYY', match1to6, match6);
753
+
754
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
755
+ addParseToken('YYYY', function (input, array) {
756
+ array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
757
+ });
758
+ addParseToken('YY', function (input, array) {
759
+ array[YEAR] = hooks.parseTwoDigitYear(input);
760
+ });
761
+ addParseToken('Y', function (input, array) {
762
+ array[YEAR] = parseInt(input, 10);
763
+ });
764
+
765
+ // HELPERS
766
+
767
+ function daysInYear(year) {
768
+ return isLeapYear(year) ? 366 : 365;
769
+ }
770
+
771
+ function isLeapYear(year) {
772
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
773
+ }
774
+
775
+ // HOOKS
776
+
777
+ hooks.parseTwoDigitYear = function (input) {
778
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
779
+ };
780
+
781
+ // MOMENTS
782
+
783
+ var getSetYear = makeGetSet('FullYear', true);
784
+
785
+ function getIsLeapYear () {
786
+ return isLeapYear(this.year());
787
+ }
788
+
789
+ function makeGetSet (unit, keepTime) {
790
+ return function (value) {
791
+ if (value != null) {
792
+ set(this, unit, value);
793
+ hooks.updateOffset(this, keepTime);
794
+ return this;
795
+ } else {
796
+ return get$2(this, unit);
797
+ }
798
+ };
799
+ }
800
+
801
+ function get$2 (mom, unit) {
802
+ return mom.isValid() ?
803
+ mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
804
+ }
805
+
806
+ function set (mom, unit, value) {
807
+ if (mom.isValid() && !isNaN(value)) {
808
+ if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
809
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
810
+ }
811
+ else {
812
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
813
+ }
814
+ }
815
+ }
816
+
817
+ // MOMENTS
818
+
819
+ function stringGet (units) {
820
+ units = normalizeUnits(units);
821
+ if (isFunction(this[units])) {
822
+ return this[units]();
823
+ }
824
+ return this;
825
+ }
826
+
827
+
828
+ function stringSet (units, value) {
829
+ if (typeof units === 'object') {
830
+ units = normalizeObjectUnits(units);
831
+ var prioritized = getPrioritizedUnits(units);
832
+ for (var i = 0; i < prioritized.length; i++) {
833
+ this[prioritized[i].unit](units[prioritized[i].unit]);
834
+ }
835
+ } else {
836
+ units = normalizeUnits(units);
837
+ if (isFunction(this[units])) {
838
+ return this[units](value);
839
+ }
840
+ }
841
+ return this;
842
+ }
843
+
844
+ function mod$1(n, x) {
845
+ return ((n % x) + x) % x;
846
+ }
847
+
848
+ var indexOf;
849
+
850
+ if (Array.prototype.indexOf) {
851
+ indexOf = Array.prototype.indexOf;
852
+ } else {
853
+ indexOf = function (o) {
854
+ // I know
855
+ var i;
856
+ for (i = 0; i < this.length; ++i) {
857
+ if (this[i] === o) {
858
+ return i;
859
+ }
860
+ }
861
+ return -1;
862
+ };
863
+ }
864
+
865
+ function daysInMonth(year, month) {
866
+ if (isNaN(year) || isNaN(month)) {
867
+ return NaN;
868
+ }
869
+ var modMonth = mod$1(month, 12);
870
+ year += (month - modMonth) / 12;
871
+ return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2);
872
+ }
873
+
874
+ // FORMATTING
875
+
876
+ addFormatToken('M', ['MM', 2], 'Mo', function () {
877
+ return this.month() + 1;
878
+ });
879
+
880
+ addFormatToken('MMM', 0, 0, function (format) {
881
+ return this.localeData().monthsShort(this, format);
882
+ });
883
+
884
+ addFormatToken('MMMM', 0, 0, function (format) {
885
+ return this.localeData().months(this, format);
886
+ });
887
+
888
+ // ALIASES
889
+
890
+ addUnitAlias('month', 'M');
891
+
892
+ // PRIORITY
893
+
894
+ addUnitPriority('month', 8);
895
+
896
+ // PARSING
897
+
898
+ addRegexToken('M', match1to2);
899
+ addRegexToken('MM', match1to2, match2);
900
+ addRegexToken('MMM', function (isStrict, locale) {
901
+ return locale.monthsShortRegex(isStrict);
902
+ });
903
+ addRegexToken('MMMM', function (isStrict, locale) {
904
+ return locale.monthsRegex(isStrict);
905
+ });
906
+
907
+ addParseToken(['M', 'MM'], function (input, array) {
908
+ array[MONTH] = toInt(input) - 1;
909
+ });
910
+
911
+ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
912
+ var month = config._locale.monthsParse(input, token, config._strict);
913
+ // if we didn't find a month name, mark the date as invalid.
914
+ if (month != null) {
915
+ array[MONTH] = month;
916
+ } else {
917
+ getParsingFlags(config).invalidMonth = input;
918
+ }
919
+ });
920
+
921
+ // LOCALES
922
+
923
+ var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
924
+ var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
925
+ function localeMonths (m, format) {
926
+ if (!m) {
927
+ return isArray(this._months) ? this._months :
928
+ this._months['standalone'];
929
+ }
930
+ return isArray(this._months) ? this._months[m.month()] :
931
+ this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
932
+ }
933
+
934
+ var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
935
+ function localeMonthsShort (m, format) {
936
+ if (!m) {
937
+ return isArray(this._monthsShort) ? this._monthsShort :
938
+ this._monthsShort['standalone'];
939
+ }
940
+ return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
941
+ this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
942
+ }
943
+
944
+ function handleStrictParse$1(monthName, format, strict) {
945
+ var i, ii, mom, llc = monthName.toLocaleLowerCase();
946
+ if (!this._monthsParse) {
947
+ // this is not used
948
+ this._monthsParse = [];
949
+ this._longMonthsParse = [];
950
+ this._shortMonthsParse = [];
951
+ for (i = 0; i < 12; ++i) {
952
+ mom = createUTC([2000, i]);
953
+ this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
954
+ this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
955
+ }
956
+ }
957
+
958
+ if (strict) {
959
+ if (format === 'MMM') {
960
+ ii = indexOf.call(this._shortMonthsParse, llc);
961
+ return ii !== -1 ? ii : null;
962
+ } else {
963
+ ii = indexOf.call(this._longMonthsParse, llc);
964
+ return ii !== -1 ? ii : null;
965
+ }
966
+ } else {
967
+ if (format === 'MMM') {
968
+ ii = indexOf.call(this._shortMonthsParse, llc);
969
+ if (ii !== -1) {
970
+ return ii;
971
+ }
972
+ ii = indexOf.call(this._longMonthsParse, llc);
973
+ return ii !== -1 ? ii : null;
974
+ } else {
975
+ ii = indexOf.call(this._longMonthsParse, llc);
976
+ if (ii !== -1) {
977
+ return ii;
978
+ }
979
+ ii = indexOf.call(this._shortMonthsParse, llc);
980
+ return ii !== -1 ? ii : null;
981
+ }
982
+ }
983
+ }
984
+
985
+ function localeMonthsParse (monthName, format, strict) {
986
+ var i, mom, regex;
987
+
988
+ if (this._monthsParseExact) {
989
+ return handleStrictParse$1.call(this, monthName, format, strict);
990
+ }
991
+
992
+ if (!this._monthsParse) {
993
+ this._monthsParse = [];
994
+ this._longMonthsParse = [];
995
+ this._shortMonthsParse = [];
996
+ }
997
+
998
+ // TODO: add sorting
999
+ // Sorting makes sure if one month (or abbr) is a prefix of another
1000
+ // see sorting in computeMonthsParse
1001
+ for (i = 0; i < 12; i++) {
1002
+ // make the regex if we don't have it already
1003
+ mom = createUTC([2000, i]);
1004
+ if (strict && !this._longMonthsParse[i]) {
1005
+ this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
1006
+ this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
1007
+ }
1008
+ if (!strict && !this._monthsParse[i]) {
1009
+ regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
1010
+ this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
1011
+ }
1012
+ // test the regex
1013
+ if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
1014
+ return i;
1015
+ } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
1016
+ return i;
1017
+ } else if (!strict && this._monthsParse[i].test(monthName)) {
1018
+ return i;
1019
+ }
1020
+ }
1021
+ }
1022
+
1023
+ // MOMENTS
1024
+
1025
+ function setMonth (mom, value) {
1026
+ var dayOfMonth;
1027
+
1028
+ if (!mom.isValid()) {
1029
+ // No op
1030
+ return mom;
1031
+ }
1032
+
1033
+ if (typeof value === 'string') {
1034
+ if (/^\d+$/.test(value)) {
1035
+ value = toInt(value);
1036
+ } else {
1037
+ value = mom.localeData().monthsParse(value);
1038
+ // TODO: Another silent failure?
1039
+ if (!isNumber(value)) {
1040
+ return mom;
1041
+ }
1042
+ }
1043
+ }
1044
+
1045
+ dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
1046
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
1047
+ return mom;
1048
+ }
1049
+
1050
+ function getSetMonth (value) {
1051
+ if (value != null) {
1052
+ setMonth(this, value);
1053
+ hooks.updateOffset(this, true);
1054
+ return this;
1055
+ } else {
1056
+ return get$2(this, 'Month');
1057
+ }
1058
+ }
1059
+
1060
+ function getDaysInMonth () {
1061
+ return daysInMonth(this.year(), this.month());
1062
+ }
1063
+
1064
+ var defaultMonthsShortRegex = matchWord;
1065
+ function monthsShortRegex (isStrict) {
1066
+ if (this._monthsParseExact) {
1067
+ if (!hasOwnProp(this, '_monthsRegex')) {
1068
+ computeMonthsParse.call(this);
1069
+ }
1070
+ if (isStrict) {
1071
+ return this._monthsShortStrictRegex;
1072
+ } else {
1073
+ return this._monthsShortRegex;
1074
+ }
1075
+ } else {
1076
+ if (!hasOwnProp(this, '_monthsShortRegex')) {
1077
+ this._monthsShortRegex = defaultMonthsShortRegex;
1078
+ }
1079
+ return this._monthsShortStrictRegex && isStrict ?
1080
+ this._monthsShortStrictRegex : this._monthsShortRegex;
1081
+ }
1082
+ }
1083
+
1084
+ var defaultMonthsRegex = matchWord;
1085
+ function monthsRegex (isStrict) {
1086
+ if (this._monthsParseExact) {
1087
+ if (!hasOwnProp(this, '_monthsRegex')) {
1088
+ computeMonthsParse.call(this);
1089
+ }
1090
+ if (isStrict) {
1091
+ return this._monthsStrictRegex;
1092
+ } else {
1093
+ return this._monthsRegex;
1094
+ }
1095
+ } else {
1096
+ if (!hasOwnProp(this, '_monthsRegex')) {
1097
+ this._monthsRegex = defaultMonthsRegex;
1098
+ }
1099
+ return this._monthsStrictRegex && isStrict ?
1100
+ this._monthsStrictRegex : this._monthsRegex;
1101
+ }
1102
+ }
1103
+
1104
+ function computeMonthsParse () {
1105
+ function cmpLenRev(a, b) {
1106
+ return b.length - a.length;
1107
+ }
1108
+
1109
+ var shortPieces = [], longPieces = [], mixedPieces = [],
1110
+ i, mom;
1111
+ for (i = 0; i < 12; i++) {
1112
+ // make the regex if we don't have it already
1113
+ mom = createUTC([2000, i]);
1114
+ shortPieces.push(this.monthsShort(mom, ''));
1115
+ longPieces.push(this.months(mom, ''));
1116
+ mixedPieces.push(this.months(mom, ''));
1117
+ mixedPieces.push(this.monthsShort(mom, ''));
1118
+ }
1119
+ // Sorting makes sure if one month (or abbr) is a prefix of another it
1120
+ // will match the longer piece.
1121
+ shortPieces.sort(cmpLenRev);
1122
+ longPieces.sort(cmpLenRev);
1123
+ mixedPieces.sort(cmpLenRev);
1124
+ for (i = 0; i < 12; i++) {
1125
+ shortPieces[i] = regexEscape(shortPieces[i]);
1126
+ longPieces[i] = regexEscape(longPieces[i]);
1127
+ }
1128
+ for (i = 0; i < 24; i++) {
1129
+ mixedPieces[i] = regexEscape(mixedPieces[i]);
1130
+ }
1131
+
1132
+ this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
1133
+ this._monthsShortRegex = this._monthsRegex;
1134
+ this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
1135
+ this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
1136
+ }
1137
+
1138
+ function createDate (y, m, d, h, M, s, ms) {
1139
+ // can't just apply() to create a date:
1140
+ // https://stackoverflow.com/q/181348
1141
+ var date;
1142
+ // the date constructor remaps years 0-99 to 1900-1999
1143
+ if (y < 100 && y >= 0) {
1144
+ // preserve leap years using a full 400 year cycle, then reset
1145
+ date = new Date(y + 400, m, d, h, M, s, ms);
1146
+ if (isFinite(date.getFullYear())) {
1147
+ date.setFullYear(y);
1148
+ }
1149
+ } else {
1150
+ date = new Date(y, m, d, h, M, s, ms);
1151
+ }
1152
+
1153
+ return date;
1154
+ }
1155
+
1156
+ function createUTCDate (y) {
1157
+ var date;
1158
+ // the Date.UTC function remaps years 0-99 to 1900-1999
1159
+ if (y < 100 && y >= 0) {
1160
+ var args = Array.prototype.slice.call(arguments);
1161
+ // preserve leap years using a full 400 year cycle, then reset
1162
+ args[0] = y + 400;
1163
+ date = new Date(Date.UTC.apply(null, args));
1164
+ if (isFinite(date.getUTCFullYear())) {
1165
+ date.setUTCFullYear(y);
1166
+ }
1167
+ } else {
1168
+ date = new Date(Date.UTC.apply(null, arguments));
1169
+ }
1170
+
1171
+ return date;
1172
+ }
1173
+
1174
+ // start-of-first-week - start-of-year
1175
+ function firstWeekOffset(year, dow, doy) {
1176
+ var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
1177
+ fwd = 7 + dow - doy,
1178
+ // first-week day local weekday -- which local weekday is fwd
1179
+ fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
1180
+
1181
+ return -fwdlw + fwd - 1;
1182
+ }
1183
+
1184
+ // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
1185
+ function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
1186
+ var localWeekday = (7 + weekday - dow) % 7,
1187
+ weekOffset = firstWeekOffset(year, dow, doy),
1188
+ dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
1189
+ resYear, resDayOfYear;
1190
+
1191
+ if (dayOfYear <= 0) {
1192
+ resYear = year - 1;
1193
+ resDayOfYear = daysInYear(resYear) + dayOfYear;
1194
+ } else if (dayOfYear > daysInYear(year)) {
1195
+ resYear = year + 1;
1196
+ resDayOfYear = dayOfYear - daysInYear(year);
1197
+ } else {
1198
+ resYear = year;
1199
+ resDayOfYear = dayOfYear;
1200
+ }
1201
+
1202
+ return {
1203
+ year: resYear,
1204
+ dayOfYear: resDayOfYear
1205
+ };
1206
+ }
1207
+
1208
+ function weekOfYear(mom, dow, doy) {
1209
+ var weekOffset = firstWeekOffset(mom.year(), dow, doy),
1210
+ week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
1211
+ resWeek, resYear;
1212
+
1213
+ if (week < 1) {
1214
+ resYear = mom.year() - 1;
1215
+ resWeek = week + weeksInYear(resYear, dow, doy);
1216
+ } else if (week > weeksInYear(mom.year(), dow, doy)) {
1217
+ resWeek = week - weeksInYear(mom.year(), dow, doy);
1218
+ resYear = mom.year() + 1;
1219
+ } else {
1220
+ resYear = mom.year();
1221
+ resWeek = week;
1222
+ }
1223
+
1224
+ return {
1225
+ week: resWeek,
1226
+ year: resYear
1227
+ };
1228
+ }
1229
+
1230
+ function weeksInYear(year, dow, doy) {
1231
+ var weekOffset = firstWeekOffset(year, dow, doy),
1232
+ weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
1233
+ return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
1234
+ }
1235
+
1236
+ // FORMATTING
1237
+
1238
+ addFormatToken('w', ['ww', 2], 'wo', 'week');
1239
+ addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
1240
+
1241
+ // ALIASES
1242
+
1243
+ addUnitAlias('week', 'w');
1244
+ addUnitAlias('isoWeek', 'W');
1245
+
1246
+ // PRIORITIES
1247
+
1248
+ addUnitPriority('week', 5);
1249
+ addUnitPriority('isoWeek', 5);
1250
+
1251
+ // PARSING
1252
+
1253
+ addRegexToken('w', match1to2);
1254
+ addRegexToken('ww', match1to2, match2);
1255
+ addRegexToken('W', match1to2);
1256
+ addRegexToken('WW', match1to2, match2);
1257
+
1258
+ addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
1259
+ week[token.substr(0, 1)] = toInt(input);
1260
+ });
1261
+
1262
+ // HELPERS
1263
+
1264
+ // LOCALES
1265
+
1266
+ function localeWeek (mom) {
1267
+ return weekOfYear(mom, this._week.dow, this._week.doy).week;
1268
+ }
1269
+
1270
+ var defaultLocaleWeek = {
1271
+ dow : 0, // Sunday is the first day of the week.
1272
+ doy : 6 // The week that contains Jan 6th is the first week of the year.
1273
+ };
1274
+
1275
+ function localeFirstDayOfWeek () {
1276
+ return this._week.dow;
1277
+ }
1278
+
1279
+ function localeFirstDayOfYear () {
1280
+ return this._week.doy;
1281
+ }
1282
+
1283
+ // MOMENTS
1284
+
1285
+ function getSetWeek (input) {
1286
+ var week = this.localeData().week(this);
1287
+ return input == null ? week : this.add((input - week) * 7, 'd');
1288
+ }
1289
+
1290
+ function getSetISOWeek (input) {
1291
+ var week = weekOfYear(this, 1, 4).week;
1292
+ return input == null ? week : this.add((input - week) * 7, 'd');
1293
+ }
1294
+
1295
+ // FORMATTING
1296
+
1297
+ addFormatToken('d', 0, 'do', 'day');
1298
+
1299
+ addFormatToken('dd', 0, 0, function (format) {
1300
+ return this.localeData().weekdaysMin(this, format);
1301
+ });
1302
+
1303
+ addFormatToken('ddd', 0, 0, function (format) {
1304
+ return this.localeData().weekdaysShort(this, format);
1305
+ });
1306
+
1307
+ addFormatToken('dddd', 0, 0, function (format) {
1308
+ return this.localeData().weekdays(this, format);
1309
+ });
1310
+
1311
+ addFormatToken('e', 0, 0, 'weekday');
1312
+ addFormatToken('E', 0, 0, 'isoWeekday');
1313
+
1314
+ // ALIASES
1315
+
1316
+ addUnitAlias('day', 'd');
1317
+ addUnitAlias('weekday', 'e');
1318
+ addUnitAlias('isoWeekday', 'E');
1319
+
1320
+ // PRIORITY
1321
+ addUnitPriority('day', 11);
1322
+ addUnitPriority('weekday', 11);
1323
+ addUnitPriority('isoWeekday', 11);
1324
+
1325
+ // PARSING
1326
+
1327
+ addRegexToken('d', match1to2);
1328
+ addRegexToken('e', match1to2);
1329
+ addRegexToken('E', match1to2);
1330
+ addRegexToken('dd', function (isStrict, locale) {
1331
+ return locale.weekdaysMinRegex(isStrict);
1332
+ });
1333
+ addRegexToken('ddd', function (isStrict, locale) {
1334
+ return locale.weekdaysShortRegex(isStrict);
1335
+ });
1336
+ addRegexToken('dddd', function (isStrict, locale) {
1337
+ return locale.weekdaysRegex(isStrict);
1338
+ });
1339
+
1340
+ addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
1341
+ var weekday = config._locale.weekdaysParse(input, token, config._strict);
1342
+ // if we didn't get a weekday name, mark the date as invalid
1343
+ if (weekday != null) {
1344
+ week.d = weekday;
1345
+ } else {
1346
+ getParsingFlags(config).invalidWeekday = input;
1347
+ }
1348
+ });
1349
+
1350
+ addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
1351
+ week[token] = toInt(input);
1352
+ });
1353
+
1354
+ // HELPERS
1355
+
1356
+ function parseWeekday(input, locale) {
1357
+ if (typeof input !== 'string') {
1358
+ return input;
1359
+ }
1360
+
1361
+ if (!isNaN(input)) {
1362
+ return parseInt(input, 10);
1363
+ }
1364
+
1365
+ input = locale.weekdaysParse(input);
1366
+ if (typeof input === 'number') {
1367
+ return input;
1368
+ }
1369
+
1370
+ return null;
1371
+ }
1372
+
1373
+ function parseIsoWeekday(input, locale) {
1374
+ if (typeof input === 'string') {
1375
+ return locale.weekdaysParse(input) % 7 || 7;
1376
+ }
1377
+ return isNaN(input) ? null : input;
1378
+ }
1379
+
1380
+ // LOCALES
1381
+ function shiftWeekdays (ws, n) {
1382
+ return ws.slice(n, 7).concat(ws.slice(0, n));
1383
+ }
1384
+
1385
+ var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
1386
+ function localeWeekdays (m, format) {
1387
+ var weekdays = isArray(this._weekdays) ? this._weekdays :
1388
+ this._weekdays[(m && m !== true && this._weekdays.isFormat.test(format)) ? 'format' : 'standalone'];
1389
+ return (m === true) ? shiftWeekdays(weekdays, this._week.dow)
1390
+ : (m) ? weekdays[m.day()] : weekdays;
1391
+ }
1392
+
1393
+ var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
1394
+ function localeWeekdaysShort (m) {
1395
+ return (m === true) ? shiftWeekdays(this._weekdaysShort, this._week.dow)
1396
+ : (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
1397
+ }
1398
+
1399
+ var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
1400
+ function localeWeekdaysMin (m) {
1401
+ return (m === true) ? shiftWeekdays(this._weekdaysMin, this._week.dow)
1402
+ : (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
1403
+ }
1404
+
1405
+ function handleStrictParse(weekdayName, format, strict) {
1406
+ var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
1407
+ if (!this._weekdaysParse) {
1408
+ this._weekdaysParse = [];
1409
+ this._shortWeekdaysParse = [];
1410
+ this._minWeekdaysParse = [];
1411
+
1412
+ for (i = 0; i < 7; ++i) {
1413
+ mom = createUTC([2000, 1]).day(i);
1414
+ this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
1415
+ this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
1416
+ this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
1417
+ }
1418
+ }
1419
+
1420
+ if (strict) {
1421
+ if (format === 'dddd') {
1422
+ ii = indexOf.call(this._weekdaysParse, llc);
1423
+ return ii !== -1 ? ii : null;
1424
+ } else if (format === 'ddd') {
1425
+ ii = indexOf.call(this._shortWeekdaysParse, llc);
1426
+ return ii !== -1 ? ii : null;
1427
+ } else {
1428
+ ii = indexOf.call(this._minWeekdaysParse, llc);
1429
+ return ii !== -1 ? ii : null;
1430
+ }
1431
+ } else {
1432
+ if (format === 'dddd') {
1433
+ ii = indexOf.call(this._weekdaysParse, llc);
1434
+ if (ii !== -1) {
1435
+ return ii;
1436
+ }
1437
+ ii = indexOf.call(this._shortWeekdaysParse, llc);
1438
+ if (ii !== -1) {
1439
+ return ii;
1440
+ }
1441
+ ii = indexOf.call(this._minWeekdaysParse, llc);
1442
+ return ii !== -1 ? ii : null;
1443
+ } else if (format === 'ddd') {
1444
+ ii = indexOf.call(this._shortWeekdaysParse, llc);
1445
+ if (ii !== -1) {
1446
+ return ii;
1447
+ }
1448
+ ii = indexOf.call(this._weekdaysParse, llc);
1449
+ if (ii !== -1) {
1450
+ return ii;
1451
+ }
1452
+ ii = indexOf.call(this._minWeekdaysParse, llc);
1453
+ return ii !== -1 ? ii : null;
1454
+ } else {
1455
+ ii = indexOf.call(this._minWeekdaysParse, llc);
1456
+ if (ii !== -1) {
1457
+ return ii;
1458
+ }
1459
+ ii = indexOf.call(this._weekdaysParse, llc);
1460
+ if (ii !== -1) {
1461
+ return ii;
1462
+ }
1463
+ ii = indexOf.call(this._shortWeekdaysParse, llc);
1464
+ return ii !== -1 ? ii : null;
1465
+ }
1466
+ }
1467
+ }
1468
+
1469
+ function localeWeekdaysParse (weekdayName, format, strict) {
1470
+ var i, mom, regex;
1471
+
1472
+ if (this._weekdaysParseExact) {
1473
+ return handleStrictParse.call(this, weekdayName, format, strict);
1474
+ }
1475
+
1476
+ if (!this._weekdaysParse) {
1477
+ this._weekdaysParse = [];
1478
+ this._minWeekdaysParse = [];
1479
+ this._shortWeekdaysParse = [];
1480
+ this._fullWeekdaysParse = [];
1481
+ }
1482
+
1483
+ for (i = 0; i < 7; i++) {
1484
+ // make the regex if we don't have it already
1485
+
1486
+ mom = createUTC([2000, 1]).day(i);
1487
+ if (strict && !this._fullWeekdaysParse[i]) {
1488
+ this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
1489
+ this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
1490
+ this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
1491
+ }
1492
+ if (!this._weekdaysParse[i]) {
1493
+ regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
1494
+ this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
1495
+ }
1496
+ // test the regex
1497
+ if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
1498
+ return i;
1499
+ } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
1500
+ return i;
1501
+ } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
1502
+ return i;
1503
+ } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
1504
+ return i;
1505
+ }
1506
+ }
1507
+ }
1508
+
1509
+ // MOMENTS
1510
+
1511
+ function getSetDayOfWeek (input) {
1512
+ if (!this.isValid()) {
1513
+ return input != null ? this : NaN;
1514
+ }
1515
+ var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
1516
+ if (input != null) {
1517
+ input = parseWeekday(input, this.localeData());
1518
+ return this.add(input - day, 'd');
1519
+ } else {
1520
+ return day;
1521
+ }
1522
+ }
1523
+
1524
+ function getSetLocaleDayOfWeek (input) {
1525
+ if (!this.isValid()) {
1526
+ return input != null ? this : NaN;
1527
+ }
1528
+ var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
1529
+ return input == null ? weekday : this.add(input - weekday, 'd');
1530
+ }
1531
+
1532
+ function getSetISODayOfWeek (input) {
1533
+ if (!this.isValid()) {
1534
+ return input != null ? this : NaN;
1535
+ }
1536
+
1537
+ // behaves the same as moment#day except
1538
+ // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
1539
+ // as a setter, sunday should belong to the previous week.
1540
+
1541
+ if (input != null) {
1542
+ var weekday = parseIsoWeekday(input, this.localeData());
1543
+ return this.day(this.day() % 7 ? weekday : weekday - 7);
1544
+ } else {
1545
+ return this.day() || 7;
1546
+ }
1547
+ }
1548
+
1549
+ var defaultWeekdaysRegex = matchWord;
1550
+ function weekdaysRegex (isStrict) {
1551
+ if (this._weekdaysParseExact) {
1552
+ if (!hasOwnProp(this, '_weekdaysRegex')) {
1553
+ computeWeekdaysParse.call(this);
1554
+ }
1555
+ if (isStrict) {
1556
+ return this._weekdaysStrictRegex;
1557
+ } else {
1558
+ return this._weekdaysRegex;
1559
+ }
1560
+ } else {
1561
+ if (!hasOwnProp(this, '_weekdaysRegex')) {
1562
+ this._weekdaysRegex = defaultWeekdaysRegex;
1563
+ }
1564
+ return this._weekdaysStrictRegex && isStrict ?
1565
+ this._weekdaysStrictRegex : this._weekdaysRegex;
1566
+ }
1567
+ }
1568
+
1569
+ var defaultWeekdaysShortRegex = matchWord;
1570
+ function weekdaysShortRegex (isStrict) {
1571
+ if (this._weekdaysParseExact) {
1572
+ if (!hasOwnProp(this, '_weekdaysRegex')) {
1573
+ computeWeekdaysParse.call(this);
1574
+ }
1575
+ if (isStrict) {
1576
+ return this._weekdaysShortStrictRegex;
1577
+ } else {
1578
+ return this._weekdaysShortRegex;
1579
+ }
1580
+ } else {
1581
+ if (!hasOwnProp(this, '_weekdaysShortRegex')) {
1582
+ this._weekdaysShortRegex = defaultWeekdaysShortRegex;
1583
+ }
1584
+ return this._weekdaysShortStrictRegex && isStrict ?
1585
+ this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
1586
+ }
1587
+ }
1588
+
1589
+ var defaultWeekdaysMinRegex = matchWord;
1590
+ function weekdaysMinRegex (isStrict) {
1591
+ if (this._weekdaysParseExact) {
1592
+ if (!hasOwnProp(this, '_weekdaysRegex')) {
1593
+ computeWeekdaysParse.call(this);
1594
+ }
1595
+ if (isStrict) {
1596
+ return this._weekdaysMinStrictRegex;
1597
+ } else {
1598
+ return this._weekdaysMinRegex;
1599
+ }
1600
+ } else {
1601
+ if (!hasOwnProp(this, '_weekdaysMinRegex')) {
1602
+ this._weekdaysMinRegex = defaultWeekdaysMinRegex;
1603
+ }
1604
+ return this._weekdaysMinStrictRegex && isStrict ?
1605
+ this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
1606
+ }
1607
+ }
1608
+
1609
+
1610
+ function computeWeekdaysParse () {
1611
+ function cmpLenRev(a, b) {
1612
+ return b.length - a.length;
1613
+ }
1614
+
1615
+ var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
1616
+ i, mom, minp, shortp, longp;
1617
+ for (i = 0; i < 7; i++) {
1618
+ // make the regex if we don't have it already
1619
+ mom = createUTC([2000, 1]).day(i);
1620
+ minp = this.weekdaysMin(mom, '');
1621
+ shortp = this.weekdaysShort(mom, '');
1622
+ longp = this.weekdays(mom, '');
1623
+ minPieces.push(minp);
1624
+ shortPieces.push(shortp);
1625
+ longPieces.push(longp);
1626
+ mixedPieces.push(minp);
1627
+ mixedPieces.push(shortp);
1628
+ mixedPieces.push(longp);
1629
+ }
1630
+ // Sorting makes sure if one weekday (or abbr) is a prefix of another it
1631
+ // will match the longer piece.
1632
+ minPieces.sort(cmpLenRev);
1633
+ shortPieces.sort(cmpLenRev);
1634
+ longPieces.sort(cmpLenRev);
1635
+ mixedPieces.sort(cmpLenRev);
1636
+ for (i = 0; i < 7; i++) {
1637
+ shortPieces[i] = regexEscape(shortPieces[i]);
1638
+ longPieces[i] = regexEscape(longPieces[i]);
1639
+ mixedPieces[i] = regexEscape(mixedPieces[i]);
1640
+ }
1641
+
1642
+ this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
1643
+ this._weekdaysShortRegex = this._weekdaysRegex;
1644
+ this._weekdaysMinRegex = this._weekdaysRegex;
1645
+
1646
+ this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
1647
+ this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
1648
+ this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
1649
+ }
1650
+
1651
+ // FORMATTING
1652
+
1653
+ function hFormat() {
1654
+ return this.hours() % 12 || 12;
1655
+ }
1656
+
1657
+ function kFormat() {
1658
+ return this.hours() || 24;
1659
+ }
1660
+
1661
+ addFormatToken('H', ['HH', 2], 0, 'hour');
1662
+ addFormatToken('h', ['hh', 2], 0, hFormat);
1663
+ addFormatToken('k', ['kk', 2], 0, kFormat);
1664
+
1665
+ addFormatToken('hmm', 0, 0, function () {
1666
+ return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
1667
+ });
1668
+
1669
+ addFormatToken('hmmss', 0, 0, function () {
1670
+ return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
1671
+ zeroFill(this.seconds(), 2);
1672
+ });
1673
+
1674
+ addFormatToken('Hmm', 0, 0, function () {
1675
+ return '' + this.hours() + zeroFill(this.minutes(), 2);
1676
+ });
1677
+
1678
+ addFormatToken('Hmmss', 0, 0, function () {
1679
+ return '' + this.hours() + zeroFill(this.minutes(), 2) +
1680
+ zeroFill(this.seconds(), 2);
1681
+ });
1682
+
1683
+ function meridiem (token, lowercase) {
1684
+ addFormatToken(token, 0, 0, function () {
1685
+ return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
1686
+ });
1687
+ }
1688
+
1689
+ meridiem('a', true);
1690
+ meridiem('A', false);
1691
+
1692
+ // ALIASES
1693
+
1694
+ addUnitAlias('hour', 'h');
1695
+
1696
+ // PRIORITY
1697
+ addUnitPriority('hour', 13);
1698
+
1699
+ // PARSING
1700
+
1701
+ function matchMeridiem (isStrict, locale) {
1702
+ return locale._meridiemParse;
1703
+ }
1704
+
1705
+ addRegexToken('a', matchMeridiem);
1706
+ addRegexToken('A', matchMeridiem);
1707
+ addRegexToken('H', match1to2);
1708
+ addRegexToken('h', match1to2);
1709
+ addRegexToken('k', match1to2);
1710
+ addRegexToken('HH', match1to2, match2);
1711
+ addRegexToken('hh', match1to2, match2);
1712
+ addRegexToken('kk', match1to2, match2);
1713
+
1714
+ addRegexToken('hmm', match3to4);
1715
+ addRegexToken('hmmss', match5to6);
1716
+ addRegexToken('Hmm', match3to4);
1717
+ addRegexToken('Hmmss', match5to6);
1718
+
1719
+ addParseToken(['H', 'HH'], HOUR);
1720
+ addParseToken(['k', 'kk'], function (input, array, config) {
1721
+ var kInput = toInt(input);
1722
+ array[HOUR] = kInput === 24 ? 0 : kInput;
1723
+ });
1724
+ addParseToken(['a', 'A'], function (input, array, config) {
1725
+ config._isPm = config._locale.isPM(input);
1726
+ config._meridiem = input;
1727
+ });
1728
+ addParseToken(['h', 'hh'], function (input, array, config) {
1729
+ array[HOUR] = toInt(input);
1730
+ getParsingFlags(config).bigHour = true;
1731
+ });
1732
+ addParseToken('hmm', function (input, array, config) {
1733
+ var pos = input.length - 2;
1734
+ array[HOUR] = toInt(input.substr(0, pos));
1735
+ array[MINUTE] = toInt(input.substr(pos));
1736
+ getParsingFlags(config).bigHour = true;
1737
+ });
1738
+ addParseToken('hmmss', function (input, array, config) {
1739
+ var pos1 = input.length - 4;
1740
+ var pos2 = input.length - 2;
1741
+ array[HOUR] = toInt(input.substr(0, pos1));
1742
+ array[MINUTE] = toInt(input.substr(pos1, 2));
1743
+ array[SECOND] = toInt(input.substr(pos2));
1744
+ getParsingFlags(config).bigHour = true;
1745
+ });
1746
+ addParseToken('Hmm', function (input, array, config) {
1747
+ var pos = input.length - 2;
1748
+ array[HOUR] = toInt(input.substr(0, pos));
1749
+ array[MINUTE] = toInt(input.substr(pos));
1750
+ });
1751
+ addParseToken('Hmmss', function (input, array, config) {
1752
+ var pos1 = input.length - 4;
1753
+ var pos2 = input.length - 2;
1754
+ array[HOUR] = toInt(input.substr(0, pos1));
1755
+ array[MINUTE] = toInt(input.substr(pos1, 2));
1756
+ array[SECOND] = toInt(input.substr(pos2));
1757
+ });
1758
+
1759
+ // LOCALES
1760
+
1761
+ function localeIsPM (input) {
1762
+ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
1763
+ // Using charAt should be more compatible.
1764
+ return ((input + '').toLowerCase().charAt(0) === 'p');
1765
+ }
1766
+
1767
+ var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
1768
+ function localeMeridiem (hours, minutes, isLower) {
1769
+ if (hours > 11) {
1770
+ return isLower ? 'pm' : 'PM';
1771
+ } else {
1772
+ return isLower ? 'am' : 'AM';
1773
+ }
1774
+ }
1775
+
1776
+
1777
+ // MOMENTS
1778
+
1779
+ // Setting the hour should keep the time, because the user explicitly
1780
+ // specified which hour they want. So trying to maintain the same hour (in
1781
+ // a new timezone) makes sense. Adding/subtracting hours does not follow
1782
+ // this rule.
1783
+ var getSetHour = makeGetSet('Hours', true);
1784
+
1785
+ var baseConfig = {
1786
+ calendar: defaultCalendar,
1787
+ longDateFormat: defaultLongDateFormat,
1788
+ invalidDate: defaultInvalidDate,
1789
+ ordinal: defaultOrdinal,
1790
+ dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
1791
+ relativeTime: defaultRelativeTime,
1792
+
1793
+ months: defaultLocaleMonths,
1794
+ monthsShort: defaultLocaleMonthsShort,
1795
+
1796
+ week: defaultLocaleWeek,
1797
+
1798
+ weekdays: defaultLocaleWeekdays,
1799
+ weekdaysMin: defaultLocaleWeekdaysMin,
1800
+ weekdaysShort: defaultLocaleWeekdaysShort,
1801
+
1802
+ meridiemParse: defaultLocaleMeridiemParse
1803
+ };
1804
+
1805
+ // internal storage for locale config files
1806
+ var locales = {};
1807
+ var localeFamilies = {};
1808
+ var globalLocale;
1809
+
1810
+ function normalizeLocale(key) {
1811
+ return key ? key.toLowerCase().replace('_', '-') : key;
1812
+ }
1813
+
1814
+ // pick the locale from the array
1815
+ // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
1816
+ // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
1817
+ function chooseLocale(names) {
1818
+ var i = 0, j, next, locale, split;
1819
+
1820
+ while (i < names.length) {
1821
+ split = normalizeLocale(names[i]).split('-');
1822
+ j = split.length;
1823
+ next = normalizeLocale(names[i + 1]);
1824
+ next = next ? next.split('-') : null;
1825
+ while (j > 0) {
1826
+ locale = loadLocale(split.slice(0, j).join('-'));
1827
+ if (locale) {
1828
+ return locale;
1829
+ }
1830
+ if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
1831
+ //the next array item is better than a shallower substring of this one
1832
+ break;
1833
+ }
1834
+ j--;
1835
+ }
1836
+ i++;
1837
+ }
1838
+ return globalLocale;
1839
+ }
1840
+
1841
+ function loadLocale(name) {
1842
+ var oldLocale = null;
1843
+ // TODO: Find a better way to register and load all the locales in Node
1844
+ if (!locales[name] && (typeof module !== 'undefined') &&
1845
+ module && module.exports) {
1846
+ try {
1847
+ oldLocale = globalLocale._abbr;
1848
+ var aliasedRequire = require;
1849
+ aliasedRequire('./locale/' + name);
1850
+ getSetGlobalLocale(oldLocale);
1851
+ } catch (e) {}
1852
+ }
1853
+ return locales[name];
1854
+ }
1855
+
1856
+ // This function will load locale and then set the global locale. If
1857
+ // no arguments are passed in, it will simply return the current global
1858
+ // locale key.
1859
+ function getSetGlobalLocale (key, values) {
1860
+ var data;
1861
+ if (key) {
1862
+ if (isUndefined(values)) {
1863
+ data = getLocale(key);
1864
+ }
1865
+ else {
1866
+ data = defineLocale(key, values);
1867
+ }
1868
+
1869
+ if (data) {
1870
+ // moment.duration._locale = moment._locale = data;
1871
+ globalLocale = data;
1872
+ }
1873
+ else {
1874
+ if ((typeof console !== 'undefined') && console.warn) {
1875
+ //warn user if arguments are passed but the locale could not be set
1876
+ console.warn('Locale ' + key + ' not found. Did you forget to load it?');
1877
+ }
1878
+ }
1879
+ }
1880
+
1881
+ return globalLocale._abbr;
1882
+ }
1883
+
1884
+ function defineLocale (name, config) {
1885
+ if (config !== null) {
1886
+ var locale, parentConfig = baseConfig;
1887
+ config.abbr = name;
1888
+ if (locales[name] != null) {
1889
+ deprecateSimple('defineLocaleOverride',
1890
+ 'use moment.updateLocale(localeName, config) to change ' +
1891
+ 'an existing locale. moment.defineLocale(localeName, ' +
1892
+ 'config) should only be used for creating a new locale ' +
1893
+ 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
1894
+ parentConfig = locales[name]._config;
1895
+ } else if (config.parentLocale != null) {
1896
+ if (locales[config.parentLocale] != null) {
1897
+ parentConfig = locales[config.parentLocale]._config;
1898
+ } else {
1899
+ locale = loadLocale(config.parentLocale);
1900
+ if (locale != null) {
1901
+ parentConfig = locale._config;
1902
+ } else {
1903
+ if (!localeFamilies[config.parentLocale]) {
1904
+ localeFamilies[config.parentLocale] = [];
1905
+ }
1906
+ localeFamilies[config.parentLocale].push({
1907
+ name: name,
1908
+ config: config
1909
+ });
1910
+ return null;
1911
+ }
1912
+ }
1913
+ }
1914
+ locales[name] = new Locale(mergeConfigs(parentConfig, config));
1915
+
1916
+ if (localeFamilies[name]) {
1917
+ localeFamilies[name].forEach(function (x) {
1918
+ defineLocale(x.name, x.config);
1919
+ });
1920
+ }
1921
+
1922
+ // backwards compat for now: also set the locale
1923
+ // make sure we set the locale AFTER all child locales have been
1924
+ // created, so we won't end up with the child locale set.
1925
+ getSetGlobalLocale(name);
1926
+
1927
+
1928
+ return locales[name];
1929
+ } else {
1930
+ // useful for testing
1931
+ delete locales[name];
1932
+ return null;
1933
+ }
1934
+ }
1935
+
1936
+ function updateLocale(name, config) {
1937
+ if (config != null) {
1938
+ var locale, tmpLocale, parentConfig = baseConfig;
1939
+ // MERGE
1940
+ tmpLocale = loadLocale(name);
1941
+ if (tmpLocale != null) {
1942
+ parentConfig = tmpLocale._config;
1943
+ }
1944
+ config = mergeConfigs(parentConfig, config);
1945
+ locale = new Locale(config);
1946
+ locale.parentLocale = locales[name];
1947
+ locales[name] = locale;
1948
+
1949
+ // backwards compat for now: also set the locale
1950
+ getSetGlobalLocale(name);
1951
+ } else {
1952
+ // pass null for config to unupdate, useful for tests
1953
+ if (locales[name] != null) {
1954
+ if (locales[name].parentLocale != null) {
1955
+ locales[name] = locales[name].parentLocale;
1956
+ } else if (locales[name] != null) {
1957
+ delete locales[name];
1958
+ }
1959
+ }
1960
+ }
1961
+ return locales[name];
1962
+ }
1963
+
1964
+ // returns locale data
1965
+ function getLocale (key) {
1966
+ var locale;
1967
+
1968
+ if (key && key._locale && key._locale._abbr) {
1969
+ key = key._locale._abbr;
1970
+ }
1971
+
1972
+ if (!key) {
1973
+ return globalLocale;
1974
+ }
1975
+
1976
+ if (!isArray(key)) {
1977
+ //short-circuit everything else
1978
+ locale = loadLocale(key);
1979
+ if (locale) {
1980
+ return locale;
1981
+ }
1982
+ key = [key];
1983
+ }
1984
+
1985
+ return chooseLocale(key);
1986
+ }
1987
+
1988
+ function listLocales() {
1989
+ return keys(locales);
1990
+ }
1991
+
1992
+ function checkOverflow (m) {
1993
+ var overflow;
1994
+ var a = m._a;
1995
+
1996
+ if (a && getParsingFlags(m).overflow === -2) {
1997
+ overflow =
1998
+ a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
1999
+ a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
2000
+ a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
2001
+ a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
2002
+ a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
2003
+ a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
2004
+ -1;
2005
+
2006
+ if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
2007
+ overflow = DATE;
2008
+ }
2009
+ if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
2010
+ overflow = WEEK;
2011
+ }
2012
+ if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
2013
+ overflow = WEEKDAY;
2014
+ }
2015
+
2016
+ getParsingFlags(m).overflow = overflow;
2017
+ }
2018
+
2019
+ return m;
2020
+ }
2021
+
2022
+ // Pick the first defined of two or three arguments.
2023
+ function defaults(a, b, c) {
2024
+ if (a != null) {
2025
+ return a;
2026
+ }
2027
+ if (b != null) {
2028
+ return b;
2029
+ }
2030
+ return c;
2031
+ }
2032
+
2033
+ function currentDateArray(config) {
2034
+ // hooks is actually the exported moment object
2035
+ var nowValue = new Date(hooks.now());
2036
+ if (config._useUTC) {
2037
+ return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
2038
+ }
2039
+ return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
2040
+ }
2041
+
2042
+ // convert an array to a date.
2043
+ // the array should mirror the parameters below
2044
+ // note: all values past the year are optional and will default to the lowest possible value.
2045
+ // [year, month, day , hour, minute, second, millisecond]
2046
+ function configFromArray (config) {
2047
+ var i, date, input = [], currentDate, expectedWeekday, yearToUse;
2048
+
2049
+ if (config._d) {
2050
+ return;
2051
+ }
2052
+
2053
+ currentDate = currentDateArray(config);
2054
+
2055
+ //compute day of the year from weeks and weekdays
2056
+ if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
2057
+ dayOfYearFromWeekInfo(config);
2058
+ }
2059
+
2060
+ //if the day of the year is set, figure out what it is
2061
+ if (config._dayOfYear != null) {
2062
+ yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
2063
+
2064
+ if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
2065
+ getParsingFlags(config)._overflowDayOfYear = true;
2066
+ }
2067
+
2068
+ date = createUTCDate(yearToUse, 0, config._dayOfYear);
2069
+ config._a[MONTH] = date.getUTCMonth();
2070
+ config._a[DATE] = date.getUTCDate();
2071
+ }
2072
+
2073
+ // Default to current date.
2074
+ // * if no year, month, day of month are given, default to today
2075
+ // * if day of month is given, default month and year
2076
+ // * if month is given, default only year
2077
+ // * if year is given, don't default anything
2078
+ for (i = 0; i < 3 && config._a[i] == null; ++i) {
2079
+ config._a[i] = input[i] = currentDate[i];
2080
+ }
2081
+
2082
+ // Zero out whatever was not defaulted, including time
2083
+ for (; i < 7; i++) {
2084
+ config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
2085
+ }
2086
+
2087
+ // Check for 24:00:00.000
2088
+ if (config._a[HOUR] === 24 &&
2089
+ config._a[MINUTE] === 0 &&
2090
+ config._a[SECOND] === 0 &&
2091
+ config._a[MILLISECOND] === 0) {
2092
+ config._nextDay = true;
2093
+ config._a[HOUR] = 0;
2094
+ }
2095
+
2096
+ config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
2097
+ expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
2098
+
2099
+ // Apply timezone offset from input. The actual utcOffset can be changed
2100
+ // with parseZone.
2101
+ if (config._tzm != null) {
2102
+ config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2103
+ }
2104
+
2105
+ if (config._nextDay) {
2106
+ config._a[HOUR] = 24;
2107
+ }
2108
+
2109
+ // check for mismatching day of week
2110
+ if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
2111
+ getParsingFlags(config).weekdayMismatch = true;
2112
+ }
2113
+ }
2114
+
2115
+ function dayOfYearFromWeekInfo(config) {
2116
+ var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
2117
+
2118
+ w = config._w;
2119
+ if (w.GG != null || w.W != null || w.E != null) {
2120
+ dow = 1;
2121
+ doy = 4;
2122
+
2123
+ // TODO: We need to take the current isoWeekYear, but that depends on
2124
+ // how we interpret now (local, utc, fixed offset). So create
2125
+ // a now version of current config (take local/utc/offset flags, and
2126
+ // create now).
2127
+ weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
2128
+ week = defaults(w.W, 1);
2129
+ weekday = defaults(w.E, 1);
2130
+ if (weekday < 1 || weekday > 7) {
2131
+ weekdayOverflow = true;
2132
+ }
2133
+ } else {
2134
+ dow = config._locale._week.dow;
2135
+ doy = config._locale._week.doy;
2136
+
2137
+ var curWeek = weekOfYear(createLocal(), dow, doy);
2138
+
2139
+ weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
2140
+
2141
+ // Default to current week.
2142
+ week = defaults(w.w, curWeek.week);
2143
+
2144
+ if (w.d != null) {
2145
+ // weekday -- low day numbers are considered next week
2146
+ weekday = w.d;
2147
+ if (weekday < 0 || weekday > 6) {
2148
+ weekdayOverflow = true;
2149
+ }
2150
+ } else if (w.e != null) {
2151
+ // local weekday -- counting starts from beginning of week
2152
+ weekday = w.e + dow;
2153
+ if (w.e < 0 || w.e > 6) {
2154
+ weekdayOverflow = true;
2155
+ }
2156
+ } else {
2157
+ // default to beginning of week
2158
+ weekday = dow;
2159
+ }
2160
+ }
2161
+ if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
2162
+ getParsingFlags(config)._overflowWeeks = true;
2163
+ } else if (weekdayOverflow != null) {
2164
+ getParsingFlags(config)._overflowWeekday = true;
2165
+ } else {
2166
+ temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
2167
+ config._a[YEAR] = temp.year;
2168
+ config._dayOfYear = temp.dayOfYear;
2169
+ }
2170
+ }
2171
+
2172
+ // iso 8601 regex
2173
+ // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
2174
+ var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
2175
+ var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
2176
+
2177
+ var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
2178
+
2179
+ var isoDates = [
2180
+ ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
2181
+ ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
2182
+ ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
2183
+ ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
2184
+ ['YYYY-DDD', /\d{4}-\d{3}/],
2185
+ ['YYYY-MM', /\d{4}-\d\d/, false],
2186
+ ['YYYYYYMMDD', /[+-]\d{10}/],
2187
+ ['YYYYMMDD', /\d{8}/],
2188
+ // YYYYMM is NOT allowed by the standard
2189
+ ['GGGG[W]WWE', /\d{4}W\d{3}/],
2190
+ ['GGGG[W]WW', /\d{4}W\d{2}/, false],
2191
+ ['YYYYDDD', /\d{7}/]
2192
+ ];
2193
+
2194
+ // iso time formats and regexes
2195
+ var isoTimes = [
2196
+ ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
2197
+ ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
2198
+ ['HH:mm:ss', /\d\d:\d\d:\d\d/],
2199
+ ['HH:mm', /\d\d:\d\d/],
2200
+ ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
2201
+ ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
2202
+ ['HHmmss', /\d\d\d\d\d\d/],
2203
+ ['HHmm', /\d\d\d\d/],
2204
+ ['HH', /\d\d/]
2205
+ ];
2206
+
2207
+ var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
2208
+
2209
+ // date from iso format
2210
+ function configFromISO(config) {
2211
+ var i, l,
2212
+ string = config._i,
2213
+ match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
2214
+ allowTime, dateFormat, timeFormat, tzFormat;
2215
+
2216
+ if (match) {
2217
+ getParsingFlags(config).iso = true;
2218
+
2219
+ for (i = 0, l = isoDates.length; i < l; i++) {
2220
+ if (isoDates[i][1].exec(match[1])) {
2221
+ dateFormat = isoDates[i][0];
2222
+ allowTime = isoDates[i][2] !== false;
2223
+ break;
2224
+ }
2225
+ }
2226
+ if (dateFormat == null) {
2227
+ config._isValid = false;
2228
+ return;
2229
+ }
2230
+ if (match[3]) {
2231
+ for (i = 0, l = isoTimes.length; i < l; i++) {
2232
+ if (isoTimes[i][1].exec(match[3])) {
2233
+ // match[2] should be 'T' or space
2234
+ timeFormat = (match[2] || ' ') + isoTimes[i][0];
2235
+ break;
2236
+ }
2237
+ }
2238
+ if (timeFormat == null) {
2239
+ config._isValid = false;
2240
+ return;
2241
+ }
2242
+ }
2243
+ if (!allowTime && timeFormat != null) {
2244
+ config._isValid = false;
2245
+ return;
2246
+ }
2247
+ if (match[4]) {
2248
+ if (tzRegex.exec(match[4])) {
2249
+ tzFormat = 'Z';
2250
+ } else {
2251
+ config._isValid = false;
2252
+ return;
2253
+ }
2254
+ }
2255
+ config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
2256
+ configFromStringAndFormat(config);
2257
+ } else {
2258
+ config._isValid = false;
2259
+ }
2260
+ }
2261
+
2262
+ // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
2263
+ var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
2264
+
2265
+ function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
2266
+ var result = [
2267
+ untruncateYear(yearStr),
2268
+ defaultLocaleMonthsShort.indexOf(monthStr),
2269
+ parseInt(dayStr, 10),
2270
+ parseInt(hourStr, 10),
2271
+ parseInt(minuteStr, 10)
2272
+ ];
2273
+
2274
+ if (secondStr) {
2275
+ result.push(parseInt(secondStr, 10));
2276
+ }
2277
+
2278
+ return result;
2279
+ }
2280
+
2281
+ function untruncateYear(yearStr) {
2282
+ var year = parseInt(yearStr, 10);
2283
+ if (year <= 49) {
2284
+ return 2000 + year;
2285
+ } else if (year <= 999) {
2286
+ return 1900 + year;
2287
+ }
2288
+ return year;
2289
+ }
2290
+
2291
+ function preprocessRFC2822(s) {
2292
+ // Remove comments and folding whitespace and replace multiple-spaces with a single space
2293
+ return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
2294
+ }
2295
+
2296
+ function checkWeekday(weekdayStr, parsedInput, config) {
2297
+ if (weekdayStr) {
2298
+ // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
2299
+ var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
2300
+ weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
2301
+ if (weekdayProvided !== weekdayActual) {
2302
+ getParsingFlags(config).weekdayMismatch = true;
2303
+ config._isValid = false;
2304
+ return false;
2305
+ }
2306
+ }
2307
+ return true;
2308
+ }
2309
+
2310
+ var obsOffsets = {
2311
+ UT: 0,
2312
+ GMT: 0,
2313
+ EDT: -4 * 60,
2314
+ EST: -5 * 60,
2315
+ CDT: -5 * 60,
2316
+ CST: -6 * 60,
2317
+ MDT: -6 * 60,
2318
+ MST: -7 * 60,
2319
+ PDT: -7 * 60,
2320
+ PST: -8 * 60
2321
+ };
2322
+
2323
+ function calculateOffset(obsOffset, militaryOffset, numOffset) {
2324
+ if (obsOffset) {
2325
+ return obsOffsets[obsOffset];
2326
+ } else if (militaryOffset) {
2327
+ // the only allowed military tz is Z
2328
+ return 0;
2329
+ } else {
2330
+ var hm = parseInt(numOffset, 10);
2331
+ var m = hm % 100, h = (hm - m) / 100;
2332
+ return h * 60 + m;
2333
+ }
2334
+ }
2335
+
2336
+ // date and time from ref 2822 format
2337
+ function configFromRFC2822(config) {
2338
+ var match = rfc2822.exec(preprocessRFC2822(config._i));
2339
+ if (match) {
2340
+ var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
2341
+ if (!checkWeekday(match[1], parsedArray, config)) {
2342
+ return;
2343
+ }
2344
+
2345
+ config._a = parsedArray;
2346
+ config._tzm = calculateOffset(match[8], match[9], match[10]);
2347
+
2348
+ config._d = createUTCDate.apply(null, config._a);
2349
+ config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2350
+
2351
+ getParsingFlags(config).rfc2822 = true;
2352
+ } else {
2353
+ config._isValid = false;
2354
+ }
2355
+ }
2356
+
2357
+ // date from iso format or fallback
2358
+ function configFromString(config) {
2359
+ var matched = aspNetJsonRegex.exec(config._i);
2360
+
2361
+ if (matched !== null) {
2362
+ config._d = new Date(+matched[1]);
2363
+ return;
2364
+ }
2365
+
2366
+ configFromISO(config);
2367
+ if (config._isValid === false) {
2368
+ delete config._isValid;
2369
+ } else {
2370
+ return;
2371
+ }
2372
+
2373
+ configFromRFC2822(config);
2374
+ if (config._isValid === false) {
2375
+ delete config._isValid;
2376
+ } else {
2377
+ return;
2378
+ }
2379
+
2380
+ // Final attempt, use Input Fallback
2381
+ hooks.createFromInputFallback(config);
2382
+ }
2383
+
2384
+ hooks.createFromInputFallback = deprecate(
2385
+ 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
2386
+ 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
2387
+ 'discouraged and will be removed in an upcoming major release. Please refer to ' +
2388
+ 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
2389
+ function (config) {
2390
+ config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
2391
+ }
2392
+ );
2393
+
2394
+ // constant that refers to the ISO standard
2395
+ hooks.ISO_8601 = function () {};
2396
+
2397
+ // constant that refers to the RFC 2822 form
2398
+ hooks.RFC_2822 = function () {};
2399
+
2400
+ // date from string and format string
2401
+ function configFromStringAndFormat(config) {
2402
+ // TODO: Move this to another part of the creation flow to prevent circular deps
2403
+ if (config._f === hooks.ISO_8601) {
2404
+ configFromISO(config);
2405
+ return;
2406
+ }
2407
+ if (config._f === hooks.RFC_2822) {
2408
+ configFromRFC2822(config);
2409
+ return;
2410
+ }
2411
+ config._a = [];
2412
+ getParsingFlags(config).empty = true;
2413
+
2414
+ // This array is used to make a Date, either with `new Date` or `Date.UTC`
2415
+ var string = '' + config._i,
2416
+ i, parsedInput, tokens, token, skipped,
2417
+ stringLength = string.length,
2418
+ totalParsedInputLength = 0;
2419
+
2420
+ tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
2421
+
2422
+ for (i = 0; i < tokens.length; i++) {
2423
+ token = tokens[i];
2424
+ parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
2425
+ // console.log('token', token, 'parsedInput', parsedInput,
2426
+ // 'regex', getParseRegexForToken(token, config));
2427
+ if (parsedInput) {
2428
+ skipped = string.substr(0, string.indexOf(parsedInput));
2429
+ if (skipped.length > 0) {
2430
+ getParsingFlags(config).unusedInput.push(skipped);
2431
+ }
2432
+ string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
2433
+ totalParsedInputLength += parsedInput.length;
2434
+ }
2435
+ // don't parse if it's not a known token
2436
+ if (formatTokenFunctions[token]) {
2437
+ if (parsedInput) {
2438
+ getParsingFlags(config).empty = false;
2439
+ }
2440
+ else {
2441
+ getParsingFlags(config).unusedTokens.push(token);
2442
+ }
2443
+ addTimeToArrayFromToken(token, parsedInput, config);
2444
+ }
2445
+ else if (config._strict && !parsedInput) {
2446
+ getParsingFlags(config).unusedTokens.push(token);
2447
+ }
2448
+ }
2449
+
2450
+ // add remaining unparsed input length to the string
2451
+ getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
2452
+ if (string.length > 0) {
2453
+ getParsingFlags(config).unusedInput.push(string);
2454
+ }
2455
+
2456
+ // clear _12h flag if hour is <= 12
2457
+ if (config._a[HOUR] <= 12 &&
2458
+ getParsingFlags(config).bigHour === true &&
2459
+ config._a[HOUR] > 0) {
2460
+ getParsingFlags(config).bigHour = undefined;
2461
+ }
2462
+
2463
+ getParsingFlags(config).parsedDateParts = config._a.slice(0);
2464
+ getParsingFlags(config).meridiem = config._meridiem;
2465
+ // handle meridiem
2466
+ config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
2467
+
2468
+ configFromArray(config);
2469
+ checkOverflow(config);
2470
+ }
2471
+
2472
+
2473
+ function meridiemFixWrap (locale, hour, meridiem) {
2474
+ var isPm;
2475
+
2476
+ if (meridiem == null) {
2477
+ // nothing to do
2478
+ return hour;
2479
+ }
2480
+ if (locale.meridiemHour != null) {
2481
+ return locale.meridiemHour(hour, meridiem);
2482
+ } else if (locale.isPM != null) {
2483
+ // Fallback
2484
+ isPm = locale.isPM(meridiem);
2485
+ if (isPm && hour < 12) {
2486
+ hour += 12;
2487
+ }
2488
+ if (!isPm && hour === 12) {
2489
+ hour = 0;
2490
+ }
2491
+ return hour;
2492
+ } else {
2493
+ // this is not supposed to happen
2494
+ return hour;
2495
+ }
2496
+ }
2497
+
2498
+ // date from string and array of format strings
2499
+ function configFromStringAndArray(config) {
2500
+ var tempConfig,
2501
+ bestMoment,
2502
+
2503
+ scoreToBeat,
2504
+ i,
2505
+ currentScore;
2506
+
2507
+ if (config._f.length === 0) {
2508
+ getParsingFlags(config).invalidFormat = true;
2509
+ config._d = new Date(NaN);
2510
+ return;
2511
+ }
2512
+
2513
+ for (i = 0; i < config._f.length; i++) {
2514
+ currentScore = 0;
2515
+ tempConfig = copyConfig({}, config);
2516
+ if (config._useUTC != null) {
2517
+ tempConfig._useUTC = config._useUTC;
2518
+ }
2519
+ tempConfig._f = config._f[i];
2520
+ configFromStringAndFormat(tempConfig);
2521
+
2522
+ if (!isValid$2(tempConfig)) {
2523
+ continue;
2524
+ }
2525
+
2526
+ // if there is any input that was not parsed add a penalty for that format
2527
+ currentScore += getParsingFlags(tempConfig).charsLeftOver;
2528
+
2529
+ //or tokens
2530
+ currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
2531
+
2532
+ getParsingFlags(tempConfig).score = currentScore;
2533
+
2534
+ if (scoreToBeat == null || currentScore < scoreToBeat) {
2535
+ scoreToBeat = currentScore;
2536
+ bestMoment = tempConfig;
2537
+ }
2538
+ }
2539
+
2540
+ extend(config, bestMoment || tempConfig);
2541
+ }
2542
+
2543
+ function configFromObject(config) {
2544
+ if (config._d) {
2545
+ return;
2546
+ }
2547
+
2548
+ var i = normalizeObjectUnits(config._i);
2549
+ config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
2550
+ return obj && parseInt(obj, 10);
2551
+ });
2552
+
2553
+ configFromArray(config);
2554
+ }
2555
+
2556
+ function createFromConfig (config) {
2557
+ var res = new Moment(checkOverflow(prepareConfig(config)));
2558
+ if (res._nextDay) {
2559
+ // Adding is smart enough around DST
2560
+ res.add(1, 'd');
2561
+ res._nextDay = undefined;
2562
+ }
2563
+
2564
+ return res;
2565
+ }
2566
+
2567
+ function prepareConfig (config) {
2568
+ var input = config._i,
2569
+ format = config._f;
2570
+
2571
+ config._locale = config._locale || getLocale(config._l);
2572
+
2573
+ if (input === null || (format === undefined && input === '')) {
2574
+ return createInvalid$1({nullInput: true});
2575
+ }
2576
+
2577
+ if (typeof input === 'string') {
2578
+ config._i = input = config._locale.preparse(input);
2579
+ }
2580
+
2581
+ if (isMoment(input)) {
2582
+ return new Moment(checkOverflow(input));
2583
+ } else if (isDate(input)) {
2584
+ config._d = input;
2585
+ } else if (isArray(format)) {
2586
+ configFromStringAndArray(config);
2587
+ } else if (format) {
2588
+ configFromStringAndFormat(config);
2589
+ } else {
2590
+ configFromInput(config);
2591
+ }
2592
+
2593
+ if (!isValid$2(config)) {
2594
+ config._d = null;
2595
+ }
2596
+
2597
+ return config;
2598
+ }
2599
+
2600
+ function configFromInput(config) {
2601
+ var input = config._i;
2602
+ if (isUndefined(input)) {
2603
+ config._d = new Date(hooks.now());
2604
+ } else if (isDate(input)) {
2605
+ config._d = new Date(input.valueOf());
2606
+ } else if (typeof input === 'string') {
2607
+ configFromString(config);
2608
+ } else if (isArray(input)) {
2609
+ config._a = map(input.slice(0), function (obj) {
2610
+ return parseInt(obj, 10);
2611
+ });
2612
+ configFromArray(config);
2613
+ } else if (isObject(input)) {
2614
+ configFromObject(config);
2615
+ } else if (isNumber(input)) {
2616
+ // from milliseconds
2617
+ config._d = new Date(input);
2618
+ } else {
2619
+ hooks.createFromInputFallback(config);
2620
+ }
2621
+ }
2622
+
2623
+ function createLocalOrUTC (input, format, locale, strict, isUTC) {
2624
+ var c = {};
2625
+
2626
+ if (locale === true || locale === false) {
2627
+ strict = locale;
2628
+ locale = undefined;
2629
+ }
2630
+
2631
+ if ((isObject(input) && isObjectEmpty(input)) ||
2632
+ (isArray(input) && input.length === 0)) {
2633
+ input = undefined;
2634
+ }
2635
+ // object construction must be done this way.
2636
+ // https://github.com/moment/moment/issues/1423
2637
+ c._isAMomentObject = true;
2638
+ c._useUTC = c._isUTC = isUTC;
2639
+ c._l = locale;
2640
+ c._i = input;
2641
+ c._f = format;
2642
+ c._strict = strict;
2643
+
2644
+ return createFromConfig(c);
2645
+ }
2646
+
2647
+ function createLocal (input, format, locale, strict) {
2648
+ return createLocalOrUTC(input, format, locale, strict, false);
2649
+ }
2650
+
2651
+ var prototypeMin = deprecate(
2652
+ 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
2653
+ function () {
2654
+ var other = createLocal.apply(null, arguments);
2655
+ if (this.isValid() && other.isValid()) {
2656
+ return other < this ? this : other;
2657
+ } else {
2658
+ return createInvalid$1();
2659
+ }
2660
+ }
2661
+ );
2662
+
2663
+ var prototypeMax = deprecate(
2664
+ 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
2665
+ function () {
2666
+ var other = createLocal.apply(null, arguments);
2667
+ if (this.isValid() && other.isValid()) {
2668
+ return other > this ? this : other;
2669
+ } else {
2670
+ return createInvalid$1();
2671
+ }
2672
+ }
2673
+ );
2674
+
2675
+ // Pick a moment m from moments so that m[fn](other) is true for all
2676
+ // other. This relies on the function fn to be transitive.
2677
+ //
2678
+ // moments should either be an array of moment objects or an array, whose
2679
+ // first element is an array of moment objects.
2680
+ function pickBy(fn, moments) {
2681
+ var res, i;
2682
+ if (moments.length === 1 && isArray(moments[0])) {
2683
+ moments = moments[0];
2684
+ }
2685
+ if (!moments.length) {
2686
+ return createLocal();
2687
+ }
2688
+ res = moments[0];
2689
+ for (i = 1; i < moments.length; ++i) {
2690
+ if (!moments[i].isValid() || moments[i][fn](res)) {
2691
+ res = moments[i];
2692
+ }
2693
+ }
2694
+ return res;
2695
+ }
2696
+
2697
+ // TODO: Use [].sort instead?
2698
+ function min () {
2699
+ var args = [].slice.call(arguments, 0);
2700
+
2701
+ return pickBy('isBefore', args);
2702
+ }
2703
+
2704
+ function max () {
2705
+ var args = [].slice.call(arguments, 0);
2706
+
2707
+ return pickBy('isAfter', args);
2708
+ }
2709
+
2710
+ var now = function () {
2711
+ return Date.now ? Date.now() : +(new Date());
2712
+ };
2713
+
2714
+ var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
2715
+
2716
+ function isDurationValid(m) {
2717
+ for (var key in m) {
2718
+ if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
2719
+ return false;
2720
+ }
2721
+ }
2722
+
2723
+ var unitHasDecimal = false;
2724
+ for (var i = 0; i < ordering.length; ++i) {
2725
+ if (m[ordering[i]]) {
2726
+ if (unitHasDecimal) {
2727
+ return false; // only allow non-integers for smallest unit
2728
+ }
2729
+ if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
2730
+ unitHasDecimal = true;
2731
+ }
2732
+ }
2733
+ }
2734
+
2735
+ return true;
2736
+ }
2737
+
2738
+ function isValid$1() {
2739
+ return this._isValid;
2740
+ }
2741
+
2742
+ function createInvalid() {
2743
+ return createDuration(NaN);
2744
+ }
2745
+
2746
+ function Duration (duration) {
2747
+ var normalizedInput = normalizeObjectUnits(duration),
2748
+ years = normalizedInput.year || 0,
2749
+ quarters = normalizedInput.quarter || 0,
2750
+ months = normalizedInput.month || 0,
2751
+ weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
2752
+ days = normalizedInput.day || 0,
2753
+ hours = normalizedInput.hour || 0,
2754
+ minutes = normalizedInput.minute || 0,
2755
+ seconds = normalizedInput.second || 0,
2756
+ milliseconds = normalizedInput.millisecond || 0;
2757
+
2758
+ this._isValid = isDurationValid(normalizedInput);
2759
+
2760
+ // representation for dateAddRemove
2761
+ this._milliseconds = +milliseconds +
2762
+ seconds * 1e3 + // 1000
2763
+ minutes * 6e4 + // 1000 * 60
2764
+ hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
2765
+ // Because of dateAddRemove treats 24 hours as different from a
2766
+ // day when working around DST, we need to store them separately
2767
+ this._days = +days +
2768
+ weeks * 7;
2769
+ // It is impossible to translate months into days without knowing
2770
+ // which months you are are talking about, so we have to store
2771
+ // it separately.
2772
+ this._months = +months +
2773
+ quarters * 3 +
2774
+ years * 12;
2775
+
2776
+ this._data = {};
2777
+
2778
+ this._locale = getLocale();
2779
+
2780
+ this._bubble();
2781
+ }
2782
+
2783
+ function isDuration (obj) {
2784
+ return obj instanceof Duration;
2785
+ }
2786
+
2787
+ function absRound (number) {
2788
+ if (number < 0) {
2789
+ return Math.round(-1 * number) * -1;
2790
+ } else {
2791
+ return Math.round(number);
2792
+ }
2793
+ }
2794
+
2795
+ // FORMATTING
2796
+
2797
+ function offset (token, separator) {
2798
+ addFormatToken(token, 0, 0, function () {
2799
+ var offset = this.utcOffset();
2800
+ var sign = '+';
2801
+ if (offset < 0) {
2802
+ offset = -offset;
2803
+ sign = '-';
2804
+ }
2805
+ return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
2806
+ });
2807
+ }
2808
+
2809
+ offset('Z', ':');
2810
+ offset('ZZ', '');
2811
+
2812
+ // PARSING
2813
+
2814
+ addRegexToken('Z', matchShortOffset);
2815
+ addRegexToken('ZZ', matchShortOffset);
2816
+ addParseToken(['Z', 'ZZ'], function (input, array, config) {
2817
+ config._useUTC = true;
2818
+ config._tzm = offsetFromString(matchShortOffset, input);
2819
+ });
2820
+
2821
+ // HELPERS
2822
+
2823
+ // timezone chunker
2824
+ // '+10:00' > ['10', '00']
2825
+ // '-1530' > ['-15', '30']
2826
+ var chunkOffset = /([\+\-]|\d\d)/gi;
2827
+
2828
+ function offsetFromString(matcher, string) {
2829
+ var matches = (string || '').match(matcher);
2830
+
2831
+ if (matches === null) {
2832
+ return null;
2833
+ }
2834
+
2835
+ var chunk = matches[matches.length - 1] || [];
2836
+ var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
2837
+ var minutes = +(parts[1] * 60) + toInt(parts[2]);
2838
+
2839
+ return minutes === 0 ?
2840
+ 0 :
2841
+ parts[0] === '+' ? minutes : -minutes;
2842
+ }
2843
+
2844
+ // Return a moment from input, that is local/utc/zone equivalent to model.
2845
+ function cloneWithOffset(input, model) {
2846
+ var res, diff;
2847
+ if (model._isUTC) {
2848
+ res = model.clone();
2849
+ diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
2850
+ // Use low-level api, because this fn is low-level api.
2851
+ res._d.setTime(res._d.valueOf() + diff);
2852
+ hooks.updateOffset(res, false);
2853
+ return res;
2854
+ } else {
2855
+ return createLocal(input).local();
2856
+ }
2857
+ }
2858
+
2859
+ function getDateOffset (m) {
2860
+ // On Firefox.24 Date#getTimezoneOffset returns a floating point.
2861
+ // https://github.com/moment/moment/pull/1871
2862
+ return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
2863
+ }
2864
+
2865
+ // HOOKS
2866
+
2867
+ // This function will be called whenever a moment is mutated.
2868
+ // It is intended to keep the offset in sync with the timezone.
2869
+ hooks.updateOffset = function () {};
2870
+
2871
+ // MOMENTS
2872
+
2873
+ // keepLocalTime = true means only change the timezone, without
2874
+ // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
2875
+ // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
2876
+ // +0200, so we adjust the time as needed, to be valid.
2877
+ //
2878
+ // Keeping the time actually adds/subtracts (one hour)
2879
+ // from the actual represented time. That is why we call updateOffset
2880
+ // a second time. In case it wants us to change the offset again
2881
+ // _changeInProgress == true case, then we have to adjust, because
2882
+ // there is no such time in the given timezone.
2883
+ function getSetOffset (input, keepLocalTime, keepMinutes) {
2884
+ var offset = this._offset || 0,
2885
+ localAdjust;
2886
+ if (!this.isValid()) {
2887
+ return input != null ? this : NaN;
2888
+ }
2889
+ if (input != null) {
2890
+ if (typeof input === 'string') {
2891
+ input = offsetFromString(matchShortOffset, input);
2892
+ if (input === null) {
2893
+ return this;
2894
+ }
2895
+ } else if (Math.abs(input) < 16 && !keepMinutes) {
2896
+ input = input * 60;
2897
+ }
2898
+ if (!this._isUTC && keepLocalTime) {
2899
+ localAdjust = getDateOffset(this);
2900
+ }
2901
+ this._offset = input;
2902
+ this._isUTC = true;
2903
+ if (localAdjust != null) {
2904
+ this.add(localAdjust, 'm');
2905
+ }
2906
+ if (offset !== input) {
2907
+ if (!keepLocalTime || this._changeInProgress) {
2908
+ addSubtract$1(this, createDuration(input - offset, 'm'), 1, false);
2909
+ } else if (!this._changeInProgress) {
2910
+ this._changeInProgress = true;
2911
+ hooks.updateOffset(this, true);
2912
+ this._changeInProgress = null;
2913
+ }
2914
+ }
2915
+ return this;
2916
+ } else {
2917
+ return this._isUTC ? offset : getDateOffset(this);
2918
+ }
2919
+ }
2920
+
2921
+ function getSetZone (input, keepLocalTime) {
2922
+ if (input != null) {
2923
+ if (typeof input !== 'string') {
2924
+ input = -input;
2925
+ }
2926
+
2927
+ this.utcOffset(input, keepLocalTime);
2928
+
2929
+ return this;
2930
+ } else {
2931
+ return -this.utcOffset();
2932
+ }
2933
+ }
2934
+
2935
+ function setOffsetToUTC (keepLocalTime) {
2936
+ return this.utcOffset(0, keepLocalTime);
2937
+ }
2938
+
2939
+ function setOffsetToLocal (keepLocalTime) {
2940
+ if (this._isUTC) {
2941
+ this.utcOffset(0, keepLocalTime);
2942
+ this._isUTC = false;
2943
+
2944
+ if (keepLocalTime) {
2945
+ this.subtract(getDateOffset(this), 'm');
2946
+ }
2947
+ }
2948
+ return this;
2949
+ }
2950
+
2951
+ function setOffsetToParsedOffset () {
2952
+ if (this._tzm != null) {
2953
+ this.utcOffset(this._tzm, false, true);
2954
+ } else if (typeof this._i === 'string') {
2955
+ var tZone = offsetFromString(matchOffset, this._i);
2956
+ if (tZone != null) {
2957
+ this.utcOffset(tZone);
2958
+ }
2959
+ else {
2960
+ this.utcOffset(0, true);
2961
+ }
2962
+ }
2963
+ return this;
2964
+ }
2965
+
2966
+ function hasAlignedHourOffset (input) {
2967
+ if (!this.isValid()) {
2968
+ return false;
2969
+ }
2970
+ input = input ? createLocal(input).utcOffset() : 0;
2971
+
2972
+ return (this.utcOffset() - input) % 60 === 0;
2973
+ }
2974
+
2975
+ function isDaylightSavingTime () {
2976
+ return (
2977
+ this.utcOffset() > this.clone().month(0).utcOffset() ||
2978
+ this.utcOffset() > this.clone().month(5).utcOffset()
2979
+ );
2980
+ }
2981
+
2982
+ function isDaylightSavingTimeShifted () {
2983
+ if (!isUndefined(this._isDSTShifted)) {
2984
+ return this._isDSTShifted;
2985
+ }
2986
+
2987
+ var c = {};
2988
+
2989
+ copyConfig(c, this);
2990
+ c = prepareConfig(c);
2991
+
2992
+ if (c._a) {
2993
+ var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
2994
+ this._isDSTShifted = this.isValid() &&
2995
+ compareArrays(c._a, other.toArray()) > 0;
2996
+ } else {
2997
+ this._isDSTShifted = false;
2998
+ }
2999
+
3000
+ return this._isDSTShifted;
3001
+ }
3002
+
3003
+ function isLocal () {
3004
+ return this.isValid() ? !this._isUTC : false;
3005
+ }
3006
+
3007
+ function isUtcOffset () {
3008
+ return this.isValid() ? this._isUTC : false;
3009
+ }
3010
+
3011
+ function isUtc () {
3012
+ return this.isValid() ? this._isUTC && this._offset === 0 : false;
3013
+ }
3014
+
3015
+ // ASP.NET json date format regex
3016
+ var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
3017
+
3018
+ // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
3019
+ // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
3020
+ // and further modified to allow for strings containing both week and day
3021
+ var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
3022
+
3023
+ function createDuration (input, key) {
3024
+ var duration = input,
3025
+ // matching against regexp is expensive, do it on demand
3026
+ match = null,
3027
+ sign,
3028
+ ret,
3029
+ diffRes;
3030
+
3031
+ if (isDuration(input)) {
3032
+ duration = {
3033
+ ms : input._milliseconds,
3034
+ d : input._days,
3035
+ M : input._months
3036
+ };
3037
+ } else if (isNumber(input)) {
3038
+ duration = {};
3039
+ if (key) {
3040
+ duration[key] = input;
3041
+ } else {
3042
+ duration.milliseconds = input;
3043
+ }
3044
+ } else if (!!(match = aspNetRegex.exec(input))) {
3045
+ sign = (match[1] === '-') ? -1 : 1;
3046
+ duration = {
3047
+ y : 0,
3048
+ d : toInt(match[DATE]) * sign,
3049
+ h : toInt(match[HOUR]) * sign,
3050
+ m : toInt(match[MINUTE]) * sign,
3051
+ s : toInt(match[SECOND]) * sign,
3052
+ ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
3053
+ };
3054
+ } else if (!!(match = isoRegex.exec(input))) {
3055
+ sign = (match[1] === '-') ? -1 : 1;
3056
+ duration = {
3057
+ y : parseIso(match[2], sign),
3058
+ M : parseIso(match[3], sign),
3059
+ w : parseIso(match[4], sign),
3060
+ d : parseIso(match[5], sign),
3061
+ h : parseIso(match[6], sign),
3062
+ m : parseIso(match[7], sign),
3063
+ s : parseIso(match[8], sign)
3064
+ };
3065
+ } else if (duration == null) {// checks for null or undefined
3066
+ duration = {};
3067
+ } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
3068
+ diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
3069
+
3070
+ duration = {};
3071
+ duration.ms = diffRes.milliseconds;
3072
+ duration.M = diffRes.months;
3073
+ }
3074
+
3075
+ ret = new Duration(duration);
3076
+
3077
+ if (isDuration(input) && hasOwnProp(input, '_locale')) {
3078
+ ret._locale = input._locale;
3079
+ }
3080
+
3081
+ return ret;
3082
+ }
3083
+
3084
+ createDuration.fn = Duration.prototype;
3085
+ createDuration.invalid = createInvalid;
3086
+
3087
+ function parseIso (inp, sign) {
3088
+ // We'd normally use ~~inp for this, but unfortunately it also
3089
+ // converts floats to ints.
3090
+ // inp may be undefined, so careful calling replace on it.
3091
+ var res = inp && parseFloat(inp.replace(',', '.'));
3092
+ // apply sign while we're at it
3093
+ return (isNaN(res) ? 0 : res) * sign;
3094
+ }
3095
+
3096
+ function positiveMomentsDifference(base, other) {
3097
+ var res = {};
3098
+
3099
+ res.months = other.month() - base.month() +
3100
+ (other.year() - base.year()) * 12;
3101
+ if (base.clone().add(res.months, 'M').isAfter(other)) {
3102
+ --res.months;
3103
+ }
3104
+
3105
+ res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
3106
+
3107
+ return res;
3108
+ }
3109
+
3110
+ function momentsDifference(base, other) {
3111
+ var res;
3112
+ if (!(base.isValid() && other.isValid())) {
3113
+ return {milliseconds: 0, months: 0};
3114
+ }
3115
+
3116
+ other = cloneWithOffset(other, base);
3117
+ if (base.isBefore(other)) {
3118
+ res = positiveMomentsDifference(base, other);
3119
+ } else {
3120
+ res = positiveMomentsDifference(other, base);
3121
+ res.milliseconds = -res.milliseconds;
3122
+ res.months = -res.months;
3123
+ }
3124
+
3125
+ return res;
3126
+ }
3127
+
3128
+ // TODO: remove 'name' arg after deprecation is removed
3129
+ function createAdder(direction, name) {
3130
+ return function (val, period) {
3131
+ var dur, tmp;
3132
+ //invert the arguments, but complain about it
3133
+ if (period !== null && !isNaN(+period)) {
3134
+ deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
3135
+ 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
3136
+ tmp = val; val = period; period = tmp;
3137
+ }
3138
+
3139
+ val = typeof val === 'string' ? +val : val;
3140
+ dur = createDuration(val, period);
3141
+ addSubtract$1(this, dur, direction);
3142
+ return this;
3143
+ };
3144
+ }
3145
+
3146
+ function addSubtract$1 (mom, duration, isAdding, updateOffset) {
3147
+ var milliseconds = duration._milliseconds,
3148
+ days = absRound(duration._days),
3149
+ months = absRound(duration._months);
3150
+
3151
+ if (!mom.isValid()) {
3152
+ // No op
3153
+ return;
3154
+ }
3155
+
3156
+ updateOffset = updateOffset == null ? true : updateOffset;
3157
+
3158
+ if (months) {
3159
+ setMonth(mom, get$2(mom, 'Month') + months * isAdding);
3160
+ }
3161
+ if (days) {
3162
+ set(mom, 'Date', get$2(mom, 'Date') + days * isAdding);
3163
+ }
3164
+ if (milliseconds) {
3165
+ mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
3166
+ }
3167
+ if (updateOffset) {
3168
+ hooks.updateOffset(mom, days || months);
3169
+ }
3170
+ }
3171
+
3172
+ var add$1 = createAdder(1, 'add');
3173
+ var subtract$1 = createAdder(-1, 'subtract');
3174
+
3175
+ function getCalendarFormat(myMoment, now) {
3176
+ var diff = myMoment.diff(now, 'days', true);
3177
+ return diff < -6 ? 'sameElse' :
3178
+ diff < -1 ? 'lastWeek' :
3179
+ diff < 0 ? 'lastDay' :
3180
+ diff < 1 ? 'sameDay' :
3181
+ diff < 2 ? 'nextDay' :
3182
+ diff < 7 ? 'nextWeek' : 'sameElse';
3183
+ }
3184
+
3185
+ function calendar (time, formats) {
3186
+ // We want to compare the start of today, vs this.
3187
+ // Getting start-of-today depends on whether we're local/utc/offset or not.
3188
+ var now = time || createLocal(),
3189
+ sod = cloneWithOffset(now, this).startOf('day'),
3190
+ format = hooks.calendarFormat(this, sod) || 'sameElse';
3191
+
3192
+ var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
3193
+
3194
+ return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
3195
+ }
3196
+
3197
+ function clone$1 () {
3198
+ return new Moment(this);
3199
+ }
3200
+
3201
+ function isAfter (input, units) {
3202
+ var localInput = isMoment(input) ? input : createLocal(input);
3203
+ if (!(this.isValid() && localInput.isValid())) {
3204
+ return false;
3205
+ }
3206
+ units = normalizeUnits(units) || 'millisecond';
3207
+ if (units === 'millisecond') {
3208
+ return this.valueOf() > localInput.valueOf();
3209
+ } else {
3210
+ return localInput.valueOf() < this.clone().startOf(units).valueOf();
3211
+ }
3212
+ }
3213
+
3214
+ function isBefore (input, units) {
3215
+ var localInput = isMoment(input) ? input : createLocal(input);
3216
+ if (!(this.isValid() && localInput.isValid())) {
3217
+ return false;
3218
+ }
3219
+ units = normalizeUnits(units) || 'millisecond';
3220
+ if (units === 'millisecond') {
3221
+ return this.valueOf() < localInput.valueOf();
3222
+ } else {
3223
+ return this.clone().endOf(units).valueOf() < localInput.valueOf();
3224
+ }
3225
+ }
3226
+
3227
+ function isBetween (from, to, units, inclusivity) {
3228
+ var localFrom = isMoment(from) ? from : createLocal(from),
3229
+ localTo = isMoment(to) ? to : createLocal(to);
3230
+ if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
3231
+ return false;
3232
+ }
3233
+ inclusivity = inclusivity || '()';
3234
+ return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) &&
3235
+ (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
3236
+ }
3237
+
3238
+ function isSame (input, units) {
3239
+ var localInput = isMoment(input) ? input : createLocal(input),
3240
+ inputMs;
3241
+ if (!(this.isValid() && localInput.isValid())) {
3242
+ return false;
3243
+ }
3244
+ units = normalizeUnits(units) || 'millisecond';
3245
+ if (units === 'millisecond') {
3246
+ return this.valueOf() === localInput.valueOf();
3247
+ } else {
3248
+ inputMs = localInput.valueOf();
3249
+ return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
3250
+ }
3251
+ }
3252
+
3253
+ function isSameOrAfter (input, units) {
3254
+ return this.isSame(input, units) || this.isAfter(input, units);
3255
+ }
3256
+
3257
+ function isSameOrBefore (input, units) {
3258
+ return this.isSame(input, units) || this.isBefore(input, units);
3259
+ }
3260
+
3261
+ function diff (input, units, asFloat) {
3262
+ var that,
3263
+ zoneDelta,
3264
+ output;
3265
+
3266
+ if (!this.isValid()) {
3267
+ return NaN;
3268
+ }
3269
+
3270
+ that = cloneWithOffset(input, this);
3271
+
3272
+ if (!that.isValid()) {
3273
+ return NaN;
3274
+ }
3275
+
3276
+ zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
3277
+
3278
+ units = normalizeUnits(units);
3279
+
3280
+ switch (units) {
3281
+ case 'year': output = monthDiff(this, that) / 12; break;
3282
+ case 'month': output = monthDiff(this, that); break;
3283
+ case 'quarter': output = monthDiff(this, that) / 3; break;
3284
+ case 'second': output = (this - that) / 1e3; break; // 1000
3285
+ case 'minute': output = (this - that) / 6e4; break; // 1000 * 60
3286
+ case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60
3287
+ case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst
3288
+ case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst
3289
+ default: output = this - that;
3290
+ }
3291
+
3292
+ return asFloat ? output : absFloor(output);
3293
+ }
3294
+
3295
+ function monthDiff (a, b) {
3296
+ // difference in months
3297
+ var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
3298
+ // b is in (anchor - 1 month, anchor + 1 month)
3299
+ anchor = a.clone().add(wholeMonthDiff, 'months'),
3300
+ anchor2, adjust;
3301
+
3302
+ if (b - anchor < 0) {
3303
+ anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
3304
+ // linear across the month
3305
+ adjust = (b - anchor) / (anchor - anchor2);
3306
+ } else {
3307
+ anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
3308
+ // linear across the month
3309
+ adjust = (b - anchor) / (anchor2 - anchor);
3310
+ }
3311
+
3312
+ //check for negative zero, return zero if negative zero
3313
+ return -(wholeMonthDiff + adjust) || 0;
3314
+ }
3315
+
3316
+ hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
3317
+ hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
3318
+
3319
+ function toString () {
3320
+ return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
3321
+ }
3322
+
3323
+ function toISOString$1(keepOffset) {
3324
+ if (!this.isValid()) {
3325
+ return null;
3326
+ }
3327
+ var utc = keepOffset !== true;
3328
+ var m = utc ? this.clone().utc() : this;
3329
+ if (m.year() < 0 || m.year() > 9999) {
3330
+ return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
3331
+ }
3332
+ if (isFunction(Date.prototype.toISOString)) {
3333
+ // native implementation is ~50x faster, use it when we can
3334
+ if (utc) {
3335
+ return this.toDate().toISOString();
3336
+ } else {
3337
+ return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
3338
+ }
3339
+ }
3340
+ return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
3341
+ }
3342
+
3343
+ /**
3344
+ * Return a human readable representation of a moment that can
3345
+ * also be evaluated to get a new moment which is the same
3346
+ *
3347
+ * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
3348
+ */
3349
+ function inspect () {
3350
+ if (!this.isValid()) {
3351
+ return 'moment.invalid(/* ' + this._i + ' */)';
3352
+ }
3353
+ var func = 'moment';
3354
+ var zone = '';
3355
+ if (!this.isLocal()) {
3356
+ func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
3357
+ zone = 'Z';
3358
+ }
3359
+ var prefix = '[' + func + '("]';
3360
+ var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
3361
+ var datetime = '-MM-DD[T]HH:mm:ss.SSS';
3362
+ var suffix = zone + '[")]';
3363
+
3364
+ return this.format(prefix + year + datetime + suffix);
3365
+ }
3366
+
3367
+ function format (inputString) {
3368
+ if (!inputString) {
3369
+ inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
3370
+ }
3371
+ var output = formatMoment(this, inputString);
3372
+ return this.localeData().postformat(output);
3373
+ }
3374
+
3375
+ function from (time, withoutSuffix) {
3376
+ if (this.isValid() &&
3377
+ ((isMoment(time) && time.isValid()) ||
3378
+ createLocal(time).isValid())) {
3379
+ return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
3380
+ } else {
3381
+ return this.localeData().invalidDate();
3382
+ }
3383
+ }
3384
+
3385
+ function fromNow (withoutSuffix) {
3386
+ return this.from(createLocal(), withoutSuffix);
3387
+ }
3388
+
3389
+ function to (time, withoutSuffix) {
3390
+ if (this.isValid() &&
3391
+ ((isMoment(time) && time.isValid()) ||
3392
+ createLocal(time).isValid())) {
3393
+ return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
3394
+ } else {
3395
+ return this.localeData().invalidDate();
3396
+ }
3397
+ }
3398
+
3399
+ function toNow (withoutSuffix) {
3400
+ return this.to(createLocal(), withoutSuffix);
3401
+ }
3402
+
3403
+ // If passed a locale key, it will set the locale for this
3404
+ // instance. Otherwise, it will return the locale configuration
3405
+ // variables for this instance.
3406
+ function locale (key) {
3407
+ var newLocaleData;
3408
+
3409
+ if (key === undefined) {
3410
+ return this._locale._abbr;
3411
+ } else {
3412
+ newLocaleData = getLocale(key);
3413
+ if (newLocaleData != null) {
3414
+ this._locale = newLocaleData;
3415
+ }
3416
+ return this;
3417
+ }
3418
+ }
3419
+
3420
+ var lang = deprecate(
3421
+ 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
3422
+ function (key) {
3423
+ if (key === undefined) {
3424
+ return this.localeData();
3425
+ } else {
3426
+ return this.locale(key);
3427
+ }
3428
+ }
3429
+ );
3430
+
3431
+ function localeData () {
3432
+ return this._locale;
3433
+ }
3434
+
3435
+ var MS_PER_SECOND = 1000;
3436
+ var MS_PER_MINUTE = 60 * MS_PER_SECOND;
3437
+ var MS_PER_HOUR = 60 * MS_PER_MINUTE;
3438
+ var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
3439
+
3440
+ // actual modulo - handles negative numbers (for dates before 1970):
3441
+ function mod(dividend, divisor) {
3442
+ return (dividend % divisor + divisor) % divisor;
3443
+ }
3444
+
3445
+ function localStartOfDate(y, m, d) {
3446
+ // the date constructor remaps years 0-99 to 1900-1999
3447
+ if (y < 100 && y >= 0) {
3448
+ // preserve leap years using a full 400 year cycle, then reset
3449
+ return new Date(y + 400, m, d) - MS_PER_400_YEARS;
3450
+ } else {
3451
+ return new Date(y, m, d).valueOf();
3452
+ }
3453
+ }
3454
+
3455
+ function utcStartOfDate(y, m, d) {
3456
+ // Date.UTC remaps years 0-99 to 1900-1999
3457
+ if (y < 100 && y >= 0) {
3458
+ // preserve leap years using a full 400 year cycle, then reset
3459
+ return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
3460
+ } else {
3461
+ return Date.UTC(y, m, d);
3462
+ }
3463
+ }
3464
+
3465
+ function startOf (units) {
3466
+ var time;
3467
+ units = normalizeUnits(units);
3468
+ if (units === undefined || units === 'millisecond' || !this.isValid()) {
3469
+ return this;
3470
+ }
3471
+
3472
+ var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
3473
+
3474
+ switch (units) {
3475
+ case 'year':
3476
+ time = startOfDate(this.year(), 0, 1);
3477
+ break;
3478
+ case 'quarter':
3479
+ time = startOfDate(this.year(), this.month() - this.month() % 3, 1);
3480
+ break;
3481
+ case 'month':
3482
+ time = startOfDate(this.year(), this.month(), 1);
3483
+ break;
3484
+ case 'week':
3485
+ time = startOfDate(this.year(), this.month(), this.date() - this.weekday());
3486
+ break;
3487
+ case 'isoWeek':
3488
+ time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
3489
+ break;
3490
+ case 'day':
3491
+ case 'date':
3492
+ time = startOfDate(this.year(), this.month(), this.date());
3493
+ break;
3494
+ case 'hour':
3495
+ time = this._d.valueOf();
3496
+ time -= mod(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);
3497
+ break;
3498
+ case 'minute':
3499
+ time = this._d.valueOf();
3500
+ time -= mod(time, MS_PER_MINUTE);
3501
+ break;
3502
+ case 'second':
3503
+ time = this._d.valueOf();
3504
+ time -= mod(time, MS_PER_SECOND);
3505
+ break;
3506
+ }
3507
+
3508
+ this._d.setTime(time);
3509
+ hooks.updateOffset(this, true);
3510
+ return this;
3511
+ }
3512
+
3513
+ function endOf (units) {
3514
+ var time;
3515
+ units = normalizeUnits(units);
3516
+ if (units === undefined || units === 'millisecond' || !this.isValid()) {
3517
+ return this;
3518
+ }
3519
+
3520
+ var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
3521
+
3522
+ switch (units) {
3523
+ case 'year':
3524
+ time = startOfDate(this.year() + 1, 0, 1) - 1;
3525
+ break;
3526
+ case 'quarter':
3527
+ time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
3528
+ break;
3529
+ case 'month':
3530
+ time = startOfDate(this.year(), this.month() + 1, 1) - 1;
3531
+ break;
3532
+ case 'week':
3533
+ time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
3534
+ break;
3535
+ case 'isoWeek':
3536
+ time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
3537
+ break;
3538
+ case 'day':
3539
+ case 'date':
3540
+ time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
3541
+ break;
3542
+ case 'hour':
3543
+ time = this._d.valueOf();
3544
+ time += MS_PER_HOUR - mod(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;
3545
+ break;
3546
+ case 'minute':
3547
+ time = this._d.valueOf();
3548
+ time += MS_PER_MINUTE - mod(time, MS_PER_MINUTE) - 1;
3549
+ break;
3550
+ case 'second':
3551
+ time = this._d.valueOf();
3552
+ time += MS_PER_SECOND - mod(time, MS_PER_SECOND) - 1;
3553
+ break;
3554
+ }
3555
+
3556
+ this._d.setTime(time);
3557
+ hooks.updateOffset(this, true);
3558
+ return this;
3559
+ }
3560
+
3561
+ function valueOf$1 () {
3562
+ return this._d.valueOf() - ((this._offset || 0) * 60000);
3563
+ }
3564
+
3565
+ function unix () {
3566
+ return Math.floor(this.valueOf() / 1000);
3567
+ }
3568
+
3569
+ function toDate () {
3570
+ return new Date(this.valueOf());
3571
+ }
3572
+
3573
+ function toArray () {
3574
+ var m = this;
3575
+ return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
3576
+ }
3577
+
3578
+ function toObject () {
3579
+ var m = this;
3580
+ return {
3581
+ years: m.year(),
3582
+ months: m.month(),
3583
+ date: m.date(),
3584
+ hours: m.hours(),
3585
+ minutes: m.minutes(),
3586
+ seconds: m.seconds(),
3587
+ milliseconds: m.milliseconds()
3588
+ };
3589
+ }
3590
+
3591
+ function toJSON () {
3592
+ // new Date(NaN).toJSON() === null
3593
+ return this.isValid() ? this.toISOString() : null;
3594
+ }
3595
+
3596
+ function isValid () {
3597
+ return isValid$2(this);
3598
+ }
3599
+
3600
+ function parsingFlags () {
3601
+ return extend({}, getParsingFlags(this));
3602
+ }
3603
+
3604
+ function invalidAt () {
3605
+ return getParsingFlags(this).overflow;
3606
+ }
3607
+
3608
+ function creationData() {
3609
+ return {
3610
+ input: this._i,
3611
+ format: this._f,
3612
+ locale: this._locale,
3613
+ isUTC: this._isUTC,
3614
+ strict: this._strict
3615
+ };
3616
+ }
3617
+
3618
+ // FORMATTING
3619
+
3620
+ addFormatToken(0, ['gg', 2], 0, function () {
3621
+ return this.weekYear() % 100;
3622
+ });
3623
+
3624
+ addFormatToken(0, ['GG', 2], 0, function () {
3625
+ return this.isoWeekYear() % 100;
3626
+ });
3627
+
3628
+ function addWeekYearFormatToken (token, getter) {
3629
+ addFormatToken(0, [token, token.length], 0, getter);
3630
+ }
3631
+
3632
+ addWeekYearFormatToken('gggg', 'weekYear');
3633
+ addWeekYearFormatToken('ggggg', 'weekYear');
3634
+ addWeekYearFormatToken('GGGG', 'isoWeekYear');
3635
+ addWeekYearFormatToken('GGGGG', 'isoWeekYear');
3636
+
3637
+ // ALIASES
3638
+
3639
+ addUnitAlias('weekYear', 'gg');
3640
+ addUnitAlias('isoWeekYear', 'GG');
3641
+
3642
+ // PRIORITY
3643
+
3644
+ addUnitPriority('weekYear', 1);
3645
+ addUnitPriority('isoWeekYear', 1);
3646
+
3647
+
3648
+ // PARSING
3649
+
3650
+ addRegexToken('G', matchSigned);
3651
+ addRegexToken('g', matchSigned);
3652
+ addRegexToken('GG', match1to2, match2);
3653
+ addRegexToken('gg', match1to2, match2);
3654
+ addRegexToken('GGGG', match1to4, match4);
3655
+ addRegexToken('gggg', match1to4, match4);
3656
+ addRegexToken('GGGGG', match1to6, match6);
3657
+ addRegexToken('ggggg', match1to6, match6);
3658
+
3659
+ addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
3660
+ week[token.substr(0, 2)] = toInt(input);
3661
+ });
3662
+
3663
+ addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
3664
+ week[token] = hooks.parseTwoDigitYear(input);
3665
+ });
3666
+
3667
+ // MOMENTS
3668
+
3669
+ function getSetWeekYear (input) {
3670
+ return getSetWeekYearHelper.call(this,
3671
+ input,
3672
+ this.week(),
3673
+ this.weekday(),
3674
+ this.localeData()._week.dow,
3675
+ this.localeData()._week.doy);
3676
+ }
3677
+
3678
+ function getSetISOWeekYear (input) {
3679
+ return getSetWeekYearHelper.call(this,
3680
+ input, this.isoWeek(), this.isoWeekday(), 1, 4);
3681
+ }
3682
+
3683
+ function getISOWeeksInYear () {
3684
+ return weeksInYear(this.year(), 1, 4);
3685
+ }
3686
+
3687
+ function getWeeksInYear () {
3688
+ var weekInfo = this.localeData()._week;
3689
+ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
3690
+ }
3691
+
3692
+ function getSetWeekYearHelper(input, week, weekday, dow, doy) {
3693
+ var weeksTarget;
3694
+ if (input == null) {
3695
+ return weekOfYear(this, dow, doy).year;
3696
+ } else {
3697
+ weeksTarget = weeksInYear(input, dow, doy);
3698
+ if (week > weeksTarget) {
3699
+ week = weeksTarget;
3700
+ }
3701
+ return setWeekAll.call(this, input, week, weekday, dow, doy);
3702
+ }
3703
+ }
3704
+
3705
+ function setWeekAll(weekYear, week, weekday, dow, doy) {
3706
+ var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
3707
+ date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
3708
+
3709
+ this.year(date.getUTCFullYear());
3710
+ this.month(date.getUTCMonth());
3711
+ this.date(date.getUTCDate());
3712
+ return this;
3713
+ }
3714
+
3715
+ // FORMATTING
3716
+
3717
+ addFormatToken('Q', 0, 'Qo', 'quarter');
3718
+
3719
+ // ALIASES
3720
+
3721
+ addUnitAlias('quarter', 'Q');
3722
+
3723
+ // PRIORITY
3724
+
3725
+ addUnitPriority('quarter', 7);
3726
+
3727
+ // PARSING
3728
+
3729
+ addRegexToken('Q', match1);
3730
+ addParseToken('Q', function (input, array) {
3731
+ array[MONTH] = (toInt(input) - 1) * 3;
3732
+ });
3733
+
3734
+ // MOMENTS
3735
+
3736
+ function getSetQuarter (input) {
3737
+ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
3738
+ }
3739
+
3740
+ // FORMATTING
3741
+
3742
+ addFormatToken('D', ['DD', 2], 'Do', 'date');
3743
+
3744
+ // ALIASES
3745
+
3746
+ addUnitAlias('date', 'D');
3747
+
3748
+ // PRIORITY
3749
+ addUnitPriority('date', 9);
3750
+
3751
+ // PARSING
3752
+
3753
+ addRegexToken('D', match1to2);
3754
+ addRegexToken('DD', match1to2, match2);
3755
+ addRegexToken('Do', function (isStrict, locale) {
3756
+ // TODO: Remove "ordinalParse" fallback in next major release.
3757
+ return isStrict ?
3758
+ (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :
3759
+ locale._dayOfMonthOrdinalParseLenient;
3760
+ });
3761
+
3762
+ addParseToken(['D', 'DD'], DATE);
3763
+ addParseToken('Do', function (input, array) {
3764
+ array[DATE] = toInt(input.match(match1to2)[0]);
3765
+ });
3766
+
3767
+ // MOMENTS
3768
+
3769
+ var getSetDayOfMonth = makeGetSet('Date', true);
3770
+
3771
+ // FORMATTING
3772
+
3773
+ addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
3774
+
3775
+ // ALIASES
3776
+
3777
+ addUnitAlias('dayOfYear', 'DDD');
3778
+
3779
+ // PRIORITY
3780
+ addUnitPriority('dayOfYear', 4);
3781
+
3782
+ // PARSING
3783
+
3784
+ addRegexToken('DDD', match1to3);
3785
+ addRegexToken('DDDD', match3);
3786
+ addParseToken(['DDD', 'DDDD'], function (input, array, config) {
3787
+ config._dayOfYear = toInt(input);
3788
+ });
3789
+
3790
+ // HELPERS
3791
+
3792
+ // MOMENTS
3793
+
3794
+ function getSetDayOfYear (input) {
3795
+ var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
3796
+ return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
3797
+ }
3798
+
3799
+ // FORMATTING
3800
+
3801
+ addFormatToken('m', ['mm', 2], 0, 'minute');
3802
+
3803
+ // ALIASES
3804
+
3805
+ addUnitAlias('minute', 'm');
3806
+
3807
+ // PRIORITY
3808
+
3809
+ addUnitPriority('minute', 14);
3810
+
3811
+ // PARSING
3812
+
3813
+ addRegexToken('m', match1to2);
3814
+ addRegexToken('mm', match1to2, match2);
3815
+ addParseToken(['m', 'mm'], MINUTE);
3816
+
3817
+ // MOMENTS
3818
+
3819
+ var getSetMinute = makeGetSet('Minutes', false);
3820
+
3821
+ // FORMATTING
3822
+
3823
+ addFormatToken('s', ['ss', 2], 0, 'second');
3824
+
3825
+ // ALIASES
3826
+
3827
+ addUnitAlias('second', 's');
3828
+
3829
+ // PRIORITY
3830
+
3831
+ addUnitPriority('second', 15);
3832
+
3833
+ // PARSING
3834
+
3835
+ addRegexToken('s', match1to2);
3836
+ addRegexToken('ss', match1to2, match2);
3837
+ addParseToken(['s', 'ss'], SECOND);
3838
+
3839
+ // MOMENTS
3840
+
3841
+ var getSetSecond = makeGetSet('Seconds', false);
3842
+
3843
+ // FORMATTING
3844
+
3845
+ addFormatToken('S', 0, 0, function () {
3846
+ return ~~(this.millisecond() / 100);
3847
+ });
3848
+
3849
+ addFormatToken(0, ['SS', 2], 0, function () {
3850
+ return ~~(this.millisecond() / 10);
3851
+ });
3852
+
3853
+ addFormatToken(0, ['SSS', 3], 0, 'millisecond');
3854
+ addFormatToken(0, ['SSSS', 4], 0, function () {
3855
+ return this.millisecond() * 10;
3856
+ });
3857
+ addFormatToken(0, ['SSSSS', 5], 0, function () {
3858
+ return this.millisecond() * 100;
3859
+ });
3860
+ addFormatToken(0, ['SSSSSS', 6], 0, function () {
3861
+ return this.millisecond() * 1000;
3862
+ });
3863
+ addFormatToken(0, ['SSSSSSS', 7], 0, function () {
3864
+ return this.millisecond() * 10000;
3865
+ });
3866
+ addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
3867
+ return this.millisecond() * 100000;
3868
+ });
3869
+ addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
3870
+ return this.millisecond() * 1000000;
3871
+ });
3872
+
3873
+
3874
+ // ALIASES
3875
+
3876
+ addUnitAlias('millisecond', 'ms');
3877
+
3878
+ // PRIORITY
3879
+
3880
+ addUnitPriority('millisecond', 16);
3881
+
3882
+ // PARSING
3883
+
3884
+ addRegexToken('S', match1to3, match1);
3885
+ addRegexToken('SS', match1to3, match2);
3886
+ addRegexToken('SSS', match1to3, match3);
3887
+
3888
+ var token;
3889
+ for (token = 'SSSS'; token.length <= 9; token += 'S') {
3890
+ addRegexToken(token, matchUnsigned);
3891
+ }
3892
+
3893
+ function parseMs(input, array) {
3894
+ array[MILLISECOND] = toInt(('0.' + input) * 1000);
3895
+ }
3896
+
3897
+ for (token = 'S'; token.length <= 9; token += 'S') {
3898
+ addParseToken(token, parseMs);
3899
+ }
3900
+ // MOMENTS
3901
+
3902
+ var getSetMillisecond = makeGetSet('Milliseconds', false);
3903
+
3904
+ // FORMATTING
3905
+
3906
+ addFormatToken('z', 0, 0, 'zoneAbbr');
3907
+ addFormatToken('zz', 0, 0, 'zoneName');
3908
+
3909
+ // MOMENTS
3910
+
3911
+ function getZoneAbbr () {
3912
+ return this._isUTC ? 'UTC' : '';
3913
+ }
3914
+
3915
+ function getZoneName () {
3916
+ return this._isUTC ? 'Coordinated Universal Time' : '';
3917
+ }
3918
+
3919
+ var proto$2 = Moment.prototype;
3920
+
3921
+ proto$2.add = add$1;
3922
+ proto$2.calendar = calendar;
3923
+ proto$2.clone = clone$1;
3924
+ proto$2.diff = diff;
3925
+ proto$2.endOf = endOf;
3926
+ proto$2.format = format;
3927
+ proto$2.from = from;
3928
+ proto$2.fromNow = fromNow;
3929
+ proto$2.to = to;
3930
+ proto$2.toNow = toNow;
3931
+ proto$2.get = stringGet;
3932
+ proto$2.invalidAt = invalidAt;
3933
+ proto$2.isAfter = isAfter;
3934
+ proto$2.isBefore = isBefore;
3935
+ proto$2.isBetween = isBetween;
3936
+ proto$2.isSame = isSame;
3937
+ proto$2.isSameOrAfter = isSameOrAfter;
3938
+ proto$2.isSameOrBefore = isSameOrBefore;
3939
+ proto$2.isValid = isValid;
3940
+ proto$2.lang = lang;
3941
+ proto$2.locale = locale;
3942
+ proto$2.localeData = localeData;
3943
+ proto$2.max = prototypeMax;
3944
+ proto$2.min = prototypeMin;
3945
+ proto$2.parsingFlags = parsingFlags;
3946
+ proto$2.set = stringSet;
3947
+ proto$2.startOf = startOf;
3948
+ proto$2.subtract = subtract$1;
3949
+ proto$2.toArray = toArray;
3950
+ proto$2.toObject = toObject;
3951
+ proto$2.toDate = toDate;
3952
+ proto$2.toISOString = toISOString$1;
3953
+ proto$2.inspect = inspect;
3954
+ proto$2.toJSON = toJSON;
3955
+ proto$2.toString = toString;
3956
+ proto$2.unix = unix;
3957
+ proto$2.valueOf = valueOf$1;
3958
+ proto$2.creationData = creationData;
3959
+ proto$2.year = getSetYear;
3960
+ proto$2.isLeapYear = getIsLeapYear;
3961
+ proto$2.weekYear = getSetWeekYear;
3962
+ proto$2.isoWeekYear = getSetISOWeekYear;
3963
+ proto$2.quarter = proto$2.quarters = getSetQuarter;
3964
+ proto$2.month = getSetMonth;
3965
+ proto$2.daysInMonth = getDaysInMonth;
3966
+ proto$2.week = proto$2.weeks = getSetWeek;
3967
+ proto$2.isoWeek = proto$2.isoWeeks = getSetISOWeek;
3968
+ proto$2.weeksInYear = getWeeksInYear;
3969
+ proto$2.isoWeeksInYear = getISOWeeksInYear;
3970
+ proto$2.date = getSetDayOfMonth;
3971
+ proto$2.day = proto$2.days = getSetDayOfWeek;
3972
+ proto$2.weekday = getSetLocaleDayOfWeek;
3973
+ proto$2.isoWeekday = getSetISODayOfWeek;
3974
+ proto$2.dayOfYear = getSetDayOfYear;
3975
+ proto$2.hour = proto$2.hours = getSetHour;
3976
+ proto$2.minute = proto$2.minutes = getSetMinute;
3977
+ proto$2.second = proto$2.seconds = getSetSecond;
3978
+ proto$2.millisecond = proto$2.milliseconds = getSetMillisecond;
3979
+ proto$2.utcOffset = getSetOffset;
3980
+ proto$2.utc = setOffsetToUTC;
3981
+ proto$2.local = setOffsetToLocal;
3982
+ proto$2.parseZone = setOffsetToParsedOffset;
3983
+ proto$2.hasAlignedHourOffset = hasAlignedHourOffset;
3984
+ proto$2.isDST = isDaylightSavingTime;
3985
+ proto$2.isLocal = isLocal;
3986
+ proto$2.isUtcOffset = isUtcOffset;
3987
+ proto$2.isUtc = isUtc;
3988
+ proto$2.isUTC = isUtc;
3989
+ proto$2.zoneAbbr = getZoneAbbr;
3990
+ proto$2.zoneName = getZoneName;
3991
+ proto$2.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
3992
+ proto$2.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
3993
+ proto$2.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
3994
+ proto$2.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
3995
+ proto$2.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
3996
+
3997
+ function createUnix (input) {
3998
+ return createLocal(input * 1000);
3999
+ }
4000
+
4001
+ function createInZone () {
4002
+ return createLocal.apply(null, arguments).parseZone();
4003
+ }
4004
+
4005
+ function preParsePostFormat (string) {
4006
+ return string;
4007
+ }
4008
+
4009
+ var proto$1 = Locale.prototype;
4010
+
4011
+ proto$1.calendar = calendar$1;
4012
+ proto$1.longDateFormat = longDateFormat;
4013
+ proto$1.invalidDate = invalidDate;
4014
+ proto$1.ordinal = ordinal;
4015
+ proto$1.preparse = preParsePostFormat;
4016
+ proto$1.postformat = preParsePostFormat;
4017
+ proto$1.relativeTime = relativeTime$1;
4018
+ proto$1.pastFuture = pastFuture;
4019
+ proto$1.set = set$1;
4020
+
4021
+ proto$1.months = localeMonths;
4022
+ proto$1.monthsShort = localeMonthsShort;
4023
+ proto$1.monthsParse = localeMonthsParse;
4024
+ proto$1.monthsRegex = monthsRegex;
4025
+ proto$1.monthsShortRegex = monthsShortRegex;
4026
+ proto$1.week = localeWeek;
4027
+ proto$1.firstDayOfYear = localeFirstDayOfYear;
4028
+ proto$1.firstDayOfWeek = localeFirstDayOfWeek;
4029
+
4030
+ proto$1.weekdays = localeWeekdays;
4031
+ proto$1.weekdaysMin = localeWeekdaysMin;
4032
+ proto$1.weekdaysShort = localeWeekdaysShort;
4033
+ proto$1.weekdaysParse = localeWeekdaysParse;
4034
+
4035
+ proto$1.weekdaysRegex = weekdaysRegex;
4036
+ proto$1.weekdaysShortRegex = weekdaysShortRegex;
4037
+ proto$1.weekdaysMinRegex = weekdaysMinRegex;
4038
+
4039
+ proto$1.isPM = localeIsPM;
4040
+ proto$1.meridiem = localeMeridiem;
4041
+
4042
+ function get$1 (format, index, field, setter) {
4043
+ var locale = getLocale();
4044
+ var utc = createUTC().set(setter, index);
4045
+ return locale[field](utc, format);
4046
+ }
4047
+
4048
+ function listMonthsImpl (format, index, field) {
4049
+ if (isNumber(format)) {
4050
+ index = format;
4051
+ format = undefined;
4052
+ }
4053
+
4054
+ format = format || '';
4055
+
4056
+ if (index != null) {
4057
+ return get$1(format, index, field, 'month');
4058
+ }
4059
+
4060
+ var i;
4061
+ var out = [];
4062
+ for (i = 0; i < 12; i++) {
4063
+ out[i] = get$1(format, i, field, 'month');
4064
+ }
4065
+ return out;
4066
+ }
4067
+
4068
+ // ()
4069
+ // (5)
4070
+ // (fmt, 5)
4071
+ // (fmt)
4072
+ // (true)
4073
+ // (true, 5)
4074
+ // (true, fmt, 5)
4075
+ // (true, fmt)
4076
+ function listWeekdaysImpl (localeSorted, format, index, field) {
4077
+ if (typeof localeSorted === 'boolean') {
4078
+ if (isNumber(format)) {
4079
+ index = format;
4080
+ format = undefined;
4081
+ }
4082
+
4083
+ format = format || '';
4084
+ } else {
4085
+ format = localeSorted;
4086
+ index = format;
4087
+ localeSorted = false;
4088
+
4089
+ if (isNumber(format)) {
4090
+ index = format;
4091
+ format = undefined;
4092
+ }
4093
+
4094
+ format = format || '';
4095
+ }
4096
+
4097
+ var locale = getLocale(),
4098
+ shift = localeSorted ? locale._week.dow : 0;
4099
+
4100
+ if (index != null) {
4101
+ return get$1(format, (index + shift) % 7, field, 'day');
4102
+ }
4103
+
4104
+ var i;
4105
+ var out = [];
4106
+ for (i = 0; i < 7; i++) {
4107
+ out[i] = get$1(format, (i + shift) % 7, field, 'day');
4108
+ }
4109
+ return out;
4110
+ }
4111
+
4112
+ function listMonths (format, index) {
4113
+ return listMonthsImpl(format, index, 'months');
4114
+ }
4115
+
4116
+ function listMonthsShort (format, index) {
4117
+ return listMonthsImpl(format, index, 'monthsShort');
4118
+ }
4119
+
4120
+ function listWeekdays (localeSorted, format, index) {
4121
+ return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
4122
+ }
4123
+
4124
+ function listWeekdaysShort (localeSorted, format, index) {
4125
+ return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
4126
+ }
4127
+
4128
+ function listWeekdaysMin (localeSorted, format, index) {
4129
+ return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
4130
+ }
4131
+
4132
+ getSetGlobalLocale('en', {
4133
+ dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
4134
+ ordinal : function (number) {
4135
+ var b = number % 10,
4136
+ output = (toInt(number % 100 / 10) === 1) ? 'th' :
4137
+ (b === 1) ? 'st' :
4138
+ (b === 2) ? 'nd' :
4139
+ (b === 3) ? 'rd' : 'th';
4140
+ return number + output;
4141
+ }
4142
+ });
4143
+
4144
+ // Side effect imports
4145
+
4146
+ hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
4147
+ hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
4148
+
4149
+ var mathAbs = Math.abs;
4150
+
4151
+ function abs$1 () {
4152
+ var data = this._data;
4153
+
4154
+ this._milliseconds = mathAbs(this._milliseconds);
4155
+ this._days = mathAbs(this._days);
4156
+ this._months = mathAbs(this._months);
4157
+
4158
+ data.milliseconds = mathAbs(data.milliseconds);
4159
+ data.seconds = mathAbs(data.seconds);
4160
+ data.minutes = mathAbs(data.minutes);
4161
+ data.hours = mathAbs(data.hours);
4162
+ data.months = mathAbs(data.months);
4163
+ data.years = mathAbs(data.years);
4164
+
4165
+ return this;
4166
+ }
4167
+
4168
+ function addSubtract (duration, input, value, direction) {
4169
+ var other = createDuration(input, value);
4170
+
4171
+ duration._milliseconds += direction * other._milliseconds;
4172
+ duration._days += direction * other._days;
4173
+ duration._months += direction * other._months;
4174
+
4175
+ return duration._bubble();
4176
+ }
4177
+
4178
+ // supports only 2.0-style add(1, 's') or add(duration)
4179
+ function add (input, value) {
4180
+ return addSubtract(this, input, value, 1);
4181
+ }
4182
+
4183
+ // supports only 2.0-style subtract(1, 's') or subtract(duration)
4184
+ function subtract (input, value) {
4185
+ return addSubtract(this, input, value, -1);
4186
+ }
4187
+
4188
+ function absCeil (number) {
4189
+ if (number < 0) {
4190
+ return Math.floor(number);
4191
+ } else {
4192
+ return Math.ceil(number);
4193
+ }
4194
+ }
4195
+
4196
+ function bubble () {
4197
+ var milliseconds = this._milliseconds;
4198
+ var days = this._days;
4199
+ var months = this._months;
4200
+ var data = this._data;
4201
+ var seconds, minutes, hours, years, monthsFromDays;
4202
+
4203
+ // if we have a mix of positive and negative values, bubble down first
4204
+ // check: https://github.com/moment/moment/issues/2166
4205
+ if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
4206
+ (milliseconds <= 0 && days <= 0 && months <= 0))) {
4207
+ milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
4208
+ days = 0;
4209
+ months = 0;
4210
+ }
4211
+
4212
+ // The following code bubbles up values, see the tests for
4213
+ // examples of what that means.
4214
+ data.milliseconds = milliseconds % 1000;
4215
+
4216
+ seconds = absFloor(milliseconds / 1000);
4217
+ data.seconds = seconds % 60;
4218
+
4219
+ minutes = absFloor(seconds / 60);
4220
+ data.minutes = minutes % 60;
4221
+
4222
+ hours = absFloor(minutes / 60);
4223
+ data.hours = hours % 24;
4224
+
4225
+ days += absFloor(hours / 24);
4226
+
4227
+ // convert days to months
4228
+ monthsFromDays = absFloor(daysToMonths(days));
4229
+ months += monthsFromDays;
4230
+ days -= absCeil(monthsToDays(monthsFromDays));
4231
+
4232
+ // 12 months -> 1 year
4233
+ years = absFloor(months / 12);
4234
+ months %= 12;
4235
+
4236
+ data.days = days;
4237
+ data.months = months;
4238
+ data.years = years;
4239
+
4240
+ return this;
4241
+ }
4242
+
4243
+ function daysToMonths (days) {
4244
+ // 400 years have 146097 days (taking into account leap year rules)
4245
+ // 400 years have 12 months === 4800
4246
+ return days * 4800 / 146097;
4247
+ }
4248
+
4249
+ function monthsToDays (months) {
4250
+ // the reverse of daysToMonths
4251
+ return months * 146097 / 4800;
4252
+ }
4253
+
4254
+ function as (units) {
4255
+ if (!this.isValid()) {
4256
+ return NaN;
4257
+ }
4258
+ var days;
4259
+ var months;
4260
+ var milliseconds = this._milliseconds;
4261
+
4262
+ units = normalizeUnits(units);
4263
+
4264
+ if (units === 'month' || units === 'quarter' || units === 'year') {
4265
+ days = this._days + milliseconds / 864e5;
4266
+ months = this._months + daysToMonths(days);
4267
+ switch (units) {
4268
+ case 'month': return months;
4269
+ case 'quarter': return months / 3;
4270
+ case 'year': return months / 12;
4271
+ }
4272
+ } else {
4273
+ // handle milliseconds separately because of floating point math errors (issue #1867)
4274
+ days = this._days + Math.round(monthsToDays(this._months));
4275
+ switch (units) {
4276
+ case 'week' : return days / 7 + milliseconds / 6048e5;
4277
+ case 'day' : return days + milliseconds / 864e5;
4278
+ case 'hour' : return days * 24 + milliseconds / 36e5;
4279
+ case 'minute' : return days * 1440 + milliseconds / 6e4;
4280
+ case 'second' : return days * 86400 + milliseconds / 1000;
4281
+ // Math.floor prevents floating point math errors here
4282
+ case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
4283
+ default: throw new Error('Unknown unit ' + units);
4284
+ }
4285
+ }
4286
+ }
4287
+
4288
+ // TODO: Use this.as('ms')?
4289
+ function valueOf () {
4290
+ if (!this.isValid()) {
4291
+ return NaN;
4292
+ }
4293
+ return (
4294
+ this._milliseconds +
4295
+ this._days * 864e5 +
4296
+ (this._months % 12) * 2592e6 +
4297
+ toInt(this._months / 12) * 31536e6
4298
+ );
4299
+ }
4300
+
4301
+ function makeAs (alias) {
4302
+ return function () {
4303
+ return this.as(alias);
4304
+ };
4305
+ }
4306
+
4307
+ var asMilliseconds = makeAs('ms');
4308
+ var asSeconds = makeAs('s');
4309
+ var asMinutes = makeAs('m');
4310
+ var asHours = makeAs('h');
4311
+ var asDays = makeAs('d');
4312
+ var asWeeks = makeAs('w');
4313
+ var asMonths = makeAs('M');
4314
+ var asQuarters = makeAs('Q');
4315
+ var asYears = makeAs('y');
4316
+
4317
+ function clone () {
4318
+ return createDuration(this);
4319
+ }
4320
+
4321
+ function get (units) {
4322
+ units = normalizeUnits(units);
4323
+ return this.isValid() ? this[units + 's']() : NaN;
4324
+ }
4325
+
4326
+ function makeGetter(name) {
4327
+ return function () {
4328
+ return this.isValid() ? this._data[name] : NaN;
4329
+ };
4330
+ }
4331
+
4332
+ var milliseconds = makeGetter('milliseconds');
4333
+ var seconds = makeGetter('seconds');
4334
+ var minutes = makeGetter('minutes');
4335
+ var hours = makeGetter('hours');
4336
+ var days = makeGetter('days');
4337
+ var months = makeGetter('months');
4338
+ var years = makeGetter('years');
4339
+
4340
+ function weeks () {
4341
+ return absFloor(this.days() / 7);
4342
+ }
4343
+
4344
+ var round = Math.round;
4345
+ var thresholds = {
4346
+ ss: 44, // a few seconds to seconds
4347
+ s : 45, // seconds to minute
4348
+ m : 45, // minutes to hour
4349
+ h : 22, // hours to day
4350
+ d : 26, // days to month
4351
+ M : 11 // months to year
4352
+ };
4353
+
4354
+ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
4355
+ function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
4356
+ return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
4357
+ }
4358
+
4359
+ function relativeTime (posNegDuration, withoutSuffix, locale) {
4360
+ var duration = createDuration(posNegDuration).abs();
4361
+ var seconds = round(duration.as('s'));
4362
+ var minutes = round(duration.as('m'));
4363
+ var hours = round(duration.as('h'));
4364
+ var days = round(duration.as('d'));
4365
+ var months = round(duration.as('M'));
4366
+ var years = round(duration.as('y'));
4367
+
4368
+ var a = seconds <= thresholds.ss && ['s', seconds] ||
4369
+ seconds < thresholds.s && ['ss', seconds] ||
4370
+ minutes <= 1 && ['m'] ||
4371
+ minutes < thresholds.m && ['mm', minutes] ||
4372
+ hours <= 1 && ['h'] ||
4373
+ hours < thresholds.h && ['hh', hours] ||
4374
+ days <= 1 && ['d'] ||
4375
+ days < thresholds.d && ['dd', days] ||
4376
+ months <= 1 && ['M'] ||
4377
+ months < thresholds.M && ['MM', months] ||
4378
+ years <= 1 && ['y'] || ['yy', years];
4379
+
4380
+ a[2] = withoutSuffix;
4381
+ a[3] = +posNegDuration > 0;
4382
+ a[4] = locale;
4383
+ return substituteTimeAgo.apply(null, a);
4384
+ }
4385
+
4386
+ // This function allows you to set the rounding function for relative time strings
4387
+ function getSetRelativeTimeRounding (roundingFunction) {
4388
+ if (roundingFunction === undefined) {
4389
+ return round;
4390
+ }
4391
+ if (typeof(roundingFunction) === 'function') {
4392
+ round = roundingFunction;
4393
+ return true;
4394
+ }
4395
+ return false;
4396
+ }
4397
+
4398
+ // This function allows you to set a threshold for relative time strings
4399
+ function getSetRelativeTimeThreshold (threshold, limit) {
4400
+ if (thresholds[threshold] === undefined) {
4401
+ return false;
4402
+ }
4403
+ if (limit === undefined) {
4404
+ return thresholds[threshold];
4405
+ }
4406
+ thresholds[threshold] = limit;
4407
+ if (threshold === 's') {
4408
+ thresholds.ss = limit - 1;
4409
+ }
4410
+ return true;
4411
+ }
4412
+
4413
+ function humanize (withSuffix) {
4414
+ if (!this.isValid()) {
4415
+ return this.localeData().invalidDate();
4416
+ }
4417
+
4418
+ var locale = this.localeData();
4419
+ var output = relativeTime(this, !withSuffix, locale);
4420
+
4421
+ if (withSuffix) {
4422
+ output = locale.pastFuture(+this, output);
4423
+ }
4424
+
4425
+ return locale.postformat(output);
4426
+ }
4427
+
4428
+ var abs = Math.abs;
4429
+
4430
+ function sign(x) {
4431
+ return ((x > 0) - (x < 0)) || +x;
4432
+ }
4433
+
4434
+ function toISOString() {
4435
+ // for ISO strings we do not use the normal bubbling rules:
4436
+ // * milliseconds bubble up until they become hours
4437
+ // * days do not bubble at all
4438
+ // * months bubble up until they become years
4439
+ // This is because there is no context-free conversion between hours and days
4440
+ // (think of clock changes)
4441
+ // and also not between days and months (28-31 days per month)
4442
+ if (!this.isValid()) {
4443
+ return this.localeData().invalidDate();
4444
+ }
4445
+
4446
+ var seconds = abs(this._milliseconds) / 1000;
4447
+ var days = abs(this._days);
4448
+ var months = abs(this._months);
4449
+ var minutes, hours, years;
4450
+
4451
+ // 3600 seconds -> 60 minutes -> 1 hour
4452
+ minutes = absFloor(seconds / 60);
4453
+ hours = absFloor(minutes / 60);
4454
+ seconds %= 60;
4455
+ minutes %= 60;
4456
+
4457
+ // 12 months -> 1 year
4458
+ years = absFloor(months / 12);
4459
+ months %= 12;
4460
+
4461
+
4462
+ // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
4463
+ var Y = years;
4464
+ var M = months;
4465
+ var D = days;
4466
+ var h = hours;
4467
+ var m = minutes;
4468
+ var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
4469
+ var total = this.asSeconds();
4470
+
4471
+ if (!total) {
4472
+ // this is the same as C#'s (Noda) and python (isodate)...
4473
+ // but not other JS (goog.date)
4474
+ return 'P0D';
4475
+ }
4476
+
4477
+ var totalSign = total < 0 ? '-' : '';
4478
+ var ymSign = sign(this._months) !== sign(total) ? '-' : '';
4479
+ var daysSign = sign(this._days) !== sign(total) ? '-' : '';
4480
+ var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
4481
+
4482
+ return totalSign + 'P' +
4483
+ (Y ? ymSign + Y + 'Y' : '') +
4484
+ (M ? ymSign + M + 'M' : '') +
4485
+ (D ? daysSign + D + 'D' : '') +
4486
+ ((h || m || s) ? 'T' : '') +
4487
+ (h ? hmsSign + h + 'H' : '') +
4488
+ (m ? hmsSign + m + 'M' : '') +
4489
+ (s ? hmsSign + s + 'S' : '');
4490
+ }
4491
+
4492
+ var proto = Duration.prototype;
4493
+
4494
+ proto.isValid = isValid$1;
4495
+ proto.abs = abs$1;
4496
+ proto.add = add;
4497
+ proto.subtract = subtract;
4498
+ proto.as = as;
4499
+ proto.asMilliseconds = asMilliseconds;
4500
+ proto.asSeconds = asSeconds;
4501
+ proto.asMinutes = asMinutes;
4502
+ proto.asHours = asHours;
4503
+ proto.asDays = asDays;
4504
+ proto.asWeeks = asWeeks;
4505
+ proto.asMonths = asMonths;
4506
+ proto.asQuarters = asQuarters;
4507
+ proto.asYears = asYears;
4508
+ proto.valueOf = valueOf;
4509
+ proto._bubble = bubble;
4510
+ proto.clone = clone;
4511
+ proto.get = get;
4512
+ proto.milliseconds = milliseconds;
4513
+ proto.seconds = seconds;
4514
+ proto.minutes = minutes;
4515
+ proto.hours = hours;
4516
+ proto.days = days;
4517
+ proto.weeks = weeks;
4518
+ proto.months = months;
4519
+ proto.years = years;
4520
+ proto.humanize = humanize;
4521
+ proto.toISOString = toISOString;
4522
+ proto.toString = toISOString;
4523
+ proto.toJSON = toISOString;
4524
+ proto.locale = locale;
4525
+ proto.localeData = localeData;
4526
+
4527
+ proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString);
4528
+ proto.lang = lang;
4529
+
4530
+ // FORMATTING
4531
+
4532
+ addFormatToken('X', 0, 0, 'unix');
4533
+ addFormatToken('x', 0, 0, 'valueOf');
4534
+
4535
+ // PARSING
4536
+
4537
+ addRegexToken('x', matchSigned);
4538
+ addRegexToken('X', matchTimestamp);
4539
+ addParseToken('X', function (input, array, config) {
4540
+ config._d = new Date(parseFloat(input, 10) * 1000);
4541
+ });
4542
+ addParseToken('x', function (input, array, config) {
4543
+ config._d = new Date(toInt(input));
4544
+ });
4545
+
4546
+ //! moment.js
4547
+
4548
+ hooks.version = '2.24.0';
4549
+
4550
+ setHookCallback(createLocal);
4551
+
4552
+ hooks.fn = proto$2;
4553
+ hooks.min = min;
4554
+ hooks.max = max;
4555
+ hooks.now = now;
4556
+ hooks.utc = createUTC;
4557
+ hooks.unix = createUnix;
4558
+ hooks.months = listMonths;
4559
+ hooks.isDate = isDate;
4560
+ hooks.locale = getSetGlobalLocale;
4561
+ hooks.invalid = createInvalid$1;
4562
+ hooks.duration = createDuration;
4563
+ hooks.isMoment = isMoment;
4564
+ hooks.weekdays = listWeekdays;
4565
+ hooks.parseZone = createInZone;
4566
+ hooks.localeData = getLocale;
4567
+ hooks.isDuration = isDuration;
4568
+ hooks.monthsShort = listMonthsShort;
4569
+ hooks.weekdaysMin = listWeekdaysMin;
4570
+ hooks.defineLocale = defineLocale;
4571
+ hooks.updateLocale = updateLocale;
4572
+ hooks.locales = listLocales;
4573
+ hooks.weekdaysShort = listWeekdaysShort;
4574
+ hooks.normalizeUnits = normalizeUnits;
4575
+ hooks.relativeTimeRounding = getSetRelativeTimeRounding;
4576
+ hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
4577
+ hooks.calendarFormat = getCalendarFormat;
4578
+ hooks.prototype = proto$2;
4579
+
4580
+ // currently HTML5 input type only supports 24-hour formats
4581
+ hooks.HTML5_FMT = {
4582
+ DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
4583
+ DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
4584
+ DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
4585
+ DATE: 'YYYY-MM-DD', // <input type="date" />
4586
+ TIME: 'HH:mm', // <input type="time" />
4587
+ TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
4588
+ TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
4589
+ WEEK: 'GGGG-[W]WW', // <input type="week" />
4590
+ MONTH: 'YYYY-MM' // <input type="month" />
4591
+ };
4592
+
4593
+ const moment = /*#__PURE__*/Object.freeze({
4594
+ __proto__: null,
4595
+ 'default': hooks
4596
+ });
4597
+
4598
+ export { hooks as h, moment as m };