@superlogic/spree-pay 0.1.17 → 0.1.19

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/build/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/SpreePay.tsx
2
- import { useLayoutEffect as useLayoutEffect3, useMemo as useMemo8, useRef as useRef7, useState as useState13 } from "react";
2
+ import { useLayoutEffect as useLayoutEffect3, useMemo as useMemo9, useRef as useRef7, useState as useState14 } from "react";
3
3
  import NiceModal7 from "@ebay/nice-modal-react";
4
4
  import { SWRConfig } from "swr";
5
5
 
@@ -18,6 +18,15 @@ var PaymentError = class extends Error {
18
18
  }
19
19
  };
20
20
 
21
+ // src/types/payments.ts
22
+ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
23
+ PaymentType2["CREDIT_CARD"] = "CREDIT_CARD";
24
+ PaymentType2["CRYPTO"] = "CRYPTO";
25
+ PaymentType2["SPLIT"] = "SPLIT";
26
+ PaymentType2["POINTS"] = "POINTS";
27
+ return PaymentType2;
28
+ })(PaymentType || {});
29
+
21
30
  // src/context/SpreePayActionsContext.tsx
22
31
  import { jsx } from "react/jsx-runtime";
23
32
  var SpreePayActionsContext = createContext(void 0);
@@ -91,15 +100,15 @@ var CONFIG = {
91
100
  dev: {
92
101
  bookit: {
93
102
  slapiUrl: "https://slapi.dev.superlogic.com",
94
- keyklockUrl: "https://auth.dev.join.bookit.com",
95
- keyklockClientId: "oneof-next",
103
+ keycloakUrl: "https://auth.dev.join.bookit.com",
104
+ keycloakClientId: "oneof-next",
96
105
  pointsConversionRatio: 100,
97
106
  pointsTitle: "AIR SP"
98
107
  },
99
108
  moca: {
100
109
  slapiUrl: "https://slapi.dev.air.shop",
101
- keyklockUrl: "https://login.dev.air.shop",
102
- keyklockClientId: "oneof-next",
110
+ keycloakUrl: "https://login.dev.air.shop",
111
+ keycloakClientId: "oneof-next",
103
112
  pointsConversionRatio: 100,
104
113
  pointsTitle: "AIR SP"
105
114
  }
@@ -107,15 +116,15 @@ var CONFIG = {
107
116
  stg: {
108
117
  bookit: {
109
118
  slapiUrl: "https://slapi.stg.superlogic.com",
110
- keyklockUrl: "https://auth.stg.join.bookit.com",
111
- keyklockClientId: "oneof-next",
119
+ keycloakUrl: "https://auth.stg.join.bookit.com",
120
+ keycloakClientId: "oneof-next",
112
121
  pointsConversionRatio: 100,
113
122
  pointsTitle: "AIR SP"
114
123
  },
115
124
  moca: {
116
125
  slapiUrl: "https://slapi.stg.air.shop",
117
- keyklockUrl: "https://login.stg.air.shop",
118
- keyklockClientId: "oneof-next",
126
+ keycloakUrl: "https://login.stg.air.shop",
127
+ keycloakClientId: "oneof-next",
119
128
  pointsConversionRatio: 100,
120
129
  pointsTitle: "AIR SP"
121
130
  }
@@ -123,15 +132,15 @@ var CONFIG = {
123
132
  prod: {
124
133
  bookit: {
125
134
  slapiUrl: "https://slapi.superlogic.com",
126
- keyklockUrl: "https://auth.join.bookit.com",
127
- keyklockClientId: "oneof-next",
135
+ keycloakUrl: "https://auth.join.bookit.com",
136
+ keycloakClientId: "oneof-next",
128
137
  pointsConversionRatio: 100,
129
138
  pointsTitle: "AIR SP"
130
139
  },
131
140
  moca: {
132
141
  slapiUrl: "https://slapi.air.shop",
133
- keyklockUrl: "https://login.air.shop",
134
- keyklockClientId: "oneof-next",
142
+ keycloakUrl: "https://login.air.shop",
143
+ keycloakClientId: "oneof-next",
135
144
  pointsConversionRatio: 100,
136
145
  pointsTitle: "AIR SP"
137
146
  }
@@ -145,7 +154,9 @@ var StaticConfigProvider = ({ children, props }) => {
145
154
  setAppProps(props);
146
155
  }, [props]);
147
156
  const staticConfig = useMemo(() => {
148
- return CONFIG[env.environment][env.tenantId];
157
+ const envConfig = CONFIG[env.environment];
158
+ const appKey = env.tenantId in envConfig ? env.tenantId : "moca";
159
+ return envConfig[appKey];
149
160
  }, [env.environment, env.tenantId]);
150
161
  return /* @__PURE__ */ jsx2(StaticConfigContext.Provider, { value: { staticConfig, appProps }, children });
151
162
  };
@@ -600,7 +611,7 @@ var SlapiPaymentService = {
600
611
  return slapiApi.post("/v1/payments/validate", { paymentId, type: "CREDIT_CARD" /* CREDIT_CARD */ }).then((data) => ({ data }));
601
612
  },
602
613
  validatePoints: ({ paymentId, txHash }) => {
603
- return slapiApi.post("/v1/payments/validate", { txHash, paymentId, type: "SPLIT" /* SPLIT */ }).then((data) => ({ data }));
614
+ return slapiApi.post("/v1/payments/validate", { txHash, paymentId, type: "POINTS" /* POINTS */ }).then((data) => ({ data }));
604
615
  },
605
616
  getStatus: (paymentId) => {
606
617
  return slapiApi.get(`/v1/payments/${paymentId}/status`);
@@ -2341,6 +2352,7 @@ var Points = () => {
2341
2352
  const [usePoints, setUsePoints] = useState10(false);
2342
2353
  const [selectedPointsType, setSelectedPointsType] = useState10(null);
2343
2354
  const { setSelectedPaymentMethod, selectedPaymentMethod } = useSpreePaymentMethod();
2355
+ const { spreePayConfig } = useSpreePayConfig();
2344
2356
  const handleTogglePoints = (enabled) => {
2345
2357
  setUsePoints(enabled);
2346
2358
  if (!enabled) {
@@ -2349,7 +2361,7 @@ var Points = () => {
2349
2361
  }
2350
2362
  };
2351
2363
  return /* @__PURE__ */ jsxs14(Fragment3, { children: [
2352
- /* @__PURE__ */ jsx26(PointsSwitch, { value: usePoints, onChange: handleTogglePoints }),
2364
+ /* @__PURE__ */ jsx26(PointsSwitch, { disabled: !spreePayConfig?.creditCard.enabled, value: usePoints, onChange: handleTogglePoints }),
2353
2365
  usePoints && /* @__PURE__ */ jsx26(SplitBlock, { isSelected: selectedPointsType === "air", onSelect: setSelectedPointsType })
2354
2366
  ] });
2355
2367
  };
@@ -2729,20 +2741,90 @@ var Logos = () => {
2729
2741
  import NiceModal5 from "@ebay/nice-modal-react";
2730
2742
 
2731
2743
  // src/modals/CryptoSelectModal.tsx
2744
+ import { useMemo as useMemo8, useState as useState12 } from "react";
2732
2745
  import NiceModal4, { useModal as useModal2 } from "@ebay/nice-modal-react";
2733
2746
 
2734
- // src/hooks/useBaseERC20Token.ts
2747
+ // ../ui/src/components/input.tsx
2748
+ import { jsx as jsx31 } from "react/jsx-runtime";
2749
+ function Input2({ className, type, ...props }) {
2750
+ return /* @__PURE__ */ jsx31(
2751
+ "input",
2752
+ {
2753
+ type,
2754
+ "data-slot": "input",
2755
+ className: cn2(
2756
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
2757
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
2758
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
2759
+ className
2760
+ ),
2761
+ ...props
2762
+ }
2763
+ );
2764
+ }
2765
+
2766
+ // ../../node_modules/@radix-ui/react-separator/dist/index.mjs
2735
2767
  import * as React13 from "react";
2768
+ import { jsx as jsx32 } from "react/jsx-runtime";
2769
+ var NAME = "Separator";
2770
+ var DEFAULT_ORIENTATION = "horizontal";
2771
+ var ORIENTATIONS = ["horizontal", "vertical"];
2772
+ var Separator = React13.forwardRef((props, forwardedRef) => {
2773
+ const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
2774
+ const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
2775
+ const ariaOrientation = orientation === "vertical" ? orientation : void 0;
2776
+ const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
2777
+ return /* @__PURE__ */ jsx32(
2778
+ Primitive.div,
2779
+ {
2780
+ "data-orientation": orientation,
2781
+ ...semanticProps,
2782
+ ...domProps,
2783
+ ref: forwardedRef
2784
+ }
2785
+ );
2786
+ });
2787
+ Separator.displayName = NAME;
2788
+ function isValidOrientation(orientation) {
2789
+ return ORIENTATIONS.includes(orientation);
2790
+ }
2791
+ var Root6 = Separator;
2792
+
2793
+ // ../ui/src/components/separator.tsx
2794
+ import { jsx as jsx33 } from "react/jsx-runtime";
2795
+ function Separator2({
2796
+ className,
2797
+ orientation = "horizontal",
2798
+ decorative = true,
2799
+ ...props
2800
+ }) {
2801
+ return /* @__PURE__ */ jsx33(
2802
+ Root6,
2803
+ {
2804
+ "data-slot": "separator",
2805
+ decorative,
2806
+ orientation,
2807
+ className: cn2(
2808
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
2809
+ className
2810
+ ),
2811
+ ...props
2812
+ }
2813
+ );
2814
+ }
2815
+
2816
+ // src/hooks/useBaseERC20Token.ts
2817
+ import * as React14 from "react";
2736
2818
  import { erc20Abi as erc20Abi3, formatUnits, getAddress } from "viem";
2737
2819
  import { useAccount, usePublicClient } from "wagmi";
2738
2820
  function useBaseERC20Token() {
2739
2821
  const { address } = useAccount();
2740
2822
  const baseClient = usePublicClient({ chainId: BASE_CHAIN_ID });
2741
2823
  const defaultClient = usePublicClient();
2742
- const [rows, setRows] = React13.useState([]);
2743
- const [isLoading, setLoading] = React13.useState(false);
2744
- const [error, setError] = React13.useState(null);
2745
- React13.useEffect(() => {
2824
+ const [rows, setRows] = React14.useState([]);
2825
+ const [isLoading, setLoading] = React14.useState(false);
2826
+ const [error, setError] = React14.useState(null);
2827
+ React14.useEffect(() => {
2746
2828
  let cancelled = false;
2747
2829
  async function run() {
2748
2830
  const client = baseClient ?? defaultClient;
@@ -2815,36 +2897,56 @@ function useBaseNativeToken() {
2815
2897
  };
2816
2898
  }
2817
2899
 
2900
+ // src/hooks/useBaseTokens.ts
2901
+ import useSWR4 from "swr";
2902
+ var useBaseTokens = () => {
2903
+ const { data: resData, isLoading } = useSWR4(`/v1/base-transactions/tokens`);
2904
+ return { tokens: resData?.data ?? [], tokensIsLoading: isLoading };
2905
+ };
2906
+
2818
2907
  // src/modals/CryptoSelectModal.tsx
2819
- import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
2908
+ import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
2820
2909
  var CryptoSelectModal = NiceModal4.create(() => {
2821
2910
  const modal = useModal2();
2822
2911
  const { isLoading, error, erc20Balances } = useBaseERC20Token();
2823
2912
  const { isLoadingNative, nativeError, nativeBalance } = useBaseNativeToken();
2913
+ const { tokens, tokensIsLoading } = useBaseTokens();
2914
+ const [search, setSearch] = useState12("");
2915
+ const filteredCoins = useMemo8(() => {
2916
+ return tokens.filter(
2917
+ (coin) => coin.name.toLowerCase().includes(search.toLowerCase()) || coin.symbol.toLowerCase().includes(search.toLowerCase())
2918
+ );
2919
+ }, [tokens, search]);
2824
2920
  const { setSelectedPaymentMethod } = useSpreePaymentMethod();
2825
2921
  const handleSelect = (coin) => {
2826
2922
  modal.remove();
2827
2923
  setSelectedPaymentMethod({ type: "CRYPTO" /* CRYPTO */, method: coin });
2828
2924
  };
2925
+ const userCoins = [nativeBalance, ...erc20Balances].filter(Boolean);
2926
+ const userCoinSymbols = userCoins.map((c) => c.symbol);
2829
2927
  return /* @__PURE__ */ jsxs19(Dialog, { open: modal.visible, onOpenChange: modal.remove, children: [
2830
- /* @__PURE__ */ jsx31(DialogDescription, { className: "hidden", children: "Crypto Select Modal" }),
2831
- /* @__PURE__ */ jsxs19(DialogContent, { showCloseButton: false, className: "gap-0 p-0", children: [
2832
- /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-6 px-5 py-5 md:px-7 md:py-6", children: /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between gap-4", children: [
2833
- /* @__PURE__ */ jsx31("button", { className: "rounded-md hover:bg-gray-100", onClick: modal.remove, children: /* @__PURE__ */ jsx31("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "25", fill: "none", children: /* @__PURE__ */ jsx31("path", { stroke: "#000", d: "m15 6.5-6 6 6 6" }) }) }),
2834
- /* @__PURE__ */ jsx31(DialogTitle, { className: "text-primary text-2xl font-semibold", children: "Select a token" }),
2835
- /* @__PURE__ */ jsx31("button", { className: "rounded-md p-1 hover:bg-gray-100", onClick: modal.remove, children: /* @__PURE__ */ jsx31("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "17", fill: "none", children: /* @__PURE__ */ jsx31(
2836
- "path",
2837
- {
2838
- fill: "#000",
2839
- d: "M12.6 3.9c.2.2.2.52 0 .71L8.7 8.5l3.9 3.89a.5.5 0 1 1-.71.7L8 9.22 4.11 13.1a.5.5 0 1 1-.7-.71L7.28 8.5 3.4 4.61a.5.5 0 1 1 .71-.7L8 7.78l3.89-3.89c.2-.2.51-.2.7 0Z"
2840
- }
2841
- ) }) })
2842
- ] }) }),
2843
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 px-5 py-5 md:px-7 md:py-6", children: [
2844
- /* @__PURE__ */ jsx31("h3", { className: "text-primary text-xl font-semibold", children: "Tokens with wallet balance" }),
2845
- (error || nativeError) && /* @__PURE__ */ jsx31("p", { className: "text-center text-sm text-red-500", children: "Something wrong" }),
2928
+ /* @__PURE__ */ jsx34(DialogDescription, { className: "hidden", children: "Crypto Select Modal" }),
2929
+ /* @__PURE__ */ jsxs19(DialogContent, { showCloseButton: false, className: "max-h-[90vh] gap-0 p-0", children: [
2930
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 px-5 py-5 md:px-7", children: [
2931
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between gap-4", children: [
2932
+ /* @__PURE__ */ jsx34("button", { className: "rounded-md hover:bg-gray-100", onClick: modal.remove, children: /* @__PURE__ */ jsx34("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "25", fill: "none", children: /* @__PURE__ */ jsx34("path", { stroke: "#000", d: "m15 6.5-6 6 6 6" }) }) }),
2933
+ /* @__PURE__ */ jsx34(DialogTitle, { className: "text-primary text-2xl font-semibold", children: "Select a token" }),
2934
+ /* @__PURE__ */ jsx34("button", { className: "rounded-md p-1 hover:bg-gray-100", onClick: modal.remove, children: /* @__PURE__ */ jsx34("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "17", fill: "none", children: /* @__PURE__ */ jsx34(
2935
+ "path",
2936
+ {
2937
+ fill: "#000",
2938
+ d: "M12.6 3.9c.2.2.2.52 0 .71L8.7 8.5l3.9 3.89a.5.5 0 1 1-.71.7L8 9.22 4.11 13.1a.5.5 0 1 1-.7-.71L7.28 8.5 3.4 4.61a.5.5 0 1 1 .71-.7L8 7.78l3.89-3.89c.2-.2.51-.2.7 0Z"
2939
+ }
2940
+ ) }) })
2941
+ ] }),
2942
+ /* @__PURE__ */ jsx34(Input2, { onChange: (e) => setSearch(e.target.value), placeholder: "Search by token name", value: search })
2943
+ ] }),
2944
+ /* @__PURE__ */ jsx34(Separator2, { className: "hidden md:block" }),
2945
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 px-5 py-5 md:px-7", children: [
2946
+ /* @__PURE__ */ jsx34("h3", { className: "text-primary text-xl font-semibold", children: "Tokens with wallet balance" }),
2947
+ (error || nativeError) && /* @__PURE__ */ jsx34("p", { className: "text-center text-sm text-red-500", children: "Something wrong" }),
2846
2948
  /* @__PURE__ */ jsxs19("div", { className: "flex w-full flex-col gap-1", children: [
2847
- isLoadingNative && /* @__PURE__ */ jsx31("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
2949
+ isLoadingNative && /* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
2848
2950
  nativeBalance && /* @__PURE__ */ jsxs19(
2849
2951
  "button",
2850
2952
  {
@@ -2852,7 +2954,7 @@ var CryptoSelectModal = NiceModal4.create(() => {
2852
2954
  onClick: () => handleSelect(nativeBalance),
2853
2955
  children: [
2854
2956
  /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
2855
- nativeBalance.logoURI && /* @__PURE__ */ jsx31(
2957
+ nativeBalance.logoURI && /* @__PURE__ */ jsx34(
2856
2958
  "img",
2857
2959
  {
2858
2960
  className: "h-8 w-8 shrink-0",
@@ -2860,17 +2962,17 @@ var CryptoSelectModal = NiceModal4.create(() => {
2860
2962
  alt: `${nativeBalance.symbol} logo`
2861
2963
  }
2862
2964
  ),
2863
- /* @__PURE__ */ jsx31("p", { className: "text-sm font-medium", children: nativeBalance.symbol })
2965
+ /* @__PURE__ */ jsx34("p", { className: "text-sm font-medium", children: nativeBalance.symbol })
2864
2966
  ] }),
2865
- /* @__PURE__ */ jsx31("p", { className: "text-sm font-medium", children: nativeBalance.formatted })
2967
+ /* @__PURE__ */ jsx34("p", { className: "text-sm font-medium", children: nativeBalance.formatted })
2866
2968
  ]
2867
2969
  },
2868
2970
  nativeBalance.symbol
2869
2971
  ),
2870
2972
  isLoading && /* @__PURE__ */ jsxs19(Fragment5, { children: [
2871
- /* @__PURE__ */ jsx31("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
2872
- /* @__PURE__ */ jsx31("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
2873
- /* @__PURE__ */ jsx31("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" })
2973
+ /* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
2974
+ /* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
2975
+ /* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" })
2874
2976
  ] }),
2875
2977
  erc20Balances.map((coin) => {
2876
2978
  const Icon = getSymbolLogo(coin.symbol);
@@ -2882,14 +2984,35 @@ var CryptoSelectModal = NiceModal4.create(() => {
2882
2984
  children: [
2883
2985
  /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
2884
2986
  Boolean(Icon) && Icon,
2885
- /* @__PURE__ */ jsx31("p", { className: "text-sm font-medium", children: coin.symbol })
2987
+ /* @__PURE__ */ jsx34("p", { className: "text-sm font-medium", children: coin.symbol })
2886
2988
  ] }),
2887
- /* @__PURE__ */ jsx31("p", { className: "text-sm font-medium", children: coin.formatted })
2989
+ /* @__PURE__ */ jsx34("p", { className: "text-sm font-medium", children: coin.formatted })
2888
2990
  ]
2889
2991
  },
2890
2992
  coin.symbol
2891
2993
  );
2892
2994
  })
2995
+ ] }),
2996
+ /* @__PURE__ */ jsx34("h3", { className: "text-primary text-xl font-semibold", children: "All Tokens" }),
2997
+ /* @__PURE__ */ jsxs19("div", { className: "flex max-h-[40vh] w-full flex-col gap-1 overflow-y-auto", children: [
2998
+ tokensIsLoading && /* @__PURE__ */ jsxs19(Fragment5, { children: [
2999
+ /* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
3000
+ /* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
3001
+ /* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" })
3002
+ ] }),
3003
+ filteredCoins.map((token) => /* @__PURE__ */ jsx34(
3004
+ "button",
3005
+ {
3006
+ disabled: !userCoinSymbols.includes(token.symbol),
3007
+ onClick: () => handleSelect(userCoins.find((c) => c.symbol === token.symbol)),
3008
+ className: "flex min-h-11 w-full items-center justify-between gap-4 rounded-sm px-1.5 text-black hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",
3009
+ children: /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
3010
+ token.logoURI ? /* @__PURE__ */ jsx34("img", { className: "h-8 w-8 shrink-0", src: token.logoURI, alt: `${token.name} logo` }) : /* @__PURE__ */ jsx34("div", { className: "h-8 w-8 shrink-0 rounded-full bg-gray-400" }),
3011
+ /* @__PURE__ */ jsx34("p", { className: "text-sm font-medium", children: token.symbol })
3012
+ ] })
3013
+ },
3014
+ token.symbol
3015
+ ))
2893
3016
  ] })
2894
3017
  ] })
2895
3018
  ] })
@@ -2898,44 +3021,44 @@ var CryptoSelectModal = NiceModal4.create(() => {
2898
3021
  CryptoSelectModal.displayName = "CryptoSelectModal";
2899
3022
 
2900
3023
  // src/components/CryptoTab/Crypto/SelectCoinButton.tsx
2901
- import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
3024
+ import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
2902
3025
  var SelectCoinButton = () => {
2903
3026
  const openModal = () => {
2904
3027
  NiceModal5.show(CryptoSelectModal);
2905
3028
  };
2906
3029
  return /* @__PURE__ */ jsxs20("button", { onClick: openModal, type: "button", className: "bg-primary/8 flex h-11 w-full overflow-hidden rounded-md", children: [
2907
- /* @__PURE__ */ jsx32("div", { className: "bg-primary flex h-full w-11 items-center justify-center", children: /* @__PURE__ */ jsx32("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-white" }) }),
3030
+ /* @__PURE__ */ jsx35("div", { className: "bg-primary flex h-full w-11 items-center justify-center", children: /* @__PURE__ */ jsx35("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-white" }) }),
2908
3031
  /* @__PURE__ */ jsxs20("div", { className: "flex h-full w-full items-center justify-between px-3", children: [
2909
- /* @__PURE__ */ jsx32("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx32("p", { className: "font-medium text-black/50", children: "Select a token" }) }),
2910
- /* @__PURE__ */ jsx32("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none", children: /* @__PURE__ */ jsx32("path", { stroke: "#000", strokeLinecap: "round", d: "m6 12.43 4-4-4-4" }) })
3032
+ /* @__PURE__ */ jsx35("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx35("p", { className: "font-medium text-black/50", children: "Select a token" }) }),
3033
+ /* @__PURE__ */ jsx35("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none", children: /* @__PURE__ */ jsx35("path", { stroke: "#000", strokeLinecap: "round", d: "m6 12.43 4-4-4-4" }) })
2911
3034
  ] })
2912
3035
  ] });
2913
3036
  };
2914
3037
 
2915
3038
  // src/components/CryptoTab/Crypto/SelectedCoin.tsx
2916
- import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
3039
+ import { jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
2917
3040
  var SelectedCoin = (props) => {
2918
3041
  const { coin, balance, logoURI } = props;
2919
3042
  const Icon = getSymbolLogo(coin);
2920
3043
  return /* @__PURE__ */ jsxs21("div", { className: "bg-primary/8 flex h-11 w-full overflow-hidden rounded-md", children: [
2921
- /* @__PURE__ */ jsx33("div", { className: "bg-primary flex h-full w-11 items-center justify-center", children: /* @__PURE__ */ jsx33("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-white", children: /* @__PURE__ */ jsx33("div", { className: "bg-primary h-2.5 w-2.5 rounded-full" }) }) }),
3044
+ /* @__PURE__ */ jsx36("div", { className: "bg-primary flex h-full w-11 items-center justify-center", children: /* @__PURE__ */ jsx36("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-white", children: /* @__PURE__ */ jsx36("div", { className: "bg-primary h-2.5 w-2.5 rounded-full" }) }) }),
2922
3045
  /* @__PURE__ */ jsxs21("div", { className: "border-primary flex h-full w-full items-center justify-between rounded-r-md border-1 !border-l-0 px-3", children: [
2923
3046
  /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1", children: [
2924
3047
  Icon,
2925
- !Icon && logoURI && /* @__PURE__ */ jsx33("img", { className: "mr-1 h-8 w-8 shrink-0", src: logoURI, alt: `${coin} logo` }),
2926
- /* @__PURE__ */ jsx33("p", { className: "font-semibold text-black", children: coin }),
2927
- /* @__PURE__ */ jsx33("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx33("path", { d: "M6 12.4341L10 8.43408L6 4.43408", stroke: "black", strokeLinecap: "round" }) })
3048
+ !Icon && logoURI && /* @__PURE__ */ jsx36("img", { className: "mr-1 h-8 w-8 shrink-0", src: logoURI, alt: `${coin} logo` }),
3049
+ /* @__PURE__ */ jsx36("p", { className: "font-semibold text-black", children: coin }),
3050
+ /* @__PURE__ */ jsx36("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx36("path", { d: "M6 12.4341L10 8.43408L6 4.43408", stroke: "black", strokeLinecap: "round" }) })
2928
3051
  ] }),
2929
3052
  /* @__PURE__ */ jsxs21("p", { className: "text-xs font-medium text-black/50", children: [
2930
3053
  "Wallet balance ",
2931
- /* @__PURE__ */ jsx33("span", { className: "text-black", children: balance })
3054
+ /* @__PURE__ */ jsx36("span", { className: "text-black", children: balance })
2932
3055
  ] })
2933
3056
  ] })
2934
3057
  ] });
2935
3058
  };
2936
3059
 
2937
3060
  // src/components/CryptoTab/Crypto/Crypto.tsx
2938
- import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
3061
+ import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
2939
3062
  var Crypto = () => {
2940
3063
  const { address } = useAccount3();
2941
3064
  const { selectedPaymentMethod } = useSpreePaymentMethod();
@@ -2961,12 +3084,12 @@ var Crypto = () => {
2961
3084
  }, [register, handlePay]);
2962
3085
  return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-baseline gap-4", children: [
2963
3086
  /* @__PURE__ */ jsxs22("div", { className: "flex w-full items-center justify-between gap-4", children: [
2964
- /* @__PURE__ */ jsx34("h3", { className: "text-primary text-xl leading-[1.7] font-semibold", children: "Pay with Crypto" }),
2965
- /* @__PURE__ */ jsx34(ConnectButton, {})
3087
+ /* @__PURE__ */ jsx37("h3", { className: "text-primary text-xl leading-[1.7] font-semibold", children: "Pay with Crypto" }),
3088
+ /* @__PURE__ */ jsx37(ConnectButton, {})
2966
3089
  ] }),
2967
- !isWalletConnected && /* @__PURE__ */ jsx34(Logos, {}),
3090
+ !isWalletConnected && /* @__PURE__ */ jsx37(Logos, {}),
2968
3091
  isWalletConnected && /* @__PURE__ */ jsxs22("div", { className: "flex w-full flex-col gap-1", children: [
2969
- selectedPaymentMethod.type === "CRYPTO" /* CRYPTO */ && selectedPaymentMethod.method && /* @__PURE__ */ jsx34(
3092
+ selectedPaymentMethod.type === "CRYPTO" /* CRYPTO */ && selectedPaymentMethod.method && /* @__PURE__ */ jsx37(
2970
3093
  SelectedCoin,
2971
3094
  {
2972
3095
  coin: selectedPaymentMethod.method.symbol,
@@ -2974,13 +3097,13 @@ var Crypto = () => {
2974
3097
  logoURI: selectedPaymentMethod.method.logoURI
2975
3098
  }
2976
3099
  ),
2977
- /* @__PURE__ */ jsx34(SelectCoinButton, {})
3100
+ /* @__PURE__ */ jsx37(SelectCoinButton, {})
2978
3101
  ] })
2979
3102
  ] });
2980
3103
  };
2981
3104
 
2982
3105
  // src/components/CryptoTab/Crypto/CryptoWrapper.tsx
2983
- import { jsx as jsx35 } from "react/jsx-runtime";
3106
+ import { jsx as jsx38 } from "react/jsx-runtime";
2984
3107
  var queryClient = new QueryClient();
2985
3108
  var connectors = connectorsForWallets(
2986
3109
  [
@@ -2998,22 +3121,22 @@ var config = createConfig({
2998
3121
  ssr: true
2999
3122
  });
3000
3123
  var CryptoWrapper = () => {
3001
- return /* @__PURE__ */ jsx35(WagmiProvider, { config, children: /* @__PURE__ */ jsx35(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx35(RainbowKitProvider, { children: /* @__PURE__ */ jsx35(NiceModal6.Provider, { children: /* @__PURE__ */ jsx35(Crypto, {}) }) }) }) });
3124
+ return /* @__PURE__ */ jsx38(WagmiProvider, { config, children: /* @__PURE__ */ jsx38(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx38(RainbowKitProvider, { children: /* @__PURE__ */ jsx38(NiceModal6.Provider, { children: /* @__PURE__ */ jsx38(Crypto, {}) }) }) }) });
3002
3125
  };
3003
3126
 
3004
3127
  // src/components/CryptoTab/CryptoTab.tsx
3005
- import { jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
3128
+ import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
3006
3129
  var CryptoTab = () => {
3007
3130
  return /* @__PURE__ */ jsxs23("div", { children: [
3008
- /* @__PURE__ */ jsx36("div", { className: "border-b-1 border-black/7 px-5 py-5 md:px-7 md:py-5", children: /* @__PURE__ */ jsx36(CryptoWrapper, {}) }),
3009
- /* @__PURE__ */ jsx36("div", { className: "px-5 py-5 md:px-7 md:py-6", children: /* @__PURE__ */ jsx36(PointsSwitch, { disabled: true }) })
3131
+ /* @__PURE__ */ jsx39("div", { className: "border-b-1 border-black/7 px-5 py-5 md:px-7 md:py-5", children: /* @__PURE__ */ jsx39(CryptoWrapper, {}) }),
3132
+ /* @__PURE__ */ jsx39("div", { className: "px-5 py-5 md:px-7 md:py-6", children: /* @__PURE__ */ jsx39(PointsSwitch, { disabled: true }) })
3010
3133
  ] });
3011
3134
  };
3012
3135
 
3013
3136
  // src/components/TabButtons.tsx
3014
- import { jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
3137
+ import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
3015
3138
  var TabButton = ({ isDisabled = true, isActive, children, onClick }) => {
3016
- return /* @__PURE__ */ jsx37(
3139
+ return /* @__PURE__ */ jsx40(
3017
3140
  "button",
3018
3141
  {
3019
3142
  disabled: isDisabled,
@@ -3044,14 +3167,14 @@ var TabButtons = (props) => {
3044
3167
  onClick: handleChange("CREDIT_CARD" /* CREDIT_CARD */),
3045
3168
  isActive: value === "CREDIT_CARD" /* CREDIT_CARD */,
3046
3169
  children: [
3047
- /* @__PURE__ */ jsx37("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", children: /* @__PURE__ */ jsx37(
3170
+ /* @__PURE__ */ jsx40("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", children: /* @__PURE__ */ jsx40(
3048
3171
  "path",
3049
3172
  {
3050
3173
  fill: "currentColor",
3051
3174
  d: "M22 6v12c0 .55-.2 1.02-.59 1.41-.39.4-.86.59-1.41.59H4c-.55 0-1.02-.2-1.41-.59-.4-.39-.59-.86-.59-1.41V6c0-.55.2-1.02.59-1.41C2.98 4.19 3.45 4 4 4h16c.55 0 1.02.2 1.41.59.4.39.59.86.59 1.41ZM4 8h16V6H4v2Zm0 4v6h16v-6H4Z"
3052
3175
  }
3053
3176
  ) }),
3054
- /* @__PURE__ */ jsx37("p", { className: "text-sm font-medium", children: "Card" })
3177
+ /* @__PURE__ */ jsx40("p", { className: "text-sm font-medium", children: "Card" })
3055
3178
  ]
3056
3179
  }
3057
3180
  ),
@@ -3063,23 +3186,23 @@ var TabButtons = (props) => {
3063
3186
  isActive: value === "CRYPTO" /* CRYPTO */,
3064
3187
  children: [
3065
3188
  /* @__PURE__ */ jsxs24("svg", { className: "my-1", xmlns: "http://www.w3.org/2000/svg", width: "30", height: "16", fill: "none", children: [
3066
- /* @__PURE__ */ jsx37(
3189
+ /* @__PURE__ */ jsx40(
3067
3190
  "path",
3068
3191
  {
3069
3192
  fill: "currentColor",
3070
3193
  d: "M14.5 0C19.2 0 23 3.58 23 8s-3.8 8-8.5 8a8.93 8.93 0 0 1-3.35-.65 8 8 0 0 0 2.24-1.44c.36.06.73.09 1.11.09 3.7 0 6.5-2.8 6.5-6s-2.8-6-6.5-6c-.38 0-.75.03-1.11.09A8 8 0 0 0 11.15.65 8.93 8.93 0 0 1 14.5 0Z"
3071
3194
  }
3072
3195
  ),
3073
- /* @__PURE__ */ jsx37(
3196
+ /* @__PURE__ */ jsx40(
3074
3197
  "path",
3075
3198
  {
3076
3199
  fill: "currentColor",
3077
3200
  d: "M21.15 0c4.7 0 8.5 3.58 8.5 8s-3.8 8-8.5 8a8.93 8.93 0 0 1-3.35-.65 8 8 0 0 0 2.24-1.44c.36.06.73.09 1.1.09 3.71 0 6.5-2.8 6.5-6s-2.79-6-6.5-6c-.37 0-.74.03-1.1.09A8 8 0 0 0 17.8.65 8.93 8.93 0 0 1 21.15 0Z"
3078
3201
  }
3079
3202
  ),
3080
- /* @__PURE__ */ jsx37("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "2" })
3203
+ /* @__PURE__ */ jsx40("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "2" })
3081
3204
  ] }),
3082
- /* @__PURE__ */ jsx37("p", { className: "text-sm font-medium", children: "Crypto" })
3205
+ /* @__PURE__ */ jsx40("p", { className: "text-sm font-medium", children: "Crypto" })
3083
3206
  ]
3084
3207
  }
3085
3208
  )
@@ -3087,31 +3210,31 @@ var TabButtons = (props) => {
3087
3210
  };
3088
3211
 
3089
3212
  // src/components/Tabs.tsx
3090
- import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
3213
+ import { jsx as jsx41, jsxs as jsxs25 } from "react/jsx-runtime";
3091
3214
  var Tabs = () => {
3092
3215
  const { selectedPaymentMethod, setSelectedPaymentMethod } = useSpreePaymentMethod();
3093
3216
  return /* @__PURE__ */ jsxs25("div", { className: "mb-4 rounded-3xl border border-black/25 bg-white", children: [
3094
3217
  /* @__PURE__ */ jsxs25("div", { className: "flex w-full flex-col gap-4 border-b-1 border-black/7 px-5 py-5 md:px-7 md:py-6", children: [
3095
- /* @__PURE__ */ jsx38("h2", { className: "text-primary text-2xl font-semibold", children: "Choose a Payment Method" }),
3096
- /* @__PURE__ */ jsx38(TabButtons, { value: selectedPaymentMethod.type, onChange: setSelectedPaymentMethod })
3218
+ /* @__PURE__ */ jsx41("h2", { className: "text-primary text-2xl font-semibold", children: "Choose a Payment Method" }),
3219
+ /* @__PURE__ */ jsx41(TabButtons, { value: selectedPaymentMethod.type, onChange: setSelectedPaymentMethod })
3097
3220
  ] }),
3098
- selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && /* @__PURE__ */ jsx38(CreditCardTab, {}),
3099
- selectedPaymentMethod.type === "CRYPTO" /* CRYPTO */ && /* @__PURE__ */ jsx38(CryptoTab, {})
3221
+ selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && /* @__PURE__ */ jsx41(CreditCardTab, {}),
3222
+ selectedPaymentMethod.type === "CRYPTO" /* CRYPTO */ && /* @__PURE__ */ jsx41(CryptoTab, {})
3100
3223
  ] });
3101
3224
  };
3102
3225
 
3103
3226
  // src/SpreePayContent.tsx
3104
- import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
3227
+ import { jsx as jsx42, jsxs as jsxs26 } from "react/jsx-runtime";
3105
3228
  var SpreePayContent = ({ isLoggedIn }) => {
3106
3229
  return /* @__PURE__ */ jsxs26("div", { className: "w-full", children: [
3107
- /* @__PURE__ */ jsx39(Tabs, {}),
3108
- /* @__PURE__ */ jsx39(CheckoutButton, { isLoggedIn }),
3109
- /* @__PURE__ */ jsx39(SpreeLegal, {})
3230
+ /* @__PURE__ */ jsx42(Tabs, {}),
3231
+ /* @__PURE__ */ jsx42(CheckoutButton, { isLoggedIn }),
3232
+ /* @__PURE__ */ jsx42(SpreeLegal, {})
3110
3233
  ] });
3111
3234
  };
3112
3235
 
3113
3236
  // src/hooks/useKeycloakSSO.ts
3114
- import { useCallback as useCallback7, useEffect as useEffect10, useRef as useRef6, useState as useState12 } from "react";
3237
+ import { useCallback as useCallback7, useEffect as useEffect10, useRef as useRef6, useState as useState13 } from "react";
3115
3238
  import Keycloak from "keycloak-js";
3116
3239
  var refreshAheadSeconds = 60;
3117
3240
  function useKeycloakSSO(config2) {
@@ -3119,9 +3242,9 @@ function useKeycloakSSO(config2) {
3119
3242
  const initRef = useRef6(false);
3120
3243
  const kcRef = useRef6(null);
3121
3244
  const refreshTimerRef = useRef6(null);
3122
- const [error, setError] = useState12(null);
3123
- const [isChecking, setIsChecking] = useState12(enabled);
3124
- const [accessToken, setAccessToken] = useState12(null);
3245
+ const [error, setError] = useState13(null);
3246
+ const [isChecking, setIsChecking] = useState13(enabled);
3247
+ const [accessToken, setAccessToken] = useState13(null);
3125
3248
  const scheduleRefresh = useCallback7(() => {
3126
3249
  const kc = kcRef.current;
3127
3250
  if (!kc || !kc.tokenParsed || !kc.tokenParsed.exp) {
@@ -3178,10 +3301,10 @@ function useKeycloakSSO(config2) {
3178
3301
  }
3179
3302
 
3180
3303
  // src/SpreePay.tsx
3181
- import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
3304
+ import { jsx as jsx43, jsxs as jsxs27 } from "react/jsx-runtime";
3182
3305
  var SpreePayInner = () => {
3183
3306
  const rootRef = useRef7(null);
3184
- const [portalEl, setPortalEl] = useState13(null);
3307
+ const [portalEl, setPortalEl] = useState14(null);
3185
3308
  useLayoutEffect3(() => {
3186
3309
  if (!rootRef.current) return;
3187
3310
  const el = rootRef.current.querySelector(":scope > .sl-spreepay__portal");
@@ -3192,12 +3315,12 @@ var SpreePayInner = () => {
3192
3315
  const tenantId = env?.tenantId || "bookit";
3193
3316
  const { isChecking, accessToken } = useKeycloakSSO({
3194
3317
  realm: tenantId,
3195
- url: staticConfig.keyklockUrl,
3196
- clientId: staticConfig.keyklockClientId,
3318
+ url: staticConfig.keycloakUrl,
3319
+ clientId: staticConfig.keycloakClientId,
3197
3320
  ssoPageURI: env?.ssoPageURI,
3198
3321
  enabled: !env?.accessToken
3199
3322
  });
3200
- const slapiFetcher = useMemo8(() => {
3323
+ const slapiFetcher = useMemo9(() => {
3201
3324
  if (accessToken || env.accessToken) {
3202
3325
  return registerApi({
3203
3326
  accessToken: env.accessToken || accessToken,
@@ -3209,12 +3332,12 @@ var SpreePayInner = () => {
3209
3332
  const getContent = () => {
3210
3333
  if (isChecking) {
3211
3334
  return /* @__PURE__ */ jsxs27("div", { className: "flex w-full flex-col", children: [
3212
- /* @__PURE__ */ jsx40("div", { className: "bg-primary/8 mb-4 h-[315px] animate-pulse rounded-3xl" }),
3213
- /* @__PURE__ */ jsx40("div", { className: "bg-primary/8 h-[135px] animate-pulse rounded-3xl" }),
3214
- /* @__PURE__ */ jsx40(SpreeLegal, {})
3335
+ /* @__PURE__ */ jsx43("div", { className: "bg-primary/8 mb-4 h-[315px] animate-pulse rounded-3xl" }),
3336
+ /* @__PURE__ */ jsx43("div", { className: "bg-primary/8 h-[135px] animate-pulse rounded-3xl" }),
3337
+ /* @__PURE__ */ jsx43(SpreeLegal, {})
3215
3338
  ] });
3216
3339
  }
3217
- return /* @__PURE__ */ jsx40(
3340
+ return /* @__PURE__ */ jsx43(
3218
3341
  SWRConfig,
3219
3342
  {
3220
3343
  value: {
@@ -3223,29 +3346,30 @@ var SpreePayInner = () => {
3223
3346
  revalidateOnFocus: false,
3224
3347
  revalidateIfStale: false
3225
3348
  },
3226
- children: /* @__PURE__ */ jsx40(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ jsx40(NiceModal7.Provider, { children: /* @__PURE__ */ jsx40(SpreePayContent, { isLoggedIn: Boolean(accessToken || env.accessToken) }) }) })
3349
+ children: /* @__PURE__ */ jsx43(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ jsx43(NiceModal7.Provider, { children: /* @__PURE__ */ jsx43(SpreePayContent, { isLoggedIn: Boolean(accessToken || env.accessToken) }) }) })
3227
3350
  }
3228
3351
  );
3229
3352
  };
3230
3353
  return /* @__PURE__ */ jsxs27("div", { ref: rootRef, className: cn("sl-spreepay", appProps.className), children: [
3231
- /* @__PURE__ */ jsx40("div", { className: "sl-spreepay__portal" }),
3354
+ /* @__PURE__ */ jsx43("div", { className: "sl-spreepay__portal" }),
3232
3355
  getContent()
3233
3356
  ] });
3234
3357
  };
3235
3358
  var SpreePay = (props) => {
3236
- return /* @__PURE__ */ jsx40(StaticConfigProvider, { props, children: /* @__PURE__ */ jsx40(SpreePayInner, {}) });
3359
+ return /* @__PURE__ */ jsx43(StaticConfigProvider, { props, children: /* @__PURE__ */ jsx43(SpreePayInner, {}) });
3237
3360
  };
3238
3361
 
3239
3362
  // src/hooks/useCapture3DS.ts
3240
3363
  import { useEffect as useEffect11 } from "react";
3241
3364
  var useCapture3DS = (searchParams) => {
3242
3365
  useEffect11(() => {
3243
- if (window?.parent && searchParams?.paymentIntent) {
3366
+ if (typeof window !== "undefined" && window.parent && searchParams?.paymentIntent) {
3244
3367
  window.parent.SP_EVENT_BUS?.emit("paymentIntent", { paymentIntent: searchParams.paymentIntent });
3245
3368
  }
3246
3369
  }, [searchParams]);
3247
3370
  };
3248
3371
  export {
3372
+ PaymentType,
3249
3373
  SpreePay,
3250
3374
  SpreePayProvider,
3251
3375
  useCapture3DS,