@gravity-ui/navigation 1.1.3 → 1.3.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 (120) hide show
  1. package/README.md +28 -1
  2. package/build/cjs/ActionBar-393db3ea.js +62 -0
  3. package/build/cjs/ActionBar-393db3ea.js.map +1 -0
  4. package/build/cjs/AsideHeader.js +50 -0
  5. package/build/cjs/AsideHeader.js.map +1 -0
  6. package/build/cjs/AsideHeaderContext.js +41 -0
  7. package/build/cjs/AsideHeaderContext.js.map +1 -0
  8. package/build/cjs/Content-64d5738a.js +20 -0
  9. package/build/cjs/Content-64d5738a.js.map +1 -0
  10. package/build/cjs/Drawer.js +3091 -0
  11. package/build/cjs/Drawer.js.map +1 -0
  12. package/build/cjs/FooterItem-01b32eb7.js +286 -0
  13. package/build/cjs/FooterItem-01b32eb7.js.map +1 -0
  14. package/build/cjs/FooterItem.js +30 -0
  15. package/build/cjs/FooterItem.js.map +1 -0
  16. package/build/cjs/HotkeysPanel-9e5af200.js +66 -0
  17. package/build/cjs/HotkeysPanel-9e5af200.js.map +1 -0
  18. package/build/cjs/Item-ff00938b.js +294 -0
  19. package/build/cjs/Item-ff00938b.js.map +1 -0
  20. package/build/cjs/PageLayout.js +36 -0
  21. package/build/cjs/PageLayout.js.map +1 -0
  22. package/build/cjs/PageLayoutAside.js +967 -0
  23. package/build/cjs/PageLayoutAside.js.map +1 -0
  24. package/build/cjs/Settings-014971f7.js +489 -0
  25. package/build/cjs/Settings-014971f7.js.map +1 -0
  26. package/build/cjs/Title-d58ff158.js +41 -0
  27. package/build/cjs/Title-d58ff158.js.map +1 -0
  28. package/build/cjs/components/AsideHeader/AsideHeader.d.ts +15 -1
  29. package/build/cjs/components/AsideHeader/AsideHeaderContext.d.ts +1 -2
  30. package/build/cjs/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +1 -0
  31. package/build/cjs/components/AsideHeader/components/PageLayout/PageLayout.d.ts +11 -0
  32. package/build/cjs/components/AsideHeader/components/PageLayout/PageLayoutAside.d.ts +5 -0
  33. package/build/cjs/components/AsideHeader/types.d.ts +8 -3
  34. package/build/cjs/components/CompositeBar/utils.d.ts +1 -1
  35. package/build/cjs/components/Content/Content.d.ts +1 -2
  36. package/build/cjs/components/index.d.ts +2 -0
  37. package/build/cjs/constants-9783dc2d.js +10 -0
  38. package/build/cjs/constants-9783dc2d.js.map +1 -0
  39. package/build/cjs/debounce-8772fd80.js +545 -0
  40. package/build/cjs/debounce-8772fd80.js.map +1 -0
  41. package/build/cjs/index.js +47 -6036
  42. package/build/cjs/index.js.map +1 -1
  43. package/build/cjs/index2.js +13 -0
  44. package/build/cjs/index2.js.map +1 -0
  45. package/build/cjs/index3.js +16 -0
  46. package/build/cjs/index3.js.map +1 -0
  47. package/build/cjs/index4.js +17 -0
  48. package/build/cjs/index4.js.map +1 -0
  49. package/build/cjs/index5.js +20 -0
  50. package/build/cjs/index5.js.map +1 -0
  51. package/build/cjs/index6.js +19 -0
  52. package/build/cjs/index6.js.map +1 -0
  53. package/build/cjs/registerKeyset-f4ce9ee7.js +215 -0
  54. package/build/cjs/registerKeyset-f4ce9ee7.js.map +1 -0
  55. package/build/cjs/style-inject.es-935afc04.js +38 -0
  56. package/build/cjs/style-inject.es-935afc04.js.map +1 -0
  57. package/build/cjs/tslib.es6-705c6589.js +36 -0
  58. package/build/cjs/tslib.es6-705c6589.js.map +1 -0
  59. package/build/cjs/utils-e82025ce.js +8 -0
  60. package/build/cjs/utils-e82025ce.js.map +1 -0
  61. package/build/esm/ActionBar-f1c9a2d3.js +56 -0
  62. package/build/esm/ActionBar-f1c9a2d3.js.map +1 -0
  63. package/build/esm/AsideHeader.js +42 -0
  64. package/build/esm/AsideHeader.js.map +1 -0
  65. package/build/esm/AsideHeaderContext.js +28 -0
  66. package/build/esm/AsideHeaderContext.js.map +1 -0
  67. package/build/esm/Content-f94ba85d.js +14 -0
  68. package/build/esm/Content-f94ba85d.js.map +1 -0
  69. package/build/esm/Drawer.js +3081 -0
  70. package/build/esm/Drawer.js.map +1 -0
  71. package/build/esm/FooterItem-d66ab545.js +279 -0
  72. package/build/esm/FooterItem-d66ab545.js.map +1 -0
  73. package/build/esm/FooterItem.js +22 -0
  74. package/build/esm/FooterItem.js.map +1 -0
  75. package/build/esm/HotkeysPanel-67f3066d.js +60 -0
  76. package/build/esm/HotkeysPanel-67f3066d.js.map +1 -0
  77. package/build/esm/Item-30c88899.js +280 -0
  78. package/build/esm/Item-30c88899.js.map +1 -0
  79. package/build/esm/PageLayout.js +28 -0
  80. package/build/esm/PageLayout.js.map +1 -0
  81. package/build/esm/PageLayoutAside.js +941 -0
  82. package/build/esm/PageLayoutAside.js.map +1 -0
  83. package/build/esm/Settings-ea96388d.js +464 -0
  84. package/build/esm/Settings-ea96388d.js.map +1 -0
  85. package/build/esm/Title-3d579ca4.js +35 -0
  86. package/build/esm/Title-3d579ca4.js.map +1 -0
  87. package/build/esm/components/AsideHeader/AsideHeader.d.ts +15 -1
  88. package/build/esm/components/AsideHeader/AsideHeaderContext.d.ts +1 -2
  89. package/build/esm/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +1 -0
  90. package/build/esm/components/AsideHeader/components/PageLayout/PageLayout.d.ts +11 -0
  91. package/build/esm/components/AsideHeader/components/PageLayout/PageLayoutAside.d.ts +5 -0
  92. package/build/esm/components/AsideHeader/types.d.ts +8 -3
  93. package/build/esm/components/CompositeBar/utils.d.ts +1 -1
  94. package/build/esm/components/Content/Content.d.ts +1 -2
  95. package/build/esm/components/index.d.ts +2 -0
  96. package/build/esm/constants-b3a73cd1.js +6 -0
  97. package/build/esm/constants-b3a73cd1.js.map +1 -0
  98. package/build/esm/debounce-64cd2b4c.js +543 -0
  99. package/build/esm/debounce-64cd2b4c.js.map +1 -0
  100. package/build/esm/index.js +24 -6000
  101. package/build/esm/index.js.map +1 -1
  102. package/build/esm/index2.js +5 -0
  103. package/build/esm/index2.js.map +1 -0
  104. package/build/esm/index3.js +8 -0
  105. package/build/esm/index3.js.map +1 -0
  106. package/build/esm/index4.js +9 -0
  107. package/build/esm/index4.js.map +1 -0
  108. package/build/esm/index5.js +11 -0
  109. package/build/esm/index5.js.map +1 -0
  110. package/build/esm/index6.js +10 -0
  111. package/build/esm/index6.js.map +1 -0
  112. package/build/esm/registerKeyset-35f1ea08.js +212 -0
  113. package/build/esm/registerKeyset-35f1ea08.js.map +1 -0
  114. package/build/esm/style-inject.es-cfd97593.js +35 -0
  115. package/build/esm/style-inject.es-cfd97593.js.map +1 -0
  116. package/build/esm/tslib.es6-3cd4e99f.js +34 -0
  117. package/build/esm/tslib.es6-3cd4e99f.js.map +1 -0
  118. package/build/esm/utils-cc9b1968.js +6 -0
  119. package/build/esm/utils-cc9b1968.js.map +1 -0
  120. package/package.json +3 -3
@@ -0,0 +1,3081 @@
1
+ import React__default, { Children, isValidElement, cloneElement } from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import { useBodyScrollLock } from '@gravity-ui/uikit';
4
+ import { s as styleInject, b as block } from './style-inject.es-cfd97593.js';
5
+ import '@bem-react/classname';
6
+
7
+ function _extends() {
8
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
9
+ for (var i = 1; i < arguments.length; i++) {
10
+ var source = arguments[i];
11
+ for (var key in source) {
12
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
13
+ target[key] = source[key];
14
+ }
15
+ }
16
+ }
17
+ return target;
18
+ };
19
+ return _extends.apply(this, arguments);
20
+ }
21
+
22
+ function _objectWithoutPropertiesLoose(source, excluded) {
23
+ if (source == null) return {};
24
+ var target = {};
25
+ var sourceKeys = Object.keys(source);
26
+ var key, i;
27
+ for (i = 0; i < sourceKeys.length; i++) {
28
+ key = sourceKeys[i];
29
+ if (excluded.indexOf(key) >= 0) continue;
30
+ target[key] = source[key];
31
+ }
32
+ return target;
33
+ }
34
+
35
+ function _setPrototypeOf(o, p) {
36
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
37
+ o.__proto__ = p;
38
+ return o;
39
+ };
40
+ return _setPrototypeOf(o, p);
41
+ }
42
+
43
+ function _inheritsLoose(subClass, superClass) {
44
+ subClass.prototype = Object.create(superClass.prototype);
45
+ subClass.prototype.constructor = subClass;
46
+ _setPrototypeOf(subClass, superClass);
47
+ }
48
+
49
+ var propTypes = {exports: {}};
50
+
51
+ var reactIs = {exports: {}};
52
+
53
+ var reactIs_production_min = {};
54
+
55
+ /** @license React v16.13.1
56
+ * react-is.production.min.js
57
+ *
58
+ * Copyright (c) Facebook, Inc. and its affiliates.
59
+ *
60
+ * This source code is licensed under the MIT license found in the
61
+ * LICENSE file in the root directory of this source tree.
62
+ */
63
+
64
+ var hasRequiredReactIs_production_min;
65
+
66
+ function requireReactIs_production_min () {
67
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
68
+ hasRequiredReactIs_production_min = 1;
69
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
70
+ Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
71
+ function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
72
+ reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
73
+ reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
74
+ reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
75
+ return reactIs_production_min;
76
+ }
77
+
78
+ var reactIs_development = {};
79
+
80
+ /** @license React v16.13.1
81
+ * react-is.development.js
82
+ *
83
+ * Copyright (c) Facebook, Inc. and its affiliates.
84
+ *
85
+ * This source code is licensed under the MIT license found in the
86
+ * LICENSE file in the root directory of this source tree.
87
+ */
88
+
89
+ var hasRequiredReactIs_development;
90
+
91
+ function requireReactIs_development () {
92
+ if (hasRequiredReactIs_development) return reactIs_development;
93
+ hasRequiredReactIs_development = 1;
94
+
95
+
96
+
97
+ if (process.env.NODE_ENV !== "production") {
98
+ (function() {
99
+
100
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
101
+ // nor polyfill, then a plain number is used for performance.
102
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
103
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
104
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
105
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
106
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
107
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
108
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
109
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
110
+ // (unstable) APIs that have been removed. Can we remove the symbols?
111
+
112
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
113
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
114
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
115
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
116
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
117
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
118
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
119
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
120
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
121
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
122
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
123
+
124
+ function isValidElementType(type) {
125
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
126
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
127
+ }
128
+
129
+ function typeOf(object) {
130
+ if (typeof object === 'object' && object !== null) {
131
+ var $$typeof = object.$$typeof;
132
+
133
+ switch ($$typeof) {
134
+ case REACT_ELEMENT_TYPE:
135
+ var type = object.type;
136
+
137
+ switch (type) {
138
+ case REACT_ASYNC_MODE_TYPE:
139
+ case REACT_CONCURRENT_MODE_TYPE:
140
+ case REACT_FRAGMENT_TYPE:
141
+ case REACT_PROFILER_TYPE:
142
+ case REACT_STRICT_MODE_TYPE:
143
+ case REACT_SUSPENSE_TYPE:
144
+ return type;
145
+
146
+ default:
147
+ var $$typeofType = type && type.$$typeof;
148
+
149
+ switch ($$typeofType) {
150
+ case REACT_CONTEXT_TYPE:
151
+ case REACT_FORWARD_REF_TYPE:
152
+ case REACT_LAZY_TYPE:
153
+ case REACT_MEMO_TYPE:
154
+ case REACT_PROVIDER_TYPE:
155
+ return $$typeofType;
156
+
157
+ default:
158
+ return $$typeof;
159
+ }
160
+
161
+ }
162
+
163
+ case REACT_PORTAL_TYPE:
164
+ return $$typeof;
165
+ }
166
+ }
167
+
168
+ return undefined;
169
+ } // AsyncMode is deprecated along with isAsyncMode
170
+
171
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
172
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
173
+ var ContextConsumer = REACT_CONTEXT_TYPE;
174
+ var ContextProvider = REACT_PROVIDER_TYPE;
175
+ var Element = REACT_ELEMENT_TYPE;
176
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
177
+ var Fragment = REACT_FRAGMENT_TYPE;
178
+ var Lazy = REACT_LAZY_TYPE;
179
+ var Memo = REACT_MEMO_TYPE;
180
+ var Portal = REACT_PORTAL_TYPE;
181
+ var Profiler = REACT_PROFILER_TYPE;
182
+ var StrictMode = REACT_STRICT_MODE_TYPE;
183
+ var Suspense = REACT_SUSPENSE_TYPE;
184
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
185
+
186
+ function isAsyncMode(object) {
187
+ {
188
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
189
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
190
+
191
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
192
+ }
193
+ }
194
+
195
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
196
+ }
197
+ function isConcurrentMode(object) {
198
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
199
+ }
200
+ function isContextConsumer(object) {
201
+ return typeOf(object) === REACT_CONTEXT_TYPE;
202
+ }
203
+ function isContextProvider(object) {
204
+ return typeOf(object) === REACT_PROVIDER_TYPE;
205
+ }
206
+ function isElement(object) {
207
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
208
+ }
209
+ function isForwardRef(object) {
210
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
211
+ }
212
+ function isFragment(object) {
213
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
214
+ }
215
+ function isLazy(object) {
216
+ return typeOf(object) === REACT_LAZY_TYPE;
217
+ }
218
+ function isMemo(object) {
219
+ return typeOf(object) === REACT_MEMO_TYPE;
220
+ }
221
+ function isPortal(object) {
222
+ return typeOf(object) === REACT_PORTAL_TYPE;
223
+ }
224
+ function isProfiler(object) {
225
+ return typeOf(object) === REACT_PROFILER_TYPE;
226
+ }
227
+ function isStrictMode(object) {
228
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
229
+ }
230
+ function isSuspense(object) {
231
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
232
+ }
233
+
234
+ reactIs_development.AsyncMode = AsyncMode;
235
+ reactIs_development.ConcurrentMode = ConcurrentMode;
236
+ reactIs_development.ContextConsumer = ContextConsumer;
237
+ reactIs_development.ContextProvider = ContextProvider;
238
+ reactIs_development.Element = Element;
239
+ reactIs_development.ForwardRef = ForwardRef;
240
+ reactIs_development.Fragment = Fragment;
241
+ reactIs_development.Lazy = Lazy;
242
+ reactIs_development.Memo = Memo;
243
+ reactIs_development.Portal = Portal;
244
+ reactIs_development.Profiler = Profiler;
245
+ reactIs_development.StrictMode = StrictMode;
246
+ reactIs_development.Suspense = Suspense;
247
+ reactIs_development.isAsyncMode = isAsyncMode;
248
+ reactIs_development.isConcurrentMode = isConcurrentMode;
249
+ reactIs_development.isContextConsumer = isContextConsumer;
250
+ reactIs_development.isContextProvider = isContextProvider;
251
+ reactIs_development.isElement = isElement;
252
+ reactIs_development.isForwardRef = isForwardRef;
253
+ reactIs_development.isFragment = isFragment;
254
+ reactIs_development.isLazy = isLazy;
255
+ reactIs_development.isMemo = isMemo;
256
+ reactIs_development.isPortal = isPortal;
257
+ reactIs_development.isProfiler = isProfiler;
258
+ reactIs_development.isStrictMode = isStrictMode;
259
+ reactIs_development.isSuspense = isSuspense;
260
+ reactIs_development.isValidElementType = isValidElementType;
261
+ reactIs_development.typeOf = typeOf;
262
+ })();
263
+ }
264
+ return reactIs_development;
265
+ }
266
+
267
+ var hasRequiredReactIs;
268
+
269
+ function requireReactIs () {
270
+ if (hasRequiredReactIs) return reactIs.exports;
271
+ hasRequiredReactIs = 1;
272
+ (function (module) {
273
+
274
+ if (process.env.NODE_ENV === 'production') {
275
+ module.exports = requireReactIs_production_min();
276
+ } else {
277
+ module.exports = requireReactIs_development();
278
+ }
279
+ } (reactIs));
280
+ return reactIs.exports;
281
+ }
282
+
283
+ /*
284
+ object-assign
285
+ (c) Sindre Sorhus
286
+ @license MIT
287
+ */
288
+
289
+ var objectAssign;
290
+ var hasRequiredObjectAssign;
291
+
292
+ function requireObjectAssign () {
293
+ if (hasRequiredObjectAssign) return objectAssign;
294
+ hasRequiredObjectAssign = 1;
295
+ /* eslint-disable no-unused-vars */
296
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
297
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
298
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
299
+
300
+ function toObject(val) {
301
+ if (val === null || val === undefined) {
302
+ throw new TypeError('Object.assign cannot be called with null or undefined');
303
+ }
304
+
305
+ return Object(val);
306
+ }
307
+
308
+ function shouldUseNative() {
309
+ try {
310
+ if (!Object.assign) {
311
+ return false;
312
+ }
313
+
314
+ // Detect buggy property enumeration order in older V8 versions.
315
+
316
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
317
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
318
+ test1[5] = 'de';
319
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
320
+ return false;
321
+ }
322
+
323
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
324
+ var test2 = {};
325
+ for (var i = 0; i < 10; i++) {
326
+ test2['_' + String.fromCharCode(i)] = i;
327
+ }
328
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
329
+ return test2[n];
330
+ });
331
+ if (order2.join('') !== '0123456789') {
332
+ return false;
333
+ }
334
+
335
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
336
+ var test3 = {};
337
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
338
+ test3[letter] = letter;
339
+ });
340
+ if (Object.keys(Object.assign({}, test3)).join('') !==
341
+ 'abcdefghijklmnopqrst') {
342
+ return false;
343
+ }
344
+
345
+ return true;
346
+ } catch (err) {
347
+ // We don't expect any of the above to throw, but better to be safe.
348
+ return false;
349
+ }
350
+ }
351
+
352
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
353
+ var from;
354
+ var to = toObject(target);
355
+ var symbols;
356
+
357
+ for (var s = 1; s < arguments.length; s++) {
358
+ from = Object(arguments[s]);
359
+
360
+ for (var key in from) {
361
+ if (hasOwnProperty.call(from, key)) {
362
+ to[key] = from[key];
363
+ }
364
+ }
365
+
366
+ if (getOwnPropertySymbols) {
367
+ symbols = getOwnPropertySymbols(from);
368
+ for (var i = 0; i < symbols.length; i++) {
369
+ if (propIsEnumerable.call(from, symbols[i])) {
370
+ to[symbols[i]] = from[symbols[i]];
371
+ }
372
+ }
373
+ }
374
+ }
375
+
376
+ return to;
377
+ };
378
+ return objectAssign;
379
+ }
380
+
381
+ /**
382
+ * Copyright (c) 2013-present, Facebook, Inc.
383
+ *
384
+ * This source code is licensed under the MIT license found in the
385
+ * LICENSE file in the root directory of this source tree.
386
+ */
387
+
388
+ var ReactPropTypesSecret_1;
389
+ var hasRequiredReactPropTypesSecret;
390
+
391
+ function requireReactPropTypesSecret () {
392
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
393
+ hasRequiredReactPropTypesSecret = 1;
394
+
395
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
396
+
397
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
398
+ return ReactPropTypesSecret_1;
399
+ }
400
+
401
+ var has;
402
+ var hasRequiredHas;
403
+
404
+ function requireHas () {
405
+ if (hasRequiredHas) return has;
406
+ hasRequiredHas = 1;
407
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
408
+ return has;
409
+ }
410
+
411
+ /**
412
+ * Copyright (c) 2013-present, Facebook, Inc.
413
+ *
414
+ * This source code is licensed under the MIT license found in the
415
+ * LICENSE file in the root directory of this source tree.
416
+ */
417
+
418
+ var checkPropTypes_1;
419
+ var hasRequiredCheckPropTypes;
420
+
421
+ function requireCheckPropTypes () {
422
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
423
+ hasRequiredCheckPropTypes = 1;
424
+
425
+ var printWarning = function() {};
426
+
427
+ if (process.env.NODE_ENV !== 'production') {
428
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
429
+ var loggedTypeFailures = {};
430
+ var has = requireHas();
431
+
432
+ printWarning = function(text) {
433
+ var message = 'Warning: ' + text;
434
+ if (typeof console !== 'undefined') {
435
+ console.error(message);
436
+ }
437
+ try {
438
+ // --- Welcome to debugging React ---
439
+ // This error was thrown as a convenience so that you can use this stack
440
+ // to find the callsite that caused this warning to fire.
441
+ throw new Error(message);
442
+ } catch (x) { /**/ }
443
+ };
444
+ }
445
+
446
+ /**
447
+ * Assert that the values match with the type specs.
448
+ * Error messages are memorized and will only be shown once.
449
+ *
450
+ * @param {object} typeSpecs Map of name to a ReactPropType
451
+ * @param {object} values Runtime values that need to be type-checked
452
+ * @param {string} location e.g. "prop", "context", "child context"
453
+ * @param {string} componentName Name of the component for error messages.
454
+ * @param {?Function} getStack Returns the component stack.
455
+ * @private
456
+ */
457
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
458
+ if (process.env.NODE_ENV !== 'production') {
459
+ for (var typeSpecName in typeSpecs) {
460
+ if (has(typeSpecs, typeSpecName)) {
461
+ var error;
462
+ // Prop type validation may throw. In case they do, we don't want to
463
+ // fail the render phase where it didn't fail before. So we log it.
464
+ // After these have been cleaned up, we'll let them throw.
465
+ try {
466
+ // This is intentionally an invariant that gets caught. It's the same
467
+ // behavior as without this statement except with a better message.
468
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
469
+ var err = Error(
470
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
471
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
472
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
473
+ );
474
+ err.name = 'Invariant Violation';
475
+ throw err;
476
+ }
477
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
478
+ } catch (ex) {
479
+ error = ex;
480
+ }
481
+ if (error && !(error instanceof Error)) {
482
+ printWarning(
483
+ (componentName || 'React class') + ': type specification of ' +
484
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
485
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
486
+ 'You may have forgotten to pass an argument to the type checker ' +
487
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
488
+ 'shape all require an argument).'
489
+ );
490
+ }
491
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
492
+ // Only monitor this failure once because there tends to be a lot of the
493
+ // same error.
494
+ loggedTypeFailures[error.message] = true;
495
+
496
+ var stack = getStack ? getStack() : '';
497
+
498
+ printWarning(
499
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
500
+ );
501
+ }
502
+ }
503
+ }
504
+ }
505
+ }
506
+
507
+ /**
508
+ * Resets warning cache when testing.
509
+ *
510
+ * @private
511
+ */
512
+ checkPropTypes.resetWarningCache = function() {
513
+ if (process.env.NODE_ENV !== 'production') {
514
+ loggedTypeFailures = {};
515
+ }
516
+ };
517
+
518
+ checkPropTypes_1 = checkPropTypes;
519
+ return checkPropTypes_1;
520
+ }
521
+
522
+ /**
523
+ * Copyright (c) 2013-present, Facebook, Inc.
524
+ *
525
+ * This source code is licensed under the MIT license found in the
526
+ * LICENSE file in the root directory of this source tree.
527
+ */
528
+
529
+ var factoryWithTypeCheckers;
530
+ var hasRequiredFactoryWithTypeCheckers;
531
+
532
+ function requireFactoryWithTypeCheckers () {
533
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
534
+ hasRequiredFactoryWithTypeCheckers = 1;
535
+
536
+ var ReactIs = requireReactIs();
537
+ var assign = requireObjectAssign();
538
+
539
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
540
+ var has = requireHas();
541
+ var checkPropTypes = requireCheckPropTypes();
542
+
543
+ var printWarning = function() {};
544
+
545
+ if (process.env.NODE_ENV !== 'production') {
546
+ printWarning = function(text) {
547
+ var message = 'Warning: ' + text;
548
+ if (typeof console !== 'undefined') {
549
+ console.error(message);
550
+ }
551
+ try {
552
+ // --- Welcome to debugging React ---
553
+ // This error was thrown as a convenience so that you can use this stack
554
+ // to find the callsite that caused this warning to fire.
555
+ throw new Error(message);
556
+ } catch (x) {}
557
+ };
558
+ }
559
+
560
+ function emptyFunctionThatReturnsNull() {
561
+ return null;
562
+ }
563
+
564
+ factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
565
+ /* global Symbol */
566
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
567
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
568
+
569
+ /**
570
+ * Returns the iterator method function contained on the iterable object.
571
+ *
572
+ * Be sure to invoke the function with the iterable as context:
573
+ *
574
+ * var iteratorFn = getIteratorFn(myIterable);
575
+ * if (iteratorFn) {
576
+ * var iterator = iteratorFn.call(myIterable);
577
+ * ...
578
+ * }
579
+ *
580
+ * @param {?object} maybeIterable
581
+ * @return {?function}
582
+ */
583
+ function getIteratorFn(maybeIterable) {
584
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
585
+ if (typeof iteratorFn === 'function') {
586
+ return iteratorFn;
587
+ }
588
+ }
589
+
590
+ /**
591
+ * Collection of methods that allow declaration and validation of props that are
592
+ * supplied to React components. Example usage:
593
+ *
594
+ * var Props = require('ReactPropTypes');
595
+ * var MyArticle = React.createClass({
596
+ * propTypes: {
597
+ * // An optional string prop named "description".
598
+ * description: Props.string,
599
+ *
600
+ * // A required enum prop named "category".
601
+ * category: Props.oneOf(['News','Photos']).isRequired,
602
+ *
603
+ * // A prop named "dialog" that requires an instance of Dialog.
604
+ * dialog: Props.instanceOf(Dialog).isRequired
605
+ * },
606
+ * render: function() { ... }
607
+ * });
608
+ *
609
+ * A more formal specification of how these methods are used:
610
+ *
611
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
612
+ * decl := ReactPropTypes.{type}(.isRequired)?
613
+ *
614
+ * Each and every declaration produces a function with the same signature. This
615
+ * allows the creation of custom validation functions. For example:
616
+ *
617
+ * var MyLink = React.createClass({
618
+ * propTypes: {
619
+ * // An optional string or URI prop named "href".
620
+ * href: function(props, propName, componentName) {
621
+ * var propValue = props[propName];
622
+ * if (propValue != null && typeof propValue !== 'string' &&
623
+ * !(propValue instanceof URI)) {
624
+ * return new Error(
625
+ * 'Expected a string or an URI for ' + propName + ' in ' +
626
+ * componentName
627
+ * );
628
+ * }
629
+ * }
630
+ * },
631
+ * render: function() {...}
632
+ * });
633
+ *
634
+ * @internal
635
+ */
636
+
637
+ var ANONYMOUS = '<<anonymous>>';
638
+
639
+ // Important!
640
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
641
+ var ReactPropTypes = {
642
+ array: createPrimitiveTypeChecker('array'),
643
+ bigint: createPrimitiveTypeChecker('bigint'),
644
+ bool: createPrimitiveTypeChecker('boolean'),
645
+ func: createPrimitiveTypeChecker('function'),
646
+ number: createPrimitiveTypeChecker('number'),
647
+ object: createPrimitiveTypeChecker('object'),
648
+ string: createPrimitiveTypeChecker('string'),
649
+ symbol: createPrimitiveTypeChecker('symbol'),
650
+
651
+ any: createAnyTypeChecker(),
652
+ arrayOf: createArrayOfTypeChecker,
653
+ element: createElementTypeChecker(),
654
+ elementType: createElementTypeTypeChecker(),
655
+ instanceOf: createInstanceTypeChecker,
656
+ node: createNodeChecker(),
657
+ objectOf: createObjectOfTypeChecker,
658
+ oneOf: createEnumTypeChecker,
659
+ oneOfType: createUnionTypeChecker,
660
+ shape: createShapeTypeChecker,
661
+ exact: createStrictShapeTypeChecker,
662
+ };
663
+
664
+ /**
665
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
666
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
667
+ */
668
+ /*eslint-disable no-self-compare*/
669
+ function is(x, y) {
670
+ // SameValue algorithm
671
+ if (x === y) {
672
+ // Steps 1-5, 7-10
673
+ // Steps 6.b-6.e: +0 != -0
674
+ return x !== 0 || 1 / x === 1 / y;
675
+ } else {
676
+ // Step 6.a: NaN == NaN
677
+ return x !== x && y !== y;
678
+ }
679
+ }
680
+ /*eslint-enable no-self-compare*/
681
+
682
+ /**
683
+ * We use an Error-like object for backward compatibility as people may call
684
+ * PropTypes directly and inspect their output. However, we don't use real
685
+ * Errors anymore. We don't inspect their stack anyway, and creating them
686
+ * is prohibitively expensive if they are created too often, such as what
687
+ * happens in oneOfType() for any type before the one that matched.
688
+ */
689
+ function PropTypeError(message, data) {
690
+ this.message = message;
691
+ this.data = data && typeof data === 'object' ? data: {};
692
+ this.stack = '';
693
+ }
694
+ // Make `instanceof Error` still work for returned errors.
695
+ PropTypeError.prototype = Error.prototype;
696
+
697
+ function createChainableTypeChecker(validate) {
698
+ if (process.env.NODE_ENV !== 'production') {
699
+ var manualPropTypeCallCache = {};
700
+ var manualPropTypeWarningCount = 0;
701
+ }
702
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
703
+ componentName = componentName || ANONYMOUS;
704
+ propFullName = propFullName || propName;
705
+
706
+ if (secret !== ReactPropTypesSecret) {
707
+ if (throwOnDirectAccess) {
708
+ // New behavior only for users of `prop-types` package
709
+ var err = new Error(
710
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
711
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
712
+ 'Read more at http://fb.me/use-check-prop-types'
713
+ );
714
+ err.name = 'Invariant Violation';
715
+ throw err;
716
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
717
+ // Old behavior for people using React.PropTypes
718
+ var cacheKey = componentName + ':' + propName;
719
+ if (
720
+ !manualPropTypeCallCache[cacheKey] &&
721
+ // Avoid spamming the console because they are often not actionable except for lib authors
722
+ manualPropTypeWarningCount < 3
723
+ ) {
724
+ printWarning(
725
+ 'You are manually calling a React.PropTypes validation ' +
726
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
727
+ 'and will throw in the standalone `prop-types` package. ' +
728
+ 'You may be seeing this warning due to a third-party PropTypes ' +
729
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
730
+ );
731
+ manualPropTypeCallCache[cacheKey] = true;
732
+ manualPropTypeWarningCount++;
733
+ }
734
+ }
735
+ }
736
+ if (props[propName] == null) {
737
+ if (isRequired) {
738
+ if (props[propName] === null) {
739
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
740
+ }
741
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
742
+ }
743
+ return null;
744
+ } else {
745
+ return validate(props, propName, componentName, location, propFullName);
746
+ }
747
+ }
748
+
749
+ var chainedCheckType = checkType.bind(null, false);
750
+ chainedCheckType.isRequired = checkType.bind(null, true);
751
+
752
+ return chainedCheckType;
753
+ }
754
+
755
+ function createPrimitiveTypeChecker(expectedType) {
756
+ function validate(props, propName, componentName, location, propFullName, secret) {
757
+ var propValue = props[propName];
758
+ var propType = getPropType(propValue);
759
+ if (propType !== expectedType) {
760
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
761
+ // check, but we can offer a more precise error message here rather than
762
+ // 'of type `object`'.
763
+ var preciseType = getPreciseType(propValue);
764
+
765
+ return new PropTypeError(
766
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
767
+ {expectedType: expectedType}
768
+ );
769
+ }
770
+ return null;
771
+ }
772
+ return createChainableTypeChecker(validate);
773
+ }
774
+
775
+ function createAnyTypeChecker() {
776
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
777
+ }
778
+
779
+ function createArrayOfTypeChecker(typeChecker) {
780
+ function validate(props, propName, componentName, location, propFullName) {
781
+ if (typeof typeChecker !== 'function') {
782
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
783
+ }
784
+ var propValue = props[propName];
785
+ if (!Array.isArray(propValue)) {
786
+ var propType = getPropType(propValue);
787
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
788
+ }
789
+ for (var i = 0; i < propValue.length; i++) {
790
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
791
+ if (error instanceof Error) {
792
+ return error;
793
+ }
794
+ }
795
+ return null;
796
+ }
797
+ return createChainableTypeChecker(validate);
798
+ }
799
+
800
+ function createElementTypeChecker() {
801
+ function validate(props, propName, componentName, location, propFullName) {
802
+ var propValue = props[propName];
803
+ if (!isValidElement(propValue)) {
804
+ var propType = getPropType(propValue);
805
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
806
+ }
807
+ return null;
808
+ }
809
+ return createChainableTypeChecker(validate);
810
+ }
811
+
812
+ function createElementTypeTypeChecker() {
813
+ function validate(props, propName, componentName, location, propFullName) {
814
+ var propValue = props[propName];
815
+ if (!ReactIs.isValidElementType(propValue)) {
816
+ var propType = getPropType(propValue);
817
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
818
+ }
819
+ return null;
820
+ }
821
+ return createChainableTypeChecker(validate);
822
+ }
823
+
824
+ function createInstanceTypeChecker(expectedClass) {
825
+ function validate(props, propName, componentName, location, propFullName) {
826
+ if (!(props[propName] instanceof expectedClass)) {
827
+ var expectedClassName = expectedClass.name || ANONYMOUS;
828
+ var actualClassName = getClassName(props[propName]);
829
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
830
+ }
831
+ return null;
832
+ }
833
+ return createChainableTypeChecker(validate);
834
+ }
835
+
836
+ function createEnumTypeChecker(expectedValues) {
837
+ if (!Array.isArray(expectedValues)) {
838
+ if (process.env.NODE_ENV !== 'production') {
839
+ if (arguments.length > 1) {
840
+ printWarning(
841
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
842
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
843
+ );
844
+ } else {
845
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
846
+ }
847
+ }
848
+ return emptyFunctionThatReturnsNull;
849
+ }
850
+
851
+ function validate(props, propName, componentName, location, propFullName) {
852
+ var propValue = props[propName];
853
+ for (var i = 0; i < expectedValues.length; i++) {
854
+ if (is(propValue, expectedValues[i])) {
855
+ return null;
856
+ }
857
+ }
858
+
859
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
860
+ var type = getPreciseType(value);
861
+ if (type === 'symbol') {
862
+ return String(value);
863
+ }
864
+ return value;
865
+ });
866
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
867
+ }
868
+ return createChainableTypeChecker(validate);
869
+ }
870
+
871
+ function createObjectOfTypeChecker(typeChecker) {
872
+ function validate(props, propName, componentName, location, propFullName) {
873
+ if (typeof typeChecker !== 'function') {
874
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
875
+ }
876
+ var propValue = props[propName];
877
+ var propType = getPropType(propValue);
878
+ if (propType !== 'object') {
879
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
880
+ }
881
+ for (var key in propValue) {
882
+ if (has(propValue, key)) {
883
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
884
+ if (error instanceof Error) {
885
+ return error;
886
+ }
887
+ }
888
+ }
889
+ return null;
890
+ }
891
+ return createChainableTypeChecker(validate);
892
+ }
893
+
894
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
895
+ if (!Array.isArray(arrayOfTypeCheckers)) {
896
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
897
+ return emptyFunctionThatReturnsNull;
898
+ }
899
+
900
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
901
+ var checker = arrayOfTypeCheckers[i];
902
+ if (typeof checker !== 'function') {
903
+ printWarning(
904
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
905
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
906
+ );
907
+ return emptyFunctionThatReturnsNull;
908
+ }
909
+ }
910
+
911
+ function validate(props, propName, componentName, location, propFullName) {
912
+ var expectedTypes = [];
913
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
914
+ var checker = arrayOfTypeCheckers[i];
915
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
916
+ if (checkerResult == null) {
917
+ return null;
918
+ }
919
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
920
+ expectedTypes.push(checkerResult.data.expectedType);
921
+ }
922
+ }
923
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
924
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
925
+ }
926
+ return createChainableTypeChecker(validate);
927
+ }
928
+
929
+ function createNodeChecker() {
930
+ function validate(props, propName, componentName, location, propFullName) {
931
+ if (!isNode(props[propName])) {
932
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
933
+ }
934
+ return null;
935
+ }
936
+ return createChainableTypeChecker(validate);
937
+ }
938
+
939
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
940
+ return new PropTypeError(
941
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
942
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
943
+ );
944
+ }
945
+
946
+ function createShapeTypeChecker(shapeTypes) {
947
+ function validate(props, propName, componentName, location, propFullName) {
948
+ var propValue = props[propName];
949
+ var propType = getPropType(propValue);
950
+ if (propType !== 'object') {
951
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
952
+ }
953
+ for (var key in shapeTypes) {
954
+ var checker = shapeTypes[key];
955
+ if (typeof checker !== 'function') {
956
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
957
+ }
958
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
959
+ if (error) {
960
+ return error;
961
+ }
962
+ }
963
+ return null;
964
+ }
965
+ return createChainableTypeChecker(validate);
966
+ }
967
+
968
+ function createStrictShapeTypeChecker(shapeTypes) {
969
+ function validate(props, propName, componentName, location, propFullName) {
970
+ var propValue = props[propName];
971
+ var propType = getPropType(propValue);
972
+ if (propType !== 'object') {
973
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
974
+ }
975
+ // We need to check all keys in case some are required but missing from props.
976
+ var allKeys = assign({}, props[propName], shapeTypes);
977
+ for (var key in allKeys) {
978
+ var checker = shapeTypes[key];
979
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
980
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
981
+ }
982
+ if (!checker) {
983
+ return new PropTypeError(
984
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
985
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
986
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
987
+ );
988
+ }
989
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
990
+ if (error) {
991
+ return error;
992
+ }
993
+ }
994
+ return null;
995
+ }
996
+
997
+ return createChainableTypeChecker(validate);
998
+ }
999
+
1000
+ function isNode(propValue) {
1001
+ switch (typeof propValue) {
1002
+ case 'number':
1003
+ case 'string':
1004
+ case 'undefined':
1005
+ return true;
1006
+ case 'boolean':
1007
+ return !propValue;
1008
+ case 'object':
1009
+ if (Array.isArray(propValue)) {
1010
+ return propValue.every(isNode);
1011
+ }
1012
+ if (propValue === null || isValidElement(propValue)) {
1013
+ return true;
1014
+ }
1015
+
1016
+ var iteratorFn = getIteratorFn(propValue);
1017
+ if (iteratorFn) {
1018
+ var iterator = iteratorFn.call(propValue);
1019
+ var step;
1020
+ if (iteratorFn !== propValue.entries) {
1021
+ while (!(step = iterator.next()).done) {
1022
+ if (!isNode(step.value)) {
1023
+ return false;
1024
+ }
1025
+ }
1026
+ } else {
1027
+ // Iterator will provide entry [k,v] tuples rather than values.
1028
+ while (!(step = iterator.next()).done) {
1029
+ var entry = step.value;
1030
+ if (entry) {
1031
+ if (!isNode(entry[1])) {
1032
+ return false;
1033
+ }
1034
+ }
1035
+ }
1036
+ }
1037
+ } else {
1038
+ return false;
1039
+ }
1040
+
1041
+ return true;
1042
+ default:
1043
+ return false;
1044
+ }
1045
+ }
1046
+
1047
+ function isSymbol(propType, propValue) {
1048
+ // Native Symbol.
1049
+ if (propType === 'symbol') {
1050
+ return true;
1051
+ }
1052
+
1053
+ // falsy value can't be a Symbol
1054
+ if (!propValue) {
1055
+ return false;
1056
+ }
1057
+
1058
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1059
+ if (propValue['@@toStringTag'] === 'Symbol') {
1060
+ return true;
1061
+ }
1062
+
1063
+ // Fallback for non-spec compliant Symbols which are polyfilled.
1064
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1065
+ return true;
1066
+ }
1067
+
1068
+ return false;
1069
+ }
1070
+
1071
+ // Equivalent of `typeof` but with special handling for array and regexp.
1072
+ function getPropType(propValue) {
1073
+ var propType = typeof propValue;
1074
+ if (Array.isArray(propValue)) {
1075
+ return 'array';
1076
+ }
1077
+ if (propValue instanceof RegExp) {
1078
+ // Old webkits (at least until Android 4.0) return 'function' rather than
1079
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1080
+ // passes PropTypes.object.
1081
+ return 'object';
1082
+ }
1083
+ if (isSymbol(propType, propValue)) {
1084
+ return 'symbol';
1085
+ }
1086
+ return propType;
1087
+ }
1088
+
1089
+ // This handles more types than `getPropType`. Only used for error messages.
1090
+ // See `createPrimitiveTypeChecker`.
1091
+ function getPreciseType(propValue) {
1092
+ if (typeof propValue === 'undefined' || propValue === null) {
1093
+ return '' + propValue;
1094
+ }
1095
+ var propType = getPropType(propValue);
1096
+ if (propType === 'object') {
1097
+ if (propValue instanceof Date) {
1098
+ return 'date';
1099
+ } else if (propValue instanceof RegExp) {
1100
+ return 'regexp';
1101
+ }
1102
+ }
1103
+ return propType;
1104
+ }
1105
+
1106
+ // Returns a string that is postfixed to a warning about an invalid type.
1107
+ // For example, "undefined" or "of type array"
1108
+ function getPostfixForTypeWarning(value) {
1109
+ var type = getPreciseType(value);
1110
+ switch (type) {
1111
+ case 'array':
1112
+ case 'object':
1113
+ return 'an ' + type;
1114
+ case 'boolean':
1115
+ case 'date':
1116
+ case 'regexp':
1117
+ return 'a ' + type;
1118
+ default:
1119
+ return type;
1120
+ }
1121
+ }
1122
+
1123
+ // Returns class name of the object, if any.
1124
+ function getClassName(propValue) {
1125
+ if (!propValue.constructor || !propValue.constructor.name) {
1126
+ return ANONYMOUS;
1127
+ }
1128
+ return propValue.constructor.name;
1129
+ }
1130
+
1131
+ ReactPropTypes.checkPropTypes = checkPropTypes;
1132
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1133
+ ReactPropTypes.PropTypes = ReactPropTypes;
1134
+
1135
+ return ReactPropTypes;
1136
+ };
1137
+ return factoryWithTypeCheckers;
1138
+ }
1139
+
1140
+ /**
1141
+ * Copyright (c) 2013-present, Facebook, Inc.
1142
+ *
1143
+ * This source code is licensed under the MIT license found in the
1144
+ * LICENSE file in the root directory of this source tree.
1145
+ */
1146
+
1147
+ var factoryWithThrowingShims;
1148
+ var hasRequiredFactoryWithThrowingShims;
1149
+
1150
+ function requireFactoryWithThrowingShims () {
1151
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1152
+ hasRequiredFactoryWithThrowingShims = 1;
1153
+
1154
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
1155
+
1156
+ function emptyFunction() {}
1157
+ function emptyFunctionWithReset() {}
1158
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
1159
+
1160
+ factoryWithThrowingShims = function() {
1161
+ function shim(props, propName, componentName, location, propFullName, secret) {
1162
+ if (secret === ReactPropTypesSecret) {
1163
+ // It is still safe when called from React.
1164
+ return;
1165
+ }
1166
+ var err = new Error(
1167
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1168
+ 'Use PropTypes.checkPropTypes() to call them. ' +
1169
+ 'Read more at http://fb.me/use-check-prop-types'
1170
+ );
1171
+ err.name = 'Invariant Violation';
1172
+ throw err;
1173
+ } shim.isRequired = shim;
1174
+ function getShim() {
1175
+ return shim;
1176
+ } // Important!
1177
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1178
+ var ReactPropTypes = {
1179
+ array: shim,
1180
+ bigint: shim,
1181
+ bool: shim,
1182
+ func: shim,
1183
+ number: shim,
1184
+ object: shim,
1185
+ string: shim,
1186
+ symbol: shim,
1187
+
1188
+ any: shim,
1189
+ arrayOf: getShim,
1190
+ element: shim,
1191
+ elementType: shim,
1192
+ instanceOf: getShim,
1193
+ node: shim,
1194
+ objectOf: getShim,
1195
+ oneOf: getShim,
1196
+ oneOfType: getShim,
1197
+ shape: getShim,
1198
+ exact: getShim,
1199
+
1200
+ checkPropTypes: emptyFunctionWithReset,
1201
+ resetWarningCache: emptyFunction
1202
+ };
1203
+
1204
+ ReactPropTypes.PropTypes = ReactPropTypes;
1205
+
1206
+ return ReactPropTypes;
1207
+ };
1208
+ return factoryWithThrowingShims;
1209
+ }
1210
+
1211
+ /**
1212
+ * Copyright (c) 2013-present, Facebook, Inc.
1213
+ *
1214
+ * This source code is licensed under the MIT license found in the
1215
+ * LICENSE file in the root directory of this source tree.
1216
+ */
1217
+
1218
+ if (process.env.NODE_ENV !== 'production') {
1219
+ var ReactIs = requireReactIs();
1220
+
1221
+ // By explicitly using `prop-types` you are opting into new development behavior.
1222
+ // http://fb.me/prop-types-in-prod
1223
+ var throwOnDirectAccess = true;
1224
+ propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1225
+ } else {
1226
+ // By explicitly using `prop-types` you are opting into new production behavior.
1227
+ // http://fb.me/prop-types-in-prod
1228
+ propTypes.exports = requireFactoryWithThrowingShims()();
1229
+ }
1230
+
1231
+ /**
1232
+ * Checks if a given element has a CSS class.
1233
+ *
1234
+ * @param element the element
1235
+ * @param className the CSS class name
1236
+ */
1237
+ function hasClass(element, className) {
1238
+ if (element.classList) return !!className && element.classList.contains(className);
1239
+ return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
1240
+ }
1241
+
1242
+ /**
1243
+ * Adds a CSS class to a given element.
1244
+ *
1245
+ * @param element the element
1246
+ * @param className the CSS class name
1247
+ */
1248
+
1249
+ function addClass(element, className) {
1250
+ if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
1251
+ }
1252
+
1253
+ function replaceClassName(origClass, classToRemove) {
1254
+ return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
1255
+ }
1256
+ /**
1257
+ * Removes a CSS class from a given element.
1258
+ *
1259
+ * @param element the element
1260
+ * @param className the CSS class name
1261
+ */
1262
+
1263
+
1264
+ function removeClass$1(element, className) {
1265
+ if (element.classList) {
1266
+ element.classList.remove(className);
1267
+ } else if (typeof element.className === 'string') {
1268
+ element.className = replaceClassName(element.className, className);
1269
+ } else {
1270
+ element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
1271
+ }
1272
+ }
1273
+
1274
+ var config = {
1275
+ disabled: false
1276
+ };
1277
+
1278
+ var timeoutsShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.shape({
1279
+ enter: propTypes.exports.number,
1280
+ exit: propTypes.exports.number,
1281
+ appear: propTypes.exports.number
1282
+ }).isRequired]) : null;
1283
+ var classNamesShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.shape({
1284
+ enter: propTypes.exports.string,
1285
+ exit: propTypes.exports.string,
1286
+ active: propTypes.exports.string
1287
+ }), propTypes.exports.shape({
1288
+ enter: propTypes.exports.string,
1289
+ enterDone: propTypes.exports.string,
1290
+ enterActive: propTypes.exports.string,
1291
+ exit: propTypes.exports.string,
1292
+ exitDone: propTypes.exports.string,
1293
+ exitActive: propTypes.exports.string
1294
+ })]) : null;
1295
+
1296
+ var TransitionGroupContext = React__default.createContext(null);
1297
+
1298
+ var forceReflow = function forceReflow(node) {
1299
+ return node.scrollTop;
1300
+ };
1301
+
1302
+ var UNMOUNTED = 'unmounted';
1303
+ var EXITED = 'exited';
1304
+ var ENTERING = 'entering';
1305
+ var ENTERED = 'entered';
1306
+ var EXITING = 'exiting';
1307
+ /**
1308
+ * The Transition component lets you describe a transition from one component
1309
+ * state to another _over time_ with a simple declarative API. Most commonly
1310
+ * it's used to animate the mounting and unmounting of a component, but can also
1311
+ * be used to describe in-place transition states as well.
1312
+ *
1313
+ * ---
1314
+ *
1315
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
1316
+ * transitions in CSS, you'll probably want to use
1317
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
1318
+ * instead. It inherits all the features of `Transition`, but contains
1319
+ * additional features necessary to play nice with CSS transitions (hence the
1320
+ * name of the component).
1321
+ *
1322
+ * ---
1323
+ *
1324
+ * By default the `Transition` component does not alter the behavior of the
1325
+ * component it renders, it only tracks "enter" and "exit" states for the
1326
+ * components. It's up to you to give meaning and effect to those states. For
1327
+ * example we can add styles to a component when it enters or exits:
1328
+ *
1329
+ * ```jsx
1330
+ * import { Transition } from 'react-transition-group';
1331
+ *
1332
+ * const duration = 300;
1333
+ *
1334
+ * const defaultStyle = {
1335
+ * transition: `opacity ${duration}ms ease-in-out`,
1336
+ * opacity: 0,
1337
+ * }
1338
+ *
1339
+ * const transitionStyles = {
1340
+ * entering: { opacity: 1 },
1341
+ * entered: { opacity: 1 },
1342
+ * exiting: { opacity: 0 },
1343
+ * exited: { opacity: 0 },
1344
+ * };
1345
+ *
1346
+ * const Fade = ({ in: inProp }) => (
1347
+ * <Transition in={inProp} timeout={duration}>
1348
+ * {state => (
1349
+ * <div style={{
1350
+ * ...defaultStyle,
1351
+ * ...transitionStyles[state]
1352
+ * }}>
1353
+ * I'm a fade Transition!
1354
+ * </div>
1355
+ * )}
1356
+ * </Transition>
1357
+ * );
1358
+ * ```
1359
+ *
1360
+ * There are 4 main states a Transition can be in:
1361
+ * - `'entering'`
1362
+ * - `'entered'`
1363
+ * - `'exiting'`
1364
+ * - `'exited'`
1365
+ *
1366
+ * Transition state is toggled via the `in` prop. When `true` the component
1367
+ * begins the "Enter" stage. During this stage, the component will shift from
1368
+ * its current transition state, to `'entering'` for the duration of the
1369
+ * transition and then to the `'entered'` stage once it's complete. Let's take
1370
+ * the following example (we'll use the
1371
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
1372
+ *
1373
+ * ```jsx
1374
+ * function App() {
1375
+ * const [inProp, setInProp] = useState(false);
1376
+ * return (
1377
+ * <div>
1378
+ * <Transition in={inProp} timeout={500}>
1379
+ * {state => (
1380
+ * // ...
1381
+ * )}
1382
+ * </Transition>
1383
+ * <button onClick={() => setInProp(true)}>
1384
+ * Click to Enter
1385
+ * </button>
1386
+ * </div>
1387
+ * );
1388
+ * }
1389
+ * ```
1390
+ *
1391
+ * When the button is clicked the component will shift to the `'entering'` state
1392
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
1393
+ * to `'entered'`.
1394
+ *
1395
+ * When `in` is `false` the same thing happens except the state moves from
1396
+ * `'exiting'` to `'exited'`.
1397
+ */
1398
+
1399
+ var Transition = /*#__PURE__*/function (_React$Component) {
1400
+ _inheritsLoose(Transition, _React$Component);
1401
+
1402
+ function Transition(props, context) {
1403
+ var _this;
1404
+
1405
+ _this = _React$Component.call(this, props, context) || this;
1406
+ var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
1407
+
1408
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
1409
+ var initialStatus;
1410
+ _this.appearStatus = null;
1411
+
1412
+ if (props.in) {
1413
+ if (appear) {
1414
+ initialStatus = EXITED;
1415
+ _this.appearStatus = ENTERING;
1416
+ } else {
1417
+ initialStatus = ENTERED;
1418
+ }
1419
+ } else {
1420
+ if (props.unmountOnExit || props.mountOnEnter) {
1421
+ initialStatus = UNMOUNTED;
1422
+ } else {
1423
+ initialStatus = EXITED;
1424
+ }
1425
+ }
1426
+
1427
+ _this.state = {
1428
+ status: initialStatus
1429
+ };
1430
+ _this.nextCallback = null;
1431
+ return _this;
1432
+ }
1433
+
1434
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
1435
+ var nextIn = _ref.in;
1436
+
1437
+ if (nextIn && prevState.status === UNMOUNTED) {
1438
+ return {
1439
+ status: EXITED
1440
+ };
1441
+ }
1442
+
1443
+ return null;
1444
+ } // getSnapshotBeforeUpdate(prevProps) {
1445
+ // let nextStatus = null
1446
+ // if (prevProps !== this.props) {
1447
+ // const { status } = this.state
1448
+ // if (this.props.in) {
1449
+ // if (status !== ENTERING && status !== ENTERED) {
1450
+ // nextStatus = ENTERING
1451
+ // }
1452
+ // } else {
1453
+ // if (status === ENTERING || status === ENTERED) {
1454
+ // nextStatus = EXITING
1455
+ // }
1456
+ // }
1457
+ // }
1458
+ // return { nextStatus }
1459
+ // }
1460
+ ;
1461
+
1462
+ var _proto = Transition.prototype;
1463
+
1464
+ _proto.componentDidMount = function componentDidMount() {
1465
+ this.updateStatus(true, this.appearStatus);
1466
+ };
1467
+
1468
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
1469
+ var nextStatus = null;
1470
+
1471
+ if (prevProps !== this.props) {
1472
+ var status = this.state.status;
1473
+
1474
+ if (this.props.in) {
1475
+ if (status !== ENTERING && status !== ENTERED) {
1476
+ nextStatus = ENTERING;
1477
+ }
1478
+ } else {
1479
+ if (status === ENTERING || status === ENTERED) {
1480
+ nextStatus = EXITING;
1481
+ }
1482
+ }
1483
+ }
1484
+
1485
+ this.updateStatus(false, nextStatus);
1486
+ };
1487
+
1488
+ _proto.componentWillUnmount = function componentWillUnmount() {
1489
+ this.cancelNextCallback();
1490
+ };
1491
+
1492
+ _proto.getTimeouts = function getTimeouts() {
1493
+ var timeout = this.props.timeout;
1494
+ var exit, enter, appear;
1495
+ exit = enter = appear = timeout;
1496
+
1497
+ if (timeout != null && typeof timeout !== 'number') {
1498
+ exit = timeout.exit;
1499
+ enter = timeout.enter; // TODO: remove fallback for next major
1500
+
1501
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
1502
+ }
1503
+
1504
+ return {
1505
+ exit: exit,
1506
+ enter: enter,
1507
+ appear: appear
1508
+ };
1509
+ };
1510
+
1511
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
1512
+ if (mounting === void 0) {
1513
+ mounting = false;
1514
+ }
1515
+
1516
+ if (nextStatus !== null) {
1517
+ // nextStatus will always be ENTERING or EXITING.
1518
+ this.cancelNextCallback();
1519
+
1520
+ if (nextStatus === ENTERING) {
1521
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
1522
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
1523
+ // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
1524
+ // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
1525
+
1526
+ if (node) forceReflow(node);
1527
+ }
1528
+
1529
+ this.performEnter(mounting);
1530
+ } else {
1531
+ this.performExit();
1532
+ }
1533
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
1534
+ this.setState({
1535
+ status: UNMOUNTED
1536
+ });
1537
+ }
1538
+ };
1539
+
1540
+ _proto.performEnter = function performEnter(mounting) {
1541
+ var _this2 = this;
1542
+
1543
+ var enter = this.props.enter;
1544
+ var appearing = this.context ? this.context.isMounting : mounting;
1545
+
1546
+ var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],
1547
+ maybeNode = _ref2[0],
1548
+ maybeAppearing = _ref2[1];
1549
+
1550
+ var timeouts = this.getTimeouts();
1551
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
1552
+ // if we are mounting and running this it means appear _must_ be set
1553
+
1554
+ if (!mounting && !enter || config.disabled) {
1555
+ this.safeSetState({
1556
+ status: ENTERED
1557
+ }, function () {
1558
+ _this2.props.onEntered(maybeNode);
1559
+ });
1560
+ return;
1561
+ }
1562
+
1563
+ this.props.onEnter(maybeNode, maybeAppearing);
1564
+ this.safeSetState({
1565
+ status: ENTERING
1566
+ }, function () {
1567
+ _this2.props.onEntering(maybeNode, maybeAppearing);
1568
+
1569
+ _this2.onTransitionEnd(enterTimeout, function () {
1570
+ _this2.safeSetState({
1571
+ status: ENTERED
1572
+ }, function () {
1573
+ _this2.props.onEntered(maybeNode, maybeAppearing);
1574
+ });
1575
+ });
1576
+ });
1577
+ };
1578
+
1579
+ _proto.performExit = function performExit() {
1580
+ var _this3 = this;
1581
+
1582
+ var exit = this.props.exit;
1583
+ var timeouts = this.getTimeouts();
1584
+ var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED
1585
+
1586
+ if (!exit || config.disabled) {
1587
+ this.safeSetState({
1588
+ status: EXITED
1589
+ }, function () {
1590
+ _this3.props.onExited(maybeNode);
1591
+ });
1592
+ return;
1593
+ }
1594
+
1595
+ this.props.onExit(maybeNode);
1596
+ this.safeSetState({
1597
+ status: EXITING
1598
+ }, function () {
1599
+ _this3.props.onExiting(maybeNode);
1600
+
1601
+ _this3.onTransitionEnd(timeouts.exit, function () {
1602
+ _this3.safeSetState({
1603
+ status: EXITED
1604
+ }, function () {
1605
+ _this3.props.onExited(maybeNode);
1606
+ });
1607
+ });
1608
+ });
1609
+ };
1610
+
1611
+ _proto.cancelNextCallback = function cancelNextCallback() {
1612
+ if (this.nextCallback !== null) {
1613
+ this.nextCallback.cancel();
1614
+ this.nextCallback = null;
1615
+ }
1616
+ };
1617
+
1618
+ _proto.safeSetState = function safeSetState(nextState, callback) {
1619
+ // This shouldn't be necessary, but there are weird race conditions with
1620
+ // setState callbacks and unmounting in testing, so always make sure that
1621
+ // we can cancel any pending setState callbacks after we unmount.
1622
+ callback = this.setNextCallback(callback);
1623
+ this.setState(nextState, callback);
1624
+ };
1625
+
1626
+ _proto.setNextCallback = function setNextCallback(callback) {
1627
+ var _this4 = this;
1628
+
1629
+ var active = true;
1630
+
1631
+ this.nextCallback = function (event) {
1632
+ if (active) {
1633
+ active = false;
1634
+ _this4.nextCallback = null;
1635
+ callback(event);
1636
+ }
1637
+ };
1638
+
1639
+ this.nextCallback.cancel = function () {
1640
+ active = false;
1641
+ };
1642
+
1643
+ return this.nextCallback;
1644
+ };
1645
+
1646
+ _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
1647
+ this.setNextCallback(handler);
1648
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
1649
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
1650
+
1651
+ if (!node || doesNotHaveTimeoutOrListener) {
1652
+ setTimeout(this.nextCallback, 0);
1653
+ return;
1654
+ }
1655
+
1656
+ if (this.props.addEndListener) {
1657
+ var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
1658
+ maybeNode = _ref3[0],
1659
+ maybeNextCallback = _ref3[1];
1660
+
1661
+ this.props.addEndListener(maybeNode, maybeNextCallback);
1662
+ }
1663
+
1664
+ if (timeout != null) {
1665
+ setTimeout(this.nextCallback, timeout);
1666
+ }
1667
+ };
1668
+
1669
+ _proto.render = function render() {
1670
+ var status = this.state.status;
1671
+
1672
+ if (status === UNMOUNTED) {
1673
+ return null;
1674
+ }
1675
+
1676
+ var _this$props = this.props,
1677
+ children = _this$props.children;
1678
+ _this$props.in;
1679
+ _this$props.mountOnEnter;
1680
+ _this$props.unmountOnExit;
1681
+ _this$props.appear;
1682
+ _this$props.enter;
1683
+ _this$props.exit;
1684
+ _this$props.timeout;
1685
+ _this$props.addEndListener;
1686
+ _this$props.onEnter;
1687
+ _this$props.onEntering;
1688
+ _this$props.onEntered;
1689
+ _this$props.onExit;
1690
+ _this$props.onExiting;
1691
+ _this$props.onExited;
1692
+ _this$props.nodeRef;
1693
+ var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
1694
+
1695
+ return (
1696
+ /*#__PURE__*/
1697
+ // allows for nested Transitions
1698
+ React__default.createElement(TransitionGroupContext.Provider, {
1699
+ value: null
1700
+ }, typeof children === 'function' ? children(status, childProps) : React__default.cloneElement(React__default.Children.only(children), childProps))
1701
+ );
1702
+ };
1703
+
1704
+ return Transition;
1705
+ }(React__default.Component);
1706
+
1707
+ Transition.contextType = TransitionGroupContext;
1708
+ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
1709
+ /**
1710
+ * A React reference to DOM element that need to transition:
1711
+ * https://stackoverflow.com/a/51127130/4671932
1712
+ *
1713
+ * - When `nodeRef` prop is used, `node` is not passed to callback functions
1714
+ * (e.g. `onEnter`) because user already has direct access to the node.
1715
+ * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
1716
+ * `nodeRef` need to be provided to `Transition` with changed `key` prop
1717
+ * (see
1718
+ * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
1719
+ */
1720
+ nodeRef: propTypes.exports.shape({
1721
+ current: typeof Element === 'undefined' ? propTypes.exports.any : function (propValue, key, componentName, location, propFullName, secret) {
1722
+ var value = propValue[key];
1723
+ return propTypes.exports.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
1724
+ }
1725
+ }),
1726
+
1727
+ /**
1728
+ * A `function` child can be used instead of a React element. This function is
1729
+ * called with the current transition status (`'entering'`, `'entered'`,
1730
+ * `'exiting'`, `'exited'`), which can be used to apply context
1731
+ * specific props to a component.
1732
+ *
1733
+ * ```jsx
1734
+ * <Transition in={this.state.in} timeout={150}>
1735
+ * {state => (
1736
+ * <MyComponent className={`fade fade-${state}`} />
1737
+ * )}
1738
+ * </Transition>
1739
+ * ```
1740
+ */
1741
+ children: propTypes.exports.oneOfType([propTypes.exports.func.isRequired, propTypes.exports.element.isRequired]).isRequired,
1742
+
1743
+ /**
1744
+ * Show the component; triggers the enter or exit states
1745
+ */
1746
+ in: propTypes.exports.bool,
1747
+
1748
+ /**
1749
+ * By default the child component is mounted immediately along with
1750
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
1751
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
1752
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
1753
+ */
1754
+ mountOnEnter: propTypes.exports.bool,
1755
+
1756
+ /**
1757
+ * By default the child component stays mounted after it reaches the `'exited'` state.
1758
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
1759
+ */
1760
+ unmountOnExit: propTypes.exports.bool,
1761
+
1762
+ /**
1763
+ * By default the child component does not perform the enter transition when
1764
+ * it first mounts, regardless of the value of `in`. If you want this
1765
+ * behavior, set both `appear` and `in` to `true`.
1766
+ *
1767
+ * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
1768
+ * > only adds an additional enter transition. However, in the
1769
+ * > `<CSSTransition>` component that first enter transition does result in
1770
+ * > additional `.appear-*` classes, that way you can choose to style it
1771
+ * > differently.
1772
+ */
1773
+ appear: propTypes.exports.bool,
1774
+
1775
+ /**
1776
+ * Enable or disable enter transitions.
1777
+ */
1778
+ enter: propTypes.exports.bool,
1779
+
1780
+ /**
1781
+ * Enable or disable exit transitions.
1782
+ */
1783
+ exit: propTypes.exports.bool,
1784
+
1785
+ /**
1786
+ * The duration of the transition, in milliseconds.
1787
+ * Required unless `addEndListener` is provided.
1788
+ *
1789
+ * You may specify a single timeout for all transitions:
1790
+ *
1791
+ * ```jsx
1792
+ * timeout={500}
1793
+ * ```
1794
+ *
1795
+ * or individually:
1796
+ *
1797
+ * ```jsx
1798
+ * timeout={{
1799
+ * appear: 500,
1800
+ * enter: 300,
1801
+ * exit: 500,
1802
+ * }}
1803
+ * ```
1804
+ *
1805
+ * - `appear` defaults to the value of `enter`
1806
+ * - `enter` defaults to `0`
1807
+ * - `exit` defaults to `0`
1808
+ *
1809
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
1810
+ */
1811
+ timeout: function timeout(props) {
1812
+ var pt = timeoutsShape;
1813
+ if (!props.addEndListener) pt = pt.isRequired;
1814
+
1815
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1816
+ args[_key - 1] = arguments[_key];
1817
+ }
1818
+
1819
+ return pt.apply(void 0, [props].concat(args));
1820
+ },
1821
+
1822
+ /**
1823
+ * Add a custom transition end trigger. Called with the transitioning
1824
+ * DOM node and a `done` callback. Allows for more fine grained transition end
1825
+ * logic. Timeouts are still used as a fallback if provided.
1826
+ *
1827
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1828
+ *
1829
+ * ```jsx
1830
+ * addEndListener={(node, done) => {
1831
+ * // use the css transitionend event to mark the finish of a transition
1832
+ * node.addEventListener('transitionend', done, false);
1833
+ * }}
1834
+ * ```
1835
+ */
1836
+ addEndListener: propTypes.exports.func,
1837
+
1838
+ /**
1839
+ * Callback fired before the "entering" status is applied. An extra parameter
1840
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1841
+ *
1842
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1843
+ *
1844
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
1845
+ */
1846
+ onEnter: propTypes.exports.func,
1847
+
1848
+ /**
1849
+ * Callback fired after the "entering" status is applied. An extra parameter
1850
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1851
+ *
1852
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1853
+ *
1854
+ * @type Function(node: HtmlElement, isAppearing: bool)
1855
+ */
1856
+ onEntering: propTypes.exports.func,
1857
+
1858
+ /**
1859
+ * Callback fired after the "entered" status is applied. An extra parameter
1860
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1861
+ *
1862
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1863
+ *
1864
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
1865
+ */
1866
+ onEntered: propTypes.exports.func,
1867
+
1868
+ /**
1869
+ * Callback fired before the "exiting" status is applied.
1870
+ *
1871
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1872
+ *
1873
+ * @type Function(node: HtmlElement) -> void
1874
+ */
1875
+ onExit: propTypes.exports.func,
1876
+
1877
+ /**
1878
+ * Callback fired after the "exiting" status is applied.
1879
+ *
1880
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1881
+ *
1882
+ * @type Function(node: HtmlElement) -> void
1883
+ */
1884
+ onExiting: propTypes.exports.func,
1885
+
1886
+ /**
1887
+ * Callback fired after the "exited" status is applied.
1888
+ *
1889
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1890
+ *
1891
+ * @type Function(node: HtmlElement) -> void
1892
+ */
1893
+ onExited: propTypes.exports.func
1894
+ } : {}; // Name the function so it is clearer in the documentation
1895
+
1896
+ function noop() {}
1897
+
1898
+ Transition.defaultProps = {
1899
+ in: false,
1900
+ mountOnEnter: false,
1901
+ unmountOnExit: false,
1902
+ appear: false,
1903
+ enter: true,
1904
+ exit: true,
1905
+ onEnter: noop,
1906
+ onEntering: noop,
1907
+ onEntered: noop,
1908
+ onExit: noop,
1909
+ onExiting: noop,
1910
+ onExited: noop
1911
+ };
1912
+ Transition.UNMOUNTED = UNMOUNTED;
1913
+ Transition.EXITED = EXITED;
1914
+ Transition.ENTERING = ENTERING;
1915
+ Transition.ENTERED = ENTERED;
1916
+ Transition.EXITING = EXITING;
1917
+
1918
+ var _addClass = function addClass$1(node, classes) {
1919
+ return node && classes && classes.split(' ').forEach(function (c) {
1920
+ return addClass(node, c);
1921
+ });
1922
+ };
1923
+
1924
+ var removeClass = function removeClass(node, classes) {
1925
+ return node && classes && classes.split(' ').forEach(function (c) {
1926
+ return removeClass$1(node, c);
1927
+ });
1928
+ };
1929
+ /**
1930
+ * A transition component inspired by the excellent
1931
+ * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
1932
+ * use it if you're using CSS transitions or animations. It's built upon the
1933
+ * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
1934
+ * component, so it inherits all of its props.
1935
+ *
1936
+ * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
1937
+ * and `exit` states of the transition. The first class is applied and then a
1938
+ * second `*-active` class in order to activate the CSS transition. After the
1939
+ * transition, matching `*-done` class names are applied to persist the
1940
+ * transition state.
1941
+ *
1942
+ * ```jsx
1943
+ * function App() {
1944
+ * const [inProp, setInProp] = useState(false);
1945
+ * return (
1946
+ * <div>
1947
+ * <CSSTransition in={inProp} timeout={200} classNames="my-node">
1948
+ * <div>
1949
+ * {"I'll receive my-node-* classes"}
1950
+ * </div>
1951
+ * </CSSTransition>
1952
+ * <button type="button" onClick={() => setInProp(true)}>
1953
+ * Click to Enter
1954
+ * </button>
1955
+ * </div>
1956
+ * );
1957
+ * }
1958
+ * ```
1959
+ *
1960
+ * When the `in` prop is set to `true`, the child component will first receive
1961
+ * the class `example-enter`, then the `example-enter-active` will be added in
1962
+ * the next tick. `CSSTransition` [forces a
1963
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
1964
+ * between before adding the `example-enter-active`. This is an important trick
1965
+ * because it allows us to transition between `example-enter` and
1966
+ * `example-enter-active` even though they were added immediately one after
1967
+ * another. Most notably, this is what makes it possible for us to animate
1968
+ * _appearance_.
1969
+ *
1970
+ * ```css
1971
+ * .my-node-enter {
1972
+ * opacity: 0;
1973
+ * }
1974
+ * .my-node-enter-active {
1975
+ * opacity: 1;
1976
+ * transition: opacity 200ms;
1977
+ * }
1978
+ * .my-node-exit {
1979
+ * opacity: 1;
1980
+ * }
1981
+ * .my-node-exit-active {
1982
+ * opacity: 0;
1983
+ * transition: opacity 200ms;
1984
+ * }
1985
+ * ```
1986
+ *
1987
+ * `*-active` classes represent which styles you want to animate **to**, so it's
1988
+ * important to add `transition` declaration only to them, otherwise transitions
1989
+ * might not behave as intended! This might not be obvious when the transitions
1990
+ * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
1991
+ * the example above (minus `transition`), but it becomes apparent in more
1992
+ * complex transitions.
1993
+ *
1994
+ * **Note**: If you're using the
1995
+ * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
1996
+ * prop, make sure to define styles for `.appear-*` classes as well.
1997
+ */
1998
+
1999
+
2000
+ var CSSTransition = /*#__PURE__*/function (_React$Component) {
2001
+ _inheritsLoose(CSSTransition, _React$Component);
2002
+
2003
+ function CSSTransition() {
2004
+ var _this;
2005
+
2006
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2007
+ args[_key] = arguments[_key];
2008
+ }
2009
+
2010
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
2011
+ _this.appliedClasses = {
2012
+ appear: {},
2013
+ enter: {},
2014
+ exit: {}
2015
+ };
2016
+
2017
+ _this.onEnter = function (maybeNode, maybeAppearing) {
2018
+ var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
2019
+ node = _this$resolveArgument[0],
2020
+ appearing = _this$resolveArgument[1];
2021
+
2022
+ _this.removeClasses(node, 'exit');
2023
+
2024
+ _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
2025
+
2026
+ if (_this.props.onEnter) {
2027
+ _this.props.onEnter(maybeNode, maybeAppearing);
2028
+ }
2029
+ };
2030
+
2031
+ _this.onEntering = function (maybeNode, maybeAppearing) {
2032
+ var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
2033
+ node = _this$resolveArgument2[0],
2034
+ appearing = _this$resolveArgument2[1];
2035
+
2036
+ var type = appearing ? 'appear' : 'enter';
2037
+
2038
+ _this.addClass(node, type, 'active');
2039
+
2040
+ if (_this.props.onEntering) {
2041
+ _this.props.onEntering(maybeNode, maybeAppearing);
2042
+ }
2043
+ };
2044
+
2045
+ _this.onEntered = function (maybeNode, maybeAppearing) {
2046
+ var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
2047
+ node = _this$resolveArgument3[0],
2048
+ appearing = _this$resolveArgument3[1];
2049
+
2050
+ var type = appearing ? 'appear' : 'enter';
2051
+
2052
+ _this.removeClasses(node, type);
2053
+
2054
+ _this.addClass(node, type, 'done');
2055
+
2056
+ if (_this.props.onEntered) {
2057
+ _this.props.onEntered(maybeNode, maybeAppearing);
2058
+ }
2059
+ };
2060
+
2061
+ _this.onExit = function (maybeNode) {
2062
+ var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
2063
+ node = _this$resolveArgument4[0];
2064
+
2065
+ _this.removeClasses(node, 'appear');
2066
+
2067
+ _this.removeClasses(node, 'enter');
2068
+
2069
+ _this.addClass(node, 'exit', 'base');
2070
+
2071
+ if (_this.props.onExit) {
2072
+ _this.props.onExit(maybeNode);
2073
+ }
2074
+ };
2075
+
2076
+ _this.onExiting = function (maybeNode) {
2077
+ var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
2078
+ node = _this$resolveArgument5[0];
2079
+
2080
+ _this.addClass(node, 'exit', 'active');
2081
+
2082
+ if (_this.props.onExiting) {
2083
+ _this.props.onExiting(maybeNode);
2084
+ }
2085
+ };
2086
+
2087
+ _this.onExited = function (maybeNode) {
2088
+ var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
2089
+ node = _this$resolveArgument6[0];
2090
+
2091
+ _this.removeClasses(node, 'exit');
2092
+
2093
+ _this.addClass(node, 'exit', 'done');
2094
+
2095
+ if (_this.props.onExited) {
2096
+ _this.props.onExited(maybeNode);
2097
+ }
2098
+ };
2099
+
2100
+ _this.resolveArguments = function (maybeNode, maybeAppearing) {
2101
+ return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
2102
+ : [maybeNode, maybeAppearing];
2103
+ };
2104
+
2105
+ _this.getClassNames = function (type) {
2106
+ var classNames = _this.props.classNames;
2107
+ var isStringClassNames = typeof classNames === 'string';
2108
+ var prefix = isStringClassNames && classNames ? classNames + "-" : '';
2109
+ var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
2110
+ var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
2111
+ var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
2112
+ return {
2113
+ baseClassName: baseClassName,
2114
+ activeClassName: activeClassName,
2115
+ doneClassName: doneClassName
2116
+ };
2117
+ };
2118
+
2119
+ return _this;
2120
+ }
2121
+
2122
+ var _proto = CSSTransition.prototype;
2123
+
2124
+ _proto.addClass = function addClass(node, type, phase) {
2125
+ var className = this.getClassNames(type)[phase + "ClassName"];
2126
+
2127
+ var _this$getClassNames = this.getClassNames('enter'),
2128
+ doneClassName = _this$getClassNames.doneClassName;
2129
+
2130
+ if (type === 'appear' && phase === 'done' && doneClassName) {
2131
+ className += " " + doneClassName;
2132
+ } // This is to force a repaint,
2133
+ // which is necessary in order to transition styles when adding a class name.
2134
+
2135
+
2136
+ if (phase === 'active') {
2137
+ if (node) forceReflow(node);
2138
+ }
2139
+
2140
+ if (className) {
2141
+ this.appliedClasses[type][phase] = className;
2142
+
2143
+ _addClass(node, className);
2144
+ }
2145
+ };
2146
+
2147
+ _proto.removeClasses = function removeClasses(node, type) {
2148
+ var _this$appliedClasses$ = this.appliedClasses[type],
2149
+ baseClassName = _this$appliedClasses$.base,
2150
+ activeClassName = _this$appliedClasses$.active,
2151
+ doneClassName = _this$appliedClasses$.done;
2152
+ this.appliedClasses[type] = {};
2153
+
2154
+ if (baseClassName) {
2155
+ removeClass(node, baseClassName);
2156
+ }
2157
+
2158
+ if (activeClassName) {
2159
+ removeClass(node, activeClassName);
2160
+ }
2161
+
2162
+ if (doneClassName) {
2163
+ removeClass(node, doneClassName);
2164
+ }
2165
+ };
2166
+
2167
+ _proto.render = function render() {
2168
+ var _this$props = this.props;
2169
+ _this$props.classNames;
2170
+ var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
2171
+
2172
+ return /*#__PURE__*/React__default.createElement(Transition, _extends({}, props, {
2173
+ onEnter: this.onEnter,
2174
+ onEntered: this.onEntered,
2175
+ onEntering: this.onEntering,
2176
+ onExit: this.onExit,
2177
+ onExiting: this.onExiting,
2178
+ onExited: this.onExited
2179
+ }));
2180
+ };
2181
+
2182
+ return CSSTransition;
2183
+ }(React__default.Component);
2184
+
2185
+ CSSTransition.defaultProps = {
2186
+ classNames: ''
2187
+ };
2188
+ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, Transition.propTypes, {
2189
+ /**
2190
+ * The animation classNames applied to the component as it appears, enters,
2191
+ * exits or has finished the transition. A single name can be provided, which
2192
+ * will be suffixed for each stage, e.g. `classNames="fade"` applies:
2193
+ *
2194
+ * - `fade-appear`, `fade-appear-active`, `fade-appear-done`
2195
+ * - `fade-enter`, `fade-enter-active`, `fade-enter-done`
2196
+ * - `fade-exit`, `fade-exit-active`, `fade-exit-done`
2197
+ *
2198
+ * A few details to note about how these classes are applied:
2199
+ *
2200
+ * 1. They are _joined_ with the ones that are already defined on the child
2201
+ * component, so if you want to add some base styles, you can use
2202
+ * `className` without worrying that it will be overridden.
2203
+ *
2204
+ * 2. If the transition component mounts with `in={false}`, no classes are
2205
+ * applied yet. You might be expecting `*-exit-done`, but if you think
2206
+ * about it, a component cannot finish exiting if it hasn't entered yet.
2207
+ *
2208
+ * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
2209
+ * allows you to define different behavior for when appearing is done and
2210
+ * when regular entering is done, using selectors like
2211
+ * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
2212
+ * an epic entrance animation when element first appears in the DOM using
2213
+ * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
2214
+ * simply use `fade-enter-done` for defining both cases.
2215
+ *
2216
+ * Each individual classNames can also be specified independently like:
2217
+ *
2218
+ * ```js
2219
+ * classNames={{
2220
+ * appear: 'my-appear',
2221
+ * appearActive: 'my-active-appear',
2222
+ * appearDone: 'my-done-appear',
2223
+ * enter: 'my-enter',
2224
+ * enterActive: 'my-active-enter',
2225
+ * enterDone: 'my-done-enter',
2226
+ * exit: 'my-exit',
2227
+ * exitActive: 'my-active-exit',
2228
+ * exitDone: 'my-done-exit',
2229
+ * }}
2230
+ * ```
2231
+ *
2232
+ * If you want to set these classes using CSS Modules:
2233
+ *
2234
+ * ```js
2235
+ * import styles from './styles.css';
2236
+ * ```
2237
+ *
2238
+ * you might want to use camelCase in your CSS file, that way could simply
2239
+ * spread them instead of listing them one by one:
2240
+ *
2241
+ * ```js
2242
+ * classNames={{ ...styles }}
2243
+ * ```
2244
+ *
2245
+ * @type {string | {
2246
+ * appear?: string,
2247
+ * appearActive?: string,
2248
+ * appearDone?: string,
2249
+ * enter?: string,
2250
+ * enterActive?: string,
2251
+ * enterDone?: string,
2252
+ * exit?: string,
2253
+ * exitActive?: string,
2254
+ * exitDone?: string,
2255
+ * }}
2256
+ */
2257
+ classNames: classNamesShape,
2258
+
2259
+ /**
2260
+ * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
2261
+ * applied.
2262
+ *
2263
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2264
+ *
2265
+ * @type Function(node: HtmlElement, isAppearing: bool)
2266
+ */
2267
+ onEnter: propTypes.exports.func,
2268
+
2269
+ /**
2270
+ * A `<Transition>` callback fired immediately after the 'enter-active' or
2271
+ * 'appear-active' class is applied.
2272
+ *
2273
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2274
+ *
2275
+ * @type Function(node: HtmlElement, isAppearing: bool)
2276
+ */
2277
+ onEntering: propTypes.exports.func,
2278
+
2279
+ /**
2280
+ * A `<Transition>` callback fired immediately after the 'enter' or
2281
+ * 'appear' classes are **removed** and the `done` class is added to the DOM node.
2282
+ *
2283
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2284
+ *
2285
+ * @type Function(node: HtmlElement, isAppearing: bool)
2286
+ */
2287
+ onEntered: propTypes.exports.func,
2288
+
2289
+ /**
2290
+ * A `<Transition>` callback fired immediately after the 'exit' class is
2291
+ * applied.
2292
+ *
2293
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2294
+ *
2295
+ * @type Function(node: HtmlElement)
2296
+ */
2297
+ onExit: propTypes.exports.func,
2298
+
2299
+ /**
2300
+ * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
2301
+ *
2302
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2303
+ *
2304
+ * @type Function(node: HtmlElement)
2305
+ */
2306
+ onExiting: propTypes.exports.func,
2307
+
2308
+ /**
2309
+ * A `<Transition>` callback fired immediately after the 'exit' classes
2310
+ * are **removed** and the `exit-done` class is added to the DOM node.
2311
+ *
2312
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2313
+ *
2314
+ * @type Function(node: HtmlElement)
2315
+ */
2316
+ onExited: propTypes.exports.func
2317
+ }) : {};
2318
+
2319
+ function _assertThisInitialized(self) {
2320
+ if (self === void 0) {
2321
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2322
+ }
2323
+ return self;
2324
+ }
2325
+
2326
+ /**
2327
+ * Given `this.props.children`, return an object mapping key to child.
2328
+ *
2329
+ * @param {*} children `this.props.children`
2330
+ * @return {object} Mapping of key to child
2331
+ */
2332
+
2333
+ function getChildMapping(children, mapFn) {
2334
+ var mapper = function mapper(child) {
2335
+ return mapFn && isValidElement(child) ? mapFn(child) : child;
2336
+ };
2337
+
2338
+ var result = Object.create(null);
2339
+ if (children) Children.map(children, function (c) {
2340
+ return c;
2341
+ }).forEach(function (child) {
2342
+ // run the map function here instead so that the key is the computed one
2343
+ result[child.key] = mapper(child);
2344
+ });
2345
+ return result;
2346
+ }
2347
+ /**
2348
+ * When you're adding or removing children some may be added or removed in the
2349
+ * same render pass. We want to show *both* since we want to simultaneously
2350
+ * animate elements in and out. This function takes a previous set of keys
2351
+ * and a new set of keys and merges them with its best guess of the correct
2352
+ * ordering. In the future we may expose some of the utilities in
2353
+ * ReactMultiChild to make this easy, but for now React itself does not
2354
+ * directly have this concept of the union of prevChildren and nextChildren
2355
+ * so we implement it here.
2356
+ *
2357
+ * @param {object} prev prev children as returned from
2358
+ * `ReactTransitionChildMapping.getChildMapping()`.
2359
+ * @param {object} next next children as returned from
2360
+ * `ReactTransitionChildMapping.getChildMapping()`.
2361
+ * @return {object} a key set that contains all keys in `prev` and all keys
2362
+ * in `next` in a reasonable order.
2363
+ */
2364
+
2365
+ function mergeChildMappings(prev, next) {
2366
+ prev = prev || {};
2367
+ next = next || {};
2368
+
2369
+ function getValueForKey(key) {
2370
+ return key in next ? next[key] : prev[key];
2371
+ } // For each key of `next`, the list of keys to insert before that key in
2372
+ // the combined list
2373
+
2374
+
2375
+ var nextKeysPending = Object.create(null);
2376
+ var pendingKeys = [];
2377
+
2378
+ for (var prevKey in prev) {
2379
+ if (prevKey in next) {
2380
+ if (pendingKeys.length) {
2381
+ nextKeysPending[prevKey] = pendingKeys;
2382
+ pendingKeys = [];
2383
+ }
2384
+ } else {
2385
+ pendingKeys.push(prevKey);
2386
+ }
2387
+ }
2388
+
2389
+ var i;
2390
+ var childMapping = {};
2391
+
2392
+ for (var nextKey in next) {
2393
+ if (nextKeysPending[nextKey]) {
2394
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
2395
+ var pendingNextKey = nextKeysPending[nextKey][i];
2396
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
2397
+ }
2398
+ }
2399
+
2400
+ childMapping[nextKey] = getValueForKey(nextKey);
2401
+ } // Finally, add the keys which didn't appear before any key in `next`
2402
+
2403
+
2404
+ for (i = 0; i < pendingKeys.length; i++) {
2405
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
2406
+ }
2407
+
2408
+ return childMapping;
2409
+ }
2410
+
2411
+ function getProp(child, prop, props) {
2412
+ return props[prop] != null ? props[prop] : child.props[prop];
2413
+ }
2414
+
2415
+ function getInitialChildMapping(props, onExited) {
2416
+ return getChildMapping(props.children, function (child) {
2417
+ return cloneElement(child, {
2418
+ onExited: onExited.bind(null, child),
2419
+ in: true,
2420
+ appear: getProp(child, 'appear', props),
2421
+ enter: getProp(child, 'enter', props),
2422
+ exit: getProp(child, 'exit', props)
2423
+ });
2424
+ });
2425
+ }
2426
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
2427
+ var nextChildMapping = getChildMapping(nextProps.children);
2428
+ var children = mergeChildMappings(prevChildMapping, nextChildMapping);
2429
+ Object.keys(children).forEach(function (key) {
2430
+ var child = children[key];
2431
+ if (!isValidElement(child)) return;
2432
+ var hasPrev = (key in prevChildMapping);
2433
+ var hasNext = (key in nextChildMapping);
2434
+ var prevChild = prevChildMapping[key];
2435
+ var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
2436
+
2437
+ if (hasNext && (!hasPrev || isLeaving)) {
2438
+ // console.log('entering', key)
2439
+ children[key] = cloneElement(child, {
2440
+ onExited: onExited.bind(null, child),
2441
+ in: true,
2442
+ exit: getProp(child, 'exit', nextProps),
2443
+ enter: getProp(child, 'enter', nextProps)
2444
+ });
2445
+ } else if (!hasNext && hasPrev && !isLeaving) {
2446
+ // item is old (exiting)
2447
+ // console.log('leaving', key)
2448
+ children[key] = cloneElement(child, {
2449
+ in: false
2450
+ });
2451
+ } else if (hasNext && hasPrev && isValidElement(prevChild)) {
2452
+ // item hasn't changed transition states
2453
+ // copy over the last transition props;
2454
+ // console.log('unchanged', key)
2455
+ children[key] = cloneElement(child, {
2456
+ onExited: onExited.bind(null, child),
2457
+ in: prevChild.props.in,
2458
+ exit: getProp(child, 'exit', nextProps),
2459
+ enter: getProp(child, 'enter', nextProps)
2460
+ });
2461
+ }
2462
+ });
2463
+ return children;
2464
+ }
2465
+
2466
+ var values = Object.values || function (obj) {
2467
+ return Object.keys(obj).map(function (k) {
2468
+ return obj[k];
2469
+ });
2470
+ };
2471
+
2472
+ var defaultProps = {
2473
+ component: 'div',
2474
+ childFactory: function childFactory(child) {
2475
+ return child;
2476
+ }
2477
+ };
2478
+ /**
2479
+ * The `<TransitionGroup>` component manages a set of transition components
2480
+ * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
2481
+ * components, `<TransitionGroup>` is a state machine for managing the mounting
2482
+ * and unmounting of components over time.
2483
+ *
2484
+ * Consider the example below. As items are removed or added to the TodoList the
2485
+ * `in` prop is toggled automatically by the `<TransitionGroup>`.
2486
+ *
2487
+ * Note that `<TransitionGroup>` does not define any animation behavior!
2488
+ * Exactly _how_ a list item animates is up to the individual transition
2489
+ * component. This means you can mix and match animations across different list
2490
+ * items.
2491
+ */
2492
+
2493
+ var TransitionGroup = /*#__PURE__*/function (_React$Component) {
2494
+ _inheritsLoose(TransitionGroup, _React$Component);
2495
+
2496
+ function TransitionGroup(props, context) {
2497
+ var _this;
2498
+
2499
+ _this = _React$Component.call(this, props, context) || this;
2500
+
2501
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
2502
+
2503
+
2504
+ _this.state = {
2505
+ contextValue: {
2506
+ isMounting: true
2507
+ },
2508
+ handleExited: handleExited,
2509
+ firstRender: true
2510
+ };
2511
+ return _this;
2512
+ }
2513
+
2514
+ var _proto = TransitionGroup.prototype;
2515
+
2516
+ _proto.componentDidMount = function componentDidMount() {
2517
+ this.mounted = true;
2518
+ this.setState({
2519
+ contextValue: {
2520
+ isMounting: false
2521
+ }
2522
+ });
2523
+ };
2524
+
2525
+ _proto.componentWillUnmount = function componentWillUnmount() {
2526
+ this.mounted = false;
2527
+ };
2528
+
2529
+ TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
2530
+ var prevChildMapping = _ref.children,
2531
+ handleExited = _ref.handleExited,
2532
+ firstRender = _ref.firstRender;
2533
+ return {
2534
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
2535
+ firstRender: false
2536
+ };
2537
+ } // node is `undefined` when user provided `nodeRef` prop
2538
+ ;
2539
+
2540
+ _proto.handleExited = function handleExited(child, node) {
2541
+ var currentChildMapping = getChildMapping(this.props.children);
2542
+ if (child.key in currentChildMapping) return;
2543
+
2544
+ if (child.props.onExited) {
2545
+ child.props.onExited(node);
2546
+ }
2547
+
2548
+ if (this.mounted) {
2549
+ this.setState(function (state) {
2550
+ var children = _extends({}, state.children);
2551
+
2552
+ delete children[child.key];
2553
+ return {
2554
+ children: children
2555
+ };
2556
+ });
2557
+ }
2558
+ };
2559
+
2560
+ _proto.render = function render() {
2561
+ var _this$props = this.props,
2562
+ Component = _this$props.component,
2563
+ childFactory = _this$props.childFactory,
2564
+ props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
2565
+
2566
+ var contextValue = this.state.contextValue;
2567
+ var children = values(this.state.children).map(childFactory);
2568
+ delete props.appear;
2569
+ delete props.enter;
2570
+ delete props.exit;
2571
+
2572
+ if (Component === null) {
2573
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
2574
+ value: contextValue
2575
+ }, children);
2576
+ }
2577
+
2578
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
2579
+ value: contextValue
2580
+ }, /*#__PURE__*/React__default.createElement(Component, props, children));
2581
+ };
2582
+
2583
+ return TransitionGroup;
2584
+ }(React__default.Component);
2585
+
2586
+ TransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? {
2587
+ /**
2588
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
2589
+ * behavior by providing a `component` prop.
2590
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
2591
+ * you can pass in `component={null}`. This is useful if the wrapping div
2592
+ * borks your css styles.
2593
+ */
2594
+ component: propTypes.exports.any,
2595
+
2596
+ /**
2597
+ * A set of `<Transition>` components, that are toggled `in` and out as they
2598
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
2599
+ * remember to spread them through if you are wrapping the `<Transition>` as
2600
+ * with our `<Fade>` example.
2601
+ *
2602
+ * While this component is meant for multiple `Transition` or `CSSTransition`
2603
+ * children, sometimes you may want to have a single transition child with
2604
+ * content that you want to be transitioned out and in when you change it
2605
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
2606
+ * the transition child as you change its content, this will cause
2607
+ * `TransitionGroup` to transition the child out and back in.
2608
+ */
2609
+ children: propTypes.exports.node,
2610
+
2611
+ /**
2612
+ * A convenience prop that enables or disables appear animations
2613
+ * for all children. Note that specifying this will override any defaults set
2614
+ * on individual children Transitions.
2615
+ */
2616
+ appear: propTypes.exports.bool,
2617
+
2618
+ /**
2619
+ * A convenience prop that enables or disables enter animations
2620
+ * for all children. Note that specifying this will override any defaults set
2621
+ * on individual children Transitions.
2622
+ */
2623
+ enter: propTypes.exports.bool,
2624
+
2625
+ /**
2626
+ * A convenience prop that enables or disables exit animations
2627
+ * for all children. Note that specifying this will override any defaults set
2628
+ * on individual children Transitions.
2629
+ */
2630
+ exit: propTypes.exports.bool,
2631
+
2632
+ /**
2633
+ * You may need to apply reactive updates to a child as it is exiting.
2634
+ * This is generally done by using `cloneElement` however in the case of an exiting
2635
+ * child the element has already been removed and not accessible to the consumer.
2636
+ *
2637
+ * If you do need to update a child as it leaves you can provide a `childFactory`
2638
+ * to wrap every child, even the ones that are leaving.
2639
+ *
2640
+ * @type Function(child: ReactElement) -> ReactElement
2641
+ */
2642
+ childFactory: propTypes.exports.func
2643
+ } : {};
2644
+ TransitionGroup.defaultProps = defaultProps;
2645
+
2646
+ /**
2647
+ * The `<ReplaceTransition>` component is a specialized `Transition` component
2648
+ * that animates between two children.
2649
+ *
2650
+ * ```jsx
2651
+ * <ReplaceTransition in>
2652
+ * <Fade><div>I appear first</div></Fade>
2653
+ * <Fade><div>I replace the above</div></Fade>
2654
+ * </ReplaceTransition>
2655
+ * ```
2656
+ */
2657
+
2658
+ var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
2659
+ _inheritsLoose(ReplaceTransition, _React$Component);
2660
+
2661
+ function ReplaceTransition() {
2662
+ var _this;
2663
+
2664
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
2665
+ _args[_key] = arguments[_key];
2666
+ }
2667
+
2668
+ _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
2669
+
2670
+ _this.handleEnter = function () {
2671
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2672
+ args[_key2] = arguments[_key2];
2673
+ }
2674
+
2675
+ return _this.handleLifecycle('onEnter', 0, args);
2676
+ };
2677
+
2678
+ _this.handleEntering = function () {
2679
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2680
+ args[_key3] = arguments[_key3];
2681
+ }
2682
+
2683
+ return _this.handleLifecycle('onEntering', 0, args);
2684
+ };
2685
+
2686
+ _this.handleEntered = function () {
2687
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
2688
+ args[_key4] = arguments[_key4];
2689
+ }
2690
+
2691
+ return _this.handleLifecycle('onEntered', 0, args);
2692
+ };
2693
+
2694
+ _this.handleExit = function () {
2695
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
2696
+ args[_key5] = arguments[_key5];
2697
+ }
2698
+
2699
+ return _this.handleLifecycle('onExit', 1, args);
2700
+ };
2701
+
2702
+ _this.handleExiting = function () {
2703
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
2704
+ args[_key6] = arguments[_key6];
2705
+ }
2706
+
2707
+ return _this.handleLifecycle('onExiting', 1, args);
2708
+ };
2709
+
2710
+ _this.handleExited = function () {
2711
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
2712
+ args[_key7] = arguments[_key7];
2713
+ }
2714
+
2715
+ return _this.handleLifecycle('onExited', 1, args);
2716
+ };
2717
+
2718
+ return _this;
2719
+ }
2720
+
2721
+ var _proto = ReplaceTransition.prototype;
2722
+
2723
+ _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
2724
+ var _child$props;
2725
+
2726
+ var children = this.props.children;
2727
+ var child = React__default.Children.toArray(children)[idx];
2728
+ if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
2729
+
2730
+ if (this.props[handler]) {
2731
+ var maybeNode = child.props.nodeRef ? undefined : ReactDOM.findDOMNode(this);
2732
+ this.props[handler](maybeNode);
2733
+ }
2734
+ };
2735
+
2736
+ _proto.render = function render() {
2737
+ var _this$props = this.props,
2738
+ children = _this$props.children,
2739
+ inProp = _this$props.in,
2740
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
2741
+
2742
+ var _React$Children$toArr = React__default.Children.toArray(children),
2743
+ first = _React$Children$toArr[0],
2744
+ second = _React$Children$toArr[1];
2745
+
2746
+ delete props.onEnter;
2747
+ delete props.onEntering;
2748
+ delete props.onEntered;
2749
+ delete props.onExit;
2750
+ delete props.onExiting;
2751
+ delete props.onExited;
2752
+ return /*#__PURE__*/React__default.createElement(TransitionGroup, props, inProp ? React__default.cloneElement(first, {
2753
+ key: 'first',
2754
+ onEnter: this.handleEnter,
2755
+ onEntering: this.handleEntering,
2756
+ onEntered: this.handleEntered
2757
+ }) : React__default.cloneElement(second, {
2758
+ key: 'second',
2759
+ onEnter: this.handleExit,
2760
+ onEntering: this.handleExiting,
2761
+ onEntered: this.handleExited
2762
+ }));
2763
+ };
2764
+
2765
+ return ReplaceTransition;
2766
+ }(React__default.Component);
2767
+
2768
+ ReplaceTransition.propTypes = process.env.NODE_ENV !== "production" ? {
2769
+ in: propTypes.exports.bool.isRequired,
2770
+ children: function children(props, propName) {
2771
+ if (React__default.Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
2772
+ return null;
2773
+ }
2774
+ } : {};
2775
+
2776
+ var _leaveRenders, _enterRenders;
2777
+
2778
+ function areChildrenDifferent(oldChildren, newChildren) {
2779
+ if (oldChildren === newChildren) return false;
2780
+
2781
+ if (React__default.isValidElement(oldChildren) && React__default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
2782
+ return false;
2783
+ }
2784
+
2785
+ return true;
2786
+ }
2787
+ /**
2788
+ * Enum of modes for SwitchTransition component
2789
+ * @enum { string }
2790
+ */
2791
+
2792
+
2793
+ var modes = {
2794
+ out: 'out-in',
2795
+ in: 'in-out'
2796
+ };
2797
+
2798
+ var callHook = function callHook(element, name, cb) {
2799
+ return function () {
2800
+ var _element$props;
2801
+
2802
+ element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
2803
+ cb();
2804
+ };
2805
+ };
2806
+
2807
+ var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
2808
+ var current = _ref.current,
2809
+ changeState = _ref.changeState;
2810
+ return React__default.cloneElement(current, {
2811
+ in: false,
2812
+ onExited: callHook(current, 'onExited', function () {
2813
+ changeState(ENTERING, null);
2814
+ })
2815
+ });
2816
+ }, _leaveRenders[modes.in] = function (_ref2) {
2817
+ var current = _ref2.current,
2818
+ changeState = _ref2.changeState,
2819
+ children = _ref2.children;
2820
+ return [current, React__default.cloneElement(children, {
2821
+ in: true,
2822
+ onEntered: callHook(children, 'onEntered', function () {
2823
+ changeState(ENTERING);
2824
+ })
2825
+ })];
2826
+ }, _leaveRenders);
2827
+ var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
2828
+ var children = _ref3.children,
2829
+ changeState = _ref3.changeState;
2830
+ return React__default.cloneElement(children, {
2831
+ in: true,
2832
+ onEntered: callHook(children, 'onEntered', function () {
2833
+ changeState(ENTERED, React__default.cloneElement(children, {
2834
+ in: true
2835
+ }));
2836
+ })
2837
+ });
2838
+ }, _enterRenders[modes.in] = function (_ref4) {
2839
+ var current = _ref4.current,
2840
+ children = _ref4.children,
2841
+ changeState = _ref4.changeState;
2842
+ return [React__default.cloneElement(current, {
2843
+ in: false,
2844
+ onExited: callHook(current, 'onExited', function () {
2845
+ changeState(ENTERED, React__default.cloneElement(children, {
2846
+ in: true
2847
+ }));
2848
+ })
2849
+ }), React__default.cloneElement(children, {
2850
+ in: true
2851
+ })];
2852
+ }, _enterRenders);
2853
+ /**
2854
+ * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
2855
+ * You can use it when you want to control the render between state transitions.
2856
+ * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
2857
+ *
2858
+ * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
2859
+ * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
2860
+ *
2861
+ * **Note**: If you want the animation to happen simultaneously
2862
+ * (that is, to have the old child removed and a new child inserted **at the same time**),
2863
+ * you should use
2864
+ * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
2865
+ * instead.
2866
+ *
2867
+ * ```jsx
2868
+ * function App() {
2869
+ * const [state, setState] = useState(false);
2870
+ * return (
2871
+ * <SwitchTransition>
2872
+ * <CSSTransition
2873
+ * key={state ? "Goodbye, world!" : "Hello, world!"}
2874
+ * addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
2875
+ * classNames='fade'
2876
+ * >
2877
+ * <button onClick={() => setState(state => !state)}>
2878
+ * {state ? "Goodbye, world!" : "Hello, world!"}
2879
+ * </button>
2880
+ * </CSSTransition>
2881
+ * </SwitchTransition>
2882
+ * );
2883
+ * }
2884
+ * ```
2885
+ *
2886
+ * ```css
2887
+ * .fade-enter{
2888
+ * opacity: 0;
2889
+ * }
2890
+ * .fade-exit{
2891
+ * opacity: 1;
2892
+ * }
2893
+ * .fade-enter-active{
2894
+ * opacity: 1;
2895
+ * }
2896
+ * .fade-exit-active{
2897
+ * opacity: 0;
2898
+ * }
2899
+ * .fade-enter-active,
2900
+ * .fade-exit-active{
2901
+ * transition: opacity 500ms;
2902
+ * }
2903
+ * ```
2904
+ */
2905
+
2906
+ var SwitchTransition = /*#__PURE__*/function (_React$Component) {
2907
+ _inheritsLoose(SwitchTransition, _React$Component);
2908
+
2909
+ function SwitchTransition() {
2910
+ var _this;
2911
+
2912
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2913
+ args[_key] = arguments[_key];
2914
+ }
2915
+
2916
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
2917
+ _this.state = {
2918
+ status: ENTERED,
2919
+ current: null
2920
+ };
2921
+ _this.appeared = false;
2922
+
2923
+ _this.changeState = function (status, current) {
2924
+ if (current === void 0) {
2925
+ current = _this.state.current;
2926
+ }
2927
+
2928
+ _this.setState({
2929
+ status: status,
2930
+ current: current
2931
+ });
2932
+ };
2933
+
2934
+ return _this;
2935
+ }
2936
+
2937
+ var _proto = SwitchTransition.prototype;
2938
+
2939
+ _proto.componentDidMount = function componentDidMount() {
2940
+ this.appeared = true;
2941
+ };
2942
+
2943
+ SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
2944
+ if (props.children == null) {
2945
+ return {
2946
+ current: null
2947
+ };
2948
+ }
2949
+
2950
+ if (state.status === ENTERING && props.mode === modes.in) {
2951
+ return {
2952
+ status: ENTERING
2953
+ };
2954
+ }
2955
+
2956
+ if (state.current && areChildrenDifferent(state.current, props.children)) {
2957
+ return {
2958
+ status: EXITING
2959
+ };
2960
+ }
2961
+
2962
+ return {
2963
+ current: React__default.cloneElement(props.children, {
2964
+ in: true
2965
+ })
2966
+ };
2967
+ };
2968
+
2969
+ _proto.render = function render() {
2970
+ var _this$props = this.props,
2971
+ children = _this$props.children,
2972
+ mode = _this$props.mode,
2973
+ _this$state = this.state,
2974
+ status = _this$state.status,
2975
+ current = _this$state.current;
2976
+ var data = {
2977
+ children: children,
2978
+ current: current,
2979
+ changeState: this.changeState,
2980
+ status: status
2981
+ };
2982
+ var component;
2983
+
2984
+ switch (status) {
2985
+ case ENTERING:
2986
+ component = enterRenders[mode](data);
2987
+ break;
2988
+
2989
+ case EXITING:
2990
+ component = leaveRenders[mode](data);
2991
+ break;
2992
+
2993
+ case ENTERED:
2994
+ component = current;
2995
+ }
2996
+
2997
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
2998
+ value: {
2999
+ isMounting: !this.appeared
3000
+ }
3001
+ }, component);
3002
+ };
3003
+
3004
+ return SwitchTransition;
3005
+ }(React__default.Component);
3006
+
3007
+ SwitchTransition.propTypes = process.env.NODE_ENV !== "production" ? {
3008
+ /**
3009
+ * Transition modes.
3010
+ * `out-in`: Current element transitions out first, then when complete, the new element transitions in.
3011
+ * `in-out`: New element transitions in first, then when complete, the current element transitions out.
3012
+ *
3013
+ * @type {'out-in'|'in-out'}
3014
+ */
3015
+ mode: propTypes.exports.oneOf([modes.in, modes.out]),
3016
+
3017
+ /**
3018
+ * Any `Transition` or `CSSTransition` component.
3019
+ */
3020
+ children: propTypes.exports.oneOfType([propTypes.exports.element.isRequired])
3021
+ } : {};
3022
+ SwitchTransition.defaultProps = {
3023
+ mode: modes.out
3024
+ };
3025
+
3026
+ var css_248z = ".gn-drawer__item{background-color:var(--g-color-base-background);bottom:0;height:100%;left:0;position:absolute;top:0;will-change:transform}.gn-drawer__item_direction_right{left:auto;right:0}.gn-drawer__item-transition-enter{transform:translate(-100%)}.gn-drawer__item-transition_direction_right-enter{transform:translate(100%)}.gn-drawer__item-transition-enter-active,.gn-drawer__item-transition_direction_right-enter-active{transform:translate(0);transition:transform .3s}.gn-drawer__item-transition-enter-done,.gn-drawer__item-transition_direction_right-enter-done{filter:blur(0);transform:translateZ(0)}.gn-drawer__item-transition-exit,.gn-drawer__item-transition_direction_right-exit{transform:translate(0)}.gn-drawer__item-transition-exit-active,.gn-drawer__item-transition_direction_right-exit-active{transition:transform .3s}.gn-drawer__item-transition-exit-active{transform:translate(-100%)}.gn-drawer__item-transition_direction_right-exit-active{transform:translate(100%)}.gn-drawer__item-transition-exit-done,.gn-drawer__item-transition_direction_right-exit-done{visibility:hidden}.gn-drawer__veil{background-color:var(--g-color-sfx-veil);bottom:0;left:0;position:absolute;right:0;top:0}.gn-drawer__veil-transition-enter{opacity:0}.gn-drawer__veil-transition-enter-active{opacity:1;transition:opacity .3s}.gn-drawer__veil-transition-exit{opacity:1}.gn-drawer__veil-transition-exit-active{opacity:0;transition:opacity .3s}.gn-drawer__veil-transition-exit-done{visibility:hidden}";
3027
+ styleInject(css_248z);
3028
+
3029
+ const b = block('drawer');
3030
+ const TIMEOUT = 300;
3031
+ const DrawerItem = ({ visible, content, direction, className }) => {
3032
+ const itemRef = React__default.useRef(null);
3033
+ const cssDirection = direction === 'left' ? undefined : direction;
3034
+ return (React__default.createElement(CSSTransition, { in: visible, timeout: TIMEOUT, unmountOnExit: true, classNames: b('item-transition', { direction: cssDirection }), nodeRef: itemRef },
3035
+ React__default.createElement("div", { ref: itemRef, className: b('item', { direction: cssDirection }, className) }, content)));
3036
+ };
3037
+ const Drawer = ({ className, children, style, onVeilClick, onEscape, preventScrollBody = true, }) => {
3038
+ let someItemVisible = false;
3039
+ React__default.Children.forEach(children, (child) => {
3040
+ const childElem = child;
3041
+ if (childElem.type === DrawerItem) {
3042
+ const childVisible = Boolean(childElem.props.visible);
3043
+ if (childVisible) {
3044
+ someItemVisible = true;
3045
+ }
3046
+ }
3047
+ });
3048
+ React__default.useEffect(() => {
3049
+ function onKeyDown(event) {
3050
+ if (event.key === 'Escape') {
3051
+ onEscape === null || onEscape === void 0 ? void 0 : onEscape();
3052
+ }
3053
+ }
3054
+ if (someItemVisible) {
3055
+ window.addEventListener('keydown', onKeyDown);
3056
+ }
3057
+ return () => {
3058
+ window.removeEventListener('keydown', onKeyDown);
3059
+ };
3060
+ }, [onEscape, someItemVisible]);
3061
+ useBodyScrollLock({ enabled: preventScrollBody && someItemVisible });
3062
+ const containerRef = React__default.useRef(null);
3063
+ const veilRef = React__default.useRef(null);
3064
+ return (React__default.createElement(Transition, { in: someItemVisible, timeout: { enter: 0, exit: TIMEOUT }, mountOnEnter: true, unmountOnExit: true, nodeRef: containerRef }, (state) => {
3065
+ const childrenVisible = someItemVisible && state === 'entered';
3066
+ return (React__default.createElement("div", { ref: containerRef, className: b(null, className), style: style },
3067
+ React__default.createElement(CSSTransition, { in: childrenVisible, timeout: TIMEOUT, unmountOnExit: true, classNames: b('veil-transition'), nodeRef: veilRef },
3068
+ React__default.createElement("div", { ref: veilRef, className: b('veil'), onClick: onVeilClick })),
3069
+ React__default.Children.map(children, (child) => {
3070
+ const childElem = child;
3071
+ if (childElem.type === DrawerItem) {
3072
+ const childVisible = Boolean(childElem.props.visible);
3073
+ return React__default.cloneElement(childElem, Object.assign(Object.assign({}, childElem.props), { visible: childVisible && childrenVisible }));
3074
+ }
3075
+ return child;
3076
+ })));
3077
+ }));
3078
+ };
3079
+
3080
+ export { Drawer, DrawerItem };
3081
+ //# sourceMappingURL=Drawer.js.map