UNPKG

6.66 kBJavaScriptView Raw
1/**
2 * @license React
3 * react-dom.production.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";
12function formatProdErrorMessage(code) {
13 var url = "https://react.dev/errors/" + code;
14 if (1 < arguments.length) {
15 url += "?args[]=" + encodeURIComponent(arguments[1]);
16 for (var i = 2; i < arguments.length; i++)
17 url += "&args[]=" + encodeURIComponent(arguments[i]);
18 }
19 return (
20 "Minified React error #" +
21 code +
22 "; visit " +
23 url +
24 " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
25 );
26}
27var ReactSharedInternals =
28 require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
29function noop() {}
30var Internals = {
31 d: {
32 f: noop,
33 r: function () {
34 throw Error(formatProdErrorMessage(522));
35 },
36 D: noop,
37 C: noop,
38 L: noop,
39 m: noop,
40 X: noop,
41 S: noop,
42 M: noop
43 },
44 p: 0,
45 findDOMNode: null
46 },
47 REACT_PORTAL_TYPE = Symbol.for("react.portal");
48function createPortal$1(children, containerInfo, implementation) {
49 var key =
50 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
51 return {
52 $$typeof: REACT_PORTAL_TYPE,
53 key: null == key ? null : "" + key,
54 children: children,
55 containerInfo: containerInfo,
56 implementation: implementation
57 };
58}
59function getCrossOriginStringAs(as, input) {
60 if ("font" === as) return "";
61 if ("string" === typeof input)
62 return "use-credentials" === input ? input : "";
63}
64exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
65 Internals;
66exports.createPortal = function (children, container) {
67 var key =
68 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
69 if (
70 !container ||
71 (1 !== container.nodeType &&
72 9 !== container.nodeType &&
73 11 !== container.nodeType)
74 )
75 throw Error(formatProdErrorMessage(299));
76 return createPortal$1(children, container, null, key);
77};
78exports.flushSync = function (fn) {
79 var previousTransition = ReactSharedInternals.T,
80 previousUpdatePriority = Internals.p;
81 try {
82 if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();
83 } finally {
84 (ReactSharedInternals.T = previousTransition),
85 (Internals.p = previousUpdatePriority),
86 Internals.d.f();
87 }
88};
89exports.preconnect = function (href, options) {
90 "string" === typeof href &&
91 (options
92 ? ((options = options.crossOrigin),
93 (options =
94 "string" === typeof options
95 ? "use-credentials" === options
96 ? options
97 : ""
98 : void 0))
99 : (options = null),
100 Internals.d.C(href, options));
101};
102exports.prefetchDNS = function (href) {
103 "string" === typeof href && Internals.d.D(href);
104};
105exports.preinit = function (href, options) {
106 if ("string" === typeof href && options && "string" === typeof options.as) {
107 var as = options.as,
108 crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
109 integrity =
110 "string" === typeof options.integrity ? options.integrity : void 0,
111 fetchPriority =
112 "string" === typeof options.fetchPriority
113 ? options.fetchPriority
114 : void 0;
115 "style" === as
116 ? Internals.d.S(
117 href,
118 "string" === typeof options.precedence ? options.precedence : void 0,
119 {
120 crossOrigin: crossOrigin,
121 integrity: integrity,
122 fetchPriority: fetchPriority
123 }
124 )
125 : "script" === as &&
126 Internals.d.X(href, {
127 crossOrigin: crossOrigin,
128 integrity: integrity,
129 fetchPriority: fetchPriority,
130 nonce: "string" === typeof options.nonce ? options.nonce : void 0
131 });
132 }
133};
134exports.preinitModule = function (href, options) {
135 if ("string" === typeof href)
136 if ("object" === typeof options && null !== options) {
137 if (null == options.as || "script" === options.as) {
138 var crossOrigin = getCrossOriginStringAs(
139 options.as,
140 options.crossOrigin
141 );
142 Internals.d.M(href, {
143 crossOrigin: crossOrigin,
144 integrity:
145 "string" === typeof options.integrity ? options.integrity : void 0,
146 nonce: "string" === typeof options.nonce ? options.nonce : void 0
147 });
148 }
149 } else null == options && Internals.d.M(href);
150};
151exports.preload = function (href, options) {
152 if (
153 "string" === typeof href &&
154 "object" === typeof options &&
155 null !== options &&
156 "string" === typeof options.as
157 ) {
158 var as = options.as,
159 crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
160 Internals.d.L(href, as, {
161 crossOrigin: crossOrigin,
162 integrity:
163 "string" === typeof options.integrity ? options.integrity : void 0,
164 nonce: "string" === typeof options.nonce ? options.nonce : void 0,
165 type: "string" === typeof options.type ? options.type : void 0,
166 fetchPriority:
167 "string" === typeof options.fetchPriority
168 ? options.fetchPriority
169 : void 0,
170 referrerPolicy:
171 "string" === typeof options.referrerPolicy
172 ? options.referrerPolicy
173 : void 0,
174 imageSrcSet:
175 "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
176 imageSizes:
177 "string" === typeof options.imageSizes ? options.imageSizes : void 0,
178 media: "string" === typeof options.media ? options.media : void 0
179 });
180 }
181};
182exports.preloadModule = function (href, options) {
183 if ("string" === typeof href)
184 if (options) {
185 var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
186 Internals.d.m(href, {
187 as:
188 "string" === typeof options.as && "script" !== options.as
189 ? options.as
190 : void 0,
191 crossOrigin: crossOrigin,
192 integrity:
193 "string" === typeof options.integrity ? options.integrity : void 0
194 });
195 } else Internals.d.m(href);
196};
197exports.requestFormReset = function (form) {
198 Internals.d.r(form);
199};
200exports.unstable_batchedUpdates = function (fn, a) {
201 return fn(a);
202};
203exports.useFormState = function (action, initialState, permalink) {
204 return ReactSharedInternals.H.useFormState(action, initialState, permalink);
205};
206exports.useFormStatus = function () {
207 return ReactSharedInternals.H.useHostTransitionStatus();
208};
209exports.version = "19.0.0-beta-94eed63c49-20240425";