@shopify/hydrogen 0.0.0-experimental-20220526194818

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 (692) hide show
  1. package/CHANGELOG.md +1643 -0
  2. package/README.md +29 -0
  3. package/client.d.ts +1 -0
  4. package/client.js +1 -0
  5. package/config.d.ts +1 -0
  6. package/config.js +1 -0
  7. package/dist/esnext/FileSessionStorage.d.ts +1 -0
  8. package/dist/esnext/FileSessionStorage.js +1 -0
  9. package/dist/esnext/client.d.ts +16 -0
  10. package/dist/esnext/client.js +16 -0
  11. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +23 -0
  12. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +47 -0
  13. package/dist/esnext/components/AddToCartButton/index.d.ts +1 -0
  14. package/dist/esnext/components/AddToCartButton/index.js +1 -0
  15. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +18 -0
  16. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +26 -0
  17. package/dist/esnext/components/BuyNowButton/index.d.ts +1 -0
  18. package/dist/esnext/components/BuyNowButton/index.js +1 -0
  19. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +11 -0
  20. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +17 -0
  21. package/dist/esnext/components/CartCheckoutButton/index.d.ts +1 -0
  22. package/dist/esnext/components/CartCheckoutButton/index.js +1 -0
  23. package/dist/esnext/components/CartEstimatedCost/CartEstimatedCost.client.d.ts +14 -0
  24. package/dist/esnext/components/CartEstimatedCost/CartEstimatedCost.client.js +29 -0
  25. package/dist/esnext/components/CartEstimatedCost/index.d.ts +1 -0
  26. package/dist/esnext/components/CartEstimatedCost/index.js +1 -0
  27. package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +9 -0
  28. package/dist/esnext/components/CartLineImage/CartLineImage.client.js +11 -0
  29. package/dist/esnext/components/CartLineImage/index.d.ts +1 -0
  30. package/dist/esnext/components/CartLineImage/index.js +1 -0
  31. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +12 -0
  32. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +21 -0
  33. package/dist/esnext/components/CartLinePrice/index.d.ts +1 -0
  34. package/dist/esnext/components/CartLinePrice/index.js +1 -0
  35. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +8 -0
  36. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +12 -0
  37. package/dist/esnext/components/CartLineProductTitle/index.d.ts +1 -0
  38. package/dist/esnext/components/CartLineProductTitle/index.js +1 -0
  39. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +11 -0
  40. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +8 -0
  41. package/dist/esnext/components/CartLineProvider/context.d.ts +26 -0
  42. package/dist/esnext/components/CartLineProvider/context.js +2 -0
  43. package/dist/esnext/components/CartLineProvider/index.d.ts +2 -0
  44. package/dist/esnext/components/CartLineProvider/index.js +2 -0
  45. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +8 -0
  46. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +12 -0
  47. package/dist/esnext/components/CartLineQuantity/index.d.ts +1 -0
  48. package/dist/esnext/components/CartLineQuantity/index.js +1 -0
  49. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +14 -0
  50. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +24 -0
  51. package/dist/esnext/components/CartLineQuantityAdjustButton/index.d.ts +1 -0
  52. package/dist/esnext/components/CartLineQuantityAdjustButton/index.js +1 -0
  53. package/dist/esnext/components/CartLines/CartLines.d.ts +15 -0
  54. package/dist/esnext/components/CartLines/CartLines.js +17 -0
  55. package/dist/esnext/components/CartLines/index.d.ts +1 -0
  56. package/dist/esnext/components/CartLines/index.js +1 -0
  57. package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +41 -0
  58. package/dist/esnext/components/CartProvider/CartProvider.client.js +523 -0
  59. package/dist/esnext/components/CartProvider/cart-queries.d.ts +10 -0
  60. package/dist/esnext/components/CartProvider/cart-queries.js +191 -0
  61. package/dist/esnext/components/CartProvider/constants.d.ts +2 -0
  62. package/dist/esnext/components/CartProvider/constants.js +2 -0
  63. package/dist/esnext/components/CartProvider/context.d.ts +2 -0
  64. package/dist/esnext/components/CartProvider/context.js +2 -0
  65. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +86 -0
  66. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.js +1 -0
  67. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +86 -0
  68. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +1 -0
  69. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +85 -0
  70. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.js +1 -0
  71. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +86 -0
  72. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +1 -0
  73. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +72 -0
  74. package/dist/esnext/components/CartProvider/graphql/CartFragment.js +1 -0
  75. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +86 -0
  76. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.js +1 -0
  77. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +86 -0
  78. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.js +1 -0
  79. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +86 -0
  80. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.js +1 -0
  81. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +86 -0
  82. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.js +1 -0
  83. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +81 -0
  84. package/dist/esnext/components/CartProvider/graphql/CartQuery.js +1 -0
  85. package/dist/esnext/components/CartProvider/hooks.client.d.ts +15 -0
  86. package/dist/esnext/components/CartProvider/hooks.client.js +62 -0
  87. package/dist/esnext/components/CartProvider/index.d.ts +4 -0
  88. package/dist/esnext/components/CartProvider/index.js +3 -0
  89. package/dist/esnext/components/CartProvider/types.d.ts +102 -0
  90. package/dist/esnext/components/CartProvider/types.js +1 -0
  91. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +9 -0
  92. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +19 -0
  93. package/dist/esnext/components/CartShopPayButton/index.d.ts +1 -0
  94. package/dist/esnext/components/CartShopPayButton/index.js +1 -0
  95. package/dist/esnext/components/DevTools.client.d.ts +1 -0
  96. package/dist/esnext/components/DevTools.client.js +129 -0
  97. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +21 -0
  98. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +14 -0
  99. package/dist/esnext/components/ExternalVideo/index.d.ts +1 -0
  100. package/dist/esnext/components/ExternalVideo/index.js +1 -0
  101. package/dist/esnext/components/Image/Image.d.ts +84 -0
  102. package/dist/esnext/components/Image/Image.js +59 -0
  103. package/dist/esnext/components/Image/index.d.ts +2 -0
  104. package/dist/esnext/components/Image/index.js +1 -0
  105. package/dist/esnext/components/Link/Link.client.d.ts +23 -0
  106. package/dist/esnext/components/Link/Link.client.js +135 -0
  107. package/dist/esnext/components/Link/index.d.ts +1 -0
  108. package/dist/esnext/components/Link/index.js +1 -0
  109. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +6 -0
  110. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +5 -0
  111. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -0
  112. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.js +2 -0
  113. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +33 -0
  114. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +44 -0
  115. package/dist/esnext/components/LocalizationProvider/index.d.ts +2 -0
  116. package/dist/esnext/components/LocalizationProvider/index.js +2 -0
  117. package/dist/esnext/components/MediaFile/MediaFile.d.ts +19 -0
  118. package/dist/esnext/components/MediaFile/MediaFile.js +31 -0
  119. package/dist/esnext/components/MediaFile/index.d.ts +1 -0
  120. package/dist/esnext/components/MediaFile/index.js +1 -0
  121. package/dist/esnext/components/Metafield/Metafield.client.d.ts +21 -0
  122. package/dist/esnext/components/Metafield/Metafield.client.js +68 -0
  123. package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +12 -0
  124. package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +48 -0
  125. package/dist/esnext/components/Metafield/components/StarRating/index.d.ts +1 -0
  126. package/dist/esnext/components/Metafield/components/StarRating/index.js +1 -0
  127. package/dist/esnext/components/Metafield/components/index.d.ts +1 -0
  128. package/dist/esnext/components/Metafield/components/index.js +1 -0
  129. package/dist/esnext/components/Metafield/index.d.ts +2 -0
  130. package/dist/esnext/components/Metafield/index.js +1 -0
  131. package/dist/esnext/components/Metafield/types.d.ts +4 -0
  132. package/dist/esnext/components/Metafield/types.js +1 -0
  133. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +128 -0
  134. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +105 -0
  135. package/dist/esnext/components/ModelViewer/index.d.ts +1 -0
  136. package/dist/esnext/components/ModelViewer/index.js +1 -0
  137. package/dist/esnext/components/Money/Money.client.d.ts +25 -0
  138. package/dist/esnext/components/Money/Money.client.js +39 -0
  139. package/dist/esnext/components/Money/index.d.ts +1 -0
  140. package/dist/esnext/components/Money/index.js +1 -0
  141. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +15 -0
  142. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +56 -0
  143. package/dist/esnext/components/ProductPrice/index.d.ts +1 -0
  144. package/dist/esnext/components/ProductPrice/index.js +1 -0
  145. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.d.ts +8 -0
  146. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.js +12 -0
  147. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +24 -0
  148. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +34 -0
  149. package/dist/esnext/components/ProductProvider/context.d.ts +29 -0
  150. package/dist/esnext/components/ProductProvider/context.js +3 -0
  151. package/dist/esnext/components/ProductProvider/index.d.ts +2 -0
  152. package/dist/esnext/components/ProductProvider/index.js +2 -0
  153. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +3 -0
  154. package/dist/esnext/components/Seo/CollectionSeo.client.js +15 -0
  155. package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +3 -0
  156. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +18 -0
  157. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +4 -0
  158. package/dist/esnext/components/Seo/DescriptionSeo.client.js +10 -0
  159. package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +2 -0
  160. package/dist/esnext/components/Seo/HomePageSeo.client.js +25 -0
  161. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +3 -0
  162. package/dist/esnext/components/Seo/ImageSeo.client.js +10 -0
  163. package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +3 -0
  164. package/dist/esnext/components/Seo/NoIndexSeo.client.js +10 -0
  165. package/dist/esnext/components/Seo/PageSeo.client.d.ts +3 -0
  166. package/dist/esnext/components/Seo/PageSeo.client.js +13 -0
  167. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +5 -0
  168. package/dist/esnext/components/Seo/ProductSeo.client.js +63 -0
  169. package/dist/esnext/components/Seo/Seo.client.d.ts +30 -0
  170. package/dist/esnext/components/Seo/Seo.client.js +31 -0
  171. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +3 -0
  172. package/dist/esnext/components/Seo/TitleSeo.client.js +10 -0
  173. package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +2 -0
  174. package/dist/esnext/components/Seo/TwitterSeo.client.js +9 -0
  175. package/dist/esnext/components/Seo/index.d.ts +1 -0
  176. package/dist/esnext/components/Seo/index.js +1 -0
  177. package/dist/esnext/components/Seo/seo-types.d.ts +17 -0
  178. package/dist/esnext/components/Seo/seo-types.js +1 -0
  179. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +38 -0
  180. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +52 -0
  181. package/dist/esnext/components/ShopPayButton/index.d.ts +1 -0
  182. package/dist/esnext/components/ShopPayButton/index.js +1 -0
  183. package/dist/esnext/components/Video/Video.d.ts +14 -0
  184. package/dist/esnext/components/Video/Video.js +24 -0
  185. package/dist/esnext/components/Video/index.d.ts +1 -0
  186. package/dist/esnext/components/Video/index.js +1 -0
  187. package/dist/esnext/components/index.d.ts +28 -0
  188. package/dist/esnext/components/index.js +26 -0
  189. package/dist/esnext/components/types.d.ts +71 -0
  190. package/dist/esnext/components/types.js +10 -0
  191. package/dist/esnext/config.d.ts +3 -0
  192. package/dist/esnext/config.js +1 -0
  193. package/dist/esnext/constants.d.ts +7 -0
  194. package/dist/esnext/constants.js +7 -0
  195. package/dist/esnext/entry-client.d.ts +3 -0
  196. package/dist/esnext/entry-client.js +73 -0
  197. package/dist/esnext/entry-server.d.ts +35 -0
  198. package/dist/esnext/entry-server.js +529 -0
  199. package/dist/esnext/foundation/Analytics/Analytics.client.d.ts +3 -0
  200. package/dist/esnext/foundation/Analytics/Analytics.client.js +28 -0
  201. package/dist/esnext/foundation/Analytics/Analytics.server.d.ts +1 -0
  202. package/dist/esnext/foundation/Analytics/Analytics.server.js +40 -0
  203. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +25 -0
  204. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +97 -0
  205. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.d.ts +2 -0
  206. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.js +33 -0
  207. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +7 -0
  208. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +64 -0
  209. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.d.ts +1 -0
  210. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.js +24 -0
  211. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +1 -0
  212. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +23 -0
  213. package/dist/esnext/foundation/Analytics/const.d.ts +9 -0
  214. package/dist/esnext/foundation/Analytics/const.js +9 -0
  215. package/dist/esnext/foundation/Analytics/hook.d.ts +1 -0
  216. package/dist/esnext/foundation/Analytics/hook.js +7 -0
  217. package/dist/esnext/foundation/Analytics/index.d.ts +2 -0
  218. package/dist/esnext/foundation/Analytics/index.js +2 -0
  219. package/dist/esnext/foundation/Analytics/types.d.ts +5 -0
  220. package/dist/esnext/foundation/Analytics/types.js +1 -0
  221. package/dist/esnext/foundation/Analytics/utils.d.ts +1 -0
  222. package/dist/esnext/foundation/Analytics/utils.js +8 -0
  223. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.d.ts +4 -0
  224. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.js +8 -0
  225. package/dist/esnext/foundation/Cookie/Cookie.d.ts +48 -0
  226. package/dist/esnext/foundation/Cookie/Cookie.js +67 -0
  227. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.d.ts +5 -0
  228. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.js +31 -0
  229. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +22 -0
  230. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +74 -0
  231. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.d.ts +6 -0
  232. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.js +149 -0
  233. package/dist/esnext/foundation/Head/Head.client.d.ts +5 -0
  234. package/dist/esnext/foundation/Head/Head.client.js +10 -0
  235. package/dist/esnext/foundation/Head/index.d.ts +1 -0
  236. package/dist/esnext/foundation/Head/index.js +1 -0
  237. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.d.ts +5 -0
  238. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.js +53 -0
  239. package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +5 -0
  240. package/dist/esnext/foundation/Redirect/Redirect.client.js +15 -0
  241. package/dist/esnext/foundation/Route/Route.server.d.ts +12 -0
  242. package/dist/esnext/foundation/Route/Route.server.js +28 -0
  243. package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +13 -0
  244. package/dist/esnext/foundation/Router/BrowserRouter.client.js +130 -0
  245. package/dist/esnext/foundation/Router/Router.server.d.ts +10 -0
  246. package/dist/esnext/foundation/Router/Router.server.js +8 -0
  247. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +40 -0
  248. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +67 -0
  249. package/dist/esnext/foundation/ServerPropsProvider/index.d.ts +2 -0
  250. package/dist/esnext/foundation/ServerPropsProvider/index.js +1 -0
  251. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +23 -0
  252. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +128 -0
  253. package/dist/esnext/foundation/ServerRequestProvider/index.d.ts +1 -0
  254. package/dist/esnext/foundation/ServerRequestProvider/index.js +1 -0
  255. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +30 -0
  256. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +59 -0
  257. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +7 -0
  258. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +8 -0
  259. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +16 -0
  260. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +58 -0
  261. package/dist/esnext/foundation/ShopifyProvider/index.d.ts +1 -0
  262. package/dist/esnext/foundation/ShopifyProvider/index.js +1 -0
  263. package/dist/esnext/foundation/ShopifyProvider/types.d.ts +13 -0
  264. package/dist/esnext/foundation/ShopifyProvider/types.js +1 -0
  265. package/dist/esnext/foundation/constants.d.ts +1 -0
  266. package/dist/esnext/foundation/constants.js +3 -0
  267. package/dist/esnext/foundation/fetchSync/client/fetchSync.d.ts +10 -0
  268. package/dist/esnext/foundation/fetchSync/client/fetchSync.js +28 -0
  269. package/dist/esnext/foundation/fetchSync/server/fetchSync.d.ts +8 -0
  270. package/dist/esnext/foundation/fetchSync/server/fetchSync.js +29 -0
  271. package/dist/esnext/foundation/fetchSync/types.d.ts +5 -0
  272. package/dist/esnext/foundation/fetchSync/types.js +1 -0
  273. package/dist/esnext/foundation/index.d.ts +3 -0
  274. package/dist/esnext/foundation/index.js +3 -0
  275. package/dist/esnext/foundation/session/session.d.ts +27 -0
  276. package/dist/esnext/foundation/session/session.js +37 -0
  277. package/dist/esnext/foundation/ssr-interop.d.ts +29 -0
  278. package/dist/esnext/foundation/ssr-interop.js +35 -0
  279. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +13 -0
  280. package/dist/esnext/foundation/useNavigate/useNavigate.js +14 -0
  281. package/dist/esnext/foundation/useQuery/hooks.d.ts +36 -0
  282. package/dist/esnext/foundation/useQuery/hooks.js +97 -0
  283. package/dist/esnext/foundation/useQuery/index.d.ts +1 -0
  284. package/dist/esnext/foundation/useQuery/index.js +1 -0
  285. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +9 -0
  286. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +7 -0
  287. package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  288. package/dist/esnext/foundation/useRouteParams/useRouteParams.js +9 -0
  289. package/dist/esnext/foundation/useServerProps/index.d.ts +1 -0
  290. package/dist/esnext/foundation/useServerProps/index.js +1 -0
  291. package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +21 -0
  292. package/dist/esnext/foundation/useServerProps/use-server-props.js +35 -0
  293. package/dist/esnext/foundation/useSession/useSession.d.ts +2 -0
  294. package/dist/esnext/foundation/useSession/useSession.js +8 -0
  295. package/dist/esnext/foundation/useShop/index.d.ts +1 -0
  296. package/dist/esnext/foundation/useShop/index.js +1 -0
  297. package/dist/esnext/foundation/useShop/use-shop.d.ts +6 -0
  298. package/dist/esnext/foundation/useShop/use-shop.js +14 -0
  299. package/dist/esnext/foundation/useUrl/index.d.ts +1 -0
  300. package/dist/esnext/foundation/useUrl/index.js +1 -0
  301. package/dist/esnext/foundation/useUrl/useUrl.d.ts +4 -0
  302. package/dist/esnext/foundation/useUrl/useUrl.js +28 -0
  303. package/dist/esnext/framework/CachingStrategy/index.d.ts +10 -0
  304. package/dist/esnext/framework/CachingStrategy/index.js +96 -0
  305. package/dist/esnext/framework/Hydration/Html.d.ts +11 -0
  306. package/dist/esnext/framework/Hydration/Html.js +86 -0
  307. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.d.ts +58 -0
  308. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.js +146 -0
  309. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.d.ts +26 -0
  310. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.js +42 -0
  311. package/dist/esnext/framework/Hydration/rsc.d.ts +8 -0
  312. package/dist/esnext/framework/Hydration/rsc.js +100 -0
  313. package/dist/esnext/framework/cache/in-memory.d.ts +12 -0
  314. package/dist/esnext/framework/cache/in-memory.js +52 -0
  315. package/dist/esnext/framework/cache-sub-request.d.ts +17 -0
  316. package/dist/esnext/framework/cache-sub-request.js +64 -0
  317. package/dist/esnext/framework/cache.d.ts +17 -0
  318. package/dist/esnext/framework/cache.js +127 -0
  319. package/dist/esnext/framework/config.d.ts +6 -0
  320. package/dist/esnext/framework/config.js +6 -0
  321. package/dist/esnext/framework/graphiql.d.ts +1 -0
  322. package/dist/esnext/framework/graphiql.js +38 -0
  323. package/dist/esnext/framework/middleware.d.ts +21 -0
  324. package/dist/esnext/framework/middleware.js +98 -0
  325. package/dist/esnext/framework/plugin.d.ts +4 -0
  326. package/dist/esnext/framework/plugin.js +28 -0
  327. package/dist/esnext/framework/plugins/vite-plugin-client-imports.d.ts +2 -0
  328. package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +25 -0
  329. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  330. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +98 -0
  331. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.d.ts +3 -0
  332. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.js +35 -0
  333. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +9 -0
  334. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.js +37 -0
  335. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +3 -0
  336. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +96 -0
  337. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +11 -0
  338. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +110 -0
  339. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +1 -0
  340. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +35 -0
  341. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.d.ts +3 -0
  342. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +70 -0
  343. package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.d.ts +3 -0
  344. package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.js +11 -0
  345. package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.d.ts +3 -0
  346. package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.js +16 -0
  347. package/dist/esnext/framework/runtime.d.ts +13 -0
  348. package/dist/esnext/framework/runtime.js +27 -0
  349. package/dist/esnext/hooks/index.d.ts +6 -0
  350. package/dist/esnext/hooks/index.js +6 -0
  351. package/dist/esnext/hooks/useCart/index.d.ts +1 -0
  352. package/dist/esnext/hooks/useCart/index.js +1 -0
  353. package/dist/esnext/hooks/useCart/useCart.d.ts +4 -0
  354. package/dist/esnext/hooks/useCart/useCart.js +12 -0
  355. package/dist/esnext/hooks/useCartLine/index.d.ts +1 -0
  356. package/dist/esnext/hooks/useCartLine/index.js +1 -0
  357. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +29 -0
  358. package/dist/esnext/hooks/useCartLine/useCartLine.js +12 -0
  359. package/dist/esnext/hooks/useCountry/index.d.ts +1 -0
  360. package/dist/esnext/hooks/useCountry/index.js +1 -0
  361. package/dist/esnext/hooks/useCountry/useCountry.d.ts +7 -0
  362. package/dist/esnext/hooks/useCountry/useCountry.js +17 -0
  363. package/dist/esnext/hooks/useLoadScript/index.d.ts +1 -0
  364. package/dist/esnext/hooks/useLoadScript/index.js +1 -0
  365. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.d.ts +8 -0
  366. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.js +23 -0
  367. package/dist/esnext/hooks/useMeasurement/hooks.d.ts +9 -0
  368. package/dist/esnext/hooks/useMeasurement/hooks.js +13 -0
  369. package/dist/esnext/hooks/useMeasurement/index.d.ts +1 -0
  370. package/dist/esnext/hooks/useMeasurement/index.js +1 -0
  371. package/dist/esnext/hooks/useMoney/hooks.d.ts +54 -0
  372. package/dist/esnext/hooks/useMoney/hooks.js +66 -0
  373. package/dist/esnext/hooks/useMoney/index.d.ts +1 -0
  374. package/dist/esnext/hooks/useMoney/index.js +1 -0
  375. package/dist/esnext/hooks/useParsedMetafields/index.d.ts +1 -0
  376. package/dist/esnext/hooks/useParsedMetafields/index.js +1 -0
  377. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +21 -0
  378. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.js +21 -0
  379. package/dist/esnext/hooks/useProduct/index.d.ts +1 -0
  380. package/dist/esnext/hooks/useProduct/index.js +1 -0
  381. package/dist/esnext/hooks/useProduct/useProduct.d.ts +52 -0
  382. package/dist/esnext/hooks/useProduct/useProduct.js +43 -0
  383. package/dist/esnext/hooks/useProductOptions/helpers.d.ts +6 -0
  384. package/dist/esnext/hooks/useProductOptions/helpers.js +40 -0
  385. package/dist/esnext/hooks/useProductOptions/index.d.ts +2 -0
  386. package/dist/esnext/hooks/useProductOptions/index.js +2 -0
  387. package/dist/esnext/hooks/useProductOptions/types.d.ts +42 -0
  388. package/dist/esnext/hooks/useProductOptions/types.js +1 -0
  389. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +15 -0
  390. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +108 -0
  391. package/dist/esnext/hooks/useShopQuery/hooks.d.ts +28 -0
  392. package/dist/esnext/hooks/useShopQuery/hooks.js +161 -0
  393. package/dist/esnext/hooks/useShopQuery/index.d.ts +1 -0
  394. package/dist/esnext/hooks/useShopQuery/index.js +1 -0
  395. package/dist/esnext/index.d.ts +27 -0
  396. package/dist/esnext/index.js +31 -0
  397. package/dist/esnext/node.d.ts +1 -0
  398. package/dist/esnext/node.js +1 -0
  399. package/dist/esnext/platforms/node.d.ts +9 -0
  400. package/dist/esnext/platforms/node.js +40 -0
  401. package/dist/esnext/platforms/worker-event.d.ts +1 -0
  402. package/dist/esnext/platforms/worker-event.js +3 -0
  403. package/dist/esnext/platforms/worker.d.ts +14 -0
  404. package/dist/esnext/platforms/worker.js +25 -0
  405. package/dist/esnext/storefront-api-types.d.ts +6405 -0
  406. package/dist/esnext/storefront-api-types.js +1763 -0
  407. package/dist/esnext/streaming.server.d.ts +24 -0
  408. package/dist/esnext/streaming.server.js +33 -0
  409. package/dist/esnext/types.d.ts +98 -0
  410. package/dist/esnext/types.js +1 -0
  411. package/dist/esnext/utilities/apiRoutes.d.ts +37 -0
  412. package/dist/esnext/utilities/apiRoutes.js +156 -0
  413. package/dist/esnext/utilities/bot-ua.d.ts +4 -0
  414. package/dist/esnext/utilities/bot-ua.js +61 -0
  415. package/dist/esnext/utilities/defer.d.ts +6 -0
  416. package/dist/esnext/utilities/defer.js +14 -0
  417. package/dist/esnext/utilities/devtools.d.ts +11 -0
  418. package/dist/esnext/utilities/devtools.js +11 -0
  419. package/dist/esnext/utilities/empty-hydrogen-config.d.ts +2 -0
  420. package/dist/esnext/utilities/empty-hydrogen-config.js +2 -0
  421. package/dist/esnext/utilities/error.d.ts +1 -0
  422. package/dist/esnext/utilities/error.js +6 -0
  423. package/dist/esnext/utilities/fetch.d.ts +9 -0
  424. package/dist/esnext/utilities/fetch.js +31 -0
  425. package/dist/esnext/utilities/findRoutePrefix.d.ts +1 -0
  426. package/dist/esnext/utilities/findRoutePrefix.js +17 -0
  427. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +6 -0
  428. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +11 -0
  429. package/dist/esnext/utilities/flattenConnection/index.d.ts +1 -0
  430. package/dist/esnext/utilities/flattenConnection/index.js +1 -0
  431. package/dist/esnext/utilities/graphql-tag.d.ts +1 -0
  432. package/dist/esnext/utilities/graphql-tag.js +6 -0
  433. package/dist/esnext/utilities/graphql-tracker.d.ts +17 -0
  434. package/dist/esnext/utilities/graphql-tracker.js +123 -0
  435. package/dist/esnext/utilities/hash.d.ts +2 -0
  436. package/dist/esnext/utilities/hash.js +7 -0
  437. package/dist/esnext/utilities/html-encoding.d.ts +2 -0
  438. package/dist/esnext/utilities/html-encoding.js +16 -0
  439. package/dist/esnext/utilities/image_size.d.ts +12 -0
  440. package/dist/esnext/utilities/image_size.js +62 -0
  441. package/dist/esnext/utilities/index.d.ts +12 -0
  442. package/dist/esnext/utilities/index.js +12 -0
  443. package/dist/esnext/utilities/isClient/index.d.ts +1 -0
  444. package/dist/esnext/utilities/isClient/index.js +1 -0
  445. package/dist/esnext/utilities/isClient/isClient.d.ts +4 -0
  446. package/dist/esnext/utilities/isClient/isClient.js +6 -0
  447. package/dist/esnext/utilities/isServer/index.d.ts +1 -0
  448. package/dist/esnext/utilities/isServer/index.js +1 -0
  449. package/dist/esnext/utilities/isServer/isServer.d.ts +4 -0
  450. package/dist/esnext/utilities/isServer/isServer.js +7 -0
  451. package/dist/esnext/utilities/load_script.d.ts +3 -0
  452. package/dist/esnext/utilities/load_script.js +23 -0
  453. package/dist/esnext/utilities/log/index.d.ts +4 -0
  454. package/dist/esnext/utilities/log/index.js +4 -0
  455. package/dist/esnext/utilities/log/log-cache-api-status.d.ts +1 -0
  456. package/dist/esnext/utilities/log/log-cache-api-status.js +13 -0
  457. package/dist/esnext/utilities/log/log-cache-header.d.ts +10 -0
  458. package/dist/esnext/utilities/log/log-cache-header.js +30 -0
  459. package/dist/esnext/utilities/log/log-query-timeline.d.ts +12 -0
  460. package/dist/esnext/utilities/log/log-query-timeline.js +83 -0
  461. package/dist/esnext/utilities/log/log.d.ts +22 -0
  462. package/dist/esnext/utilities/log/log.js +66 -0
  463. package/dist/esnext/utilities/log/utils.d.ts +3 -0
  464. package/dist/esnext/utilities/log/utils.js +16 -0
  465. package/dist/esnext/utilities/matchPath.d.ts +10 -0
  466. package/dist/esnext/utilities/matchPath.js +54 -0
  467. package/dist/esnext/utilities/measurement.d.ts +3 -0
  468. package/dist/esnext/utilities/measurement.js +98 -0
  469. package/dist/esnext/utilities/object.d.ts +5 -0
  470. package/dist/esnext/utilities/object.js +7 -0
  471. package/dist/esnext/utilities/parse.d.ts +1 -0
  472. package/dist/esnext/utilities/parse.js +9 -0
  473. package/dist/esnext/utilities/parseMetafieldValue/index.d.ts +1 -0
  474. package/dist/esnext/utilities/parseMetafieldValue/index.js +1 -0
  475. package/dist/esnext/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +6 -0
  476. package/dist/esnext/utilities/parseMetafieldValue/parseMetafieldValue.js +36 -0
  477. package/dist/esnext/utilities/storefrontApi.d.ts +4 -0
  478. package/dist/esnext/utilities/storefrontApi.js +22 -0
  479. package/dist/esnext/utilities/suspense.d.ts +12 -0
  480. package/dist/esnext/utilities/suspense.js +58 -0
  481. package/dist/esnext/utilities/template.d.ts +9 -0
  482. package/dist/esnext/utilities/template.js +23 -0
  483. package/dist/esnext/utilities/timing.d.ts +7 -0
  484. package/dist/esnext/utilities/timing.js +14 -0
  485. package/dist/esnext/utilities/video_parameters.d.ts +47 -0
  486. package/dist/esnext/utilities/video_parameters.js +22 -0
  487. package/dist/esnext/utilities/web-api-polyfill.d.ts +1 -0
  488. package/dist/esnext/utilities/web-api-polyfill.js +19 -0
  489. package/dist/esnext/version.d.ts +1 -0
  490. package/dist/esnext/version.js +1 -0
  491. package/dist/node/components/Image/Image.d.ts +84 -0
  492. package/dist/node/components/Image/Image.js +86 -0
  493. package/dist/node/components/Image/index.d.ts +2 -0
  494. package/dist/node/components/Image/index.js +5 -0
  495. package/dist/node/constants.d.ts +7 -0
  496. package/dist/node/constants.js +10 -0
  497. package/dist/node/entry-server.d.ts +35 -0
  498. package/dist/node/entry-server.js +556 -0
  499. package/dist/node/foundation/Analytics/Analytics.client.d.ts +3 -0
  500. package/dist/node/foundation/Analytics/Analytics.client.js +32 -0
  501. package/dist/node/foundation/Analytics/Analytics.server.d.ts +1 -0
  502. package/dist/node/foundation/Analytics/Analytics.server.js +70 -0
  503. package/dist/node/foundation/Analytics/ClientAnalytics.d.ts +25 -0
  504. package/dist/node/foundation/Analytics/ClientAnalytics.js +100 -0
  505. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.d.ts +2 -0
  506. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.js +37 -0
  507. package/dist/node/foundation/Analytics/const.d.ts +9 -0
  508. package/dist/node/foundation/Analytics/const.js +12 -0
  509. package/dist/node/foundation/Analytics/hook.d.ts +1 -0
  510. package/dist/node/foundation/Analytics/hook.js +11 -0
  511. package/dist/node/foundation/Analytics/index.d.ts +2 -0
  512. package/dist/node/foundation/Analytics/index.js +7 -0
  513. package/dist/node/foundation/Analytics/types.d.ts +5 -0
  514. package/dist/node/foundation/Analytics/types.js +2 -0
  515. package/dist/node/foundation/Analytics/utils.d.ts +1 -0
  516. package/dist/node/foundation/Analytics/utils.js +12 -0
  517. package/dist/node/foundation/AnalyticsErrorBoundary.client.d.ts +4 -0
  518. package/dist/node/foundation/AnalyticsErrorBoundary.client.js +14 -0
  519. package/dist/node/foundation/Redirect/Redirect.client.d.ts +5 -0
  520. package/dist/node/foundation/Redirect/Redirect.client.js +18 -0
  521. package/dist/node/foundation/Router/BrowserRouter.client.d.ts +13 -0
  522. package/dist/node/foundation/Router/BrowserRouter.client.js +159 -0
  523. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +40 -0
  524. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.js +92 -0
  525. package/dist/node/foundation/ServerPropsProvider/index.d.ts +2 -0
  526. package/dist/node/foundation/ServerPropsProvider/index.js +6 -0
  527. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +23 -0
  528. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +158 -0
  529. package/dist/node/foundation/ServerRequestProvider/index.d.ts +1 -0
  530. package/dist/node/foundation/ServerRequestProvider/index.js +17 -0
  531. package/dist/node/foundation/ShopifyProvider/types.d.ts +13 -0
  532. package/dist/node/foundation/ShopifyProvider/types.js +2 -0
  533. package/dist/node/foundation/session/session.d.ts +27 -0
  534. package/dist/node/foundation/session/session.js +43 -0
  535. package/dist/node/foundation/ssr-interop.d.ts +29 -0
  536. package/dist/node/foundation/ssr-interop.js +39 -0
  537. package/dist/node/foundation/useNavigate/useNavigate.d.ts +13 -0
  538. package/dist/node/foundation/useNavigate/useNavigate.js +18 -0
  539. package/dist/node/foundation/useServerProps/use-server-props.d.ts +21 -0
  540. package/dist/node/foundation/useServerProps/use-server-props.js +40 -0
  541. package/dist/node/framework/CachingStrategy/index.d.ts +10 -0
  542. package/dist/node/framework/CachingStrategy/index.js +108 -0
  543. package/dist/node/framework/Hydration/Html.d.ts +11 -0
  544. package/dist/node/framework/Hydration/Html.js +94 -0
  545. package/dist/node/framework/Hydration/ServerComponentRequest.server.d.ts +58 -0
  546. package/dist/node/framework/Hydration/ServerComponentRequest.server.js +150 -0
  547. package/dist/node/framework/Hydration/ServerComponentResponse.server.d.ts +26 -0
  548. package/dist/node/framework/Hydration/ServerComponentResponse.server.js +49 -0
  549. package/dist/node/framework/Hydration/rsc.d.ts +8 -0
  550. package/dist/node/framework/Hydration/rsc.js +103 -0
  551. package/dist/node/framework/cache/in-memory.d.ts +12 -0
  552. package/dist/node/framework/cache/in-memory.js +56 -0
  553. package/dist/node/framework/cache-sub-request.d.ts +17 -0
  554. package/dist/node/framework/cache-sub-request.js +95 -0
  555. package/dist/node/framework/cache.d.ts +17 -0
  556. package/dist/node/framework/cache.js +135 -0
  557. package/dist/node/framework/config.d.ts +6 -0
  558. package/dist/node/framework/config.js +11 -0
  559. package/dist/node/framework/graphiql.d.ts +1 -0
  560. package/dist/node/framework/graphiql.js +42 -0
  561. package/dist/node/framework/middleware.d.ts +21 -0
  562. package/dist/node/framework/middleware.js +125 -0
  563. package/dist/node/framework/plugin.d.ts +4 -0
  564. package/dist/node/framework/plugin.js +33 -0
  565. package/dist/node/framework/plugins/vite-plugin-client-imports.d.ts +2 -0
  566. package/dist/node/framework/plugins/vite-plugin-client-imports.js +28 -0
  567. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  568. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +104 -0
  569. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.d.ts +3 -0
  570. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.js +40 -0
  571. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +9 -0
  572. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.js +39 -0
  573. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +3 -0
  574. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +98 -0
  575. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +11 -0
  576. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +116 -0
  577. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +1 -0
  578. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +41 -0
  579. package/dist/node/framework/plugins/vite-plugin-platform-entry.d.ts +3 -0
  580. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +75 -0
  581. package/dist/node/framework/plugins/vite-plugin-purge-query-cache.d.ts +3 -0
  582. package/dist/node/framework/plugins/vite-plugin-purge-query-cache.js +16 -0
  583. package/dist/node/framework/plugins/vite-plugin-ssr-interop.d.ts +3 -0
  584. package/dist/node/framework/plugins/vite-plugin-ssr-interop.js +18 -0
  585. package/dist/node/framework/runtime.d.ts +13 -0
  586. package/dist/node/framework/runtime.js +35 -0
  587. package/dist/node/storefront-api-types.d.ts +6405 -0
  588. package/dist/node/storefront-api-types.js +1766 -0
  589. package/dist/node/streaming.server.d.ts +24 -0
  590. package/dist/node/streaming.server.js +33 -0
  591. package/dist/node/types.d.ts +98 -0
  592. package/dist/node/types.js +2 -0
  593. package/dist/node/utilities/apiRoutes.d.ts +37 -0
  594. package/dist/node/utilities/apiRoutes.js +163 -0
  595. package/dist/node/utilities/bot-ua.d.ts +4 -0
  596. package/dist/node/utilities/bot-ua.js +65 -0
  597. package/dist/node/utilities/defer.d.ts +6 -0
  598. package/dist/node/utilities/defer.js +18 -0
  599. package/dist/node/utilities/error.d.ts +1 -0
  600. package/dist/node/utilities/error.js +10 -0
  601. package/dist/node/utilities/fetch.d.ts +9 -0
  602. package/dist/node/utilities/fetch.js +37 -0
  603. package/dist/node/utilities/findRoutePrefix.d.ts +1 -0
  604. package/dist/node/utilities/findRoutePrefix.js +21 -0
  605. package/dist/node/utilities/flattenConnection/flattenConnection.d.ts +6 -0
  606. package/dist/node/utilities/flattenConnection/flattenConnection.js +15 -0
  607. package/dist/node/utilities/flattenConnection/index.d.ts +1 -0
  608. package/dist/node/utilities/flattenConnection/index.js +5 -0
  609. package/dist/node/utilities/hash.d.ts +2 -0
  610. package/dist/node/utilities/hash.js +11 -0
  611. package/dist/node/utilities/html-encoding.d.ts +2 -0
  612. package/dist/node/utilities/html-encoding.js +21 -0
  613. package/dist/node/utilities/image_size.d.ts +12 -0
  614. package/dist/node/utilities/image_size.js +68 -0
  615. package/dist/node/utilities/index.d.ts +12 -0
  616. package/dist/node/utilities/index.js +34 -0
  617. package/dist/node/utilities/isClient/index.d.ts +1 -0
  618. package/dist/node/utilities/isClient/index.js +5 -0
  619. package/dist/node/utilities/isClient/isClient.d.ts +4 -0
  620. package/dist/node/utilities/isClient/isClient.js +10 -0
  621. package/dist/node/utilities/isServer/index.d.ts +1 -0
  622. package/dist/node/utilities/isServer/index.js +5 -0
  623. package/dist/node/utilities/isServer/isServer.d.ts +4 -0
  624. package/dist/node/utilities/isServer/isServer.js +11 -0
  625. package/dist/node/utilities/load_script.d.ts +3 -0
  626. package/dist/node/utilities/load_script.js +27 -0
  627. package/dist/node/utilities/log/index.d.ts +4 -0
  628. package/dist/node/utilities/log/index.js +18 -0
  629. package/dist/node/utilities/log/log-cache-api-status.d.ts +1 -0
  630. package/dist/node/utilities/log/log-cache-api-status.js +17 -0
  631. package/dist/node/utilities/log/log-cache-header.d.ts +10 -0
  632. package/dist/node/utilities/log/log-cache-header.js +35 -0
  633. package/dist/node/utilities/log/log-query-timeline.d.ts +12 -0
  634. package/dist/node/utilities/log/log-query-timeline.js +88 -0
  635. package/dist/node/utilities/log/log.d.ts +22 -0
  636. package/dist/node/utilities/log/log.js +74 -0
  637. package/dist/node/utilities/log/utils.d.ts +3 -0
  638. package/dist/node/utilities/log/utils.js +21 -0
  639. package/dist/node/utilities/matchPath.d.ts +10 -0
  640. package/dist/node/utilities/matchPath.js +58 -0
  641. package/dist/node/utilities/measurement.d.ts +3 -0
  642. package/dist/node/utilities/measurement.js +103 -0
  643. package/dist/node/utilities/parse.d.ts +1 -0
  644. package/dist/node/utilities/parse.js +13 -0
  645. package/dist/node/utilities/parseMetafieldValue/index.d.ts +1 -0
  646. package/dist/node/utilities/parseMetafieldValue/index.js +5 -0
  647. package/dist/node/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +6 -0
  648. package/dist/node/utilities/parseMetafieldValue/parseMetafieldValue.js +40 -0
  649. package/dist/node/utilities/storefrontApi.d.ts +4 -0
  650. package/dist/node/utilities/storefrontApi.js +26 -0
  651. package/dist/node/utilities/suspense.d.ts +12 -0
  652. package/dist/node/utilities/suspense.js +64 -0
  653. package/dist/node/utilities/template.d.ts +9 -0
  654. package/dist/node/utilities/template.js +27 -0
  655. package/dist/node/utilities/timing.d.ts +7 -0
  656. package/dist/node/utilities/timing.js +18 -0
  657. package/dist/node/utilities/video_parameters.d.ts +47 -0
  658. package/dist/node/utilities/video_parameters.js +27 -0
  659. package/dist/node/utilities/web-api-polyfill.d.ts +1 -0
  660. package/dist/node/utilities/web-api-polyfill.js +47 -0
  661. package/dist/node/version.d.ts +1 -0
  662. package/dist/node/version.js +4 -0
  663. package/entry-client.d.ts +1 -0
  664. package/entry-client.js +1 -0
  665. package/entry-server.d.ts +1 -0
  666. package/entry-server.js +1 -0
  667. package/middleware.d.ts +1 -0
  668. package/middleware.js +1 -0
  669. package/package.json +125 -0
  670. package/plugin.d.ts +1 -0
  671. package/plugin.js +1 -0
  672. package/vendor/react-server-dom-vite/LICENSE +21 -0
  673. package/vendor/react-server-dom-vite/README.md +5 -0
  674. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +356 -0
  675. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +1753 -0
  676. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +46 -0
  677. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +1716 -0
  678. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +44 -0
  679. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +613 -0
  680. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +19 -0
  681. package/vendor/react-server-dom-vite/esm/package.json +3 -0
  682. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +88 -0
  683. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +352 -0
  684. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +1745 -0
  685. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +1708 -0
  686. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +603 -0
  687. package/vendor/react-server-dom-vite/index.js +7 -0
  688. package/vendor/react-server-dom-vite/package.json +67 -0
  689. package/vendor/react-server-dom-vite/plugin.js +3 -0
  690. package/vendor/react-server-dom-vite/writer.browser.server.js +7 -0
  691. package/vendor/react-server-dom-vite/writer.node.server.js +7 -0
  692. package/web-polyfills.js +1 -0
@@ -0,0 +1,1716 @@
1
+ /**
2
+ * @license React
3
+ * react-server-dom-vite-writer.node.development.server.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ if (process.env.NODE_ENV !== "production") {
14
+ (function() {
15
+ 'use strict';
16
+
17
+ var React = require('react');
18
+
19
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
20
+
21
+ function error(format) {
22
+ {
23
+ {
24
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
25
+ args[_key2 - 1] = arguments[_key2];
26
+ }
27
+
28
+ printWarning('error', format, args);
29
+ }
30
+ }
31
+ }
32
+
33
+ function printWarning(level, format, args) {
34
+ // When changing this logic, you might want to also
35
+ // update consoleWithStackDev.www.js as well.
36
+ {
37
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
38
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
39
+
40
+ if (stack !== '') {
41
+ format += '%s';
42
+ args = args.concat([stack]);
43
+ } // eslint-disable-next-line react-internal/safe-string-coercion
44
+
45
+
46
+ var argsWithFormat = args.map(function (item) {
47
+ return String(item);
48
+ }); // Careful: RN currently depends on this prefix
49
+
50
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
51
+ // breaks IE9: https://github.com/facebook/react/issues/13610
52
+ // eslint-disable-next-line react-internal/no-production-logging
53
+
54
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
55
+ }
56
+ }
57
+
58
+ function scheduleWork(callback) {
59
+ setImmediate(callback);
60
+ }
61
+ function flushBuffered(destination) {
62
+ // If we don't have any more data to send right now.
63
+ // Flush whatever is in the buffer to the wire.
64
+ if (typeof destination.flush === 'function') {
65
+ // By convention the Zlib streams provide a flush function for this purpose.
66
+ // For Express, compression middleware adds this method.
67
+ destination.flush();
68
+ }
69
+ }
70
+ function beginWriting(destination) {
71
+ // Older Node streams like http.createServer don't have this.
72
+ if (typeof destination.cork === 'function') {
73
+ destination.cork();
74
+ }
75
+ }
76
+ function writeChunkAndReturn(destination, chunk) {
77
+ var nodeBuffer = chunk; // close enough
78
+
79
+ return destination.write(nodeBuffer);
80
+ }
81
+ function completeWriting(destination) {
82
+ // Older Node streams like http.createServer don't have this.
83
+ if (typeof destination.uncork === 'function') {
84
+ destination.uncork();
85
+ }
86
+ }
87
+ function close(destination) {
88
+ destination.end();
89
+ }
90
+ function stringToChunk(content) {
91
+ return content;
92
+ }
93
+ function stringToPrecomputedChunk(content) {
94
+ return Buffer.from(content, 'utf8');
95
+ }
96
+ function closeWithError(destination, error) {
97
+ // $FlowFixMe: This is an Error object or the destination accepts other types.
98
+ destination.destroy(error);
99
+ }
100
+
101
+ // This file is an intermediate layer to translate between Flight
102
+ var stringify = JSON.stringify;
103
+
104
+ function serializeRowHeader(tag, id) {
105
+ return tag + id.toString(16) + ':';
106
+ }
107
+
108
+ function processErrorChunk(request, id, message, stack) {
109
+ var errorInfo = {
110
+ message: message,
111
+ stack: stack
112
+ };
113
+ var row = serializeRowHeader('E', id) + stringify(errorInfo) + '\n';
114
+ return stringToChunk(row);
115
+ }
116
+ function processModelChunk(request, id, model) {
117
+ var json = stringify(model, request.toJSON);
118
+ var row = serializeRowHeader('J', id) + json + '\n';
119
+ return stringToChunk(row);
120
+ }
121
+ function processModuleChunk(request, id, moduleMetaData) {
122
+ var json = stringify(moduleMetaData);
123
+ var row = serializeRowHeader('M', id) + json + '\n';
124
+ return stringToChunk(row);
125
+ }
126
+ function processProviderChunk(request, id, contextName) {
127
+ var row = serializeRowHeader('P', id) + contextName + '\n';
128
+ return stringToChunk(row);
129
+ }
130
+ function processSymbolChunk(request, id, name) {
131
+ var json = stringify(name);
132
+ var row = serializeRowHeader('S', id) + json + '\n';
133
+ return stringToChunk(row);
134
+ }
135
+
136
+ // eslint-disable-next-line no-unused-vars
137
+ var MODULE_TAG = Symbol.for('react.module.reference');
138
+ function getModuleKey(reference) {
139
+ return reference.filepath + '#' + reference.name;
140
+ }
141
+ function getModuleReference(reference) {
142
+ if (typeof reference === 'string') return globalThis.__STRING_REFERENCE_INDEX[reference];
143
+ return reference && reference.$$typeof === MODULE_TAG ? reference : undefined;
144
+ }
145
+ function resolveModuleMetaData(config, moduleReference) {
146
+ return {
147
+ id: moduleReference.filepath,
148
+ name: moduleReference.name
149
+ };
150
+ }
151
+
152
+ // ATTENTION
153
+ // When adding new symbols to this file,
154
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
155
+ // The Symbol used to tag the ReactElement-like types.
156
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
157
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
158
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
159
+ var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
160
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
161
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
162
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
163
+ var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
164
+
165
+ // A reserved attribute.
166
+ // It is handled by React separately and shouldn't be written to the DOM.
167
+ var RESERVED = 0; // A simple string attribute.
168
+ // Attributes that aren't in the filter are presumed to have this type.
169
+
170
+ var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
171
+ // "enumerated" attributes with "true" and "false" as possible values.
172
+ // When true, it should be set to a "true" string.
173
+ // When false, it should be set to a "false" string.
174
+
175
+ var BOOLEANISH_STRING = 2; // A real boolean attribute.
176
+ // When true, it should be present (set either to an empty string or its name).
177
+ // When false, it should be omitted.
178
+
179
+ var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
180
+ // When true, it should be present (set either to an empty string or its name).
181
+ // When false, it should be omitted.
182
+ // For any other value, should be present with that value.
183
+
184
+ var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
185
+ // When falsy, it should be removed.
186
+
187
+ var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
188
+ // When falsy, it should be removed.
189
+
190
+ var POSITIVE_NUMERIC = 6;
191
+
192
+ function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
193
+ this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
194
+ this.attributeName = attributeName;
195
+ this.attributeNamespace = attributeNamespace;
196
+ this.mustUseProperty = mustUseProperty;
197
+ this.propertyName = name;
198
+ this.type = type;
199
+ this.sanitizeURL = sanitizeURL;
200
+ this.removeEmptyString = removeEmptyString;
201
+ } // When adding attributes to this list, be sure to also add them to
202
+ // the `possibleStandardNames` module to ensure casing and incorrect
203
+ // name warnings.
204
+
205
+
206
+ var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
207
+
208
+ var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
209
+ // elements (not just inputs). Now that ReactDOMInput assigns to the
210
+ // defaultValue property -- do we need this?
211
+ 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
212
+
213
+ {
214
+ reservedProps.push('innerText', 'textContent');
215
+ }
216
+
217
+ reservedProps.forEach(function (name) {
218
+ properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
219
+ name, // attributeName
220
+ null, // attributeNamespace
221
+ false, // sanitizeURL
222
+ false);
223
+ }); // A few React string attributes have a different name.
224
+ // This is a mapping from React prop names to the attribute names.
225
+
226
+ [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
227
+ var name = _ref[0],
228
+ attributeName = _ref[1];
229
+ properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
230
+ attributeName, // attributeName
231
+ null, // attributeNamespace
232
+ false, // sanitizeURL
233
+ false);
234
+ }); // These are "enumerated" HTML attributes that accept "true" and "false".
235
+ // In React, we let users pass `true` and `false` even though technically
236
+ // these aren't boolean attributes (they are coerced to strings).
237
+
238
+ ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
239
+ properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
240
+ name.toLowerCase(), // attributeName
241
+ null, // attributeNamespace
242
+ false, // sanitizeURL
243
+ false);
244
+ }); // These are "enumerated" SVG attributes that accept "true" and "false".
245
+ // In React, we let users pass `true` and `false` even though technically
246
+ // these aren't boolean attributes (they are coerced to strings).
247
+ // Since these are SVG attributes, their attribute names are case-sensitive.
248
+
249
+ ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
250
+ properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
251
+ name, // attributeName
252
+ null, // attributeNamespace
253
+ false, // sanitizeURL
254
+ false);
255
+ }); // These are HTML boolean attributes.
256
+
257
+ ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
258
+ // on the client side because the browsers are inconsistent. Instead we call focus().
259
+ 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
260
+ 'itemScope'].forEach(function (name) {
261
+ properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
262
+ name.toLowerCase(), // attributeName
263
+ null, // attributeNamespace
264
+ false, // sanitizeURL
265
+ false);
266
+ }); // These are the few React props that we set as DOM properties
267
+ // rather than attributes. These are all booleans.
268
+
269
+ ['checked', // Note: `option.selected` is not updated if `select.multiple` is
270
+ // disabled with `removeAttribute`. We have special logic for handling this.
271
+ 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
272
+ // you'll need to set attributeName to name.toLowerCase()
273
+ // instead in the assignment below.
274
+ ].forEach(function (name) {
275
+ properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
276
+ name, // attributeName
277
+ null, // attributeNamespace
278
+ false, // sanitizeURL
279
+ false);
280
+ }); // These are HTML attributes that are "overloaded booleans": they behave like
281
+ // booleans, but can also accept a string value.
282
+
283
+ ['capture', 'download' // NOTE: if you add a camelCased prop to this list,
284
+ // you'll need to set attributeName to name.toLowerCase()
285
+ // instead in the assignment below.
286
+ ].forEach(function (name) {
287
+ properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
288
+ name, // attributeName
289
+ null, // attributeNamespace
290
+ false, // sanitizeURL
291
+ false);
292
+ }); // These are HTML attributes that must be positive numbers.
293
+
294
+ ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
295
+ // you'll need to set attributeName to name.toLowerCase()
296
+ // instead in the assignment below.
297
+ ].forEach(function (name) {
298
+ properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
299
+ name, // attributeName
300
+ null, // attributeNamespace
301
+ false, // sanitizeURL
302
+ false);
303
+ }); // These are HTML attributes that must be numbers.
304
+
305
+ ['rowSpan', 'start'].forEach(function (name) {
306
+ properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
307
+ name.toLowerCase(), // attributeName
308
+ null, // attributeNamespace
309
+ false, // sanitizeURL
310
+ false);
311
+ });
312
+ var CAMELIZE = /[\-\:]([a-z])/g;
313
+
314
+ var capitalize = function (token) {
315
+ return token[1].toUpperCase();
316
+ }; // This is a list of all SVG attributes that need special casing, namespacing,
317
+ // or boolean value assignment. Regular attributes that just accept strings
318
+ // and have the same names are omitted, just like in the HTML attribute filter.
319
+ // Some of these attributes can be hard to find. This list was created by
320
+ // scraping the MDN documentation.
321
+
322
+
323
+ ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
324
+ // you'll need to set attributeName to name.toLowerCase()
325
+ // instead in the assignment below.
326
+ ].forEach(function (attributeName) {
327
+ var name = attributeName.replace(CAMELIZE, capitalize);
328
+ properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
329
+ attributeName, null, // attributeNamespace
330
+ false, // sanitizeURL
331
+ false);
332
+ }); // String SVG attributes with the xlink namespace.
333
+
334
+ ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
335
+ // you'll need to set attributeName to name.toLowerCase()
336
+ // instead in the assignment below.
337
+ ].forEach(function (attributeName) {
338
+ var name = attributeName.replace(CAMELIZE, capitalize);
339
+ properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
340
+ attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL
341
+ false);
342
+ }); // String SVG attributes with the xml namespace.
343
+
344
+ ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
345
+ // you'll need to set attributeName to name.toLowerCase()
346
+ // instead in the assignment below.
347
+ ].forEach(function (attributeName) {
348
+ var name = attributeName.replace(CAMELIZE, capitalize);
349
+ properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
350
+ attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL
351
+ false);
352
+ }); // These attribute exists both in HTML and SVG.
353
+ // The attribute name is case-sensitive in SVG so we can't just use
354
+ // the React name like we do for attributes that exist only in HTML.
355
+
356
+ ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
357
+ properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
358
+ attributeName.toLowerCase(), // attributeName
359
+ null, // attributeNamespace
360
+ false, // sanitizeURL
361
+ false);
362
+ }); // These attributes accept URLs. These must not allow javascript: URLS.
363
+ // These will also need to accept Trusted Types object in the future.
364
+
365
+ var xlinkHref = 'xlinkHref';
366
+ properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
367
+ 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL
368
+ false);
369
+ ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
370
+ properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
371
+ attributeName.toLowerCase(), // attributeName
372
+ null, // attributeNamespace
373
+ true, // sanitizeURL
374
+ true);
375
+ });
376
+
377
+ /**
378
+ * CSS properties which accept numbers but are not in units of "px".
379
+ */
380
+ var isUnitlessNumber = {
381
+ animationIterationCount: true,
382
+ aspectRatio: true,
383
+ borderImageOutset: true,
384
+ borderImageSlice: true,
385
+ borderImageWidth: true,
386
+ boxFlex: true,
387
+ boxFlexGroup: true,
388
+ boxOrdinalGroup: true,
389
+ columnCount: true,
390
+ columns: true,
391
+ flex: true,
392
+ flexGrow: true,
393
+ flexPositive: true,
394
+ flexShrink: true,
395
+ flexNegative: true,
396
+ flexOrder: true,
397
+ gridArea: true,
398
+ gridRow: true,
399
+ gridRowEnd: true,
400
+ gridRowSpan: true,
401
+ gridRowStart: true,
402
+ gridColumn: true,
403
+ gridColumnEnd: true,
404
+ gridColumnSpan: true,
405
+ gridColumnStart: true,
406
+ fontWeight: true,
407
+ lineClamp: true,
408
+ lineHeight: true,
409
+ opacity: true,
410
+ order: true,
411
+ orphans: true,
412
+ tabSize: true,
413
+ widows: true,
414
+ zIndex: true,
415
+ zoom: true,
416
+ // SVG-related properties
417
+ fillOpacity: true,
418
+ floodOpacity: true,
419
+ stopOpacity: true,
420
+ strokeDasharray: true,
421
+ strokeDashoffset: true,
422
+ strokeMiterlimit: true,
423
+ strokeOpacity: true,
424
+ strokeWidth: true
425
+ };
426
+ /**
427
+ * @param {string} prefix vendor-specific prefix, eg: Webkit
428
+ * @param {string} key style name, eg: transitionDuration
429
+ * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
430
+ * WebkitTransitionDuration
431
+ */
432
+
433
+ function prefixKey(prefix, key) {
434
+ return prefix + key.charAt(0).toUpperCase() + key.substring(1);
435
+ }
436
+ /**
437
+ * Support style names that may come passed in prefixed by adding permutations
438
+ * of vendor prefixes.
439
+ */
440
+
441
+
442
+ var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
443
+ // infinite loop, because it iterates over the newly added props too.
444
+
445
+ Object.keys(isUnitlessNumber).forEach(function (prop) {
446
+ prefixes.forEach(function (prefix) {
447
+ isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
448
+ });
449
+ });
450
+
451
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
452
+
453
+ function isArray(a) {
454
+ return isArrayImpl(a);
455
+ }
456
+
457
+ var startInlineScript = stringToPrecomputedChunk('<script>');
458
+ var endInlineScript = stringToPrecomputedChunk('</script>');
459
+ var startScriptSrc = stringToPrecomputedChunk('<script src="');
460
+ var startModuleSrc = stringToPrecomputedChunk('<script type="module" src="');
461
+ var endAsyncScript = stringToPrecomputedChunk('" async=""></script>'); // Allows us to keep track of what we've already written so we can refer back to it.
462
+
463
+ var textSeparator = stringToPrecomputedChunk('<!-- -->');
464
+
465
+ var styleAttributeStart = stringToPrecomputedChunk(' style="');
466
+ var styleAssign = stringToPrecomputedChunk(':');
467
+ var styleSeparator = stringToPrecomputedChunk(';');
468
+
469
+ var attributeSeparator = stringToPrecomputedChunk(' ');
470
+ var attributeAssign = stringToPrecomputedChunk('="');
471
+ var attributeEnd = stringToPrecomputedChunk('"');
472
+ var attributeEmptyString = stringToPrecomputedChunk('=""');
473
+
474
+ var endOfStartTag = stringToPrecomputedChunk('>');
475
+ var endOfStartTagSelfClosing = stringToPrecomputedChunk('/>');
476
+
477
+ var selectedMarkerAttribute = stringToPrecomputedChunk(' selected=""');
478
+
479
+ var leadingNewline = stringToPrecomputedChunk('\n');
480
+
481
+ var DOCTYPE = stringToPrecomputedChunk('<!DOCTYPE html>');
482
+ var endTag1 = stringToPrecomputedChunk('</');
483
+ var endTag2 = stringToPrecomputedChunk('>');
484
+ // A placeholder is a node inside a hidden partial tree that can be filled in later, but before
485
+ // display. It's never visible to users. We use the template tag because it can be used in every
486
+ // type of parent. <script> tags also work in every other tag except <colgroup>.
487
+
488
+ var placeholder1 = stringToPrecomputedChunk('<template id="');
489
+ var placeholder2 = stringToPrecomputedChunk('"></template>');
490
+
491
+ var startCompletedSuspenseBoundary = stringToPrecomputedChunk('<!--$-->');
492
+ var startPendingSuspenseBoundary1 = stringToPrecomputedChunk('<!--$?--><template id="');
493
+ var startPendingSuspenseBoundary2 = stringToPrecomputedChunk('"></template>');
494
+ var startClientRenderedSuspenseBoundary = stringToPrecomputedChunk('<!--$!-->');
495
+ var endSuspenseBoundary = stringToPrecomputedChunk('<!--/$-->');
496
+ var startSegmentHTML = stringToPrecomputedChunk('<div hidden id="');
497
+ var startSegmentHTML2 = stringToPrecomputedChunk('">');
498
+ var endSegmentHTML = stringToPrecomputedChunk('</div>');
499
+ var startSegmentSVG = stringToPrecomputedChunk('<svg aria-hidden="true" style="display:none" id="');
500
+ var startSegmentSVG2 = stringToPrecomputedChunk('">');
501
+ var endSegmentSVG = stringToPrecomputedChunk('</svg>');
502
+ var startSegmentMathML = stringToPrecomputedChunk('<math aria-hidden="true" style="display:none" id="');
503
+ var startSegmentMathML2 = stringToPrecomputedChunk('">');
504
+ var endSegmentMathML = stringToPrecomputedChunk('</math>');
505
+ var startSegmentTable = stringToPrecomputedChunk('<table hidden id="');
506
+ var startSegmentTable2 = stringToPrecomputedChunk('">');
507
+ var endSegmentTable = stringToPrecomputedChunk('</table>');
508
+ var startSegmentTableBody = stringToPrecomputedChunk('<table hidden><tbody id="');
509
+ var startSegmentTableBody2 = stringToPrecomputedChunk('">');
510
+ var endSegmentTableBody = stringToPrecomputedChunk('</tbody></table>');
511
+ var startSegmentTableRow = stringToPrecomputedChunk('<table hidden><tr id="');
512
+ var startSegmentTableRow2 = stringToPrecomputedChunk('">');
513
+ var endSegmentTableRow = stringToPrecomputedChunk('</tr></table>');
514
+ var startSegmentColGroup = stringToPrecomputedChunk('<table hidden><colgroup id="');
515
+ var startSegmentColGroup2 = stringToPrecomputedChunk('">');
516
+ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
517
+ // The following code is the source scripts that we then minify and inline below,
518
+ // with renamed function names that we hope don't collide:
519
+ // const COMMENT_NODE = 8;
520
+ // const SUSPENSE_START_DATA = '$';
521
+ // const SUSPENSE_END_DATA = '/$';
522
+ // const SUSPENSE_PENDING_START_DATA = '$?';
523
+ // const SUSPENSE_FALLBACK_START_DATA = '$!';
524
+ //
525
+ // function clientRenderBoundary(suspenseBoundaryID) {
526
+ // // Find the fallback's first element.
527
+ // const suspenseIdNode = document.getElementById(suspenseBoundaryID);
528
+ // if (!suspenseIdNode) {
529
+ // // The user must have already navigated away from this tree.
530
+ // // E.g. because the parent was hydrated.
531
+ // return;
532
+ // }
533
+ // // Find the boundary around the fallback. This is always the previous node.
534
+ // const suspenseNode = suspenseIdNode.previousSibling;
535
+ // // Tag it to be client rendered.
536
+ // suspenseNode.data = SUSPENSE_FALLBACK_START_DATA;
537
+ // // Tell React to retry it if the parent already hydrated.
538
+ // if (suspenseNode._reactRetry) {
539
+ // suspenseNode._reactRetry();
540
+ // }
541
+ // }
542
+ //
543
+ // function completeBoundary(suspenseBoundaryID, contentID) {
544
+ // // Find the fallback's first element.
545
+ // const suspenseIdNode = document.getElementById(suspenseBoundaryID);
546
+ // const contentNode = document.getElementById(contentID);
547
+ // // We'll detach the content node so that regardless of what happens next we don't leave in the tree.
548
+ // // This might also help by not causing recalcing each time we move a child from here to the target.
549
+ // contentNode.parentNode.removeChild(contentNode);
550
+ // if (!suspenseIdNode) {
551
+ // // The user must have already navigated away from this tree.
552
+ // // E.g. because the parent was hydrated. That's fine there's nothing to do
553
+ // // but we have to make sure that we already deleted the container node.
554
+ // return;
555
+ // }
556
+ // // Find the boundary around the fallback. This is always the previous node.
557
+ // const suspenseNode = suspenseIdNode.previousSibling;
558
+ //
559
+ // // Clear all the existing children. This is complicated because
560
+ // // there can be embedded Suspense boundaries in the fallback.
561
+ // // This is similar to clearSuspenseBoundary in ReactDOMHostConfig.
562
+ // // TODO: We could avoid this if we never emitted suspense boundaries in fallback trees.
563
+ // // They never hydrate anyway. However, currently we support incrementally loading the fallback.
564
+ // const parentInstance = suspenseNode.parentNode;
565
+ // let node = suspenseNode.nextSibling;
566
+ // let depth = 0;
567
+ // do {
568
+ // if (node && node.nodeType === COMMENT_NODE) {
569
+ // const data = node.data;
570
+ // if (data === SUSPENSE_END_DATA) {
571
+ // if (depth === 0) {
572
+ // break;
573
+ // } else {
574
+ // depth--;
575
+ // }
576
+ // } else if (
577
+ // data === SUSPENSE_START_DATA ||
578
+ // data === SUSPENSE_PENDING_START_DATA ||
579
+ // data === SUSPENSE_FALLBACK_START_DATA
580
+ // ) {
581
+ // depth++;
582
+ // }
583
+ // }
584
+ //
585
+ // const nextNode = node.nextSibling;
586
+ // parentInstance.removeChild(node);
587
+ // node = nextNode;
588
+ // } while (node);
589
+ //
590
+ // const endOfBoundary = node;
591
+ //
592
+ // // Insert all the children from the contentNode between the start and end of suspense boundary.
593
+ // while (contentNode.firstChild) {
594
+ // parentInstance.insertBefore(contentNode.firstChild, endOfBoundary);
595
+ // }
596
+ // suspenseNode.data = SUSPENSE_START_DATA;
597
+ // if (suspenseNode._reactRetry) {
598
+ // suspenseNode._reactRetry();
599
+ // }
600
+ // }
601
+ //
602
+ // function completeSegment(containerID, placeholderID) {
603
+ // const segmentContainer = document.getElementById(containerID);
604
+ // const placeholderNode = document.getElementById(placeholderID);
605
+ // // We always expect both nodes to exist here because, while we might
606
+ // // have navigated away from the main tree, we still expect the detached
607
+ // // tree to exist.
608
+ // segmentContainer.parentNode.removeChild(segmentContainer);
609
+ // while (segmentContainer.firstChild) {
610
+ // placeholderNode.parentNode.insertBefore(
611
+ // segmentContainer.firstChild,
612
+ // placeholderNode,
613
+ // );
614
+ // }
615
+ // placeholderNode.parentNode.removeChild(placeholderNode);
616
+ // }
617
+
618
+ var completeSegmentFunction = 'function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}';
619
+ var completeBoundaryFunction = 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}}';
620
+ var clientRenderFunction = 'function $RX(a){if(a=document.getElementById(a))a=a.previousSibling,a.data="$!",a._reactRetry&&a._reactRetry()}';
621
+ var completeSegmentScript1Full = stringToPrecomputedChunk(completeSegmentFunction + ';$RS("');
622
+ var completeSegmentScript1Partial = stringToPrecomputedChunk('$RS("');
623
+ var completeSegmentScript2 = stringToPrecomputedChunk('","');
624
+ var completeSegmentScript3 = stringToPrecomputedChunk('")</script>');
625
+ var completeBoundaryScript1Full = stringToPrecomputedChunk(completeBoundaryFunction + ';$RC("');
626
+ var completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("');
627
+ var completeBoundaryScript2 = stringToPrecomputedChunk('","');
628
+ var completeBoundaryScript3 = stringToPrecomputedChunk('")</script>');
629
+ var clientRenderScript1Full = stringToPrecomputedChunk(clientRenderFunction + ';$RX("');
630
+ var clientRenderScript1Partial = stringToPrecomputedChunk('$RX("');
631
+ var clientRenderScript2 = stringToPrecomputedChunk('")</script>');
632
+
633
+ var rendererSigil;
634
+
635
+ {
636
+ // Use this to detect multiple renderers using the same context
637
+ rendererSigil = {};
638
+ } // Used to store the parent path of all context overrides in a shared linked list.
639
+ // Forming a reverse tree.
640
+
641
+
642
+ var rootContextSnapshot = null; // We assume that this runtime owns the "current" field on all ReactContext instances.
643
+ // This global (actually thread local) state represents what state all those "current",
644
+ // fields are currently in.
645
+
646
+ var currentActiveSnapshot = null;
647
+
648
+ function popNode(prev) {
649
+ {
650
+ prev.context._currentValue = prev.parentValue;
651
+ }
652
+ }
653
+
654
+ function pushNode(next) {
655
+ {
656
+ next.context._currentValue = next.value;
657
+ }
658
+ }
659
+
660
+ function popToNearestCommonAncestor(prev, next) {
661
+ if (prev === next) ; else {
662
+ popNode(prev);
663
+ var parentPrev = prev.parent;
664
+ var parentNext = next.parent;
665
+
666
+ if (parentPrev === null) {
667
+ if (parentNext !== null) {
668
+ throw new Error('The stacks must reach the root at the same time. This is a bug in React.');
669
+ }
670
+ } else {
671
+ if (parentNext === null) {
672
+ throw new Error('The stacks must reach the root at the same time. This is a bug in React.');
673
+ }
674
+
675
+ popToNearestCommonAncestor(parentPrev, parentNext); // On the way back, we push the new ones that weren't common.
676
+
677
+ pushNode(next);
678
+ }
679
+ }
680
+ }
681
+
682
+ function popAllPrevious(prev) {
683
+ popNode(prev);
684
+ var parentPrev = prev.parent;
685
+
686
+ if (parentPrev !== null) {
687
+ popAllPrevious(parentPrev);
688
+ }
689
+ }
690
+
691
+ function pushAllNext(next) {
692
+ var parentNext = next.parent;
693
+
694
+ if (parentNext !== null) {
695
+ pushAllNext(parentNext);
696
+ }
697
+
698
+ pushNode(next);
699
+ }
700
+
701
+ function popPreviousToCommonLevel(prev, next) {
702
+ popNode(prev);
703
+ var parentPrev = prev.parent;
704
+
705
+ if (parentPrev === null) {
706
+ throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');
707
+ }
708
+
709
+ if (parentPrev.depth === next.depth) {
710
+ // We found the same level. Now we just need to find a shared ancestor.
711
+ popToNearestCommonAncestor(parentPrev, next);
712
+ } else {
713
+ // We must still be deeper.
714
+ popPreviousToCommonLevel(parentPrev, next);
715
+ }
716
+ }
717
+
718
+ function popNextToCommonLevel(prev, next) {
719
+ var parentNext = next.parent;
720
+
721
+ if (parentNext === null) {
722
+ throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');
723
+ }
724
+
725
+ if (prev.depth === parentNext.depth) {
726
+ // We found the same level. Now we just need to find a shared ancestor.
727
+ popToNearestCommonAncestor(prev, parentNext);
728
+ } else {
729
+ // We must still be deeper.
730
+ popNextToCommonLevel(prev, parentNext);
731
+ }
732
+
733
+ pushNode(next);
734
+ } // Perform context switching to the new snapshot.
735
+ // To make it cheap to read many contexts, while not suspending, we make the switch eagerly by
736
+ // updating all the context's current values. That way reads, always just read the current value.
737
+ // At the cost of updating contexts even if they're never read by this subtree.
738
+
739
+
740
+ function switchContext(newSnapshot) {
741
+ // The basic algorithm we need to do is to pop back any contexts that are no longer on the stack.
742
+ // We also need to update any new contexts that are now on the stack with the deepest value.
743
+ // The easiest way to update new contexts is to just reapply them in reverse order from the
744
+ // perspective of the backpointers. To avoid allocating a lot when switching, we use the stack
745
+ // for that. Therefore this algorithm is recursive.
746
+ // 1) First we pop which ever snapshot tree was deepest. Popping old contexts as we go.
747
+ // 2) Then we find the nearest common ancestor from there. Popping old contexts as we go.
748
+ // 3) Then we reapply new contexts on the way back up the stack.
749
+ var prev = currentActiveSnapshot;
750
+ var next = newSnapshot;
751
+
752
+ if (prev !== next) {
753
+ if (prev === null) {
754
+ // $FlowFixMe: This has to be non-null since it's not equal to prev.
755
+ pushAllNext(next);
756
+ } else if (next === null) {
757
+ popAllPrevious(prev);
758
+ } else if (prev.depth === next.depth) {
759
+ popToNearestCommonAncestor(prev, next);
760
+ } else if (prev.depth > next.depth) {
761
+ popPreviousToCommonLevel(prev, next);
762
+ } else {
763
+ popNextToCommonLevel(prev, next);
764
+ }
765
+
766
+ currentActiveSnapshot = next;
767
+ }
768
+ }
769
+ function pushProvider(context, nextValue) {
770
+ var prevValue;
771
+
772
+ {
773
+ prevValue = context._currentValue;
774
+ context._currentValue = nextValue;
775
+
776
+ {
777
+ if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
778
+ error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');
779
+ }
780
+
781
+ context._currentRenderer = rendererSigil;
782
+ }
783
+ }
784
+
785
+ var prevNode = currentActiveSnapshot;
786
+ var newNode = {
787
+ parent: prevNode,
788
+ depth: prevNode === null ? 0 : prevNode.depth + 1,
789
+ context: context,
790
+ parentValue: prevValue,
791
+ value: nextValue
792
+ };
793
+ currentActiveSnapshot = newNode;
794
+ return newNode;
795
+ }
796
+ function popProvider() {
797
+ var prevSnapshot = currentActiveSnapshot;
798
+
799
+ if (prevSnapshot === null) {
800
+ throw new Error('Tried to pop a Context at the root of the app. This is a bug in React.');
801
+ }
802
+
803
+ {
804
+ var value = prevSnapshot.parentValue;
805
+
806
+ if (value === REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED) {
807
+ prevSnapshot.context._currentValue = prevSnapshot.context._defaultValue;
808
+ } else {
809
+ prevSnapshot.context._currentValue = value;
810
+ }
811
+ }
812
+
813
+ return currentActiveSnapshot = prevSnapshot.parent;
814
+ }
815
+ function getActiveContext() {
816
+ return currentActiveSnapshot;
817
+ }
818
+ function readContext(context) {
819
+ var value = context._currentValue ;
820
+ return value;
821
+ }
822
+
823
+ function readContext$1(context) {
824
+ {
825
+ if (context.$$typeof !== REACT_SERVER_CONTEXT_TYPE) {
826
+ error('Only ServerContext is supported in Flight');
827
+ }
828
+
829
+ if (currentCache === null) {
830
+ error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
831
+ }
832
+ }
833
+
834
+ return readContext(context);
835
+ }
836
+
837
+ var Dispatcher = {
838
+ useMemo: function (nextCreate) {
839
+ return nextCreate();
840
+ },
841
+ useCallback: function (callback) {
842
+ return callback;
843
+ },
844
+ useDebugValue: function () {},
845
+ useDeferredValue: unsupportedHook,
846
+ useTransition: unsupportedHook,
847
+ getCacheForType: function (resourceType) {
848
+ if (!currentCache) {
849
+ throw new Error('Reading the cache is only supported while rendering.');
850
+ }
851
+
852
+ var entry = currentCache.get(resourceType);
853
+
854
+ if (entry === undefined) {
855
+ entry = resourceType(); // TODO: Warn if undefined?
856
+
857
+ currentCache.set(resourceType, entry);
858
+ }
859
+
860
+ return entry;
861
+ },
862
+ readContext: readContext$1,
863
+ useContext: readContext$1,
864
+ useReducer: unsupportedHook,
865
+ useRef: unsupportedHook,
866
+ useState: unsupportedHook,
867
+ useInsertionEffect: unsupportedHook,
868
+ useLayoutEffect: unsupportedHook,
869
+ useImperativeHandle: unsupportedHook,
870
+ useEffect: unsupportedHook,
871
+ useId: unsupportedHook,
872
+ useMutableSource: unsupportedHook,
873
+ useSyncExternalStore: unsupportedHook,
874
+ useCacheRefresh: function () {
875
+ return unsupportedRefresh;
876
+ }
877
+ };
878
+
879
+ function unsupportedHook() {
880
+ throw new Error('This Hook is not supported in Server Components.');
881
+ }
882
+
883
+ function unsupportedRefresh() {
884
+ if (!currentCache) {
885
+ throw new Error('Refreshing the cache is not supported in Server Components.');
886
+ }
887
+ }
888
+
889
+ var currentCache = null;
890
+ function setCurrentCache(cache) {
891
+ currentCache = cache;
892
+ return currentCache;
893
+ }
894
+ function getCurrentCache() {
895
+ return currentCache;
896
+ }
897
+
898
+ var ContextRegistry = ReactSharedInternals.ContextRegistry;
899
+ function getOrCreateServerContext(globalName) {
900
+ if (!ContextRegistry[globalName]) {
901
+ ContextRegistry[globalName] = React.createServerContext(globalName, REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED);
902
+ }
903
+
904
+ return ContextRegistry[globalName];
905
+ }
906
+
907
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
908
+
909
+ function defaultErrorHandler(error) {
910
+ console['error'](error); // Don't transform to our wrapper
911
+ }
912
+
913
+ var OPEN = 0;
914
+ var CLOSING = 1;
915
+ var CLOSED = 2;
916
+ function createRequest(model, bundlerConfig, onError, context) {
917
+ var pingedSegments = [];
918
+ var request = {
919
+ status: OPEN,
920
+ fatalError: null,
921
+ destination: null,
922
+ bundlerConfig: bundlerConfig,
923
+ cache: new Map(),
924
+ nextChunkId: 0,
925
+ pendingChunks: 0,
926
+ pingedSegments: pingedSegments,
927
+ completedModuleChunks: [],
928
+ completedJSONChunks: [],
929
+ completedErrorChunks: [],
930
+ writtenSymbols: new Map(),
931
+ writtenModules: new Map(),
932
+ writtenProviders: new Map(),
933
+ onError: onError === undefined ? defaultErrorHandler : onError,
934
+ toJSON: function (key, value) {
935
+ return resolveModelToJSON(request, this, key, value);
936
+ }
937
+ };
938
+ request.pendingChunks++;
939
+ var rootContext = createRootContext(context);
940
+ var rootSegment = createSegment(request, model, rootContext);
941
+ pingedSegments.push(rootSegment);
942
+ return request;
943
+ }
944
+
945
+ function createRootContext(reqContext) {
946
+ return importServerContexts(reqContext);
947
+ }
948
+
949
+ var POP = {};
950
+
951
+ function attemptResolveElement(type, key, ref, props) {
952
+ if (ref !== null && ref !== undefined) {
953
+ // When the ref moves to the regular props object this will implicitly
954
+ // throw for functions. We could probably relax it to a DEV warning for other
955
+ // cases.
956
+ throw new Error('Refs cannot be used in server components, nor passed to client components.');
957
+ }
958
+
959
+ if (getModuleReference(type)) {
960
+ // This is a reference to a client component.
961
+ return [REACT_ELEMENT_TYPE, type, key, props];
962
+ }
963
+
964
+ if (typeof type === 'function') {
965
+ // This is a server-side component.
966
+ return type(props);
967
+ } else if (typeof type === 'string') {
968
+ // This is a host element. E.g. HTML.
969
+ return [REACT_ELEMENT_TYPE, type, key, props];
970
+ } else if (typeof type === 'symbol') {
971
+ if (type === REACT_FRAGMENT_TYPE) {
972
+ // For key-less fragments, we add a small optimization to avoid serializing
973
+ // it as a wrapper.
974
+ // TODO: If a key is specified, we should propagate its key to any children.
975
+ // Same as if a server component has a key.
976
+ return props.children;
977
+ } // This might be a built-in React component. We'll let the client decide.
978
+ // Any built-in works as long as its props are serializable.
979
+
980
+
981
+ return [REACT_ELEMENT_TYPE, type, key, props];
982
+ } else if (type != null && typeof type === 'object') {
983
+ switch (type.$$typeof) {
984
+ case REACT_LAZY_TYPE:
985
+ {
986
+ var payload = type._payload;
987
+ var init = type._init;
988
+ var wrappedType = init(payload);
989
+ return attemptResolveElement(wrappedType, key, ref, props);
990
+ }
991
+
992
+ case REACT_FORWARD_REF_TYPE:
993
+ {
994
+ var render = type.render;
995
+ return render(props, undefined);
996
+ }
997
+
998
+ case REACT_MEMO_TYPE:
999
+ {
1000
+ return attemptResolveElement(type.type, key, ref, props);
1001
+ }
1002
+
1003
+ case REACT_PROVIDER_TYPE:
1004
+ {
1005
+ pushProvider(type._context, props.value);
1006
+
1007
+ {
1008
+ var extraKeys = Object.keys(props).filter(function (value) {
1009
+ if (value === 'children' || value === 'value') {
1010
+ return false;
1011
+ }
1012
+
1013
+ return true;
1014
+ });
1015
+
1016
+ if (extraKeys.length !== 0) {
1017
+ error('ServerContext can only have a value prop and children. Found: %s', JSON.stringify(extraKeys));
1018
+ }
1019
+ }
1020
+
1021
+ return [REACT_ELEMENT_TYPE, type, key, // Rely on __popProvider being serialized last to pop the provider.
1022
+ {
1023
+ value: props.value,
1024
+ children: props.children,
1025
+ __pop: POP
1026
+ }];
1027
+ }
1028
+ }
1029
+ }
1030
+
1031
+ throw new Error("Unsupported server component type: " + describeValueForErrorMessage(type));
1032
+ }
1033
+
1034
+ function pingSegment(request, segment) {
1035
+ var pingedSegments = request.pingedSegments;
1036
+ pingedSegments.push(segment);
1037
+
1038
+ if (pingedSegments.length === 1) {
1039
+ scheduleWork(function () {
1040
+ return performWork(request);
1041
+ });
1042
+ }
1043
+ }
1044
+
1045
+ function createSegment(request, model, context) {
1046
+ var id = request.nextChunkId++;
1047
+ var segment = {
1048
+ id: id,
1049
+ model: model,
1050
+ context: context,
1051
+ ping: function () {
1052
+ return pingSegment(request, segment);
1053
+ }
1054
+ };
1055
+ return segment;
1056
+ }
1057
+
1058
+ function serializeByValueID(id) {
1059
+ return '$' + id.toString(16);
1060
+ }
1061
+
1062
+ function serializeByRefID(id) {
1063
+ return '@' + id.toString(16);
1064
+ }
1065
+
1066
+ function escapeStringValue(value) {
1067
+ if (value[0] === '$' || value[0] === '@') {
1068
+ // We need to escape $ or @ prefixed strings since we use those to encode
1069
+ // references to IDs and as special symbol values.
1070
+ return '$' + value;
1071
+ } else {
1072
+ return value;
1073
+ }
1074
+ }
1075
+
1076
+ function isObjectPrototype(object) {
1077
+ if (!object) {
1078
+ return false;
1079
+ }
1080
+
1081
+ var ObjectPrototype = Object.prototype;
1082
+
1083
+ if (object === ObjectPrototype) {
1084
+ return true;
1085
+ } // It might be an object from a different Realm which is
1086
+ // still just a plain simple object.
1087
+
1088
+
1089
+ if (Object.getPrototypeOf(object)) {
1090
+ return false;
1091
+ }
1092
+
1093
+ var names = Object.getOwnPropertyNames(object);
1094
+
1095
+ for (var i = 0; i < names.length; i++) {
1096
+ if (!(names[i] in ObjectPrototype)) {
1097
+ return false;
1098
+ }
1099
+ }
1100
+
1101
+ return true;
1102
+ }
1103
+
1104
+ function isSimpleObject(object) {
1105
+ if (!isObjectPrototype(Object.getPrototypeOf(object))) {
1106
+ return false;
1107
+ }
1108
+
1109
+ var names = Object.getOwnPropertyNames(object);
1110
+
1111
+ for (var i = 0; i < names.length; i++) {
1112
+ var descriptor = Object.getOwnPropertyDescriptor(object, names[i]);
1113
+
1114
+ if (!descriptor) {
1115
+ return false;
1116
+ }
1117
+
1118
+ if (!descriptor.enumerable) {
1119
+ if ((names[i] === 'key' || names[i] === 'ref') && typeof descriptor.get === 'function') {
1120
+ // React adds key and ref getters to props objects to issue warnings.
1121
+ // Those getters will not be transferred to the client, but that's ok,
1122
+ // so we'll special case them.
1123
+ continue;
1124
+ }
1125
+
1126
+ return false;
1127
+ }
1128
+ }
1129
+
1130
+ return true;
1131
+ }
1132
+
1133
+ function objectName(object) {
1134
+ var name = Object.prototype.toString.call(object);
1135
+ return name.replace(/^\[object (.*)\]$/, function (m, p0) {
1136
+ return p0;
1137
+ });
1138
+ }
1139
+
1140
+ function describeKeyForErrorMessage(key) {
1141
+ var encodedKey = JSON.stringify(key);
1142
+ return '"' + key + '"' === encodedKey ? key : encodedKey;
1143
+ }
1144
+
1145
+ function describeValueForErrorMessage(value) {
1146
+ switch (typeof value) {
1147
+ case 'string':
1148
+ {
1149
+ return JSON.stringify(value.length <= 10 ? value : value.substr(0, 10) + '...');
1150
+ }
1151
+
1152
+ case 'object':
1153
+ {
1154
+ if (isArray(value)) {
1155
+ return '[...]';
1156
+ }
1157
+
1158
+ var name = objectName(value);
1159
+
1160
+ if (name === 'Object') {
1161
+ return '{...}';
1162
+ }
1163
+
1164
+ return name;
1165
+ }
1166
+
1167
+ case 'function':
1168
+ return 'function';
1169
+
1170
+ default:
1171
+ // eslint-disable-next-line react-internal/safe-string-coercion
1172
+ return String(value);
1173
+ }
1174
+ }
1175
+
1176
+ function describeObjectForErrorMessage(objectOrArray, expandedName) {
1177
+ if (isArray(objectOrArray)) {
1178
+ var str = '[';
1179
+ var array = objectOrArray;
1180
+
1181
+ for (var i = 0; i < array.length; i++) {
1182
+ if (i > 0) {
1183
+ str += ', ';
1184
+ }
1185
+
1186
+ if (i > 6) {
1187
+ str += '...';
1188
+ break;
1189
+ }
1190
+
1191
+ var _value = array[i];
1192
+
1193
+ if ('' + i === expandedName && typeof _value === 'object' && _value !== null) {
1194
+ str += describeObjectForErrorMessage(_value);
1195
+ } else {
1196
+ str += describeValueForErrorMessage(_value);
1197
+ }
1198
+ }
1199
+
1200
+ str += ']';
1201
+ return str;
1202
+ } else {
1203
+ var _str = '{';
1204
+ var object = objectOrArray;
1205
+ var names = Object.keys(object);
1206
+
1207
+ for (var _i = 0; _i < names.length; _i++) {
1208
+ if (_i > 0) {
1209
+ _str += ', ';
1210
+ }
1211
+
1212
+ if (_i > 6) {
1213
+ _str += '...';
1214
+ break;
1215
+ }
1216
+
1217
+ var name = names[_i];
1218
+ _str += describeKeyForErrorMessage(name) + ': ';
1219
+ var _value2 = object[name];
1220
+
1221
+ if (name === expandedName && typeof _value2 === 'object' && _value2 !== null) {
1222
+ _str += describeObjectForErrorMessage(_value2);
1223
+ } else {
1224
+ _str += describeValueForErrorMessage(_value2);
1225
+ }
1226
+ }
1227
+
1228
+ _str += '}';
1229
+ return _str;
1230
+ }
1231
+ }
1232
+
1233
+ var insideContextProps = null;
1234
+ var isInsideContextValue = false;
1235
+ function resolveModelToJSON(request, parent, key, value) {
1236
+ {
1237
+ // $FlowFixMe
1238
+ var originalValue = parent[key];
1239
+
1240
+ if (typeof originalValue === 'object' && originalValue !== value) {
1241
+ error('Only plain objects can be passed to client components from server components. ' + 'Objects with toJSON methods are not supported. Convert it manually ' + 'to a simple value before passing it to props. ' + 'Remove %s from these props: %s', describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent));
1242
+ }
1243
+ } // Special Symbols
1244
+
1245
+
1246
+ switch (value) {
1247
+ case REACT_ELEMENT_TYPE:
1248
+ return '$';
1249
+ }
1250
+
1251
+ {
1252
+ if (parent[0] === REACT_ELEMENT_TYPE && parent[1] && parent[1].$$typeof === REACT_PROVIDER_TYPE && key === '3') {
1253
+ insideContextProps = value;
1254
+ } else if (insideContextProps === parent && key === 'value') {
1255
+ isInsideContextValue = true;
1256
+ } else if (insideContextProps === parent && key === 'children') {
1257
+ isInsideContextValue = false;
1258
+ }
1259
+ } // Resolve server components.
1260
+
1261
+
1262
+ while (typeof value === 'object' && value !== null && (value.$$typeof === REACT_ELEMENT_TYPE || value.$$typeof === REACT_LAZY_TYPE)) {
1263
+ {
1264
+ if (isInsideContextValue) {
1265
+ error('React elements are not allowed in ServerContext');
1266
+ }
1267
+ }
1268
+
1269
+ try {
1270
+ switch (value.$$typeof) {
1271
+ case REACT_ELEMENT_TYPE:
1272
+ {
1273
+ // TODO: Concatenate keys of parents onto children.
1274
+ var element = value; // Attempt to render the server component.
1275
+
1276
+ value = attemptResolveElement(element.type, element.key, element.ref, element.props);
1277
+ break;
1278
+ }
1279
+
1280
+ case REACT_LAZY_TYPE:
1281
+ {
1282
+ var payload = value._payload;
1283
+ var init = value._init;
1284
+ value = init(payload);
1285
+ break;
1286
+ }
1287
+ }
1288
+ } catch (x) {
1289
+ if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
1290
+ // Something suspended, we'll need to create a new segment and resolve it later.
1291
+ request.pendingChunks++;
1292
+ var newSegment = createSegment(request, value, getActiveContext());
1293
+ var ping = newSegment.ping;
1294
+ x.then(ping, ping);
1295
+ return serializeByRefID(newSegment.id);
1296
+ } else {
1297
+ logRecoverableError(request, x); // Something errored. We'll still send everything we have up until this point.
1298
+ // We'll replace this element with a lazy reference that throws on the client
1299
+ // once it gets rendered.
1300
+
1301
+ request.pendingChunks++;
1302
+ var errorId = request.nextChunkId++;
1303
+ emitErrorChunk(request, errorId, x);
1304
+ return serializeByRefID(errorId);
1305
+ }
1306
+ }
1307
+ }
1308
+
1309
+ if (value === null) {
1310
+ return null;
1311
+ }
1312
+
1313
+ var moduleReference = getModuleReference(value);
1314
+
1315
+ if (moduleReference) {
1316
+ var moduleKey = getModuleKey(moduleReference);
1317
+ var writtenModules = request.writtenModules;
1318
+ var existingId = writtenModules.get(moduleKey);
1319
+
1320
+ if (existingId !== undefined) {
1321
+ if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1322
+ // If we're encoding the "type" of an element, we can refer
1323
+ // to that by a lazy reference instead of directly since React
1324
+ // knows how to deal with lazy values. This lets us suspend
1325
+ // on this component rather than its parent until the code has
1326
+ // loaded.
1327
+ return serializeByRefID(existingId);
1328
+ }
1329
+
1330
+ return serializeByValueID(existingId);
1331
+ }
1332
+
1333
+ try {
1334
+ var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
1335
+ request.pendingChunks++;
1336
+ var moduleId = request.nextChunkId++;
1337
+ emitModuleChunk(request, moduleId, moduleMetaData);
1338
+ writtenModules.set(moduleKey, moduleId);
1339
+
1340
+ if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1341
+ // If we're encoding the "type" of an element, we can refer
1342
+ // to that by a lazy reference instead of directly since React
1343
+ // knows how to deal with lazy values. This lets us suspend
1344
+ // on this component rather than its parent until the code has
1345
+ // loaded.
1346
+ return serializeByRefID(moduleId);
1347
+ }
1348
+
1349
+ return serializeByValueID(moduleId);
1350
+ } catch (x) {
1351
+ request.pendingChunks++;
1352
+
1353
+ var _errorId = request.nextChunkId++;
1354
+
1355
+ emitErrorChunk(request, _errorId, x);
1356
+ return serializeByValueID(_errorId);
1357
+ }
1358
+ }
1359
+
1360
+ if (typeof value === 'object') {
1361
+ if (value.$$typeof === REACT_PROVIDER_TYPE) {
1362
+ var providerKey = value._context._globalName;
1363
+ var writtenProviders = request.writtenProviders;
1364
+ var providerId = writtenProviders.get(key);
1365
+
1366
+ if (providerId === undefined) {
1367
+ request.pendingChunks++;
1368
+ providerId = request.nextChunkId++;
1369
+ writtenProviders.set(providerKey, providerId);
1370
+ emitProviderChunk(request, providerId, providerKey);
1371
+ }
1372
+
1373
+ return serializeByValueID(providerId);
1374
+ } else if (value === POP) {
1375
+ popProvider();
1376
+
1377
+ {
1378
+ insideContextProps = null;
1379
+ isInsideContextValue = false;
1380
+ }
1381
+
1382
+ return undefined;
1383
+ }
1384
+
1385
+ {
1386
+ if (value !== null && !isArray(value)) {
1387
+ // Verify that this is a simple plain object.
1388
+ if (objectName(value) !== 'Object') {
1389
+ error('Only plain objects can be passed to client components from server components. ' + 'Built-ins like %s are not supported. ' + 'Remove %s from these props: %s', objectName(value), describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent));
1390
+ } else if (!isSimpleObject(value)) {
1391
+ error('Only plain objects can be passed to client components from server components. ' + 'Classes or other objects with methods are not supported. ' + 'Remove %s from these props: %s', describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent, key));
1392
+ } else if (Object.getOwnPropertySymbols) {
1393
+ var symbols = Object.getOwnPropertySymbols(value);
1394
+
1395
+ if (symbols.length > 0) {
1396
+ error('Only plain objects can be passed to client components from server components. ' + 'Objects with symbol properties like %s are not supported. ' + 'Remove %s from these props: %s', symbols[0].description, describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent, key));
1397
+ }
1398
+ }
1399
+ }
1400
+ }
1401
+
1402
+ return value;
1403
+ }
1404
+
1405
+ if (typeof value === 'string') {
1406
+ return escapeStringValue(value);
1407
+ }
1408
+
1409
+ if (typeof value === 'boolean' || typeof value === 'number' || typeof value === 'undefined') {
1410
+ return value;
1411
+ }
1412
+
1413
+ if (typeof value === 'function') {
1414
+ if (/^on[A-Z]/.test(key)) {
1415
+ throw new Error('Event handlers cannot be passed to client component props. ' + ("Remove " + describeKeyForErrorMessage(key) + " from these props if possible: " + describeObjectForErrorMessage(parent) + "\n") + 'If you need interactivity, consider converting part of this to a client component.');
1416
+ } else {
1417
+ throw new Error('Functions cannot be passed directly to client components ' + "because they're not serializable. " + ("Remove " + describeKeyForErrorMessage(key) + " (" + (value.displayName || value.name || 'function') + ") from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1418
+ }
1419
+ }
1420
+
1421
+ if (typeof value === 'symbol') {
1422
+ var writtenSymbols = request.writtenSymbols;
1423
+
1424
+ var _existingId = writtenSymbols.get(value);
1425
+
1426
+ if (_existingId !== undefined) {
1427
+ return serializeByValueID(_existingId);
1428
+ }
1429
+
1430
+ var name = value.description;
1431
+
1432
+ if (Symbol.for(name) !== value) {
1433
+ throw new Error('Only global symbols received from Symbol.for(...) can be passed to client components. ' + ("The symbol Symbol.for(" + value.description + ") cannot be found among global symbols. ") + ("Remove " + describeKeyForErrorMessage(key) + " from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1434
+ }
1435
+
1436
+ request.pendingChunks++;
1437
+ var symbolId = request.nextChunkId++;
1438
+ emitSymbolChunk(request, symbolId, name);
1439
+ writtenSymbols.set(value, symbolId);
1440
+ return serializeByValueID(symbolId);
1441
+ } // $FlowFixMe: bigint isn't added to Flow yet.
1442
+
1443
+
1444
+ if (typeof value === 'bigint') {
1445
+ throw new Error("BigInt (" + value + ") is not yet supported in client component props. " + ("Remove " + describeKeyForErrorMessage(key) + " from this object or use a plain number instead: " + describeObjectForErrorMessage(parent)));
1446
+ }
1447
+
1448
+ throw new Error("Type " + typeof value + " is not supported in client component props. " + ("Remove " + describeKeyForErrorMessage(key) + " from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1449
+ }
1450
+
1451
+ function logRecoverableError(request, error) {
1452
+ var onError = request.onError;
1453
+ onError(error);
1454
+ }
1455
+
1456
+ function fatalError(request, error) {
1457
+ // This is called outside error handling code such as if an error happens in React internals.
1458
+ if (request.destination !== null) {
1459
+ request.status = CLOSED;
1460
+ closeWithError(request.destination, error);
1461
+ } else {
1462
+ request.status = CLOSING;
1463
+ request.fatalError = error;
1464
+ }
1465
+ }
1466
+
1467
+ function emitErrorChunk(request, id, error) {
1468
+ // TODO: We should not leak error messages to the client in prod.
1469
+ // Give this an error code instead and log on the server.
1470
+ // We can serialize the error in DEV as a convenience.
1471
+ var message;
1472
+ var stack = '';
1473
+
1474
+ try {
1475
+ if (error instanceof Error) {
1476
+ // eslint-disable-next-line react-internal/safe-string-coercion
1477
+ message = String(error.message); // eslint-disable-next-line react-internal/safe-string-coercion
1478
+
1479
+ stack = String(error.stack);
1480
+ } else {
1481
+ message = 'Error: ' + error;
1482
+ }
1483
+ } catch (x) {
1484
+ message = 'An error occurred but serializing the error message failed.';
1485
+ }
1486
+
1487
+ var processedChunk = processErrorChunk(request, id, message, stack);
1488
+ request.completedErrorChunks.push(processedChunk);
1489
+ }
1490
+
1491
+ function emitModuleChunk(request, id, moduleMetaData) {
1492
+ var processedChunk = processModuleChunk(request, id, moduleMetaData);
1493
+ request.completedModuleChunks.push(processedChunk);
1494
+ }
1495
+
1496
+ function emitSymbolChunk(request, id, name) {
1497
+ var processedChunk = processSymbolChunk(request, id, name);
1498
+ request.completedModuleChunks.push(processedChunk);
1499
+ }
1500
+
1501
+ function emitProviderChunk(request, id, contextName) {
1502
+ var processedChunk = processProviderChunk(request, id, contextName);
1503
+ request.completedJSONChunks.push(processedChunk);
1504
+ }
1505
+
1506
+ function retrySegment(request, segment) {
1507
+ switchContext(segment.context);
1508
+
1509
+ try {
1510
+ var _value3 = segment.model;
1511
+
1512
+ while (typeof _value3 === 'object' && _value3 !== null && _value3.$$typeof === REACT_ELEMENT_TYPE) {
1513
+ // TODO: Concatenate keys of parents onto children.
1514
+ var element = _value3; // Attempt to render the server component.
1515
+ // Doing this here lets us reuse this same segment if the next component
1516
+ // also suspends.
1517
+
1518
+ segment.model = _value3;
1519
+ _value3 = attemptResolveElement(element.type, element.key, element.ref, element.props);
1520
+ }
1521
+
1522
+ var processedChunk = processModelChunk(request, segment.id, _value3);
1523
+ request.completedJSONChunks.push(processedChunk);
1524
+ } catch (x) {
1525
+ if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
1526
+ // Something suspended again, let's pick it back up later.
1527
+ var ping = segment.ping;
1528
+ x.then(ping, ping);
1529
+ return;
1530
+ } else {
1531
+ logRecoverableError(request, x); // This errored, we need to serialize this error to the
1532
+
1533
+ emitErrorChunk(request, segment.id, x);
1534
+ }
1535
+ }
1536
+ }
1537
+
1538
+ function performWork(request) {
1539
+ var prevDispatcher = ReactCurrentDispatcher.current;
1540
+ var prevCache = getCurrentCache();
1541
+ ReactCurrentDispatcher.current = Dispatcher;
1542
+ setCurrentCache(request.cache);
1543
+
1544
+ try {
1545
+ var pingedSegments = request.pingedSegments;
1546
+ request.pingedSegments = [];
1547
+
1548
+ for (var i = 0; i < pingedSegments.length; i++) {
1549
+ var segment = pingedSegments[i];
1550
+ retrySegment(request, segment);
1551
+ }
1552
+
1553
+ if (request.destination !== null) {
1554
+ flushCompletedChunks(request, request.destination);
1555
+ }
1556
+ } catch (error) {
1557
+ logRecoverableError(request, error);
1558
+ fatalError(request, error);
1559
+ } finally {
1560
+ ReactCurrentDispatcher.current = prevDispatcher;
1561
+ setCurrentCache(prevCache);
1562
+ }
1563
+ }
1564
+
1565
+ function flushCompletedChunks(request, destination) {
1566
+ beginWriting(destination);
1567
+
1568
+ try {
1569
+ // We emit module chunks first in the stream so that
1570
+ // they can be preloaded as early as possible.
1571
+ var moduleChunks = request.completedModuleChunks;
1572
+ var i = 0;
1573
+
1574
+ for (; i < moduleChunks.length; i++) {
1575
+ request.pendingChunks--;
1576
+ var chunk = moduleChunks[i];
1577
+ var keepWriting = writeChunkAndReturn(destination, chunk);
1578
+
1579
+ if (!keepWriting) {
1580
+ request.destination = null;
1581
+ i++;
1582
+ break;
1583
+ }
1584
+ }
1585
+
1586
+ moduleChunks.splice(0, i); // Next comes model data.
1587
+
1588
+ var jsonChunks = request.completedJSONChunks;
1589
+ i = 0;
1590
+
1591
+ for (; i < jsonChunks.length; i++) {
1592
+ request.pendingChunks--;
1593
+ var _chunk = jsonChunks[i];
1594
+
1595
+ var _keepWriting = writeChunkAndReturn(destination, _chunk);
1596
+
1597
+ if (!_keepWriting) {
1598
+ request.destination = null;
1599
+ i++;
1600
+ break;
1601
+ }
1602
+ }
1603
+
1604
+ jsonChunks.splice(0, i); // Finally, errors are sent. The idea is that it's ok to delay
1605
+ // any error messages and prioritize display of other parts of
1606
+ // the page.
1607
+
1608
+ var errorChunks = request.completedErrorChunks;
1609
+ i = 0;
1610
+
1611
+ for (; i < errorChunks.length; i++) {
1612
+ request.pendingChunks--;
1613
+ var _chunk2 = errorChunks[i];
1614
+
1615
+ var _keepWriting2 = writeChunkAndReturn(destination, _chunk2);
1616
+
1617
+ if (!_keepWriting2) {
1618
+ request.destination = null;
1619
+ i++;
1620
+ break;
1621
+ }
1622
+ }
1623
+
1624
+ errorChunks.splice(0, i);
1625
+ } finally {
1626
+ completeWriting(destination);
1627
+ }
1628
+
1629
+ flushBuffered(destination);
1630
+
1631
+ if (request.pendingChunks === 0) {
1632
+ // We're done.
1633
+ close(destination);
1634
+ }
1635
+ }
1636
+
1637
+ function startWork(request) {
1638
+ scheduleWork(function () {
1639
+ return performWork(request);
1640
+ });
1641
+ }
1642
+ function startFlowing(request, destination) {
1643
+ if (request.status === CLOSING) {
1644
+ request.status = CLOSED;
1645
+ closeWithError(destination, request.fatalError);
1646
+ return;
1647
+ }
1648
+
1649
+ if (request.status === CLOSED) {
1650
+ return;
1651
+ }
1652
+
1653
+ if (request.destination !== null) {
1654
+ // We're already flowing.
1655
+ return;
1656
+ }
1657
+
1658
+ request.destination = destination;
1659
+
1660
+ try {
1661
+ flushCompletedChunks(request, destination);
1662
+ } catch (error) {
1663
+ logRecoverableError(request, error);
1664
+ fatalError(request, error);
1665
+ }
1666
+ }
1667
+
1668
+ function importServerContexts(contexts) {
1669
+ if (contexts) {
1670
+ var prevContext = getActiveContext();
1671
+ switchContext(rootContextSnapshot);
1672
+
1673
+ for (var i = 0; i < contexts.length; i++) {
1674
+ var _contexts$i = contexts[i],
1675
+ name = _contexts$i[0],
1676
+ _value4 = _contexts$i[1];
1677
+ var context = getOrCreateServerContext(name);
1678
+ pushProvider(context, _value4);
1679
+ }
1680
+
1681
+ var importedContext = getActiveContext();
1682
+ switchContext(prevContext);
1683
+ return importedContext;
1684
+ }
1685
+
1686
+ return rootContextSnapshot;
1687
+ }
1688
+
1689
+ function createDrainHandler(destination, request) {
1690
+ return function () {
1691
+ return startFlowing(request, destination);
1692
+ };
1693
+ }
1694
+
1695
+ function renderToPipeableStream(model, options, context) {
1696
+ var request = createRequest(model, {}, // Manifest, not used
1697
+ options ? options.onError : undefined, context);
1698
+ var hasStartedFlowing = false;
1699
+ startWork(request);
1700
+ return {
1701
+ pipe: function (destination) {
1702
+ if (hasStartedFlowing) {
1703
+ throw new Error('React currently only supports piping to one writable stream.');
1704
+ }
1705
+
1706
+ hasStartedFlowing = true;
1707
+ startFlowing(request, destination);
1708
+ destination.on('drain', createDrainHandler(destination, request));
1709
+ return destination;
1710
+ }
1711
+ };
1712
+ }
1713
+
1714
+ exports.renderToPipeableStream = renderToPipeableStream;
1715
+ })();
1716
+ }