autumn-js 0.1.33 → 0.1.35
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/libraries/backend/better-auth.d.mts +221 -310
- package/dist/libraries/backend/better-auth.d.ts +221 -310
- package/dist/libraries/backend/better-auth.js +421 -148
- package/dist/libraries/backend/better-auth.mjs +250 -100
- package/dist/libraries/backend/{chunk-66ZEIO2W.mjs → chunk-35N7BIAE.mjs} +45 -1
- package/dist/libraries/backend/{chunk-OF427U7W.mjs → chunk-4MEEJLXG.mjs} +6 -6
- package/dist/libraries/backend/{chunk-FELIWCJB.mjs → chunk-LOSIWWM2.mjs} +1 -1
- package/dist/libraries/backend/{chunk-7HOB6NAU.mjs → chunk-MHIUO3ST.mjs} +1 -1
- package/dist/libraries/backend/{chunk-NTBLGION.mjs → chunk-PO4EL4BW.mjs} +9 -27
- package/dist/libraries/backend/{chunk-CVD6CEVQ.mjs → chunk-QOJMX7ML.mjs} +25 -31
- package/dist/libraries/backend/chunk-SRJD6EXQ.mjs +104 -0
- package/dist/libraries/backend/{chunk-3XTIAF27.mjs → chunk-USQ76FYI.mjs} +1 -1
- package/dist/libraries/backend/convex.js +84 -58
- package/dist/libraries/backend/convex.mjs +7 -7
- package/dist/libraries/backend/elysia.js +85 -77
- package/dist/libraries/backend/elysia.mjs +10 -28
- package/dist/libraries/backend/express.d.mts +1 -2
- package/dist/libraries/backend/express.d.ts +1 -2
- package/dist/libraries/backend/express.js +84 -58
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +84 -58
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +85 -59
- package/dist/libraries/backend/hono.mjs +8 -8
- package/dist/libraries/backend/index.d.mts +1 -2
- package/dist/libraries/backend/index.d.ts +1 -2
- package/dist/libraries/backend/index.js +84 -58
- package/dist/libraries/backend/index.mjs +7 -7
- package/dist/libraries/backend/next.js +84 -58
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.js +84 -58
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-DebIXtFw.d.ts → referralTypes-8cxTmxXS.d.ts} +49 -15
- package/dist/libraries/backend/{referralTypes-8bo5DSdv.d.mts → referralTypes-BXNyy9z2.d.mts} +49 -15
- package/dist/libraries/backend/remix_dep.js +84 -58
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +84 -58
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +76 -32
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +89 -63
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +76 -32
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +76 -32
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +84 -58
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +84 -58
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +33 -32
- package/dist/libraries/backend/utils/backendRes.mjs +1 -1
- package/dist/libraries/backend/utils/betterAuth/middlewares.d.mts +26 -0
- package/dist/libraries/backend/utils/betterAuth/middlewares.d.ts +26 -0
- package/dist/libraries/backend/utils/betterAuth/middlewares.js +130 -0
- package/dist/libraries/backend/utils/betterAuth/middlewares.mjs +10 -0
- package/dist/libraries/backend/utils/betterAuth/types.d.mts +18 -0
- package/dist/libraries/backend/utils/betterAuth/types.d.ts +18 -0
- package/dist/libraries/backend/utils/betterAuth/types.js +18 -0
- package/dist/libraries/backend/utils/betterAuth/types.mjs +0 -0
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -2
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -2
- package/dist/libraries/backend/utils/withAuth.js +76 -32
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +7 -9
- package/dist/libraries/react/AutumnContext.d.ts +7 -9
- package/dist/libraries/react/AutumnContext.js +64 -96
- package/dist/libraries/react/AutumnContext.mjs +6 -8
- package/dist/libraries/react/BaseAutumnProvider.d.mts +7 -9
- package/dist/libraries/react/BaseAutumnProvider.d.ts +7 -9
- package/dist/libraries/react/BaseAutumnProvider.js +233 -269
- package/dist/libraries/react/BaseAutumnProvider.mjs +11 -13
- package/dist/libraries/react/{ReactAutumnClient-DEHKGBDi.d.ts → ReactAutumnClient-DkAcY1X2.d.ts} +32 -37
- package/dist/libraries/react/{ReactAutumnClient-Zj0UGjxH.d.mts → ReactAutumnClient-DuYr1i4C.d.mts} +32 -37
- package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.js +233 -278
- package/dist/libraries/react/ReactAutumnProvider.mjs +13 -15
- package/dist/libraries/react/{attachTypes-DVF4f7Hw.d.ts → attachTypes-CKp1KMwX.d.ts} +1 -1
- package/dist/libraries/react/{attachTypes-DJIr5ldB.d.mts → attachTypes-DbuZWzAP.d.mts} +1 -1
- package/dist/libraries/react/{chunk-VYUFW3OD.mjs → chunk-4YM2QKRI.mjs} +5 -9
- package/dist/libraries/react/{chunk-NRR6GSHG.mjs → chunk-5LRBYZUD.mjs} +1 -1
- package/dist/libraries/react/{chunk-2RQO56D3.mjs → chunk-5OBFJVZC.mjs} +19 -19
- package/dist/libraries/react/{chunk-JNFJ3VBI.mjs → chunk-7FMBA5I4.mjs} +2 -2
- package/dist/libraries/react/{chunk-566O6I3M.mjs → chunk-7T7IOMAA.mjs} +2 -2
- package/dist/libraries/react/{chunk-LC75KITX.mjs → chunk-7YNNQGHZ.mjs} +1 -1
- package/dist/libraries/react/{chunk-TL3Q72GK.mjs → chunk-AUZMXLNB.mjs} +1 -1
- package/dist/libraries/react/{chunk-KUHUEZ4E.mjs → chunk-FL4H464X.mjs} +4 -4
- package/dist/libraries/react/{chunk-RHWRL643.mjs → chunk-FW7AQFVX.mjs} +1 -1
- package/dist/libraries/react/{chunk-HWQFNAOP.mjs → chunk-HN7ULWIM.mjs} +1 -1
- package/dist/libraries/react/chunk-LS2RW6JG.mjs +51 -0
- package/dist/libraries/react/{chunk-ZF2HUCN6.mjs → chunk-OYBOLAL5.mjs} +2 -7
- package/dist/libraries/react/{chunk-23P5IQNT.mjs → chunk-P4GHLIEZ.mjs} +19 -19
- package/dist/libraries/react/{chunk-4U4KMWWI.mjs → chunk-Q7LVAQ5K.mjs} +2 -2
- package/dist/libraries/react/{chunk-DIHJNBEP.mjs → chunk-RNIUZGWU.mjs} +2 -2
- package/dist/libraries/react/{chunk-QRCWNK2T.mjs → chunk-SFOIZTAS.mjs} +24 -23
- package/dist/libraries/react/{chunk-ZV4RPZTM.mjs → chunk-SUENW2KS.mjs} +2 -7
- package/dist/libraries/react/{chunk-RMDNPM6H.mjs → chunk-WSX7HWKQ.mjs} +4 -3
- package/dist/libraries/react/{chunk-ICJTAVNU.mjs → chunk-YKJYGNXR.mjs} +1 -1
- package/dist/libraries/react/{chunk-XIBQRZXG.mjs → chunk-ZVGPT54A.mjs} +1 -10
- package/dist/libraries/react/client/ConvexAutumnClient.d.mts +7 -13
- package/dist/libraries/react/client/ConvexAutumnClient.d.ts +7 -13
- package/dist/libraries/react/client/ConvexAutumnClient.js +33 -41
- package/dist/libraries/react/client/ConvexAutumnClient.mjs +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -8
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -8
- package/dist/libraries/react/client/ReactAutumnClient.js +64 -96
- package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -7
- package/dist/libraries/react/client/clientCompMethods.d.mts +25 -9
- package/dist/libraries/react/client/clientCompMethods.d.ts +25 -9
- package/dist/libraries/react/client/clientCompMethods.mjs +6 -3
- package/dist/libraries/react/client/clientCusMethods.d.mts +7 -9
- package/dist/libraries/react/client/clientCusMethods.d.ts +7 -9
- package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -7
- package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -7
- package/dist/libraries/react/client/clientEntityMethods.js +2 -25
- package/dist/libraries/react/client/clientEntityMethods.mjs +1 -2
- package/dist/libraries/react/client/clientGenMethods.d.mts +8 -9
- package/dist/libraries/react/client/clientGenMethods.d.ts +8 -9
- package/dist/libraries/react/client/clientGenMethods.js +12 -40
- package/dist/libraries/react/client/clientGenMethods.mjs +1 -2
- package/dist/libraries/react/client/clientProdMethods.d.mts +7 -9
- package/dist/libraries/react/client/clientProdMethods.d.ts +7 -9
- package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -8
- package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -8
- package/dist/libraries/react/client/clientReferralMethods.js +2 -27
- package/dist/libraries/react/client/clientReferralMethods.mjs +1 -2
- package/dist/libraries/react/client/types/clientEntTypes.d.mts +18 -13
- package/dist/libraries/react/client/types/clientEntTypes.d.ts +18 -13
- package/dist/libraries/react/client/types/clientEntTypes.js +28 -0
- package/dist/libraries/react/client/types/clientEntTypes.mjs +20 -0
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +12 -10
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +12 -10
- package/dist/libraries/react/client/types/clientGenTypes.js +70 -56
- package/dist/libraries/react/client/types/clientGenTypes.mjs +12 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +317 -353
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +26 -28
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +2 -2
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.mts +1 -1
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.ts +1 -1
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +113 -146
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +26 -28
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +516 -552
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +26 -28
- package/dist/libraries/react/components/ui/accordion.d.mts +10 -4
- package/dist/libraries/react/components/ui/accordion.d.ts +10 -4
- package/dist/libraries/react/components/ui/dialog.d.mts +15 -7
- package/dist/libraries/react/components/ui/dialog.d.ts +15 -7
- package/dist/libraries/react/components/ui/popover.d.mts +6 -4
- package/dist/libraries/react/components/ui/popover.d.ts +6 -4
- package/dist/libraries/react/components/ui/popover.mjs +2 -2
- package/dist/libraries/react/components/ui/switch.d.mts +3 -1
- package/dist/libraries/react/components/ui/switch.d.ts +3 -1
- package/dist/libraries/react/{cusTypes-CEb_KwPo.d.ts → cusTypes-D3QQXjif.d.ts} +1 -1
- package/dist/libraries/react/{cusTypes-DynqPCZH.d.mts → cusTypes-RU0fmR-t.d.mts} +1 -1
- package/dist/libraries/react/{entTypes-DjasDDYh.d.mts → entTypes-35x0LnYH.d.mts} +1 -1
- package/dist/libraries/react/{entTypes--Y-4T20Y.d.ts → entTypes-n2T2wpRx.d.ts} +1 -1
- package/dist/libraries/react/{genTypes-VKn7hoqQ.d.mts → genTypes-B5_6Pu_4.d.mts} +1 -1
- package/dist/libraries/react/{genTypes-BjHbcZ7E.d.ts → genTypes-CY6GNiAn.d.ts} +1 -1
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -7
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -7
- package/dist/libraries/react/hooks/helpers/handleCheck.js +33 -32
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +6 -7
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +6 -7
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +33 -32
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.js +64 -96
- package/dist/libraries/react/hooks/useAnalytics.mjs +7 -9
- package/dist/libraries/react/hooks/useCustomer.d.mts +10 -10
- package/dist/libraries/react/hooks/useCustomer.d.ts +10 -10
- package/dist/libraries/react/hooks/useCustomer.js +213 -249
- package/dist/libraries/react/hooks/useCustomer.mjs +11 -13
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.js +229 -265
- package/dist/libraries/react/hooks/useCustomerBase.mjs +10 -12
- package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
- package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntity.js +65 -96
- package/dist/libraries/react/hooks/useEntity.mjs +11 -13
- package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.js +65 -96
- package/dist/libraries/react/hooks/useEntityBase.mjs +10 -12
- package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
- package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
- package/dist/libraries/react/hooks/usePaywall.js +64 -96
- package/dist/libraries/react/hooks/usePaywall.mjs +7 -9
- package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.js +64 -96
- package/dist/libraries/react/hooks/usePricingTable.mjs +8 -10
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -8
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -8
- package/dist/libraries/react/hooks/usePricingTableBase.js +33 -32
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -8
- package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -8
- package/dist/libraries/react/hooks/useProductsBase.js +2 -1
- package/dist/libraries/react/hooks/useProductsBase.mjs +2 -1
- package/dist/libraries/react/index.d.mts +62 -58
- package/dist/libraries/react/index.d.ts +62 -58
- package/dist/libraries/react/index.js +521 -565
- package/dist/libraries/react/index.mjs +484 -528
- package/dist/libraries/react/{prodTypes-C8xRoBP7.d.ts → prodTypes-C4aZSZfO.d.mts} +1 -1
- package/dist/libraries/react/{prodTypes-C8xRoBP7.d.mts → prodTypes-C4aZSZfO.d.ts} +1 -1
- package/dist/next/client/NextAutumnClient.d.mts +31 -34
- package/dist/next/client/NextAutumnClient.d.ts +31 -34
- package/dist/next/client/NextAutumnProvider.d.mts +2 -2
- package/dist/next/client/NextAutumnProvider.d.ts +2 -2
- package/dist/next/client/{clientAttachTypes-BqwjCML1.d.ts → clientAttachTypes-BtZh00uu.d.ts} +12 -10
- package/dist/next/client/{clientAttachTypes-9AXt1E5H.d.mts → clientAttachTypes-yOuJqDWt.d.mts} +12 -10
- package/dist/next/client/{clientEntTypes-CnQkrPEG.d.mts → clientEntTypes-Bsi7ciUF.d.ts} +12 -10
- package/dist/next/client/{clientEntTypes-BhQWlwSW.d.ts → clientEntTypes-aLfa3lyP.d.mts} +12 -10
- package/dist/next/client/clientUtils.d.mts +3 -3
- package/dist/next/client/clientUtils.d.ts +3 -3
- package/dist/next/client/{cusTypes-5W4JVk2C.d.ts → cusTypes-B-rJwpui.d.ts} +2 -2
- package/dist/next/client/{cusTypes-Cb9Peq72.d.mts → cusTypes-CXjHwB-c.d.mts} +2 -2
- package/dist/next/client/{entTypes-R0fGEyG8.d.mts → entTypes-BkN-Puru.d.mts} +1 -1
- package/dist/next/client/{entTypes-B2gnYOgY.d.ts → entTypes-DjKFS-Zk.d.ts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +3 -3
- package/dist/next/client/hooks/useAutumn.d.ts +3 -3
- package/dist/next/client/hooks/useCustomer.d.mts +6 -6
- package/dist/next/client/hooks/useCustomer.d.ts +6 -6
- package/dist/next/client/hooks/useEntity.d.mts +4 -4
- package/dist/next/client/hooks/useEntity.d.ts +4 -4
- package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
- package/dist/next/client/{prodTypes-BC--Np0p.d.mts → prodTypes-B_VMILpU.d.mts} +1 -1
- package/dist/next/client/{prodTypes-BC--Np0p.d.ts → prodTypes-B_VMILpU.d.ts} +1 -1
- package/dist/next/client/types.d.mts +3 -3
- package/dist/next/client/types.d.ts +3 -3
- package/dist/next/server/cusActions.d.mts +59 -23
- package/dist/next/server/cusActions.d.ts +59 -23
- package/dist/next/server/cusActions.js +3 -3
- package/dist/next/server/cusActions.mjs +3 -3
- package/dist/next/server/genActions.js +5 -5
- package/dist/next/server/genActions.mjs +5 -5
- package/dist/sdk/index.d.mts +53 -16
- package/dist/sdk/index.d.ts +53 -16
- package/dist/sdk/index.js +32 -16
- package/dist/sdk/index.mjs +32 -16
- package/dist/utils/encryptUtils.js +33 -32
- package/dist/utils/encryptUtils.mjs +24 -23
- package/dist/utils/toSnakeCase.d.mts +5 -1
- package/dist/utils/toSnakeCase.d.ts +5 -1
- package/dist/utils/toSnakeCase.js +25 -6
- package/dist/utils/toSnakeCase.mjs +25 -6
- package/package.json +1 -1
- package/dist/libraries/react/chunk-KQT5G3HT.mjs +0 -27
- package/dist/libraries/react/chunk-VTGR7VVK.mjs +0 -12
- package/dist/libraries/react/chunk-YQHZT73Z.mjs +0 -59
- package/dist/libraries/react/utils/toSnakeCase.d.mts +0 -3
- package/dist/libraries/react/utils/toSnakeCase.d.ts +0 -3
- package/dist/libraries/react/utils/toSnakeCase.js +0 -50
- package/dist/libraries/react/utils/toSnakeCase.mjs +0 -8
- package/dist/libraries/react/{chunk-I274Z7T2.mjs → chunk-C3G5RW3Q.mjs} +3 -3
|
@@ -46,23 +46,6 @@ var useDialog = (component) => {
|
|
|
46
46
|
|
|
47
47
|
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
48
48
|
import useSWR2 from "swr";
|
|
49
|
-
import { useEffect as useEffect2 } from "react";
|
|
50
|
-
|
|
51
|
-
// src/libraries/react/errorUtils/logAuthError.ts
|
|
52
|
-
var logAuthError = async (response) => {
|
|
53
|
-
if (response.status === 401) {
|
|
54
|
-
let clonedResponse = response.clone();
|
|
55
|
-
let data = await clonedResponse.json();
|
|
56
|
-
if (data.message.includes("Missing authorization header")) {
|
|
57
|
-
console.error(`[Autumn] Missing authorization header.
|
|
58
|
-
|
|
59
|
-
Use the getBearerToken prop in <AutumnProvider /> to set the authorization header.
|
|
60
|
-
https://docs.useautumn.com/quickstart/quickstart#5-set-up-autumnprovider`);
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return false;
|
|
65
|
-
};
|
|
66
49
|
|
|
67
50
|
// src/sdk/error.ts
|
|
68
51
|
var AutumnError = class _AutumnError extends Error {
|
|
@@ -299,7 +282,8 @@ var productMethods = (instance) => {
|
|
|
299
282
|
return {
|
|
300
283
|
get: (id) => staticWrapper(getProduct, instance, { id }),
|
|
301
284
|
create: (params) => staticWrapper(createProduct, instance, { params }),
|
|
302
|
-
list: (params) => staticWrapper(listProducts, instance, { params })
|
|
285
|
+
list: (params) => staticWrapper(listProducts, instance, { params }),
|
|
286
|
+
delete: (id) => staticWrapper(deleteProduct, instance, { id })
|
|
303
287
|
};
|
|
304
288
|
};
|
|
305
289
|
var listProducts = async ({
|
|
@@ -333,6 +317,14 @@ var createProduct = async ({
|
|
|
333
317
|
}) => {
|
|
334
318
|
return instance.post("/products", params);
|
|
335
319
|
};
|
|
320
|
+
var deleteProduct = async ({
|
|
321
|
+
instance,
|
|
322
|
+
id,
|
|
323
|
+
params
|
|
324
|
+
}) => {
|
|
325
|
+
const path = buildPathWithQuery(`/products/${id}`, params);
|
|
326
|
+
return instance.delete(path);
|
|
327
|
+
};
|
|
336
328
|
|
|
337
329
|
// src/sdk/referrals/referralMethods.ts
|
|
338
330
|
var referralMethods = (instance) => {
|
|
@@ -369,14 +361,6 @@ var toContainerResult = async ({
|
|
|
369
361
|
}
|
|
370
362
|
} catch (error2) {
|
|
371
363
|
throw error2;
|
|
372
|
-
return {
|
|
373
|
-
data: null,
|
|
374
|
-
error: new AutumnError({
|
|
375
|
-
message: "Failed to parse JSON response from Autumn",
|
|
376
|
-
code: "internal_error"
|
|
377
|
-
}),
|
|
378
|
-
statusCode: response.status
|
|
379
|
-
};
|
|
380
364
|
}
|
|
381
365
|
return {
|
|
382
366
|
data: null,
|
|
@@ -388,7 +372,7 @@ var toContainerResult = async ({
|
|
|
388
372
|
};
|
|
389
373
|
}
|
|
390
374
|
try {
|
|
391
|
-
|
|
375
|
+
const data = await response.json();
|
|
392
376
|
return {
|
|
393
377
|
data,
|
|
394
378
|
error: null,
|
|
@@ -396,14 +380,6 @@ var toContainerResult = async ({
|
|
|
396
380
|
};
|
|
397
381
|
} catch (error) {
|
|
398
382
|
throw error;
|
|
399
|
-
return {
|
|
400
|
-
data: null,
|
|
401
|
-
error: new AutumnError({
|
|
402
|
-
message: "Failed to parse Autumn API response",
|
|
403
|
-
code: "internal_error"
|
|
404
|
-
}),
|
|
405
|
-
statusCode: response?.status
|
|
406
|
-
};
|
|
407
383
|
}
|
|
408
384
|
};
|
|
409
385
|
|
|
@@ -447,7 +423,8 @@ var logger = {
|
|
|
447
423
|
// src/sdk/features/featureMethods.ts
|
|
448
424
|
var featureMethods = (instance) => {
|
|
449
425
|
return {
|
|
450
|
-
list: () => staticWrapper(listFeatures, instance, {})
|
|
426
|
+
list: () => staticWrapper(listFeatures, instance, {}),
|
|
427
|
+
get: (id) => staticWrapper(getFeature, instance, { id })
|
|
451
428
|
};
|
|
452
429
|
};
|
|
453
430
|
var listFeatures = async ({
|
|
@@ -469,6 +446,12 @@ var listFeatures = async ({
|
|
|
469
446
|
}
|
|
470
447
|
return instance.get(path);
|
|
471
448
|
};
|
|
449
|
+
var getFeature = async ({
|
|
450
|
+
instance,
|
|
451
|
+
id
|
|
452
|
+
}) => {
|
|
453
|
+
return instance.get(`/features/${id}`);
|
|
454
|
+
};
|
|
472
455
|
|
|
473
456
|
// src/sdk/client.ts
|
|
474
457
|
var LATEST_API_VERSION = "1.2";
|
|
@@ -986,7 +969,7 @@ var CheckoutParamsSchema = z7.object({
|
|
|
986
969
|
});
|
|
987
970
|
|
|
988
971
|
// src/sdk/features/featureTypes.ts
|
|
989
|
-
import { z as z8 } from "zod";
|
|
972
|
+
import { z as z8 } from "zod/v4";
|
|
990
973
|
var FeatureType = /* @__PURE__ */ ((FeatureType2) => {
|
|
991
974
|
FeatureType2["Boolean"] = "boolean";
|
|
992
975
|
FeatureType2["SingleUse"] = "single_use";
|
|
@@ -996,8 +979,8 @@ var FeatureType = /* @__PURE__ */ ((FeatureType2) => {
|
|
|
996
979
|
})(FeatureType || {});
|
|
997
980
|
var FeatureSchema = z8.object({
|
|
998
981
|
id: z8.string(),
|
|
999
|
-
name: z8.string()
|
|
1000
|
-
type: z8.
|
|
982
|
+
name: z8.string(),
|
|
983
|
+
type: z8.enum(FeatureType),
|
|
1001
984
|
display: z8.object({
|
|
1002
985
|
singular: z8.string(),
|
|
1003
986
|
plural: z8.string()
|
|
@@ -1007,9 +990,173 @@ var FeatureSchema = z8.object({
|
|
|
1007
990
|
metered_feature_id: z8.string(),
|
|
1008
991
|
credit_cost: z8.number()
|
|
1009
992
|
})
|
|
1010
|
-
).nullish()
|
|
993
|
+
).nullish(),
|
|
994
|
+
archived: z8.boolean()
|
|
1011
995
|
});
|
|
1012
996
|
|
|
997
|
+
// src/libraries/react/hooks/helpers/handleCheck.ts
|
|
998
|
+
var getCusFeature = ({
|
|
999
|
+
customer,
|
|
1000
|
+
featureId,
|
|
1001
|
+
requiredBalance = 1
|
|
1002
|
+
}) => {
|
|
1003
|
+
let cusFeature = customer.features[featureId];
|
|
1004
|
+
if (cusFeature && typeof cusFeature.balance === "number" && cusFeature.balance >= requiredBalance) {
|
|
1005
|
+
return {
|
|
1006
|
+
cusFeature,
|
|
1007
|
+
requiredBalance
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
let creditSchema = Object.values(customer.features).find(
|
|
1011
|
+
(f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId)
|
|
1012
|
+
);
|
|
1013
|
+
if (creditSchema) {
|
|
1014
|
+
let schemaItem = creditSchema.credit_schema?.find(
|
|
1015
|
+
(c) => c.feature_id === featureId
|
|
1016
|
+
);
|
|
1017
|
+
return {
|
|
1018
|
+
cusFeature: creditSchema,
|
|
1019
|
+
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
return {
|
|
1023
|
+
cusFeature: customer.features[featureId],
|
|
1024
|
+
requiredBalance
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1027
|
+
var getFeatureAllowed = ({
|
|
1028
|
+
cusFeature,
|
|
1029
|
+
requiredBalance
|
|
1030
|
+
}) => {
|
|
1031
|
+
if (!cusFeature) return false;
|
|
1032
|
+
if (cusFeature.type == "static") return true;
|
|
1033
|
+
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
1034
|
+
if (cusFeature.usage_limit) {
|
|
1035
|
+
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
1036
|
+
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
1037
|
+
}
|
|
1038
|
+
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1039
|
+
};
|
|
1040
|
+
var handleFeatureCheck = ({
|
|
1041
|
+
customer,
|
|
1042
|
+
isEntity,
|
|
1043
|
+
params
|
|
1044
|
+
}) => {
|
|
1045
|
+
let { cusFeature, requiredBalance } = getCusFeature({
|
|
1046
|
+
customer,
|
|
1047
|
+
featureId: params.featureId,
|
|
1048
|
+
...params.requiredBalance ? { requiredBalance: params.requiredBalance } : {}
|
|
1049
|
+
});
|
|
1050
|
+
let allowed = getFeatureAllowed({
|
|
1051
|
+
cusFeature,
|
|
1052
|
+
requiredBalance: requiredBalance ?? 1
|
|
1053
|
+
});
|
|
1054
|
+
let result = {
|
|
1055
|
+
allowed,
|
|
1056
|
+
feature_id: cusFeature?.id ?? params.featureId,
|
|
1057
|
+
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1058
|
+
required_balance: requiredBalance,
|
|
1059
|
+
...cusFeature
|
|
1060
|
+
};
|
|
1061
|
+
if (isEntity) {
|
|
1062
|
+
result.entity_id = customer.id;
|
|
1063
|
+
}
|
|
1064
|
+
try {
|
|
1065
|
+
return CheckFeatureResultSchema.parse(result);
|
|
1066
|
+
} catch (error) {
|
|
1067
|
+
return result;
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
var handleProductCheck = ({
|
|
1071
|
+
customer,
|
|
1072
|
+
isEntity,
|
|
1073
|
+
params
|
|
1074
|
+
}) => {
|
|
1075
|
+
let product = customer.products.find((p) => p.id == params.productId);
|
|
1076
|
+
let allowed = product?.status === "active";
|
|
1077
|
+
let result = {
|
|
1078
|
+
allowed,
|
|
1079
|
+
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1080
|
+
product_id: params.productId
|
|
1081
|
+
};
|
|
1082
|
+
if (product) {
|
|
1083
|
+
result.status = product.status;
|
|
1084
|
+
}
|
|
1085
|
+
if (isEntity) {
|
|
1086
|
+
result.entity_id = customer.id;
|
|
1087
|
+
}
|
|
1088
|
+
return result;
|
|
1089
|
+
};
|
|
1090
|
+
var openDialog = ({
|
|
1091
|
+
result,
|
|
1092
|
+
params,
|
|
1093
|
+
context
|
|
1094
|
+
}) => {
|
|
1095
|
+
let open = result?.allowed === false && params.dialog && context;
|
|
1096
|
+
if (!open) return;
|
|
1097
|
+
const isInRenderCycle = (() => {
|
|
1098
|
+
const stack = new Error().stack || "";
|
|
1099
|
+
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1100
|
+
})();
|
|
1101
|
+
if (isInRenderCycle) {
|
|
1102
|
+
context.paywallRef.current = {
|
|
1103
|
+
component: params.dialog,
|
|
1104
|
+
open: true,
|
|
1105
|
+
props: params
|
|
1106
|
+
};
|
|
1107
|
+
} else {
|
|
1108
|
+
context.paywallDialog.setComponent(params.dialog);
|
|
1109
|
+
context.paywallDialog.setProps(params);
|
|
1110
|
+
context.paywallDialog.setOpen(true);
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
var handleCheck2 = ({
|
|
1114
|
+
customer,
|
|
1115
|
+
isEntity,
|
|
1116
|
+
params,
|
|
1117
|
+
context
|
|
1118
|
+
}) => {
|
|
1119
|
+
if (!customer) {
|
|
1120
|
+
return {
|
|
1121
|
+
data: {
|
|
1122
|
+
allowed: false,
|
|
1123
|
+
feature_id: "",
|
|
1124
|
+
customer_id: "",
|
|
1125
|
+
required_balance: 0
|
|
1126
|
+
},
|
|
1127
|
+
error: null
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
if (!params.featureId && !params.productId) {
|
|
1131
|
+
throw new Error("allowed() requires either featureId or productId");
|
|
1132
|
+
}
|
|
1133
|
+
let result;
|
|
1134
|
+
if (params.featureId)
|
|
1135
|
+
result = handleFeatureCheck({ customer, params, isEntity });
|
|
1136
|
+
if (params.productId)
|
|
1137
|
+
result = handleProductCheck({ customer, params, isEntity });
|
|
1138
|
+
return {
|
|
1139
|
+
data: result,
|
|
1140
|
+
error: null
|
|
1141
|
+
};
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
// src/libraries/react/errorUtils/logAuthError.ts
|
|
1145
|
+
var logAuthError = async (response) => {
|
|
1146
|
+
if (response.status === 401) {
|
|
1147
|
+
let clonedResponse = response.clone();
|
|
1148
|
+
let data = await clonedResponse.json();
|
|
1149
|
+
if (data.message.includes("Missing authorization header")) {
|
|
1150
|
+
console.error(`[Autumn] Missing authorization header.
|
|
1151
|
+
|
|
1152
|
+
Use the getBearerToken prop in <AutumnProvider /> to set the authorization header.
|
|
1153
|
+
https://docs.useautumn.com/quickstart/quickstart#5-set-up-autumnprovider`);
|
|
1154
|
+
return true;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return false;
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1013
1160
|
// src/libraries/react/errorUtils/logFetchError.ts
|
|
1014
1161
|
var logFetchError = ({
|
|
1015
1162
|
method,
|
|
@@ -1023,12 +1170,6 @@ var logFetchError = ({
|
|
|
1023
1170
|
2. Check that autumnHandler is correctly registered on your backend.`);
|
|
1024
1171
|
};
|
|
1025
1172
|
|
|
1026
|
-
// src/libraries/react/client/clientCompMethods.ts
|
|
1027
|
-
async function getPricingTableMethod() {
|
|
1028
|
-
const res = await this.get(`${this.prefix}/components/pricing_table`);
|
|
1029
|
-
return res;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
1173
|
// src/libraries/react/client/clientCusMethods.ts
|
|
1033
1174
|
var createCustomerMethod = async ({
|
|
1034
1175
|
client,
|
|
@@ -1038,27 +1179,6 @@ var createCustomerMethod = async ({
|
|
|
1038
1179
|
return result;
|
|
1039
1180
|
};
|
|
1040
1181
|
|
|
1041
|
-
// src/libraries/react/utils/toSnakeCase.ts
|
|
1042
|
-
function stringToSnakeCase(str) {
|
|
1043
|
-
return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[-\s]+/g, "_").toLowerCase();
|
|
1044
|
-
}
|
|
1045
|
-
var toSnakeCase = (obj, excludeKeys) => {
|
|
1046
|
-
if (Array.isArray(obj)) {
|
|
1047
|
-
return obj.map((item) => toSnakeCase(item, excludeKeys));
|
|
1048
|
-
} else if (obj !== null && typeof obj === "object") {
|
|
1049
|
-
return Object.fromEntries(
|
|
1050
|
-
Object.entries(obj).map(([key, value]) => {
|
|
1051
|
-
const snakeKey = stringToSnakeCase(key);
|
|
1052
|
-
if (excludeKeys && excludeKeys.includes(key)) {
|
|
1053
|
-
return [snakeKey, value];
|
|
1054
|
-
}
|
|
1055
|
-
return [snakeKey, toSnakeCase(value, excludeKeys)];
|
|
1056
|
-
})
|
|
1057
|
-
);
|
|
1058
|
-
}
|
|
1059
|
-
return obj;
|
|
1060
|
-
};
|
|
1061
|
-
|
|
1062
1182
|
// src/utils/entityUtils.tsx
|
|
1063
1183
|
var getEntityExpandStr = (expand) => {
|
|
1064
1184
|
if (!expand) {
|
|
@@ -1069,13 +1189,11 @@ var getEntityExpandStr = (expand) => {
|
|
|
1069
1189
|
|
|
1070
1190
|
// src/libraries/react/client/clientEntityMethods.ts
|
|
1071
1191
|
async function createEntityMethod(params) {
|
|
1072
|
-
|
|
1073
|
-
const res = await this.post(`${this.prefix}/entities`, snakeParams);
|
|
1192
|
+
const res = await this.post(`${this.prefix}/entities`, params);
|
|
1074
1193
|
return res;
|
|
1075
1194
|
}
|
|
1076
1195
|
async function getEntityMethod(entityId, params) {
|
|
1077
|
-
|
|
1078
|
-
let expand = getEntityExpandStr(params?.expand);
|
|
1196
|
+
const expand = getEntityExpandStr(params?.expand);
|
|
1079
1197
|
const res = await this.get(`${this.prefix}/entities/${entityId}?${expand}`);
|
|
1080
1198
|
return res;
|
|
1081
1199
|
}
|
|
@@ -1086,44 +1204,39 @@ async function deleteEntityMethod(entityId) {
|
|
|
1086
1204
|
|
|
1087
1205
|
// src/libraries/react/client/clientGenMethods.ts
|
|
1088
1206
|
async function checkoutMethod(params) {
|
|
1089
|
-
|
|
1090
|
-
const res = await this.post(`${this.prefix}/checkout`, snakeParams);
|
|
1207
|
+
const res = await this.post(`${this.prefix}/checkout`, params);
|
|
1091
1208
|
return res;
|
|
1092
1209
|
}
|
|
1093
1210
|
async function attachMethod(params) {
|
|
1094
|
-
|
|
1095
|
-
const res = await this.post(`${this.prefix}/attach`, snakeParams);
|
|
1211
|
+
const res = await this.post(`${this.prefix}/attach`, params);
|
|
1096
1212
|
return res;
|
|
1097
1213
|
}
|
|
1098
1214
|
async function setupPaymentMethod(params) {
|
|
1099
|
-
|
|
1100
|
-
const res = await this.post(`${this.prefix}/setup_payment`, snakeParams);
|
|
1215
|
+
const res = await this.post(`${this.prefix}/setup_payment`, params);
|
|
1101
1216
|
return res;
|
|
1102
1217
|
}
|
|
1103
1218
|
async function cancelMethod(params) {
|
|
1104
|
-
|
|
1105
|
-
const res = await this.post(`${this.prefix}/cancel`, snakeParams);
|
|
1219
|
+
const res = await this.post(`${this.prefix}/cancel`, params);
|
|
1106
1220
|
return res;
|
|
1107
1221
|
}
|
|
1108
1222
|
async function checkMethod(params) {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1223
|
+
const noDialogParams = {
|
|
1224
|
+
...params,
|
|
1225
|
+
dialog: void 0
|
|
1226
|
+
};
|
|
1227
|
+
const res = await this.post(`${this.prefix}/check`, noDialogParams);
|
|
1112
1228
|
return res;
|
|
1113
1229
|
}
|
|
1114
1230
|
async function trackMethod(params) {
|
|
1115
|
-
|
|
1116
|
-
const res = await this.post(`${this.prefix}/track`, snakeParams);
|
|
1231
|
+
const res = await this.post(`${this.prefix}/track`, params);
|
|
1117
1232
|
return res;
|
|
1118
1233
|
}
|
|
1119
1234
|
async function openBillingPortalMethod(params) {
|
|
1120
|
-
|
|
1121
|
-
const res = await this.post(`${this.prefix}/billing_portal`, snakeParams);
|
|
1235
|
+
const res = await this.post(`${this.prefix}/billing_portal`, params || {});
|
|
1122
1236
|
return res;
|
|
1123
1237
|
}
|
|
1124
1238
|
async function queryMethod(params) {
|
|
1125
|
-
|
|
1126
|
-
const res = await this.post(`${this.prefix}/query`, snakeParams);
|
|
1239
|
+
const res = await this.post(`${this.prefix}/query`, params);
|
|
1127
1240
|
return res;
|
|
1128
1241
|
}
|
|
1129
1242
|
|
|
@@ -1135,13 +1248,11 @@ async function listProductsMethod() {
|
|
|
1135
1248
|
|
|
1136
1249
|
// src/libraries/react/client/clientReferralMethods.ts
|
|
1137
1250
|
async function createCode(params) {
|
|
1138
|
-
|
|
1139
|
-
const res = await this.post(`${this.prefix}/referrals/code`, snakeParams);
|
|
1251
|
+
const res = await this.post(`${this.prefix}/referrals/code`, params);
|
|
1140
1252
|
return res;
|
|
1141
1253
|
}
|
|
1142
1254
|
async function redeemCode(params) {
|
|
1143
|
-
|
|
1144
|
-
const res = await this.post(`${this.prefix}/referrals/redeem`, snakeParams);
|
|
1255
|
+
const res = await this.post(`${this.prefix}/referrals/redeem`, params);
|
|
1145
1256
|
return res;
|
|
1146
1257
|
}
|
|
1147
1258
|
|
|
@@ -1152,7 +1263,9 @@ var AutumnClient = class {
|
|
|
1152
1263
|
customerData;
|
|
1153
1264
|
includeCredentials;
|
|
1154
1265
|
prefix;
|
|
1266
|
+
camelCase;
|
|
1155
1267
|
headers;
|
|
1268
|
+
framework;
|
|
1156
1269
|
constructor({
|
|
1157
1270
|
backendUrl,
|
|
1158
1271
|
getBearerToken,
|
|
@@ -1166,11 +1279,15 @@ var AutumnClient = class {
|
|
|
1166
1279
|
this.customerData = customerData;
|
|
1167
1280
|
this.includeCredentials = includeCredentials;
|
|
1168
1281
|
this.prefix = "/api/autumn";
|
|
1282
|
+
let camelCase = false;
|
|
1169
1283
|
if (betterAuthUrl) {
|
|
1170
1284
|
this.prefix = "/api/auth/autumn";
|
|
1171
1285
|
this.backendUrl = betterAuthUrl;
|
|
1286
|
+
camelCase = true;
|
|
1172
1287
|
}
|
|
1173
1288
|
this.headers = headers;
|
|
1289
|
+
if (betterAuthUrl) camelCase = true;
|
|
1290
|
+
this.camelCase = camelCase;
|
|
1174
1291
|
}
|
|
1175
1292
|
/**
|
|
1176
1293
|
* Detects if the backend supports CORS credentials by making an OPTIONS request
|
|
@@ -1188,7 +1305,7 @@ var AutumnClient = class {
|
|
|
1188
1305
|
body: JSON.stringify({})
|
|
1189
1306
|
});
|
|
1190
1307
|
return { valid: true, includeCredentials: true };
|
|
1191
|
-
} catch (
|
|
1308
|
+
} catch (_) {
|
|
1192
1309
|
try {
|
|
1193
1310
|
await fetch(testEndpoint, {
|
|
1194
1311
|
method: "POST",
|
|
@@ -1197,7 +1314,7 @@ var AutumnClient = class {
|
|
|
1197
1314
|
body: JSON.stringify({})
|
|
1198
1315
|
});
|
|
1199
1316
|
return { valid: true, includeCredentials: false };
|
|
1200
|
-
} catch (
|
|
1317
|
+
} catch (_2) {
|
|
1201
1318
|
return { valid: false, includeCredentials: void 0 };
|
|
1202
1319
|
}
|
|
1203
1320
|
}
|
|
@@ -1234,9 +1351,9 @@ var AutumnClient = class {
|
|
|
1234
1351
|
};
|
|
1235
1352
|
if (this.getBearerToken) {
|
|
1236
1353
|
try {
|
|
1237
|
-
|
|
1354
|
+
const token = await this.getBearerToken();
|
|
1238
1355
|
headers.Authorization = `Bearer ${token}`;
|
|
1239
|
-
} catch (
|
|
1356
|
+
} catch (_) {
|
|
1240
1357
|
console.error(`Failed to call getToken() in AutumnProvider`);
|
|
1241
1358
|
}
|
|
1242
1359
|
}
|
|
@@ -1250,15 +1367,15 @@ var AutumnClient = class {
|
|
|
1250
1367
|
method,
|
|
1251
1368
|
body
|
|
1252
1369
|
}) {
|
|
1253
|
-
body = method === "POST" ?
|
|
1370
|
+
body = method === "POST" ? {
|
|
1254
1371
|
...body,
|
|
1255
|
-
customer_data: this.customerData || void 0
|
|
1256
|
-
}
|
|
1372
|
+
[this.camelCase ? "customerData" : "customer_data"]: this.customerData || void 0
|
|
1373
|
+
} : void 0;
|
|
1257
1374
|
const includeCredentials = await this.shouldIncludeCredentials();
|
|
1258
1375
|
try {
|
|
1259
1376
|
const response = await fetch(`${this.backendUrl}${path}`, {
|
|
1260
1377
|
method,
|
|
1261
|
-
body,
|
|
1378
|
+
body: body ? JSON.stringify(body) : void 0,
|
|
1262
1379
|
headers: await this.getHeaders(),
|
|
1263
1380
|
credentials: includeCredentials ? "include" : "omit"
|
|
1264
1381
|
});
|
|
@@ -1278,7 +1395,7 @@ var AutumnClient = class {
|
|
|
1278
1395
|
return {
|
|
1279
1396
|
data: null,
|
|
1280
1397
|
error: new AutumnError({
|
|
1281
|
-
message: error.message,
|
|
1398
|
+
message: error instanceof Error ? error.message : JSON.stringify(error),
|
|
1282
1399
|
code: "fetch_failed"
|
|
1283
1400
|
})
|
|
1284
1401
|
};
|
|
@@ -1309,9 +1426,6 @@ var AutumnClient = class {
|
|
|
1309
1426
|
params
|
|
1310
1427
|
});
|
|
1311
1428
|
}
|
|
1312
|
-
async getPricingTable() {
|
|
1313
|
-
return await getPricingTableMethod.bind(this)();
|
|
1314
|
-
}
|
|
1315
1429
|
attach = attachMethod.bind(this);
|
|
1316
1430
|
checkout = checkoutMethod.bind(this);
|
|
1317
1431
|
cancel = cancelMethod.bind(this);
|
|
@@ -1719,153 +1833,6 @@ var useAutumnBase = ({
|
|
|
1719
1833
|
};
|
|
1720
1834
|
};
|
|
1721
1835
|
|
|
1722
|
-
// src/libraries/react/hooks/helpers/handleCheck.ts
|
|
1723
|
-
var getCusFeature = ({
|
|
1724
|
-
customer,
|
|
1725
|
-
featureId,
|
|
1726
|
-
requiredBalance = 1
|
|
1727
|
-
}) => {
|
|
1728
|
-
let cusFeature = customer.features[featureId];
|
|
1729
|
-
if (cusFeature && typeof cusFeature.balance === "number" && cusFeature.balance >= requiredBalance) {
|
|
1730
|
-
return {
|
|
1731
|
-
cusFeature,
|
|
1732
|
-
requiredBalance
|
|
1733
|
-
};
|
|
1734
|
-
}
|
|
1735
|
-
let creditSchema = Object.values(customer.features).find(
|
|
1736
|
-
(f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId)
|
|
1737
|
-
);
|
|
1738
|
-
if (creditSchema) {
|
|
1739
|
-
let schemaItem = creditSchema.credit_schema?.find(
|
|
1740
|
-
(c) => c.feature_id === featureId
|
|
1741
|
-
);
|
|
1742
|
-
return {
|
|
1743
|
-
cusFeature: creditSchema,
|
|
1744
|
-
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1745
|
-
};
|
|
1746
|
-
}
|
|
1747
|
-
return {
|
|
1748
|
-
cusFeature: customer.features[featureId],
|
|
1749
|
-
requiredBalance
|
|
1750
|
-
};
|
|
1751
|
-
};
|
|
1752
|
-
var getFeatureAllowed = ({
|
|
1753
|
-
cusFeature,
|
|
1754
|
-
requiredBalance
|
|
1755
|
-
}) => {
|
|
1756
|
-
if (!cusFeature) return false;
|
|
1757
|
-
if (cusFeature.type == "static") return true;
|
|
1758
|
-
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
1759
|
-
if (cusFeature.usage_limit) {
|
|
1760
|
-
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
1761
|
-
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
1762
|
-
}
|
|
1763
|
-
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1764
|
-
};
|
|
1765
|
-
var handleFeatureCheck = ({
|
|
1766
|
-
customer,
|
|
1767
|
-
isEntity,
|
|
1768
|
-
params
|
|
1769
|
-
}) => {
|
|
1770
|
-
let { cusFeature, requiredBalance } = getCusFeature({
|
|
1771
|
-
customer,
|
|
1772
|
-
featureId: params.featureId,
|
|
1773
|
-
...params.requiredBalance ? { requiredBalance: params.requiredBalance } : {}
|
|
1774
|
-
});
|
|
1775
|
-
let allowed = getFeatureAllowed({
|
|
1776
|
-
cusFeature,
|
|
1777
|
-
requiredBalance: requiredBalance ?? 1
|
|
1778
|
-
});
|
|
1779
|
-
let result = {
|
|
1780
|
-
allowed,
|
|
1781
|
-
feature_id: cusFeature?.id ?? params.featureId,
|
|
1782
|
-
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1783
|
-
required_balance: requiredBalance,
|
|
1784
|
-
...cusFeature
|
|
1785
|
-
};
|
|
1786
|
-
if (isEntity) {
|
|
1787
|
-
result.entity_id = customer.id;
|
|
1788
|
-
}
|
|
1789
|
-
try {
|
|
1790
|
-
return CheckFeatureResultSchema.parse(result);
|
|
1791
|
-
} catch (error) {
|
|
1792
|
-
return result;
|
|
1793
|
-
}
|
|
1794
|
-
};
|
|
1795
|
-
var handleProductCheck = ({
|
|
1796
|
-
customer,
|
|
1797
|
-
isEntity,
|
|
1798
|
-
params
|
|
1799
|
-
}) => {
|
|
1800
|
-
let product = customer.products.find((p) => p.id == params.productId);
|
|
1801
|
-
let allowed = product?.status === "active";
|
|
1802
|
-
let result = {
|
|
1803
|
-
allowed,
|
|
1804
|
-
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1805
|
-
product_id: params.productId
|
|
1806
|
-
};
|
|
1807
|
-
if (product) {
|
|
1808
|
-
result.status = product.status;
|
|
1809
|
-
}
|
|
1810
|
-
if (isEntity) {
|
|
1811
|
-
result.entity_id = customer.id;
|
|
1812
|
-
}
|
|
1813
|
-
return result;
|
|
1814
|
-
};
|
|
1815
|
-
var openDialog = ({
|
|
1816
|
-
result,
|
|
1817
|
-
params,
|
|
1818
|
-
context
|
|
1819
|
-
}) => {
|
|
1820
|
-
let open = result?.allowed === false && params.dialog && context;
|
|
1821
|
-
if (!open) return;
|
|
1822
|
-
const isInRenderCycle = (() => {
|
|
1823
|
-
const stack = new Error().stack || "";
|
|
1824
|
-
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1825
|
-
})();
|
|
1826
|
-
if (isInRenderCycle) {
|
|
1827
|
-
context.paywallRef.current = {
|
|
1828
|
-
component: params.dialog,
|
|
1829
|
-
open: true,
|
|
1830
|
-
props: params
|
|
1831
|
-
};
|
|
1832
|
-
} else {
|
|
1833
|
-
context.paywallDialog.setComponent(params.dialog);
|
|
1834
|
-
context.paywallDialog.setProps(params);
|
|
1835
|
-
context.paywallDialog.setOpen(true);
|
|
1836
|
-
}
|
|
1837
|
-
};
|
|
1838
|
-
var handleCheck2 = ({
|
|
1839
|
-
customer,
|
|
1840
|
-
isEntity,
|
|
1841
|
-
params,
|
|
1842
|
-
context
|
|
1843
|
-
}) => {
|
|
1844
|
-
if (!customer) {
|
|
1845
|
-
return {
|
|
1846
|
-
data: {
|
|
1847
|
-
allowed: false,
|
|
1848
|
-
feature_id: "",
|
|
1849
|
-
customer_id: "",
|
|
1850
|
-
required_balance: 0
|
|
1851
|
-
},
|
|
1852
|
-
error: null
|
|
1853
|
-
};
|
|
1854
|
-
}
|
|
1855
|
-
if (!params.featureId && !params.productId) {
|
|
1856
|
-
throw new Error("allowed() requires either featureId or productId");
|
|
1857
|
-
}
|
|
1858
|
-
let result;
|
|
1859
|
-
if (params.featureId)
|
|
1860
|
-
result = handleFeatureCheck({ customer, params, isEntity });
|
|
1861
|
-
if (params.productId)
|
|
1862
|
-
result = handleProductCheck({ customer, params, isEntity });
|
|
1863
|
-
return {
|
|
1864
|
-
data: result,
|
|
1865
|
-
error: null
|
|
1866
|
-
};
|
|
1867
|
-
};
|
|
1868
|
-
|
|
1869
1836
|
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
1870
1837
|
var useCustomerBase = ({
|
|
1871
1838
|
params,
|
|
@@ -1882,7 +1849,7 @@ var useCustomerBase = ({
|
|
|
1882
1849
|
if (!client) {
|
|
1883
1850
|
client = context.client;
|
|
1884
1851
|
}
|
|
1885
|
-
|
|
1852
|
+
const baseUrl = client?.backendUrl || "";
|
|
1886
1853
|
const queryKey = ["customer", baseUrl, params?.expand];
|
|
1887
1854
|
const fetchCustomer = async () => {
|
|
1888
1855
|
const { data, error: error2 } = await client.createCustomer({
|
|
@@ -1903,11 +1870,10 @@ var useCustomerBase = ({
|
|
|
1903
1870
|
isLoading,
|
|
1904
1871
|
mutate
|
|
1905
1872
|
} = useSWR2(queryKey, fetchCustomer, {
|
|
1906
|
-
fallbackData: null,
|
|
1907
1873
|
// Default to 5 minutes
|
|
1874
|
+
fallbackData: null,
|
|
1908
1875
|
swrConfig: {
|
|
1909
1876
|
shouldRetryOnError: false,
|
|
1910
|
-
// refreshInterval: 1000 * 60 * 5,
|
|
1911
1877
|
refreshInterval: 0,
|
|
1912
1878
|
...params?.swrConfig
|
|
1913
1879
|
}
|
|
@@ -1917,8 +1883,6 @@ var useCustomerBase = ({
|
|
|
1917
1883
|
client,
|
|
1918
1884
|
refetchCustomer: mutate
|
|
1919
1885
|
});
|
|
1920
|
-
useEffect2(() => {
|
|
1921
|
-
}, [context?.paywallRef.current]);
|
|
1922
1886
|
return {
|
|
1923
1887
|
customer: error ? null : customer,
|
|
1924
1888
|
isLoading,
|
|
@@ -2093,15 +2057,6 @@ var ConvexAutumnClient = class {
|
|
|
2093
2057
|
};
|
|
2094
2058
|
}
|
|
2095
2059
|
}
|
|
2096
|
-
async getPricingTable() {
|
|
2097
|
-
return {
|
|
2098
|
-
data: null,
|
|
2099
|
-
error: new AutumnError({
|
|
2100
|
-
message: "getPricingTable not yet implemented for Convex",
|
|
2101
|
-
code: "not_implemented"
|
|
2102
|
-
})
|
|
2103
|
-
};
|
|
2104
|
-
}
|
|
2105
2060
|
// Core methods that wrap Convex actions
|
|
2106
2061
|
attach = async (args) => {
|
|
2107
2062
|
try {
|
|
@@ -2434,6 +2389,7 @@ var useEntityBase = ({
|
|
|
2434
2389
|
};
|
|
2435
2390
|
const { data, error, isLoading, mutate } = useSWR3(queryKey, fetchEntity, {
|
|
2436
2391
|
fallbackData: null,
|
|
2392
|
+
shouldRetryOnError: false,
|
|
2437
2393
|
onErrorRetry: (error2, key, config) => {
|
|
2438
2394
|
if (error2.code == "entity_not_found") {
|
|
2439
2395
|
return false;
|
|
@@ -2555,21 +2511,21 @@ var usePaywall = ({
|
|
|
2555
2511
|
};
|
|
2556
2512
|
|
|
2557
2513
|
// ../node_modules/.pnpm/@radix-ui+react-accordion@1.2.11_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@1_rikqbnzk4rayqkcryhydcdufbu/node_modules/@radix-ui/react-accordion/dist/index.mjs
|
|
2558
|
-
import
|
|
2514
|
+
import React13 from "react";
|
|
2559
2515
|
|
|
2560
2516
|
// ../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
2561
|
-
import * as
|
|
2517
|
+
import * as React2 from "react";
|
|
2562
2518
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2563
2519
|
function createContext22(rootComponentName, defaultContext) {
|
|
2564
|
-
const Context =
|
|
2520
|
+
const Context = React2.createContext(defaultContext);
|
|
2565
2521
|
const Provider = (props) => {
|
|
2566
2522
|
const { children, ...context } = props;
|
|
2567
|
-
const value =
|
|
2523
|
+
const value = React2.useMemo(() => context, Object.values(context));
|
|
2568
2524
|
return /* @__PURE__ */ jsx3(Context.Provider, { value, children });
|
|
2569
2525
|
};
|
|
2570
2526
|
Provider.displayName = rootComponentName + "Provider";
|
|
2571
2527
|
function useContext22(consumerName) {
|
|
2572
|
-
const context =
|
|
2528
|
+
const context = React2.useContext(Context);
|
|
2573
2529
|
if (context) return context;
|
|
2574
2530
|
if (defaultContext !== void 0) return defaultContext;
|
|
2575
2531
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -2579,19 +2535,19 @@ function createContext22(rootComponentName, defaultContext) {
|
|
|
2579
2535
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
2580
2536
|
let defaultContexts = [];
|
|
2581
2537
|
function createContext32(rootComponentName, defaultContext) {
|
|
2582
|
-
const BaseContext =
|
|
2538
|
+
const BaseContext = React2.createContext(defaultContext);
|
|
2583
2539
|
const index2 = defaultContexts.length;
|
|
2584
2540
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
2585
2541
|
const Provider = (props) => {
|
|
2586
2542
|
const { scope, children, ...context } = props;
|
|
2587
2543
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
2588
|
-
const value =
|
|
2544
|
+
const value = React2.useMemo(() => context, Object.values(context));
|
|
2589
2545
|
return /* @__PURE__ */ jsx3(Context.Provider, { value, children });
|
|
2590
2546
|
};
|
|
2591
2547
|
Provider.displayName = rootComponentName + "Provider";
|
|
2592
2548
|
function useContext22(consumerName, scope) {
|
|
2593
2549
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
2594
|
-
const context =
|
|
2550
|
+
const context = React2.useContext(Context);
|
|
2595
2551
|
if (context) return context;
|
|
2596
2552
|
if (defaultContext !== void 0) return defaultContext;
|
|
2597
2553
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -2600,11 +2556,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
2600
2556
|
}
|
|
2601
2557
|
const createScope = () => {
|
|
2602
2558
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
2603
|
-
return
|
|
2559
|
+
return React2.createContext(defaultContext);
|
|
2604
2560
|
});
|
|
2605
2561
|
return function useScope(scope) {
|
|
2606
2562
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
2607
|
-
return
|
|
2563
|
+
return React2.useMemo(
|
|
2608
2564
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
2609
2565
|
[scope, contexts]
|
|
2610
2566
|
);
|
|
@@ -2627,7 +2583,7 @@ function composeContextScopes(...scopes) {
|
|
|
2627
2583
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
2628
2584
|
return { ...nextScopes2, ...currentScope };
|
|
2629
2585
|
}, {});
|
|
2630
|
-
return
|
|
2586
|
+
return React2.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
2631
2587
|
};
|
|
2632
2588
|
};
|
|
2633
2589
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -2635,10 +2591,10 @@ function composeContextScopes(...scopes) {
|
|
|
2635
2591
|
}
|
|
2636
2592
|
|
|
2637
2593
|
// ../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@1_fj4gprouy7cllhpzda3tfrvhzi/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
2638
|
-
import
|
|
2594
|
+
import React5 from "react";
|
|
2639
2595
|
|
|
2640
2596
|
// ../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
2641
|
-
import * as
|
|
2597
|
+
import * as React3 from "react";
|
|
2642
2598
|
function setRef(ref, value) {
|
|
2643
2599
|
if (typeof ref === "function") {
|
|
2644
2600
|
return ref(value);
|
|
@@ -2671,30 +2627,30 @@ function composeRefs(...refs) {
|
|
|
2671
2627
|
};
|
|
2672
2628
|
}
|
|
2673
2629
|
function useComposedRefs(...refs) {
|
|
2674
|
-
return
|
|
2630
|
+
return React3.useCallback(composeRefs(...refs), refs);
|
|
2675
2631
|
}
|
|
2676
2632
|
|
|
2677
2633
|
// ../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
2678
|
-
import * as
|
|
2634
|
+
import * as React4 from "react";
|
|
2679
2635
|
import { Fragment as Fragment2, jsx as jsx4 } from "react/jsx-runtime";
|
|
2680
2636
|
// @__NO_SIDE_EFFECTS__
|
|
2681
2637
|
function createSlot(ownerName) {
|
|
2682
2638
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
2683
|
-
const Slot22 =
|
|
2639
|
+
const Slot22 = React4.forwardRef((props, forwardedRef) => {
|
|
2684
2640
|
const { children, ...slotProps } = props;
|
|
2685
|
-
const childrenArray =
|
|
2641
|
+
const childrenArray = React4.Children.toArray(children);
|
|
2686
2642
|
const slottable = childrenArray.find(isSlottable);
|
|
2687
2643
|
if (slottable) {
|
|
2688
2644
|
const newElement = slottable.props.children;
|
|
2689
2645
|
const newChildren = childrenArray.map((child) => {
|
|
2690
2646
|
if (child === slottable) {
|
|
2691
|
-
if (
|
|
2692
|
-
return
|
|
2647
|
+
if (React4.Children.count(newElement) > 1) return React4.Children.only(null);
|
|
2648
|
+
return React4.isValidElement(newElement) ? newElement.props.children : null;
|
|
2693
2649
|
} else {
|
|
2694
2650
|
return child;
|
|
2695
2651
|
}
|
|
2696
2652
|
});
|
|
2697
|
-
return /* @__PURE__ */ jsx4(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
2653
|
+
return /* @__PURE__ */ jsx4(SlotClone, { ...slotProps, ref: forwardedRef, children: React4.isValidElement(newElement) ? React4.cloneElement(newElement, void 0, newChildren) : null });
|
|
2698
2654
|
}
|
|
2699
2655
|
return /* @__PURE__ */ jsx4(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
2700
2656
|
});
|
|
@@ -2704,24 +2660,24 @@ function createSlot(ownerName) {
|
|
|
2704
2660
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
2705
2661
|
// @__NO_SIDE_EFFECTS__
|
|
2706
2662
|
function createSlotClone(ownerName) {
|
|
2707
|
-
const SlotClone =
|
|
2663
|
+
const SlotClone = React4.forwardRef((props, forwardedRef) => {
|
|
2708
2664
|
const { children, ...slotProps } = props;
|
|
2709
|
-
if (
|
|
2665
|
+
if (React4.isValidElement(children)) {
|
|
2710
2666
|
const childrenRef = getElementRef(children);
|
|
2711
2667
|
const props2 = mergeProps(slotProps, children.props);
|
|
2712
|
-
if (children.type !==
|
|
2668
|
+
if (children.type !== React4.Fragment) {
|
|
2713
2669
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
2714
2670
|
}
|
|
2715
|
-
return
|
|
2671
|
+
return React4.cloneElement(children, props2);
|
|
2716
2672
|
}
|
|
2717
|
-
return
|
|
2673
|
+
return React4.Children.count(children) > 1 ? React4.Children.only(null) : null;
|
|
2718
2674
|
});
|
|
2719
2675
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
2720
2676
|
return SlotClone;
|
|
2721
2677
|
}
|
|
2722
2678
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
2723
2679
|
function isSlottable(child) {
|
|
2724
|
-
return
|
|
2680
|
+
return React4.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
2725
2681
|
}
|
|
2726
2682
|
function mergeProps(slotProps, childProps) {
|
|
2727
2683
|
const overrideProps = { ...childProps };
|
|
@@ -2774,14 +2730,14 @@ function createCollection(name) {
|
|
|
2774
2730
|
);
|
|
2775
2731
|
const CollectionProvider = (props) => {
|
|
2776
2732
|
const { scope, children } = props;
|
|
2777
|
-
const ref =
|
|
2778
|
-
const itemMap =
|
|
2733
|
+
const ref = React5.useRef(null);
|
|
2734
|
+
const itemMap = React5.useRef(/* @__PURE__ */ new Map()).current;
|
|
2779
2735
|
return /* @__PURE__ */ jsx5(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
2780
2736
|
};
|
|
2781
2737
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
2782
2738
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
2783
2739
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
2784
|
-
const CollectionSlot =
|
|
2740
|
+
const CollectionSlot = React5.forwardRef(
|
|
2785
2741
|
(props, forwardedRef) => {
|
|
2786
2742
|
const { scope, children } = props;
|
|
2787
2743
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -2793,13 +2749,13 @@ function createCollection(name) {
|
|
|
2793
2749
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
2794
2750
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
2795
2751
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
2796
|
-
const CollectionItemSlot =
|
|
2752
|
+
const CollectionItemSlot = React5.forwardRef(
|
|
2797
2753
|
(props, forwardedRef) => {
|
|
2798
2754
|
const { scope, children, ...itemData } = props;
|
|
2799
|
-
const ref =
|
|
2755
|
+
const ref = React5.useRef(null);
|
|
2800
2756
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2801
2757
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
2802
|
-
|
|
2758
|
+
React5.useEffect(() => {
|
|
2803
2759
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
2804
2760
|
return () => void context.itemMap.delete(ref);
|
|
2805
2761
|
});
|
|
@@ -2809,7 +2765,7 @@ function createCollection(name) {
|
|
|
2809
2765
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
2810
2766
|
function useCollection2(scope) {
|
|
2811
2767
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
2812
|
-
const getItems =
|
|
2768
|
+
const getItems = React5.useCallback(() => {
|
|
2813
2769
|
const collectionNode = context.collectionRef.current;
|
|
2814
2770
|
if (!collectionNode) return [];
|
|
2815
2771
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -2839,16 +2795,16 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
2839
2795
|
}
|
|
2840
2796
|
|
|
2841
2797
|
// ../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
2842
|
-
import * as
|
|
2798
|
+
import * as React7 from "react";
|
|
2843
2799
|
|
|
2844
2800
|
// ../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
2845
|
-
import * as
|
|
2846
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
2801
|
+
import * as React6 from "react";
|
|
2802
|
+
var useLayoutEffect2 = globalThis?.document ? React6.useLayoutEffect : () => {
|
|
2847
2803
|
};
|
|
2848
2804
|
|
|
2849
2805
|
// ../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
2850
2806
|
import * as React23 from "react";
|
|
2851
|
-
var useInsertionEffect =
|
|
2807
|
+
var useInsertionEffect = React7[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
2852
2808
|
function useControllableState({
|
|
2853
2809
|
prop,
|
|
2854
2810
|
defaultProp,
|
|
@@ -2863,8 +2819,8 @@ function useControllableState({
|
|
|
2863
2819
|
const isControlled = prop !== void 0;
|
|
2864
2820
|
const value = isControlled ? prop : uncontrolledProp;
|
|
2865
2821
|
if (true) {
|
|
2866
|
-
const isControlledRef =
|
|
2867
|
-
|
|
2822
|
+
const isControlledRef = React7.useRef(prop !== void 0);
|
|
2823
|
+
React7.useEffect(() => {
|
|
2868
2824
|
const wasControlled = isControlledRef.current;
|
|
2869
2825
|
if (wasControlled !== isControlled) {
|
|
2870
2826
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -2876,7 +2832,7 @@ function useControllableState({
|
|
|
2876
2832
|
isControlledRef.current = isControlled;
|
|
2877
2833
|
}, [isControlled, caller]);
|
|
2878
2834
|
}
|
|
2879
|
-
const setValue =
|
|
2835
|
+
const setValue = React7.useCallback(
|
|
2880
2836
|
(nextValue) => {
|
|
2881
2837
|
if (isControlled) {
|
|
2882
2838
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -2895,13 +2851,13 @@ function useUncontrolledState({
|
|
|
2895
2851
|
defaultProp,
|
|
2896
2852
|
onChange
|
|
2897
2853
|
}) {
|
|
2898
|
-
const [value, setValue] =
|
|
2899
|
-
const prevValueRef =
|
|
2900
|
-
const onChangeRef =
|
|
2854
|
+
const [value, setValue] = React7.useState(defaultProp);
|
|
2855
|
+
const prevValueRef = React7.useRef(value);
|
|
2856
|
+
const onChangeRef = React7.useRef(onChange);
|
|
2901
2857
|
useInsertionEffect(() => {
|
|
2902
2858
|
onChangeRef.current = onChange;
|
|
2903
2859
|
}, [onChange]);
|
|
2904
|
-
|
|
2860
|
+
React7.useEffect(() => {
|
|
2905
2861
|
if (prevValueRef.current !== value) {
|
|
2906
2862
|
onChangeRef.current?.(value);
|
|
2907
2863
|
prevValueRef.current = value;
|
|
@@ -2915,7 +2871,7 @@ function isFunction(value) {
|
|
|
2915
2871
|
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
2916
2872
|
|
|
2917
2873
|
// ../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19_xx37pthzbhildnk4zsozp4vigu/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
2918
|
-
import * as
|
|
2874
|
+
import * as React8 from "react";
|
|
2919
2875
|
import * as ReactDOM from "react-dom";
|
|
2920
2876
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
2921
2877
|
var NODES = [
|
|
@@ -2939,7 +2895,7 @@ var NODES = [
|
|
|
2939
2895
|
];
|
|
2940
2896
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
2941
2897
|
const Slot4 = createSlot(`Primitive.${node}`);
|
|
2942
|
-
const Node2 =
|
|
2898
|
+
const Node2 = React8.forwardRef((props, forwardedRef) => {
|
|
2943
2899
|
const { asChild, ...primitiveProps } = props;
|
|
2944
2900
|
const Comp = asChild ? Slot4 : node;
|
|
2945
2901
|
if (typeof window !== "undefined") {
|
|
@@ -2955,13 +2911,13 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
2955
2911
|
}
|
|
2956
2912
|
|
|
2957
2913
|
// ../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.11_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react_62ff4xakccgppayw3kaahenns4/node_modules/@radix-ui/react-collapsible/dist/index.mjs
|
|
2958
|
-
import * as
|
|
2914
|
+
import * as React11 from "react";
|
|
2959
2915
|
|
|
2960
2916
|
// ../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19._m54kvncv6il6p2flbkd4qzvije/node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
2961
2917
|
import * as React24 from "react";
|
|
2962
|
-
import * as
|
|
2918
|
+
import * as React9 from "react";
|
|
2963
2919
|
function useStateMachine(initialState, machine) {
|
|
2964
|
-
return
|
|
2920
|
+
return React9.useReducer((state, event) => {
|
|
2965
2921
|
const nextState = machine[state][event];
|
|
2966
2922
|
return nextState ?? state;
|
|
2967
2923
|
}, initialState);
|
|
@@ -3084,11 +3040,11 @@ function getElementRef2(element) {
|
|
|
3084
3040
|
}
|
|
3085
3041
|
|
|
3086
3042
|
// ../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
3087
|
-
import * as
|
|
3088
|
-
var useReactId =
|
|
3043
|
+
import * as React10 from "react";
|
|
3044
|
+
var useReactId = React10[" useId ".trim().toString()] || (() => void 0);
|
|
3089
3045
|
var count = 0;
|
|
3090
3046
|
function useId(deterministicId) {
|
|
3091
|
-
const [id, setId] =
|
|
3047
|
+
const [id, setId] = React10.useState(useReactId());
|
|
3092
3048
|
useLayoutEffect2(() => {
|
|
3093
3049
|
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
3094
3050
|
}, [deterministicId]);
|
|
@@ -3100,7 +3056,7 @@ import { jsx as jsx7 } from "react/jsx-runtime";
|
|
|
3100
3056
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
3101
3057
|
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
3102
3058
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
3103
|
-
var Collapsible =
|
|
3059
|
+
var Collapsible = React11.forwardRef(
|
|
3104
3060
|
(props, forwardedRef) => {
|
|
3105
3061
|
const {
|
|
3106
3062
|
__scopeCollapsible,
|
|
@@ -3123,7 +3079,7 @@ var Collapsible = React12.forwardRef(
|
|
|
3123
3079
|
disabled,
|
|
3124
3080
|
contentId: useId(),
|
|
3125
3081
|
open,
|
|
3126
|
-
onOpenToggle:
|
|
3082
|
+
onOpenToggle: React11.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
3127
3083
|
children: /* @__PURE__ */ jsx7(
|
|
3128
3084
|
Primitive.div,
|
|
3129
3085
|
{
|
|
@@ -3139,7 +3095,7 @@ var Collapsible = React12.forwardRef(
|
|
|
3139
3095
|
);
|
|
3140
3096
|
Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
3141
3097
|
var TRIGGER_NAME = "CollapsibleTrigger";
|
|
3142
|
-
var CollapsibleTrigger =
|
|
3098
|
+
var CollapsibleTrigger = React11.forwardRef(
|
|
3143
3099
|
(props, forwardedRef) => {
|
|
3144
3100
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
3145
3101
|
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
@@ -3161,7 +3117,7 @@ var CollapsibleTrigger = React12.forwardRef(
|
|
|
3161
3117
|
);
|
|
3162
3118
|
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
3163
3119
|
var CONTENT_NAME = "CollapsibleContent";
|
|
3164
|
-
var CollapsibleContent =
|
|
3120
|
+
var CollapsibleContent = React11.forwardRef(
|
|
3165
3121
|
(props, forwardedRef) => {
|
|
3166
3122
|
const { forceMount, ...contentProps } = props;
|
|
3167
3123
|
const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);
|
|
@@ -3169,20 +3125,20 @@ var CollapsibleContent = React12.forwardRef(
|
|
|
3169
3125
|
}
|
|
3170
3126
|
);
|
|
3171
3127
|
CollapsibleContent.displayName = CONTENT_NAME;
|
|
3172
|
-
var CollapsibleContentImpl =
|
|
3128
|
+
var CollapsibleContentImpl = React11.forwardRef((props, forwardedRef) => {
|
|
3173
3129
|
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
3174
3130
|
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
3175
|
-
const [isPresent, setIsPresent] =
|
|
3176
|
-
const ref =
|
|
3131
|
+
const [isPresent, setIsPresent] = React11.useState(present);
|
|
3132
|
+
const ref = React11.useRef(null);
|
|
3177
3133
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3178
|
-
const heightRef =
|
|
3134
|
+
const heightRef = React11.useRef(0);
|
|
3179
3135
|
const height = heightRef.current;
|
|
3180
|
-
const widthRef =
|
|
3136
|
+
const widthRef = React11.useRef(0);
|
|
3181
3137
|
const width = widthRef.current;
|
|
3182
3138
|
const isOpen = context.open || isPresent;
|
|
3183
|
-
const isMountAnimationPreventedRef =
|
|
3184
|
-
const originalStylesRef =
|
|
3185
|
-
|
|
3139
|
+
const isMountAnimationPreventedRef = React11.useRef(isOpen);
|
|
3140
|
+
const originalStylesRef = React11.useRef(void 0);
|
|
3141
|
+
React11.useEffect(() => {
|
|
3186
3142
|
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
3187
3143
|
return () => cancelAnimationFrame(rAF);
|
|
3188
3144
|
}, []);
|
|
@@ -3231,11 +3187,11 @@ var Trigger = CollapsibleTrigger;
|
|
|
3231
3187
|
var Content = CollapsibleContent;
|
|
3232
3188
|
|
|
3233
3189
|
// ../node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
3234
|
-
import * as
|
|
3190
|
+
import * as React12 from "react";
|
|
3235
3191
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
3236
|
-
var DirectionContext =
|
|
3192
|
+
var DirectionContext = React12.createContext(void 0);
|
|
3237
3193
|
function useDirection(localDir) {
|
|
3238
|
-
const globalDir =
|
|
3194
|
+
const globalDir = React12.useContext(DirectionContext);
|
|
3239
3195
|
return localDir || globalDir || "ltr";
|
|
3240
3196
|
}
|
|
3241
3197
|
|
|
@@ -3249,7 +3205,7 @@ var [createAccordionContext, createAccordionScope] = createContextScope(ACCORDIO
|
|
|
3249
3205
|
createCollapsibleScope
|
|
3250
3206
|
]);
|
|
3251
3207
|
var useCollapsibleScope = createCollapsibleScope();
|
|
3252
|
-
var Accordion =
|
|
3208
|
+
var Accordion = React13.forwardRef(
|
|
3253
3209
|
(props, forwardedRef) => {
|
|
3254
3210
|
const { type, ...accordionProps } = props;
|
|
3255
3211
|
const singleProps = accordionProps;
|
|
@@ -3263,7 +3219,7 @@ var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccor
|
|
|
3263
3219
|
ACCORDION_NAME,
|
|
3264
3220
|
{ collapsible: false }
|
|
3265
3221
|
);
|
|
3266
|
-
var AccordionImplSingle =
|
|
3222
|
+
var AccordionImplSingle = React13.forwardRef(
|
|
3267
3223
|
(props, forwardedRef) => {
|
|
3268
3224
|
const {
|
|
3269
3225
|
value: valueProp,
|
|
@@ -3283,15 +3239,15 @@ var AccordionImplSingle = React14.forwardRef(
|
|
|
3283
3239
|
AccordionValueProvider,
|
|
3284
3240
|
{
|
|
3285
3241
|
scope: props.__scopeAccordion,
|
|
3286
|
-
value:
|
|
3242
|
+
value: React13.useMemo(() => value ? [value] : [], [value]),
|
|
3287
3243
|
onItemOpen: setValue,
|
|
3288
|
-
onItemClose:
|
|
3244
|
+
onItemClose: React13.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
3289
3245
|
children: /* @__PURE__ */ jsx9(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsx9(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
3290
3246
|
}
|
|
3291
3247
|
);
|
|
3292
3248
|
}
|
|
3293
3249
|
);
|
|
3294
|
-
var AccordionImplMultiple =
|
|
3250
|
+
var AccordionImplMultiple = React13.forwardRef((props, forwardedRef) => {
|
|
3295
3251
|
const {
|
|
3296
3252
|
value: valueProp,
|
|
3297
3253
|
defaultValue,
|
|
@@ -3305,11 +3261,11 @@ var AccordionImplMultiple = React14.forwardRef((props, forwardedRef) => {
|
|
|
3305
3261
|
onChange: onValueChange,
|
|
3306
3262
|
caller: ACCORDION_NAME
|
|
3307
3263
|
});
|
|
3308
|
-
const handleItemOpen =
|
|
3264
|
+
const handleItemOpen = React13.useCallback(
|
|
3309
3265
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
3310
3266
|
[setValue]
|
|
3311
3267
|
);
|
|
3312
|
-
const handleItemClose =
|
|
3268
|
+
const handleItemClose = React13.useCallback(
|
|
3313
3269
|
(itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
|
|
3314
3270
|
[setValue]
|
|
3315
3271
|
);
|
|
@@ -3325,10 +3281,10 @@ var AccordionImplMultiple = React14.forwardRef((props, forwardedRef) => {
|
|
|
3325
3281
|
);
|
|
3326
3282
|
});
|
|
3327
3283
|
var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);
|
|
3328
|
-
var AccordionImpl =
|
|
3284
|
+
var AccordionImpl = React13.forwardRef(
|
|
3329
3285
|
(props, forwardedRef) => {
|
|
3330
3286
|
const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
|
|
3331
|
-
const accordionRef =
|
|
3287
|
+
const accordionRef = React13.useRef(null);
|
|
3332
3288
|
const composedRefs = useComposedRefs(accordionRef, forwardedRef);
|
|
3333
3289
|
const getItems = useCollection(__scopeAccordion);
|
|
3334
3290
|
const direction = useDirection(dir);
|
|
@@ -3417,7 +3373,7 @@ var AccordionImpl = React14.forwardRef(
|
|
|
3417
3373
|
);
|
|
3418
3374
|
var ITEM_NAME = "AccordionItem";
|
|
3419
3375
|
var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME);
|
|
3420
|
-
var AccordionItem =
|
|
3376
|
+
var AccordionItem = React13.forwardRef(
|
|
3421
3377
|
(props, forwardedRef) => {
|
|
3422
3378
|
const { __scopeAccordion, value, ...accordionItemProps } = props;
|
|
3423
3379
|
const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);
|
|
@@ -3458,7 +3414,7 @@ var AccordionItem = React14.forwardRef(
|
|
|
3458
3414
|
);
|
|
3459
3415
|
AccordionItem.displayName = ITEM_NAME;
|
|
3460
3416
|
var HEADER_NAME = "AccordionHeader";
|
|
3461
|
-
var AccordionHeader =
|
|
3417
|
+
var AccordionHeader = React13.forwardRef(
|
|
3462
3418
|
(props, forwardedRef) => {
|
|
3463
3419
|
const { __scopeAccordion, ...headerProps } = props;
|
|
3464
3420
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -3477,7 +3433,7 @@ var AccordionHeader = React14.forwardRef(
|
|
|
3477
3433
|
);
|
|
3478
3434
|
AccordionHeader.displayName = HEADER_NAME;
|
|
3479
3435
|
var TRIGGER_NAME2 = "AccordionTrigger";
|
|
3480
|
-
var AccordionTrigger =
|
|
3436
|
+
var AccordionTrigger = React13.forwardRef(
|
|
3481
3437
|
(props, forwardedRef) => {
|
|
3482
3438
|
const { __scopeAccordion, ...triggerProps } = props;
|
|
3483
3439
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -3499,7 +3455,7 @@ var AccordionTrigger = React14.forwardRef(
|
|
|
3499
3455
|
);
|
|
3500
3456
|
AccordionTrigger.displayName = TRIGGER_NAME2;
|
|
3501
3457
|
var CONTENT_NAME2 = "AccordionContent";
|
|
3502
|
-
var AccordionContent =
|
|
3458
|
+
var AccordionContent = React13.forwardRef(
|
|
3503
3459
|
(props, forwardedRef) => {
|
|
3504
3460
|
const { __scopeAccordion, ...contentProps } = props;
|
|
3505
3461
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -3534,7 +3490,7 @@ var Trigger2 = AccordionTrigger;
|
|
|
3534
3490
|
var Content2 = AccordionContent;
|
|
3535
3491
|
|
|
3536
3492
|
// src/libraries/react/components/checkout-dialog/checkout-dialog-synced.tsx
|
|
3537
|
-
import { useEffect as
|
|
3493
|
+
import { useEffect as useEffect19, useState as useState17 } from "react";
|
|
3538
3494
|
|
|
3539
3495
|
// ../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
3540
3496
|
function r(e) {
|
|
@@ -6062,7 +6018,7 @@ function cn(...inputs) {
|
|
|
6062
6018
|
}
|
|
6063
6019
|
|
|
6064
6020
|
// src/libraries/react/components/ui/button.tsx
|
|
6065
|
-
import * as
|
|
6021
|
+
import * as React14 from "react";
|
|
6066
6022
|
|
|
6067
6023
|
// ../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
6068
6024
|
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
@@ -6133,7 +6089,7 @@ var buttonVariants = cva(
|
|
|
6133
6089
|
}
|
|
6134
6090
|
}
|
|
6135
6091
|
);
|
|
6136
|
-
var Button =
|
|
6092
|
+
var Button = React14.forwardRef(
|
|
6137
6093
|
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
6138
6094
|
const Comp = asChild ? Slot : "button";
|
|
6139
6095
|
return /* @__PURE__ */ jsx10(
|
|
@@ -6149,29 +6105,29 @@ var Button = React15.forwardRef(
|
|
|
6149
6105
|
Button.displayName = "Button";
|
|
6150
6106
|
|
|
6151
6107
|
// src/libraries/react/components/ui/dialog.tsx
|
|
6152
|
-
import * as
|
|
6108
|
+
import * as React32 from "react";
|
|
6153
6109
|
|
|
6154
6110
|
// ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1_7xipnhxsrwjfttlgycirhttgoi/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
6155
|
-
import * as
|
|
6111
|
+
import * as React31 from "react";
|
|
6156
6112
|
|
|
6157
6113
|
// ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.9_@types+react@19.1.10__@types_recfemx4gbocxquotpq6g6r6si/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
6158
|
-
import * as
|
|
6114
|
+
import * as React17 from "react";
|
|
6159
6115
|
|
|
6160
6116
|
// ../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
6161
|
-
import * as
|
|
6117
|
+
import * as React15 from "react";
|
|
6162
6118
|
function useCallbackRef(callback) {
|
|
6163
|
-
const callbackRef =
|
|
6164
|
-
|
|
6119
|
+
const callbackRef = React15.useRef(callback);
|
|
6120
|
+
React15.useEffect(() => {
|
|
6165
6121
|
callbackRef.current = callback;
|
|
6166
6122
|
});
|
|
6167
|
-
return
|
|
6123
|
+
return React15.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
6168
6124
|
}
|
|
6169
6125
|
|
|
6170
6126
|
// ../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
6171
|
-
import * as
|
|
6127
|
+
import * as React16 from "react";
|
|
6172
6128
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
6173
6129
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
6174
|
-
|
|
6130
|
+
React16.useEffect(() => {
|
|
6175
6131
|
const handleKeyDown = (event) => {
|
|
6176
6132
|
if (event.key === "Escape") {
|
|
6177
6133
|
onEscapeKeyDown(event);
|
|
@@ -6189,12 +6145,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
6189
6145
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
6190
6146
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
6191
6147
|
var originalBodyPointerEvents;
|
|
6192
|
-
var DismissableLayerContext =
|
|
6148
|
+
var DismissableLayerContext = React17.createContext({
|
|
6193
6149
|
layers: /* @__PURE__ */ new Set(),
|
|
6194
6150
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
6195
6151
|
branches: /* @__PURE__ */ new Set()
|
|
6196
6152
|
});
|
|
6197
|
-
var DismissableLayer =
|
|
6153
|
+
var DismissableLayer = React17.forwardRef(
|
|
6198
6154
|
(props, forwardedRef) => {
|
|
6199
6155
|
const {
|
|
6200
6156
|
disableOutsidePointerEvents = false,
|
|
@@ -6205,10 +6161,10 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6205
6161
|
onDismiss,
|
|
6206
6162
|
...layerProps
|
|
6207
6163
|
} = props;
|
|
6208
|
-
const context =
|
|
6209
|
-
const [node, setNode] =
|
|
6164
|
+
const context = React17.useContext(DismissableLayerContext);
|
|
6165
|
+
const [node, setNode] = React17.useState(null);
|
|
6210
6166
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
6211
|
-
const [, force] =
|
|
6167
|
+
const [, force] = React17.useState({});
|
|
6212
6168
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
6213
6169
|
const layers = Array.from(context.layers);
|
|
6214
6170
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -6241,7 +6197,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6241
6197
|
onDismiss();
|
|
6242
6198
|
}
|
|
6243
6199
|
}, ownerDocument);
|
|
6244
|
-
|
|
6200
|
+
React17.useEffect(() => {
|
|
6245
6201
|
if (!node) return;
|
|
6246
6202
|
if (disableOutsidePointerEvents) {
|
|
6247
6203
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -6258,7 +6214,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6258
6214
|
}
|
|
6259
6215
|
};
|
|
6260
6216
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
6261
|
-
|
|
6217
|
+
React17.useEffect(() => {
|
|
6262
6218
|
return () => {
|
|
6263
6219
|
if (!node) return;
|
|
6264
6220
|
context.layers.delete(node);
|
|
@@ -6266,7 +6222,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6266
6222
|
dispatchUpdate();
|
|
6267
6223
|
};
|
|
6268
6224
|
}, [node, context]);
|
|
6269
|
-
|
|
6225
|
+
React17.useEffect(() => {
|
|
6270
6226
|
const handleUpdate = () => force({});
|
|
6271
6227
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
6272
6228
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -6292,11 +6248,11 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6292
6248
|
);
|
|
6293
6249
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
6294
6250
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
6295
|
-
var DismissableLayerBranch =
|
|
6296
|
-
const context =
|
|
6297
|
-
const ref =
|
|
6251
|
+
var DismissableLayerBranch = React17.forwardRef((props, forwardedRef) => {
|
|
6252
|
+
const context = React17.useContext(DismissableLayerContext);
|
|
6253
|
+
const ref = React17.useRef(null);
|
|
6298
6254
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6299
|
-
|
|
6255
|
+
React17.useEffect(() => {
|
|
6300
6256
|
const node = ref.current;
|
|
6301
6257
|
if (node) {
|
|
6302
6258
|
context.branches.add(node);
|
|
@@ -6310,10 +6266,10 @@ var DismissableLayerBranch = React18.forwardRef((props, forwardedRef) => {
|
|
|
6310
6266
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
6311
6267
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
6312
6268
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
6313
|
-
const isPointerInsideReactTreeRef =
|
|
6314
|
-
const handleClickRef =
|
|
6269
|
+
const isPointerInsideReactTreeRef = React17.useRef(false);
|
|
6270
|
+
const handleClickRef = React17.useRef(() => {
|
|
6315
6271
|
});
|
|
6316
|
-
|
|
6272
|
+
React17.useEffect(() => {
|
|
6317
6273
|
const handlePointerDown = (event) => {
|
|
6318
6274
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
6319
6275
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -6354,8 +6310,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
6354
6310
|
}
|
|
6355
6311
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
6356
6312
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
6357
|
-
const isFocusInsideReactTreeRef =
|
|
6358
|
-
|
|
6313
|
+
const isFocusInsideReactTreeRef = React17.useRef(false);
|
|
6314
|
+
React17.useEffect(() => {
|
|
6359
6315
|
const handleFocus = (event) => {
|
|
6360
6316
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
6361
6317
|
const eventDetail = { originalEvent: event };
|
|
@@ -6388,13 +6344,13 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
6388
6344
|
}
|
|
6389
6345
|
|
|
6390
6346
|
// ../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@_a6spdpnjpgxlsfsxwjh6tjh7gm/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
6391
|
-
import * as
|
|
6347
|
+
import * as React18 from "react";
|
|
6392
6348
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
6393
6349
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
6394
6350
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
6395
6351
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
6396
6352
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
6397
|
-
var FocusScope =
|
|
6353
|
+
var FocusScope = React18.forwardRef((props, forwardedRef) => {
|
|
6398
6354
|
const {
|
|
6399
6355
|
loop = false,
|
|
6400
6356
|
trapped = false,
|
|
@@ -6402,12 +6358,12 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
6402
6358
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
6403
6359
|
...scopeProps
|
|
6404
6360
|
} = props;
|
|
6405
|
-
const [container, setContainer] =
|
|
6361
|
+
const [container, setContainer] = React18.useState(null);
|
|
6406
6362
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
6407
6363
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
6408
|
-
const lastFocusedElementRef =
|
|
6364
|
+
const lastFocusedElementRef = React18.useRef(null);
|
|
6409
6365
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
6410
|
-
const focusScope =
|
|
6366
|
+
const focusScope = React18.useRef({
|
|
6411
6367
|
paused: false,
|
|
6412
6368
|
pause() {
|
|
6413
6369
|
this.paused = true;
|
|
@@ -6416,7 +6372,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
6416
6372
|
this.paused = false;
|
|
6417
6373
|
}
|
|
6418
6374
|
}).current;
|
|
6419
|
-
|
|
6375
|
+
React18.useEffect(() => {
|
|
6420
6376
|
if (trapped) {
|
|
6421
6377
|
let handleFocusIn2 = function(event) {
|
|
6422
6378
|
if (focusScope.paused || !container) return;
|
|
@@ -6452,7 +6408,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
6452
6408
|
};
|
|
6453
6409
|
}
|
|
6454
6410
|
}, [trapped, container, focusScope.paused]);
|
|
6455
|
-
|
|
6411
|
+
React18.useEffect(() => {
|
|
6456
6412
|
if (container) {
|
|
6457
6413
|
focusScopesStack.add(focusScope);
|
|
6458
6414
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -6483,7 +6439,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
6483
6439
|
};
|
|
6484
6440
|
}
|
|
6485
6441
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
6486
|
-
const handleKeyDown =
|
|
6442
|
+
const handleKeyDown = React18.useCallback(
|
|
6487
6443
|
(event) => {
|
|
6488
6444
|
if (!loop && !trapped) return;
|
|
6489
6445
|
if (focusScope.paused) return;
|
|
@@ -6592,13 +6548,13 @@ function removeLinks(items) {
|
|
|
6592
6548
|
}
|
|
6593
6549
|
|
|
6594
6550
|
// ../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1._o5qf2sukaqjy2xztyed32jp6ia/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
6595
|
-
import * as
|
|
6551
|
+
import * as React19 from "react";
|
|
6596
6552
|
import ReactDOM2 from "react-dom";
|
|
6597
6553
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
6598
6554
|
var PORTAL_NAME = "Portal";
|
|
6599
|
-
var Portal =
|
|
6555
|
+
var Portal = React19.forwardRef((props, forwardedRef) => {
|
|
6600
6556
|
const { container: containerProp, ...portalProps } = props;
|
|
6601
|
-
const [mounted, setMounted] =
|
|
6557
|
+
const [mounted, setMounted] = React19.useState(false);
|
|
6602
6558
|
useLayoutEffect2(() => setMounted(true), []);
|
|
6603
6559
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
6604
6560
|
return container ? ReactDOM2.createPortal(/* @__PURE__ */ jsx13(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
@@ -6606,10 +6562,10 @@ var Portal = React20.forwardRef((props, forwardedRef) => {
|
|
|
6606
6562
|
Portal.displayName = PORTAL_NAME;
|
|
6607
6563
|
|
|
6608
6564
|
// ../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
6609
|
-
import * as
|
|
6565
|
+
import * as React20 from "react";
|
|
6610
6566
|
var count2 = 0;
|
|
6611
6567
|
function useFocusGuards() {
|
|
6612
|
-
|
|
6568
|
+
React20.useEffect(() => {
|
|
6613
6569
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
6614
6570
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
6615
6571
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -6666,10 +6622,10 @@ function __spreadArray(to, from, pack) {
|
|
|
6666
6622
|
}
|
|
6667
6623
|
|
|
6668
6624
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
6669
|
-
import * as
|
|
6625
|
+
import * as React30 from "react";
|
|
6670
6626
|
|
|
6671
6627
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
6672
|
-
import * as
|
|
6628
|
+
import * as React26 from "react";
|
|
6673
6629
|
|
|
6674
6630
|
// ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
6675
6631
|
var zeroRightClassName = "right-scroll-bar-position";
|
|
@@ -6716,8 +6672,8 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
6716
6672
|
}
|
|
6717
6673
|
|
|
6718
6674
|
// ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.10_react@19.1.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
6719
|
-
import * as
|
|
6720
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
6675
|
+
import * as React21 from "react";
|
|
6676
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React21.useLayoutEffect : React21.useEffect;
|
|
6721
6677
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
6722
6678
|
function useMergeRefs(refs, defaultValue) {
|
|
6723
6679
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -6834,7 +6790,7 @@ function createSidecarMedium(options) {
|
|
|
6834
6790
|
}
|
|
6835
6791
|
|
|
6836
6792
|
// ../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.10_react@19.1.1/node_modules/use-sidecar/dist/es2015/exports.js
|
|
6837
|
-
import * as
|
|
6793
|
+
import * as React25 from "react";
|
|
6838
6794
|
var SideCar = function(_a) {
|
|
6839
6795
|
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
6840
6796
|
if (!sideCar) {
|
|
@@ -6844,7 +6800,7 @@ var SideCar = function(_a) {
|
|
|
6844
6800
|
if (!Target) {
|
|
6845
6801
|
throw new Error("Sidecar medium not found");
|
|
6846
6802
|
}
|
|
6847
|
-
return
|
|
6803
|
+
return React25.createElement(Target, __assign({}, rest));
|
|
6848
6804
|
};
|
|
6849
6805
|
SideCar.isSideCarExport = true;
|
|
6850
6806
|
function exportSidecar(medium, exported) {
|
|
@@ -6859,9 +6815,9 @@ var effectCar = createSidecarMedium();
|
|
|
6859
6815
|
var nothing = function() {
|
|
6860
6816
|
return;
|
|
6861
6817
|
};
|
|
6862
|
-
var RemoveScroll =
|
|
6863
|
-
var ref =
|
|
6864
|
-
var _a =
|
|
6818
|
+
var RemoveScroll = React26.forwardRef(function(props, parentRef) {
|
|
6819
|
+
var ref = React26.useRef(null);
|
|
6820
|
+
var _a = React26.useState({
|
|
6865
6821
|
onScrollCapture: nothing,
|
|
6866
6822
|
onWheelCapture: nothing,
|
|
6867
6823
|
onTouchMoveCapture: nothing
|
|
@@ -6870,11 +6826,11 @@ var RemoveScroll = React27.forwardRef(function(props, parentRef) {
|
|
|
6870
6826
|
var SideCar2 = sideCar;
|
|
6871
6827
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
6872
6828
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
6873
|
-
return
|
|
6874
|
-
|
|
6829
|
+
return React26.createElement(
|
|
6830
|
+
React26.Fragment,
|
|
6875
6831
|
null,
|
|
6876
|
-
enabled &&
|
|
6877
|
-
forwardProps ?
|
|
6832
|
+
enabled && React26.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
6833
|
+
forwardProps ? React26.cloneElement(React26.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React26.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
6878
6834
|
);
|
|
6879
6835
|
});
|
|
6880
6836
|
RemoveScroll.defaultProps = {
|
|
@@ -6888,13 +6844,13 @@ RemoveScroll.classNames = {
|
|
|
6888
6844
|
};
|
|
6889
6845
|
|
|
6890
6846
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
6891
|
-
import * as
|
|
6847
|
+
import * as React29 from "react";
|
|
6892
6848
|
|
|
6893
6849
|
// ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
6894
|
-
import * as
|
|
6850
|
+
import * as React28 from "react";
|
|
6895
6851
|
|
|
6896
6852
|
// ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.10_react@19.1.1/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
6897
|
-
import * as
|
|
6853
|
+
import * as React27 from "react";
|
|
6898
6854
|
|
|
6899
6855
|
// ../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
|
|
6900
6856
|
var currentNonce;
|
|
@@ -6958,7 +6914,7 @@ var stylesheetSingleton = function() {
|
|
|
6958
6914
|
var styleHookSingleton = function() {
|
|
6959
6915
|
var sheet = stylesheetSingleton();
|
|
6960
6916
|
return function(styles, isDynamic) {
|
|
6961
|
-
|
|
6917
|
+
React27.useEffect(function() {
|
|
6962
6918
|
sheet.add(styles);
|
|
6963
6919
|
return function() {
|
|
6964
6920
|
sheet.remove();
|
|
@@ -7032,7 +6988,7 @@ var getCurrentUseCounter = function() {
|
|
|
7032
6988
|
return isFinite(counter) ? counter : 0;
|
|
7033
6989
|
};
|
|
7034
6990
|
var useLockAttribute = function() {
|
|
7035
|
-
|
|
6991
|
+
React28.useEffect(function() {
|
|
7036
6992
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
7037
6993
|
return function() {
|
|
7038
6994
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -7047,10 +7003,10 @@ var useLockAttribute = function() {
|
|
|
7047
7003
|
var RemoveScrollBar = function(_a) {
|
|
7048
7004
|
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
7049
7005
|
useLockAttribute();
|
|
7050
|
-
var gap =
|
|
7006
|
+
var gap = React28.useMemo(function() {
|
|
7051
7007
|
return getGapWidth(gapMode);
|
|
7052
7008
|
}, [gapMode]);
|
|
7053
|
-
return
|
|
7009
|
+
return React28.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
7054
7010
|
};
|
|
7055
7011
|
|
|
7056
7012
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
@@ -7191,16 +7147,16 @@ var generateStyle = function(id) {
|
|
|
7191
7147
|
var idCounter = 0;
|
|
7192
7148
|
var lockStack = [];
|
|
7193
7149
|
function RemoveScrollSideCar(props) {
|
|
7194
|
-
var shouldPreventQueue =
|
|
7195
|
-
var touchStartRef =
|
|
7196
|
-
var activeAxis =
|
|
7197
|
-
var id =
|
|
7198
|
-
var Style2 =
|
|
7199
|
-
var lastProps =
|
|
7200
|
-
|
|
7150
|
+
var shouldPreventQueue = React29.useRef([]);
|
|
7151
|
+
var touchStartRef = React29.useRef([0, 0]);
|
|
7152
|
+
var activeAxis = React29.useRef();
|
|
7153
|
+
var id = React29.useState(idCounter++)[0];
|
|
7154
|
+
var Style2 = React29.useState(styleSingleton)[0];
|
|
7155
|
+
var lastProps = React29.useRef(props);
|
|
7156
|
+
React29.useEffect(function() {
|
|
7201
7157
|
lastProps.current = props;
|
|
7202
7158
|
}, [props]);
|
|
7203
|
-
|
|
7159
|
+
React29.useEffect(function() {
|
|
7204
7160
|
if (props.inert) {
|
|
7205
7161
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
7206
7162
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -7216,7 +7172,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7216
7172
|
}
|
|
7217
7173
|
return;
|
|
7218
7174
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
7219
|
-
var shouldCancelEvent =
|
|
7175
|
+
var shouldCancelEvent = React29.useCallback(function(event, parent) {
|
|
7220
7176
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
7221
7177
|
return !lastProps.current.allowPinchZoom;
|
|
7222
7178
|
}
|
|
@@ -7252,7 +7208,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7252
7208
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
7253
7209
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
7254
7210
|
}, []);
|
|
7255
|
-
var shouldPrevent =
|
|
7211
|
+
var shouldPrevent = React29.useCallback(function(_event) {
|
|
7256
7212
|
var event = _event;
|
|
7257
7213
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
7258
7214
|
return;
|
|
@@ -7279,7 +7235,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7279
7235
|
}
|
|
7280
7236
|
}
|
|
7281
7237
|
}, []);
|
|
7282
|
-
var shouldCancel =
|
|
7238
|
+
var shouldCancel = React29.useCallback(function(name, delta, target, should) {
|
|
7283
7239
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
7284
7240
|
shouldPreventQueue.current.push(event);
|
|
7285
7241
|
setTimeout(function() {
|
|
@@ -7288,17 +7244,17 @@ function RemoveScrollSideCar(props) {
|
|
|
7288
7244
|
});
|
|
7289
7245
|
}, 1);
|
|
7290
7246
|
}, []);
|
|
7291
|
-
var scrollTouchStart =
|
|
7247
|
+
var scrollTouchStart = React29.useCallback(function(event) {
|
|
7292
7248
|
touchStartRef.current = getTouchXY(event);
|
|
7293
7249
|
activeAxis.current = void 0;
|
|
7294
7250
|
}, []);
|
|
7295
|
-
var scrollWheel =
|
|
7251
|
+
var scrollWheel = React29.useCallback(function(event) {
|
|
7296
7252
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7297
7253
|
}, []);
|
|
7298
|
-
var scrollTouchMove =
|
|
7254
|
+
var scrollTouchMove = React29.useCallback(function(event) {
|
|
7299
7255
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7300
7256
|
}, []);
|
|
7301
|
-
|
|
7257
|
+
React29.useEffect(function() {
|
|
7302
7258
|
lockStack.push(Style2);
|
|
7303
7259
|
props.setCallbacks({
|
|
7304
7260
|
onScrollCapture: scrollWheel,
|
|
@@ -7318,11 +7274,11 @@ function RemoveScrollSideCar(props) {
|
|
|
7318
7274
|
};
|
|
7319
7275
|
}, []);
|
|
7320
7276
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
7321
|
-
return
|
|
7322
|
-
|
|
7277
|
+
return React29.createElement(
|
|
7278
|
+
React29.Fragment,
|
|
7323
7279
|
null,
|
|
7324
|
-
inert ?
|
|
7325
|
-
removeScrollBar ?
|
|
7280
|
+
inert ? React29.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
7281
|
+
removeScrollBar ? React29.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
7326
7282
|
);
|
|
7327
7283
|
}
|
|
7328
7284
|
function getOutermostShadowParent(node) {
|
|
@@ -7341,8 +7297,8 @@ function getOutermostShadowParent(node) {
|
|
|
7341
7297
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
7342
7298
|
|
|
7343
7299
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
7344
|
-
var ReactRemoveScroll =
|
|
7345
|
-
return
|
|
7300
|
+
var ReactRemoveScroll = React30.forwardRef(function(props, ref) {
|
|
7301
|
+
return React30.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
7346
7302
|
});
|
|
7347
7303
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
7348
7304
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -7482,8 +7438,8 @@ var Dialog = (props) => {
|
|
|
7482
7438
|
onOpenChange,
|
|
7483
7439
|
modal = true
|
|
7484
7440
|
} = props;
|
|
7485
|
-
const triggerRef =
|
|
7486
|
-
const contentRef =
|
|
7441
|
+
const triggerRef = React31.useRef(null);
|
|
7442
|
+
const contentRef = React31.useRef(null);
|
|
7487
7443
|
const [open, setOpen] = useControllableState({
|
|
7488
7444
|
prop: openProp,
|
|
7489
7445
|
defaultProp: defaultOpen ?? false,
|
|
@@ -7501,7 +7457,7 @@ var Dialog = (props) => {
|
|
|
7501
7457
|
descriptionId: useId(),
|
|
7502
7458
|
open,
|
|
7503
7459
|
onOpenChange: setOpen,
|
|
7504
|
-
onOpenToggle:
|
|
7460
|
+
onOpenToggle: React31.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
7505
7461
|
modal,
|
|
7506
7462
|
children
|
|
7507
7463
|
}
|
|
@@ -7509,7 +7465,7 @@ var Dialog = (props) => {
|
|
|
7509
7465
|
};
|
|
7510
7466
|
Dialog.displayName = DIALOG_NAME;
|
|
7511
7467
|
var TRIGGER_NAME3 = "DialogTrigger";
|
|
7512
|
-
var DialogTrigger =
|
|
7468
|
+
var DialogTrigger = React31.forwardRef(
|
|
7513
7469
|
(props, forwardedRef) => {
|
|
7514
7470
|
const { __scopeDialog, ...triggerProps } = props;
|
|
7515
7471
|
const context = useDialogContext(TRIGGER_NAME3, __scopeDialog);
|
|
@@ -7537,11 +7493,11 @@ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
|
|
|
7537
7493
|
var DialogPortal = (props) => {
|
|
7538
7494
|
const { __scopeDialog, forceMount, children, container } = props;
|
|
7539
7495
|
const context = useDialogContext(PORTAL_NAME2, __scopeDialog);
|
|
7540
|
-
return /* @__PURE__ */ jsx14(PortalProvider, { scope: __scopeDialog, forceMount, children:
|
|
7496
|
+
return /* @__PURE__ */ jsx14(PortalProvider, { scope: __scopeDialog, forceMount, children: React31.Children.map(children, (child) => /* @__PURE__ */ jsx14(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx14(Portal, { asChild: true, container, children: child }) })) });
|
|
7541
7497
|
};
|
|
7542
7498
|
DialogPortal.displayName = PORTAL_NAME2;
|
|
7543
7499
|
var OVERLAY_NAME = "DialogOverlay";
|
|
7544
|
-
var DialogOverlay =
|
|
7500
|
+
var DialogOverlay = React31.forwardRef(
|
|
7545
7501
|
(props, forwardedRef) => {
|
|
7546
7502
|
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
7547
7503
|
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
@@ -7551,7 +7507,7 @@ var DialogOverlay = React32.forwardRef(
|
|
|
7551
7507
|
);
|
|
7552
7508
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
7553
7509
|
var Slot2 = createSlot("DialogOverlay.RemoveScroll");
|
|
7554
|
-
var DialogOverlayImpl =
|
|
7510
|
+
var DialogOverlayImpl = React31.forwardRef(
|
|
7555
7511
|
(props, forwardedRef) => {
|
|
7556
7512
|
const { __scopeDialog, ...overlayProps } = props;
|
|
7557
7513
|
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
@@ -7571,7 +7527,7 @@ var DialogOverlayImpl = React32.forwardRef(
|
|
|
7571
7527
|
}
|
|
7572
7528
|
);
|
|
7573
7529
|
var CONTENT_NAME3 = "DialogContent";
|
|
7574
|
-
var DialogContent =
|
|
7530
|
+
var DialogContent = React31.forwardRef(
|
|
7575
7531
|
(props, forwardedRef) => {
|
|
7576
7532
|
const portalContext = usePortalContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7577
7533
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -7580,12 +7536,12 @@ var DialogContent = React32.forwardRef(
|
|
|
7580
7536
|
}
|
|
7581
7537
|
);
|
|
7582
7538
|
DialogContent.displayName = CONTENT_NAME3;
|
|
7583
|
-
var DialogContentModal =
|
|
7539
|
+
var DialogContentModal = React31.forwardRef(
|
|
7584
7540
|
(props, forwardedRef) => {
|
|
7585
7541
|
const context = useDialogContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7586
|
-
const contentRef =
|
|
7542
|
+
const contentRef = React31.useRef(null);
|
|
7587
7543
|
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
7588
|
-
|
|
7544
|
+
React31.useEffect(() => {
|
|
7589
7545
|
const content = contentRef.current;
|
|
7590
7546
|
if (content) return hideOthers(content);
|
|
7591
7547
|
}, []);
|
|
@@ -7614,11 +7570,11 @@ var DialogContentModal = React32.forwardRef(
|
|
|
7614
7570
|
);
|
|
7615
7571
|
}
|
|
7616
7572
|
);
|
|
7617
|
-
var DialogContentNonModal =
|
|
7573
|
+
var DialogContentNonModal = React31.forwardRef(
|
|
7618
7574
|
(props, forwardedRef) => {
|
|
7619
7575
|
const context = useDialogContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7620
|
-
const hasInteractedOutsideRef =
|
|
7621
|
-
const hasPointerDownOutsideRef =
|
|
7576
|
+
const hasInteractedOutsideRef = React31.useRef(false);
|
|
7577
|
+
const hasPointerDownOutsideRef = React31.useRef(false);
|
|
7622
7578
|
return /* @__PURE__ */ jsx14(
|
|
7623
7579
|
DialogContentImpl,
|
|
7624
7580
|
{
|
|
@@ -7654,11 +7610,11 @@ var DialogContentNonModal = React32.forwardRef(
|
|
|
7654
7610
|
);
|
|
7655
7611
|
}
|
|
7656
7612
|
);
|
|
7657
|
-
var DialogContentImpl =
|
|
7613
|
+
var DialogContentImpl = React31.forwardRef(
|
|
7658
7614
|
(props, forwardedRef) => {
|
|
7659
7615
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
7660
7616
|
const context = useDialogContext(CONTENT_NAME3, __scopeDialog);
|
|
7661
|
-
const contentRef =
|
|
7617
|
+
const contentRef = React31.useRef(null);
|
|
7662
7618
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
7663
7619
|
useFocusGuards();
|
|
7664
7620
|
return /* @__PURE__ */ jsxs2(Fragment5, { children: [
|
|
@@ -7693,7 +7649,7 @@ var DialogContentImpl = React32.forwardRef(
|
|
|
7693
7649
|
}
|
|
7694
7650
|
);
|
|
7695
7651
|
var TITLE_NAME = "DialogTitle";
|
|
7696
|
-
var DialogTitle =
|
|
7652
|
+
var DialogTitle = React31.forwardRef(
|
|
7697
7653
|
(props, forwardedRef) => {
|
|
7698
7654
|
const { __scopeDialog, ...titleProps } = props;
|
|
7699
7655
|
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
@@ -7702,7 +7658,7 @@ var DialogTitle = React32.forwardRef(
|
|
|
7702
7658
|
);
|
|
7703
7659
|
DialogTitle.displayName = TITLE_NAME;
|
|
7704
7660
|
var DESCRIPTION_NAME = "DialogDescription";
|
|
7705
|
-
var DialogDescription =
|
|
7661
|
+
var DialogDescription = React31.forwardRef(
|
|
7706
7662
|
(props, forwardedRef) => {
|
|
7707
7663
|
const { __scopeDialog, ...descriptionProps } = props;
|
|
7708
7664
|
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
@@ -7711,7 +7667,7 @@ var DialogDescription = React32.forwardRef(
|
|
|
7711
7667
|
);
|
|
7712
7668
|
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
7713
7669
|
var CLOSE_NAME = "DialogClose";
|
|
7714
|
-
var DialogClose =
|
|
7670
|
+
var DialogClose = React31.forwardRef(
|
|
7715
7671
|
(props, forwardedRef) => {
|
|
7716
7672
|
const { __scopeDialog, ...closeProps } = props;
|
|
7717
7673
|
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
@@ -7743,7 +7699,7 @@ var TitleWarning = ({ titleId }) => {
|
|
|
7743
7699
|
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
7744
7700
|
|
|
7745
7701
|
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
7746
|
-
|
|
7702
|
+
React31.useEffect(() => {
|
|
7747
7703
|
if (titleId) {
|
|
7748
7704
|
const hasTitle = document.getElementById(titleId);
|
|
7749
7705
|
if (!hasTitle) console.error(MESSAGE);
|
|
@@ -7755,7 +7711,7 @@ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
|
7755
7711
|
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
7756
7712
|
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
7757
7713
|
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
7758
|
-
|
|
7714
|
+
React31.useEffect(() => {
|
|
7759
7715
|
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
7760
7716
|
if (descriptionId && describedById) {
|
|
7761
7717
|
const hasDescription = document.getElementById(descriptionId);
|
|
@@ -7885,7 +7841,7 @@ var DialogPortal2 = ({
|
|
|
7885
7841
|
}) => {
|
|
7886
7842
|
return /* @__PURE__ */ jsx15(Portal2, { ...props, children: /* @__PURE__ */ jsx15("div", { className: "au-root", children }) });
|
|
7887
7843
|
};
|
|
7888
|
-
var DialogOverlay2 =
|
|
7844
|
+
var DialogOverlay2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
7889
7845
|
Overlay,
|
|
7890
7846
|
{
|
|
7891
7847
|
ref,
|
|
@@ -7897,7 +7853,7 @@ var DialogOverlay2 = React33.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
7897
7853
|
}
|
|
7898
7854
|
));
|
|
7899
7855
|
DialogOverlay2.displayName = Overlay.displayName;
|
|
7900
|
-
var DialogContent2 =
|
|
7856
|
+
var DialogContent2 = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs3(DialogPortal2, { children: [
|
|
7901
7857
|
/* @__PURE__ */ jsx15(DialogOverlay2, {}),
|
|
7902
7858
|
/* @__PURE__ */ jsxs3(
|
|
7903
7859
|
Content3,
|
|
@@ -7947,7 +7903,7 @@ var DialogFooter = ({
|
|
|
7947
7903
|
}
|
|
7948
7904
|
);
|
|
7949
7905
|
DialogFooter.displayName = "DialogFooter";
|
|
7950
|
-
var DialogTitle2 =
|
|
7906
|
+
var DialogTitle2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
7951
7907
|
Title,
|
|
7952
7908
|
{
|
|
7953
7909
|
ref,
|
|
@@ -7959,7 +7915,7 @@ var DialogTitle2 = React33.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
7959
7915
|
}
|
|
7960
7916
|
));
|
|
7961
7917
|
DialogTitle2.displayName = Title.displayName;
|
|
7962
|
-
var DialogDescription2 =
|
|
7918
|
+
var DialogDescription2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
7963
7919
|
Description,
|
|
7964
7920
|
{
|
|
7965
7921
|
ref,
|
|
@@ -8122,10 +8078,10 @@ var getCheckoutContent = (checkoutResult) => {
|
|
|
8122
8078
|
};
|
|
8123
8079
|
|
|
8124
8080
|
// src/libraries/react/components/ui/accordion.tsx
|
|
8125
|
-
import * as
|
|
8081
|
+
import * as React33 from "react";
|
|
8126
8082
|
import { jsx as jsx17, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
8127
8083
|
var Accordion2 = Root2;
|
|
8128
|
-
var AccordionItem2 =
|
|
8084
|
+
var AccordionItem2 = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
8129
8085
|
Item,
|
|
8130
8086
|
{
|
|
8131
8087
|
ref,
|
|
@@ -8134,7 +8090,7 @@ var AccordionItem2 = React34.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
8134
8090
|
}
|
|
8135
8091
|
));
|
|
8136
8092
|
AccordionItem2.displayName = "AccordionItem";
|
|
8137
|
-
var AccordionTrigger2 =
|
|
8093
|
+
var AccordionTrigger2 = React33.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx17(Header, { className: "au-flex", children: /* @__PURE__ */ jsxs5(
|
|
8138
8094
|
Trigger2,
|
|
8139
8095
|
{
|
|
8140
8096
|
ref,
|
|
@@ -8150,7 +8106,7 @@ var AccordionTrigger2 = React34.forwardRef(({ className, children, ...props }, r
|
|
|
8150
8106
|
}
|
|
8151
8107
|
) }));
|
|
8152
8108
|
AccordionTrigger2.displayName = Trigger2.displayName;
|
|
8153
|
-
var AccordionContent2 =
|
|
8109
|
+
var AccordionContent2 = React33.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
8154
8110
|
Content2,
|
|
8155
8111
|
{
|
|
8156
8112
|
ref,
|
|
@@ -8162,13 +8118,13 @@ var AccordionContent2 = React34.forwardRef(({ className, children, ...props }, r
|
|
|
8162
8118
|
AccordionContent2.displayName = Content2.displayName;
|
|
8163
8119
|
|
|
8164
8120
|
// src/libraries/react/components/ui/popover.tsx
|
|
8165
|
-
import * as
|
|
8121
|
+
import * as React39 from "react";
|
|
8166
8122
|
|
|
8167
8123
|
// ../node_modules/.pnpm/@radix-ui+react-popover@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19._2d5qzp46jobjymz4ef7wsko3em/node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
8168
|
-
import * as
|
|
8124
|
+
import * as React38 from "react";
|
|
8169
8125
|
|
|
8170
8126
|
// ../node_modules/.pnpm/@radix-ui+react-popper@1.2.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1._rx2bw5lpqtxi7ji4o3uo2rsuda/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
8171
|
-
import * as
|
|
8127
|
+
import * as React37 from "react";
|
|
8172
8128
|
|
|
8173
8129
|
// ../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
8174
8130
|
var sides = ["top", "right", "bottom", "left"];
|
|
@@ -9769,7 +9725,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
9769
9725
|
};
|
|
9770
9726
|
|
|
9771
9727
|
// ../node_modules/.pnpm/@floating-ui+react-dom@2.1.5_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
9772
|
-
import * as
|
|
9728
|
+
import * as React34 from "react";
|
|
9773
9729
|
import { useLayoutEffect as useLayoutEffect4 } from "react";
|
|
9774
9730
|
import * as ReactDOM3 from "react-dom";
|
|
9775
9731
|
var isClient = typeof document !== "undefined";
|
|
@@ -9835,7 +9791,7 @@ function roundByDPR(element, value) {
|
|
|
9835
9791
|
return Math.round(value * dpr) / dpr;
|
|
9836
9792
|
}
|
|
9837
9793
|
function useLatestRef(value) {
|
|
9838
|
-
const ref =
|
|
9794
|
+
const ref = React34.useRef(value);
|
|
9839
9795
|
index(() => {
|
|
9840
9796
|
ref.current = value;
|
|
9841
9797
|
});
|
|
@@ -9858,7 +9814,7 @@ function useFloating(options) {
|
|
|
9858
9814
|
whileElementsMounted,
|
|
9859
9815
|
open
|
|
9860
9816
|
} = options;
|
|
9861
|
-
const [data, setData] =
|
|
9817
|
+
const [data, setData] = React34.useState({
|
|
9862
9818
|
x: 0,
|
|
9863
9819
|
y: 0,
|
|
9864
9820
|
strategy,
|
|
@@ -9866,19 +9822,19 @@ function useFloating(options) {
|
|
|
9866
9822
|
middlewareData: {},
|
|
9867
9823
|
isPositioned: false
|
|
9868
9824
|
});
|
|
9869
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
9825
|
+
const [latestMiddleware, setLatestMiddleware] = React34.useState(middleware);
|
|
9870
9826
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
9871
9827
|
setLatestMiddleware(middleware);
|
|
9872
9828
|
}
|
|
9873
|
-
const [_reference, _setReference] =
|
|
9874
|
-
const [_floating, _setFloating] =
|
|
9875
|
-
const setReference =
|
|
9829
|
+
const [_reference, _setReference] = React34.useState(null);
|
|
9830
|
+
const [_floating, _setFloating] = React34.useState(null);
|
|
9831
|
+
const setReference = React34.useCallback((node) => {
|
|
9876
9832
|
if (node !== referenceRef.current) {
|
|
9877
9833
|
referenceRef.current = node;
|
|
9878
9834
|
_setReference(node);
|
|
9879
9835
|
}
|
|
9880
9836
|
}, []);
|
|
9881
|
-
const setFloating =
|
|
9837
|
+
const setFloating = React34.useCallback((node) => {
|
|
9882
9838
|
if (node !== floatingRef.current) {
|
|
9883
9839
|
floatingRef.current = node;
|
|
9884
9840
|
_setFloating(node);
|
|
@@ -9886,14 +9842,14 @@ function useFloating(options) {
|
|
|
9886
9842
|
}, []);
|
|
9887
9843
|
const referenceEl = externalReference || _reference;
|
|
9888
9844
|
const floatingEl = externalFloating || _floating;
|
|
9889
|
-
const referenceRef =
|
|
9890
|
-
const floatingRef =
|
|
9891
|
-
const dataRef =
|
|
9845
|
+
const referenceRef = React34.useRef(null);
|
|
9846
|
+
const floatingRef = React34.useRef(null);
|
|
9847
|
+
const dataRef = React34.useRef(data);
|
|
9892
9848
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
9893
9849
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
9894
9850
|
const platformRef = useLatestRef(platform2);
|
|
9895
9851
|
const openRef = useLatestRef(open);
|
|
9896
|
-
const update =
|
|
9852
|
+
const update = React34.useCallback(() => {
|
|
9897
9853
|
if (!referenceRef.current || !floatingRef.current) {
|
|
9898
9854
|
return;
|
|
9899
9855
|
}
|
|
@@ -9931,7 +9887,7 @@ function useFloating(options) {
|
|
|
9931
9887
|
}));
|
|
9932
9888
|
}
|
|
9933
9889
|
}, [open]);
|
|
9934
|
-
const isMountedRef =
|
|
9890
|
+
const isMountedRef = React34.useRef(false);
|
|
9935
9891
|
index(() => {
|
|
9936
9892
|
isMountedRef.current = true;
|
|
9937
9893
|
return () => {
|
|
@@ -9948,17 +9904,17 @@ function useFloating(options) {
|
|
|
9948
9904
|
update();
|
|
9949
9905
|
}
|
|
9950
9906
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
9951
|
-
const refs =
|
|
9907
|
+
const refs = React34.useMemo(() => ({
|
|
9952
9908
|
reference: referenceRef,
|
|
9953
9909
|
floating: floatingRef,
|
|
9954
9910
|
setReference,
|
|
9955
9911
|
setFloating
|
|
9956
9912
|
}), [setReference, setFloating]);
|
|
9957
|
-
const elements =
|
|
9913
|
+
const elements = React34.useMemo(() => ({
|
|
9958
9914
|
reference: referenceEl,
|
|
9959
9915
|
floating: floatingEl
|
|
9960
9916
|
}), [referenceEl, floatingEl]);
|
|
9961
|
-
const floatingStyles =
|
|
9917
|
+
const floatingStyles = React34.useMemo(() => {
|
|
9962
9918
|
const initialStyles = {
|
|
9963
9919
|
position: strategy,
|
|
9964
9920
|
left: 0,
|
|
@@ -9984,7 +9940,7 @@ function useFloating(options) {
|
|
|
9984
9940
|
top: y
|
|
9985
9941
|
};
|
|
9986
9942
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
9987
|
-
return
|
|
9943
|
+
return React34.useMemo(() => ({
|
|
9988
9944
|
...data,
|
|
9989
9945
|
update,
|
|
9990
9946
|
refs,
|
|
@@ -10053,10 +10009,10 @@ var arrow3 = (options, deps) => ({
|
|
|
10053
10009
|
});
|
|
10054
10010
|
|
|
10055
10011
|
// ../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1.1_7w5nl47bqckuaclutkvv5v7iie/node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
10056
|
-
import * as
|
|
10012
|
+
import * as React35 from "react";
|
|
10057
10013
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
10058
10014
|
var NAME = "Arrow";
|
|
10059
|
-
var Arrow =
|
|
10015
|
+
var Arrow = React35.forwardRef((props, forwardedRef) => {
|
|
10060
10016
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
10061
10017
|
return /* @__PURE__ */ jsx18(
|
|
10062
10018
|
Primitive.svg,
|
|
@@ -10075,9 +10031,9 @@ Arrow.displayName = NAME;
|
|
|
10075
10031
|
var Root4 = Arrow;
|
|
10076
10032
|
|
|
10077
10033
|
// ../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
10078
|
-
import * as
|
|
10034
|
+
import * as React36 from "react";
|
|
10079
10035
|
function useSize(element) {
|
|
10080
|
-
const [size4, setSize] =
|
|
10036
|
+
const [size4, setSize] = React36.useState(void 0);
|
|
10081
10037
|
useLayoutEffect2(() => {
|
|
10082
10038
|
if (element) {
|
|
10083
10039
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -10118,18 +10074,18 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
|
10118
10074
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
10119
10075
|
var Popper = (props) => {
|
|
10120
10076
|
const { __scopePopper, children } = props;
|
|
10121
|
-
const [anchor, setAnchor] =
|
|
10077
|
+
const [anchor, setAnchor] = React37.useState(null);
|
|
10122
10078
|
return /* @__PURE__ */ jsx19(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
10123
10079
|
};
|
|
10124
10080
|
Popper.displayName = POPPER_NAME;
|
|
10125
10081
|
var ANCHOR_NAME = "PopperAnchor";
|
|
10126
|
-
var PopperAnchor =
|
|
10082
|
+
var PopperAnchor = React37.forwardRef(
|
|
10127
10083
|
(props, forwardedRef) => {
|
|
10128
10084
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
10129
10085
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
10130
|
-
const ref =
|
|
10086
|
+
const ref = React37.useRef(null);
|
|
10131
10087
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10132
|
-
|
|
10088
|
+
React37.useEffect(() => {
|
|
10133
10089
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
10134
10090
|
});
|
|
10135
10091
|
return virtualRef ? null : /* @__PURE__ */ jsx19(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
@@ -10138,7 +10094,7 @@ var PopperAnchor = React38.forwardRef(
|
|
|
10138
10094
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
10139
10095
|
var CONTENT_NAME4 = "PopperContent";
|
|
10140
10096
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME4);
|
|
10141
|
-
var PopperContent =
|
|
10097
|
+
var PopperContent = React37.forwardRef(
|
|
10142
10098
|
(props, forwardedRef) => {
|
|
10143
10099
|
const {
|
|
10144
10100
|
__scopePopper,
|
|
@@ -10157,9 +10113,9 @@ var PopperContent = React38.forwardRef(
|
|
|
10157
10113
|
...contentProps
|
|
10158
10114
|
} = props;
|
|
10159
10115
|
const context = usePopperContext(CONTENT_NAME4, __scopePopper);
|
|
10160
|
-
const [content, setContent] =
|
|
10116
|
+
const [content, setContent] = React37.useState(null);
|
|
10161
10117
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
10162
|
-
const [arrow4, setArrow] =
|
|
10118
|
+
const [arrow4, setArrow] = React37.useState(null);
|
|
10163
10119
|
const arrowSize = useSize(arrow4);
|
|
10164
10120
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
10165
10121
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -10221,7 +10177,7 @@ var PopperContent = React38.forwardRef(
|
|
|
10221
10177
|
const arrowX = middlewareData.arrow?.x;
|
|
10222
10178
|
const arrowY = middlewareData.arrow?.y;
|
|
10223
10179
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
10224
|
-
const [contentZIndex, setContentZIndex] =
|
|
10180
|
+
const [contentZIndex, setContentZIndex] = React37.useState();
|
|
10225
10181
|
useLayoutEffect2(() => {
|
|
10226
10182
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
10227
10183
|
}, [content]);
|
|
@@ -10287,7 +10243,7 @@ var OPPOSITE_SIDE = {
|
|
|
10287
10243
|
bottom: "top",
|
|
10288
10244
|
left: "right"
|
|
10289
10245
|
};
|
|
10290
|
-
var PopperArrow =
|
|
10246
|
+
var PopperArrow = React37.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
10291
10247
|
const { __scopePopper, ...arrowProps } = props;
|
|
10292
10248
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
10293
10249
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -10396,8 +10352,8 @@ var Popover = (props) => {
|
|
|
10396
10352
|
modal = false
|
|
10397
10353
|
} = props;
|
|
10398
10354
|
const popperScope = usePopperScope(__scopePopover);
|
|
10399
|
-
const triggerRef =
|
|
10400
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
10355
|
+
const triggerRef = React38.useRef(null);
|
|
10356
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React38.useState(false);
|
|
10401
10357
|
const [open, setOpen] = useControllableState({
|
|
10402
10358
|
prop: openProp,
|
|
10403
10359
|
defaultProp: defaultOpen ?? false,
|
|
@@ -10412,10 +10368,10 @@ var Popover = (props) => {
|
|
|
10412
10368
|
triggerRef,
|
|
10413
10369
|
open,
|
|
10414
10370
|
onOpenChange: setOpen,
|
|
10415
|
-
onOpenToggle:
|
|
10371
|
+
onOpenToggle: React38.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
10416
10372
|
hasCustomAnchor,
|
|
10417
|
-
onCustomAnchorAdd:
|
|
10418
|
-
onCustomAnchorRemove:
|
|
10373
|
+
onCustomAnchorAdd: React38.useCallback(() => setHasCustomAnchor(true), []),
|
|
10374
|
+
onCustomAnchorRemove: React38.useCallback(() => setHasCustomAnchor(false), []),
|
|
10419
10375
|
modal,
|
|
10420
10376
|
children
|
|
10421
10377
|
}
|
|
@@ -10423,13 +10379,13 @@ var Popover = (props) => {
|
|
|
10423
10379
|
};
|
|
10424
10380
|
Popover.displayName = POPOVER_NAME;
|
|
10425
10381
|
var ANCHOR_NAME2 = "PopoverAnchor";
|
|
10426
|
-
var PopoverAnchor =
|
|
10382
|
+
var PopoverAnchor = React38.forwardRef(
|
|
10427
10383
|
(props, forwardedRef) => {
|
|
10428
10384
|
const { __scopePopover, ...anchorProps } = props;
|
|
10429
10385
|
const context = usePopoverContext(ANCHOR_NAME2, __scopePopover);
|
|
10430
10386
|
const popperScope = usePopperScope(__scopePopover);
|
|
10431
10387
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
10432
|
-
|
|
10388
|
+
React38.useEffect(() => {
|
|
10433
10389
|
onCustomAnchorAdd();
|
|
10434
10390
|
return () => onCustomAnchorRemove();
|
|
10435
10391
|
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
@@ -10438,7 +10394,7 @@ var PopoverAnchor = React39.forwardRef(
|
|
|
10438
10394
|
);
|
|
10439
10395
|
PopoverAnchor.displayName = ANCHOR_NAME2;
|
|
10440
10396
|
var TRIGGER_NAME4 = "PopoverTrigger";
|
|
10441
|
-
var PopoverTrigger =
|
|
10397
|
+
var PopoverTrigger = React38.forwardRef(
|
|
10442
10398
|
(props, forwardedRef) => {
|
|
10443
10399
|
const { __scopePopover, ...triggerProps } = props;
|
|
10444
10400
|
const context = usePopoverContext(TRIGGER_NAME4, __scopePopover);
|
|
@@ -10472,7 +10428,7 @@ var PopoverPortal = (props) => {
|
|
|
10472
10428
|
};
|
|
10473
10429
|
PopoverPortal.displayName = PORTAL_NAME3;
|
|
10474
10430
|
var CONTENT_NAME5 = "PopoverContent";
|
|
10475
|
-
var PopoverContent =
|
|
10431
|
+
var PopoverContent = React38.forwardRef(
|
|
10476
10432
|
(props, forwardedRef) => {
|
|
10477
10433
|
const portalContext = usePortalContext2(CONTENT_NAME5, props.__scopePopover);
|
|
10478
10434
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -10482,13 +10438,13 @@ var PopoverContent = React39.forwardRef(
|
|
|
10482
10438
|
);
|
|
10483
10439
|
PopoverContent.displayName = CONTENT_NAME5;
|
|
10484
10440
|
var Slot3 = createSlot("PopoverContent.RemoveScroll");
|
|
10485
|
-
var PopoverContentModal =
|
|
10441
|
+
var PopoverContentModal = React38.forwardRef(
|
|
10486
10442
|
(props, forwardedRef) => {
|
|
10487
10443
|
const context = usePopoverContext(CONTENT_NAME5, props.__scopePopover);
|
|
10488
|
-
const contentRef =
|
|
10444
|
+
const contentRef = React38.useRef(null);
|
|
10489
10445
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
10490
|
-
const isRightClickOutsideRef =
|
|
10491
|
-
|
|
10446
|
+
const isRightClickOutsideRef = React38.useRef(false);
|
|
10447
|
+
React38.useEffect(() => {
|
|
10492
10448
|
const content = contentRef.current;
|
|
10493
10449
|
if (content) return hideOthers(content);
|
|
10494
10450
|
}, []);
|
|
@@ -10522,11 +10478,11 @@ var PopoverContentModal = React39.forwardRef(
|
|
|
10522
10478
|
) });
|
|
10523
10479
|
}
|
|
10524
10480
|
);
|
|
10525
|
-
var PopoverContentNonModal =
|
|
10481
|
+
var PopoverContentNonModal = React38.forwardRef(
|
|
10526
10482
|
(props, forwardedRef) => {
|
|
10527
10483
|
const context = usePopoverContext(CONTENT_NAME5, props.__scopePopover);
|
|
10528
|
-
const hasInteractedOutsideRef =
|
|
10529
|
-
const hasPointerDownOutsideRef =
|
|
10484
|
+
const hasInteractedOutsideRef = React38.useRef(false);
|
|
10485
|
+
const hasPointerDownOutsideRef = React38.useRef(false);
|
|
10530
10486
|
return /* @__PURE__ */ jsx20(
|
|
10531
10487
|
PopoverContentImpl,
|
|
10532
10488
|
{
|
|
@@ -10562,7 +10518,7 @@ var PopoverContentNonModal = React39.forwardRef(
|
|
|
10562
10518
|
);
|
|
10563
10519
|
}
|
|
10564
10520
|
);
|
|
10565
|
-
var PopoverContentImpl =
|
|
10521
|
+
var PopoverContentImpl = React38.forwardRef(
|
|
10566
10522
|
(props, forwardedRef) => {
|
|
10567
10523
|
const {
|
|
10568
10524
|
__scopePopover,
|
|
@@ -10626,7 +10582,7 @@ var PopoverContentImpl = React39.forwardRef(
|
|
|
10626
10582
|
}
|
|
10627
10583
|
);
|
|
10628
10584
|
var CLOSE_NAME2 = "PopoverClose";
|
|
10629
|
-
var PopoverClose =
|
|
10585
|
+
var PopoverClose = React38.forwardRef(
|
|
10630
10586
|
(props, forwardedRef) => {
|
|
10631
10587
|
const { __scopePopover, ...closeProps } = props;
|
|
10632
10588
|
const context = usePopoverContext(CLOSE_NAME2, __scopePopover);
|
|
@@ -10643,7 +10599,7 @@ var PopoverClose = React39.forwardRef(
|
|
|
10643
10599
|
);
|
|
10644
10600
|
PopoverClose.displayName = CLOSE_NAME2;
|
|
10645
10601
|
var ARROW_NAME2 = "PopoverArrow";
|
|
10646
|
-
var PopoverArrow =
|
|
10602
|
+
var PopoverArrow = React38.forwardRef(
|
|
10647
10603
|
(props, forwardedRef) => {
|
|
10648
10604
|
const { __scopePopover, ...arrowProps } = props;
|
|
10649
10605
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -10662,7 +10618,7 @@ var Content22 = PopoverContent;
|
|
|
10662
10618
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
10663
10619
|
var Popover2 = Root23;
|
|
10664
10620
|
var PopoverTrigger2 = Trigger4;
|
|
10665
|
-
var PopoverContent2 =
|
|
10621
|
+
var PopoverContent2 = React39.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
10666
10622
|
Content22,
|
|
10667
10623
|
{
|
|
10668
10624
|
ref,
|
|
@@ -10678,9 +10634,9 @@ var PopoverContent2 = React40.forwardRef(({ className, align = "center", sideOff
|
|
|
10678
10634
|
PopoverContent2.displayName = Content22.displayName;
|
|
10679
10635
|
|
|
10680
10636
|
// src/libraries/react/components/ui/input.tsx
|
|
10681
|
-
import * as
|
|
10637
|
+
import * as React40 from "react";
|
|
10682
10638
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10683
|
-
var Input =
|
|
10639
|
+
var Input = React40.forwardRef(
|
|
10684
10640
|
({ className, type, onClick, ...props }, ref) => {
|
|
10685
10641
|
return /* @__PURE__ */ jsx23(
|
|
10686
10642
|
"input",
|
|
@@ -10712,7 +10668,7 @@ var formatCurrency = ({
|
|
|
10712
10668
|
function CheckoutDialog(params) {
|
|
10713
10669
|
const { attach } = useCustomer();
|
|
10714
10670
|
const [checkoutResult, setCheckoutResult] = useState17(params?.checkoutResult);
|
|
10715
|
-
|
|
10671
|
+
useEffect19(() => {
|
|
10716
10672
|
if (params.checkoutResult) {
|
|
10717
10673
|
setCheckoutResult(params.checkoutResult);
|
|
10718
10674
|
}
|
|
@@ -11082,20 +11038,20 @@ function PaywallDialog(params) {
|
|
|
11082
11038
|
}
|
|
11083
11039
|
|
|
11084
11040
|
// src/libraries/react/components/pricing-table/pricing-table-synced.tsx
|
|
11085
|
-
import
|
|
11041
|
+
import React45 from "react";
|
|
11086
11042
|
import { createContext as createContext5, useContext as useContext6, useState as useState19 } from "react";
|
|
11087
11043
|
|
|
11088
11044
|
// src/libraries/react/components/ui/switch.tsx
|
|
11089
|
-
import * as
|
|
11045
|
+
import * as React44 from "react";
|
|
11090
11046
|
|
|
11091
11047
|
// ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1._mh2w7rehnd5adfujfuln6l4w5m/node_modules/@radix-ui/react-switch/dist/index.mjs
|
|
11092
|
-
import * as
|
|
11048
|
+
import * as React43 from "react";
|
|
11093
11049
|
|
|
11094
11050
|
// ../node_modules/.pnpm/@radix-ui+react-use-previous@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
|
11095
|
-
import * as
|
|
11051
|
+
import * as React42 from "react";
|
|
11096
11052
|
function usePrevious(value) {
|
|
11097
|
-
const ref =
|
|
11098
|
-
return
|
|
11053
|
+
const ref = React42.useRef({ value, previous: value });
|
|
11054
|
+
return React42.useMemo(() => {
|
|
11099
11055
|
if (ref.current.value !== value) {
|
|
11100
11056
|
ref.current.previous = ref.current.value;
|
|
11101
11057
|
ref.current.value = value;
|
|
@@ -11109,7 +11065,7 @@ import { jsx as jsx26, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
|
11109
11065
|
var SWITCH_NAME = "Switch";
|
|
11110
11066
|
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
|
11111
11067
|
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
11112
|
-
var Switch =
|
|
11068
|
+
var Switch = React43.forwardRef(
|
|
11113
11069
|
(props, forwardedRef) => {
|
|
11114
11070
|
const {
|
|
11115
11071
|
__scopeSwitch,
|
|
@@ -11123,9 +11079,9 @@ var Switch = React44.forwardRef(
|
|
|
11123
11079
|
form,
|
|
11124
11080
|
...switchProps
|
|
11125
11081
|
} = props;
|
|
11126
|
-
const [button, setButton] =
|
|
11082
|
+
const [button, setButton] = React43.useState(null);
|
|
11127
11083
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
11128
|
-
const hasConsumerStoppedPropagationRef =
|
|
11084
|
+
const hasConsumerStoppedPropagationRef = React43.useRef(false);
|
|
11129
11085
|
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
11130
11086
|
const [checked, setChecked] = useControllableState({
|
|
11131
11087
|
prop: checkedProp,
|
|
@@ -11175,7 +11131,7 @@ var Switch = React44.forwardRef(
|
|
|
11175
11131
|
);
|
|
11176
11132
|
Switch.displayName = SWITCH_NAME;
|
|
11177
11133
|
var THUMB_NAME = "SwitchThumb";
|
|
11178
|
-
var SwitchThumb =
|
|
11134
|
+
var SwitchThumb = React43.forwardRef(
|
|
11179
11135
|
(props, forwardedRef) => {
|
|
11180
11136
|
const { __scopeSwitch, ...thumbProps } = props;
|
|
11181
11137
|
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
|
@@ -11192,7 +11148,7 @@ var SwitchThumb = React44.forwardRef(
|
|
|
11192
11148
|
);
|
|
11193
11149
|
SwitchThumb.displayName = THUMB_NAME;
|
|
11194
11150
|
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
|
11195
|
-
var SwitchBubbleInput =
|
|
11151
|
+
var SwitchBubbleInput = React43.forwardRef(
|
|
11196
11152
|
({
|
|
11197
11153
|
__scopeSwitch,
|
|
11198
11154
|
control,
|
|
@@ -11200,11 +11156,11 @@ var SwitchBubbleInput = React44.forwardRef(
|
|
|
11200
11156
|
bubbles = true,
|
|
11201
11157
|
...props
|
|
11202
11158
|
}, forwardedRef) => {
|
|
11203
|
-
const ref =
|
|
11159
|
+
const ref = React43.useRef(null);
|
|
11204
11160
|
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
11205
11161
|
const prevChecked = usePrevious(checked);
|
|
11206
11162
|
const controlSize = useSize(control);
|
|
11207
|
-
|
|
11163
|
+
React43.useEffect(() => {
|
|
11208
11164
|
const input = ref.current;
|
|
11209
11165
|
if (!input) return;
|
|
11210
11166
|
const inputProto = window.HTMLInputElement.prototype;
|
|
@@ -11249,7 +11205,7 @@ var Thumb = SwitchThumb;
|
|
|
11249
11205
|
|
|
11250
11206
|
// src/libraries/react/components/ui/switch.tsx
|
|
11251
11207
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
11252
|
-
var Switch2 =
|
|
11208
|
+
var Switch2 = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
11253
11209
|
Root5,
|
|
11254
11210
|
{
|
|
11255
11211
|
className: cn(
|
|
@@ -11592,7 +11548,7 @@ var PricingFeatureList = ({
|
|
|
11592
11548
|
)) })
|
|
11593
11549
|
] });
|
|
11594
11550
|
};
|
|
11595
|
-
var PricingCardButton =
|
|
11551
|
+
var PricingCardButton = React45.forwardRef(({ recommended, children, className, onClick, ...props }, ref) => {
|
|
11596
11552
|
const [loading, setLoading] = useState19(false);
|
|
11597
11553
|
const handleClick = async (e) => {
|
|
11598
11554
|
setLoading(true);
|