autumn-js 0.1.53 → 0.1.56
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 +30 -34
- package/dist/libraries/backend/better-auth.d.ts +30 -34
- package/dist/libraries/backend/better-auth.js +323 -332
- package/dist/libraries/backend/better-auth.mjs +135 -148
- package/dist/libraries/backend/{chunk-ZDGVHVDZ.mjs → chunk-ABXR5LZJ.mjs} +1 -1
- package/dist/libraries/backend/{chunk-NCUEPWFJ.mjs → chunk-DMVFEWDM.mjs} +7 -7
- package/dist/libraries/backend/{chunk-DUTH4YIQ.mjs → chunk-EGTNCWHG.mjs} +198 -194
- package/dist/libraries/backend/{chunk-IUUFQ3OI.mjs → chunk-IVO6PRCK.mjs} +2 -2
- package/dist/libraries/backend/{chunk-PLADIABP.mjs → chunk-L4HVOC7A.mjs} +1 -1
- package/dist/libraries/backend/{chunk-M3WWSFNX.mjs → chunk-NK3RQBHK.mjs} +1 -1
- package/dist/libraries/backend/{chunk-2TEL6LR5.mjs → chunk-SGEUXFOF.mjs} +1 -1
- package/dist/libraries/backend/{chunk-GUY7BZZ4.mjs → chunk-VSBNSHZS.mjs} +1 -1
- package/dist/libraries/backend/{chunk-OWJBOQNO.mjs → chunk-Z3GRABBZ.mjs} +1 -1
- package/dist/libraries/backend/convex.js +197 -193
- package/dist/libraries/backend/convex.mjs +9 -9
- package/dist/libraries/backend/elysia.js +197 -193
- package/dist/libraries/backend/elysia.mjs +9 -9
- package/dist/libraries/backend/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/express.js +197 -193
- package/dist/libraries/backend/express.mjs +9 -9
- package/dist/libraries/backend/fastify.js +197 -193
- package/dist/libraries/backend/fastify.mjs +9 -9
- package/dist/libraries/backend/hono.js +197 -193
- package/dist/libraries/backend/hono.mjs +9 -9
- package/dist/libraries/backend/index.d.mts +1 -1
- package/dist/libraries/backend/index.d.ts +1 -1
- package/dist/libraries/backend/index.js +197 -193
- package/dist/libraries/backend/index.mjs +9 -9
- package/dist/libraries/backend/next.js +197 -193
- package/dist/libraries/backend/next.mjs +9 -9
- package/dist/libraries/backend/react-router.js +197 -193
- package/dist/libraries/backend/react-router.mjs +9 -9
- package/dist/libraries/backend/{referralTypes-CrOWHkir.d.ts → referralTypes-DFoyaks_.d.ts} +2 -35
- package/dist/libraries/backend/{referralTypes-DUfnhwYC.d.mts → referralTypes-DQvRryhI.d.mts} +2 -35
- package/dist/libraries/backend/remix_dep.js +197 -193
- package/dist/libraries/backend/remix_dep.mjs +9 -9
- package/dist/libraries/backend/routes/analyticsRoutes.js +176 -172
- package/dist/libraries/backend/routes/analyticsRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/backendRouter.js +197 -193
- package/dist/libraries/backend/routes/backendRouter.mjs +9 -9
- package/dist/libraries/backend/routes/entityRoutes.js +173 -169
- package/dist/libraries/backend/routes/entityRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/genRoutes.js +173 -169
- package/dist/libraries/backend/routes/genRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/productRoutes.js +173 -169
- package/dist/libraries/backend/routes/productRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/referralRoutes.js +173 -169
- package/dist/libraries/backend/routes/referralRoutes.mjs +4 -4
- package/dist/libraries/backend/supabase.js +197 -193
- package/dist/libraries/backend/supabase.mjs +9 -9
- package/dist/libraries/backend/tanstack.js +197 -193
- package/dist/libraries/backend/tanstack.mjs +9 -9
- package/dist/libraries/backend/utils/backendRes.js +173 -169
- package/dist/libraries/backend/utils/backendRes.mjs +2 -2
- package/dist/libraries/backend/utils/logBackendErrors.js +1 -1
- package/dist/libraries/backend/utils/logBackendErrors.mjs +1 -1
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
- package/dist/libraries/backend/utils/withAuth.js +173 -169
- package/dist/libraries/backend/utils/withAuth.mjs +3 -3
- package/dist/libraries/react/AutumnContext.d.mts +3 -3
- package/dist/libraries/react/AutumnContext.d.ts +3 -3
- package/dist/libraries/react/AutumnContext.js +183 -179
- package/dist/libraries/react/AutumnContext.mjs +5 -5
- package/dist/libraries/react/BaseAutumnProvider.d.mts +3 -3
- package/dist/libraries/react/BaseAutumnProvider.d.ts +3 -3
- package/dist/libraries/react/BaseAutumnProvider.js +350 -343
- package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
- package/dist/libraries/react/{ReactAutumnClient-DBRxtvI5.d.mts → ReactAutumnClient-Cmh9bCXD.d.mts} +14 -14
- package/dist/libraries/react/{ReactAutumnClient-CgvqoNfl.d.ts → ReactAutumnClient-DgCDKkGy.d.ts} +14 -14
- package/dist/libraries/react/ReactAutumnProvider.js +350 -343
- package/dist/libraries/react/ReactAutumnProvider.mjs +12 -12
- package/dist/libraries/react/{chunk-YJ66CCNM.mjs → chunk-2GEDBGON.mjs} +1 -1
- package/dist/libraries/react/{chunk-OCLWLKH7.mjs → chunk-2LZIBRD4.mjs} +4 -4
- package/dist/libraries/react/{chunk-QCGPJ5QU.mjs → chunk-3J4DYJET.mjs} +1 -1
- package/dist/libraries/react/{chunk-YGXSVTYJ.mjs → chunk-4J4Y5AAU.mjs} +6 -5
- package/dist/libraries/react/{chunk-OGDFDSBE.mjs → chunk-4KLTPVNG.mjs} +6 -6
- package/dist/libraries/react/{chunk-RZVWBOKP.mjs → chunk-4QVAJKUF.mjs} +5 -5
- package/dist/libraries/react/{chunk-3HGWHP3P.mjs → chunk-5TLRC3ED.mjs} +2 -2
- package/dist/libraries/react/{chunk-Y3AJHLDS.mjs → chunk-5YRCYEG5.mjs} +1 -1
- package/dist/libraries/react/{chunk-FO7GCPGQ.mjs → chunk-6XHXGLPY.mjs} +1 -1
- package/dist/libraries/react/{chunk-O4KFMQ34.mjs → chunk-CDWIZ4FK.mjs} +1 -1
- package/dist/libraries/react/{chunk-OQMAGWNJ.mjs → chunk-E27FVCYB.mjs} +2 -2
- package/dist/libraries/react/{chunk-XMJFBTHX.mjs → chunk-ESF5JUVR.mjs} +231 -227
- package/dist/libraries/react/chunk-FZEXI65Y.mjs +64 -0
- package/dist/libraries/react/{chunk-G3FR7GFT.mjs → chunk-G75EJQHU.mjs} +7 -7
- package/dist/libraries/react/{chunk-VMRN7YTJ.mjs → chunk-HGURN5SI.mjs} +17 -11
- package/dist/libraries/react/{chunk-MM4LTFTB.mjs → chunk-I274Z7T2.mjs} +11 -11
- package/dist/libraries/react/{chunk-VFYARVJM.mjs → chunk-I4WOYOTA.mjs} +2 -2
- package/dist/libraries/react/{chunk-3NVSJPCH.mjs → chunk-KHXGA6KQ.mjs} +1 -1
- package/dist/libraries/react/{chunk-ARG7A7DZ.mjs → chunk-KZ7KACBC.mjs} +2 -2
- package/dist/libraries/react/{chunk-74TUFYHU.mjs → chunk-MHAXHLX4.mjs} +7 -7
- package/dist/libraries/react/{chunk-GWG6ISTT.mjs → chunk-O6TLUOYG.mjs} +5 -5
- package/dist/libraries/react/{chunk-VCTI23H4.mjs → chunk-OIFXT3AO.mjs} +6 -4
- package/dist/libraries/react/{chunk-ZOXTGPMK.mjs → chunk-OQUXN5ST.mjs} +1 -1
- package/dist/libraries/react/{chunk-OK35S3KG.mjs → chunk-QAXLT5FQ.mjs} +4 -4
- package/dist/libraries/react/{chunk-2CIFBRPG.mjs → chunk-QEWVBDWJ.mjs} +1 -1
- package/dist/libraries/react/{chunk-UOCXSRR2.mjs → chunk-RVEGBFYS.mjs} +21 -21
- package/dist/libraries/react/chunk-RWPPMNTA.mjs +88 -0
- package/dist/libraries/react/client/ConvexAutumnClient.d.mts +5 -5
- package/dist/libraries/react/client/ConvexAutumnClient.d.ts +5 -5
- package/dist/libraries/react/client/ConvexAutumnClient.js +173 -169
- package/dist/libraries/react/client/ConvexAutumnClient.mjs +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +3 -3
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +3 -3
- package/dist/libraries/react/client/ReactAutumnClient.js +183 -179
- package/dist/libraries/react/client/ReactAutumnClient.mjs +4 -4
- package/dist/libraries/react/client/clientAnalyticsMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientAnalyticsMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientCompMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientCompMethods.d.ts +3 -3
- package/dist/libraries/react/client/clientCusMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientCusMethods.d.ts +3 -3
- package/dist/libraries/react/client/clientEntityMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientEntityMethods.d.ts +3 -3
- package/dist/libraries/react/client/clientGenMethods.d.mts +2 -2
- package/dist/libraries/react/client/clientGenMethods.d.ts +2 -2
- package/dist/libraries/react/client/clientProdMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientProdMethods.d.ts +3 -3
- package/dist/libraries/react/client/clientReferralMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientReferralMethods.d.ts +3 -3
- package/dist/libraries/react/client/types/clientAnalyticsTypes.d.mts +13 -37
- package/dist/libraries/react/client/types/clientAnalyticsTypes.d.ts +13 -37
- package/dist/libraries/react/client/types/clientAnalyticsTypes.js +20 -37
- package/dist/libraries/react/client/types/clientAnalyticsTypes.mjs +17 -32
- package/dist/libraries/react/client/types/clientGenTypes.js +173 -169
- package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +423 -418
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +31 -31
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +320 -316
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +31 -31
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +694 -689
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +31 -31
- package/dist/libraries/react/components/ui/accordion.js +8 -8
- package/dist/libraries/react/components/ui/accordion.mjs +3 -3
- package/dist/libraries/react/components/ui/dialog.js +9 -9
- package/dist/libraries/react/components/ui/dialog.mjs +4 -4
- package/dist/libraries/react/components/ui/popover.js +12 -12
- package/dist/libraries/react/components/ui/popover.mjs +5 -5
- package/dist/libraries/react/components/ui/switch.js +4 -4
- package/dist/libraries/react/components/ui/switch.mjs +3 -3
- package/dist/libraries/react/eventTypes-5iJYcv30.d.mts +26 -0
- package/dist/libraries/react/eventTypes-5iJYcv30.d.ts +26 -0
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +3 -3
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +3 -3
- package/dist/libraries/react/hooks/helpers/handleCheck.js +173 -169
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +3 -3
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +3 -3
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +173 -169
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAggregateEvents.d.mts +4 -1
- package/dist/libraries/react/hooks/useAggregateEvents.d.ts +4 -1
- package/dist/libraries/react/hooks/useAggregateEvents.js +229 -206
- package/dist/libraries/react/hooks/useAggregateEvents.mjs +6 -6
- 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 +217 -205
- package/dist/libraries/react/hooks/useAnalytics.mjs +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.mts +5 -5
- package/dist/libraries/react/hooks/useCustomer.d.ts +5 -5
- package/dist/libraries/react/hooks/useCustomer.js +184 -179
- package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +5 -5
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +5 -5
- package/dist/libraries/react/hooks/useCustomerBase.js +344 -339
- package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
- package/dist/libraries/react/hooks/useEntity.d.mts +1 -1
- package/dist/libraries/react/hooks/useEntity.d.ts +1 -1
- package/dist/libraries/react/hooks/useEntity.js +183 -179
- package/dist/libraries/react/hooks/useEntity.mjs +10 -10
- package/dist/libraries/react/hooks/useEntityBase.d.mts +3 -3
- package/dist/libraries/react/hooks/useEntityBase.d.ts +3 -3
- package/dist/libraries/react/hooks/useEntityBase.js +183 -179
- package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
- package/dist/libraries/react/hooks/useListEvents.d.mts +15 -5
- package/dist/libraries/react/hooks/useListEvents.d.ts +15 -5
- package/dist/libraries/react/hooks/useListEvents.js +257 -211
- package/dist/libraries/react/hooks/useListEvents.mjs +6 -6
- package/dist/libraries/react/hooks/usePaywall.js +183 -179
- package/dist/libraries/react/hooks/usePaywall.mjs +6 -6
- 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 +183 -179
- package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +3 -3
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +3 -3
- package/dist/libraries/react/hooks/usePricingTableBase.js +173 -169
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +3 -3
- package/dist/libraries/react/hooks/useProductsBase.d.ts +3 -3
- package/dist/libraries/react/index.d.mts +265 -256
- package/dist/libraries/react/index.d.ts +265 -256
- package/dist/libraries/react/index.js +1160 -1088
- package/dist/libraries/react/index.mjs +1177 -1105
- package/dist/next/client/NextAutumnClient.d.mts +32 -32
- package/dist/next/client/NextAutumnClient.d.ts +32 -32
- package/dist/next/client/hooks/useCustomer.d.mts +1 -1
- package/dist/next/client/hooks/useCustomer.d.ts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
- package/dist/next/server/cusActions.d.mts +2 -35
- package/dist/next/server/cusActions.d.ts +2 -35
- package/dist/sdk/index.d.mts +34 -51
- package/dist/sdk/index.d.ts +34 -51
- package/dist/sdk/index.js +194 -190
- package/dist/sdk/index.mjs +192 -188
- package/dist/utils/{chunk-WNUBT3GZ.mjs → chunk-EG37DNU2.mjs} +1 -1
- package/dist/utils/encryptUtils.js +173 -169
- package/dist/utils/encryptUtils.mjs +173 -169
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.mjs +1 -1
- package/package.json +1 -1
- package/dist/libraries/react/chunk-AEWKNTLD.mjs +0 -48
- package/dist/libraries/react/chunk-VTZUF5OC.mjs +0 -47
- package/dist/libraries/react/eventTypes-MwzIb0X5.d.mts +0 -9
- package/dist/libraries/react/eventTypes-MwzIb0X5.d.ts +0 -9
|
@@ -25,54 +25,6 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
25
25
|
// src/styles/global.css
|
|
26
26
|
styleInject('.au-root *,\n.au-root ::before,\n.au-root ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n.au-root ::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n*:where(.au-root, .au-root *),\n:where(.au-root, .au-root *)::before,\n:where(.au-root, .au-root *)::after {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: #e5e7eb;\n}\n:where(.au-root, .au-root *)::before,\n:where(.au-root, .au-root *)::after {\n --tw-content: "";\n}\n.au-root {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n font-feature-settings: normal;\n font-variation-settings: normal;\n -webkit-tap-highlight-color: transparent;\n}\n.au-root {\n margin: 0;\n line-height: inherit;\n}\nhr:where(.au-root, .au-root *) {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\nabbr:where([title]):where(.au-root, .au-root *) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\nh1:where(.au-root, .au-root *),\nh2:where(.au-root, .au-root *),\nh3:where(.au-root, .au-root *),\nh4:where(.au-root, .au-root *),\nh5:where(.au-root, .au-root *),\nh6:where(.au-root, .au-root *) {\n font-size: inherit;\n font-weight: inherit;\n}\na:where(.au-root, .au-root *) {\n color: inherit;\n text-decoration: inherit;\n}\nb:where(.au-root, .au-root *),\nstrong:where(.au-root, .au-root *) {\n font-weight: bolder;\n}\ncode:where(.au-root, .au-root *),\nkbd:where(.au-root, .au-root *),\nsamp:where(.au-root, .au-root *),\npre:where(.au-root, .au-root *) {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n font-feature-settings: normal;\n font-variation-settings: normal;\n font-size: 1em;\n}\nsmall:where(.au-root, .au-root *) {\n font-size: 80%;\n}\nsub:where(.au-root, .au-root *),\nsup:where(.au-root, .au-root *) {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsub:where(.au-root, .au-root *) {\n bottom: -0.25em;\n}\nsup:where(.au-root, .au-root *) {\n top: -0.5em;\n}\ntable:where(.au-root, .au-root *) {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\nbutton:where(.au-root, .au-root *),\ninput:where(.au-root, .au-root *),\noptgroup:where(.au-root, .au-root *),\nselect:where(.au-root, .au-root *),\ntextarea:where(.au-root, .au-root *) {\n font-family: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n padding: 0;\n}\nbutton:where(.au-root, .au-root *),\nselect:where(.au-root, .au-root *) {\n text-transform: none;\n}\nbutton:where(.au-root, .au-root *),\ninput:where([type=button]):where(.au-root, .au-root *),\ninput:where([type=reset]):where(.au-root, .au-root *),\ninput:where([type=submit]):where(.au-root, .au-root *) {\n -webkit-appearance: button;\n background-color: transparent;\n background-image: none;\n}\n:-moz-focusring:where(.au-root, .au-root *) {\n outline: auto;\n}\n:-moz-ui-invalid:where(.au-root, .au-root *) {\n box-shadow: none;\n}\nprogress:where(.au-root, .au-root *) {\n vertical-align: baseline;\n}\n:where(.au-root, .au-root *) ::-webkit-inner-spin-button,\n:where(.au-root, .au-root *) ::-webkit-outer-spin-button {\n height: auto;\n}\n[type=search]:where(.au-root, .au-root *) {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n:where(.au-root, .au-root *) ::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n:where(.au-root, .au-root *) ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\nsummary:where(.au-root, .au-root *) {\n display: list-item;\n}\nblockquote:where(.au-root, .au-root *),\ndl:where(.au-root, .au-root *),\ndd:where(.au-root, .au-root *),\nh1:where(.au-root, .au-root *),\nh2:where(.au-root, .au-root *),\nh3:where(.au-root, .au-root *),\nh4:where(.au-root, .au-root *),\nh5:where(.au-root, .au-root *),\nh6:where(.au-root, .au-root *),\nhr:where(.au-root, .au-root *),\nfigure:where(.au-root, .au-root *),\np:where(.au-root, .au-root *),\npre:where(.au-root, .au-root *) {\n margin: 0;\n}\nfieldset:where(.au-root, .au-root *) {\n margin: 0;\n padding: 0;\n}\nlegend:where(.au-root, .au-root *) {\n padding: 0;\n}\nol:where(.au-root, .au-root *),\nul:where(.au-root, .au-root *),\nmenu:where(.au-root, .au-root *) {\n list-style: none;\n margin: 0;\n padding: 0;\n}\ndialog:where(.au-root, .au-root *) {\n padding: 0;\n}\ntextarea:where(.au-root, .au-root *) {\n resize: vertical;\n}\n:where(.au-root, .au-root *) input::-moz-placeholder,\n:where(.au-root, .au-root *) textarea::-moz-placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n:where(.au-root, .au-root *) input::placeholder,\n:where(.au-root, .au-root *) textarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n}\nbutton:where(.au-root, .au-root *),\n[role=button]:where(.au-root, .au-root *) {\n cursor: pointer;\n}\n:disabled:where(.au-root, .au-root *) {\n cursor: default;\n}\nimg:where(.au-root, .au-root *),\nsvg:where(.au-root, .au-root *),\nvideo:where(.au-root, .au-root *),\ncanvas:where(.au-root, .au-root *),\naudio:where(.au-root, .au-root *),\niframe:where(.au-root, .au-root *),\nembed:where(.au-root, .au-root *),\nobject:where(.au-root, .au-root *) {\n display: block;\n vertical-align: middle;\n}\nimg:where(.au-root, .au-root *),\nvideo:where(.au-root, .au-root *) {\n max-width: 100%;\n height: auto;\n}\n[hidden]:where(:not([hidden=until-found])):where(.au-root, .au-root *) {\n display: none;\n}\n.au-root * {\n border-color: hsl(var(--au-border));\n}\n.au-root body {\n background-color: hsl(var(--au-background));\n color: hsl(var(--au-foreground));\n}\n.au-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n.au-pointer-events-none {\n pointer-events: none;\n}\n.au-fixed {\n position: fixed;\n}\n.au-absolute {\n position: absolute;\n}\n.au-relative {\n position: relative;\n}\n.au-inset-0 {\n inset: 0px;\n}\n.au-left-\\[50\\%\\] {\n left: 50%;\n}\n.au-right-4 {\n right: 1rem;\n}\n.au-right-\\[-1px\\] {\n right: -1px;\n}\n.au-top-4 {\n top: 1rem;\n}\n.au-top-\\[-1px\\] {\n top: -1px;\n}\n.au-top-\\[50\\%\\] {\n top: 50%;\n}\n.au-z-50 {\n z-index: 50;\n}\n.au-z-\\[9999\\] {\n z-index: 9999;\n}\n.au-my-0 {\n margin-top: 0px;\n margin-bottom: 0px;\n}\n.au-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.au-mb-0 {\n margin-bottom: 0px;\n}\n.au-mb-1 {\n margin-bottom: 0.25rem;\n}\n.au-mb-2 {\n margin-bottom: 0.5rem;\n}\n.au-mb-4 {\n margin-bottom: 1rem;\n}\n.au-mb-6 {\n margin-bottom: 1.5rem;\n}\n.au-mb-8 {\n margin-bottom: 2rem;\n}\n.au-mt-0\\.5 {\n margin-top: 0.125rem;\n}\n.au-mt-1 {\n margin-top: 0.25rem;\n}\n.au-mt-2 {\n margin-top: 0.5rem;\n}\n.au-mt-4 {\n margin-top: 1rem;\n}\n.au-line-clamp-2 {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n.au-block {\n display: block;\n}\n.au-flex {\n display: flex;\n}\n.au-inline-flex {\n display: inline-flex;\n}\n.au-grid {\n display: grid;\n}\n.\\!au-h-3 {\n height: 0.75rem !important;\n}\n.\\!au-h-4 {\n height: 1rem !important;\n}\n.\\!au-h-7 {\n height: 1.75rem !important;\n}\n.au-h-10 {\n height: 2.5rem;\n}\n.au-h-16 {\n height: 4rem;\n}\n.au-h-4 {\n height: 1rem;\n}\n.au-h-5 {\n height: 1.25rem;\n}\n.au-h-7 {\n height: 1.75rem;\n}\n.au-h-8 {\n height: 2rem;\n}\n.au-h-9 {\n height: 2.25rem;\n}\n.au-h-full {\n height: 100%;\n}\n.\\!au-w-4 {\n width: 1rem !important;\n}\n.au-w-14 {\n width: 3.5rem;\n}\n.au-w-16 {\n width: 4rem;\n}\n.au-w-4 {\n width: 1rem;\n}\n.au-w-72 {\n width: 18rem;\n}\n.au-w-80 {\n width: 20rem;\n}\n.au-w-9 {\n width: 2.25rem;\n}\n.au-w-full {\n width: 100%;\n}\n.au-min-w-0 {\n min-width: 0px;\n}\n.au-min-w-16 {\n min-width: 4rem;\n}\n.au-min-w-20 {\n min-width: 5rem;\n}\n.au-max-w-lg {\n max-width: 32rem;\n}\n.au-max-w-xl {\n max-width: 36rem;\n}\n.au-flex-1 {\n flex: 1 1 0%;\n}\n.au-flex-shrink-0 {\n flex-shrink: 0;\n}\n.au-shrink-0 {\n flex-shrink: 0;\n}\n.au-flex-grow {\n flex-grow: 1;\n}\n.au-origin-\\[--radix-popover-content-transform-origin\\] {\n transform-origin: var(--radix-popover-content-transform-origin);\n}\n.au-translate-x-\\[-50\\%\\] {\n --tw-translate-x: -50%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.au-translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.au-translate-y-\\[130\\%\\] {\n --tw-translate-y: 130%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.au-rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n@keyframes au-spin {\n to {\n transform: rotate(360deg);\n }\n}\n.au-animate-spin {\n animation: au-spin 1s linear infinite;\n}\n.au-cursor-not-allowed {\n cursor: not-allowed;\n}\n.au-cursor-pointer {\n cursor: pointer;\n}\n.au-grid-cols-1 {\n grid-template-columns: repeat(1, minmax(0, 1fr));\n}\n.au-flex-col {\n flex-direction: column;\n}\n.au-flex-col-reverse {\n flex-direction: column-reverse;\n}\n.au-items-start {\n align-items: flex-start;\n}\n.au-items-end {\n align-items: flex-end;\n}\n.au-items-center {\n align-items: center;\n}\n.au-justify-end {\n justify-content: flex-end;\n}\n.au-justify-center {\n justify-content: center;\n}\n.au-justify-between {\n justify-content: space-between;\n}\n.au-gap-0 {\n gap: 0px;\n}\n.au-gap-1 {\n gap: 0.25rem;\n}\n.au-gap-2 {\n gap: 0.5rem;\n}\n.au-gap-4 {\n gap: 1rem;\n}\n.au-gap-x-4 {\n -moz-column-gap: 1rem;\n column-gap: 1rem;\n}\n.au-space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse));\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));\n}\n.au-space-y-1\\.5 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.375rem * var(--tw-space-y-reverse));\n}\n.au-space-y-3 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));\n}\n.au-overflow-hidden {\n overflow: hidden;\n}\n.au-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.au-whitespace-nowrap {\n white-space: nowrap;\n}\n.au-rounded-full {\n border-radius: 9999px;\n}\n.au-rounded-lg {\n border-radius: var(--au-radius);\n}\n.au-rounded-md {\n border-radius: calc(var(--au-radius) - 2px);\n}\n.au-rounded-sm {\n border-radius: calc(var(--au-radius) - 4px);\n}\n.au-rounded-bl-lg {\n border-bottom-left-radius: var(--au-radius);\n}\n.au-border {\n border-width: 1px;\n}\n.au-border-2 {\n border-width: 2px;\n}\n.au-border-y {\n border-top-width: 1px;\n border-bottom-width: 1px;\n}\n.au-border-b {\n border-bottom-width: 1px;\n}\n.au-border-b-0 {\n border-bottom-width: 0px;\n}\n.au-border-t {\n border-top-width: 1px;\n}\n.au-border-none {\n border-style: none;\n}\n.au-border-input {\n border-color: hsl(var(--au-input));\n}\n.au-border-transparent {\n border-color: transparent;\n}\n.au-border-zinc-200 {\n --tw-border-opacity: 1;\n border-color: rgb(228 228 231 / var(--tw-border-opacity, 1));\n}\n.au-bg-accent\\/80 {\n background-color: hsl(var(--au-accent) / 0.8);\n}\n.au-bg-background {\n background-color: hsl(var(--au-background));\n}\n.au-bg-black\\/40 {\n background-color: rgb(0 0 0 / 0.4);\n}\n.au-bg-destructive {\n background-color: hsl(var(--au-destructive));\n}\n.au-bg-popover {\n background-color: hsl(var(--au-popover));\n}\n.au-bg-primary {\n background-color: hsl(var(--au-primary));\n}\n.au-bg-secondary {\n background-color: hsl(var(--au-secondary));\n}\n.au-bg-secondary\\/40 {\n background-color: hsl(var(--au-secondary) / 0.4);\n}\n.au-bg-transparent {\n background-color: transparent;\n}\n.au-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.au-p-0 {\n padding: 0px;\n}\n.au-p-4 {\n padding: 1rem;\n}\n.au-p-6 {\n padding: 1.5rem;\n}\n.\\!au-py-10 {\n padding-top: 2.5rem !important;\n padding-bottom: 2.5rem !important;\n}\n.au-px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n.au-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.au-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.au-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.au-px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n.au-py-0 {\n padding-top: 0px;\n padding-bottom: 0px;\n}\n.au-py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n}\n.au-py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.au-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.au-py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.au-py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.au-py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.au-pb-2 {\n padding-bottom: 0.5rem;\n}\n.au-pb-4 {\n padding-bottom: 1rem;\n}\n.au-pl-6 {\n padding-left: 1.5rem;\n}\n.au-pr-3 {\n padding-right: 0.75rem;\n}\n.au-pt-0 {\n padding-top: 0px;\n}\n.au-pt-3 {\n padding-top: 0.75rem;\n}\n.au-pt-4 {\n padding-top: 1rem;\n}\n.au-text-left {\n text-align: left;\n}\n.au-text-center {\n text-align: center;\n}\n.au-text-end {\n text-align: end;\n}\n.au-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.au-text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.au-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.au-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.au-text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.au-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.au-font-bold {\n font-weight: 700;\n}\n.au-font-light {\n font-weight: 300;\n}\n.au-font-medium {\n font-weight: 500;\n}\n.au-font-normal {\n font-weight: 400;\n}\n.au-font-semibold {\n font-weight: 600;\n}\n.au-leading-none {\n line-height: 1;\n}\n.au-tracking-tight {\n letter-spacing: -0.025em;\n}\n.au-text-destructive-foreground {\n color: hsl(var(--au-destructive-foreground));\n}\n.au-text-foreground {\n color: hsl(var(--au-foreground));\n}\n.au-text-muted-foreground {\n color: hsl(var(--au-muted-foreground));\n}\n.au-text-popover-foreground {\n color: hsl(var(--au-popover-foreground));\n}\n.au-text-primary {\n color: hsl(var(--au-primary));\n}\n.au-text-primary-foreground {\n color: hsl(var(--au-primary-foreground));\n}\n.au-text-secondary-foreground {\n color: hsl(var(--au-secondary-foreground));\n}\n.au-underline-offset-4 {\n text-underline-offset: 4px;\n}\n.au-opacity-70 {\n opacity: 0.7;\n}\n.au-opacity-80 {\n opacity: 0.8;\n}\n.au-shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-inner {\n --tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);\n --tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-md {\n --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-stone-400 {\n --tw-shadow-color: #a8a29e;\n --tw-shadow: var(--tw-shadow-colored);\n}\n.au-outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.au-ring-0 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.au-ring-offset-background {\n --tw-ring-offset-color: hsl(var(--au-background));\n}\n.au-backdrop-blur-sm {\n --tw-backdrop-blur: blur(4px);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n.au-transition {\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke,\n opacity,\n box-shadow,\n transform,\n filter,\n backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-\\[color\\,box-shadow\\] {\n transition-property: color, box-shadow;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-colors {\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-opacity {\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-transform {\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-duration-200 {\n transition-duration: 200ms;\n}\n.au-duration-300 {\n transition-duration: 300ms;\n}\n.au-ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n.au-duration-200 {\n animation-duration: 200ms;\n}\n.au-duration-300 {\n animation-duration: 300ms;\n}\n.au-ease-in-out {\n animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n.au-root {\n --au-background: 0 0% 100%;\n --au-foreground: 240 10% 3.9%;\n --au-card: 0 0% 100%;\n --au-card-foreground: 240 10% 3.9%;\n --au-popover: 0 0% 100%;\n --au-popover-foreground: 240 10% 3.9%;\n --au-primary: 240 5.9% 10%;\n --au-primary-foreground: 0 0% 98%;\n --au-secondary: 240 4.8% 95.9%;\n --au-secondary-foreground: 240 5.9% 10%;\n --au-muted: 240 4.8% 95.9%;\n --au-muted-foreground: 240 3.8% 46.1%;\n --au-accent: 240 4.8% 95.9%;\n --au-accent-foreground: 240 5.9% 10%;\n --au-destructive: 0 84.2% 60.2%;\n --au-destructive-foreground: 0 0% 98%;\n --au-border: 240 5.9% 90%;\n --au-input: 240 5.9% 90%;\n --au-ring: 240 10% 3.9%;\n --au-chart-1: 12 76% 61%;\n --au-chart-2: 173 58% 39%;\n --au-chart-3: 197 37% 24%;\n --au-chart-4: 43 74% 66%;\n --au-chart-5: 27 87% 67%;\n --au-radius: 0.5rem;\n --au-sidebar-background: 0 0% 98%;\n --au-sidebar-foreground: 240 5.3% 26.1%;\n --au-sidebar-primary: 240 5.9% 10%;\n --au-sidebar-primary-foreground: 0 0% 98%;\n --au-sidebar-accent: 240 4.8% 95.9%;\n --au-sidebar-accent-foreground: 240 5.9% 10%;\n --au-sidebar-border: 220 13% 91%;\n --au-sidebar-ring: 217.2 91.2% 59.8%;\n}\n.au-root.dark {\n --au-background: 240 10% 3.9%;\n --au-foreground: 0 0% 98%;\n --au-card: 240 10% 3.9%;\n --au-card-foreground: 0 0% 98%;\n --au-popover: 240 10% 3.9%;\n --au-popover-foreground: 0 0% 98%;\n --au-primary: 0 0% 98%;\n --au-primary-foreground: 240 5.9% 10%;\n --au-secondary: 240 3.7% 15.9%;\n --au-secondary-foreground: 0 0% 98%;\n --au-muted: 240 3.7% 15.9%;\n --au-muted-foreground: 240 5% 64.9%;\n --au-accent: 240 3.7% 15.9%;\n --au-accent-foreground: 0 0% 98%;\n --au-destructive: 0 62.8% 30.6%;\n --au-destructive-foreground: 0 0% 98%;\n --au-border: 240 3.7% 15.9%;\n --au-input: 240 3.7% 15.9%;\n --au-ring: 240 4.9% 83.9%;\n --au-chart-1: 220 70% 50%;\n --au-chart-2: 160 60% 45%;\n --au-chart-3: 30 80% 55%;\n --au-chart-4: 280 65% 60%;\n --au-chart-5: 340 75% 55%;\n --au-sidebar-background: 240 5.9% 10%;\n --au-sidebar-foreground: 240 4.8% 95.9%;\n --au-sidebar-primary: 224.3 76.3% 48%;\n --au-sidebar-primary-foreground: 0 0% 100%;\n --au-sidebar-accent: 240 3.7% 15.9%;\n --au-sidebar-accent-foreground: 240 4.8% 95.9%;\n --au-sidebar-border: 240 3.7% 15.9%;\n --au-sidebar-ring: 217.2 91.2% 59.8%;\n}.dark .au-root {\n --au-background: 240 10% 3.9%;\n --au-foreground: 0 0% 98%;\n --au-card: 240 10% 3.9%;\n --au-card-foreground: 0 0% 98%;\n --au-popover: 240 10% 3.9%;\n --au-popover-foreground: 0 0% 98%;\n --au-primary: 0 0% 98%;\n --au-primary-foreground: 240 5.9% 10%;\n --au-secondary: 240 3.7% 15.9%;\n --au-secondary-foreground: 0 0% 98%;\n --au-muted: 240 3.7% 15.9%;\n --au-muted-foreground: 240 5% 64.9%;\n --au-accent: 240 3.7% 15.9%;\n --au-accent-foreground: 0 0% 98%;\n --au-destructive: 0 62.8% 30.6%;\n --au-destructive-foreground: 0 0% 98%;\n --au-border: 240 3.7% 15.9%;\n --au-input: 240 3.7% 15.9%;\n --au-ring: 240 4.9% 83.9%;\n --au-chart-1: 220 70% 50%;\n --au-chart-2: 160 60% 45%;\n --au-chart-3: 30 80% 55%;\n --au-chart-4: 280 65% 60%;\n --au-chart-5: 340 75% 55%;\n --au-sidebar-background: 240 5.9% 10%;\n --au-sidebar-foreground: 240 4.8% 95.9%;\n --au-sidebar-primary: 224.3 76.3% 48%;\n --au-sidebar-primary-foreground: 0 0% 100%;\n --au-sidebar-accent: 240 3.7% 15.9%;\n --au-sidebar-accent-foreground: 240 4.8% 95.9%;\n --au-sidebar-border: 240 3.7% 15.9%;\n --au-sidebar-ring: 217.2 91.2% 59.8%;\n}\n.selection\\:au-bg-primary *::-moz-selection {\n background-color: hsl(var(--au-primary));\n}\n.selection\\:au-bg-primary *::selection {\n background-color: hsl(var(--au-primary));\n}\n.selection\\:au-text-primary-foreground *::-moz-selection {\n color: hsl(var(--au-primary-foreground));\n}\n.selection\\:au-text-primary-foreground *::selection {\n color: hsl(var(--au-primary-foreground));\n}\n.selection\\:au-bg-primary::-moz-selection {\n background-color: hsl(var(--au-primary));\n}\n.selection\\:au-bg-primary::selection {\n background-color: hsl(var(--au-primary));\n}\n.selection\\:au-text-primary-foreground::-moz-selection {\n color: hsl(var(--au-primary-foreground));\n}\n.selection\\:au-text-primary-foreground::selection {\n color: hsl(var(--au-primary-foreground));\n}\n.file\\:au-inline-flex::file-selector-button {\n display: inline-flex;\n}\n.file\\:au-h-7::file-selector-button {\n height: 1.75rem;\n}\n.file\\:au-border-0::file-selector-button {\n border-width: 0px;\n}\n.file\\:au-bg-transparent::file-selector-button {\n background-color: transparent;\n}\n.file\\:au-text-sm::file-selector-button {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.file\\:au-font-medium::file-selector-button {\n font-weight: 500;\n}\n.file\\:au-text-foreground::file-selector-button {\n color: hsl(var(--au-foreground));\n}\n.placeholder\\:au-text-muted-foreground::-moz-placeholder {\n color: hsl(var(--au-muted-foreground));\n}\n.placeholder\\:au-text-muted-foreground::placeholder {\n color: hsl(var(--au-muted-foreground));\n}\n.hover\\:au-bg-accent:hover {\n background-color: hsl(var(--au-accent));\n}\n.hover\\:au-bg-destructive\\/90:hover {\n background-color: hsl(var(--au-destructive) / 0.9);\n}\n.hover\\:au-bg-primary\\/90:hover {\n background-color: hsl(var(--au-primary) / 0.9);\n}\n.hover\\:au-bg-secondary\\/80:hover {\n background-color: hsl(var(--au-secondary) / 0.8);\n}\n.hover\\:au-bg-zinc-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(244 244 245 / var(--tw-bg-opacity, 1));\n}\n.hover\\:au-text-accent-foreground:hover {\n color: hsl(var(--au-accent-foreground));\n}\n.hover\\:au-text-foreground:hover {\n color: hsl(var(--au-foreground));\n}\n.hover\\:au-underline:hover {\n text-decoration-line: underline;\n}\n.hover\\:au-opacity-100:hover {\n opacity: 1;\n}\n.hover\\:au-brightness-90:hover {\n --tw-brightness: brightness(.9);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.focus\\:au-outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus\\:\\!au-ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000) !important;\n}\n.focus\\:au-ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus\\:au-ring-ring:focus {\n --tw-ring-color: hsl(var(--au-ring));\n}\n.focus\\:au-ring-offset-2:focus {\n --tw-ring-offset-width: 2px;\n}\n.focus-visible\\:au-border-ring:focus-visible {\n border-color: hsl(var(--au-ring));\n}\n.focus-visible\\:au-outline-none:focus-visible {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus-visible\\:au-ring-1:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:au-ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:au-ring-\\[3px\\]:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:au-ring-ring:focus-visible {\n --tw-ring-color: hsl(var(--au-ring));\n}\n.focus-visible\\:au-ring-ring\\/50:focus-visible {\n --tw-ring-color: hsl(var(--au-ring) / 0.5);\n}\n.focus-visible\\:au-ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n.focus-visible\\:au-ring-offset-background:focus-visible {\n --tw-ring-offset-color: hsl(var(--au-background));\n}\n.disabled\\:au-pointer-events-none:disabled {\n pointer-events: none;\n}\n.disabled\\:au-cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n.disabled\\:au-opacity-50:disabled {\n opacity: 0.5;\n}\n.au-group:hover .group-hover\\:au-mt-0 {\n margin-top: 0px;\n}\n.au-group:hover .group-hover\\:au-translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.au-group:hover .group-hover\\:au-translate-y-\\[-130\\%\\] {\n --tw-translate-y: -130%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.data-\\[state\\=checked\\]\\:au-translate-x-4[data-state=checked] {\n --tw-translate-x: 1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.data-\\[state\\=unchecked\\]\\:au-translate-x-0[data-state=unchecked] {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n@keyframes au-accordion-up {\n from {\n height: var(--radix-accordion-content-height);\n }\n to {\n height: 0;\n }\n}\n.data-\\[state\\=closed\\]\\:au-animate-accordion-up[data-state=closed] {\n animation: au-accordion-up 0.2s ease-out;\n}\n@keyframes au-accordion-down {\n from {\n height: 0;\n }\n to {\n height: var(--radix-accordion-content-height);\n }\n}\n.data-\\[state\\=open\\]\\:au-animate-accordion-down[data-state=open] {\n animation: au-accordion-down 0.2s ease-out;\n}\n.data-\\[state\\=checked\\]\\:au-bg-primary[data-state=checked] {\n background-color: hsl(var(--au-primary));\n}\n.data-\\[state\\=open\\]\\:au-bg-accent[data-state=open] {\n background-color: hsl(var(--au-accent));\n}\n.data-\\[state\\=unchecked\\]\\:au-bg-input[data-state=unchecked] {\n background-color: hsl(var(--au-input));\n}\n.data-\\[state\\=open\\]\\:au-text-muted-foreground[data-state=open] {\n color: hsl(var(--au-muted-foreground));\n}\n.data-\\[state\\=open\\]\\:au-animate-in[data-state=open] {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n.data-\\[state\\=closed\\]\\:au-animate-out[data-state=closed] {\n animation-name: exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n}\n.data-\\[state\\=closed\\]\\:au-fade-out-0[data-state=closed] {\n --tw-exit-opacity: 0;\n}\n.data-\\[state\\=open\\]\\:au-fade-in-0[data-state=open] {\n --tw-enter-opacity: 0;\n}\n.data-\\[state\\=closed\\]\\:au-zoom-out-95[data-state=closed] {\n --tw-exit-scale: .95;\n}\n.data-\\[state\\=open\\]\\:au-zoom-in-95[data-state=open] {\n --tw-enter-scale: .95;\n}\n.data-\\[side\\=bottom\\]\\:au-slide-in-from-top-2[data-side=bottom] {\n --tw-enter-translate-y: -0.5rem;\n}\n.data-\\[side\\=left\\]\\:au-slide-in-from-right-2[data-side=left] {\n --tw-enter-translate-x: 0.5rem;\n}\n.data-\\[side\\=right\\]\\:au-slide-in-from-left-2[data-side=right] {\n --tw-enter-translate-x: -0.5rem;\n}\n.data-\\[side\\=top\\]\\:au-slide-in-from-bottom-2[data-side=top] {\n --tw-enter-translate-y: 0.5rem;\n}\n.data-\\[state\\=closed\\]\\:au-slide-out-to-left-1\\/2[data-state=closed] {\n --tw-exit-translate-x: -50%;\n}\n.data-\\[state\\=closed\\]\\:au-slide-out-to-top-\\[48\\%\\][data-state=closed] {\n --tw-exit-translate-y: -48%;\n}\n.data-\\[state\\=open\\]\\:au-slide-in-from-left-1\\/2[data-state=open] {\n --tw-enter-translate-x: -50%;\n}\n.data-\\[state\\=open\\]\\:au-slide-in-from-top-\\[48\\%\\][data-state=open] {\n --tw-enter-translate-y: -48%;\n}\n.dark\\:au-bg-input\\/30:is(.au-dark *) {\n background-color: hsl(var(--au-input) / 0.3);\n}\n.dark\\:au-shadow-zinc-800\\/80:is(.au-dark *) {\n --tw-shadow-color: rgb(39 39 42 / 0.8);\n --tw-shadow: var(--tw-shadow-colored);\n}\n@media (min-width: 640px) {\n .sm\\:au-h-7 {\n height: 1.75rem;\n }\n .sm\\:au-grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .sm\\:au-flex-row {\n flex-direction: row;\n }\n .sm\\:au-items-center {\n align-items: center;\n }\n .sm\\:au-justify-end {\n justify-content: flex-end;\n }\n .sm\\:au-gap-2 {\n gap: 0.5rem;\n }\n .sm\\:au-space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse));\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));\n }\n .sm\\:au-rounded-lg {\n border-radius: var(--au-radius);\n }\n .sm\\:au-pb-0 {\n padding-bottom: 0px;\n }\n .sm\\:au-text-left {\n text-align: left;\n }\n}\n@media (min-width: 768px) {\n .md\\:au-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n}\n@media (min-width: 1024px) {\n .lg\\:au-right-4 {\n right: 1rem;\n }\n .lg\\:au-top-4 {\n top: 1rem;\n }\n .lg\\:au-h-\\[calc\\(100\\%\\+48px\\)\\] {\n height: calc(100% + 48px);\n }\n .lg\\:au--translate-y-12 {\n --tw-translate-y: -3rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n }\n .lg\\:au--translate-y-6 {\n --tw-translate-y: -1.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n }\n .lg\\:au-translate-y-6 {\n --tw-translate-y: 1.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n }\n .lg\\:au-grid-cols-\\[repeat\\(auto-fit\\,minmax\\(200px\\,1fr\\)\\)\\] {\n grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n }\n .lg\\:au-rounded-full {\n border-radius: 9999px;\n }\n .lg\\:au-py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n }\n .lg\\:au-shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n }\n}\n.\\[\\&\\[data-state\\=open\\]\\>svg\\]\\:au-rotate-180[data-state=open] > svg {\n --tw-rotate: 180deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.\\[\\&\\[data-state\\=open\\]_svg\\]\\:au-rotate-0[data-state=open] svg {\n --tw-rotate: 0deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.\\[\\&_svg\\]\\:au-pointer-events-none svg {\n pointer-events: none;\n}\n.\\[\\&_svg\\]\\:au-size-4 svg {\n width: 1rem;\n height: 1rem;\n}\n.\\[\\&_svg\\]\\:au-shrink-0 svg {\n flex-shrink: 0;\n}\n');
|
|
27
27
|
|
|
28
|
-
// src/libraries/react/BaseAutumnProvider.tsx
|
|
29
|
-
import { useRef } from "react";
|
|
30
|
-
import { useState as useState2 } from "react";
|
|
31
|
-
|
|
32
|
-
// src/libraries/react/hooks/helpers/useDialog.tsx
|
|
33
|
-
import { useState, useEffect } from "react";
|
|
34
|
-
var useDialog = (component) => {
|
|
35
|
-
const [dialogProps, setDialogProps] = useState(null);
|
|
36
|
-
const [dialogOpen, setDialogOpen] = useState(false);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (!dialogOpen) {
|
|
39
|
-
setTimeout(() => {
|
|
40
|
-
setDialogProps(null);
|
|
41
|
-
}, 200);
|
|
42
|
-
}
|
|
43
|
-
}, [dialogOpen]);
|
|
44
|
-
return [dialogProps, setDialogProps, dialogOpen, setDialogOpen];
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
48
|
-
import useSWR2 from "swr";
|
|
49
|
-
|
|
50
|
-
// src/sdk/error.ts
|
|
51
|
-
var AutumnError = class _AutumnError extends Error {
|
|
52
|
-
message;
|
|
53
|
-
code;
|
|
54
|
-
constructor(response) {
|
|
55
|
-
super(response.message);
|
|
56
|
-
this.message = response.message;
|
|
57
|
-
this.code = response.code;
|
|
58
|
-
}
|
|
59
|
-
static fromError(error) {
|
|
60
|
-
return new _AutumnError({
|
|
61
|
-
message: error.message || "Unknown error",
|
|
62
|
-
code: error.code || "unknown_error"
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
toString() {
|
|
66
|
-
return `${this.message} (code: ${this.code})`;
|
|
67
|
-
}
|
|
68
|
-
toJSON() {
|
|
69
|
-
return {
|
|
70
|
-
message: this.message,
|
|
71
|
-
code: this.code
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
28
|
// src/sdk/general/genMethods.ts
|
|
77
29
|
var handleCheckout = async ({
|
|
78
30
|
instance,
|
|
@@ -158,6 +110,32 @@ var buildPathWithQuery = (basePath, params) => {
|
|
|
158
110
|
return query ? `${basePath}?${query}` : basePath;
|
|
159
111
|
};
|
|
160
112
|
|
|
113
|
+
// src/sdk/error.ts
|
|
114
|
+
var AutumnError = class _AutumnError extends Error {
|
|
115
|
+
message;
|
|
116
|
+
code;
|
|
117
|
+
constructor(response) {
|
|
118
|
+
super(response.message);
|
|
119
|
+
this.message = response.message;
|
|
120
|
+
this.code = response.code;
|
|
121
|
+
}
|
|
122
|
+
static fromError(error) {
|
|
123
|
+
return new _AutumnError({
|
|
124
|
+
message: error.message || "Unknown error",
|
|
125
|
+
code: error.code || "unknown_error"
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
toString() {
|
|
129
|
+
return `${this.message} (code: ${this.code})`;
|
|
130
|
+
}
|
|
131
|
+
toJSON() {
|
|
132
|
+
return {
|
|
133
|
+
message: this.message,
|
|
134
|
+
code: this.code
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
161
139
|
// src/sdk/customers/cusMethods.ts
|
|
162
140
|
var customerMethods = (instance) => {
|
|
163
141
|
return {
|
|
@@ -401,7 +379,7 @@ var toContainerResult = async ({
|
|
|
401
379
|
|
|
402
380
|
// src/utils/logger.ts
|
|
403
381
|
var getTime = () => {
|
|
404
|
-
|
|
382
|
+
const timeString = (/* @__PURE__ */ new Date()).toISOString();
|
|
405
383
|
return `[${timeString.split("T")[1].split(".")[0]}]`;
|
|
406
384
|
};
|
|
407
385
|
var greaterThanLevel = (level) => {
|
|
@@ -782,6 +760,17 @@ var Autumn = class {
|
|
|
782
760
|
}
|
|
783
761
|
};
|
|
784
762
|
|
|
763
|
+
// src/sdk/customers/cusEnums.ts
|
|
764
|
+
import { z } from "zod/v4";
|
|
765
|
+
var CustomerExpandEnum = z.enum([
|
|
766
|
+
"invoices",
|
|
767
|
+
"rewards",
|
|
768
|
+
"trials_used",
|
|
769
|
+
"entities",
|
|
770
|
+
"referrals",
|
|
771
|
+
"payment_method"
|
|
772
|
+
]);
|
|
773
|
+
|
|
785
774
|
// src/sdk/products/prodEnums.ts
|
|
786
775
|
var ProductItemInterval = /* @__PURE__ */ ((ProductItemInterval2) => {
|
|
787
776
|
ProductItemInterval2["Minute"] = "minute";
|
|
@@ -796,17 +785,6 @@ var ProductItemInterval = /* @__PURE__ */ ((ProductItemInterval2) => {
|
|
|
796
785
|
return ProductItemInterval2;
|
|
797
786
|
})(ProductItemInterval || {});
|
|
798
787
|
|
|
799
|
-
// src/sdk/customers/cusEnums.ts
|
|
800
|
-
import { z } from "zod/v4";
|
|
801
|
-
var CustomerExpandEnum = z.enum([
|
|
802
|
-
"invoices",
|
|
803
|
-
"rewards",
|
|
804
|
-
"trials_used",
|
|
805
|
-
"entities",
|
|
806
|
-
"referrals",
|
|
807
|
-
"payment_method"
|
|
808
|
-
]);
|
|
809
|
-
|
|
810
788
|
// src/sdk/customers/cusTypes.ts
|
|
811
789
|
import { z as z2 } from "zod/v4";
|
|
812
790
|
var CoreCusFeatureSchema = z2.object({
|
|
@@ -874,80 +852,103 @@ var ListCustomersParamsSchema = z2.object({
|
|
|
874
852
|
offset: z2.number().optional()
|
|
875
853
|
});
|
|
876
854
|
|
|
877
|
-
// src/sdk/
|
|
855
|
+
// src/sdk/customers/entities/entTypes.ts
|
|
878
856
|
import { z as z3 } from "zod/v4";
|
|
879
|
-
var
|
|
880
|
-
|
|
881
|
-
feature_id: z3.string()
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
857
|
+
var EntityDataSchema = z3.object({
|
|
858
|
+
name: z3.string().optional(),
|
|
859
|
+
feature_id: z3.string()
|
|
860
|
+
});
|
|
861
|
+
var TransferProductParamsSchema = z3.object({
|
|
862
|
+
from_entity_id: z3.string(),
|
|
863
|
+
to_entity_id: z3.string(),
|
|
864
|
+
product_id: z3.string()
|
|
865
|
+
});
|
|
886
866
|
|
|
887
|
-
// src/sdk/
|
|
867
|
+
// src/sdk/general/pageTypes.ts
|
|
888
868
|
import { z as z4 } from "zod/v4";
|
|
889
|
-
var
|
|
890
|
-
|
|
891
|
-
|
|
869
|
+
var PagePaginationDefaults = {
|
|
870
|
+
Limit: 100,
|
|
871
|
+
MaxLimit: 1e3
|
|
872
|
+
};
|
|
873
|
+
var PagePaginationQuerySchema = z4.object({
|
|
874
|
+
offset: z4.coerce.number().int().min(0).default(0).describe("Number of items to skip"),
|
|
875
|
+
limit: z4.coerce.number().int().min(1).max(PagePaginationDefaults.MaxLimit).default(PagePaginationDefaults.Limit).describe(
|
|
876
|
+
`Number of items to return. Default ${PagePaginationDefaults.Limit}, max ${PagePaginationDefaults.MaxLimit}.`
|
|
877
|
+
)
|
|
892
878
|
});
|
|
893
|
-
var
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
879
|
+
var createPagePaginatedResponseSchema = (itemSchema) => z4.object({
|
|
880
|
+
list: z4.array(itemSchema).describe("Array of items for current page"),
|
|
881
|
+
has_more: z4.boolean().describe("Whether more results exist after this page"),
|
|
882
|
+
offset: z4.number().describe("Current offset position"),
|
|
883
|
+
limit: z4.number().describe("Limit passed in the request"),
|
|
884
|
+
total: z4.number().describe("Total number of items returned in the current page")
|
|
897
885
|
});
|
|
898
886
|
|
|
899
|
-
// src/sdk/
|
|
887
|
+
// src/sdk/events/eventTypes.ts
|
|
900
888
|
import { z as z5 } from "zod/v4";
|
|
901
|
-
var
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
var TrackParamsSchema = z5.object({
|
|
889
|
+
var QueryRangeEnum = z5.enum([
|
|
890
|
+
"24h",
|
|
891
|
+
"7d",
|
|
892
|
+
"30d",
|
|
893
|
+
"90d",
|
|
894
|
+
"last_cycle",
|
|
895
|
+
"1bc",
|
|
896
|
+
"3bc"
|
|
897
|
+
]);
|
|
898
|
+
var BinSizeEnum = z5.enum(["day", "hour"]);
|
|
899
|
+
var QueryParamsSchema = z5.object({
|
|
913
900
|
customer_id: z5.string(),
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
901
|
+
feature_id: z5.string().or(z5.array(z5.string())),
|
|
902
|
+
range: QueryRangeEnum.optional(),
|
|
903
|
+
group_by: z5.string().startsWith("properties.").optional(),
|
|
904
|
+
bin_size: BinSizeEnum.optional(),
|
|
905
|
+
custom_range: z5.object({
|
|
906
|
+
start: z5.number(),
|
|
907
|
+
end: z5.number()
|
|
908
|
+
}).optional()
|
|
922
909
|
});
|
|
923
|
-
var
|
|
924
|
-
id: z5.string(),
|
|
925
|
-
code: z5.string(),
|
|
910
|
+
var EventsListParamsSchema = PagePaginationQuerySchema.extend({
|
|
926
911
|
customer_id: z5.string(),
|
|
927
|
-
feature_id: z5.string().
|
|
928
|
-
|
|
912
|
+
feature_id: z5.string().or(z5.array(z5.string())),
|
|
913
|
+
custom_range: z5.object({
|
|
914
|
+
start: z5.coerce.number().optional(),
|
|
915
|
+
end: z5.coerce.number().optional()
|
|
916
|
+
}).optional()
|
|
929
917
|
});
|
|
930
|
-
var
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
send_event: z5.boolean().optional(),
|
|
938
|
-
with_preview: z5.boolean().optional(),
|
|
939
|
-
entity_data: EntityDataSchema.optional()
|
|
918
|
+
var EventsListItemSchema = z5.object({
|
|
919
|
+
id: z5.string().describe("Event ID (KSUID)"),
|
|
920
|
+
timestamp: z5.number().describe("Event timestamp (epoch milliseconds)"),
|
|
921
|
+
feature_id: z5.string().describe("Name of the event"),
|
|
922
|
+
customer_id: z5.string().describe("Customer identifier"),
|
|
923
|
+
value: z5.number().describe("Event value/count"),
|
|
924
|
+
properties: z5.object({}).describe("Event properties (JSONB)")
|
|
940
925
|
});
|
|
926
|
+
var EventsListResponseSchema = createPagePaginatedResponseSchema(EventsListItemSchema);
|
|
941
927
|
|
|
942
|
-
// src/sdk/
|
|
928
|
+
// src/sdk/features/featureTypes.ts
|
|
943
929
|
import { z as z6 } from "zod/v4";
|
|
944
|
-
var
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
930
|
+
var FeatureType = /* @__PURE__ */ ((FeatureType2) => {
|
|
931
|
+
FeatureType2["Boolean"] = "boolean";
|
|
932
|
+
FeatureType2["SingleUse"] = "single_use";
|
|
933
|
+
FeatureType2["ContinuousUse"] = "continuous_use";
|
|
934
|
+
FeatureType2["CreditSystem"] = "credit_system";
|
|
935
|
+
return FeatureType2;
|
|
936
|
+
})(FeatureType || {});
|
|
937
|
+
var FeatureSchema = z6.object({
|
|
938
|
+
id: z6.string(),
|
|
939
|
+
name: z6.string(),
|
|
940
|
+
type: z6.enum(FeatureType),
|
|
941
|
+
display: z6.object({
|
|
942
|
+
singular: z6.string(),
|
|
943
|
+
plural: z6.string()
|
|
944
|
+
}).nullish(),
|
|
945
|
+
credit_schema: z6.array(
|
|
946
|
+
z6.object({
|
|
947
|
+
metered_feature_id: z6.string(),
|
|
948
|
+
credit_cost: z6.number()
|
|
949
|
+
})
|
|
950
|
+
).nullish(),
|
|
951
|
+
archived: z6.boolean()
|
|
951
952
|
});
|
|
952
953
|
|
|
953
954
|
// src/sdk/general/attachTypes.ts
|
|
@@ -1004,264 +1005,111 @@ var CheckoutParamsSchema = z7.object({
|
|
|
1004
1005
|
new_billing_subscription: z7.boolean().optional()
|
|
1005
1006
|
});
|
|
1006
1007
|
|
|
1007
|
-
// src/sdk/general/
|
|
1008
|
+
// src/sdk/general/checkTypes.ts
|
|
1008
1009
|
import { z as z8 } from "zod/v4";
|
|
1009
|
-
var
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
});
|
|
1017
|
-
var createCursorPaginatedResponseSchema = (itemSchema) => z8.object({
|
|
1018
|
-
list: z8.array(itemSchema),
|
|
1019
|
-
has_more: z8.boolean(),
|
|
1020
|
-
next_cursor: z8.string().nullable()
|
|
1021
|
-
});
|
|
1010
|
+
var CheckFeatureResultSchema = z8.object({
|
|
1011
|
+
allowed: z8.boolean(),
|
|
1012
|
+
feature_id: z8.string(),
|
|
1013
|
+
customer_id: z8.string(),
|
|
1014
|
+
entity_id: z8.string().optional(),
|
|
1015
|
+
required_balance: z8.number()
|
|
1016
|
+
}).extend(CoreCusFeatureSchema.shape);
|
|
1022
1017
|
|
|
1023
|
-
// src/sdk/
|
|
1018
|
+
// src/sdk/general/genTypes.ts
|
|
1024
1019
|
import { z as z9 } from "zod/v4";
|
|
1025
|
-
var
|
|
1026
|
-
"24h",
|
|
1027
|
-
"7d",
|
|
1028
|
-
"30d",
|
|
1029
|
-
"90d",
|
|
1030
|
-
"last_cycle",
|
|
1031
|
-
"1bc",
|
|
1032
|
-
"3bc"
|
|
1033
|
-
]);
|
|
1034
|
-
var BinSizeEnum = z9.enum(["day", "hour"]);
|
|
1035
|
-
var QueryParamsSchema = z9.object({
|
|
1020
|
+
var CancelParamsSchema = z9.object({
|
|
1036
1021
|
customer_id: z9.string(),
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
bin_size: BinSizeEnum.optional(),
|
|
1041
|
-
custom_range: z9.object({
|
|
1042
|
-
start: z9.number(),
|
|
1043
|
-
end: z9.number()
|
|
1044
|
-
}).optional()
|
|
1022
|
+
product_id: z9.string(),
|
|
1023
|
+
entity_id: z9.string().optional(),
|
|
1024
|
+
cancel_immediately: z9.boolean().optional()
|
|
1045
1025
|
});
|
|
1046
|
-
var
|
|
1026
|
+
var CancelResultSchema = z9.object({
|
|
1027
|
+
success: z9.boolean(),
|
|
1047
1028
|
customer_id: z9.string(),
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1029
|
+
product_id: z9.string()
|
|
1030
|
+
});
|
|
1031
|
+
var TrackParamsSchema = z9.object({
|
|
1032
|
+
customer_id: z9.string(),
|
|
1033
|
+
value: z9.number().optional(),
|
|
1034
|
+
feature_id: z9.string().optional(),
|
|
1035
|
+
event_name: z9.string().optional(),
|
|
1036
|
+
entity_id: z9.string().optional(),
|
|
1037
|
+
customer_data: z9.any().optional(),
|
|
1038
|
+
idempotency_key: z9.string().optional(),
|
|
1039
|
+
entity_data: z9.any().optional(),
|
|
1040
|
+
properties: z9.record(z9.string(), z9.any()).optional()
|
|
1041
|
+
});
|
|
1042
|
+
var TrackResultSchema = z9.object({
|
|
1043
|
+
id: z9.string(),
|
|
1044
|
+
code: z9.string(),
|
|
1045
|
+
customer_id: z9.string(),
|
|
1046
|
+
feature_id: z9.string().optional(),
|
|
1047
|
+
event_name: z9.string().optional()
|
|
1053
1048
|
});
|
|
1054
|
-
var
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1049
|
+
var CheckParamsSchema = z9.object({
|
|
1050
|
+
customer_id: z9.string(),
|
|
1051
|
+
feature_id: z9.string().optional(),
|
|
1052
|
+
product_id: z9.string().optional(),
|
|
1053
|
+
entity_id: z9.string().optional(),
|
|
1054
|
+
customer_data: z9.any().optional(),
|
|
1055
|
+
required_balance: z9.number().optional(),
|
|
1056
|
+
send_event: z9.boolean().optional(),
|
|
1057
|
+
with_preview: z9.boolean().optional(),
|
|
1058
|
+
entity_data: EntityDataSchema.optional()
|
|
1061
1059
|
});
|
|
1062
|
-
var EventListResponseSchema = createCursorPaginatedResponseSchema(EventListItemSchema);
|
|
1063
1060
|
|
|
1064
|
-
// src/sdk/
|
|
1061
|
+
// src/sdk/referrals/referralTypes.ts
|
|
1065
1062
|
import { z as z10 } from "zod/v4";
|
|
1066
|
-
var
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
var FeatureSchema = z10.object({
|
|
1074
|
-
id: z10.string(),
|
|
1075
|
-
name: z10.string(),
|
|
1076
|
-
type: z10.enum(FeatureType),
|
|
1077
|
-
display: z10.object({
|
|
1078
|
-
singular: z10.string(),
|
|
1079
|
-
plural: z10.string()
|
|
1080
|
-
}).nullish(),
|
|
1081
|
-
credit_schema: z10.array(
|
|
1082
|
-
z10.object({
|
|
1083
|
-
metered_feature_id: z10.string(),
|
|
1084
|
-
credit_cost: z10.number()
|
|
1085
|
-
})
|
|
1086
|
-
).nullish(),
|
|
1087
|
-
archived: z10.boolean()
|
|
1063
|
+
var CreateReferralCodeParamsSchema = z10.object({
|
|
1064
|
+
customer_id: z10.string(),
|
|
1065
|
+
program_id: z10.string()
|
|
1066
|
+
});
|
|
1067
|
+
var RedeemReferralCodeParamsSchema = z10.object({
|
|
1068
|
+
code: z10.string(),
|
|
1069
|
+
customer_id: z10.string()
|
|
1088
1070
|
});
|
|
1089
1071
|
|
|
1090
|
-
// src/libraries/react/hooks/
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
);
|
|
1106
|
-
if (creditSchema) {
|
|
1107
|
-
let schemaItem = creditSchema.credit_schema?.find(
|
|
1108
|
-
(c) => c.feature_id === featureId
|
|
1109
|
-
);
|
|
1110
|
-
return {
|
|
1111
|
-
cusFeature: creditSchema,
|
|
1112
|
-
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1113
|
-
};
|
|
1072
|
+
// src/libraries/react/hooks/useAggregateEvents.tsx
|
|
1073
|
+
import useSWR from "swr";
|
|
1074
|
+
|
|
1075
|
+
// src/libraries/react/errorUtils/logAuthError.ts
|
|
1076
|
+
var logAuthError = async (response) => {
|
|
1077
|
+
if (response.status === 401) {
|
|
1078
|
+
let clonedResponse = response.clone();
|
|
1079
|
+
let data = await clonedResponse.json();
|
|
1080
|
+
if (data.message.includes("Missing authorization header")) {
|
|
1081
|
+
console.error(`[Autumn] Missing authorization header.
|
|
1082
|
+
|
|
1083
|
+
Use the getBearerToken prop in <AutumnProvider /> to set the authorization header.
|
|
1084
|
+
https://docs.useautumn.com/quickstart/quickstart#5-set-up-autumnprovider`);
|
|
1085
|
+
return true;
|
|
1086
|
+
}
|
|
1114
1087
|
}
|
|
1115
|
-
return
|
|
1116
|
-
cusFeature: customer.features[featureId],
|
|
1117
|
-
requiredBalance
|
|
1118
|
-
};
|
|
1088
|
+
return false;
|
|
1119
1089
|
};
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1090
|
+
|
|
1091
|
+
// src/libraries/react/errorUtils/logFetchError.ts
|
|
1092
|
+
var logFetchError = ({
|
|
1093
|
+
method,
|
|
1094
|
+
backendUrl,
|
|
1095
|
+
path,
|
|
1096
|
+
error
|
|
1123
1097
|
}) => {
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
1129
|
-
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
1130
|
-
}
|
|
1131
|
-
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1098
|
+
console.error(`[Autumn] Fetch failed: ${method} ${backendUrl}${path}
|
|
1099
|
+
|
|
1100
|
+
1. Check that backendUrl in <AutumnProvider/> is correctly set.
|
|
1101
|
+
2. Check that autumnHandler is correctly registered on your backend.`);
|
|
1132
1102
|
};
|
|
1133
|
-
var handleFeatureCheck = ({
|
|
1134
|
-
customer,
|
|
1135
|
-
isEntity,
|
|
1136
|
-
params
|
|
1137
|
-
}) => {
|
|
1138
|
-
let { cusFeature, requiredBalance } = getCusFeature({
|
|
1139
|
-
customer,
|
|
1140
|
-
featureId: params.featureId,
|
|
1141
|
-
...params.requiredBalance ? { requiredBalance: params.requiredBalance } : {}
|
|
1142
|
-
});
|
|
1143
|
-
let allowed = getFeatureAllowed({
|
|
1144
|
-
cusFeature,
|
|
1145
|
-
requiredBalance: requiredBalance ?? 1
|
|
1146
|
-
});
|
|
1147
|
-
let result = {
|
|
1148
|
-
allowed,
|
|
1149
|
-
feature_id: cusFeature?.id ?? params.featureId,
|
|
1150
|
-
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1151
|
-
required_balance: requiredBalance,
|
|
1152
|
-
...cusFeature
|
|
1153
|
-
};
|
|
1154
|
-
if (isEntity) {
|
|
1155
|
-
result.entity_id = customer.id;
|
|
1156
|
-
}
|
|
1157
|
-
try {
|
|
1158
|
-
return CheckFeatureResultSchema.parse(result);
|
|
1159
|
-
} catch (error) {
|
|
1160
|
-
return result;
|
|
1161
|
-
}
|
|
1162
|
-
};
|
|
1163
|
-
var handleProductCheck = ({
|
|
1164
|
-
customer,
|
|
1165
|
-
isEntity,
|
|
1166
|
-
params
|
|
1167
|
-
}) => {
|
|
1168
|
-
let product = customer.products.find((p) => p.id == params.productId);
|
|
1169
|
-
let allowed = product?.status === "active" || product?.status === "trialing";
|
|
1170
|
-
let result = {
|
|
1171
|
-
allowed,
|
|
1172
|
-
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1173
|
-
product_id: params.productId
|
|
1174
|
-
};
|
|
1175
|
-
if (product) {
|
|
1176
|
-
result.status = product.status;
|
|
1177
|
-
}
|
|
1178
|
-
if (isEntity) {
|
|
1179
|
-
result.entity_id = customer.id;
|
|
1180
|
-
}
|
|
1181
|
-
return result;
|
|
1182
|
-
};
|
|
1183
|
-
var openDialog = ({
|
|
1184
|
-
result,
|
|
1185
|
-
params,
|
|
1186
|
-
context
|
|
1187
|
-
}) => {
|
|
1188
|
-
let open = result?.allowed === false && params.dialog && context;
|
|
1189
|
-
if (!open) return;
|
|
1190
|
-
const isInRenderCycle = (() => {
|
|
1191
|
-
const stack = new Error().stack || "";
|
|
1192
|
-
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1193
|
-
})();
|
|
1194
|
-
if (isInRenderCycle) {
|
|
1195
|
-
context.paywallRef.current = {
|
|
1196
|
-
component: params.dialog,
|
|
1197
|
-
open: true,
|
|
1198
|
-
props: params
|
|
1199
|
-
};
|
|
1200
|
-
} else {
|
|
1201
|
-
context.paywallDialog.setComponent(params.dialog);
|
|
1202
|
-
context.paywallDialog.setProps(params);
|
|
1203
|
-
context.paywallDialog.setOpen(true);
|
|
1204
|
-
}
|
|
1205
|
-
};
|
|
1206
|
-
var handleCheck2 = ({
|
|
1207
|
-
customer,
|
|
1208
|
-
isEntity,
|
|
1209
|
-
params,
|
|
1210
|
-
context
|
|
1211
|
-
}) => {
|
|
1212
|
-
if (!customer) {
|
|
1213
|
-
return {
|
|
1214
|
-
data: {
|
|
1215
|
-
allowed: false,
|
|
1216
|
-
feature_id: "",
|
|
1217
|
-
customer_id: "",
|
|
1218
|
-
required_balance: 0
|
|
1219
|
-
},
|
|
1220
|
-
error: null
|
|
1221
|
-
};
|
|
1222
|
-
}
|
|
1223
|
-
if (!params.featureId && !params.productId) {
|
|
1224
|
-
throw new Error("allowed() requires either featureId or productId");
|
|
1225
|
-
}
|
|
1226
|
-
let result;
|
|
1227
|
-
if (params.featureId)
|
|
1228
|
-
result = handleFeatureCheck({ customer, params, isEntity });
|
|
1229
|
-
if (params.productId)
|
|
1230
|
-
result = handleProductCheck({ customer, params, isEntity });
|
|
1231
|
-
return {
|
|
1232
|
-
data: result,
|
|
1233
|
-
error: null
|
|
1234
|
-
};
|
|
1235
|
-
};
|
|
1236
|
-
|
|
1237
|
-
// src/libraries/react/errorUtils/logAuthError.ts
|
|
1238
|
-
var logAuthError = async (response) => {
|
|
1239
|
-
if (response.status === 401) {
|
|
1240
|
-
let clonedResponse = response.clone();
|
|
1241
|
-
let data = await clonedResponse.json();
|
|
1242
|
-
if (data.message.includes("Missing authorization header")) {
|
|
1243
|
-
console.error(`[Autumn] Missing authorization header.
|
|
1244
|
-
|
|
1245
|
-
Use the getBearerToken prop in <AutumnProvider /> to set the authorization header.
|
|
1246
|
-
https://docs.useautumn.com/quickstart/quickstart#5-set-up-autumnprovider`);
|
|
1247
|
-
return true;
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
return false;
|
|
1251
|
-
};
|
|
1252
|
-
|
|
1253
|
-
// src/libraries/react/errorUtils/logFetchError.ts
|
|
1254
|
-
var logFetchError = ({
|
|
1255
|
-
method,
|
|
1256
|
-
backendUrl,
|
|
1257
|
-
path,
|
|
1258
|
-
error
|
|
1259
|
-
}) => {
|
|
1260
|
-
console.error(`[Autumn] Fetch failed: ${method} ${backendUrl}${path}
|
|
1261
1103
|
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
};
|
|
1104
|
+
// src/libraries/react/client/clientAnalyticsMethods.ts
|
|
1105
|
+
async function eventListMethod(params) {
|
|
1106
|
+
const res = await this.post(`${this.prefix}/events/list`, params);
|
|
1107
|
+
return res;
|
|
1108
|
+
}
|
|
1109
|
+
async function eventAggregateMethod(params) {
|
|
1110
|
+
const res = await this.post(`${this.prefix}/events/aggregate`, params);
|
|
1111
|
+
return res;
|
|
1112
|
+
}
|
|
1265
1113
|
|
|
1266
1114
|
// src/libraries/react/client/clientCusMethods.ts
|
|
1267
1115
|
var createCustomerMethod = async ({
|
|
@@ -1365,16 +1213,6 @@ async function redeemCode(params) {
|
|
|
1365
1213
|
return res;
|
|
1366
1214
|
}
|
|
1367
1215
|
|
|
1368
|
-
// src/libraries/react/client/clientAnalyticsMethods.ts
|
|
1369
|
-
async function eventListMethod(params) {
|
|
1370
|
-
const res = await this.post(`${this.prefix}/events/list`, params);
|
|
1371
|
-
return res;
|
|
1372
|
-
}
|
|
1373
|
-
async function eventAggregateMethod(params) {
|
|
1374
|
-
const res = await this.post(`${this.prefix}/events/aggregate`, params);
|
|
1375
|
-
return res;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
1216
|
// src/libraries/react/client/ReactAutumnClient.tsx
|
|
1379
1217
|
var AutumnClient = class {
|
|
1380
1218
|
backendUrl;
|
|
@@ -1620,97 +1458,336 @@ var useAutumnContext = ({
|
|
|
1620
1458
|
return context;
|
|
1621
1459
|
};
|
|
1622
1460
|
|
|
1623
|
-
// src/libraries/react/hooks/
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
return {
|
|
1637
|
-
...product,
|
|
1638
|
-
name: baseProduct.name
|
|
1639
|
-
};
|
|
1640
|
-
}
|
|
1641
|
-
}
|
|
1642
|
-
return product;
|
|
1643
|
-
});
|
|
1644
|
-
}
|
|
1645
|
-
let fetchedProducts = structuredClone(products);
|
|
1646
|
-
let mergedProducts = [];
|
|
1647
|
-
for (const overrideDetails of productDetails) {
|
|
1648
|
-
if (!overrideDetails.id) {
|
|
1649
|
-
let properties = {};
|
|
1650
|
-
let overrideItems2 = overrideDetails.items?.map((item) => ({
|
|
1651
|
-
display: {
|
|
1652
|
-
primary_text: item.primaryText,
|
|
1653
|
-
secondary_text: item.secondaryText
|
|
1654
|
-
}
|
|
1655
|
-
}));
|
|
1656
|
-
let overridePrice2 = overrideDetails.price;
|
|
1657
|
-
if (overrideDetails.price) {
|
|
1658
|
-
properties.is_free = false;
|
|
1659
|
-
overrideItems2 = [
|
|
1660
|
-
{
|
|
1661
|
-
display: {
|
|
1662
|
-
primary_text: overridePrice2?.primaryText,
|
|
1663
|
-
secondary_text: overridePrice2?.secondaryText
|
|
1664
|
-
}
|
|
1665
|
-
},
|
|
1666
|
-
...overrideItems2 || []
|
|
1667
|
-
];
|
|
1668
|
-
}
|
|
1669
|
-
if (!overrideItems2 || overrideItems2.length === 0) {
|
|
1670
|
-
overrideItems2 = [
|
|
1671
|
-
{
|
|
1672
|
-
display: {
|
|
1673
|
-
primary_text: ""
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
];
|
|
1677
|
-
}
|
|
1678
|
-
mergedProducts.push({
|
|
1679
|
-
display: {
|
|
1680
|
-
name: overrideDetails.name,
|
|
1681
|
-
description: overrideDetails.description,
|
|
1682
|
-
button_text: overrideDetails.buttonText,
|
|
1683
|
-
recommend_text: overrideDetails.recommendText,
|
|
1684
|
-
everything_from: overrideDetails.everythingFrom,
|
|
1685
|
-
button_url: overrideDetails.buttonUrl
|
|
1686
|
-
},
|
|
1687
|
-
items: overrideItems2,
|
|
1688
|
-
properties
|
|
1461
|
+
// src/libraries/react/hooks/useAggregateEvents.tsx
|
|
1462
|
+
var useAggregateEvents = (params) => {
|
|
1463
|
+
const context = useAutumnContext({
|
|
1464
|
+
AutumnContext,
|
|
1465
|
+
name: "useAggregateEvents"
|
|
1466
|
+
});
|
|
1467
|
+
const client = context.client;
|
|
1468
|
+
const fetcher = async () => {
|
|
1469
|
+
const res = await client.events.aggregate(params);
|
|
1470
|
+
if (res.error) {
|
|
1471
|
+
const err = new AutumnError({
|
|
1472
|
+
message: res.error.message,
|
|
1473
|
+
code: res.error.code
|
|
1689
1474
|
});
|
|
1690
|
-
|
|
1475
|
+
err.statusCode = res.statusCode;
|
|
1476
|
+
throw err;
|
|
1691
1477
|
}
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1478
|
+
return res.data;
|
|
1479
|
+
};
|
|
1480
|
+
const startDate = params.customRange?.start ? new Date(params.customRange.start).toISOString().slice(0, 13) : void 0;
|
|
1481
|
+
const endDate = params.customRange?.end ? new Date(params.customRange.end).toISOString().slice(0, 13) : void 0;
|
|
1482
|
+
const { data, error, mutate } = useSWR(
|
|
1483
|
+
[
|
|
1484
|
+
"eventAggregate",
|
|
1485
|
+
params.featureId,
|
|
1486
|
+
params.groupBy,
|
|
1487
|
+
params.range,
|
|
1488
|
+
startDate,
|
|
1489
|
+
endDate,
|
|
1490
|
+
params.binSize
|
|
1491
|
+
],
|
|
1492
|
+
fetcher,
|
|
1493
|
+
{
|
|
1494
|
+
dedupingInterval: 2e3,
|
|
1495
|
+
revalidateOnFocus: false,
|
|
1496
|
+
revalidateOnReconnect: false,
|
|
1497
|
+
shouldRetryOnError: (error2) => error2.statusCode === 429,
|
|
1498
|
+
errorRetryCount: 3,
|
|
1499
|
+
...params.swrConfig
|
|
1697
1500
|
}
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1501
|
+
);
|
|
1502
|
+
return {
|
|
1503
|
+
list: data?.list,
|
|
1504
|
+
total: data?.total,
|
|
1505
|
+
isLoading: !error && !data,
|
|
1506
|
+
error,
|
|
1507
|
+
refetch: mutate
|
|
1508
|
+
};
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
// src/libraries/react/hooks/useAnalytics.tsx
|
|
1512
|
+
import useSWR2 from "swr";
|
|
1513
|
+
var useAnalytics = (params) => {
|
|
1514
|
+
const context = useAutumnContext({
|
|
1515
|
+
AutumnContext,
|
|
1516
|
+
name: "useAnalytics"
|
|
1517
|
+
});
|
|
1518
|
+
const client = context.client;
|
|
1519
|
+
const fetcher = async () => {
|
|
1520
|
+
const res = await client.query(params);
|
|
1521
|
+
if (res.error) {
|
|
1522
|
+
const err = new AutumnError({
|
|
1523
|
+
message: res.error.message,
|
|
1524
|
+
code: res.error.code
|
|
1525
|
+
});
|
|
1526
|
+
err.statusCode = res.statusCode;
|
|
1527
|
+
throw err;
|
|
1705
1528
|
}
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1529
|
+
return res.data;
|
|
1530
|
+
};
|
|
1531
|
+
const { data, error, mutate } = useSWR2(
|
|
1532
|
+
["analytics", params.featureId, params.range],
|
|
1533
|
+
fetcher,
|
|
1534
|
+
{
|
|
1535
|
+
refreshInterval: 0,
|
|
1536
|
+
revalidateOnFocus: false,
|
|
1537
|
+
revalidateOnReconnect: false,
|
|
1538
|
+
shouldRetryOnError: (error2) => error2.statusCode === 429,
|
|
1539
|
+
errorRetryCount: 3
|
|
1540
|
+
}
|
|
1541
|
+
);
|
|
1542
|
+
return {
|
|
1543
|
+
data: data?.list,
|
|
1544
|
+
isLoading: !error && !data,
|
|
1545
|
+
error,
|
|
1546
|
+
refetch: mutate
|
|
1547
|
+
};
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1550
|
+
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
1551
|
+
import useSWR4 from "swr";
|
|
1552
|
+
|
|
1553
|
+
// src/libraries/react/hooks/helpers/handleCheck.ts
|
|
1554
|
+
var getCusFeature = ({
|
|
1555
|
+
customer,
|
|
1556
|
+
featureId,
|
|
1557
|
+
requiredBalance = 1
|
|
1558
|
+
}) => {
|
|
1559
|
+
let cusFeature = customer.features[featureId];
|
|
1560
|
+
if (cusFeature && typeof cusFeature.balance === "number" && cusFeature.balance >= requiredBalance) {
|
|
1561
|
+
return {
|
|
1562
|
+
cusFeature,
|
|
1563
|
+
requiredBalance
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
let creditSchema = Object.values(customer.features).find(
|
|
1567
|
+
(f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId)
|
|
1568
|
+
);
|
|
1569
|
+
if (creditSchema) {
|
|
1570
|
+
let schemaItem = creditSchema.credit_schema?.find(
|
|
1571
|
+
(c) => c.feature_id === featureId
|
|
1572
|
+
);
|
|
1573
|
+
return {
|
|
1574
|
+
cusFeature: creditSchema,
|
|
1575
|
+
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1578
|
+
return {
|
|
1579
|
+
cusFeature: customer.features[featureId],
|
|
1580
|
+
requiredBalance
|
|
1581
|
+
};
|
|
1582
|
+
};
|
|
1583
|
+
var getFeatureAllowed = ({
|
|
1584
|
+
cusFeature,
|
|
1585
|
+
requiredBalance
|
|
1586
|
+
}) => {
|
|
1587
|
+
if (!cusFeature) return false;
|
|
1588
|
+
if (cusFeature.type == "static") return true;
|
|
1589
|
+
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
1590
|
+
if (cusFeature.usage_limit) {
|
|
1591
|
+
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
1592
|
+
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
1593
|
+
}
|
|
1594
|
+
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1595
|
+
};
|
|
1596
|
+
var handleFeatureCheck = ({
|
|
1597
|
+
customer,
|
|
1598
|
+
isEntity,
|
|
1599
|
+
params
|
|
1600
|
+
}) => {
|
|
1601
|
+
let { cusFeature, requiredBalance } = getCusFeature({
|
|
1602
|
+
customer,
|
|
1603
|
+
featureId: params.featureId,
|
|
1604
|
+
...params.requiredBalance ? { requiredBalance: params.requiredBalance } : {}
|
|
1605
|
+
});
|
|
1606
|
+
let allowed = getFeatureAllowed({
|
|
1607
|
+
cusFeature,
|
|
1608
|
+
requiredBalance: requiredBalance ?? 1
|
|
1609
|
+
});
|
|
1610
|
+
let result = {
|
|
1611
|
+
allowed,
|
|
1612
|
+
feature_id: cusFeature?.id ?? params.featureId,
|
|
1613
|
+
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1614
|
+
required_balance: requiredBalance,
|
|
1615
|
+
...cusFeature
|
|
1616
|
+
};
|
|
1617
|
+
if (isEntity) {
|
|
1618
|
+
result.entity_id = customer.id;
|
|
1619
|
+
}
|
|
1620
|
+
try {
|
|
1621
|
+
return CheckFeatureResultSchema.parse(result);
|
|
1622
|
+
} catch (error) {
|
|
1623
|
+
return result;
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
var handleProductCheck = ({
|
|
1627
|
+
customer,
|
|
1628
|
+
isEntity,
|
|
1629
|
+
params
|
|
1630
|
+
}) => {
|
|
1631
|
+
let product = customer.products.find((p) => p.id == params.productId);
|
|
1632
|
+
let allowed = product?.status === "active" || product?.status === "trialing";
|
|
1633
|
+
let result = {
|
|
1634
|
+
allowed,
|
|
1635
|
+
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1636
|
+
product_id: params.productId
|
|
1637
|
+
};
|
|
1638
|
+
if (product) {
|
|
1639
|
+
result.status = product.status;
|
|
1640
|
+
}
|
|
1641
|
+
if (isEntity) {
|
|
1642
|
+
result.entity_id = customer.id;
|
|
1643
|
+
}
|
|
1644
|
+
return result;
|
|
1645
|
+
};
|
|
1646
|
+
var openDialog = ({
|
|
1647
|
+
result,
|
|
1648
|
+
params,
|
|
1649
|
+
context
|
|
1650
|
+
}) => {
|
|
1651
|
+
let open = result?.allowed === false && params.dialog && context;
|
|
1652
|
+
if (!open) return;
|
|
1653
|
+
const isInRenderCycle = (() => {
|
|
1654
|
+
const stack = new Error().stack || "";
|
|
1655
|
+
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1656
|
+
})();
|
|
1657
|
+
if (isInRenderCycle) {
|
|
1658
|
+
context.paywallRef.current = {
|
|
1659
|
+
component: params.dialog,
|
|
1660
|
+
open: true,
|
|
1661
|
+
props: params
|
|
1662
|
+
};
|
|
1663
|
+
} else {
|
|
1664
|
+
context.paywallDialog.setComponent(params.dialog);
|
|
1665
|
+
context.paywallDialog.setProps(params);
|
|
1666
|
+
context.paywallDialog.setOpen(true);
|
|
1667
|
+
}
|
|
1668
|
+
};
|
|
1669
|
+
var handleCheck2 = ({
|
|
1670
|
+
customer,
|
|
1671
|
+
isEntity,
|
|
1672
|
+
params,
|
|
1673
|
+
context
|
|
1674
|
+
}) => {
|
|
1675
|
+
if (!customer) {
|
|
1676
|
+
return {
|
|
1677
|
+
data: {
|
|
1678
|
+
allowed: false,
|
|
1679
|
+
feature_id: "",
|
|
1680
|
+
customer_id: "",
|
|
1681
|
+
required_balance: 0
|
|
1682
|
+
},
|
|
1683
|
+
error: null
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
if (!params.featureId && !params.productId) {
|
|
1687
|
+
throw new Error("allowed() requires either featureId or productId");
|
|
1688
|
+
}
|
|
1689
|
+
let result;
|
|
1690
|
+
if (params.featureId)
|
|
1691
|
+
result = handleFeatureCheck({ customer, params, isEntity });
|
|
1692
|
+
if (params.productId)
|
|
1693
|
+
result = handleProductCheck({ customer, params, isEntity });
|
|
1694
|
+
return {
|
|
1695
|
+
data: result,
|
|
1696
|
+
error: null
|
|
1697
|
+
};
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
// src/libraries/react/hooks/usePricingTableBase.tsx
|
|
1701
|
+
import useSWR3 from "swr";
|
|
1702
|
+
var mergeProductDetails = (products, productDetails) => {
|
|
1703
|
+
if (!products) {
|
|
1704
|
+
return null;
|
|
1705
|
+
}
|
|
1706
|
+
if (!productDetails) {
|
|
1707
|
+
return products.map((product) => {
|
|
1708
|
+
if (product.base_variant_id) {
|
|
1709
|
+
let baseProduct = products.find(
|
|
1710
|
+
(p) => p.id === product.base_variant_id
|
|
1711
|
+
);
|
|
1712
|
+
if (baseProduct) {
|
|
1713
|
+
return {
|
|
1714
|
+
...product,
|
|
1715
|
+
name: baseProduct.name
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
return product;
|
|
1720
|
+
});
|
|
1721
|
+
}
|
|
1722
|
+
let fetchedProducts = structuredClone(products);
|
|
1723
|
+
let mergedProducts = [];
|
|
1724
|
+
for (const overrideDetails of productDetails) {
|
|
1725
|
+
if (!overrideDetails.id) {
|
|
1726
|
+
let properties = {};
|
|
1727
|
+
let overrideItems2 = overrideDetails.items?.map((item) => ({
|
|
1728
|
+
display: {
|
|
1729
|
+
primary_text: item.primaryText,
|
|
1730
|
+
secondary_text: item.secondaryText
|
|
1731
|
+
}
|
|
1732
|
+
}));
|
|
1733
|
+
let overridePrice2 = overrideDetails.price;
|
|
1734
|
+
if (overrideDetails.price) {
|
|
1735
|
+
properties.is_free = false;
|
|
1736
|
+
overrideItems2 = [
|
|
1737
|
+
{
|
|
1738
|
+
display: {
|
|
1739
|
+
primary_text: overridePrice2?.primaryText,
|
|
1740
|
+
secondary_text: overridePrice2?.secondaryText
|
|
1741
|
+
}
|
|
1742
|
+
},
|
|
1743
|
+
...overrideItems2 || []
|
|
1744
|
+
];
|
|
1745
|
+
}
|
|
1746
|
+
if (!overrideItems2 || overrideItems2.length === 0) {
|
|
1747
|
+
overrideItems2 = [
|
|
1748
|
+
{
|
|
1749
|
+
display: {
|
|
1750
|
+
primary_text: ""
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
];
|
|
1754
|
+
}
|
|
1755
|
+
mergedProducts.push({
|
|
1756
|
+
display: {
|
|
1757
|
+
name: overrideDetails.name,
|
|
1758
|
+
description: overrideDetails.description,
|
|
1759
|
+
button_text: overrideDetails.buttonText,
|
|
1760
|
+
recommend_text: overrideDetails.recommendText,
|
|
1761
|
+
everything_from: overrideDetails.everythingFrom,
|
|
1762
|
+
button_url: overrideDetails.buttonUrl
|
|
1763
|
+
},
|
|
1764
|
+
items: overrideItems2,
|
|
1765
|
+
properties
|
|
1766
|
+
});
|
|
1767
|
+
continue;
|
|
1768
|
+
}
|
|
1769
|
+
let fetchedProduct = fetchedProducts.find(
|
|
1770
|
+
(p) => p.id === overrideDetails.id
|
|
1771
|
+
);
|
|
1772
|
+
if (!fetchedProduct) {
|
|
1773
|
+
continue;
|
|
1774
|
+
}
|
|
1775
|
+
let displayName = fetchedProduct.name;
|
|
1776
|
+
let baseVariantId = fetchedProduct.base_variant_id;
|
|
1777
|
+
if (baseVariantId) {
|
|
1778
|
+
let baseProduct = fetchedProducts.find((p) => p.id === baseVariantId);
|
|
1779
|
+
if (baseProduct) {
|
|
1780
|
+
displayName = baseProduct.name;
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
displayName = overrideDetails.name || displayName;
|
|
1784
|
+
const originalIsFree = fetchedProduct.properties?.is_free;
|
|
1785
|
+
let overrideProperties = fetchedProduct.properties || {};
|
|
1786
|
+
let overrideItems = overrideDetails.items;
|
|
1787
|
+
let overridePrice = overrideDetails.price;
|
|
1788
|
+
let mergedItems = [];
|
|
1789
|
+
if (overridePrice) {
|
|
1790
|
+
overrideProperties.is_free = false;
|
|
1714
1791
|
if (originalIsFree || overrideItems !== void 0) {
|
|
1715
1792
|
mergedItems.push({
|
|
1716
1793
|
display: {
|
|
@@ -1796,7 +1873,7 @@ var usePricingTableBase = ({
|
|
|
1796
1873
|
});
|
|
1797
1874
|
}
|
|
1798
1875
|
};
|
|
1799
|
-
const { data, error, mutate } =
|
|
1876
|
+
const { data, error, mutate } = useSWR3(
|
|
1800
1877
|
["pricing-table", client.backendUrl],
|
|
1801
1878
|
fetcher,
|
|
1802
1879
|
{ ...defaultSWRConfig }
|
|
@@ -2001,12 +2078,13 @@ var useCustomerBase = ({
|
|
|
2001
2078
|
error,
|
|
2002
2079
|
isLoading,
|
|
2003
2080
|
mutate
|
|
2004
|
-
} =
|
|
2081
|
+
} = useSWR4(queryKey, fetchCustomer, {
|
|
2005
2082
|
// Default to 5 minutes
|
|
2006
2083
|
fallbackData: null,
|
|
2007
2084
|
swrConfig: {
|
|
2008
2085
|
shouldRetryOnError: false,
|
|
2009
2086
|
refreshInterval: 0,
|
|
2087
|
+
dedupingInterval: 2e3,
|
|
2010
2088
|
...params?.swrConfig
|
|
2011
2089
|
}
|
|
2012
2090
|
});
|
|
@@ -2041,6 +2119,236 @@ var useCustomerBase = ({
|
|
|
2041
2119
|
};
|
|
2042
2120
|
};
|
|
2043
2121
|
|
|
2122
|
+
// src/libraries/react/hooks/useCustomer.tsx
|
|
2123
|
+
var useCustomer = (params) => {
|
|
2124
|
+
return useCustomerBase({
|
|
2125
|
+
params,
|
|
2126
|
+
AutumnContext
|
|
2127
|
+
});
|
|
2128
|
+
};
|
|
2129
|
+
|
|
2130
|
+
// src/libraries/react/hooks/useEntityBase.tsx
|
|
2131
|
+
import useSWR5 from "swr";
|
|
2132
|
+
import { useContext as useContext2 } from "react";
|
|
2133
|
+
var useEntityBase = ({
|
|
2134
|
+
entityId,
|
|
2135
|
+
params,
|
|
2136
|
+
AutumnContext: AutumnContext2
|
|
2137
|
+
}) => {
|
|
2138
|
+
const { client } = useContext2(AutumnContext2);
|
|
2139
|
+
const queryKey = ["entity", entityId, params?.expand];
|
|
2140
|
+
const context = useAutumnContext({
|
|
2141
|
+
AutumnContext: AutumnContext2,
|
|
2142
|
+
name: "useEntity"
|
|
2143
|
+
});
|
|
2144
|
+
const fetchEntity = async () => {
|
|
2145
|
+
if (!entityId) {
|
|
2146
|
+
return null;
|
|
2147
|
+
}
|
|
2148
|
+
const { data: data2, error: error2 } = await client.entities.get(entityId, params);
|
|
2149
|
+
if (error2) {
|
|
2150
|
+
throw error2;
|
|
2151
|
+
}
|
|
2152
|
+
if (!data2) {
|
|
2153
|
+
return null;
|
|
2154
|
+
}
|
|
2155
|
+
return data2;
|
|
2156
|
+
};
|
|
2157
|
+
const { data, error, isLoading, mutate } = useSWR5(queryKey, fetchEntity, {
|
|
2158
|
+
fallbackData: null,
|
|
2159
|
+
shouldRetryOnError: false,
|
|
2160
|
+
onErrorRetry: (error2, key, config) => {
|
|
2161
|
+
if (error2.code == "entity_not_found") {
|
|
2162
|
+
return false;
|
|
2163
|
+
}
|
|
2164
|
+
return true;
|
|
2165
|
+
}
|
|
2166
|
+
});
|
|
2167
|
+
const {
|
|
2168
|
+
attach: attachAutumn,
|
|
2169
|
+
cancel: cancelAutumn,
|
|
2170
|
+
track: trackAutumn
|
|
2171
|
+
} = useAutumnBase({ context, client });
|
|
2172
|
+
const check = (params2) => {
|
|
2173
|
+
const result = handleCheck2({ customer: data, params: params2, isEntity: true });
|
|
2174
|
+
openDialog({
|
|
2175
|
+
result: result.data,
|
|
2176
|
+
params: params2,
|
|
2177
|
+
context
|
|
2178
|
+
});
|
|
2179
|
+
return result;
|
|
2180
|
+
};
|
|
2181
|
+
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2182
|
+
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2183
|
+
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2184
|
+
if (!entityId) {
|
|
2185
|
+
return {
|
|
2186
|
+
entity: null,
|
|
2187
|
+
isLoading: false,
|
|
2188
|
+
error: null,
|
|
2189
|
+
refetch: mutate,
|
|
2190
|
+
check,
|
|
2191
|
+
attach,
|
|
2192
|
+
cancel,
|
|
2193
|
+
track
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
return {
|
|
2197
|
+
entity: error ? null : data,
|
|
2198
|
+
isLoading,
|
|
2199
|
+
error,
|
|
2200
|
+
refetch: mutate,
|
|
2201
|
+
check,
|
|
2202
|
+
attach,
|
|
2203
|
+
cancel,
|
|
2204
|
+
track
|
|
2205
|
+
};
|
|
2206
|
+
};
|
|
2207
|
+
|
|
2208
|
+
// src/libraries/react/hooks/useEntity.tsx
|
|
2209
|
+
var useEntity = (entityId, params) => {
|
|
2210
|
+
return useEntityBase({ AutumnContext, entityId, params });
|
|
2211
|
+
};
|
|
2212
|
+
|
|
2213
|
+
// src/libraries/react/hooks/useListEvents.tsx
|
|
2214
|
+
import { useCallback, useState } from "react";
|
|
2215
|
+
import useSWR6 from "swr";
|
|
2216
|
+
var useListEvents = (params) => {
|
|
2217
|
+
const context = useAutumnContext({
|
|
2218
|
+
AutumnContext,
|
|
2219
|
+
name: "useListEvents"
|
|
2220
|
+
});
|
|
2221
|
+
const client = context.client;
|
|
2222
|
+
const limit = params.limit ?? 100;
|
|
2223
|
+
const [page, setPage] = useState(0);
|
|
2224
|
+
const startDate = params.customRange?.start ? new Date(params.customRange.start).toISOString().slice(0, 13) : void 0;
|
|
2225
|
+
const endDate = params.customRange?.end ? new Date(params.customRange.end).toISOString().slice(0, 13) : void 0;
|
|
2226
|
+
const offset4 = page * limit;
|
|
2227
|
+
const fetcher = async () => {
|
|
2228
|
+
const res = await client.events.list({
|
|
2229
|
+
...params,
|
|
2230
|
+
offset: offset4,
|
|
2231
|
+
limit
|
|
2232
|
+
});
|
|
2233
|
+
if (res.error) {
|
|
2234
|
+
const err = new AutumnError({
|
|
2235
|
+
message: res.error.message,
|
|
2236
|
+
code: res.error.code
|
|
2237
|
+
});
|
|
2238
|
+
err.statusCode = res.statusCode;
|
|
2239
|
+
throw err;
|
|
2240
|
+
}
|
|
2241
|
+
return res.data;
|
|
2242
|
+
};
|
|
2243
|
+
const { data, error, mutate, isLoading } = useSWR6(
|
|
2244
|
+
["eventList", params.featureId, startDate, endDate, offset4, limit],
|
|
2245
|
+
fetcher,
|
|
2246
|
+
{
|
|
2247
|
+
dedupingInterval: 2e3,
|
|
2248
|
+
revalidateOnFocus: false,
|
|
2249
|
+
revalidateOnReconnect: false,
|
|
2250
|
+
shouldRetryOnError: (error2) => error2.statusCode === 429,
|
|
2251
|
+
errorRetryCount: 3,
|
|
2252
|
+
...params.swrConfig
|
|
2253
|
+
}
|
|
2254
|
+
);
|
|
2255
|
+
const hasMore = data?.has_more ?? false;
|
|
2256
|
+
const hasPrevious = page > 0;
|
|
2257
|
+
const nextPage = useCallback(() => {
|
|
2258
|
+
if (hasMore) {
|
|
2259
|
+
setPage((p) => p + 1);
|
|
2260
|
+
}
|
|
2261
|
+
}, [hasMore]);
|
|
2262
|
+
const prevPage = useCallback(() => {
|
|
2263
|
+
if (hasPrevious) {
|
|
2264
|
+
setPage((p) => p - 1);
|
|
2265
|
+
}
|
|
2266
|
+
}, [hasPrevious]);
|
|
2267
|
+
const goToPage = useCallback((pageNum) => {
|
|
2268
|
+
setPage(Math.max(0, pageNum));
|
|
2269
|
+
}, []);
|
|
2270
|
+
const resetPagination = useCallback(() => {
|
|
2271
|
+
setPage(0);
|
|
2272
|
+
}, []);
|
|
2273
|
+
return {
|
|
2274
|
+
list: data?.list,
|
|
2275
|
+
hasMore,
|
|
2276
|
+
hasPrevious,
|
|
2277
|
+
page,
|
|
2278
|
+
isLoading,
|
|
2279
|
+
error,
|
|
2280
|
+
refetch: mutate,
|
|
2281
|
+
nextPage,
|
|
2282
|
+
prevPage,
|
|
2283
|
+
goToPage,
|
|
2284
|
+
resetPagination
|
|
2285
|
+
};
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
// src/libraries/react/hooks/usePaywall.tsx
|
|
2289
|
+
import useSWR7 from "swr";
|
|
2290
|
+
var usePaywall = ({
|
|
2291
|
+
featureId,
|
|
2292
|
+
entityId
|
|
2293
|
+
}) => {
|
|
2294
|
+
const context = useAutumnContext({
|
|
2295
|
+
AutumnContext,
|
|
2296
|
+
name: "usePaywall"
|
|
2297
|
+
});
|
|
2298
|
+
const enabled = !!featureId && !!context;
|
|
2299
|
+
const fetcher = async () => {
|
|
2300
|
+
if (!featureId) {
|
|
2301
|
+
return { preview: void 0 };
|
|
2302
|
+
}
|
|
2303
|
+
const { data: data2, error: error2 } = await context.client.check({
|
|
2304
|
+
featureId,
|
|
2305
|
+
withPreview: true
|
|
2306
|
+
});
|
|
2307
|
+
if (error2) throw error2;
|
|
2308
|
+
return data2;
|
|
2309
|
+
};
|
|
2310
|
+
const queryKey = [`check`, featureId, entityId];
|
|
2311
|
+
const { data, error, isLoading } = useSWR7(queryKey, fetcher, {
|
|
2312
|
+
refreshInterval: 0,
|
|
2313
|
+
enabled
|
|
2314
|
+
});
|
|
2315
|
+
return {
|
|
2316
|
+
data: data?.preview,
|
|
2317
|
+
error,
|
|
2318
|
+
isLoading
|
|
2319
|
+
};
|
|
2320
|
+
};
|
|
2321
|
+
|
|
2322
|
+
// src/libraries/react/hooks/usePricingTable.tsx
|
|
2323
|
+
var usePricingTable = (params) => {
|
|
2324
|
+
const context = useAutumnContext({
|
|
2325
|
+
AutumnContext,
|
|
2326
|
+
name: "usePricingTable"
|
|
2327
|
+
});
|
|
2328
|
+
return usePricingTableBase({
|
|
2329
|
+
client: context.client,
|
|
2330
|
+
params
|
|
2331
|
+
});
|
|
2332
|
+
};
|
|
2333
|
+
|
|
2334
|
+
// src/libraries/react/BaseAutumnProvider.tsx
|
|
2335
|
+
import { useRef, useState as useState3 } from "react";
|
|
2336
|
+
|
|
2337
|
+
// src/libraries/react/hooks/helpers/useDialog.tsx
|
|
2338
|
+
import { useState as useState2, useEffect } from "react";
|
|
2339
|
+
var useDialog = (component) => {
|
|
2340
|
+
const [dialogProps, setDialogProps] = useState2(null);
|
|
2341
|
+
const [dialogOpen, setDialogOpen] = useState2(false);
|
|
2342
|
+
useEffect(() => {
|
|
2343
|
+
if (!dialogOpen) {
|
|
2344
|
+
setTimeout(() => {
|
|
2345
|
+
setDialogProps(null);
|
|
2346
|
+
}, 200);
|
|
2347
|
+
}
|
|
2348
|
+
}, [dialogOpen]);
|
|
2349
|
+
return [dialogProps, setDialogProps, dialogOpen, setDialogOpen];
|
|
2350
|
+
};
|
|
2351
|
+
|
|
2044
2352
|
// src/libraries/react/BaseAutumnProvider.tsx
|
|
2045
2353
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2046
2354
|
function BaseAutumnProvider({
|
|
@@ -2048,7 +2356,7 @@ function BaseAutumnProvider({
|
|
|
2048
2356
|
children,
|
|
2049
2357
|
AutumnContext: AutumnContext2
|
|
2050
2358
|
}) {
|
|
2051
|
-
const [components, setComponents] =
|
|
2359
|
+
const [components, setComponents] = useState3({});
|
|
2052
2360
|
const [paywallProps, setPaywallProps, paywallOpen, setPaywallOpen] = useDialog(components.paywallDialog);
|
|
2053
2361
|
const [
|
|
2054
2362
|
productChangeProps,
|
|
@@ -2056,9 +2364,12 @@ function BaseAutumnProvider({
|
|
|
2056
2364
|
productChangeOpen,
|
|
2057
2365
|
setProductChangeOpen
|
|
2058
2366
|
] = useDialog(components.productChangeDialog);
|
|
2059
|
-
useCustomerBase({
|
|
2367
|
+
useCustomerBase({
|
|
2368
|
+
client,
|
|
2369
|
+
params: { errorOnNotFound: false }
|
|
2370
|
+
});
|
|
2060
2371
|
const paywallRef = useRef(null);
|
|
2061
|
-
const [refresh, setRefresh] =
|
|
2372
|
+
const [refresh, setRefresh] = useState3(0);
|
|
2062
2373
|
return /* @__PURE__ */ jsxs(
|
|
2063
2374
|
AutumnContext2.Provider,
|
|
2064
2375
|
{
|
|
@@ -2391,381 +2702,142 @@ var ConvexAutumnClient = class {
|
|
|
2391
2702
|
error: new AutumnError({
|
|
2392
2703
|
message: error.message,
|
|
2393
2704
|
code: "convex_action_failed"
|
|
2394
|
-
})
|
|
2395
|
-
};
|
|
2396
|
-
}
|
|
2397
|
-
},
|
|
2398
|
-
redeemCode: async (args) => {
|
|
2399
|
-
try {
|
|
2400
|
-
const result = await this.convex.action(
|
|
2401
|
-
this.convexApi.redeemReferralCode,
|
|
2402
|
-
args
|
|
2403
|
-
);
|
|
2404
|
-
return result;
|
|
2405
|
-
} catch (error) {
|
|
2406
|
-
return {
|
|
2407
|
-
data: null,
|
|
2408
|
-
error: new AutumnError({
|
|
2409
|
-
message: error.message,
|
|
2410
|
-
code: "convex_action_failed"
|
|
2411
|
-
})
|
|
2412
|
-
};
|
|
2413
|
-
}
|
|
2414
|
-
}
|
|
2415
|
-
};
|
|
2416
|
-
products = {
|
|
2417
|
-
list: async () => {
|
|
2418
|
-
try {
|
|
2419
|
-
const result = await this.convex.action(
|
|
2420
|
-
this.convexApi.listProducts,
|
|
2421
|
-
{}
|
|
2422
|
-
);
|
|
2423
|
-
return result;
|
|
2424
|
-
} catch (error) {
|
|
2425
|
-
return {
|
|
2426
|
-
data: null,
|
|
2427
|
-
error: new AutumnError({
|
|
2428
|
-
message: error.message,
|
|
2429
|
-
code: "convex_action_failed"
|
|
2430
|
-
})
|
|
2431
|
-
};
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
};
|
|
2435
|
-
events = {
|
|
2436
|
-
list: async (params) => {
|
|
2437
|
-
try {
|
|
2438
|
-
const result = await this.convex.action(
|
|
2439
|
-
this.convexApi.listEvents,
|
|
2440
|
-
params
|
|
2441
|
-
);
|
|
2442
|
-
return result;
|
|
2443
|
-
} catch (error) {
|
|
2444
|
-
return {
|
|
2445
|
-
data: null,
|
|
2446
|
-
error: new AutumnError({
|
|
2447
|
-
message: error.message,
|
|
2448
|
-
code: "convex_action_failed"
|
|
2449
|
-
})
|
|
2450
|
-
};
|
|
2451
|
-
}
|
|
2452
|
-
},
|
|
2453
|
-
aggregate: async (params) => {
|
|
2454
|
-
try {
|
|
2455
|
-
const result = await this.convex.action(
|
|
2456
|
-
this.convexApi.aggregateEvents,
|
|
2457
|
-
params
|
|
2458
|
-
);
|
|
2459
|
-
return result;
|
|
2460
|
-
} catch (error) {
|
|
2461
|
-
return {
|
|
2462
|
-
data: null,
|
|
2463
|
-
error: new AutumnError({
|
|
2464
|
-
message: error.message,
|
|
2465
|
-
code: "convex_action_failed"
|
|
2466
|
-
})
|
|
2467
|
-
};
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
};
|
|
2471
|
-
};
|
|
2472
|
-
|
|
2473
|
-
// src/libraries/react/ReactAutumnProvider.tsx
|
|
2474
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
2475
|
-
var getBackendUrl = (backendUrl) => {
|
|
2476
|
-
if (backendUrl) {
|
|
2477
|
-
return backendUrl;
|
|
2478
|
-
}
|
|
2479
|
-
if (backendUrl && !backendUrl.startsWith("http")) {
|
|
2480
|
-
console.warn(`backendUrl is not a valid URL: ${backendUrl}`);
|
|
2481
|
-
}
|
|
2482
|
-
return "";
|
|
2483
|
-
};
|
|
2484
|
-
var ReactAutumnProvider = ({
|
|
2485
|
-
children,
|
|
2486
|
-
getBearerToken,
|
|
2487
|
-
convex,
|
|
2488
|
-
backendUrl,
|
|
2489
|
-
customerData,
|
|
2490
|
-
includeCredentials,
|
|
2491
|
-
betterAuthUrl,
|
|
2492
|
-
headers,
|
|
2493
|
-
convexApi,
|
|
2494
|
-
pathPrefix
|
|
2495
|
-
}) => {
|
|
2496
|
-
let client = convexApi ? new ConvexAutumnClient({
|
|
2497
|
-
convex,
|
|
2498
|
-
convexApi,
|
|
2499
|
-
customerData,
|
|
2500
|
-
headers,
|
|
2501
|
-
getBearerToken
|
|
2502
|
-
}) : new AutumnClient({
|
|
2503
|
-
backendUrl: getBackendUrl(backendUrl),
|
|
2504
|
-
getBearerToken,
|
|
2505
|
-
customerData,
|
|
2506
|
-
includeCredentials,
|
|
2507
|
-
betterAuthUrl,
|
|
2508
|
-
headers,
|
|
2509
|
-
pathPrefix
|
|
2510
|
-
});
|
|
2511
|
-
return /* @__PURE__ */ jsx2(BaseAutumnProvider, { client, AutumnContext, children });
|
|
2512
|
-
};
|
|
2513
|
-
|
|
2514
|
-
// src/libraries/react/hooks/useCustomer.tsx
|
|
2515
|
-
var useCustomer = (params) => {
|
|
2516
|
-
return useCustomerBase({
|
|
2517
|
-
params,
|
|
2518
|
-
AutumnContext
|
|
2519
|
-
});
|
|
2520
|
-
};
|
|
2521
|
-
|
|
2522
|
-
// src/libraries/react/hooks/usePricingTable.tsx
|
|
2523
|
-
var usePricingTable = (params) => {
|
|
2524
|
-
const context = useAutumnContext({
|
|
2525
|
-
AutumnContext,
|
|
2526
|
-
name: "usePricingTable"
|
|
2527
|
-
});
|
|
2528
|
-
return usePricingTableBase({
|
|
2529
|
-
client: context.client,
|
|
2530
|
-
params
|
|
2531
|
-
});
|
|
2532
|
-
};
|
|
2533
|
-
|
|
2534
|
-
// src/libraries/react/hooks/useEntityBase.tsx
|
|
2535
|
-
import useSWR3 from "swr";
|
|
2536
|
-
import { useContext as useContext2 } from "react";
|
|
2537
|
-
var useEntityBase = ({
|
|
2538
|
-
entityId,
|
|
2539
|
-
params,
|
|
2540
|
-
AutumnContext: AutumnContext2
|
|
2541
|
-
}) => {
|
|
2542
|
-
const { client } = useContext2(AutumnContext2);
|
|
2543
|
-
const queryKey = ["entity", entityId, params?.expand];
|
|
2544
|
-
const context = useAutumnContext({
|
|
2545
|
-
AutumnContext: AutumnContext2,
|
|
2546
|
-
name: "useEntity"
|
|
2547
|
-
});
|
|
2548
|
-
const fetchEntity = async () => {
|
|
2549
|
-
if (!entityId) {
|
|
2550
|
-
return null;
|
|
2551
|
-
}
|
|
2552
|
-
const { data: data2, error: error2 } = await client.entities.get(entityId, params);
|
|
2553
|
-
if (error2) {
|
|
2554
|
-
throw error2;
|
|
2555
|
-
}
|
|
2556
|
-
if (!data2) {
|
|
2557
|
-
return null;
|
|
2558
|
-
}
|
|
2559
|
-
return data2;
|
|
2560
|
-
};
|
|
2561
|
-
const { data, error, isLoading, mutate } = useSWR3(queryKey, fetchEntity, {
|
|
2562
|
-
fallbackData: null,
|
|
2563
|
-
shouldRetryOnError: false,
|
|
2564
|
-
onErrorRetry: (error2, key, config) => {
|
|
2565
|
-
if (error2.code == "entity_not_found") {
|
|
2566
|
-
return false;
|
|
2567
|
-
}
|
|
2568
|
-
return true;
|
|
2569
|
-
}
|
|
2570
|
-
});
|
|
2571
|
-
const {
|
|
2572
|
-
attach: attachAutumn,
|
|
2573
|
-
cancel: cancelAutumn,
|
|
2574
|
-
track: trackAutumn
|
|
2575
|
-
} = useAutumnBase({ context, client });
|
|
2576
|
-
const check = (params2) => {
|
|
2577
|
-
const result = handleCheck2({ customer: data, params: params2, isEntity: true });
|
|
2578
|
-
openDialog({
|
|
2579
|
-
result: result.data,
|
|
2580
|
-
params: params2,
|
|
2581
|
-
context
|
|
2582
|
-
});
|
|
2583
|
-
return result;
|
|
2584
|
-
};
|
|
2585
|
-
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2586
|
-
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2587
|
-
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2588
|
-
if (!entityId) {
|
|
2589
|
-
return {
|
|
2590
|
-
entity: null,
|
|
2591
|
-
isLoading: false,
|
|
2592
|
-
error: null,
|
|
2593
|
-
refetch: mutate,
|
|
2594
|
-
check,
|
|
2595
|
-
attach,
|
|
2596
|
-
cancel,
|
|
2597
|
-
track
|
|
2598
|
-
};
|
|
2599
|
-
}
|
|
2600
|
-
return {
|
|
2601
|
-
entity: error ? null : data,
|
|
2602
|
-
isLoading,
|
|
2603
|
-
error,
|
|
2604
|
-
refetch: mutate,
|
|
2605
|
-
check,
|
|
2606
|
-
attach,
|
|
2607
|
-
cancel,
|
|
2608
|
-
track
|
|
2609
|
-
};
|
|
2610
|
-
};
|
|
2611
|
-
|
|
2612
|
-
// src/libraries/react/hooks/useEntity.tsx
|
|
2613
|
-
var useEntity = (entityId, params) => {
|
|
2614
|
-
return useEntityBase({ AutumnContext, entityId, params });
|
|
2615
|
-
};
|
|
2616
|
-
|
|
2617
|
-
// src/libraries/react/hooks/useAnalytics.tsx
|
|
2618
|
-
import useSWR4 from "swr";
|
|
2619
|
-
var useAnalytics = (params) => {
|
|
2620
|
-
const context = useAutumnContext({
|
|
2621
|
-
AutumnContext,
|
|
2622
|
-
name: "useAnalytics"
|
|
2623
|
-
});
|
|
2624
|
-
const client = context.client;
|
|
2625
|
-
const fetcher = async () => {
|
|
2626
|
-
try {
|
|
2627
|
-
const { data: data2, error: error2 } = await client.query(params);
|
|
2628
|
-
if (error2) throw error2;
|
|
2629
|
-
return data2;
|
|
2630
|
-
} catch (error2) {
|
|
2631
|
-
throw new AutumnError({
|
|
2632
|
-
message: "Failed to fetch analytics",
|
|
2633
|
-
code: "fetch_analytics_failed"
|
|
2634
|
-
});
|
|
2635
|
-
}
|
|
2636
|
-
};
|
|
2637
|
-
const { data, error, mutate } = useSWR4(
|
|
2638
|
-
["analytics", params.featureId, params.range],
|
|
2639
|
-
fetcher,
|
|
2640
|
-
{ refreshInterval: 0 }
|
|
2641
|
-
);
|
|
2642
|
-
return {
|
|
2643
|
-
data: data?.list,
|
|
2644
|
-
isLoading: !error && !data,
|
|
2645
|
-
error,
|
|
2646
|
-
refetch: mutate
|
|
2647
|
-
};
|
|
2648
|
-
};
|
|
2649
|
-
|
|
2650
|
-
// src/libraries/react/hooks/usePaywall.tsx
|
|
2651
|
-
import useSWR5 from "swr";
|
|
2652
|
-
var usePaywall = ({
|
|
2653
|
-
featureId,
|
|
2654
|
-
entityId
|
|
2655
|
-
}) => {
|
|
2656
|
-
const context = useAutumnContext({
|
|
2657
|
-
AutumnContext,
|
|
2658
|
-
name: "usePaywall"
|
|
2659
|
-
});
|
|
2660
|
-
const enabled = !!featureId && !!context;
|
|
2661
|
-
const fetcher = async () => {
|
|
2662
|
-
if (!featureId) {
|
|
2663
|
-
return { preview: void 0 };
|
|
2705
|
+
})
|
|
2706
|
+
};
|
|
2707
|
+
}
|
|
2708
|
+
},
|
|
2709
|
+
redeemCode: async (args) => {
|
|
2710
|
+
try {
|
|
2711
|
+
const result = await this.convex.action(
|
|
2712
|
+
this.convexApi.redeemReferralCode,
|
|
2713
|
+
args
|
|
2714
|
+
);
|
|
2715
|
+
return result;
|
|
2716
|
+
} catch (error) {
|
|
2717
|
+
return {
|
|
2718
|
+
data: null,
|
|
2719
|
+
error: new AutumnError({
|
|
2720
|
+
message: error.message,
|
|
2721
|
+
code: "convex_action_failed"
|
|
2722
|
+
})
|
|
2723
|
+
};
|
|
2724
|
+
}
|
|
2664
2725
|
}
|
|
2665
|
-
const { data: data2, error: error2 } = await context.client.check({
|
|
2666
|
-
featureId,
|
|
2667
|
-
withPreview: true
|
|
2668
|
-
});
|
|
2669
|
-
if (error2) throw error2;
|
|
2670
|
-
return data2;
|
|
2671
|
-
};
|
|
2672
|
-
const queryKey = [`check`, featureId, entityId];
|
|
2673
|
-
const { data, error, isLoading } = useSWR5(queryKey, fetcher, {
|
|
2674
|
-
refreshInterval: 0,
|
|
2675
|
-
enabled
|
|
2676
|
-
});
|
|
2677
|
-
return {
|
|
2678
|
-
data: data?.preview,
|
|
2679
|
-
error,
|
|
2680
|
-
isLoading
|
|
2681
2726
|
};
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
message: "Failed to fetch event list",
|
|
2700
|
-
code: "fetch_event_list_failed"
|
|
2701
|
-
});
|
|
2727
|
+
products = {
|
|
2728
|
+
list: async () => {
|
|
2729
|
+
try {
|
|
2730
|
+
const result = await this.convex.action(
|
|
2731
|
+
this.convexApi.listProducts,
|
|
2732
|
+
{}
|
|
2733
|
+
);
|
|
2734
|
+
return result;
|
|
2735
|
+
} catch (error) {
|
|
2736
|
+
return {
|
|
2737
|
+
data: null,
|
|
2738
|
+
error: new AutumnError({
|
|
2739
|
+
message: error.message,
|
|
2740
|
+
code: "convex_action_failed"
|
|
2741
|
+
})
|
|
2742
|
+
};
|
|
2743
|
+
}
|
|
2702
2744
|
}
|
|
2703
2745
|
};
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2746
|
+
events = {
|
|
2747
|
+
list: async (params) => {
|
|
2748
|
+
try {
|
|
2749
|
+
const result = await this.convex.action(
|
|
2750
|
+
this.convexApi.listEvents,
|
|
2751
|
+
params
|
|
2752
|
+
);
|
|
2753
|
+
return result;
|
|
2754
|
+
} catch (error) {
|
|
2755
|
+
return {
|
|
2756
|
+
data: null,
|
|
2757
|
+
error: new AutumnError({
|
|
2758
|
+
message: error.message,
|
|
2759
|
+
code: "convex_action_failed"
|
|
2760
|
+
})
|
|
2761
|
+
};
|
|
2762
|
+
}
|
|
2763
|
+
},
|
|
2764
|
+
aggregate: async (params) => {
|
|
2765
|
+
try {
|
|
2766
|
+
const result = await this.convex.action(
|
|
2767
|
+
this.convexApi.aggregateEvents,
|
|
2768
|
+
params
|
|
2769
|
+
);
|
|
2770
|
+
return result;
|
|
2771
|
+
} catch (error) {
|
|
2772
|
+
return {
|
|
2773
|
+
data: null,
|
|
2774
|
+
error: new AutumnError({
|
|
2775
|
+
message: error.message,
|
|
2776
|
+
code: "convex_action_failed"
|
|
2777
|
+
})
|
|
2778
|
+
};
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2716
2781
|
};
|
|
2717
2782
|
};
|
|
2718
2783
|
|
|
2719
|
-
// src/libraries/react/
|
|
2720
|
-
import
|
|
2721
|
-
var
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2784
|
+
// src/libraries/react/ReactAutumnProvider.tsx
|
|
2785
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
2786
|
+
var getBackendUrl = (backendUrl) => {
|
|
2787
|
+
if (backendUrl) {
|
|
2788
|
+
return backendUrl;
|
|
2789
|
+
}
|
|
2790
|
+
if (backendUrl && !backendUrl.startsWith("http")) {
|
|
2791
|
+
console.warn(`backendUrl is not a valid URL: ${backendUrl}`);
|
|
2792
|
+
}
|
|
2793
|
+
return "";
|
|
2794
|
+
};
|
|
2795
|
+
var ReactAutumnProvider = ({
|
|
2796
|
+
children,
|
|
2797
|
+
getBearerToken,
|
|
2798
|
+
convex,
|
|
2799
|
+
backendUrl,
|
|
2800
|
+
customerData,
|
|
2801
|
+
includeCredentials,
|
|
2802
|
+
betterAuthUrl,
|
|
2803
|
+
headers,
|
|
2804
|
+
convexApi,
|
|
2805
|
+
pathPrefix
|
|
2806
|
+
}) => {
|
|
2807
|
+
let client = convexApi ? new ConvexAutumnClient({
|
|
2808
|
+
convex,
|
|
2809
|
+
convexApi,
|
|
2810
|
+
customerData,
|
|
2811
|
+
headers,
|
|
2812
|
+
getBearerToken
|
|
2813
|
+
}) : new AutumnClient({
|
|
2814
|
+
backendUrl: getBackendUrl(backendUrl),
|
|
2815
|
+
getBearerToken,
|
|
2816
|
+
customerData,
|
|
2817
|
+
includeCredentials,
|
|
2818
|
+
betterAuthUrl,
|
|
2819
|
+
headers,
|
|
2820
|
+
pathPrefix
|
|
2725
2821
|
});
|
|
2726
|
-
|
|
2727
|
-
const fetcher = async () => {
|
|
2728
|
-
try {
|
|
2729
|
-
const { data: data2, error: error2 } = await client.events.aggregate(params);
|
|
2730
|
-
if (error2) throw error2;
|
|
2731
|
-
return data2;
|
|
2732
|
-
} catch (error2) {
|
|
2733
|
-
throw new AutumnError({
|
|
2734
|
-
message: "Failed to fetch event aggregation",
|
|
2735
|
-
code: "fetch_event_aggregation_failed"
|
|
2736
|
-
});
|
|
2737
|
-
}
|
|
2738
|
-
};
|
|
2739
|
-
const { data, error, mutate } = useSWR7(
|
|
2740
|
-
["eventAggregate", params.customer_id, params.feature_id, params.range, params.bin_size],
|
|
2741
|
-
fetcher,
|
|
2742
|
-
{ refreshInterval: 0 }
|
|
2743
|
-
);
|
|
2744
|
-
return {
|
|
2745
|
-
list: data?.list,
|
|
2746
|
-
total: data?.total,
|
|
2747
|
-
isLoading: !error && !data,
|
|
2748
|
-
error,
|
|
2749
|
-
refetch: mutate
|
|
2750
|
-
};
|
|
2822
|
+
return /* @__PURE__ */ jsx2(BaseAutumnProvider, { client, AutumnContext, children });
|
|
2751
2823
|
};
|
|
2752
2824
|
|
|
2753
|
-
// ../node_modules/.pnpm/@radix-ui+react-accordion@1.2.11_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
2754
|
-
import
|
|
2825
|
+
// ../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
|
|
2826
|
+
import React12 from "react";
|
|
2755
2827
|
|
|
2756
2828
|
// ../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
|
|
2757
|
-
import * as
|
|
2829
|
+
import * as React from "react";
|
|
2758
2830
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2759
2831
|
function createContext22(rootComponentName, defaultContext) {
|
|
2760
|
-
const Context =
|
|
2832
|
+
const Context = React.createContext(defaultContext);
|
|
2761
2833
|
const Provider = (props) => {
|
|
2762
2834
|
const { children, ...context } = props;
|
|
2763
|
-
const value =
|
|
2835
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
2764
2836
|
return /* @__PURE__ */ jsx3(Context.Provider, { value, children });
|
|
2765
2837
|
};
|
|
2766
2838
|
Provider.displayName = rootComponentName + "Provider";
|
|
2767
2839
|
function useContext22(consumerName) {
|
|
2768
|
-
const context =
|
|
2840
|
+
const context = React.useContext(Context);
|
|
2769
2841
|
if (context) return context;
|
|
2770
2842
|
if (defaultContext !== void 0) return defaultContext;
|
|
2771
2843
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -2775,19 +2847,19 @@ function createContext22(rootComponentName, defaultContext) {
|
|
|
2775
2847
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
2776
2848
|
let defaultContexts = [];
|
|
2777
2849
|
function createContext32(rootComponentName, defaultContext) {
|
|
2778
|
-
const BaseContext =
|
|
2850
|
+
const BaseContext = React.createContext(defaultContext);
|
|
2779
2851
|
const index2 = defaultContexts.length;
|
|
2780
2852
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
2781
2853
|
const Provider = (props) => {
|
|
2782
2854
|
const { scope, children, ...context } = props;
|
|
2783
2855
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
2784
|
-
const value =
|
|
2856
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
2785
2857
|
return /* @__PURE__ */ jsx3(Context.Provider, { value, children });
|
|
2786
2858
|
};
|
|
2787
2859
|
Provider.displayName = rootComponentName + "Provider";
|
|
2788
2860
|
function useContext22(consumerName, scope) {
|
|
2789
2861
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
2790
|
-
const context =
|
|
2862
|
+
const context = React.useContext(Context);
|
|
2791
2863
|
if (context) return context;
|
|
2792
2864
|
if (defaultContext !== void 0) return defaultContext;
|
|
2793
2865
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -2796,11 +2868,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
2796
2868
|
}
|
|
2797
2869
|
const createScope = () => {
|
|
2798
2870
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
2799
|
-
return
|
|
2871
|
+
return React.createContext(defaultContext);
|
|
2800
2872
|
});
|
|
2801
2873
|
return function useScope(scope) {
|
|
2802
2874
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
2803
|
-
return
|
|
2875
|
+
return React.useMemo(
|
|
2804
2876
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
2805
2877
|
[scope, contexts]
|
|
2806
2878
|
);
|
|
@@ -2823,18 +2895,18 @@ function composeContextScopes(...scopes) {
|
|
|
2823
2895
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
2824
2896
|
return { ...nextScopes2, ...currentScope };
|
|
2825
2897
|
}, {});
|
|
2826
|
-
return
|
|
2898
|
+
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
2827
2899
|
};
|
|
2828
2900
|
};
|
|
2829
2901
|
createScope.scopeName = baseScope.scopeName;
|
|
2830
2902
|
return createScope;
|
|
2831
2903
|
}
|
|
2832
2904
|
|
|
2833
|
-
// ../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
2834
|
-
import
|
|
2905
|
+
// ../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
|
|
2906
|
+
import React4 from "react";
|
|
2835
2907
|
|
|
2836
2908
|
// ../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
|
|
2837
|
-
import * as
|
|
2909
|
+
import * as React2 from "react";
|
|
2838
2910
|
function setRef(ref, value) {
|
|
2839
2911
|
if (typeof ref === "function") {
|
|
2840
2912
|
return ref(value);
|
|
@@ -2867,30 +2939,30 @@ function composeRefs(...refs) {
|
|
|
2867
2939
|
};
|
|
2868
2940
|
}
|
|
2869
2941
|
function useComposedRefs(...refs) {
|
|
2870
|
-
return
|
|
2942
|
+
return React2.useCallback(composeRefs(...refs), refs);
|
|
2871
2943
|
}
|
|
2872
2944
|
|
|
2873
2945
|
// ../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
|
|
2874
|
-
import * as
|
|
2946
|
+
import * as React3 from "react";
|
|
2875
2947
|
import { Fragment as Fragment2, jsx as jsx4 } from "react/jsx-runtime";
|
|
2876
2948
|
// @__NO_SIDE_EFFECTS__
|
|
2877
2949
|
function createSlot(ownerName) {
|
|
2878
2950
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
2879
|
-
const Slot22 =
|
|
2951
|
+
const Slot22 = React3.forwardRef((props, forwardedRef) => {
|
|
2880
2952
|
const { children, ...slotProps } = props;
|
|
2881
|
-
const childrenArray =
|
|
2953
|
+
const childrenArray = React3.Children.toArray(children);
|
|
2882
2954
|
const slottable = childrenArray.find(isSlottable);
|
|
2883
2955
|
if (slottable) {
|
|
2884
2956
|
const newElement = slottable.props.children;
|
|
2885
2957
|
const newChildren = childrenArray.map((child) => {
|
|
2886
2958
|
if (child === slottable) {
|
|
2887
|
-
if (
|
|
2888
|
-
return
|
|
2959
|
+
if (React3.Children.count(newElement) > 1) return React3.Children.only(null);
|
|
2960
|
+
return React3.isValidElement(newElement) ? newElement.props.children : null;
|
|
2889
2961
|
} else {
|
|
2890
2962
|
return child;
|
|
2891
2963
|
}
|
|
2892
2964
|
});
|
|
2893
|
-
return /* @__PURE__ */ jsx4(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
2965
|
+
return /* @__PURE__ */ jsx4(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
|
|
2894
2966
|
}
|
|
2895
2967
|
return /* @__PURE__ */ jsx4(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
2896
2968
|
});
|
|
@@ -2900,24 +2972,24 @@ function createSlot(ownerName) {
|
|
|
2900
2972
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
2901
2973
|
// @__NO_SIDE_EFFECTS__
|
|
2902
2974
|
function createSlotClone(ownerName) {
|
|
2903
|
-
const SlotClone =
|
|
2975
|
+
const SlotClone = React3.forwardRef((props, forwardedRef) => {
|
|
2904
2976
|
const { children, ...slotProps } = props;
|
|
2905
|
-
if (
|
|
2977
|
+
if (React3.isValidElement(children)) {
|
|
2906
2978
|
const childrenRef = getElementRef(children);
|
|
2907
2979
|
const props2 = mergeProps(slotProps, children.props);
|
|
2908
|
-
if (children.type !==
|
|
2980
|
+
if (children.type !== React3.Fragment) {
|
|
2909
2981
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
2910
2982
|
}
|
|
2911
|
-
return
|
|
2983
|
+
return React3.cloneElement(children, props2);
|
|
2912
2984
|
}
|
|
2913
|
-
return
|
|
2985
|
+
return React3.Children.count(children) > 1 ? React3.Children.only(null) : null;
|
|
2914
2986
|
});
|
|
2915
2987
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
2916
2988
|
return SlotClone;
|
|
2917
2989
|
}
|
|
2918
2990
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
2919
2991
|
function isSlottable(child) {
|
|
2920
|
-
return
|
|
2992
|
+
return React3.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
2921
2993
|
}
|
|
2922
2994
|
function mergeProps(slotProps, childProps) {
|
|
2923
2995
|
const overrideProps = { ...childProps };
|
|
@@ -2957,7 +3029,7 @@ function getElementRef(element) {
|
|
|
2957
3029
|
return element.props.ref || element.ref;
|
|
2958
3030
|
}
|
|
2959
3031
|
|
|
2960
|
-
// ../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
3032
|
+
// ../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
|
|
2961
3033
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
2962
3034
|
import React22 from "react";
|
|
2963
3035
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
@@ -2970,14 +3042,14 @@ function createCollection(name) {
|
|
|
2970
3042
|
);
|
|
2971
3043
|
const CollectionProvider = (props) => {
|
|
2972
3044
|
const { scope, children } = props;
|
|
2973
|
-
const ref =
|
|
2974
|
-
const itemMap =
|
|
3045
|
+
const ref = React4.useRef(null);
|
|
3046
|
+
const itemMap = React4.useRef(/* @__PURE__ */ new Map()).current;
|
|
2975
3047
|
return /* @__PURE__ */ jsx5(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
2976
3048
|
};
|
|
2977
3049
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
2978
3050
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
2979
3051
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
2980
|
-
const CollectionSlot =
|
|
3052
|
+
const CollectionSlot = React4.forwardRef(
|
|
2981
3053
|
(props, forwardedRef) => {
|
|
2982
3054
|
const { scope, children } = props;
|
|
2983
3055
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -2989,13 +3061,13 @@ function createCollection(name) {
|
|
|
2989
3061
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
2990
3062
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
2991
3063
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
2992
|
-
const CollectionItemSlot =
|
|
3064
|
+
const CollectionItemSlot = React4.forwardRef(
|
|
2993
3065
|
(props, forwardedRef) => {
|
|
2994
3066
|
const { scope, children, ...itemData } = props;
|
|
2995
|
-
const ref =
|
|
3067
|
+
const ref = React4.useRef(null);
|
|
2996
3068
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2997
3069
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
2998
|
-
|
|
3070
|
+
React4.useEffect(() => {
|
|
2999
3071
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
3000
3072
|
return () => void context.itemMap.delete(ref);
|
|
3001
3073
|
});
|
|
@@ -3005,7 +3077,7 @@ function createCollection(name) {
|
|
|
3005
3077
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
3006
3078
|
function useCollection2(scope) {
|
|
3007
3079
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
3008
|
-
const getItems =
|
|
3080
|
+
const getItems = React4.useCallback(() => {
|
|
3009
3081
|
const collectionNode = context.collectionRef.current;
|
|
3010
3082
|
if (!collectionNode) return [];
|
|
3011
3083
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -3035,16 +3107,16 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
3035
3107
|
}
|
|
3036
3108
|
|
|
3037
3109
|
// ../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
|
|
3038
|
-
import * as
|
|
3110
|
+
import * as React6 from "react";
|
|
3039
3111
|
|
|
3040
3112
|
// ../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
|
|
3041
|
-
import * as
|
|
3042
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
3113
|
+
import * as React5 from "react";
|
|
3114
|
+
var useLayoutEffect2 = globalThis?.document ? React5.useLayoutEffect : () => {
|
|
3043
3115
|
};
|
|
3044
3116
|
|
|
3045
3117
|
// ../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
|
|
3046
3118
|
import * as React23 from "react";
|
|
3047
|
-
var useInsertionEffect =
|
|
3119
|
+
var useInsertionEffect = React6[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3048
3120
|
function useControllableState({
|
|
3049
3121
|
prop,
|
|
3050
3122
|
defaultProp,
|
|
@@ -3059,8 +3131,8 @@ function useControllableState({
|
|
|
3059
3131
|
const isControlled = prop !== void 0;
|
|
3060
3132
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3061
3133
|
if (true) {
|
|
3062
|
-
const isControlledRef =
|
|
3063
|
-
|
|
3134
|
+
const isControlledRef = React6.useRef(prop !== void 0);
|
|
3135
|
+
React6.useEffect(() => {
|
|
3064
3136
|
const wasControlled = isControlledRef.current;
|
|
3065
3137
|
if (wasControlled !== isControlled) {
|
|
3066
3138
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -3072,7 +3144,7 @@ function useControllableState({
|
|
|
3072
3144
|
isControlledRef.current = isControlled;
|
|
3073
3145
|
}, [isControlled, caller]);
|
|
3074
3146
|
}
|
|
3075
|
-
const setValue =
|
|
3147
|
+
const setValue = React6.useCallback(
|
|
3076
3148
|
(nextValue) => {
|
|
3077
3149
|
if (isControlled) {
|
|
3078
3150
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -3091,13 +3163,13 @@ function useUncontrolledState({
|
|
|
3091
3163
|
defaultProp,
|
|
3092
3164
|
onChange
|
|
3093
3165
|
}) {
|
|
3094
|
-
const [value, setValue] =
|
|
3095
|
-
const prevValueRef =
|
|
3096
|
-
const onChangeRef =
|
|
3166
|
+
const [value, setValue] = React6.useState(defaultProp);
|
|
3167
|
+
const prevValueRef = React6.useRef(value);
|
|
3168
|
+
const onChangeRef = React6.useRef(onChange);
|
|
3097
3169
|
useInsertionEffect(() => {
|
|
3098
3170
|
onChangeRef.current = onChange;
|
|
3099
3171
|
}, [onChange]);
|
|
3100
|
-
|
|
3172
|
+
React6.useEffect(() => {
|
|
3101
3173
|
if (prevValueRef.current !== value) {
|
|
3102
3174
|
onChangeRef.current?.(value);
|
|
3103
3175
|
prevValueRef.current = value;
|
|
@@ -3110,8 +3182,8 @@ function isFunction(value) {
|
|
|
3110
3182
|
}
|
|
3111
3183
|
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
3112
3184
|
|
|
3113
|
-
// ../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
3114
|
-
import * as
|
|
3185
|
+
// ../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
|
|
3186
|
+
import * as React7 from "react";
|
|
3115
3187
|
import * as ReactDOM from "react-dom";
|
|
3116
3188
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
3117
3189
|
var NODES = [
|
|
@@ -3135,7 +3207,7 @@ var NODES = [
|
|
|
3135
3207
|
];
|
|
3136
3208
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
3137
3209
|
const Slot4 = createSlot(`Primitive.${node}`);
|
|
3138
|
-
const Node2 =
|
|
3210
|
+
const Node2 = React7.forwardRef((props, forwardedRef) => {
|
|
3139
3211
|
const { asChild, ...primitiveProps } = props;
|
|
3140
3212
|
const Comp = asChild ? Slot4 : node;
|
|
3141
3213
|
if (typeof window !== "undefined") {
|
|
@@ -3150,14 +3222,14 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
3150
3222
|
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
3151
3223
|
}
|
|
3152
3224
|
|
|
3153
|
-
// ../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.11_@types+react-dom@19.1.9_@types+react@19.1.10__@
|
|
3154
|
-
import * as
|
|
3225
|
+
// ../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
|
|
3226
|
+
import * as React10 from "react";
|
|
3155
3227
|
|
|
3156
|
-
// ../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
3228
|
+
// ../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
|
|
3157
3229
|
import * as React24 from "react";
|
|
3158
|
-
import * as
|
|
3230
|
+
import * as React8 from "react";
|
|
3159
3231
|
function useStateMachine(initialState, machine) {
|
|
3160
|
-
return
|
|
3232
|
+
return React8.useReducer((state, event) => {
|
|
3161
3233
|
const nextState = machine[state][event];
|
|
3162
3234
|
return nextState ?? state;
|
|
3163
3235
|
}, initialState);
|
|
@@ -3280,23 +3352,23 @@ function getElementRef2(element) {
|
|
|
3280
3352
|
}
|
|
3281
3353
|
|
|
3282
3354
|
// ../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
|
|
3283
|
-
import * as
|
|
3284
|
-
var useReactId =
|
|
3355
|
+
import * as React9 from "react";
|
|
3356
|
+
var useReactId = React9[" useId ".trim().toString()] || (() => void 0);
|
|
3285
3357
|
var count = 0;
|
|
3286
3358
|
function useId(deterministicId) {
|
|
3287
|
-
const [id, setId] =
|
|
3359
|
+
const [id, setId] = React9.useState(useReactId());
|
|
3288
3360
|
useLayoutEffect2(() => {
|
|
3289
3361
|
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
3290
3362
|
}, [deterministicId]);
|
|
3291
3363
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
3292
3364
|
}
|
|
3293
3365
|
|
|
3294
|
-
// ../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.11_@types+react-dom@19.1.9_@types+react@19.1.10__@
|
|
3366
|
+
// ../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
|
|
3295
3367
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
3296
3368
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
3297
3369
|
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
3298
3370
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
3299
|
-
var Collapsible =
|
|
3371
|
+
var Collapsible = React10.forwardRef(
|
|
3300
3372
|
(props, forwardedRef) => {
|
|
3301
3373
|
const {
|
|
3302
3374
|
__scopeCollapsible,
|
|
@@ -3319,7 +3391,7 @@ var Collapsible = React11.forwardRef(
|
|
|
3319
3391
|
disabled,
|
|
3320
3392
|
contentId: useId(),
|
|
3321
3393
|
open,
|
|
3322
|
-
onOpenToggle:
|
|
3394
|
+
onOpenToggle: React10.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
3323
3395
|
children: /* @__PURE__ */ jsx7(
|
|
3324
3396
|
Primitive.div,
|
|
3325
3397
|
{
|
|
@@ -3335,7 +3407,7 @@ var Collapsible = React11.forwardRef(
|
|
|
3335
3407
|
);
|
|
3336
3408
|
Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
3337
3409
|
var TRIGGER_NAME = "CollapsibleTrigger";
|
|
3338
|
-
var CollapsibleTrigger =
|
|
3410
|
+
var CollapsibleTrigger = React10.forwardRef(
|
|
3339
3411
|
(props, forwardedRef) => {
|
|
3340
3412
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
3341
3413
|
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
@@ -3357,7 +3429,7 @@ var CollapsibleTrigger = React11.forwardRef(
|
|
|
3357
3429
|
);
|
|
3358
3430
|
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
3359
3431
|
var CONTENT_NAME = "CollapsibleContent";
|
|
3360
|
-
var CollapsibleContent =
|
|
3432
|
+
var CollapsibleContent = React10.forwardRef(
|
|
3361
3433
|
(props, forwardedRef) => {
|
|
3362
3434
|
const { forceMount, ...contentProps } = props;
|
|
3363
3435
|
const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);
|
|
@@ -3365,20 +3437,20 @@ var CollapsibleContent = React11.forwardRef(
|
|
|
3365
3437
|
}
|
|
3366
3438
|
);
|
|
3367
3439
|
CollapsibleContent.displayName = CONTENT_NAME;
|
|
3368
|
-
var CollapsibleContentImpl =
|
|
3440
|
+
var CollapsibleContentImpl = React10.forwardRef((props, forwardedRef) => {
|
|
3369
3441
|
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
3370
3442
|
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
3371
|
-
const [isPresent, setIsPresent] =
|
|
3372
|
-
const ref =
|
|
3443
|
+
const [isPresent, setIsPresent] = React10.useState(present);
|
|
3444
|
+
const ref = React10.useRef(null);
|
|
3373
3445
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3374
|
-
const heightRef =
|
|
3446
|
+
const heightRef = React10.useRef(0);
|
|
3375
3447
|
const height = heightRef.current;
|
|
3376
|
-
const widthRef =
|
|
3448
|
+
const widthRef = React10.useRef(0);
|
|
3377
3449
|
const width = widthRef.current;
|
|
3378
3450
|
const isOpen = context.open || isPresent;
|
|
3379
|
-
const isMountAnimationPreventedRef =
|
|
3380
|
-
const originalStylesRef =
|
|
3381
|
-
|
|
3451
|
+
const isMountAnimationPreventedRef = React10.useRef(isOpen);
|
|
3452
|
+
const originalStylesRef = React10.useRef(void 0);
|
|
3453
|
+
React10.useEffect(() => {
|
|
3382
3454
|
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
3383
3455
|
return () => cancelAnimationFrame(rAF);
|
|
3384
3456
|
}, []);
|
|
@@ -3427,15 +3499,15 @@ var Trigger = CollapsibleTrigger;
|
|
|
3427
3499
|
var Content = CollapsibleContent;
|
|
3428
3500
|
|
|
3429
3501
|
// ../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
|
|
3430
|
-
import * as
|
|
3502
|
+
import * as React11 from "react";
|
|
3431
3503
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
3432
|
-
var DirectionContext =
|
|
3504
|
+
var DirectionContext = React11.createContext(void 0);
|
|
3433
3505
|
function useDirection(localDir) {
|
|
3434
|
-
const globalDir =
|
|
3506
|
+
const globalDir = React11.useContext(DirectionContext);
|
|
3435
3507
|
return localDir || globalDir || "ltr";
|
|
3436
3508
|
}
|
|
3437
3509
|
|
|
3438
|
-
// ../node_modules/.pnpm/@radix-ui+react-accordion@1.2.11_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
3510
|
+
// ../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
|
|
3439
3511
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
3440
3512
|
var ACCORDION_NAME = "Accordion";
|
|
3441
3513
|
var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
|
|
@@ -3445,7 +3517,7 @@ var [createAccordionContext, createAccordionScope] = createContextScope(ACCORDIO
|
|
|
3445
3517
|
createCollapsibleScope
|
|
3446
3518
|
]);
|
|
3447
3519
|
var useCollapsibleScope = createCollapsibleScope();
|
|
3448
|
-
var Accordion =
|
|
3520
|
+
var Accordion = React12.forwardRef(
|
|
3449
3521
|
(props, forwardedRef) => {
|
|
3450
3522
|
const { type, ...accordionProps } = props;
|
|
3451
3523
|
const singleProps = accordionProps;
|
|
@@ -3459,7 +3531,7 @@ var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccor
|
|
|
3459
3531
|
ACCORDION_NAME,
|
|
3460
3532
|
{ collapsible: false }
|
|
3461
3533
|
);
|
|
3462
|
-
var AccordionImplSingle =
|
|
3534
|
+
var AccordionImplSingle = React12.forwardRef(
|
|
3463
3535
|
(props, forwardedRef) => {
|
|
3464
3536
|
const {
|
|
3465
3537
|
value: valueProp,
|
|
@@ -3479,15 +3551,15 @@ var AccordionImplSingle = React13.forwardRef(
|
|
|
3479
3551
|
AccordionValueProvider,
|
|
3480
3552
|
{
|
|
3481
3553
|
scope: props.__scopeAccordion,
|
|
3482
|
-
value:
|
|
3554
|
+
value: React12.useMemo(() => value ? [value] : [], [value]),
|
|
3483
3555
|
onItemOpen: setValue,
|
|
3484
|
-
onItemClose:
|
|
3556
|
+
onItemClose: React12.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
3485
3557
|
children: /* @__PURE__ */ jsx9(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsx9(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
3486
3558
|
}
|
|
3487
3559
|
);
|
|
3488
3560
|
}
|
|
3489
3561
|
);
|
|
3490
|
-
var AccordionImplMultiple =
|
|
3562
|
+
var AccordionImplMultiple = React12.forwardRef((props, forwardedRef) => {
|
|
3491
3563
|
const {
|
|
3492
3564
|
value: valueProp,
|
|
3493
3565
|
defaultValue,
|
|
@@ -3501,11 +3573,11 @@ var AccordionImplMultiple = React13.forwardRef((props, forwardedRef) => {
|
|
|
3501
3573
|
onChange: onValueChange,
|
|
3502
3574
|
caller: ACCORDION_NAME
|
|
3503
3575
|
});
|
|
3504
|
-
const handleItemOpen =
|
|
3576
|
+
const handleItemOpen = React12.useCallback(
|
|
3505
3577
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
3506
3578
|
[setValue]
|
|
3507
3579
|
);
|
|
3508
|
-
const handleItemClose =
|
|
3580
|
+
const handleItemClose = React12.useCallback(
|
|
3509
3581
|
(itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
|
|
3510
3582
|
[setValue]
|
|
3511
3583
|
);
|
|
@@ -3521,10 +3593,10 @@ var AccordionImplMultiple = React13.forwardRef((props, forwardedRef) => {
|
|
|
3521
3593
|
);
|
|
3522
3594
|
});
|
|
3523
3595
|
var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);
|
|
3524
|
-
var AccordionImpl =
|
|
3596
|
+
var AccordionImpl = React12.forwardRef(
|
|
3525
3597
|
(props, forwardedRef) => {
|
|
3526
3598
|
const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
|
|
3527
|
-
const accordionRef =
|
|
3599
|
+
const accordionRef = React12.useRef(null);
|
|
3528
3600
|
const composedRefs = useComposedRefs(accordionRef, forwardedRef);
|
|
3529
3601
|
const getItems = useCollection(__scopeAccordion);
|
|
3530
3602
|
const direction = useDirection(dir);
|
|
@@ -3613,7 +3685,7 @@ var AccordionImpl = React13.forwardRef(
|
|
|
3613
3685
|
);
|
|
3614
3686
|
var ITEM_NAME = "AccordionItem";
|
|
3615
3687
|
var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME);
|
|
3616
|
-
var AccordionItem =
|
|
3688
|
+
var AccordionItem = React12.forwardRef(
|
|
3617
3689
|
(props, forwardedRef) => {
|
|
3618
3690
|
const { __scopeAccordion, value, ...accordionItemProps } = props;
|
|
3619
3691
|
const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);
|
|
@@ -3654,7 +3726,7 @@ var AccordionItem = React13.forwardRef(
|
|
|
3654
3726
|
);
|
|
3655
3727
|
AccordionItem.displayName = ITEM_NAME;
|
|
3656
3728
|
var HEADER_NAME = "AccordionHeader";
|
|
3657
|
-
var AccordionHeader =
|
|
3729
|
+
var AccordionHeader = React12.forwardRef(
|
|
3658
3730
|
(props, forwardedRef) => {
|
|
3659
3731
|
const { __scopeAccordion, ...headerProps } = props;
|
|
3660
3732
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -3673,7 +3745,7 @@ var AccordionHeader = React13.forwardRef(
|
|
|
3673
3745
|
);
|
|
3674
3746
|
AccordionHeader.displayName = HEADER_NAME;
|
|
3675
3747
|
var TRIGGER_NAME2 = "AccordionTrigger";
|
|
3676
|
-
var AccordionTrigger =
|
|
3748
|
+
var AccordionTrigger = React12.forwardRef(
|
|
3677
3749
|
(props, forwardedRef) => {
|
|
3678
3750
|
const { __scopeAccordion, ...triggerProps } = props;
|
|
3679
3751
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -3695,7 +3767,7 @@ var AccordionTrigger = React13.forwardRef(
|
|
|
3695
3767
|
);
|
|
3696
3768
|
AccordionTrigger.displayName = TRIGGER_NAME2;
|
|
3697
3769
|
var CONTENT_NAME2 = "AccordionContent";
|
|
3698
|
-
var AccordionContent =
|
|
3770
|
+
var AccordionContent = React12.forwardRef(
|
|
3699
3771
|
(props, forwardedRef) => {
|
|
3700
3772
|
const { __scopeAccordion, ...contentProps } = props;
|
|
3701
3773
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -3834,10 +3906,10 @@ var __iconNode3 = [
|
|
|
3834
3906
|
var X = createLucideIcon("x", __iconNode3);
|
|
3835
3907
|
|
|
3836
3908
|
// src/libraries/react/components/checkout-dialog/checkout-dialog-synced.tsx
|
|
3837
|
-
import { useEffect as
|
|
3909
|
+
import { useEffect as useEffect18, useState as useState18 } from "react";
|
|
3838
3910
|
|
|
3839
3911
|
// src/libraries/react/components/ui/accordion.tsx
|
|
3840
|
-
import * as
|
|
3912
|
+
import * as React13 from "react";
|
|
3841
3913
|
|
|
3842
3914
|
// ../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
3843
3915
|
function r(e) {
|
|
@@ -6367,7 +6439,7 @@ function cn(...inputs) {
|
|
|
6367
6439
|
// src/libraries/react/components/ui/accordion.tsx
|
|
6368
6440
|
import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
6369
6441
|
var Accordion2 = Root2;
|
|
6370
|
-
var AccordionItem2 =
|
|
6442
|
+
var AccordionItem2 = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
6371
6443
|
Item,
|
|
6372
6444
|
{
|
|
6373
6445
|
ref,
|
|
@@ -6376,7 +6448,7 @@ var AccordionItem2 = React14.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
6376
6448
|
}
|
|
6377
6449
|
));
|
|
6378
6450
|
AccordionItem2.displayName = "AccordionItem";
|
|
6379
|
-
var AccordionTrigger2 =
|
|
6451
|
+
var AccordionTrigger2 = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx10(Header, { className: "au-flex", children: /* @__PURE__ */ jsxs2(
|
|
6380
6452
|
Trigger2,
|
|
6381
6453
|
{
|
|
6382
6454
|
ref,
|
|
@@ -6392,7 +6464,7 @@ var AccordionTrigger2 = React14.forwardRef(({ className, children, ...props }, r
|
|
|
6392
6464
|
}
|
|
6393
6465
|
) }));
|
|
6394
6466
|
AccordionTrigger2.displayName = Trigger2.displayName;
|
|
6395
|
-
var AccordionContent2 =
|
|
6467
|
+
var AccordionContent2 = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
6396
6468
|
Content2,
|
|
6397
6469
|
{
|
|
6398
6470
|
ref,
|
|
@@ -6404,7 +6476,7 @@ var AccordionContent2 = React14.forwardRef(({ className, children, ...props }, r
|
|
|
6404
6476
|
AccordionContent2.displayName = Content2.displayName;
|
|
6405
6477
|
|
|
6406
6478
|
// src/libraries/react/components/ui/button.tsx
|
|
6407
|
-
import * as
|
|
6479
|
+
import * as React14 from "react";
|
|
6408
6480
|
|
|
6409
6481
|
// ../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
6410
6482
|
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
@@ -6475,7 +6547,7 @@ var buttonVariants = cva(
|
|
|
6475
6547
|
}
|
|
6476
6548
|
}
|
|
6477
6549
|
);
|
|
6478
|
-
var Button =
|
|
6550
|
+
var Button = React14.forwardRef(
|
|
6479
6551
|
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
6480
6552
|
const Comp = asChild ? Slot : "button";
|
|
6481
6553
|
return /* @__PURE__ */ jsx11(
|
|
@@ -6491,29 +6563,29 @@ var Button = React15.forwardRef(
|
|
|
6491
6563
|
Button.displayName = "Button";
|
|
6492
6564
|
|
|
6493
6565
|
// src/libraries/react/components/ui/dialog.tsx
|
|
6494
|
-
import * as React33 from "react";
|
|
6495
|
-
|
|
6496
|
-
// ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+reac_d887111acb876d7a867028e90c6aec01/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
6497
6566
|
import * as React32 from "react";
|
|
6498
6567
|
|
|
6499
|
-
// ../node_modules/.pnpm/@radix-ui+react-
|
|
6500
|
-
import * as
|
|
6568
|
+
// ../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
|
|
6569
|
+
import * as React31 from "react";
|
|
6570
|
+
|
|
6571
|
+
// ../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
|
|
6572
|
+
import * as React17 from "react";
|
|
6501
6573
|
|
|
6502
6574
|
// ../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
|
|
6503
|
-
import * as
|
|
6575
|
+
import * as React15 from "react";
|
|
6504
6576
|
function useCallbackRef(callback) {
|
|
6505
|
-
const callbackRef =
|
|
6506
|
-
|
|
6577
|
+
const callbackRef = React15.useRef(callback);
|
|
6578
|
+
React15.useEffect(() => {
|
|
6507
6579
|
callbackRef.current = callback;
|
|
6508
6580
|
});
|
|
6509
|
-
return
|
|
6581
|
+
return React15.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
6510
6582
|
}
|
|
6511
6583
|
|
|
6512
6584
|
// ../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
|
|
6513
|
-
import * as
|
|
6585
|
+
import * as React16 from "react";
|
|
6514
6586
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
6515
6587
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
6516
|
-
|
|
6588
|
+
React16.useEffect(() => {
|
|
6517
6589
|
const handleKeyDown = (event) => {
|
|
6518
6590
|
if (event.key === "Escape") {
|
|
6519
6591
|
onEscapeKeyDown(event);
|
|
@@ -6524,19 +6596,19 @@ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.docum
|
|
|
6524
6596
|
}, [onEscapeKeyDown, ownerDocument]);
|
|
6525
6597
|
}
|
|
6526
6598
|
|
|
6527
|
-
// ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.9_@types+react@19.1.
|
|
6599
|
+
// ../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
|
|
6528
6600
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
6529
6601
|
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
6530
6602
|
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
6531
6603
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
6532
6604
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
6533
6605
|
var originalBodyPointerEvents;
|
|
6534
|
-
var DismissableLayerContext =
|
|
6606
|
+
var DismissableLayerContext = React17.createContext({
|
|
6535
6607
|
layers: /* @__PURE__ */ new Set(),
|
|
6536
6608
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
6537
6609
|
branches: /* @__PURE__ */ new Set()
|
|
6538
6610
|
});
|
|
6539
|
-
var DismissableLayer =
|
|
6611
|
+
var DismissableLayer = React17.forwardRef(
|
|
6540
6612
|
(props, forwardedRef) => {
|
|
6541
6613
|
const {
|
|
6542
6614
|
disableOutsidePointerEvents = false,
|
|
@@ -6547,10 +6619,10 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6547
6619
|
onDismiss,
|
|
6548
6620
|
...layerProps
|
|
6549
6621
|
} = props;
|
|
6550
|
-
const context =
|
|
6551
|
-
const [node, setNode] =
|
|
6622
|
+
const context = React17.useContext(DismissableLayerContext);
|
|
6623
|
+
const [node, setNode] = React17.useState(null);
|
|
6552
6624
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
6553
|
-
const [, force] =
|
|
6625
|
+
const [, force] = React17.useState({});
|
|
6554
6626
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
6555
6627
|
const layers = Array.from(context.layers);
|
|
6556
6628
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -6583,7 +6655,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6583
6655
|
onDismiss();
|
|
6584
6656
|
}
|
|
6585
6657
|
}, ownerDocument);
|
|
6586
|
-
|
|
6658
|
+
React17.useEffect(() => {
|
|
6587
6659
|
if (!node) return;
|
|
6588
6660
|
if (disableOutsidePointerEvents) {
|
|
6589
6661
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -6600,7 +6672,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6600
6672
|
}
|
|
6601
6673
|
};
|
|
6602
6674
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
6603
|
-
|
|
6675
|
+
React17.useEffect(() => {
|
|
6604
6676
|
return () => {
|
|
6605
6677
|
if (!node) return;
|
|
6606
6678
|
context.layers.delete(node);
|
|
@@ -6608,7 +6680,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6608
6680
|
dispatchUpdate();
|
|
6609
6681
|
};
|
|
6610
6682
|
}, [node, context]);
|
|
6611
|
-
|
|
6683
|
+
React17.useEffect(() => {
|
|
6612
6684
|
const handleUpdate = () => force({});
|
|
6613
6685
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
6614
6686
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -6634,11 +6706,11 @@ var DismissableLayer = React18.forwardRef(
|
|
|
6634
6706
|
);
|
|
6635
6707
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
6636
6708
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
6637
|
-
var DismissableLayerBranch =
|
|
6638
|
-
const context =
|
|
6639
|
-
const ref =
|
|
6709
|
+
var DismissableLayerBranch = React17.forwardRef((props, forwardedRef) => {
|
|
6710
|
+
const context = React17.useContext(DismissableLayerContext);
|
|
6711
|
+
const ref = React17.useRef(null);
|
|
6640
6712
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6641
|
-
|
|
6713
|
+
React17.useEffect(() => {
|
|
6642
6714
|
const node = ref.current;
|
|
6643
6715
|
if (node) {
|
|
6644
6716
|
context.branches.add(node);
|
|
@@ -6652,10 +6724,10 @@ var DismissableLayerBranch = React18.forwardRef((props, forwardedRef) => {
|
|
|
6652
6724
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
6653
6725
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
6654
6726
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
6655
|
-
const isPointerInsideReactTreeRef =
|
|
6656
|
-
const handleClickRef =
|
|
6727
|
+
const isPointerInsideReactTreeRef = React17.useRef(false);
|
|
6728
|
+
const handleClickRef = React17.useRef(() => {
|
|
6657
6729
|
});
|
|
6658
|
-
|
|
6730
|
+
React17.useEffect(() => {
|
|
6659
6731
|
const handlePointerDown = (event) => {
|
|
6660
6732
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
6661
6733
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -6696,8 +6768,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
6696
6768
|
}
|
|
6697
6769
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
6698
6770
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
6699
|
-
const isFocusInsideReactTreeRef =
|
|
6700
|
-
|
|
6771
|
+
const isFocusInsideReactTreeRef = React17.useRef(false);
|
|
6772
|
+
React17.useEffect(() => {
|
|
6701
6773
|
const handleFocus = (event) => {
|
|
6702
6774
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
6703
6775
|
const eventDetail = { originalEvent: event };
|
|
@@ -6729,14 +6801,14 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
6729
6801
|
}
|
|
6730
6802
|
}
|
|
6731
6803
|
|
|
6732
|
-
// ../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
6733
|
-
import * as
|
|
6804
|
+
// ../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
|
|
6805
|
+
import * as React18 from "react";
|
|
6734
6806
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
6735
6807
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
6736
6808
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
6737
6809
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
6738
6810
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
6739
|
-
var FocusScope =
|
|
6811
|
+
var FocusScope = React18.forwardRef((props, forwardedRef) => {
|
|
6740
6812
|
const {
|
|
6741
6813
|
loop = false,
|
|
6742
6814
|
trapped = false,
|
|
@@ -6744,12 +6816,12 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
6744
6816
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
6745
6817
|
...scopeProps
|
|
6746
6818
|
} = props;
|
|
6747
|
-
const [container, setContainer] =
|
|
6819
|
+
const [container, setContainer] = React18.useState(null);
|
|
6748
6820
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
6749
6821
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
6750
|
-
const lastFocusedElementRef =
|
|
6822
|
+
const lastFocusedElementRef = React18.useRef(null);
|
|
6751
6823
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
6752
|
-
const focusScope =
|
|
6824
|
+
const focusScope = React18.useRef({
|
|
6753
6825
|
paused: false,
|
|
6754
6826
|
pause() {
|
|
6755
6827
|
this.paused = true;
|
|
@@ -6758,7 +6830,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
6758
6830
|
this.paused = false;
|
|
6759
6831
|
}
|
|
6760
6832
|
}).current;
|
|
6761
|
-
|
|
6833
|
+
React18.useEffect(() => {
|
|
6762
6834
|
if (trapped) {
|
|
6763
6835
|
let handleFocusIn2 = function(event) {
|
|
6764
6836
|
if (focusScope.paused || !container) return;
|
|
@@ -6794,7 +6866,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
6794
6866
|
};
|
|
6795
6867
|
}
|
|
6796
6868
|
}, [trapped, container, focusScope.paused]);
|
|
6797
|
-
|
|
6869
|
+
React18.useEffect(() => {
|
|
6798
6870
|
if (container) {
|
|
6799
6871
|
focusScopesStack.add(focusScope);
|
|
6800
6872
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -6825,7 +6897,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
6825
6897
|
};
|
|
6826
6898
|
}
|
|
6827
6899
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
6828
|
-
const handleKeyDown =
|
|
6900
|
+
const handleKeyDown = React18.useCallback(
|
|
6829
6901
|
(event) => {
|
|
6830
6902
|
if (!loop && !trapped) return;
|
|
6831
6903
|
if (focusScope.paused) return;
|
|
@@ -6933,14 +7005,14 @@ function removeLinks(items) {
|
|
|
6933
7005
|
return items.filter((item) => item.tagName !== "A");
|
|
6934
7006
|
}
|
|
6935
7007
|
|
|
6936
|
-
// ../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
6937
|
-
import * as
|
|
7008
|
+
// ../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
|
|
7009
|
+
import * as React19 from "react";
|
|
6938
7010
|
import ReactDOM2 from "react-dom";
|
|
6939
7011
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
6940
7012
|
var PORTAL_NAME = "Portal";
|
|
6941
|
-
var Portal =
|
|
7013
|
+
var Portal = React19.forwardRef((props, forwardedRef) => {
|
|
6942
7014
|
const { container: containerProp, ...portalProps } = props;
|
|
6943
|
-
const [mounted, setMounted] =
|
|
7015
|
+
const [mounted, setMounted] = React19.useState(false);
|
|
6944
7016
|
useLayoutEffect2(() => setMounted(true), []);
|
|
6945
7017
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
6946
7018
|
return container ? ReactDOM2.createPortal(/* @__PURE__ */ jsx14(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
@@ -6948,10 +7020,10 @@ var Portal = React20.forwardRef((props, forwardedRef) => {
|
|
|
6948
7020
|
Portal.displayName = PORTAL_NAME;
|
|
6949
7021
|
|
|
6950
7022
|
// ../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
|
|
6951
|
-
import * as
|
|
7023
|
+
import * as React20 from "react";
|
|
6952
7024
|
var count2 = 0;
|
|
6953
7025
|
function useFocusGuards() {
|
|
6954
|
-
|
|
7026
|
+
React20.useEffect(() => {
|
|
6955
7027
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
6956
7028
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
6957
7029
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -7008,10 +7080,10 @@ function __spreadArray(to, from, pack) {
|
|
|
7008
7080
|
}
|
|
7009
7081
|
|
|
7010
7082
|
// ../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
|
|
7011
|
-
import * as
|
|
7083
|
+
import * as React30 from "react";
|
|
7012
7084
|
|
|
7013
7085
|
// ../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
|
|
7014
|
-
import * as
|
|
7086
|
+
import * as React26 from "react";
|
|
7015
7087
|
|
|
7016
7088
|
// ../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
|
|
7017
7089
|
var zeroRightClassName = "right-scroll-bar-position";
|
|
@@ -7030,9 +7102,9 @@ function assignRef(ref, value) {
|
|
|
7030
7102
|
}
|
|
7031
7103
|
|
|
7032
7104
|
// ../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/useRef.js
|
|
7033
|
-
import { useState as
|
|
7105
|
+
import { useState as useState11 } from "react";
|
|
7034
7106
|
function useCallbackRef2(initialValue, callback) {
|
|
7035
|
-
var ref =
|
|
7107
|
+
var ref = useState11(function() {
|
|
7036
7108
|
return {
|
|
7037
7109
|
// value
|
|
7038
7110
|
value: initialValue,
|
|
@@ -7058,8 +7130,8 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
7058
7130
|
}
|
|
7059
7131
|
|
|
7060
7132
|
// ../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
|
|
7061
|
-
import * as
|
|
7062
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
7133
|
+
import * as React21 from "react";
|
|
7134
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React21.useLayoutEffect : React21.useEffect;
|
|
7063
7135
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
7064
7136
|
function useMergeRefs(refs, defaultValue) {
|
|
7065
7137
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -7176,7 +7248,7 @@ function createSidecarMedium(options) {
|
|
|
7176
7248
|
}
|
|
7177
7249
|
|
|
7178
7250
|
// ../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
|
|
7179
|
-
import * as
|
|
7251
|
+
import * as React25 from "react";
|
|
7180
7252
|
var SideCar = function(_a) {
|
|
7181
7253
|
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
7182
7254
|
if (!sideCar) {
|
|
@@ -7186,7 +7258,7 @@ var SideCar = function(_a) {
|
|
|
7186
7258
|
if (!Target) {
|
|
7187
7259
|
throw new Error("Sidecar medium not found");
|
|
7188
7260
|
}
|
|
7189
|
-
return
|
|
7261
|
+
return React25.createElement(Target, __assign({}, rest));
|
|
7190
7262
|
};
|
|
7191
7263
|
SideCar.isSideCarExport = true;
|
|
7192
7264
|
function exportSidecar(medium, exported) {
|
|
@@ -7201,9 +7273,9 @@ var effectCar = createSidecarMedium();
|
|
|
7201
7273
|
var nothing = function() {
|
|
7202
7274
|
return;
|
|
7203
7275
|
};
|
|
7204
|
-
var RemoveScroll =
|
|
7205
|
-
var ref =
|
|
7206
|
-
var _a =
|
|
7276
|
+
var RemoveScroll = React26.forwardRef(function(props, parentRef) {
|
|
7277
|
+
var ref = React26.useRef(null);
|
|
7278
|
+
var _a = React26.useState({
|
|
7207
7279
|
onScrollCapture: nothing,
|
|
7208
7280
|
onWheelCapture: nothing,
|
|
7209
7281
|
onTouchMoveCapture: nothing
|
|
@@ -7212,11 +7284,11 @@ var RemoveScroll = React27.forwardRef(function(props, parentRef) {
|
|
|
7212
7284
|
var SideCar2 = sideCar;
|
|
7213
7285
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
7214
7286
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
7215
|
-
return
|
|
7216
|
-
|
|
7287
|
+
return React26.createElement(
|
|
7288
|
+
React26.Fragment,
|
|
7217
7289
|
null,
|
|
7218
|
-
enabled &&
|
|
7219
|
-
forwardProps ?
|
|
7290
|
+
enabled && React26.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
7291
|
+
forwardProps ? React26.cloneElement(React26.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React26.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
7220
7292
|
);
|
|
7221
7293
|
});
|
|
7222
7294
|
RemoveScroll.defaultProps = {
|
|
@@ -7230,13 +7302,13 @@ RemoveScroll.classNames = {
|
|
|
7230
7302
|
};
|
|
7231
7303
|
|
|
7232
7304
|
// ../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
|
|
7233
|
-
import * as
|
|
7305
|
+
import * as React29 from "react";
|
|
7234
7306
|
|
|
7235
7307
|
// ../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
|
|
7236
|
-
import * as
|
|
7308
|
+
import * as React28 from "react";
|
|
7237
7309
|
|
|
7238
7310
|
// ../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
|
|
7239
|
-
import * as
|
|
7311
|
+
import * as React27 from "react";
|
|
7240
7312
|
|
|
7241
7313
|
// ../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
|
|
7242
7314
|
var currentNonce;
|
|
@@ -7300,7 +7372,7 @@ var stylesheetSingleton = function() {
|
|
|
7300
7372
|
var styleHookSingleton = function() {
|
|
7301
7373
|
var sheet = stylesheetSingleton();
|
|
7302
7374
|
return function(styles, isDynamic) {
|
|
7303
|
-
|
|
7375
|
+
React27.useEffect(function() {
|
|
7304
7376
|
sheet.add(styles);
|
|
7305
7377
|
return function() {
|
|
7306
7378
|
sheet.remove();
|
|
@@ -7374,7 +7446,7 @@ var getCurrentUseCounter = function() {
|
|
|
7374
7446
|
return isFinite(counter) ? counter : 0;
|
|
7375
7447
|
};
|
|
7376
7448
|
var useLockAttribute = function() {
|
|
7377
|
-
|
|
7449
|
+
React28.useEffect(function() {
|
|
7378
7450
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
7379
7451
|
return function() {
|
|
7380
7452
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -7389,10 +7461,10 @@ var useLockAttribute = function() {
|
|
|
7389
7461
|
var RemoveScrollBar = function(_a) {
|
|
7390
7462
|
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
7391
7463
|
useLockAttribute();
|
|
7392
|
-
var gap =
|
|
7464
|
+
var gap = React28.useMemo(function() {
|
|
7393
7465
|
return getGapWidth(gapMode);
|
|
7394
7466
|
}, [gapMode]);
|
|
7395
|
-
return
|
|
7467
|
+
return React28.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
7396
7468
|
};
|
|
7397
7469
|
|
|
7398
7470
|
// ../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
|
|
@@ -7533,16 +7605,16 @@ var generateStyle = function(id) {
|
|
|
7533
7605
|
var idCounter = 0;
|
|
7534
7606
|
var lockStack = [];
|
|
7535
7607
|
function RemoveScrollSideCar(props) {
|
|
7536
|
-
var shouldPreventQueue =
|
|
7537
|
-
var touchStartRef =
|
|
7538
|
-
var activeAxis =
|
|
7539
|
-
var id =
|
|
7540
|
-
var Style2 =
|
|
7541
|
-
var lastProps =
|
|
7542
|
-
|
|
7608
|
+
var shouldPreventQueue = React29.useRef([]);
|
|
7609
|
+
var touchStartRef = React29.useRef([0, 0]);
|
|
7610
|
+
var activeAxis = React29.useRef();
|
|
7611
|
+
var id = React29.useState(idCounter++)[0];
|
|
7612
|
+
var Style2 = React29.useState(styleSingleton)[0];
|
|
7613
|
+
var lastProps = React29.useRef(props);
|
|
7614
|
+
React29.useEffect(function() {
|
|
7543
7615
|
lastProps.current = props;
|
|
7544
7616
|
}, [props]);
|
|
7545
|
-
|
|
7617
|
+
React29.useEffect(function() {
|
|
7546
7618
|
if (props.inert) {
|
|
7547
7619
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
7548
7620
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -7558,7 +7630,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7558
7630
|
}
|
|
7559
7631
|
return;
|
|
7560
7632
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
7561
|
-
var shouldCancelEvent =
|
|
7633
|
+
var shouldCancelEvent = React29.useCallback(function(event, parent) {
|
|
7562
7634
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
7563
7635
|
return !lastProps.current.allowPinchZoom;
|
|
7564
7636
|
}
|
|
@@ -7594,7 +7666,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7594
7666
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
7595
7667
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
7596
7668
|
}, []);
|
|
7597
|
-
var shouldPrevent =
|
|
7669
|
+
var shouldPrevent = React29.useCallback(function(_event) {
|
|
7598
7670
|
var event = _event;
|
|
7599
7671
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
7600
7672
|
return;
|
|
@@ -7621,7 +7693,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7621
7693
|
}
|
|
7622
7694
|
}
|
|
7623
7695
|
}, []);
|
|
7624
|
-
var shouldCancel =
|
|
7696
|
+
var shouldCancel = React29.useCallback(function(name, delta, target, should) {
|
|
7625
7697
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
7626
7698
|
shouldPreventQueue.current.push(event);
|
|
7627
7699
|
setTimeout(function() {
|
|
@@ -7630,17 +7702,17 @@ function RemoveScrollSideCar(props) {
|
|
|
7630
7702
|
});
|
|
7631
7703
|
}, 1);
|
|
7632
7704
|
}, []);
|
|
7633
|
-
var scrollTouchStart =
|
|
7705
|
+
var scrollTouchStart = React29.useCallback(function(event) {
|
|
7634
7706
|
touchStartRef.current = getTouchXY(event);
|
|
7635
7707
|
activeAxis.current = void 0;
|
|
7636
7708
|
}, []);
|
|
7637
|
-
var scrollWheel =
|
|
7709
|
+
var scrollWheel = React29.useCallback(function(event) {
|
|
7638
7710
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7639
7711
|
}, []);
|
|
7640
|
-
var scrollTouchMove =
|
|
7712
|
+
var scrollTouchMove = React29.useCallback(function(event) {
|
|
7641
7713
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7642
7714
|
}, []);
|
|
7643
|
-
|
|
7715
|
+
React29.useEffect(function() {
|
|
7644
7716
|
lockStack.push(Style2);
|
|
7645
7717
|
props.setCallbacks({
|
|
7646
7718
|
onScrollCapture: scrollWheel,
|
|
@@ -7660,11 +7732,11 @@ function RemoveScrollSideCar(props) {
|
|
|
7660
7732
|
};
|
|
7661
7733
|
}, []);
|
|
7662
7734
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
7663
|
-
return
|
|
7664
|
-
|
|
7735
|
+
return React29.createElement(
|
|
7736
|
+
React29.Fragment,
|
|
7665
7737
|
null,
|
|
7666
|
-
inert ?
|
|
7667
|
-
removeScrollBar ?
|
|
7738
|
+
inert ? React29.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
7739
|
+
removeScrollBar ? React29.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
7668
7740
|
);
|
|
7669
7741
|
}
|
|
7670
7742
|
function getOutermostShadowParent(node) {
|
|
@@ -7683,8 +7755,8 @@ function getOutermostShadowParent(node) {
|
|
|
7683
7755
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
7684
7756
|
|
|
7685
7757
|
// ../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
|
|
7686
|
-
var ReactRemoveScroll =
|
|
7687
|
-
return
|
|
7758
|
+
var ReactRemoveScroll = React30.forwardRef(function(props, ref) {
|
|
7759
|
+
return React30.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
7688
7760
|
});
|
|
7689
7761
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
7690
7762
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -7810,7 +7882,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
|
7810
7882
|
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
7811
7883
|
};
|
|
7812
7884
|
|
|
7813
|
-
// ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
7885
|
+
// ../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
|
|
7814
7886
|
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
7815
7887
|
var DIALOG_NAME = "Dialog";
|
|
7816
7888
|
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
@@ -7824,8 +7896,8 @@ var Dialog = (props) => {
|
|
|
7824
7896
|
onOpenChange,
|
|
7825
7897
|
modal = true
|
|
7826
7898
|
} = props;
|
|
7827
|
-
const triggerRef =
|
|
7828
|
-
const contentRef =
|
|
7899
|
+
const triggerRef = React31.useRef(null);
|
|
7900
|
+
const contentRef = React31.useRef(null);
|
|
7829
7901
|
const [open, setOpen] = useControllableState({
|
|
7830
7902
|
prop: openProp,
|
|
7831
7903
|
defaultProp: defaultOpen ?? false,
|
|
@@ -7843,7 +7915,7 @@ var Dialog = (props) => {
|
|
|
7843
7915
|
descriptionId: useId(),
|
|
7844
7916
|
open,
|
|
7845
7917
|
onOpenChange: setOpen,
|
|
7846
|
-
onOpenToggle:
|
|
7918
|
+
onOpenToggle: React31.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
7847
7919
|
modal,
|
|
7848
7920
|
children
|
|
7849
7921
|
}
|
|
@@ -7851,7 +7923,7 @@ var Dialog = (props) => {
|
|
|
7851
7923
|
};
|
|
7852
7924
|
Dialog.displayName = DIALOG_NAME;
|
|
7853
7925
|
var TRIGGER_NAME3 = "DialogTrigger";
|
|
7854
|
-
var DialogTrigger =
|
|
7926
|
+
var DialogTrigger = React31.forwardRef(
|
|
7855
7927
|
(props, forwardedRef) => {
|
|
7856
7928
|
const { __scopeDialog, ...triggerProps } = props;
|
|
7857
7929
|
const context = useDialogContext(TRIGGER_NAME3, __scopeDialog);
|
|
@@ -7879,11 +7951,11 @@ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
|
|
|
7879
7951
|
var DialogPortal = (props) => {
|
|
7880
7952
|
const { __scopeDialog, forceMount, children, container } = props;
|
|
7881
7953
|
const context = useDialogContext(PORTAL_NAME2, __scopeDialog);
|
|
7882
|
-
return /* @__PURE__ */ jsx15(PortalProvider, { scope: __scopeDialog, forceMount, children:
|
|
7954
|
+
return /* @__PURE__ */ jsx15(PortalProvider, { scope: __scopeDialog, forceMount, children: React31.Children.map(children, (child) => /* @__PURE__ */ jsx15(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx15(Portal, { asChild: true, container, children: child }) })) });
|
|
7883
7955
|
};
|
|
7884
7956
|
DialogPortal.displayName = PORTAL_NAME2;
|
|
7885
7957
|
var OVERLAY_NAME = "DialogOverlay";
|
|
7886
|
-
var DialogOverlay =
|
|
7958
|
+
var DialogOverlay = React31.forwardRef(
|
|
7887
7959
|
(props, forwardedRef) => {
|
|
7888
7960
|
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
7889
7961
|
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
@@ -7893,7 +7965,7 @@ var DialogOverlay = React32.forwardRef(
|
|
|
7893
7965
|
);
|
|
7894
7966
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
7895
7967
|
var Slot2 = createSlot("DialogOverlay.RemoveScroll");
|
|
7896
|
-
var DialogOverlayImpl =
|
|
7968
|
+
var DialogOverlayImpl = React31.forwardRef(
|
|
7897
7969
|
(props, forwardedRef) => {
|
|
7898
7970
|
const { __scopeDialog, ...overlayProps } = props;
|
|
7899
7971
|
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
@@ -7913,7 +7985,7 @@ var DialogOverlayImpl = React32.forwardRef(
|
|
|
7913
7985
|
}
|
|
7914
7986
|
);
|
|
7915
7987
|
var CONTENT_NAME3 = "DialogContent";
|
|
7916
|
-
var DialogContent =
|
|
7988
|
+
var DialogContent = React31.forwardRef(
|
|
7917
7989
|
(props, forwardedRef) => {
|
|
7918
7990
|
const portalContext = usePortalContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7919
7991
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -7922,12 +7994,12 @@ var DialogContent = React32.forwardRef(
|
|
|
7922
7994
|
}
|
|
7923
7995
|
);
|
|
7924
7996
|
DialogContent.displayName = CONTENT_NAME3;
|
|
7925
|
-
var DialogContentModal =
|
|
7997
|
+
var DialogContentModal = React31.forwardRef(
|
|
7926
7998
|
(props, forwardedRef) => {
|
|
7927
7999
|
const context = useDialogContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7928
|
-
const contentRef =
|
|
8000
|
+
const contentRef = React31.useRef(null);
|
|
7929
8001
|
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
7930
|
-
|
|
8002
|
+
React31.useEffect(() => {
|
|
7931
8003
|
const content = contentRef.current;
|
|
7932
8004
|
if (content) return hideOthers(content);
|
|
7933
8005
|
}, []);
|
|
@@ -7956,11 +8028,11 @@ var DialogContentModal = React32.forwardRef(
|
|
|
7956
8028
|
);
|
|
7957
8029
|
}
|
|
7958
8030
|
);
|
|
7959
|
-
var DialogContentNonModal =
|
|
8031
|
+
var DialogContentNonModal = React31.forwardRef(
|
|
7960
8032
|
(props, forwardedRef) => {
|
|
7961
8033
|
const context = useDialogContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7962
|
-
const hasInteractedOutsideRef =
|
|
7963
|
-
const hasPointerDownOutsideRef =
|
|
8034
|
+
const hasInteractedOutsideRef = React31.useRef(false);
|
|
8035
|
+
const hasPointerDownOutsideRef = React31.useRef(false);
|
|
7964
8036
|
return /* @__PURE__ */ jsx15(
|
|
7965
8037
|
DialogContentImpl,
|
|
7966
8038
|
{
|
|
@@ -7996,11 +8068,11 @@ var DialogContentNonModal = React32.forwardRef(
|
|
|
7996
8068
|
);
|
|
7997
8069
|
}
|
|
7998
8070
|
);
|
|
7999
|
-
var DialogContentImpl =
|
|
8071
|
+
var DialogContentImpl = React31.forwardRef(
|
|
8000
8072
|
(props, forwardedRef) => {
|
|
8001
8073
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
8002
8074
|
const context = useDialogContext(CONTENT_NAME3, __scopeDialog);
|
|
8003
|
-
const contentRef =
|
|
8075
|
+
const contentRef = React31.useRef(null);
|
|
8004
8076
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
8005
8077
|
useFocusGuards();
|
|
8006
8078
|
return /* @__PURE__ */ jsxs3(Fragment5, { children: [
|
|
@@ -8035,7 +8107,7 @@ var DialogContentImpl = React32.forwardRef(
|
|
|
8035
8107
|
}
|
|
8036
8108
|
);
|
|
8037
8109
|
var TITLE_NAME = "DialogTitle";
|
|
8038
|
-
var DialogTitle =
|
|
8110
|
+
var DialogTitle = React31.forwardRef(
|
|
8039
8111
|
(props, forwardedRef) => {
|
|
8040
8112
|
const { __scopeDialog, ...titleProps } = props;
|
|
8041
8113
|
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
@@ -8044,7 +8116,7 @@ var DialogTitle = React32.forwardRef(
|
|
|
8044
8116
|
);
|
|
8045
8117
|
DialogTitle.displayName = TITLE_NAME;
|
|
8046
8118
|
var DESCRIPTION_NAME = "DialogDescription";
|
|
8047
|
-
var DialogDescription =
|
|
8119
|
+
var DialogDescription = React31.forwardRef(
|
|
8048
8120
|
(props, forwardedRef) => {
|
|
8049
8121
|
const { __scopeDialog, ...descriptionProps } = props;
|
|
8050
8122
|
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
@@ -8053,7 +8125,7 @@ var DialogDescription = React32.forwardRef(
|
|
|
8053
8125
|
);
|
|
8054
8126
|
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
8055
8127
|
var CLOSE_NAME = "DialogClose";
|
|
8056
|
-
var DialogClose =
|
|
8128
|
+
var DialogClose = React31.forwardRef(
|
|
8057
8129
|
(props, forwardedRef) => {
|
|
8058
8130
|
const { __scopeDialog, ...closeProps } = props;
|
|
8059
8131
|
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
@@ -8085,7 +8157,7 @@ var TitleWarning = ({ titleId }) => {
|
|
|
8085
8157
|
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
8086
8158
|
|
|
8087
8159
|
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
8088
|
-
|
|
8160
|
+
React31.useEffect(() => {
|
|
8089
8161
|
if (titleId) {
|
|
8090
8162
|
const hasTitle = document.getElementById(titleId);
|
|
8091
8163
|
if (!hasTitle) console.error(MESSAGE);
|
|
@@ -8097,7 +8169,7 @@ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
|
8097
8169
|
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
8098
8170
|
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
8099
8171
|
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
8100
|
-
|
|
8172
|
+
React31.useEffect(() => {
|
|
8101
8173
|
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
8102
8174
|
if (descriptionId && describedById) {
|
|
8103
8175
|
const hasDescription = document.getElementById(descriptionId);
|
|
@@ -8123,7 +8195,7 @@ var DialogPortal2 = ({
|
|
|
8123
8195
|
}) => {
|
|
8124
8196
|
return /* @__PURE__ */ jsx16(Portal2, { ...props, children: /* @__PURE__ */ jsx16("div", { className: "au-root", children }) });
|
|
8125
8197
|
};
|
|
8126
|
-
var DialogOverlay2 =
|
|
8198
|
+
var DialogOverlay2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
8127
8199
|
Overlay,
|
|
8128
8200
|
{
|
|
8129
8201
|
ref,
|
|
@@ -8135,7 +8207,7 @@ var DialogOverlay2 = React33.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
8135
8207
|
}
|
|
8136
8208
|
));
|
|
8137
8209
|
DialogOverlay2.displayName = Overlay.displayName;
|
|
8138
|
-
var DialogContent2 =
|
|
8210
|
+
var DialogContent2 = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs4(DialogPortal2, { children: [
|
|
8139
8211
|
/* @__PURE__ */ jsx16(DialogOverlay2, {}),
|
|
8140
8212
|
/* @__PURE__ */ jsxs4(
|
|
8141
8213
|
Content3,
|
|
@@ -8185,7 +8257,7 @@ var DialogFooter = ({
|
|
|
8185
8257
|
}
|
|
8186
8258
|
);
|
|
8187
8259
|
DialogFooter.displayName = "DialogFooter";
|
|
8188
|
-
var DialogTitle2 =
|
|
8260
|
+
var DialogTitle2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
8189
8261
|
Title,
|
|
8190
8262
|
{
|
|
8191
8263
|
ref,
|
|
@@ -8197,7 +8269,7 @@ var DialogTitle2 = React33.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
8197
8269
|
}
|
|
8198
8270
|
));
|
|
8199
8271
|
DialogTitle2.displayName = Title.displayName;
|
|
8200
|
-
var DialogDescription2 =
|
|
8272
|
+
var DialogDescription2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
8201
8273
|
Description,
|
|
8202
8274
|
{
|
|
8203
8275
|
ref,
|
|
@@ -8208,9 +8280,9 @@ var DialogDescription2 = React33.forwardRef(({ className, ...props }, ref) => /*
|
|
|
8208
8280
|
DialogDescription2.displayName = Description.displayName;
|
|
8209
8281
|
|
|
8210
8282
|
// src/libraries/react/components/ui/input.tsx
|
|
8211
|
-
import * as
|
|
8283
|
+
import * as React33 from "react";
|
|
8212
8284
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
8213
|
-
var Input =
|
|
8285
|
+
var Input = React33.forwardRef(
|
|
8214
8286
|
({ className, type, onClick, ...props }, ref) => {
|
|
8215
8287
|
return /* @__PURE__ */ jsx17(
|
|
8216
8288
|
"input",
|
|
@@ -8229,14 +8301,14 @@ var Input = React34.forwardRef(
|
|
|
8229
8301
|
Input.displayName = "Input";
|
|
8230
8302
|
|
|
8231
8303
|
// src/libraries/react/components/ui/popover.tsx
|
|
8232
|
-
import * as React40 from "react";
|
|
8233
|
-
|
|
8234
|
-
// ../node_modules/.pnpm/@radix-ui+react-popover@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+rea_361550b787f32d6b9c5c274e470f0ceb/node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
8235
8304
|
import * as React39 from "react";
|
|
8236
8305
|
|
|
8237
|
-
// ../node_modules/.pnpm/@radix-ui+react-
|
|
8306
|
+
// ../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
|
|
8238
8307
|
import * as React38 from "react";
|
|
8239
8308
|
|
|
8309
|
+
// ../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
|
|
8310
|
+
import * as React37 from "react";
|
|
8311
|
+
|
|
8240
8312
|
// ../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
8241
8313
|
var sides = ["top", "right", "bottom", "left"];
|
|
8242
8314
|
var min = Math.min;
|
|
@@ -9836,7 +9908,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
9836
9908
|
};
|
|
9837
9909
|
|
|
9838
9910
|
// ../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
|
|
9839
|
-
import * as
|
|
9911
|
+
import * as React34 from "react";
|
|
9840
9912
|
import { useLayoutEffect as useLayoutEffect4 } from "react";
|
|
9841
9913
|
import * as ReactDOM3 from "react-dom";
|
|
9842
9914
|
var isClient = typeof document !== "undefined";
|
|
@@ -9902,7 +9974,7 @@ function roundByDPR(element, value) {
|
|
|
9902
9974
|
return Math.round(value * dpr) / dpr;
|
|
9903
9975
|
}
|
|
9904
9976
|
function useLatestRef(value) {
|
|
9905
|
-
const ref =
|
|
9977
|
+
const ref = React34.useRef(value);
|
|
9906
9978
|
index(() => {
|
|
9907
9979
|
ref.current = value;
|
|
9908
9980
|
});
|
|
@@ -9925,7 +9997,7 @@ function useFloating(options) {
|
|
|
9925
9997
|
whileElementsMounted,
|
|
9926
9998
|
open
|
|
9927
9999
|
} = options;
|
|
9928
|
-
const [data, setData] =
|
|
10000
|
+
const [data, setData] = React34.useState({
|
|
9929
10001
|
x: 0,
|
|
9930
10002
|
y: 0,
|
|
9931
10003
|
strategy,
|
|
@@ -9933,19 +10005,19 @@ function useFloating(options) {
|
|
|
9933
10005
|
middlewareData: {},
|
|
9934
10006
|
isPositioned: false
|
|
9935
10007
|
});
|
|
9936
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
10008
|
+
const [latestMiddleware, setLatestMiddleware] = React34.useState(middleware);
|
|
9937
10009
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
9938
10010
|
setLatestMiddleware(middleware);
|
|
9939
10011
|
}
|
|
9940
|
-
const [_reference, _setReference] =
|
|
9941
|
-
const [_floating, _setFloating] =
|
|
9942
|
-
const setReference =
|
|
10012
|
+
const [_reference, _setReference] = React34.useState(null);
|
|
10013
|
+
const [_floating, _setFloating] = React34.useState(null);
|
|
10014
|
+
const setReference = React34.useCallback((node) => {
|
|
9943
10015
|
if (node !== referenceRef.current) {
|
|
9944
10016
|
referenceRef.current = node;
|
|
9945
10017
|
_setReference(node);
|
|
9946
10018
|
}
|
|
9947
10019
|
}, []);
|
|
9948
|
-
const setFloating =
|
|
10020
|
+
const setFloating = React34.useCallback((node) => {
|
|
9949
10021
|
if (node !== floatingRef.current) {
|
|
9950
10022
|
floatingRef.current = node;
|
|
9951
10023
|
_setFloating(node);
|
|
@@ -9953,14 +10025,14 @@ function useFloating(options) {
|
|
|
9953
10025
|
}, []);
|
|
9954
10026
|
const referenceEl = externalReference || _reference;
|
|
9955
10027
|
const floatingEl = externalFloating || _floating;
|
|
9956
|
-
const referenceRef =
|
|
9957
|
-
const floatingRef =
|
|
9958
|
-
const dataRef =
|
|
10028
|
+
const referenceRef = React34.useRef(null);
|
|
10029
|
+
const floatingRef = React34.useRef(null);
|
|
10030
|
+
const dataRef = React34.useRef(data);
|
|
9959
10031
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
9960
10032
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
9961
10033
|
const platformRef = useLatestRef(platform2);
|
|
9962
10034
|
const openRef = useLatestRef(open);
|
|
9963
|
-
const update =
|
|
10035
|
+
const update = React34.useCallback(() => {
|
|
9964
10036
|
if (!referenceRef.current || !floatingRef.current) {
|
|
9965
10037
|
return;
|
|
9966
10038
|
}
|
|
@@ -9998,7 +10070,7 @@ function useFloating(options) {
|
|
|
9998
10070
|
}));
|
|
9999
10071
|
}
|
|
10000
10072
|
}, [open]);
|
|
10001
|
-
const isMountedRef =
|
|
10073
|
+
const isMountedRef = React34.useRef(false);
|
|
10002
10074
|
index(() => {
|
|
10003
10075
|
isMountedRef.current = true;
|
|
10004
10076
|
return () => {
|
|
@@ -10015,17 +10087,17 @@ function useFloating(options) {
|
|
|
10015
10087
|
update();
|
|
10016
10088
|
}
|
|
10017
10089
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
10018
|
-
const refs =
|
|
10090
|
+
const refs = React34.useMemo(() => ({
|
|
10019
10091
|
reference: referenceRef,
|
|
10020
10092
|
floating: floatingRef,
|
|
10021
10093
|
setReference,
|
|
10022
10094
|
setFloating
|
|
10023
10095
|
}), [setReference, setFloating]);
|
|
10024
|
-
const elements =
|
|
10096
|
+
const elements = React34.useMemo(() => ({
|
|
10025
10097
|
reference: referenceEl,
|
|
10026
10098
|
floating: floatingEl
|
|
10027
10099
|
}), [referenceEl, floatingEl]);
|
|
10028
|
-
const floatingStyles =
|
|
10100
|
+
const floatingStyles = React34.useMemo(() => {
|
|
10029
10101
|
const initialStyles = {
|
|
10030
10102
|
position: strategy,
|
|
10031
10103
|
left: 0,
|
|
@@ -10051,7 +10123,7 @@ function useFloating(options) {
|
|
|
10051
10123
|
top: y
|
|
10052
10124
|
};
|
|
10053
10125
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
10054
|
-
return
|
|
10126
|
+
return React34.useMemo(() => ({
|
|
10055
10127
|
...data,
|
|
10056
10128
|
update,
|
|
10057
10129
|
refs,
|
|
@@ -10119,11 +10191,11 @@ var arrow3 = (options, deps) => ({
|
|
|
10119
10191
|
options: [options, deps]
|
|
10120
10192
|
});
|
|
10121
10193
|
|
|
10122
|
-
// ../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@
|
|
10123
|
-
import * as
|
|
10194
|
+
// ../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
|
|
10195
|
+
import * as React35 from "react";
|
|
10124
10196
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
10125
10197
|
var NAME = "Arrow";
|
|
10126
|
-
var Arrow =
|
|
10198
|
+
var Arrow = React35.forwardRef((props, forwardedRef) => {
|
|
10127
10199
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
10128
10200
|
return /* @__PURE__ */ jsx18(
|
|
10129
10201
|
Primitive.svg,
|
|
@@ -10142,9 +10214,9 @@ Arrow.displayName = NAME;
|
|
|
10142
10214
|
var Root4 = Arrow;
|
|
10143
10215
|
|
|
10144
10216
|
// ../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
|
|
10145
|
-
import * as
|
|
10217
|
+
import * as React36 from "react";
|
|
10146
10218
|
function useSize(element) {
|
|
10147
|
-
const [size4, setSize] =
|
|
10219
|
+
const [size4, setSize] = React36.useState(void 0);
|
|
10148
10220
|
useLayoutEffect2(() => {
|
|
10149
10221
|
if (element) {
|
|
10150
10222
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -10178,25 +10250,25 @@ function useSize(element) {
|
|
|
10178
10250
|
return size4;
|
|
10179
10251
|
}
|
|
10180
10252
|
|
|
10181
|
-
// ../node_modules/.pnpm/@radix-ui+react-popper@1.2.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
10253
|
+
// ../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
|
|
10182
10254
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
10183
10255
|
var POPPER_NAME = "Popper";
|
|
10184
10256
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
10185
10257
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
10186
10258
|
var Popper = (props) => {
|
|
10187
10259
|
const { __scopePopper, children } = props;
|
|
10188
|
-
const [anchor, setAnchor] =
|
|
10260
|
+
const [anchor, setAnchor] = React37.useState(null);
|
|
10189
10261
|
return /* @__PURE__ */ jsx19(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
10190
10262
|
};
|
|
10191
10263
|
Popper.displayName = POPPER_NAME;
|
|
10192
10264
|
var ANCHOR_NAME = "PopperAnchor";
|
|
10193
|
-
var PopperAnchor =
|
|
10265
|
+
var PopperAnchor = React37.forwardRef(
|
|
10194
10266
|
(props, forwardedRef) => {
|
|
10195
10267
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
10196
10268
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
10197
|
-
const ref =
|
|
10269
|
+
const ref = React37.useRef(null);
|
|
10198
10270
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10199
|
-
|
|
10271
|
+
React37.useEffect(() => {
|
|
10200
10272
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
10201
10273
|
});
|
|
10202
10274
|
return virtualRef ? null : /* @__PURE__ */ jsx19(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
@@ -10205,7 +10277,7 @@ var PopperAnchor = React38.forwardRef(
|
|
|
10205
10277
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
10206
10278
|
var CONTENT_NAME4 = "PopperContent";
|
|
10207
10279
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME4);
|
|
10208
|
-
var PopperContent =
|
|
10280
|
+
var PopperContent = React37.forwardRef(
|
|
10209
10281
|
(props, forwardedRef) => {
|
|
10210
10282
|
const {
|
|
10211
10283
|
__scopePopper,
|
|
@@ -10224,9 +10296,9 @@ var PopperContent = React38.forwardRef(
|
|
|
10224
10296
|
...contentProps
|
|
10225
10297
|
} = props;
|
|
10226
10298
|
const context = usePopperContext(CONTENT_NAME4, __scopePopper);
|
|
10227
|
-
const [content, setContent] =
|
|
10299
|
+
const [content, setContent] = React37.useState(null);
|
|
10228
10300
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
10229
|
-
const [arrow4, setArrow] =
|
|
10301
|
+
const [arrow4, setArrow] = React37.useState(null);
|
|
10230
10302
|
const arrowSize = useSize(arrow4);
|
|
10231
10303
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
10232
10304
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -10288,7 +10360,7 @@ var PopperContent = React38.forwardRef(
|
|
|
10288
10360
|
const arrowX = middlewareData.arrow?.x;
|
|
10289
10361
|
const arrowY = middlewareData.arrow?.y;
|
|
10290
10362
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
10291
|
-
const [contentZIndex, setContentZIndex] =
|
|
10363
|
+
const [contentZIndex, setContentZIndex] = React37.useState();
|
|
10292
10364
|
useLayoutEffect2(() => {
|
|
10293
10365
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
10294
10366
|
}, [content]);
|
|
@@ -10354,7 +10426,7 @@ var OPPOSITE_SIDE = {
|
|
|
10354
10426
|
bottom: "top",
|
|
10355
10427
|
left: "right"
|
|
10356
10428
|
};
|
|
10357
|
-
var PopperArrow =
|
|
10429
|
+
var PopperArrow = React37.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
10358
10430
|
const { __scopePopper, ...arrowProps } = props;
|
|
10359
10431
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
10360
10432
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -10445,7 +10517,7 @@ var Anchor = PopperAnchor;
|
|
|
10445
10517
|
var Content4 = PopperContent;
|
|
10446
10518
|
var Arrow2 = PopperArrow;
|
|
10447
10519
|
|
|
10448
|
-
// ../node_modules/.pnpm/@radix-ui+react-popover@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
10520
|
+
// ../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
|
|
10449
10521
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
10450
10522
|
var POPOVER_NAME = "Popover";
|
|
10451
10523
|
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
@@ -10463,8 +10535,8 @@ var Popover = (props) => {
|
|
|
10463
10535
|
modal = false
|
|
10464
10536
|
} = props;
|
|
10465
10537
|
const popperScope = usePopperScope(__scopePopover);
|
|
10466
|
-
const triggerRef =
|
|
10467
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
10538
|
+
const triggerRef = React38.useRef(null);
|
|
10539
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React38.useState(false);
|
|
10468
10540
|
const [open, setOpen] = useControllableState({
|
|
10469
10541
|
prop: openProp,
|
|
10470
10542
|
defaultProp: defaultOpen ?? false,
|
|
@@ -10479,10 +10551,10 @@ var Popover = (props) => {
|
|
|
10479
10551
|
triggerRef,
|
|
10480
10552
|
open,
|
|
10481
10553
|
onOpenChange: setOpen,
|
|
10482
|
-
onOpenToggle:
|
|
10554
|
+
onOpenToggle: React38.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
10483
10555
|
hasCustomAnchor,
|
|
10484
|
-
onCustomAnchorAdd:
|
|
10485
|
-
onCustomAnchorRemove:
|
|
10556
|
+
onCustomAnchorAdd: React38.useCallback(() => setHasCustomAnchor(true), []),
|
|
10557
|
+
onCustomAnchorRemove: React38.useCallback(() => setHasCustomAnchor(false), []),
|
|
10486
10558
|
modal,
|
|
10487
10559
|
children
|
|
10488
10560
|
}
|
|
@@ -10490,13 +10562,13 @@ var Popover = (props) => {
|
|
|
10490
10562
|
};
|
|
10491
10563
|
Popover.displayName = POPOVER_NAME;
|
|
10492
10564
|
var ANCHOR_NAME2 = "PopoverAnchor";
|
|
10493
|
-
var PopoverAnchor =
|
|
10565
|
+
var PopoverAnchor = React38.forwardRef(
|
|
10494
10566
|
(props, forwardedRef) => {
|
|
10495
10567
|
const { __scopePopover, ...anchorProps } = props;
|
|
10496
10568
|
const context = usePopoverContext(ANCHOR_NAME2, __scopePopover);
|
|
10497
10569
|
const popperScope = usePopperScope(__scopePopover);
|
|
10498
10570
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
10499
|
-
|
|
10571
|
+
React38.useEffect(() => {
|
|
10500
10572
|
onCustomAnchorAdd();
|
|
10501
10573
|
return () => onCustomAnchorRemove();
|
|
10502
10574
|
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
@@ -10505,7 +10577,7 @@ var PopoverAnchor = React39.forwardRef(
|
|
|
10505
10577
|
);
|
|
10506
10578
|
PopoverAnchor.displayName = ANCHOR_NAME2;
|
|
10507
10579
|
var TRIGGER_NAME4 = "PopoverTrigger";
|
|
10508
|
-
var PopoverTrigger =
|
|
10580
|
+
var PopoverTrigger = React38.forwardRef(
|
|
10509
10581
|
(props, forwardedRef) => {
|
|
10510
10582
|
const { __scopePopover, ...triggerProps } = props;
|
|
10511
10583
|
const context = usePopoverContext(TRIGGER_NAME4, __scopePopover);
|
|
@@ -10539,7 +10611,7 @@ var PopoverPortal = (props) => {
|
|
|
10539
10611
|
};
|
|
10540
10612
|
PopoverPortal.displayName = PORTAL_NAME3;
|
|
10541
10613
|
var CONTENT_NAME5 = "PopoverContent";
|
|
10542
|
-
var PopoverContent =
|
|
10614
|
+
var PopoverContent = React38.forwardRef(
|
|
10543
10615
|
(props, forwardedRef) => {
|
|
10544
10616
|
const portalContext = usePortalContext2(CONTENT_NAME5, props.__scopePopover);
|
|
10545
10617
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -10549,13 +10621,13 @@ var PopoverContent = React39.forwardRef(
|
|
|
10549
10621
|
);
|
|
10550
10622
|
PopoverContent.displayName = CONTENT_NAME5;
|
|
10551
10623
|
var Slot3 = createSlot("PopoverContent.RemoveScroll");
|
|
10552
|
-
var PopoverContentModal =
|
|
10624
|
+
var PopoverContentModal = React38.forwardRef(
|
|
10553
10625
|
(props, forwardedRef) => {
|
|
10554
10626
|
const context = usePopoverContext(CONTENT_NAME5, props.__scopePopover);
|
|
10555
|
-
const contentRef =
|
|
10627
|
+
const contentRef = React38.useRef(null);
|
|
10556
10628
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
10557
|
-
const isRightClickOutsideRef =
|
|
10558
|
-
|
|
10629
|
+
const isRightClickOutsideRef = React38.useRef(false);
|
|
10630
|
+
React38.useEffect(() => {
|
|
10559
10631
|
const content = contentRef.current;
|
|
10560
10632
|
if (content) return hideOthers(content);
|
|
10561
10633
|
}, []);
|
|
@@ -10589,11 +10661,11 @@ var PopoverContentModal = React39.forwardRef(
|
|
|
10589
10661
|
) });
|
|
10590
10662
|
}
|
|
10591
10663
|
);
|
|
10592
|
-
var PopoverContentNonModal =
|
|
10664
|
+
var PopoverContentNonModal = React38.forwardRef(
|
|
10593
10665
|
(props, forwardedRef) => {
|
|
10594
10666
|
const context = usePopoverContext(CONTENT_NAME5, props.__scopePopover);
|
|
10595
|
-
const hasInteractedOutsideRef =
|
|
10596
|
-
const hasPointerDownOutsideRef =
|
|
10667
|
+
const hasInteractedOutsideRef = React38.useRef(false);
|
|
10668
|
+
const hasPointerDownOutsideRef = React38.useRef(false);
|
|
10597
10669
|
return /* @__PURE__ */ jsx20(
|
|
10598
10670
|
PopoverContentImpl,
|
|
10599
10671
|
{
|
|
@@ -10629,7 +10701,7 @@ var PopoverContentNonModal = React39.forwardRef(
|
|
|
10629
10701
|
);
|
|
10630
10702
|
}
|
|
10631
10703
|
);
|
|
10632
|
-
var PopoverContentImpl =
|
|
10704
|
+
var PopoverContentImpl = React38.forwardRef(
|
|
10633
10705
|
(props, forwardedRef) => {
|
|
10634
10706
|
const {
|
|
10635
10707
|
__scopePopover,
|
|
@@ -10693,7 +10765,7 @@ var PopoverContentImpl = React39.forwardRef(
|
|
|
10693
10765
|
}
|
|
10694
10766
|
);
|
|
10695
10767
|
var CLOSE_NAME2 = "PopoverClose";
|
|
10696
|
-
var PopoverClose =
|
|
10768
|
+
var PopoverClose = React38.forwardRef(
|
|
10697
10769
|
(props, forwardedRef) => {
|
|
10698
10770
|
const { __scopePopover, ...closeProps } = props;
|
|
10699
10771
|
const context = usePopoverContext(CLOSE_NAME2, __scopePopover);
|
|
@@ -10710,7 +10782,7 @@ var PopoverClose = React39.forwardRef(
|
|
|
10710
10782
|
);
|
|
10711
10783
|
PopoverClose.displayName = CLOSE_NAME2;
|
|
10712
10784
|
var ARROW_NAME2 = "PopoverArrow";
|
|
10713
|
-
var PopoverArrow =
|
|
10785
|
+
var PopoverArrow = React38.forwardRef(
|
|
10714
10786
|
(props, forwardedRef) => {
|
|
10715
10787
|
const { __scopePopover, ...arrowProps } = props;
|
|
10716
10788
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -10729,7 +10801,7 @@ var Content22 = PopoverContent;
|
|
|
10729
10801
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
10730
10802
|
var Popover2 = Root23;
|
|
10731
10803
|
var PopoverTrigger2 = Trigger4;
|
|
10732
|
-
var PopoverContent2 =
|
|
10804
|
+
var PopoverContent2 = React39.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
10733
10805
|
Content22,
|
|
10734
10806
|
{
|
|
10735
10807
|
ref,
|
|
@@ -10909,13 +10981,13 @@ var formatCurrency = ({
|
|
|
10909
10981
|
};
|
|
10910
10982
|
function CheckoutDialog(params) {
|
|
10911
10983
|
const { attach } = useCustomer();
|
|
10912
|
-
const [checkoutResult, setCheckoutResult] =
|
|
10913
|
-
|
|
10984
|
+
const [checkoutResult, setCheckoutResult] = useState18(params?.checkoutResult);
|
|
10985
|
+
useEffect18(() => {
|
|
10914
10986
|
if (params.checkoutResult) {
|
|
10915
10987
|
setCheckoutResult(params.checkoutResult);
|
|
10916
10988
|
}
|
|
10917
10989
|
}, [params.checkoutResult]);
|
|
10918
|
-
const [loading, setLoading] =
|
|
10990
|
+
const [loading, setLoading] = useState18(false);
|
|
10919
10991
|
if (!checkoutResult) {
|
|
10920
10992
|
return /* @__PURE__ */ jsx24(Fragment6, {});
|
|
10921
10993
|
}
|
|
@@ -11090,12 +11162,12 @@ var PrepaidItem = ({
|
|
|
11090
11162
|
setCheckoutResult
|
|
11091
11163
|
}) => {
|
|
11092
11164
|
const { quantity = 0, billing_units: billingUnits = 1 } = item;
|
|
11093
|
-
const [quantityInput, setQuantityInput] =
|
|
11165
|
+
const [quantityInput, setQuantityInput] = useState18(
|
|
11094
11166
|
(quantity / billingUnits).toString()
|
|
11095
11167
|
);
|
|
11096
11168
|
const { checkout } = useCustomer();
|
|
11097
|
-
const [loading, setLoading] =
|
|
11098
|
-
const [open, setOpen] =
|
|
11169
|
+
const [loading, setLoading] = useState18(false);
|
|
11170
|
+
const [open, setOpen] = useState18(false);
|
|
11099
11171
|
const scenario = checkoutResult.product.scenario;
|
|
11100
11172
|
const handleSave = async () => {
|
|
11101
11173
|
setLoading(true);
|
|
@@ -11281,20 +11353,20 @@ function PaywallDialog(params) {
|
|
|
11281
11353
|
}
|
|
11282
11354
|
|
|
11283
11355
|
// src/libraries/react/components/pricing-table/pricing-table-synced.tsx
|
|
11284
|
-
import
|
|
11285
|
-
import { createContext as createContext5, useContext as useContext6, useState as
|
|
11356
|
+
import React43 from "react";
|
|
11357
|
+
import { createContext as createContext5, useContext as useContext6, useState as useState20 } from "react";
|
|
11286
11358
|
|
|
11287
11359
|
// src/libraries/react/components/ui/switch.tsx
|
|
11288
|
-
import * as React43 from "react";
|
|
11289
|
-
|
|
11290
|
-
// ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react_d116794fd29880b88b610a986963c8dd/node_modules/@radix-ui/react-switch/dist/index.mjs
|
|
11291
11360
|
import * as React42 from "react";
|
|
11292
11361
|
|
|
11293
|
-
// ../node_modules/.pnpm/@radix-ui+react-
|
|
11362
|
+
// ../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
|
|
11294
11363
|
import * as React41 from "react";
|
|
11364
|
+
|
|
11365
|
+
// ../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
|
|
11366
|
+
import * as React40 from "react";
|
|
11295
11367
|
function usePrevious(value) {
|
|
11296
|
-
const ref =
|
|
11297
|
-
return
|
|
11368
|
+
const ref = React40.useRef({ value, previous: value });
|
|
11369
|
+
return React40.useMemo(() => {
|
|
11298
11370
|
if (ref.current.value !== value) {
|
|
11299
11371
|
ref.current.previous = ref.current.value;
|
|
11300
11372
|
ref.current.value = value;
|
|
@@ -11303,12 +11375,12 @@ function usePrevious(value) {
|
|
|
11303
11375
|
}, [value]);
|
|
11304
11376
|
}
|
|
11305
11377
|
|
|
11306
|
-
// ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
11378
|
+
// ../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
|
|
11307
11379
|
import { jsx as jsx26, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
11308
11380
|
var SWITCH_NAME = "Switch";
|
|
11309
11381
|
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
|
11310
11382
|
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
11311
|
-
var Switch =
|
|
11383
|
+
var Switch = React41.forwardRef(
|
|
11312
11384
|
(props, forwardedRef) => {
|
|
11313
11385
|
const {
|
|
11314
11386
|
__scopeSwitch,
|
|
@@ -11322,9 +11394,9 @@ var Switch = React42.forwardRef(
|
|
|
11322
11394
|
form,
|
|
11323
11395
|
...switchProps
|
|
11324
11396
|
} = props;
|
|
11325
|
-
const [button, setButton] =
|
|
11397
|
+
const [button, setButton] = React41.useState(null);
|
|
11326
11398
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
11327
|
-
const hasConsumerStoppedPropagationRef =
|
|
11399
|
+
const hasConsumerStoppedPropagationRef = React41.useRef(false);
|
|
11328
11400
|
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
11329
11401
|
const [checked, setChecked] = useControllableState({
|
|
11330
11402
|
prop: checkedProp,
|
|
@@ -11374,7 +11446,7 @@ var Switch = React42.forwardRef(
|
|
|
11374
11446
|
);
|
|
11375
11447
|
Switch.displayName = SWITCH_NAME;
|
|
11376
11448
|
var THUMB_NAME = "SwitchThumb";
|
|
11377
|
-
var SwitchThumb =
|
|
11449
|
+
var SwitchThumb = React41.forwardRef(
|
|
11378
11450
|
(props, forwardedRef) => {
|
|
11379
11451
|
const { __scopeSwitch, ...thumbProps } = props;
|
|
11380
11452
|
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
|
@@ -11391,7 +11463,7 @@ var SwitchThumb = React42.forwardRef(
|
|
|
11391
11463
|
);
|
|
11392
11464
|
SwitchThumb.displayName = THUMB_NAME;
|
|
11393
11465
|
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
|
11394
|
-
var SwitchBubbleInput =
|
|
11466
|
+
var SwitchBubbleInput = React41.forwardRef(
|
|
11395
11467
|
({
|
|
11396
11468
|
__scopeSwitch,
|
|
11397
11469
|
control,
|
|
@@ -11399,11 +11471,11 @@ var SwitchBubbleInput = React42.forwardRef(
|
|
|
11399
11471
|
bubbles = true,
|
|
11400
11472
|
...props
|
|
11401
11473
|
}, forwardedRef) => {
|
|
11402
|
-
const ref =
|
|
11474
|
+
const ref = React41.useRef(null);
|
|
11403
11475
|
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
11404
11476
|
const prevChecked = usePrevious(checked);
|
|
11405
11477
|
const controlSize = useSize(control);
|
|
11406
|
-
|
|
11478
|
+
React41.useEffect(() => {
|
|
11407
11479
|
const input = ref.current;
|
|
11408
11480
|
if (!input) return;
|
|
11409
11481
|
const inputProto = window.HTMLInputElement.prototype;
|
|
@@ -11448,7 +11520,7 @@ var Thumb = SwitchThumb;
|
|
|
11448
11520
|
|
|
11449
11521
|
// src/libraries/react/components/ui/switch.tsx
|
|
11450
11522
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
11451
|
-
var Switch2 =
|
|
11523
|
+
var Switch2 = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
11452
11524
|
Root5,
|
|
11453
11525
|
{
|
|
11454
11526
|
className: cn(
|
|
@@ -11561,7 +11633,7 @@ function PricingTable({
|
|
|
11561
11633
|
productDetails
|
|
11562
11634
|
}) {
|
|
11563
11635
|
const { customer, checkout } = useCustomer({ errorOnNotFound: false });
|
|
11564
|
-
const [isAnnual, setIsAnnual] =
|
|
11636
|
+
const [isAnnual, setIsAnnual] = useState20(false);
|
|
11565
11637
|
const { products, isLoading, error } = usePricingTable({ productDetails });
|
|
11566
11638
|
if (isLoading) {
|
|
11567
11639
|
return /* @__PURE__ */ jsx29("div", { style: loadingStyles, children: /* @__PURE__ */ jsx29(LoaderCircle, { style: spinnerStyles }) });
|
|
@@ -11791,8 +11863,8 @@ var PricingFeatureList = ({
|
|
|
11791
11863
|
)) })
|
|
11792
11864
|
] });
|
|
11793
11865
|
};
|
|
11794
|
-
var PricingCardButton =
|
|
11795
|
-
const [loading, setLoading] =
|
|
11866
|
+
var PricingCardButton = React43.forwardRef(({ recommended, children, className, onClick, ...props }, ref) => {
|
|
11867
|
+
const [loading, setLoading] = useState20(false);
|
|
11796
11868
|
const handleClick = async (e) => {
|
|
11797
11869
|
setLoading(true);
|
|
11798
11870
|
try {
|