react-intl 2.3.0 → 2.4.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 (263) hide show
  1. package/dist/react-intl.js +960 -948
  2. package/dist/react-intl.js.map +1 -1
  3. package/dist/react-intl.min.js +1 -2
  4. package/dist/react-intl.min.js.map +1 -1
  5. package/lib/index.es.js +971 -970
  6. package/lib/index.js +971 -970
  7. package/locale-data/af.js +1 -1
  8. package/locale-data/agq.js +1 -1
  9. package/locale-data/ak.js +1 -1
  10. package/locale-data/am.js +1 -1
  11. package/locale-data/ar.js +1 -1
  12. package/locale-data/ars.js +1 -0
  13. package/locale-data/as.js +1 -1
  14. package/locale-data/asa.js +1 -1
  15. package/locale-data/ast.js +1 -1
  16. package/locale-data/az.js +1 -1
  17. package/locale-data/bas.js +1 -1
  18. package/locale-data/be.js +1 -1
  19. package/locale-data/bem.js +1 -1
  20. package/locale-data/bez.js +1 -1
  21. package/locale-data/bg.js +1 -1
  22. package/locale-data/bh.js +1 -1
  23. package/locale-data/bm.js +1 -1
  24. package/locale-data/bn.js +1 -1
  25. package/locale-data/bo.js +1 -1
  26. package/locale-data/br.js +1 -1
  27. package/locale-data/brx.js +1 -1
  28. package/locale-data/bs.js +1 -1
  29. package/locale-data/ca.js +1 -1
  30. package/locale-data/ce.js +1 -1
  31. package/locale-data/cgg.js +1 -1
  32. package/locale-data/chr.js +1 -1
  33. package/locale-data/ckb.js +1 -1
  34. package/locale-data/cs.js +1 -1
  35. package/locale-data/cu.js +1 -1
  36. package/locale-data/cy.js +1 -1
  37. package/locale-data/da.js +1 -1
  38. package/locale-data/dav.js +1 -1
  39. package/locale-data/de.js +1 -1
  40. package/locale-data/dje.js +1 -1
  41. package/locale-data/dsb.js +1 -1
  42. package/locale-data/dua.js +1 -1
  43. package/locale-data/dv.js +1 -1
  44. package/locale-data/dyo.js +1 -1
  45. package/locale-data/dz.js +1 -1
  46. package/locale-data/ebu.js +1 -1
  47. package/locale-data/ee.js +1 -1
  48. package/locale-data/el.js +1 -1
  49. package/locale-data/en.js +1 -1
  50. package/locale-data/eo.js +1 -1
  51. package/locale-data/es.js +1 -1
  52. package/locale-data/et.js +1 -1
  53. package/locale-data/eu.js +1 -1
  54. package/locale-data/ewo.js +1 -1
  55. package/locale-data/fa.js +1 -1
  56. package/locale-data/ff.js +1 -1
  57. package/locale-data/fi.js +1 -1
  58. package/locale-data/fil.js +1 -1
  59. package/locale-data/fo.js +1 -1
  60. package/locale-data/fr.js +1 -1
  61. package/locale-data/fur.js +1 -1
  62. package/locale-data/fy.js +1 -1
  63. package/locale-data/ga.js +1 -1
  64. package/locale-data/gd.js +1 -1
  65. package/locale-data/gl.js +1 -1
  66. package/locale-data/gsw.js +1 -1
  67. package/locale-data/gu.js +1 -1
  68. package/locale-data/guw.js +1 -1
  69. package/locale-data/guz.js +1 -1
  70. package/locale-data/gv.js +1 -1
  71. package/locale-data/ha.js +1 -1
  72. package/locale-data/haw.js +1 -1
  73. package/locale-data/he.js +1 -1
  74. package/locale-data/hi.js +1 -1
  75. package/locale-data/hr.js +1 -1
  76. package/locale-data/hsb.js +1 -1
  77. package/locale-data/hu.js +1 -1
  78. package/locale-data/hy.js +1 -1
  79. package/locale-data/id.js +1 -1
  80. package/locale-data/ig.js +1 -1
  81. package/locale-data/ii.js +1 -1
  82. package/locale-data/in.js +1 -1
  83. package/locale-data/index.js +1 -10
  84. package/locale-data/is.js +1 -1
  85. package/locale-data/it.js +1 -1
  86. package/locale-data/iu.js +1 -1
  87. package/locale-data/iw.js +1 -1
  88. package/locale-data/ja.js +1 -1
  89. package/locale-data/jbo.js +1 -1
  90. package/locale-data/jgo.js +1 -1
  91. package/locale-data/ji.js +1 -1
  92. package/locale-data/jmc.js +1 -1
  93. package/locale-data/jv.js +1 -1
  94. package/locale-data/jw.js +1 -1
  95. package/locale-data/ka.js +1 -1
  96. package/locale-data/kab.js +1 -1
  97. package/locale-data/kaj.js +1 -1
  98. package/locale-data/kam.js +1 -1
  99. package/locale-data/kcg.js +1 -1
  100. package/locale-data/kde.js +1 -1
  101. package/locale-data/kea.js +1 -1
  102. package/locale-data/khq.js +1 -1
  103. package/locale-data/ki.js +1 -1
  104. package/locale-data/kk.js +1 -1
  105. package/locale-data/kkj.js +1 -1
  106. package/locale-data/kl.js +1 -1
  107. package/locale-data/kln.js +1 -1
  108. package/locale-data/km.js +1 -1
  109. package/locale-data/kn.js +1 -1
  110. package/locale-data/ko.js +1 -1
  111. package/locale-data/kok.js +1 -1
  112. package/locale-data/ks.js +1 -1
  113. package/locale-data/ksb.js +1 -1
  114. package/locale-data/ksf.js +1 -1
  115. package/locale-data/ksh.js +1 -1
  116. package/locale-data/ku.js +1 -1
  117. package/locale-data/kw.js +1 -1
  118. package/locale-data/ky.js +1 -1
  119. package/locale-data/lag.js +1 -1
  120. package/locale-data/lb.js +1 -1
  121. package/locale-data/lg.js +1 -1
  122. package/locale-data/lkt.js +1 -1
  123. package/locale-data/ln.js +1 -1
  124. package/locale-data/lo.js +1 -1
  125. package/locale-data/lrc.js +1 -1
  126. package/locale-data/lt.js +1 -1
  127. package/locale-data/lu.js +1 -1
  128. package/locale-data/luo.js +1 -1
  129. package/locale-data/luy.js +1 -1
  130. package/locale-data/lv.js +1 -1
  131. package/locale-data/mas.js +1 -1
  132. package/locale-data/mer.js +1 -1
  133. package/locale-data/mfe.js +1 -1
  134. package/locale-data/mg.js +1 -1
  135. package/locale-data/mgh.js +1 -1
  136. package/locale-data/mgo.js +1 -1
  137. package/locale-data/mk.js +1 -1
  138. package/locale-data/ml.js +1 -1
  139. package/locale-data/mn.js +1 -1
  140. package/locale-data/mo.js +1 -1
  141. package/locale-data/mr.js +1 -1
  142. package/locale-data/ms.js +1 -1
  143. package/locale-data/mt.js +1 -1
  144. package/locale-data/mua.js +1 -1
  145. package/locale-data/my.js +1 -1
  146. package/locale-data/mzn.js +1 -1
  147. package/locale-data/nah.js +1 -1
  148. package/locale-data/naq.js +1 -1
  149. package/locale-data/nb.js +1 -1
  150. package/locale-data/nd.js +1 -1
  151. package/locale-data/nds.js +1 -0
  152. package/locale-data/ne.js +1 -1
  153. package/locale-data/nl.js +1 -1
  154. package/locale-data/nmg.js +1 -1
  155. package/locale-data/nn.js +1 -1
  156. package/locale-data/nnh.js +1 -1
  157. package/locale-data/no.js +1 -1
  158. package/locale-data/nqo.js +1 -1
  159. package/locale-data/nr.js +1 -1
  160. package/locale-data/nso.js +1 -1
  161. package/locale-data/nus.js +1 -1
  162. package/locale-data/ny.js +1 -1
  163. package/locale-data/nyn.js +1 -1
  164. package/locale-data/om.js +1 -1
  165. package/locale-data/or.js +1 -1
  166. package/locale-data/os.js +1 -1
  167. package/locale-data/pa.js +1 -1
  168. package/locale-data/pap.js +1 -1
  169. package/locale-data/pl.js +1 -1
  170. package/locale-data/prg.js +1 -1
  171. package/locale-data/ps.js +1 -1
  172. package/locale-data/pt.js +1 -1
  173. package/locale-data/qu.js +1 -1
  174. package/locale-data/rm.js +1 -1
  175. package/locale-data/rn.js +1 -1
  176. package/locale-data/ro.js +1 -1
  177. package/locale-data/rof.js +1 -1
  178. package/locale-data/ru.js +1 -1
  179. package/locale-data/rw.js +1 -1
  180. package/locale-data/rwk.js +1 -1
  181. package/locale-data/sah.js +1 -1
  182. package/locale-data/saq.js +1 -1
  183. package/locale-data/sbp.js +1 -1
  184. package/locale-data/sdh.js +1 -1
  185. package/locale-data/se.js +1 -1
  186. package/locale-data/seh.js +1 -1
  187. package/locale-data/ses.js +1 -1
  188. package/locale-data/sg.js +1 -1
  189. package/locale-data/sh.js +1 -1
  190. package/locale-data/shi.js +1 -1
  191. package/locale-data/si.js +1 -1
  192. package/locale-data/sk.js +1 -1
  193. package/locale-data/sl.js +1 -1
  194. package/locale-data/sma.js +1 -1
  195. package/locale-data/smi.js +1 -1
  196. package/locale-data/smj.js +1 -1
  197. package/locale-data/smn.js +1 -1
  198. package/locale-data/sms.js +1 -1
  199. package/locale-data/sn.js +1 -1
  200. package/locale-data/so.js +1 -1
  201. package/locale-data/sq.js +1 -1
  202. package/locale-data/sr.js +1 -1
  203. package/locale-data/ss.js +1 -1
  204. package/locale-data/ssy.js +1 -1
  205. package/locale-data/st.js +1 -1
  206. package/locale-data/sv.js +1 -1
  207. package/locale-data/sw.js +1 -1
  208. package/locale-data/syr.js +1 -1
  209. package/locale-data/ta.js +1 -1
  210. package/locale-data/te.js +1 -1
  211. package/locale-data/teo.js +1 -1
  212. package/locale-data/th.js +1 -1
  213. package/locale-data/ti.js +1 -1
  214. package/locale-data/tig.js +1 -1
  215. package/locale-data/tk.js +1 -1
  216. package/locale-data/tl.js +1 -1
  217. package/locale-data/tn.js +1 -1
  218. package/locale-data/to.js +1 -1
  219. package/locale-data/tr.js +1 -1
  220. package/locale-data/ts.js +1 -1
  221. package/locale-data/twq.js +1 -1
  222. package/locale-data/tzm.js +1 -1
  223. package/locale-data/ug.js +1 -1
  224. package/locale-data/uk.js +1 -1
  225. package/locale-data/ur.js +1 -1
  226. package/locale-data/uz.js +1 -1
  227. package/locale-data/vai.js +1 -1
  228. package/locale-data/ve.js +1 -1
  229. package/locale-data/vi.js +1 -1
  230. package/locale-data/vo.js +1 -1
  231. package/locale-data/vun.js +1 -1
  232. package/locale-data/wa.js +1 -1
  233. package/locale-data/wae.js +1 -1
  234. package/locale-data/wo.js +1 -1
  235. package/locale-data/xh.js +1 -1
  236. package/locale-data/xog.js +1 -1
  237. package/locale-data/yav.js +1 -1
  238. package/locale-data/yi.js +1 -1
  239. package/locale-data/yo.js +1 -1
  240. package/locale-data/yue.js +1 -0
  241. package/locale-data/zgh.js +1 -1
  242. package/locale-data/zh.js +1 -1
  243. package/locale-data/zu.js +1 -1
  244. package/package.json +11 -9
  245. package/src/components/date.js +47 -0
  246. package/src/components/html-message.js +88 -0
  247. package/src/components/message.js +137 -0
  248. package/src/components/number.js +47 -0
  249. package/src/components/plural.js +59 -0
  250. package/src/components/provider.js +177 -0
  251. package/src/components/relative.js +171 -0
  252. package/src/components/time.js +47 -0
  253. package/src/define-messages.js +11 -0
  254. package/src/en.js +2 -0
  255. package/src/format.js +276 -0
  256. package/src/index.js +12 -0
  257. package/src/inject.js +59 -0
  258. package/src/locale-data-registry.js +42 -0
  259. package/src/plural.js +28 -0
  260. package/src/react-intl.js +24 -0
  261. package/src/types.js +98 -0
  262. package/src/utils.js +103 -0
  263. package/yarn.lock +87 -59
@@ -25,7 +25,7 @@ var defaultLocaleData = { "locale": "en", "pluralRuleFunction": function pluralR
25
25
  t0 = Number(s[0]) == n,
26
26
  n10 = t0 && s[0].slice(-1),
27
27
  n100 = t0 && s[0].slice(-2);if (ord) return n10 == 1 && n100 != 11 ? "one" : n10 == 2 && n100 != 12 ? "two" : n10 == 3 && n100 != 13 ? "few" : "other";return n == 1 && v0 ? "one" : "other";
28
- }, "fields": { "year": { "displayName": "year", "relative": { "0": "this year", "1": "next year", "-1": "last year" }, "relativeTime": { "future": { "one": "in {0} year", "other": "in {0} years" }, "past": { "one": "{0} year ago", "other": "{0} years ago" } } }, "month": { "displayName": "month", "relative": { "0": "this month", "1": "next month", "-1": "last month" }, "relativeTime": { "future": { "one": "in {0} month", "other": "in {0} months" }, "past": { "one": "{0} month ago", "other": "{0} months ago" } } }, "day": { "displayName": "day", "relative": { "0": "today", "1": "tomorrow", "-1": "yesterday" }, "relativeTime": { "future": { "one": "in {0} day", "other": "in {0} days" }, "past": { "one": "{0} day ago", "other": "{0} days ago" } } }, "hour": { "displayName": "hour", "relativeTime": { "future": { "one": "in {0} hour", "other": "in {0} hours" }, "past": { "one": "{0} hour ago", "other": "{0} hours ago" } } }, "minute": { "displayName": "minute", "relativeTime": { "future": { "one": "in {0} minute", "other": "in {0} minutes" }, "past": { "one": "{0} minute ago", "other": "{0} minutes ago" } } }, "second": { "displayName": "second", "relative": { "0": "now" }, "relativeTime": { "future": { "one": "in {0} second", "other": "in {0} seconds" }, "past": { "one": "{0} second ago", "other": "{0} seconds ago" } } } } };
28
+ }, "fields": { "year": { "displayName": "year", "relative": { "0": "this year", "1": "next year", "-1": "last year" }, "relativeTime": { "future": { "one": "in {0} year", "other": "in {0} years" }, "past": { "one": "{0} year ago", "other": "{0} years ago" } } }, "month": { "displayName": "month", "relative": { "0": "this month", "1": "next month", "-1": "last month" }, "relativeTime": { "future": { "one": "in {0} month", "other": "in {0} months" }, "past": { "one": "{0} month ago", "other": "{0} months ago" } } }, "day": { "displayName": "day", "relative": { "0": "today", "1": "tomorrow", "-1": "yesterday" }, "relativeTime": { "future": { "one": "in {0} day", "other": "in {0} days" }, "past": { "one": "{0} day ago", "other": "{0} days ago" } } }, "hour": { "displayName": "hour", "relative": { "0": "this hour" }, "relativeTime": { "future": { "one": "in {0} hour", "other": "in {0} hours" }, "past": { "one": "{0} hour ago", "other": "{0} hours ago" } } }, "minute": { "displayName": "minute", "relative": { "0": "this minute" }, "relativeTime": { "future": { "one": "in {0} minute", "other": "in {0} minutes" }, "past": { "one": "{0} minute ago", "other": "{0} minutes ago" } } }, "second": { "displayName": "second", "relative": { "0": "now" }, "relativeTime": { "future": { "one": "in {0} second", "other": "in {0} seconds" }, "past": { "one": "{0} second ago", "other": "{0} seconds ago" } } } } };
29
29
 
30
30
  /*
31
31
  Copyright (c) 2014, Yahoo! Inc. All rights reserved.
@@ -254,7 +254,7 @@ function StringFormat(id) {
254
254
  }
255
255
 
256
256
  StringFormat.prototype.format = function (value) {
257
- if (!value) {
257
+ if (!value && typeof value !== 'number') {
258
258
  return '';
259
259
  }
260
260
 
@@ -1734,7 +1734,15 @@ function MessageFormat(message, locales, formats) {
1734
1734
  // the other `Intl` APIs.
1735
1735
  var messageFormat = this;
1736
1736
  this.format = function (values) {
1737
- return messageFormat._format(pattern, values);
1737
+ try {
1738
+ return messageFormat._format(pattern, values);
1739
+ } catch (e) {
1740
+ if (e.variableId) {
1741
+ throw new Error('The intl string context variable \'' + e.variableId + '\'' + ' was not provided to the string \'' + message + '\'');
1742
+ } else {
1743
+ throw e;
1744
+ }
1745
+ }
1738
1746
  };
1739
1747
  }
1740
1748
 
@@ -1867,7 +1875,8 @@ MessageFormat.prototype._format = function (pattern, values) {
1867
1875
  len,
1868
1876
  part,
1869
1877
  id,
1870
- value;
1878
+ value,
1879
+ err;
1871
1880
 
1872
1881
  for (i = 0, len = pattern.length; i < len; i += 1) {
1873
1882
  part = pattern[i];
@@ -1882,7 +1891,9 @@ MessageFormat.prototype._format = function (pattern, values) {
1882
1891
 
1883
1892
  // Enforce that all required values are provided by the caller.
1884
1893
  if (!(values && hop.call(values, id))) {
1885
- throw new Error('A value must be provided for: ' + id);
1894
+ err = new Error('A value must be provided for: ' + id);
1895
+ err.variableId = id;
1896
+ throw err;
1886
1897
  }
1887
1898
 
1888
1899
  value = values[id];
@@ -2369,36 +2380,36 @@ RelativeFormat.defaultLocale = 'en';
2369
2380
  */
2370
2381
 
2371
2382
  function addLocaleData() {
2372
- var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2383
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2373
2384
 
2374
- var locales = Array.isArray(data) ? data : [data];
2385
+ var locales = Array.isArray(data) ? data : [data];
2375
2386
 
2376
- locales.forEach(function (localeData) {
2377
- if (localeData && localeData.locale) {
2378
- MessageFormat.__addLocaleData(localeData);
2379
- RelativeFormat.__addLocaleData(localeData);
2380
- }
2381
- });
2387
+ locales.forEach(function (localeData) {
2388
+ if (localeData && localeData.locale) {
2389
+ MessageFormat.__addLocaleData(localeData);
2390
+ RelativeFormat.__addLocaleData(localeData);
2391
+ }
2392
+ });
2382
2393
  }
2383
2394
 
2384
2395
  function hasLocaleData(locale) {
2385
- var localeParts = (locale || '').split('-');
2396
+ var localeParts = (locale || '').split('-');
2386
2397
 
2387
- while (localeParts.length > 0) {
2388
- if (hasIMFAndIRFLocaleData(localeParts.join('-'))) {
2389
- return true;
2390
- }
2391
-
2392
- localeParts.pop();
2398
+ while (localeParts.length > 0) {
2399
+ if (hasIMFAndIRFLocaleData(localeParts.join('-'))) {
2400
+ return true;
2393
2401
  }
2394
2402
 
2395
- return false;
2403
+ localeParts.pop();
2404
+ }
2405
+
2406
+ return false;
2396
2407
  }
2397
2408
 
2398
2409
  function hasIMFAndIRFLocaleData(locale) {
2399
- var normalizedLocale = locale && locale.toLowerCase();
2410
+ var normalizedLocale = locale && locale.toLowerCase();
2400
2411
 
2401
- return !!(MessageFormat.__localeData__[normalizedLocale] && RelativeFormat.__localeData__[normalizedLocale]);
2412
+ return !!(MessageFormat.__localeData__[normalizedLocale] && RelativeFormat.__localeData__[normalizedLocale]);
2402
2413
  }
2403
2414
 
2404
2415
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
@@ -2562,6 +2573,7 @@ var object = PropTypes.object;
2562
2573
  var oneOf = PropTypes.oneOf;
2563
2574
  var shape = PropTypes.shape;
2564
2575
  var any = PropTypes.any;
2576
+ var oneOfType = PropTypes.oneOfType;
2565
2577
 
2566
2578
  var localeMatcher = oneOf(['best fit', 'lookup']);
2567
2579
  var narrowShortLong = oneOf(['narrow', 'short', 'long']);
@@ -2569,76 +2581,76 @@ var numeric2digit = oneOf(['numeric', '2-digit']);
2569
2581
  var funcReq = func.isRequired;
2570
2582
 
2571
2583
  var intlConfigPropTypes = {
2572
- locale: string,
2573
- formats: object,
2574
- messages: object,
2575
- textComponent: any,
2584
+ locale: string,
2585
+ formats: object,
2586
+ messages: object,
2587
+ textComponent: any,
2576
2588
 
2577
- defaultLocale: string,
2578
- defaultFormats: object
2589
+ defaultLocale: string,
2590
+ defaultFormats: object
2579
2591
  };
2580
2592
 
2581
2593
  var intlFormatPropTypes = {
2582
- formatDate: funcReq,
2583
- formatTime: funcReq,
2584
- formatRelative: funcReq,
2585
- formatNumber: funcReq,
2586
- formatPlural: funcReq,
2587
- formatMessage: funcReq,
2588
- formatHTMLMessage: funcReq
2594
+ formatDate: funcReq,
2595
+ formatTime: funcReq,
2596
+ formatRelative: funcReq,
2597
+ formatNumber: funcReq,
2598
+ formatPlural: funcReq,
2599
+ formatMessage: funcReq,
2600
+ formatHTMLMessage: funcReq
2589
2601
  };
2590
2602
 
2591
2603
  var intlShape = shape(_extends({}, intlConfigPropTypes, intlFormatPropTypes, {
2592
- formatters: object,
2593
- now: funcReq
2604
+ formatters: object,
2605
+ now: funcReq
2594
2606
  }));
2595
2607
 
2596
2608
  var messageDescriptorPropTypes = {
2597
- id: string.isRequired,
2598
- description: string,
2599
- defaultMessage: string
2609
+ id: string.isRequired,
2610
+ description: oneOfType([string, object]),
2611
+ defaultMessage: string
2600
2612
  };
2601
2613
 
2602
2614
  var dateTimeFormatPropTypes = {
2603
- localeMatcher: localeMatcher,
2604
- formatMatcher: oneOf(['basic', 'best fit']),
2605
-
2606
- timeZone: string,
2607
- hour12: bool,
2608
-
2609
- weekday: narrowShortLong,
2610
- era: narrowShortLong,
2611
- year: numeric2digit,
2612
- month: oneOf(['numeric', '2-digit', 'narrow', 'short', 'long']),
2613
- day: numeric2digit,
2614
- hour: numeric2digit,
2615
- minute: numeric2digit,
2616
- second: numeric2digit,
2617
- timeZoneName: oneOf(['short', 'long'])
2615
+ localeMatcher: localeMatcher,
2616
+ formatMatcher: oneOf(['basic', 'best fit']),
2617
+
2618
+ timeZone: string,
2619
+ hour12: bool,
2620
+
2621
+ weekday: narrowShortLong,
2622
+ era: narrowShortLong,
2623
+ year: numeric2digit,
2624
+ month: oneOf(['numeric', '2-digit', 'narrow', 'short', 'long']),
2625
+ day: numeric2digit,
2626
+ hour: numeric2digit,
2627
+ minute: numeric2digit,
2628
+ second: numeric2digit,
2629
+ timeZoneName: oneOf(['short', 'long'])
2618
2630
  };
2619
2631
 
2620
2632
  var numberFormatPropTypes = {
2621
- localeMatcher: localeMatcher,
2622
-
2623
- style: oneOf(['decimal', 'currency', 'percent']),
2624
- currency: string,
2625
- currencyDisplay: oneOf(['symbol', 'code', 'name']),
2626
- useGrouping: bool,
2627
-
2628
- minimumIntegerDigits: number,
2629
- minimumFractionDigits: number,
2630
- maximumFractionDigits: number,
2631
- minimumSignificantDigits: number,
2632
- maximumSignificantDigits: number
2633
+ localeMatcher: localeMatcher,
2634
+
2635
+ style: oneOf(['decimal', 'currency', 'percent']),
2636
+ currency: string,
2637
+ currencyDisplay: oneOf(['symbol', 'code', 'name']),
2638
+ useGrouping: bool,
2639
+
2640
+ minimumIntegerDigits: number,
2641
+ minimumFractionDigits: number,
2642
+ maximumFractionDigits: number,
2643
+ minimumSignificantDigits: number,
2644
+ maximumSignificantDigits: number
2633
2645
  };
2634
2646
 
2635
2647
  var relativeFormatPropTypes = {
2636
- style: oneOf(['best fit', 'numeric']),
2637
- units: oneOf(['second', 'minute', 'hour', 'day', 'month', 'year'])
2648
+ style: oneOf(['best fit', 'numeric']),
2649
+ units: oneOf(['second', 'minute', 'hour', 'day', 'month', 'year'])
2638
2650
  };
2639
2651
 
2640
2652
  var pluralFormatPropTypes = {
2641
- style: oneOf(['cardinal', 'ordinal'])
2653
+ style: oneOf(['cardinal', 'ordinal'])
2642
2654
  };
2643
2655
 
2644
2656
  /**
@@ -2704,82 +2716,82 @@ file in the root directory of React's source tree.
2704
2716
  var intlConfigPropNames = Object.keys(intlConfigPropTypes);
2705
2717
 
2706
2718
  var ESCAPED_CHARS = {
2707
- '&': '&amp;',
2708
- '>': '&gt;',
2709
- '<': '&lt;',
2710
- '"': '&quot;',
2711
- '\'': '&#x27;'
2719
+ '&': '&amp;',
2720
+ '>': '&gt;',
2721
+ '<': '&lt;',
2722
+ '"': '&quot;',
2723
+ "'": '&#x27;'
2712
2724
  };
2713
2725
 
2714
2726
  var UNSAFE_CHARS_REGEX = /[&><"']/g;
2715
2727
 
2716
2728
  function escape(str) {
2717
- return ('' + str).replace(UNSAFE_CHARS_REGEX, function (match) {
2718
- return ESCAPED_CHARS[match];
2719
- });
2729
+ return ('' + str).replace(UNSAFE_CHARS_REGEX, function (match) {
2730
+ return ESCAPED_CHARS[match];
2731
+ });
2720
2732
  }
2721
2733
 
2722
2734
  function filterProps(props, whitelist) {
2723
- var defaults$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2735
+ var defaults$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2724
2736
 
2725
- return whitelist.reduce(function (filtered, name) {
2726
- if (props.hasOwnProperty(name)) {
2727
- filtered[name] = props[name];
2728
- } else if (defaults$$1.hasOwnProperty(name)) {
2729
- filtered[name] = defaults$$1[name];
2730
- }
2737
+ return whitelist.reduce(function (filtered, name) {
2738
+ if (props.hasOwnProperty(name)) {
2739
+ filtered[name] = props[name];
2740
+ } else if (defaults$$1.hasOwnProperty(name)) {
2741
+ filtered[name] = defaults$$1[name];
2742
+ }
2731
2743
 
2732
- return filtered;
2733
- }, {});
2744
+ return filtered;
2745
+ }, {});
2734
2746
  }
2735
2747
 
2736
2748
  function invariantIntlContext() {
2737
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
2738
- intl = _ref.intl;
2749
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
2750
+ intl = _ref.intl;
2739
2751
 
2740
- invariant_1(intl, '[React Intl] Could not find required `intl` object. ' + '<IntlProvider> needs to exist in the component ancestry.');
2752
+ invariant_1(intl, '[React Intl] Could not find required `intl` object. ' + '<IntlProvider> needs to exist in the component ancestry.');
2741
2753
  }
2742
2754
 
2743
2755
  function shallowEquals(objA, objB) {
2744
- if (objA === objB) {
2745
- return true;
2746
- }
2756
+ if (objA === objB) {
2757
+ return true;
2758
+ }
2747
2759
 
2748
- if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {
2749
- return false;
2750
- }
2760
+ if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {
2761
+ return false;
2762
+ }
2751
2763
 
2752
- var keysA = Object.keys(objA);
2753
- var keysB = Object.keys(objB);
2764
+ var keysA = Object.keys(objA);
2765
+ var keysB = Object.keys(objB);
2754
2766
 
2755
- if (keysA.length !== keysB.length) {
2756
- return false;
2757
- }
2767
+ if (keysA.length !== keysB.length) {
2768
+ return false;
2769
+ }
2758
2770
 
2759
- // Test for A's keys different from B.
2760
- var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
2761
- for (var i = 0; i < keysA.length; i++) {
2762
- if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
2763
- return false;
2764
- }
2771
+ // Test for A's keys different from B.
2772
+ var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
2773
+ for (var i = 0; i < keysA.length; i++) {
2774
+ if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
2775
+ return false;
2765
2776
  }
2777
+ }
2766
2778
 
2767
- return true;
2779
+ return true;
2768
2780
  }
2769
2781
 
2770
2782
  function shouldIntlComponentUpdate(_ref2, nextProps, nextState) {
2771
- var props = _ref2.props,
2772
- state = _ref2.state,
2773
- _ref2$context = _ref2.context,
2774
- context = _ref2$context === undefined ? {} : _ref2$context;
2775
- var nextContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2776
- var _context$intl = context.intl,
2777
- intl = _context$intl === undefined ? {} : _context$intl;
2778
- var _nextContext$intl = nextContext.intl,
2779
- nextIntl = _nextContext$intl === undefined ? {} : _nextContext$intl;
2780
-
2781
-
2782
- return !shallowEquals(nextProps, props) || !shallowEquals(nextState, state) || !(nextIntl === intl || shallowEquals(filterProps(nextIntl, intlConfigPropNames), filterProps(intl, intlConfigPropNames)));
2783
+ var props = _ref2.props,
2784
+ state = _ref2.state,
2785
+ _ref2$context = _ref2.context,
2786
+ context = _ref2$context === undefined ? {} : _ref2$context;
2787
+ var nextContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2788
+ var _context$intl = context.intl,
2789
+ intl = _context$intl === undefined ? {} : _context$intl;
2790
+ var _nextContext$intl = nextContext.intl,
2791
+ nextIntl = _nextContext$intl === undefined ? {} : _nextContext$intl;
2792
+
2793
+
2794
+ return !shallowEquals(nextProps, props) || !shallowEquals(nextState, state) || !(nextIntl === intl || shallowEquals(filterProps(nextIntl, intlConfigPropNames), filterProps(intl, intlConfigPropNames)));
2783
2795
  }
2784
2796
 
2785
2797
  /*
@@ -2792,54 +2804,54 @@ function shouldIntlComponentUpdate(_ref2, nextProps, nextState) {
2792
2804
  // https://github.com/rackt/react-redux
2793
2805
 
2794
2806
  function getDisplayName(Component$$1) {
2795
- return Component$$1.displayName || Component$$1.name || 'Component';
2807
+ return Component$$1.displayName || Component$$1.name || 'Component';
2796
2808
  }
2797
2809
 
2798
2810
  function injectIntl(WrappedComponent) {
2799
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2800
- var _options$intlPropName = options.intlPropName,
2801
- intlPropName = _options$intlPropName === undefined ? 'intl' : _options$intlPropName,
2802
- _options$withRef = options.withRef,
2803
- withRef = _options$withRef === undefined ? false : _options$withRef;
2811
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2812
+ var _options$intlPropName = options.intlPropName,
2813
+ intlPropName = _options$intlPropName === undefined ? 'intl' : _options$intlPropName,
2814
+ _options$withRef = options.withRef,
2815
+ withRef = _options$withRef === undefined ? false : _options$withRef;
2804
2816
 
2805
- var InjectIntl = function (_Component) {
2806
- inherits(InjectIntl, _Component);
2817
+ var InjectIntl = function (_Component) {
2818
+ inherits(InjectIntl, _Component);
2807
2819
 
2808
- function InjectIntl(props, context) {
2809
- classCallCheck(this, InjectIntl);
2820
+ function InjectIntl(props, context) {
2821
+ classCallCheck(this, InjectIntl);
2810
2822
 
2811
- var _this = possibleConstructorReturn(this, (InjectIntl.__proto__ || Object.getPrototypeOf(InjectIntl)).call(this, props, context));
2823
+ var _this = possibleConstructorReturn(this, (InjectIntl.__proto__ || Object.getPrototypeOf(InjectIntl)).call(this, props, context));
2812
2824
 
2813
- invariantIntlContext(context);
2814
- return _this;
2815
- }
2825
+ invariantIntlContext(context);
2826
+ return _this;
2827
+ }
2816
2828
 
2817
- createClass(InjectIntl, [{
2818
- key: 'getWrappedInstance',
2819
- value: function getWrappedInstance() {
2820
- invariant_1(withRef, '[React Intl] To access the wrapped instance, ' + 'the `{withRef: true}` option must be set when calling: ' + '`injectIntl()`');
2829
+ createClass(InjectIntl, [{
2830
+ key: 'getWrappedInstance',
2831
+ value: function getWrappedInstance() {
2832
+ invariant_1(withRef, '[React Intl] To access the wrapped instance, ' + 'the `{withRef: true}` option must be set when calling: ' + '`injectIntl()`');
2821
2833
 
2822
- return this.refs.wrappedInstance;
2823
- }
2824
- }, {
2825
- key: 'render',
2826
- value: function render() {
2827
- return React__default.createElement(WrappedComponent, _extends({}, this.props, defineProperty$2({}, intlPropName, this.context.intl), {
2828
- ref: withRef ? 'wrappedInstance' : null
2829
- }));
2830
- }
2831
- }]);
2832
- return InjectIntl;
2833
- }(React.Component);
2834
+ return this.refs.wrappedInstance;
2835
+ }
2836
+ }, {
2837
+ key: 'render',
2838
+ value: function render() {
2839
+ return React__default.createElement(WrappedComponent, _extends({}, this.props, defineProperty$2({}, intlPropName, this.context.intl), {
2840
+ ref: withRef ? 'wrappedInstance' : null
2841
+ }));
2842
+ }
2843
+ }]);
2844
+ return InjectIntl;
2845
+ }(React.Component);
2834
2846
 
2835
- InjectIntl.displayName = 'InjectIntl(' + getDisplayName(WrappedComponent) + ')';
2836
- InjectIntl.contextTypes = {
2837
- intl: intlShape
2838
- };
2839
- InjectIntl.WrappedComponent = WrappedComponent;
2847
+ InjectIntl.displayName = 'InjectIntl(' + getDisplayName(WrappedComponent) + ')';
2848
+ InjectIntl.contextTypes = {
2849
+ intl: intlShape
2850
+ };
2851
+ InjectIntl.WrappedComponent = WrappedComponent;
2840
2852
 
2841
2853
 
2842
- return InjectIntl;
2854
+ return InjectIntl;
2843
2855
  }
2844
2856
 
2845
2857
  /*
@@ -2863,25 +2875,25 @@ function defineMessages(messageDescriptors) {
2863
2875
  // This is a "hack" until a proper `intl-pluralformat` package is created.
2864
2876
 
2865
2877
  function resolveLocale(locales) {
2866
- // IntlMessageFormat#_resolveLocale() does not depend on `this`.
2867
- return MessageFormat.prototype._resolveLocale(locales);
2878
+ // IntlMessageFormat#_resolveLocale() does not depend on `this`.
2879
+ return MessageFormat.prototype._resolveLocale(locales);
2868
2880
  }
2869
2881
 
2870
2882
  function findPluralFunction(locale) {
2871
- // IntlMessageFormat#_findPluralFunction() does not depend on `this`.
2872
- return MessageFormat.prototype._findPluralRuleFunction(locale);
2883
+ // IntlMessageFormat#_findPluralFunction() does not depend on `this`.
2884
+ return MessageFormat.prototype._findPluralRuleFunction(locale);
2873
2885
  }
2874
2886
 
2875
2887
  var IntlPluralFormat = function IntlPluralFormat(locales) {
2876
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2877
- classCallCheck(this, IntlPluralFormat);
2888
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2889
+ classCallCheck(this, IntlPluralFormat);
2878
2890
 
2879
- var useOrdinal = options.style === 'ordinal';
2880
- var pluralFn = findPluralFunction(resolveLocale(locales));
2891
+ var useOrdinal = options.style === 'ordinal';
2892
+ var pluralFn = findPluralFunction(resolveLocale(locales));
2881
2893
 
2882
- this.format = function (value) {
2883
- return pluralFn(value, useOrdinal);
2884
- };
2894
+ this.format = function (value) {
2895
+ return pluralFn(value, useOrdinal);
2896
+ };
2885
2897
  };
2886
2898
 
2887
2899
  /*
@@ -3048,234 +3060,234 @@ var RELATIVE_FORMAT_OPTIONS = Object.keys(relativeFormatPropTypes);
3048
3060
  var PLURAL_FORMAT_OPTIONS = Object.keys(pluralFormatPropTypes);
3049
3061
 
3050
3062
  var RELATIVE_FORMAT_THRESHOLDS = {
3051
- second: 60, // seconds to minute
3052
- minute: 60, // minutes to hour
3053
- hour: 24, // hours to day
3054
- day: 30, // days to month
3055
- month: 12 };
3063
+ second: 60, // seconds to minute
3064
+ minute: 60, // minutes to hour
3065
+ hour: 24, // hours to day
3066
+ day: 30, // days to month
3067
+ month: 12 // months to year
3068
+ };
3056
3069
 
3057
3070
  function updateRelativeFormatThresholds(newThresholds) {
3058
- var thresholds = RelativeFormat.thresholds;
3059
- thresholds.second = newThresholds.second;
3060
- thresholds.minute = newThresholds.minute;
3061
- thresholds.hour = newThresholds.hour;
3062
- thresholds.day = newThresholds.day;
3063
- thresholds.month = newThresholds.month;
3071
+ var thresholds = RelativeFormat.thresholds;
3072
+ thresholds.second = newThresholds.second;
3073
+ thresholds.minute = newThresholds.minute;
3074
+ thresholds.hour = newThresholds.hour;
3075
+ thresholds.day = newThresholds.day;
3076
+ thresholds.month = newThresholds.month;
3064
3077
  }
3065
3078
 
3066
3079
  function getNamedFormat(formats, type, name) {
3067
- var format = formats && formats[type] && formats[type][name];
3068
- if (format) {
3069
- return format;
3070
- }
3080
+ var format = formats && formats[type] && formats[type][name];
3081
+ if (format) {
3082
+ return format;
3083
+ }
3071
3084
 
3072
- {
3073
- console.error('[React Intl] No ' + type + ' format named: ' + name);
3074
- }
3085
+ {
3086
+ console.error('[React Intl] No ' + type + ' format named: ' + name);
3087
+ }
3075
3088
  }
3076
3089
 
3077
3090
  function formatDate(config, state, value) {
3078
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3079
- var locale = config.locale,
3080
- formats = config.formats;
3081
- var format = options.format;
3091
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3092
+ var locale = config.locale,
3093
+ formats = config.formats;
3094
+ var format = options.format;
3082
3095
 
3083
3096
 
3084
- var date = new Date(value);
3085
- var defaults$$1 = format && getNamedFormat(formats, 'date', format);
3086
- var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults$$1);
3097
+ var date = new Date(value);
3098
+ var defaults$$1 = format && getNamedFormat(formats, 'date', format);
3099
+ var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults$$1);
3087
3100
 
3088
- try {
3089
- return state.getDateTimeFormat(locale, filteredOptions).format(date);
3090
- } catch (e) {
3091
- {
3092
- console.error('[React Intl] Error formatting date.\n' + e);
3093
- }
3101
+ try {
3102
+ return state.getDateTimeFormat(locale, filteredOptions).format(date);
3103
+ } catch (e) {
3104
+ {
3105
+ console.error('[React Intl] Error formatting date.\n' + e);
3094
3106
  }
3107
+ }
3095
3108
 
3096
- return String(date);
3109
+ return String(date);
3097
3110
  }
3098
3111
 
3099
3112
  function formatTime(config, state, value) {
3100
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3101
- var locale = config.locale,
3102
- formats = config.formats;
3103
- var format = options.format;
3113
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3114
+ var locale = config.locale,
3115
+ formats = config.formats;
3116
+ var format = options.format;
3104
3117
 
3105
3118
 
3106
- var date = new Date(value);
3107
- var defaults$$1 = format && getNamedFormat(formats, 'time', format);
3108
- var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults$$1);
3119
+ var date = new Date(value);
3120
+ var defaults$$1 = format && getNamedFormat(formats, 'time', format);
3121
+ var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults$$1);
3109
3122
 
3110
- if (!filteredOptions.hour && !filteredOptions.minute && !filteredOptions.second) {
3111
- // Add default formatting options if hour, minute, or second isn't defined.
3112
- filteredOptions = _extends({}, filteredOptions, { hour: 'numeric', minute: 'numeric' });
3113
- }
3123
+ if (!filteredOptions.hour && !filteredOptions.minute && !filteredOptions.second) {
3124
+ // Add default formatting options if hour, minute, or second isn't defined.
3125
+ filteredOptions = _extends({}, filteredOptions, { hour: 'numeric', minute: 'numeric' });
3126
+ }
3114
3127
 
3115
- try {
3116
- return state.getDateTimeFormat(locale, filteredOptions).format(date);
3117
- } catch (e) {
3118
- {
3119
- console.error('[React Intl] Error formatting time.\n' + e);
3120
- }
3128
+ try {
3129
+ return state.getDateTimeFormat(locale, filteredOptions).format(date);
3130
+ } catch (e) {
3131
+ {
3132
+ console.error('[React Intl] Error formatting time.\n' + e);
3121
3133
  }
3134
+ }
3122
3135
 
3123
- return String(date);
3136
+ return String(date);
3124
3137
  }
3125
3138
 
3126
3139
  function formatRelative(config, state, value) {
3127
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3128
- var locale = config.locale,
3129
- formats = config.formats;
3130
- var format = options.format;
3140
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3141
+ var locale = config.locale,
3142
+ formats = config.formats;
3143
+ var format = options.format;
3131
3144
 
3132
3145
 
3133
- var date = new Date(value);
3134
- var now = new Date(options.now);
3135
- var defaults$$1 = format && getNamedFormat(formats, 'relative', format);
3136
- var filteredOptions = filterProps(options, RELATIVE_FORMAT_OPTIONS, defaults$$1);
3146
+ var date = new Date(value);
3147
+ var now = new Date(options.now);
3148
+ var defaults$$1 = format && getNamedFormat(formats, 'relative', format);
3149
+ var filteredOptions = filterProps(options, RELATIVE_FORMAT_OPTIONS, defaults$$1);
3137
3150
 
3138
- // Capture the current threshold values, then temporarily override them with
3139
- // specific values just for this render.
3140
- var oldThresholds = _extends({}, RelativeFormat.thresholds);
3141
- updateRelativeFormatThresholds(RELATIVE_FORMAT_THRESHOLDS);
3151
+ // Capture the current threshold values, then temporarily override them with
3152
+ // specific values just for this render.
3153
+ var oldThresholds = _extends({}, RelativeFormat.thresholds);
3154
+ updateRelativeFormatThresholds(RELATIVE_FORMAT_THRESHOLDS);
3142
3155
 
3143
- try {
3144
- return state.getRelativeFormat(locale, filteredOptions).format(date, {
3145
- now: isFinite(now) ? now : state.now()
3146
- });
3147
- } catch (e) {
3148
- {
3149
- console.error('[React Intl] Error formatting relative time.\n' + e);
3150
- }
3151
- } finally {
3152
- updateRelativeFormatThresholds(oldThresholds);
3156
+ try {
3157
+ return state.getRelativeFormat(locale, filteredOptions).format(date, {
3158
+ now: isFinite(now) ? now : state.now()
3159
+ });
3160
+ } catch (e) {
3161
+ {
3162
+ console.error('[React Intl] Error formatting relative time.\n' + e);
3153
3163
  }
3164
+ } finally {
3165
+ updateRelativeFormatThresholds(oldThresholds);
3166
+ }
3154
3167
 
3155
- return String(date);
3168
+ return String(date);
3156
3169
  }
3157
3170
 
3158
3171
  function formatNumber(config, state, value) {
3159
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3160
- var locale = config.locale,
3161
- formats = config.formats;
3162
- var format = options.format;
3172
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3173
+ var locale = config.locale,
3174
+ formats = config.formats;
3175
+ var format = options.format;
3163
3176
 
3164
3177
 
3165
- var defaults$$1 = format && getNamedFormat(formats, 'number', format);
3166
- var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults$$1);
3178
+ var defaults$$1 = format && getNamedFormat(formats, 'number', format);
3179
+ var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults$$1);
3167
3180
 
3168
- try {
3169
- return state.getNumberFormat(locale, filteredOptions).format(value);
3170
- } catch (e) {
3171
- {
3172
- console.error('[React Intl] Error formatting number.\n' + e);
3173
- }
3181
+ try {
3182
+ return state.getNumberFormat(locale, filteredOptions).format(value);
3183
+ } catch (e) {
3184
+ {
3185
+ console.error('[React Intl] Error formatting number.\n' + e);
3174
3186
  }
3187
+ }
3175
3188
 
3176
- return String(value);
3189
+ return String(value);
3177
3190
  }
3178
3191
 
3179
3192
  function formatPlural(config, state, value) {
3180
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3181
- var locale = config.locale;
3193
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3194
+ var locale = config.locale;
3182
3195
 
3183
3196
 
3184
- var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);
3197
+ var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);
3185
3198
 
3186
- try {
3187
- return state.getPluralFormat(locale, filteredOptions).format(value);
3188
- } catch (e) {
3189
- {
3190
- console.error('[React Intl] Error formatting plural.\n' + e);
3191
- }
3199
+ try {
3200
+ return state.getPluralFormat(locale, filteredOptions).format(value);
3201
+ } catch (e) {
3202
+ {
3203
+ console.error('[React Intl] Error formatting plural.\n' + e);
3192
3204
  }
3205
+ }
3193
3206
 
3194
- return 'other';
3207
+ return 'other';
3195
3208
  }
3196
3209
 
3197
3210
  function formatMessage(config, state) {
3198
- var messageDescriptor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3199
- var values = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3200
- var locale = config.locale,
3201
- formats = config.formats,
3202
- messages = config.messages,
3203
- defaultLocale = config.defaultLocale,
3204
- defaultFormats = config.defaultFormats;
3205
- var id = messageDescriptor.id,
3206
- defaultMessage = messageDescriptor.defaultMessage;
3207
-
3208
- // `id` is a required field of a Message Descriptor.
3209
-
3210
- invariant_1(id, '[React Intl] An `id` must be provided to format a message.');
3211
-
3212
- var message = messages && messages[id];
3213
- var hasValues = Object.keys(values).length > 0;
3214
-
3215
- // Avoid expensive message formatting for simple messages without values. In
3216
- // development messages will always be formatted in case of missing values.
3217
- if (!hasValues && "development" === 'production') {
3218
- return message || defaultMessage || id;
3219
- }
3220
-
3221
- var formattedMessage = void 0;
3211
+ var messageDescriptor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3212
+ var values = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3213
+ var locale = config.locale,
3214
+ formats = config.formats,
3215
+ messages = config.messages,
3216
+ defaultLocale = config.defaultLocale,
3217
+ defaultFormats = config.defaultFormats;
3218
+ var id = messageDescriptor.id,
3219
+ defaultMessage = messageDescriptor.defaultMessage;
3220
+
3221
+ // `id` is a required field of a Message Descriptor.
3222
+
3223
+ invariant_1(id, '[React Intl] An `id` must be provided to format a message.');
3224
+
3225
+ var message = messages && messages[id];
3226
+ var hasValues = Object.keys(values).length > 0;
3227
+
3228
+ // Avoid expensive message formatting for simple messages without values. In
3229
+ // development messages will always be formatted in case of missing values.
3230
+ if (!hasValues && "development" === 'production') {
3231
+ return message || defaultMessage || id;
3232
+ }
3222
3233
 
3223
- if (message) {
3224
- try {
3225
- var formatter = state.getMessageFormat(message, locale, formats);
3234
+ var formattedMessage = void 0;
3226
3235
 
3227
- formattedMessage = formatter.format(values);
3228
- } catch (e) {
3229
- {
3230
- console.error('[React Intl] Error formatting message: "' + id + '" for locale: "' + locale + '"' + (defaultMessage ? ', using default message as fallback.' : '') + ('\n' + e));
3231
- }
3232
- }
3233
- } else {
3234
- {
3235
- // This prevents warnings from littering the console in development
3236
- // when no `messages` are passed into the <IntlProvider> for the
3237
- // default locale, and a default message is in the source.
3238
- if (!defaultMessage || locale && locale.toLowerCase() !== defaultLocale.toLowerCase()) {
3236
+ if (message) {
3237
+ try {
3238
+ var formatter = state.getMessageFormat(message, locale, formats);
3239
3239
 
3240
- console.error('[React Intl] Missing message: "' + id + '" for locale: "' + locale + '"' + (defaultMessage ? ', using default message as fallback.' : ''));
3241
- }
3242
- }
3240
+ formattedMessage = formatter.format(values);
3241
+ } catch (e) {
3242
+ {
3243
+ console.error('[React Intl] Error formatting message: "' + id + '" for locale: "' + locale + '"' + (defaultMessage ? ', using default message as fallback.' : '') + ('\n' + e));
3244
+ }
3243
3245
  }
3246
+ } else {
3247
+ {
3248
+ // This prevents warnings from littering the console in development
3249
+ // when no `messages` are passed into the <IntlProvider> for the
3250
+ // default locale, and a default message is in the source.
3251
+ if (!defaultMessage || locale && locale.toLowerCase() !== defaultLocale.toLowerCase()) {
3252
+ console.error('[React Intl] Missing message: "' + id + '" for locale: "' + locale + '"' + (defaultMessage ? ', using default message as fallback.' : ''));
3253
+ }
3254
+ }
3255
+ }
3244
3256
 
3245
- if (!formattedMessage && defaultMessage) {
3246
- try {
3247
- var _formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats);
3257
+ if (!formattedMessage && defaultMessage) {
3258
+ try {
3259
+ var _formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats);
3248
3260
 
3249
- formattedMessage = _formatter.format(values);
3250
- } catch (e) {
3251
- {
3252
- console.error('[React Intl] Error formatting the default message for: "' + id + '"' + ('\n' + e));
3253
- }
3254
- }
3261
+ formattedMessage = _formatter.format(values);
3262
+ } catch (e) {
3263
+ {
3264
+ console.error('[React Intl] Error formatting the default message for: "' + id + '"' + ('\n' + e));
3265
+ }
3255
3266
  }
3267
+ }
3256
3268
 
3257
- if (!formattedMessage) {
3258
- {
3259
- console.error('[React Intl] Cannot format message: "' + id + '", ' + ('using message ' + (message || defaultMessage ? 'source' : 'id') + ' as fallback.'));
3260
- }
3269
+ if (!formattedMessage) {
3270
+ {
3271
+ console.error('[React Intl] Cannot format message: "' + id + '", ' + ('using message ' + (message || defaultMessage ? 'source' : 'id') + ' as fallback.'));
3261
3272
  }
3273
+ }
3262
3274
 
3263
- return formattedMessage || message || defaultMessage || id;
3275
+ return formattedMessage || message || defaultMessage || id;
3264
3276
  }
3265
3277
 
3266
3278
  function formatHTMLMessage(config, state, messageDescriptor) {
3267
- var rawValues = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3268
-
3269
- // Process all the values before they are used when formatting the ICU
3270
- // Message string. Since the formatted message might be injected via
3271
- // `innerHTML`, all String-based values need to be HTML-escaped.
3272
- var escapedValues = Object.keys(rawValues).reduce(function (escaped, name) {
3273
- var value = rawValues[name];
3274
- escaped[name] = typeof value === 'string' ? escape(value) : value;
3275
- return escaped;
3276
- }, {});
3277
-
3278
- return formatMessage(config, state, messageDescriptor, escapedValues);
3279
+ var rawValues = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3280
+
3281
+ // Process all the values before they are used when formatting the ICU
3282
+ // Message string. Since the formatted message might be injected via
3283
+ // `innerHTML`, all String-based values need to be HTML-escaped.
3284
+ var escapedValues = Object.keys(rawValues).reduce(function (escaped, name) {
3285
+ var value = rawValues[name];
3286
+ escaped[name] = typeof value === 'string' ? escape(value) : value;
3287
+ return escaped;
3288
+ }, {});
3289
+
3290
+ return formatMessage(config, state, messageDescriptor, escapedValues);
3279
3291
  }
3280
3292
 
3281
3293
 
@@ -3302,170 +3314,170 @@ var intlFormatPropNames = Object.keys(intlFormatPropTypes);
3302
3314
  // These are not a static property on the `IntlProvider` class so the intl
3303
3315
  // config values can be inherited from an <IntlProvider> ancestor.
3304
3316
  var defaultProps = {
3305
- formats: {},
3306
- messages: {},
3307
- textComponent: 'span',
3317
+ formats: {},
3318
+ messages: {},
3319
+ textComponent: 'span',
3308
3320
 
3309
- defaultLocale: 'en',
3310
- defaultFormats: {}
3321
+ defaultLocale: 'en',
3322
+ defaultFormats: {}
3311
3323
  };
3312
3324
 
3313
3325
  var IntlProvider = function (_Component) {
3314
- inherits(IntlProvider, _Component);
3326
+ inherits(IntlProvider, _Component);
3315
3327
 
3316
- function IntlProvider(props) {
3317
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3318
- classCallCheck(this, IntlProvider);
3328
+ function IntlProvider(props) {
3329
+ var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3330
+ classCallCheck(this, IntlProvider);
3319
3331
 
3320
- var _this = possibleConstructorReturn(this, (IntlProvider.__proto__ || Object.getPrototypeOf(IntlProvider)).call(this, props, context));
3332
+ var _this = possibleConstructorReturn(this, (IntlProvider.__proto__ || Object.getPrototypeOf(IntlProvider)).call(this, props, context));
3321
3333
 
3322
- invariant_1(typeof Intl !== 'undefined', '[React Intl] The `Intl` APIs must be available in the runtime, ' + 'and do not appear to be built-in. An `Intl` polyfill should be loaded.\n' + 'See: http://formatjs.io/guides/runtime-environments/');
3334
+ invariant_1(typeof Intl !== 'undefined', '[React Intl] The `Intl` APIs must be available in the runtime, ' + 'and do not appear to be built-in. An `Intl` polyfill should be loaded.\n' + 'See: http://formatjs.io/guides/runtime-environments/');
3323
3335
 
3324
- var intlContext = context.intl;
3336
+ var intlContext = context.intl;
3325
3337
 
3326
- // Used to stabilize time when performing an initial rendering so that
3327
- // all relative times use the same reference "now" time.
3338
+ // Used to stabilize time when performing an initial rendering so that
3339
+ // all relative times use the same reference "now" time.
3328
3340
 
3329
- var initialNow = void 0;
3330
- if (isFinite(props.initialNow)) {
3331
- initialNow = Number(props.initialNow);
3332
- } else {
3333
- // When an `initialNow` isn't provided via `props`, look to see an
3334
- // <IntlProvider> exists in the ancestry and call its `now()`
3335
- // function to propagate its value for "now".
3336
- initialNow = intlContext ? intlContext.now() : Date.now();
3337
- }
3338
-
3339
- // Creating `Intl*` formatters is expensive. If there's a parent
3340
- // `<IntlProvider>`, then its formatters will be used. Otherwise, this
3341
- // memoize the `Intl*` constructors and cache them for the lifecycle of
3342
- // this IntlProvider instance.
3343
-
3344
- var _ref = intlContext || {},
3345
- _ref$formatters = _ref.formatters,
3346
- formatters = _ref$formatters === undefined ? {
3347
- getDateTimeFormat: createFormatCache(Intl.DateTimeFormat),
3348
- getNumberFormat: createFormatCache(Intl.NumberFormat),
3349
- getMessageFormat: createFormatCache(MessageFormat),
3350
- getRelativeFormat: createFormatCache(RelativeFormat),
3351
- getPluralFormat: createFormatCache(IntlPluralFormat)
3352
- } : _ref$formatters;
3353
-
3354
- _this.state = _extends({}, formatters, {
3355
-
3356
- // Wrapper to provide stable "now" time for initial render.
3357
- now: function now() {
3358
- return _this._didDisplay ? Date.now() : initialNow;
3359
- }
3360
- });
3361
- return _this;
3341
+ var initialNow = void 0;
3342
+ if (isFinite(props.initialNow)) {
3343
+ initialNow = Number(props.initialNow);
3344
+ } else {
3345
+ // When an `initialNow` isn't provided via `props`, look to see an
3346
+ // <IntlProvider> exists in the ancestry and call its `now()`
3347
+ // function to propagate its value for "now".
3348
+ initialNow = intlContext ? intlContext.now() : Date.now();
3362
3349
  }
3363
3350
 
3364
- createClass(IntlProvider, [{
3365
- key: 'getConfig',
3366
- value: function getConfig() {
3367
- var intlContext = this.context.intl;
3351
+ // Creating `Intl*` formatters is expensive. If there's a parent
3352
+ // `<IntlProvider>`, then its formatters will be used. Otherwise, this
3353
+ // memoize the `Intl*` constructors and cache them for the lifecycle of
3354
+ // this IntlProvider instance.
3355
+
3356
+ var _ref = intlContext || {},
3357
+ _ref$formatters = _ref.formatters,
3358
+ formatters = _ref$formatters === undefined ? {
3359
+ getDateTimeFormat: createFormatCache(Intl.DateTimeFormat),
3360
+ getNumberFormat: createFormatCache(Intl.NumberFormat),
3361
+ getMessageFormat: createFormatCache(MessageFormat),
3362
+ getRelativeFormat: createFormatCache(RelativeFormat),
3363
+ getPluralFormat: createFormatCache(IntlPluralFormat)
3364
+ } : _ref$formatters;
3365
+
3366
+ _this.state = _extends({}, formatters, {
3367
+
3368
+ // Wrapper to provide stable "now" time for initial render.
3369
+ now: function now() {
3370
+ return _this._didDisplay ? Date.now() : initialNow;
3371
+ }
3372
+ });
3373
+ return _this;
3374
+ }
3368
3375
 
3369
- // Build a whitelisted config object from `props`, defaults, and
3370
- // `context.intl`, if an <IntlProvider> exists in the ancestry.
3376
+ createClass(IntlProvider, [{
3377
+ key: 'getConfig',
3378
+ value: function getConfig() {
3379
+ var intlContext = this.context.intl;
3371
3380
 
3372
- var config = filterProps(this.props, intlConfigPropNames$1, intlContext);
3381
+ // Build a whitelisted config object from `props`, defaults, and
3382
+ // `context.intl`, if an <IntlProvider> exists in the ancestry.
3373
3383
 
3374
- // Apply default props. This must be applied last after the props have
3375
- // been resolved and inherited from any <IntlProvider> in the ancestry.
3376
- // This matches how React resolves `defaultProps`.
3377
- for (var propName in defaultProps) {
3378
- if (config[propName] === undefined) {
3379
- config[propName] = defaultProps[propName];
3380
- }
3381
- }
3382
-
3383
- if (!hasLocaleData(config.locale)) {
3384
- var _config = config,
3385
- locale = _config.locale,
3386
- defaultLocale = _config.defaultLocale,
3387
- defaultFormats = _config.defaultFormats;
3384
+ var config = filterProps(this.props, intlConfigPropNames$1, intlContext);
3388
3385
 
3386
+ // Apply default props. This must be applied last after the props have
3387
+ // been resolved and inherited from any <IntlProvider> in the ancestry.
3388
+ // This matches how React resolves `defaultProps`.
3389
+ for (var propName in defaultProps) {
3390
+ if (config[propName] === undefined) {
3391
+ config[propName] = defaultProps[propName];
3392
+ }
3393
+ }
3389
3394
 
3390
- {
3391
- console.error('[React Intl] Missing locale data for locale: "' + locale + '". ' + ('Using default locale: "' + defaultLocale + '" as fallback.'));
3392
- }
3395
+ if (!hasLocaleData(config.locale)) {
3396
+ var _config = config,
3397
+ locale = _config.locale,
3398
+ defaultLocale = _config.defaultLocale,
3399
+ defaultFormats = _config.defaultFormats;
3393
3400
 
3394
- // Since there's no registered locale data for `locale`, this will
3395
- // fallback to the `defaultLocale` to make sure things can render.
3396
- // The `messages` are overridden to the `defaultProps` empty object
3397
- // to maintain referential equality across re-renders. It's assumed
3398
- // each <FormattedMessage> contains a `defaultMessage` prop.
3399
- config = _extends({}, config, {
3400
- locale: defaultLocale,
3401
- formats: defaultFormats,
3402
- messages: defaultProps.messages
3403
- });
3404
- }
3405
3401
 
3406
- return config;
3407
- }
3408
- }, {
3409
- key: 'getBoundFormatFns',
3410
- value: function getBoundFormatFns(config, state) {
3411
- return intlFormatPropNames.reduce(function (boundFormatFns, name) {
3412
- boundFormatFns[name] = format[name].bind(null, config, state);
3413
- return boundFormatFns;
3414
- }, {});
3402
+ {
3403
+ console.error('[React Intl] Missing locale data for locale: "' + locale + '". ' + ('Using default locale: "' + defaultLocale + '" as fallback.'));
3415
3404
  }
3416
- }, {
3417
- key: 'getChildContext',
3418
- value: function getChildContext() {
3419
- var config = this.getConfig();
3420
3405
 
3421
- // Bind intl factories and current config to the format functions.
3422
- var boundFormatFns = this.getBoundFormatFns(config, this.state);
3406
+ // Since there's no registered locale data for `locale`, this will
3407
+ // fallback to the `defaultLocale` to make sure things can render.
3408
+ // The `messages` are overridden to the `defaultProps` empty object
3409
+ // to maintain referential equality across re-renders. It's assumed
3410
+ // each <FormattedMessage> contains a `defaultMessage` prop.
3411
+ config = _extends({}, config, {
3412
+ locale: defaultLocale,
3413
+ formats: defaultFormats,
3414
+ messages: defaultProps.messages
3415
+ });
3416
+ }
3423
3417
 
3424
- var _state = this.state,
3425
- now = _state.now,
3426
- formatters = objectWithoutProperties(_state, ['now']);
3418
+ return config;
3419
+ }
3420
+ }, {
3421
+ key: 'getBoundFormatFns',
3422
+ value: function getBoundFormatFns(config, state) {
3423
+ return intlFormatPropNames.reduce(function (boundFormatFns, name) {
3424
+ boundFormatFns[name] = format[name].bind(null, config, state);
3425
+ return boundFormatFns;
3426
+ }, {});
3427
+ }
3428
+ }, {
3429
+ key: 'getChildContext',
3430
+ value: function getChildContext() {
3431
+ var config = this.getConfig();
3427
3432
 
3433
+ // Bind intl factories and current config to the format functions.
3434
+ var boundFormatFns = this.getBoundFormatFns(config, this.state);
3428
3435
 
3429
- return {
3430
- intl: _extends({}, config, boundFormatFns, {
3431
- formatters: formatters,
3432
- now: now
3433
- })
3434
- };
3435
- }
3436
- }, {
3437
- key: 'shouldComponentUpdate',
3438
- value: function shouldComponentUpdate() {
3439
- for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3440
- next[_key] = arguments[_key];
3441
- }
3436
+ var _state = this.state,
3437
+ now = _state.now,
3438
+ formatters = objectWithoutProperties(_state, ['now']);
3442
3439
 
3443
- return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3444
- }
3445
- }, {
3446
- key: 'componentDidMount',
3447
- value: function componentDidMount() {
3448
- this._didDisplay = true;
3449
- }
3450
- }, {
3451
- key: 'render',
3452
- value: function render() {
3453
- return React.Children.only(this.props.children);
3454
- }
3455
- }]);
3456
- return IntlProvider;
3440
+
3441
+ return {
3442
+ intl: _extends({}, config, boundFormatFns, {
3443
+ formatters: formatters,
3444
+ now: now
3445
+ })
3446
+ };
3447
+ }
3448
+ }, {
3449
+ key: 'shouldComponentUpdate',
3450
+ value: function shouldComponentUpdate() {
3451
+ for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3452
+ next[_key] = arguments[_key];
3453
+ }
3454
+
3455
+ return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3456
+ }
3457
+ }, {
3458
+ key: 'componentDidMount',
3459
+ value: function componentDidMount() {
3460
+ this._didDisplay = true;
3461
+ }
3462
+ }, {
3463
+ key: 'render',
3464
+ value: function render() {
3465
+ return React.Children.only(this.props.children);
3466
+ }
3467
+ }]);
3468
+ return IntlProvider;
3457
3469
  }(React.Component);
3458
3470
 
3459
3471
  IntlProvider.displayName = 'IntlProvider';
3460
3472
  IntlProvider.contextTypes = {
3461
- intl: intlShape
3473
+ intl: intlShape
3462
3474
  };
3463
3475
  IntlProvider.childContextTypes = {
3464
- intl: intlShape.isRequired
3476
+ intl: intlShape.isRequired
3465
3477
  };
3466
3478
  IntlProvider.propTypes = _extends({}, intlConfigPropTypes, {
3467
- children: PropTypes.element.isRequired,
3468
- initialNow: PropTypes.any
3479
+ children: PropTypes.element.isRequired,
3480
+ initialNow: PropTypes.any
3469
3481
  });
3470
3482
 
3471
3483
  /*
@@ -3475,61 +3487,61 @@ IntlProvider.propTypes = _extends({}, intlConfigPropTypes, {
3475
3487
  */
3476
3488
 
3477
3489
  var FormattedDate = function (_Component) {
3478
- inherits(FormattedDate, _Component);
3490
+ inherits(FormattedDate, _Component);
3479
3491
 
3480
- function FormattedDate(props, context) {
3481
- classCallCheck(this, FormattedDate);
3492
+ function FormattedDate(props, context) {
3493
+ classCallCheck(this, FormattedDate);
3482
3494
 
3483
- var _this = possibleConstructorReturn(this, (FormattedDate.__proto__ || Object.getPrototypeOf(FormattedDate)).call(this, props, context));
3495
+ var _this = possibleConstructorReturn(this, (FormattedDate.__proto__ || Object.getPrototypeOf(FormattedDate)).call(this, props, context));
3484
3496
 
3485
- invariantIntlContext(context);
3486
- return _this;
3487
- }
3497
+ invariantIntlContext(context);
3498
+ return _this;
3499
+ }
3488
3500
 
3489
- createClass(FormattedDate, [{
3490
- key: 'shouldComponentUpdate',
3491
- value: function shouldComponentUpdate() {
3492
- for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3493
- next[_key] = arguments[_key];
3494
- }
3501
+ createClass(FormattedDate, [{
3502
+ key: 'shouldComponentUpdate',
3503
+ value: function shouldComponentUpdate() {
3504
+ for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3505
+ next[_key] = arguments[_key];
3506
+ }
3495
3507
 
3496
- return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3497
- }
3498
- }, {
3499
- key: 'render',
3500
- value: function render() {
3501
- var _context$intl = this.context.intl,
3502
- formatDate = _context$intl.formatDate,
3503
- Text = _context$intl.textComponent;
3504
- var _props = this.props,
3505
- value = _props.value,
3506
- children = _props.children;
3508
+ return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3509
+ }
3510
+ }, {
3511
+ key: 'render',
3512
+ value: function render() {
3513
+ var _context$intl = this.context.intl,
3514
+ formatDate = _context$intl.formatDate,
3515
+ Text = _context$intl.textComponent;
3516
+ var _props = this.props,
3517
+ value = _props.value,
3518
+ children = _props.children;
3507
3519
 
3508
3520
 
3509
- var formattedDate = formatDate(value, this.props);
3521
+ var formattedDate = formatDate(value, this.props);
3510
3522
 
3511
- if (typeof children === 'function') {
3512
- return children(formattedDate);
3513
- }
3523
+ if (typeof children === 'function') {
3524
+ return children(formattedDate);
3525
+ }
3514
3526
 
3515
- return React__default.createElement(
3516
- Text,
3517
- null,
3518
- formattedDate
3519
- );
3520
- }
3521
- }]);
3522
- return FormattedDate;
3527
+ return React__default.createElement(
3528
+ Text,
3529
+ null,
3530
+ formattedDate
3531
+ );
3532
+ }
3533
+ }]);
3534
+ return FormattedDate;
3523
3535
  }(React.Component);
3524
3536
 
3525
3537
  FormattedDate.displayName = 'FormattedDate';
3526
3538
  FormattedDate.contextTypes = {
3527
- intl: intlShape
3539
+ intl: intlShape
3528
3540
  };
3529
3541
  FormattedDate.propTypes = _extends({}, dateTimeFormatPropTypes, {
3530
- value: PropTypes.any.isRequired,
3531
- format: PropTypes.string,
3532
- children: PropTypes.func
3542
+ value: PropTypes.any.isRequired,
3543
+ format: PropTypes.string,
3544
+ children: PropTypes.func
3533
3545
  });
3534
3546
 
3535
3547
  /*
@@ -3539,61 +3551,61 @@ FormattedDate.propTypes = _extends({}, dateTimeFormatPropTypes, {
3539
3551
  */
3540
3552
 
3541
3553
  var FormattedTime = function (_Component) {
3542
- inherits(FormattedTime, _Component);
3554
+ inherits(FormattedTime, _Component);
3543
3555
 
3544
- function FormattedTime(props, context) {
3545
- classCallCheck(this, FormattedTime);
3556
+ function FormattedTime(props, context) {
3557
+ classCallCheck(this, FormattedTime);
3546
3558
 
3547
- var _this = possibleConstructorReturn(this, (FormattedTime.__proto__ || Object.getPrototypeOf(FormattedTime)).call(this, props, context));
3559
+ var _this = possibleConstructorReturn(this, (FormattedTime.__proto__ || Object.getPrototypeOf(FormattedTime)).call(this, props, context));
3548
3560
 
3549
- invariantIntlContext(context);
3550
- return _this;
3551
- }
3561
+ invariantIntlContext(context);
3562
+ return _this;
3563
+ }
3552
3564
 
3553
- createClass(FormattedTime, [{
3554
- key: 'shouldComponentUpdate',
3555
- value: function shouldComponentUpdate() {
3556
- for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3557
- next[_key] = arguments[_key];
3558
- }
3565
+ createClass(FormattedTime, [{
3566
+ key: 'shouldComponentUpdate',
3567
+ value: function shouldComponentUpdate() {
3568
+ for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3569
+ next[_key] = arguments[_key];
3570
+ }
3559
3571
 
3560
- return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3561
- }
3562
- }, {
3563
- key: 'render',
3564
- value: function render() {
3565
- var _context$intl = this.context.intl,
3566
- formatTime = _context$intl.formatTime,
3567
- Text = _context$intl.textComponent;
3568
- var _props = this.props,
3569
- value = _props.value,
3570
- children = _props.children;
3572
+ return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3573
+ }
3574
+ }, {
3575
+ key: 'render',
3576
+ value: function render() {
3577
+ var _context$intl = this.context.intl,
3578
+ formatTime = _context$intl.formatTime,
3579
+ Text = _context$intl.textComponent;
3580
+ var _props = this.props,
3581
+ value = _props.value,
3582
+ children = _props.children;
3571
3583
 
3572
3584
 
3573
- var formattedTime = formatTime(value, this.props);
3585
+ var formattedTime = formatTime(value, this.props);
3574
3586
 
3575
- if (typeof children === 'function') {
3576
- return children(formattedTime);
3577
- }
3587
+ if (typeof children === 'function') {
3588
+ return children(formattedTime);
3589
+ }
3578
3590
 
3579
- return React__default.createElement(
3580
- Text,
3581
- null,
3582
- formattedTime
3583
- );
3584
- }
3585
- }]);
3586
- return FormattedTime;
3591
+ return React__default.createElement(
3592
+ Text,
3593
+ null,
3594
+ formattedTime
3595
+ );
3596
+ }
3597
+ }]);
3598
+ return FormattedTime;
3587
3599
  }(React.Component);
3588
3600
 
3589
3601
  FormattedTime.displayName = 'FormattedTime';
3590
3602
  FormattedTime.contextTypes = {
3591
- intl: intlShape
3603
+ intl: intlShape
3592
3604
  };
3593
3605
  FormattedTime.propTypes = _extends({}, dateTimeFormatPropTypes, {
3594
- value: PropTypes.any.isRequired,
3595
- format: PropTypes.string,
3596
- children: PropTypes.func
3606
+ value: PropTypes.any.isRequired,
3607
+ format: PropTypes.string,
3608
+ children: PropTypes.func
3597
3609
  });
3598
3610
 
3599
3611
  /*
@@ -3612,179 +3624,179 @@ var DAY = 1000 * 60 * 60 * 24;
3612
3624
  var MAX_TIMER_DELAY = 2147483647;
3613
3625
 
3614
3626
  function selectUnits(delta) {
3615
- var absDelta = Math.abs(delta);
3627
+ var absDelta = Math.abs(delta);
3616
3628
 
3617
- if (absDelta < MINUTE) {
3618
- return 'second';
3619
- }
3629
+ if (absDelta < MINUTE) {
3630
+ return 'second';
3631
+ }
3620
3632
 
3621
- if (absDelta < HOUR) {
3622
- return 'minute';
3623
- }
3633
+ if (absDelta < HOUR) {
3634
+ return 'minute';
3635
+ }
3624
3636
 
3625
- if (absDelta < DAY) {
3626
- return 'hour';
3627
- }
3637
+ if (absDelta < DAY) {
3638
+ return 'hour';
3639
+ }
3628
3640
 
3629
- // The maximum scheduled delay will be measured in days since the maximum
3630
- // timer delay is less than the number of milliseconds in 25 days.
3631
- return 'day';
3641
+ // The maximum scheduled delay will be measured in days since the maximum
3642
+ // timer delay is less than the number of milliseconds in 25 days.
3643
+ return 'day';
3632
3644
  }
3633
3645
 
3634
3646
  function getUnitDelay(units) {
3635
- switch (units) {
3636
- case 'second':
3637
- return SECOND;
3638
- case 'minute':
3639
- return MINUTE;
3640
- case 'hour':
3641
- return HOUR;
3642
- case 'day':
3643
- return DAY;
3644
- default:
3645
- return MAX_TIMER_DELAY;
3646
- }
3647
+ switch (units) {
3648
+ case 'second':
3649
+ return SECOND;
3650
+ case 'minute':
3651
+ return MINUTE;
3652
+ case 'hour':
3653
+ return HOUR;
3654
+ case 'day':
3655
+ return DAY;
3656
+ default:
3657
+ return MAX_TIMER_DELAY;
3658
+ }
3647
3659
  }
3648
3660
 
3649
3661
  function isSameDate(a, b) {
3650
- if (a === b) {
3651
- return true;
3652
- }
3662
+ if (a === b) {
3663
+ return true;
3664
+ }
3653
3665
 
3654
- var aTime = new Date(a).getTime();
3655
- var bTime = new Date(b).getTime();
3666
+ var aTime = new Date(a).getTime();
3667
+ var bTime = new Date(b).getTime();
3656
3668
 
3657
- return isFinite(aTime) && isFinite(bTime) && aTime === bTime;
3669
+ return isFinite(aTime) && isFinite(bTime) && aTime === bTime;
3658
3670
  }
3659
3671
 
3660
3672
  var FormattedRelative = function (_Component) {
3661
- inherits(FormattedRelative, _Component);
3673
+ inherits(FormattedRelative, _Component);
3662
3674
 
3663
- function FormattedRelative(props, context) {
3664
- classCallCheck(this, FormattedRelative);
3675
+ function FormattedRelative(props, context) {
3676
+ classCallCheck(this, FormattedRelative);
3665
3677
 
3666
- var _this = possibleConstructorReturn(this, (FormattedRelative.__proto__ || Object.getPrototypeOf(FormattedRelative)).call(this, props, context));
3678
+ var _this = possibleConstructorReturn(this, (FormattedRelative.__proto__ || Object.getPrototypeOf(FormattedRelative)).call(this, props, context));
3667
3679
 
3668
- invariantIntlContext(context);
3680
+ invariantIntlContext(context);
3669
3681
 
3670
- var now = isFinite(props.initialNow) ? Number(props.initialNow) : context.intl.now();
3682
+ var now = isFinite(props.initialNow) ? Number(props.initialNow) : context.intl.now();
3671
3683
 
3672
- // `now` is stored as state so that `render()` remains a function of
3673
- // props + state, instead of accessing `Date.now()` inside `render()`.
3674
- _this.state = { now: now };
3675
- return _this;
3676
- }
3684
+ // `now` is stored as state so that `render()` remains a function of
3685
+ // props + state, instead of accessing `Date.now()` inside `render()`.
3686
+ _this.state = { now: now };
3687
+ return _this;
3688
+ }
3677
3689
 
3678
- createClass(FormattedRelative, [{
3679
- key: 'scheduleNextUpdate',
3680
- value: function scheduleNextUpdate(props, state) {
3681
- var _this2 = this;
3690
+ createClass(FormattedRelative, [{
3691
+ key: 'scheduleNextUpdate',
3692
+ value: function scheduleNextUpdate(props, state) {
3693
+ var _this2 = this;
3682
3694
 
3683
- // Cancel and pending update because we're scheduling a new update.
3684
- clearTimeout(this._timer);
3695
+ // Cancel and pending update because we're scheduling a new update.
3696
+ clearTimeout(this._timer);
3685
3697
 
3686
- var value = props.value,
3687
- units = props.units,
3688
- updateInterval = props.updateInterval;
3698
+ var value = props.value,
3699
+ units = props.units,
3700
+ updateInterval = props.updateInterval;
3689
3701
 
3690
- var time = new Date(value).getTime();
3702
+ var time = new Date(value).getTime();
3691
3703
 
3692
- // If the `updateInterval` is falsy, including `0` or we don't have a
3693
- // valid date, then auto updates have been turned off, so we bail and
3694
- // skip scheduling an update.
3695
- if (!updateInterval || !isFinite(time)) {
3696
- return;
3697
- }
3704
+ // If the `updateInterval` is falsy, including `0` or we don't have a
3705
+ // valid date, then auto updates have been turned off, so we bail and
3706
+ // skip scheduling an update.
3707
+ if (!updateInterval || !isFinite(time)) {
3708
+ return;
3709
+ }
3698
3710
 
3699
- var delta = time - state.now;
3700
- var unitDelay = getUnitDelay(units || selectUnits(delta));
3701
- var unitRemainder = Math.abs(delta % unitDelay);
3711
+ var delta = time - state.now;
3712
+ var unitDelay = getUnitDelay(units || selectUnits(delta));
3713
+ var unitRemainder = Math.abs(delta % unitDelay);
3702
3714
 
3703
- // We want the largest possible timer delay which will still display
3704
- // accurate information while reducing unnecessary re-renders. The delay
3705
- // should be until the next "interesting" moment, like a tick from
3706
- // "1 minute ago" to "2 minutes ago" when the delta is 120,000ms.
3707
- var delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder);
3715
+ // We want the largest possible timer delay which will still display
3716
+ // accurate information while reducing unnecessary re-renders. The delay
3717
+ // should be until the next "interesting" moment, like a tick from
3718
+ // "1 minute ago" to "2 minutes ago" when the delta is 120,000ms.
3719
+ var delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder);
3708
3720
 
3709
- this._timer = setTimeout(function () {
3710
- _this2.setState({ now: _this2.context.intl.now() });
3711
- }, delay);
3712
- }
3713
- }, {
3714
- key: 'componentDidMount',
3715
- value: function componentDidMount() {
3716
- this.scheduleNextUpdate(this.props, this.state);
3717
- }
3718
- }, {
3719
- key: 'componentWillReceiveProps',
3720
- value: function componentWillReceiveProps(_ref) {
3721
- var nextValue = _ref.value;
3722
-
3723
- // When the `props.value` date changes, `state.now` needs to be updated,
3724
- // and the next update can be rescheduled.
3725
- if (!isSameDate(nextValue, this.props.value)) {
3726
- this.setState({ now: this.context.intl.now() });
3727
- }
3728
- }
3729
- }, {
3730
- key: 'shouldComponentUpdate',
3731
- value: function shouldComponentUpdate() {
3732
- for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3733
- next[_key] = arguments[_key];
3734
- }
3721
+ this._timer = setTimeout(function () {
3722
+ _this2.setState({ now: _this2.context.intl.now() });
3723
+ }, delay);
3724
+ }
3725
+ }, {
3726
+ key: 'componentDidMount',
3727
+ value: function componentDidMount() {
3728
+ this.scheduleNextUpdate(this.props, this.state);
3729
+ }
3730
+ }, {
3731
+ key: 'componentWillReceiveProps',
3732
+ value: function componentWillReceiveProps(_ref) {
3733
+ var nextValue = _ref.value;
3734
+
3735
+ // When the `props.value` date changes, `state.now` needs to be updated,
3736
+ // and the next update can be rescheduled.
3737
+ if (!isSameDate(nextValue, this.props.value)) {
3738
+ this.setState({ now: this.context.intl.now() });
3739
+ }
3740
+ }
3741
+ }, {
3742
+ key: 'shouldComponentUpdate',
3743
+ value: function shouldComponentUpdate() {
3744
+ for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3745
+ next[_key] = arguments[_key];
3746
+ }
3735
3747
 
3736
- return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3737
- }
3738
- }, {
3739
- key: 'componentWillUpdate',
3740
- value: function componentWillUpdate(nextProps, nextState) {
3741
- this.scheduleNextUpdate(nextProps, nextState);
3742
- }
3743
- }, {
3744
- key: 'componentWillUnmount',
3745
- value: function componentWillUnmount() {
3746
- clearTimeout(this._timer);
3747
- }
3748
- }, {
3749
- key: 'render',
3750
- value: function render() {
3751
- var _context$intl = this.context.intl,
3752
- formatRelative = _context$intl.formatRelative,
3753
- Text = _context$intl.textComponent;
3754
- var _props = this.props,
3755
- value = _props.value,
3756
- children = _props.children;
3748
+ return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3749
+ }
3750
+ }, {
3751
+ key: 'componentWillUpdate',
3752
+ value: function componentWillUpdate(nextProps, nextState) {
3753
+ this.scheduleNextUpdate(nextProps, nextState);
3754
+ }
3755
+ }, {
3756
+ key: 'componentWillUnmount',
3757
+ value: function componentWillUnmount() {
3758
+ clearTimeout(this._timer);
3759
+ }
3760
+ }, {
3761
+ key: 'render',
3762
+ value: function render() {
3763
+ var _context$intl = this.context.intl,
3764
+ formatRelative = _context$intl.formatRelative,
3765
+ Text = _context$intl.textComponent;
3766
+ var _props = this.props,
3767
+ value = _props.value,
3768
+ children = _props.children;
3757
3769
 
3758
3770
 
3759
- var formattedRelative = formatRelative(value, _extends({}, this.props, this.state));
3771
+ var formattedRelative = formatRelative(value, _extends({}, this.props, this.state));
3760
3772
 
3761
- if (typeof children === 'function') {
3762
- return children(formattedRelative);
3763
- }
3773
+ if (typeof children === 'function') {
3774
+ return children(formattedRelative);
3775
+ }
3764
3776
 
3765
- return React__default.createElement(
3766
- Text,
3767
- null,
3768
- formattedRelative
3769
- );
3770
- }
3771
- }]);
3772
- return FormattedRelative;
3777
+ return React__default.createElement(
3778
+ Text,
3779
+ null,
3780
+ formattedRelative
3781
+ );
3782
+ }
3783
+ }]);
3784
+ return FormattedRelative;
3773
3785
  }(React.Component);
3774
3786
 
3775
3787
  FormattedRelative.displayName = 'FormattedRelative';
3776
3788
  FormattedRelative.contextTypes = {
3777
- intl: intlShape
3789
+ intl: intlShape
3778
3790
  };
3779
3791
  FormattedRelative.defaultProps = {
3780
- updateInterval: 1000 * 10
3792
+ updateInterval: 1000 * 10
3781
3793
  };
3782
3794
  FormattedRelative.propTypes = _extends({}, relativeFormatPropTypes, {
3783
- value: PropTypes.any.isRequired,
3784
- format: PropTypes.string,
3785
- updateInterval: PropTypes.number,
3786
- initialNow: PropTypes.any,
3787
- children: PropTypes.func
3795
+ value: PropTypes.any.isRequired,
3796
+ format: PropTypes.string,
3797
+ updateInterval: PropTypes.number,
3798
+ initialNow: PropTypes.any,
3799
+ children: PropTypes.func
3788
3800
  });
3789
3801
 
3790
3802
  /*
@@ -3794,61 +3806,61 @@ FormattedRelative.propTypes = _extends({}, relativeFormatPropTypes, {
3794
3806
  */
3795
3807
 
3796
3808
  var FormattedNumber = function (_Component) {
3797
- inherits(FormattedNumber, _Component);
3809
+ inherits(FormattedNumber, _Component);
3798
3810
 
3799
- function FormattedNumber(props, context) {
3800
- classCallCheck(this, FormattedNumber);
3811
+ function FormattedNumber(props, context) {
3812
+ classCallCheck(this, FormattedNumber);
3801
3813
 
3802
- var _this = possibleConstructorReturn(this, (FormattedNumber.__proto__ || Object.getPrototypeOf(FormattedNumber)).call(this, props, context));
3814
+ var _this = possibleConstructorReturn(this, (FormattedNumber.__proto__ || Object.getPrototypeOf(FormattedNumber)).call(this, props, context));
3803
3815
 
3804
- invariantIntlContext(context);
3805
- return _this;
3806
- }
3816
+ invariantIntlContext(context);
3817
+ return _this;
3818
+ }
3807
3819
 
3808
- createClass(FormattedNumber, [{
3809
- key: 'shouldComponentUpdate',
3810
- value: function shouldComponentUpdate() {
3811
- for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3812
- next[_key] = arguments[_key];
3813
- }
3820
+ createClass(FormattedNumber, [{
3821
+ key: 'shouldComponentUpdate',
3822
+ value: function shouldComponentUpdate() {
3823
+ for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3824
+ next[_key] = arguments[_key];
3825
+ }
3814
3826
 
3815
- return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3816
- }
3817
- }, {
3818
- key: 'render',
3819
- value: function render() {
3820
- var _context$intl = this.context.intl,
3821
- formatNumber = _context$intl.formatNumber,
3822
- Text = _context$intl.textComponent;
3823
- var _props = this.props,
3824
- value = _props.value,
3825
- children = _props.children;
3827
+ return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3828
+ }
3829
+ }, {
3830
+ key: 'render',
3831
+ value: function render() {
3832
+ var _context$intl = this.context.intl,
3833
+ formatNumber = _context$intl.formatNumber,
3834
+ Text = _context$intl.textComponent;
3835
+ var _props = this.props,
3836
+ value = _props.value,
3837
+ children = _props.children;
3826
3838
 
3827
3839
 
3828
- var formattedNumber = formatNumber(value, this.props);
3840
+ var formattedNumber = formatNumber(value, this.props);
3829
3841
 
3830
- if (typeof children === 'function') {
3831
- return children(formattedNumber);
3832
- }
3842
+ if (typeof children === 'function') {
3843
+ return children(formattedNumber);
3844
+ }
3833
3845
 
3834
- return React__default.createElement(
3835
- Text,
3836
- null,
3837
- formattedNumber
3838
- );
3839
- }
3840
- }]);
3841
- return FormattedNumber;
3846
+ return React__default.createElement(
3847
+ Text,
3848
+ null,
3849
+ formattedNumber
3850
+ );
3851
+ }
3852
+ }]);
3853
+ return FormattedNumber;
3842
3854
  }(React.Component);
3843
3855
 
3844
3856
  FormattedNumber.displayName = 'FormattedNumber';
3845
3857
  FormattedNumber.contextTypes = {
3846
- intl: intlShape
3858
+ intl: intlShape
3847
3859
  };
3848
3860
  FormattedNumber.propTypes = _extends({}, numberFormatPropTypes, {
3849
- value: PropTypes.any.isRequired,
3850
- format: PropTypes.string,
3851
- children: PropTypes.func
3861
+ value: PropTypes.any.isRequired,
3862
+ format: PropTypes.string,
3863
+ children: PropTypes.func
3852
3864
  });
3853
3865
 
3854
3866
  /*
@@ -3858,73 +3870,73 @@ FormattedNumber.propTypes = _extends({}, numberFormatPropTypes, {
3858
3870
  */
3859
3871
 
3860
3872
  var FormattedPlural = function (_Component) {
3861
- inherits(FormattedPlural, _Component);
3873
+ inherits(FormattedPlural, _Component);
3862
3874
 
3863
- function FormattedPlural(props, context) {
3864
- classCallCheck(this, FormattedPlural);
3875
+ function FormattedPlural(props, context) {
3876
+ classCallCheck(this, FormattedPlural);
3865
3877
 
3866
- var _this = possibleConstructorReturn(this, (FormattedPlural.__proto__ || Object.getPrototypeOf(FormattedPlural)).call(this, props, context));
3878
+ var _this = possibleConstructorReturn(this, (FormattedPlural.__proto__ || Object.getPrototypeOf(FormattedPlural)).call(this, props, context));
3867
3879
 
3868
- invariantIntlContext(context);
3869
- return _this;
3870
- }
3880
+ invariantIntlContext(context);
3881
+ return _this;
3882
+ }
3871
3883
 
3872
- createClass(FormattedPlural, [{
3873
- key: 'shouldComponentUpdate',
3874
- value: function shouldComponentUpdate() {
3875
- for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3876
- next[_key] = arguments[_key];
3877
- }
3884
+ createClass(FormattedPlural, [{
3885
+ key: 'shouldComponentUpdate',
3886
+ value: function shouldComponentUpdate() {
3887
+ for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
3888
+ next[_key] = arguments[_key];
3889
+ }
3878
3890
 
3879
- return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3880
- }
3881
- }, {
3882
- key: 'render',
3883
- value: function render() {
3884
- var _context$intl = this.context.intl,
3885
- formatPlural = _context$intl.formatPlural,
3886
- Text = _context$intl.textComponent;
3887
- var _props = this.props,
3888
- value = _props.value,
3889
- other = _props.other,
3890
- children = _props.children;
3891
-
3892
-
3893
- var pluralCategory = formatPlural(value, this.props);
3894
- var formattedPlural = this.props[pluralCategory] || other;
3895
-
3896
- if (typeof children === 'function') {
3897
- return children(formattedPlural);
3898
- }
3891
+ return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
3892
+ }
3893
+ }, {
3894
+ key: 'render',
3895
+ value: function render() {
3896
+ var _context$intl = this.context.intl,
3897
+ formatPlural = _context$intl.formatPlural,
3898
+ Text = _context$intl.textComponent;
3899
+ var _props = this.props,
3900
+ value = _props.value,
3901
+ other = _props.other,
3902
+ children = _props.children;
3903
+
3904
+
3905
+ var pluralCategory = formatPlural(value, this.props);
3906
+ var formattedPlural = this.props[pluralCategory] || other;
3907
+
3908
+ if (typeof children === 'function') {
3909
+ return children(formattedPlural);
3910
+ }
3899
3911
 
3900
- return React__default.createElement(
3901
- Text,
3902
- null,
3903
- formattedPlural
3904
- );
3905
- }
3906
- }]);
3907
- return FormattedPlural;
3912
+ return React__default.createElement(
3913
+ Text,
3914
+ null,
3915
+ formattedPlural
3916
+ );
3917
+ }
3918
+ }]);
3919
+ return FormattedPlural;
3908
3920
  }(React.Component);
3909
3921
 
3910
3922
  FormattedPlural.displayName = 'FormattedPlural';
3911
3923
  FormattedPlural.contextTypes = {
3912
- intl: intlShape
3924
+ intl: intlShape
3913
3925
  };
3914
3926
  FormattedPlural.defaultProps = {
3915
- style: 'cardinal'
3927
+ style: 'cardinal'
3916
3928
  };
3917
3929
  FormattedPlural.propTypes = _extends({}, pluralFormatPropTypes, {
3918
- value: PropTypes.any.isRequired,
3930
+ value: PropTypes.any.isRequired,
3919
3931
 
3920
- other: PropTypes.node.isRequired,
3921
- zero: PropTypes.node,
3922
- one: PropTypes.node,
3923
- two: PropTypes.node,
3924
- few: PropTypes.node,
3925
- many: PropTypes.node,
3932
+ other: PropTypes.node.isRequired,
3933
+ zero: PropTypes.node,
3934
+ one: PropTypes.node,
3935
+ two: PropTypes.node,
3936
+ few: PropTypes.node,
3937
+ many: PropTypes.node,
3926
3938
 
3927
- children: PropTypes.func
3939
+ children: PropTypes.func
3928
3940
  });
3929
3941
 
3930
3942
  /*
@@ -3934,142 +3946,142 @@ FormattedPlural.propTypes = _extends({}, pluralFormatPropTypes, {
3934
3946
  */
3935
3947
 
3936
3948
  var FormattedMessage = function (_Component) {
3937
- inherits(FormattedMessage, _Component);
3949
+ inherits(FormattedMessage, _Component);
3938
3950
 
3939
- function FormattedMessage(props, context) {
3940
- classCallCheck(this, FormattedMessage);
3951
+ function FormattedMessage(props, context) {
3952
+ classCallCheck(this, FormattedMessage);
3941
3953
 
3942
- var _this = possibleConstructorReturn(this, (FormattedMessage.__proto__ || Object.getPrototypeOf(FormattedMessage)).call(this, props, context));
3954
+ var _this = possibleConstructorReturn(this, (FormattedMessage.__proto__ || Object.getPrototypeOf(FormattedMessage)).call(this, props, context));
3943
3955
 
3944
- invariantIntlContext(context);
3945
- return _this;
3946
- }
3956
+ invariantIntlContext(context);
3957
+ return _this;
3958
+ }
3947
3959
 
3948
- createClass(FormattedMessage, [{
3949
- key: 'shouldComponentUpdate',
3950
- value: function shouldComponentUpdate(nextProps) {
3951
- var values = this.props.values;
3952
- var nextValues = nextProps.values;
3960
+ createClass(FormattedMessage, [{
3961
+ key: 'shouldComponentUpdate',
3962
+ value: function shouldComponentUpdate(nextProps) {
3963
+ var values = this.props.values;
3964
+ var nextValues = nextProps.values;
3953
3965
 
3954
3966
 
3955
- if (!shallowEquals(nextValues, values)) {
3956
- return true;
3957
- }
3967
+ if (!shallowEquals(nextValues, values)) {
3968
+ return true;
3969
+ }
3958
3970
 
3959
- // Since `values` has already been checked, we know they're not
3960
- // different, so the current `values` are carried over so the shallow
3961
- // equals comparison on the other props isn't affected by the `values`.
3962
- var nextPropsToCheck = _extends({}, nextProps, {
3963
- values: values
3964
- });
3971
+ // Since `values` has already been checked, we know they're not
3972
+ // different, so the current `values` are carried over so the shallow
3973
+ // equals comparison on the other props isn't affected by the `values`.
3974
+ var nextPropsToCheck = _extends({}, nextProps, {
3975
+ values: values
3976
+ });
3965
3977
 
3966
- for (var _len = arguments.length, next = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3967
- next[_key - 1] = arguments[_key];
3968
- }
3978
+ for (var _len = arguments.length, next = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3979
+ next[_key - 1] = arguments[_key];
3980
+ }
3969
3981
 
3970
- return shouldIntlComponentUpdate.apply(undefined, [this, nextPropsToCheck].concat(next));
3971
- }
3972
- }, {
3973
- key: 'render',
3974
- value: function render() {
3975
- var _context$intl = this.context.intl,
3976
- formatMessage = _context$intl.formatMessage,
3977
- Text = _context$intl.textComponent;
3978
- var _props = this.props,
3979
- id = _props.id,
3980
- description = _props.description,
3981
- defaultMessage = _props.defaultMessage,
3982
- values = _props.values,
3983
- _props$tagName = _props.tagName,
3984
- Component$$1 = _props$tagName === undefined ? Text : _props$tagName,
3985
- children = _props.children;
3986
-
3987
-
3988
- var tokenDelimiter = void 0;
3989
- var tokenizedValues = void 0;
3990
- var elements = void 0;
3991
-
3992
- var hasValues = values && Object.keys(values).length > 0;
3993
- if (hasValues) {
3994
- // Creates a token with a random UID that should not be guessable or
3995
- // conflict with other parts of the `message` string.
3996
- var uid = Math.floor(Math.random() * 0x10000000000).toString(16);
3997
-
3998
- var generateToken = function () {
3999
- var counter = 0;
4000
- return function () {
4001
- return 'ELEMENT-' + uid + '-' + (counter += 1);
4002
- };
4003
- }();
4004
-
4005
- // Splitting with a delimiter to support IE8. When using a regex
4006
- // with a capture group IE8 does not include the capture group in
4007
- // the resulting array.
4008
- tokenDelimiter = '@__' + uid + '__@';
4009
- tokenizedValues = {};
4010
- elements = {};
4011
-
4012
- // Iterates over the `props` to keep track of any React Element
4013
- // values so they can be represented by the `token` as a placeholder
4014
- // when the `message` is formatted. This allows the formatted
4015
- // message to then be broken-up into parts with references to the
4016
- // React Elements inserted back in.
4017
- Object.keys(values).forEach(function (name) {
4018
- var value = values[name];
4019
-
4020
- if (React.isValidElement(value)) {
4021
- var token = generateToken();
4022
- tokenizedValues[name] = tokenDelimiter + token + tokenDelimiter;
4023
- elements[token] = value;
4024
- } else {
4025
- tokenizedValues[name] = value;
4026
- }
4027
- });
4028
- }
3982
+ return shouldIntlComponentUpdate.apply(undefined, [this, nextPropsToCheck].concat(next));
3983
+ }
3984
+ }, {
3985
+ key: 'render',
3986
+ value: function render() {
3987
+ var _context$intl = this.context.intl,
3988
+ formatMessage = _context$intl.formatMessage,
3989
+ Text = _context$intl.textComponent;
3990
+ var _props = this.props,
3991
+ id = _props.id,
3992
+ description = _props.description,
3993
+ defaultMessage = _props.defaultMessage,
3994
+ values = _props.values,
3995
+ _props$tagName = _props.tagName,
3996
+ Component$$1 = _props$tagName === undefined ? Text : _props$tagName,
3997
+ children = _props.children;
3998
+
3999
+
4000
+ var tokenDelimiter = void 0;
4001
+ var tokenizedValues = void 0;
4002
+ var elements = void 0;
4003
+
4004
+ var hasValues = values && Object.keys(values).length > 0;
4005
+ if (hasValues) {
4006
+ // Creates a token with a random UID that should not be guessable or
4007
+ // conflict with other parts of the `message` string.
4008
+ var uid = Math.floor(Math.random() * 0x10000000000).toString(16);
4009
+
4010
+ var generateToken = function () {
4011
+ var counter = 0;
4012
+ return function () {
4013
+ return 'ELEMENT-' + uid + '-' + (counter += 1);
4014
+ };
4015
+ }();
4016
+
4017
+ // Splitting with a delimiter to support IE8. When using a regex
4018
+ // with a capture group IE8 does not include the capture group in
4019
+ // the resulting array.
4020
+ tokenDelimiter = '@__' + uid + '__@';
4021
+ tokenizedValues = {};
4022
+ elements = {};
4023
+
4024
+ // Iterates over the `props` to keep track of any React Element
4025
+ // values so they can be represented by the `token` as a placeholder
4026
+ // when the `message` is formatted. This allows the formatted
4027
+ // message to then be broken-up into parts with references to the
4028
+ // React Elements inserted back in.
4029
+ Object.keys(values).forEach(function (name) {
4030
+ var value = values[name];
4031
+
4032
+ if (React.isValidElement(value)) {
4033
+ var token = generateToken();
4034
+ tokenizedValues[name] = tokenDelimiter + token + tokenDelimiter;
4035
+ elements[token] = value;
4036
+ } else {
4037
+ tokenizedValues[name] = value;
4038
+ }
4039
+ });
4040
+ }
4029
4041
 
4030
- var descriptor = { id: id, description: description, defaultMessage: defaultMessage };
4031
- var formattedMessage = formatMessage(descriptor, tokenizedValues || values);
4032
-
4033
- var nodes = void 0;
4034
-
4035
- var hasElements = elements && Object.keys(elements).length > 0;
4036
- if (hasElements) {
4037
- // Split the message into parts so the React Element values captured
4038
- // above can be inserted back into the rendered message. This
4039
- // approach allows messages to render with React Elements while
4040
- // keeping React's virtual diffing working properly.
4041
- nodes = formattedMessage.split(tokenDelimiter).filter(function (part) {
4042
- return !!part;
4043
- }).map(function (part) {
4044
- return elements[part] || part;
4045
- });
4046
- } else {
4047
- nodes = [formattedMessage];
4048
- }
4042
+ var descriptor = { id: id, description: description, defaultMessage: defaultMessage };
4043
+ var formattedMessage = formatMessage(descriptor, tokenizedValues || values);
4044
+
4045
+ var nodes = void 0;
4046
+
4047
+ var hasElements = elements && Object.keys(elements).length > 0;
4048
+ if (hasElements) {
4049
+ // Split the message into parts so the React Element values captured
4050
+ // above can be inserted back into the rendered message. This
4051
+ // approach allows messages to render with React Elements while
4052
+ // keeping React's virtual diffing working properly.
4053
+ nodes = formattedMessage.split(tokenDelimiter).filter(function (part) {
4054
+ return !!part;
4055
+ }).map(function (part) {
4056
+ return elements[part] || part;
4057
+ });
4058
+ } else {
4059
+ nodes = [formattedMessage];
4060
+ }
4049
4061
 
4050
- if (typeof children === 'function') {
4051
- return children.apply(undefined, toConsumableArray(nodes));
4052
- }
4062
+ if (typeof children === 'function') {
4063
+ return children.apply(undefined, toConsumableArray(nodes));
4064
+ }
4053
4065
 
4054
- // Needs to use `createElement()` instead of JSX, otherwise React will
4055
- // warn about a missing `key` prop with rich-text message formatting.
4056
- return React.createElement.apply(undefined, [Component$$1, null].concat(toConsumableArray(nodes)));
4057
- }
4058
- }]);
4059
- return FormattedMessage;
4066
+ // Needs to use `createElement()` instead of JSX, otherwise React will
4067
+ // warn about a missing `key` prop with rich-text message formatting.
4068
+ return React.createElement.apply(undefined, [Component$$1, null].concat(toConsumableArray(nodes)));
4069
+ }
4070
+ }]);
4071
+ return FormattedMessage;
4060
4072
  }(React.Component);
4061
4073
 
4062
4074
  FormattedMessage.displayName = 'FormattedMessage';
4063
4075
  FormattedMessage.contextTypes = {
4064
- intl: intlShape
4076
+ intl: intlShape
4065
4077
  };
4066
4078
  FormattedMessage.defaultProps = {
4067
- values: {}
4079
+ values: {}
4068
4080
  };
4069
4081
  FormattedMessage.propTypes = _extends({}, messageDescriptorPropTypes, {
4070
- values: PropTypes.object,
4071
- tagName: PropTypes.string,
4072
- children: PropTypes.func
4082
+ values: PropTypes.object,
4083
+ tagName: PropTypes.string,
4084
+ children: PropTypes.func
4073
4085
  });
4074
4086
 
4075
4087
  /*
@@ -4079,90 +4091,90 @@ FormattedMessage.propTypes = _extends({}, messageDescriptorPropTypes, {
4079
4091
  */
4080
4092
 
4081
4093
  var FormattedHTMLMessage = function (_Component) {
4082
- inherits(FormattedHTMLMessage, _Component);
4094
+ inherits(FormattedHTMLMessage, _Component);
4083
4095
 
4084
- function FormattedHTMLMessage(props, context) {
4085
- classCallCheck(this, FormattedHTMLMessage);
4096
+ function FormattedHTMLMessage(props, context) {
4097
+ classCallCheck(this, FormattedHTMLMessage);
4086
4098
 
4087
- var _this = possibleConstructorReturn(this, (FormattedHTMLMessage.__proto__ || Object.getPrototypeOf(FormattedHTMLMessage)).call(this, props, context));
4099
+ var _this = possibleConstructorReturn(this, (FormattedHTMLMessage.__proto__ || Object.getPrototypeOf(FormattedHTMLMessage)).call(this, props, context));
4088
4100
 
4089
- invariantIntlContext(context);
4090
- return _this;
4091
- }
4101
+ invariantIntlContext(context);
4102
+ return _this;
4103
+ }
4092
4104
 
4093
- createClass(FormattedHTMLMessage, [{
4094
- key: 'shouldComponentUpdate',
4095
- value: function shouldComponentUpdate(nextProps) {
4096
- var values = this.props.values;
4097
- var nextValues = nextProps.values;
4105
+ createClass(FormattedHTMLMessage, [{
4106
+ key: 'shouldComponentUpdate',
4107
+ value: function shouldComponentUpdate(nextProps) {
4108
+ var values = this.props.values;
4109
+ var nextValues = nextProps.values;
4098
4110
 
4099
4111
 
4100
- if (!shallowEquals(nextValues, values)) {
4101
- return true;
4102
- }
4112
+ if (!shallowEquals(nextValues, values)) {
4113
+ return true;
4114
+ }
4103
4115
 
4104
- // Since `values` has already been checked, we know they're not
4105
- // different, so the current `values` are carried over so the shallow
4106
- // equals comparison on the other props isn't affected by the `values`.
4107
- var nextPropsToCheck = _extends({}, nextProps, {
4108
- values: values
4109
- });
4116
+ // Since `values` has already been checked, we know they're not
4117
+ // different, so the current `values` are carried over so the shallow
4118
+ // equals comparison on the other props isn't affected by the `values`.
4119
+ var nextPropsToCheck = _extends({}, nextProps, {
4120
+ values: values
4121
+ });
4110
4122
 
4111
- for (var _len = arguments.length, next = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4112
- next[_key - 1] = arguments[_key];
4113
- }
4123
+ for (var _len = arguments.length, next = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4124
+ next[_key - 1] = arguments[_key];
4125
+ }
4114
4126
 
4115
- return shouldIntlComponentUpdate.apply(undefined, [this, nextPropsToCheck].concat(next));
4116
- }
4117
- }, {
4118
- key: 'render',
4119
- value: function render() {
4120
- var _context$intl = this.context.intl,
4121
- formatHTMLMessage = _context$intl.formatHTMLMessage,
4122
- Text = _context$intl.textComponent;
4123
- var _props = this.props,
4124
- id = _props.id,
4125
- description = _props.description,
4126
- defaultMessage = _props.defaultMessage,
4127
- rawValues = _props.values,
4128
- _props$tagName = _props.tagName,
4129
- Component$$1 = _props$tagName === undefined ? Text : _props$tagName,
4130
- children = _props.children;
4131
-
4132
-
4133
- var descriptor = { id: id, description: description, defaultMessage: defaultMessage };
4134
- var formattedHTMLMessage = formatHTMLMessage(descriptor, rawValues);
4135
-
4136
- if (typeof children === 'function') {
4137
- return children(formattedHTMLMessage);
4138
- }
4127
+ return shouldIntlComponentUpdate.apply(undefined, [this, nextPropsToCheck].concat(next));
4128
+ }
4129
+ }, {
4130
+ key: 'render',
4131
+ value: function render() {
4132
+ var _context$intl = this.context.intl,
4133
+ formatHTMLMessage = _context$intl.formatHTMLMessage,
4134
+ Text = _context$intl.textComponent;
4135
+ var _props = this.props,
4136
+ id = _props.id,
4137
+ description = _props.description,
4138
+ defaultMessage = _props.defaultMessage,
4139
+ rawValues = _props.values,
4140
+ _props$tagName = _props.tagName,
4141
+ Component$$1 = _props$tagName === undefined ? Text : _props$tagName,
4142
+ children = _props.children;
4143
+
4144
+
4145
+ var descriptor = { id: id, description: description, defaultMessage: defaultMessage };
4146
+ var formattedHTMLMessage = formatHTMLMessage(descriptor, rawValues);
4147
+
4148
+ if (typeof children === 'function') {
4149
+ return children(formattedHTMLMessage);
4150
+ }
4139
4151
 
4140
- // Since the message presumably has HTML in it, we need to set
4141
- // `innerHTML` in order for it to be rendered and not escaped by React.
4142
- // To be safe, all string prop values were escaped when formatting the
4143
- // message. It is assumed that the message is not UGC, and came from the
4144
- // developer making it more like a template.
4145
- //
4146
- // Note: There's a perf impact of using this component since there's no
4147
- // way for React to do its virtual DOM diffing.
4148
- var html = { __html: formattedHTMLMessage };
4149
- return React__default.createElement(Component$$1, { dangerouslySetInnerHTML: html });
4150
- }
4151
- }]);
4152
- return FormattedHTMLMessage;
4152
+ // Since the message presumably has HTML in it, we need to set
4153
+ // `innerHTML` in order for it to be rendered and not escaped by React.
4154
+ // To be safe, all string prop values were escaped when formatting the
4155
+ // message. It is assumed that the message is not UGC, and came from the
4156
+ // developer making it more like a template.
4157
+ //
4158
+ // Note: There's a perf impact of using this component since there's no
4159
+ // way for React to do its virtual DOM diffing.
4160
+ var html = { __html: formattedHTMLMessage };
4161
+ return React__default.createElement(Component$$1, { dangerouslySetInnerHTML: html });
4162
+ }
4163
+ }]);
4164
+ return FormattedHTMLMessage;
4153
4165
  }(React.Component);
4154
4166
 
4155
4167
  FormattedHTMLMessage.displayName = 'FormattedHTMLMessage';
4156
4168
  FormattedHTMLMessage.contextTypes = {
4157
- intl: intlShape
4169
+ intl: intlShape
4158
4170
  };
4159
4171
  FormattedHTMLMessage.defaultProps = {
4160
- values: {}
4172
+ values: {}
4161
4173
  };
4162
4174
  FormattedHTMLMessage.propTypes = _extends({}, messageDescriptorPropTypes, {
4163
- values: PropTypes.object,
4164
- tagName: PropTypes.string,
4165
- children: PropTypes.func
4175
+ values: PropTypes.object,
4176
+ tagName: PropTypes.string,
4177
+ children: PropTypes.func
4166
4178
  });
4167
4179
 
4168
4180
  /*