react-server-dom-webpack 18.3.0-next-9fb2469a6-20230308 → 18.3.0-next-3706edb81-20230308

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 (23) hide show
  1. package/cjs/react-server-dom-webpack-client.browser.development.js +4 -0
  2. package/cjs/react-server-dom-webpack-client.browser.production.min.js +2 -1
  3. package/cjs/react-server-dom-webpack-client.edge.development.js +4 -0
  4. package/cjs/react-server-dom-webpack-client.edge.production.min.js +2 -1
  5. package/cjs/react-server-dom-webpack-client.node.development.js +4 -0
  6. package/cjs/react-server-dom-webpack-client.node.production.min.js +2 -1
  7. package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +4 -0
  8. package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +1 -1
  9. package/cjs/react-server-dom-webpack-node-register.js +3 -3
  10. package/cjs/react-server-dom-webpack-server.browser.development.js +12 -6
  11. package/cjs/react-server-dom-webpack-server.browser.production.min.js +4 -4
  12. package/cjs/react-server-dom-webpack-server.edge.development.js +13 -7
  13. package/cjs/react-server-dom-webpack-server.edge.production.min.js +9 -8
  14. package/cjs/react-server-dom-webpack-server.node.development.js +12 -6
  15. package/cjs/react-server-dom-webpack-server.node.production.min.js +5 -5
  16. package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +12 -6
  17. package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +5 -5
  18. package/esm/react-server-dom-webpack-node-loader.production.min.js +1 -1
  19. package/package.json +3 -3
  20. package/umd/react-server-dom-webpack-client.browser.development.js +4 -0
  21. package/umd/react-server-dom-webpack-client.browser.production.min.js +2 -2
  22. package/umd/react-server-dom-webpack-server.browser.development.js +12 -6
  23. package/umd/react-server-dom-webpack-server.browser.production.min.js +1 -1
@@ -547,6 +547,10 @@ function createServerReferenceProxy(response, metaData) {
547
547
  var args = Array.prototype.slice.call(arguments);
548
548
  var p = metaData.bound;
549
549
 
550
+ if (!p) {
551
+ return callServer(metaData.id, args);
552
+ }
553
+
550
554
  if (p.status === INITIALIZED) {
551
555
  var bound = p.value;
552
556
  return callServer(metaData.id, bound.concat(args));
@@ -15,7 +15,8 @@ function C(a){switch(a.status){case "resolved_model":z(a);break;case "resolved_m
15
15
  function F(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&D(c,b)}}function G(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&&(A(a),E(a,c,d))}}var H=null,I=null;
16
16
  function z(a){var b=H,c=I;H=a;I=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==I&&0<I.deps?(I.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{H=b,I=c}}
17
17
  function A(a){try{var b=a.value;if(b.async){var c=q.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;}else d=__webpack_require__(b.id);var e="*"===b.name?d:""===b.name?d.__esModule?d.default:d:d[b.name];a.status="fulfilled";a.value=e}catch(f){a.status="rejected",a.reason=f}}function J(a,b){a._chunks.forEach(function(c){"pending"===c.status&&F(c,b)})}function K(a,b){var c=a._chunks,d=c.get(b);d||(d=new y("pending",null,null,a),c.set(b,d));return d}
18
- function L(a,b,c){if(I){var d=I;d.deps++}else d=I={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&&D(e,d.value))}}function M(a){return function(b){return F(a,b)}}function N(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=b.bound;return"fulfilled"===e.status?c(b.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return c(b.id,f.concat(d))})}}
18
+ function L(a,b,c){if(I){var d=I;d.deps++}else d=I={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&&D(e,d.value))}}function M(a){return function(b){return F(a,b)}}
19
+ function N(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=b.bound;return e?"fulfilled"===e.status?c(b.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return c(b.id,f.concat(d))}):c(b.id,d)}}
19
20
  function O(a,b,c,d){if("$"===d[0]){if("$"===d)return u;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),a=K(a,b),{$$typeof:v,_payload:a,_init:C};case "@":return b=parseInt(d.substring(2),16),K(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),x[a]||(x[a]=l.createServerContext(a,w)),x[a].Provider;case "F":b=parseInt(d.substring(2),16);b=K(a,b);switch(b.status){case "resolved_model":z(b)}switch(b.status){case "fulfilled":return N(a,
20
21
  b.value);default:throw b.reason;}default:d=parseInt(d.substring(1),16);a=K(a,d);switch(a.status){case "resolved_model":z(a);break;case "resolved_module":A(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=H,a.then(L(d,b,c),M(d)),null;default:throw a.reason;}}}return d}function P(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
21
22
  function Q(a,b,c){var d=a._chunks,e=d.get(b);c=JSON.parse(c,a._fromJSON);var f=n(a._bundlerConfig,c);if(c=t(f)){if(e){var h=e;h.status="blocked"}else h=new y("blocked",null,null,a),d.set(b,h);c.then(function(){return G(h,f)},function(g){return F(h,g)})}else e?G(e,f):d.set(b,new y("resolved_module",f,null,a))}function R(a){J(a,Error("Connection closed."))}
@@ -547,6 +547,10 @@ function createServerReferenceProxy(response, metaData) {
547
547
  var args = Array.prototype.slice.call(arguments);
548
548
  var p = metaData.bound;
549
549
 
550
+ if (!p) {
551
+ return callServer(metaData.id, args);
552
+ }
553
+
550
554
  if (p.status === INITIALIZED) {
551
555
  var bound = p.value;
552
556
  return callServer(metaData.id, bound.concat(args));
@@ -15,7 +15,8 @@ function F(a){switch(a.status){case "resolved_model":D(a);break;case "resolved_m
15
15
  function I(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&G(c,b)}}function J(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&&(E(a),H(a,c,d))}}var K=null,L=null;
16
16
  function D(a){var b=K,c=L;K=a;L=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==L&&0<L.deps?(L.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(f){a.status="rejected",a.reason=f}finally{K=b,L=c}}
17
17
  function E(a){try{var b=a.value;if(b.async){var c=u.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;}else d=__webpack_require__(b.id);var f="*"===b.name?d:""===b.name?d.__esModule?d.default:d:d[b.name];a.status="fulfilled";a.value=f}catch(e){a.status="rejected",a.reason=e}}function M(a,b){a._chunks.forEach(function(c){"pending"===c.status&&I(c,b)})}function N(a,b){var c=a._chunks,d=c.get(b);d||(d=new C("pending",null,null,a),c.set(b,d));return d}
18
- function O(a,b,c){if(L){var d=L;d.deps++}else d=L={deps:1,value:null};return function(f){b[c]=f;d.deps--;0===d.deps&&"blocked"===a.status&&(f=a.value,a.status="fulfilled",a.value=d.value,null!==f&&G(f,d.value))}}function P(a){return function(b){return I(a,b)}}function Q(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),f=b.bound;return"fulfilled"===f.status?c(b.id,f.value.concat(d)):Promise.resolve(f).then(function(e){return c(b.id,e.concat(d))})}}
18
+ function O(a,b,c){if(L){var d=L;d.deps++}else d=L={deps:1,value:null};return function(f){b[c]=f;d.deps--;0===d.deps&&"blocked"===a.status&&(f=a.value,a.status="fulfilled",a.value=d.value,null!==f&&G(f,d.value))}}function P(a){return function(b){return I(a,b)}}
19
+ function Q(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),f=b.bound;return f?"fulfilled"===f.status?c(b.id,f.value.concat(d)):Promise.resolve(f).then(function(e){return c(b.id,e.concat(d))}):c(b.id,d)}}
19
20
  function R(a,b,c,d){if("$"===d[0]){if("$"===d)return x;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),a=N(a,b),{$$typeof:y,_payload:a,_init:F};case "@":return b=parseInt(d.substring(2),16),N(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),B[a]||(B[a]=p.createServerContext(a,A)),B[a].Provider;case "F":b=parseInt(d.substring(2),16);b=N(a,b);switch(b.status){case "resolved_model":D(b)}switch(b.status){case "fulfilled":return Q(a,
20
21
  b.value);default:throw b.reason;}default:d=parseInt(d.substring(1),16);a=N(a,d);switch(a.status){case "resolved_model":D(a);break;case "resolved_module":E(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=K,a.then(O(d,b,c),P(d)),null;default:throw a.reason;}}}return d}function S(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
21
22
  function T(a,b,c){var d=a._chunks,f=d.get(b);c=JSON.parse(c,a._fromJSON);var e=r(a._bundlerConfig,c);if(c=w(e)){if(f){var m=f;m.status="blocked"}else m=new C("blocked",null,null,a),d.set(b,m);c.then(function(){return J(m,e)},function(l){return I(m,l)})}else f?J(f,e):d.set(b,new C("resolved_module",e,null,a))}function U(a){return function(b,c){return"string"===typeof c?R(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===x?{$$typeof:x,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:c,b):c}}
@@ -548,6 +548,10 @@ function createServerReferenceProxy(response, metaData) {
548
548
  var args = Array.prototype.slice.call(arguments);
549
549
  var p = metaData.bound;
550
550
 
551
+ if (!p) {
552
+ return callServer(metaData.id, args);
553
+ }
554
+
551
555
  if (p.status === INITIALIZED) {
552
556
  var bound = p.value;
553
557
  return callServer(metaData.id, bound.concat(args));
@@ -15,7 +15,8 @@ function C(a){switch(a.status){case "resolved_model":A(a);break;case "resolved_m
15
15
  function F(a,c){if("pending"===a.status||"blocked"===a.status){var b=a.reason;a.status="rejected";a.reason=c;null!==b&&D(b,c)}}function G(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&&(B(a),E(a,b,d))}}var H=null,I=null;
16
16
  function A(a){var c=H,b=I;H=a;I=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==I&&0<I.deps?(I.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{H=c,I=b}}
17
17
  function B(a){try{var c=a.value;if(c.async){var b=q.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(f){a.status="rejected",a.reason=f}}function J(a,c){a._chunks.forEach(function(b){"pending"===b.status&&F(b,c)})}function K(a,c){var b=a._chunks,d=b.get(c);d||(d=new z("pending",null,null,a),b.set(c,d));return d}
18
- function L(a,c,b){if(I){var d=I;d.deps++}else d=I={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&&D(e,d.value))}}function M(a){return function(c){return F(a,c)}}function N(a,c){var b=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=c.bound;return"fulfilled"===e.status?b(c.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return b(c.id,f.concat(d))})}}
18
+ function L(a,c,b){if(I){var d=I;d.deps++}else d=I={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&&D(e,d.value))}}function M(a){return function(c){return F(a,c)}}
19
+ function N(a,c){var b=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=c.bound;return e?"fulfilled"===e.status?b(c.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return b(c.id,f.concat(d))}):b(c.id,d)}}
19
20
  function O(a,c,b,d){if("$"===d[0]){if("$"===d)return u;switch(d[1]){case "$":return d.substring(1);case "L":return c=parseInt(d.substring(2),16),a=K(a,c),{$$typeof:v,_payload:a,_init:C};case "@":return c=parseInt(d.substring(2),16),K(a,c);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),y[a]||(y[a]=l.createServerContext(a,x)),y[a].Provider;case "F":c=parseInt(d.substring(2),16);c=K(a,c);switch(c.status){case "resolved_model":A(c)}switch(c.status){case "fulfilled":return N(a,
20
21
  c.value);default:throw c.reason;}default:d=parseInt(d.substring(1),16);a=K(a,d);switch(a.status){case "resolved_model":A(a);break;case "resolved_module":B(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=H,a.then(L(d,c,b),M(d)),null;default:throw a.reason;}}}return d}function P(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
21
22
  function Q(a,c,b){var d=a._chunks,e=d.get(c);b=JSON.parse(b,a._fromJSON);var f=n(a._bundlerConfig,b);if(b=t(f)){if(e){var h=e;h.status="blocked"}else h=new z("blocked",null,null,a),d.set(c,h);b.then(function(){return G(h,f)},function(g){return F(h,g)})}else e?G(e,f):d.set(c,new z("resolved_module",f,null,a))}
@@ -489,6 +489,10 @@ function createServerReferenceProxy(response, metaData) {
489
489
  var args = Array.prototype.slice.call(arguments);
490
490
  var p = metaData.bound;
491
491
 
492
+ if (!p) {
493
+ return callServer(metaData.id, args);
494
+ }
495
+
492
496
  if (p.status === INITIALIZED) {
493
497
  var bound = p.value;
494
498
  return callServer(metaData.id, bound.concat(args));
@@ -13,7 +13,7 @@ function y(a){switch(a.status){case "resolved_model":w(a);break;case "resolved_m
13
13
  function B(a,c){if("pending"===a.status||"blocked"===a.status){var b=a.reason;a.status="rejected";a.reason=c;null!==b&&z(b,c)}}function C(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&&(x(a),A(a,b,d))}}var D=null,E=null;
14
14
  function w(a){var c=D,b=E;D=a;E=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==E&&0<E.deps?(E.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{D=c,E=b}}function x(a){try{var c=a.value,b=m.get(c.specifier);if("fulfilled"===b.status)var d=b.value;else throw b.reason;var e="*"===c.name?d:""===c.name?d.default:d[c.name];a.status="fulfilled";a.value=e}catch(f){a.status="rejected",a.reason=f}}
15
15
  function F(a,c){a._chunks.forEach(function(b){"pending"===b.status&&B(b,c)})}function G(a,c){var b=a._chunks,d=b.get(c);d||(d=new v("pending",null,null,a),b.set(c,d));return d}function H(a,c,b){if(E){var d=E;d.deps++}else d=E={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&&z(e,d.value))}}function I(a){return function(c){return B(a,c)}}
16
- function J(a,c){var b=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=c.bound;return"fulfilled"===e.status?b(c.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return b(c.id,f.concat(d))})}}
16
+ function J(a,c){var b=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=c.bound;return e?"fulfilled"===e.status?b(c.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return b(c.id,f.concat(d))}):b(c.id,d)}}
17
17
  function K(a,c,b,d){if("$"===d[0]){if("$"===d)return q;switch(d[1]){case "$":return d.substring(1);case "L":return c=parseInt(d.substring(2),16),a=G(a,c),{$$typeof:r,_payload:a,_init:y};case "@":return c=parseInt(d.substring(2),16),G(a,c);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),u[a]||(u[a]=h.createServerContext(a,t)),u[a].Provider;case "F":c=parseInt(d.substring(2),16);c=G(a,c);switch(c.status){case "resolved_model":w(c)}switch(c.status){case "fulfilled":return J(a,
18
18
  c.value);default:throw c.reason;}default:d=parseInt(d.substring(1),16);a=G(a,d);switch(a.status){case "resolved_model":w(a);break;case "resolved_module":x(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=D,a.then(H(d,c,b),I(d)),null;default:throw a.reason;}}}return d}function L(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
19
19
  function M(a,c,b){var d=a._chunks,e=d.get(c);b=JSON.parse(b,a._fromJSON);var f=a._bundlerConfig[b.id][b.name];if(b=p(f)){if(e){var k=e;k.status="blocked"}else k=new v("blocked",null,null,a),d.set(c,k);b.then(function(){return C(k,f)},function(n){return B(k,n)})}else e?C(e,f):d.set(c,new v("resolved_module",f,null,a))}
@@ -11,10 +11,10 @@
11
11
  'use strict';
12
12
 
13
13
  'use strict';const n=require("acorn"),p=require("url"),r=require("module");
14
- module.exports=function(){const h=Symbol.for("react.client.reference"),k=Symbol.for("react.server.reference"),t=Promise.prototype,u=Function.prototype.bind;Function.prototype.bind=function(a){const c=u.apply(this,arguments);if(this.$$typeof===k){const b=Array.prototype.slice.call(arguments,1);c.$$typeof=k;c.$$id=this.$$id;c.$$bound=this.$$bound.concat(b)}return c};const v={get:function(a,c){switch(c){case "$$typeof":return a.$$typeof;case "$$id":return a.$$id;case "$$async":return a.$$async;case "name":return a.name;
15
- 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(c))+" on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.");
14
+ module.exports=function(){const h=Symbol.for("react.client.reference"),k=Symbol.for("react.server.reference"),t=Promise.prototype,u=Function.prototype.bind;Function.prototype.bind=function(a){const c=u.apply(this,arguments);if(this.$$typeof===k){const b=Array.prototype.slice.call(arguments,1);c.$$typeof=k;c.$$id=this.$$id;c.$$bound=this.$$bound?this.$$bound.concat(b):b}return c};const v={get:function(a,c){switch(c){case "$$typeof":return a.$$typeof;case "$$id":return a.$$id;case "$$async":return a.$$async;
15
+ 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(c))+" on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.");
16
16
  },set:function(){throw Error("Cannot assign to a client module from a server module.");}},q={get:function(a,c){switch(c){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":const d=a.$$id;a.default=Object.defineProperties(function(){throw Error("Attempted to call the default export of "+d+" 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.");
17
17
  },{$$typeof:{value:h},$$id:{value:a.$$id+"#"},$$async:{value:a.$$async}});return!0;case "then":if(a.then)return a.then;if(a.$$async)return;var b=Object.defineProperties({},{$$typeof:{value:h},$$id:{value:a.$$id},$$async:{value:!0}});const e=new Proxy(b,q);a.status="fulfilled";a.value=e;return a.then=Object.defineProperties(function(f){return Promise.resolve(f(e))},{$$typeof:{value:h},$$id:{value:a.$$id+"#then"},$$async:{value:!1}})}b=a[c];b||(b=Object.defineProperties(function(){throw Error("Attempted to call "+
18
18
  String(c)+"() from the server but "+String(c)+" 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.");},{name:{value:c},$$typeof:{value:h},$$id:{value:a.$$id+"#"+c},$$async:{value:a.$$async}}),b=a[c]=new Proxy(b,v));return b},getPrototypeOf(){return t},set:function(){throw Error("Cannot assign to a client module from a server module.");}},l=r.prototype._compile;r.prototype._compile=function(a,
19
19
  c){if(-1===a.indexOf("use client")&&-1===a.indexOf("use server"))return l.apply(this,arguments);try{var b=n.parse(a,{ecmaVersion:"2024",sourceType:"source"}).body}catch(m){return console.error("Error parsing %s %s",p,m.message),l.apply(this,arguments)}var d=!1,e=!1;for(var f=0;f<b.length;f++){var g=b[f];if("ExpressionStatement"!==g.type||!g.directive)break;"use client"===g.directive&&(d=!0);"use server"===g.directive&&(e=!0)}if(!d&&!e)return l.apply(this,arguments);if(d&&e)throw Error('Cannot have both "use client" and "use server" directives in the same file.');
20
- d&&(b=p.pathToFileURL(c).href,b=Object.defineProperties({},{$$typeof:{value:h},$$id:{value:b},$$async:{value:!1}}),this.exports=new Proxy(b,q));if(e)if(l.apply(this,arguments),e=p.pathToFileURL(c).href,b=this.exports,"function"===typeof b)Object.defineProperties(b,{$$typeof:{value:k},$$id:{value:e},$$bound:{value:[]}});else for(d=Object.keys(b),f=0;f<d.length;f++){g=d[f];const m=b[d[f]];"function"===typeof m&&Object.defineProperties(m,{$$typeof:{value:k},$$id:{value:e+"#"+g},$$bound:{value:[]}})}}};
20
+ d&&(b=p.pathToFileURL(c).href,b=Object.defineProperties({},{$$typeof:{value:h},$$id:{value:b},$$async:{value:!1}}),this.exports=new Proxy(b,q));if(e)if(l.apply(this,arguments),e=p.pathToFileURL(c).href,b=this.exports,"function"===typeof b)Object.defineProperties(b,{$$typeof:{value:k},$$id:{value:e},$$bound:{value:null}});else for(d=Object.keys(b),f=0;f<d.length;f++){g=d[f];const m=b[d[f]];"function"===typeof m&&Object.defineProperties(m,{$$typeof:{value:k},$$id:{value:e+"#"+g},$$bound:{value:null}})}}};
@@ -228,11 +228,11 @@ function resolveClientReferenceMetadata(config, clientReference) {
228
228
  return resolvedModuleData;
229
229
  }
230
230
  }
231
- function resolveServerReferenceMetadata(config, serverReference) {
232
- return {
233
- id: serverReference.$$id,
234
- bound: Promise.resolve(serverReference.$$bound)
235
- };
231
+ function getServerReferenceId(config, serverReference) {
232
+ return serverReference.$$id;
233
+ }
234
+ function getServerReferenceBoundArguments(config, serverReference) {
235
+ return serverReference.$$bound;
236
236
  }
237
237
 
238
238
  // ATTENTION
@@ -1167,6 +1167,8 @@ function getOrCreateServerContext(globalName) {
1167
1167
  return ContextRegistry[globalName];
1168
1168
  }
1169
1169
 
1170
+ // Thenable<ReactClientValue>
1171
+
1170
1172
  var PENDING = 0;
1171
1173
  var COMPLETED = 1;
1172
1174
  var ABORTED = 3;
@@ -1592,7 +1594,11 @@ function serializeServerReference(request, parent, key, serverReference) {
1592
1594
  return serializeServerReferenceID(existingId);
1593
1595
  }
1594
1596
 
1595
- var serverReferenceMetadata = resolveServerReferenceMetadata(request.bundlerConfig, serverReference);
1597
+ var bound = getServerReferenceBoundArguments(request.bundlerConfig, serverReference);
1598
+ var serverReferenceMetadata = {
1599
+ id: getServerReferenceId(request.bundlerConfig, serverReference),
1600
+ bound: bound ? Promise.resolve(bound) : null
1601
+ };
1596
1602
  request.pendingChunks++;
1597
1603
  var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
1598
1604
 
@@ -48,10 +48,10 @@ function Z(a,b){var c=Va(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;i
48
48
  Sa(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}
49
49
  function Ka(a,b,c,d){switch(d){case w:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===w||d.$$typeof===x);)try{switch(d.$$typeof){case w:var e=d;d=X(a,e.type,e.key,e.ref,e.props,null);break;case x:var g=d._init;d=g(d._payload)}}catch(h){c=h===I?za():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=Ma(a,d,E,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Aa(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=U(a,c);V(a,d,c);return"$L"+
50
50
  d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===u)return Ua(a,b,c,d);if("function"===typeof d.then)return"$@"+Oa(a,d).toString(16);if(d.$$typeof===ia)return d=d._context._globalName,b=a.writtenProviders,c=b.get(c),void 0===c&&(a.pendingChunks++,c=a.nextChunkId++,b.set(d,c),d=t(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===Na){a=E;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");d=a.parentValue;a.context._currentValue=
51
- d===oa?a.context._defaultValue:d;E=a.parent;return}return!D(d)&&(null===d||"object"!==typeof d?a=null:(a=qa&&d[qa]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===u)return Ua(a,b,c,d);if(d.$$typeof===da)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(e={id:d.$$id,bound:Promise.resolve(d.$$bound)},
52
- a.pendingChunks++,b=a.nextChunkId++,e=ca(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){e=a.writtenSymbols;g=e.get(d);
53
- if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=t(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+Z(b,c));throw Error("Type "+
54
- typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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 Wa(a,b){null!==a.destination?(a.status=2,ba(a.destination,b)):(a.status=1,a.fatalError=b)}
51
+ d===oa?a.context._defaultValue:d;E=a.parent;return}return!D(d)&&(null===d||"object"!==typeof d?a=null:(a=qa&&d[qa]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===u)return Ua(a,b,c,d);if(d.$$typeof===da)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,
52
+ bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ca(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){e=
53
+ a.writtenSymbols;g=e.get(d);if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=t(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
54
+ Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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 Wa(a,b){null!==a.destination?(a.status=2,ba(a.destination,b)):(a.status=1,a.fatalError=b)}
55
55
  function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+r(c)+"\n";b=p.encode(b);a.completedErrorChunks.push(b)}
56
56
  function Ta(a){var b=T.current,c=Q;T.current=Fa;Q=a.cache;K=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){H(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===w){var l=k,v=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,v);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===w;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var ea=ca(h,g.id,k);h.completedJSONChunks.push(ea);h.abortableTasks.delete(g);
57
57
  g.status=1}catch(F){var y=F===I?za():F;if("object"===typeof y&&null!==y&&"function"===typeof y.then){var M=g.ping;y.then(M,M);g.thenableState=Aa()}else{h.abortableTasks.delete(g);g.status=4;var fa=U(h,y);V(h,g.id,fa)}}}}null!==a.destination&&W(a,a.destination)}catch(F){U(a,F),Wa(a,F)}finally{T.current=b,Q=c,K=null}}
@@ -56,7 +56,7 @@ function printWarning(level, format, args) {
56
56
  }
57
57
 
58
58
  function scheduleWork(callback) {
59
- callback();
59
+ setTimeout(callback, 0);
60
60
  }
61
61
 
62
62
  var supportsRequestStorage = typeof AsyncLocalStorage === 'function';
@@ -231,11 +231,11 @@ function resolveClientReferenceMetadata(config, clientReference) {
231
231
  return resolvedModuleData;
232
232
  }
233
233
  }
234
- function resolveServerReferenceMetadata(config, serverReference) {
235
- return {
236
- id: serverReference.$$id,
237
- bound: Promise.resolve(serverReference.$$bound)
238
- };
234
+ function getServerReferenceId(config, serverReference) {
235
+ return serverReference.$$id;
236
+ }
237
+ function getServerReferenceBoundArguments(config, serverReference) {
238
+ return serverReference.$$bound;
239
239
  }
240
240
 
241
241
  // ATTENTION
@@ -1175,6 +1175,8 @@ function getOrCreateServerContext(globalName) {
1175
1175
  return ContextRegistry[globalName];
1176
1176
  }
1177
1177
 
1178
+ // Thenable<ReactClientValue>
1179
+
1178
1180
  var PENDING = 0;
1179
1181
  var COMPLETED = 1;
1180
1182
  var ABORTED = 3;
@@ -1600,7 +1602,11 @@ function serializeServerReference(request, parent, key, serverReference) {
1600
1602
  return serializeServerReferenceID(existingId);
1601
1603
  }
1602
1604
 
1603
- var serverReferenceMetadata = resolveServerReferenceMetadata(request.bundlerConfig, serverReference);
1605
+ var bound = getServerReferenceBoundArguments(request.bundlerConfig, serverReference);
1606
+ var serverReferenceMetadata = {
1607
+ id: getServerReferenceId(request.bundlerConfig, serverReference),
1608
+ bound: bound ? Promise.resolve(bound) : null
1609
+ };
1604
1610
  request.pendingChunks++;
1605
1611
  var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
1606
1612
 
@@ -40,7 +40,8 @@ function Ma(a,b,c,d,e){if(null!==Ka.current&&Ka.current!==Ia)throw Error("Curren
40
40
  function Ra(a,b){a.pendingChunks++;var c=Pa(a,null,G,a.abortableTasks);switch(b.status){case "fulfilled":return c.model=b.value,Sa(a,c),c.id;case "rejected":var d=U(a,b.reason);V(a,c.id,d);return c.id;default:"string"!==typeof b.status&&(b.status="pending",b.then(function(e){"pending"===b.status&&(b.status="fulfilled",b.value=e)},function(e){"pending"===b.status&&(b.status="rejected",b.reason=e)}))}b.then(function(e){c.model=e;Sa(a,c)},function(e){c.status=4;e=U(a,e);V(a,c.id,e);null!==a.destination&&
41
41
  W(a,a.destination)});return c.id}function Ta(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}function Ua(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:z,_payload:a,_init:Ta}}
42
42
  function X(a,b,c,d,e,g){if(null!==d&&void 0!==d)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof b){if(b.$$typeof===w)return[y,b,c,e];N=0;O=g;e=b(e);return"object"===typeof e&&null!==e&&"function"===typeof e.then?"fulfilled"===e.status?e.value:Ua(e):e}if("string"===typeof b)return[y,b,c,e];if("symbol"===typeof b)return b===fa?e.children:[y,b,c,e];if(null!=b&&"object"===typeof b){if(b.$$typeof===w)return[y,b,c,e];switch(b.$$typeof){case z:var h=
43
- b._init;b=h(b._payload);return X(a,b,c,d,e,g);case la:return a=b.render,N=0,O=g,a(e,void 0);case oa:return X(a,b.type,c,d,e,g);case ja:return xa(b._context,e.value),[y,b,c,{value:e.value,children:e.children,__pop:Qa}]}}throw Error("Unsupported Server Component type: "+Va(b));}function Sa(a,b){var c=a.pingedTasks;c.push(b);1===c.length&&Wa(a)}function Pa(a,b,c,d){var e={id:a.nextChunkId++,status:0,model:b,context:c,ping:function(){return Sa(a,e)},thenableState:null};d.add(e);return e}
43
+ b._init;b=h(b._payload);return X(a,b,c,d,e,g);case la:return a=b.render,N=0,O=g,a(e,void 0);case oa:return X(a,b.type,c,d,e,g);case ja:return xa(b._context,e.value),[y,b,c,{value:e.value,children:e.children,__pop:Qa}]}}throw Error("Unsupported Server Component type: "+Va(b));}function Sa(a,b){var c=a.pingedTasks;c.push(b);1===c.length&&setTimeout(function(){return Wa(a)},0)}
44
+ function Pa(a,b,c,d){var e={id:a.nextChunkId++,status:0,model:b,context:c,ping:function(){return Sa(a,e)},thenableState:null};d.add(e);return e}
44
45
  function Xa(a,b,c,d){var e=d.$$async?d.$$id+"#async":d.$$id,g=a.writtenClientReferences,h=g.get(e);if(void 0!==h)return b[0]===y&&"1"===c?"$L"+h.toString(16):"$"+h.toString(16);try{var k=a.bundlerConfig[d.$$id];var l=d.$$async?{id:k.id,chunks:k.chunks,name:k.name,async:!0}:k;a.pendingChunks++;var v=a.nextChunkId++,ha=t(l),x=v.toString(16)+":I"+ha+"\n";var M=q.encode(x);a.completedImportChunks.push(M);g.set(e,v);return b[0]===y&&"1"===c?"$L"+v.toString(16):"$"+v.toString(16)}catch(ia){return a.pendingChunks++,
45
46
  b=a.nextChunkId++,c=U(a,ia),V(a,b,c),"$"+b.toString(16)}}function Ya(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.substr(0,10)+"...");case "object":if(E(a))return"[...]";a=Ya(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
46
47
  function Y(a){if("string"===typeof a)return a;switch(a){case ma:return"Suspense";case na:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case la:return Y(a.render);case oa:return Y(a.type);case z:var b=a._payload;a=a._init;try{return Y(a(b))}catch(c){}}return""}
@@ -48,15 +49,15 @@ function Z(a,b){var c=Ya(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;i
48
49
  Va(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}
49
50
  function Na(a,b,c,d){switch(d){case y:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===y||d.$$typeof===z);)try{switch(d.$$typeof){case y:var e=d;d=X(a,e.type,e.key,e.ref,e.props,null);break;case z:var g=d._init;d=g(d._payload)}}catch(h){c=h===J?Aa():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=Pa(a,d,G,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Ba(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=U(a,c);V(a,d,c);return"$L"+
50
51
  d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===w)return Xa(a,b,c,d);if("function"===typeof d.then)return"$@"+Ra(a,d).toString(16);if(d.$$typeof===ja)return d=d._context._globalName,b=a.writtenProviders,c=b.get(c),void 0===c&&(a.pendingChunks++,c=a.nextChunkId++,b.set(d,c),d=u(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===Qa){a=G;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");d=a.parentValue;a.context._currentValue=
51
- d===pa?a.context._defaultValue:d;G=a.parent;return}return!E(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===w)return Xa(a,b,c,d);if(d.$$typeof===ea)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(e={id:d.$$id,bound:Promise.resolve(d.$$bound)},
52
- a.pendingChunks++,b=a.nextChunkId++,e=da(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){e=a.writtenSymbols;g=e.get(d);
53
- if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=u(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+Z(b,c));throw Error("Type "+
54
- typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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 Za(a,b){null!==a.destination?(a.status=2,ca(a.destination,b)):(a.status=1,a.fatalError=b)}
52
+ d===pa?a.context._defaultValue:d;G=a.parent;return}return!E(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===w)return Xa(a,b,c,d);if(d.$$typeof===ea)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,
53
+ bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=da(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){e=
54
+ a.writtenSymbols;g=e.get(d);if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=u(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
55
+ Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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 Za(a,b){null!==a.destination?(a.status=2,ca(a.destination,b)):(a.status=1,a.fatalError=b)}
55
56
  function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+t(c)+"\n";b=q.encode(b);a.completedErrorChunks.push(b)}
56
57
  function Wa(a){var b=Ja.current,c=R;Ja.current=Ga;R=a.cache;L=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){I(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===y){var l=k,v=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,v);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===y;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var ha=da(h,g.id,k);h.completedJSONChunks.push(ha);h.abortableTasks.delete(g);
57
58
  g.status=1}catch(F){var x=F===J?Aa():F;if("object"===typeof x&&null!==x&&"function"===typeof x.then){var M=g.ping;x.then(M,M);g.thenableState=Ba()}else{h.abortableTasks.delete(g);g.status=4;var ia=U(h,x);V(h,g.id,ia)}}}}null!==a.destination&&W(a,a.destination)}catch(F){U(a,F),Za(a,F)}finally{Ja.current=b,R=c,L=null}}
58
59
  function W(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.completedJSONChunks;for(d=0;d<e.length;d++)a.pendingChunks--,p(b,e[d]);e.splice(0,d);var g=a.completedErrorChunks;for(d=0;d<g.length;d++)a.pendingChunks--,p(b,g[d]);g.splice(0,d)}finally{m&&0<n&&(b.enqueue(new Uint8Array(m.buffer,0,n)),m=null,n=0)}0===a.pendingChunks&&b.close()}
59
- function $a(a,b){try{var c=a.abortableTasks;if(0<c.size){var d=U(a,void 0===b?Error("The render was aborted by the server without a reason."):b);a.pendingChunks++;var e=a.nextChunkId++;V(a,e,d);c.forEach(function(g){g.status=3;var h="$"+e.toString(16);g=u(a,g.id,h);a.completedErrorChunks.push(g)});c.clear()}null!==a.destination&&W(a,a.destination)}catch(g){U(a,g),Za(a,g)}}
60
+ function $a(a){f?setTimeout(function(){return ba.run(a.cache,Wa,a)},0):setTimeout(function(){return Wa(a)},0)}function ab(a,b){try{var c=a.abortableTasks;if(0<c.size){var d=U(a,void 0===b?Error("The render was aborted by the server without a reason."):b);a.pendingChunks++;var e=a.nextChunkId++;V(a,e,d);c.forEach(function(g){g.status=3;var h="$"+e.toString(16);g=u(a,g.id,h);a.completedErrorChunks.push(g)});c.clear()}null!==a.destination&&W(a,a.destination)}catch(g){U(a,g),Za(a,g)}}
60
61
  function Oa(a){if(a){var b=G;I(null);for(var c=0;c<a.length;c++){var d=a[c],e=d[0];d=d[1];T[e]||(T[e]=aa.createServerContext(e,pa));xa(T[e],d)}a=G;I(b);return a}return null}
61
- exports.renderToReadableStream=function(a,b,c){var d=Ma(a,b,c?c.onError:void 0,c?c.context:void 0,c?c.identifierPrefix:void 0);if(c&&c.signal){var e=c.signal;if(e.aborted)$a(d,e.reason);else{var g=function(){$a(d,e.reason);e.removeEventListener("abort",g)};e.addEventListener("abort",g)}}return new ReadableStream({type:"bytes",start:function(){f?ba.run(d.cache,Wa,d):Wa(d)},pull:function(h){if(1===d.status)d.status=2,ca(h,d.fatalError);else if(2!==d.status&&null===d.destination){d.destination=h;try{W(d,
62
- h)}catch(k){U(d,k),Za(d,k)}}},cancel:function(){}},{highWaterMark:0})};
62
+ exports.renderToReadableStream=function(a,b,c){var d=Ma(a,b,c?c.onError:void 0,c?c.context:void 0,c?c.identifierPrefix:void 0);if(c&&c.signal){var e=c.signal;if(e.aborted)ab(d,e.reason);else{var g=function(){ab(d,e.reason);e.removeEventListener("abort",g)};e.addEventListener("abort",g)}}return new ReadableStream({type:"bytes",start:function(){$a(d)},pull:function(h){if(1===d.status)d.status=2,ca(h,d.fatalError);else if(2!==d.status&&null===d.destination){d.destination=h;try{W(d,h)}catch(k){U(d,k),
63
+ Za(d,k)}}},cancel:function(){}},{highWaterMark:0})};
@@ -297,11 +297,11 @@ function resolveClientReferenceMetadata(config, clientReference) {
297
297
  return resolvedModuleData;
298
298
  }
299
299
  }
300
- function resolveServerReferenceMetadata(config, serverReference) {
301
- return {
302
- id: serverReference.$$id,
303
- bound: Promise.resolve(serverReference.$$bound)
304
- };
300
+ function getServerReferenceId(config, serverReference) {
301
+ return serverReference.$$id;
302
+ }
303
+ function getServerReferenceBoundArguments(config, serverReference) {
304
+ return serverReference.$$bound;
305
305
  }
306
306
 
307
307
  // ATTENTION
@@ -1241,6 +1241,8 @@ function getOrCreateServerContext(globalName) {
1241
1241
  return ContextRegistry[globalName];
1242
1242
  }
1243
1243
 
1244
+ // Thenable<ReactClientValue>
1245
+
1244
1246
  var PENDING = 0;
1245
1247
  var COMPLETED = 1;
1246
1248
  var ABORTED = 3;
@@ -1666,7 +1668,11 @@ function serializeServerReference(request, parent, key, serverReference) {
1666
1668
  return serializeServerReferenceID(existingId);
1667
1669
  }
1668
1670
 
1669
- var serverReferenceMetadata = resolveServerReferenceMetadata(request.bundlerConfig, serverReference);
1671
+ var bound = getServerReferenceBoundArguments(request.bundlerConfig, serverReference);
1672
+ var serverReferenceMetadata = {
1673
+ id: getServerReferenceId(request.bundlerConfig, serverReference),
1674
+ bound: bound ? Promise.resolve(bound) : null
1675
+ };
1670
1676
  request.pendingChunks++;
1671
1677
  var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
1672
1678
 
@@ -50,11 +50,11 @@ function Z(a,b){var c=Za(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;i
50
50
  Wa(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}
51
51
  function Oa(a,b,c,d){switch(d){case z:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===z||d.$$typeof===A);)try{switch(d.$$typeof){case z:var e=d;d=X(a,e.type,e.key,e.ref,e.props,null);break;case A:var g=d._init;d=g(d._payload)}}catch(h){c=h===K?Aa():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=Qa(a,d,H,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Ba(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=U(a,c);V(a,d,c);return"$L"+
52
52
  d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if("function"===typeof d.then)return"$@"+Sa(a,d).toString(16);if(d.$$typeof===ja)return d=d._context._globalName,b=a.writtenProviders,c=b.get(c),void 0===c&&(a.pendingChunks++,c=a.nextChunkId++,b.set(d,c),d=v(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===Ra){a=H;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");d=a.parentValue;a.context._currentValue=
53
- d===pa?a.context._defaultValue:d;H=a.parent;return}return!F(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(e={id:d.$$id,bound:Promise.resolve(d.$$bound)},
54
- a.pendingChunks++,b=a.nextChunkId++,e=ea(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){e=a.writtenSymbols;g=e.get(d);
55
- if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=v(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+Z(b,c));throw Error("Type "+
56
- typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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 $a(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}
57
- function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+u(c)+"\n";a.completedErrorChunks.push(b)}
53
+ d===pa?a.context._defaultValue:d;H=a.parent;return}return!F(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,
54
+ bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ea(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){e=
55
+ a.writtenSymbols;g=e.get(d);if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=v(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
56
+ Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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||""}
57
+ function $a(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+u(c)+"\n";a.completedErrorChunks.push(b)}
58
58
  function Xa(a){var b=Ka.current,c=S;Ka.current=Ga;S=a.cache;M=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){J(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===z){var l=k,w=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,w);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===z;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var ha=ea(h,g.id,k);h.completedJSONChunks.push(ha);h.abortableTasks.delete(g);
59
59
  g.status=1}catch(G){var y=G===K?Aa():G;if("object"===typeof y&&null!==y&&"function"===typeof y.then){var O=g.ping;y.then(O,O);g.thenableState=Ba()}else{h.abortableTasks.delete(g);g.status=4;var bb=U(h,y);V(h,g.id,bb)}}}}null!==a.destination&&W(a,a.destination)}catch(G){U(a,G),$a(a,G)}finally{Ka.current=b,S=c,M=null}}
60
60
  function W(a,b){f=new Uint8Array(2048);m=0;n=!0;try{for(var c=a.completedImportChunks,d=0;d<c.length;d++)if(a.pendingChunks--,!q(b,c[d])){a.destination=null;d++;break}c.splice(0,d);var e=a.completedJSONChunks;for(d=0;d<e.length;d++)if(a.pendingChunks--,!q(b,e[d])){a.destination=null;d++;break}e.splice(0,d);var g=a.completedErrorChunks;for(d=0;d<g.length;d++)if(a.pendingChunks--,!q(b,g[d])){a.destination=null;d++;break}g.splice(0,d)}finally{f&&0<m&&b.write(f.subarray(0,m)),f=null,m=0,n=!0}"function"===
@@ -297,11 +297,11 @@ function resolveClientReferenceMetadata(config, clientReference) {
297
297
  return resolvedModuleData;
298
298
  }
299
299
  }
300
- function resolveServerReferenceMetadata(config, serverReference) {
301
- return {
302
- id: serverReference.$$id,
303
- bound: Promise.resolve(serverReference.$$bound)
304
- };
300
+ function getServerReferenceId(config, serverReference) {
301
+ return serverReference.$$id;
302
+ }
303
+ function getServerReferenceBoundArguments(config, serverReference) {
304
+ return serverReference.$$bound;
305
305
  }
306
306
 
307
307
  // ATTENTION
@@ -1241,6 +1241,8 @@ function getOrCreateServerContext(globalName) {
1241
1241
  return ContextRegistry[globalName];
1242
1242
  }
1243
1243
 
1244
+ // Thenable<ReactClientValue>
1245
+
1244
1246
  var PENDING = 0;
1245
1247
  var COMPLETED = 1;
1246
1248
  var ABORTED = 3;
@@ -1666,7 +1668,11 @@ function serializeServerReference(request, parent, key, serverReference) {
1666
1668
  return serializeServerReferenceID(existingId);
1667
1669
  }
1668
1670
 
1669
- var serverReferenceMetadata = resolveServerReferenceMetadata(request.bundlerConfig, serverReference);
1671
+ var bound = getServerReferenceBoundArguments(request.bundlerConfig, serverReference);
1672
+ var serverReferenceMetadata = {
1673
+ id: getServerReferenceId(request.bundlerConfig, serverReference),
1674
+ bound: bound ? Promise.resolve(bound) : null
1675
+ };
1670
1676
  request.pendingChunks++;
1671
1677
  var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
1672
1678
 
@@ -50,11 +50,11 @@ function Z(a,b){var c=Za(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;i
50
50
  Wa(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}
51
51
  function Oa(a,b,c,d){switch(d){case z:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===z||d.$$typeof===A);)try{switch(d.$$typeof){case z:var e=d;d=X(a,e.type,e.key,e.ref,e.props,null);break;case A:var g=d._init;d=g(d._payload)}}catch(h){c=h===K?Aa():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=Qa(a,d,H,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Ba(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=U(a,c);V(a,d,c);return"$L"+
52
52
  d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if("function"===typeof d.then)return"$@"+Sa(a,d).toString(16);if(d.$$typeof===ja)return d=d._context._globalName,b=a.writtenProviders,c=b.get(c),void 0===c&&(a.pendingChunks++,c=a.nextChunkId++,b.set(d,c),d=v(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===Ra){a=H;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");d=a.parentValue;a.context._currentValue=
53
- d===pa?a.context._defaultValue:d;H=a.parent;return}return!F(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(e={id:d.$$id,bound:Promise.resolve(d.$$bound)},
54
- a.pendingChunks++,b=a.nextChunkId++,e=ea(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){e=a.writtenSymbols;g=e.get(d);
55
- if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=v(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+Z(b,c));throw Error("Type "+
56
- typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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 $a(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}
57
- function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+u(c)+"\n";a.completedErrorChunks.push(b)}
53
+ d===pa?a.context._defaultValue:d;H=a.parent;return}return!F(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,
54
+ bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ea(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){e=
55
+ a.writtenSymbols;g=e.get(d);if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=v(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
56
+ Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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||""}
57
+ function $a(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+u(c)+"\n";a.completedErrorChunks.push(b)}
58
58
  function Xa(a){var b=Ka.current,c=S;Ka.current=Ga;S=a.cache;M=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){J(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===z){var l=k,w=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,w);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===z;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var ha=ea(h,g.id,k);h.completedJSONChunks.push(ha);h.abortableTasks.delete(g);
59
59
  g.status=1}catch(G){var y=G===K?Aa():G;if("object"===typeof y&&null!==y&&"function"===typeof y.then){var O=g.ping;y.then(O,O);g.thenableState=Ba()}else{h.abortableTasks.delete(g);g.status=4;var bb=U(h,y);V(h,g.id,bb)}}}}null!==a.destination&&W(a,a.destination)}catch(G){U(a,G),$a(a,G)}finally{Ka.current=b,S=c,M=null}}
60
60
  function W(a,b){f=new Uint8Array(2048);m=0;n=!0;try{for(var c=a.completedImportChunks,d=0;d<c.length;d++)if(a.pendingChunks--,!q(b,c[d])){a.destination=null;d++;break}c.splice(0,d);var e=a.completedJSONChunks;for(d=0;d<e.length;d++)if(a.pendingChunks--,!q(b,e[d])){a.destination=null;d++;break}e.splice(0,d);var g=a.completedErrorChunks;for(d=0;d<g.length;d++)if(a.pendingChunks--,!q(b,g[d])){a.destination=null;d++;break}g.splice(0,d)}finally{f&&0<m&&b.write(f.subarray(0,m)),f=null,m=0,n=!0}"function"===
@@ -142,7 +142,7 @@ function transformServerModule(source, body, url, loader) {
142
142
  newSrc += 'Object.defineProperties(' + local + ',{';
143
143
  newSrc += '$$typeof: {value: Symbol.for("react.server.reference")},';
144
144
  newSrc += '$$id: {value: ' + JSON.stringify(url + '#' + exported) + '},';
145
- newSrc += '$$bound: { value: [] }';
145
+ newSrc += '$$bound: { value: null }';
146
146
  newSrc += '});\n';
147
147
  });
148
148
  return newSrc;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-server-dom-webpack",
3
3
  "description": "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.",
4
- "version": "18.3.0-next-9fb2469a6-20230308",
4
+ "version": "18.3.0-next-3706edb81-20230308",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -78,8 +78,8 @@
78
78
  "node": ">=0.10.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "react": "18.3.0-next-9fb2469a6-20230308",
82
- "react-dom": "18.3.0-next-9fb2469a6-20230308",
81
+ "react": "18.3.0-next-3706edb81-20230308",
82
+ "react-dom": "18.3.0-next-3706edb81-20230308",
83
83
  "webpack": "^5.59.0"
84
84
  },
85
85
  "dependencies": {
@@ -544,6 +544,10 @@
544
544
  var args = Array.prototype.slice.call(arguments);
545
545
  var p = metaData.bound;
546
546
 
547
+ if (!p) {
548
+ return callServer(metaData.id, args);
549
+ }
550
+
547
551
  if (p.status === INITIALIZED) {
548
552
  var bound = p.value;
549
553
  return callServer(metaData.id, bound.concat(args));
@@ -12,8 +12,8 @@ f){f=__webpack_chunk_load__(e);c.push(f);var h=t.set.bind(t,e,null);f.then(h,K);
12
12
  break;case "resolved_module":u(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":throw a;default:throw a.reason;}}function v(a,b){for(var c=0;c<a.length;c++)(0,a[c])(b)}function E(a,b,c){switch(a.status){case "fulfilled":v(b,a.value);break;case "pending":case "blocked":a.value=b;a.reason=c;break;case "rejected":c&&v(c,a.reason)}}function w(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&v(c,b)}}function F(a,
13
13
  b){if("pending"===a.status||"blocked"===a.status){var c=a.value,d=a.reason;a.status="resolved_module";a.value=b;null!==c&&(u(a),E(a,c,d))}}function r(a){var b=x,c=l;x=a;l=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==l&&0<l.deps?(l.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{x=b,l=c}}function u(a){try{var b=a.value;if(b.async){var c=z.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;
14
14
  }else d=__webpack_require__(b.id);var e="*"===b.name?d:""===b.name?d.__esModule?d.default:d:d[b.name];a.status="fulfilled";a.value=e}catch(f){a.status="rejected",a.reason=f}}function y(a,b){a._chunks.forEach(function(c){"pending"===c.status&&w(c,b)})}function p(a,b){var c=a._chunks,d=c.get(b);d||(d=new n("pending",null,null,a),c.set(b,d));return d}function N(a,b,c){if(l){var d=l;d.deps++}else d=l={deps:1,value:null};return function(e){b[c]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status=
15
- "fulfilled",a.value=d.value,null!==e&&v(e,d.value))}}function O(a){return function(b){return w(a,b)}}function P(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=b.bound;return"fulfilled"===e.status?c(b.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return c(b.id,f.concat(d))})}}function Q(a,b,c,d){if("$"===d[0]){if("$"===d)return A;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),a=p(a,b),{$$typeof:R,_payload:a,
16
- _init:M};case "@":return b=parseInt(d.substring(2),16),p(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),B[a]||(B[a]=q.createServerContext(a,S)),B[a].Provider;case "F":b=parseInt(d.substring(2),16);b=p(a,b);switch(b.status){case "resolved_model":r(b)}switch(b.status){case "fulfilled":return P(a,b.value);default:throw b.reason;}default:d=parseInt(d.substring(1),16);a=p(a,d);switch(a.status){case "resolved_model":r(a);break;case "resolved_module":u(a)}switch(a.status){case "fulfilled":return a.value;
15
+ "fulfilled",a.value=d.value,null!==e&&v(e,d.value))}}function O(a){return function(b){return w(a,b)}}function P(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=b.bound;return e?"fulfilled"===e.status?c(b.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return c(b.id,f.concat(d))}):c(b.id,d)}}function Q(a,b,c,d){if("$"===d[0]){if("$"===d)return A;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),a=p(a,b),{$$typeof:R,
16
+ _payload:a,_init:M};case "@":return b=parseInt(d.substring(2),16),p(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),B[a]||(B[a]=q.createServerContext(a,S)),B[a].Provider;case "F":b=parseInt(d.substring(2),16);b=p(a,b);switch(b.status){case "resolved_model":r(b)}switch(b.status){case "fulfilled":return P(a,b.value);default:throw b.reason;}default:d=parseInt(d.substring(1),16);a=p(a,d);switch(a.status){case "resolved_model":r(a);break;case "resolved_module":u(a)}switch(a.status){case "fulfilled":return a.value;
17
17
  case "pending":case "blocked":return d=x,a.then(N(d,b,c),O(d)),null;default:throw a.reason;}}}return d}function T(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}function U(a,b,c){var d=a._chunks,e=d.get(b);c=JSON.parse(c,a._fromJSON);var f=J(a._bundlerConfig,c);if(c=L(f)){if(e){var h=e;h.status="blocked"}else h=new n("blocked",null,null,a),d.set(b,h);c.then(function(){return F(h,f)},function(g){return w(h,g)})}else e?
18
18
  F(e,f):d.set(b,new n("resolved_module",f,null,a))}function G(a){y(a,Error("Connection closed."))}function H(a,b){if(""!==b){var c=b.indexOf(":",0),d=parseInt(b.substring(0,c),16);switch(b[c+1]){case "I":U(a,d,b.substring(c+2));break;case "E":c=JSON.parse(b.substring(c+2)).digest;b=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.");
19
19
  b.stack="Error: "+b.message;b.digest=c;c=a._chunks;var e=c.get(d);e?w(e,b):c.set(d,new n("rejected",null,b,a));break;default:b=b.substring(c+1),e=a._chunks,(c=e.get(d))?"pending"===c.status&&(a=c.value,d=c.reason,c.status="resolved_model",c.value=b,null!==a&&(r(c),E(c,a,d))):e.set(d,new n("resolved_model",b,null,a))}}}function V(a){return function(b,c){return"string"===typeof c?Q(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===A?{$$typeof:A,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:
@@ -225,11 +225,11 @@
225
225
  return resolvedModuleData;
226
226
  }
227
227
  }
228
- function resolveServerReferenceMetadata(config, serverReference) {
229
- return {
230
- id: serverReference.$$id,
231
- bound: Promise.resolve(serverReference.$$bound)
232
- };
228
+ function getServerReferenceId(config, serverReference) {
229
+ return serverReference.$$id;
230
+ }
231
+ function getServerReferenceBoundArguments(config, serverReference) {
232
+ return serverReference.$$bound;
233
233
  }
234
234
 
235
235
  // ATTENTION
@@ -1164,6 +1164,8 @@
1164
1164
  return ContextRegistry[globalName];
1165
1165
  }
1166
1166
 
1167
+ // Thenable<ReactClientValue>
1168
+
1167
1169
  var PENDING = 0;
1168
1170
  var COMPLETED = 1;
1169
1171
  var ABORTED = 3;
@@ -1589,7 +1591,11 @@
1589
1591
  return serializeServerReferenceID(existingId);
1590
1592
  }
1591
1593
 
1592
- var serverReferenceMetadata = resolveServerReferenceMetadata(request.bundlerConfig, serverReference);
1594
+ var bound = getServerReferenceBoundArguments(request.bundlerConfig, serverReference);
1595
+ var serverReferenceMetadata = {
1596
+ id: getServerReferenceId(request.bundlerConfig, serverReference),
1597
+ bound: bound ? Promise.resolve(bound) : null
1598
+ };
1593
1599
  request.pendingChunks++;
1594
1600
  var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
1595
1601
 
@@ -25,7 +25,7 @@ g&&(e+=", ");var h=a[g];h="object"===typeof h&&null!==h?y(h):Y(h);""+g===b?(c=e.
25
25
  " ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}function Ka(a,b,c,d){switch(d){case n:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===n||d.$$typeof===E);)try{switch(d.$$typeof){case n:var e=d;d=F(a,e.type,e.key,e.ref,e.props,null);break;case E:var g=d._init;d=g(d._payload)}}catch(h){c=h===T?sa():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=W(a,d,t,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=ta(),"$L"+a.id.toString(16);a.pendingChunks++;
26
26
  d=a.nextChunkId++;c=u(a,c);C(a,d,c);return"$L"+d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===M)return Ba(a,b,c,d);if("function"===typeof d.then)return"$@"+Ma(a,d).toString(16);if(d.$$typeof===ya)return d=d._context._globalName,b=a.writtenProviders,c=b.get(c),void 0===c&&(a.pendingChunks++,c=a.nextChunkId++,b.set(d,c),d=R(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===za){a=t;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");
27
27
  d=a.parentValue;a.context._currentValue=d===Da?a.context._defaultValue:d;t=a.parent;return}return!ba(d)&&(null===d||"object"!==typeof d?a=null:(a=Ea&&d[Ea]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===M)return Ba(a,b,c,d);if(d.$$typeof===Sa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+
28
- b.toString(16):(e={id:d.$$id,bound:Promise.resolve(d.$$bound)},a.pendingChunks++,b=a.nextChunkId++,e=la(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+y(b,c)+"\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".'+
28
+ b.toString(16):(b=d.$$bound,e={id:d.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=la(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+y(b,c)+"\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".'+
29
29
  y(b,c));}if("symbol"===typeof d){e=a.writtenSymbols;g=e.get(d);if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(d.description+") cannot be found among global symbols.")+y(b,c));a.pendingChunks++;c=a.nextChunkId++;b=R(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
30
30
  y(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+y(b,c));}function u(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 ca(a,b){null!==a.destination?(a.status=2,ka(a.destination,b)):(a.status=1,a.fatalError=b)}function C(a,
31
31
  b,c){c={digest:c};b=b.toString(16)+":E"+I(c)+"\n";b=D.encode(b);a.completedErrorChunks.push(b)}function Aa(a){var b=da.current,c=z;da.current=Ta;z=a.cache;G=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){S(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===n){var l=k,v=g.thenableState;g.model=k;k=F(h,l.type,l.key,l.ref,l.props,v);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===n;)l=k,g.model=