@whop/embedded-components-react-js 0.0.5-beta.2 → 0.0.5-beta.21

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.
Files changed (84) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/lib/with-fallback.d.ts +55 -0
  3. package/dist/lib/with-fallback.js +85 -0
  4. package/dist/lib/with-fallback.js.map +1 -0
  5. package/dist/lib/with-fallback.mjs +58 -0
  6. package/dist/lib/with-fallback.mjs.map +1 -0
  7. package/dist/payouts/elements/add-payout-method.d.ts +11 -0
  8. package/dist/payouts/elements/add-payout-method.js +30 -0
  9. package/dist/payouts/elements/add-payout-method.js.map +1 -0
  10. package/dist/payouts/elements/add-payout-method.mjs +8 -0
  11. package/dist/payouts/elements/add-payout-method.mjs.map +1 -0
  12. package/dist/payouts/elements/automatic-withdraw.d.ts +11 -0
  13. package/dist/payouts/elements/automatic-withdraw.js +30 -0
  14. package/dist/payouts/elements/automatic-withdraw.js.map +1 -0
  15. package/dist/payouts/elements/automatic-withdraw.mjs +8 -0
  16. package/dist/payouts/elements/automatic-withdraw.mjs.map +1 -0
  17. package/dist/payouts/elements/balance.d.ts +8 -13
  18. package/dist/payouts/elements/balance.js +5 -61
  19. package/dist/payouts/elements/balance.js.map +1 -1
  20. package/dist/payouts/elements/balance.mjs +5 -53
  21. package/dist/payouts/elements/balance.mjs.map +1 -1
  22. package/dist/payouts/elements/bnpl-reserve-balance-breakdown.d.ts +8 -13
  23. package/dist/payouts/elements/bnpl-reserve-balance-breakdown.js +5 -61
  24. package/dist/payouts/elements/bnpl-reserve-balance-breakdown.js.map +1 -1
  25. package/dist/payouts/elements/bnpl-reserve-balance-breakdown.mjs +5 -53
  26. package/dist/payouts/elements/bnpl-reserve-balance-breakdown.mjs.map +1 -1
  27. package/dist/payouts/elements/change-account-country.d.ts +8 -13
  28. package/dist/payouts/elements/change-account-country.js +5 -61
  29. package/dist/payouts/elements/change-account-country.js.map +1 -1
  30. package/dist/payouts/elements/change-account-country.mjs +5 -53
  31. package/dist/payouts/elements/change-account-country.mjs.map +1 -1
  32. package/dist/payouts/elements/generate-withdrawal-receipt.d.ts +8 -13
  33. package/dist/payouts/elements/generate-withdrawal-receipt.js +5 -61
  34. package/dist/payouts/elements/generate-withdrawal-receipt.js.map +1 -1
  35. package/dist/payouts/elements/generate-withdrawal-receipt.mjs +5 -53
  36. package/dist/payouts/elements/generate-withdrawal-receipt.mjs.map +1 -1
  37. package/dist/payouts/elements/index.d.ts +3 -0
  38. package/dist/payouts/elements/index.js +2 -0
  39. package/dist/payouts/elements/index.js.map +1 -1
  40. package/dist/payouts/elements/index.mjs +2 -0
  41. package/dist/payouts/elements/index.mjs.map +1 -1
  42. package/dist/payouts/elements/pending-balance-breakdown.d.ts +8 -13
  43. package/dist/payouts/elements/pending-balance-breakdown.js +5 -61
  44. package/dist/payouts/elements/pending-balance-breakdown.js.map +1 -1
  45. package/dist/payouts/elements/pending-balance-breakdown.mjs +5 -53
  46. package/dist/payouts/elements/pending-balance-breakdown.mjs.map +1 -1
  47. package/dist/payouts/elements/regular-reserve-balance-breakdown.d.ts +8 -13
  48. package/dist/payouts/elements/regular-reserve-balance-breakdown.js +5 -61
  49. package/dist/payouts/elements/regular-reserve-balance-breakdown.js.map +1 -1
  50. package/dist/payouts/elements/regular-reserve-balance-breakdown.mjs +5 -53
  51. package/dist/payouts/elements/regular-reserve-balance-breakdown.mjs.map +1 -1
  52. package/dist/payouts/elements/reset-account.d.ts +8 -13
  53. package/dist/payouts/elements/reset-account.js +5 -61
  54. package/dist/payouts/elements/reset-account.js.map +1 -1
  55. package/dist/payouts/elements/reset-account.mjs +5 -53
  56. package/dist/payouts/elements/reset-account.mjs.map +1 -1
  57. package/dist/payouts/elements/total-balance-breakdown.d.ts +8 -13
  58. package/dist/payouts/elements/total-balance-breakdown.js +5 -61
  59. package/dist/payouts/elements/total-balance-breakdown.js.map +1 -1
  60. package/dist/payouts/elements/total-balance-breakdown.mjs +5 -53
  61. package/dist/payouts/elements/total-balance-breakdown.mjs.map +1 -1
  62. package/dist/payouts/elements/verify.d.ts +8 -13
  63. package/dist/payouts/elements/verify.js +5 -58
  64. package/dist/payouts/elements/verify.js.map +1 -1
  65. package/dist/payouts/elements/verify.mjs +5 -53
  66. package/dist/payouts/elements/verify.mjs.map +1 -1
  67. package/dist/payouts/elements/withdraw-button.d.ts +8 -13
  68. package/dist/payouts/elements/withdraw-button.js +5 -61
  69. package/dist/payouts/elements/withdraw-button.js.map +1 -1
  70. package/dist/payouts/elements/withdraw-button.mjs +5 -53
  71. package/dist/payouts/elements/withdraw-button.mjs.map +1 -1
  72. package/dist/payouts/elements/withdrawal-breakdown.d.ts +8 -13
  73. package/dist/payouts/elements/withdrawal-breakdown.js +5 -61
  74. package/dist/payouts/elements/withdrawal-breakdown.js.map +1 -1
  75. package/dist/payouts/elements/withdrawal-breakdown.mjs +5 -53
  76. package/dist/payouts/elements/withdrawal-breakdown.mjs.map +1 -1
  77. package/dist/payouts/elements/withdrawals.d.ts +8 -13
  78. package/dist/payouts/elements/withdrawals.js +5 -61
  79. package/dist/payouts/elements/withdrawals.js.map +1 -1
  80. package/dist/payouts/elements/withdrawals.mjs +5 -53
  81. package/dist/payouts/elements/withdrawals.mjs.map +1 -1
  82. package/dist/payouts/index.d.ts +3 -0
  83. package/package.json +2 -2
  84. package/package.json.temp +0 -44
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  "use client";
3
- var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
7
  var __export = (target, all) => {
10
8
  for (var name in all)
@@ -18,69 +16,15 @@ var __copyProps = (to, from, except, desc) => {
18
16
  }
19
17
  return to;
20
18
  };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
20
  var bnpl_reserve_balance_breakdown_exports = {};
31
21
  __export(bnpl_reserve_balance_breakdown_exports, {
32
22
  BnplReserveBalanceBreakdownElement: () => BnplReserveBalanceBreakdownElement
33
23
  });
34
24
  module.exports = __toCommonJS(bnpl_reserve_balance_breakdown_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_use_element_snapshot = require("../../lib/use-element-snapshot");
37
- var import_session = require("../session");
38
- function BnplReserveBalanceBreakdownElement({
39
- options = {},
40
- className,
41
- style,
42
- onReady,
43
- fallback
44
- }) {
45
- const payoutsSession = (0, import_session.usePayoutsSession)();
46
- const ref = (0, import_react.useRef)(null);
47
- const element = (0, import_react.useMemo)(() => {
48
- if (!payoutsSession) return null;
49
- const createdElement = payoutsSession.createElement(
50
- BnplReserveBalanceBreakdownElement,
51
- options
52
- );
53
- return createdElement;
54
- }, [payoutsSession]);
55
- const elementSnapshot = (0, import_use_element_snapshot.useElementSnapshot)(element);
56
- const isReady = elementSnapshot?.state === "ready";
57
- (0, import_react.useEffect)(() => {
58
- if (!element) return;
59
- element.updateOptions(options);
60
- }, [options, element]);
61
- (0, import_react.useEffect)(() => {
62
- if (!element || !onReady) return;
63
- element.on("ready", onReady);
64
- return () => {
65
- element.off("ready", onReady);
66
- };
67
- }, [element, onReady]);
68
- (0, import_react.useLayoutEffect)(() => {
69
- if (!element || !ref.current) return;
70
- element.mount(ref.current);
71
- return () => {
72
- element.unmount();
73
- };
74
- }, [element, ref.current]);
75
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
76
- "div",
77
- {
78
- style: { ...style, visibility: isReady ? void 0 : "hidden" },
79
- className,
80
- ref
81
- }
82
- ), !isReady && (fallback ?? null));
83
- }
84
- BnplReserveBalanceBreakdownElement.displayName = "BnplReserveBalanceBreakdownElement";
85
- BnplReserveBalanceBreakdownElement.type = "bnpl-reserve-balance-breakdown-element";
25
+ var import_with_fallback = require("../../lib/with-fallback");
26
+ const BnplReserveBalanceBreakdownElement = (0, import_with_fallback.withFallback)({
27
+ displayName: "BnplReserveBalanceBreakdownElement",
28
+ type: "bnpl-reserve-balance-breakdown-element"
29
+ });
86
30
  //# sourceMappingURL=bnpl-reserve-balance-breakdown.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/payouts/elements/bnpl-reserve-balance-breakdown.tsx"],"sourcesContent":["\"use client\";\n\nimport type { BnplReserveBalanceBreakdownElementOptions } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport React, { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { useElementSnapshot } from \"../../lib/use-element-snapshot\";\nimport { usePayoutsSession } from \"../session\";\n\nexport function BnplReserveBalanceBreakdownElement({\n\toptions = {},\n\tclassName,\n\tstyle,\n\tonReady,\n\tfallback,\n}: {\n\toptions?: BnplReserveBalanceBreakdownElementOptions;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonReady?: () => void;\n\tfallback?: React.ReactNode;\n}) {\n\tconst payoutsSession = usePayoutsSession();\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst element = useMemo(() => {\n\t\tif (!payoutsSession) return null;\n\t\tconst createdElement = payoutsSession.createElement(\n\t\t\tBnplReserveBalanceBreakdownElement,\n\t\t\toptions,\n\t\t);\n\t\treturn createdElement;\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [payoutsSession]);\n\n\tconst elementSnapshot = useElementSnapshot(element);\n\n\tconst isReady = elementSnapshot?.state === \"ready\";\n\n\tuseEffect(() => {\n\t\tif (!element) return;\n\t\telement.updateOptions(options);\n\t}, [options, element]);\n\n\tuseEffect(() => {\n\t\tif (!element || !onReady) return;\n\t\telement.on(\"ready\", onReady);\n\t\treturn () => {\n\t\t\telement.off(\"ready\", onReady);\n\t\t};\n\t}, [element, onReady]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!element || !ref.current) return;\n\t\telement.mount(ref.current);\n\t\treturn () => {\n\t\t\telement.unmount();\n\t\t};\n\t}, [element, ref.current]);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{ ...style, visibility: isReady ? undefined : \"hidden\" }}\n\t\t\t\tclassName={className}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t\t{!isReady && (fallback ?? null)}\n\t\t</>\n\t);\n}\n\nBnplReserveBalanceBreakdownElement.displayName =\n\t\"BnplReserveBalanceBreakdownElement\";\nBnplReserveBalanceBreakdownElement.type =\n\t\"bnpl-reserve-balance-breakdown-element\" as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAAmE;AACnE,kCAAmC;AACnC,qBAAkC;AAE3B,SAAS,mCAAmC;AAAA,EAClD,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAMG;AACF,QAAM,qBAAiB,kCAAkB;AACzC,QAAM,UAAM,qBAAuB,IAAI;AACvC,QAAM,cAAU,sBAAQ,MAAM;AAC7B,QAAI,CAAC,eAAgB,QAAO;AAC5B,UAAM,iBAAiB,eAAe;AAAA,MACrC;AAAA,MACA;AAAA,IACD;AACA,WAAO;AAAA,EAER,GAAG,CAAC,cAAc,CAAC;AAEnB,QAAM,sBAAkB,gDAAmB,OAAO;AAElD,QAAM,UAAU,iBAAiB,UAAU;AAE3C,8BAAU,MAAM;AACf,QAAI,CAAC,QAAS;AACd,YAAQ,cAAc,OAAO;AAAA,EAC9B,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,8BAAU,MAAM;AACf,QAAI,CAAC,WAAW,CAAC,QAAS;AAC1B,YAAQ,GAAG,SAAS,OAAO;AAC3B,WAAO,MAAM;AACZ,cAAQ,IAAI,SAAS,OAAO;AAAA,IAC7B;AAAA,EACD,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,oCAAgB,MAAM;AACrB,QAAI,CAAC,WAAW,CAAC,IAAI,QAAS;AAC9B,YAAQ,MAAM,IAAI,OAAO;AACzB,WAAO,MAAM;AACZ,cAAQ,QAAQ;AAAA,IACjB;AAAA,EACD,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEzB,SACC,6BAAAA,QAAA,2BAAAA,QAAA,gBACC,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACA,OAAO,EAAE,GAAG,OAAO,YAAY,UAAU,SAAY,SAAS;AAAA,MAC9D;AAAA,MACA;AAAA;AAAA,EACD,GACC,CAAC,YAAY,YAAY,KAC3B;AAEF;AAEA,mCAAmC,cAClC;AACD,mCAAmC,OAClC;","names":["React"]}
1
+ {"version":3,"sources":["../../../src/payouts/elements/bnpl-reserve-balance-breakdown.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const BnplReserveBalanceBreakdownElement = withFallback({\n\tdisplayName: \"BnplReserveBalanceBreakdownElement\",\n\ttype: \"bnpl-reserve-balance-breakdown-element\",\n} as const);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAA6B;AAEtB,MAAM,yCAAqC,mCAAa;AAAA,EAC9D,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
@@ -1,56 +1,8 @@
1
1
  "use client";
2
2
  import "../../chunk-NSSMTXJJ.mjs";
3
- import React, { useEffect, useLayoutEffect, useMemo, useRef } from "react";
4
- import { useElementSnapshot } from "../../lib/use-element-snapshot.mjs";
5
- import { usePayoutsSession } from "../session.mjs";
6
- function BnplReserveBalanceBreakdownElement({ options = {}, className, style, onReady, fallback }) {
7
- const payoutsSession = usePayoutsSession();
8
- const ref = useRef(null);
9
- const element = useMemo(()=>{
10
- if (!payoutsSession) return null;
11
- const createdElement = payoutsSession.createElement(BnplReserveBalanceBreakdownElement, options);
12
- return createdElement;
13
- }, [
14
- payoutsSession
15
- ]);
16
- const elementSnapshot = useElementSnapshot(element);
17
- const isReady = elementSnapshot?.state === "ready";
18
- useEffect(()=>{
19
- if (!element) return;
20
- element.updateOptions(options);
21
- }, [
22
- options,
23
- element
24
- ]);
25
- useEffect(()=>{
26
- if (!element || !onReady) return;
27
- element.on("ready", onReady);
28
- return ()=>{
29
- element.off("ready", onReady);
30
- };
31
- }, [
32
- element,
33
- onReady
34
- ]);
35
- useLayoutEffect(()=>{
36
- if (!element || !ref.current) return;
37
- element.mount(ref.current);
38
- return ()=>{
39
- element.unmount();
40
- };
41
- }, [
42
- element,
43
- ref.current
44
- ]);
45
- return React.createElement(React.Fragment, null, React.createElement("div", {
46
- style: {
47
- ...style,
48
- visibility: isReady ? void 0 : "hidden"
49
- },
50
- className,
51
- ref
52
- }), !isReady && (fallback ?? null));
53
- }
54
- BnplReserveBalanceBreakdownElement.displayName = "BnplReserveBalanceBreakdownElement";
55
- BnplReserveBalanceBreakdownElement.type = "bnpl-reserve-balance-breakdown-element";
3
+ import { withFallback } from "../../lib/with-fallback.mjs";
4
+ const BnplReserveBalanceBreakdownElement = withFallback({
5
+ displayName: "BnplReserveBalanceBreakdownElement",
6
+ type: "bnpl-reserve-balance-breakdown-element"
7
+ });
56
8
  export { BnplReserveBalanceBreakdownElement };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/payouts/elements/bnpl-reserve-balance-breakdown.tsx"],"sourcesContent":["\"use client\";\n\nimport type { BnplReserveBalanceBreakdownElementOptions } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport React, { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { useElementSnapshot } from \"../../lib/use-element-snapshot\";\nimport { usePayoutsSession } from \"../session\";\n\nexport function BnplReserveBalanceBreakdownElement({\n\toptions = {},\n\tclassName,\n\tstyle,\n\tonReady,\n\tfallback,\n}: {\n\toptions?: BnplReserveBalanceBreakdownElementOptions;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonReady?: () => void;\n\tfallback?: React.ReactNode;\n}) {\n\tconst payoutsSession = usePayoutsSession();\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst element = useMemo(() => {\n\t\tif (!payoutsSession) return null;\n\t\tconst createdElement = payoutsSession.createElement(\n\t\t\tBnplReserveBalanceBreakdownElement,\n\t\t\toptions,\n\t\t);\n\t\treturn createdElement;\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [payoutsSession]);\n\n\tconst elementSnapshot = useElementSnapshot(element);\n\n\tconst isReady = elementSnapshot?.state === \"ready\";\n\n\tuseEffect(() => {\n\t\tif (!element) return;\n\t\telement.updateOptions(options);\n\t}, [options, element]);\n\n\tuseEffect(() => {\n\t\tif (!element || !onReady) return;\n\t\telement.on(\"ready\", onReady);\n\t\treturn () => {\n\t\t\telement.off(\"ready\", onReady);\n\t\t};\n\t}, [element, onReady]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!element || !ref.current) return;\n\t\telement.mount(ref.current);\n\t\treturn () => {\n\t\t\telement.unmount();\n\t\t};\n\t}, [element, ref.current]);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{ ...style, visibility: isReady ? undefined : \"hidden\" }}\n\t\t\t\tclassName={className}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t\t{!isReady && (fallback ?? null)}\n\t\t</>\n\t);\n}\n\nBnplReserveBalanceBreakdownElement.displayName =\n\t\"BnplReserveBalanceBreakdownElement\";\nBnplReserveBalanceBreakdownElement.type =\n\t\"bnpl-reserve-balance-breakdown-element\" as const;\n"],"mappings":";;AAIA,OAAO,SAAS,WAAW,iBAAiB,SAAS,cAAc;AACnE,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAE3B,SAAS,mCAAmC;AAAA,EAClD,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAMG;AACF,QAAM,iBAAiB,kBAAkB;AACzC,QAAM,MAAM,OAAuB,IAAI;AACvC,QAAM,UAAU,QAAQ,MAAM;AAC7B,QAAI,CAAC,eAAgB,QAAO;AAC5B,UAAM,iBAAiB,eAAe;AAAA,MACrC;AAAA,MACA;AAAA,IACD;AACA,WAAO;AAAA,EAER,GAAG,CAAC,cAAc,CAAC;AAEnB,QAAM,kBAAkB,mBAAmB,OAAO;AAElD,QAAM,UAAU,iBAAiB,UAAU;AAE3C,YAAU,MAAM;AACf,QAAI,CAAC,QAAS;AACd,YAAQ,cAAc,OAAO;AAAA,EAC9B,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,YAAU,MAAM;AACf,QAAI,CAAC,WAAW,CAAC,QAAS;AAC1B,YAAQ,GAAG,SAAS,OAAO;AAC3B,WAAO,MAAM;AACZ,cAAQ,IAAI,SAAS,OAAO;AAAA,IAC7B;AAAA,EACD,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,kBAAgB,MAAM;AACrB,QAAI,CAAC,WAAW,CAAC,IAAI,QAAS;AAC9B,YAAQ,MAAM,IAAI,OAAO;AACzB,WAAO,MAAM;AACZ,cAAQ,QAAQ;AAAA,IACjB;AAAA,EACD,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEzB,SACC,0DACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAO,EAAE,GAAG,OAAO,YAAY,UAAU,SAAY,SAAS;AAAA,MAC9D;AAAA,MACA;AAAA;AAAA,EACD,GACC,CAAC,YAAY,YAAY,KAC3B;AAEF;AAEA,mCAAmC,cAClC;AACD,mCAAmC,OAClC;","names":[]}
1
+ {"version":3,"sources":["../../../src/payouts/elements/bnpl-reserve-balance-breakdown.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const BnplReserveBalanceBreakdownElement = withFallback({\n\tdisplayName: \"BnplReserveBalanceBreakdownElement\",\n\ttype: \"bnpl-reserve-balance-breakdown-element\",\n} as const);\n"],"mappings":";;AAEA,SAAS,oBAAoB;AAEtB,MAAM,qCAAqC,aAAa;AAAA,EAC9D,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
@@ -1,16 +1,11 @@
1
- import { ChangeAccountCountryElementOptions } from '@whop/embedded-components-vanilla-js/types';
2
- import React__default from 'react';
1
+ import { WithFallbackPropsOptional } from '../../lib/with-fallback.js';
2
+ import * as _whop_embedded_components_vanilla_js_types from '@whop/embedded-components-vanilla-js/types';
3
+ import 'react';
3
4
 
4
- declare function ChangeAccountCountryElement({ options, className, style, onReady, fallback, }: {
5
- options?: ChangeAccountCountryElementOptions;
6
- className?: string;
7
- style?: React__default.CSSProperties;
8
- onReady?: () => void;
9
- fallback?: React__default.ReactNode;
10
- }): React__default.JSX.Element;
11
- declare namespace ChangeAccountCountryElement {
12
- var displayName: string;
13
- var type: "change-account-country-element";
14
- }
5
+ declare const ChangeAccountCountryElement: {
6
+ (props: WithFallbackPropsOptional<_whop_embedded_components_vanilla_js_types.ChangeAccountCountryElementOptions>): React.ReactNode;
7
+ displayName: string;
8
+ type: string;
9
+ };
15
10
 
16
11
  export { ChangeAccountCountryElement };
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  "use client";
3
- var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
7
  var __export = (target, all) => {
10
8
  for (var name in all)
@@ -18,69 +16,15 @@ var __copyProps = (to, from, except, desc) => {
18
16
  }
19
17
  return to;
20
18
  };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
20
  var change_account_country_exports = {};
31
21
  __export(change_account_country_exports, {
32
22
  ChangeAccountCountryElement: () => ChangeAccountCountryElement
33
23
  });
34
24
  module.exports = __toCommonJS(change_account_country_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_use_element_snapshot = require("../../lib/use-element-snapshot");
37
- var import_session = require("../session");
38
- function ChangeAccountCountryElement({
39
- options = {},
40
- className,
41
- style,
42
- onReady,
43
- fallback
44
- }) {
45
- const payoutsSession = (0, import_session.usePayoutsSession)();
46
- const ref = (0, import_react.useRef)(null);
47
- const element = (0, import_react.useMemo)(() => {
48
- if (!payoutsSession) return null;
49
- const createdElement = payoutsSession.createElement(
50
- ChangeAccountCountryElement,
51
- options
52
- );
53
- return createdElement;
54
- }, [payoutsSession]);
55
- const elementSnapshot = (0, import_use_element_snapshot.useElementSnapshot)(element);
56
- const isReady = elementSnapshot?.state === "ready";
57
- (0, import_react.useEffect)(() => {
58
- if (!element) return;
59
- element.updateOptions(options);
60
- }, [options, element]);
61
- (0, import_react.useEffect)(() => {
62
- if (!element || !onReady) return;
63
- element.on("ready", onReady);
64
- return () => {
65
- element.off("ready", onReady);
66
- };
67
- }, [element, onReady]);
68
- (0, import_react.useLayoutEffect)(() => {
69
- if (!element || !ref.current) return;
70
- element.mount(ref.current);
71
- return () => {
72
- element.unmount();
73
- };
74
- }, [element, ref.current]);
75
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
76
- "div",
77
- {
78
- style: { ...style, visibility: isReady ? void 0 : "hidden" },
79
- className,
80
- ref
81
- }
82
- ), !isReady && (fallback ?? null));
83
- }
84
- ChangeAccountCountryElement.displayName = "ChangeAccountCountryElement";
85
- ChangeAccountCountryElement.type = "change-account-country-element";
25
+ var import_with_fallback = require("../../lib/with-fallback");
26
+ const ChangeAccountCountryElement = (0, import_with_fallback.withFallback)({
27
+ displayName: "ChangeAccountCountryElement",
28
+ type: "change-account-country-element"
29
+ });
86
30
  //# sourceMappingURL=change-account-country.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/payouts/elements/change-account-country.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ChangeAccountCountryElementOptions } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport React, { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { useElementSnapshot } from \"../../lib/use-element-snapshot\";\nimport { usePayoutsSession } from \"../session\";\n\nexport function ChangeAccountCountryElement({\n\toptions = {},\n\tclassName,\n\tstyle,\n\tonReady,\n\tfallback,\n}: {\n\toptions?: ChangeAccountCountryElementOptions;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonReady?: () => void;\n\tfallback?: React.ReactNode;\n}) {\n\tconst payoutsSession = usePayoutsSession();\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst element = useMemo(() => {\n\t\tif (!payoutsSession) return null;\n\t\tconst createdElement = payoutsSession.createElement(\n\t\t\tChangeAccountCountryElement,\n\t\t\toptions,\n\t\t);\n\t\treturn createdElement;\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [payoutsSession]);\n\n\tconst elementSnapshot = useElementSnapshot(element);\n\n\tconst isReady = elementSnapshot?.state === \"ready\";\n\n\tuseEffect(() => {\n\t\tif (!element) return;\n\t\telement.updateOptions(options);\n\t}, [options, element]);\n\n\tuseEffect(() => {\n\t\tif (!element || !onReady) return;\n\t\telement.on(\"ready\", onReady);\n\t\treturn () => {\n\t\t\telement.off(\"ready\", onReady);\n\t\t};\n\t}, [element, onReady]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!element || !ref.current) return;\n\t\telement.mount(ref.current);\n\t\treturn () => {\n\t\t\telement.unmount();\n\t\t};\n\t}, [element, ref.current]);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{ ...style, visibility: isReady ? undefined : \"hidden\" }}\n\t\t\t\tclassName={className}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t\t{!isReady && (fallback ?? null)}\n\t\t</>\n\t);\n}\n\nChangeAccountCountryElement.displayName = \"ChangeAccountCountryElement\";\nChangeAccountCountryElement.type = \"change-account-country-element\" as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAAmE;AACnE,kCAAmC;AACnC,qBAAkC;AAE3B,SAAS,4BAA4B;AAAA,EAC3C,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAMG;AACF,QAAM,qBAAiB,kCAAkB;AACzC,QAAM,UAAM,qBAAuB,IAAI;AACvC,QAAM,cAAU,sBAAQ,MAAM;AAC7B,QAAI,CAAC,eAAgB,QAAO;AAC5B,UAAM,iBAAiB,eAAe;AAAA,MACrC;AAAA,MACA;AAAA,IACD;AACA,WAAO;AAAA,EAER,GAAG,CAAC,cAAc,CAAC;AAEnB,QAAM,sBAAkB,gDAAmB,OAAO;AAElD,QAAM,UAAU,iBAAiB,UAAU;AAE3C,8BAAU,MAAM;AACf,QAAI,CAAC,QAAS;AACd,YAAQ,cAAc,OAAO;AAAA,EAC9B,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,8BAAU,MAAM;AACf,QAAI,CAAC,WAAW,CAAC,QAAS;AAC1B,YAAQ,GAAG,SAAS,OAAO;AAC3B,WAAO,MAAM;AACZ,cAAQ,IAAI,SAAS,OAAO;AAAA,IAC7B;AAAA,EACD,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,oCAAgB,MAAM;AACrB,QAAI,CAAC,WAAW,CAAC,IAAI,QAAS;AAC9B,YAAQ,MAAM,IAAI,OAAO;AACzB,WAAO,MAAM;AACZ,cAAQ,QAAQ;AAAA,IACjB;AAAA,EACD,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEzB,SACC,6BAAAA,QAAA,2BAAAA,QAAA,gBACC,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACA,OAAO,EAAE,GAAG,OAAO,YAAY,UAAU,SAAY,SAAS;AAAA,MAC9D;AAAA,MACA;AAAA;AAAA,EACD,GACC,CAAC,YAAY,YAAY,KAC3B;AAEF;AAEA,4BAA4B,cAAc;AAC1C,4BAA4B,OAAO;","names":["React"]}
1
+ {"version":3,"sources":["../../../src/payouts/elements/change-account-country.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const ChangeAccountCountryElement = withFallback({\n\tdisplayName: \"ChangeAccountCountryElement\",\n\ttype: \"change-account-country-element\",\n} as const);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAA6B;AAEtB,MAAM,kCAA8B,mCAAa;AAAA,EACvD,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
@@ -1,56 +1,8 @@
1
1
  "use client";
2
2
  import "../../chunk-NSSMTXJJ.mjs";
3
- import React, { useEffect, useLayoutEffect, useMemo, useRef } from "react";
4
- import { useElementSnapshot } from "../../lib/use-element-snapshot.mjs";
5
- import { usePayoutsSession } from "../session.mjs";
6
- function ChangeAccountCountryElement({ options = {}, className, style, onReady, fallback }) {
7
- const payoutsSession = usePayoutsSession();
8
- const ref = useRef(null);
9
- const element = useMemo(()=>{
10
- if (!payoutsSession) return null;
11
- const createdElement = payoutsSession.createElement(ChangeAccountCountryElement, options);
12
- return createdElement;
13
- }, [
14
- payoutsSession
15
- ]);
16
- const elementSnapshot = useElementSnapshot(element);
17
- const isReady = elementSnapshot?.state === "ready";
18
- useEffect(()=>{
19
- if (!element) return;
20
- element.updateOptions(options);
21
- }, [
22
- options,
23
- element
24
- ]);
25
- useEffect(()=>{
26
- if (!element || !onReady) return;
27
- element.on("ready", onReady);
28
- return ()=>{
29
- element.off("ready", onReady);
30
- };
31
- }, [
32
- element,
33
- onReady
34
- ]);
35
- useLayoutEffect(()=>{
36
- if (!element || !ref.current) return;
37
- element.mount(ref.current);
38
- return ()=>{
39
- element.unmount();
40
- };
41
- }, [
42
- element,
43
- ref.current
44
- ]);
45
- return React.createElement(React.Fragment, null, React.createElement("div", {
46
- style: {
47
- ...style,
48
- visibility: isReady ? void 0 : "hidden"
49
- },
50
- className,
51
- ref
52
- }), !isReady && (fallback ?? null));
53
- }
54
- ChangeAccountCountryElement.displayName = "ChangeAccountCountryElement";
55
- ChangeAccountCountryElement.type = "change-account-country-element";
3
+ import { withFallback } from "../../lib/with-fallback.mjs";
4
+ const ChangeAccountCountryElement = withFallback({
5
+ displayName: "ChangeAccountCountryElement",
6
+ type: "change-account-country-element"
7
+ });
56
8
  export { ChangeAccountCountryElement };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/payouts/elements/change-account-country.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ChangeAccountCountryElementOptions } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport React, { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { useElementSnapshot } from \"../../lib/use-element-snapshot\";\nimport { usePayoutsSession } from \"../session\";\n\nexport function ChangeAccountCountryElement({\n\toptions = {},\n\tclassName,\n\tstyle,\n\tonReady,\n\tfallback,\n}: {\n\toptions?: ChangeAccountCountryElementOptions;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonReady?: () => void;\n\tfallback?: React.ReactNode;\n}) {\n\tconst payoutsSession = usePayoutsSession();\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst element = useMemo(() => {\n\t\tif (!payoutsSession) return null;\n\t\tconst createdElement = payoutsSession.createElement(\n\t\t\tChangeAccountCountryElement,\n\t\t\toptions,\n\t\t);\n\t\treturn createdElement;\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [payoutsSession]);\n\n\tconst elementSnapshot = useElementSnapshot(element);\n\n\tconst isReady = elementSnapshot?.state === \"ready\";\n\n\tuseEffect(() => {\n\t\tif (!element) return;\n\t\telement.updateOptions(options);\n\t}, [options, element]);\n\n\tuseEffect(() => {\n\t\tif (!element || !onReady) return;\n\t\telement.on(\"ready\", onReady);\n\t\treturn () => {\n\t\t\telement.off(\"ready\", onReady);\n\t\t};\n\t}, [element, onReady]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!element || !ref.current) return;\n\t\telement.mount(ref.current);\n\t\treturn () => {\n\t\t\telement.unmount();\n\t\t};\n\t}, [element, ref.current]);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{ ...style, visibility: isReady ? undefined : \"hidden\" }}\n\t\t\t\tclassName={className}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t\t{!isReady && (fallback ?? null)}\n\t\t</>\n\t);\n}\n\nChangeAccountCountryElement.displayName = \"ChangeAccountCountryElement\";\nChangeAccountCountryElement.type = \"change-account-country-element\" as const;\n"],"mappings":";;AAIA,OAAO,SAAS,WAAW,iBAAiB,SAAS,cAAc;AACnE,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAE3B,SAAS,4BAA4B;AAAA,EAC3C,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAMG;AACF,QAAM,iBAAiB,kBAAkB;AACzC,QAAM,MAAM,OAAuB,IAAI;AACvC,QAAM,UAAU,QAAQ,MAAM;AAC7B,QAAI,CAAC,eAAgB,QAAO;AAC5B,UAAM,iBAAiB,eAAe;AAAA,MACrC;AAAA,MACA;AAAA,IACD;AACA,WAAO;AAAA,EAER,GAAG,CAAC,cAAc,CAAC;AAEnB,QAAM,kBAAkB,mBAAmB,OAAO;AAElD,QAAM,UAAU,iBAAiB,UAAU;AAE3C,YAAU,MAAM;AACf,QAAI,CAAC,QAAS;AACd,YAAQ,cAAc,OAAO;AAAA,EAC9B,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,YAAU,MAAM;AACf,QAAI,CAAC,WAAW,CAAC,QAAS;AAC1B,YAAQ,GAAG,SAAS,OAAO;AAC3B,WAAO,MAAM;AACZ,cAAQ,IAAI,SAAS,OAAO;AAAA,IAC7B;AAAA,EACD,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,kBAAgB,MAAM;AACrB,QAAI,CAAC,WAAW,CAAC,IAAI,QAAS;AAC9B,YAAQ,MAAM,IAAI,OAAO;AACzB,WAAO,MAAM;AACZ,cAAQ,QAAQ;AAAA,IACjB;AAAA,EACD,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEzB,SACC,0DACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAO,EAAE,GAAG,OAAO,YAAY,UAAU,SAAY,SAAS;AAAA,MAC9D;AAAA,MACA;AAAA;AAAA,EACD,GACC,CAAC,YAAY,YAAY,KAC3B;AAEF;AAEA,4BAA4B,cAAc;AAC1C,4BAA4B,OAAO;","names":[]}
1
+ {"version":3,"sources":["../../../src/payouts/elements/change-account-country.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const ChangeAccountCountryElement = withFallback({\n\tdisplayName: \"ChangeAccountCountryElement\",\n\ttype: \"change-account-country-element\",\n} as const);\n"],"mappings":";;AAEA,SAAS,oBAAoB;AAEtB,MAAM,8BAA8B,aAAa;AAAA,EACvD,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
@@ -1,16 +1,11 @@
1
- import { GenerateWithdrawalReceiptElementOptions } from '@whop/embedded-components-vanilla-js/types';
2
- import React__default from 'react';
1
+ import { WithFallbackPropsRequired } from '../../lib/with-fallback.js';
2
+ import * as _whop_embedded_components_vanilla_js_types from '@whop/embedded-components-vanilla-js/types';
3
+ import 'react';
3
4
 
4
- declare function GenerateWithdrawalReceiptElement({ options, className, style, onReady, fallback, }: {
5
- options: GenerateWithdrawalReceiptElementOptions;
6
- className?: string;
7
- style?: React__default.CSSProperties;
8
- onReady?: () => void;
9
- fallback?: React__default.ReactNode;
10
- }): React__default.JSX.Element;
11
- declare namespace GenerateWithdrawalReceiptElement {
12
- var displayName: string;
13
- var type: "generate-withdrawal-receipt-element";
14
- }
5
+ declare const GenerateWithdrawalReceiptElement: {
6
+ (props: WithFallbackPropsRequired<_whop_embedded_components_vanilla_js_types.GenerateWithdrawalReceiptElementOptions>): React.ReactNode;
7
+ displayName: string;
8
+ type: string;
9
+ };
15
10
 
16
11
  export { GenerateWithdrawalReceiptElement };
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  "use client";
3
- var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
7
  var __export = (target, all) => {
10
8
  for (var name in all)
@@ -18,69 +16,15 @@ var __copyProps = (to, from, except, desc) => {
18
16
  }
19
17
  return to;
20
18
  };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
20
  var generate_withdrawal_receipt_exports = {};
31
21
  __export(generate_withdrawal_receipt_exports, {
32
22
  GenerateWithdrawalReceiptElement: () => GenerateWithdrawalReceiptElement
33
23
  });
34
24
  module.exports = __toCommonJS(generate_withdrawal_receipt_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_use_element_snapshot = require("../../lib/use-element-snapshot");
37
- var import_session = require("../session");
38
- function GenerateWithdrawalReceiptElement({
39
- options,
40
- className,
41
- style,
42
- onReady,
43
- fallback
44
- }) {
45
- const payoutsSession = (0, import_session.usePayoutsSession)();
46
- const ref = (0, import_react.useRef)(null);
47
- const element = (0, import_react.useMemo)(() => {
48
- if (!payoutsSession) return null;
49
- const createdElement = payoutsSession.createElement(
50
- GenerateWithdrawalReceiptElement,
51
- options
52
- );
53
- return createdElement;
54
- }, [payoutsSession]);
55
- const elementSnapshot = (0, import_use_element_snapshot.useElementSnapshot)(element);
56
- const isReady = elementSnapshot?.state === "ready";
57
- (0, import_react.useEffect)(() => {
58
- if (!element) return;
59
- element.updateOptions(options);
60
- }, [options, element]);
61
- (0, import_react.useEffect)(() => {
62
- if (!element || !onReady) return;
63
- element.on("ready", onReady);
64
- return () => {
65
- element.off("ready", onReady);
66
- };
67
- }, [element, onReady]);
68
- (0, import_react.useLayoutEffect)(() => {
69
- if (!element || !ref.current) return;
70
- element.mount(ref.current);
71
- return () => {
72
- element.unmount();
73
- };
74
- }, [element, ref.current]);
75
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
76
- "div",
77
- {
78
- style: { ...style, visibility: isReady ? void 0 : "hidden" },
79
- className,
80
- ref
81
- }
82
- ), !isReady && (fallback ?? null));
83
- }
84
- GenerateWithdrawalReceiptElement.displayName = "GenerateWithdrawalReceiptElement";
85
- GenerateWithdrawalReceiptElement.type = "generate-withdrawal-receipt-element";
25
+ var import_with_fallback = require("../../lib/with-fallback");
26
+ const GenerateWithdrawalReceiptElement = (0, import_with_fallback.withFallback)({
27
+ displayName: "GenerateWithdrawalReceiptElement",
28
+ type: "generate-withdrawal-receipt-element"
29
+ });
86
30
  //# sourceMappingURL=generate-withdrawal-receipt.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/payouts/elements/generate-withdrawal-receipt.tsx"],"sourcesContent":["\"use client\";\n\nimport type { GenerateWithdrawalReceiptElementOptions } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport React, { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { useElementSnapshot } from \"../../lib/use-element-snapshot\";\nimport { usePayoutsSession } from \"../session\";\n\nexport function GenerateWithdrawalReceiptElement({\n\toptions,\n\tclassName,\n\tstyle,\n\tonReady,\n\tfallback,\n}: {\n\toptions: GenerateWithdrawalReceiptElementOptions;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonReady?: () => void;\n\tfallback?: React.ReactNode;\n}) {\n\tconst payoutsSession = usePayoutsSession();\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst element = useMemo(() => {\n\t\tif (!payoutsSession) return null;\n\t\tconst createdElement = payoutsSession.createElement(\n\t\t\tGenerateWithdrawalReceiptElement,\n\t\t\toptions,\n\t\t);\n\t\treturn createdElement;\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [payoutsSession]);\n\n\tconst elementSnapshot = useElementSnapshot(element);\n\n\tconst isReady = elementSnapshot?.state === \"ready\";\n\n\tuseEffect(() => {\n\t\tif (!element) return;\n\t\telement.updateOptions(options);\n\t}, [options, element]);\n\n\tuseEffect(() => {\n\t\tif (!element || !onReady) return;\n\t\telement.on(\"ready\", onReady);\n\t\treturn () => {\n\t\t\telement.off(\"ready\", onReady);\n\t\t};\n\t}, [element, onReady]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!element || !ref.current) return;\n\t\telement.mount(ref.current);\n\t\treturn () => {\n\t\t\telement.unmount();\n\t\t};\n\t}, [element, ref.current]);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{ ...style, visibility: isReady ? undefined : \"hidden\" }}\n\t\t\t\tclassName={className}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t\t{!isReady && (fallback ?? null)}\n\t\t</>\n\t);\n}\n\nGenerateWithdrawalReceiptElement.displayName =\n\t\"GenerateWithdrawalReceiptElement\";\nGenerateWithdrawalReceiptElement.type =\n\t\"generate-withdrawal-receipt-element\" as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAAmE;AACnE,kCAAmC;AACnC,qBAAkC;AAE3B,SAAS,iCAAiC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAMG;AACF,QAAM,qBAAiB,kCAAkB;AACzC,QAAM,UAAM,qBAAuB,IAAI;AACvC,QAAM,cAAU,sBAAQ,MAAM;AAC7B,QAAI,CAAC,eAAgB,QAAO;AAC5B,UAAM,iBAAiB,eAAe;AAAA,MACrC;AAAA,MACA;AAAA,IACD;AACA,WAAO;AAAA,EAER,GAAG,CAAC,cAAc,CAAC;AAEnB,QAAM,sBAAkB,gDAAmB,OAAO;AAElD,QAAM,UAAU,iBAAiB,UAAU;AAE3C,8BAAU,MAAM;AACf,QAAI,CAAC,QAAS;AACd,YAAQ,cAAc,OAAO;AAAA,EAC9B,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,8BAAU,MAAM;AACf,QAAI,CAAC,WAAW,CAAC,QAAS;AAC1B,YAAQ,GAAG,SAAS,OAAO;AAC3B,WAAO,MAAM;AACZ,cAAQ,IAAI,SAAS,OAAO;AAAA,IAC7B;AAAA,EACD,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,oCAAgB,MAAM;AACrB,QAAI,CAAC,WAAW,CAAC,IAAI,QAAS;AAC9B,YAAQ,MAAM,IAAI,OAAO;AACzB,WAAO,MAAM;AACZ,cAAQ,QAAQ;AAAA,IACjB;AAAA,EACD,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEzB,SACC,6BAAAA,QAAA,2BAAAA,QAAA,gBACC,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACA,OAAO,EAAE,GAAG,OAAO,YAAY,UAAU,SAAY,SAAS;AAAA,MAC9D;AAAA,MACA;AAAA;AAAA,EACD,GACC,CAAC,YAAY,YAAY,KAC3B;AAEF;AAEA,iCAAiC,cAChC;AACD,iCAAiC,OAChC;","names":["React"]}
1
+ {"version":3,"sources":["../../../src/payouts/elements/generate-withdrawal-receipt.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const GenerateWithdrawalReceiptElement = withFallback<\n\t\"generate-withdrawal-receipt-element\",\n\ttrue\n>({\n\tdisplayName: \"GenerateWithdrawalReceiptElement\",\n\ttype: \"generate-withdrawal-receipt-element\",\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAA6B;AAEtB,MAAM,uCAAmC,mCAG9C;AAAA,EACD,aAAa;AAAA,EACb,MAAM;AACP,CAAC;","names":[]}
@@ -1,56 +1,8 @@
1
1
  "use client";
2
2
  import "../../chunk-NSSMTXJJ.mjs";
3
- import React, { useEffect, useLayoutEffect, useMemo, useRef } from "react";
4
- import { useElementSnapshot } from "../../lib/use-element-snapshot.mjs";
5
- import { usePayoutsSession } from "../session.mjs";
6
- function GenerateWithdrawalReceiptElement({ options, className, style, onReady, fallback }) {
7
- const payoutsSession = usePayoutsSession();
8
- const ref = useRef(null);
9
- const element = useMemo(()=>{
10
- if (!payoutsSession) return null;
11
- const createdElement = payoutsSession.createElement(GenerateWithdrawalReceiptElement, options);
12
- return createdElement;
13
- }, [
14
- payoutsSession
15
- ]);
16
- const elementSnapshot = useElementSnapshot(element);
17
- const isReady = elementSnapshot?.state === "ready";
18
- useEffect(()=>{
19
- if (!element) return;
20
- element.updateOptions(options);
21
- }, [
22
- options,
23
- element
24
- ]);
25
- useEffect(()=>{
26
- if (!element || !onReady) return;
27
- element.on("ready", onReady);
28
- return ()=>{
29
- element.off("ready", onReady);
30
- };
31
- }, [
32
- element,
33
- onReady
34
- ]);
35
- useLayoutEffect(()=>{
36
- if (!element || !ref.current) return;
37
- element.mount(ref.current);
38
- return ()=>{
39
- element.unmount();
40
- };
41
- }, [
42
- element,
43
- ref.current
44
- ]);
45
- return React.createElement(React.Fragment, null, React.createElement("div", {
46
- style: {
47
- ...style,
48
- visibility: isReady ? void 0 : "hidden"
49
- },
50
- className,
51
- ref
52
- }), !isReady && (fallback ?? null));
53
- }
54
- GenerateWithdrawalReceiptElement.displayName = "GenerateWithdrawalReceiptElement";
55
- GenerateWithdrawalReceiptElement.type = "generate-withdrawal-receipt-element";
3
+ import { withFallback } from "../../lib/with-fallback.mjs";
4
+ const GenerateWithdrawalReceiptElement = withFallback({
5
+ displayName: "GenerateWithdrawalReceiptElement",
6
+ type: "generate-withdrawal-receipt-element"
7
+ });
56
8
  export { GenerateWithdrawalReceiptElement };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/payouts/elements/generate-withdrawal-receipt.tsx"],"sourcesContent":["\"use client\";\n\nimport type { GenerateWithdrawalReceiptElementOptions } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport React, { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { useElementSnapshot } from \"../../lib/use-element-snapshot\";\nimport { usePayoutsSession } from \"../session\";\n\nexport function GenerateWithdrawalReceiptElement({\n\toptions,\n\tclassName,\n\tstyle,\n\tonReady,\n\tfallback,\n}: {\n\toptions: GenerateWithdrawalReceiptElementOptions;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonReady?: () => void;\n\tfallback?: React.ReactNode;\n}) {\n\tconst payoutsSession = usePayoutsSession();\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst element = useMemo(() => {\n\t\tif (!payoutsSession) return null;\n\t\tconst createdElement = payoutsSession.createElement(\n\t\t\tGenerateWithdrawalReceiptElement,\n\t\t\toptions,\n\t\t);\n\t\treturn createdElement;\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [payoutsSession]);\n\n\tconst elementSnapshot = useElementSnapshot(element);\n\n\tconst isReady = elementSnapshot?.state === \"ready\";\n\n\tuseEffect(() => {\n\t\tif (!element) return;\n\t\telement.updateOptions(options);\n\t}, [options, element]);\n\n\tuseEffect(() => {\n\t\tif (!element || !onReady) return;\n\t\telement.on(\"ready\", onReady);\n\t\treturn () => {\n\t\t\telement.off(\"ready\", onReady);\n\t\t};\n\t}, [element, onReady]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!element || !ref.current) return;\n\t\telement.mount(ref.current);\n\t\treturn () => {\n\t\t\telement.unmount();\n\t\t};\n\t}, [element, ref.current]);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tstyle={{ ...style, visibility: isReady ? undefined : \"hidden\" }}\n\t\t\t\tclassName={className}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t\t{!isReady && (fallback ?? null)}\n\t\t</>\n\t);\n}\n\nGenerateWithdrawalReceiptElement.displayName =\n\t\"GenerateWithdrawalReceiptElement\";\nGenerateWithdrawalReceiptElement.type =\n\t\"generate-withdrawal-receipt-element\" as const;\n"],"mappings":";;AAIA,OAAO,SAAS,WAAW,iBAAiB,SAAS,cAAc;AACnE,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAE3B,SAAS,iCAAiC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAMG;AACF,QAAM,iBAAiB,kBAAkB;AACzC,QAAM,MAAM,OAAuB,IAAI;AACvC,QAAM,UAAU,QAAQ,MAAM;AAC7B,QAAI,CAAC,eAAgB,QAAO;AAC5B,UAAM,iBAAiB,eAAe;AAAA,MACrC;AAAA,MACA;AAAA,IACD;AACA,WAAO;AAAA,EAER,GAAG,CAAC,cAAc,CAAC;AAEnB,QAAM,kBAAkB,mBAAmB,OAAO;AAElD,QAAM,UAAU,iBAAiB,UAAU;AAE3C,YAAU,MAAM;AACf,QAAI,CAAC,QAAS;AACd,YAAQ,cAAc,OAAO;AAAA,EAC9B,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,YAAU,MAAM;AACf,QAAI,CAAC,WAAW,CAAC,QAAS;AAC1B,YAAQ,GAAG,SAAS,OAAO;AAC3B,WAAO,MAAM;AACZ,cAAQ,IAAI,SAAS,OAAO;AAAA,IAC7B;AAAA,EACD,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,kBAAgB,MAAM;AACrB,QAAI,CAAC,WAAW,CAAC,IAAI,QAAS;AAC9B,YAAQ,MAAM,IAAI,OAAO;AACzB,WAAO,MAAM;AACZ,cAAQ,QAAQ;AAAA,IACjB;AAAA,EACD,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEzB,SACC,0DACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAO,EAAE,GAAG,OAAO,YAAY,UAAU,SAAY,SAAS;AAAA,MAC9D;AAAA,MACA;AAAA;AAAA,EACD,GACC,CAAC,YAAY,YAAY,KAC3B;AAEF;AAEA,iCAAiC,cAChC;AACD,iCAAiC,OAChC;","names":[]}
1
+ {"version":3,"sources":["../../../src/payouts/elements/generate-withdrawal-receipt.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const GenerateWithdrawalReceiptElement = withFallback<\n\t\"generate-withdrawal-receipt-element\",\n\ttrue\n>({\n\tdisplayName: \"GenerateWithdrawalReceiptElement\",\n\ttype: \"generate-withdrawal-receipt-element\",\n});\n"],"mappings":";;AAEA,SAAS,oBAAoB;AAEtB,MAAM,mCAAmC,aAG9C;AAAA,EACD,aAAa;AAAA,EACb,MAAM;AACP,CAAC;","names":[]}
@@ -1,3 +1,5 @@
1
+ export { AddPayoutMethodElement } from './add-payout-method.js';
2
+ export { AutomaticWithdrawElement } from './automatic-withdraw.js';
1
3
  export { BalanceElement } from './balance.js';
2
4
  export { ChangeAccountCountryElement } from './change-account-country.js';
3
5
  export { ResetAccountElement } from './reset-account.js';
@@ -11,5 +13,6 @@ export { RegularReserveBalanceBreakdownElement } from './regular-reserve-balance
11
13
  export { BnplReserveBalanceBreakdownElement } from './bnpl-reserve-balance-breakdown.js';
12
14
  export { GenerateWithdrawalReceiptElement } from './generate-withdrawal-receipt.js';
13
15
  export { StatusBannerElement } from './status-banner.js';
16
+ import '../../lib/with-fallback.js';
14
17
  import '@whop/embedded-components-vanilla-js/types';
15
18
  import 'react';
@@ -15,6 +15,8 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
16
  var elements_exports = {};
17
17
  module.exports = __toCommonJS(elements_exports);
18
+ __reExport(elements_exports, require("./add-payout-method"), module.exports);
19
+ __reExport(elements_exports, require("./automatic-withdraw"), module.exports);
18
20
  __reExport(elements_exports, require("./balance"), module.exports);
19
21
  __reExport(elements_exports, require("./change-account-country"), module.exports);
20
22
  __reExport(elements_exports, require("./reset-account"), module.exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/payouts/elements/index.tsx"],"sourcesContent":["export * from \"./balance\";\nexport * from \"./change-account-country\";\nexport * from \"./reset-account\";\nexport * from \"./verify\";\nexport * from \"./withdraw-button\";\nexport * from \"./withdrawal-breakdown\";\nexport * from \"./withdrawals\";\nexport * from \"./total-balance-breakdown\";\nexport * from \"./pending-balance-breakdown\";\nexport * from \"./regular-reserve-balance-breakdown\";\nexport * from \"./bnpl-reserve-balance-breakdown\";\nexport * from \"./generate-withdrawal-receipt\";\nexport * from \"./status-banner\";\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,sBAAd;AACA,6BAAc,qCADd;AAEA,6BAAc,4BAFd;AAGA,6BAAc,qBAHd;AAIA,6BAAc,8BAJd;AAKA,6BAAc,mCALd;AAMA,6BAAc,0BANd;AAOA,6BAAc,sCAPd;AAQA,6BAAc,wCARd;AASA,6BAAc,gDATd;AAUA,6BAAc,6CAVd;AAWA,6BAAc,0CAXd;AAYA,6BAAc,4BAZd;","names":[]}
1
+ {"version":3,"sources":["../../../src/payouts/elements/index.tsx"],"sourcesContent":["export * from \"./add-payout-method\";\nexport * from \"./automatic-withdraw\";\nexport * from \"./balance\";\nexport * from \"./change-account-country\";\nexport * from \"./reset-account\";\nexport * from \"./verify\";\nexport * from \"./withdraw-button\";\nexport * from \"./withdrawal-breakdown\";\nexport * from \"./withdrawals\";\nexport * from \"./total-balance-breakdown\";\nexport * from \"./pending-balance-breakdown\";\nexport * from \"./regular-reserve-balance-breakdown\";\nexport * from \"./bnpl-reserve-balance-breakdown\";\nexport * from \"./generate-withdrawal-receipt\";\nexport * from \"./status-banner\";\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,gCAAd;AACA,6BAAc,iCADd;AAEA,6BAAc,sBAFd;AAGA,6BAAc,qCAHd;AAIA,6BAAc,4BAJd;AAKA,6BAAc,qBALd;AAMA,6BAAc,8BANd;AAOA,6BAAc,mCAPd;AAQA,6BAAc,0BARd;AASA,6BAAc,sCATd;AAUA,6BAAc,wCAVd;AAWA,6BAAc,gDAXd;AAYA,6BAAc,6CAZd;AAaA,6BAAc,0CAbd;AAcA,6BAAc,4BAdd;","names":[]}
@@ -1,3 +1,5 @@
1
+ export * from "./add-payout-method.mjs";
2
+ export * from "./automatic-withdraw.mjs";
1
3
  export * from "./balance.mjs";
2
4
  export * from "./change-account-country.mjs";
3
5
  export * from "./reset-account.mjs";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/payouts/elements/index.tsx"],"sourcesContent":["export * from \"./balance\";\nexport * from \"./change-account-country\";\nexport * from \"./reset-account\";\nexport * from \"./verify\";\nexport * from \"./withdraw-button\";\nexport * from \"./withdrawal-breakdown\";\nexport * from \"./withdrawals\";\nexport * from \"./total-balance-breakdown\";\nexport * from \"./pending-balance-breakdown\";\nexport * from \"./regular-reserve-balance-breakdown\";\nexport * from \"./bnpl-reserve-balance-breakdown\";\nexport * from \"./generate-withdrawal-receipt\";\nexport * from \"./status-banner\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/payouts/elements/index.tsx"],"sourcesContent":["export * from \"./add-payout-method\";\nexport * from \"./automatic-withdraw\";\nexport * from \"./balance\";\nexport * from \"./change-account-country\";\nexport * from \"./reset-account\";\nexport * from \"./verify\";\nexport * from \"./withdraw-button\";\nexport * from \"./withdrawal-breakdown\";\nexport * from \"./withdrawals\";\nexport * from \"./total-balance-breakdown\";\nexport * from \"./pending-balance-breakdown\";\nexport * from \"./regular-reserve-balance-breakdown\";\nexport * from \"./bnpl-reserve-balance-breakdown\";\nexport * from \"./generate-withdrawal-receipt\";\nexport * from \"./status-banner\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}