@expo/cli 1.0.0-canary-20250404-87e2506 → 1.0.0-canary-20250630-547cd82

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 (182) hide show
  1. package/README.md +33 -24
  2. package/build/bin/cli +1 -1
  3. package/build/metro-require/require.js +6 -4
  4. package/build/src/api/user/actions.js +25 -11
  5. package/build/src/api/user/actions.js.map +1 -1
  6. package/build/src/customize/templates.js +15 -1
  7. package/build/src/customize/templates.js.map +1 -1
  8. package/build/src/export/exportApp.js +26 -14
  9. package/build/src/export/exportApp.js.map +1 -1
  10. package/build/src/export/exportAsync.js +6 -0
  11. package/build/src/export/exportAsync.js.map +1 -1
  12. package/build/src/export/exportHermes.js +2 -2
  13. package/build/src/export/exportHermes.js.map +1 -1
  14. package/build/src/export/persistMetroAssets.js.map +1 -1
  15. package/build/src/install/checkPackages.js +22 -4
  16. package/build/src/install/checkPackages.js.map +1 -1
  17. package/build/src/install/index.js +3 -1
  18. package/build/src/install/index.js.map +1 -1
  19. package/build/src/install/resolveOptions.js +7 -2
  20. package/build/src/install/resolveOptions.js.map +1 -1
  21. package/build/src/install/utils/checkPackagesCompatibility.js +1 -1
  22. package/build/src/install/utils/checkPackagesCompatibility.js.map +1 -1
  23. package/build/src/lint/ESlintPrerequisite.js +32 -48
  24. package/build/src/lint/ESlintPrerequisite.js.map +1 -1
  25. package/build/src/lint/index.js +45 -47
  26. package/build/src/lint/index.js.map +1 -1
  27. package/build/src/lint/lintAsync.js +150 -4
  28. package/build/src/lint/lintAsync.js.map +1 -1
  29. package/build/src/lint/resolveOptions.js +115 -0
  30. package/build/src/lint/resolveOptions.js.map +1 -0
  31. package/build/src/prebuild/renameTemplateAppName.js +4 -1
  32. package/build/src/prebuild/renameTemplateAppName.js.map +1 -1
  33. package/build/src/prebuild/resolveTemplate.js +4 -4
  34. package/build/src/prebuild/resolveTemplate.js.map +1 -1
  35. package/build/src/prebuild/updatePackageJson.js +19 -9
  36. package/build/src/prebuild/updatePackageJson.js.map +1 -1
  37. package/build/src/run/android/resolveOptions.js +13 -1
  38. package/build/src/run/android/resolveOptions.js.map +1 -1
  39. package/build/src/run/android/runAndroidAsync.js +39 -17
  40. package/build/src/run/android/runAndroidAsync.js.map +1 -1
  41. package/build/src/run/ios/XcodeBuild.js +3 -3
  42. package/build/src/run/ios/XcodeBuild.js.map +1 -1
  43. package/build/src/run/ios/options/resolveOptions.js +13 -1
  44. package/build/src/run/ios/options/resolveOptions.js.map +1 -1
  45. package/build/src/run/ios/runIosAsync.js +38 -7
  46. package/build/src/run/ios/runIosAsync.js.map +1 -1
  47. package/build/src/start/doctor/SecurityBinPrerequisite.js +1 -1
  48. package/build/src/start/doctor/SecurityBinPrerequisite.js.map +1 -1
  49. package/build/src/start/doctor/apple/XcodePrerequisite.js +1 -1
  50. package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
  51. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +1 -1
  52. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
  53. package/build/src/start/doctor/dependencies/resolvePackages.js +1 -1
  54. package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -1
  55. package/build/src/start/doctor/ngrok/ExternalModule.js +1 -1
  56. package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
  57. package/build/src/start/index.js +1 -1
  58. package/build/src/start/index.js.map +1 -1
  59. package/build/src/start/platforms/PlatformManager.js +1 -1
  60. package/build/src/start/platforms/PlatformManager.js.map +1 -1
  61. package/build/src/start/platforms/android/AndroidPlatformManager.js +1 -1
  62. package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
  63. package/build/src/start/platforms/android/getDevices.js +1 -1
  64. package/build/src/start/platforms/android/getDevices.js.map +1 -1
  65. package/build/src/start/platforms/ios/AppleDeviceManager.js +1 -1
  66. package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
  67. package/build/src/start/platforms/ios/xcrun.js +1 -1
  68. package/build/src/start/platforms/ios/xcrun.js.map +1 -1
  69. package/build/src/start/project/dotExpo.js +5 -0
  70. package/build/src/start/project/dotExpo.js.map +1 -1
  71. package/build/src/start/resolveOptions.js +3 -0
  72. package/build/src/start/resolveOptions.js.map +1 -1
  73. package/build/src/start/server/metro/MetroBundlerDevServer.js +38 -26
  74. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  75. package/build/src/start/server/metro/MetroTerminalReporter.js +29 -2
  76. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  77. package/build/src/start/server/metro/createExpoFallbackResolver.js +6 -4
  78. package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
  79. package/build/src/start/server/metro/createJResolver.js +2 -2
  80. package/build/src/start/server/metro/createJResolver.js.map +1 -1
  81. package/build/src/start/server/metro/createServerComponentsMiddleware.js +16 -5
  82. package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
  83. package/build/src/start/server/metro/debugging/createDebugMiddleware.js +19 -19
  84. package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
  85. package/build/src/start/server/metro/externals.js +1 -1
  86. package/build/src/start/server/metro/externals.js.map +1 -1
  87. package/build/src/start/server/metro/instantiateMetro.js +13 -8
  88. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  89. package/build/src/start/server/metro/log-box/LogBoxSymbolication.js +21 -2
  90. package/build/src/start/server/metro/log-box/LogBoxSymbolication.js.map +1 -1
  91. package/build/src/start/server/metro/log-box/formatProjectFilePath.js +15 -12
  92. package/build/src/start/server/metro/log-box/formatProjectFilePath.js.map +1 -1
  93. package/build/src/start/server/metro/metroErrorInterface.js +19 -8
  94. package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
  95. package/build/src/start/server/metro/runServer-fork.js +1 -1
  96. package/build/src/start/server/metro/runServer-fork.js.map +1 -1
  97. package/build/src/start/server/metro/withMetroMultiPlatform.js +8 -2
  98. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  99. package/build/src/start/server/middleware/CorsMiddleware.js +1 -1
  100. package/build/src/start/server/middleware/CorsMiddleware.js.map +1 -1
  101. package/build/src/start/server/middleware/ManifestMiddleware.js +4 -8
  102. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  103. package/build/src/start/server/middleware/inspector/JsInspector.js +2 -25
  104. package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
  105. package/build/src/start/server/middleware/metroOptions.js +2 -26
  106. package/build/src/start/server/middleware/metroOptions.js.map +1 -1
  107. package/build/src/utils/build-cache-providers/helpers.js +61 -0
  108. package/build/src/utils/build-cache-providers/helpers.js.map +1 -0
  109. package/build/src/utils/build-cache-providers/index.js +283 -0
  110. package/build/src/utils/build-cache-providers/index.js.map +1 -0
  111. package/build/src/utils/codesigning.js +14 -2
  112. package/build/src/utils/codesigning.js.map +1 -1
  113. package/build/src/utils/exit.js +0 -1
  114. package/build/src/utils/exit.js.map +1 -1
  115. package/build/src/utils/ip.js +7 -104
  116. package/build/src/utils/ip.js.map +1 -1
  117. package/build/src/utils/modifyConfigAsync.js +1 -1
  118. package/build/src/utils/modifyConfigAsync.js.map +1 -1
  119. package/build/src/utils/resolveArgs.js +8 -0
  120. package/build/src/utils/resolveArgs.js.map +1 -1
  121. package/build/src/utils/scheme.js +1 -1
  122. package/build/src/utils/scheme.js.map +1 -1
  123. package/build/src/utils/telemetry/clients/FetchClient.js +2 -2
  124. package/build/src/utils/telemetry/clients/FetchClient.js.map +1 -1
  125. package/build/src/utils/telemetry/utils/context.js +1 -1
  126. package/build/src/utils/tsconfig/evaluateTsConfig.js +7 -2
  127. package/build/src/utils/tsconfig/evaluateTsConfig.js.map +1 -1
  128. package/build/src/utils/variadic.js +63 -6
  129. package/build/src/utils/variadic.js.map +1 -1
  130. package/package.json +20 -20
  131. package/static/canary/react-is/cjs/react-is.development.js +118 -185
  132. package/static/canary/react-is/cjs/react-is.production.js +2 -2
  133. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js +16582 -26565
  134. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js +3495 -3357
  135. package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js +3929 -3801
  136. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16869 -27032
  137. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3535 -3428
  138. package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4198 -4095
  139. package/static/canary/scheduler/cjs/scheduler-unstable_mock.development.js +387 -684
  140. package/static/canary/scheduler/cjs/scheduler-unstable_mock.production.js +0 -9
  141. package/static/canary/scheduler/cjs/scheduler-unstable_post_task.development.js +137 -195
  142. package/static/canary/scheduler/cjs/scheduler-unstable_post_task.production.js +0 -5
  143. package/static/canary/scheduler/cjs/scheduler.development.js +339 -600
  144. package/static/canary/scheduler/cjs/scheduler.native.development.js +324 -512
  145. package/static/canary/scheduler/cjs/scheduler.native.production.js +6 -5
  146. package/static/canary/scheduler/cjs/scheduler.production.js +16 -17
  147. package/static/canary-full/react/cjs/react-compiler-runtime.development.js +13 -68
  148. package/static/canary-full/react/cjs/react-jsx-dev-runtime.development.js +317 -1251
  149. package/static/canary-full/react/cjs/react-jsx-dev-runtime.react-server.development.js +353 -1286
  150. package/static/canary-full/react/cjs/react-jsx-runtime.development.js +326 -1279
  151. package/static/canary-full/react/cjs/react-jsx-runtime.react-server.development.js +353 -1286
  152. package/static/canary-full/react/cjs/react.development.js +1204 -2771
  153. package/static/canary-full/react/cjs/react.production.js +25 -20
  154. package/static/canary-full/react/cjs/react.react-server.development.js +783 -2162
  155. package/static/canary-full/react/cjs/react.react-server.production.js +13 -63
  156. package/static/canary-full/react/package.json +1 -1
  157. package/static/canary-full/react-dom/cjs/react-dom-client.development.js +24847 -37099
  158. package/static/canary-full/react-dom/cjs/react-dom-client.production.js +8261 -7475
  159. package/static/canary-full/react-dom/cjs/react-dom-profiling.development.js +25252 -37571
  160. package/static/canary-full/react-dom/cjs/react-dom-profiling.profiling.js +9442 -8662
  161. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.browser.development.js +8944 -11568
  162. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.browser.production.js +1378 -944
  163. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.node.development.js +8944 -11568
  164. package/static/canary-full/react-dom/cjs/react-dom-server-legacy.node.production.js +1386 -954
  165. package/static/canary-full/react-dom/cjs/react-dom-server.browser.development.js +9344 -11600
  166. package/static/canary-full/react-dom/cjs/react-dom-server.browser.production.js +1545 -954
  167. package/static/canary-full/react-dom/cjs/react-dom-server.bun.development.js +8286 -11064
  168. package/static/canary-full/react-dom/cjs/react-dom-server.bun.production.js +1437 -976
  169. package/static/canary-full/react-dom/cjs/react-dom-server.edge.development.js +9356 -11609
  170. package/static/canary-full/react-dom/cjs/react-dom-server.edge.production.js +1542 -970
  171. package/static/canary-full/react-dom/cjs/react-dom-server.node.development.js +9227 -11571
  172. package/static/canary-full/react-dom/cjs/react-dom-server.node.production.js +1787 -1183
  173. package/static/canary-full/react-dom/cjs/react-dom-test-utils.development.js +13 -59
  174. package/static/canary-full/react-dom/cjs/react-dom.development.js +402 -604
  175. package/static/canary-full/react-dom/cjs/react-dom.production.js +4 -3
  176. package/static/canary-full/react-dom/cjs/react-dom.react-server.development.js +322 -382
  177. package/static/canary-full/react-dom/cjs/react-dom.react-server.production.js +6 -7
  178. package/static/canary-full/react-dom/package.json +5 -5
  179. package/static/canary-full/react-dom/static.browser.js +1 -0
  180. package/static/canary-full/react-dom/static.edge.js +1 -0
  181. package/static/canary-full/react-dom/static.node.js +1 -0
  182. package/static/template/eslint.config.js +10 -0
@@ -8,2810 +8,1243 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
-
16
- 'use strict';
17
-
18
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
19
- if (
20
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
21
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
22
- 'function'
23
- ) {
24
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
25
- }
26
- var ReactVersion = '19.0.0-beta-4508873393-20240430';
27
-
28
- // -----------------------------------------------------------------------------
29
-
30
- var enableScopeAPI = false; // Experimental Create Event Handle API.
31
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
32
-
33
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
34
- // as a normal prop instead of stripping it from the props object.
35
- // Passes `ref` as a normal prop instead of stripping it from the props object
36
- // during element creation.
37
-
38
- var enableRefAsProp = true;
39
- // This allows us to land breaking changes to remove legacy mode APIs in experimental builds
40
- // before removing them in stable in the next Major
41
-
42
- var disableLegacyMode = true;
43
-
44
- var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
45
- // stuff. Intended to enable React core members to more easily debug scheduling
46
- // issues in DEV builds.
47
-
48
- var enableDebugTracing = false;
49
-
50
- var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
51
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
52
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
53
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
54
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
55
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
56
-
57
- var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
58
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
59
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
60
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
61
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
62
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
63
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
64
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
65
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
66
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
67
- function getIteratorFn(maybeIterable) {
68
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
69
- return null;
70
- }
71
-
72
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
73
-
74
- if (typeof maybeIterator === 'function') {
75
- return maybeIterator;
76
- }
77
-
78
- return null;
79
- }
80
-
81
- var ReactSharedInternals = {
82
- H: null,
83
- A: null,
84
- T: null
85
- };
86
-
87
- {
88
- ReactSharedInternals.actQueue = null;
89
- ReactSharedInternals.isBatchingLegacy = false;
90
- ReactSharedInternals.didScheduleLegacyUpdate = false;
91
- ReactSharedInternals.didUsePromise = false;
92
- ReactSharedInternals.thrownErrors = [];
93
- var currentExtraStackFrame = null;
94
-
95
- ReactSharedInternals.setExtraStackFrame = function (stack) {
96
- currentExtraStackFrame = stack;
97
- }; // Stack implementation injected by the current renderer.
98
-
99
-
100
- ReactSharedInternals.getCurrentStack = null;
101
-
102
- ReactSharedInternals.getStackAddendum = function () {
103
- var stack = ''; // Add an extra top frame while an element is being validated
104
-
105
- if (currentExtraStackFrame) {
106
- stack += currentExtraStackFrame;
107
- } // Delegate to the injected renderer-specific implementation
108
-
109
-
110
- var impl = ReactSharedInternals.getCurrentStack;
111
-
112
- if (impl) {
113
- stack += impl() || '';
114
- }
115
-
116
- return stack;
117
- };
118
- }
119
-
120
- // by calls to these methods by a Babel plugin.
121
- //
122
- // In PROD (or in packages without access to React internals),
123
- // they are left as they are instead.
124
-
125
- function warn(format) {
126
- {
127
- {
128
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
129
- args[_key - 1] = arguments[_key];
130
- }
131
-
132
- printWarning('warn', format, args);
133
- }
134
- }
135
- }
136
- function error(format) {
137
- {
138
- {
139
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
140
- args[_key2 - 1] = arguments[_key2];
141
- }
142
-
143
- printWarning('error', format, args);
144
- }
145
- }
146
- }
147
-
148
- function printWarning(level, format, args) {
149
- // When changing this logic, you might want to also
150
- // update consoleWithStackDev.www.js as well.
151
- {
152
- var stack = ReactSharedInternals.getStackAddendum();
153
-
154
- if (stack !== '') {
155
- format += '%s';
156
- args = args.concat([stack]);
157
- } // eslint-disable-next-line react-internal/safe-string-coercion
158
-
159
-
160
- var argsWithFormat = args.map(function (item) {
161
- return String(item);
162
- }); // Careful: RN currently depends on this prefix
163
-
164
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
165
- // breaks IE9: https://github.com/facebook/react/issues/13610
166
- // eslint-disable-next-line react-internal/no-production-logging
167
-
168
- Function.prototype.apply.call(console[level], console, argsWithFormat);
169
- }
170
- }
171
-
172
- var didWarnStateUpdateForUnmountedComponent = {};
173
-
174
- function warnNoop(publicInstance, callerName) {
175
- {
176
- var _constructor = publicInstance.constructor;
177
- var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
178
- var warningKey = componentName + "." + callerName;
179
-
180
- if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
181
- return;
182
- }
183
-
184
- error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
185
-
186
- didWarnStateUpdateForUnmountedComponent[warningKey] = true;
187
- }
188
- }
189
- /**
190
- * This is the abstract API for an update queue.
191
- */
192
-
193
-
194
- var ReactNoopUpdateQueue = {
195
- /**
196
- * Checks whether or not this composite component is mounted.
197
- * @param {ReactClass} publicInstance The instance we want to test.
198
- * @return {boolean} True if mounted, false otherwise.
199
- * @protected
200
- * @final
201
- */
202
- isMounted: function (publicInstance) {
203
- return false;
204
- },
205
-
206
- /**
207
- * Forces an update. This should only be invoked when it is known with
208
- * certainty that we are **not** in a DOM transaction.
209
- *
210
- * You may want to call this when you know that some deeper aspect of the
211
- * component's state has changed but `setState` was not called.
212
- *
213
- * This will not invoke `shouldComponentUpdate`, but it will invoke
214
- * `componentWillUpdate` and `componentDidUpdate`.
215
- *
216
- * @param {ReactClass} publicInstance The instance that should rerender.
217
- * @param {?function} callback Called after component is updated.
218
- * @param {?string} callerName name of the calling function in the public API.
219
- * @internal
220
- */
221
- enqueueForceUpdate: function (publicInstance, callback, callerName) {
222
- warnNoop(publicInstance, 'forceUpdate');
223
- },
224
-
225
- /**
226
- * Replaces all of the state. Always use this or `setState` to mutate state.
227
- * You should treat `this.state` as immutable.
228
- *
229
- * There is no guarantee that `this.state` will be immediately updated, so
230
- * accessing `this.state` after calling this method may return the old value.
231
- *
232
- * @param {ReactClass} publicInstance The instance that should rerender.
233
- * @param {object} completeState Next state.
234
- * @param {?function} callback Called after component is updated.
235
- * @param {?string} callerName name of the calling function in the public API.
236
- * @internal
237
- */
238
- enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
239
- warnNoop(publicInstance, 'replaceState');
240
- },
241
-
242
- /**
243
- * Sets a subset of the state. This only exists because _pendingState is
244
- * internal. This provides a merging strategy that is not available to deep
245
- * properties which is confusing. TODO: Expose pendingState or don't use it
246
- * during the merge.
247
- *
248
- * @param {ReactClass} publicInstance The instance that should rerender.
249
- * @param {object} partialState Next partial state to be merged with state.
250
- * @param {?function} callback Called after component is updated.
251
- * @param {?string} Name of the calling function in the public API.
252
- * @internal
253
- */
254
- enqueueSetState: function (publicInstance, partialState, callback, callerName) {
255
- warnNoop(publicInstance, 'setState');
256
- }
257
- };
258
-
259
- var assign = Object.assign;
260
-
261
- var emptyObject = {};
262
-
263
- {
264
- Object.freeze(emptyObject);
265
- }
266
- /**
267
- * Base class helpers for the updating state of a component.
268
- */
269
-
270
-
271
- function Component(props, context, updater) {
272
- this.props = props;
273
- this.context = context; // If a component has string refs, we will assign a different object later.
274
-
275
- this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
276
- // renderer.
277
-
278
- this.updater = updater || ReactNoopUpdateQueue;
279
- }
280
-
281
- Component.prototype.isReactComponent = {};
282
- /**
283
- * Sets a subset of the state. Always use this to mutate
284
- * state. You should treat `this.state` as immutable.
285
- *
286
- * There is no guarantee that `this.state` will be immediately updated, so
287
- * accessing `this.state` after calling this method may return the old value.
288
- *
289
- * There is no guarantee that calls to `setState` will run synchronously,
290
- * as they may eventually be batched together. You can provide an optional
291
- * callback that will be executed when the call to setState is actually
292
- * completed.
293
- *
294
- * When a function is provided to setState, it will be called at some point in
295
- * the future (not synchronously). It will be called with the up to date
296
- * component arguments (state, props, context). These values can be different
297
- * from this.* because your function may be called after receiveProps but before
298
- * shouldComponentUpdate, and this new state, props, and context will not yet be
299
- * assigned to this.
300
- *
301
- * @param {object|function} partialState Next partial state or function to
302
- * produce next partial state to be merged with current state.
303
- * @param {?function} callback Called after state is updated.
304
- * @final
305
- * @protected
306
- */
307
-
308
- Component.prototype.setState = function (partialState, callback) {
309
- if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
310
- throw new Error('takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
311
- }
312
-
313
- this.updater.enqueueSetState(this, partialState, callback, 'setState');
314
- };
315
- /**
316
- * Forces an update. This should only be invoked when it is known with
317
- * certainty that we are **not** in a DOM transaction.
318
- *
319
- * You may want to call this when you know that some deeper aspect of the
320
- * component's state has changed but `setState` was not called.
321
- *
322
- * This will not invoke `shouldComponentUpdate`, but it will invoke
323
- * `componentWillUpdate` and `componentDidUpdate`.
324
- *
325
- * @param {?function} callback Called after update is complete.
326
- * @final
327
- * @protected
328
- */
329
-
330
-
331
- Component.prototype.forceUpdate = function (callback) {
332
- this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
333
- };
334
- /**
335
- * Deprecated APIs. These APIs used to exist on classic React classes but since
336
- * we would like to deprecate them, we're not going to move them over to this
337
- * modern base class. Instead, we define a getter that warns if it's accessed.
338
- */
339
-
340
-
341
- {
342
- var deprecatedAPIs = {
343
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
344
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
345
- };
346
-
347
- var defineDeprecationWarning = function (methodName, info) {
348
- Object.defineProperty(Component.prototype, methodName, {
349
- get: function () {
350
- warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
351
-
352
- return undefined;
353
- }
354
- });
355
- };
356
-
357
- for (var fnName in deprecatedAPIs) {
358
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
359
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
360
- }
361
- }
362
- }
363
-
364
- function ComponentDummy() {}
365
-
366
- ComponentDummy.prototype = Component.prototype;
367
- /**
368
- * Convenience component with default shallow equality check for sCU.
369
- */
370
-
371
- function PureComponent(props, context, updater) {
372
- this.props = props;
373
- this.context = context; // If a component has string refs, we will assign a different object later.
374
-
375
- this.refs = emptyObject;
376
- this.updater = updater || ReactNoopUpdateQueue;
377
- }
378
-
379
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
380
- pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
381
-
382
- assign(pureComponentPrototype, Component.prototype);
383
- pureComponentPrototype.isPureReactComponent = true;
384
-
385
- // an immutable object with a single mutable value
386
- function createRef() {
387
- var refObject = {
388
- current: null
389
- };
390
-
391
- {
392
- Object.seal(refObject);
393
- }
394
-
395
- return refObject;
396
- }
397
-
398
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
399
-
400
- function isArray(a) {
401
- return isArrayImpl(a);
402
- }
403
-
404
- /*
405
- * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
406
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
407
- *
408
- * The functions in this module will throw an easier-to-understand,
409
- * easier-to-debug exception with a clear errors message message explaining the
410
- * problem. (Instead of a confusing exception thrown inside the implementation
411
- * of the `value` object).
412
- */
413
- // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
414
- function typeName(value) {
415
- {
416
- // toStringTag is needed for namespaced types like Temporal.Instant
417
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
418
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
419
-
420
- return type;
421
- }
422
- } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
423
-
424
-
425
- function willCoercionThrow(value) {
426
- {
427
- try {
428
- testStringCoercion(value);
429
- return false;
430
- } catch (e) {
431
- return true;
432
- }
433
- }
434
- }
435
-
436
- function testStringCoercion(value) {
437
- // If you ended up here by following an exception call stack, here's what's
438
- // happened: you supplied an object or symbol value to React (as a prop, key,
439
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
440
- // coerce it to a string using `'' + value`, an exception was thrown.
441
- //
442
- // The most common types that will cause this exception are `Symbol` instances
443
- // and Temporal objects like `Temporal.Instant`. But any object that has a
444
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
445
- // exception. (Library authors do this to prevent users from using built-in
446
- // numeric operators like `+` or comparison operators like `>=` because custom
447
- // methods are needed to perform accurate arithmetic or comparison.)
448
- //
449
- // To fix the problem, coerce this object or symbol value to a string before
450
- // passing it to React. The most reliable way is usually `String(value)`.
451
- //
452
- // To find which value is throwing, check the browser or debugger console.
453
- // Before this exception was thrown, there should be `console.error` output
454
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
455
- // problem and how that type was used: key, atrribute, input value prop, etc.
456
- // In most cases, this console output also shows the component and its
457
- // ancestor components where the exception happened.
458
- //
459
- // eslint-disable-next-line react-internal/safe-string-coercion
460
- return '' + value;
461
- }
462
- function checkKeyStringCoercion(value) {
463
- {
464
- if (willCoercionThrow(value)) {
465
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));
466
-
467
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
468
- }
469
- }
470
- }
471
-
472
- function getWrappedName(outerType, innerType, wrapperName) {
473
- var displayName = outerType.displayName;
474
-
475
- if (displayName) {
476
- return displayName;
477
- }
478
-
479
- var functionName = innerType.displayName || innerType.name || '';
480
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
481
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
482
-
483
-
484
- function getContextName(type) {
485
- return type.displayName || 'Context';
486
- }
487
-
488
- var REACT_CLIENT_REFERENCE$2 = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
489
-
490
- function getComponentNameFromType(type) {
491
- if (type == null) {
492
- // Host root, text node or just invalid type.
493
- return null;
494
- }
495
-
496
- if (typeof type === 'function') {
497
- if (type.$$typeof === REACT_CLIENT_REFERENCE$2) {
498
- // TODO: Create a convention for naming client references with debug info.
499
- return null;
500
- }
501
-
502
- return type.displayName || type.name || null;
503
- }
504
-
505
- if (typeof type === 'string') {
506
- return type;
507
- }
508
-
509
- switch (type) {
510
- case REACT_FRAGMENT_TYPE:
511
- return 'Fragment';
512
-
513
- case REACT_PORTAL_TYPE:
514
- return 'Portal';
515
-
516
- case REACT_PROFILER_TYPE:
517
- return 'Profiler';
518
-
519
- case REACT_STRICT_MODE_TYPE:
520
- return 'StrictMode';
521
-
522
- case REACT_SUSPENSE_TYPE:
523
- return 'Suspense';
524
-
525
- case REACT_SUSPENSE_LIST_TYPE:
526
- return 'SuspenseList';
527
-
528
- }
529
-
530
- if (typeof type === 'object') {
531
- {
532
- if (typeof type.tag === 'number') {
533
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
534
- }
535
- }
536
-
537
- switch (type.$$typeof) {
538
- case REACT_PROVIDER_TYPE:
539
- {
540
- return null;
541
- }
542
-
543
- case REACT_CONTEXT_TYPE:
544
- var context = type;
545
-
546
- {
547
- return getContextName(context) + '.Provider';
548
- }
549
-
550
- case REACT_CONSUMER_TYPE:
551
- {
552
- var consumer = type;
553
- return getContextName(consumer._context) + '.Consumer';
554
- }
555
-
556
- case REACT_FORWARD_REF_TYPE:
557
- return getWrappedName(type, type.render, 'ForwardRef');
558
-
559
- case REACT_MEMO_TYPE:
560
- var outerName = type.displayName || null;
561
-
562
- if (outerName !== null) {
563
- return outerName;
564
- }
565
-
566
- return getComponentNameFromType(type.type) || 'Memo';
567
-
568
- case REACT_LAZY_TYPE:
569
- {
570
- var lazyComponent = type;
571
- var payload = lazyComponent._payload;
572
- var init = lazyComponent._init;
573
-
574
- try {
575
- return getComponentNameFromType(init(payload));
576
- } catch (x) {
577
- return null;
578
- }
579
- }
580
- }
581
- }
582
-
583
- return null;
584
- }
585
-
586
- // $FlowFixMe[method-unbinding]
587
- var hasOwnProperty = Object.prototype.hasOwnProperty;
588
-
589
- var REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference');
590
- function isValidElementType(type) {
591
- if (typeof type === 'string' || typeof type === 'function') {
592
- return true;
593
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
594
-
595
-
596
- if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableTransitionTracing ) {
597
- return true;
598
- }
599
-
600
- if (typeof type === 'object' && type !== null) {
601
- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
602
- // types supported by any Flight configuration anywhere since
603
- // we don't know which Flight build this will end up being used
604
- // with.
605
- type.$$typeof === REACT_CLIENT_REFERENCE$1 || type.getModuleId !== undefined) {
606
- return true;
607
- }
608
- }
609
-
610
- return false;
611
- }
612
-
613
- // Helpers to patch console.logs to avoid logging during side-effect free
614
- // replaying on render function. This currently only patches the object
615
- // lazily which won't cover if the log function was extracted eagerly.
616
- // We could also eagerly patch the method.
617
- var disabledDepth = 0;
618
- var prevLog;
619
- var prevInfo;
620
- var prevWarn;
621
- var prevError;
622
- var prevGroup;
623
- var prevGroupCollapsed;
624
- var prevGroupEnd;
625
-
626
- function disabledLog() {}
627
-
628
- disabledLog.__reactDisabledLog = true;
629
- function disableLogs() {
630
- {
631
- if (disabledDepth === 0) {
632
- /* eslint-disable react-internal/no-production-logging */
633
- prevLog = console.log;
634
- prevInfo = console.info;
635
- prevWarn = console.warn;
636
- prevError = console.error;
637
- prevGroup = console.group;
638
- prevGroupCollapsed = console.groupCollapsed;
639
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
640
-
641
- var props = {
642
- configurable: true,
643
- enumerable: true,
644
- value: disabledLog,
645
- writable: true
646
- }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
647
-
648
- Object.defineProperties(console, {
649
- info: props,
650
- log: props,
651
- warn: props,
652
- error: props,
653
- group: props,
654
- groupCollapsed: props,
655
- groupEnd: props
656
- });
657
- /* eslint-enable react-internal/no-production-logging */
658
- }
659
-
660
- disabledDepth++;
661
- }
662
- }
663
- function reenableLogs() {
664
- {
665
- disabledDepth--;
666
-
667
- if (disabledDepth === 0) {
668
- /* eslint-disable react-internal/no-production-logging */
669
- var props = {
670
- configurable: true,
671
- enumerable: true,
672
- writable: true
673
- }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
674
-
675
- Object.defineProperties(console, {
676
- log: assign({}, props, {
677
- value: prevLog
678
- }),
679
- info: assign({}, props, {
680
- value: prevInfo
681
- }),
682
- warn: assign({}, props, {
683
- value: prevWarn
684
- }),
685
- error: assign({}, props, {
686
- value: prevError
687
- }),
688
- group: assign({}, props, {
689
- value: prevGroup
690
- }),
691
- groupCollapsed: assign({}, props, {
692
- value: prevGroupCollapsed
693
- }),
694
- groupEnd: assign({}, props, {
695
- value: prevGroupEnd
696
- })
697
- });
698
- /* eslint-enable react-internal/no-production-logging */
699
- }
700
-
701
- if (disabledDepth < 0) {
702
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
703
- }
704
- }
705
- }
706
-
707
- var prefix;
708
- function describeBuiltInComponentFrame(name) {
709
- {
710
- if (prefix === undefined) {
711
- // Extract the VM specific prefix used by each line.
712
- try {
713
- throw Error();
714
- } catch (x) {
715
- var match = x.stack.trim().match(/\n( *(at )?)/);
716
- prefix = match && match[1] || '';
717
- }
718
- } // We use the prefix to ensure our stacks line up with native stack frames.
719
-
720
-
721
- return '\n' + prefix + name;
722
- }
723
- }
724
- var reentry = false;
725
- var componentFrameCache;
726
-
727
- {
728
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
729
- componentFrameCache = new PossiblyWeakMap();
730
- }
731
- /**
732
- * Leverages native browser/VM stack frames to get proper details (e.g.
733
- * filename, line + col number) for a single component in a component stack. We
734
- * do this by:
735
- * (1) throwing and catching an error in the function - this will be our
736
- * control error.
737
- * (2) calling the component which will eventually throw an error that we'll
738
- * catch - this will be our sample error.
739
- * (3) diffing the control and sample error stacks to find the stack frame
740
- * which represents our component.
741
- */
742
-
743
-
744
- function describeNativeComponentFrame(fn, construct) {
745
- // If something asked for a stack inside a fake render, it should get ignored.
746
- if (!fn || reentry) {
747
- return '';
748
- }
749
-
750
- {
751
- var frame = componentFrameCache.get(fn);
752
-
753
- if (frame !== undefined) {
754
- return frame;
755
- }
756
- }
757
-
758
- reentry = true;
759
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
760
-
761
- Error.prepareStackTrace = undefined;
762
- var previousDispatcher = null;
763
-
764
- {
765
- previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
766
- // for warnings.
767
-
768
- ReactSharedInternals.H = null;
769
- disableLogs();
770
- }
771
- /**
772
- * Finding a common stack frame between sample and control errors can be
773
- * tricky given the different types and levels of stack trace truncation from
774
- * different JS VMs. So instead we'll attempt to control what that common
775
- * frame should be through this object method:
776
- * Having both the sample and control errors be in the function under the
777
- * `DescribeNativeComponentFrameRoot` property, + setting the `name` and
778
- * `displayName` properties of the function ensures that a stack
779
- * frame exists that has the method name `DescribeNativeComponentFrameRoot` in
780
- * it for both control and sample stacks.
781
- */
782
-
783
-
784
- var RunInRootFrame = {
785
- DetermineComponentFrameRoot: function () {
786
- var control;
787
-
788
- try {
789
- // This should throw.
790
- if (construct) {
791
- // Something should be setting the props in the constructor.
792
- var Fake = function () {
793
- throw Error();
794
- }; // $FlowFixMe[prop-missing]
795
-
796
-
797
- Object.defineProperty(Fake.prototype, 'props', {
798
- set: function () {
799
- // We use a throwing setter instead of frozen or non-writable props
800
- // because that won't throw in a non-strict mode function.
801
- throw Error();
802
- }
803
- });
804
-
805
- if (typeof Reflect === 'object' && Reflect.construct) {
806
- // We construct a different control for this case to include any extra
807
- // frames added by the construct call.
808
- try {
809
- Reflect.construct(Fake, []);
810
- } catch (x) {
811
- control = x;
812
- }
813
-
814
- Reflect.construct(fn, [], Fake);
815
- } else {
816
- try {
817
- Fake.call();
818
- } catch (x) {
819
- control = x;
820
- } // $FlowFixMe[prop-missing] found when upgrading Flow
821
-
822
-
823
- fn.call(Fake.prototype);
824
- }
825
- } else {
826
- try {
827
- throw Error();
828
- } catch (x) {
829
- control = x;
830
- } // TODO(luna): This will currently only throw if the function component
831
- // tries to access React/ReactDOM/props. We should probably make this throw
832
- // in simple components too
833
-
834
-
835
- var maybePromise = fn(); // If the function component returns a promise, it's likely an async
836
- // component, which we don't yet support. Attach a noop catch handler to
837
- // silence the error.
838
- // TODO: Implement component stacks for async client components?
839
-
840
- if (maybePromise && typeof maybePromise.catch === 'function') {
841
- maybePromise.catch(function () {});
842
- }
843
- }
844
- } catch (sample) {
845
- // This is inlined manually because closure doesn't do it for us.
846
- if (sample && control && typeof sample.stack === 'string') {
847
- return [sample.stack, control.stack];
848
- }
849
- }
850
-
851
- return [null, null];
852
- }
853
- }; // $FlowFixMe[prop-missing]
854
-
855
- RunInRootFrame.DetermineComponentFrameRoot.displayName = 'DetermineComponentFrameRoot';
856
- var namePropDescriptor = Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot, 'name'); // Before ES6, the `name` property was not configurable.
857
-
858
- if (namePropDescriptor && namePropDescriptor.configurable) {
859
- // V8 utilizes a function's `name` property when generating a stack trace.
860
- Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor
861
- // is set to `false`.
862
- // $FlowFixMe[cannot-write]
863
- 'name', {
864
- value: 'DetermineComponentFrameRoot'
865
- });
866
- }
867
-
868
- try {
869
- var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
870
- sampleStack = _RunInRootFrame$Deter[0],
871
- controlStack = _RunInRootFrame$Deter[1];
872
-
873
- if (sampleStack && controlStack) {
874
- // This extracts the first frame from the sample that isn't also in the control.
875
- // Skipping one frame that we assume is the frame that calls the two.
876
- var sampleLines = sampleStack.split('\n');
877
- var controlLines = controlStack.split('\n');
878
- var s = 0;
879
- var c = 0;
880
-
881
- while (s < sampleLines.length && !sampleLines[s].includes('DetermineComponentFrameRoot')) {
882
- s++;
883
- }
884
-
885
- while (c < controlLines.length && !controlLines[c].includes('DetermineComponentFrameRoot')) {
886
- c++;
887
- } // We couldn't find our intentionally injected common root frame, attempt
888
- // to find another common root frame by search from the bottom of the
889
- // control stack...
890
-
891
-
892
- if (s === sampleLines.length || c === controlLines.length) {
893
- s = sampleLines.length - 1;
894
- c = controlLines.length - 1;
895
-
896
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
897
- // We expect at least one stack frame to be shared.
898
- // Typically this will be the root most one. However, stack frames may be
899
- // cut off due to maximum stack limits. In this case, one maybe cut off
900
- // earlier than the other. We assume that the sample is longer or the same
901
- // and there for cut off earlier. So we should find the root most frame in
902
- // the sample somewhere in the control.
903
- c--;
904
- }
905
- }
906
-
907
- for (; s >= 1 && c >= 0; s--, c--) {
908
- // Next we find the first one that isn't the same which should be the
909
- // frame that called our sample function and the control.
910
- if (sampleLines[s] !== controlLines[c]) {
911
- // In V8, the first line is describing the message but other VMs don't.
912
- // If we're about to return the first line, and the control is also on the same
913
- // line, that's a pretty good indicator that our sample threw at same line as
914
- // the control. I.e. before we entered the sample frame. So we ignore this result.
915
- // This can happen if you passed a class to function component, or non-function.
916
- if (s !== 1 || c !== 1) {
917
- do {
918
- s--;
919
- c--; // We may still have similar intermediate frames from the construct call.
920
- // The next one that isn't the same should be our match though.
921
-
922
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
923
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
924
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
925
- // but we have a user-provided "displayName"
926
- // splice it in to make the stack more readable.
927
-
928
-
929
- if (fn.displayName && _frame.includes('<anonymous>')) {
930
- _frame = _frame.replace('<anonymous>', fn.displayName);
931
- }
932
-
933
- if (true) {
934
- if (typeof fn === 'function') {
935
- componentFrameCache.set(fn, _frame);
936
- }
937
- } // Return the line we found.
938
-
939
-
940
- return _frame;
941
- }
942
- } while (s >= 1 && c >= 0);
943
- }
944
-
945
- break;
946
- }
947
- }
948
- }
949
- } finally {
950
- reentry = false;
951
-
952
- {
953
- ReactSharedInternals.H = previousDispatcher;
954
- reenableLogs();
955
- }
956
-
957
- Error.prepareStackTrace = previousPrepareStackTrace;
958
- } // Fallback to just using the name if we couldn't make it throw.
959
-
960
-
961
- var name = fn ? fn.displayName || fn.name : '';
962
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
963
-
964
- {
965
- if (typeof fn === 'function') {
966
- componentFrameCache.set(fn, syntheticFrame);
967
- }
968
- }
969
-
970
- return syntheticFrame;
971
- }
972
- function describeFunctionComponentFrame(fn) {
973
- {
974
- return describeNativeComponentFrame(fn, false);
975
- }
976
- }
977
-
978
- function shouldConstruct(Component) {
979
- var prototype = Component.prototype;
980
- return !!(prototype && prototype.isReactComponent);
981
- }
982
-
983
- function describeUnknownElementTypeFrameInDEV(type) {
984
-
985
- if (type == null) {
986
- return '';
987
- }
988
-
989
- if (typeof type === 'function') {
990
- {
991
- return describeNativeComponentFrame(type, shouldConstruct(type));
992
- }
993
- }
994
-
995
- if (typeof type === 'string') {
996
- return describeBuiltInComponentFrame(type);
997
- }
998
-
999
- switch (type) {
1000
- case REACT_SUSPENSE_TYPE:
1001
- return describeBuiltInComponentFrame('Suspense');
1002
-
1003
- case REACT_SUSPENSE_LIST_TYPE:
1004
- return describeBuiltInComponentFrame('SuspenseList');
1005
- }
1006
-
1007
- if (typeof type === 'object') {
1008
- switch (type.$$typeof) {
1009
- case REACT_FORWARD_REF_TYPE:
1010
- return describeFunctionComponentFrame(type.render);
1011
-
1012
- case REACT_MEMO_TYPE:
1013
- // Memo may contain any component type so we recursively resolve it.
1014
- return describeUnknownElementTypeFrameInDEV(type.type);
1015
-
1016
- case REACT_LAZY_TYPE:
1017
- {
1018
- var lazyComponent = type;
1019
- var payload = lazyComponent._payload;
1020
- var init = lazyComponent._init;
1021
-
1022
- try {
1023
- // Lazy may contain any component type so we recursively resolve it.
1024
- return describeUnknownElementTypeFrameInDEV(init(payload));
1025
- } catch (x) {}
1026
- }
1027
- }
1028
- }
1029
-
1030
- return '';
1031
- }
1032
-
1033
- var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
1034
-
1035
- function getOwner() {
1036
- {
1037
- var dispatcher = ReactSharedInternals.A;
1038
-
1039
- if (dispatcher === null) {
1040
- return null;
1041
- }
1042
-
1043
- return dispatcher.getOwner();
1044
- }
1045
- }
1046
-
1047
- var specialPropKeyWarningShown;
1048
- var didWarnAboutElementRef;
1049
- var didWarnAboutOldJSXRuntime;
1050
-
1051
- {
1052
- didWarnAboutElementRef = {};
1053
- }
1054
-
1055
- function hasValidRef(config) {
1056
- {
1057
- if (hasOwnProperty.call(config, 'ref')) {
1058
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1059
-
1060
- if (getter && getter.isReactWarning) {
1061
- return false;
1062
- }
1063
- }
1064
- }
1065
-
1066
- return config.ref !== undefined;
1067
- }
1068
-
1069
- function hasValidKey(config) {
1070
- {
1071
- if (hasOwnProperty.call(config, 'key')) {
1072
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1073
-
1074
- if (getter && getter.isReactWarning) {
1075
- return false;
1076
- }
1077
- }
1078
- }
1079
-
1080
- return config.key !== undefined;
1081
- }
1082
-
1083
- function defineKeyPropWarningGetter(props, displayName) {
1084
- {
1085
- var warnAboutAccessingKey = function () {
1086
- if (!specialPropKeyWarningShown) {
1087
- specialPropKeyWarningShown = true;
1088
-
1089
- error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://react.dev/link/special-props)', displayName);
1090
- }
1091
- };
1092
-
1093
- warnAboutAccessingKey.isReactWarning = true;
1094
- Object.defineProperty(props, 'key', {
1095
- get: warnAboutAccessingKey,
1096
- configurable: true
1097
- });
1098
- }
1099
- }
1100
-
1101
- function elementRefGetterWithDeprecationWarning() {
1102
- {
1103
- var componentName = getComponentNameFromType(this.type);
1104
-
1105
- if (!didWarnAboutElementRef[componentName]) {
1106
- didWarnAboutElementRef[componentName] = true;
1107
-
1108
- error('Accessing element.ref was removed in React 19. ref is now a ' + 'regular prop. It will be removed from the JSX Element ' + 'type in a future release.');
1109
- } // An undefined `element.ref` is coerced to `null` for
1110
- // backwards compatibility.
1111
-
1112
-
1113
- var refProp = this.props.ref;
1114
- return refProp !== undefined ? refProp : null;
1115
- }
1116
- }
1117
- /**
1118
- * Factory method to create a new React element. This no longer adheres to
1119
- * the class pattern, so do not use new to call it. Also, instanceof check
1120
- * will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
1121
- * if something is a React Element.
1122
- *
1123
- * @param {*} type
1124
- * @param {*} props
1125
- * @param {*} key
1126
- * @param {string|object} ref
1127
- * @param {*} owner
1128
- * @param {*} self A *temporary* helper to detect places where `this` is
1129
- * different from the `owner` when React.createElement is called, so that we
1130
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
1131
- * functions, and as long as `this` and owner are the same, there will be no
1132
- * change in behavior.
1133
- * @param {*} source An annotation object (added by a transpiler or otherwise)
1134
- * indicating filename, line number, and/or other information.
1135
- * @internal
1136
- */
1137
-
1138
-
1139
- function ReactElement(type, key, _ref, self, source, owner, props) {
1140
- var ref;
1141
-
1142
- {
1143
- // When enableRefAsProp is on, ignore whatever was passed as the ref
1144
- // argument and treat `props.ref` as the source of truth. The only thing we
1145
- // use this for is `element.ref`, which will log a deprecation warning on
1146
- // access. In the next release, we can remove `element.ref` as well as the
1147
- // `ref` argument.
1148
- var refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
1149
- // backwards compatibility.
1150
-
1151
- ref = refProp !== undefined ? refProp : null;
1152
- }
1153
-
1154
- var element;
1155
-
1156
- {
1157
- // In dev, make `ref` a non-enumerable property with a warning. It's non-
1158
- // enumerable so that test matchers and serializers don't access it and
1159
- // trigger the warning.
1160
- //
1161
- // `ref` will be removed from the element completely in a future release.
1162
- element = {
1163
- // This tag allows us to uniquely identify this as a React Element
1164
- $$typeof: REACT_ELEMENT_TYPE,
1165
- // Built-in properties that belong on the element
1166
- type: type,
1167
- key: key,
1168
- props: props,
1169
- // Record the component responsible for creating this element.
1170
- _owner: owner
1171
- };
1172
-
1173
- if (ref !== null) {
1174
- Object.defineProperty(element, 'ref', {
1175
- enumerable: false,
1176
- get: elementRefGetterWithDeprecationWarning
1177
- });
1178
- } else {
1179
- // Don't warn on access if a ref is not given. This reduces false
1180
- // positives in cases where a test serializer uses
1181
- // getOwnPropertyDescriptors to compare objects, like Jest does, which is
1182
- // a problem because it bypasses non-enumerability.
1183
- //
1184
- // So unfortunately this will trigger a false positive warning in Jest
1185
- // when the diff is printed:
1186
- //
1187
- // expect(<div ref={ref} />).toEqual(<span ref={ref} />);
1188
- //
1189
- // A bit sketchy, but this is what we've done for the `props.key` and
1190
- // `props.ref` accessors for years, which implies it will be good enough
1191
- // for `element.ref`, too. Let's see if anyone complains.
1192
- Object.defineProperty(element, 'ref', {
1193
- enumerable: false,
1194
- value: null
1195
- });
1196
- }
1197
- }
1198
-
1199
- {
1200
- // The validation flag is currently mutative. We put it on
1201
- // an external backing store so that we can freeze the whole object.
1202
- // This can be replaced with a WeakMap once they are implemented in
1203
- // commonly used development environments.
1204
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
1205
- // the validation flag non-enumerable (where possible, which should
1206
- // include every environment we run tests in), so the test framework
1207
- // ignores it.
1208
-
1209
- Object.defineProperty(element._store, 'validated', {
1210
- configurable: false,
1211
- enumerable: false,
1212
- writable: true,
1213
- value: false
1214
- }); // debugInfo contains Server Component debug information.
1215
-
1216
- Object.defineProperty(element, '_debugInfo', {
1217
- configurable: false,
1218
- enumerable: false,
1219
- writable: true,
1220
- value: null
1221
- });
1222
-
1223
- if (Object.freeze) {
1224
- Object.freeze(element.props);
1225
- Object.freeze(element);
1226
- }
1227
- }
1228
-
1229
- return element;
1230
- }
1231
- /**
1232
- * Create and return a new ReactElement of the given type.
1233
- * See https://reactjs.org/docs/react-api.html#createelement
1234
- */
1235
-
1236
- function createElement(type, config, children) {
1237
- {
1238
- if (!isValidElementType(type)) {
1239
- // This is an invalid element type.
1240
- //
1241
- // We warn in this case but don't throw. We expect the element creation to
1242
- // succeed and there will likely be errors in render.
1243
- var info = '';
1244
-
1245
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1246
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
1247
- }
1248
-
1249
- var typeString;
1250
-
1251
- if (type === null) {
1252
- typeString = 'null';
1253
- } else if (isArray(type)) {
1254
- typeString = 'array';
1255
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1256
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1257
- info = ' Did you accidentally export a JSX literal instead of a component?';
1258
- } else {
1259
- typeString = typeof type;
1260
- }
1261
-
1262
- error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
1263
- } else {
1264
- // This is a valid element type.
1265
- // Skip key warning if the type isn't valid since our key validation logic
1266
- // doesn't expect a non-string/function type and can throw confusing
1267
- // errors. We don't want exception behavior to differ between dev and
1268
- // prod. (Rendering will throw with a helpful message and as soon as the
1269
- // type is fixed, the key warnings will appear.)
1270
- for (var i = 2; i < arguments.length; i++) {
1271
- validateChildKeys(arguments[i], type);
1272
- }
1273
- } // Unlike the jsx() runtime, createElement() doesn't warn about key spread.
1274
-
1275
- }
1276
-
1277
- var propName; // Reserved names are extracted
1278
-
1279
- var props = {};
1280
- var key = null;
1281
- var ref = null;
1282
-
1283
- if (config != null) {
1284
- {
1285
- if (!didWarnAboutOldJSXRuntime && '__self' in config && // Do not assume this is the result of an oudated JSX transform if key
1286
- // is present, because the modern JSX transform sometimes outputs
1287
- // createElement to preserve precedence between a static key and a
1288
- // spread key. To avoid false positive warnings, we never warn if
1289
- // there's a key.
1290
- !('key' in config)) {
1291
- didWarnAboutOldJSXRuntime = true;
1292
-
1293
- warn('Your app (or one of its dependencies) is using an outdated JSX ' + 'transform. Update to the modern JSX transform for ' + 'faster performance: https://react.dev/link/new-jsx-transform');
1294
- }
1295
- }
1296
-
1297
- if (hasValidRef(config)) ;
1298
-
1299
- if (hasValidKey(config)) {
1300
- {
1301
- checkKeyStringCoercion(config.key);
1302
- }
1303
-
1304
- key = '' + config.key;
1305
- } // Remaining properties are added to a new props object
1306
-
1307
-
1308
- for (propName in config) {
1309
- if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
1310
- propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
1311
- // them to appear as props, so in createElement we filter them out.
1312
- // We don't have to do this in the jsx() runtime because the jsx()
1313
- // transform never passed these as props; it used separate arguments.
1314
- propName !== '__self' && propName !== '__source') {
1315
- {
1316
- props[propName] = config[propName];
1317
- }
1318
- }
1319
- }
1320
- } // Children can be more than one argument, and those are transferred onto
1321
- // the newly allocated props object.
1322
-
1323
-
1324
- var childrenLength = arguments.length - 2;
1325
-
1326
- if (childrenLength === 1) {
1327
- props.children = children;
1328
- } else if (childrenLength > 1) {
1329
- var childArray = Array(childrenLength);
1330
-
1331
- for (var _i = 0; _i < childrenLength; _i++) {
1332
- childArray[_i] = arguments[_i + 2];
1333
- }
1334
-
1335
- {
1336
- if (Object.freeze) {
1337
- Object.freeze(childArray);
1338
- }
1339
- }
1340
-
1341
- props.children = childArray;
1342
- } // Resolve default props
1343
-
1344
-
1345
- if (type && type.defaultProps) {
1346
- var defaultProps = type.defaultProps;
1347
-
1348
- for (propName in defaultProps) {
1349
- if (props[propName] === undefined) {
1350
- props[propName] = defaultProps[propName];
1351
- }
1352
- }
1353
- }
1354
-
1355
- {
1356
- if (key || !enableRefAsProp ) {
1357
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1358
-
1359
- if (key) {
1360
- defineKeyPropWarningGetter(props, displayName);
1361
- }
1362
- }
1363
- }
1364
-
1365
- var element = ReactElement(type, key, ref, undefined, undefined, getOwner(), props);
1366
-
1367
- if (type === REACT_FRAGMENT_TYPE) {
1368
- validateFragmentProps(element);
1369
- }
1370
-
1371
- return element;
1372
- }
1373
- function cloneAndReplaceKey(oldElement, newKey) {
1374
- return ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
1375
- // exists to avoid the `ref` access warning.
1376
- null , undefined, undefined, oldElement._owner, oldElement.props);
1377
- }
1378
- /**
1379
- * Clone and return a new ReactElement using element as the starting point.
1380
- * See https://reactjs.org/docs/react-api.html#cloneelement
1381
- */
1382
-
1383
- function cloneElement(element, config, children) {
1384
- if (element === null || element === undefined) {
1385
- throw new Error("The argument must be a React element, but you passed " + element + ".");
1386
- }
1387
-
1388
- var propName; // Original props are copied
1389
-
1390
- var props = assign({}, element.props); // Reserved names are extracted
1391
-
1392
- var key = element.key;
1393
- var ref = null ; // Owner will be preserved, unless ref is overridden
1394
-
1395
- var owner = element._owner;
1396
-
1397
- if (config != null) {
1398
- if (hasValidRef(config)) {
1399
- owner = getOwner() ;
1400
- }
1401
-
1402
- if (hasValidKey(config)) {
1403
- {
1404
- checkKeyStringCoercion(config.key);
1405
- }
1406
-
1407
- key = '' + config.key;
1408
- } // Remaining properties override existing props
1409
-
1410
- for (propName in config) {
1411
- if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
1412
- propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
1413
- // warnings and debug information in dev. Need to decide if we're OK
1414
- // with dropping them. In the jsx() runtime it's not an issue because
1415
- // the data gets passed as separate arguments instead of props, but
1416
- // it would be nice to stop relying on them entirely so we can drop
1417
- // them from the internal Fiber field.
1418
- propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
1419
- // if the property were missing. This is mostly for
1420
- // backwards compatibility.
1421
- !(propName === 'ref' && config.ref === undefined)) {
1422
- {
1423
- {
1424
- props[propName] = config[propName];
1425
- }
1426
- }
1427
- }
1428
- }
1429
- } // Children can be more than one argument, and those are transferred onto
1430
- // the newly allocated props object.
1431
-
1432
-
1433
- var childrenLength = arguments.length - 2;
1434
-
1435
- if (childrenLength === 1) {
1436
- props.children = children;
1437
- } else if (childrenLength > 1) {
1438
- var childArray = Array(childrenLength);
1439
-
1440
- for (var i = 0; i < childrenLength; i++) {
1441
- childArray[i] = arguments[i + 2];
1442
- }
1443
-
1444
- props.children = childArray;
1445
- }
1446
-
1447
- var clonedElement = ReactElement(element.type, key, ref, undefined, undefined, owner, props);
1448
-
1449
- for (var _i2 = 2; _i2 < arguments.length; _i2++) {
1450
- validateChildKeys(arguments[_i2], clonedElement.type);
1451
- }
1452
-
1453
- return clonedElement;
1454
- }
1455
-
1456
- function getDeclarationErrorAddendum() {
1457
- {
1458
- var owner = getOwner();
1459
-
1460
- if (owner) {
1461
- var name = getComponentNameFromType(owner.type);
1462
-
1463
- if (name) {
1464
- return '\n\nCheck the render method of `' + name + '`.';
1465
- }
1466
- }
1467
-
1468
- return '';
1469
- }
1470
- }
1471
- /**
1472
- * Ensure that every element either is passed in a static location, in an
1473
- * array with an explicit keys property defined, or in an object literal
1474
- * with valid key property.
1475
- *
1476
- * @internal
1477
- * @param {ReactNode} node Statically passed child of any type.
1478
- * @param {*} parentType node's parent's type.
1479
- */
1480
-
1481
-
1482
- function validateChildKeys(node, parentType) {
1483
- {
1484
- if (typeof node !== 'object' || !node) {
1485
- return;
1486
- }
1487
-
1488
- if (node.$$typeof === REACT_CLIENT_REFERENCE) ; else if (isArray(node)) {
1489
- for (var i = 0; i < node.length; i++) {
1490
- var child = node[i];
1491
-
1492
- if (isValidElement(child)) {
1493
- validateExplicitKey(child, parentType);
1494
- }
1495
- }
1496
- } else if (isValidElement(node)) {
1497
- // This element was passed in a valid location.
1498
- if (node._store) {
1499
- node._store.validated = true;
1500
- }
1501
- } else {
1502
- var iteratorFn = getIteratorFn(node);
1503
-
1504
- if (typeof iteratorFn === 'function') {
1505
- // Entry iterators used to provide implicit keys,
1506
- // but now we print a separate warning for them later.
1507
- if (iteratorFn !== node.entries) {
1508
- var iterator = iteratorFn.call(node);
1509
-
1510
- if (iterator !== node) {
1511
- var step;
1512
-
1513
- while (!(step = iterator.next()).done) {
1514
- if (isValidElement(step.value)) {
1515
- validateExplicitKey(step.value, parentType);
1516
- }
1517
- }
1518
- }
1519
- }
1520
- }
1521
- }
1522
- }
1523
- }
1524
- /**
1525
- * Verifies the object is a ReactElement.
1526
- * See https://reactjs.org/docs/react-api.html#isvalidelement
1527
- * @param {?object} object
1528
- * @return {boolean} True if `object` is a ReactElement.
1529
- * @final
1530
- */
1531
-
1532
-
1533
- function isValidElement(object) {
1534
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1535
- }
1536
- var ownerHasKeyUseWarning = {};
1537
- /**
1538
- * Warn if the element doesn't have an explicit key assigned to it.
1539
- * This element is in an array. The array could grow and shrink or be
1540
- * reordered. All children that haven't already been validated are required to
1541
- * have a "key" property assigned to it. Error statuses are cached so a warning
1542
- * will only be shown once.
1543
- *
1544
- * @internal
1545
- * @param {ReactElement} element Element that requires a key.
1546
- * @param {*} parentType element's parent's type.
1547
- */
1548
-
1549
- function validateExplicitKey(element, parentType) {
1550
- {
1551
- if (!element._store || element._store.validated || element.key != null) {
1552
- return;
1553
- }
1554
-
1555
- element._store.validated = true;
1556
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1557
-
1558
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1559
- return;
1560
- }
1561
-
1562
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1563
- // property, it may be the creator of the child that's responsible for
1564
- // assigning it a key.
1565
-
1566
- var childOwner = '';
1567
-
1568
- if (element && element._owner != null && element._owner !== getOwner()) {
1569
- var ownerName = null;
1570
-
1571
- if (typeof element._owner.tag === 'number') {
1572
- ownerName = getComponentNameFromType(element._owner.type);
1573
- } else if (typeof element._owner.name === 'string') {
1574
- ownerName = element._owner.name;
1575
- } // Give the component that originally created this child.
1576
-
1577
-
1578
- childOwner = " It was passed a child from " + ownerName + ".";
1579
- }
1580
-
1581
- setCurrentlyValidatingElement(element);
1582
-
1583
- error('Each child in a list should have a unique "key" prop.' + '%s%s See https://react.dev/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
1584
-
1585
- setCurrentlyValidatingElement(null);
1586
- }
1587
- }
1588
-
1589
- function setCurrentlyValidatingElement(element) {
1590
- {
1591
- if (element) {
1592
- var stack = describeUnknownElementTypeFrameInDEV(element.type);
1593
- ReactSharedInternals.setExtraStackFrame(stack);
1594
- } else {
1595
- ReactSharedInternals.setExtraStackFrame(null);
1596
- }
1597
- }
1598
- }
1599
-
1600
- function getCurrentComponentErrorInfo(parentType) {
1601
- {
1602
- var info = getDeclarationErrorAddendum();
1603
-
1604
- if (!info) {
1605
- var parentName = getComponentNameFromType(parentType);
1606
-
1607
- if (parentName) {
1608
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1609
- }
1610
- }
1611
-
1612
- return info;
1613
- }
1614
- }
1615
- /**
1616
- * Given a fragment, validate that it can only be provided with fragment props
1617
- * @param {ReactElement} fragment
1618
- */
1619
-
1620
-
1621
- function validateFragmentProps(fragment) {
1622
- // TODO: Move this to render phase instead of at element creation.
1623
- {
1624
- var keys = Object.keys(fragment.props);
1625
-
1626
- for (var i = 0; i < keys.length; i++) {
1627
- var key = keys[i];
1628
-
1629
- if (key !== 'children' && key !== 'key') {
1630
- setCurrentlyValidatingElement(fragment);
1631
-
1632
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1633
-
1634
- setCurrentlyValidatingElement(null);
1635
- break;
1636
- }
1637
- }
1638
- }
1639
- }
1640
-
1641
- var SEPARATOR = '.';
1642
- var SUBSEPARATOR = ':';
1643
- /**
1644
- * Escape and wrap key so it is safe to use as a reactid
1645
- *
1646
- * @param {string} key to be escaped.
1647
- * @return {string} the escaped key.
1648
- */
1649
-
1650
- function escape(key) {
1651
- var escapeRegex = /[=:]/g;
1652
- var escaperLookup = {
1653
- '=': '=0',
1654
- ':': '=2'
1655
- };
1656
- var escapedString = key.replace(escapeRegex, function (match) {
1657
- return escaperLookup[match];
1658
- });
1659
- return '$' + escapedString;
1660
- }
1661
- /**
1662
- * TODO: Test that a single child and an array with one item have the same key
1663
- * pattern.
1664
- */
1665
-
1666
-
1667
- var didWarnAboutMaps = false;
1668
- var userProvidedKeyEscapeRegex = /\/+/g;
1669
-
1670
- function escapeUserProvidedKey(text) {
1671
- return text.replace(userProvidedKeyEscapeRegex, '$&/');
1672
- }
1673
- /**
1674
- * Generate a key string that identifies a element within a set.
1675
- *
1676
- * @param {*} element A element that could contain a manual key.
1677
- * @param {number} index Index that is used if a manual key is not provided.
1678
- * @return {string}
1679
- */
1680
-
1681
-
1682
- function getElementKey(element, index) {
1683
- // Do some typechecking here since we call this blindly. We want to ensure
1684
- // that we don't block potential future ES APIs.
1685
- if (typeof element === 'object' && element !== null && element.key != null) {
1686
- // Explicit key
1687
- {
1688
- checkKeyStringCoercion(element.key);
1689
- }
1690
-
1691
- return escape('' + element.key);
1692
- } // Implicit key determined by the index in the set
1693
-
1694
-
1695
- return index.toString(36);
1696
- }
1697
-
1698
- function noop$1() {}
1699
-
1700
- function resolveThenable(thenable) {
1701
- switch (thenable.status) {
1702
- case 'fulfilled':
1703
- {
1704
- var fulfilledValue = thenable.value;
1705
- return fulfilledValue;
1706
- }
1707
-
1708
- case 'rejected':
1709
- {
1710
- var rejectedError = thenable.reason;
1711
- throw rejectedError;
1712
- }
1713
-
1714
- default:
1715
- {
1716
- if (typeof thenable.status === 'string') {
1717
- // Only instrument the thenable if the status if not defined. If
1718
- // it's defined, but an unknown value, assume it's been instrumented by
1719
- // some custom userspace implementation. We treat it as "pending".
1720
- // Attach a dummy listener, to ensure that any lazy initialization can
1721
- // happen. Flight lazily parses JSON when the value is actually awaited.
1722
- thenable.then(noop$1, noop$1);
1723
- } else {
1724
- // This is an uncached thenable that we haven't seen before.
1725
- // TODO: Detect infinite ping loops caused by uncached promises.
1726
- var pendingThenable = thenable;
1727
- pendingThenable.status = 'pending';
1728
- pendingThenable.then(function (fulfilledValue) {
1729
- if (thenable.status === 'pending') {
1730
- var fulfilledThenable = thenable;
1731
- fulfilledThenable.status = 'fulfilled';
1732
- fulfilledThenable.value = fulfilledValue;
1733
- }
1734
- }, function (error) {
1735
- if (thenable.status === 'pending') {
1736
- var rejectedThenable = thenable;
1737
- rejectedThenable.status = 'rejected';
1738
- rejectedThenable.reason = error;
1739
- }
1740
- });
1741
- } // Check one more time in case the thenable resolved synchronously.
1742
-
1743
-
1744
- switch (thenable.status) {
1745
- case 'fulfilled':
1746
- {
1747
- var fulfilledThenable = thenable;
1748
- return fulfilledThenable.value;
1749
- }
1750
-
1751
- case 'rejected':
1752
- {
1753
- var rejectedThenable = thenable;
1754
- var _rejectedError = rejectedThenable.reason;
1755
- throw _rejectedError;
1756
- }
1757
- }
1758
- }
1759
- }
1760
-
1761
- throw thenable;
1762
- }
1763
-
1764
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1765
- var type = typeof children;
1766
-
1767
- if (type === 'undefined' || type === 'boolean') {
1768
- // All of the above are perceived as null.
1769
- children = null;
1770
- }
1771
-
1772
- var invokeCallback = false;
1773
-
1774
- if (children === null) {
1775
- invokeCallback = true;
1776
- } else {
1777
- switch (type) {
1778
- case 'bigint':
1779
- case 'string':
1780
- case 'number':
1781
- invokeCallback = true;
1782
- break;
1783
-
1784
- case 'object':
1785
- switch (children.$$typeof) {
1786
- case REACT_ELEMENT_TYPE:
1787
- case REACT_PORTAL_TYPE:
1788
- invokeCallback = true;
1789
- break;
1790
-
1791
- case REACT_LAZY_TYPE:
1792
- var payload = children._payload;
1793
- var init = children._init;
1794
- return mapIntoArray(init(payload), array, escapedPrefix, nameSoFar, callback);
1795
- }
1796
-
1797
- }
1798
- }
1799
-
1800
- if (invokeCallback) {
1801
- var _child = children;
1802
- var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
1803
- // so that it's consistent if the number of children grows:
1804
-
1805
- var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1806
-
1807
- if (isArray(mappedChild)) {
1808
- var escapedChildKey = '';
1809
-
1810
- if (childKey != null) {
1811
- escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1812
- }
1813
-
1814
- mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1815
- return c;
1816
- });
1817
- } else if (mappedChild != null) {
1818
- if (isValidElement(mappedChild)) {
1819
- {
1820
- // The `if` statement here prevents auto-disabling of the safe
1821
- // coercion ESLint rule, so we must manually disable it below.
1822
- // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
1823
- if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
1824
- checkKeyStringCoercion(mappedChild.key);
1825
- }
1826
- }
1827
-
1828
- mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1829
- // traverseAllChildren used to do for objects as children
1830
- escapedPrefix + ( // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
1831
- mappedChild.key && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey( // $FlowFixMe[unsafe-addition]
1832
- '' + mappedChild.key // eslint-disable-line react-internal/safe-string-coercion
1833
- ) + '/' : '') + childKey);
1834
- }
1835
-
1836
- array.push(mappedChild);
1837
- }
1838
-
1839
- return 1;
1840
- }
1841
-
1842
- var child;
1843
- var nextName;
1844
- var subtreeCount = 0; // Count of children found in the current subtree.
1845
-
1846
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1847
-
1848
- if (isArray(children)) {
1849
- for (var i = 0; i < children.length; i++) {
1850
- child = children[i];
1851
- nextName = nextNamePrefix + getElementKey(child, i);
1852
- subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1853
- }
1854
- } else {
1855
- var iteratorFn = getIteratorFn(children);
1856
-
1857
- if (typeof iteratorFn === 'function') {
1858
- var iterableChildren = children;
1859
-
1860
- {
1861
- // Warn about using Maps as children
1862
- if (iteratorFn === iterableChildren.entries) {
1863
- if (!didWarnAboutMaps) {
1864
- warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
1865
- }
1866
-
1867
- didWarnAboutMaps = true;
1868
- }
1869
- }
1870
-
1871
- var iterator = iteratorFn.call(iterableChildren);
1872
- var step;
1873
- var ii = 0; // $FlowFixMe[incompatible-use] `iteratorFn` might return null according to typing.
1874
-
1875
- while (!(step = iterator.next()).done) {
1876
- child = step.value;
1877
- nextName = nextNamePrefix + getElementKey(child, ii++);
1878
- subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1879
- }
1880
- } else if (type === 'object') {
1881
- if (typeof children.then === 'function') {
1882
- return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
1883
- } // eslint-disable-next-line react-internal/safe-string-coercion
1884
-
1885
-
1886
- var childrenString = String(children);
1887
- throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.');
1888
- }
1889
- }
1890
-
1891
- return subtreeCount;
1892
- }
1893
- /**
1894
- * Maps children that are typically specified as `props.children`.
1895
- *
1896
- * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1897
- *
1898
- * The provided mapFunction(child, index) will be called for each
1899
- * leaf child.
1900
- *
1901
- * @param {?*} children Children tree container.
1902
- * @param {function(*, int)} func The map function.
1903
- * @param {*} context Context for mapFunction.
1904
- * @return {object} Object containing the ordered map of results.
1905
- */
1906
-
1907
-
1908
- function mapChildren(children, func, context) {
1909
- if (children == null) {
1910
- // $FlowFixMe limitation refining abstract types in Flow
1911
- return children;
1912
- }
1913
-
1914
- var result = [];
1915
- var count = 0;
1916
- mapIntoArray(children, result, '', '', function (child) {
1917
- return func.call(context, child, count++);
1918
- });
1919
- return result;
1920
- }
1921
- /**
1922
- * Count the number of children that are typically specified as
1923
- * `props.children`.
1924
- *
1925
- * See https://reactjs.org/docs/react-api.html#reactchildrencount
1926
- *
1927
- * @param {?*} children Children tree container.
1928
- * @return {number} The number of children.
1929
- */
1930
-
1931
-
1932
- function countChildren(children) {
1933
- var n = 0;
1934
- mapChildren(children, function () {
1935
- n++; // Don't return anything
1936
- });
1937
- return n;
1938
- }
1939
- /**
1940
- * Iterates through children that are typically specified as `props.children`.
1941
- *
1942
- * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1943
- *
1944
- * The provided forEachFunc(child, index) will be called for each
1945
- * leaf child.
1946
- *
1947
- * @param {?*} children Children tree container.
1948
- * @param {function(*, int)} forEachFunc
1949
- * @param {*} forEachContext Context for forEachContext.
1950
- */
1951
-
1952
-
1953
- function forEachChildren(children, forEachFunc, forEachContext) {
1954
- mapChildren(children, // $FlowFixMe[missing-this-annot]
1955
- function () {
1956
- forEachFunc.apply(this, arguments); // Don't return anything.
1957
- }, forEachContext);
1958
- }
1959
- /**
1960
- * Flatten a children object (typically specified as `props.children`) and
1961
- * return an array with appropriately re-keyed children.
1962
- *
1963
- * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1964
- */
1965
-
1966
-
1967
- function toArray(children) {
1968
- return mapChildren(children, function (child) {
1969
- return child;
1970
- }) || [];
1971
- }
1972
- /**
1973
- * Returns the first child in a collection of children and verifies that there
1974
- * is only one child in the collection.
1975
- *
1976
- * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1977
- *
1978
- * The current implementation of this function assumes that a single child gets
1979
- * passed without a wrapper, but the purpose of this helper function is to
1980
- * abstract away the particular structure of children.
1981
- *
1982
- * @param {?object} children Child collection structure.
1983
- * @return {ReactElement} The first and only `ReactElement` contained in the
1984
- * structure.
1985
- */
1986
-
1987
-
1988
- function onlyChild(children) {
1989
- if (!isValidElement(children)) {
1990
- throw new Error('React.Children.only expected to receive a single React element child.');
1991
- }
1992
-
1993
- return children;
1994
- }
1995
-
1996
- function createContext(defaultValue) {
1997
- // TODO: Second argument used to be an optional `calculateChangedBits`
1998
- // function. Warn to reserve for future use?
1999
- var context = {
2000
- $$typeof: REACT_CONTEXT_TYPE,
2001
- // As a workaround to support multiple concurrent renderers, we categorize
2002
- // some renderers as primary and others as secondary. We only expect
2003
- // there to be two concurrent renderers at most: React Native (primary) and
2004
- // Fabric (secondary); React DOM (primary) and React ART (secondary).
2005
- // Secondary renderers store their context values on separate fields.
2006
- _currentValue: defaultValue,
2007
- _currentValue2: defaultValue,
2008
- // Used to track how many concurrent renderers this context currently
2009
- // supports within in a single renderer. Such as parallel server rendering.
2010
- _threadCount: 0,
2011
- // These are circular
2012
- Provider: null,
2013
- Consumer: null
2014
- };
2015
-
2016
- {
2017
- context.Provider = context;
2018
- context.Consumer = {
2019
- $$typeof: REACT_CONSUMER_TYPE,
2020
- _context: context
2021
- };
2022
- }
2023
-
2024
- {
2025
- context._currentRenderer = null;
2026
- context._currentRenderer2 = null;
2027
- }
2028
-
2029
- return context;
2030
- }
2031
-
2032
- var Uninitialized = -1;
2033
- var Pending = 0;
2034
- var Resolved = 1;
2035
- var Rejected = 2;
2036
-
2037
- function lazyInitializer(payload) {
2038
- if (payload._status === Uninitialized) {
2039
- var ctor = payload._result;
2040
- var thenable = ctor(); // Transition to the next state.
2041
- // This might throw either because it's missing or throws. If so, we treat it
2042
- // as still uninitialized and try again next time. Which is the same as what
2043
- // happens if the ctor or any wrappers processing the ctor throws. This might
2044
- // end up fixing it if the resolution was a concurrency bug.
2045
-
2046
- thenable.then(function (moduleObject) {
2047
- if (payload._status === Pending || payload._status === Uninitialized) {
2048
- // Transition to the next state.
2049
- var resolved = payload;
2050
- resolved._status = Resolved;
2051
- resolved._result = moduleObject;
2052
- }
2053
- }, function (error) {
2054
- if (payload._status === Pending || payload._status === Uninitialized) {
2055
- // Transition to the next state.
2056
- var rejected = payload;
2057
- rejected._status = Rejected;
2058
- rejected._result = error;
2059
- }
2060
- });
2061
-
2062
- if (payload._status === Uninitialized) {
2063
- // In case, we're still uninitialized, then we're waiting for the thenable
2064
- // to resolve. Set it as pending in the meantime.
2065
- var pending = payload;
2066
- pending._status = Pending;
2067
- pending._result = thenable;
2068
- }
2069
- }
2070
-
2071
- if (payload._status === Resolved) {
2072
- var moduleObject = payload._result;
2073
-
2074
- {
2075
- if (moduleObject === undefined) {
2076
- error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
2077
- 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
2078
- }
11
+ "use strict";
12
+ "production" !== process.env.NODE_ENV &&
13
+ (function () {
14
+ function defineDeprecationWarning(methodName, info) {
15
+ Object.defineProperty(Component.prototype, methodName, {
16
+ get: function () {
17
+ console.warn(
18
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
19
+ info[0],
20
+ info[1]
21
+ );
22
+ }
23
+ });
2079
24
  }
2080
-
2081
- {
2082
- if (!('default' in moduleObject)) {
2083
- error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
2084
- 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
25
+ function getIteratorFn(maybeIterable) {
26
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
27
+ return null;
28
+ maybeIterable =
29
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
30
+ maybeIterable["@@iterator"];
31
+ return "function" === typeof maybeIterable ? maybeIterable : null;
32
+ }
33
+ function warnNoop(publicInstance, callerName) {
34
+ publicInstance =
35
+ ((publicInstance = publicInstance.constructor) &&
36
+ (publicInstance.displayName || publicInstance.name)) ||
37
+ "ReactClass";
38
+ var warningKey = publicInstance + "." + callerName;
39
+ didWarnStateUpdateForUnmountedComponent[warningKey] ||
40
+ (console.error(
41
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
42
+ callerName,
43
+ publicInstance
44
+ ),
45
+ (didWarnStateUpdateForUnmountedComponent[warningKey] = !0));
46
+ }
47
+ function Component(props, context, updater) {
48
+ this.props = props;
49
+ this.context = context;
50
+ this.refs = emptyObject;
51
+ this.updater = updater || ReactNoopUpdateQueue;
52
+ }
53
+ function ComponentDummy() {}
54
+ function PureComponent(props, context, updater) {
55
+ this.props = props;
56
+ this.context = context;
57
+ this.refs = emptyObject;
58
+ this.updater = updater || ReactNoopUpdateQueue;
59
+ }
60
+ function testStringCoercion(value) {
61
+ return "" + value;
62
+ }
63
+ function checkKeyStringCoercion(value) {
64
+ try {
65
+ testStringCoercion(value);
66
+ var JSCompiler_inline_result = !1;
67
+ } catch (e) {
68
+ JSCompiler_inline_result = !0;
2085
69
  }
2086
- }
2087
-
2088
- return moduleObject.default;
2089
- } else {
2090
- throw payload._result;
2091
- }
2092
- }
2093
-
2094
- function lazy(ctor) {
2095
- var payload = {
2096
- // We use these fields to store the result.
2097
- _status: Uninitialized,
2098
- _result: ctor
2099
- };
2100
- var lazyType = {
2101
- $$typeof: REACT_LAZY_TYPE,
2102
- _payload: payload,
2103
- _init: lazyInitializer
2104
- };
2105
-
2106
- return lazyType;
2107
- }
2108
-
2109
- function forwardRef(render) {
2110
- {
2111
- if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
2112
- error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
2113
- } else if (typeof render !== 'function') {
2114
- error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
2115
- } else {
2116
- if (render.length !== 0 && render.length !== 2) {
2117
- error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
70
+ if (JSCompiler_inline_result) {
71
+ JSCompiler_inline_result = console;
72
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
73
+ var JSCompiler_inline_result$jscomp$0 =
74
+ ("function" === typeof Symbol &&
75
+ Symbol.toStringTag &&
76
+ value[Symbol.toStringTag]) ||
77
+ value.constructor.name ||
78
+ "Object";
79
+ JSCompiler_temp_const.call(
80
+ JSCompiler_inline_result,
81
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
82
+ JSCompiler_inline_result$jscomp$0
83
+ );
84
+ return testStringCoercion(value);
2118
85
  }
2119
86
  }
2120
-
2121
- if (render != null) {
2122
- if (render.defaultProps != null) {
2123
- error('forwardRef render functions do not support defaultProps. ' + 'Did you accidentally pass a React component?');
87
+ function getComponentNameFromType(type) {
88
+ if (null == type) return null;
89
+ if ("function" === typeof type)
90
+ return type.$$typeof === REACT_CLIENT_REFERENCE
91
+ ? null
92
+ : type.displayName || type.name || null;
93
+ if ("string" === typeof type) return type;
94
+ switch (type) {
95
+ case REACT_FRAGMENT_TYPE:
96
+ return "Fragment";
97
+ case REACT_PROFILER_TYPE:
98
+ return "Profiler";
99
+ case REACT_STRICT_MODE_TYPE:
100
+ return "StrictMode";
101
+ case REACT_SUSPENSE_TYPE:
102
+ return "Suspense";
103
+ case REACT_SUSPENSE_LIST_TYPE:
104
+ return "SuspenseList";
105
+ case REACT_ACTIVITY_TYPE:
106
+ return "Activity";
2124
107
  }
2125
- }
2126
- }
2127
-
2128
- var elementType = {
2129
- $$typeof: REACT_FORWARD_REF_TYPE,
2130
- render: render
2131
- };
2132
-
2133
- {
2134
- var ownName;
2135
- Object.defineProperty(elementType, 'displayName', {
2136
- enumerable: false,
2137
- configurable: true,
2138
- get: function () {
2139
- return ownName;
2140
- },
2141
- set: function (name) {
2142
- ownName = name; // The inner component shouldn't inherit this display name in most cases,
2143
- // because the component may be used elsewhere.
2144
- // But it's nice for anonymous functions to inherit the name,
2145
- // so that our component-stack generation logic will display their frames.
2146
- // An anonymous function generally suggests a pattern like:
2147
- // React.forwardRef((props, ref) => {...});
2148
- // This kind of inner function is not used elsewhere so the side effect is okay.
2149
-
2150
- if (!render.name && !render.displayName) {
2151
- render.displayName = name;
108
+ if ("object" === typeof type)
109
+ switch (
110
+ ("number" === typeof type.tag &&
111
+ console.error(
112
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
113
+ ),
114
+ type.$$typeof)
115
+ ) {
116
+ case REACT_PORTAL_TYPE:
117
+ return "Portal";
118
+ case REACT_CONTEXT_TYPE:
119
+ return (type.displayName || "Context") + ".Provider";
120
+ case REACT_CONSUMER_TYPE:
121
+ return (type._context.displayName || "Context") + ".Consumer";
122
+ case REACT_FORWARD_REF_TYPE:
123
+ var innerType = type.render;
124
+ type = type.displayName;
125
+ type ||
126
+ ((type = innerType.displayName || innerType.name || ""),
127
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
128
+ return type;
129
+ case REACT_MEMO_TYPE:
130
+ return (
131
+ (innerType = type.displayName || null),
132
+ null !== innerType
133
+ ? innerType
134
+ : getComponentNameFromType(type.type) || "Memo"
135
+ );
136
+ case REACT_LAZY_TYPE:
137
+ innerType = type._payload;
138
+ type = type._init;
139
+ try {
140
+ return getComponentNameFromType(type(innerType));
141
+ } catch (x) {}
2152
142
  }
2153
- }
2154
- });
2155
- }
2156
-
2157
- return elementType;
2158
- }
2159
-
2160
- function memo(type, compare) {
2161
- {
2162
- if (!isValidElementType(type)) {
2163
- error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
143
+ return null;
2164
144
  }
2165
- }
2166
-
2167
- var elementType = {
2168
- $$typeof: REACT_MEMO_TYPE,
2169
- type: type,
2170
- compare: compare === undefined ? null : compare
2171
- };
2172
-
2173
- {
2174
- var ownName;
2175
- Object.defineProperty(elementType, 'displayName', {
2176
- enumerable: false,
2177
- configurable: true,
2178
- get: function () {
2179
- return ownName;
2180
- },
2181
- set: function (name) {
2182
- ownName = name; // The inner component shouldn't inherit this display name in most cases,
2183
- // because the component may be used elsewhere.
2184
- // But it's nice for anonymous functions to inherit the name,
2185
- // so that our component-stack generation logic will display their frames.
2186
- // An anonymous function generally suggests a pattern like:
2187
- // React.memo((props) => {...});
2188
- // This kind of inner function is not used elsewhere so the side effect is okay.
2189
-
2190
- if (!type.name && !type.displayName) {
2191
- type.displayName = name;
2192
- }
145
+ function getTaskName(type) {
146
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
147
+ if (
148
+ "object" === typeof type &&
149
+ null !== type &&
150
+ type.$$typeof === REACT_LAZY_TYPE
151
+ )
152
+ return "<...>";
153
+ try {
154
+ var name = getComponentNameFromType(type);
155
+ return name ? "<" + name + ">" : "<...>";
156
+ } catch (x) {
157
+ return "<...>";
2193
158
  }
2194
- });
2195
- }
2196
-
2197
- return elementType;
2198
- }
2199
-
2200
- function noopCache(fn) {
2201
- // On the client (i.e. not a Server Components environment) `cache` has
2202
- // no caching behavior. We just return the function as-is.
2203
- //
2204
- // We intend to implement client caching in a future major release. In the
2205
- // meantime, it's only exposed as an API so that Shared Components can use
2206
- // per-request caching on the server without breaking on the client. But it
2207
- // does mean they need to be aware of the behavioral difference.
2208
- //
2209
- // The rest of the behavior is the same as the server implementation — it
2210
- // returns a new reference, extra properties like `displayName` are not
2211
- // preserved, the length of the new function is 0, etc. That way apps can't
2212
- // accidentally depend on those details.
2213
- return function () {
2214
- // $FlowFixMe[incompatible-call]: We don't want to use rest arguments since we transpile the code.
2215
- return fn.apply(null, arguments);
2216
- };
2217
- }
2218
- var cache = noopCache ;
2219
-
2220
- function resolveDispatcher() {
2221
- var dispatcher = ReactSharedInternals.H;
2222
-
2223
- {
2224
- if (dispatcher === null) {
2225
- error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.');
2226
159
  }
2227
- } // Will result in a null access error if accessed outside render phase. We
2228
- // intentionally don't throw our own error because this is in a hot path.
2229
- // Also helps ensure this is inlined.
2230
-
2231
-
2232
- return dispatcher;
2233
- }
2234
- function useContext(Context) {
2235
- var dispatcher = resolveDispatcher();
2236
-
2237
- {
2238
- if (Context.$$typeof === REACT_CONSUMER_TYPE) {
2239
- error('Calling useContext(Context.Consumer) is not supported and will cause bugs. ' + 'Did you mean to call useContext(Context) instead?');
160
+ function getOwner() {
161
+ var dispatcher = ReactSharedInternals.A;
162
+ return null === dispatcher ? null : dispatcher.getOwner();
2240
163
  }
2241
- }
2242
-
2243
- return dispatcher.useContext(Context);
2244
- }
2245
- function useState(initialState) {
2246
- var dispatcher = resolveDispatcher();
2247
- return dispatcher.useState(initialState);
2248
- }
2249
- function useReducer(reducer, initialArg, init) {
2250
- var dispatcher = resolveDispatcher();
2251
- return dispatcher.useReducer(reducer, initialArg, init);
2252
- }
2253
- function useRef(initialValue) {
2254
- var dispatcher = resolveDispatcher();
2255
- return dispatcher.useRef(initialValue);
2256
- }
2257
- function useEffect(create, deps) {
2258
- var dispatcher = resolveDispatcher();
2259
- return dispatcher.useEffect(create, deps);
2260
- }
2261
- function useInsertionEffect(create, deps) {
2262
- var dispatcher = resolveDispatcher();
2263
- return dispatcher.useInsertionEffect(create, deps);
2264
- }
2265
- function useLayoutEffect(create, deps) {
2266
- var dispatcher = resolveDispatcher();
2267
- return dispatcher.useLayoutEffect(create, deps);
2268
- }
2269
- function useCallback(callback, deps) {
2270
- var dispatcher = resolveDispatcher();
2271
- return dispatcher.useCallback(callback, deps);
2272
- }
2273
- function useMemo(create, deps) {
2274
- var dispatcher = resolveDispatcher();
2275
- return dispatcher.useMemo(create, deps);
2276
- }
2277
- function useImperativeHandle(ref, create, deps) {
2278
- var dispatcher = resolveDispatcher();
2279
- return dispatcher.useImperativeHandle(ref, create, deps);
2280
- }
2281
- function useDebugValue(value, formatterFn) {
2282
- {
2283
- var dispatcher = resolveDispatcher();
2284
- return dispatcher.useDebugValue(value, formatterFn);
2285
- }
2286
- }
2287
- function useTransition() {
2288
- var dispatcher = resolveDispatcher();
2289
- return dispatcher.useTransition();
2290
- }
2291
- function useDeferredValue(value, initialValue) {
2292
- var dispatcher = resolveDispatcher();
2293
- return dispatcher.useDeferredValue(value, initialValue);
2294
- }
2295
- function useId() {
2296
- var dispatcher = resolveDispatcher();
2297
- return dispatcher.useId();
2298
- }
2299
- function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
2300
- var dispatcher = resolveDispatcher();
2301
- return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
2302
- }
2303
- function useCacheRefresh() {
2304
- var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
2305
-
2306
- return dispatcher.useCacheRefresh();
2307
- }
2308
- function use(usable) {
2309
- var dispatcher = resolveDispatcher();
2310
- return dispatcher.use(usable);
2311
- }
2312
- function useOptimistic(passthrough, reducer) {
2313
- var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
2314
-
2315
- return dispatcher.useOptimistic(passthrough, reducer);
2316
- }
2317
- function useActionState(action, initialState, permalink) {
2318
- {
2319
- var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
2320
-
2321
- return dispatcher.useActionState(action, initialState, permalink);
2322
- }
2323
- }
2324
-
2325
- var reportGlobalError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event,
2326
- // emulating an uncaught JavaScript error.
2327
- reportError : function (error) {
2328
- if (typeof window === 'object' && typeof window.ErrorEvent === 'function') {
2329
- // Browser Polyfill
2330
- var message = typeof error === 'object' && error !== null && typeof error.message === 'string' ? // eslint-disable-next-line react-internal/safe-string-coercion
2331
- String(error.message) : // eslint-disable-next-line react-internal/safe-string-coercion
2332
- String(error);
2333
- var event = new window.ErrorEvent('error', {
2334
- bubbles: true,
2335
- cancelable: true,
2336
- message: message,
2337
- error: error
2338
- });
2339
- var shouldLog = window.dispatchEvent(event);
2340
-
2341
- if (!shouldLog) {
2342
- return;
164
+ function UnknownOwner() {
165
+ return Error("react-stack-top-frame");
2343
166
  }
2344
- } else if (typeof process === 'object' && // $FlowFixMe[method-unbinding]
2345
- typeof process.emit === 'function') {
2346
- // Node Polyfill
2347
- process.emit('uncaughtException', error);
2348
- return;
2349
- } // eslint-disable-next-line react-internal/no-production-logging
2350
-
2351
-
2352
- console['error'](error);
2353
- };
2354
-
2355
- function startTransition(scope, options) {
2356
- var prevTransition = ReactSharedInternals.T; // Each renderer registers a callback to receive the return value of
2357
- // the scope function. This is used to implement async actions.
2358
-
2359
- var callbacks = new Set();
2360
- var transition = {
2361
- _callbacks: callbacks
2362
- };
2363
- ReactSharedInternals.T = transition;
2364
- var currentTransition = ReactSharedInternals.T;
2365
-
2366
- {
2367
- ReactSharedInternals.T._updatedFibers = new Set();
2368
- }
2369
-
2370
- {
2371
- try {
2372
- var returnValue = scope();
2373
-
2374
- if (typeof returnValue === 'object' && returnValue !== null && typeof returnValue.then === 'function') {
2375
- callbacks.forEach(function (callback) {
2376
- return callback(currentTransition, returnValue);
2377
- });
2378
- returnValue.then(noop, reportGlobalError);
167
+ function hasValidKey(config) {
168
+ if (hasOwnProperty.call(config, "key")) {
169
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
170
+ if (getter && getter.isReactWarning) return !1;
2379
171
  }
2380
- } catch (error) {
2381
- reportGlobalError(error);
2382
- } finally {
2383
- warnAboutTransitionSubscriptions(prevTransition, currentTransition);
2384
- ReactSharedInternals.T = prevTransition;
2385
- }
2386
- }
2387
- }
2388
-
2389
- function warnAboutTransitionSubscriptions(prevTransition, currentTransition) {
2390
- {
2391
- if (prevTransition === null && currentTransition._updatedFibers) {
2392
- var updatedFibersCount = currentTransition._updatedFibers.size;
2393
-
2394
- currentTransition._updatedFibers.clear();
2395
-
2396
- if (updatedFibersCount > 10) {
2397
- warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
172
+ return void 0 !== config.key;
173
+ }
174
+ function defineKeyPropWarningGetter(props, displayName) {
175
+ function warnAboutAccessingKey() {
176
+ specialPropKeyWarningShown ||
177
+ ((specialPropKeyWarningShown = !0),
178
+ console.error(
179
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
180
+ displayName
181
+ ));
2398
182
  }
183
+ warnAboutAccessingKey.isReactWarning = !0;
184
+ Object.defineProperty(props, "key", {
185
+ get: warnAboutAccessingKey,
186
+ configurable: !0
187
+ });
2399
188
  }
2400
- }
2401
- }
2402
-
2403
- function noop() {}
2404
-
2405
- var didWarnAboutMessageChannel = false;
2406
- var enqueueTaskImpl = null;
2407
- function enqueueTask(task) {
2408
- if (enqueueTaskImpl === null) {
2409
- try {
2410
- // read require off the module object to get around the bundlers.
2411
- // we don't want them to detect a require and bundle a Node polyfill.
2412
- var requireString = ('require' + Math.random()).slice(0, 7);
2413
- var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
2414
- // version of setImmediate, bypassing fake timers if any.
2415
-
2416
- enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
2417
- } catch (_err) {
2418
- // we're in a browser
2419
- // we can't use regular timers because they may still be faked
2420
- // so we try MessageChannel+postMessage instead
2421
- enqueueTaskImpl = function (callback) {
2422
- {
2423
- if (didWarnAboutMessageChannel === false) {
2424
- didWarnAboutMessageChannel = true;
2425
-
2426
- if (typeof MessageChannel === 'undefined') {
2427
- error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');
2428
- }
2429
- }
2430
- }
2431
-
2432
- var channel = new MessageChannel();
2433
- channel.port1.onmessage = callback;
2434
- channel.port2.postMessage(undefined);
189
+ function elementRefGetterWithDeprecationWarning() {
190
+ var componentName = getComponentNameFromType(this.type);
191
+ didWarnAboutElementRef[componentName] ||
192
+ ((didWarnAboutElementRef[componentName] = !0),
193
+ console.error(
194
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
195
+ ));
196
+ componentName = this.props.ref;
197
+ return void 0 !== componentName ? componentName : null;
198
+ }
199
+ function ReactElement(
200
+ type,
201
+ key,
202
+ self,
203
+ source,
204
+ owner,
205
+ props,
206
+ debugStack,
207
+ debugTask
208
+ ) {
209
+ self = props.ref;
210
+ type = {
211
+ $$typeof: REACT_ELEMENT_TYPE,
212
+ type: type,
213
+ key: key,
214
+ props: props,
215
+ _owner: owner
2435
216
  };
2436
- }
2437
- }
2438
-
2439
- return enqueueTaskImpl(task);
2440
- }
2441
-
2442
- // number of `act` scopes on the stack.
2443
-
2444
- var actScopeDepth = 0; // We only warn the first time you neglect to await an async `act` scope.
2445
-
2446
- var didWarnNoAwaitAct = false;
2447
-
2448
- function aggregateErrors(errors) {
2449
- if (errors.length > 1 && typeof AggregateError === 'function') {
2450
- // eslint-disable-next-line no-undef
2451
- return new AggregateError(errors);
2452
- }
2453
-
2454
- return errors[0];
2455
- }
2456
-
2457
- function act(callback) {
2458
- {
2459
- // When ReactSharedInternals.actQueue is not null, it signals to React that
2460
- // we're currently inside an `act` scope. React will push all its tasks to
2461
- // this queue instead of scheduling them with platform APIs.
2462
- //
2463
- // We set this to an empty array when we first enter an `act` scope, and
2464
- // only unset it once we've left the outermost `act` scope — remember that
2465
- // `act` calls can be nested.
2466
- //
2467
- // If we're already inside an `act` scope, reuse the existing queue.
2468
- var prevIsBatchingLegacy = false;
2469
- var prevActQueue = ReactSharedInternals.actQueue;
2470
- var prevActScopeDepth = actScopeDepth;
2471
- actScopeDepth++;
2472
- var queue = ReactSharedInternals.actQueue = prevActQueue !== null ? prevActQueue : []; // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
2473
-
2474
- var result; // This tracks whether the `act` call is awaited. In certain cases, not
2475
- // awaiting it is a mistake, so we will detect that and warn.
2476
-
2477
- var didAwaitActCall = false;
2478
-
2479
- try {
2480
- // Reset this to `false` right before entering the React work loop. The
2481
- // only place we ever read this fields is just below, right after running
2482
- // the callback. So we don't need to reset after the callback runs.
2483
- if (!disableLegacyMode) ;
2484
-
2485
- result = callback();
2486
- var didScheduleLegacyUpdate = !disableLegacyMode ? ReactSharedInternals.didScheduleLegacyUpdate : false; // Replicate behavior of original `act` implementation in legacy mode,
2487
- // which flushed updates immediately after the scope function exits, even
2488
- // if it's an async function.
2489
-
2490
- if (!prevIsBatchingLegacy && didScheduleLegacyUpdate) {
2491
- flushActQueue(queue);
2492
- } // `isBatchingLegacy` gets reset using the regular stack, not the async
2493
- // one used to track `act` scopes. Why, you may be wondering? Because
2494
- // that's how it worked before version 18. Yes, it's confusing! We should
2495
- // delete legacy mode!!
2496
-
2497
-
2498
- if (!disableLegacyMode) ;
2499
- } catch (error) {
2500
- // `isBatchingLegacy` gets reset using the regular stack, not the async
2501
- // one used to track `act` scopes. Why, you may be wondering? Because
2502
- // that's how it worked before version 18. Yes, it's confusing! We should
2503
- // delete legacy mode!!
2504
- ReactSharedInternals.thrownErrors.push(error);
2505
- }
2506
-
2507
- if (ReactSharedInternals.thrownErrors.length > 0) {
2508
-
2509
- popActScope(prevActQueue, prevActScopeDepth);
2510
- var thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
2511
- ReactSharedInternals.thrownErrors.length = 0;
2512
- throw thrownError;
2513
- }
2514
-
2515
- if (result !== null && typeof result === 'object' && // $FlowFixMe[method-unbinding]
2516
- typeof result.then === 'function') {
2517
- // A promise/thenable was returned from the callback. Wait for it to
2518
- // resolve before flushing the queue.
2519
- //
2520
- // If `act` were implemented as an async function, this whole block could
2521
- // be a single `await` call. That's really the only difference between
2522
- // this branch and the next one.
2523
- var thenable = result; // Warn if the an `act` call with an async scope is not awaited. In a
2524
- // future release, consider making this an error.
2525
-
2526
- queueSeveralMicrotasks(function () {
2527
- if (!didAwaitActCall && !didWarnNoAwaitAct) {
2528
- didWarnNoAwaitAct = true;
2529
-
2530
- error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');
2531
- }
217
+ null !== (void 0 !== self ? self : null)
218
+ ? Object.defineProperty(type, "ref", {
219
+ enumerable: !1,
220
+ get: elementRefGetterWithDeprecationWarning
221
+ })
222
+ : Object.defineProperty(type, "ref", { enumerable: !1, value: null });
223
+ type._store = {};
224
+ Object.defineProperty(type._store, "validated", {
225
+ configurable: !1,
226
+ enumerable: !1,
227
+ writable: !0,
228
+ value: 0
2532
229
  });
2533
- return {
2534
- then: function (resolve, reject) {
2535
- didAwaitActCall = true;
2536
- thenable.then(function (returnValue) {
2537
- popActScope(prevActQueue, prevActScopeDepth);
2538
-
2539
- if (prevActScopeDepth === 0) {
2540
- // We're exiting the outermost `act` scope. Flush the queue.
2541
- try {
2542
- flushActQueue(queue);
2543
- enqueueTask(function () {
2544
- return (// Recursively flush tasks scheduled by a microtask.
2545
- recursivelyFlushAsyncActWork(returnValue, resolve, reject)
2546
- );
2547
- });
2548
- } catch (error) {
2549
- // `thenable` might not be a real promise, and `flushActQueue`
2550
- // might throw, so we need to wrap `flushActQueue` in a
2551
- // try/catch.
2552
- ReactSharedInternals.thrownErrors.push(error);
2553
- }
2554
-
2555
- if (ReactSharedInternals.thrownErrors.length > 0) {
2556
- var _thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
2557
-
2558
- ReactSharedInternals.thrownErrors.length = 0;
2559
- reject(_thrownError);
2560
- }
2561
- } else {
2562
- resolve(returnValue);
2563
- }
2564
- }, function (error) {
2565
- popActScope(prevActQueue, prevActScopeDepth);
2566
-
2567
- if (ReactSharedInternals.thrownErrors.length > 0) {
2568
- var _thrownError2 = aggregateErrors(ReactSharedInternals.thrownErrors);
2569
-
2570
- ReactSharedInternals.thrownErrors.length = 0;
2571
- reject(_thrownError2);
2572
- } else {
2573
- reject(error);
230
+ Object.defineProperty(type, "_debugInfo", {
231
+ configurable: !1,
232
+ enumerable: !1,
233
+ writable: !0,
234
+ value: null
235
+ });
236
+ Object.defineProperty(type, "_debugStack", {
237
+ configurable: !1,
238
+ enumerable: !1,
239
+ writable: !0,
240
+ value: debugStack
241
+ });
242
+ Object.defineProperty(type, "_debugTask", {
243
+ configurable: !1,
244
+ enumerable: !1,
245
+ writable: !0,
246
+ value: debugTask
247
+ });
248
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
249
+ return type;
250
+ }
251
+ function cloneAndReplaceKey(oldElement, newKey) {
252
+ newKey = ReactElement(
253
+ oldElement.type,
254
+ newKey,
255
+ void 0,
256
+ void 0,
257
+ oldElement._owner,
258
+ oldElement.props,
259
+ oldElement._debugStack,
260
+ oldElement._debugTask
261
+ );
262
+ oldElement._store &&
263
+ (newKey._store.validated = oldElement._store.validated);
264
+ return newKey;
265
+ }
266
+ function isValidElement(object) {
267
+ return (
268
+ "object" === typeof object &&
269
+ null !== object &&
270
+ object.$$typeof === REACT_ELEMENT_TYPE
271
+ );
272
+ }
273
+ function escape(key) {
274
+ var escaperLookup = { "=": "=0", ":": "=2" };
275
+ return (
276
+ "$" +
277
+ key.replace(/[=:]/g, function (match) {
278
+ return escaperLookup[match];
279
+ })
280
+ );
281
+ }
282
+ function getElementKey(element, index) {
283
+ return "object" === typeof element &&
284
+ null !== element &&
285
+ null != element.key
286
+ ? (checkKeyStringCoercion(element.key), escape("" + element.key))
287
+ : index.toString(36);
288
+ }
289
+ function noop$1() {}
290
+ function resolveThenable(thenable) {
291
+ switch (thenable.status) {
292
+ case "fulfilled":
293
+ return thenable.value;
294
+ case "rejected":
295
+ throw thenable.reason;
296
+ default:
297
+ switch (
298
+ ("string" === typeof thenable.status
299
+ ? thenable.then(noop$1, noop$1)
300
+ : ((thenable.status = "pending"),
301
+ thenable.then(
302
+ function (fulfilledValue) {
303
+ "pending" === thenable.status &&
304
+ ((thenable.status = "fulfilled"),
305
+ (thenable.value = fulfilledValue));
306
+ },
307
+ function (error) {
308
+ "pending" === thenable.status &&
309
+ ((thenable.status = "rejected"),
310
+ (thenable.reason = error));
311
+ }
312
+ )),
313
+ thenable.status)
314
+ ) {
315
+ case "fulfilled":
316
+ return thenable.value;
317
+ case "rejected":
318
+ throw thenable.reason;
319
+ }
320
+ }
321
+ throw thenable;
322
+ }
323
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
324
+ var type = typeof children;
325
+ if ("undefined" === type || "boolean" === type) children = null;
326
+ var invokeCallback = !1;
327
+ if (null === children) invokeCallback = !0;
328
+ else
329
+ switch (type) {
330
+ case "bigint":
331
+ case "string":
332
+ case "number":
333
+ invokeCallback = !0;
334
+ break;
335
+ case "object":
336
+ switch (children.$$typeof) {
337
+ case REACT_ELEMENT_TYPE:
338
+ case REACT_PORTAL_TYPE:
339
+ invokeCallback = !0;
340
+ break;
341
+ case REACT_LAZY_TYPE:
342
+ return (
343
+ (invokeCallback = children._init),
344
+ mapIntoArray(
345
+ invokeCallback(children._payload),
346
+ array,
347
+ escapedPrefix,
348
+ nameSoFar,
349
+ callback
350
+ )
351
+ );
2574
352
  }
2575
- });
2576
353
  }
2577
- };
2578
- } else {
2579
- var returnValue = result; // The callback is not an async function. Exit the current
2580
- // scope immediately.
2581
-
2582
- popActScope(prevActQueue, prevActScopeDepth);
2583
-
2584
- if (prevActScopeDepth === 0) {
2585
- // We're exiting the outermost `act` scope. Flush the queue.
2586
- flushActQueue(queue); // If the queue is not empty, it implies that we intentionally yielded
2587
- // to the main thread, because something suspended. We will continue
2588
- // in an asynchronous task.
2589
- //
2590
- // Warn if something suspends but the `act` call is not awaited.
2591
- // In a future release, consider making this an error.
2592
-
2593
- if (queue.length !== 0) {
2594
- queueSeveralMicrotasks(function () {
2595
- if (!didAwaitActCall && !didWarnNoAwaitAct) {
2596
- didWarnNoAwaitAct = true;
2597
-
2598
- error('A component suspended inside an `act` scope, but the ' + '`act` call was not awaited. When testing React ' + 'components that depend on asynchronous data, you must ' + 'await the result:\n\n' + 'await act(() => ...)');
2599
- }
2600
- });
2601
- } // Like many things in this module, this is next part is confusing.
2602
- //
2603
- // We do not currently require every `act` call that is passed a
2604
- // callback to be awaited, through arguably we should. Since this
2605
- // callback was synchronous, we need to exit the current scope before
2606
- // returning.
2607
- //
2608
- // However, if thenable we're about to return *is* awaited, we'll
2609
- // immediately restore the current scope. So it shouldn't observable.
2610
- //
2611
- // This doesn't affect the case where the scope callback is async,
2612
- // because we always require those calls to be awaited.
2613
- //
2614
- // TODO: In a future version, consider always requiring all `act` calls
2615
- // to be awaited, regardless of whether the callback is sync or async.
2616
-
2617
-
2618
- ReactSharedInternals.actQueue = null;
354
+ if (invokeCallback) {
355
+ invokeCallback = children;
356
+ callback = callback(invokeCallback);
357
+ var childKey =
358
+ "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
359
+ isArrayImpl(callback)
360
+ ? ((escapedPrefix = ""),
361
+ null != childKey &&
362
+ (escapedPrefix =
363
+ childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
364
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
365
+ return c;
366
+ }))
367
+ : null != callback &&
368
+ (isValidElement(callback) &&
369
+ (null != callback.key &&
370
+ ((invokeCallback && invokeCallback.key === callback.key) ||
371
+ checkKeyStringCoercion(callback.key)),
372
+ (escapedPrefix = cloneAndReplaceKey(
373
+ callback,
374
+ escapedPrefix +
375
+ (null == callback.key ||
376
+ (invokeCallback && invokeCallback.key === callback.key)
377
+ ? ""
378
+ : ("" + callback.key).replace(
379
+ userProvidedKeyEscapeRegex,
380
+ "$&/"
381
+ ) + "/") +
382
+ childKey
383
+ )),
384
+ "" !== nameSoFar &&
385
+ null != invokeCallback &&
386
+ isValidElement(invokeCallback) &&
387
+ null == invokeCallback.key &&
388
+ invokeCallback._store &&
389
+ !invokeCallback._store.validated &&
390
+ (escapedPrefix._store.validated = 2),
391
+ (callback = escapedPrefix)),
392
+ array.push(callback));
393
+ return 1;
2619
394
  }
2620
-
2621
- if (ReactSharedInternals.thrownErrors.length > 0) {
2622
- var _thrownError3 = aggregateErrors(ReactSharedInternals.thrownErrors);
2623
-
2624
- ReactSharedInternals.thrownErrors.length = 0;
2625
- throw _thrownError3;
395
+ invokeCallback = 0;
396
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
397
+ if (isArrayImpl(children))
398
+ for (var i = 0; i < children.length; i++)
399
+ (nameSoFar = children[i]),
400
+ (type = childKey + getElementKey(nameSoFar, i)),
401
+ (invokeCallback += mapIntoArray(
402
+ nameSoFar,
403
+ array,
404
+ escapedPrefix,
405
+ type,
406
+ callback
407
+ ));
408
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
409
+ for (
410
+ i === children.entries &&
411
+ (didWarnAboutMaps ||
412
+ console.warn(
413
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
414
+ ),
415
+ (didWarnAboutMaps = !0)),
416
+ children = i.call(children),
417
+ i = 0;
418
+ !(nameSoFar = children.next()).done;
419
+
420
+ )
421
+ (nameSoFar = nameSoFar.value),
422
+ (type = childKey + getElementKey(nameSoFar, i++)),
423
+ (invokeCallback += mapIntoArray(
424
+ nameSoFar,
425
+ array,
426
+ escapedPrefix,
427
+ type,
428
+ callback
429
+ ));
430
+ else if ("object" === type) {
431
+ if ("function" === typeof children.then)
432
+ return mapIntoArray(
433
+ resolveThenable(children),
434
+ array,
435
+ escapedPrefix,
436
+ nameSoFar,
437
+ callback
438
+ );
439
+ array = String(children);
440
+ throw Error(
441
+ "Objects are not valid as a React child (found: " +
442
+ ("[object Object]" === array
443
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
444
+ : array) +
445
+ "). If you meant to render a collection of children, use an array instead."
446
+ );
2626
447
  }
2627
-
2628
- return {
2629
- then: function (resolve, reject) {
2630
- didAwaitActCall = true;
2631
-
2632
- if (prevActScopeDepth === 0) {
2633
- // If the `act` call is awaited, restore the queue we were
2634
- // using before (see long comment above) so we can flush it.
2635
- ReactSharedInternals.actQueue = queue;
448
+ return invokeCallback;
449
+ }
450
+ function mapChildren(children, func, context) {
451
+ if (null == children) return children;
452
+ var result = [],
453
+ count = 0;
454
+ mapIntoArray(children, result, "", "", function (child) {
455
+ return func.call(context, child, count++);
456
+ });
457
+ return result;
458
+ }
459
+ function lazyInitializer(payload) {
460
+ if (-1 === payload._status) {
461
+ var ctor = payload._result;
462
+ ctor = ctor();
463
+ ctor.then(
464
+ function (moduleObject) {
465
+ if (0 === payload._status || -1 === payload._status)
466
+ (payload._status = 1), (payload._result = moduleObject);
467
+ },
468
+ function (error) {
469
+ if (0 === payload._status || -1 === payload._status)
470
+ (payload._status = 2), (payload._result = error);
471
+ }
472
+ );
473
+ -1 === payload._status &&
474
+ ((payload._status = 0), (payload._result = ctor));
475
+ }
476
+ if (1 === payload._status)
477
+ return (
478
+ (ctor = payload._result),
479
+ void 0 === ctor &&
480
+ console.error(
481
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
482
+ ctor
483
+ ),
484
+ "default" in ctor ||
485
+ console.error(
486
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
487
+ ctor
488
+ ),
489
+ ctor.default
490
+ );
491
+ throw payload._result;
492
+ }
493
+ function resolveDispatcher() {
494
+ var dispatcher = ReactSharedInternals.H;
495
+ null === dispatcher &&
496
+ console.error(
497
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
498
+ );
499
+ return dispatcher;
500
+ }
501
+ function releaseAsyncTransition() {
502
+ ReactSharedInternals.asyncTransitions--;
503
+ }
504
+ function noop() {}
505
+ function enqueueTask(task) {
506
+ if (null === enqueueTaskImpl)
507
+ try {
508
+ var requireString = ("require" + Math.random()).slice(0, 7);
509
+ enqueueTaskImpl = (module && module[requireString]).call(
510
+ module,
511
+ "timers"
512
+ ).setImmediate;
513
+ } catch (_err) {
514
+ enqueueTaskImpl = function (callback) {
515
+ !1 === didWarnAboutMessageChannel &&
516
+ ((didWarnAboutMessageChannel = !0),
517
+ "undefined" === typeof MessageChannel &&
518
+ console.error(
519
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
520
+ ));
521
+ var channel = new MessageChannel();
522
+ channel.port1.onmessage = callback;
523
+ channel.port2.postMessage(void 0);
524
+ };
525
+ }
526
+ return enqueueTaskImpl(task);
527
+ }
528
+ function aggregateErrors(errors) {
529
+ return 1 < errors.length && "function" === typeof AggregateError
530
+ ? new AggregateError(errors)
531
+ : errors[0];
532
+ }
533
+ function popActScope(prevActQueue, prevActScopeDepth) {
534
+ prevActScopeDepth !== actScopeDepth - 1 &&
535
+ console.error(
536
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
537
+ );
538
+ actScopeDepth = prevActScopeDepth;
539
+ }
540
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
541
+ var queue = ReactSharedInternals.actQueue;
542
+ if (null !== queue)
543
+ if (0 !== queue.length)
544
+ try {
545
+ flushActQueue(queue);
2636
546
  enqueueTask(function () {
2637
- return (// Recursively flush tasks scheduled by a microtask.
2638
- recursivelyFlushAsyncActWork(returnValue, resolve, reject)
2639
- );
547
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2640
548
  });
2641
- } else {
2642
- resolve(returnValue);
549
+ return;
550
+ } catch (error) {
551
+ ReactSharedInternals.thrownErrors.push(error);
2643
552
  }
2644
- }
2645
- };
2646
- }
2647
- }
2648
- }
2649
-
2650
- function popActScope(prevActQueue, prevActScopeDepth) {
2651
- {
2652
- if (prevActScopeDepth !== actScopeDepth - 1) {
2653
- error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
2654
- }
2655
-
2656
- actScopeDepth = prevActScopeDepth;
2657
- }
2658
- }
2659
-
2660
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
2661
- {
2662
- // Check if any tasks were scheduled asynchronously.
2663
- var queue = ReactSharedInternals.actQueue;
2664
-
2665
- if (queue !== null) {
2666
- if (queue.length !== 0) {
2667
- // Async tasks were scheduled, mostly likely in a microtask.
2668
- // Keep flushing until there are no more.
553
+ else ReactSharedInternals.actQueue = null;
554
+ 0 < ReactSharedInternals.thrownErrors.length
555
+ ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),
556
+ (ReactSharedInternals.thrownErrors.length = 0),
557
+ reject(queue))
558
+ : resolve(returnValue);
559
+ }
560
+ function flushActQueue(queue) {
561
+ if (!isFlushing) {
562
+ isFlushing = !0;
563
+ var i = 0;
2669
564
  try {
2670
- flushActQueue(queue); // The work we just performed may have schedule additional async
2671
- // tasks. Wait a macrotask and check again.
2672
-
2673
- enqueueTask(function () {
2674
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2675
- });
2676
- return;
565
+ for (; i < queue.length; i++) {
566
+ var callback = queue[i];
567
+ do {
568
+ ReactSharedInternals.didUsePromise = !1;
569
+ var continuation = callback(!1);
570
+ if (null !== continuation) {
571
+ if (ReactSharedInternals.didUsePromise) {
572
+ queue[i] = callback;
573
+ queue.splice(0, i);
574
+ return;
575
+ }
576
+ callback = continuation;
577
+ } else break;
578
+ } while (1);
579
+ }
580
+ queue.length = 0;
2677
581
  } catch (error) {
2678
- // Leave remaining tasks on the queue if something throws.
2679
- ReactSharedInternals.thrownErrors.push(error);
582
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
583
+ } finally {
584
+ isFlushing = !1;
2680
585
  }
2681
- } else {
2682
- // The queue is empty. We can finish.
2683
- ReactSharedInternals.actQueue = null;
2684
586
  }
2685
587
  }
2686
-
2687
- if (ReactSharedInternals.thrownErrors.length > 0) {
2688
- var thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
2689
- ReactSharedInternals.thrownErrors.length = 0;
2690
- reject(thrownError);
2691
- } else {
2692
- resolve(returnValue);
2693
- }
2694
- }
2695
- }
2696
-
2697
- var isFlushing = false;
2698
-
2699
- function flushActQueue(queue) {
2700
- {
2701
- if (!isFlushing) {
2702
- // Prevent re-entrance.
2703
- isFlushing = true;
2704
- var i = 0;
2705
-
2706
- try {
2707
- for (; i < queue.length; i++) {
2708
- var callback = queue[i];
2709
-
2710
- do {
2711
- ReactSharedInternals.didUsePromise = false;
2712
- var continuation = callback(false);
2713
-
2714
- if (continuation !== null) {
2715
- if (ReactSharedInternals.didUsePromise) {
2716
- // The component just suspended. Yield to the main thread in
2717
- // case the promise is already resolved. If so, it will ping in
2718
- // a microtask and we can resume without unwinding the stack.
2719
- queue[i] = callback;
2720
- queue.splice(0, i);
588
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
589
+ "function" ===
590
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
591
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
592
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
593
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
594
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
595
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
596
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler");
597
+ Symbol.for("react.provider");
598
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
599
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
600
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
601
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
602
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
603
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
604
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
605
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
606
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
607
+ didWarnStateUpdateForUnmountedComponent = {},
608
+ ReactNoopUpdateQueue = {
609
+ isMounted: function () {
610
+ return !1;
611
+ },
612
+ enqueueForceUpdate: function (publicInstance) {
613
+ warnNoop(publicInstance, "forceUpdate");
614
+ },
615
+ enqueueReplaceState: function (publicInstance) {
616
+ warnNoop(publicInstance, "replaceState");
617
+ },
618
+ enqueueSetState: function (publicInstance) {
619
+ warnNoop(publicInstance, "setState");
620
+ }
621
+ },
622
+ assign = Object.assign,
623
+ emptyObject = {};
624
+ Object.freeze(emptyObject);
625
+ Component.prototype.isReactComponent = {};
626
+ Component.prototype.setState = function (partialState, callback) {
627
+ if (
628
+ "object" !== typeof partialState &&
629
+ "function" !== typeof partialState &&
630
+ null != partialState
631
+ )
632
+ throw Error(
633
+ "takes an object of state variables to update or a function which returns an object of state variables."
634
+ );
635
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
636
+ };
637
+ Component.prototype.forceUpdate = function (callback) {
638
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
639
+ };
640
+ var deprecatedAPIs = {
641
+ isMounted: [
642
+ "isMounted",
643
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
644
+ ],
645
+ replaceState: [
646
+ "replaceState",
647
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
648
+ ]
649
+ },
650
+ fnName;
651
+ for (fnName in deprecatedAPIs)
652
+ deprecatedAPIs.hasOwnProperty(fnName) &&
653
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
654
+ ComponentDummy.prototype = Component.prototype;
655
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
656
+ deprecatedAPIs.constructor = PureComponent;
657
+ assign(deprecatedAPIs, Component.prototype);
658
+ deprecatedAPIs.isPureReactComponent = !0;
659
+ var isArrayImpl = Array.isArray,
660
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
661
+ ReactSharedInternals = {
662
+ H: null,
663
+ A: null,
664
+ T: null,
665
+ S: null,
666
+ actQueue: null,
667
+ asyncTransitions: 0,
668
+ isBatchingLegacy: !1,
669
+ didScheduleLegacyUpdate: !1,
670
+ didUsePromise: !1,
671
+ thrownErrors: [],
672
+ getCurrentStack: null,
673
+ recentlyCreatedOwnerStacks: 0
674
+ },
675
+ hasOwnProperty = Object.prototype.hasOwnProperty,
676
+ createTask = console.createTask
677
+ ? console.createTask
678
+ : function () {
679
+ return null;
680
+ };
681
+ deprecatedAPIs = {
682
+ "react-stack-bottom-frame": function (callStackForError) {
683
+ return callStackForError();
684
+ }
685
+ };
686
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
687
+ var didWarnAboutElementRef = {};
688
+ var unknownOwnerDebugStack = deprecatedAPIs[
689
+ "react-stack-bottom-frame"
690
+ ].bind(deprecatedAPIs, UnknownOwner)();
691
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
692
+ var didWarnAboutMaps = !1,
693
+ userProvidedKeyEscapeRegex = /\/+/g,
694
+ reportGlobalError =
695
+ "function" === typeof reportError
696
+ ? reportError
697
+ : function (error) {
698
+ if (
699
+ "object" === typeof window &&
700
+ "function" === typeof window.ErrorEvent
701
+ ) {
702
+ var event = new window.ErrorEvent("error", {
703
+ bubbles: !0,
704
+ cancelable: !0,
705
+ message:
706
+ "object" === typeof error &&
707
+ null !== error &&
708
+ "string" === typeof error.message
709
+ ? String(error.message)
710
+ : String(error),
711
+ error: error
712
+ });
713
+ if (!window.dispatchEvent(event)) return;
714
+ } else if (
715
+ "object" === typeof process &&
716
+ "function" === typeof process.emit
717
+ ) {
718
+ process.emit("uncaughtException", error);
2721
719
  return;
2722
720
  }
2723
-
2724
- callback = continuation;
2725
- } else {
2726
- break;
721
+ console.error(error);
722
+ },
723
+ didWarnAboutMessageChannel = !1,
724
+ enqueueTaskImpl = null,
725
+ actScopeDepth = 0,
726
+ didWarnNoAwaitAct = !1,
727
+ isFlushing = !1,
728
+ queueSeveralMicrotasks =
729
+ "function" === typeof queueMicrotask
730
+ ? function (callback) {
731
+ queueMicrotask(function () {
732
+ return queueMicrotask(callback);
733
+ });
2727
734
  }
2728
- } while (true);
2729
- } // We flushed the entire queue.
2730
-
2731
-
2732
- queue.length = 0;
735
+ : enqueueTask;
736
+ deprecatedAPIs = Object.freeze({
737
+ __proto__: null,
738
+ c: function (size) {
739
+ return resolveDispatcher().useMemoCache(size);
740
+ }
741
+ });
742
+ exports.Children = {
743
+ map: mapChildren,
744
+ forEach: function (children, forEachFunc, forEachContext) {
745
+ mapChildren(
746
+ children,
747
+ function () {
748
+ forEachFunc.apply(this, arguments);
749
+ },
750
+ forEachContext
751
+ );
752
+ },
753
+ count: function (children) {
754
+ var n = 0;
755
+ mapChildren(children, function () {
756
+ n++;
757
+ });
758
+ return n;
759
+ },
760
+ toArray: function (children) {
761
+ return (
762
+ mapChildren(children, function (child) {
763
+ return child;
764
+ }) || []
765
+ );
766
+ },
767
+ only: function (children) {
768
+ if (!isValidElement(children))
769
+ throw Error(
770
+ "React.Children.only expected to receive a single React element child."
771
+ );
772
+ return children;
773
+ }
774
+ };
775
+ exports.Component = Component;
776
+ exports.Fragment = REACT_FRAGMENT_TYPE;
777
+ exports.Profiler = REACT_PROFILER_TYPE;
778
+ exports.PureComponent = PureComponent;
779
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
780
+ exports.Suspense = REACT_SUSPENSE_TYPE;
781
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
782
+ ReactSharedInternals;
783
+ exports.__COMPILER_RUNTIME = deprecatedAPIs;
784
+ exports.act = function (callback) {
785
+ var prevActQueue = ReactSharedInternals.actQueue,
786
+ prevActScopeDepth = actScopeDepth;
787
+ actScopeDepth++;
788
+ var queue = (ReactSharedInternals.actQueue =
789
+ null !== prevActQueue ? prevActQueue : []),
790
+ didAwaitActCall = !1;
791
+ try {
792
+ var result = callback();
2733
793
  } catch (error) {
2734
- // If something throws, leave the remaining callbacks on the queue.
2735
- queue.splice(0, i + 1);
2736
794
  ReactSharedInternals.thrownErrors.push(error);
795
+ }
796
+ if (0 < ReactSharedInternals.thrownErrors.length)
797
+ throw (
798
+ (popActScope(prevActQueue, prevActScopeDepth),
799
+ (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
800
+ (ReactSharedInternals.thrownErrors.length = 0),
801
+ callback)
802
+ );
803
+ if (
804
+ null !== result &&
805
+ "object" === typeof result &&
806
+ "function" === typeof result.then
807
+ ) {
808
+ var thenable = result;
809
+ queueSeveralMicrotasks(function () {
810
+ didAwaitActCall ||
811
+ didWarnNoAwaitAct ||
812
+ ((didWarnNoAwaitAct = !0),
813
+ console.error(
814
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
815
+ ));
816
+ });
817
+ return {
818
+ then: function (resolve, reject) {
819
+ didAwaitActCall = !0;
820
+ thenable.then(
821
+ function (returnValue) {
822
+ popActScope(prevActQueue, prevActScopeDepth);
823
+ if (0 === prevActScopeDepth) {
824
+ try {
825
+ flushActQueue(queue),
826
+ enqueueTask(function () {
827
+ return recursivelyFlushAsyncActWork(
828
+ returnValue,
829
+ resolve,
830
+ reject
831
+ );
832
+ });
833
+ } catch (error$0) {
834
+ ReactSharedInternals.thrownErrors.push(error$0);
835
+ }
836
+ if (0 < ReactSharedInternals.thrownErrors.length) {
837
+ var _thrownError = aggregateErrors(
838
+ ReactSharedInternals.thrownErrors
839
+ );
840
+ ReactSharedInternals.thrownErrors.length = 0;
841
+ reject(_thrownError);
842
+ }
843
+ } else resolve(returnValue);
844
+ },
845
+ function (error) {
846
+ popActScope(prevActQueue, prevActScopeDepth);
847
+ 0 < ReactSharedInternals.thrownErrors.length
848
+ ? ((error = aggregateErrors(
849
+ ReactSharedInternals.thrownErrors
850
+ )),
851
+ (ReactSharedInternals.thrownErrors.length = 0),
852
+ reject(error))
853
+ : reject(error);
854
+ }
855
+ );
856
+ }
857
+ };
858
+ }
859
+ var returnValue$jscomp$0 = result;
860
+ popActScope(prevActQueue, prevActScopeDepth);
861
+ 0 === prevActScopeDepth &&
862
+ (flushActQueue(queue),
863
+ 0 !== queue.length &&
864
+ queueSeveralMicrotasks(function () {
865
+ didAwaitActCall ||
866
+ didWarnNoAwaitAct ||
867
+ ((didWarnNoAwaitAct = !0),
868
+ console.error(
869
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
870
+ ));
871
+ }),
872
+ (ReactSharedInternals.actQueue = null));
873
+ if (0 < ReactSharedInternals.thrownErrors.length)
874
+ throw (
875
+ ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
876
+ (ReactSharedInternals.thrownErrors.length = 0),
877
+ callback)
878
+ );
879
+ return {
880
+ then: function (resolve, reject) {
881
+ didAwaitActCall = !0;
882
+ 0 === prevActScopeDepth
883
+ ? ((ReactSharedInternals.actQueue = queue),
884
+ enqueueTask(function () {
885
+ return recursivelyFlushAsyncActWork(
886
+ returnValue$jscomp$0,
887
+ resolve,
888
+ reject
889
+ );
890
+ }))
891
+ : resolve(returnValue$jscomp$0);
892
+ }
893
+ };
894
+ };
895
+ exports.cache = function (fn) {
896
+ return function () {
897
+ return fn.apply(null, arguments);
898
+ };
899
+ };
900
+ exports.captureOwnerStack = function () {
901
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
902
+ return null === getCurrentStack ? null : getCurrentStack();
903
+ };
904
+ exports.cloneElement = function (element, config, children) {
905
+ if (null === element || void 0 === element)
906
+ throw Error(
907
+ "The argument must be a React element, but you passed " +
908
+ element +
909
+ "."
910
+ );
911
+ var props = assign({}, element.props),
912
+ key = element.key,
913
+ owner = element._owner;
914
+ if (null != config) {
915
+ var JSCompiler_inline_result;
916
+ a: {
917
+ if (
918
+ hasOwnProperty.call(config, "ref") &&
919
+ (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
920
+ config,
921
+ "ref"
922
+ ).get) &&
923
+ JSCompiler_inline_result.isReactWarning
924
+ ) {
925
+ JSCompiler_inline_result = !1;
926
+ break a;
927
+ }
928
+ JSCompiler_inline_result = void 0 !== config.ref;
929
+ }
930
+ JSCompiler_inline_result && (owner = getOwner());
931
+ hasValidKey(config) &&
932
+ (checkKeyStringCoercion(config.key), (key = "" + config.key));
933
+ for (propName in config)
934
+ !hasOwnProperty.call(config, propName) ||
935
+ "key" === propName ||
936
+ "__self" === propName ||
937
+ "__source" === propName ||
938
+ ("ref" === propName && void 0 === config.ref) ||
939
+ (props[propName] = config[propName]);
940
+ }
941
+ var propName = arguments.length - 2;
942
+ if (1 === propName) props.children = children;
943
+ else if (1 < propName) {
944
+ JSCompiler_inline_result = Array(propName);
945
+ for (var i = 0; i < propName; i++)
946
+ JSCompiler_inline_result[i] = arguments[i + 2];
947
+ props.children = JSCompiler_inline_result;
948
+ }
949
+ props = ReactElement(
950
+ element.type,
951
+ key,
952
+ void 0,
953
+ void 0,
954
+ owner,
955
+ props,
956
+ element._debugStack,
957
+ element._debugTask
958
+ );
959
+ for (key = 2; key < arguments.length; key++)
960
+ (owner = arguments[key]),
961
+ isValidElement(owner) && owner._store && (owner._store.validated = 1);
962
+ return props;
963
+ };
964
+ exports.createContext = function (defaultValue) {
965
+ defaultValue = {
966
+ $$typeof: REACT_CONTEXT_TYPE,
967
+ _currentValue: defaultValue,
968
+ _currentValue2: defaultValue,
969
+ _threadCount: 0,
970
+ Provider: null,
971
+ Consumer: null
972
+ };
973
+ defaultValue.Provider = defaultValue;
974
+ defaultValue.Consumer = {
975
+ $$typeof: REACT_CONSUMER_TYPE,
976
+ _context: defaultValue
977
+ };
978
+ defaultValue._currentRenderer = null;
979
+ defaultValue._currentRenderer2 = null;
980
+ return defaultValue;
981
+ };
982
+ exports.createElement = function (type, config, children) {
983
+ for (var i = 2; i < arguments.length; i++) {
984
+ var node = arguments[i];
985
+ isValidElement(node) && node._store && (node._store.validated = 1);
986
+ }
987
+ i = {};
988
+ node = null;
989
+ if (null != config)
990
+ for (propName in (didWarnAboutOldJSXRuntime ||
991
+ !("__self" in config) ||
992
+ "key" in config ||
993
+ ((didWarnAboutOldJSXRuntime = !0),
994
+ console.warn(
995
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
996
+ )),
997
+ hasValidKey(config) &&
998
+ (checkKeyStringCoercion(config.key), (node = "" + config.key)),
999
+ config))
1000
+ hasOwnProperty.call(config, propName) &&
1001
+ "key" !== propName &&
1002
+ "__self" !== propName &&
1003
+ "__source" !== propName &&
1004
+ (i[propName] = config[propName]);
1005
+ var childrenLength = arguments.length - 2;
1006
+ if (1 === childrenLength) i.children = children;
1007
+ else if (1 < childrenLength) {
1008
+ for (
1009
+ var childArray = Array(childrenLength), _i = 0;
1010
+ _i < childrenLength;
1011
+ _i++
1012
+ )
1013
+ childArray[_i] = arguments[_i + 2];
1014
+ Object.freeze && Object.freeze(childArray);
1015
+ i.children = childArray;
1016
+ }
1017
+ if (type && type.defaultProps)
1018
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
1019
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1020
+ node &&
1021
+ defineKeyPropWarningGetter(
1022
+ i,
1023
+ "function" === typeof type
1024
+ ? type.displayName || type.name || "Unknown"
1025
+ : type
1026
+ );
1027
+ var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1028
+ return ReactElement(
1029
+ type,
1030
+ node,
1031
+ void 0,
1032
+ void 0,
1033
+ getOwner(),
1034
+ i,
1035
+ propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1036
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1037
+ );
1038
+ };
1039
+ exports.createRef = function () {
1040
+ var refObject = { current: null };
1041
+ Object.seal(refObject);
1042
+ return refObject;
1043
+ };
1044
+ exports.forwardRef = function (render) {
1045
+ null != render && render.$$typeof === REACT_MEMO_TYPE
1046
+ ? console.error(
1047
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1048
+ )
1049
+ : "function" !== typeof render
1050
+ ? console.error(
1051
+ "forwardRef requires a render function but was given %s.",
1052
+ null === render ? "null" : typeof render
1053
+ )
1054
+ : 0 !== render.length &&
1055
+ 2 !== render.length &&
1056
+ console.error(
1057
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1058
+ 1 === render.length
1059
+ ? "Did you forget to use the ref parameter?"
1060
+ : "Any additional parameter will be undefined."
1061
+ );
1062
+ null != render &&
1063
+ null != render.defaultProps &&
1064
+ console.error(
1065
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1066
+ );
1067
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
1068
+ ownName;
1069
+ Object.defineProperty(elementType, "displayName", {
1070
+ enumerable: !1,
1071
+ configurable: !0,
1072
+ get: function () {
1073
+ return ownName;
1074
+ },
1075
+ set: function (name) {
1076
+ ownName = name;
1077
+ render.name ||
1078
+ render.displayName ||
1079
+ (Object.defineProperty(render, "name", { value: name }),
1080
+ (render.displayName = name));
1081
+ }
1082
+ });
1083
+ return elementType;
1084
+ };
1085
+ exports.isValidElement = isValidElement;
1086
+ exports.lazy = function (ctor) {
1087
+ return {
1088
+ $$typeof: REACT_LAZY_TYPE,
1089
+ _payload: { _status: -1, _result: ctor },
1090
+ _init: lazyInitializer
1091
+ };
1092
+ };
1093
+ exports.memo = function (type, compare) {
1094
+ null == type &&
1095
+ console.error(
1096
+ "memo: The first argument must be a component. Instead received: %s",
1097
+ null === type ? "null" : typeof type
1098
+ );
1099
+ compare = {
1100
+ $$typeof: REACT_MEMO_TYPE,
1101
+ type: type,
1102
+ compare: void 0 === compare ? null : compare
1103
+ };
1104
+ var ownName;
1105
+ Object.defineProperty(compare, "displayName", {
1106
+ enumerable: !1,
1107
+ configurable: !0,
1108
+ get: function () {
1109
+ return ownName;
1110
+ },
1111
+ set: function (name) {
1112
+ ownName = name;
1113
+ type.name ||
1114
+ type.displayName ||
1115
+ (Object.defineProperty(type, "name", { value: name }),
1116
+ (type.displayName = name));
1117
+ }
1118
+ });
1119
+ return compare;
1120
+ };
1121
+ exports.startTransition = function (scope) {
1122
+ var prevTransition = ReactSharedInternals.T,
1123
+ currentTransition = {};
1124
+ currentTransition._updatedFibers = new Set();
1125
+ ReactSharedInternals.T = currentTransition;
1126
+ try {
1127
+ var returnValue = scope(),
1128
+ onStartTransitionFinish = ReactSharedInternals.S;
1129
+ null !== onStartTransitionFinish &&
1130
+ onStartTransitionFinish(currentTransition, returnValue);
1131
+ "object" === typeof returnValue &&
1132
+ null !== returnValue &&
1133
+ "function" === typeof returnValue.then &&
1134
+ (ReactSharedInternals.asyncTransitions++,
1135
+ returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
1136
+ returnValue.then(noop, reportGlobalError));
1137
+ } catch (error) {
1138
+ reportGlobalError(error);
2737
1139
  } finally {
2738
- isFlushing = false;
1140
+ null === prevTransition &&
1141
+ currentTransition._updatedFibers &&
1142
+ ((scope = currentTransition._updatedFibers.size),
1143
+ currentTransition._updatedFibers.clear(),
1144
+ 10 < scope &&
1145
+ console.warn(
1146
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1147
+ )),
1148
+ null !== prevTransition &&
1149
+ null !== currentTransition.types &&
1150
+ (null !== prevTransition.types &&
1151
+ prevTransition.types !== currentTransition.types &&
1152
+ console.error(
1153
+ "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
1154
+ ),
1155
+ (prevTransition.types = currentTransition.types)),
1156
+ (ReactSharedInternals.T = prevTransition);
2739
1157
  }
2740
- }
2741
- }
2742
- } // Some of our warnings attempt to detect if the `act` call is awaited by
2743
- // checking in an asynchronous task. Wait a few microtasks before checking. The
2744
- // only reason one isn't sufficient is we want to accommodate the case where an
2745
- // `act` call is returned from an async function without first being awaited,
2746
- // since that's a somewhat common pattern. If you do this too many times in a
2747
- // nested sequence, you might get a warning, but you can always fix by awaiting
2748
- // the call.
2749
- //
2750
- // A macrotask would also work (and is the fallback) but depending on the test
2751
- // environment it may cause the warning to fire too late.
2752
-
2753
-
2754
- var queueSeveralMicrotasks = typeof queueMicrotask === 'function' ? function (callback) {
2755
- queueMicrotask(function () {
2756
- return queueMicrotask(callback);
2757
- });
2758
- } : enqueueTask;
2759
-
2760
- var Children = {
2761
- map: mapChildren,
2762
- forEach: forEachChildren,
2763
- count: countChildren,
2764
- toArray: toArray,
2765
- only: onlyChild
2766
- };
2767
-
2768
- exports.Children = Children;
2769
- exports.Component = Component;
2770
- exports.Fragment = REACT_FRAGMENT_TYPE;
2771
- exports.Profiler = REACT_PROFILER_TYPE;
2772
- exports.PureComponent = PureComponent;
2773
- exports.StrictMode = REACT_STRICT_MODE_TYPE;
2774
- exports.Suspense = REACT_SUSPENSE_TYPE;
2775
- exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
2776
- exports.act = act;
2777
- exports.cache = cache;
2778
- exports.cloneElement = cloneElement;
2779
- exports.createContext = createContext;
2780
- exports.createElement = createElement;
2781
- exports.createRef = createRef;
2782
- exports.forwardRef = forwardRef;
2783
- exports.isValidElement = isValidElement;
2784
- exports.lazy = lazy;
2785
- exports.memo = memo;
2786
- exports.startTransition = startTransition;
2787
- exports.unstable_useCacheRefresh = useCacheRefresh;
2788
- exports.use = use;
2789
- exports.useActionState = useActionState;
2790
- exports.useCallback = useCallback;
2791
- exports.useContext = useContext;
2792
- exports.useDebugValue = useDebugValue;
2793
- exports.useDeferredValue = useDeferredValue;
2794
- exports.useEffect = useEffect;
2795
- exports.useId = useId;
2796
- exports.useImperativeHandle = useImperativeHandle;
2797
- exports.useInsertionEffect = useInsertionEffect;
2798
- exports.useLayoutEffect = useLayoutEffect;
2799
- exports.useMemo = useMemo;
2800
- exports.useOptimistic = useOptimistic;
2801
- exports.useReducer = useReducer;
2802
- exports.useRef = useRef;
2803
- exports.useState = useState;
2804
- exports.useSyncExternalStore = useSyncExternalStore;
2805
- exports.useTransition = useTransition;
2806
- exports.version = ReactVersion;
2807
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
2808
- if (
2809
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
2810
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
2811
- 'function'
2812
- ) {
2813
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
2814
- }
2815
-
1158
+ };
1159
+ exports.unstable_useCacheRefresh = function () {
1160
+ return resolveDispatcher().useCacheRefresh();
1161
+ };
1162
+ exports.use = function (usable) {
1163
+ return resolveDispatcher().use(usable);
1164
+ };
1165
+ exports.useActionState = function (action, initialState, permalink) {
1166
+ return resolveDispatcher().useActionState(
1167
+ action,
1168
+ initialState,
1169
+ permalink
1170
+ );
1171
+ };
1172
+ exports.useCallback = function (callback, deps) {
1173
+ return resolveDispatcher().useCallback(callback, deps);
1174
+ };
1175
+ exports.useContext = function (Context) {
1176
+ var dispatcher = resolveDispatcher();
1177
+ Context.$$typeof === REACT_CONSUMER_TYPE &&
1178
+ console.error(
1179
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1180
+ );
1181
+ return dispatcher.useContext(Context);
1182
+ };
1183
+ exports.useDebugValue = function (value, formatterFn) {
1184
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1185
+ };
1186
+ exports.useDeferredValue = function (value, initialValue) {
1187
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1188
+ };
1189
+ exports.useEffect = function (create, deps) {
1190
+ null == create &&
1191
+ console.warn(
1192
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1193
+ );
1194
+ return resolveDispatcher().useEffect(create, deps);
1195
+ };
1196
+ exports.useId = function () {
1197
+ return resolveDispatcher().useId();
1198
+ };
1199
+ exports.useImperativeHandle = function (ref, create, deps) {
1200
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1201
+ };
1202
+ exports.useInsertionEffect = function (create, deps) {
1203
+ null == create &&
1204
+ console.warn(
1205
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1206
+ );
1207
+ return resolveDispatcher().useInsertionEffect(create, deps);
1208
+ };
1209
+ exports.useLayoutEffect = function (create, deps) {
1210
+ null == create &&
1211
+ console.warn(
1212
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1213
+ );
1214
+ return resolveDispatcher().useLayoutEffect(create, deps);
1215
+ };
1216
+ exports.useMemo = function (create, deps) {
1217
+ return resolveDispatcher().useMemo(create, deps);
1218
+ };
1219
+ exports.useOptimistic = function (passthrough, reducer) {
1220
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1221
+ };
1222
+ exports.useReducer = function (reducer, initialArg, init) {
1223
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1224
+ };
1225
+ exports.useRef = function (initialValue) {
1226
+ return resolveDispatcher().useRef(initialValue);
1227
+ };
1228
+ exports.useState = function (initialState) {
1229
+ return resolveDispatcher().useState(initialState);
1230
+ };
1231
+ exports.useSyncExternalStore = function (
1232
+ subscribe,
1233
+ getSnapshot,
1234
+ getServerSnapshot
1235
+ ) {
1236
+ return resolveDispatcher().useSyncExternalStore(
1237
+ subscribe,
1238
+ getSnapshot,
1239
+ getServerSnapshot
1240
+ );
1241
+ };
1242
+ exports.useTransition = function () {
1243
+ return resolveDispatcher().useTransition();
1244
+ };
1245
+ exports.version = "19.2.0-canary-5252281c-20250408";
1246
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1247
+ "function" ===
1248
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
1249
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2816
1250
  })();
2817
- }