@whop/checkout 0.0.21-canary.7

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/README.md ADDED
File without changes
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";function e(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function t(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function n(e){return t(e.data)=="object"&&e.data!==null&&"event"in e.data&&e.data.event==="resize"}function o(e){window.addEventListener("message",function(t){t.source===e.contentWindow&&n(t)&&t.data.event==="resize"&&(e.style.height="".concat(t.data.height,"px"))})}function a(e){if(e.dataset.whopCheckoutMounted)return;var t=e.dataset.whopCheckoutPlanId;if(!t)return;var n;var a=(n=e.dataset.whopCheckoutOrigin)!==null&&n!==void 0?n:"https://whop.com/",r=new URL("/embedded/checkout/".concat(t,"/"),a),l=e.dataset.whopCheckoutTheme;l&&r.searchParams.set("theme",l);var i=new URL(window.location.href).origin;r.searchParams.set("h",i);var d=document.createElement("iframe");d.src=r.toString(),d.style.width="100%",d.style.height="480px",d.style.border="none",d.style.overflow="hidden",d.sandbox.add("allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"),d.allow="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;",e.dataset.whopCheckoutMounted="true",e.appendChild(d),o(d)}if((typeof window==="undefined"?"undefined":t(window))<"u"&&window.wco&&!window.wco.listening){new MutationObserver(function(t){var n=true,o=false,r=undefined,l=true,i=false,d=undefined;try{for(var u=t[Symbol.iterator](),c;!(l=(c=u.next()).done);l=true){var s=c.value;try{for(var w=s.addedNodes[Symbol.iterator](),f;!(n=(f=w.next()).done);n=true){var h=f.value;e(h,HTMLElement)&&h.dataset.whopCheckoutPlanId&&a(h)}}catch(e){o=true;r=e}finally{try{if(!n&&w.return!=null){w.return()}}finally{if(o){throw r}}}}}catch(e){i=true;d=e}finally{try{if(!l&&u.return!=null){u.return()}}finally{if(i){throw d}}}}).observe(document.body,{childList:!0,subtree:!0});var r=true,l=false,i=undefined;try{for(var d=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),u;!(r=(u=d.next()).done);r=true){var c=u.value;e(c,HTMLElement)&&a(c)}}catch(e){l=true;i=e}finally{try{if(!r&&d.return!=null){d.return()}}finally{if(l){throw i}}}window.wco.listening=!0}
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html style="height: 100%">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width">
6
+ <script src="http://localhost:3000/loader.js"></script>
7
+ <title>Whop embedded checkout</title>
8
+ <style>
9
+ div {
10
+ box-sizing: border-box;
11
+ }
12
+ body {
13
+ margin: 0
14
+ }
15
+ </style>
16
+ </head>
17
+ <body style="display: flex; height: fit-content; width: 100%">
18
+ <div style="flex: 1; height: fit-content; overflow: hidden; max-width: 50%;" data-whop-checkout-theme="light" data-whop-checkout-origin="http://localhost:8004" data-whop-checkout-plan-id="plan_ziYsgX0C9r4rG"></div>
19
+ <div style="flex: 1; height: fit-content; overflow: hidden; max-width: 50%;" data-whop-checkout-theme="light" data-whop-checkout-origin="http://localhost:8004" data-whop-checkout-plan-id="plan_ziYsgX0C9r4rG"></div>
20
+ </body>
21
+ </html>
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";function e(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function t(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}(function(){var n=function e(e){return t(e.data)=="object"&&e.data!==null&&"event"in e.data&&e.data.event==="resize"};var o=function e(e){window.addEventListener("message",function(t){t.source===e.contentWindow&&n(t)&&t.data.event==="resize"&&(e.style.height="".concat(t.data.height,"px"))})};var a=function e(e){if(e.dataset.whopCheckoutMounted)return;var t=e.dataset.whopCheckoutPlanId;if(!t)return;var n;var a=(n=e.dataset.whopCheckoutOrigin)!==null&&n!==void 0?n:"https://whop.com/",r=new URL("/embedded/checkout/".concat(t,"/"),a),l=e.dataset.whopCheckoutTheme;l&&r.searchParams.set("theme",l);var i=new URL(window.location.href).origin;r.searchParams.set("h",i);var d=document.createElement("iframe");d.src=r.toString(),d.style.width="100%",d.style.height="480px",d.style.border="none",d.style.overflow="hidden",d.sandbox.add("allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"),d.allow="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;",e.dataset.whopCheckoutMounted="true",e.appendChild(d),o(d)};if((typeof window==="undefined"?"undefined":t(window))<"u"&&window.wco&&!window.wco.listening){new MutationObserver(function(t){var n=true,o=false,r=undefined,l=true,i=false,d=undefined;try{for(var u=t[Symbol.iterator](),c;!(l=(c=u.next()).done);l=true){var s=c.value;try{for(var w=s.addedNodes[Symbol.iterator](),f;!(n=(f=w.next()).done);n=true){var h=f.value;e(h,HTMLElement)&&h.dataset.whopCheckoutPlanId&&a(h)}}catch(e){o=true;r=e}finally{try{if(!n&&w.return!=null){w.return()}}finally{if(o){throw r}}}}}catch(e){i=true;d=e}finally{try{if(!l&&u.return!=null){u.return()}}finally{if(i){throw d}}}}).observe(document.body,{childList:!0,subtree:!0});var r=true,l=false,i=undefined;try{for(var d=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),u;!(r=(u=d.next()).done);r=true){var c=u.value;e(c,HTMLElement)&&a(c)}}catch(e){l=true;i=e}finally{try{if(!r&&d.return!=null){d.return()}}finally{if(l){throw i}}}window.wco.listening=!0}})();
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ function e(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function t(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function n(e){return t(e.data)=="object"&&e.data!==null&&"event"in e.data&&e.data.event==="resize"}function o(e){window.addEventListener("message",function(t){t.source===e.contentWindow&&n(t)&&t.data.event==="resize"&&(e.style.height="".concat(t.data.height,"px"))})}function a(e){if(e.dataset.whopCheckoutMounted)return;var t=e.dataset.whopCheckoutPlanId;if(!t)return;var n;var a=(n=e.dataset.whopCheckoutOrigin)!==null&&n!==void 0?n:"https://whop.com/",r=new URL("/embedded/checkout/".concat(t,"/"),a),l=e.dataset.whopCheckoutTheme;l&&r.searchParams.set("theme",l);var i=new URL(window.location.href).origin;r.searchParams.set("h",i);var d=document.createElement("iframe");d.src=r.toString(),d.style.width="100%",d.style.height="480px",d.style.border="none",d.style.overflow="hidden",d.sandbox.add("allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"),d.allow="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;",e.dataset.whopCheckoutMounted="true",e.appendChild(d),o(d)}if((typeof window==="undefined"?"undefined":t(window))<"u"&&window.wco&&!window.wco.listening){new MutationObserver(function(t){var n=true,o=false,r=undefined,l=true,i=false,d=undefined;try{for(var u=t[Symbol.iterator](),c;!(l=(c=u.next()).done);l=true){var s=c.value;try{for(var w=s.addedNodes[Symbol.iterator](),f;!(n=(f=w.next()).done);n=true){var h=f.value;e(h,HTMLElement)&&h.dataset.whopCheckoutPlanId&&a(h)}}catch(e){o=true;r=e}finally{try{if(!n&&w.return!=null){w.return()}}finally{if(o){throw r}}}}}catch(e){i=true;d=e}finally{try{if(!l&&u.return!=null){u.return()}}finally{if(i){throw d}}}}).observe(document.body,{childList:!0,subtree:!0});var r=true,l=false,i=undefined;try{for(var d=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),u;!(r=(u=d.next()).done);r=true){var c=u.value;e(c,HTMLElement)&&a(c)}}catch(e){l=true;i=e}finally{try{if(!r&&d.return!=null){d.return()}}finally{if(l){throw i}}}window.wco.listening=!0}
@@ -0,0 +1 @@
1
+ "use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var n=document.currentScript,o=n===null||n===void 0?void 0:n.src;var d;(typeof window==="undefined"?"undefined":e(window))<"u"&&o&&((d=window.wco)!==null&&d!==void 0?d:window.wco=function(){var e=document.createElement("script");return e.src=o.replace(/loader\.js$/,"index.js"),e.async=!0,e.defer=!0,document.head.appendChild(e),{injected:!0,listening:!1}}());
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/loader.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}(function(){var n=document.currentScript,o=n===null||n===void 0?void 0:n.src;var d;(typeof window==="undefined"?"undefined":e(window))<"u"&&o&&((d=window.wco)!==null&&d!==void 0?d:window.wco=function(){var e=document.createElement("script");return e.src=o.replace(/loader\.js$/,"index.js"),e.async=!0,e.defer=!0,document.head.appendChild(e),{injected:!0,listening:!1}}())})();
@@ -0,0 +1 @@
1
+ function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var n=document.currentScript,o=n===null||n===void 0?void 0:n.src;var d;(typeof window==="undefined"?"undefined":e(window))<"u"&&o&&((d=window.wco)!==null&&d!==void 0?d:window.wco=function(){var e=document.createElement("script");return e.src=o.replace(/loader\.js$/,"index.js"),e.async=!0,e.defer=!0,document.head.appendChild(e),{injected:!0,listening:!1}}());
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@whop/checkout",
3
+ "version": "0.0.21-canary.7",
4
+ "main": "./dist/index.cjs",
5
+ "module": "./dist/index.mjs",
6
+ "types": "./dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "devDependencies": {
11
+ "@swc/core": "^1.11.29",
12
+ "@types/node": "latest",
13
+ "concurrently": "9.1.2",
14
+ "dotenv": "16.5.0",
15
+ "serve": "^14.2.4",
16
+ "ts-proto": "2.7.0",
17
+ "tsup": "8.5.0",
18
+ "typescript": "latest"
19
+ },
20
+ "engines": {
21
+ "node": "22.x",
22
+ "pnpm": "9.15.9"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "build": "tsup",
29
+ "dev": "concurrently \"pnpm run dev:tsup\" \"pnpm run dev:serve\"",
30
+ "dev:tsup": "tsup --watch",
31
+ "dev:serve": "serve ./dist",
32
+ "check-types": "tsc --noEmit",
33
+ "lint:fix": "biome check --write --unsafe"
34
+ }
35
+ }