@shopify/hydrogen-react 2022.10.8 → 2023.1.4

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 (612) hide show
  1. package/README.md +41 -47
  2. package/dist/browser-dev/AddToCartButton.mjs +43 -40
  3. package/dist/browser-dev/AddToCartButton.mjs.map +1 -1
  4. package/dist/browser-dev/BaseButton.mjs +13 -15
  5. package/dist/browser-dev/BaseButton.mjs.map +1 -1
  6. package/dist/browser-dev/BuyNowButton.mjs +19 -17
  7. package/dist/browser-dev/BuyNowButton.mjs.map +1 -1
  8. package/dist/browser-dev/CartCheckoutButton.mjs +12 -15
  9. package/dist/browser-dev/CartCheckoutButton.mjs.map +1 -1
  10. package/dist/browser-dev/CartCost.mjs +25 -0
  11. package/dist/browser-dev/CartCost.mjs.map +1 -0
  12. package/dist/browser-dev/CartLinePrice.mjs +18 -0
  13. package/dist/browser-dev/CartLinePrice.mjs.map +1 -0
  14. package/dist/browser-dev/CartLineProvider.mjs +19 -0
  15. package/dist/browser-dev/CartLineProvider.mjs.map +1 -0
  16. package/dist/browser-dev/CartProvider.mjs +73 -67
  17. package/dist/browser-dev/CartProvider.mjs.map +1 -1
  18. package/dist/browser-dev/ExternalVideo.mjs +13 -11
  19. package/dist/browser-dev/ExternalVideo.mjs.map +1 -1
  20. package/dist/browser-dev/Image.mjs +41 -30
  21. package/dist/browser-dev/Image.mjs.map +1 -1
  22. package/dist/browser-dev/MediaFile.mjs +29 -21
  23. package/dist/browser-dev/MediaFile.mjs.map +1 -1
  24. package/dist/browser-dev/ModelViewer.mjs +138 -76
  25. package/dist/browser-dev/ModelViewer.mjs.map +1 -1
  26. package/dist/browser-dev/Money.mjs +12 -9
  27. package/dist/browser-dev/Money.mjs.map +1 -1
  28. package/dist/browser-dev/ProductPrice.mjs +12 -17
  29. package/dist/browser-dev/ProductPrice.mjs.map +1 -1
  30. package/dist/browser-dev/ProductProvider.mjs +102 -73
  31. package/dist/browser-dev/ProductProvider.mjs.map +1 -1
  32. package/dist/browser-dev/ShopPayButton.mjs +14 -24
  33. package/dist/browser-dev/ShopPayButton.mjs.map +1 -1
  34. package/dist/browser-dev/ShopifyProvider.mjs +22 -38
  35. package/dist/browser-dev/ShopifyProvider.mjs.map +1 -1
  36. package/dist/browser-dev/Video.mjs +30 -21
  37. package/dist/browser-dev/Video.mjs.map +1 -1
  38. package/dist/browser-dev/_virtual/index.mjs +11 -2
  39. package/dist/browser-dev/_virtual/index.mjs.map +1 -1
  40. package/dist/browser-dev/_virtual/with-selector.mjs +11 -2
  41. package/dist/browser-dev/_virtual/with-selector.mjs.map +1 -1
  42. package/dist/browser-dev/analytics-constants.mjs +43 -0
  43. package/dist/browser-dev/analytics-constants.mjs.map +1 -0
  44. package/dist/browser-dev/analytics-schema-custom-storefront-customer-tracking.mjs +145 -0
  45. package/dist/browser-dev/analytics-schema-custom-storefront-customer-tracking.mjs.map +1 -0
  46. package/dist/browser-dev/analytics-schema-trekkie-storefront-page-view.mjs +58 -0
  47. package/dist/browser-dev/analytics-schema-trekkie-storefront-page-view.mjs.map +1 -0
  48. package/dist/browser-dev/analytics-utils.mjs +49 -0
  49. package/dist/browser-dev/analytics-utils.mjs.map +1 -0
  50. package/dist/browser-dev/analytics.mjs +159 -0
  51. package/dist/browser-dev/analytics.mjs.map +1 -0
  52. package/dist/browser-dev/cart-hooks.mjs +29 -34
  53. package/dist/browser-dev/cart-hooks.mjs.map +1 -1
  54. package/dist/browser-dev/cart-queries.mjs +50 -28
  55. package/dist/browser-dev/cart-queries.mjs.map +1 -1
  56. package/dist/browser-dev/codegen.helpers.mjs +1 -0
  57. package/dist/browser-dev/codegen.helpers.mjs.map +1 -1
  58. package/dist/browser-dev/cookies-utils.mjs +50 -0
  59. package/dist/browser-dev/cookies-utils.mjs.map +1 -0
  60. package/dist/browser-dev/flatten-connection.mjs +7 -5
  61. package/dist/browser-dev/flatten-connection.mjs.map +1 -1
  62. package/dist/browser-dev/image-size.mjs +8 -8
  63. package/dist/browser-dev/image-size.mjs.map +1 -1
  64. package/dist/browser-dev/index.mjs +20 -6
  65. package/dist/browser-dev/index.mjs.map +1 -1
  66. package/dist/browser-dev/load-script.mjs.map +1 -1
  67. package/dist/browser-dev/node_modules/@xstate/fsm/es/index.mjs.map +1 -1
  68. package/dist/browser-dev/node_modules/@xstate/react/es/fsm.mjs +2 -2
  69. package/dist/browser-dev/node_modules/@xstate/react/es/fsm.mjs.map +1 -1
  70. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +1 -1
  71. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
  72. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +1 -1
  73. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs.map +1 -1
  74. package/dist/browser-dev/node_modules/use-sync-external-store/shim/index.mjs +3 -3
  75. package/dist/browser-dev/node_modules/use-sync-external-store/shim/with-selector.mjs +1 -1
  76. package/dist/browser-dev/{metafield-parser.mjs → parse-metafield.mjs} +20 -12
  77. package/dist/browser-dev/parse-metafield.mjs.map +1 -0
  78. package/dist/browser-dev/storefront-api-constants.mjs +1 -1
  79. package/dist/browser-dev/storefront-api-constants.mjs.map +1 -1
  80. package/dist/browser-dev/storefront-client.mjs +19 -20
  81. package/dist/browser-dev/storefront-client.mjs.map +1 -1
  82. package/dist/browser-dev/useCartAPIStateMachine.mjs +111 -80
  83. package/dist/browser-dev/useCartAPIStateMachine.mjs.map +1 -1
  84. package/dist/browser-dev/useCartActions.mjs +150 -109
  85. package/dist/browser-dev/useCartActions.mjs.map +1 -1
  86. package/dist/browser-dev/useMoney.mjs +62 -36
  87. package/dist/browser-dev/useMoney.mjs.map +1 -1
  88. package/dist/browser-dev/useShopifyCookies.mjs +41 -0
  89. package/dist/browser-dev/useShopifyCookies.mjs.map +1 -0
  90. package/dist/browser-prod/AddToCartButton.mjs +43 -40
  91. package/dist/browser-prod/AddToCartButton.mjs.map +1 -1
  92. package/dist/browser-prod/BaseButton.mjs +13 -15
  93. package/dist/browser-prod/BaseButton.mjs.map +1 -1
  94. package/dist/browser-prod/BuyNowButton.mjs +19 -17
  95. package/dist/browser-prod/BuyNowButton.mjs.map +1 -1
  96. package/dist/browser-prod/CartCheckoutButton.mjs +12 -15
  97. package/dist/browser-prod/CartCheckoutButton.mjs.map +1 -1
  98. package/dist/browser-prod/CartCost.mjs +25 -0
  99. package/dist/browser-prod/CartCost.mjs.map +1 -0
  100. package/dist/browser-prod/CartLinePrice.mjs +18 -0
  101. package/dist/browser-prod/CartLinePrice.mjs.map +1 -0
  102. package/dist/browser-prod/CartLineProvider.mjs +19 -0
  103. package/dist/browser-prod/CartLineProvider.mjs.map +1 -0
  104. package/dist/browser-prod/CartProvider.mjs +73 -67
  105. package/dist/browser-prod/CartProvider.mjs.map +1 -1
  106. package/dist/browser-prod/ExternalVideo.mjs +13 -11
  107. package/dist/browser-prod/ExternalVideo.mjs.map +1 -1
  108. package/dist/browser-prod/Image.mjs +35 -28
  109. package/dist/browser-prod/Image.mjs.map +1 -1
  110. package/dist/browser-prod/MediaFile.mjs +29 -21
  111. package/dist/browser-prod/MediaFile.mjs.map +1 -1
  112. package/dist/browser-prod/ModelViewer.mjs +135 -75
  113. package/dist/browser-prod/ModelViewer.mjs.map +1 -1
  114. package/dist/browser-prod/Money.mjs +12 -9
  115. package/dist/browser-prod/Money.mjs.map +1 -1
  116. package/dist/browser-prod/ProductPrice.mjs +12 -17
  117. package/dist/browser-prod/ProductPrice.mjs.map +1 -1
  118. package/dist/browser-prod/ProductProvider.mjs +102 -73
  119. package/dist/browser-prod/ProductProvider.mjs.map +1 -1
  120. package/dist/browser-prod/ShopPayButton.mjs +14 -24
  121. package/dist/browser-prod/ShopPayButton.mjs.map +1 -1
  122. package/dist/browser-prod/ShopifyProvider.mjs +22 -32
  123. package/dist/browser-prod/ShopifyProvider.mjs.map +1 -1
  124. package/dist/browser-prod/Video.mjs +30 -21
  125. package/dist/browser-prod/Video.mjs.map +1 -1
  126. package/dist/browser-prod/_virtual/index.mjs +11 -2
  127. package/dist/browser-prod/_virtual/index.mjs.map +1 -1
  128. package/dist/browser-prod/_virtual/with-selector.mjs +11 -2
  129. package/dist/browser-prod/_virtual/with-selector.mjs.map +1 -1
  130. package/dist/browser-prod/analytics-constants.mjs +43 -0
  131. package/dist/browser-prod/analytics-constants.mjs.map +1 -0
  132. package/dist/browser-prod/analytics-schema-custom-storefront-customer-tracking.mjs +145 -0
  133. package/dist/browser-prod/analytics-schema-custom-storefront-customer-tracking.mjs.map +1 -0
  134. package/dist/browser-prod/analytics-schema-trekkie-storefront-page-view.mjs +58 -0
  135. package/dist/browser-prod/analytics-schema-trekkie-storefront-page-view.mjs.map +1 -0
  136. package/dist/browser-prod/analytics-utils.mjs +49 -0
  137. package/dist/browser-prod/analytics-utils.mjs.map +1 -0
  138. package/dist/browser-prod/analytics.mjs +158 -0
  139. package/dist/browser-prod/analytics.mjs.map +1 -0
  140. package/dist/browser-prod/cart-hooks.mjs +29 -34
  141. package/dist/browser-prod/cart-hooks.mjs.map +1 -1
  142. package/dist/browser-prod/cart-queries.mjs +50 -28
  143. package/dist/browser-prod/cart-queries.mjs.map +1 -1
  144. package/dist/browser-prod/codegen.helpers.mjs +1 -0
  145. package/dist/browser-prod/codegen.helpers.mjs.map +1 -1
  146. package/dist/browser-prod/cookies-utils.mjs +50 -0
  147. package/dist/browser-prod/cookies-utils.mjs.map +1 -0
  148. package/dist/browser-prod/flatten-connection.mjs +7 -5
  149. package/dist/browser-prod/flatten-connection.mjs.map +1 -1
  150. package/dist/browser-prod/image-size.mjs +8 -8
  151. package/dist/browser-prod/image-size.mjs.map +1 -1
  152. package/dist/browser-prod/index.mjs +20 -6
  153. package/dist/browser-prod/index.mjs.map +1 -1
  154. package/dist/browser-prod/load-script.mjs.map +1 -1
  155. package/dist/browser-prod/node_modules/@xstate/fsm/es/index.mjs.map +1 -1
  156. package/dist/browser-prod/node_modules/@xstate/react/es/fsm.mjs +2 -2
  157. package/dist/browser-prod/node_modules/@xstate/react/es/fsm.mjs.map +1 -1
  158. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +1 -1
  159. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
  160. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +1 -1
  161. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs.map +1 -1
  162. package/dist/browser-prod/node_modules/use-sync-external-store/shim/index.mjs +3 -3
  163. package/dist/browser-prod/node_modules/use-sync-external-store/shim/with-selector.mjs +1 -1
  164. package/dist/browser-prod/{metafield-parser.mjs → parse-metafield.mjs} +20 -12
  165. package/dist/browser-prod/parse-metafield.mjs.map +1 -0
  166. package/dist/browser-prod/storefront-api-constants.mjs +1 -1
  167. package/dist/browser-prod/storefront-api-constants.mjs.map +1 -1
  168. package/dist/browser-prod/storefront-client.mjs +19 -20
  169. package/dist/browser-prod/storefront-client.mjs.map +1 -1
  170. package/dist/browser-prod/useCartAPIStateMachine.mjs +111 -80
  171. package/dist/browser-prod/useCartAPIStateMachine.mjs.map +1 -1
  172. package/dist/browser-prod/useCartActions.mjs +150 -109
  173. package/dist/browser-prod/useCartActions.mjs.map +1 -1
  174. package/dist/browser-prod/useMoney.mjs +62 -36
  175. package/dist/browser-prod/useMoney.mjs.map +1 -1
  176. package/dist/browser-prod/useShopifyCookies.mjs +41 -0
  177. package/dist/browser-prod/useShopifyCookies.mjs.map +1 -0
  178. package/dist/node-dev/AddToCartButton.js +44 -41
  179. package/dist/node-dev/AddToCartButton.js.map +1 -1
  180. package/dist/node-dev/AddToCartButton.mjs +43 -40
  181. package/dist/node-dev/AddToCartButton.mjs.map +1 -1
  182. package/dist/node-dev/BaseButton.js +14 -16
  183. package/dist/node-dev/BaseButton.js.map +1 -1
  184. package/dist/node-dev/BaseButton.mjs +13 -15
  185. package/dist/node-dev/BaseButton.mjs.map +1 -1
  186. package/dist/node-dev/BuyNowButton.js +20 -18
  187. package/dist/node-dev/BuyNowButton.js.map +1 -1
  188. package/dist/node-dev/BuyNowButton.mjs +19 -17
  189. package/dist/node-dev/BuyNowButton.mjs.map +1 -1
  190. package/dist/node-dev/CartCheckoutButton.js +13 -16
  191. package/dist/node-dev/CartCheckoutButton.js.map +1 -1
  192. package/dist/node-dev/CartCheckoutButton.mjs +12 -15
  193. package/dist/node-dev/CartCheckoutButton.mjs.map +1 -1
  194. package/dist/node-dev/CartCost.js +25 -0
  195. package/dist/node-dev/CartCost.js.map +1 -0
  196. package/dist/node-dev/CartCost.mjs +25 -0
  197. package/dist/node-dev/CartCost.mjs.map +1 -0
  198. package/dist/node-dev/CartLinePrice.js +18 -0
  199. package/dist/node-dev/CartLinePrice.js.map +1 -0
  200. package/dist/node-dev/CartLinePrice.mjs +18 -0
  201. package/dist/node-dev/CartLinePrice.mjs.map +1 -0
  202. package/dist/node-dev/CartLineProvider.js +19 -0
  203. package/dist/node-dev/CartLineProvider.js.map +1 -0
  204. package/dist/node-dev/CartLineProvider.mjs +19 -0
  205. package/dist/node-dev/CartLineProvider.mjs.map +1 -0
  206. package/dist/node-dev/CartProvider.js +74 -68
  207. package/dist/node-dev/CartProvider.js.map +1 -1
  208. package/dist/node-dev/CartProvider.mjs +73 -67
  209. package/dist/node-dev/CartProvider.mjs.map +1 -1
  210. package/dist/node-dev/ExternalVideo.js +14 -12
  211. package/dist/node-dev/ExternalVideo.js.map +1 -1
  212. package/dist/node-dev/ExternalVideo.mjs +13 -11
  213. package/dist/node-dev/ExternalVideo.mjs.map +1 -1
  214. package/dist/node-dev/Image.js +42 -31
  215. package/dist/node-dev/Image.js.map +1 -1
  216. package/dist/node-dev/Image.mjs +41 -30
  217. package/dist/node-dev/Image.mjs.map +1 -1
  218. package/dist/node-dev/MediaFile.js +30 -22
  219. package/dist/node-dev/MediaFile.js.map +1 -1
  220. package/dist/node-dev/MediaFile.mjs +29 -21
  221. package/dist/node-dev/MediaFile.mjs.map +1 -1
  222. package/dist/node-dev/ModelViewer.js +139 -77
  223. package/dist/node-dev/ModelViewer.js.map +1 -1
  224. package/dist/node-dev/ModelViewer.mjs +138 -76
  225. package/dist/node-dev/ModelViewer.mjs.map +1 -1
  226. package/dist/node-dev/Money.js +13 -10
  227. package/dist/node-dev/Money.js.map +1 -1
  228. package/dist/node-dev/Money.mjs +12 -9
  229. package/dist/node-dev/Money.mjs.map +1 -1
  230. package/dist/node-dev/ProductPrice.js +13 -18
  231. package/dist/node-dev/ProductPrice.js.map +1 -1
  232. package/dist/node-dev/ProductPrice.mjs +12 -17
  233. package/dist/node-dev/ProductPrice.mjs.map +1 -1
  234. package/dist/node-dev/ProductProvider.js +103 -74
  235. package/dist/node-dev/ProductProvider.js.map +1 -1
  236. package/dist/node-dev/ProductProvider.mjs +102 -73
  237. package/dist/node-dev/ProductProvider.mjs.map +1 -1
  238. package/dist/node-dev/ShopPayButton.js +14 -24
  239. package/dist/node-dev/ShopPayButton.js.map +1 -1
  240. package/dist/node-dev/ShopPayButton.mjs +14 -24
  241. package/dist/node-dev/ShopPayButton.mjs.map +1 -1
  242. package/dist/node-dev/ShopifyProvider.js +23 -39
  243. package/dist/node-dev/ShopifyProvider.js.map +1 -1
  244. package/dist/node-dev/ShopifyProvider.mjs +22 -38
  245. package/dist/node-dev/ShopifyProvider.mjs.map +1 -1
  246. package/dist/node-dev/Video.js +31 -22
  247. package/dist/node-dev/Video.js.map +1 -1
  248. package/dist/node-dev/Video.mjs +30 -21
  249. package/dist/node-dev/Video.mjs.map +1 -1
  250. package/dist/node-dev/_virtual/index.js +11 -3
  251. package/dist/node-dev/_virtual/index.js.map +1 -1
  252. package/dist/node-dev/_virtual/index.mjs +11 -2
  253. package/dist/node-dev/_virtual/index.mjs.map +1 -1
  254. package/dist/node-dev/_virtual/use-sync-external-store-shim.development.js +1 -1
  255. package/dist/node-dev/_virtual/use-sync-external-store-shim.production.min.js +1 -1
  256. package/dist/node-dev/_virtual/with-selector.development.js +1 -1
  257. package/dist/node-dev/_virtual/with-selector.js +11 -3
  258. package/dist/node-dev/_virtual/with-selector.js.map +1 -1
  259. package/dist/node-dev/_virtual/with-selector.mjs +11 -2
  260. package/dist/node-dev/_virtual/with-selector.mjs.map +1 -1
  261. package/dist/node-dev/_virtual/with-selector.production.min.js +1 -1
  262. package/dist/node-dev/analytics-constants.js +43 -0
  263. package/dist/node-dev/analytics-constants.js.map +1 -0
  264. package/dist/node-dev/analytics-constants.mjs +43 -0
  265. package/dist/node-dev/analytics-constants.mjs.map +1 -0
  266. package/dist/node-dev/analytics-schema-custom-storefront-customer-tracking.js +145 -0
  267. package/dist/node-dev/analytics-schema-custom-storefront-customer-tracking.js.map +1 -0
  268. package/dist/node-dev/analytics-schema-custom-storefront-customer-tracking.mjs +145 -0
  269. package/dist/node-dev/analytics-schema-custom-storefront-customer-tracking.mjs.map +1 -0
  270. package/dist/node-dev/analytics-schema-trekkie-storefront-page-view.js +58 -0
  271. package/dist/node-dev/analytics-schema-trekkie-storefront-page-view.js.map +1 -0
  272. package/dist/node-dev/analytics-schema-trekkie-storefront-page-view.mjs +58 -0
  273. package/dist/node-dev/analytics-schema-trekkie-storefront-page-view.mjs.map +1 -0
  274. package/dist/node-dev/analytics-utils.js +49 -0
  275. package/dist/node-dev/analytics-utils.js.map +1 -0
  276. package/dist/node-dev/analytics-utils.mjs +49 -0
  277. package/dist/node-dev/analytics-utils.mjs.map +1 -0
  278. package/dist/node-dev/analytics.js +159 -0
  279. package/dist/node-dev/analytics.js.map +1 -0
  280. package/dist/node-dev/analytics.mjs +159 -0
  281. package/dist/node-dev/analytics.mjs.map +1 -0
  282. package/dist/node-dev/cart-constants.js +1 -1
  283. package/dist/node-dev/cart-hooks.js +29 -34
  284. package/dist/node-dev/cart-hooks.js.map +1 -1
  285. package/dist/node-dev/cart-hooks.mjs +29 -34
  286. package/dist/node-dev/cart-hooks.mjs.map +1 -1
  287. package/dist/node-dev/cart-queries.js +51 -29
  288. package/dist/node-dev/cart-queries.js.map +1 -1
  289. package/dist/node-dev/cart-queries.mjs +50 -28
  290. package/dist/node-dev/cart-queries.mjs.map +1 -1
  291. package/dist/node-dev/codegen.helpers.js +2 -1
  292. package/dist/node-dev/codegen.helpers.js.map +1 -1
  293. package/dist/node-dev/codegen.helpers.mjs +1 -0
  294. package/dist/node-dev/codegen.helpers.mjs.map +1 -1
  295. package/dist/node-dev/cookies-utils.js +50 -0
  296. package/dist/node-dev/cookies-utils.js.map +1 -0
  297. package/dist/node-dev/cookies-utils.mjs +50 -0
  298. package/dist/node-dev/cookies-utils.mjs.map +1 -0
  299. package/dist/node-dev/flatten-connection.js +8 -6
  300. package/dist/node-dev/flatten-connection.js.map +1 -1
  301. package/dist/node-dev/flatten-connection.mjs +7 -5
  302. package/dist/node-dev/flatten-connection.mjs.map +1 -1
  303. package/dist/node-dev/image-size.js +9 -9
  304. package/dist/node-dev/image-size.js.map +1 -1
  305. package/dist/node-dev/image-size.mjs +8 -8
  306. package/dist/node-dev/image-size.mjs.map +1 -1
  307. package/dist/node-dev/index.js +21 -7
  308. package/dist/node-dev/index.js.map +1 -1
  309. package/dist/node-dev/index.mjs +20 -6
  310. package/dist/node-dev/index.mjs.map +1 -1
  311. package/dist/node-dev/load-script.js +1 -1
  312. package/dist/node-dev/load-script.js.map +1 -1
  313. package/dist/node-dev/load-script.mjs.map +1 -1
  314. package/dist/node-dev/node_modules/@xstate/fsm/es/index.js +1 -1
  315. package/dist/node-dev/node_modules/@xstate/fsm/es/index.js.map +1 -1
  316. package/dist/node-dev/node_modules/@xstate/fsm/es/index.mjs.map +1 -1
  317. package/dist/node-dev/node_modules/@xstate/react/es/fsm.js +2 -2
  318. package/dist/node-dev/node_modules/@xstate/react/es/fsm.js.map +1 -1
  319. package/dist/node-dev/node_modules/@xstate/react/es/fsm.mjs +2 -2
  320. package/dist/node-dev/node_modules/@xstate/react/es/fsm.mjs.map +1 -1
  321. package/dist/node-dev/node_modules/@xstate/react/es/useConstant.js +2 -4
  322. package/dist/node-dev/node_modules/@xstate/react/es/useConstant.js.map +1 -1
  323. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +2 -4
  324. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -1
  325. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +1 -1
  326. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +2 -4
  327. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -1
  328. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
  329. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +2 -4
  330. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
  331. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +1 -1
  332. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +2 -4
  333. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -1
  334. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs.map +1 -1
  335. package/dist/node-dev/node_modules/use-sync-external-store/shim/index.js +4 -4
  336. package/dist/node-dev/node_modules/use-sync-external-store/shim/index.mjs +3 -3
  337. package/dist/node-dev/node_modules/use-sync-external-store/shim/with-selector.js +1 -1
  338. package/dist/node-dev/node_modules/use-sync-external-store/shim/with-selector.mjs +1 -1
  339. package/dist/node-dev/{metafield-parser.js → parse-metafield.js} +21 -13
  340. package/dist/node-dev/parse-metafield.js.map +1 -0
  341. package/dist/node-dev/{metafield-parser.mjs → parse-metafield.mjs} +20 -12
  342. package/dist/node-dev/parse-metafield.mjs.map +1 -0
  343. package/dist/node-dev/storefront-api-constants.js +2 -2
  344. package/dist/node-dev/storefront-api-constants.js.map +1 -1
  345. package/dist/node-dev/storefront-api-constants.mjs +1 -1
  346. package/dist/node-dev/storefront-api-constants.mjs.map +1 -1
  347. package/dist/node-dev/storefront-client.js +20 -21
  348. package/dist/node-dev/storefront-client.js.map +1 -1
  349. package/dist/node-dev/storefront-client.mjs +19 -20
  350. package/dist/node-dev/storefront-client.mjs.map +1 -1
  351. package/dist/node-dev/useCartAPIStateMachine.js +112 -81
  352. package/dist/node-dev/useCartAPIStateMachine.js.map +1 -1
  353. package/dist/node-dev/useCartAPIStateMachine.mjs +111 -80
  354. package/dist/node-dev/useCartAPIStateMachine.mjs.map +1 -1
  355. package/dist/node-dev/useCartActions.js +151 -110
  356. package/dist/node-dev/useCartActions.js.map +1 -1
  357. package/dist/node-dev/useCartActions.mjs +150 -109
  358. package/dist/node-dev/useCartActions.mjs.map +1 -1
  359. package/dist/node-dev/useMoney.js +63 -37
  360. package/dist/node-dev/useMoney.js.map +1 -1
  361. package/dist/node-dev/useMoney.mjs +62 -36
  362. package/dist/node-dev/useMoney.mjs.map +1 -1
  363. package/dist/node-dev/useShopifyCookies.js +41 -0
  364. package/dist/node-dev/useShopifyCookies.js.map +1 -0
  365. package/dist/node-dev/useShopifyCookies.mjs +41 -0
  366. package/dist/node-dev/useShopifyCookies.mjs.map +1 -0
  367. package/dist/node-prod/AddToCartButton.js +44 -41
  368. package/dist/node-prod/AddToCartButton.js.map +1 -1
  369. package/dist/node-prod/AddToCartButton.mjs +43 -40
  370. package/dist/node-prod/AddToCartButton.mjs.map +1 -1
  371. package/dist/node-prod/BaseButton.js +14 -16
  372. package/dist/node-prod/BaseButton.js.map +1 -1
  373. package/dist/node-prod/BaseButton.mjs +13 -15
  374. package/dist/node-prod/BaseButton.mjs.map +1 -1
  375. package/dist/node-prod/BuyNowButton.js +20 -18
  376. package/dist/node-prod/BuyNowButton.js.map +1 -1
  377. package/dist/node-prod/BuyNowButton.mjs +19 -17
  378. package/dist/node-prod/BuyNowButton.mjs.map +1 -1
  379. package/dist/node-prod/CartCheckoutButton.js +13 -16
  380. package/dist/node-prod/CartCheckoutButton.js.map +1 -1
  381. package/dist/node-prod/CartCheckoutButton.mjs +12 -15
  382. package/dist/node-prod/CartCheckoutButton.mjs.map +1 -1
  383. package/dist/node-prod/CartCost.js +25 -0
  384. package/dist/node-prod/CartCost.js.map +1 -0
  385. package/dist/node-prod/CartCost.mjs +25 -0
  386. package/dist/node-prod/CartCost.mjs.map +1 -0
  387. package/dist/node-prod/CartLinePrice.js +18 -0
  388. package/dist/node-prod/CartLinePrice.js.map +1 -0
  389. package/dist/node-prod/CartLinePrice.mjs +18 -0
  390. package/dist/node-prod/CartLinePrice.mjs.map +1 -0
  391. package/dist/node-prod/CartLineProvider.js +19 -0
  392. package/dist/node-prod/CartLineProvider.js.map +1 -0
  393. package/dist/node-prod/CartLineProvider.mjs +19 -0
  394. package/dist/node-prod/CartLineProvider.mjs.map +1 -0
  395. package/dist/node-prod/CartProvider.js +74 -68
  396. package/dist/node-prod/CartProvider.js.map +1 -1
  397. package/dist/node-prod/CartProvider.mjs +73 -67
  398. package/dist/node-prod/CartProvider.mjs.map +1 -1
  399. package/dist/node-prod/ExternalVideo.js +14 -12
  400. package/dist/node-prod/ExternalVideo.js.map +1 -1
  401. package/dist/node-prod/ExternalVideo.mjs +13 -11
  402. package/dist/node-prod/ExternalVideo.mjs.map +1 -1
  403. package/dist/node-prod/Image.js +36 -29
  404. package/dist/node-prod/Image.js.map +1 -1
  405. package/dist/node-prod/Image.mjs +35 -28
  406. package/dist/node-prod/Image.mjs.map +1 -1
  407. package/dist/node-prod/MediaFile.js +30 -22
  408. package/dist/node-prod/MediaFile.js.map +1 -1
  409. package/dist/node-prod/MediaFile.mjs +29 -21
  410. package/dist/node-prod/MediaFile.mjs.map +1 -1
  411. package/dist/node-prod/ModelViewer.js +136 -76
  412. package/dist/node-prod/ModelViewer.js.map +1 -1
  413. package/dist/node-prod/ModelViewer.mjs +135 -75
  414. package/dist/node-prod/ModelViewer.mjs.map +1 -1
  415. package/dist/node-prod/Money.js +13 -10
  416. package/dist/node-prod/Money.js.map +1 -1
  417. package/dist/node-prod/Money.mjs +12 -9
  418. package/dist/node-prod/Money.mjs.map +1 -1
  419. package/dist/node-prod/ProductPrice.js +13 -18
  420. package/dist/node-prod/ProductPrice.js.map +1 -1
  421. package/dist/node-prod/ProductPrice.mjs +12 -17
  422. package/dist/node-prod/ProductPrice.mjs.map +1 -1
  423. package/dist/node-prod/ProductProvider.js +103 -74
  424. package/dist/node-prod/ProductProvider.js.map +1 -1
  425. package/dist/node-prod/ProductProvider.mjs +102 -73
  426. package/dist/node-prod/ProductProvider.mjs.map +1 -1
  427. package/dist/node-prod/ShopPayButton.js +14 -24
  428. package/dist/node-prod/ShopPayButton.js.map +1 -1
  429. package/dist/node-prod/ShopPayButton.mjs +14 -24
  430. package/dist/node-prod/ShopPayButton.mjs.map +1 -1
  431. package/dist/node-prod/ShopifyProvider.js +23 -33
  432. package/dist/node-prod/ShopifyProvider.js.map +1 -1
  433. package/dist/node-prod/ShopifyProvider.mjs +22 -32
  434. package/dist/node-prod/ShopifyProvider.mjs.map +1 -1
  435. package/dist/node-prod/Video.js +31 -22
  436. package/dist/node-prod/Video.js.map +1 -1
  437. package/dist/node-prod/Video.mjs +30 -21
  438. package/dist/node-prod/Video.mjs.map +1 -1
  439. package/dist/node-prod/_virtual/index.js +11 -3
  440. package/dist/node-prod/_virtual/index.js.map +1 -1
  441. package/dist/node-prod/_virtual/index.mjs +11 -2
  442. package/dist/node-prod/_virtual/index.mjs.map +1 -1
  443. package/dist/node-prod/_virtual/use-sync-external-store-shim.development.js +1 -1
  444. package/dist/node-prod/_virtual/use-sync-external-store-shim.production.min.js +1 -1
  445. package/dist/node-prod/_virtual/with-selector.development.js +1 -1
  446. package/dist/node-prod/_virtual/with-selector.js +11 -3
  447. package/dist/node-prod/_virtual/with-selector.js.map +1 -1
  448. package/dist/node-prod/_virtual/with-selector.mjs +11 -2
  449. package/dist/node-prod/_virtual/with-selector.mjs.map +1 -1
  450. package/dist/node-prod/_virtual/with-selector.production.min.js +1 -1
  451. package/dist/node-prod/analytics-constants.js +43 -0
  452. package/dist/node-prod/analytics-constants.js.map +1 -0
  453. package/dist/node-prod/analytics-constants.mjs +43 -0
  454. package/dist/node-prod/analytics-constants.mjs.map +1 -0
  455. package/dist/node-prod/analytics-schema-custom-storefront-customer-tracking.js +145 -0
  456. package/dist/node-prod/analytics-schema-custom-storefront-customer-tracking.js.map +1 -0
  457. package/dist/node-prod/analytics-schema-custom-storefront-customer-tracking.mjs +145 -0
  458. package/dist/node-prod/analytics-schema-custom-storefront-customer-tracking.mjs.map +1 -0
  459. package/dist/node-prod/analytics-schema-trekkie-storefront-page-view.js +58 -0
  460. package/dist/node-prod/analytics-schema-trekkie-storefront-page-view.js.map +1 -0
  461. package/dist/node-prod/analytics-schema-trekkie-storefront-page-view.mjs +58 -0
  462. package/dist/node-prod/analytics-schema-trekkie-storefront-page-view.mjs.map +1 -0
  463. package/dist/node-prod/analytics-utils.js +49 -0
  464. package/dist/node-prod/analytics-utils.js.map +1 -0
  465. package/dist/node-prod/analytics-utils.mjs +49 -0
  466. package/dist/node-prod/analytics-utils.mjs.map +1 -0
  467. package/dist/node-prod/analytics.js +158 -0
  468. package/dist/node-prod/analytics.js.map +1 -0
  469. package/dist/node-prod/analytics.mjs +158 -0
  470. package/dist/node-prod/analytics.mjs.map +1 -0
  471. package/dist/node-prod/cart-constants.js +1 -1
  472. package/dist/node-prod/cart-hooks.js +29 -34
  473. package/dist/node-prod/cart-hooks.js.map +1 -1
  474. package/dist/node-prod/cart-hooks.mjs +29 -34
  475. package/dist/node-prod/cart-hooks.mjs.map +1 -1
  476. package/dist/node-prod/cart-queries.js +51 -29
  477. package/dist/node-prod/cart-queries.js.map +1 -1
  478. package/dist/node-prod/cart-queries.mjs +50 -28
  479. package/dist/node-prod/cart-queries.mjs.map +1 -1
  480. package/dist/node-prod/codegen.helpers.js +2 -1
  481. package/dist/node-prod/codegen.helpers.js.map +1 -1
  482. package/dist/node-prod/codegen.helpers.mjs +1 -0
  483. package/dist/node-prod/codegen.helpers.mjs.map +1 -1
  484. package/dist/node-prod/cookies-utils.js +50 -0
  485. package/dist/node-prod/cookies-utils.js.map +1 -0
  486. package/dist/node-prod/cookies-utils.mjs +50 -0
  487. package/dist/node-prod/cookies-utils.mjs.map +1 -0
  488. package/dist/node-prod/flatten-connection.js +8 -6
  489. package/dist/node-prod/flatten-connection.js.map +1 -1
  490. package/dist/node-prod/flatten-connection.mjs +7 -5
  491. package/dist/node-prod/flatten-connection.mjs.map +1 -1
  492. package/dist/node-prod/image-size.js +9 -9
  493. package/dist/node-prod/image-size.js.map +1 -1
  494. package/dist/node-prod/image-size.mjs +8 -8
  495. package/dist/node-prod/image-size.mjs.map +1 -1
  496. package/dist/node-prod/index.js +21 -7
  497. package/dist/node-prod/index.js.map +1 -1
  498. package/dist/node-prod/index.mjs +20 -6
  499. package/dist/node-prod/index.mjs.map +1 -1
  500. package/dist/node-prod/load-script.js +1 -1
  501. package/dist/node-prod/load-script.js.map +1 -1
  502. package/dist/node-prod/load-script.mjs.map +1 -1
  503. package/dist/node-prod/node_modules/@xstate/fsm/es/index.js +1 -1
  504. package/dist/node-prod/node_modules/@xstate/fsm/es/index.js.map +1 -1
  505. package/dist/node-prod/node_modules/@xstate/fsm/es/index.mjs.map +1 -1
  506. package/dist/node-prod/node_modules/@xstate/react/es/fsm.js +2 -2
  507. package/dist/node-prod/node_modules/@xstate/react/es/fsm.js.map +1 -1
  508. package/dist/node-prod/node_modules/@xstate/react/es/fsm.mjs +2 -2
  509. package/dist/node-prod/node_modules/@xstate/react/es/fsm.mjs.map +1 -1
  510. package/dist/node-prod/node_modules/@xstate/react/es/useConstant.js +2 -4
  511. package/dist/node-prod/node_modules/@xstate/react/es/useConstant.js.map +1 -1
  512. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +2 -4
  513. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -1
  514. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs.map +1 -1
  515. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +2 -4
  516. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -1
  517. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
  518. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +2 -4
  519. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
  520. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs.map +1 -1
  521. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +2 -4
  522. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -1
  523. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs.map +1 -1
  524. package/dist/node-prod/node_modules/use-sync-external-store/shim/index.js +4 -4
  525. package/dist/node-prod/node_modules/use-sync-external-store/shim/index.mjs +3 -3
  526. package/dist/node-prod/node_modules/use-sync-external-store/shim/with-selector.js +1 -1
  527. package/dist/node-prod/node_modules/use-sync-external-store/shim/with-selector.mjs +1 -1
  528. package/dist/node-prod/{metafield-parser.js → parse-metafield.js} +21 -13
  529. package/dist/node-prod/parse-metafield.js.map +1 -0
  530. package/dist/node-prod/{metafield-parser.mjs → parse-metafield.mjs} +20 -12
  531. package/dist/node-prod/parse-metafield.mjs.map +1 -0
  532. package/dist/node-prod/storefront-api-constants.js +2 -2
  533. package/dist/node-prod/storefront-api-constants.js.map +1 -1
  534. package/dist/node-prod/storefront-api-constants.mjs +1 -1
  535. package/dist/node-prod/storefront-api-constants.mjs.map +1 -1
  536. package/dist/node-prod/storefront-client.js +20 -21
  537. package/dist/node-prod/storefront-client.js.map +1 -1
  538. package/dist/node-prod/storefront-client.mjs +19 -20
  539. package/dist/node-prod/storefront-client.mjs.map +1 -1
  540. package/dist/node-prod/useCartAPIStateMachine.js +112 -81
  541. package/dist/node-prod/useCartAPIStateMachine.js.map +1 -1
  542. package/dist/node-prod/useCartAPIStateMachine.mjs +111 -80
  543. package/dist/node-prod/useCartAPIStateMachine.mjs.map +1 -1
  544. package/dist/node-prod/useCartActions.js +151 -110
  545. package/dist/node-prod/useCartActions.js.map +1 -1
  546. package/dist/node-prod/useCartActions.mjs +150 -109
  547. package/dist/node-prod/useCartActions.mjs.map +1 -1
  548. package/dist/node-prod/useMoney.js +63 -37
  549. package/dist/node-prod/useMoney.js.map +1 -1
  550. package/dist/node-prod/useMoney.mjs +62 -36
  551. package/dist/node-prod/useMoney.mjs.map +1 -1
  552. package/dist/node-prod/useShopifyCookies.js +41 -0
  553. package/dist/node-prod/useShopifyCookies.js.map +1 -0
  554. package/dist/node-prod/useShopifyCookies.mjs +41 -0
  555. package/dist/node-prod/useShopifyCookies.mjs.map +1 -0
  556. package/dist/types/AddToCartButton.d.ts +3 -2
  557. package/dist/types/BuyNowButton.d.ts +7 -3
  558. package/dist/types/CartCheckoutButton.d.ts +6 -5
  559. package/dist/types/CartCost.d.ts +7 -5
  560. package/dist/types/CartLinePrice.d.ts +4 -4
  561. package/dist/types/CartLineProvider.d.ts +8 -6
  562. package/dist/types/CartProvider.d.ts +12 -2
  563. package/dist/types/ExternalVideo.d.ts +1 -2
  564. package/dist/types/Image.d.ts +5 -3
  565. package/dist/types/MediaFile.d.ts +12 -11
  566. package/dist/types/ModelViewer.d.ts +2 -2
  567. package/dist/types/ProductPrice.d.ts +1 -1
  568. package/dist/types/ProductProvider.d.ts +1 -1
  569. package/dist/types/ShopPayButton.d.ts +10 -10
  570. package/dist/types/ShopifyProvider.d.ts +36 -40
  571. package/dist/types/analytics-constants.d.ts +48 -0
  572. package/dist/types/analytics-schema-custom-storefront-customer-tracking.d.ts +3 -0
  573. package/dist/types/analytics-schema-trekkie-storefront-page-view.d.ts +2 -0
  574. package/dist/types/analytics-types.d.ts +108 -0
  575. package/dist/types/analytics-utils.d.ts +36 -0
  576. package/dist/types/analytics.d.ts +9 -0
  577. package/dist/types/cart-queries.d.ts +1 -1
  578. package/dist/types/cookies-utils.d.ts +4 -0
  579. package/dist/types/flatten-connection.d.ts +29 -9
  580. package/dist/types/index.d.cts +11 -4
  581. package/dist/types/index.d.ts +11 -4
  582. package/dist/types/{metafield-parser.d.ts → parse-metafield.d.ts} +11 -9
  583. package/dist/types/storefront-api-constants.d.ts +1 -1
  584. package/dist/types/storefront-api-types.d.ts +121 -2
  585. package/dist/types/storefront-client.d.ts +14 -14
  586. package/dist/types/useCartActions.d.ts +1 -1
  587. package/dist/types/useShopifyCookies.d.ts +14 -0
  588. package/dist/umd/hydrogen-react.dev.js +1634 -1371
  589. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  590. package/dist/umd/hydrogen-react.prod.js +18 -25
  591. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  592. package/package.json +24 -19
  593. package/storefront.schema.json +1 -1
  594. package/dist/browser-dev/Metafield.mjs +0 -301
  595. package/dist/browser-dev/Metafield.mjs.map +0 -1
  596. package/dist/browser-dev/metafield-parser.mjs.map +0 -1
  597. package/dist/browser-prod/Metafield.mjs +0 -288
  598. package/dist/browser-prod/Metafield.mjs.map +0 -1
  599. package/dist/browser-prod/metafield-parser.mjs.map +0 -1
  600. package/dist/node-dev/Metafield.js +0 -301
  601. package/dist/node-dev/Metafield.js.map +0 -1
  602. package/dist/node-dev/Metafield.mjs +0 -301
  603. package/dist/node-dev/Metafield.mjs.map +0 -1
  604. package/dist/node-dev/metafield-parser.js.map +0 -1
  605. package/dist/node-dev/metafield-parser.mjs.map +0 -1
  606. package/dist/node-prod/Metafield.js +0 -288
  607. package/dist/node-prod/Metafield.js.map +0 -1
  608. package/dist/node-prod/Metafield.mjs +0 -288
  609. package/dist/node-prod/Metafield.mjs.map +0 -1
  610. package/dist/node-prod/metafield-parser.js.map +0 -1
  611. package/dist/node-prod/metafield-parser.mjs.map +0 -1
  612. package/dist/types/Metafield.d.ts +0 -61
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../../../node_modules/@xstate/fsm/es/index.js"],"sourcesContent":["/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nfunction t(t,n){var e=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,i,o=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return a}var n;!function(t){t[t.NotStarted=0]=\"NotStarted\",t[t.Running=1]=\"Running\",t[t.Stopped=2]=\"Stopped\"}(n||(n={}));var e={type:\"xstate.init\"};function r(t){return void 0===t?[]:[].concat(t)}function i(t){return{type:\"xstate.assign\",assignment:t}}function o(t,n){return\"string\"==typeof(t=\"string\"==typeof t&&n&&n[t]?n[t]:t)?{type:t}:\"function\"==typeof t?{type:t.name,exec:t}:t}function a(t){return function(n){return t===n}}function u(t){return\"string\"==typeof t?{type:t}:t}function c(t,n){return{value:t,context:n,actions:[],changed:!1,matches:a(t)}}function f(t,n,e){var r=n,i=!1;return[t.filter((function(t){if(\"xstate.assign\"===t.type){i=!0;var n=Object.assign({},r);return\"function\"==typeof t.assignment?n=t.assignment(r,e):Object.keys(t.assignment).forEach((function(i){n[i]=\"function\"==typeof t.assignment[i]?t.assignment[i](r,e):t.assignment[i]})),r=n,!1}return!0})),r,i]}function s(n,i){void 0===i&&(i={});var s=t(f(r(n.states[n.initial].entry).map((function(t){return o(t,i.actions)})),n.context,e),2),l=s[0],v=s[1],y={config:n,_options:i,initialState:{value:n.initial,actions:l,context:v,matches:a(n.initial)},transition:function(e,i){var s,l,v=\"string\"==typeof e?{value:e,context:n.context}:e,p=v.value,g=v.context,d=u(i),x=n.states[p];if(x.on){var m=r(x.on[d.type]);try{for(var h=function(t){var n=\"function\"==typeof Symbol&&Symbol.iterator,e=n&&t[n],r=0;if(e)return e.call(t);if(t&&\"number\"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}(m),b=h.next();!b.done;b=h.next()){var S=b.value;if(void 0===S)return c(p,g);var w=\"string\"==typeof S?{target:S}:S,j=w.target,E=w.actions,R=void 0===E?[]:E,N=w.cond,O=void 0===N?function(){return!0}:N,_=void 0===j,k=null!=j?j:p,T=n.states[k];if(O(g,d)){var q=t(f((_?r(R):[].concat(x.exit,R,T.entry).filter((function(t){return t}))).map((function(t){return o(t,y._options.actions)})),g,d),3),z=q[0],A=q[1],B=q[2],C=null!=j?j:p;return{value:C,context:A,actions:z,changed:j!==p||z.length>0||B,matches:a(C)}}}}catch(t){s={error:t}}finally{try{b&&!b.done&&(l=h.return)&&l.call(h)}finally{if(s)throw s.error}}}return c(p,g)}};return y}var l=function(t,n){return t.actions.forEach((function(e){var r=e.exec;return r&&r(t.context,n)}))};function v(t){var r=t.initialState,i=n.NotStarted,o=new Set,c={_machine:t,send:function(e){i===n.Running&&(r=t.transition(r,e),l(r,u(e)),o.forEach((function(t){return t(r)})))},subscribe:function(t){return o.add(t),t(r),{unsubscribe:function(){return o.delete(t)}}},start:function(o){if(o){var u=\"object\"==typeof o?o:{context:t.config.context,value:o};r={value:u.value,actions:[],context:u.context,matches:a(u.value)}}else r=t.initialState;return i=n.Running,l(r,e),c},stop:function(){return i=n.Stopped,o.clear(),c},get state(){return r},get status(){return i}};return c}export{n as InterpreterStatus,i as assign,s as createMachine,v as interpret};\n"],"names":["t","n","e","r","i","o","a","s","l","v","c","u"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,SAAS,EAAEA,IAAEC,IAAE;AAAC,MAAIC,KAAE,cAAY,OAAO,UAAQF,GAAE,OAAO;AAAU,MAAG,CAACE;AAAE,WAAOF;AAAE,MAAIG,IAAEC,IAAEC,KAAEH,GAAE,KAAKF,EAAC,GAAEM,KAAE,CAAE;AAAC,MAAG;AAAC,YAAM,WAASL,MAAGA,OAAK,MAAI,EAAEE,KAAEE,GAAE,KAAI,GAAI;AAAM,MAAAC,GAAE,KAAKH,GAAE,KAAK;AAAA,EAAC,SAAOH,IAAN;AAAS,IAAAI,KAAE,EAAC,OAAMJ,GAAC;AAAA,EAAC,UAAC;AAAQ,QAAG;AAAC,MAAAG,MAAG,CAACA,GAAE,SAAOD,KAAEG,GAAE,WAASH,GAAE,KAAKG,EAAC;AAAA,IAAC,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IAAC;AAAM,MAAAR,KAAEH,GAAE;AAAa,WAAOI,KAAE,EAAE,SAAQ,EAAED,IAAE,CAAC,GAAEO;AAAA,EAAC,GAAE,MAAK,WAAU;AAAC,WAAON,KAAE,EAAE,SAAQC,GAAE,MAAO,GAACK;AAAA,EAAC,GAAE,IAAI,QAAO;AAAC,WAAOP;AAAA,EAAC,GAAE,IAAI,SAAQ;AAAC,WAAOC;AAAA,EAAC,EAAC;AAAE,SAAOM;AAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../../../../node_modules/@xstate/fsm/es/index.js"],"sourcesContent":["/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nfunction t(t,n){var e=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,i,o=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return a}var n;!function(t){t[t.NotStarted=0]=\"NotStarted\",t[t.Running=1]=\"Running\",t[t.Stopped=2]=\"Stopped\"}(n||(n={}));var e={type:\"xstate.init\"};function r(t){return void 0===t?[]:[].concat(t)}function i(t){return{type:\"xstate.assign\",assignment:t}}function o(t,n){return\"string\"==typeof(t=\"string\"==typeof t&&n&&n[t]?n[t]:t)?{type:t}:\"function\"==typeof t?{type:t.name,exec:t}:t}function a(t){return function(n){return t===n}}function u(t){return\"string\"==typeof t?{type:t}:t}function c(t,n){return{value:t,context:n,actions:[],changed:!1,matches:a(t)}}function f(t,n,e){var r=n,i=!1;return[t.filter((function(t){if(\"xstate.assign\"===t.type){i=!0;var n=Object.assign({},r);return\"function\"==typeof t.assignment?n=t.assignment(r,e):Object.keys(t.assignment).forEach((function(i){n[i]=\"function\"==typeof t.assignment[i]?t.assignment[i](r,e):t.assignment[i]})),r=n,!1}return!0})),r,i]}function s(n,i){void 0===i&&(i={});var s=t(f(r(n.states[n.initial].entry).map((function(t){return o(t,i.actions)})),n.context,e),2),l=s[0],v=s[1],y={config:n,_options:i,initialState:{value:n.initial,actions:l,context:v,matches:a(n.initial)},transition:function(e,i){var s,l,v=\"string\"==typeof e?{value:e,context:n.context}:e,p=v.value,g=v.context,d=u(i),x=n.states[p];if(x.on){var m=r(x.on[d.type]);try{for(var h=function(t){var n=\"function\"==typeof Symbol&&Symbol.iterator,e=n&&t[n],r=0;if(e)return e.call(t);if(t&&\"number\"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}(m),b=h.next();!b.done;b=h.next()){var S=b.value;if(void 0===S)return c(p,g);var w=\"string\"==typeof S?{target:S}:S,j=w.target,E=w.actions,R=void 0===E?[]:E,N=w.cond,O=void 0===N?function(){return!0}:N,_=void 0===j,k=null!=j?j:p,T=n.states[k];if(O(g,d)){var q=t(f((_?r(R):[].concat(x.exit,R,T.entry).filter((function(t){return t}))).map((function(t){return o(t,y._options.actions)})),g,d),3),z=q[0],A=q[1],B=q[2],C=null!=j?j:p;return{value:C,context:A,actions:z,changed:j!==p||z.length>0||B,matches:a(C)}}}}catch(t){s={error:t}}finally{try{b&&!b.done&&(l=h.return)&&l.call(h)}finally{if(s)throw s.error}}}return c(p,g)}};return y}var l=function(t,n){return t.actions.forEach((function(e){var r=e.exec;return r&&r(t.context,n)}))};function v(t){var r=t.initialState,i=n.NotStarted,o=new Set,c={_machine:t,send:function(e){i===n.Running&&(r=t.transition(r,e),l(r,u(e)),o.forEach((function(t){return t(r)})))},subscribe:function(t){return o.add(t),t(r),{unsubscribe:function(){return o.delete(t)}}},start:function(o){if(o){var u=\"object\"==typeof o?o:{context:t.config.context,value:o};r={value:u.value,actions:[],context:u.context,matches:a(u.value)}}else r=t.initialState;return i=n.Running,l(r,e),c},stop:function(){return i=n.Stopped,o.clear(),c},get state(){return r},get status(){return i}};return c}export{n as InterpreterStatus,i as assign,s as createMachine,v as interpret};\n"],"names":["t","n","e","r","i","o","a","s","l","v","c","u"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,SAAS,EAAEA,IAAEC,IAAE;AAAC,MAAIC,KAAE,cAAY,OAAO,UAAQF,GAAE,OAAO,QAAQ;AAAE,MAAG,CAACE;AAAE,WAAOF;AAAE,MAAIG,IAAEC,IAAEC,KAAEH,GAAE,KAAKF,EAAC,GAAEM,KAAE,CAAE;AAAC,MAAG;AAAC,YAAM,WAASL,MAAGA,OAAK,MAAI,EAAEE,KAAEE,GAAE,KAAI,GAAI;AAAM,MAAAC,GAAE,KAAKH,GAAE,KAAK;AAAA,EAAC,SAAOH,IAAN;AAAS,IAAAI,KAAE,EAAC,OAAMJ,GAAC;AAAA,EAAC,UAAC;AAAQ,QAAG;AAAC,MAAAG,MAAG,CAACA,GAAE,SAAOD,KAAEG,GAAE,WAASH,GAAE,KAAKG,EAAC;AAAA,IAAC,UAAC;AAAQ,UAAGD;AAAE,cAAMA,GAAE;AAAA,IAAK;AAAA,EAAC;AAAC,SAAOE;AAAC;AAAI,IAAC;AAAE,CAAC,SAAS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C;AAAA,IAAC;AAAM,MAAAR,KAAEH,GAAE;AAAa,WAAOI,KAAE,EAAE,SAAQ,EAAED,IAAE,CAAC,GAAEO;AAAA,EAAC,GAAE,MAAK,WAAU;AAAC,WAAON,KAAE,EAAE,SAAQC,GAAE,MAAO,GAACK;AAAA,EAAC,GAAE,IAAI,QAAO;AAAC,WAAOP;AAAA,EAAC,GAAE,IAAI,SAAQ;AAAC,WAAOC;AAAA,EAAC,EAAC;AAAE,SAAOM;AAAC;"}
@@ -3,7 +3,7 @@ import { useRef, useState, useEffect, useCallback } from "react";
3
3
  import index from "../../../use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.mjs";
4
4
  import "../../../use-sync-external-store/shim/with-selector.mjs";
5
5
  import useConstant from "./useConstant.mjs";
6
- import { w as withSelector } from "../../../../_virtual/with-selector.mjs";
6
+ import { exports as withSelectorExports } from "../../../../_virtual/with-selector.mjs";
7
7
  var __read = globalThis && globalThis.__read || function(o, n2) {
8
8
  var m = typeof Symbol === "function" && o[Symbol.iterator];
9
9
  if (!m)
@@ -84,7 +84,7 @@ function useService(service) {
84
84
  var unsubscribe = service.subscribe(handleStoreChange).unsubscribe;
85
85
  return unsubscribe;
86
86
  }, [service]);
87
- var storeSnapshot = withSelector.exports.useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, identity, isEqual);
87
+ var storeSnapshot = withSelectorExports.useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, identity, isEqual);
88
88
  return [storeSnapshot, service.send, service];
89
89
  }
90
90
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"fsm.mjs","sources":["../../../../../../../../node_modules/@xstate/react/es/fsm.js"],"sourcesContent":["var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { createMachine, interpret, InterpreterStatus } from '@xstate/fsm';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport useConstant from './useConstant';\nfunction identity(a) {\n return a;\n}\nvar getServiceState = function (service) {\n var currentValue;\n service\n .subscribe(function (state) {\n currentValue = state;\n })\n .unsubscribe();\n return currentValue;\n};\nexport function useMachine(stateMachine, options) {\n var persistedStateRef = useRef();\n if (process.env.NODE_ENV !== 'production') {\n var _a = __read(useState(stateMachine), 1), initialMachine = _a[0];\n if (stateMachine !== initialMachine) {\n console.warn('Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\\n' +\n 'Please make sure that you pass the same Machine as argument each time.');\n }\n }\n var _b = __read(useConstant(function () {\n var queue = [];\n var service = interpret(createMachine(stateMachine.config, options ? options : stateMachine._options));\n var send = service.send;\n service.send = function (event) {\n if (service.status === InterpreterStatus.NotStarted) {\n queue.push(event);\n return;\n }\n send(event);\n persistedStateRef.current = service.state;\n };\n return [service, queue];\n }), 2), service = _b[0], queue = _b[1];\n useIsomorphicLayoutEffect(function () {\n if (options) {\n service._machine._options = options;\n }\n });\n var useServiceResult = useService(service);\n useEffect(function () {\n service.start(persistedStateRef.current);\n queue.forEach(service.send);\n persistedStateRef.current = service.state;\n return function () {\n service.stop();\n };\n }, []);\n return useServiceResult;\n}\nvar isEqual = function (_prevState, nextState) { return nextState.changed === false; };\nexport function useService(service) {\n var getSnapshot = useCallback(function () { return getServiceState(service); }, [service]);\n var subscribe = useCallback(function (handleStoreChange) {\n var unsubscribe = service.subscribe(handleStoreChange).unsubscribe;\n return unsubscribe;\n }, [service]);\n var storeSnapshot = useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, identity, isEqual);\n return [storeSnapshot, service.send, service];\n}\n"],"names":["this","n","queue","service","interpret","createMachine","InterpreterStatus","useIsomorphicLayoutEffect","useSyncExternalStoreWithSelector"],"mappings":";;;;;;AAAA,IAAI,SAAUA,cAAQA,WAAK,UAAW,SAAU,GAAGC,IAAG;AAClD,MAAI,IAAI,OAAO,WAAW,cAAc,EAAE,OAAO;AACjD,MAAI,CAAC;AAAG,WAAO;AACf,MAAI,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAE,GAAE;AAC/B,MAAI;AACA,YAAQA,OAAM,UAAUA,OAAM,MAAM,EAAE,IAAI,EAAE,KAAM,GAAE;AAAM,SAAG,KAAK,EAAE,KAAK;AAAA,EAC5E,SACM,OAAP;AAAgB,QAAI,EAAE,MAAc;AAAA,EAAG,UAC/B;AACJ,QAAI;AACA,UAAI,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE;AAAY,UAAE,KAAK,CAAC;AAAA,IAClD,UACO;AAAE,UAAI;AAAG,cAAM,EAAE;AAAA,IAAQ;AAAA,EACpC;AACD,SAAO;AACX;AAMA,SAAS,SAAS,GAAG;AACjB,SAAO;AACX;AACA,IAAI,kBAAkB,SAAU,SAAS;AACrC,MAAI;AACJ,UACK,UAAU,SAAU,OAAO;AAC5B,mBAAe;AAAA,EACvB,CAAK,EACI;AACL,SAAO;AACX;AACO,SAAS,WAAW,cAAc,SAAS;AAC9C,MAAI,oBAAoB;AACxB,MAAI,QAAQ,IAAI,aAAa,cAAc;AACvC,QAAI,KAAK,OAAO,SAAS,YAAY,GAAG,CAAC,GAAG,iBAAiB,GAAG;AAChE,QAAI,iBAAiB,gBAAgB;AACjC,cAAQ,KAAK,gMAC+D;AAAA,IAC/E;AAAA,EACJ;AACD,MAAI,KAAK,OAAO,YAAY,WAAY;AACpC,QAAIC,SAAQ,CAAA;AACZ,QAAIC,WAAUC,EAAUC,EAAc,aAAa,QAAQ,UAAU,UAAU,aAAa,QAAQ,CAAC;AACrG,QAAI,OAAOF,SAAQ;AACnB,IAAAA,SAAQ,OAAO,SAAU,OAAO;AAC5B,UAAIA,SAAQ,WAAWG,EAAkB,YAAY;AACjD,QAAAJ,OAAM,KAAK,KAAK;AAChB;AAAA,MACH;AACD,WAAK,KAAK;AACV,wBAAkB,UAAUC,SAAQ;AAAA,IAChD;AACQ,WAAO,CAACA,UAASD,MAAK;AAAA,EAC9B,CAAK,GAAG,CAAC,GAAG,UAAU,GAAG,IAAI,QAAQ,GAAG;AACpCK,QAA0B,WAAY;AAClC,QAAI,SAAS;AACT,cAAQ,SAAS,WAAW;AAAA,IAC/B;AAAA,EACT,CAAK;AACD,MAAI,mBAAmB,WAAW,OAAO;AACzC,YAAU,WAAY;AAClB,YAAQ,MAAM,kBAAkB,OAAO;AACvC,UAAM,QAAQ,QAAQ,IAAI;AAC1B,sBAAkB,UAAU,QAAQ;AACpC,WAAO,WAAY;AACf,cAAQ,KAAI;AAAA,IACxB;AAAA,EACK,GAAE,CAAE,CAAA;AACL,SAAO;AACX;AACA,IAAI,UAAU,SAAU,YAAY,WAAW;AAAE,SAAO,UAAU,YAAY;;AACvE,SAAS,WAAW,SAAS;AAChC,MAAI,cAAc,YAAY,WAAY;AAAE,WAAO,gBAAgB,OAAO;AAAA,EAAI,GAAE,CAAC,OAAO,CAAC;AACzF,MAAI,YAAY,YAAY,SAAU,mBAAmB;AACrD,QAAI,cAAc,QAAQ,UAAU,iBAAiB,EAAE;AACvD,WAAO;AAAA,EACf,GAAO,CAAC,OAAO,CAAC;AACZ,MAAI,gBAAgBC,aAAAA,QAAAA,iCAAiC,WAAW,aAAa,aAAa,UAAU,OAAO;AAC3G,SAAO,CAAC,eAAe,QAAQ,MAAM,OAAO;AAChD;"}
1
+ {"version":3,"file":"fsm.mjs","sources":["../../../../../../../../node_modules/@xstate/react/es/fsm.js"],"sourcesContent":["var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { createMachine, interpret, InterpreterStatus } from '@xstate/fsm';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport useConstant from './useConstant';\nfunction identity(a) {\n return a;\n}\nvar getServiceState = function (service) {\n var currentValue;\n service\n .subscribe(function (state) {\n currentValue = state;\n })\n .unsubscribe();\n return currentValue;\n};\nexport function useMachine(stateMachine, options) {\n var persistedStateRef = useRef();\n if (process.env.NODE_ENV !== 'production') {\n var _a = __read(useState(stateMachine), 1), initialMachine = _a[0];\n if (stateMachine !== initialMachine) {\n console.warn('Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\\n' +\n 'Please make sure that you pass the same Machine as argument each time.');\n }\n }\n var _b = __read(useConstant(function () {\n var queue = [];\n var service = interpret(createMachine(stateMachine.config, options ? options : stateMachine._options));\n var send = service.send;\n service.send = function (event) {\n if (service.status === InterpreterStatus.NotStarted) {\n queue.push(event);\n return;\n }\n send(event);\n persistedStateRef.current = service.state;\n };\n return [service, queue];\n }), 2), service = _b[0], queue = _b[1];\n useIsomorphicLayoutEffect(function () {\n if (options) {\n service._machine._options = options;\n }\n });\n var useServiceResult = useService(service);\n useEffect(function () {\n service.start(persistedStateRef.current);\n queue.forEach(service.send);\n persistedStateRef.current = service.state;\n return function () {\n service.stop();\n };\n }, []);\n return useServiceResult;\n}\nvar isEqual = function (_prevState, nextState) { return nextState.changed === false; };\nexport function useService(service) {\n var getSnapshot = useCallback(function () { return getServiceState(service); }, [service]);\n var subscribe = useCallback(function (handleStoreChange) {\n var unsubscribe = service.subscribe(handleStoreChange).unsubscribe;\n return unsubscribe;\n }, [service]);\n var storeSnapshot = useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, identity, isEqual);\n return [storeSnapshot, service.send, service];\n}\n"],"names":["this","n","queue","service","interpret","createMachine","InterpreterStatus","useIsomorphicLayoutEffect","useSyncExternalStoreWithSelector"],"mappings":";;;;;;AAAA,IAAI,SAAUA,cAAQA,WAAK,UAAW,SAAU,GAAGC,IAAG;AAClD,MAAI,IAAI,OAAO,WAAW,cAAc,EAAE,OAAO,QAAQ;AACzD,MAAI,CAAC;AAAG,WAAO;AACf,MAAI,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAE,GAAE;AAC/B,MAAI;AACA,YAAQA,OAAM,UAAUA,OAAM,MAAM,EAAE,IAAI,EAAE,KAAM,GAAE;AAAM,SAAG,KAAK,EAAE,KAAK;AAAA,EAC5E,SACM,OAAP;AAAgB,QAAI,EAAE,MAAc;AAAA,EAAG,UAC/B;AACJ,QAAI;AACA,UAAI,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,QAAQ;AAAI,UAAE,KAAK,CAAC;AAAA,IAClD,UACO;AAAE,UAAI;AAAG,cAAM,EAAE;AAAA,IAAQ;AAAA,EACpC;AACD,SAAO;AACX;AAMA,SAAS,SAAS,GAAG;AACjB,SAAO;AACX;AACA,IAAI,kBAAkB,SAAU,SAAS;AACrC,MAAI;AACJ,UACK,UAAU,SAAU,OAAO;AAC5B,mBAAe;AAAA,EACvB,CAAK,EACI;AACL,SAAO;AACX;AACO,SAAS,WAAW,cAAc,SAAS;AAC9C,MAAI,oBAAoB;AACxB,MAAI,QAAQ,IAAI,aAAa,cAAc;AACvC,QAAI,KAAK,OAAO,SAAS,YAAY,GAAG,CAAC,GAAG,iBAAiB,GAAG,CAAC;AACjE,QAAI,iBAAiB,gBAAgB;AACjC,cAAQ,KAAK,gMAC+D;AAAA,IAC/E;AAAA,EACJ;AACD,MAAI,KAAK,OAAO,YAAY,WAAY;AACpC,QAAIC,SAAQ,CAAA;AAC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store/cjs/use-sync-external-store-shim/with-selector.development.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = require('react');\nvar shim = require('use-sync-external-store/shim');\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\nvar useSyncExternalStore = shim.useSyncExternalStore;\n\n// for CommonJS interop.\n\nvar useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments.\n\nfunction useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {\n // Use this to track the rendered snapshot.\n var instRef = useRef(null);\n var inst;\n\n if (instRef.current === null) {\n inst = {\n hasValue: false,\n value: null\n };\n instRef.current = inst;\n } else {\n inst = instRef.current;\n }\n\n var _useMemo = useMemo(function () {\n // Track the memoized state using closure variables that are local to this\n // memoized instance of a getSnapshot function. Intentionally not using a\n // useRef hook, because that state would be shared across all concurrent\n // copies of the hook/component.\n var hasMemo = false;\n var memoizedSnapshot;\n var memoizedSelection;\n\n var memoizedSelector = function (nextSnapshot) {\n if (!hasMemo) {\n // The first time the hook is called, there is no memoized result.\n hasMemo = true;\n memoizedSnapshot = nextSnapshot;\n\n var _nextSelection = selector(nextSnapshot);\n\n if (isEqual !== undefined) {\n // Even if the selector has changed, the currently rendered selection\n // may be equal to the new selection. We should attempt to reuse the\n // current value if possible, to preserve downstream memoizations.\n if (inst.hasValue) {\n var currentSelection = inst.value;\n\n if (isEqual(currentSelection, _nextSelection)) {\n memoizedSelection = currentSelection;\n return currentSelection;\n }\n }\n }\n\n memoizedSelection = _nextSelection;\n return _nextSelection;\n } // We may be able to reuse the previous invocation's result.\n\n\n // We may be able to reuse the previous invocation's result.\n var prevSnapshot = memoizedSnapshot;\n var prevSelection = memoizedSelection;\n\n if (objectIs(prevSnapshot, nextSnapshot)) {\n // The snapshot is the same as last time. Reuse the previous selection.\n return prevSelection;\n } // The snapshot has changed, so we need to compute a new selection.\n\n\n // The snapshot has changed, so we need to compute a new selection.\n var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data\n // has changed. If it hasn't, return the previous selection. That signals\n // to React that the selections are conceptually equal, and we can bail\n // out of rendering.\n\n // If a custom isEqual function is provided, use that to check if the data\n // has changed. If it hasn't, return the previous selection. That signals\n // to React that the selections are conceptually equal, and we can bail\n // out of rendering.\n if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {\n return prevSelection;\n }\n\n memoizedSnapshot = nextSnapshot;\n memoizedSelection = nextSelection;\n return nextSelection;\n }; // Assigning this to a constant so that Flow knows it can't change.\n\n\n // Assigning this to a constant so that Flow knows it can't change.\n var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot;\n\n var getSnapshotWithSelector = function () {\n return memoizedSelector(getSnapshot());\n };\n\n var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n };\n return [getSnapshotWithSelector, getServerSnapshotWithSelector];\n }, [getSnapshot, getServerSnapshot, selector, isEqual]),\n getSelection = _useMemo[0],\n getServerSelection = _useMemo[1];\n\n var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);\n useEffect(function () {\n inst.hasValue = true;\n inst.value = value;\n }, [value]);\n useDebugValue(value);\n return value;\n}\n\nexports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n"],"names":["require$$0","require$$1"],"mappings":";;;;;;;;;;;;;;;;;AAYA,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,KAAC,WAAW;AAKd,UACE,OAAO,mCAAmC,eAC1C,OAAO,+BAA+B,gCACpC,YACF;AACA,uCAA+B,4BAA4B,IAAI,MAAK,CAAE;AAAA,MACvE;AACS,UAAI,QAAQA;AACtB,UAAI,OAAOC;AAMX,eAAS,GAAG,GAAG,GAAG;AAChB,eAAO,MAAM,MAAM,MAAM,KAAK,IAAI,MAAM,IAAI,MAAM,MAAM,KAAK,MAAM;AAAA,MAEpE;AAED,UAAI,WAAW,OAAO,OAAO,OAAO,aAAa,OAAO,KAAK;AAE7D,UAAI,uBAAuB,KAAK;AAIhC,UAAI,SAAS,MAAM,QACf,YAAY,MAAM,WAClB,UAAU,MAAM,SAChB,gBAAgB,MAAM;AAE1B,eAAS,iCAAiC,WAAW,aAAa,mBAAmB,UAAU,SAAS;AAEtG,YAAI,UAAU,OAAO,IAAI;AACzB,YAAI;AAEJ,YAAI,QAAQ,YAAY,MAAM;AAC5B,iBAAO;AAAA,YACL,UAAU;AAAA,YACV,OAAO;AAAA,UACb;AACI,kBAAQ,UAAU;AAAA,QACtB,OAAS;AACL,iBAAO,QAAQ;AAAA,QAChB;AAED,YAAI,W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mCAAmC,eAC1C,OAAO,+BAA+B,+BACpC,YACF;AACA,uCAA+B,2BAA2B,IAAI,MAAK,CAAE;AAAA,MACtE;AAAA,IAED;EACA;;;"}
1
+ {"version":3,"file":"with-selector.development.mjs","sources":["../../../../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = require('react');\nvar shim = require('use-sync-external-store/shim');\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\nvar useSyncExternalStore = shim.useSyncExternalStore;\n\n// for CommonJS interop.\n\nvar useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments.\n\nfunction useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {\n // Use this to track the rendered snapshot.\n var instRef = useRef(null);\n var inst;\n\n if (instRef.current === null) {\n inst = {\n hasValue: false,\n value: null\n };\n instRef.current = inst;\n } else {\n inst = instRef.current;\n }\n\n var _useMemo = useMemo(function () {\n // Track the memoized state using closure variables that are local to this\n // memoized instance of a getSnapshot function. Intentionally not using a\n // useRef hook, because that state would be shared across all concurrent\n // copies of the hook/component.\n var hasMemo = false;\n var memoizedSnapshot;\n var memoizedSelection;\n\n var memoizedSelector = function (nextSnapshot) {\n if (!hasMemo) {\n // The first time the hook is called, there is no memoized result.\n hasMemo = true;\n memoizedSnapshot = nextSnapshot;\n\n var _nextSelection = selector(nextSnapshot);\n\n if (isEqual !== undefined) {\n // Even if the selector has changed, the currently rendered selection\n // may be equal to the new selection. We should attempt to reuse the\n // current value if possible, to preserve downstream memoizations.\n if (inst.hasValue) {\n var currentSelection = inst.value;\n\n if (isEqual(currentSelection, _nextSelection)) {\n memoizedSelection = currentSelection;\n return currentSelection;\n }\n }\n }\n\n memoizedSelection = _nextSelection;\n return _nextSelection;\n } // We may be able to reuse the previous invocation's result.\n\n\n // We may be able to reuse the previous invocation's result.\n var prevSnapshot = memoizedSnapshot;\n var prevSelection = memoizedSelection;\n\n if (objectIs(prevSnapshot, nextSnapshot)) {\n // The snapshot is the same as last time. Reuse the previous selection.\n return prevSelection;\n } // The snapshot has changed, so we need to compute a new selection.\n\n\n // The snapshot has changed, so we need to compute a new selection.\n var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data\n // has changed. If it hasn't, return the previous selection. That signals\n // to React that the selections are conceptually equal, and we can bail\n // out of rendering.\n\n // If a custom isEqual function is provided, use that to check if the data\n // has changed. If it hasn't, return the previous selection. That signals\n // to React that the selections are conceptually equal, and we can bail\n // out of rendering.\n if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {\n return prevSelection;\n }\n\n memoizedSnapshot = nextSnapshot;\n memoizedSelection = nextSelection;\n return nextSelection;\n }; // Assigning this to a constant so that Flow knows it can't change.\n\n\n // Assigning this to a constant so that Flow knows it can't change.\n var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot;\n\n var getSnapshotWithSelector = function () {\n return memoizedSelector(getSnapshot());\n };\n\n var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n };\n return [getSnapshotWithSelector, getServerSnapshotWithSelector];\n }, [getSnapshot, getServerSnapshot, selector, isEqual]),\n getSelection = _useMemo[0],\n getServerSelection = _useMemo[1];\n\n var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);\n useEffect(function () {\n inst.hasValue = true;\n inst.value = value;\n }, [value]);\n useDebugValue(value);\n return value;\n}\n\nexports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n"],"names":["require$$0","require$$1"],"mappings":";;;;;;;;;;;;;;;;;AAYA,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,KAAC,WAAW;AAKd,UACE,OAAO,mCAAmC,eAC1C,OAAO,+BAA+B,gCACpC,YACF;AACA,uCAA+B,4BAA4B,IAAI,MAAK,CAAE;AAAA,MACvE;AACS,UAAI,QAAQA;AACtB,UAAI,OAAOC;AAMX,eAAS,GAAG,GAAG,GAAG;AAChB,eAAO,MAAM,MAAM,MAAM,KAAK,IAAI,MAAM,IAAI,MAAM,MAAM,KAAK,MAAM;AAAA,MAEpE;AAED,UAAI,WAAW,OAAO,OAAO,OAAO,aAAa,OAAO,KAAK;AAE7D,UAAI,uBAAuB,KAAK;AAIhC,UAAI,SAAS,MAAM,QACf,YAAY,MAAM,WAClB,UAAU,MAAM,SAChB,gBAAgB,MAAM;AAE1B,eAAS,iCAAiC,WAAW,aAAa,mBAAmB,UAAU,SAAS;AAEtG,YAAI,UAAU,OAAO,IAAI;AACzB,YAA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AAc,kBAAkB;AAC5E,kBAAU,WAAY;AACpB,eAAK,WAAW;AAChB,eAAK,QAAQ;AAAA,QACjB,GAAK,CAAC,KAAK,CAAC;AACV,sBAAc,KAAK;AACnB,eAAO;AAAA,MACR;AAEuC,+BAAA,mCAAG;AAE3C,UACE,OAAO,mCAAmC,eAC1C,OAAO,+BAA+B,+BACpC,YACF;AACA,uCAA+B,2BAA2B,IAAI,MAAK,CAAE;AAAA,MACtE;AAAA,IAED;EACA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"with-selector.production.min.mjs","sources":["../../../../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var h=require(\"react\"),n=require(\"use-sync-external-store/shim\");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q=\"function\"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);\nu(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};\n"],"names":["require$$0","require$$1","a","c","d","b","e"],"mappings":";;;;;;;;;;;;;;;;;AASa,MAAI,IAAEA,qBAAiB,IAAEC,YAAuC;AAAC,WAAS,EAAE,G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AE,CAAC,CAAC;AAAE,QAAI,IAAE,EAAE,GAAE,EAAE,IAAG,EAAE,EAAE;AACrf,MAAE,WAAU;AAAC,QAAE,WAAS;AAAG,QAAE,QAAM;AAAA,IAAC,GAAE,CAAC,CAAC,CAAC;AAAE,MAAE,CAAC;AAAE,WAAO;AAAA,EAAC;;;"}
1
+ {"version":3,"file":"with-selector.production.min.mjs","sources":["../../../../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var h=require(\"react\"),n=require(\"use-sync-external-store/shim\");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q=\"function\"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);\nu(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};\n"],"names":["require$$0","require$$1","a","c","d","b","e"],"mappings":";;;;;;;;;;;;;;;;;AASa,MAAI,IAAEA,qBAAiB,IAAEC,YAAuC;AAAC,WAAS,EAAE,GAAE,GAAE;AAAC,WAAO,MAAI,MAAI,MAAI,KAAG,IAAE,MAAI,IAAE,MAAI,MAAI,KAAG,MAAI;AAAA,EAAC;AAAC,M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AE,WAAS;AAAG,QAAE,QAAM;AAAA,IAAC,GAAE,CAAC,CAAC,CAAC;AAAE,MAAE,CAAC;AAAE,WAAO;AAAA,EAAC;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-sync-external-store-shim.development.mjs","sources":["../../../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = require('react');\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\n// dispatch for CommonJS interop named imports.\n\nvar useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nvar didWarnOld18Alpha = false;\nvar didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works\n// because of a very particular set of implementation details and assumptions\n// -- change any one of them and it will break. The most important assumption\n// is that updates are always synchronous, because concurrent rendering is\n// only available in versions of React that also have a built-in\n// useSyncExternalStore API. And we only use this shim when the built-in API\n// does not exist.\n//\n// Do not assume that the clever hacks used by this hook also work in general.\n// The point of this shim is to replace the need for hacks by other libraries.\n\nfunction useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n// React do not expose a way to check if we're hydrating. So users of the shim\n// will need to track that themselves and return the correct value\n// from `getSnapshot`.\ngetServerSnapshot) {\n {\n if (!didWarnOld18Alpha) {\n if (React.startTransition !== undefined) {\n didWarnOld18Alpha = true;\n\n error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');\n }\n }\n } // Read the current snapshot from the store on every render. Again, this\n // breaks the rules of React, and only works here because of specific\n // implementation details, most importantly that updates are\n // always synchronous.\n\n\n var value = getSnapshot();\n\n {\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n\n if (!objectIs(value, cachedValue)) {\n error('The result of getSnapshot should be cached to avoid an infinite loop');\n\n didWarnUncachedGetSnapshot = true;\n }\n }\n } // Because updates are synchronous, we don't queue them. Instead we force a\n // re-render whenever the subscribed state changes by updating an some\n // arbitrary useState hook. Then, during render, we call getSnapshot to read\n // the current value.\n //\n // Because we don't actually use the state returned by the useState hook, we\n // can save a bit of memory by storing other stuff in that slot.\n //\n // To implement the early bailout, we need to track some things on a mutable\n // object. Usually, we would put that in a useRef hook, but we can stash it in\n // our useState hook instead.\n //\n // To force a re-render, we call forceUpdate({inst}). That works because the\n // new object always fails an equality check.\n\n\n var _useState = useState({\n inst: {\n value: value,\n getSnapshot: getSnapshot\n }\n }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated\n // in the layout phase so we can access it during the tearing check that\n // happens on subscribe.\n\n\n useLayoutEffect(function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the\n // commit phase if there was an interleaved mutation. In concurrent mode\n // this can happen all the time, but even in synchronous mode, an earlier\n // effect may have mutated the store.\n\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n }, [subscribe, value, getSnapshot]);\n useEffect(function () {\n // Check for changes right before subscribing. Subsequent changes will be\n // detected in the subscription handler.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n\n var handleStoreChange = function () {\n // TODO: Because there is no cross-renderer API for batching updates, it's\n // up to the consumer of this library to wrap their subscription event\n // with unstable_batchedUpdates. Should we try to detect when this isn't\n // the case and print a warning in development?\n // The store changed. Check if the snapshot changed since the last time we\n // read from the store.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n }; // Subscribe to the store and return a clean-up function.\n\n\n return subscribe(handleStoreChange);\n }, [subscribe]);\n useDebugValue(value);\n return value;\n}\n\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n var prevValue = inst.value;\n\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(prevValue, nextValue);\n } catch (error) {\n return true;\n }\n}\n\nfunction useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {\n // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n // React do not expose a way to check if we're hydrating. So users of the shim\n // will need to track that themselves and return the correct value\n // from `getSnapshot`.\n return getSnapshot();\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nvar isServerEnvironment = !canUseDOM;\n\nvar shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;\nvar useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;\n\nexports.useSyncExternalStore = useSyncExternalStore$2;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n"],"names":["require$$0","error"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,KAAC,WAAW;AAKd,UACE,OAAO,mCAAmC,eAC1C,OAAO,+BAA+B,gCACpC,YACF;AACA,uCAA+B,4BAA4B,IAAI,MAAK,CAAE;AAAA,MACvE;AACS,UAAI,QAAQA;AAEtB,UAAI,uBAAuB,MAAM;AAEjC,eAAS,MAAM,QAAQ;AACrB;AACE;AACE,qBAAS,QAAQ,UAAU,QAAQ,OAAO,IAAI,MAAM,QAAQ,IAAI,QAAQ,IAAI,CAAC,GAAG,QAAQ,GAAG,QAAQ,OAAO,SAAS;AACjH,mBAAK,QAAQ,KAAK,UAAU;AAAA,YAC7B;AAED,yBAAa,SAAS,QAAQ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../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = require('react');\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\n// dispatch for CommonJS interop named imports.\n\nvar useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nvar didWarnOld18Alpha = false;\nvar didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works\n// because of a very particular set of implementation details and assumptions\n// -- change any one of them and it will break. The most important assumption\n// is that updates are always synchronous, because concurrent rendering is\n// only available in versions of React that also have a built-in\n// useSyncExternalStore API. And we only use this shim when the built-in API\n// does not exist.\n//\n// Do not assume that the clever hacks used by this hook also work in general.\n// The point of this shim is to replace the need for hacks by other libraries.\n\nfunction useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n// React do not expose a way to check if we're hydrating. So users of the shim\n// will need to track that themselves and return the correct value\n// from `getSnapshot`.\ngetServerSnapshot) {\n {\n if (!didWarnOld18Alpha) {\n if (React.startTransition !== undefined) {\n didWarnOld18Alpha = true;\n\n error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');\n }\n }\n } // Read the current snapshot from the store on every render. Again, this\n // breaks the rules of React, and only works here because of specific\n // implementation details, most importantly that updates are\n // always synchronous.\n\n\n var value = getSnapshot();\n\n {\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n\n if (!objectIs(value, cachedValue)) {\n error('The result of getSnapshot should be cached to avoid an infinite loop');\n\n didWarnUncachedGetSnapshot = true;\n }\n }\n } // Because updates are synchronous, we don't queue them. Instead we force a\n // re-render whenever the subscribed state changes by updating an some\n // arbitrary useState hook. Then, during render, we call getSnapshot to read\n // the current value.\n //\n // Because we don't actually use the state returned by the useState hook, we\n // can save a bit of memory by storing other stuff in that slot.\n //\n // To implement the early bailout, we need to track some things on a mutable\n // object. Usually, we would put that in a useRef hook, but we can stash it in\n // our useState hook instead.\n //\n // To force a re-render, we call forceUpdate({inst}). That works because the\n // new object always fails an equality check.\n\n\n var _useState = useState({\n inst: {\n value: value,\n getSnapshot: getSnapshot\n }\n }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated\n // in the layout phase so we can access it during the tearing check that\n // happens on subscribe.\n\n\n useLayoutEffect(function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the\n // commit phase if there was an interleaved mutation. In concurrent mode\n // this can happen all the time, but even in synchronous mode, an earlier\n // effect may have mutated the store.\n\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n }, [subscribe, value, getSnapshot]);\n useEffect(function () {\n // Check for changes right before subscribing. Subsequent changes will be\n // detected in the subscription handler.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n\n var handleStoreChange = function () {\n // TODO: Because there is no cross-renderer API for batching updates, it's\n // up to the consumer of this library to wrap their subscription event\n // with unstable_batchedUpdates. Should we try to detect when this isn't\n // the case and print a warning in development?\n // The store changed. Check if the snapshot changed since the last time we\n // read from the store.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n }; // Subscribe to the store and return a clean-up function.\n\n\n return subscribe(handleStoreChange);\n }, [subscribe]);\n useDebugValue(value);\n return value;\n}\n\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n var prevValue = inst.value;\n\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(prevValue, nextValue);\n } catch (error) {\n return true;\n }\n}\n\nfunction useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {\n // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n // React do not expose a way to check if we're hydrating. So users of the shim\n // will need to track that themselves and return the correct value\n // from `getSnapshot`.\n return getSnapshot();\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nvar isServerEnvironment = !canUseDOM;\n\nvar shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;\nvar useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;\n\nexports.useSyncExternalStore = useSyncExternalStore$2;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n"],"names":["require$$0","error"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,KAAC,WAAW;AAKd,UACE,OAAO,mCAAmC,eAC1C,OAAO,+BAA+B,gCACpC,YACF;AACA,uCAA+B,4BAA4B,IAAI,MAAK,CAAE;AAAA,MACvE;AACS,UAAI,QAAQA;AAEtB,UAAI,uBAAuB,MAAM;AAEjC,eAAS,MAAM,QAAQ;AACrB;AACE;AACE,qBAAS,QAAQ,UAAU,QAAQ,OAAO,IAAI,MAAM,QAAQ,IAAI,QAAQ,IAAI,CAAC,GAAG,QAAQ,GAAG,QAAQ,OAAO,SAAS;AACjH,mBAAK,QAAQ,CAAC,IAAI,UAAU,KAAK;AAAA,YAClC;AAED,yBAAa,SAAS,QAAQ,IAAI;AAAA,UACnC;AAAA,QACF;AAAA,MACF;AAED,eAAS,aAAa,OAAO,QAAQ,MAAM;AAGzC;AACE,cAAI,yBAAyB,qBAAqB;AAClD,cAAI,QAAQ,uBAAuB;AAEnC,cAAI,UAAU,IAAI;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UACF;AAAA,QACF,GAAE,CAAC,WAAW,OAAO,WAAW,CAAC;AAClC,kBAAU,WAAY;AAGpB,cAAI,uBAAuB,IAAI,GAAG;AAEhC,wBAAY;AAAA,cACV;AAAA,YACR,CAAO;AAAA,UACF;AAED,cAAI,oBAAoB,WAAY;AAOlC,gBAAI,uBAAuB,IAAI,GAAG;AAEhC,0BAAY;AAAA,gBACV;AAAA,cACV,CAAS;AAAA,YACF;AAAA,UACP;AAGI,iBAAO,UAAU,iBAAiB;AAAA,QACtC,GAAK,CAAC,SAAS,CAAC;AACd,sBAAc,KAAK;AACnB,eAAO;AAAA,MACR;AAED,eAAS,uBAAuB,MAAM;AACpC,YAAI,oBAAoB,KAAK;AAC7B,YAAI,YAAY,KAAK;AAErB,YAAI;AACF,cAAI,YAAY;AAChB,iBAAO,CAAC,SAAS,WAAW,SAAS;AAAA,QACtC,SAAQC,QAAP;AACA,iBAAO;AAAA,QACR;AAAA,MACF;AAED,eAAS,uBAAuB,WAAW,aAAa,mBAAmB;AAKzE,eAAO,YAAW;AAAA,MACnB;AAED,UAAI,YAAY,CAAC,EAAE,OAAO,WAAW,eAAe,OAAO,OAAO,aAAa,eAAe,OAAO,OAAO,SAAS,kBAAkB;AAEvI,UAAI,sBAAsB,CAAC;AAE3B,UAAI,OAAO,sBAAsB,yBAAyB;AAC1D,UAAI,yBAAyB,MAAM,yBAAyB,SAAY,MAAM,uBAAuB;AAEzE,2CAAA,uBAAG;AAE/B,UACE,OAAO,mCAAmC,eAC1C,OAAO,+BAA+B,+BACpC,YACF;AACA,uCAA+B,2BAA2B,IAAI,MAAK,CAAE;AAAA,MACtE;AAAA,IAED;EACA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-sync-external-store-shim.production.min.mjs","sources":["../../../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n"],"names":["require$$0"],"mappings":";;;;;;;;;;;;;;;;AASa,MAAI,IAAEA;AAAiB,WAAS,EAAE,GAAE,GAAE;AAAC,WAAO,MAAI,MAAI,MAAI,KAAG,IAAE,MAAI,IAAE,MAAI,MAAI,KAAG,MAAI;AAAA,EAAC;AAAC,MAAI,IAAE,eAAa,OAAO,OAAO,KAAG,OAAO,KAAG,GAAE,IAAE,EAAE,UAAS,IAAE,EAAE,WAAU,IAAE,EAAE,iBAAgB,IAAE,EAAE;AAAc,WAAS,EAAE,GAAE,GAAE;AAAC,QAAI,IAAE,EAAC,GAAG,IAAE,EAAE,EAAC,MAAK,EAAC,OAAM,GAAE,aAAY,EAAC,EAAC,CAAC,GAAE,IAAE,EAAE,GAAG,MAAK,IAAE,EAAE;AAAG,MAAE,WAAU;AAAC,QAAE,QAAM;AAAE,QAAE,cAAY;AAAE,QAAE,CAAC,KAAG,EAAE,EAAC,MAAK,EAAC,CAAC;AAAA,IAAC,GAAE,CAAC,GAAE,GAAE,CAAC,CAAC;AAAE,MAAE,WAAU;AAAC,QAAE,CAAC,KAAG,EAAE,EAAC,MAAK,EAAC,CAAC;AAAE,aAAO,EAAE,WAAU;AAAC,UAAE,CAAC,KAAG,EAAE,EAAC,MAAK,EAAC,CAAC;AAAA,MAAC,CAAC;AAAA,IAAC,GAAE,CAAC,CAAC,CAAC;AAAE,MAAE,CAAC;AAAE,WAAO;AAAA,EAAC;AAClc,WAAS,EAAE,GAAE;AAAC,QAAI,IAAE,EAAE;AAAY,QAAE,EAAE;AAAM,QAAG;AAAC,UAAI,IAAE,EAAG;AAAC,aAAM,CAAC,EAAE,GAAE,CAAC;AAAA,IAAC,SAAO,GAAN;AAAS,aAAM;AAAA,IAAE;AAAA,EAAC;AAAC,WAAS,EAAE,GAAE,GAAE;AAAC,WAAO,EAAC;AAAA,EAAE;AAAC,MAAI,IAAE,gBAAc,OAAO,UAAQ,gBAAc,OAAO,OAAO,YAAU,gBAAc,OAAO,OAAO,SAAS,gBAAc,IAAE;AAAE,0CAA4B,uBAAC,WAAS,EAAE,uBAAqB,EAAE,uBAAqB;;;"}
1
+ {"version":3,"file":"use-sync-external-store-shim.production.min.mjs","sources":["../../../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n"],"names":["require$$0"],"mappings":";;;;;;;;;;;;;;;;AASa,MAAI,IAAEA;AAAiB,WAAS,EAAE,GAAE,GAAE;AAAC,WAAO,MAAI,MAAI,MAAI,KAAG,IAAE,MAAI,IAAE,MAAI,MAAI,KAAG,MAAI;AAAA,EAAC;AAAC,MAAI,IAAE,eAAa,OAAO,OAAO,KAAG,OAAO,KAAG,GAAE,IAAE,EAAE,UAAS,IAAE,EAAE,WAAU,IAAE,EAAE,iBAAgB,IAAE,EAAE;AAAc,WAAS,EAAE,GAAE,GAAE;AAAC,QAAI,IAAE,EAAC,GAAG,IAAE,EAAE,EAAC,MAAK,EAAC,OAAM,GAAE,aAAY,EAAC,EAAC,CAAC,GAAE,IAAE,EAAE,CAAC,EAAE,MAAK,IAAE,EAAE,CAAC;AAAE,MAAE,WAAU;AAAC,QAAE,QAAM;AAAE,QAAE,cAAY;AAAE,QAAE,CAAC,KAAG,EAAE,EAAC,MAAK,EAAC,CAAC;AAAA,IAAC,GAAE,CAAC,GAAE,GAAE,CAAC,CAAC;AAAE,MAAE,WAAU;AAAC,QAAE,CAAC,KAAG,EAAE,EAAC,MAAK,EAAC,CAAC;AAAE,aAAO,EAAE,WAAU;AAAC,UAAE,CAAC,KAAG,EAAE,EAAC,MAAK,EAAC,CAAC;AAAA,MAAC,CAAC;AAAA,IAAC,GAAE,CAAC,CAAC,CAAC;AAAE,MAAE,CAAC;AAAE,WAAO;AAAA,EAAC;AAClc,WAAS,EAAE,GAAE;AAAC,QAAI,IAAE,EAAE;AAAY,QAAE,EAAE;AAAM,QAAG;AAAC,UAAI,IAAE,EAAG;AAAC,aAAM,CAAC,EAAE,GAAE,CAAC;AAAA,IAAC,SAAO,GAAN;AAAS,aAAM;AAAA,IAAE;AAAA,EAAC;AAAC,WAAS,EAAE,GAAE,GAAE;AAAC,WAAO,EAAC;AAAA,EAAE;AAAC,MAAI,IAAE,gBAAc,OAAO,UAAQ,gBAAc,OAAO,OAAO,YAAU,gBAAc,OAAO,OAAO,SAAS,gBAAc,IAAE;AAAE,0CAA4B,uBAAC,WAAS,EAAE,uBAAqB,EAAE,uBAAqB;;;"}
@@ -1,10 +1,10 @@
1
- import { s as shim } from "../../../_virtual/index.mjs";
1
+ import { exports as shimExports, __module as shim } from "../../../_virtual/index.mjs";
2
2
  import { __require as requireUseSyncExternalStoreShim_production_min } from "../cjs/use-sync-external-store-shim.production.min.mjs";
3
3
  import { __require as requireUseSyncExternalStoreShim_development } from "../cjs/use-sync-external-store-shim.development.mjs";
4
4
  var hasRequiredShim;
5
5
  function requireShim() {
6
6
  if (hasRequiredShim)
7
- return shim.exports;
7
+ return shimExports;
8
8
  hasRequiredShim = 1;
9
9
  (function(module) {
10
10
  if (process.env.NODE_ENV === "production") {
@@ -13,7 +13,7 @@ function requireShim() {
13
13
  module.exports = requireUseSyncExternalStoreShim_development();
14
14
  }
15
15
  })(shim);
16
- return shim.exports;
16
+ return shimExports;
17
17
  }
18
18
  export {
19
19
  requireShim as __require
@@ -1,4 +1,4 @@
1
- import { w as withSelector } from "../../../_virtual/with-selector.mjs";
1
+ import { __module as withSelector, exports as withSelectorExports } from "../../../_virtual/with-selector.mjs";
2
2
  import { __require as requireWithSelector_production_min } from "../cjs/use-sync-external-store-shim/with-selector.production.min.mjs";
3
3
  import { __require as requireWithSelector_development } from "../cjs/use-sync-external-store-shim/with-selector.development.mjs";
4
4
  (function(module) {
@@ -1,9 +1,7 @@
1
- import { parseJSON } from "./Metafield.mjs";
2
1
  import { flattenConnection } from "./flatten-connection.mjs";
3
- function metafieldParser(metafield) {
4
- var _a, _b, _c, _d;
2
+ function parseMetafield(metafield) {
5
3
  if (!metafield.type) {
6
- const noTypeError = `metafieldParser(): The 'type' field is required in order to parse the Metafield.`;
4
+ const noTypeError = `parseMetafield(): The 'type' field is required in order to parse the Metafield.`;
7
5
  {
8
6
  throw new Error(noTypeError);
9
7
  }
@@ -48,9 +46,9 @@ function metafieldParser(metafield) {
48
46
  case "list.weight": {
49
47
  let parsedValue = null;
50
48
  try {
51
- parsedValue = parseJSON((_a = metafield.value) != null ? _a : "");
49
+ parsedValue = parseJSON(metafield.value ?? "");
52
50
  } catch (err) {
53
- const parseError = `metafieldParser(): attempted to JSON.parse the 'metafield.value' property, but failed.`;
51
+ const parseError = `parseMetafield(): attempted to JSON.parse the 'metafield.value' property, but failed.`;
54
52
  {
55
53
  throw new Error(parseError);
56
54
  }
@@ -64,11 +62,11 @@ function metafieldParser(metafield) {
64
62
  case "date_time":
65
63
  return {
66
64
  ...metafield,
67
- parsedValue: new Date((_b = metafield.value) != null ? _b : "")
65
+ parsedValue: new Date(metafield.value ?? "")
68
66
  };
69
67
  case "list.date":
70
68
  case "list.date_time": {
71
- const jsonParseValue = parseJSON((_c = metafield == null ? void 0 : metafield.value) != null ? _c : "");
69
+ const jsonParseValue = parseJSON((metafield == null ? void 0 : metafield.value) ?? "");
72
70
  return {
73
71
  ...metafield,
74
72
  parsedValue: jsonParseValue.map((dateString) => new Date(dateString))
@@ -87,17 +85,27 @@ function metafieldParser(metafield) {
87
85
  case "list.variant_reference":
88
86
  return {
89
87
  ...metafield,
90
- parsedValue: flattenConnection((_d = metafield.references) != null ? _d : void 0)
88
+ parsedValue: flattenConnection(metafield.references ?? void 0)
91
89
  };
92
90
  default: {
93
- const typeNotFoundError = `metafieldParser(): the 'metafield.type' you passed in is not supported. Your type: "${metafield.type}". If you believe this is an error, please open an issue on GitHub.`;
91
+ const typeNotFoundError = `parseMetafield(): the 'metafield.type' you passed in is not supported. Your type: "${metafield.type}". If you believe this is an error, please open an issue on GitHub.`;
94
92
  {
95
93
  throw new Error(typeNotFoundError);
96
94
  }
97
95
  }
98
96
  }
99
97
  }
98
+ function parseJSON(json) {
99
+ if (String(json).includes("__proto__")) {
100
+ return JSON.parse(json, (k, v) => {
101
+ if (k !== "__proto__")
102
+ return v;
103
+ });
104
+ }
105
+ return JSON.parse(json);
106
+ }
100
107
  export {
101
- metafieldParser
108
+ parseJSON,
109
+ parseMetafield
102
110
  };
103
- //# sourceMappingURL=metafield-parser.mjs.map
111
+ //# sourceMappingURL=parse-metafield.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-metafield.mjs","sources":["../../src/parse-metafield.ts"],"sourcesContent":["import type {\n Collection,\n GenericFile,\n Metafield as MetafieldBaseType,\n MoneyV2,\n Page,\n Product,\n ProductVariant,\n} from './storefront-api-types.js';\nimport type {PartialDeep, Simplify} from 'type-fest';\nimport {flattenConnection} from './flatten-connection.js';\n\n/**\n * A function that uses `metafield.type` to parse the Metafield's `value` or `reference` or `references` (depending on the `metafield.type`) and places the result in `metafield.parsedValue`\n *\n * TypeScript developers can use the type `ParsedMetafields` from this package to get the returned object's type correct. For example:\n *\n * ```\n * parseMetafield<ParsedMetafields['boolean']>({type: 'boolean', value: 'false'}\n * ```\n */\nexport function parseMetafield<ReturnGeneric>(\n metafield: PartialDeep<MetafieldBaseType, {recurseIntoArrays: true}>\n): ReturnGeneric {\n if (!metafield.type) {\n const noTypeError = `parseMetafield(): The 'type' field is required in order to parse the Metafield.`;\n if (__HYDROGEN_DEV__) {\n throw new Error(noTypeError);\n } else {\n console.error(`${noTypeError} Returning 'parsedValue' of 'null'`);\n return {\n ...metafield,\n parsedValue: null,\n } as ReturnGeneric;\n }\n }\n\n switch (metafield.type) {\n case 'boolean':\n return {\n ...metafield,\n parsedValue: metafield.value === 'true',\n } as ReturnGeneric;\n\n case 'collection_reference':\n case 'file_reference':\n case 'page_reference':\n case 'product_reference':\n case 'variant_reference':\n return {\n ...metafield,\n parsedValue: metafield.reference,\n } as ReturnGeneric;\n\n case 'color':\n case 'multi_line_text_field':\n case 'single_line_text_field':\n case 'url':\n return {\n ...metafield,\n parsedValue: metafield.value,\n } as ReturnGeneric;\n\n // TODO: 'money' should probably be parsed even further to like `useMoney()`, but that logic needs to be extracted first so it's not a hook\n case 'dimension':\n case 'money':\n case 'json':\n case 'rating':\n case 'volume':\n case 'weight':\n case 'list.color':\n case 'list.dimension':\n case 'list.number_integer':\n case 'list.number_decimal':\n case 'list.rating':\n case 'list.single_line_text_field':\n case 'list.url':\n case 'list.volume':\n case 'list.weight': {\n let parsedValue = null;\n try {\n parsedValue = parseJSON(metafield.value ?? '');\n } catch (err) {\n const parseError = `parseMetafield(): attempted to JSON.parse the 'metafield.value' property, but failed.`;\n if (__HYDROGEN_DEV__) {\n throw new Error(parseError);\n } else {\n console.error(`${parseError} Returning 'null' for 'parsedValue'`);\n }\n parsedValue = null;\n }\n return {\n ...metafield,\n parsedValue,\n } as ReturnGeneric;\n }\n\n case 'date':\n case 'date_time':\n return {\n ...metafield,\n parsedValue: new Date(metafield.value ?? ''),\n } as ReturnGeneric;\n\n case 'list.date':\n case 'list.date_time': {\n const jsonParseValue = parseJSON(metafield?.value ?? '') as string[];\n return {\n ...metafield,\n parsedValue: jsonParseValue.map((dateString) => new Date(dateString)),\n } as ReturnGeneric;\n }\n\n case 'number_decimal':\n case 'number_integer':\n return {\n ...metafield,\n parsedValue: Number(metafield.value),\n } as ReturnGeneric;\n\n case 'list.collection_reference':\n case 'list.file_reference':\n case 'list.page_reference':\n case 'list.product_reference':\n case 'list.variant_reference':\n return {\n ...metafield,\n parsedValue: flattenConnection(metafield.references ?? undefined),\n } as ReturnGeneric;\n\n default: {\n const typeNotFoundError = `parseMetafield(): the 'metafield.type' you passed in is not supported. Your type: \"${metafield.type}\". If you believe this is an error, please open an issue on GitHub.`;\n if (__HYDROGEN_DEV__) {\n throw new Error(typeNotFoundError);\n } else {\n console.error(\n `${typeNotFoundError} Returning 'parsedValue' of 'null'`\n );\n return {\n ...metafield,\n parsedValue: null,\n } as ReturnGeneric;\n }\n }\n }\n}\n\n/**\n * Parses a JSON string while preventing prototype injection attacks.\n */\nexport function parseJSON(json: string) {\n if (String(json).includes('__proto__')) {\n return JSON.parse(json, (k, v) => {\n if (k !== '__proto__') return v;\n });\n }\n return JSON.parse(json);\n}\n\n// taken from https://shopify.dev/apps/metafields/types\nexport const allMetafieldTypesArray = [\n 'boolean',\n 'collection_reference',\n 'color',\n 'date',\n 'date_time',\n 'dimension',\n 'file_reference',\n 'json',\n 'money',\n 'multi_line_text_field',\n 'number_decimal',\n 'number_integer',\n 'page_reference',\n 'product_reference',\n 'rating',\n 'single_line_text_field',\n 'url',\n 'variant_reference',\n 'volume',\n 'weight',\n // list metafields\n 'list.collection_reference',\n 'list.color',\n 'list.date',\n 'list.date_time',\n 'list.dimension',\n 'list.file_reference',\n 'list.number_integer',\n 'list.number_decimal',\n 'list.page_reference',\n 'list.product_reference',\n 'list.rating',\n 'list.single_line_text_field',\n 'list.url',\n 'list.variant_reference',\n 'list.volume',\n 'list.weight',\n] as const;\n\n/** A union of all the supported `metafield.type`s */\nexport type MetafieldTypeTypes = (typeof allMetafieldTypesArray)[number];\n\n/**\n * A mapping of a Metafield's `type` to the TypeScript type that is returned from `parseMetafield()`\n * For example, when using `parseMetafield()`, the type will be correctly returned when used like the following:\n *\n * ```\n * const parsedMetafield = parseMetafield<ParsedMetafields['boolean']>(metafield);`\n * ```\n * `parsedMetafield.parsedValue`'s type is now `boolean`\n */\nexport type ParsedMetafields<ExtraTypeGeneric = void> = {\n /** A Metafield that's been parsed, with a `parsedValue` of `boolean` */\n boolean: Simplify<BooleanParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of a `Collection` object (as defined by the Storefront API) */\n collection_reference: Simplify<CollectionParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `string` */\n color: Simplify<ColorParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `Date` */\n date: Simplify<DatesParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `Date` */\n date_time: Simplify<DatesParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `Measurement` */\n dimension: Simplify<MeasurementParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of a `GenericFile` object (as defined by the Storefront API) */\n file_reference: Simplify<FileRefParsedMetafield>;\n /**\n * A Metafield that's been parsed, with a `parsedValue` of type `unknown`, unless you pass in the type as a generic. For example:\n *\n * ```\n * ParsedMetafields<MyJsonType>['json']\n * ```\n */\n json: Simplify<JsonParsedMetafield<ExtraTypeGeneric>>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `Money` */\n money: Simplify<MoneyParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `string` */\n multi_line_text_field: Simplify<TextParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `number` */\n number_decimal: Simplify<NumberParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `number` */\n number_integer: Simplify<NumberParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of a `Page` object (as defined by the Storefront API) */\n page_reference: Simplify<PageParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of a `Product` object (as defined by the Storefront API) */\n product_reference: Simplify<ProductParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `Rating` */\n rating: Simplify<RatingParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `string` */\n single_line_text_field: Simplify<TextParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `string` */\n url: Simplify<TextParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of a `ProductVariant` object (as defined by the Storefront API) */\n variant_reference: Simplify<VariantParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `Measurement` */\n volume: Simplify<MeasurementParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of type `Measurement` */\n weight: Simplify<MeasurementParsedMetafield>;\n // list metafields\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `Collection` objects (as defined by the Storefront API) */\n 'list.collection_reference': Simplify<CollectionListParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of strings */\n 'list.color': Simplify<ColorListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of Date objects */\n 'list.date': Simplify<DatesListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of Date objects */\n 'list.date_time': Simplify<DatesListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `Measurement` objects */\n 'list.dimension': Simplify<MeasurementListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `GenericFile` objects (as defined by the Storefront API) */\n 'list.file_reference': Simplify<FileListParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of numbers */\n 'list.number_integer': Simplify<NumberListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of numbers */\n 'list.number_decimal': Simplify<NumberListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `Page` objects (as defined by the Storefront API) */\n 'list.page_reference': Simplify<PageListParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `Product` objects (as defined by the Storefront API) */\n 'list.product_reference': Simplify<ProductListParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `Rating`s */\n 'list.rating': Simplify<RatingListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of strings */\n 'list.single_line_text_field': Simplify<TextListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of strings */\n 'list.url': Simplify<TextListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `ProductVariant` objects (as defined by the Storefront API) */\n 'list.variant_reference': Simplify<VariantListParsedRefMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `Measurement`s */\n 'list.volume': Simplify<MeasurementListParsedMetafield>;\n /** A Metafield that's been parsed, with a `parsedValue` of an array of `Measurement`s */\n 'list.weight': Simplify<MeasurementListParsedMetafield>;\n};\n\ninterface ParsedBase extends MetafieldBaseType {\n type: MetafieldTypeTypes;\n parsedValue: unknown;\n}\n\ninterface BooleanParsedMetafield extends ParsedBase {\n type: 'boolean';\n parsedValue: boolean | null;\n}\ntype CollectionParsedRefMetafield = MetafieldBaseType & {\n type: 'collection_reference';\n parsedValue: Collection | null;\n};\ntype ColorParsedMetafield = MetafieldBaseType & {\n type: 'color';\n parsedValue: string | null;\n};\ntype DatesParsedMetafield = MetafieldBaseType & {\n type: 'date' | 'date_time';\n parsedValue: Date | null;\n};\n\ntype MeasurementParsedMetafield = MetafieldBaseType & {\n type: 'dimension' | 'weight' | 'volume';\n parsedValue: Measurement | null;\n};\n\ntype FileRefParsedMetafield = MetafieldBaseType & {\n type: 'file_reference';\n parsedValue: GenericFile | null;\n};\n\ntype JsonParsedMetafield<JsonTypeGeneric = void> = MetafieldBaseType & {\n type: 'json';\n parsedValue: JsonTypeGeneric extends void ? unknown : JsonTypeGeneric | null;\n};\n\ntype MoneyParsedMetafield = MetafieldBaseType & {\n type: 'money';\n parsedValue: MoneyV2 | null;\n};\n\ntype TextParsedMetafield = MetafieldBaseType & {\n type: 'single_line_text_field' | 'multi_line_text_field' | 'url';\n parsedValue: string | null;\n};\n\ntype NumberParsedMetafield = MetafieldBaseType & {\n type: 'number_decimal' | 'number_integer';\n parsedValue: number | null;\n};\n\ntype PageParsedRefMetafield = MetafieldBaseType & {\n type: 'page_reference';\n parsedValue: Page | null;\n};\n\ntype ProductParsedRefMetafield = MetafieldBaseType & {\n type: 'product_reference';\n parsedValue: Product | null;\n};\n\ntype RatingParsedMetafield = MetafieldBaseType & {\n type: 'rating';\n parsedValue: Rating | null;\n};\n\ntype VariantParsedRefMetafield = MetafieldBaseType & {\n type: 'variant_reference';\n parsedValue: ProductVariant | null;\n};\n\ntype CollectionListParsedRefMetafield = MetafieldBaseType & {\n type: 'list.collection_reference';\n parsedValue: Array<Collection> | null;\n};\n\ntype ColorListParsedMetafield = MetafieldBaseType & {\n type: 'list.color';\n parsedValue: Array<string> | null;\n};\n\ntype DatesListParsedMetafield = MetafieldBaseType & {\n type: 'list.date' | 'list.date_time';\n parsedValue: Array<Date> | null;\n};\n\ntype MeasurementListParsedMetafield = MetafieldBaseType & {\n type: 'list.dimension' | 'list.weight' | 'list.volume';\n parsedValue: Array<Measurement> | null;\n};\n\ntype FileListParsedRefMetafield = MetafieldBaseType & {\n type: 'list.file_reference';\n parsedValue: Array<GenericFile> | null;\n};\n\ntype TextListParsedMetafield = MetafieldBaseType & {\n type: 'list.single_line_text_field' | 'list.url';\n parsedValue: Array<string> | null;\n};\n\ntype NumberListParsedMetafield = MetafieldBaseType & {\n type: 'list.number_decimal' | 'list.number_integer';\n parsedValue: Array<number> | null;\n};\n\ntype PageListParsedRefMetafield = MetafieldBaseType & {\n type: 'list.page_reference';\n parsedValue: Array<Page> | null;\n};\n\ntype ProductListParsedRefMetafield = MetafieldBaseType & {\n type: 'list.product_reference';\n parsedValue: Array<Product> | null;\n};\n\ntype RatingListParsedMetafield = MetafieldBaseType & {\n type: 'list.rating';\n parsedValue: Array<Rating> | null;\n};\n\ntype VariantListParsedRefMetafield = MetafieldBaseType & {\n type: 'list.variant_reference';\n parsedValue: Array<ProductVariant> | null;\n};\n\nexport type Measurement = {\n unit: string;\n value: number;\n};\n\nexport interface Rating {\n value: number;\n scale_min: number;\n scale_max: number;\n}\n"],"names":[],"mappings":";AAqBO,SAAS,eACd,WACe;AACX,MAAA,CAAC,UAAU,MAAM;AACnB,UAAM,cAAc;AACE;AACd,YAAA,IAAI,MAAM,WAAW;AAAA,IAO7B;AAAA,EACF;AAEA,UAAQ,UAAU,MAAM;AAAA,IACtB,KAAK;AACI,aAAA;AAAA,QACL,GAAG;AAAA,QACH,aAAa,UAAU,UAAU;AAAA,MAAA;AAAA,IAGrC,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,GAAG;AAAA,QACH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;AAAA,MAAA;AAAA,IAGpE,SAAS;AACD,YAAA,oBAAoB,sFAAsF,UAAU;AACpG;AACd,cAAA,IAAI,MAAM,iBAAiB;AAAA,MASnC;AAAA,IACF;AAAA,EACF;AACF;AAKO,SAAS,UAAU,MAAc;AACtC,MAAI,OAAO,IAAI,EAAE,SAAS,WAAW,GAAG;AACtC,WAAO,KAAK,MAAM,MAAM,CAAC,GAAG,MAAM;AAChC,UAAI,MAAM;AAAoB,eAAA;AAAA,IAAA,CAC/B;AAAA,EACH;AACO,SAAA,KAAK,MAAM,IAAI;AACxB;"}
@@ -1,4 +1,4 @@
1
- const SFAPI_VERSION = "2022-10";
1
+ const SFAPI_VERSION = "2023-01";
2
2
  export {
3
3
  SFAPI_VERSION
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"storefront-api-constants.mjs","sources":["../../src/storefront-api-constants.ts"],"sourcesContent":["export const SFAPI_VERSION = '2022-10';\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB;"}
1
+ {"version":3,"file":"storefront-api-constants.mjs","sources":["../../src/storefront-api-constants.ts"],"sourcesContent":["export const SFAPI_VERSION = '2023-01';\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB;"}
@@ -1,11 +1,4 @@
1
1
  import { SFAPI_VERSION } from "./storefront-api-constants.mjs";
2
- const warnings = /* @__PURE__ */ new Set();
3
- const warnOnce = (string) => {
4
- if (!warnings.has(string)) {
5
- console.warn(string);
6
- warnings.add(string);
7
- }
8
- };
9
2
  function createStorefrontClient({
10
3
  storeDomain,
11
4
  privateStorefrontToken,
@@ -15,7 +8,7 @@ function createStorefrontClient({
15
8
  }) {
16
9
  if (storefrontApiVersion !== SFAPI_VERSION) {
17
10
  warnOnce(
18
- `StorefrontClient: The Storefront API version that you're using is different than the version this build of Hydrogen-UI is targeting. You may run into unexpected errors if these versions don't match. Received verion: "${storefrontApiVersion}"; expected version "${SFAPI_VERSION}"`
11
+ `StorefrontClient: The Storefront API version that you're using is different than the version this build of Hydrogen React is targeting. You may run into unexpected errors if these versions don't match. Received verion: "${storefrontApiVersion}"; expected version "${SFAPI_VERSION}"`
19
12
  );
20
13
  }
21
14
  if (!privateStorefrontToken && !globalThis.document) {
@@ -30,15 +23,13 @@ function createStorefrontClient({
30
23
  }
31
24
  return {
32
25
  getShopifyDomain(overrideProps) {
33
- var _a;
34
- return `https://${(_a = overrideProps == null ? void 0 : overrideProps.storeDomain) != null ? _a : storeDomain}.myshopify.com`;
26
+ return (overrideProps == null ? void 0 : overrideProps.storeDomain) ?? storeDomain;
35
27
  },
36
28
  getStorefrontApiUrl(overrideProps) {
37
- var _a, _b;
38
- return `https://${(_a = overrideProps == null ? void 0 : overrideProps.storeDomain) != null ? _a : storeDomain}.myshopify.com/api/${(_b = overrideProps == null ? void 0 : overrideProps.storefrontApiVersion) != null ? _b : storefrontApiVersion}/graphql.json`;
29
+ const finalDomainUrl = (overrideProps == null ? void 0 : overrideProps.storeDomain) ?? storeDomain;
30
+ return `${finalDomainUrl}${finalDomainUrl.endsWith("/") ? "" : "/"}api/${(overrideProps == null ? void 0 : overrideProps.storefrontApiVersion) ?? storefrontApiVersion}/graphql.json`;
39
31
  },
40
32
  getPrivateTokenHeaders(overrideProps) {
41
- var _a, _b, _c;
42
33
  if (!privateStorefrontToken && !(overrideProps == null ? void 0 : overrideProps.privateStorefrontToken)) {
43
34
  throw new Error(
44
35
  `StorefrontClient: You did not pass in a 'privateStorefrontToken' while using 'getPrivateTokenHeaders()'`
@@ -49,41 +40,49 @@ function createStorefrontClient({
49
40
  `StorefrontClient: it is recommended to pass in the 'buyerIp' property which improves analytics and data in the admin.`
50
41
  );
51
42
  }
52
- const finalContentType = (_a = overrideProps == null ? void 0 : overrideProps.contentType) != null ? _a : contentType;
43
+ const finalContentType = (overrideProps == null ? void 0 : overrideProps.contentType) ?? contentType;
53
44
  return {
45
+ // default to json
54
46
  "content-type": finalContentType === "graphql" ? "application/graphql" : "application/json",
55
- "X-SDK-Variant": "hydrogen-ui",
47
+ "X-SDK-Variant": "hydrogen-react",
56
48
  "X-SDK-Variant-Source": "react",
57
49
  "X-SDK-Version": storefrontApiVersion,
58
- "Shopify-Storefront-Private-Token": (_c = (_b = overrideProps == null ? void 0 : overrideProps.privateStorefrontToken) != null ? _b : privateStorefrontToken) != null ? _c : "",
50
+ "Shopify-Storefront-Private-Token": (overrideProps == null ? void 0 : overrideProps.privateStorefrontToken) ?? privateStorefrontToken ?? "",
59
51
  ...(overrideProps == null ? void 0 : overrideProps.buyerIp) ? { "Shopify-Storefront-Buyer-IP": overrideProps.buyerIp } : {}
60
52
  };
61
53
  },
62
54
  getPublicTokenHeaders(overrideProps) {
63
- var _a, _b, _c, _d;
64
55
  if (!publicStorefrontToken && !(overrideProps == null ? void 0 : overrideProps.publicStorefrontToken)) {
65
56
  throw new Error(
66
57
  `StorefrontClient: You did not pass in a 'publicStorefrontToken' while using 'getPublicTokenHeaders()'`
67
58
  );
68
59
  }
69
- const finalContentType = (_b = (_a = overrideProps == null ? void 0 : overrideProps.contentType) != null ? _a : contentType) != null ? _b : "json";
60
+ const finalContentType = (overrideProps == null ? void 0 : overrideProps.contentType) ?? contentType ?? "json";
70
61
  return getPublicTokenHeadersRaw(
71
62
  finalContentType,
72
63
  storefrontApiVersion,
73
- (_d = (_c = overrideProps == null ? void 0 : overrideProps.publicStorefrontToken) != null ? _c : publicStorefrontToken) != null ? _d : ""
64
+ (overrideProps == null ? void 0 : overrideProps.publicStorefrontToken) ?? publicStorefrontToken ?? ""
74
65
  );
75
66
  }
76
67
  };
77
68
  }
78
69
  function getPublicTokenHeadersRaw(contentType, storefrontApiVersion, accessToken) {
79
70
  return {
71
+ // default to json
80
72
  "content-type": contentType === "graphql" ? "application/graphql" : "application/json",
81
- "X-SDK-Variant": "hydrogen-ui",
73
+ "X-SDK-Variant": "hydrogen-react",
82
74
  "X-SDK-Variant-Source": "react",
83
75
  "X-SDK-Version": storefrontApiVersion,
84
76
  "X-Shopify-Storefront-Access-Token": accessToken
85
77
  };
86
78
  }
79
+ const warnings = /* @__PURE__ */ new Set();
80
+ const warnOnce = (string) => {
81
+ if (!warnings.has(string)) {
82
+ console.warn(string);
83
+ warnings.add(string);
84
+ }
85
+ };
87
86
  export {
88
87
  createStorefrontClient,
89
88
  getPublicTokenHeadersRaw
@@ -1 +1 @@
1
- {"version":3,"file":"storefront-client.mjs","sources":["../../src/storefront-client.ts"],"sourcesContent":["import {SFAPI_VERSION} from './storefront-api-constants.js';\n\nconst warnings = new Set<string>();\nconst warnOnce = (string: string) => {\n if (!warnings.has(string)) {\n console.warn(string);\n warnings.add(string);\n }\n};\n\n/**\n * The `createStorefrontClient()` function creates helpers that enable you to quickly query the Shopify Storefront API.\n *\n * When used on the server, it is recommended to use the `privateStorefrontToken` prop. When used on the client, it is recommended to use the `publicStorefrontToken` prop.\n */\nexport function createStorefrontClient({\n storeDomain,\n privateStorefrontToken,\n publicStorefrontToken,\n storefrontApiVersion,\n contentType,\n}: StorefrontClientProps): StorefrontClientReturn {\n if (storefrontApiVersion !== SFAPI_VERSION) {\n warnOnce(\n `StorefrontClient: The Storefront API version that you're using is different than the version this build of Hydrogen-UI is targeting. You may run into unexpected errors if these versions don't match. Received verion: \"${storefrontApiVersion}\"; expected version \"${SFAPI_VERSION}\"`\n );\n }\n\n // only warn if not in a browser environment\n if (__HYDROGEN_DEV__ && !privateStorefrontToken && !globalThis.document) {\n warnOnce(\n `StorefrontClient: Using a private storefront token is recommended for server environments. Refer to the authentication https://shopify.dev/api/storefront#authentication documentation for more details.`\n );\n }\n\n // only warn if in a browser environment and you're using the privateStorefrontToken\n if (__HYDROGEN_DEV__ && privateStorefrontToken && globalThis) {\n warnOnce(\n `StorefrontClient: You are attempting to use a private token in an environment where it can be easily accessed by anyone. This is a security risk; please use the public token and the 'publicStorefrontToken' prop`\n );\n }\n\n return {\n getShopifyDomain(overrideProps) {\n return `https://${\n overrideProps?.storeDomain ?? storeDomain\n }.myshopify.com`;\n },\n getStorefrontApiUrl(overrideProps) {\n return `https://${\n overrideProps?.storeDomain ?? storeDomain\n }.myshopify.com/api/${\n overrideProps?.storefrontApiVersion ?? storefrontApiVersion\n }/graphql.json`;\n },\n getPrivateTokenHeaders(overrideProps) {\n if (!privateStorefrontToken && !overrideProps?.privateStorefrontToken) {\n throw new Error(\n `StorefrontClient: You did not pass in a 'privateStorefrontToken' while using 'getPrivateTokenHeaders()'`\n );\n }\n\n if (__HYDROGEN_DEV__ && !overrideProps?.buyerIp) {\n warnOnce(\n `StorefrontClient: it is recommended to pass in the 'buyerIp' property which improves analytics and data in the admin.`\n );\n }\n\n const finalContentType = overrideProps?.contentType ?? contentType;\n\n return {\n // default to json\n 'content-type':\n finalContentType === 'graphql'\n ? 'application/graphql'\n : 'application/json',\n 'X-SDK-Variant': 'hydrogen-ui',\n 'X-SDK-Variant-Source': 'react',\n 'X-SDK-Version': storefrontApiVersion,\n 'Shopify-Storefront-Private-Token':\n overrideProps?.privateStorefrontToken ?? privateStorefrontToken ?? '',\n ...(overrideProps?.buyerIp\n ? {'Shopify-Storefront-Buyer-IP': overrideProps.buyerIp}\n : {}),\n };\n },\n getPublicTokenHeaders(overrideProps) {\n if (!publicStorefrontToken && !overrideProps?.publicStorefrontToken) {\n throw new Error(\n `StorefrontClient: You did not pass in a 'publicStorefrontToken' while using 'getPublicTokenHeaders()'`\n );\n }\n\n const finalContentType =\n overrideProps?.contentType ?? contentType ?? 'json';\n\n return getPublicTokenHeadersRaw(\n finalContentType,\n storefrontApiVersion,\n overrideProps?.publicStorefrontToken ?? publicStorefrontToken ?? ''\n );\n },\n };\n}\n\nexport function getPublicTokenHeadersRaw(\n contentType: 'graphql' | 'json',\n storefrontApiVersion: string,\n accessToken: string\n) {\n return {\n // default to json\n 'content-type':\n contentType === 'graphql' ? 'application/graphql' : 'application/json',\n 'X-SDK-Variant': 'hydrogen-ui',\n 'X-SDK-Variant-Source': 'react',\n 'X-SDK-Version': storefrontApiVersion,\n 'X-Shopify-Storefront-Access-Token': accessToken,\n };\n}\n\ntype StorefrontClientProps = {\n /** The host name of the domain (eg: `{shop}.myshopify.com`). */\n storeDomain: string;\n /** The Storefront API delegate access token. Refer to the [authentication](https://shopify.dev/api/storefront#authentication) and [delegate access token](https://shopify.dev/apps/auth/oauth/delegate-access-tokens) documentation for more details. */\n privateStorefrontToken?: string;\n /** The Storefront API access token. Refer to the [authentication](https://shopify.dev/api/storefront#authentication) documentation for more details. */\n publicStorefrontToken?: string;\n /** The Storefront API version. This should almost always be the same as the version Hydrogen-UI was built for. Learn more about Shopify [API versioning](https://shopify.dev/api/usage/versioning) for more details. */\n storefrontApiVersion: string;\n /**\n * Customizes which `\"content-type\"` header is added when using `getPrivateTokenHeaders()` and `getPublicTokenHeaders()`. When fetching with a `JSON.stringify()`-ed `body`, use `\"json\"`. When fetching with a `body` that is a plain string, use `\"graphql\"`. Defaults to `\"json\"`\n *\n * Can also be customized on a call-by-call basis by passing in `'contentType'` to both `getPrivateTokenHeaders({...})` and `getPublicTokenHeaders({...})`, for example: `getPublicTokenHeaders({contentType: 'graphql'})`\n */\n contentType?: 'json' | 'graphql';\n};\n\ntype OverrideTokenHeaderProps = Partial<\n Pick<StorefrontClientProps, 'contentType'>\n>;\n\ntype StorefrontClientReturn = {\n /**\n * Creates the fully-qualified URL to your myshopify.com domain.\n *\n * By default, it will use the config you passed in when calling `createStorefrontClient()`. However, you can override the following settings on each invocation of `getShopifyDomain({...})`:\n *\n * - `storeDomain`\n */\n getShopifyDomain: (\n props?: Partial<Pick<StorefrontClientProps, 'storeDomain'>>\n ) => string;\n /**\n * Creates the fully-qualified URL to your store's GraphQL endpoint.\n *\n * By default, it will use the config you passed in when calling `createStorefrontClient()`. However, you can override the following settings on each invocation of `getStorefrontApiUrl({...})`:\n *\n * - `storeDomain`\n * - `storefrontApiVersion`\n */\n getStorefrontApiUrl: (\n props?: Partial<\n Pick<StorefrontClientProps, 'storeDomain' | 'storefrontApiVersion'>\n >\n ) => string;\n /**\n * Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint. This method uses the private Server-to-Server token which reduces the chance of throttling but must not be exposed to clients. Server-side calls should prefer using this over `getPublicTokenHeaders()`.\n *\n * By default, it will use the config you passed in when calling `createStorefrontClient()`. However, you can override the following settings on each invocation of `getPrivateTokenHeaders({...})`:\n *\n * - `contentType`\n * - `privateStorefrontToken`\n * - `buyerIp`\n *\n * Note that `contentType` defaults to what you configured in `createStorefrontClient({...})` and defaults to `'json'`, but a specific call may require using `graphql`. When using `JSON.stringify()` on the `body`, use `'json'`; otherwise, use `'graphql'`.\n */\n getPrivateTokenHeaders: (\n props?: OverrideTokenHeaderProps &\n Pick<StorefrontClientProps, 'privateStorefrontToken'> & {\n /**\n * The client's IP address. Passing this to the Storefront API when using a server-to-server token will help improve your store's analytics data.\n */\n buyerIp?: string;\n }\n ) => Record<string, string>;\n /**\n * Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint. This method uses the public token which increases the chance of throttling but also can be exposed to clients. Server-side calls should prefer using `getPublicTokenHeaders()`.\n *\n * By default, it will use the config you passed in when calling `createStorefrontClient()`. However, you can override the following settings on each invocation of `getPublicTokenHeaders({...})`:\n *\n * - `contentType`\n * - `publicStorefrontToken`\n *\n * Note that `contentType` defaults to what you configured in `createStorefrontClient({...})` and defaults to `'json'`, but a specific call may require using `graphql`. When using `JSON.stringify()` on the `body`, use `'json'`; otherwise, use `'graphql'`.\n */\n getPublicTokenHeaders: (\n props?: OverrideTokenHeaderProps &\n Pick<StorefrontClientProps, 'publicStorefrontToken'>\n ) => Record<string, string>;\n};\n"],"names":[],"mappings":";AAEA,MAAM,+BAAe;AACrB,MAAM,WAAW,CAAC,WAAmB;AACnC,MAAI,CAAC,SAAS,IAAI,MAAM,GAAG;AACzB,YAAQ,KAAK,MAAM;AACnB,aAAS,IAAI,MAAM;AAAA,EACrB;AACF;AAOO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAkD;AAChD,MA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;AAAA,EAAA;AAEJ;AAEgB,SAAA,yBACd,aACA,sBACA,aACA;AACO,SAAA;AAAA,IAEL,gBACE,gBAAgB,YAAY,wBAAwB;AAAA,IACtD,iBAAiB;AAAA,IACjB,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,IACjB,qCAAqC;AAAA,EAAA;AAEzC;"}
1
+ {"version":3,"file":"storefront-client.mjs","sources":["../../src/storefront-client.ts"],"sourcesContent":["import {SFAPI_VERSION} from './storefront-api-constants.js';\n\ntype StorefrontClientProps = {\n /** The host name of the domain (eg: `{shop}.myshopify.com`). */\n storeDomain: string;\n /** The Storefront API delegate access token. Refer to the [authentication](https://shopify.dev/api/storefront#authentication) and [delegate access token](https://shopify.dev/apps/auth/oauth/delegate-access-tokens) documentation for more details. */\n privateStorefrontToken?: string;\n /** The Storefront API access token. Refer to the [authentication](https://shopify.dev/api/storefront#authentication) documentation for more details. */\n publicStorefrontToken?: string;\n /** The Storefront API version. This should almost always be the same as the version Hydrogen React was built for. Learn more about Shopify [API versioning](https://shopify.dev/api/usage/versioning) for more details. */\n storefrontApiVersion: string;\n /**\n * Customizes which `\"content-type\"` header is added when using `getPrivateTokenHeaders()` and `getPublicTokenHeaders()`. When fetching with a `JSON.stringify()`-ed `body`, use `\"json\"`. When fetching with a `body` that is a plain string, use `\"graphql\"`. Defaults to `\"json\"`\n *\n * Can also be customized on a call-by-call basis by passing in `'contentType'` to both `getPrivateTokenHeaders({...})` and `getPublicTokenHeaders({...})`, for example: `getPublicTokenHeaders({contentType: 'graphql'})`\n */\n contentType?: 'json' | 'graphql';\n};\n\n/**\n * The `createStorefrontClient()` function creates helpers that enable you to quickly query the Shopify Storefront API.\n *\n * When used on the server, it is recommended to use the `privateStorefrontToken` prop. When used on the client, it is recommended to use the `publicStorefrontToken` prop.\n */\nexport function createStorefrontClient({\n storeDomain,\n privateStorefrontToken,\n publicStorefrontToken,\n storefrontApiVersion,\n contentType,\n}: StorefrontClientProps): StorefrontClientReturn {\n if (storefrontApiVersion !== SFAPI_VERSION) {\n warnOnce(\n `StorefrontClient: The Storefront API version that you're using is different than the version this build of Hydrogen React is targeting. You may run into unexpected errors if these versions don't match. Received verion: \"${storefrontApiVersion}\"; expected version \"${SFAPI_VERSION}\"`\n );\n }\n\n // only warn if not in a browser environment\n if (__HYDROGEN_DEV__ && !privateStorefrontToken && !globalThis.document) {\n warnOnce(\n `StorefrontClient: Using a private storefront token is recommended for server environments. Refer to the authentication https://shopify.dev/api/storefront#authentication documentation for more details.`\n );\n }\n\n // only warn if in a browser environment and you're using the privateStorefrontToken\n if (__HYDROGEN_DEV__ && privateStorefrontToken && globalThis) {\n warnOnce(\n `StorefrontClient: You are attempting to use a private token in an environment where it can be easily accessed by anyone. This is a security risk; please use the public token and the 'publicStorefrontToken' prop`\n );\n }\n\n return {\n getShopifyDomain(overrideProps) {\n return overrideProps?.storeDomain ?? storeDomain;\n },\n getStorefrontApiUrl(overrideProps) {\n const finalDomainUrl = overrideProps?.storeDomain ?? storeDomain;\n return `${finalDomainUrl}${finalDomainUrl.endsWith('/') ? '' : '/'}api/${\n overrideProps?.storefrontApiVersion ?? storefrontApiVersion\n }/graphql.json`;\n },\n getPrivateTokenHeaders(overrideProps) {\n if (!privateStorefrontToken && !overrideProps?.privateStorefrontToken) {\n throw new Error(\n `StorefrontClient: You did not pass in a 'privateStorefrontToken' while using 'getPrivateTokenHeaders()'`\n );\n }\n\n if (__HYDROGEN_DEV__ && !overrideProps?.buyerIp) {\n warnOnce(\n `StorefrontClient: it is recommended to pass in the 'buyerIp' property which improves analytics and data in the admin.`\n );\n }\n\n const finalContentType = overrideProps?.contentType ?? contentType;\n\n return {\n // default to json\n 'content-type':\n finalContentType === 'graphql'\n ? 'application/graphql'\n : 'application/json',\n 'X-SDK-Variant': 'hydrogen-react',\n 'X-SDK-Variant-Source': 'react',\n 'X-SDK-Version': storefrontApiVersion,\n 'Shopify-Storefront-Private-Token':\n overrideProps?.privateStorefrontToken ?? privateStorefrontToken ?? '',\n ...(overrideProps?.buyerIp\n ? {'Shopify-Storefront-Buyer-IP': overrideProps.buyerIp}\n : {}),\n };\n },\n getPublicTokenHeaders(overrideProps) {\n if (!publicStorefrontToken && !overrideProps?.publicStorefrontToken) {\n throw new Error(\n `StorefrontClient: You did not pass in a 'publicStorefrontToken' while using 'getPublicTokenHeaders()'`\n );\n }\n\n const finalContentType =\n overrideProps?.contentType ?? contentType ?? 'json';\n\n return getPublicTokenHeadersRaw(\n finalContentType,\n storefrontApiVersion,\n overrideProps?.publicStorefrontToken ?? publicStorefrontToken ?? ''\n );\n },\n };\n}\n\nexport function getPublicTokenHeadersRaw(\n contentType: 'graphql' | 'json',\n storefrontApiVersion: string,\n accessToken: string\n) {\n return {\n // default to json\n 'content-type':\n contentType === 'graphql' ? 'application/graphql' : 'application/json',\n 'X-SDK-Variant': 'hydrogen-react',\n 'X-SDK-Variant-Source': 'react',\n 'X-SDK-Version': storefrontApiVersion,\n 'X-Shopify-Storefront-Access-Token': accessToken,\n };\n}\n\nconst warnings = new Set<string>();\nconst warnOnce = (string: string) => {\n if (!warnings.has(string)) {\n console.warn(string);\n warnings.add(string);\n }\n};\n\ntype OverrideTokenHeaderProps = Partial<\n Pick<StorefrontClientProps, 'contentType'>\n>;\n\ntype StorefrontClientReturn = {\n /**\n * Creates the fully-qualified URL to your myshopify.com domain.\n *\n * By default, it will use the config you passed in when calling `createStorefrontClient()`. However, you can override the following settings on each invocation of `getShopifyDomain({...})`:\n *\n * - `storeDomain`\n */\n getShopifyDomain: (\n props?: Partial<Pick<StorefrontClientProps, 'storeDomain'>>\n ) => string;\n /**\n * Creates the fully-qualified URL to your store's GraphQL endpoint.\n *\n * By default, it will use the config you passed in when calling `createStorefrontClient()`. However, you can override the following settings on each invocation of `getStorefrontApiUrl({...})`:\n *\n * - `storeDomain`\n * - `storefrontApiVersion`\n */\n getStorefrontApiUrl: (\n props?: Partial<\n Pick<StorefrontClientProps, 'storeDomain' | 'storefrontApiVersion'>\n >\n ) => string;\n /**\n * Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint. This method uses the private Server-to-Server token which reduces the chance of throttling but must not be exposed to clients. Server-side calls should prefer using this over `getPublicTokenHeaders()`.\n *\n * By default, it will use the config you passed in when calling `createStorefrontClient()`. However, you can override the following settings on each invocation of `getPrivateTokenHeaders({...})`:\n *\n * - `contentType`\n * - `privateStorefrontToken`\n * - `buyerIp`\n *\n * Note that `contentType` defaults to what you configured in `createStorefrontClient({...})` and defaults to `'json'`, but a specific call may require using `graphql`. When using `JSON.stringify()` on the `body`, use `'json'`; otherwise, use `'graphql'`.\n */\n getPrivateTokenHeaders: (\n props?: OverrideTokenHeaderProps &\n Pick<StorefrontClientProps, 'privateStorefrontToken'> & {\n /**\n * The client's IP address. Passing this to the Storefront API when using a server-to-server token will help improve your store's analytics data.\n */\n buyerIp?: string;\n }\n ) => Record<string, string>;\n /**\n * Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint. This method uses the public token which increases the chance of throttling but also can be exposed to clients. Server-side calls should prefer using `getPublicTokenHeaders()`.\n *\n * By default, it will use the config you passed in when calling `createStorefrontClient()`. However, you can override the following settings on each invocation of `getPublicTokenHeaders({...})`:\n *\n * - `contentType`\n * - `publicStorefrontToken`\n *\n * Note that `contentType` defaults to what you configured in `createStorefrontClient({...})` and defaults to `'json'`, but a specific call may require using `graphql`. When using `JSON.stringify()` on the `body`, use `'json'`; otherwise, use `'graphql'`.\n */\n getPublicTokenHeaders: (\n props?: OverrideTokenHeaderProps &\n Pick<StorefrontClientProps, 'publicStorefrontToken'>\n ) => Record<string, string>;\n};\n"],"names":[],"mappings":";AAwBO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAkD;AAChD,MAAI,yBAAyB,eAAe;AAC1C;AAAA,MACE,+NAA+N,4CAA4C;AAAA,IAAA;AAAA,EAE/Q;AAGA,MAAwB,CAAC,0BAA0B,CAAC,WAAW,UAAU;AACvE;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