react-server-dom-webpack
Version:
React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.
79 lines (75 loc) • 26.9 kB
JavaScript
/*
React
react-server-dom-webpack-server.edge.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
;var aa=require("react"),ba=require("react-dom"),m=null,n=0;function p(a,b){if(0!==b.byteLength)if(512<b.byteLength)0<n&&(a.enqueue(new Uint8Array(m.buffer,0,n)),m=new Uint8Array(512),n=0),a.enqueue(b);else{var c=m.length-n;c<b.byteLength&&(0===c?a.enqueue(m):(m.set(b.subarray(0,c),n),a.enqueue(m),b=b.subarray(c)),m=new Uint8Array(512),n=0);m.set(b,n);n+=b.byteLength}return!0}var q=new TextEncoder;function ca(a,b){"function"===typeof a.error?a.error(b):a.close()}
var r=Symbol.for("react.client.reference"),t=Symbol.for("react.server.reference");function v(a,b,c){return Object.defineProperties(a,{$$typeof:{value:r},$$id:{value:b},$$async:{value:c}})}var da=Function.prototype.bind,ea=Array.prototype.slice;function fa(){var a=da.apply(this,arguments);if(this.$$typeof===t){var b=ea.call(arguments,1);return Object.defineProperties(a,{$$typeof:{value:t},$$id:{value:this.$$id},$$bound:{value:this.$$bound?this.$$bound.concat(b):b},bind:{value:fa}})}return a}
var ha=Promise.prototype,ia={get:function(a,b){switch(b){case "$$typeof":return a.$$typeof;case "$$id":return a.$$id;case "$$async":return a.$$async;case "name":return a.name;case "displayName":return;case "defaultProps":return;case "toJSON":return;case Symbol.toPrimitive:return Object.prototype[Symbol.toPrimitive];case "Provider":throw Error("Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider.");
}throw Error("Cannot access "+(String(a.name)+"."+String(b))+" on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.");},set:function(){throw Error("Cannot assign to a client module from a server module.");}};
function ja(a,b){switch(b){case "$$typeof":return a.$$typeof;case "$$id":return a.$$id;case "$$async":return a.$$async;case "name":return a.name;case "defaultProps":return;case "toJSON":return;case Symbol.toPrimitive:return Object.prototype[Symbol.toPrimitive];case "__esModule":var c=a.$$id;a.default=v(function(){throw Error("Attempted to call the default export of "+c+" from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.");
},a.$$id+"#",a.$$async);return!0;case "then":if(a.then)return a.then;if(a.$$async)return;var d=v({},a.$$id,!0),e=new Proxy(d,ka);a.status="fulfilled";a.value=e;return a.then=v(function(g){return Promise.resolve(g(e))},a.$$id+"#then",!1)}d=a[b];d||(d=v(function(){throw Error("Attempted to call "+String(b)+"() from the server but "+String(b)+" is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.");
},a.$$id+"#"+b,a.$$async),Object.defineProperty(d,"name",{value:b}),d=a[b]=new Proxy(d,ia));return d}
var ka={get:function(a,b){return ja(a,b)},getOwnPropertyDescriptor:function(a,b){var c=Object.getOwnPropertyDescriptor(a,b);c||(c={value:ja(a,b),writable:!1,configurable:!1,enumerable:!1},Object.defineProperty(a,b,c));return c},getPrototypeOf:function(){return ha},set:function(){throw Error("Cannot assign to a client module from a server module.");}},sa={prefetchDNS:la,preconnect:ma,preload:na,preloadModule:oa,preinitStyle:pa,preinitScript:qa,preinitModuleScript:ra};
function la(a){if("string"===typeof a&&a){var b=w();if(b){var c=b.hints,d="D|"+a;c.has(d)||(c.add(d),x(b,"D",a))}}}function ma(a,b){if("string"===typeof a){var c=w();if(c){var d=c.hints,e="C|"+(null==b?"null":b)+"|"+a;d.has(e)||(d.add(e),"string"===typeof b?x(c,"C",[a,b]):x(c,"C",a))}}}
function na(a,b,c){if("string"===typeof a){var d=w();if(d){var e=d.hints,g="L";if("image"===b&&c){var f=c.imageSrcSet,h=c.imageSizes,k="";"string"===typeof f&&""!==f?(k+="["+f+"]","string"===typeof h&&(k+="["+h+"]")):k+="[][]"+a;g+="[image]"+k}else g+="["+b+"]"+a;e.has(g)||(e.add(g),(c=z(c))?x(d,"L",[a,b,c]):x(d,"L",[a,b]))}}}function oa(a,b){if("string"===typeof a){var c=w();if(c){var d=c.hints,e="m|"+a;if(!d.has(e))return d.add(e),(b=z(b))?x(c,"m",[a,b]):x(c,"m",a)}}}
function pa(a,b,c){if("string"===typeof a){var d=w();if(d){var e=d.hints,g="S|"+a;if(!e.has(g))return e.add(g),(c=z(c))?x(d,"S",[a,"string"===typeof b?b:0,c]):"string"===typeof b?x(d,"S",[a,b]):x(d,"S",a)}}}function qa(a,b){if("string"===typeof a){var c=w();if(c){var d=c.hints,e="X|"+a;if(!d.has(e))return d.add(e),(b=z(b))?x(c,"X",[a,b]):x(c,"X",a)}}}function ra(a,b){if("string"===typeof a){var c=w();if(c){var d=c.hints,e="M|"+a;if(!d.has(e))return d.add(e),(b=z(b))?x(c,"M",[a,b]):x(c,"M",a)}}}
function z(a){if(null==a)return null;var b=!1,c={},d;for(d in a)null!=a[d]&&(b=!0,c[d]=a[d]);return b?c:null}var ta=ba.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,ua="function"===typeof AsyncLocalStorage,va=ua?new AsyncLocalStorage:null;"object"===typeof async_hooks?async_hooks.createHook:function(){return{enable:function(){},disable:function(){}}};"object"===typeof async_hooks?async_hooks.executionAsyncId:null;
var A=Symbol.for("react.element"),wa=Symbol.for("react.fragment"),xa=Symbol.for("react.context"),ya=Symbol.for("react.forward_ref"),za=Symbol.for("react.suspense"),Aa=Symbol.for("react.suspense_list"),Ba=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),Ca=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.postpone");var Da=Symbol.iterator,Ea=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`");
function Fa(){}function Ga(a,b,c){c=a[c];void 0===c?a.push(b):c!==b&&(b.then(Fa,Fa),b=c);switch(b.status){case "fulfilled":return b.value;case "rejected":throw b.reason;default:if("string"!==typeof b.status)switch(a=b,a.status="pending",a.then(function(d){if("pending"===b.status){var e=b;e.status="fulfilled";e.value=d}},function(d){if("pending"===b.status){var e=b;e.status="rejected";e.reason=d}}),b.status){case "fulfilled":return b.value;case "rejected":throw b.reason;}D=b;throw Ea;}}var D=null;
function Ha(){if(null===D)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=D;D=null;return a}var E=null,Ia=0,F=null;function Ja(){var a=F||[];F=null;return a}
var Oa={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:G,useTransition:G,readContext:Ka,useContext:Ka,useReducer:G,useRef:G,useState:G,useInsertionEffect:G,useLayoutEffect:G,useImperativeHandle:G,useEffect:G,useId:La,useSyncExternalStore:G,useCacheRefresh:function(){return Ma},useMemoCache:function(a){for(var b=Array(a),c=0;c<a;c++)b[c]=Ca;return b},use:Na};
function G(){throw Error("This Hook is not supported in Server Components.");}function Ma(){throw Error("Refreshing the cache is not supported in Server Components.");}function Ka(){throw Error("Cannot read a Client Context from a Server Component.");}function La(){if(null===E)throw Error("useId can only be used while React is rendering");var a=E.identifierCount++;return":"+E.identifierPrefix+"S"+a.toString(32)+":"}
function Na(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=Ia;Ia+=1;null===F&&(F=[]);return Ga(F,a,b)}a.$$typeof===xa&&Ka()}if(a.$$typeof===r){if(null!=a.value&&a.value.$$typeof===xa)throw Error("Cannot read a Client Context from a Server Component.");throw Error("Cannot use() an already resolved Client Reference.");}throw Error("An unsupported type was passed to use(): "+String(a));}function Pa(){return(new AbortController).signal}
function Qa(){var a=w();return a?a.cache:new Map}var Ra={getCacheSignal:function(){var a=Qa(),b=a.get(Pa);void 0===b&&(b=Pa(),a.set(Pa,b));return b},getCacheForType:function(a){var b=Qa(),c=b.get(a);void 0===c&&(c=a(),b.set(a,c));return c}},Sa=Array.isArray,Ta=Object.getPrototypeOf;function Ua(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(b,c){return c})}
function Va(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.slice(0,10)+"...");case "object":if(Sa(a))return"[...]";a=Ua(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
function H(a){if("string"===typeof a)return a;switch(a){case za:return"Suspense";case Aa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case ya:return H(a.render);case Ba:return H(a.type);case C:var b=a._payload;a=a._init;try{return H(a(b))}catch(c){}}return""}
function I(a,b){var c=Ua(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;if(Sa(a)){var e="[";for(var g=0;g<a.length;g++){0<g&&(e+=", ");var f=a[g];f="object"===typeof f&&null!==f?I(f):Va(f);""+g===b?(c=e.length,d=f.length,e+=f):e=10>f.length&&40>e.length+f.length?e+f:e+"..."}e+="]"}else if(a.$$typeof===A)e="<"+H(a.type)+"/>";else{e="{";g=Object.keys(a);for(f=0;f<g.length;f++){0<f&&(e+=", ");var h=g[f],k=JSON.stringify(h);e+=('"'+h+'"'===k?h:k)+": ";k=a[h];k="object"===typeof k&&null!==k?I(k):
Va(k);h===b?(c=e.length,d=k.length,e+=k):e=10>k.length&&40>e.length+k.length?e+k:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}var Wa=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xa=aa.__SECRET_SERVER_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;if(!Xa)throw Error('The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.');
var Ya=Object.prototype,J=JSON.stringify,Za=Xa.ReactCurrentCache,$a=Wa.ReactCurrentDispatcher;function ab(a){console.error(a)}function bb(){}
function cb(a,b,c,d,e){if(null!==Za.current&&Za.current!==Ra)throw Error("Currently React only supports one RSC renderer at a time.");ta.current=sa;Za.current=Ra;var g=new Set,f=[],h=new Set;b={status:0,flushScheduled:!1,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,hints:h,abortableTasks:g,pingedTasks:f,completedImportChunks:[],completedHintChunks:[],completedRegularChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenClientReferences:new Map,
writtenServerReferences:new Map,writtenObjects:new WeakMap,identifierPrefix:d||"",identifierCount:1,taintCleanupQueue:[],onError:void 0===c?ab:c,onPostpone:void 0===e?bb:e};a=K(b,a,null,!1,g);f.push(a);return b}var L=null;function w(){if(L)return L;if(ua){var a=va.getStore();if(a)return a}return null}
function db(a,b,c){var d=K(a,null,b.keyPath,b.implicitSlot,a.abortableTasks);switch(c.status){case "fulfilled":return d.model=c.value,eb(a,d),d.id;case "rejected":return b=M(a,c.reason),N(a,d.id,b),d.id;default:"string"!==typeof c.status&&(c.status="pending",c.then(function(e){"pending"===c.status&&(c.status="fulfilled",c.value=e)},function(e){"pending"===c.status&&(c.status="rejected",c.reason=e)}))}c.then(function(e){d.model=e;eb(a,d)},function(e){d.status=4;e=M(a,e);N(a,d.id,e);a.abortableTasks.delete(d);
null!==a.destination&&O(a,a.destination)});return d.id}function x(a,b,c){c=J(c);var d=a.nextChunkId++;b="H"+b;b=d.toString(16)+":"+b;c=q.encode(b+c+"\n");a.completedHintChunks.push(c);fb(a)}function gb(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}
function hb(a){switch(a.status){case "fulfilled":case "rejected":break;default:"string"!==typeof a.status&&(a.status="pending",a.then(function(b){"pending"===a.status&&(a.status="fulfilled",a.value=b)},function(b){"pending"===a.status&&(a.status="rejected",a.reason=b)}))}return{$$typeof:C,_payload:a,_init:gb}}
function ib(a,b,c,d,e){var g=b.thenableState;b.thenableState=null;Ia=0;F=g;d=d(e,void 0);if("object"===typeof d&&null!==d&&"function"===typeof d.then){e=d;if("fulfilled"===e.status)return e.value;d=hb(d)}e=b.keyPath;g=b.implicitSlot;null!==c?b.keyPath=null===e?c:e+","+c:null===e&&(b.implicitSlot=!0);a=P(a,b,Q,"",d);b.keyPath=e;b.implicitSlot=g;return a}
function jb(a,b,c,d,e,g){if(null!==e&&void 0!==e)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof c)return c.$$typeof===r?[A,c,d,g]:ib(a,b,d,c,g);if("string"===typeof c)return[A,c,d,g];if("symbol"===typeof c)return c===wa&&null===d?(d=b.implicitSlot,null===b.keyPath&&(b.implicitSlot=!0),a=P(a,b,Q,"",g.children),b.implicitSlot=d,a):[A,c,d,g];if(null!=c&&"object"===typeof c){if(c.$$typeof===r)return[A,c,d,g];switch(c.$$typeof){case C:var f=
c._init;c=f(c._payload);return jb(a,b,c,d,e,g);case ya:return ib(a,b,d,c.render,g);case Ba:return jb(a,b,c.type,d,e,g)}}throw Error("Unsupported Server Component type: "+Va(c));}function eb(a,b){var c=a.pingedTasks;c.push(b);1===c.length&&(a.flushScheduled=null!==a.destination,setTimeout(function(){return kb(a)},0))}
function K(a,b,c,d,e){a.pendingChunks++;var g=a.nextChunkId++;"object"===typeof b&&null!==b&&a.writtenObjects.set(b,g);var f={id:g,status:0,model:b,keyPath:c,implicitSlot:d,ping:function(){return eb(a,f)},toJSON:function(h,k){var l=f.keyPath,y=f.implicitSlot;try{var u=P(a,f,this,h,k)}catch(Y){if(h=Y===Ea?Ha():Y,k=f.model,k="object"===typeof k&&null!==k&&(k.$$typeof===A||k.$$typeof===C),"object"===typeof h&&null!==h&&"function"===typeof h.then){u=K(a,f.model,f.keyPath,f.implicitSlot,a.abortableTasks);
var B=u.ping;h.then(B,B);u.thenableState=Ja();f.keyPath=l;f.implicitSlot=y;u=k?"$L"+u.id.toString(16):R(u.id)}else if(f.keyPath=l,f.implicitSlot=y,k)a.pendingChunks++,l=a.nextChunkId++,y=M(a,h),N(a,l,y),u="$L"+l.toString(16);else throw h;}return u},thenableState:null};e.add(f);return f}function R(a){return"$"+a.toString(16)}function lb(a,b,c){a=J(c);b=b.toString(16)+":"+a+"\n";return q.encode(b)}
function mb(a,b,c,d){var e=d.$$async?d.$$id+"#async":d.$$id,g=a.writtenClientReferences,f=g.get(e);if(void 0!==f)return b[0]===A&&"1"===c?"$L"+f.toString(16):R(f);try{var h=a.bundlerConfig,k=d.$$id;f="";var l=h[k];if(l)f=l.name;else{var y=k.lastIndexOf("#");-1!==y&&(f=k.slice(y+1),l=h[k.slice(0,y)]);if(!l)throw Error('Could not find the module "'+k+'" in the React Client Manifest. This is probably a bug in the React Server Components bundler.');}var u=!0===d.$$async?[l.id,l.chunks,f,1]:[l.id,l.chunks,
f];a.pendingChunks++;var B=a.nextChunkId++,Y=J(u),Eb=B.toString(16)+":I"+Y+"\n",Fb=q.encode(Eb);a.completedImportChunks.push(Fb);g.set(e,B);return b[0]===A&&"1"===c?"$L"+B.toString(16):R(B)}catch(Gb){return a.pendingChunks++,b=a.nextChunkId++,c=M(a,Gb),N(a,b,c),R(b)}}function S(a,b){b=K(a,b,null,!1,a.abortableTasks);nb(a,b);return b.id}var T=!1;
function P(a,b,c,d,e){b.model=e;if(e===A)return"$";if(null===e)return null;if("object"===typeof e){switch(e.$$typeof){case A:c=a.writtenObjects;d=c.get(e);if(void 0!==d)if(T===e)T=null;else return-1===d?(a=S(a,e),R(a)):R(d);else c.set(e,-1);return jb(a,b,e.type,e.key,e.ref,e.props);case C:return b.thenableState=null,c=e._init,e=c(e._payload),P(a,b,Q,"",e)}if(e.$$typeof===r)return mb(a,c,d,e);c=a.writtenObjects;d=c.get(e);if("function"===typeof e.then){if(void 0!==d)if(T===e)T=null;else return"$@"+
d.toString(16);a=db(a,b,e);c.set(e,a);return"$@"+a.toString(16)}if(void 0!==d)if(T===e)T=null;else return-1===d?(a=S(a,e),R(a)):R(d);else c.set(e,-1);if(Sa(e))return e;if(e instanceof Map){e=Array.from(e);for(b=0;b<e.length;b++)c=e[b][0],"object"===typeof c&&null!==c&&(d=a.writtenObjects,void 0===d.get(c)&&d.set(c,-1));return"$Q"+S(a,e).toString(16)}if(e instanceof Set){e=Array.from(e);for(b=0;b<e.length;b++)c=e[b],"object"===typeof c&&null!==c&&(d=a.writtenObjects,void 0===d.get(c)&&d.set(c,-1));
return"$W"+S(a,e).toString(16)}null===e||"object"!==typeof e?a=null:(a=Da&&e[Da]||e["@@iterator"],a="function"===typeof a?a:null);if(a)return a=Array.from(e),a;a=Ta(e);if(a!==Ya&&(null===a||null!==Ta(a)))throw Error("Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported.");return e}if("string"===typeof e){if("Z"===e[e.length-1]&&c[d]instanceof Date)return"$D"+e;if(1024<=e.length)return a.pendingChunks+=2,b=
a.nextChunkId++,e=q.encode(e),c=e.byteLength,c=b.toString(16)+":T"+c.toString(16)+",",c=q.encode(c),a.completedRegularChunks.push(c,e),R(b);a="$"===e[0]?"$"+e:e;return a}if("boolean"===typeof e)return e;if("number"===typeof e)return Number.isFinite(e)?0===e&&-Infinity===1/e?"$-0":e:Infinity===e?"$Infinity":-Infinity===e?"$-Infinity":"$NaN";if("undefined"===typeof e)return"$undefined";if("function"===typeof e){if(e.$$typeof===r)return mb(a,c,d,e);if(e.$$typeof===t)return b=a.writtenServerReferences,
c=b.get(e),void 0!==c?a="$F"+c.toString(16):(c=e.$$bound,c={id:e.$$id,bound:c?Promise.resolve(c):null},a=S(a,c),b.set(e,a),a="$F"+a.toString(16)),a;if(/^on[A-Z]/.test(d))throw Error("Event handlers cannot be passed to Client Component props."+I(c,d)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+I(c,d));}if("symbol"===typeof e){b=
a.writtenSymbols;var g=b.get(e);if(void 0!==g)return R(g);g=e.description;if(Symbol.for(g)!==e)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(e.description+") cannot be found among global symbols.")+I(c,d));a.pendingChunks++;c=a.nextChunkId++;d=lb(a,c,"$S"+g);a.completedImportChunks.push(d);b.set(e,c);return R(c)}if("bigint"===typeof e)return"$n"+e.toString(10);throw Error("Type "+typeof e+" is not supported in Client Component props."+
I(c,d));}function M(a,b){a=a.onError;b=a(b);if(null!=b&&"string"!==typeof b)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof b+'" instead');return b||""}function ob(a,b){null!==a.destination?(a.status=2,ca(a.destination,b)):(a.status=1,a.fatalError=b)}
function N(a,b,c){c={digest:c};b=b.toString(16)+":E"+J(c)+"\n";b=q.encode(b);a.completedErrorChunks.push(b)}var Q={};
function nb(a,b){if(0===b.status)try{T=b.model;var c=P(a,b,Q,"",b.model);T=c;b.keyPath=null;b.implicitSlot=!1;var d="object"===typeof c&&null!==c?J(c,b.toJSON):J(c),e=b.id.toString(16)+":"+d+"\n",g=q.encode(e);a.completedRegularChunks.push(g);a.abortableTasks.delete(b);b.status=1}catch(l){var f=l===Ea?Ha():l;if("object"===typeof f&&null!==f&&"function"===typeof f.then){var h=b.ping;f.then(h,h);b.thenableState=Ja()}else{a.abortableTasks.delete(b);b.status=4;var k=M(a,f);N(a,b.id,k)}}finally{}}
function kb(a){var b=$a.current;$a.current=Oa;var c=L;E=L=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++)nb(a,d[e]);null!==a.destination&&O(a,a.destination)}catch(g){M(a,g),ob(a,g)}finally{$a.current=b,E=null,L=c}}
function O(a,b){m=new Uint8Array(512);n=0;try{for(var c=a.completedImportChunks,d=0;d<c.length;d++)a.pendingChunks--,p(b,c[d]);c.splice(0,d);var e=a.completedHintChunks;for(d=0;d<e.length;d++)p(b,e[d]);e.splice(0,d);var g=a.completedRegularChunks;for(d=0;d<g.length;d++)a.pendingChunks--,p(b,g[d]);g.splice(0,d);var f=a.completedErrorChunks;for(d=0;d<f.length;d++)a.pendingChunks--,p(b,f[d]);f.splice(0,d)}finally{a.flushScheduled=!1,m&&0<n&&(b.enqueue(new Uint8Array(m.buffer,0,n)),m=null,n=0)}0===a.pendingChunks&&
b.close()}function pb(a){a.flushScheduled=null!==a.destination;ua?setTimeout(function(){return va.run(a,kb,a)},0):setTimeout(function(){return kb(a)},0)}function fb(a){if(!1===a.flushScheduled&&0===a.pingedTasks.length&&null!==a.destination){var b=a.destination;a.flushScheduled=!0;setTimeout(function(){return O(a,b)},0)}}
function qb(a,b){try{var c=a.abortableTasks;if(0<c.size){a.pendingChunks++;var d=a.nextChunkId++,e=void 0===b?Error("The render was aborted by the server without a reason."):b,g=M(a,e);N(a,d,g,e);c.forEach(function(f){f.status=3;var h=R(d);f=lb(a,f.id,h);a.completedErrorChunks.push(f)});c.clear()}null!==a.destination&&O(a,a.destination)}catch(f){M(a,f),ob(a,f)}}
function rb(a,b){var c="",d=a[b];if(d)c=d.name;else{var e=b.lastIndexOf("#");-1!==e&&(c=b.slice(e+1),d=a[b.slice(0,e)]);if(!d)throw Error('Could not find the module "'+b+'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.');}return[d.id,d.chunks,c]}var U=new Map;
function sb(a){var b=__webpack_require__(a);if("function"!==typeof b.then||"fulfilled"===b.status)return null;b.then(function(c){b.status="fulfilled";b.value=c},function(c){b.status="rejected";b.reason=c});return b}function tb(){}
function ub(a){for(var b=a[1],c=[],d=0;d<b.length;){var e=b[d++];b[d++];var g=U.get(e);if(void 0===g){g=__webpack_chunk_load__(e);c.push(g);var f=U.set.bind(U,e,null);g.then(f,tb);U.set(e,g)}else null!==g&&c.push(g)}return 4===a.length?0===c.length?sb(a[0]):Promise.all(c).then(function(){return sb(a[0])}):0<c.length?Promise.all(c):null}
function V(a){var b=__webpack_require__(a[0]);if(4===a.length&&"function"===typeof b.then)if("fulfilled"===b.status)b=b.value;else throw b.reason;return"*"===a[2]?b:""===a[2]?b.__esModule?b.default:b:b[a[2]]}function vb(a,b,c,d){this.status=a;this.value=b;this.reason=c;this._response=d}vb.prototype=Object.create(Promise.prototype);
vb.prototype.then=function(a,b){switch(this.status){case "resolved_model":wb(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":a&&(null===this.value&&(this.value=[]),this.value.push(a));b&&(null===this.reason&&(this.reason=[]),this.reason.push(b));break;default:b(this.reason)}};function xb(a,b){for(var c=0;c<a.length;c++)(0,a[c])(b)}
function yb(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&xb(c,b)}}function zb(a,b,c,d,e,g){var f=rb(a._bundlerConfig,b);a=ub(f);if(c)c=Promise.all([c,a]).then(function(h){h=h[0];var k=V(f);return k.bind.apply(k,[null].concat(h))});else if(a)c=Promise.resolve(a).then(function(){return V(f)});else return V(f);c.then(Ab(d,e,g),Bb(d));return null}var W=null,X=null;
function wb(a){var b=W,c=X;W=a;X=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==X&&0<X.deps?(X.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(e){a.status="rejected",a.reason=e}finally{W=b,X=c}}function Cb(a,b){a._chunks.forEach(function(c){"pending"===c.status&&yb(c,b)})}
function Z(a,b){var c=a._chunks,d=c.get(b);d||(d=a._formData.get(a._prefix+b),d=null!=d?new vb("resolved_model",d,null,a):new vb("pending",null,null,a),c.set(b,d));return d}function Ab(a,b,c){if(X){var d=X;d.deps++}else d=X={deps:1,value:null};return function(e){b[c]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=d.value,null!==e&&xb(e,d.value))}}function Bb(a){return function(b){return yb(a,b)}}
function Db(a,b){a=Z(a,b);"resolved_model"===a.status&&wb(a);if("fulfilled"!==a.status)throw a.reason;return a.value}
function Hb(a,b,c,d){if("$"===d[0])switch(d[1]){case "$":return d.slice(1);case "@":return b=parseInt(d.slice(2),16),Z(a,b);case "S":return Symbol.for(d.slice(2));case "F":return d=parseInt(d.slice(2),16),d=Db(a,d),zb(a,d.id,d.bound,W,b,c);case "Q":return b=parseInt(d.slice(2),16),a=Db(a,b),new Map(a);case "W":return b=parseInt(d.slice(2),16),a=Db(a,b),new Set(a);case "K":b=d.slice(2);var e=a._prefix+b+"_",g=new FormData;a._formData.forEach(function(f,h){h.startsWith(e)&&g.append(h.slice(e.length),
f)});return g;case "I":return Infinity;case "-":return"$-0"===d?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(d.slice(2)));case "n":return BigInt(d.slice(2));default:d=parseInt(d.slice(1),16);a=Z(a,d);switch(a.status){case "resolved_model":wb(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=W,a.then(Ab(d,b,c),Bb(d)),null;default:throw a.reason;}}return d}
function Ib(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new FormData,d=new Map,e={_bundlerConfig:a,_prefix:b,_formData:c,_chunks:d,_fromJSON:function(g,f){return"string"===typeof f?Hb(e,this,g,f):f}};return e}function Jb(a){Cb(a,Error("Connection closed."))}function Kb(a,b,c){var d=rb(a,b);a=ub(d);return c?Promise.all([c,a]).then(function(e){e=e[0];var g=V(d);return g.bind.apply(g,[null].concat(e))}):a?Promise.resolve(a).then(function(){return V(d)}):Promise.resolve(V(d))}
function Lb(a,b,c){a=Ib(b,c,a);Jb(a);a=Z(a,0);a.then(function(){});if("fulfilled"!==a.status)throw a.reason;return a.value}exports.createClientModuleProxy=function(a){a=v({},a,!1);return new Proxy(a,ka)};
exports.decodeAction=function(a,b){var c=new FormData,d=null;a.forEach(function(e,g){g.startsWith("$ACTION_")?g.startsWith("$ACTION_REF_")?(e="$ACTION_"+g.slice(12)+":",e=Lb(a,b,e),d=Kb(b,e.id,e.bound)):g.startsWith("$ACTION_ID_")&&(e=g.slice(11),d=Kb(b,e,null)):c.append(g,e)});return null===d?null:d.then(function(e){return e.bind(null,c)})};
exports.decodeFormState=function(a,b,c){var d=b.get("$ACTION_KEY");if("string"!==typeof d)return Promise.resolve(null);var e=null;b.forEach(function(f,h){h.startsWith("$ACTION_REF_")&&(f="$ACTION_"+h.slice(12)+":",e=Lb(b,c,f))});if(null===e)return Promise.resolve(null);var g=e.id;return Promise.resolve(e.bound).then(function(f){return null===f?null:[a,d,g,f.length-1]})};exports.decodeReply=function(a,b){if("string"===typeof a){var c=new FormData;c.append("0",a);a=c}a=Ib(b,"",a);b=Z(a,0);Jb(a);return b};
exports.registerClientReference=function(a,b,c){return v(a,b+"#"+c,!1)};exports.registerServerReference=function(a,b,c){return Object.defineProperties(a,{$$typeof:{value:t},$$id:{value:null===c?b:b+"#"+c},$$bound:{value:null},bind:{value:fa}})};
exports.renderToReadableStream=function(a,b,c){var d=cb(a,b,c?c.onError:void 0,c?c.identifierPrefix:void 0,c?c.onPostpone:void 0);if(c&&c.signal){var e=c.signal;if(e.aborted)qb(d,e.reason);else{var g=function(){qb(d,e.reason);e.removeEventListener("abort",g)};e.addEventListener("abort",g)}}return new ReadableStream({type:"bytes",start:function(){pb(d)},pull:function(f){if(1===d.status)d.status=2,ca(f,d.fatalError);else if(2!==d.status&&null===d.destination){d.destination=f;try{O(d,f)}catch(h){M(d,
h),ob(d,h)}}},cancel:function(f){d.destination=null;qb(d,f)}},{highWaterMark:0})};
//# sourceMappingURL=react-server-dom-webpack-server.edge.production.min.js.map