UNPKG

24.3 kBJavaScriptView Raw
1/**
2 * @license React
3 * react-jsx-runtime.development.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */
10
11"use strict";
12"production" !== process.env.NODE_ENV &&
13 (function () {
14 function getComponentNameFromType(type) {
15 if (null == type) return null;
16 if ("function" === typeof type)
17 return type.$$typeof === REACT_CLIENT_REFERENCE$2
18 ? null
19 : type.displayName || type.name || null;
20 if ("string" === typeof type) return type;
21 switch (type) {
22 case REACT_FRAGMENT_TYPE:
23 return "Fragment";
24 case REACT_PORTAL_TYPE:
25 return "Portal";
26 case REACT_PROFILER_TYPE:
27 return "Profiler";
28 case REACT_STRICT_MODE_TYPE:
29 return "StrictMode";
30 case REACT_SUSPENSE_TYPE:
31 return "Suspense";
32 case REACT_SUSPENSE_LIST_TYPE:
33 return "SuspenseList";
34 }
35 if ("object" === typeof type)
36 switch (
37 ("number" === typeof type.tag &&
38 console.error(
39 "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
40 ),
41 type.$$typeof)
42 ) {
43 case REACT_CONTEXT_TYPE:
44 return (type.displayName || "Context") + ".Provider";
45 case REACT_CONSUMER_TYPE:
46 return (type._context.displayName || "Context") + ".Consumer";
47 case REACT_FORWARD_REF_TYPE:
48 var innerType = type.render;
49 type = type.displayName;
50 type ||
51 ((type = innerType.displayName || innerType.name || ""),
52 (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
53 return type;
54 case REACT_MEMO_TYPE:
55 return (
56 (innerType = type.displayName || null),
57 null !== innerType
58 ? innerType
59 : getComponentNameFromType(type.type) || "Memo"
60 );
61 case REACT_LAZY_TYPE:
62 innerType = type._payload;
63 type = type._init;
64 try {
65 return getComponentNameFromType(type(innerType));
66 } catch (x) {}
67 }
68 return null;
69 }
70 function testStringCoercion(value) {
71 return "" + value;
72 }
73 function checkKeyStringCoercion(value) {
74 try {
75 testStringCoercion(value);
76 var JSCompiler_inline_result = !1;
77 } catch (e) {
78 JSCompiler_inline_result = !0;
79 }
80 if (JSCompiler_inline_result) {
81 JSCompiler_inline_result = console;
82 var JSCompiler_temp_const = JSCompiler_inline_result.error;
83 var JSCompiler_inline_result$jscomp$0 =
84 ("function" === typeof Symbol &&
85 Symbol.toStringTag &&
86 value[Symbol.toStringTag]) ||
87 value.constructor.name ||
88 "Object";
89 JSCompiler_temp_const.call(
90 JSCompiler_inline_result,
91 "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92 JSCompiler_inline_result$jscomp$0
93 );
94 return testStringCoercion(value);
95 }
96 }
97 function disabledLog() {}
98 function disableLogs() {
99 if (0 === disabledDepth) {
100 prevLog = console.log;
101 prevInfo = console.info;
102 prevWarn = console.warn;
103 prevError = console.error;
104 prevGroup = console.group;
105 prevGroupCollapsed = console.groupCollapsed;
106 prevGroupEnd = console.groupEnd;
107 var props = {
108 configurable: !0,
109 enumerable: !0,
110 value: disabledLog,
111 writable: !0
112 };
113 Object.defineProperties(console, {
114 info: props,
115 log: props,
116 warn: props,
117 error: props,
118 group: props,
119 groupCollapsed: props,
120 groupEnd: props
121 });
122 }
123 disabledDepth++;
124 }
125 function reenableLogs() {
126 disabledDepth--;
127 if (0 === disabledDepth) {
128 var props = { configurable: !0, enumerable: !0, writable: !0 };
129 Object.defineProperties(console, {
130 log: assign({}, props, { value: prevLog }),
131 info: assign({}, props, { value: prevInfo }),
132 warn: assign({}, props, { value: prevWarn }),
133 error: assign({}, props, { value: prevError }),
134 group: assign({}, props, { value: prevGroup }),
135 groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
136 groupEnd: assign({}, props, { value: prevGroupEnd })
137 });
138 }
139 0 > disabledDepth &&
140 console.error(
141 "disabledDepth fell below zero. This is a bug in React. Please file an issue."
142 );
143 }
144 function describeBuiltInComponentFrame(name) {
145 if (void 0 === prefix)
146 try {
147 throw Error();
148 } catch (x) {
149 var match = x.stack.trim().match(/\n( *(at )?)/);
150 prefix = (match && match[1]) || "";
151 suffix =
152 -1 < x.stack.indexOf("\n at")
153 ? " (<anonymous>)"
154 : -1 < x.stack.indexOf("@")
155 ? "@unknown:0:0"
156 : "";
157 }
158 return "\n" + prefix + name + suffix;
159 }
160 function describeNativeComponentFrame(fn, construct) {
161 if (!fn || reentry) return "";
162 var frame = componentFrameCache.get(fn);
163 if (void 0 !== frame) return frame;
164 reentry = !0;
165 frame = Error.prepareStackTrace;
166 Error.prepareStackTrace = void 0;
167 var previousDispatcher = null;
168 previousDispatcher = ReactSharedInternals.H;
169 ReactSharedInternals.H = null;
170 disableLogs();
171 try {
172 var RunInRootFrame = {
173 DetermineComponentFrameRoot: function () {
174 try {
175 if (construct) {
176 var Fake = function () {
177 throw Error();
178 };
179 Object.defineProperty(Fake.prototype, "props", {
180 set: function () {
181 throw Error();
182 }
183 });
184 if ("object" === typeof Reflect && Reflect.construct) {
185 try {
186 Reflect.construct(Fake, []);
187 } catch (x) {
188 var control = x;
189 }
190 Reflect.construct(fn, [], Fake);
191 } else {
192 try {
193 Fake.call();
194 } catch (x$0) {
195 control = x$0;
196 }
197 fn.call(Fake.prototype);
198 }
199 } else {
200 try {
201 throw Error();
202 } catch (x$1) {
203 control = x$1;
204 }
205 (Fake = fn()) &&
206 "function" === typeof Fake.catch &&
207 Fake.catch(function () {});
208 }
209 } catch (sample) {
210 if (sample && control && "string" === typeof sample.stack)
211 return [sample.stack, control.stack];
212 }
213 return [null, null];
214 }
215 };
216 RunInRootFrame.DetermineComponentFrameRoot.displayName =
217 "DetermineComponentFrameRoot";
218 var namePropDescriptor = Object.getOwnPropertyDescriptor(
219 RunInRootFrame.DetermineComponentFrameRoot,
220 "name"
221 );
222 namePropDescriptor &&
223 namePropDescriptor.configurable &&
224 Object.defineProperty(
225 RunInRootFrame.DetermineComponentFrameRoot,
226 "name",
227 { value: "DetermineComponentFrameRoot" }
228 );
229 var _RunInRootFrame$Deter =
230 RunInRootFrame.DetermineComponentFrameRoot(),
231 sampleStack = _RunInRootFrame$Deter[0],
232 controlStack = _RunInRootFrame$Deter[1];
233 if (sampleStack && controlStack) {
234 var sampleLines = sampleStack.split("\n"),
235 controlLines = controlStack.split("\n");
236 for (
237 _RunInRootFrame$Deter = namePropDescriptor = 0;
238 namePropDescriptor < sampleLines.length &&
239 !sampleLines[namePropDescriptor].includes(
240 "DetermineComponentFrameRoot"
241 );
242
243 )
244 namePropDescriptor++;
245 for (
246 ;
247 _RunInRootFrame$Deter < controlLines.length &&
248 !controlLines[_RunInRootFrame$Deter].includes(
249 "DetermineComponentFrameRoot"
250 );
251
252 )
253 _RunInRootFrame$Deter++;
254 if (
255 namePropDescriptor === sampleLines.length ||
256 _RunInRootFrame$Deter === controlLines.length
257 )
258 for (
259 namePropDescriptor = sampleLines.length - 1,
260 _RunInRootFrame$Deter = controlLines.length - 1;
261 1 <= namePropDescriptor &&
262 0 <= _RunInRootFrame$Deter &&
263 sampleLines[namePropDescriptor] !==
264 controlLines[_RunInRootFrame$Deter];
265
266 )
267 _RunInRootFrame$Deter--;
268 for (
269 ;
270 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;
271 namePropDescriptor--, _RunInRootFrame$Deter--
272 )
273 if (
274 sampleLines[namePropDescriptor] !==
275 controlLines[_RunInRootFrame$Deter]
276 ) {
277 if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
278 do
279 if (
280 (namePropDescriptor--,
281 _RunInRootFrame$Deter--,
282 0 > _RunInRootFrame$Deter ||
283 sampleLines[namePropDescriptor] !==
284 controlLines[_RunInRootFrame$Deter])
285 ) {
286 var _frame =
287 "\n" +
288 sampleLines[namePropDescriptor].replace(
289 " at new ",
290 " at "
291 );
292 fn.displayName &&
293 _frame.includes("<anonymous>") &&
294 (_frame = _frame.replace("<anonymous>", fn.displayName));
295 "function" === typeof fn &&
296 componentFrameCache.set(fn, _frame);
297 return _frame;
298 }
299 while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
300 }
301 break;
302 }
303 }
304 } finally {
305 (reentry = !1),
306 (ReactSharedInternals.H = previousDispatcher),
307 reenableLogs(),
308 (Error.prepareStackTrace = frame);
309 }
310 sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
311 ? describeBuiltInComponentFrame(sampleLines)
312 : "";
313 "function" === typeof fn && componentFrameCache.set(fn, sampleLines);
314 return sampleLines;
315 }
316 function describeUnknownElementTypeFrameInDEV(type) {
317 if (null == type) return "";
318 if ("function" === typeof type) {
319 var prototype = type.prototype;
320 return describeNativeComponentFrame(
321 type,
322 !(!prototype || !prototype.isReactComponent)
323 );
324 }
325 if ("string" === typeof type) return describeBuiltInComponentFrame(type);
326 switch (type) {
327 case REACT_SUSPENSE_TYPE:
328 return describeBuiltInComponentFrame("Suspense");
329 case REACT_SUSPENSE_LIST_TYPE:
330 return describeBuiltInComponentFrame("SuspenseList");
331 }
332 if ("object" === typeof type)
333 switch (type.$$typeof) {
334 case REACT_FORWARD_REF_TYPE:
335 return (type = describeNativeComponentFrame(type.render, !1)), type;
336 case REACT_MEMO_TYPE:
337 return describeUnknownElementTypeFrameInDEV(type.type);
338 case REACT_LAZY_TYPE:
339 prototype = type._payload;
340 type = type._init;
341 try {
342 return describeUnknownElementTypeFrameInDEV(type(prototype));
343 } catch (x) {}
344 }
345 return "";
346 }
347 function getOwner() {
348 var dispatcher = ReactSharedInternals.A;
349 return null === dispatcher ? null : dispatcher.getOwner();
350 }
351 function hasValidKey(config) {
352 if (hasOwnProperty.call(config, "key")) {
353 var getter = Object.getOwnPropertyDescriptor(config, "key").get;
354 if (getter && getter.isReactWarning) return !1;
355 }
356 return void 0 !== config.key;
357 }
358 function defineKeyPropWarningGetter(props, displayName) {
359 function warnAboutAccessingKey() {
360 specialPropKeyWarningShown ||
361 ((specialPropKeyWarningShown = !0),
362 console.error(
363 "%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)",
364 displayName
365 ));
366 }
367 warnAboutAccessingKey.isReactWarning = !0;
368 Object.defineProperty(props, "key", {
369 get: warnAboutAccessingKey,
370 configurable: !0
371 });
372 }
373 function elementRefGetterWithDeprecationWarning() {
374 var componentName = getComponentNameFromType(this.type);
375 didWarnAboutElementRef[componentName] ||
376 ((didWarnAboutElementRef[componentName] = !0),
377 console.error(
378 "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."
379 ));
380 componentName = this.props.ref;
381 return void 0 !== componentName ? componentName : null;
382 }
383 function ReactElement(type, key, self, source, owner, props) {
384 self = props.ref;
385 type = {
386 $$typeof: REACT_ELEMENT_TYPE,
387 type: type,
388 key: key,
389 props: props,
390 _owner: owner
391 };
392 null !== (void 0 !== self ? self : null)
393 ? Object.defineProperty(type, "ref", {
394 enumerable: !1,
395 get: elementRefGetterWithDeprecationWarning
396 })
397 : Object.defineProperty(type, "ref", { enumerable: !1, value: null });
398 type._store = {};
399 Object.defineProperty(type._store, "validated", {
400 configurable: !1,
401 enumerable: !1,
402 writable: !0,
403 value: 0
404 });
405 Object.defineProperty(type, "_debugInfo", {
406 configurable: !1,
407 enumerable: !1,
408 writable: !0,
409 value: null
410 });
411 Object.freeze && (Object.freeze(type.props), Object.freeze(type));
412 return type;
413 }
414 function jsxDEVImpl(
415 type,
416 config,
417 maybeKey,
418 isStaticChildren,
419 source,
420 self
421 ) {
422 if (
423 "string" === typeof type ||
424 "function" === typeof type ||
425 type === REACT_FRAGMENT_TYPE ||
426 type === REACT_PROFILER_TYPE ||
427 type === REACT_STRICT_MODE_TYPE ||
428 type === REACT_SUSPENSE_TYPE ||
429 type === REACT_SUSPENSE_LIST_TYPE ||
430 type === REACT_OFFSCREEN_TYPE ||
431 ("object" === typeof type &&
432 null !== type &&
433 (type.$$typeof === REACT_LAZY_TYPE ||
434 type.$$typeof === REACT_MEMO_TYPE ||
435 type.$$typeof === REACT_CONTEXT_TYPE ||
436 type.$$typeof === REACT_CONSUMER_TYPE ||
437 type.$$typeof === REACT_FORWARD_REF_TYPE ||
438 type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
439 void 0 !== type.getModuleId))
440 ) {
441 var children = config.children;
442 if (void 0 !== children)
443 if (isStaticChildren)
444 if (isArrayImpl(children)) {
445 for (
446 isStaticChildren = 0;
447 isStaticChildren < children.length;
448 isStaticChildren++
449 )
450 validateChildKeys(children[isStaticChildren], type);
451 Object.freeze && Object.freeze(children);
452 } else
453 console.error(
454 "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
455 );
456 else validateChildKeys(children, type);
457 } else {
458 children = "";
459 if (
460 void 0 === type ||
461 ("object" === typeof type &&
462 null !== type &&
463 0 === Object.keys(type).length)
464 )
465 children +=
466 " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
467 null === type
468 ? (isStaticChildren = "null")
469 : isArrayImpl(type)
470 ? (isStaticChildren = "array")
471 : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
472 ? ((isStaticChildren =
473 "<" +
474 (getComponentNameFromType(type.type) || "Unknown") +
475 " />"),
476 (children =
477 " Did you accidentally export a JSX literal instead of a component?"))
478 : (isStaticChildren = typeof type);
479 console.error(
480 "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
481 isStaticChildren,
482 children
483 );
484 }
485 if (hasOwnProperty.call(config, "key")) {
486 children = getComponentNameFromType(type);
487 var keys = Object.keys(config).filter(function (k) {
488 return "key" !== k;
489 });
490 isStaticChildren =
491 0 < keys.length
492 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
493 : "{key: someKey}";
494 didWarnAboutKeySpread[children + isStaticChildren] ||
495 ((keys =
496 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
497 console.error(
498 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
499 isStaticChildren,
500 children,
501 keys,
502 children
503 ),
504 (didWarnAboutKeySpread[children + isStaticChildren] = !0));
505 }
506 children = null;
507 void 0 !== maybeKey &&
508 (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
509 hasValidKey(config) &&
510 (checkKeyStringCoercion(config.key), (children = "" + config.key));
511 if ("key" in config) {
512 maybeKey = {};
513 for (var propName in config)
514 "key" !== propName && (maybeKey[propName] = config[propName]);
515 } else maybeKey = config;
516 children &&
517 defineKeyPropWarningGetter(
518 maybeKey,
519 "function" === typeof type
520 ? type.displayName || type.name || "Unknown"
521 : type
522 );
523 return ReactElement(type, children, self, source, getOwner(), maybeKey);
524 }
525 function validateChildKeys(node, parentType) {
526 if (
527 "object" === typeof node &&
528 node &&
529 node.$$typeof !== REACT_CLIENT_REFERENCE
530 )
531 if (isArrayImpl(node))
532 for (var i = 0; i < node.length; i++) {
533 var child = node[i];
534 isValidElement(child) && validateExplicitKey(child, parentType);
535 }
536 else if (isValidElement(node))
537 node._store && (node._store.validated = 1);
538 else if (
539 (null === node || "object" !== typeof node
540 ? (i = null)
541 : ((i =
542 (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||
543 node["@@iterator"]),
544 (i = "function" === typeof i ? i : null)),
545 "function" === typeof i &&
546 i !== node.entries &&
547 ((i = i.call(node)), i !== node))
548 )
549 for (; !(node = i.next()).done; )
550 isValidElement(node.value) &&
551 validateExplicitKey(node.value, parentType);
552 }
553 function isValidElement(object) {
554 return (
555 "object" === typeof object &&
556 null !== object &&
557 object.$$typeof === REACT_ELEMENT_TYPE
558 );
559 }
560 function validateExplicitKey(element, parentType) {
561 if (
562 element._store &&
563 !element._store.validated &&
564 null == element.key &&
565 ((element._store.validated = 1),
566 (parentType = getCurrentComponentErrorInfo(parentType)),
567 !ownerHasKeyUseWarning[parentType])
568 ) {
569 ownerHasKeyUseWarning[parentType] = !0;
570 var childOwner = "";
571 element &&
572 null != element._owner &&
573 element._owner !== getOwner() &&
574 ((childOwner = null),
575 "number" === typeof element._owner.tag
576 ? (childOwner = getComponentNameFromType(element._owner.type))
577 : "string" === typeof element._owner.name &&
578 (childOwner = element._owner.name),
579 (childOwner = " It was passed a child from " + childOwner + "."));
580 var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
581 ReactSharedInternals.getCurrentStack = function () {
582 var stack = describeUnknownElementTypeFrameInDEV(element.type);
583 prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
584 return stack;
585 };
586 console.error(
587 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
588 parentType,
589 childOwner
590 );
591 ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
592 }
593 }
594 function getCurrentComponentErrorInfo(parentType) {
595 var info = "",
596 owner = getOwner();
597 owner &&
598 (owner = getComponentNameFromType(owner.type)) &&
599 (info = "\n\nCheck the render method of `" + owner + "`.");
600 info ||
601 ((parentType = getComponentNameFromType(parentType)) &&
602 (info =
603 "\n\nCheck the top-level render call using <" + parentType + ">."));
604 return info;
605 }
606 var React = require("react"),
607 REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
608 REACT_PORTAL_TYPE = Symbol.for("react.portal"),
609 REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
610 REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
611 REACT_PROFILER_TYPE = Symbol.for("react.profiler");
612 Symbol.for("react.provider");
613 var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
614 REACT_CONTEXT_TYPE = Symbol.for("react.context"),
615 REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
616 REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
617 REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
618 REACT_MEMO_TYPE = Symbol.for("react.memo"),
619 REACT_LAZY_TYPE = Symbol.for("react.lazy"),
620 REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
621 MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
622 REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
623 ReactSharedInternals =
624 React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
625 hasOwnProperty = Object.prototype.hasOwnProperty,
626 assign = Object.assign,
627 REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
628 isArrayImpl = Array.isArray,
629 disabledDepth = 0,
630 prevLog,
631 prevInfo,
632 prevWarn,
633 prevError,
634 prevGroup,
635 prevGroupCollapsed,
636 prevGroupEnd;
637 disabledLog.__reactDisabledLog = !0;
638 var prefix,
639 suffix,
640 reentry = !1;
641 var componentFrameCache = new (
642 "function" === typeof WeakMap ? WeakMap : Map
643 )();
644 var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
645 specialPropKeyWarningShown;
646 var didWarnAboutElementRef = {};
647 var didWarnAboutKeySpread = {},
648 ownerHasKeyUseWarning = {};
649 exports.Fragment = REACT_FRAGMENT_TYPE;
650 exports.jsx = function (type, config, maybeKey, source, self) {
651 return jsxDEVImpl(type, config, maybeKey, !1, source, self);
652 };
653 exports.jsxs = function (type, config, maybeKey, source, self) {
654 return jsxDEVImpl(type, config, maybeKey, !0, source, self);
655 };
656 })();