react-server-dom-webpack 18.3.0-canary-21a161fa3-20230609 → 18.3.0-canary-88df88f94-20230613
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.
- package/cjs/react-server-dom-webpack-client.browser.development.js +178 -36
- package/cjs/react-server-dom-webpack-client.browser.production.min.js +24 -24
- package/cjs/react-server-dom-webpack-client.edge.development.js +178 -36
- package/cjs/react-server-dom-webpack-client.edge.production.min.js +23 -23
- package/cjs/react-server-dom-webpack-client.node.development.js +177 -53
- package/cjs/react-server-dom-webpack-client.node.production.min.js +25 -25
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +177 -53
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +24 -24
- package/cjs/react-server-dom-webpack-server.browser.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +46 -46
- package/cjs/react-server-dom-webpack-server.edge.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.edge.production.min.js +49 -49
- package/cjs/react-server-dom-webpack-server.node.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.node.production.min.js +37 -37
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +56 -56
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-client.browser.development.js +178 -36
- package/umd/react-server-dom-webpack-client.browser.production.min.js +21 -20
- package/umd/react-server-dom-webpack-server.browser.development.js +32 -8
- package/umd/react-server-dom-webpack-server.browser.production.min.js +43 -42
@@ -7,28 +7,28 @@
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
|
-
'use strict';var q=require("react-dom"),
|
11
|
-
function
|
12
|
-
var
|
13
|
-
function
|
14
|
-
1]&&this[
|
15
|
-
if(Symbol.for(
|
16
|
-
function
|
17
|
-
function
|
18
|
-
var L=
|
10
|
+
'use strict';var q=require("react-dom"),r=require("react"),u={stream:!0};function v(a,b){if(a){var c=a[b.id];if(a=c[b.name])c=a.name;else{a=c["*"];if(!a)throw Error('Could not find the module "'+b.id+'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.');c=b.name}return{id:a.id,chunks:a.chunks,name:c,async:!!b.async}}return b}var w=new Map,x=new Map;function y(){}
|
11
|
+
function z(a){for(var b=a.chunks,c=[],d=0;d<b.length;d++){var g=b[d],h=w.get(g);if(void 0===h){h=__webpack_chunk_load__(g);c.push(h);var n=w.set.bind(w,g,null);h.then(n,y);w.set(g,h)}else null!==h&&c.push(h)}if(a.async){if(b=x.get(a.id))return"fulfilled"===b.status?null:b;var e=Promise.all(c).then(function(){return __webpack_require__(a.id)});e.then(function(l){e.status="fulfilled";e.value=l},function(l){e.status="rejected";e.reason=l});x.set(a.id,e);return e}return 0<c.length?Promise.all(c):null}
|
12
|
+
var A=q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,B=Symbol.for("react.element"),C=Symbol.for("react.lazy"),D=Symbol.for("react.default_value"),F=Symbol.iterator;function G(a){if(null===a||"object"!==typeof a)return null;a=F&&a[F]||a["@@iterator"];return"function"===typeof a?a:null}var H=Array.isArray,J=new WeakMap;function aa(a){return Number.isFinite(a)?0===a&&-Infinity===1/a?"$-0":a:Infinity===a?"$Infinity":-Infinity===a?"$-Infinity":"$NaN"}
|
13
|
+
function ba(a,b,c,d){function g(l,f){if(null===f)return null;if("object"===typeof f){if("function"===typeof f.then){null===e&&(e=new FormData);n++;var k=h++;f.then(function(p){p=JSON.stringify(p,g);var t=e;t.append(b+k,p);n--;0===n&&c(t)},function(p){d(p)});return"$@"+k.toString(16)}if(f instanceof FormData){null===e&&(e=new FormData);var m=e;l=h++;var E=b+l+"_";f.forEach(function(p,t){m.append(E+t,p)});return"$K"+l.toString(16)}return!H(f)&&G(f)?Array.from(f):f}if("string"===typeof f){if("Z"===f[f.length-
|
14
|
+
1]&&this[l]instanceof Date)return"$D"+f;f="$"===f[0]?"$"+f:f;return f}if("boolean"===typeof f)return f;if("number"===typeof f)return aa(f);if("undefined"===typeof f)return"$undefined";if("function"===typeof f){f=J.get(f);if(void 0!==f)return f=JSON.stringify(f,g),null===e&&(e=new FormData),l=h++,e.set(b+l,f),"$F"+l.toString(16);throw Error("Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again.");}if("symbol"===typeof f){l=f.description;
|
15
|
+
if(Symbol.for(l)!==f)throw Error("Only global symbols received from Symbol.for(...) can be passed to Server Functions. The symbol Symbol.for("+(f.description+") cannot be found among global symbols."));return"$S"+l}if("bigint"===typeof f)return"$n"+f.toString(10);throw Error("Type "+typeof f+" is not supported as an argument to a Server Function.");}var h=1,n=0,e=null;a=JSON.stringify(a,g);null===e?c(a):(e.set(b+"0",a),0===n&&c(e))}var K=new WeakMap;
|
16
|
+
function ca(a){var b,c,d=new Promise(function(g,h){b=g;c=h});ba(a,"",function(g){if("string"===typeof g){var h=new FormData;h.append("0",g);g=h}d.status="fulfilled";d.value=g;b(g)},function(g){d.status="rejected";d.reason=g;c(g)});return d}
|
17
|
+
function da(a){var b=J.get(this);if(!b)throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.");var c=null;if(null!==b.bound){c=K.get(b);c||(c=ca(b),K.set(b,c));if("rejected"===c.status)throw c.reason;if("fulfilled"!==c.status)throw c;b=c.value;var d=new FormData;b.forEach(function(g,h){d.append("$ACTION_"+a+":"+h,g)});c=d;b="$ACTION_REF_"+a}else b="$ACTION_ID_"+b.id;return{name:b,method:"POST",encType:"multipart/form-data",data:c}}
|
18
|
+
var L=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;function M(a,b,c,d){this.status=a;this.value=b;this.reason=c;this._response=d}M.prototype=Object.create(Promise.prototype);
|
19
19
|
M.prototype.then=function(a,b){switch(this.status){case "resolved_model":N(this);break;case "resolved_module":O(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)}};
|
20
|
-
function
|
20
|
+
function ea(a){switch(a.status){case "resolved_model":N(a);break;case "resolved_module":O(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":throw a;default:throw a.reason;}}function P(a,b){for(var c=0;c<a.length;c++)(0,a[c])(b)}function Q(a,b,c){switch(a.status){case "fulfilled":P(b,a.value);break;case "pending":case "blocked":a.value=b;a.reason=c;break;case "rejected":c&&P(c,a.reason)}}
|
21
21
|
function R(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&P(c,b)}}function S(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.value,d=a.reason;a.status="resolved_module";a.value=b;null!==c&&(O(a),Q(a,c,d))}}var T=null,U=null;
|
22
|
-
function N(a){var b=T,c=U;T=a;U=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==U&&0<U.deps?(U.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(
|
23
|
-
function O(a){try{var b=a.value;if(b.async){var c=
|
24
|
-
function
|
25
|
-
function
|
26
|
-
function
|
27
|
-
}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=W(a,d);switch(a.status){case "resolved_model":N(a);break;case "resolved_module":O(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=T,a.then(
|
28
|
-
function
|
29
|
-
function
|
30
|
-
function
|
31
|
-
function Z(a,b){function c(
|
32
|
-
case "C":
|
33
|
-
null,k,
|
34
|
-
exports.createFromFetch=function(a,b){var c=X(b&&b.moduleMap?b.moduleMap:null,Y);a.then(function(d){Z(c,d.body)},function(d){V(c,d)});return W(c,0)};exports.createFromReadableStream=function(a,b){b=X(b&&b.moduleMap?b.moduleMap:null,Y);Z(b,a);return W(b,0)};exports.createServerReference=function(){return Y};
|
22
|
+
function N(a){var b=T,c=U;T=a;U=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==U&&0<U.deps?(U.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(g){a.status="rejected",a.reason=g}finally{T=b,U=c}}
|
23
|
+
function O(a){try{var b=a.value;if(b.async){var c=x.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;}else d=__webpack_require__(b.id);var g="*"===b.name?d:""===b.name?d.__esModule?d.default:d:d[b.name];a.status="fulfilled";a.value=g}catch(h){a.status="rejected",a.reason=h}}function V(a,b){a._chunks.forEach(function(c){"pending"===c.status&&R(c,b)})}function W(a,b){var c=a._chunks,d=c.get(b);d||(d=new M("pending",null,null,a),c.set(b,d));return d}
|
24
|
+
function fa(a,b,c){if(U){var d=U;d.deps++}else d=U={deps:1,value:null};return function(g){b[c]=g;d.deps--;0===d.deps&&"blocked"===a.status&&(g=a.value,a.status="fulfilled",a.value=d.value,null!==g&&P(g,d.value))}}function ha(a){return function(b){return R(a,b)}}
|
25
|
+
function ia(a,b){function c(){var g=Array.prototype.slice.call(arguments),h=b.bound;return h?"fulfilled"===h.status?d(b.id,h.value.concat(g)):Promise.resolve(h).then(function(n){return d(b.id,n.concat(g))}):d(b.id,g)}var d=a._callServer;c.$$FORM_ACTION=da;J.set(c,b);return c}
|
26
|
+
function ja(a,b,c,d){if("$"===d[0]){if("$"===d)return B;switch(d[1]){case "$":return d.slice(1);case "L":return b=parseInt(d.slice(2),16),a=W(a,b),{$$typeof:C,_payload:a,_init:ea};case "@":return b=parseInt(d.slice(2),16),W(a,b);case "S":return Symbol.for(d.slice(2));case "P":return a=d.slice(2),L[a]||(L[a]=r.createServerContext(a,D)),L[a].Provider;case "F":b=parseInt(d.slice(2),16);b=W(a,b);switch(b.status){case "resolved_model":N(b)}switch(b.status){case "fulfilled":return ia(a,b.value);default:throw b.reason;
|
27
|
+
}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=W(a,d);switch(a.status){case "resolved_model":N(a);break;case "resolved_module":O(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=T,a.then(fa(d,b,c),ha(d)),null;default:throw a.reason;}}}return d}
|
28
|
+
function ka(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}function X(a,b){var c=new Map;a={_bundlerConfig:a,_callServer:void 0!==b?b:ka,_chunks:c,_stringDecoder:new TextDecoder,_fromJSON:null,_rowState:0,_rowID:0,_rowTag:0,_rowLength:0,_buffer:[]};a._fromJSON=la(a);return a}
|
29
|
+
function ma(a,b,c){var d=a._chunks,g=d.get(b);c=JSON.parse(c,a._fromJSON);var h=v(a._bundlerConfig,c);if(c=z(h)){if(g){var n=g;n.status="blocked"}else n=new M("blocked",null,null,a),d.set(b,n);c.then(function(){return S(n,h)},function(e){return R(n,e)})}else g?S(g,h):d.set(b,new M("resolved_module",h,null,a))}
|
30
|
+
function la(a){return function(b,c){return"string"===typeof c?ja(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===B?{$$typeof:B,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:c,b):c}}function Y(){throw Error("Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.");}
|
31
|
+
function Z(a,b){function c(h){var n=h.value;if(h.done)V(a,Error("Connection closed."));else{var e=0,l=a._rowState,f=a._rowID,k=a._rowTag,m=a._rowLength;h=a._buffer;for(var E=n.length;e<E;){var p=-1;switch(l){case 0:p=n[e++];58===p?l=1:f=f<<4|(96<p?p-87:p-48);continue;case 1:p=n[e];84===p?(k=p,l=2,e++):64<p&&91>p?(k=p,l=3,e++):(k=0,l=3);continue;case 2:p=n[e++];44===p?l=4:m=m<<4|(96<p?p-87:p-48);continue;case 3:p=n.indexOf(10,e);break;case 4:e+m<=n.length&&(p=e+m)}if(-1<p){e=new Uint8Array(n.buffer,
|
32
|
+
n.byteOffset+e,p-e);m=a;l=k;k="";for(var t=m._stringDecoder,I=0;I<h.length;I++)k+=t.decode(h[I],u);k="string"===typeof e?k+e:k+t.decode(e);switch(l){case 73:ma(m,f,k);break;case 72:f=k[0];k=k.slice(1);m=JSON.parse(k,m._fromJSON);k=void 0;if(l=A.current)switch("string"===typeof m?e=m:(e=m[0],k=m[1]),f){case "D":l.prefetchDNS(e,k);break;case "C":l.preconnect(e,k);break;case "L":l.preload(e,k);break;case "I":l.preinit(e,k)}break;case 69:k=JSON.parse(k);e=k.digest;k=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");
|
33
|
+
k.stack="Error: "+k.message;k.digest=e;e=m._chunks;(l=e.get(f))?R(l,k):e.set(f,new M("rejected",null,k,m));break;case 84:m._chunks.set(f,new M("fulfilled",k,null,m));break;default:e=m._chunks,(l=e.get(f))?(m=l,f=k,"pending"===m.status&&(k=m.value,e=m.reason,m.status="resolved_model",m.value=f,null!==k&&(N(m),Q(m,k,e)))):e.set(f,new M("resolved_model",k,null,m))}m=f=k=l=0;h.length=0;e=p+1}else{n=new Uint8Array(n.buffer,n.byteOffset+e,n.byteLength-e);h.push(n);m-=n.byteLength;break}}a._rowState=l;a._rowID=
|
34
|
+
f;a._rowTag=k;a._rowLength=m;return g.read().then(c).catch(d)}}function d(h){V(a,h)}var g=b.getReader();g.read().then(c).catch(d)}exports.createFromFetch=function(a,b){var c=X(b&&b.moduleMap?b.moduleMap:null,Y);a.then(function(d){Z(c,d.body)},function(d){V(c,d)});return W(c,0)};exports.createFromReadableStream=function(a,b){b=X(b&&b.moduleMap?b.moduleMap:null,Y);Z(b,a);return W(b,0)};exports.createServerReference=function(){return Y};
|
@@ -945,6 +945,11 @@ function getOrCreateServerContext(globalName) {
|
|
945
945
|
return ContextRegistry[globalName];
|
946
946
|
}
|
947
947
|
|
948
|
+
var ROW_ID = 0;
|
949
|
+
var ROW_TAG = 1;
|
950
|
+
var ROW_LENGTH = 2;
|
951
|
+
var ROW_CHUNK_BY_NEWLINE = 3;
|
952
|
+
var ROW_CHUNK_BY_LENGTH = 4;
|
948
953
|
var PENDING = 'pending';
|
949
954
|
var BLOCKED = 'blocked';
|
950
955
|
var RESOLVED_MODEL = 'resolved_model';
|
@@ -1110,6 +1115,11 @@ function createResolvedModuleChunk(response, value) {
|
|
1110
1115
|
return new Chunk(RESOLVED_MODULE, value, null, response);
|
1111
1116
|
}
|
1112
1117
|
|
1118
|
+
function createInitializedTextChunk(response, value) {
|
1119
|
+
// $FlowFixMe[invalid-constructor] Flow doesn't support functions as constructors
|
1120
|
+
return new Chunk(INITIALIZED, value, null, response);
|
1121
|
+
}
|
1122
|
+
|
1113
1123
|
function resolveModelChunk(chunk, value) {
|
1114
1124
|
if (chunk.status !== PENDING) {
|
1115
1125
|
// We already resolved. We didn't expect to see this.
|
@@ -1521,15 +1531,14 @@ function createResponse(bundlerConfig, callServer) {
|
|
1521
1531
|
_bundlerConfig: bundlerConfig,
|
1522
1532
|
_callServer: callServer !== undefined ? callServer : missingCall,
|
1523
1533
|
_chunks: chunks,
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
} // Don't inline this call because it causes closure to outline the call above.
|
1532
|
-
|
1534
|
+
_stringDecoder: createStringDecoder(),
|
1535
|
+
_fromJSON: null,
|
1536
|
+
_rowState: 0,
|
1537
|
+
_rowID: 0,
|
1538
|
+
_rowTag: 0,
|
1539
|
+
_rowLength: 0,
|
1540
|
+
_buffer: []
|
1541
|
+
}; // Don't inline this call because it causes closure to outline the call above.
|
1533
1542
|
|
1534
1543
|
response._fromJSON = createFromJSONCallback(response);
|
1535
1544
|
return response;
|
@@ -1546,6 +1555,13 @@ function resolveModel(response, id, model) {
|
|
1546
1555
|
}
|
1547
1556
|
}
|
1548
1557
|
|
1558
|
+
function resolveText(response, id, text) {
|
1559
|
+
var chunks = response._chunks; // We assume that we always reference large strings after they've been
|
1560
|
+
// emitted.
|
1561
|
+
|
1562
|
+
chunks.set(id, createInitializedTextChunk(response, text));
|
1563
|
+
}
|
1564
|
+
|
1549
1565
|
function resolveModule(response, id, model) {
|
1550
1566
|
var chunks = response._chunks;
|
1551
1567
|
var chunk = chunks.get(id);
|
@@ -1609,35 +1625,44 @@ function resolveHint(response, code, model) {
|
|
1609
1625
|
dispatchHint(code, hintModel);
|
1610
1626
|
}
|
1611
1627
|
|
1612
|
-
function processFullRow(response,
|
1613
|
-
|
1614
|
-
|
1628
|
+
function processFullRow(response, id, tag, buffer, lastChunk) {
|
1629
|
+
var row = '';
|
1630
|
+
var stringDecoder = response._stringDecoder;
|
1631
|
+
|
1632
|
+
for (var i = 0; i < buffer.length; i++) {
|
1633
|
+
var chunk = buffer[i];
|
1634
|
+
row += readPartialStringChunk(stringDecoder, chunk);
|
1615
1635
|
}
|
1616
1636
|
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
// }
|
1637
|
+
if (typeof lastChunk === 'string') {
|
1638
|
+
row += lastChunk;
|
1639
|
+
} else {
|
1640
|
+
row += readFinalStringChunk(stringDecoder, lastChunk);
|
1641
|
+
}
|
1623
1642
|
|
1624
1643
|
switch (tag) {
|
1625
|
-
case
|
1644
|
+
case 73
|
1645
|
+
/* "I" */
|
1646
|
+
:
|
1626
1647
|
{
|
1627
|
-
resolveModule(response, id, row
|
1648
|
+
resolveModule(response, id, row);
|
1628
1649
|
return;
|
1629
1650
|
}
|
1630
1651
|
|
1631
|
-
case
|
1652
|
+
case 72
|
1653
|
+
/* "H" */
|
1654
|
+
:
|
1632
1655
|
{
|
1633
|
-
var code = row[
|
1634
|
-
resolveHint(response, code, row.slice(
|
1656
|
+
var code = row[0];
|
1657
|
+
resolveHint(response, code, row.slice(1));
|
1635
1658
|
return;
|
1636
1659
|
}
|
1637
1660
|
|
1638
|
-
case
|
1661
|
+
case 69
|
1662
|
+
/* "E" */
|
1663
|
+
:
|
1639
1664
|
{
|
1640
|
-
var errorInfo = JSON.parse(row
|
1665
|
+
var errorInfo = JSON.parse(row);
|
1641
1666
|
|
1642
1667
|
{
|
1643
1668
|
resolveErrorDev(response, id, errorInfo.digest, errorInfo.message, errorInfo.stack);
|
@@ -1646,42 +1671,145 @@ function processFullRow(response, row) {
|
|
1646
1671
|
return;
|
1647
1672
|
}
|
1648
1673
|
|
1674
|
+
case 84
|
1675
|
+
/* "T" */
|
1676
|
+
:
|
1677
|
+
{
|
1678
|
+
resolveText(response, id, row);
|
1679
|
+
return;
|
1680
|
+
}
|
1681
|
+
|
1649
1682
|
default:
|
1650
1683
|
{
|
1651
1684
|
// We assume anything else is JSON.
|
1652
|
-
resolveModel(response, id, row
|
1685
|
+
resolveModel(response, id, row);
|
1653
1686
|
return;
|
1654
1687
|
}
|
1655
1688
|
}
|
1656
1689
|
}
|
1657
1690
|
|
1658
|
-
function
|
1659
|
-
var
|
1691
|
+
function processBinaryChunk(response, chunk) {
|
1692
|
+
var i = 0;
|
1693
|
+
var rowState = response._rowState;
|
1694
|
+
var rowID = response._rowID;
|
1695
|
+
var rowTag = response._rowTag;
|
1696
|
+
var rowLength = response._rowLength;
|
1697
|
+
var buffer = response._buffer;
|
1698
|
+
var chunkLength = chunk.length;
|
1699
|
+
|
1700
|
+
while (i < chunkLength) {
|
1701
|
+
var lastIdx = -1;
|
1702
|
+
|
1703
|
+
switch (rowState) {
|
1704
|
+
case ROW_ID:
|
1705
|
+
{
|
1706
|
+
var byte = chunk[i++];
|
1707
|
+
|
1708
|
+
if (byte === 58
|
1709
|
+
/* ":" */
|
1710
|
+
) {
|
1711
|
+
// Finished the rowID, next we'll parse the tag.
|
1712
|
+
rowState = ROW_TAG;
|
1713
|
+
} else {
|
1714
|
+
rowID = rowID << 4 | (byte > 96 ? byte - 87 : byte - 48);
|
1715
|
+
}
|
1660
1716
|
|
1661
|
-
|
1662
|
-
|
1663
|
-
processFullRow(response, fullrow);
|
1664
|
-
response._partialRow = '';
|
1665
|
-
offset = linebreak + 1;
|
1666
|
-
linebreak = chunk.indexOf('\n', offset);
|
1667
|
-
}
|
1717
|
+
continue;
|
1718
|
+
}
|
1668
1719
|
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1720
|
+
case ROW_TAG:
|
1721
|
+
{
|
1722
|
+
var resolvedRowTag = chunk[i];
|
1723
|
+
|
1724
|
+
if (resolvedRowTag === 84
|
1725
|
+
/* "T" */
|
1726
|
+
) {
|
1727
|
+
rowTag = resolvedRowTag;
|
1728
|
+
rowState = ROW_LENGTH;
|
1729
|
+
i++;
|
1730
|
+
} else if (resolvedRowTag > 64 && resolvedRowTag < 91
|
1731
|
+
/* "A"-"Z" */
|
1732
|
+
) {
|
1733
|
+
rowTag = resolvedRowTag;
|
1734
|
+
rowState = ROW_CHUNK_BY_NEWLINE;
|
1735
|
+
i++;
|
1736
|
+
} else {
|
1737
|
+
rowTag = 0;
|
1738
|
+
rowState = ROW_CHUNK_BY_NEWLINE; // This was an unknown tag so it was probably part of the data.
|
1739
|
+
}
|
1672
1740
|
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1741
|
+
continue;
|
1742
|
+
}
|
1743
|
+
|
1744
|
+
case ROW_LENGTH:
|
1745
|
+
{
|
1746
|
+
var _byte = chunk[i++];
|
1747
|
+
|
1748
|
+
if (_byte === 44
|
1749
|
+
/* "," */
|
1750
|
+
) {
|
1751
|
+
// Finished the rowLength, next we'll buffer up to that length.
|
1752
|
+
rowState = ROW_CHUNK_BY_LENGTH;
|
1753
|
+
} else {
|
1754
|
+
rowLength = rowLength << 4 | (_byte > 96 ? _byte - 87 : _byte - 48);
|
1755
|
+
}
|
1756
|
+
|
1757
|
+
continue;
|
1758
|
+
}
|
1759
|
+
|
1760
|
+
case ROW_CHUNK_BY_NEWLINE:
|
1761
|
+
{
|
1762
|
+
// We're looking for a newline
|
1763
|
+
lastIdx = chunk.indexOf(10
|
1764
|
+
/* "\n" */
|
1765
|
+
, i);
|
1766
|
+
break;
|
1767
|
+
}
|
1768
|
+
|
1769
|
+
case ROW_CHUNK_BY_LENGTH:
|
1770
|
+
{
|
1771
|
+
// We're looking for the remaining byte length
|
1772
|
+
if (i + rowLength <= chunk.length) {
|
1773
|
+
lastIdx = i + rowLength;
|
1774
|
+
}
|
1775
|
+
|
1776
|
+
break;
|
1777
|
+
}
|
1778
|
+
}
|
1779
|
+
|
1780
|
+
if (lastIdx > -1) {
|
1781
|
+
// We found the last chunk of the row
|
1782
|
+
var offset = chunk.byteOffset + i;
|
1783
|
+
var length = lastIdx - i;
|
1784
|
+
var lastChunk = new Uint8Array(chunk.buffer, offset, length);
|
1785
|
+
processFullRow(response, rowID, rowTag, buffer, lastChunk); // Reset state machine for a new row
|
1786
|
+
|
1787
|
+
rowState = ROW_ID;
|
1788
|
+
rowTag = 0;
|
1789
|
+
rowID = 0;
|
1790
|
+
rowLength = 0;
|
1791
|
+
buffer.length = 0;
|
1792
|
+
i = lastIdx + 1;
|
1793
|
+
} else {
|
1794
|
+
// The rest of this row is in a future chunk. We stash the rest of the
|
1795
|
+
// current chunk until we can process the full row.
|
1796
|
+
var _offset = chunk.byteOffset + i;
|
1797
|
+
|
1798
|
+
var _length = chunk.byteLength - i;
|
1799
|
+
|
1800
|
+
var remainingSlice = new Uint8Array(chunk.buffer, _offset, _length);
|
1801
|
+
buffer.push(remainingSlice); // Update how many bytes we're still waiting for. If we're looking for
|
1802
|
+
// a newline, this doesn't hurt since we'll just ignore it.
|
1803
|
+
|
1804
|
+
rowLength -= remainingSlice.byteLength;
|
1805
|
+
break;
|
1806
|
+
}
|
1682
1807
|
}
|
1683
1808
|
|
1684
|
-
response.
|
1809
|
+
response._rowState = rowState;
|
1810
|
+
response._rowID = rowID;
|
1811
|
+
response._rowTag = rowTag;
|
1812
|
+
response._rowLength = rowLength;
|
1685
1813
|
}
|
1686
1814
|
|
1687
1815
|
function parseModel(response, json) {
|
@@ -1723,11 +1851,7 @@ function createServerReference(id, callServer) {
|
|
1723
1851
|
function createFromNodeStream(stream, moduleMap) {
|
1724
1852
|
var response = createResponse(moduleMap, noServerCall);
|
1725
1853
|
stream.on('data', function (chunk) {
|
1726
|
-
|
1727
|
-
processStringChunk(response, chunk, 0);
|
1728
|
-
} else {
|
1729
|
-
processBinaryChunk(response, chunk);
|
1730
|
-
}
|
1854
|
+
processBinaryChunk(response, chunk);
|
1731
1855
|
});
|
1732
1856
|
stream.on('error', function (error) {
|
1733
1857
|
reportGlobalError(response, error);
|
@@ -7,28 +7,28 @@
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
|
-
'use strict';var
|
11
|
-
function
|
12
|
-
var
|
13
|
-
function
|
14
|
-
|
15
|
-
|
16
|
-
function
|
17
|
-
function
|
18
|
-
var
|
19
|
-
|
20
|
-
function
|
21
|
-
function
|
22
|
-
function
|
23
|
-
function
|
24
|
-
function
|
25
|
-
function
|
26
|
-
function
|
27
|
-
}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=
|
28
|
-
function
|
29
|
-
function
|
30
|
-
function
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
Error("Connection closed."))});return
|
10
|
+
'use strict';var n=require("util"),p=require("react-dom"),t=require("react"),u={stream:!0};function v(a,c){if(a){var b=a[c.id];if(a=b[c.name])b=a.name;else{a=b["*"];if(!a)throw Error('Could not find the module "'+c.id+'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.');b=c.name}return{id:a.id,chunks:a.chunks,name:b,async:!!c.async}}return c}var y=new Map,z=new Map;function A(){}
|
11
|
+
function B(a){for(var c=a.chunks,b=[],d=0;d<c.length;d++){var e=c[d],g=y.get(e);if(void 0===g){g=__webpack_chunk_load__(e);b.push(g);var l=y.set.bind(y,e,null);g.then(l,A);y.set(e,g)}else null!==g&&b.push(g)}if(a.async){if(c=z.get(a.id))return"fulfilled"===c.status?null:c;var f=Promise.all(b).then(function(){return __webpack_require__(a.id)});f.then(function(h){f.status="fulfilled";f.value=h},function(h){f.status="rejected";f.reason=h});z.set(a.id,f);return f}return 0<b.length?Promise.all(b):null}
|
12
|
+
var C=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,D=Symbol.for("react.element"),E=Symbol.for("react.lazy"),F=Symbol.for("react.default_value"),G=Symbol.iterator;function H(a){if(null===a||"object"!==typeof a)return null;a=G&&a[G]||a["@@iterator"];return"function"===typeof a?a:null}var I=Array.isArray,J=new WeakMap;function K(a){return Number.isFinite(a)?0===a&&-Infinity===1/a?"$-0":a:Infinity===a?"$Infinity":-Infinity===a?"$-Infinity":"$NaN"}
|
13
|
+
function L(a,c,b,d){function e(h,k){if(null===k)return null;if("object"===typeof k){if("function"===typeof k.then){null===f&&(f=new FormData);l++;var w=g++;k.then(function(q){q=JSON.stringify(q,e);var x=f;x.append(c+w,q);l--;0===l&&b(x)},function(q){d(q)});return"$@"+w.toString(16)}if(k instanceof FormData){null===f&&(f=new FormData);var m=f;h=g++;var r=c+h+"_";k.forEach(function(q,x){m.append(r+x,q)});return"$K"+h.toString(16)}return!I(k)&&H(k)?Array.from(k):k}if("string"===typeof k){if("Z"===k[k.length-
|
14
|
+
1]&&this[h]instanceof Date)return"$D"+k;k="$"===k[0]?"$"+k:k;return k}if("boolean"===typeof k)return k;if("number"===typeof k)return K(k);if("undefined"===typeof k)return"$undefined";if("function"===typeof k){k=J.get(k);if(void 0!==k)return k=JSON.stringify(k,e),null===f&&(f=new FormData),h=g++,f.set(c+h,k),"$F"+h.toString(16);throw Error("Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again.");}if("symbol"===typeof k){h=k.description;
|
15
|
+
if(Symbol.for(h)!==k)throw Error("Only global symbols received from Symbol.for(...) can be passed to Server Functions. The symbol Symbol.for("+(k.description+") cannot be found among global symbols."));return"$S"+h}if("bigint"===typeof k)return"$n"+k.toString(10);throw Error("Type "+typeof k+" is not supported as an argument to a Server Function.");}var g=1,l=0,f=null;a=JSON.stringify(a,e);null===f?b(a):(f.set(c+"0",a),0===l&&b(f))}var M=new WeakMap;
|
16
|
+
function aa(a){var c,b,d=new Promise(function(e,g){c=e;b=g});L(a,"",function(e){if("string"===typeof e){var g=new FormData;g.append("0",e);e=g}d.status="fulfilled";d.value=e;c(e)},function(e){d.status="rejected";d.reason=e;b(e)});return d}
|
17
|
+
function ba(a){var c=J.get(this);if(!c)throw Error("Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.");var b=null;if(null!==c.bound){b=M.get(c);b||(b=aa(c),M.set(c,b));if("rejected"===b.status)throw b.reason;if("fulfilled"!==b.status)throw b;c=b.value;var d=new FormData;c.forEach(function(e,g){d.append("$ACTION_"+a+":"+g,e)});b=d;c="$ACTION_REF_"+a}else c="$ACTION_ID_"+c.id;return{name:c,method:"POST",encType:"multipart/form-data",data:b}}
|
18
|
+
var N=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;function O(a,c,b,d){this.status=a;this.value=c;this.reason=b;this._response=d}O.prototype=Object.create(Promise.prototype);
|
19
|
+
O.prototype.then=function(a,c){switch(this.status){case "resolved_model":P(this);break;case "resolved_module":Q(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":a&&(null===this.value&&(this.value=[]),this.value.push(a));c&&(null===this.reason&&(this.reason=[]),this.reason.push(c));break;default:c(this.reason)}};
|
20
|
+
function ca(a){switch(a.status){case "resolved_model":P(a);break;case "resolved_module":Q(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":throw a;default:throw a.reason;}}function R(a,c){for(var b=0;b<a.length;b++)(0,a[b])(c)}function S(a,c,b){switch(a.status){case "fulfilled":R(c,a.value);break;case "pending":case "blocked":a.value=c;a.reason=b;break;case "rejected":b&&R(b,a.reason)}}
|
21
|
+
function T(a,c){if("pending"===a.status||"blocked"===a.status){var b=a.reason;a.status="rejected";a.reason=c;null!==b&&R(b,c)}}function U(a,c){if("pending"===a.status||"blocked"===a.status){var b=a.value,d=a.reason;a.status="resolved_module";a.value=c;null!==b&&(Q(a),S(a,b,d))}}var V=null,W=null;
|
22
|
+
function P(a){var c=V,b=W;V=a;W=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==W&&0<W.deps?(W.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{V=c,W=b}}
|
23
|
+
function Q(a){try{var c=a.value;if(c.async){var b=z.get(c.id);if("fulfilled"===b.status)var d=b.value;else throw b.reason;}else d=__webpack_require__(c.id);var e="*"===c.name?d:""===c.name?d.__esModule?d.default:d:d[c.name];a.status="fulfilled";a.value=e}catch(g){a.status="rejected",a.reason=g}}function X(a,c){a._chunks.forEach(function(b){"pending"===b.status&&T(b,c)})}function Y(a,c){var b=a._chunks,d=b.get(c);d||(d=new O("pending",null,null,a),b.set(c,d));return d}
|
24
|
+
function da(a,c,b){if(W){var d=W;d.deps++}else d=W={deps:1,value:null};return function(e){c[b]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=d.value,null!==e&&R(e,d.value))}}function ea(a){return function(c){return T(a,c)}}
|
25
|
+
function fa(a,c){function b(){var e=Array.prototype.slice.call(arguments),g=c.bound;return g?"fulfilled"===g.status?d(c.id,g.value.concat(e)):Promise.resolve(g).then(function(l){return d(c.id,l.concat(e))}):d(c.id,e)}var d=a._callServer;b.$$FORM_ACTION=ba;J.set(b,c);return b}
|
26
|
+
function ha(a,c,b,d){if("$"===d[0]){if("$"===d)return D;switch(d[1]){case "$":return d.slice(1);case "L":return c=parseInt(d.slice(2),16),a=Y(a,c),{$$typeof:E,_payload:a,_init:ca};case "@":return c=parseInt(d.slice(2),16),Y(a,c);case "S":return Symbol.for(d.slice(2));case "P":return a=d.slice(2),N[a]||(N[a]=t.createServerContext(a,F)),N[a].Provider;case "F":c=parseInt(d.slice(2),16);c=Y(a,c);switch(c.status){case "resolved_model":P(c)}switch(c.status){case "fulfilled":return fa(a,c.value);default:throw c.reason;
|
27
|
+
}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=Y(a,d);switch(a.status){case "resolved_model":P(a);break;case "resolved_module":Q(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=V,a.then(da(d,c,b),ea(d)),null;default:throw a.reason;}}}return d}
|
28
|
+
function ia(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}function ja(a,c){var b=new Map;a={_bundlerConfig:a,_callServer:void 0!==c?c:ia,_chunks:b,_stringDecoder:new n.TextDecoder,_fromJSON:null,_rowState:0,_rowID:0,_rowTag:0,_rowLength:0,_buffer:[]};a._fromJSON=ka(a);return a}
|
29
|
+
function la(a,c,b){var d=a._chunks,e=d.get(c);b=JSON.parse(b,a._fromJSON);var g=v(a._bundlerConfig,b);if(b=B(g)){if(e){var l=e;l.status="blocked"}else l=new O("blocked",null,null,a),d.set(c,l);b.then(function(){return U(l,g)},function(f){return T(l,f)})}else e?U(e,g):d.set(c,new O("resolved_module",g,null,a))}
|
30
|
+
function ka(a){return function(c,b){return"string"===typeof b?ha(a,this,c,b):"object"===typeof b&&null!==b?(c=b[0]===D?{$$typeof:D,type:b[1],key:b[2],ref:null,props:b[3],_owner:null}:b,c):b}}function Z(){throw Error("Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.");}
|
31
|
+
exports.createFromNodeStream=function(a,c){var b=ja(c,Z);a.on("data",function(d){for(var e=0,g=b._rowState,l=b._rowID,f=b._rowTag,h=b._rowLength,k=b._buffer,w=d.length;e<w;){var m=-1;switch(g){case 0:m=d[e++];58===m?g=1:l=l<<4|(96<m?m-87:m-48);continue;case 1:m=d[e];84===m?(f=m,g=2,e++):64<m&&91>m?(f=m,g=3,e++):(f=0,g=3);continue;case 2:m=d[e++];44===m?g=4:h=h<<4|(96<m?m-87:m-48);continue;case 3:m=d.indexOf(10,e);break;case 4:e+h<=d.length&&(m=e+h)}if(-1<m){h=new Uint8Array(d.buffer,d.byteOffset+
|
32
|
+
e,m-e);e=f;f="";g=b._stringDecoder;for(var r=0;r<k.length;r++)f+=g.decode(k[r],u);f="string"===typeof h?f+h:f+g.decode(h);switch(e){case 73:la(b,l,f);break;case 72:l=f[0];f=f.slice(1);f=JSON.parse(f,b._fromJSON);h=void 0;if(g=C.current)switch("string"===typeof f?e=f:(e=f[0],h=f[1]),l){case "D":g.prefetchDNS(e,h);break;case "C":g.preconnect(e,h);break;case "L":g.preload(e,h);break;case "I":g.preinit(e,h)}break;case 69:f=JSON.parse(f);h=f.digest;f=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");
|
33
|
+
f.stack="Error: "+f.message;f.digest=h;h=b._chunks;(e=h.get(l))?T(e,f):h.set(l,new O("rejected",null,f,b));break;case 84:b._chunks.set(l,new O("fulfilled",f,null,b));break;default:h=b._chunks,(e=h.get(l))?(l=e,"pending"===l.status&&(h=l.value,e=l.reason,l.status="resolved_model",l.value=f,null!==h&&(P(l),S(l,h,e)))):h.set(l,new O("resolved_model",f,null,b))}h=l=f=g=0;k.length=0;e=m+1}else{d=new Uint8Array(d.buffer,d.byteOffset+e,d.byteLength-e);k.push(d);h-=d.byteLength;break}}b._rowState=g;b._rowID=
|
34
|
+
l;b._rowTag=f;b._rowLength=h});a.on("error",function(d){X(b,d)});a.on("end",function(){X(b,Error("Connection closed."))});return Y(b,0)};exports.createServerReference=function(){return Z};
|