@shopify/hydrogen-react 2023.1.8 → 2023.4.1
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/dist/browser-dev/CartProvider.mjs.map +1 -1
- package/dist/browser-dev/Image.mjs +336 -90
- package/dist/browser-dev/Image.mjs.map +1 -1
- package/dist/browser-dev/MediaFile.mjs.map +1 -1
- package/dist/browser-dev/ModelViewer.mjs.map +1 -1
- package/dist/browser-dev/Money.mjs.map +1 -1
- package/dist/browser-dev/Video.mjs +2 -2
- package/dist/browser-dev/Video.mjs.map +1 -1
- package/dist/browser-dev/analytics-utils.mjs.map +1 -1
- package/dist/browser-dev/index.mjs +4 -3
- package/dist/browser-dev/node_modules/@xstate/react/es/useConstant.mjs +2 -2
- package/dist/browser-dev/node_modules/@xstate/react/es/useConstant.mjs.map +1 -1
- package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +2 -2
- package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs +2 -2
- package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
- package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +2 -2
- package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs +2 -2
- package/dist/browser-dev/storefront-api-constants.mjs +1 -1
- package/dist/browser-dev/storefront-api-constants.mjs.map +1 -1
- package/dist/browser-dev/storefront-client.mjs.map +1 -1
- package/dist/browser-dev/useCartAPIStateMachine.mjs.map +1 -1
- package/dist/browser-dev/useCartActions.mjs.map +1 -1
- package/dist/browser-prod/CartProvider.mjs.map +1 -1
- package/dist/browser-prod/Image.mjs +302 -82
- package/dist/browser-prod/Image.mjs.map +1 -1
- package/dist/browser-prod/MediaFile.mjs.map +1 -1
- package/dist/browser-prod/ModelViewer.mjs.map +1 -1
- package/dist/browser-prod/Money.mjs.map +1 -1
- package/dist/browser-prod/Video.mjs +2 -2
- package/dist/browser-prod/Video.mjs.map +1 -1
- package/dist/browser-prod/analytics-utils.mjs.map +1 -1
- package/dist/browser-prod/index.mjs +4 -3
- package/dist/browser-prod/node_modules/@xstate/react/es/useConstant.mjs +2 -2
- package/dist/browser-prod/node_modules/@xstate/react/es/useConstant.mjs.map +1 -1
- package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +2 -2
- package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs +2 -2
- package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
- package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +2 -2
- package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs +2 -2
- package/dist/browser-prod/storefront-api-constants.mjs +1 -1
- package/dist/browser-prod/storefront-api-constants.mjs.map +1 -1
- package/dist/browser-prod/storefront-client.mjs.map +1 -1
- package/dist/browser-prod/useCartAPIStateMachine.mjs.map +1 -1
- package/dist/browser-prod/useCartActions.mjs.map +1 -1
- package/dist/node-dev/AddToCartButton.js +4 -4
- package/dist/node-dev/AddToCartButton.js.map +1 -1
- package/dist/node-dev/BaseButton.js +2 -2
- package/dist/node-dev/BaseButton.js.map +1 -1
- package/dist/node-dev/BuyNowButton.js +4 -4
- package/dist/node-dev/BuyNowButton.js.map +1 -1
- package/dist/node-dev/CartCheckoutButton.js +3 -3
- package/dist/node-dev/CartCheckoutButton.js.map +1 -1
- package/dist/node-dev/CartLineProvider.js +3 -3
- package/dist/node-dev/CartLineProvider.js.map +1 -1
- package/dist/node-dev/CartLineQuantityAdjustButton.js +2 -2
- package/dist/node-dev/CartLineQuantityAdjustButton.js.map +1 -1
- package/dist/node-dev/CartProvider.js +20 -20
- package/dist/node-dev/CartProvider.js.map +1 -1
- package/dist/node-dev/CartProvider.mjs.map +1 -1
- package/dist/node-dev/Image.js +350 -87
- package/dist/node-dev/Image.js.map +1 -1
- package/dist/node-dev/Image.mjs +336 -90
- package/dist/node-dev/Image.mjs.map +1 -1
- package/dist/node-dev/MediaFile.js.map +1 -1
- package/dist/node-dev/MediaFile.mjs.map +1 -1
- package/dist/node-dev/ModelViewer.js +4 -4
- package/dist/node-dev/ModelViewer.js.map +1 -1
- package/dist/node-dev/ModelViewer.mjs.map +1 -1
- package/dist/node-dev/Money.js.map +1 -1
- package/dist/node-dev/Money.mjs.map +1 -1
- package/dist/node-dev/ProductProvider.js +14 -14
- package/dist/node-dev/ProductProvider.js.map +1 -1
- package/dist/node-dev/ShopifyProvider.js +4 -4
- package/dist/node-dev/ShopifyProvider.js.map +1 -1
- package/dist/node-dev/Video.js +4 -4
- package/dist/node-dev/Video.js.map +1 -1
- package/dist/node-dev/Video.mjs +2 -2
- package/dist/node-dev/Video.mjs.map +1 -1
- package/dist/node-dev/analytics-utils.js.map +1 -1
- package/dist/node-dev/analytics-utils.mjs.map +1 -1
- package/dist/node-dev/cart-hooks.js +2 -2
- package/dist/node-dev/cart-hooks.js.map +1 -1
- package/dist/node-dev/index.js +3 -2
- package/dist/node-dev/index.js.map +1 -1
- package/dist/node-dev/index.mjs +4 -3
- package/dist/node-dev/load-script.js +3 -3
- package/dist/node-dev/load-script.js.map +1 -1
- package/dist/node-dev/node_modules/@xstate/react/es/fsm.js +6 -6
- package/dist/node-dev/node_modules/@xstate/react/es/fsm.js.map +1 -1
- package/dist/node-dev/node_modules/@xstate/react/es/useConstant.js +3 -3
- package/dist/node-dev/node_modules/@xstate/react/es/useConstant.js.map +1 -1
- package/dist/node-dev/node_modules/@xstate/react/es/useConstant.mjs +2 -2
- package/dist/node-dev/node_modules/@xstate/react/es/useConstant.mjs.map +1 -1
- package/dist/node-dev/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js +2 -2
- package/dist/node-dev/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js.map +1 -1
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +3 -3
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -1
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +2 -2
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +2 -2
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -1
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs +2 -2
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +6 -6
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +2 -2
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +2 -2
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -1
- package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs +2 -2
- package/dist/node-dev/storefront-api-constants.js +1 -1
- package/dist/node-dev/storefront-api-constants.js.map +1 -1
- package/dist/node-dev/storefront-api-constants.mjs +1 -1
- package/dist/node-dev/storefront-api-constants.mjs.map +1 -1
- package/dist/node-dev/storefront-client.js.map +1 -1
- package/dist/node-dev/storefront-client.mjs.map +1 -1
- package/dist/node-dev/useCartAPIStateMachine.js +3 -3
- package/dist/node-dev/useCartAPIStateMachine.js.map +1 -1
- package/dist/node-dev/useCartAPIStateMachine.mjs.map +1 -1
- package/dist/node-dev/useCartActions.js +11 -11
- package/dist/node-dev/useCartActions.js.map +1 -1
- package/dist/node-dev/useCartActions.mjs.map +1 -1
- package/dist/node-dev/useMoney.js +5 -5
- package/dist/node-dev/useMoney.js.map +1 -1
- package/dist/node-dev/useShopifyCookies.js +2 -2
- package/dist/node-dev/useShopifyCookies.js.map +1 -1
- package/dist/node-prod/AddToCartButton.js +4 -4
- package/dist/node-prod/AddToCartButton.js.map +1 -1
- package/dist/node-prod/BaseButton.js +2 -2
- package/dist/node-prod/BaseButton.js.map +1 -1
- package/dist/node-prod/BuyNowButton.js +4 -4
- package/dist/node-prod/BuyNowButton.js.map +1 -1
- package/dist/node-prod/CartCheckoutButton.js +3 -3
- package/dist/node-prod/CartCheckoutButton.js.map +1 -1
- package/dist/node-prod/CartLineProvider.js +3 -3
- package/dist/node-prod/CartLineProvider.js.map +1 -1
- package/dist/node-prod/CartLineQuantityAdjustButton.js +2 -2
- package/dist/node-prod/CartLineQuantityAdjustButton.js.map +1 -1
- package/dist/node-prod/CartProvider.js +20 -20
- package/dist/node-prod/CartProvider.js.map +1 -1
- package/dist/node-prod/CartProvider.mjs.map +1 -1
- package/dist/node-prod/Image.js +317 -80
- package/dist/node-prod/Image.js.map +1 -1
- package/dist/node-prod/Image.mjs +302 -82
- package/dist/node-prod/Image.mjs.map +1 -1
- package/dist/node-prod/MediaFile.js.map +1 -1
- package/dist/node-prod/MediaFile.mjs.map +1 -1
- package/dist/node-prod/ModelViewer.js +4 -4
- package/dist/node-prod/ModelViewer.js.map +1 -1
- package/dist/node-prod/ModelViewer.mjs.map +1 -1
- package/dist/node-prod/Money.js.map +1 -1
- package/dist/node-prod/Money.mjs.map +1 -1
- package/dist/node-prod/ProductProvider.js +14 -14
- package/dist/node-prod/ProductProvider.js.map +1 -1
- package/dist/node-prod/ShopifyProvider.js +4 -4
- package/dist/node-prod/ShopifyProvider.js.map +1 -1
- package/dist/node-prod/Video.js +4 -4
- package/dist/node-prod/Video.js.map +1 -1
- package/dist/node-prod/Video.mjs +2 -2
- package/dist/node-prod/Video.mjs.map +1 -1
- package/dist/node-prod/analytics-utils.js.map +1 -1
- package/dist/node-prod/analytics-utils.mjs.map +1 -1
- package/dist/node-prod/cart-hooks.js +2 -2
- package/dist/node-prod/cart-hooks.js.map +1 -1
- package/dist/node-prod/index.js +3 -2
- package/dist/node-prod/index.js.map +1 -1
- package/dist/node-prod/index.mjs +4 -3
- package/dist/node-prod/load-script.js +3 -3
- package/dist/node-prod/load-script.js.map +1 -1
- package/dist/node-prod/node_modules/@xstate/react/es/fsm.js +6 -6
- package/dist/node-prod/node_modules/@xstate/react/es/fsm.js.map +1 -1
- package/dist/node-prod/node_modules/@xstate/react/es/useConstant.js +3 -3
- package/dist/node-prod/node_modules/@xstate/react/es/useConstant.js.map +1 -1
- package/dist/node-prod/node_modules/@xstate/react/es/useConstant.mjs +2 -2
- package/dist/node-prod/node_modules/@xstate/react/es/useConstant.mjs.map +1 -1
- package/dist/node-prod/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js +2 -2
- package/dist/node-prod/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js.map +1 -1
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +3 -3
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -1
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +2 -2
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +2 -2
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -1
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs +2 -2
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +6 -6
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +2 -2
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +2 -2
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -1
- package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs +2 -2
- package/dist/node-prod/storefront-api-constants.js +1 -1
- package/dist/node-prod/storefront-api-constants.js.map +1 -1
- package/dist/node-prod/storefront-api-constants.mjs +1 -1
- package/dist/node-prod/storefront-api-constants.mjs.map +1 -1
- package/dist/node-prod/storefront-client.js.map +1 -1
- package/dist/node-prod/storefront-client.mjs.map +1 -1
- package/dist/node-prod/useCartAPIStateMachine.js +3 -3
- package/dist/node-prod/useCartAPIStateMachine.js.map +1 -1
- package/dist/node-prod/useCartAPIStateMachine.mjs.map +1 -1
- package/dist/node-prod/useCartActions.js +11 -11
- package/dist/node-prod/useCartActions.js.map +1 -1
- package/dist/node-prod/useCartActions.mjs.map +1 -1
- package/dist/node-prod/useMoney.js +5 -5
- package/dist/node-prod/useMoney.js.map +1 -1
- package/dist/node-prod/useShopifyCookies.js +2 -2
- package/dist/node-prod/useShopifyCookies.js.map +1 -1
- package/dist/types/CartProvider.d.ts +2 -2
- package/dist/types/Image.d.ts +173 -38
- package/dist/types/MediaFile.d.ts +2 -2
- package/dist/types/ModelViewer.d.ts +1 -1
- package/dist/types/Money.d.ts +1 -1
- package/dist/types/Video.d.ts +3 -3
- package/dist/types/analytics-types.d.ts +1 -1
- package/dist/types/analytics-utils.d.ts +2 -2
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/types/storefront-api-constants.d.ts +1 -1
- package/dist/types/storefront-api-types.d.ts +862 -118
- package/dist/types/storefront-client.d.ts +1 -1
- package/dist/types/useCartAPIStateMachine.d.ts +2 -2
- package/dist/types/useCartActions.d.ts +2 -2
- package/dist/umd/hydrogen-react.dev.js +332 -179
- package/dist/umd/hydrogen-react.dev.js.map +1 -1
- package/dist/umd/hydrogen-react.prod.js +22 -15
- package/dist/umd/hydrogen-react.prod.js.map +1 -1
- package/package.json +1 -1
- package/storefront.schema.json +1 -1
- package/dist/browser-dev/CartLinePrice.mjs +0 -21
- package/dist/browser-dev/CartLinePrice.mjs.map +0 -1
- package/dist/browser-dev/image-size.mjs +0 -80
- package/dist/browser-dev/image-size.mjs.map +0 -1
- package/dist/browser-prod/CartLinePrice.mjs +0 -18
- package/dist/browser-prod/CartLinePrice.mjs.map +0 -1
- package/dist/browser-prod/image-size.mjs +0 -80
- package/dist/browser-prod/image-size.mjs.map +0 -1
- package/dist/node-dev/CartLinePrice.js +0 -21
- package/dist/node-dev/CartLinePrice.js.map +0 -1
- package/dist/node-dev/CartLinePrice.mjs +0 -21
- package/dist/node-dev/CartLinePrice.mjs.map +0 -1
- package/dist/node-dev/image-size.js +0 -80
- package/dist/node-dev/image-size.js.map +0 -1
- package/dist/node-dev/image-size.mjs +0 -80
- package/dist/node-dev/image-size.mjs.map +0 -1
- package/dist/node-prod/CartLinePrice.js +0 -18
- package/dist/node-prod/CartLinePrice.js.map +0 -1
- package/dist/node-prod/CartLinePrice.mjs +0 -18
- package/dist/node-prod/CartLinePrice.mjs.map +0 -1
- package/dist/node-prod/image-size.js +0 -80
- package/dist/node-prod/image-size.js.map +0 -1
- package/dist/node-prod/image-size.mjs +0 -80
- package/dist/node-prod/image-size.mjs.map +0 -1
- package/dist/types/CartLinePrice.d.ts +0 -31
- package/dist/types/image-size.d.ts +0 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-utils.mjs","sources":["../../src/analytics-utils.ts"],"sourcesContent":["import type {\n ShopifyMonorailPayload,\n ShopifyMonorailEvent,\n
|
|
1
|
+
{"version":3,"file":"analytics-utils.mjs","sources":["../../src/analytics-utils.ts"],"sourcesContent":["import type {\n ShopifyMonorailPayload,\n ShopifyMonorailEvent,\n ShopifyGid,\n} from './analytics-types.js';\n\n/**\n * Builds a Shopify Monorail event from a Shopify Monorail payload and a schema ID.\n * @param payload - The Monorail payload\n * @param schemaId - The schema ID to use\n * @returns The formatted payload\n **/\nexport function schemaWrapper(\n schemaId: string,\n payload: ShopifyMonorailPayload,\n): ShopifyMonorailEvent {\n return {\n schema_id: schemaId,\n payload,\n metadata: {\n event_created_at_ms: Date.now(),\n },\n };\n}\n\n/**\n * Parses global id (gid) and returns the resource type and id.\n * @see https://shopify.dev/api/usage/gids\n * @param gid - A shopify GID (string)\n *\n * @example\n * ```ts\n * const {id, resource} = parseGid('gid://shopify/Order/123')\n * // => id = \"123\", resource = 'Order'\n *\n * * const {id, resource} = parseGid('gid://shopify/Cart/abc123')\n * // => id = \"abc123\", resource = 'Cart'\n * ```\n **/\nexport function parseGid(gid: string | undefined): ShopifyGid {\n const defaultReturn = {id: '', resource: null};\n\n if (typeof gid !== 'string') {\n return defaultReturn;\n }\n\n // TODO: add support for parsing query parameters on complex gids\n // Reference: https://shopify.dev/api/usage/gids\n const matches = gid.match(/^gid:\\/\\/shopify\\/(\\w+)\\/([^/]+)/);\n\n if (!matches || matches.length === 1) {\n return defaultReturn;\n }\n const id = matches[2] ?? null;\n const resource = matches[1] ?? null;\n\n return {id, resource};\n}\n\n/**\n * Filters properties from an object and returns a new object with only the properties that have a truthy value.\n * @param keyValuePairs - An object of key-value pairs\n * @param formattedData - An object which will hold the truthy values\n * @returns The formatted object\n **/\nexport function addDataIf(\n keyValuePairs: ShopifyMonorailPayload,\n formattedData: ShopifyMonorailPayload,\n): ShopifyMonorailPayload {\n if (typeof keyValuePairs !== 'object') {\n return {};\n }\n Object.entries(keyValuePairs).forEach(([key, value]) => {\n if (value) {\n formattedData[key] = value;\n }\n });\n return formattedData;\n}\n\n/**\n * Utility that errors if a function is called on the server.\n * @param fnName - The name of the function\n * @returns A boolean\n **/\nexport function errorIfServer(fnName: string): boolean {\n if (typeof document === 'undefined') {\n console.error(\n `${fnName} should only be used within the useEffect callback or event handlers`,\n );\n return true;\n }\n return false;\n}\n"],"names":[],"mappings":"AAYgB,SAAA,cACd,UACA,SACsB;AACf,SAAA;AAAA,IACL,WAAW;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,qBAAqB,KAAK,IAAI;AAAA,IAChC;AAAA,EAAA;AAEJ;AAgBO,SAAS,SAAS,KAAqC;AAC5D,QAAM,gBAAgB,EAAC,IAAI,IAAI,UAAU,KAAI;AAEzC,MAAA,OAAO,QAAQ,UAAU;AACpB,WAAA;AAAA,EACT;AAIM,QAAA,UAAU,IAAI,MAAM,kCAAkC;AAE5D,MAAI,CAAC,WAAW,QAAQ,WAAW,GAAG;AAC7B,WAAA;AAAA,EACT;AACM,QAAA,KAAK,QAAQ,CAAC,KAAK;AACnB,QAAA,WAAW,QAAQ,CAAC,KAAK;AAExB,SAAA,EAAC,IAAI;AACd;AAQgB,SAAA,UACd,eACA,eACwB;AACpB,MAAA,OAAO,kBAAkB,UAAU;AACrC,WAAO;EACT;AACO,SAAA,QAAQ,aAAa,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AACtD,QAAI,OAAO;AACT,oBAAc,GAAG,IAAI;AAAA,IACvB;AAAA,EAAA,CACD;AACM,SAAA;AACT;AAOO,SAAS,cAAc,QAAyB;AACjD,MAAA,OAAO,aAAa,aAAa;AAC3B,YAAA;AAAA,MACN,GAAG;AAAA,IAAA;AAEE,WAAA;AAAA,EACT;AACO,SAAA;AACT;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const React = require("react");
|
|
4
4
|
const ShopifyProvider = require("./ShopifyProvider.js");
|
|
5
5
|
const cartConstants = require("./cart-constants.js");
|
|
6
6
|
const cookiesUtils = require("./cookies-utils.js");
|
|
7
7
|
function useCartFetch() {
|
|
8
8
|
const { storefrontId, getPublicTokenHeaders, getStorefrontApiUrl } = ShopifyProvider.useShop();
|
|
9
|
-
return
|
|
9
|
+
return React.useCallback(
|
|
10
10
|
({
|
|
11
11
|
query,
|
|
12
12
|
variables
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart-hooks.js","sources":["../../src/cart-hooks.tsx"],"sourcesContent":["import {useState, useCallback} from 'react';\nimport {useShop} from './ShopifyProvider.js';\nimport {flattenConnection} from './flatten-connection.js';\nimport {CartInput, Cart as CartType} from './storefront-api-types.js';\nimport {CartCreate, defaultCartFragment} from './cart-queries.js';\nimport {Cart} from './cart-types.js';\nimport {\n SHOPIFY_STOREFRONT_ID_HEADER,\n SHOPIFY_STOREFRONT_Y_HEADER,\n SHOPIFY_STOREFRONT_S_HEADER,\n SHOPIFY_Y,\n SHOPIFY_S,\n} from './cart-constants.js';\nimport type {StorefrontApiResponseOkPartial} from './storefront-api-response.types.js';\nimport {getShopifyCookies} from './cookies-utils.js';\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function useCartFetch() {\n const {storefrontId, getPublicTokenHeaders, getStorefrontApiUrl} = useShop();\n\n return useCallback(\n <ReturnDataGeneric,>({\n query,\n variables,\n }: {\n query: string;\n variables: Record<string, unknown>;\n }): Promise<StorefrontApiResponseOkPartial<ReturnDataGeneric>> => {\n const headers = getPublicTokenHeaders({contentType: 'json'});\n\n if (storefrontId) {\n headers[SHOPIFY_STOREFRONT_ID_HEADER] = storefrontId;\n }\n\n // Find Shopify cookies\n const cookieData = getShopifyCookies(document.cookie);\n headers[SHOPIFY_STOREFRONT_Y_HEADER] = cookieData[SHOPIFY_Y];\n headers[SHOPIFY_STOREFRONT_S_HEADER] = cookieData[SHOPIFY_S];\n\n return fetch(getStorefrontApiUrl(), {\n method: 'POST',\n headers,\n body: JSON.stringify({\n query: query.toString(),\n variables,\n }),\n })\n .then(\n (res) =>\n res.json() as StorefrontApiResponseOkPartial<ReturnDataGeneric>,\n )\n .catch((error) => {\n return {\n data: undefined,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n errors: error?.toString(),\n };\n });\n },\n [getPublicTokenHeaders, storefrontId, getStorefrontApiUrl],\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function useInstantCheckout() {\n const [cart, updateCart] = useState<Cart | undefined>();\n const [checkoutUrl, updateCheckoutUrl] = useState<Cart['checkoutUrl']>();\n const [error, updateError] = useState<string | undefined>();\n\n const fetch = useCartFetch();\n\n const createInstantCheckout = useCallback(\n async (cartInput: CartInput) => {\n const {data, errors} = await fetch<{\n cartCreate: {cart: CartType};\n }>({\n query: CartCreate(defaultCartFragment),\n variables: {\n input: cartInput,\n },\n });\n\n if (errors) {\n updateError(errors.toString());\n updateCart(undefined);\n updateCheckoutUrl(undefined);\n }\n\n if (data?.cartCreate?.cart) {\n const dataCart = data.cartCreate.cart;\n updateCart({\n ...dataCart,\n lines: flattenConnection(dataCart.lines),\n note: dataCart.note ?? undefined,\n });\n updateCheckoutUrl(dataCart.checkoutUrl);\n }\n },\n [fetch],\n );\n\n return {cart, checkoutUrl, error, createInstantCheckout};\n}\n"],"names":["useShop","useCallback","SHOPIFY_STOREFRONT_ID_HEADER","getShopifyCookies","SHOPIFY_STOREFRONT_Y_HEADER","SHOPIFY_Y","SHOPIFY_STOREFRONT_S_HEADER","SHOPIFY_S"],"mappings":";;;;;;AAiBO,SAAS,eAAe;AAC7B,QAAM,EAAC,cAAc,uBAAuB,wBAAuBA,gBAAQ,QAAA;AAEpE,SAAAC,
|
|
1
|
+
{"version":3,"file":"cart-hooks.js","sources":["../../src/cart-hooks.tsx"],"sourcesContent":["import {useState, useCallback} from 'react';\nimport {useShop} from './ShopifyProvider.js';\nimport {flattenConnection} from './flatten-connection.js';\nimport {CartInput, Cart as CartType} from './storefront-api-types.js';\nimport {CartCreate, defaultCartFragment} from './cart-queries.js';\nimport {Cart} from './cart-types.js';\nimport {\n SHOPIFY_STOREFRONT_ID_HEADER,\n SHOPIFY_STOREFRONT_Y_HEADER,\n SHOPIFY_STOREFRONT_S_HEADER,\n SHOPIFY_Y,\n SHOPIFY_S,\n} from './cart-constants.js';\nimport type {StorefrontApiResponseOkPartial} from './storefront-api-response.types.js';\nimport {getShopifyCookies} from './cookies-utils.js';\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function useCartFetch() {\n const {storefrontId, getPublicTokenHeaders, getStorefrontApiUrl} = useShop();\n\n return useCallback(\n <ReturnDataGeneric,>({\n query,\n variables,\n }: {\n query: string;\n variables: Record<string, unknown>;\n }): Promise<StorefrontApiResponseOkPartial<ReturnDataGeneric>> => {\n const headers = getPublicTokenHeaders({contentType: 'json'});\n\n if (storefrontId) {\n headers[SHOPIFY_STOREFRONT_ID_HEADER] = storefrontId;\n }\n\n // Find Shopify cookies\n const cookieData = getShopifyCookies(document.cookie);\n headers[SHOPIFY_STOREFRONT_Y_HEADER] = cookieData[SHOPIFY_Y];\n headers[SHOPIFY_STOREFRONT_S_HEADER] = cookieData[SHOPIFY_S];\n\n return fetch(getStorefrontApiUrl(), {\n method: 'POST',\n headers,\n body: JSON.stringify({\n query: query.toString(),\n variables,\n }),\n })\n .then(\n (res) =>\n res.json() as StorefrontApiResponseOkPartial<ReturnDataGeneric>,\n )\n .catch((error) => {\n return {\n data: undefined,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n errors: error?.toString(),\n };\n });\n },\n [getPublicTokenHeaders, storefrontId, getStorefrontApiUrl],\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function useInstantCheckout() {\n const [cart, updateCart] = useState<Cart | undefined>();\n const [checkoutUrl, updateCheckoutUrl] = useState<Cart['checkoutUrl']>();\n const [error, updateError] = useState<string | undefined>();\n\n const fetch = useCartFetch();\n\n const createInstantCheckout = useCallback(\n async (cartInput: CartInput) => {\n const {data, errors} = await fetch<{\n cartCreate: {cart: CartType};\n }>({\n query: CartCreate(defaultCartFragment),\n variables: {\n input: cartInput,\n },\n });\n\n if (errors) {\n updateError(errors.toString());\n updateCart(undefined);\n updateCheckoutUrl(undefined);\n }\n\n if (data?.cartCreate?.cart) {\n const dataCart = data.cartCreate.cart;\n updateCart({\n ...dataCart,\n lines: flattenConnection(dataCart.lines),\n note: dataCart.note ?? undefined,\n });\n updateCheckoutUrl(dataCart.checkoutUrl);\n }\n },\n [fetch],\n );\n\n return {cart, checkoutUrl, error, createInstantCheckout};\n}\n"],"names":["useShop","useCallback","SHOPIFY_STOREFRONT_ID_HEADER","getShopifyCookies","SHOPIFY_STOREFRONT_Y_HEADER","SHOPIFY_Y","SHOPIFY_STOREFRONT_S_HEADER","SHOPIFY_S"],"mappings":";;;;;;AAiBO,SAAS,eAAe;AAC7B,QAAM,EAAC,cAAc,uBAAuB,wBAAuBA,gBAAQ,QAAA;AAEpE,SAAAC,MAAA;AAAA,IACL,CAAqB;AAAA,MACnB;AAAA,MACA;AAAA,IAAA,MAIgE;AAChE,YAAM,UAAU,sBAAsB,EAAC,aAAa,OAAO,CAAA;AAE3D,UAAI,cAAc;AAChB,gBAAQC,cAAAA,4BAA4B,IAAI;AAAA,MAC1C;AAGM,YAAA,aAAaC,aAAAA,kBAAkB,SAAS,MAAM;AAC5C,cAAAC,cAA2B,2BAAA,IAAI,WAAWC,cAAS,SAAA;AACnD,cAAAC,cAA2B,2BAAA,IAAI,WAAWC,cAAS,SAAA;AAEpD,aAAA,MAAM,uBAAuB;AAAA,QAClC,QAAQ;AAAA,QACR;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,OAAO,MAAM,SAAS;AAAA,UACtB;AAAA,QAAA,CACD;AAAA,MACF,CAAA,EACE;AAAA,QACC,CAAC,QACC,IAAI,KAAK;AAAA,MAAA,EAEZ,MAAM,CAAC,UAAU;AACT,eAAA;AAAA,UACL,MAAM;AAAA;AAAA,UAEN,QAAQ,+BAAO;AAAA,QAAS;AAAA,MAC1B,CACD;AAAA,IACL;AAAA,IACA,CAAC,uBAAuB,cAAc,mBAAmB;AAAA,EAAA;AAE7D;;"}
|
package/dist/node-dev/index.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const AddToCartButton = require("./AddToCartButton.js");
|
|
4
4
|
const analytics = require("./analytics.js");
|
|
5
5
|
const analyticsConstants = require("./analytics-constants.js");
|
|
6
|
+
const analyticsUtils = require("./analytics-utils.js");
|
|
6
7
|
const BuyNowButton = require("./BuyNowButton.js");
|
|
7
8
|
const cartConstants = require("./cart-constants.js");
|
|
8
9
|
const CartCheckoutButton = require("./CartCheckoutButton.js");
|
|
9
10
|
const CartCost = require("./CartCost.js");
|
|
10
|
-
const CartLinePrice = require("./CartLinePrice.js");
|
|
11
11
|
const CartLineProvider = require("./CartLineProvider.js");
|
|
12
12
|
const CartLineQuantity = require("./CartLineQuantity.js");
|
|
13
13
|
const CartLineQuantityAdjustButton = require("./CartLineQuantityAdjustButton.js");
|
|
@@ -35,6 +35,7 @@ exports.sendShopifyAnalytics = analytics.sendShopifyAnalytics;
|
|
|
35
35
|
exports.AnalyticsEventName = analyticsConstants.AnalyticsEventName;
|
|
36
36
|
exports.AnalyticsPageType = analyticsConstants.AnalyticsPageType;
|
|
37
37
|
exports.ShopifySalesChannel = analyticsConstants.ShopifySalesChannel;
|
|
38
|
+
exports.parseGid = analyticsUtils.parseGid;
|
|
38
39
|
exports.BuyNowButton = BuyNowButton.BuyNowButton;
|
|
39
40
|
exports.SHOPIFY_S = cartConstants.SHOPIFY_S;
|
|
40
41
|
exports.SHOPIFY_STOREFRONT_ID_HEADER = cartConstants.SHOPIFY_STOREFRONT_ID_HEADER;
|
|
@@ -43,7 +44,6 @@ exports.SHOPIFY_STOREFRONT_Y_HEADER = cartConstants.SHOPIFY_STOREFRONT_Y_HEADER;
|
|
|
43
44
|
exports.SHOPIFY_Y = cartConstants.SHOPIFY_Y;
|
|
44
45
|
exports.CartCheckoutButton = CartCheckoutButton.CartCheckoutButton;
|
|
45
46
|
exports.CartCost = CartCost.CartCost;
|
|
46
|
-
exports.CartLinePrice = CartLinePrice.CartLinePrice;
|
|
47
47
|
exports.CartLineProvider = CartLineProvider.CartLineProvider;
|
|
48
48
|
exports.useCartLine = CartLineProvider.useCartLine;
|
|
49
49
|
exports.CartLineQuantity = CartLineQuantity.CartLineQuantity;
|
|
@@ -54,6 +54,7 @@ exports.storefrontApiCustomScalars = codegen_helpers.storefrontApiCustomScalars;
|
|
|
54
54
|
exports.getShopifyCookies = cookiesUtils.getShopifyCookies;
|
|
55
55
|
exports.ExternalVideo = ExternalVideo.ExternalVideo;
|
|
56
56
|
exports.flattenConnection = flattenConnection.flattenConnection;
|
|
57
|
+
exports.IMAGE_FRAGMENT = Image.IMAGE_FRAGMENT;
|
|
57
58
|
exports.Image = Image.Image;
|
|
58
59
|
exports.MediaFile = MediaFile.MediaFile;
|
|
59
60
|
exports.ModelViewer = ModelViewer.ModelViewer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/node-dev/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AddToCartButton } from "./AddToCartButton.mjs";
|
|
2
2
|
import { getClientBrowserParameters, sendShopifyAnalytics } from "./analytics.mjs";
|
|
3
3
|
import { AnalyticsEventName, AnalyticsPageType, ShopifySalesChannel } from "./analytics-constants.mjs";
|
|
4
|
+
import { parseGid } from "./analytics-utils.mjs";
|
|
4
5
|
import { BuyNowButton } from "./BuyNowButton.mjs";
|
|
5
6
|
import { SHOPIFY_S, SHOPIFY_STOREFRONT_ID_HEADER, SHOPIFY_STOREFRONT_S_HEADER, SHOPIFY_STOREFRONT_Y_HEADER, SHOPIFY_Y } from "./cart-constants.mjs";
|
|
6
7
|
import { CartCheckoutButton } from "./CartCheckoutButton.mjs";
|
|
7
8
|
import { CartCost } from "./CartCost.mjs";
|
|
8
|
-
import { CartLinePrice } from "./CartLinePrice.mjs";
|
|
9
9
|
import { CartLineProvider, useCartLine } from "./CartLineProvider.mjs";
|
|
10
10
|
import { CartLineQuantity } from "./CartLineQuantity.mjs";
|
|
11
11
|
import { CartLineQuantityAdjustButton } from "./CartLineQuantityAdjustButton.mjs";
|
|
@@ -14,7 +14,7 @@ import { storefrontApiCustomScalars } from "./codegen.helpers.mjs";
|
|
|
14
14
|
import { getShopifyCookies } from "./cookies-utils.mjs";
|
|
15
15
|
import { ExternalVideo } from "./ExternalVideo.mjs";
|
|
16
16
|
import { flattenConnection } from "./flatten-connection.mjs";
|
|
17
|
-
import { Image } from "./Image.mjs";
|
|
17
|
+
import { IMAGE_FRAGMENT, Image } from "./Image.mjs";
|
|
18
18
|
import { MediaFile } from "./MediaFile.mjs";
|
|
19
19
|
import { ModelViewer } from "./ModelViewer.mjs";
|
|
20
20
|
import { Money } from "./Money.mjs";
|
|
@@ -34,12 +34,12 @@ export {
|
|
|
34
34
|
BuyNowButton,
|
|
35
35
|
CartCheckoutButton,
|
|
36
36
|
CartCost,
|
|
37
|
-
CartLinePrice,
|
|
38
37
|
CartLineProvider,
|
|
39
38
|
CartLineQuantity,
|
|
40
39
|
CartLineQuantityAdjustButton,
|
|
41
40
|
CartProvider,
|
|
42
41
|
ExternalVideo,
|
|
42
|
+
IMAGE_FRAGMENT,
|
|
43
43
|
Image,
|
|
44
44
|
MediaFile,
|
|
45
45
|
ModelViewer,
|
|
@@ -59,6 +59,7 @@ export {
|
|
|
59
59
|
flattenConnection,
|
|
60
60
|
getClientBrowserParameters,
|
|
61
61
|
getShopifyCookies,
|
|
62
|
+
parseGid,
|
|
62
63
|
parseMetafield,
|
|
63
64
|
sendShopifyAnalytics,
|
|
64
65
|
storefrontApiCustomScalars,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const React = require("react");
|
|
4
4
|
const SCRIPTS_LOADED = {};
|
|
5
5
|
function loadScript(src, options) {
|
|
6
6
|
const isScriptLoaded = SCRIPTS_LOADED[src];
|
|
@@ -31,9 +31,9 @@ function loadScript(src, options) {
|
|
|
31
31
|
return promise;
|
|
32
32
|
}
|
|
33
33
|
function useLoadScript(url, options) {
|
|
34
|
-
const [status, setStatus] =
|
|
34
|
+
const [status, setStatus] = React.useState("loading");
|
|
35
35
|
const stringifiedOptions = JSON.stringify(options);
|
|
36
|
-
|
|
36
|
+
React.useEffect(() => {
|
|
37
37
|
async function loadScriptWrapper() {
|
|
38
38
|
try {
|
|
39
39
|
setStatus("loading");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-script.js","sources":["../../src/load-script.tsx"],"sourcesContent":["import {useState, useEffect} from 'react';\n\nconst SCRIPTS_LOADED: Record<string, Promise<boolean>> = {};\n\nexport function loadScript(\n src: string,\n options?: {module?: boolean; in?: 'head' | 'body'},\n): Promise<boolean> {\n const isScriptLoaded = SCRIPTS_LOADED[src];\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (isScriptLoaded) {\n return isScriptLoaded;\n }\n\n const promise = new Promise<boolean>((resolve, reject) => {\n const script = document.createElement('script');\n if (options?.module) {\n script.type = 'module';\n } else {\n script.type = 'text/javascript';\n }\n script.src = src;\n script.onload = (): void => {\n resolve(true);\n };\n script.onerror = (): void => {\n reject(false);\n };\n if (options?.in === 'head') {\n document.head.appendChild(script);\n } else {\n document.body.appendChild(script);\n }\n });\n\n SCRIPTS_LOADED[src] = promise;\n\n return promise;\n}\n\ntype LoadScriptParams = Parameters<typeof loadScript>;\n\n/**\n * The `useLoadScript` hook loads an external script tag in the browser. It allows React components to lazy-load large third-party dependencies.\n */\nexport function useLoadScript(\n url: LoadScriptParams[0],\n options?: LoadScriptParams[1],\n): ScriptState {\n const [status, setStatus] = useState<ScriptState>('loading');\n const stringifiedOptions = JSON.stringify(options);\n\n useEffect(() => {\n async function loadScriptWrapper(): Promise<void> {\n try {\n setStatus('loading');\n await loadScript(url, options);\n setStatus('done');\n } catch (error) {\n setStatus('error');\n }\n }\n\n loadScriptWrapper().catch(() => {\n setStatus('error');\n });\n }, [url, stringifiedOptions, options]);\n\n return status;\n}\n\ntype ScriptState = 'loading' | 'done' | 'error';\n"],"names":["useState","useEffect"],"mappings":";;;AAEA,MAAM,iBAAmD,CAAA;AAEzC,SAAA,WACd,KACA,SACkB;AACZ,QAAA,iBAAiB,eAAe,GAAG;AAGzC,MAAI,gBAAgB;AACX,WAAA;AAAA,EACT;AAEA,QAAM,UAAU,IAAI,QAAiB,CAAC,SAAS,WAAW;AAClD,UAAA,SAAS,SAAS,cAAc,QAAQ;AAC9C,QAAI,mCAAS,QAAQ;AACnB,aAAO,OAAO;AAAA,IAAA,OACT;AACL,aAAO,OAAO;AAAA,IAChB;AACA,WAAO,MAAM;AACb,WAAO,SAAS,MAAY;AAC1B,cAAQ,IAAI;AAAA,IAAA;AAEd,WAAO,UAAU,MAAY;AAC3B,aAAO,KAAK;AAAA,IAAA;AAEV,SAAA,mCAAS,QAAO,QAAQ;AACjB,eAAA,KAAK,YAAY,MAAM;AAAA,IAAA,OAC3B;AACI,eAAA,KAAK,YAAY,MAAM;AAAA,IAClC;AAAA,EAAA,CACD;AAED,iBAAe,GAAG,IAAI;AAEf,SAAA;AACT;AAOgB,SAAA,cACd,KACA,SACa;AACb,QAAM,CAAC,QAAQ,SAAS,IAAIA,
|
|
1
|
+
{"version":3,"file":"load-script.js","sources":["../../src/load-script.tsx"],"sourcesContent":["import {useState, useEffect} from 'react';\n\nconst SCRIPTS_LOADED: Record<string, Promise<boolean>> = {};\n\nexport function loadScript(\n src: string,\n options?: {module?: boolean; in?: 'head' | 'body'},\n): Promise<boolean> {\n const isScriptLoaded = SCRIPTS_LOADED[src];\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (isScriptLoaded) {\n return isScriptLoaded;\n }\n\n const promise = new Promise<boolean>((resolve, reject) => {\n const script = document.createElement('script');\n if (options?.module) {\n script.type = 'module';\n } else {\n script.type = 'text/javascript';\n }\n script.src = src;\n script.onload = (): void => {\n resolve(true);\n };\n script.onerror = (): void => {\n reject(false);\n };\n if (options?.in === 'head') {\n document.head.appendChild(script);\n } else {\n document.body.appendChild(script);\n }\n });\n\n SCRIPTS_LOADED[src] = promise;\n\n return promise;\n}\n\ntype LoadScriptParams = Parameters<typeof loadScript>;\n\n/**\n * The `useLoadScript` hook loads an external script tag in the browser. It allows React components to lazy-load large third-party dependencies.\n */\nexport function useLoadScript(\n url: LoadScriptParams[0],\n options?: LoadScriptParams[1],\n): ScriptState {\n const [status, setStatus] = useState<ScriptState>('loading');\n const stringifiedOptions = JSON.stringify(options);\n\n useEffect(() => {\n async function loadScriptWrapper(): Promise<void> {\n try {\n setStatus('loading');\n await loadScript(url, options);\n setStatus('done');\n } catch (error) {\n setStatus('error');\n }\n }\n\n loadScriptWrapper().catch(() => {\n setStatus('error');\n });\n }, [url, stringifiedOptions, options]);\n\n return status;\n}\n\ntype ScriptState = 'loading' | 'done' | 'error';\n"],"names":["useState","useEffect"],"mappings":";;;AAEA,MAAM,iBAAmD,CAAA;AAEzC,SAAA,WACd,KACA,SACkB;AACZ,QAAA,iBAAiB,eAAe,GAAG;AAGzC,MAAI,gBAAgB;AACX,WAAA;AAAA,EACT;AAEA,QAAM,UAAU,IAAI,QAAiB,CAAC,SAAS,WAAW;AAClD,UAAA,SAAS,SAAS,cAAc,QAAQ;AAC9C,QAAI,mCAAS,QAAQ;AACnB,aAAO,OAAO;AAAA,IAAA,OACT;AACL,aAAO,OAAO;AAAA,IAChB;AACA,WAAO,MAAM;AACb,WAAO,SAAS,MAAY;AAC1B,cAAQ,IAAI;AAAA,IAAA;AAEd,WAAO,UAAU,MAAY;AAC3B,aAAO,KAAK;AAAA,IAAA;AAEV,SAAA,mCAAS,QAAO,QAAQ;AACjB,eAAA,KAAK,YAAY,MAAM;AAAA,IAAA,OAC3B;AACI,eAAA,KAAK,YAAY,MAAM;AAAA,IAClC;AAAA,EAAA,CACD;AAED,iBAAe,GAAG,IAAI;AAEf,SAAA;AACT;AAOgB,SAAA,cACd,KACA,SACa;AACb,QAAM,CAAC,QAAQ,SAAS,IAAIA,eAAsB,SAAS;AACrD,QAAA,qBAAqB,KAAK,UAAU,OAAO;AAEjDC,QAAAA,UAAU,MAAM;AACd,mBAAe,oBAAmC;AAC5C,UAAA;AACF,kBAAU,SAAS;AACb,cAAA,WAAW,KAAK,OAAO;AAC7B,kBAAU,MAAM;AAAA,eACT;AACP,kBAAU,OAAO;AAAA,MACnB;AAAA,IACF;AAEkB,sBAAA,EAAE,MAAM,MAAM;AAC9B,gBAAU,OAAO;AAAA,IAAA,CAClB;AAAA,EACA,GAAA,CAAC,KAAK,oBAAoB,OAAO,CAAC;AAE9B,SAAA;AACT;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const index = require("../../fsm/es/index.js");
|
|
4
|
-
const
|
|
4
|
+
const React = require("react");
|
|
5
5
|
const useIsomorphicLayoutEffect_esm = require("../../../use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js");
|
|
6
6
|
require("../../../use-sync-external-store/shim/with-selector.js");
|
|
7
7
|
const useConstant = require("./useConstant.js");
|
|
@@ -38,9 +38,9 @@ var getServiceState = function(service) {
|
|
|
38
38
|
return currentValue;
|
|
39
39
|
};
|
|
40
40
|
function useMachine(stateMachine, options) {
|
|
41
|
-
var persistedStateRef =
|
|
41
|
+
var persistedStateRef = React.useRef();
|
|
42
42
|
if (process.env.NODE_ENV !== "production") {
|
|
43
|
-
var _a = __read(
|
|
43
|
+
var _a = __read(React.useState(stateMachine), 1), initialMachine = _a[0];
|
|
44
44
|
if (stateMachine !== initialMachine) {
|
|
45
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
46
|
}
|
|
@@ -65,7 +65,7 @@ function useMachine(stateMachine, options) {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
var useServiceResult = useService(service);
|
|
68
|
-
|
|
68
|
+
React.useEffect(function() {
|
|
69
69
|
service.start(persistedStateRef.current);
|
|
70
70
|
queue.forEach(service.send);
|
|
71
71
|
persistedStateRef.current = service.state;
|
|
@@ -79,10 +79,10 @@ var isEqual = function(_prevState, nextState) {
|
|
|
79
79
|
return nextState.changed === false;
|
|
80
80
|
};
|
|
81
81
|
function useService(service) {
|
|
82
|
-
var getSnapshot =
|
|
82
|
+
var getSnapshot = React.useCallback(function() {
|
|
83
83
|
return getServiceState(service);
|
|
84
84
|
}, [service]);
|
|
85
|
-
var subscribe =
|
|
85
|
+
var subscribe = React.useCallback(function(handleStoreChange) {
|
|
86
86
|
var unsubscribe = service.subscribe(handleStoreChange).unsubscribe;
|
|
87
87
|
return unsubscribe;
|
|
88
88
|
}, [service]);
|
|
@@ -1 +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","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,QAAQ;AACzD,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,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,oBAAoBC,
|
|
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","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,QAAQ;AACzD,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,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,oBAAoBC,MAAAA;AACxB,MAAI,QAAQ,IAAI,aAAa,cAAc;AACvC,QAAI,KAAK,OAAOC,MAAAA,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;AACZ,QAAIC,WAAUC,MAAAA,UAAUC,MAAa,cAAC,aAAa,QAA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
|
3
3
|
function _interopNamespaceDefault(e) {
|
|
4
4
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
5
5
|
if (e) {
|
|
@@ -16,9 +16,9 @@ function _interopNamespaceDefault(e) {
|
|
|
16
16
|
n.default = e;
|
|
17
17
|
return Object.freeze(n);
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
20
20
|
function useConstant(fn) {
|
|
21
|
-
var ref =
|
|
21
|
+
var ref = React__namespace.useRef();
|
|
22
22
|
if (!ref.current) {
|
|
23
23
|
ref.current = { v: fn() };
|
|
24
24
|
}
|
|
@@ -1 +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,
|
|
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,iBAAM;AAChB,MAAI,CAAC,IAAI,SAAS;AACd,QAAI,UAAU,EAAE,GAAG,GAAI,EAAA;AAAA,EAC1B;AACD,SAAO,IAAI,QAAQ;AACvB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConstant.mjs","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":[
|
|
1
|
+
{"version":3,"file":"useConstant.mjs","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":[],"mappings":";AACe,SAAS,YAAY,IAAI;AACpC,MAAI,MAAM,MAAM;AAChB,MAAI,CAAC,IAAI,SAAS;AACd,QAAI,UAAU,EAAE,GAAG,GAAI,EAAA;AAAA,EAC1B;AACD,SAAO,IAAI,QAAQ;AACvB;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
var index = typeof document !== "undefined" ?
|
|
2
|
+
const React = require("react");
|
|
3
|
+
var index = typeof document !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
4
4
|
module.exports = index;
|
|
5
5
|
//# sourceMappingURL=use-isomorphic-layout-effect.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-isomorphic-layout-effect.esm.js","sources":["../../../../../../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js"],"sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport default index;\n"],"names":["useLayoutEffect","useEffect"],"mappings":";;AAEG,IAAC,QAAQ,OAAO,aAAa,cAAcA,
|
|
1
|
+
{"version":3,"file":"use-isomorphic-layout-effect.esm.js","sources":["../../../../../../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js"],"sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport default index;\n"],"names":["useLayoutEffect","useEffect"],"mappings":";;AAEG,IAAC,QAAQ,OAAO,aAAa,cAAcA,wBAAkBC,MAAAA;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const withSelector_development = require("../../../../_virtual/with-selector.development.js");
|
|
4
|
-
const
|
|
4
|
+
const React = require("react");
|
|
5
5
|
const index = require("../../shim/index.js");
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
@@ -22,14 +22,14 @@ function requireWithSelector_development() {
|
|
|
22
22
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
23
23
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
24
24
|
}
|
|
25
|
-
var React =
|
|
25
|
+
var React$1 = React;
|
|
26
26
|
var shim = index.__require();
|
|
27
27
|
function is(x, y) {
|
|
28
28
|
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
29
29
|
}
|
|
30
30
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
31
31
|
var useSyncExternalStore = shim.useSyncExternalStore;
|
|
32
|
-
var useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
|
|
32
|
+
var useRef = React$1.useRef, useEffect = React$1.useEffect, useMemo = React$1.useMemo, useDebugValue = React$1.useDebugValue;
|
|
33
33
|
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
34
34
|
var instRef = useRef(null);
|
|
35
35
|
var inst;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-selector.development.js","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$$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,
|
|
1
|
+
{"version":3,"file":"with-selector.development.js","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":["React","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,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AAA,YACR;AAED,+BAAmB;AACnB,gCAAoB;AACpB,mBAAO;AAAA,UACb;AAII,cAAI,yBAAyB,sBAAsB,SAAY,OAAO;AAEtE,cAAI,0BAA0B,WAAY;AACxC,mBAAO,iBAAiB,YAAW,CAAE;AAAA,UAC3C;AAEI,cAAI,gCAAgC,2BAA2B,OAAO,SAAY,WAAY;AAC5F,mBAAO,iBAAiB,uBAAsB,CAAE;AAAA,UACtD;AACI,iBAAO,CAAC,yBAAyB,6BAA6B;AAAA,QAC/D,GAAE,CAAC,aAAa,mBAAmB,UAAU,OAAO,CAAC,GAClD,eAAe,SAAS,CAAC,GACzB,qBAAqB,SAAS,CAAC;AAEnC,YAAI,QAAQ,qBAAqB,WAAW,cAAc,kBAAkB;AAC5E,kBAAU,WAAY;AACpB,eAAK,WAAW;AAChB,eAAK,QAAQ;AAAA,QACjB,GAAK,CAAC,KAAK,CAAC;AACV,sBAAc,KAAK;AACnB,eAAO;AAAA,MACR;AAEuCG,+BAAA,UAAA,mCAAG;AAE3C,UACE,OAAO,mCAAmC,eAC1C,OAAO,+BAA+B,+BACpC,YACF;AACA,uCAA+B,2BAA2B,IAAI,MAAK,CAAE;AAAA,MACtE;AAAA,IAED;EACA;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as withSelector_development } from "../../../../_virtual/with-selector.development.mjs";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
import { __require as requireShim } from "../../shim/index.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
@@ -20,7 +20,7 @@ function requireWithSelector_development() {
|
|
|
20
20
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
21
21
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
22
22
|
}
|
|
23
|
-
var React =
|
|
23
|
+
var React = React__default;
|
|
24
24
|
var shim = requireShim();
|
|
25
25
|
function is(x, y) {
|
|
26
26
|
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const withSelector_production_min = require("../../../../_virtual/with-selector.production.min.js");
|
|
4
|
-
const
|
|
4
|
+
const React = require("react");
|
|
5
5
|
const index = require("../../shim/index.js");
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
@@ -17,7 +17,7 @@ function requireWithSelector_production_min() {
|
|
|
17
17
|
if (hasRequiredWithSelector_production_min)
|
|
18
18
|
return withSelector_production_min.__exports;
|
|
19
19
|
hasRequiredWithSelector_production_min = 1;
|
|
20
|
-
var h =
|
|
20
|
+
var h = React, n = index.__require();
|
|
21
21
|
function p(a, b) {
|
|
22
22
|
return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-selector.production.min.js","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$$1","withSelector_production_min","a","c","d","b","e"],"mappings":";;;;;;;;;;;;;;;;;;;AASa,MAAI,
|
|
1
|
+
{"version":3,"file":"with-selector.production.min.js","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","withSelector_production_min","a","c","d","b","e"],"mappings":";;;;;;;;;;;;;;;;;;;AASa,MAAI,IAAEA,OAAiB,IAAEC,gBAAuC;AAAC,WAAS,EAA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E,GAAE,GAAE,CAAC,CAAC;AAAE,QAAI,IAAE,EAAE,GAAE,EAAE,CAAC,GAAE,EAAE,CAAC,CAAC;AACrf,MAAE,WAAU;AAAC,QAAE,WAAS;AAAG,QAAE,QAAM;AAAA,IAAC,GAAE,CAAC,CAAC,CAAC;AAAE,MAAE,CAAC;AAAE,WAAO;AAAA,EAAC;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as withSelector_production_min } from "../../../../_virtual/with-selector.production.min.mjs";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
import { __require as requireShim } from "../../shim/index.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
@@ -15,7 +15,7 @@ function requireWithSelector_production_min() {
|
|
|
15
15
|
if (hasRequiredWithSelector_production_min)
|
|
16
16
|
return withSelector_production_min;
|
|
17
17
|
hasRequiredWithSelector_production_min = 1;
|
|
18
|
-
var h =
|
|
18
|
+
var h = React__default, n = requireShim();
|
|
19
19
|
function p(a, b) {
|
|
20
20
|
return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
|
|
21
21
|
}
|
|
@@ -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,
|
|
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":";;;;;;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AAE,EAAC,CAAE;AAAA,MAAC,CAAC;AAAA,IAAC,GAAE,CAAC,GAAE,GAAE,GAAE,CAAC,CAAC;AAAE,QAAI,IAAE,EAAE,GAAE,EAAE,CAAC,GAAE,EAAE,CAAC,CAAC;AACrf,MAAE,WAAU;AAAC,QAAE,WAAS;AAAG,QAAE,QAAM;AAAA,IAAC,GAAE,CAAC,CAAC,CAAC;AAAE,MAAE,CAAC;AAAE,WAAO;AAAA,EAAC;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const useSyncExternalStoreShim_development = require("../../../_virtual/use-sync-external-store-shim.development.js");
|
|
4
|
-
const
|
|
4
|
+
const React = require("react");
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
|
7
7
|
* use-sync-external-store-shim.development.js
|
|
@@ -21,8 +21,8 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
21
21
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
22
22
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
23
23
|
}
|
|
24
|
-
var React =
|
|
25
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
24
|
+
var React$1 = React;
|
|
25
|
+
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
26
26
|
function error(format) {
|
|
27
27
|
{
|
|
28
28
|
{
|
|
@@ -52,13 +52,13 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
52
52
|
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
53
53
|
}
|
|
54
54
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
55
|
-
var useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
|
|
55
|
+
var useState = React$1.useState, useEffect = React$1.useEffect, useLayoutEffect = React$1.useLayoutEffect, useDebugValue = React$1.useDebugValue;
|
|
56
56
|
var didWarnOld18Alpha = false;
|
|
57
57
|
var didWarnUncachedGetSnapshot = false;
|
|
58
58
|
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
59
59
|
{
|
|
60
60
|
if (!didWarnOld18Alpha) {
|
|
61
|
-
if (React.startTransition !== void 0) {
|
|
61
|
+
if (React$1.startTransition !== void 0) {
|
|
62
62
|
didWarnOld18Alpha = true;
|
|
63
63
|
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.");
|
|
64
64
|
}
|
|
@@ -123,7 +123,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
123
123
|
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
124
124
|
var isServerEnvironment = !canUseDOM;
|
|
125
125
|
var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
126
|
-
var useSyncExternalStore$2 = React.useSyncExternalStore !== void 0 ? React.useSyncExternalStore : shim;
|
|
126
|
+
var useSyncExternalStore$2 = React$1.useSyncExternalStore !== void 0 ? React$1.useSyncExternalStore : shim;
|
|
127
127
|
useSyncExternalStoreShim_development.__exports.useSyncExternalStore = useSyncExternalStore$2;
|
|
128
128
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
129
129
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-external-store-shim.development.js","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":["error","useSyncExternalStoreShim_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,QAAQ;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,IA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AA,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,SAAQA,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;AAEzEC,2CAAA,UAAA,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
|
+
{"version":3,"file":"use-sync-external-store-shim.development.js","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":["React","require$$0","error","useSyncExternalStoreShim_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,UAAIA,UAAQC;AAEtB,UAAI,uBAAuBD,QAAM;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;AAChB,sBAAU;AACV,mBAAO,KAAK,OAAO,CAAC,KAAK,CAAC;AAAA,UAC3B;AAGD,cAAI,iBAAiB,KAAK,IAAI,SAAU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AAG;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,SAAQE,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,yBAAyBF,QAAM,yBAAyB,SAAYA,QAAM,uBAAuB;AAEzEG,2CAAA,UAAA,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,5 +1,5 @@
|
|
|
1
1
|
import { __exports as useSyncExternalStoreShim_development } from "../../../_virtual/use-sync-external-store-shim.development.mjs";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* use-sync-external-store-shim.development.js
|
|
@@ -19,7 +19,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
19
19
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
20
20
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
21
21
|
}
|
|
22
|
-
var React =
|
|
22
|
+
var React = React__default;
|
|
23
23
|
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
24
24
|
function error(format) {
|
|
25
25
|
{
|