@shopify/hydrogen-react 2022.7.0 → 2022.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/dev/CartProvider.cjs +485 -0
- package/dist/dev/CartProvider.cjs.map +1 -0
- package/dist/dev/CartProvider.js +485 -0
- package/dist/dev/CartProvider.js.map +1 -0
- package/dist/dev/MediaFile.cjs.map +1 -1
- package/dist/dev/MediaFile.js.map +1 -1
- package/dist/dev/Metafield.cjs +2 -2
- package/dist/dev/Metafield.cjs.map +1 -1
- package/dist/dev/Metafield.js.map +1 -1
- package/dist/dev/ModelViewer.cjs +4 -4
- package/dist/dev/ModelViewer.cjs.map +1 -1
- package/dist/dev/Money.cjs.map +1 -1
- package/dist/dev/Money.js.map +1 -1
- package/dist/dev/ProductPrice.cjs.map +1 -1
- package/dist/dev/ProductPrice.js.map +1 -1
- package/dist/dev/ProductProvider.cjs +14 -14
- package/dist/dev/ProductProvider.cjs.map +1 -1
- package/dist/dev/ShopPayButton.cjs.map +1 -1
- package/dist/dev/ShopPayButton.js.map +1 -1
- package/dist/dev/ShopifyProvider.cjs +4 -4
- package/dist/dev/ShopifyProvider.cjs.map +1 -1
- package/dist/dev/Video.cjs +2 -2
- package/dist/dev/_virtual/index.cjs +5 -0
- package/dist/dev/_virtual/index.cjs.map +1 -0
- package/dist/dev/_virtual/index.js +5 -0
- package/dist/dev/_virtual/index.js.map +1 -0
- package/dist/dev/_virtual/use-sync-external-store-shim.development.cjs +5 -0
- package/dist/dev/_virtual/use-sync-external-store-shim.development.cjs.map +1 -0
- package/dist/dev/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/dev/_virtual/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/dev/_virtual/use-sync-external-store-shim.production.min.cjs +5 -0
- package/dist/dev/_virtual/use-sync-external-store-shim.production.min.cjs.map +1 -0
- package/dist/dev/_virtual/use-sync-external-store-shim.production.min.js +5 -0
- package/dist/dev/_virtual/use-sync-external-store-shim.production.min.js.map +1 -0
- package/dist/dev/_virtual/with-selector.cjs +5 -0
- package/dist/dev/_virtual/with-selector.cjs.map +1 -0
- package/dist/dev/_virtual/with-selector.development.cjs +5 -0
- package/dist/dev/_virtual/with-selector.development.cjs.map +1 -0
- package/dist/dev/_virtual/with-selector.development.js +5 -0
- package/dist/dev/_virtual/with-selector.development.js.map +1 -0
- package/dist/dev/_virtual/with-selector.js +5 -0
- package/dist/dev/_virtual/with-selector.js.map +1 -0
- package/dist/dev/_virtual/with-selector.production.min.cjs +5 -0
- package/dist/dev/_virtual/with-selector.production.min.cjs.map +1 -0
- package/dist/dev/_virtual/with-selector.production.min.js +5 -0
- package/dist/dev/_virtual/with-selector.production.min.js.map +1 -0
- package/dist/dev/cart-constants.cjs +17 -0
- package/dist/dev/cart-constants.cjs.map +1 -0
- package/dist/dev/cart-constants.js +17 -0
- package/dist/dev/cart-constants.js.map +1 -0
- package/dist/dev/cart-hooks.cjs +48 -0
- package/dist/dev/cart-hooks.cjs.map +1 -0
- package/dist/dev/cart-hooks.js +48 -0
- package/dist/dev/cart-hooks.js.map +1 -0
- package/dist/dev/cart-queries.cjs +114 -0
- package/dist/dev/cart-queries.cjs.map +1 -0
- package/dist/dev/cart-queries.js +114 -0
- package/dist/dev/cart-queries.js.map +1 -0
- package/dist/dev/flatten-connection.cjs +6 -0
- package/dist/dev/flatten-connection.cjs.map +1 -1
- package/dist/dev/flatten-connection.js +6 -0
- package/dist/dev/flatten-connection.js.map +1 -1
- package/dist/dev/index.cjs +3 -0
- package/dist/dev/index.cjs.map +1 -1
- package/dist/dev/index.js +3 -0
- package/dist/dev/index.js.map +1 -1
- package/dist/dev/load-script.cjs +3 -3
- package/dist/dev/load-script.cjs.map +1 -1
- package/dist/dev/node_modules/@xstate/fsm/es/index.cjs +158 -0
- package/dist/dev/node_modules/@xstate/fsm/es/index.cjs.map +1 -0
- package/dist/dev/node_modules/@xstate/fsm/es/index.js +159 -0
- package/dist/dev/node_modules/@xstate/fsm/es/index.js.map +1 -0
- package/dist/dev/node_modules/@xstate/react/es/fsm.cjs +94 -0
- package/dist/dev/node_modules/@xstate/react/es/fsm.cjs.map +1 -0
- package/dist/dev/node_modules/@xstate/react/es/fsm.js +94 -0
- package/dist/dev/node_modules/@xstate/react/es/fsm.js.map +1 -0
- package/dist/dev/node_modules/@xstate/react/es/useConstant.cjs +30 -0
- package/dist/dev/node_modules/@xstate/react/es/useConstant.cjs.map +1 -0
- package/dist/dev/node_modules/@xstate/react/es/useConstant.js +12 -0
- package/dist/dev/node_modules/@xstate/react/es/useConstant.js.map +1 -0
- package/dist/dev/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.cjs +5 -0
- package/dist/dev/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.cjs.map +1 -0
- package/dist/dev/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js +6 -0
- package/dist/dev/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.cjs +107 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.cjs.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +105 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.cjs +74 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.cjs.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +72 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +138 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +136 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.cjs +60 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.cjs.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +58 -0
- package/dist/dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/shim/index.cjs +21 -0
- package/dist/dev/node_modules/use-sync-external-store/shim/index.cjs.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/shim/index.js +21 -0
- package/dist/dev/node_modules/use-sync-external-store/shim/index.js.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/shim/with-selector.cjs +12 -0
- package/dist/dev/node_modules/use-sync-external-store/shim/with-selector.cjs.map +1 -0
- package/dist/dev/node_modules/use-sync-external-store/shim/with-selector.js +11 -0
- package/dist/dev/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
- package/dist/dev/node_modules/worktop/cookie/index.cjs +27 -0
- package/dist/dev/node_modules/worktop/cookie/index.cjs.map +1 -0
- package/dist/dev/node_modules/worktop/cookie/index.js +27 -0
- package/dist/dev/node_modules/worktop/cookie/index.js.map +1 -0
- package/dist/dev/storefront-api-constants.cjs +1 -1
- package/dist/dev/storefront-api-constants.cjs.map +1 -1
- package/dist/dev/storefront-api-constants.js +1 -1
- package/dist/dev/storefront-api-constants.js.map +1 -1
- package/dist/dev/useCartAPIStateMachine.cjs +326 -0
- package/dist/dev/useCartAPIStateMachine.cjs.map +1 -0
- package/dist/dev/useCartAPIStateMachine.js +326 -0
- package/dist/dev/useCartAPIStateMachine.js.map +1 -0
- package/dist/dev/useCartActions.cjs +123 -0
- package/dist/dev/useCartActions.cjs.map +1 -0
- package/dist/dev/useCartActions.js +123 -0
- package/dist/dev/useCartActions.js.map +1 -0
- package/dist/dev/useMoney.cjs +5 -5
- package/dist/dev/useMoney.cjs.map +1 -1
- package/dist/prod/CartProvider.cjs +485 -0
- package/dist/prod/CartProvider.cjs.map +1 -0
- package/dist/prod/CartProvider.js +485 -0
- package/dist/prod/CartProvider.js.map +1 -0
- package/dist/prod/MediaFile.cjs.map +1 -1
- package/dist/prod/MediaFile.js.map +1 -1
- package/dist/prod/Metafield.cjs +2 -2
- package/dist/prod/Metafield.cjs.map +1 -1
- package/dist/prod/Metafield.js.map +1 -1
- package/dist/prod/ModelViewer.cjs +4 -4
- package/dist/prod/ModelViewer.cjs.map +1 -1
- package/dist/prod/Money.cjs.map +1 -1
- package/dist/prod/Money.js.map +1 -1
- package/dist/prod/ProductPrice.cjs.map +1 -1
- package/dist/prod/ProductPrice.js.map +1 -1
- package/dist/prod/ProductProvider.cjs +14 -14
- package/dist/prod/ProductProvider.cjs.map +1 -1
- package/dist/prod/ShopPayButton.cjs.map +1 -1
- package/dist/prod/ShopPayButton.js.map +1 -1
- package/dist/prod/ShopifyProvider.cjs +4 -4
- package/dist/prod/ShopifyProvider.cjs.map +1 -1
- package/dist/prod/Video.cjs +2 -2
- package/dist/prod/_virtual/index.cjs +5 -0
- package/dist/prod/_virtual/index.cjs.map +1 -0
- package/dist/prod/_virtual/index.js +5 -0
- package/dist/prod/_virtual/index.js.map +1 -0
- package/dist/prod/_virtual/use-sync-external-store-shim.development.cjs +5 -0
- package/dist/prod/_virtual/use-sync-external-store-shim.development.cjs.map +1 -0
- package/dist/prod/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/prod/_virtual/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/prod/_virtual/use-sync-external-store-shim.production.min.cjs +5 -0
- package/dist/prod/_virtual/use-sync-external-store-shim.production.min.cjs.map +1 -0
- package/dist/prod/_virtual/use-sync-external-store-shim.production.min.js +5 -0
- package/dist/prod/_virtual/use-sync-external-store-shim.production.min.js.map +1 -0
- package/dist/prod/_virtual/with-selector.cjs +5 -0
- package/dist/prod/_virtual/with-selector.cjs.map +1 -0
- package/dist/prod/_virtual/with-selector.development.cjs +5 -0
- package/dist/prod/_virtual/with-selector.development.cjs.map +1 -0
- package/dist/prod/_virtual/with-selector.development.js +5 -0
- package/dist/prod/_virtual/with-selector.development.js.map +1 -0
- package/dist/prod/_virtual/with-selector.js +5 -0
- package/dist/prod/_virtual/with-selector.js.map +1 -0
- package/dist/prod/_virtual/with-selector.production.min.cjs +5 -0
- package/dist/prod/_virtual/with-selector.production.min.cjs.map +1 -0
- package/dist/prod/_virtual/with-selector.production.min.js +5 -0
- package/dist/prod/_virtual/with-selector.production.min.js.map +1 -0
- package/dist/prod/cart-constants.cjs +17 -0
- package/dist/prod/cart-constants.cjs.map +1 -0
- package/dist/prod/cart-constants.js +17 -0
- package/dist/prod/cart-constants.js.map +1 -0
- package/dist/prod/cart-hooks.cjs +48 -0
- package/dist/prod/cart-hooks.cjs.map +1 -0
- package/dist/prod/cart-hooks.js +48 -0
- package/dist/prod/cart-hooks.js.map +1 -0
- package/dist/prod/cart-queries.cjs +114 -0
- package/dist/prod/cart-queries.cjs.map +1 -0
- package/dist/prod/cart-queries.js +114 -0
- package/dist/prod/cart-queries.js.map +1 -0
- package/dist/prod/flatten-connection.cjs +7 -0
- package/dist/prod/flatten-connection.cjs.map +1 -1
- package/dist/prod/flatten-connection.js +7 -0
- package/dist/prod/flatten-connection.js.map +1 -1
- package/dist/prod/index.cjs +3 -0
- package/dist/prod/index.cjs.map +1 -1
- package/dist/prod/index.js +3 -0
- package/dist/prod/index.js.map +1 -1
- package/dist/prod/load-script.cjs +3 -3
- package/dist/prod/load-script.cjs.map +1 -1
- package/dist/prod/node_modules/@xstate/fsm/es/index.cjs +158 -0
- package/dist/prod/node_modules/@xstate/fsm/es/index.cjs.map +1 -0
- package/dist/prod/node_modules/@xstate/fsm/es/index.js +159 -0
- package/dist/prod/node_modules/@xstate/fsm/es/index.js.map +1 -0
- package/dist/prod/node_modules/@xstate/react/es/fsm.cjs +94 -0
- package/dist/prod/node_modules/@xstate/react/es/fsm.cjs.map +1 -0
- package/dist/prod/node_modules/@xstate/react/es/fsm.js +94 -0
- package/dist/prod/node_modules/@xstate/react/es/fsm.js.map +1 -0
- package/dist/prod/node_modules/@xstate/react/es/useConstant.cjs +30 -0
- package/dist/prod/node_modules/@xstate/react/es/useConstant.cjs.map +1 -0
- package/dist/prod/node_modules/@xstate/react/es/useConstant.js +12 -0
- package/dist/prod/node_modules/@xstate/react/es/useConstant.js.map +1 -0
- package/dist/prod/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.cjs +5 -0
- package/dist/prod/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.cjs.map +1 -0
- package/dist/prod/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js +6 -0
- package/dist/prod/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.cjs +107 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.cjs.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +105 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.cjs +74 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.cjs.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +72 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +138 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +136 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.cjs +60 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.cjs.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +58 -0
- package/dist/prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/shim/index.cjs +21 -0
- package/dist/prod/node_modules/use-sync-external-store/shim/index.cjs.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/shim/index.js +21 -0
- package/dist/prod/node_modules/use-sync-external-store/shim/index.js.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/shim/with-selector.cjs +12 -0
- package/dist/prod/node_modules/use-sync-external-store/shim/with-selector.cjs.map +1 -0
- package/dist/prod/node_modules/use-sync-external-store/shim/with-selector.js +11 -0
- package/dist/prod/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
- package/dist/prod/node_modules/worktop/cookie/index.cjs +27 -0
- package/dist/prod/node_modules/worktop/cookie/index.cjs.map +1 -0
- package/dist/prod/node_modules/worktop/cookie/index.js +27 -0
- package/dist/prod/node_modules/worktop/cookie/index.js.map +1 -0
- package/dist/prod/storefront-api-constants.cjs +1 -1
- package/dist/prod/storefront-api-constants.cjs.map +1 -1
- package/dist/prod/storefront-api-constants.js +1 -1
- package/dist/prod/storefront-api-constants.js.map +1 -1
- package/dist/prod/useCartAPIStateMachine.cjs +326 -0
- package/dist/prod/useCartAPIStateMachine.cjs.map +1 -0
- package/dist/prod/useCartAPIStateMachine.js +326 -0
- package/dist/prod/useCartAPIStateMachine.js.map +1 -0
- package/dist/prod/useCartActions.cjs +123 -0
- package/dist/prod/useCartActions.cjs.map +1 -0
- package/dist/prod/useCartActions.js +123 -0
- package/dist/prod/useCartActions.js.map +1 -0
- package/dist/prod/useMoney.cjs +5 -5
- package/dist/prod/useMoney.cjs.map +1 -1
- package/dist/types/CartProvider.d.ts +61 -0
- package/dist/types/MediaFile.d.ts +0 -1
- package/dist/types/Money.d.ts +1 -1
- package/dist/types/ProductPrice.d.ts +0 -1
- package/dist/types/cart-constants.d.ts +8 -0
- package/dist/types/cart-hooks.d.ts +24 -0
- package/dist/types/cart-queries.d.ts +10 -0
- package/dist/types/cart-types.d.ts +289 -0
- package/dist/types/flatten-connection.d.ts +3 -1
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/storefront-api-constants.d.ts +1 -1
- package/dist/types/storefront-api-types.d.ts +278 -73
- package/dist/types/useCartAPIStateMachine.d.ts +25 -0
- package/dist/types/useCartActions.d.ts +64 -0
- package/dist/umd/hydrogen-react.dev.js +1815 -109
- package/dist/umd/hydrogen-react.dev.js.map +1 -1
- package/dist/umd/hydrogen-react.prod.js +239 -2
- package/dist/umd/hydrogen-react.prod.js.map +1 -1
- package/package.json +24 -12
- package/storefront.schema.json +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
function t(t2, n2) {
|
|
16
|
+
var e2 = "function" == typeof Symbol && t2[Symbol.iterator];
|
|
17
|
+
if (!e2)
|
|
18
|
+
return t2;
|
|
19
|
+
var r2, i2, o2 = e2.call(t2), a2 = [];
|
|
20
|
+
try {
|
|
21
|
+
for (; (void 0 === n2 || n2-- > 0) && !(r2 = o2.next()).done; )
|
|
22
|
+
a2.push(r2.value);
|
|
23
|
+
} catch (t3) {
|
|
24
|
+
i2 = { error: t3 };
|
|
25
|
+
} finally {
|
|
26
|
+
try {
|
|
27
|
+
r2 && !r2.done && (e2 = o2.return) && e2.call(o2);
|
|
28
|
+
} finally {
|
|
29
|
+
if (i2)
|
|
30
|
+
throw i2.error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return a2;
|
|
34
|
+
}
|
|
35
|
+
var n;
|
|
36
|
+
!function(t2) {
|
|
37
|
+
t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped";
|
|
38
|
+
}(n || (n = {}));
|
|
39
|
+
var e = { type: "xstate.init" };
|
|
40
|
+
function r(t2) {
|
|
41
|
+
return void 0 === t2 ? [] : [].concat(t2);
|
|
42
|
+
}
|
|
43
|
+
function i(t2) {
|
|
44
|
+
return { type: "xstate.assign", assignment: t2 };
|
|
45
|
+
}
|
|
46
|
+
function o(t2, n2) {
|
|
47
|
+
return "string" == typeof (t2 = "string" == typeof t2 && n2 && n2[t2] ? n2[t2] : t2) ? { type: t2 } : "function" == typeof t2 ? { type: t2.name, exec: t2 } : t2;
|
|
48
|
+
}
|
|
49
|
+
function a(t2) {
|
|
50
|
+
return function(n2) {
|
|
51
|
+
return t2 === n2;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function u(t2) {
|
|
55
|
+
return "string" == typeof t2 ? { type: t2 } : t2;
|
|
56
|
+
}
|
|
57
|
+
function c(t2, n2) {
|
|
58
|
+
return { value: t2, context: n2, actions: [], changed: false, matches: a(t2) };
|
|
59
|
+
}
|
|
60
|
+
function f(t2, n2, e2) {
|
|
61
|
+
var r2 = n2, i2 = false;
|
|
62
|
+
return [t2.filter(function(t3) {
|
|
63
|
+
if ("xstate.assign" === t3.type) {
|
|
64
|
+
i2 = true;
|
|
65
|
+
var n3 = Object.assign({}, r2);
|
|
66
|
+
return "function" == typeof t3.assignment ? n3 = t3.assignment(r2, e2) : Object.keys(t3.assignment).forEach(function(i3) {
|
|
67
|
+
n3[i3] = "function" == typeof t3.assignment[i3] ? t3.assignment[i3](r2, e2) : t3.assignment[i3];
|
|
68
|
+
}), r2 = n3, false;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}), r2, i2];
|
|
72
|
+
}
|
|
73
|
+
function s(n2, i2) {
|
|
74
|
+
void 0 === i2 && (i2 = {});
|
|
75
|
+
var s2 = t(f(r(n2.states[n2.initial].entry).map(function(t2) {
|
|
76
|
+
return o(t2, i2.actions);
|
|
77
|
+
}), n2.context, e), 2), l2 = s2[0], v2 = s2[1], y = { config: n2, _options: i2, initialState: { value: n2.initial, actions: l2, context: v2, matches: a(n2.initial) }, transition: function(e2, i3) {
|
|
78
|
+
var s3, l3, v3 = "string" == typeof e2 ? { value: e2, context: n2.context } : e2, p = v3.value, g = v3.context, d = u(i3), x = n2.states[p];
|
|
79
|
+
if (x.on) {
|
|
80
|
+
var m = r(x.on[d.type]);
|
|
81
|
+
try {
|
|
82
|
+
for (var h = function(t2) {
|
|
83
|
+
var n3 = "function" == typeof Symbol && Symbol.iterator, e3 = n3 && t2[n3], r2 = 0;
|
|
84
|
+
if (e3)
|
|
85
|
+
return e3.call(t2);
|
|
86
|
+
if (t2 && "number" == typeof t2.length)
|
|
87
|
+
return { next: function() {
|
|
88
|
+
return t2 && r2 >= t2.length && (t2 = void 0), { value: t2 && t2[r2++], done: !t2 };
|
|
89
|
+
} };
|
|
90
|
+
throw new TypeError(n3 ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
91
|
+
}(m), b = h.next(); !b.done; b = h.next()) {
|
|
92
|
+
var S = b.value;
|
|
93
|
+
if (void 0 === S)
|
|
94
|
+
return c(p, g);
|
|
95
|
+
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() {
|
|
96
|
+
return true;
|
|
97
|
+
} : N, _ = void 0 === j, k = null != j ? j : p, T = n2.states[k];
|
|
98
|
+
if (O(g, d)) {
|
|
99
|
+
var q = t(f((_ ? r(R) : [].concat(x.exit, R, T.entry).filter(function(t2) {
|
|
100
|
+
return t2;
|
|
101
|
+
})).map(function(t2) {
|
|
102
|
+
return o(t2, y._options.actions);
|
|
103
|
+
}), g, d), 3), z = q[0], A = q[1], B = q[2], C = null != j ? j : p;
|
|
104
|
+
return { value: C, context: A, actions: z, changed: j !== p || z.length > 0 || B, matches: a(C) };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
} catch (t2) {
|
|
108
|
+
s3 = { error: t2 };
|
|
109
|
+
} finally {
|
|
110
|
+
try {
|
|
111
|
+
b && !b.done && (l3 = h.return) && l3.call(h);
|
|
112
|
+
} finally {
|
|
113
|
+
if (s3)
|
|
114
|
+
throw s3.error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return c(p, g);
|
|
119
|
+
} };
|
|
120
|
+
return y;
|
|
121
|
+
}
|
|
122
|
+
var l = function(t2, n2) {
|
|
123
|
+
return t2.actions.forEach(function(e2) {
|
|
124
|
+
var r2 = e2.exec;
|
|
125
|
+
return r2 && r2(t2.context, n2);
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
function v(t2) {
|
|
129
|
+
var r2 = t2.initialState, i2 = n.NotStarted, o2 = /* @__PURE__ */ new Set(), c2 = { _machine: t2, send: function(e2) {
|
|
130
|
+
i2 === n.Running && (r2 = t2.transition(r2, e2), l(r2, u(e2)), o2.forEach(function(t3) {
|
|
131
|
+
return t3(r2);
|
|
132
|
+
}));
|
|
133
|
+
}, subscribe: function(t3) {
|
|
134
|
+
return o2.add(t3), t3(r2), { unsubscribe: function() {
|
|
135
|
+
return o2.delete(t3);
|
|
136
|
+
} };
|
|
137
|
+
}, start: function(o3) {
|
|
138
|
+
if (o3) {
|
|
139
|
+
var u2 = "object" == typeof o3 ? o3 : { context: t2.config.context, value: o3 };
|
|
140
|
+
r2 = { value: u2.value, actions: [], context: u2.context, matches: a(u2.value) };
|
|
141
|
+
} else
|
|
142
|
+
r2 = t2.initialState;
|
|
143
|
+
return i2 = n.Running, l(r2, e), c2;
|
|
144
|
+
}, stop: function() {
|
|
145
|
+
return i2 = n.Stopped, o2.clear(), c2;
|
|
146
|
+
}, get state() {
|
|
147
|
+
return r2;
|
|
148
|
+
}, get status() {
|
|
149
|
+
return i2;
|
|
150
|
+
} };
|
|
151
|
+
return c2;
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
n as InterpreterStatus,
|
|
155
|
+
i as assign,
|
|
156
|
+
s as createMachine,
|
|
157
|
+
v as interpret
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","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,UAAC;AAAQ,UAAGD;AAAE,cAAMA,GAAE;AAAA,IAAK;AAAA,EAAC;AAAC,SAAOE;AAAC;AAAI,IAAC;AAAE,CAAC,SAASN,IAAE;AAAC,EAAAA,GAAEA,GAAE,aAAW,KAAG,cAAaA,GAAEA,GAAE,UAAQ,KAAG,WAAUA,GAAEA,GAAE,UAAQ,KAAG;AAAS,EAAE,MAAI,IAAE,CAAE,EAAC;AAAE,IAAI,IAAE,EAAC,MAAK,cAAa;AAAE,SAAS,EAAEA,IAAE;AAAC,SAAO,WAASA,KAAE,CAAE,IAAC,GAAG,OAAOA,EAAC;AAAC;AAAC,SAAS,EAAEA,IAAE;AAAC,SAAM,EAAC,MAAK,iBAAgB,YAAWA,GAAC;AAAC;AAAC,SAAS,EAAEA,IAAEC,IAAE;AAAC,SAAM,YAAU,QAAOD,KAAE,YAAU,O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cAAaI,KAAE,EAAE,YAAWC,KAAE,oBAAI,OAAIK,KAAE,EAAC,UAASV,IAAE,MAAK,SAASE,IAAE;AAAC,IAAAE,OAAI,EAAE,YAAUD,KAAEH,GAAE,WAAWG,IAAED,EAAC,GAAE,EAAEC,IAAE,EAAED,EAAC,CAAC,GAAEG,GAAE,QAAS,SAASL,IAAE;AAAC,aAAOA,GAAEG,EAAC;AAAA,IAAC,CAAC;AAAA,EAAG,GAAE,WAAU,SAASH,IAAE;AAAC,WAAOK,GAAE,IAAIL,EAAC,GAAEA,GAAEG,EAAC,GAAE,EAAC,aAAY,WAAU;AAAC,aAAOE,GAAE,OAAOL,EAAC;AAAA,IAAC,EAAC;AAAA,EAAC,GAAE,OAAM,SAASK,IAAE;AAAC,QAAGA,IAAE;AAAC,UAAIM,KAAE,YAAU,OAAON,KAAEA,KAAE,EAAC,SAAQL,GAAE,OAAO,SAAQ,OAAMK,GAAC;AAAE,MAAAF,KAAE,EAAC,OAAMQ,GAAE,OAAM,SAAQ,CAAE,GAAC,SAAQA,GAAE,SAAQ,SAAQ,EAAEA,GAAE,KAAK,EAAC;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;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const index = require("../../fsm/es/index.cjs");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const useIsomorphicLayoutEffect_browser_esm = require("../../../use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.cjs");
|
|
6
|
+
require("../../../use-sync-external-store/shim/with-selector.cjs");
|
|
7
|
+
const useConstant = require("./useConstant.cjs");
|
|
8
|
+
const withSelector = require("../../../../_virtual/with-selector.cjs");
|
|
9
|
+
var __read = globalThis && globalThis.__read || function(o, n) {
|
|
10
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
11
|
+
if (!m)
|
|
12
|
+
return o;
|
|
13
|
+
var i = m.call(o), r, ar = [], e;
|
|
14
|
+
try {
|
|
15
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
16
|
+
ar.push(r.value);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
e = { error };
|
|
19
|
+
} finally {
|
|
20
|
+
try {
|
|
21
|
+
if (r && !r.done && (m = i["return"]))
|
|
22
|
+
m.call(i);
|
|
23
|
+
} finally {
|
|
24
|
+
if (e)
|
|
25
|
+
throw e.error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
function identity(a) {
|
|
31
|
+
return a;
|
|
32
|
+
}
|
|
33
|
+
var getServiceState = function(service) {
|
|
34
|
+
var currentValue;
|
|
35
|
+
service.subscribe(function(state) {
|
|
36
|
+
currentValue = state;
|
|
37
|
+
}).unsubscribe();
|
|
38
|
+
return currentValue;
|
|
39
|
+
};
|
|
40
|
+
function useMachine(stateMachine, options) {
|
|
41
|
+
var persistedStateRef = require$$0.useRef();
|
|
42
|
+
if (process.env.NODE_ENV !== "production") {
|
|
43
|
+
var _a = __read(require$$0.useState(stateMachine), 1), initialMachine = _a[0];
|
|
44
|
+
if (stateMachine !== initialMachine) {
|
|
45
|
+
console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
var _b = __read(useConstant(function() {
|
|
49
|
+
var queue2 = [];
|
|
50
|
+
var service2 = index.interpret(index.createMachine(stateMachine.config, options ? options : stateMachine._options));
|
|
51
|
+
var send = service2.send;
|
|
52
|
+
service2.send = function(event) {
|
|
53
|
+
if (service2.status === index.InterpreterStatus.NotStarted) {
|
|
54
|
+
queue2.push(event);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
send(event);
|
|
58
|
+
persistedStateRef.current = service2.state;
|
|
59
|
+
};
|
|
60
|
+
return [service2, queue2];
|
|
61
|
+
}), 2), service = _b[0], queue = _b[1];
|
|
62
|
+
useIsomorphicLayoutEffect_browser_esm(function() {
|
|
63
|
+
if (options) {
|
|
64
|
+
service._machine._options = options;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
var useServiceResult = useService(service);
|
|
68
|
+
require$$0.useEffect(function() {
|
|
69
|
+
service.start(persistedStateRef.current);
|
|
70
|
+
queue.forEach(service.send);
|
|
71
|
+
persistedStateRef.current = service.state;
|
|
72
|
+
return function() {
|
|
73
|
+
service.stop();
|
|
74
|
+
};
|
|
75
|
+
}, []);
|
|
76
|
+
return useServiceResult;
|
|
77
|
+
}
|
|
78
|
+
var isEqual = function(_prevState, nextState) {
|
|
79
|
+
return nextState.changed === false;
|
|
80
|
+
};
|
|
81
|
+
function useService(service) {
|
|
82
|
+
var getSnapshot = require$$0.useCallback(function() {
|
|
83
|
+
return getServiceState(service);
|
|
84
|
+
}, [service]);
|
|
85
|
+
var subscribe = require$$0.useCallback(function(handleStoreChange) {
|
|
86
|
+
var unsubscribe = service.subscribe(handleStoreChange).unsubscribe;
|
|
87
|
+
return unsubscribe;
|
|
88
|
+
}, [service]);
|
|
89
|
+
var storeSnapshot = withSelector.withSelector.exports.useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, identity, isEqual);
|
|
90
|
+
return [storeSnapshot, service.send, service];
|
|
91
|
+
}
|
|
92
|
+
exports.useMachine = useMachine;
|
|
93
|
+
exports.useService = useService;
|
|
94
|
+
//# sourceMappingURL=fsm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm.cjs","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","useRef","useState","queue","service","interpret","createMachine","InterpreterStatus","useIsomorphicLayoutEffect","useEffect","useCallback","useSyncExternalStoreWithSelector"],"mappings":";;;;;;;;AAAA,IAAI,SAAUA,cAAQA,WAAK,UAAW,SAAU,GAAG,GAAG;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,YAAQ,MAAM,UAAU,MAAM,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,oBAAoBC,WAAAA;AACxB,MAAI,QAAQ,IAAI,aAAa,c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B,EAAE;AACvD,WAAO;AAAA,EACf,GAAO,CAAC,OAAO,CAAC;AACZ,MAAI,gBAAgBC,aAAAA,aAAAA,QAAAA,iCAAiC,WAAW,aAAa,aAAa,UAAU,OAAO;AAC3G,SAAO,CAAC,eAAe,QAAQ,MAAM,OAAO;AAChD;;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { interpret as v, createMachine as s, InterpreterStatus as n } from "../../fsm/es/index.js";
|
|
2
|
+
import { useRef, useState, useEffect, useCallback } from "react";
|
|
3
|
+
import index from "../../../use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js";
|
|
4
|
+
import "../../../use-sync-external-store/shim/with-selector.js";
|
|
5
|
+
import useConstant from "./useConstant.js";
|
|
6
|
+
import { w as withSelector } from "../../../../_virtual/with-selector.js";
|
|
7
|
+
var __read = globalThis && globalThis.__read || function(o, n2) {
|
|
8
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
9
|
+
if (!m)
|
|
10
|
+
return o;
|
|
11
|
+
var i = m.call(o), r, ar = [], e;
|
|
12
|
+
try {
|
|
13
|
+
while ((n2 === void 0 || n2-- > 0) && !(r = i.next()).done)
|
|
14
|
+
ar.push(r.value);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
e = { error };
|
|
17
|
+
} finally {
|
|
18
|
+
try {
|
|
19
|
+
if (r && !r.done && (m = i["return"]))
|
|
20
|
+
m.call(i);
|
|
21
|
+
} finally {
|
|
22
|
+
if (e)
|
|
23
|
+
throw e.error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
function identity(a) {
|
|
29
|
+
return a;
|
|
30
|
+
}
|
|
31
|
+
var getServiceState = function(service) {
|
|
32
|
+
var currentValue;
|
|
33
|
+
service.subscribe(function(state) {
|
|
34
|
+
currentValue = state;
|
|
35
|
+
}).unsubscribe();
|
|
36
|
+
return currentValue;
|
|
37
|
+
};
|
|
38
|
+
function useMachine(stateMachine, options) {
|
|
39
|
+
var persistedStateRef = useRef();
|
|
40
|
+
if (process.env.NODE_ENV !== "production") {
|
|
41
|
+
var _a = __read(useState(stateMachine), 1), initialMachine = _a[0];
|
|
42
|
+
if (stateMachine !== initialMachine) {
|
|
43
|
+
console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
var _b = __read(useConstant(function() {
|
|
47
|
+
var queue2 = [];
|
|
48
|
+
var service2 = v(s(stateMachine.config, options ? options : stateMachine._options));
|
|
49
|
+
var send = service2.send;
|
|
50
|
+
service2.send = function(event) {
|
|
51
|
+
if (service2.status === n.NotStarted) {
|
|
52
|
+
queue2.push(event);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
send(event);
|
|
56
|
+
persistedStateRef.current = service2.state;
|
|
57
|
+
};
|
|
58
|
+
return [service2, queue2];
|
|
59
|
+
}), 2), service = _b[0], queue = _b[1];
|
|
60
|
+
index(function() {
|
|
61
|
+
if (options) {
|
|
62
|
+
service._machine._options = options;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
var useServiceResult = useService(service);
|
|
66
|
+
useEffect(function() {
|
|
67
|
+
service.start(persistedStateRef.current);
|
|
68
|
+
queue.forEach(service.send);
|
|
69
|
+
persistedStateRef.current = service.state;
|
|
70
|
+
return function() {
|
|
71
|
+
service.stop();
|
|
72
|
+
};
|
|
73
|
+
}, []);
|
|
74
|
+
return useServiceResult;
|
|
75
|
+
}
|
|
76
|
+
var isEqual = function(_prevState, nextState) {
|
|
77
|
+
return nextState.changed === false;
|
|
78
|
+
};
|
|
79
|
+
function useService(service) {
|
|
80
|
+
var getSnapshot = useCallback(function() {
|
|
81
|
+
return getServiceState(service);
|
|
82
|
+
}, [service]);
|
|
83
|
+
var subscribe = useCallback(function(handleStoreChange) {
|
|
84
|
+
var unsubscribe = service.subscribe(handleStoreChange).unsubscribe;
|
|
85
|
+
return unsubscribe;
|
|
86
|
+
}, [service]);
|
|
87
|
+
var storeSnapshot = withSelector.exports.useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, identity, isEqual);
|
|
88
|
+
return [storeSnapshot, service.send, service];
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
useMachine,
|
|
92
|
+
useService
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=fsm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsm.js","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;A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AO,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;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const require$$0 = require("react");
|
|
3
|
+
function _interopNamespace(e) {
|
|
4
|
+
if (e && e.__esModule)
|
|
5
|
+
return e;
|
|
6
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
+
if (e) {
|
|
8
|
+
for (const k in e) {
|
|
9
|
+
if (k !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: () => e[k]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
const require$$0__namespace = /* @__PURE__ */ _interopNamespace(require$$0);
|
|
22
|
+
function useConstant(fn) {
|
|
23
|
+
var ref = require$$0__namespace.useRef();
|
|
24
|
+
if (!ref.current) {
|
|
25
|
+
ref.current = { v: fn() };
|
|
26
|
+
}
|
|
27
|
+
return ref.current.v;
|
|
28
|
+
}
|
|
29
|
+
module.exports = useConstant;
|
|
30
|
+
//# sourceMappingURL=useConstant.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConstant.cjs","sources":["../../../../../../../../node_modules/@xstate/react/es/useConstant.js"],"sourcesContent":["import * as React from 'react';\nexport default function useConstant(fn) {\n var ref = React.useRef();\n if (!ref.current) {\n ref.current = { v: fn() };\n }\n return ref.current.v;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACe,SAAS,YAAY,IAAI;AACpC,MAAI,MAAMA,sBAAM;AAChB,MAAI,CAAC,IAAI,SAAS;AACd,QAAI,UAAU,EAAE,GAAG,GAAI,EAAA;AAAA,EAC1B;AACD,SAAO,IAAI,QAAQ;AACvB;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as require$$0 from "react";
|
|
2
|
+
function useConstant(fn) {
|
|
3
|
+
var ref = require$$0.useRef();
|
|
4
|
+
if (!ref.current) {
|
|
5
|
+
ref.current = { v: fn() };
|
|
6
|
+
}
|
|
7
|
+
return ref.current.v;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
useConstant as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useConstant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConstant.js","sources":["../../../../../../../../node_modules/@xstate/react/es/useConstant.js"],"sourcesContent":["import * as React from 'react';\nexport default function useConstant(fn) {\n var ref = React.useRef();\n if (!ref.current) {\n ref.current = { v: fn() };\n }\n return ref.current.v;\n}\n"],"names":["React"],"mappings":";AACe,SAAS,YAAY,IAAI;AACpC,MAAI,MAAMA,WAAM;AAChB,MAAI,CAAC,IAAI,SAAS;AACd,QAAI,UAAU,EAAE,GAAG,GAAI,EAAA;AAAA,EAC1B;AACD,SAAO,IAAI,QAAQ;AACvB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-isomorphic-layout-effect.browser.esm.cjs","sources":["../../../../../../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js"],"sourcesContent":["import { useLayoutEffect } from 'react';\n\nvar index = useLayoutEffect ;\n\nexport default index;\n"],"names":["useLayoutEffect"],"mappings":";;AAEG,IAAC,QAASA,WAAe;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-isomorphic-layout-effect.browser.esm.js","sources":["../../../../../../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js"],"sourcesContent":["import { useLayoutEffect } from 'react';\n\nvar index = useLayoutEffect ;\n\nexport default index;\n"],"names":[],"mappings":";AAEG,IAAC,QAAS;"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const withSelector_development = require("../../../../_virtual/with-selector.development.cjs");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const index = require("../../shim/index.cjs");
|
|
6
|
+
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
7
|
+
const require$$0__default = /* @__PURE__ */ _interopDefaultLegacy(require$$0);
|
|
8
|
+
/**
|
|
9
|
+
* @license React
|
|
10
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
var hasRequiredWithSelector_development;
|
|
18
|
+
function requireWithSelector_development() {
|
|
19
|
+
if (hasRequiredWithSelector_development)
|
|
20
|
+
return withSelector_development.__exports;
|
|
21
|
+
hasRequiredWithSelector_development = 1;
|
|
22
|
+
if (process.env.NODE_ENV !== "production") {
|
|
23
|
+
(function() {
|
|
24
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
25
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
26
|
+
}
|
|
27
|
+
var React = require$$0__default.default;
|
|
28
|
+
var shim = index.__require();
|
|
29
|
+
function is(x, y) {
|
|
30
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
31
|
+
}
|
|
32
|
+
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
33
|
+
var useSyncExternalStore = shim.useSyncExternalStore;
|
|
34
|
+
var useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
|
|
35
|
+
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
36
|
+
var instRef = useRef(null);
|
|
37
|
+
var inst;
|
|
38
|
+
if (instRef.current === null) {
|
|
39
|
+
inst = {
|
|
40
|
+
hasValue: false,
|
|
41
|
+
value: null
|
|
42
|
+
};
|
|
43
|
+
instRef.current = inst;
|
|
44
|
+
} else {
|
|
45
|
+
inst = instRef.current;
|
|
46
|
+
}
|
|
47
|
+
var _useMemo = useMemo(function() {
|
|
48
|
+
var hasMemo = false;
|
|
49
|
+
var memoizedSnapshot;
|
|
50
|
+
var memoizedSelection;
|
|
51
|
+
var memoizedSelector = function(nextSnapshot) {
|
|
52
|
+
if (!hasMemo) {
|
|
53
|
+
hasMemo = true;
|
|
54
|
+
memoizedSnapshot = nextSnapshot;
|
|
55
|
+
var _nextSelection = selector(nextSnapshot);
|
|
56
|
+
if (isEqual !== void 0) {
|
|
57
|
+
if (inst.hasValue) {
|
|
58
|
+
var currentSelection = inst.value;
|
|
59
|
+
if (isEqual(currentSelection, _nextSelection)) {
|
|
60
|
+
memoizedSelection = currentSelection;
|
|
61
|
+
return currentSelection;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
memoizedSelection = _nextSelection;
|
|
66
|
+
return _nextSelection;
|
|
67
|
+
}
|
|
68
|
+
var prevSnapshot = memoizedSnapshot;
|
|
69
|
+
var prevSelection = memoizedSelection;
|
|
70
|
+
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
71
|
+
return prevSelection;
|
|
72
|
+
}
|
|
73
|
+
var nextSelection = selector(nextSnapshot);
|
|
74
|
+
if (isEqual !== void 0 && isEqual(prevSelection, nextSelection)) {
|
|
75
|
+
return prevSelection;
|
|
76
|
+
}
|
|
77
|
+
memoizedSnapshot = nextSnapshot;
|
|
78
|
+
memoizedSelection = nextSelection;
|
|
79
|
+
return nextSelection;
|
|
80
|
+
};
|
|
81
|
+
var maybeGetServerSnapshot = getServerSnapshot === void 0 ? null : getServerSnapshot;
|
|
82
|
+
var getSnapshotWithSelector = function() {
|
|
83
|
+
return memoizedSelector(getSnapshot());
|
|
84
|
+
};
|
|
85
|
+
var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? void 0 : function() {
|
|
86
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
87
|
+
};
|
|
88
|
+
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
89
|
+
}, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection = _useMemo[0], getServerSelection = _useMemo[1];
|
|
90
|
+
var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
91
|
+
useEffect(function() {
|
|
92
|
+
inst.hasValue = true;
|
|
93
|
+
inst.value = value;
|
|
94
|
+
}, [value]);
|
|
95
|
+
useDebugValue(value);
|
|
96
|
+
return value;
|
|
97
|
+
}
|
|
98
|
+
withSelector_development.__exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
|
|
99
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
100
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
101
|
+
}
|
|
102
|
+
})();
|
|
103
|
+
}
|
|
104
|
+
return withSelector_development.__exports;
|
|
105
|
+
}
|
|
106
|
+
exports.__require = requireWithSelector_development;
|
|
107
|
+
//# sourceMappingURL=with-selector.development.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-selector.development.cjs","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","withSelector_development"],"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,oBAAAA;AACtB,UAAI,OAAOC,MAAAA;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,S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