@shopify/hydrogen 1.0.0-alpha.22 → 1.0.0

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