@whop/checkout 0.0.35 → 0.0.36

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 CHANGED
@@ -137,6 +137,16 @@ Defaults to `false`
137
137
  <div data-whop-checkout-hide-submit-button="true" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
138
138
  ```
139
139
 
140
+ ### **`data-whop-checkout-hide-tos`**
141
+
142
+ **Optional** - Set to `true` to hide the terms and conditions in the embedded checkout form.
143
+
144
+ Defaults to `false`
145
+
146
+ ```md
147
+ <div data-whop-checkout-hide-tos="true" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
148
+ ```
149
+
140
150
  ### **`data-whop-checkout-skip-redirect`**
141
151
 
142
152
  **Optional** - Set to `true` to skip the final redirect and keep the top frame loaded.
@@ -0,0 +1 @@
1
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var l=["resize","center","complete","state"];function u(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&l.includes(e.data.event)}function s(e,t){function r(r){r.source===e.contentWindow&&u(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function c(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function f(e,t,r,n,o,i,l,u,s,c,f,d){var y=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(y.searchParams.set("h",window.location.origin),t&&y.searchParams.set("theme",t),r&&y.searchParams.set("session",r),o&&y.searchParams.set("hide_price","true"),i&&y.searchParams.set("skip_redirect","true"),f&&y.searchParams.set("hide_submit_button","true"),d&&y.searchParams.set("hide_tos","true"),l){var m=true,v=false,h=undefined,w=true,p=false,b=undefined;try{for(var g=Object.entries(l).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),S;!(w=(S=g.next()).done);w=true){var P=a(S.value,2),x=P[0],_=P[1];if(x.startsWith("utm_"))if(Array.isArray(_))try{for(var j=_[Symbol.iterator](),A;!(m=(A=j.next()).done);m=true){var k=A.value;y.searchParams.append(x,k)}}catch(e){v=true;h=e}finally{try{if(!m&&j.return!=null){j.return()}}finally{if(v){throw h}}}else y.searchParams.set(x,_)}}catch(e){p=true;b=e}finally{try{if(!w&&g.return!=null){g.return()}}finally{if(p){throw b}}}}if(u){var O=true,L=false,W=undefined,E=true,I=false,R=undefined;try{for(var U=Object.entries(u)[Symbol.iterator](),C;!(E=(C=U.next()).done);E=true){var M=a(C.value,2),q=M[0],z=M[1];if(z)try{for(var T=Object.entries(z)[Symbol.iterator](),$;!(O=($=T.next()).done);O=true){var B=a($.value,2),D=B[0],F=B[1];y.searchParams.set("style.".concat(q,".").concat(D),F.toString())}}catch(e){L=true;W=e}finally{try{if(!O&&T.return!=null){T.return()}}finally{if(L){throw W}}}}}catch(e){I=true;R=e}finally{try{if(!E&&U.return!=null){U.return()}}finally{if(I){throw R}}}}var G=true,H=false,J=undefined;if((s===null||s===void 0?void 0:s.email)&&y.searchParams.set("email",s.email),c)try{for(var K=Object.entries(c)[Symbol.iterator](),N;!(G=(N=K.next()).done);G=true){var Q=a(N.value,2),V=Q[0],X=Q[1];X&&y.searchParams.set("theme.".concat(V),X)}}catch(e){H=true;J=e}finally{try{if(!G&&K.return!=null){K.return()}}finally{if(H){throw J}}}return y.toString()}var d=["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"],y="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";export{u as a,s as b,c as c,f as d,d as e,y as f};
@@ -1 +1 @@
1
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,r){return t(e)||o(e,r)||f(e,r)||i()}function c(e){return t(e)||a(e)||f(e)||i()}function s(e){return r(e)||a(e)||f(e)||l()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var h=["resize","center","complete","state"];function v(e){return d(e.data)=="object"&&e.data!==null&&"event"in e.data&&h.includes(e.data.event)}function w(e,t){function r(r){r.source===e.contentWindow&&v(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function y(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function m(e,t,r,n,a,o,i,l,c,s,d){var f=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(f.searchParams.set("h",window.location.origin),t&&f.searchParams.set("theme",t),r&&f.searchParams.set("session",r),a&&f.searchParams.set("hide_price","true"),o&&f.searchParams.set("skip_redirect","true"),d&&f.searchParams.set("hide_submit_button","true"),i){var h=true,v=false,w=undefined,y=true,m=false,p=undefined;try{for(var b=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),k;!(y=(k=b.next()).done);y=true){var S=u(k.value,2),C=S[0],g=S[1];if(C.startsWith("utm_"))if(Array.isArray(g))try{for(var A=g[Symbol.iterator](),P;!(h=(P=A.next()).done);h=true){var x=P.value;f.searchParams.append(C,x)}}catch(e){v=true;w=e}finally{try{if(!h&&A.return!=null){A.return()}}finally{if(v){throw w}}}else f.searchParams.set(C,g)}}catch(e){m=true;p=e}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw p}}}}if(l){var I=true,O=false,j=undefined,E=true,_=false,L=undefined;try{for(var M=Object.entries(l)[Symbol.iterator](),T;!(E=(T=M.next()).done);E=true){var U=u(T.value,2),R=U[0],W=U[1];if(W)try{for(var H=Object.entries(W)[Symbol.iterator](),q;!(I=(q=H.next()).done);I=true){var z=u(q.value,2),F=z[0],N=z[1];f.searchParams.set("style.".concat(R,".").concat(F),N.toString())}}catch(e){O=true;j=e}finally{try{if(!I&&H.return!=null){H.return()}}finally{if(O){throw j}}}}}catch(e){_=true;L=e}finally{try{if(!E&&M.return!=null){M.return()}}finally{if(_){throw L}}}}var B=true,V=false,$=undefined;if((c===null||c===void 0?void 0:c.email)&&f.searchParams.set("email",c.email),s)try{for(var D=Object.entries(s)[Symbol.iterator](),G;!(B=(G=D.next()).done);B=true){var J=u(G.value,2),K=J[0],Q=J[1];Q&&f.searchParams.set("theme.".concat(K),Q)}}catch(e){V=true;$=e}finally{try{if(!B&&D.return!=null){D.return()}}finally{if(V){throw $}}}return f.toString()}var p=["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"],b="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";function k(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var a=window[e];a===null||a===void 0?void 0:a.apply(void 0,s(r))}function S(e,t){var r;e.addEventListener("checkout:submit",function(t){y(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,w(e,function(r){switch(r.event){case"resize":{e.style.height="".concat(r.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{k(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{k(t.dataset.whopCheckoutOnStateChange,r.state);break}}}))}function C(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})}var g="data-whop-checkout-style-";function A(e){var t={};var r=true,n=false,a=undefined;try{for(var o=e.attributes[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var l=i.value;if(l.name.startsWith(g)){var u=l.name.slice(g.length),s=l.value,d=c(u.split("-")),f=d[0],h=d.slice(1);if(f&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),a=n[0],o=n.slice(1);return"".concat(e).concat(a.toUpperCase()).concat(o.join(""))},"");var w;(w=t[f])!==null&&w!==void 0?w:t[f]={},t[f][v]=s}}}}catch(e){n=true;a=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw a}}}return t}function P(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function x(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t}function I(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var a=m(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:C(),A(e),x(e),P(e),e.dataset.whopCheckoutHideSubmitButton==="true"),o=document.createElement("iframe");o.src=a,o.style.width="100%",o.style.height="480px",o.style.border="none",o.style.overflow="hidden",(t=o.sandbox).add.apply(t,s(p)),o.allow=b,e.dataset.whopCheckoutMounted="true",e.appendChild(o);var i=e.id;i&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(i,o),o.dataset.whopCheckoutIdentifier=i),S(o,e)}if((typeof window==="undefined"?"undefined":d(window))<"u"&&window.wco&&!window.wco.listening){var O=new MutationObserver(function(e){var t=true,r=false,a=undefined;try{for(var o=e[Symbol.iterator](),i;!(t=(i=o.next()).done);t=true){var l=i.value;var c,s,d;var f=true,h=false,v=undefined;try{for(var w=l.addedNodes[Symbol.iterator](),y;!(f=(y=w.next()).done);f=true){var m=y.value;n(m,HTMLElement)&&m.dataset.whopCheckoutPlanId&&I(m)}}catch(e){h=true;v=e}finally{try{if(!f&&w.return!=null){w.return()}}finally{if(h){throw v}}}var p=Array.from(l.removedNodes);var b;var k=true,S=false,C=undefined;try{for(var g=((b=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&b!==void 0?b:[])[Symbol.iterator](),A;!(k=(A=g.next()).done);k=true){var P=u(A.value,2),x=P[0],O=P[1];p.includes(x)&&(x.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(x.dataset.whopCheckoutIdentifier)),O(),(d=window.wco)===null||d===void 0?void 0:d.frames.delete(x))}}catch(e){S=true;C=e}finally{try{if(!k&&g.return!=null){g.return()}}finally{if(S){throw C}}}}}catch(e){r=true;a=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw a}}}});var j=true,E=false,_=undefined;try{for(var L=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),M;!(j=(M=L.next()).done);j=true){var T=M.value;n(T,HTMLElement)&&I(T)}}catch(e){E=true;_=e}finally{try{if(!j&&L.return!=null){L.return()}}finally{if(E){throw _}}}O.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}
1
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,r){return t(e)||o(e,r)||f(e,r)||i()}function c(e){return t(e)||a(e)||f(e)||i()}function s(e){return r(e)||a(e)||f(e)||l()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var h=["resize","center","complete","state"];function v(e){return d(e.data)=="object"&&e.data!==null&&"event"in e.data&&h.includes(e.data.event)}function w(e,t){function r(r){r.source===e.contentWindow&&v(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function y(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function m(e,t,r,n,a,o,i,l,c,s,d,f){var h=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(h.searchParams.set("h",window.location.origin),t&&h.searchParams.set("theme",t),r&&h.searchParams.set("session",r),a&&h.searchParams.set("hide_price","true"),o&&h.searchParams.set("skip_redirect","true"),d&&h.searchParams.set("hide_submit_button","true"),f&&h.searchParams.set("hide_tos","true"),i){var v=true,w=false,y=undefined,m=true,p=false,b=undefined;try{for(var k=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),C;!(m=(C=k.next()).done);m=true){var S=u(C.value,2),g=S[0],A=S[1];if(g.startsWith("utm_"))if(Array.isArray(A))try{for(var P=A[Symbol.iterator](),x;!(v=(x=P.next()).done);v=true){var I=x.value;h.searchParams.append(g,I)}}catch(e){w=true;y=e}finally{try{if(!v&&P.return!=null){P.return()}}finally{if(w){throw y}}}else h.searchParams.set(g,A)}}catch(e){p=true;b=e}finally{try{if(!m&&k.return!=null){k.return()}}finally{if(p){throw b}}}}if(l){var O=true,_=false,j=undefined,E=true,L=false,T=undefined;try{for(var M=Object.entries(l)[Symbol.iterator](),U;!(E=(U=M.next()).done);E=true){var H=u(U.value,2),R=H[0],W=H[1];if(W)try{for(var q=Object.entries(W)[Symbol.iterator](),z;!(O=(z=q.next()).done);O=true){var F=u(z.value,2),N=F[0],B=F[1];h.searchParams.set("style.".concat(R,".").concat(N),B.toString())}}catch(e){_=true;j=e}finally{try{if(!O&&q.return!=null){q.return()}}finally{if(_){throw j}}}}}catch(e){L=true;T=e}finally{try{if(!E&&M.return!=null){M.return()}}finally{if(L){throw T}}}}var V=true,$=false,D=undefined;if((c===null||c===void 0?void 0:c.email)&&h.searchParams.set("email",c.email),s)try{for(var G=Object.entries(s)[Symbol.iterator](),J;!(V=(J=G.next()).done);V=true){var K=u(J.value,2),Q=K[0],X=K[1];X&&h.searchParams.set("theme.".concat(Q),X)}}catch(e){$=true;D=e}finally{try{if(!V&&G.return!=null){G.return()}}finally{if($){throw D}}}return h.toString()}var p=["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"],b="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";function k(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var a=window[e];a===null||a===void 0?void 0:a.apply(void 0,s(r))}function C(e,t){var r;e.addEventListener("checkout:submit",function(t){y(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,w(e,function(r){switch(r.event){case"resize":{e.style.height="".concat(r.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{k(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{k(t.dataset.whopCheckoutOnStateChange,r.state);break}}}))}function S(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})}var g="data-whop-checkout-style-";function A(e){var t={};var r=true,n=false,a=undefined;try{for(var o=e.attributes[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var l=i.value;if(l.name.startsWith(g)){var u=l.name.slice(g.length),s=l.value,d=c(u.split("-")),f=d[0],h=d.slice(1);if(f&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),a=n[0],o=n.slice(1);return"".concat(e).concat(a.toUpperCase()).concat(o.join(""))},"");var w;(w=t[f])!==null&&w!==void 0?w:t[f]={},t[f][v]=s}}}}catch(e){n=true;a=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw a}}}return t}function P(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function x(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t}function I(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var a=m(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:S(),A(e),x(e),P(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true"),o=document.createElement("iframe");o.src=a,o.style.width="100%",o.style.height="480px",o.style.border="none",o.style.overflow="hidden",(t=o.sandbox).add.apply(t,s(p)),o.allow=b,e.dataset.whopCheckoutMounted="true",e.appendChild(o);var i=e.id;i&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(i,o),o.dataset.whopCheckoutIdentifier=i),C(o,e)}if((typeof window==="undefined"?"undefined":d(window))<"u"&&window.wco&&!window.wco.listening){var O=new MutationObserver(function(e){var t=true,r=false,a=undefined;try{for(var o=e[Symbol.iterator](),i;!(t=(i=o.next()).done);t=true){var l=i.value;var c,s,d;var f=true,h=false,v=undefined;try{for(var w=l.addedNodes[Symbol.iterator](),y;!(f=(y=w.next()).done);f=true){var m=y.value;n(m,HTMLElement)&&m.dataset.whopCheckoutPlanId&&I(m)}}catch(e){h=true;v=e}finally{try{if(!f&&w.return!=null){w.return()}}finally{if(h){throw v}}}var p=Array.from(l.removedNodes);var b;var k=true,C=false,S=undefined;try{for(var g=((b=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&b!==void 0?b:[])[Symbol.iterator](),A;!(k=(A=g.next()).done);k=true){var P=u(A.value,2),x=P[0],O=P[1];p.includes(x)&&(x.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(x.dataset.whopCheckoutIdentifier)),O(),(d=window.wco)===null||d===void 0?void 0:d.frames.delete(x))}}catch(e){C=true;S=e}finally{try{if(!k&&g.return!=null){g.return()}}finally{if(C){throw S}}}}}catch(e){r=true;a=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw a}}}});var _=true,j=false,E=undefined;try{for(var L=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),T;!(_=(T=L.next()).done);_=true){var M=T.value;n(M,HTMLElement)&&I(M)}}catch(e){j=true;E=e}finally{try{if(!_&&L.return!=null){L.return()}}finally{if(j){throw E}}}O.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}
@@ -1 +1 @@
1
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,r){return t(e)||o(e,r)||f(e,r)||i()}function c(e){return t(e)||a(e)||f(e)||i()}function s(e){return r(e)||a(e)||f(e)||l()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(function(){var e=function e(e){return d(e.data)=="object"&&e.data!==null&&"event"in e.data&&y.includes(e.data.event)};var t=function t(t,r){function n(n){n.source===t.contentWindow&&e(n)&&r(n.data)}return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}};var r=function e(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)};var a=function e(e,t,r,n,a,o,i,l,c,s,d){var f=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(f.searchParams.set("h",window.location.origin),t&&f.searchParams.set("theme",t),r&&f.searchParams.set("session",r),a&&f.searchParams.set("hide_price","true"),o&&f.searchParams.set("skip_redirect","true"),d&&f.searchParams.set("hide_submit_button","true"),i){var h=true,v=false,w=undefined,y=true,m=false,p=undefined;try{for(var b=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),k;!(y=(k=b.next()).done);y=true){var S=u(k.value,2),C=S[0],g=S[1];if(C.startsWith("utm_"))if(Array.isArray(g))try{for(var A=g[Symbol.iterator](),P;!(h=(P=A.next()).done);h=true){var x=P.value;f.searchParams.append(C,x)}}catch(e){v=true;w=e}finally{try{if(!h&&A.return!=null){A.return()}}finally{if(v){throw w}}}else f.searchParams.set(C,g)}}catch(e){m=true;p=e}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw p}}}}if(l){var I=true,O=false,j=undefined,E=true,_=false,L=undefined;try{for(var M=Object.entries(l)[Symbol.iterator](),T;!(E=(T=M.next()).done);E=true){var U=u(T.value,2),R=U[0],W=U[1];if(W)try{for(var H=Object.entries(W)[Symbol.iterator](),q;!(I=(q=H.next()).done);I=true){var z=u(q.value,2),F=z[0],N=z[1];f.searchParams.set("style.".concat(R,".").concat(F),N.toString())}}catch(e){O=true;j=e}finally{try{if(!I&&H.return!=null){H.return()}}finally{if(O){throw j}}}}}catch(e){_=true;L=e}finally{try{if(!E&&M.return!=null){M.return()}}finally{if(_){throw L}}}}var B=true,V=false,$=undefined;if((c===null||c===void 0?void 0:c.email)&&f.searchParams.set("email",c.email),s)try{for(var D=Object.entries(s)[Symbol.iterator](),G;!(B=(G=D.next()).done);B=true){var J=u(G.value,2),K=J[0],Q=J[1];Q&&f.searchParams.set("theme.".concat(K),Q)}}catch(e){V=true;$=e}finally{try{if(!B&&D.return!=null){D.return()}}finally{if(V){throw $}}}return f.toString()};var o=function e(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var a=window[e];a===null||a===void 0?void 0:a.apply(void 0,s(r))};var i=function e(e,n){var a;e.addEventListener("checkout:submit",function(t){r(e,t.detail)}),(a=window.wco)===null||a===void 0?void 0:a.frames.set(e,t(e,function(t){switch(t.event){case"resize":{e.style.height="".concat(t.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{o(n.dataset.whopCheckoutOnComplete,t.plan_id,t.receipt_id);break}case"state":{o(n.dataset.whopCheckoutOnStateChange,t.state);break}}}))};var l=function e(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})};var f=function e(e){var t={};var r=true,n=false,a=undefined;try{for(var o=e.attributes[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var l=i.value;if(l.name.startsWith(b)){var u=l.name.slice(b.length),s=l.value,d=c(u.split("-")),f=d[0],h=d.slice(1);if(f&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),a=n[0],o=n.slice(1);return"".concat(e).concat(a.toUpperCase()).concat(o.join(""))},"");var w;(w=t[f])!==null&&w!==void 0?w:t[f]={},t[f][v]=s}}}}catch(e){n=true;a=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw a}}}return t};var h=function e(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t};var v=function e(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t};var w=function e(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var o=a(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:l(),f(e),v(e),h(e),e.dataset.whopCheckoutHideSubmitButton==="true"),u=document.createElement("iframe");u.src=o,u.style.width="100%",u.style.height="480px",u.style.border="none",u.style.overflow="hidden",(t=u.sandbox).add.apply(t,s(m)),u.allow=p,e.dataset.whopCheckoutMounted="true",e.appendChild(u);var c=e.id;c&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(c,u),u.dataset.whopCheckoutIdentifier=c),i(u,e)};var y=["resize","center","complete","state"];var m=["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"],p="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var b="data-whop-checkout-style-";if((typeof window==="undefined"?"undefined":d(window))<"u"&&window.wco&&!window.wco.listening){var k=new MutationObserver(function(e){var t=true,r=false,a=undefined;try{for(var o=e[Symbol.iterator](),i;!(t=(i=o.next()).done);t=true){var l=i.value;var c,s,d;var f=true,h=false,v=undefined;try{for(var y=l.addedNodes[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var p=m.value;n(p,HTMLElement)&&p.dataset.whopCheckoutPlanId&&w(p)}}catch(e){h=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(h){throw v}}}var b=Array.from(l.removedNodes);var k;var S=true,C=false,g=undefined;try{for(var A=((k=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&k!==void 0?k:[])[Symbol.iterator](),P;!(S=(P=A.next()).done);S=true){var x=u(P.value,2),I=x[0],O=x[1];b.includes(I)&&(I.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(I.dataset.whopCheckoutIdentifier)),O(),(d=window.wco)===null||d===void 0?void 0:d.frames.delete(I))}}catch(e){C=true;g=e}finally{try{if(!S&&A.return!=null){A.return()}}finally{if(C){throw g}}}}}catch(e){r=true;a=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw a}}}});var S=true,C=false,g=undefined;try{for(var A=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),P;!(S=(P=A.next()).done);S=true){var x=P.value;n(x,HTMLElement)&&w(x)}}catch(e){C=true;g=e}finally{try{if(!S&&A.return!=null){A.return()}}finally{if(C){throw g}}}k.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}})();
1
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,r){return t(e)||o(e,r)||f(e,r)||i()}function c(e){return t(e)||a(e)||f(e)||i()}function s(e){return r(e)||a(e)||f(e)||l()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(function(){var e=function e(e){return d(e.data)=="object"&&e.data!==null&&"event"in e.data&&y.includes(e.data.event)};var t=function t(t,r){function n(n){n.source===t.contentWindow&&e(n)&&r(n.data)}return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}};var r=function e(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)};var a=function e(e,t,r,n,a,o,i,l,c,s,d,f){var h=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(h.searchParams.set("h",window.location.origin),t&&h.searchParams.set("theme",t),r&&h.searchParams.set("session",r),a&&h.searchParams.set("hide_price","true"),o&&h.searchParams.set("skip_redirect","true"),d&&h.searchParams.set("hide_submit_button","true"),f&&h.searchParams.set("hide_tos","true"),i){var v=true,w=false,y=undefined,m=true,p=false,b=undefined;try{for(var k=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),C;!(m=(C=k.next()).done);m=true){var S=u(C.value,2),g=S[0],A=S[1];if(g.startsWith("utm_"))if(Array.isArray(A))try{for(var P=A[Symbol.iterator](),x;!(v=(x=P.next()).done);v=true){var I=x.value;h.searchParams.append(g,I)}}catch(e){w=true;y=e}finally{try{if(!v&&P.return!=null){P.return()}}finally{if(w){throw y}}}else h.searchParams.set(g,A)}}catch(e){p=true;b=e}finally{try{if(!m&&k.return!=null){k.return()}}finally{if(p){throw b}}}}if(l){var O=true,_=false,j=undefined,E=true,L=false,T=undefined;try{for(var M=Object.entries(l)[Symbol.iterator](),U;!(E=(U=M.next()).done);E=true){var H=u(U.value,2),R=H[0],W=H[1];if(W)try{for(var q=Object.entries(W)[Symbol.iterator](),z;!(O=(z=q.next()).done);O=true){var F=u(z.value,2),N=F[0],B=F[1];h.searchParams.set("style.".concat(R,".").concat(N),B.toString())}}catch(e){_=true;j=e}finally{try{if(!O&&q.return!=null){q.return()}}finally{if(_){throw j}}}}}catch(e){L=true;T=e}finally{try{if(!E&&M.return!=null){M.return()}}finally{if(L){throw T}}}}var V=true,$=false,D=undefined;if((c===null||c===void 0?void 0:c.email)&&h.searchParams.set("email",c.email),s)try{for(var G=Object.entries(s)[Symbol.iterator](),J;!(V=(J=G.next()).done);V=true){var K=u(J.value,2),Q=K[0],X=K[1];X&&h.searchParams.set("theme.".concat(Q),X)}}catch(e){$=true;D=e}finally{try{if(!V&&G.return!=null){G.return()}}finally{if($){throw D}}}return h.toString()};var o=function e(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var a=window[e];a===null||a===void 0?void 0:a.apply(void 0,s(r))};var i=function e(e,n){var a;e.addEventListener("checkout:submit",function(t){r(e,t.detail)}),(a=window.wco)===null||a===void 0?void 0:a.frames.set(e,t(e,function(t){switch(t.event){case"resize":{e.style.height="".concat(t.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{o(n.dataset.whopCheckoutOnComplete,t.plan_id,t.receipt_id);break}case"state":{o(n.dataset.whopCheckoutOnStateChange,t.state);break}}}))};var l=function e(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})};var f=function e(e){var t={};var r=true,n=false,a=undefined;try{for(var o=e.attributes[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var l=i.value;if(l.name.startsWith(b)){var u=l.name.slice(b.length),s=l.value,d=c(u.split("-")),f=d[0],h=d.slice(1);if(f&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),a=n[0],o=n.slice(1);return"".concat(e).concat(a.toUpperCase()).concat(o.join(""))},"");var w;(w=t[f])!==null&&w!==void 0?w:t[f]={},t[f][v]=s}}}}catch(e){n=true;a=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw a}}}return t};var h=function e(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t};var v=function e(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t};var w=function e(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var o=a(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:l(),f(e),v(e),h(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true"),u=document.createElement("iframe");u.src=o,u.style.width="100%",u.style.height="480px",u.style.border="none",u.style.overflow="hidden",(t=u.sandbox).add.apply(t,s(m)),u.allow=p,e.dataset.whopCheckoutMounted="true",e.appendChild(u);var c=e.id;c&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(c,u),u.dataset.whopCheckoutIdentifier=c),i(u,e)};var y=["resize","center","complete","state"];var m=["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"],p="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var b="data-whop-checkout-style-";if((typeof window==="undefined"?"undefined":d(window))<"u"&&window.wco&&!window.wco.listening){var k=new MutationObserver(function(e){var t=true,r=false,a=undefined;try{for(var o=e[Symbol.iterator](),i;!(t=(i=o.next()).done);t=true){var l=i.value;var c,s,d;var f=true,h=false,v=undefined;try{for(var y=l.addedNodes[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var p=m.value;n(p,HTMLElement)&&p.dataset.whopCheckoutPlanId&&w(p)}}catch(e){h=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(h){throw v}}}var b=Array.from(l.removedNodes);var k;var C=true,S=false,g=undefined;try{for(var A=((k=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&k!==void 0?k:[])[Symbol.iterator](),P;!(C=(P=A.next()).done);C=true){var x=u(P.value,2),I=x[0],O=x[1];b.includes(I)&&(I.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(I.dataset.whopCheckoutIdentifier)),O(),(d=window.wco)===null||d===void 0?void 0:d.frames.delete(I))}}catch(e){S=true;g=e}finally{try{if(!C&&A.return!=null){A.return()}}finally{if(S){throw g}}}}}catch(e){r=true;a=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw a}}}});var C=true,S=false,g=undefined;try{for(var A=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),P;!(C=(P=A.next()).done);C=true){var x=P.value;n(x,HTMLElement)&&w(x)}}catch(e){S=true;g=e}finally{try{if(!C&&A.return!=null){A.return()}}finally{if(S){throw g}}}k.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}})();
@@ -1 +1 @@
1
- function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var i,u;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){a=true;u=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,r){return t(e)||a(e,r)||s(e,r)||i()}function c(e){return t(e)||o(e)||s(e)||i()}function d(e){return r(e)||o(e)||s(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function s(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}import{b as h,c as v,d as w,e as y,f as m}from"./chunk-IG6RUVWW.mjs";function p(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var o=window[e];o===null||o===void 0?void 0:o.apply(void 0,d(r))}function b(e,t){var r;e.addEventListener("checkout:submit",function(t){v(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,h(e,function(r){switch(r.event){case"resize":{e.style.height="".concat(r.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{p(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{p(t.dataset.whopCheckoutOnStateChange,r.state);break}}}))}function k(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})}var C="data-whop-checkout-style-";function S(e){var t={};var r=true,n=false,o=undefined;try{for(var a=e.attributes[Symbol.iterator](),i;!(r=(i=a.next()).done);r=true){var u=i.value;if(u.name.startsWith(C)){var l=u.name.slice(C.length),d=u.value,f=c(l.split("-")),s=f[0],h=f.slice(1);if(s&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),o=n[0],a=n.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(a.join(""))},"");var w;(w=t[s])!==null&&w!==void 0?w:t[s]={},t[s][v]=d}}}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return t}function g(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function A(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t}function I(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var o=w(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:k(),S(e),A(e),g(e),e.dataset.whopCheckoutHideSubmitButton==="true"),a=document.createElement("iframe");a.src=o,a.style.width="100%",a.style.height="480px",a.style.border="none",a.style.overflow="hidden",(t=a.sandbox).add.apply(t,d(y)),a.allow=m,e.dataset.whopCheckoutMounted="true",e.appendChild(a);var i=e.id;i&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(i,a),a.dataset.whopCheckoutIdentifier=i),b(a,e)}if((typeof window==="undefined"?"undefined":f(window))<"u"&&window.wco&&!window.wco.listening){var x=new MutationObserver(function(e){var t=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),i;!(t=(i=a.next()).done);t=true){var u=i.value;var c,d,f;var s=true,h=false,v=undefined;try{for(var w=u.addedNodes[Symbol.iterator](),y;!(s=(y=w.next()).done);s=true){var m=y.value;n(m,HTMLElement)&&m.dataset.whopCheckoutPlanId&&I(m)}}catch(e){h=true;v=e}finally{try{if(!s&&w.return!=null){w.return()}}finally{if(h){throw v}}}var p=Array.from(u.removedNodes);var b;var k=true,C=false,S=undefined;try{for(var g=((b=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&b!==void 0?b:[])[Symbol.iterator](),A;!(k=(A=g.next()).done);k=true){var x=l(A.value,2),E=x[0],O=x[1];p.includes(E)&&(E.dataset.whopCheckoutIdentifier&&((d=window.wco)===null||d===void 0?void 0:d.identifiedFrames.delete(E.dataset.whopCheckoutIdentifier)),O(),(f=window.wco)===null||f===void 0?void 0:f.frames.delete(E))}}catch(e){C=true;S=e}finally{try{if(!k&&g.return!=null){g.return()}}finally{if(C){throw S}}}}}catch(e){r=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(r){throw o}}}});var E=true,O=false,T=undefined;try{for(var j=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),M;!(E=(M=j.next()).done);E=true){var P=M.value;n(P,HTMLElement)&&I(P)}}catch(e){O=true;T=e}finally{try{if(!E&&j.return!=null){j.return()}}finally{if(O){throw T}}}x.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}
1
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var i,u;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){a=true;u=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,r){return t(e)||a(e,r)||s(e,r)||i()}function c(e){return t(e)||o(e)||s(e)||i()}function d(e){return r(e)||o(e)||s(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function s(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}import{b as h,c as v,d as w,e as y,f as p}from"./chunk-EAN646K5.mjs";function m(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var o=window[e];o===null||o===void 0?void 0:o.apply(void 0,d(r))}function b(e,t){var r;e.addEventListener("checkout:submit",function(t){v(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,h(e,function(r){switch(r.event){case"resize":{e.style.height="".concat(r.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{m(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{m(t.dataset.whopCheckoutOnStateChange,r.state);break}}}))}function k(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})}var C="data-whop-checkout-style-";function S(e){var t={};var r=true,n=false,o=undefined;try{for(var a=e.attributes[Symbol.iterator](),i;!(r=(i=a.next()).done);r=true){var u=i.value;if(u.name.startsWith(C)){var l=u.name.slice(C.length),d=u.value,f=c(l.split("-")),s=f[0],h=f.slice(1);if(s&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),o=n[0],a=n.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(a.join(""))},"");var w;(w=t[s])!==null&&w!==void 0?w:t[s]={},t[s][v]=d}}}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return t}function g(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function A(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t}function I(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var o=w(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:k(),S(e),A(e),g(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true"),a=document.createElement("iframe");a.src=o,a.style.width="100%",a.style.height="480px",a.style.border="none",a.style.overflow="hidden",(t=a.sandbox).add.apply(t,d(y)),a.allow=p,e.dataset.whopCheckoutMounted="true",e.appendChild(a);var i=e.id;i&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(i,a),a.dataset.whopCheckoutIdentifier=i),b(a,e)}if((typeof window==="undefined"?"undefined":f(window))<"u"&&window.wco&&!window.wco.listening){var x=new MutationObserver(function(e){var t=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),i;!(t=(i=a.next()).done);t=true){var u=i.value;var c,d,f;var s=true,h=false,v=undefined;try{for(var w=u.addedNodes[Symbol.iterator](),y;!(s=(y=w.next()).done);s=true){var p=y.value;n(p,HTMLElement)&&p.dataset.whopCheckoutPlanId&&I(p)}}catch(e){h=true;v=e}finally{try{if(!s&&w.return!=null){w.return()}}finally{if(h){throw v}}}var m=Array.from(u.removedNodes);var b;var k=true,C=false,S=undefined;try{for(var g=((b=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&b!==void 0?b:[])[Symbol.iterator](),A;!(k=(A=g.next()).done);k=true){var x=l(A.value,2),E=x[0],T=x[1];m.includes(E)&&(E.dataset.whopCheckoutIdentifier&&((d=window.wco)===null||d===void 0?void 0:d.identifiedFrames.delete(E.dataset.whopCheckoutIdentifier)),T(),(f=window.wco)===null||f===void 0?void 0:f.frames.delete(E))}}catch(e){C=true;S=e}finally{try{if(!k&&g.return!=null){g.return()}}finally{if(C){throw S}}}}}catch(e){r=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(r){throw o}}}});var E=true,T=false,O=undefined;try{for(var j=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),M;!(E=(M=j.next()).done);E=true){var P=M.value;n(P,HTMLElement)&&I(P)}}catch(e){T=true;O=e}finally{try{if(!E&&j.return!=null){j.return()}}finally{if(T){throw O}}}x.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}
@@ -1 +1 @@
1
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,u;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;u=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw u}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=function(e,t){for(var r in t)u(e,r,{get:t[r],enumerable:!0})},d=function(e,t,r,n){var a=true,i=false,f=undefined;if(t&&(typeof t==="undefined"?"undefined":o(t))=="object"||typeof t=="function")try{var d=function(){var a=y.value;!s.call(e,a)&&a!==r&&u(e,a,{get:function(){return t[a]},enumerable:!(n=l(t,a))||n.enumerable})};for(var m=c(t)[Symbol.iterator](),y;!(a=(y=m.next()).done);a=true)d()}catch(e){i=true;f=e}finally{try{if(!a&&m.return!=null){m.return()}}finally{if(i){throw f}}}return e};var m=function(e){return d(u({},"__esModule",{value:!0}),e)};var y={};f(y,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return _},EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:function(){return E},getEmbeddedCheckoutIframeUrl:function(){return w},isWhopCheckoutMessage:function(){return v},onWhopCheckoutMessage:function(){return p},submitCheckoutFrame:function(){return b}});module.exports=m(y);var h=["resize","center","complete","state"];function v(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&h.includes(e.data.event)}function p(e,t){function r(r){r.source===e.contentWindow&&v(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function b(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function w(e,t,r,n,o,i,u,l,c,s,f){var d=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(d.searchParams.set("h",window.location.origin),t&&d.searchParams.set("theme",t),r&&d.searchParams.set("session",r),o&&d.searchParams.set("hide_price","true"),i&&d.searchParams.set("skip_redirect","true"),f&&d.searchParams.set("hide_submit_button","true"),u){var m=true,y=false,h=undefined,v=true,p=false,b=undefined;try{for(var w=Object.entries(u).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),E;!(v=(E=w.next()).done);v=true){var _=a(E.value,2),g=_[0],C=_[1];if(g.startsWith("utm_"))if(Array.isArray(C))try{for(var O=C[Symbol.iterator](),S;!(m=(S=O.next()).done);m=true){var D=S.value;d.searchParams.append(g,D)}}catch(e){y=true;h=e}finally{try{if(!m&&O.return!=null){O.return()}}finally{if(y){throw h}}}else d.searchParams.set(g,C)}}catch(e){p=true;b=e}finally{try{if(!v&&w.return!=null){w.return()}}finally{if(p){throw b}}}}if(l){var M=true,A=false,k=undefined,I=true,P=false,j=undefined;try{for(var L=Object.entries(l)[Symbol.iterator](),T;!(I=(T=L.next()).done);I=true){var R=a(T.value,2),U=R[0],W=R[1];if(W)try{for(var x=Object.entries(W)[Symbol.iterator](),B;!(M=(B=x.next()).done);M=true){var F=a(B.value,2),N=F[0],H=F[1];d.searchParams.set("style.".concat(U,".").concat(N),H.toString())}}catch(e){A=true;k=e}finally{try{if(!M&&x.return!=null){x.return()}}finally{if(A){throw k}}}}}catch(e){P=true;j=e}finally{try{if(!I&&L.return!=null){L.return()}}finally{if(P){throw j}}}}var K=true,G=false,X=undefined;if((c===null||c===void 0?void 0:c.email)&&d.searchParams.set("email",c.email),s)try{for(var q=Object.entries(s)[Symbol.iterator](),z;!(K=(z=q.next()).done);K=true){var $=a(z.value,2),J=$[0],Q=$[1];Q&&d.searchParams.set("theme.".concat(J),Q)}}catch(e){G=true;X=e}finally{try{if(!K&&q.return!=null){q.return()}}finally{if(G){throw X}}}return d.toString()}var E=["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"],_="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";0&&(module.exports={EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,getEmbeddedCheckoutIframeUrl:getEmbeddedCheckoutIframeUrl,isWhopCheckoutMessage:isWhopCheckoutMessage,onWhopCheckoutMessage:onWhopCheckoutMessage,submitCheckoutFrame:submitCheckoutFrame});
1
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,u;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;u=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw u}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=function(e,t){for(var r in t)u(e,r,{get:t[r],enumerable:!0})},d=function(e,t,r,n){var a=true,i=false,f=undefined;if(t&&(typeof t==="undefined"?"undefined":o(t))=="object"||typeof t=="function")try{var d=function(){var a=h.value;!c.call(e,a)&&a!==r&&u(e,a,{get:function(){return t[a]},enumerable:!(n=l(t,a))||n.enumerable})};for(var m=s(t)[Symbol.iterator](),h;!(a=(h=m.next()).done);a=true)d()}catch(e){i=true;f=e}finally{try{if(!a&&m.return!=null){m.return()}}finally{if(i){throw f}}}return e};var m=function(e){return d(u({},"__esModule",{value:!0}),e)};var h={};f(h,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return _},EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:function(){return E},getEmbeddedCheckoutIframeUrl:function(){return w},isWhopCheckoutMessage:function(){return v},onWhopCheckoutMessage:function(){return p},submitCheckoutFrame:function(){return b}});module.exports=m(h);var y=["resize","center","complete","state"];function v(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&y.includes(e.data.event)}function p(e,t){function r(r){r.source===e.contentWindow&&v(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function b(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function w(e,t,r,n,o,i,u,l,s,c,f,d){var m=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(m.searchParams.set("h",window.location.origin),t&&m.searchParams.set("theme",t),r&&m.searchParams.set("session",r),o&&m.searchParams.set("hide_price","true"),i&&m.searchParams.set("skip_redirect","true"),f&&m.searchParams.set("hide_submit_button","true"),d&&m.searchParams.set("hide_tos","true"),u){var h=true,y=false,v=undefined,p=true,b=false,w=undefined;try{for(var E=Object.entries(u).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),_;!(p=(_=E.next()).done);p=true){var g=a(_.value,2),C=g[0],O=g[1];if(C.startsWith("utm_"))if(Array.isArray(O))try{for(var S=O[Symbol.iterator](),D;!(h=(D=S.next()).done);h=true){var M=D.value;m.searchParams.append(C,M)}}catch(e){y=true;v=e}finally{try{if(!h&&S.return!=null){S.return()}}finally{if(y){throw v}}}else m.searchParams.set(C,O)}}catch(e){b=true;w=e}finally{try{if(!p&&E.return!=null){E.return()}}finally{if(b){throw w}}}}if(l){var A=true,k=false,I=undefined,P=true,j=false,L=undefined;try{for(var T=Object.entries(l)[Symbol.iterator](),R;!(P=(R=T.next()).done);P=true){var U=a(R.value,2),W=U[0],x=U[1];if(x)try{for(var B=Object.entries(x)[Symbol.iterator](),F;!(A=(F=B.next()).done);A=true){var N=a(F.value,2),H=N[0],K=N[1];m.searchParams.set("style.".concat(W,".").concat(H),K.toString())}}catch(e){k=true;I=e}finally{try{if(!A&&B.return!=null){B.return()}}finally{if(k){throw I}}}}}catch(e){j=true;L=e}finally{try{if(!P&&T.return!=null){T.return()}}finally{if(j){throw L}}}}var G=true,X=false,q=undefined;if((s===null||s===void 0?void 0:s.email)&&m.searchParams.set("email",s.email),c)try{for(var z=Object.entries(c)[Symbol.iterator](),$;!(G=($=z.next()).done);G=true){var J=a($.value,2),Q=J[0],V=J[1];V&&m.searchParams.set("theme.".concat(Q),V)}}catch(e){X=true;q=e}finally{try{if(!G&&z.return!=null){z.return()}}finally{if(X){throw q}}}return m.toString()}var E=["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"],_="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";0&&(module.exports={EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,getEmbeddedCheckoutIframeUrl:getEmbeddedCheckoutIframeUrl,isWhopCheckoutMessage:isWhopCheckoutMessage,onWhopCheckoutMessage:onWhopCheckoutMessage,submitCheckoutFrame:submitCheckoutFrame});
@@ -52,7 +52,7 @@ interface WhopEmbeddedCheckoutPrefillOptions {
52
52
  interface WhopEmbeddedCheckoutThemeOptions {
53
53
  accentColor?: string;
54
54
  }
55
- declare function getEmbeddedCheckoutIframeUrl(planId: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean): string;
55
+ declare function getEmbeddedCheckoutIframeUrl(planId: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean, hideTermsAndConditions?: boolean): string;
56
56
  declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
57
57
  declare const EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING = "document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";
58
58
 
@@ -52,7 +52,7 @@ interface WhopEmbeddedCheckoutPrefillOptions {
52
52
  interface WhopEmbeddedCheckoutThemeOptions {
53
53
  accentColor?: string;
54
54
  }
55
- declare function getEmbeddedCheckoutIframeUrl(planId: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean): string;
55
+ declare function getEmbeddedCheckoutIframeUrl(planId: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean, hideTermsAndConditions?: boolean): string;
56
56
  declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
57
57
  declare const EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING = "document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";
58
58
 
@@ -1 +1 @@
1
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(function(){var e=function e(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&i.includes(e.data.event)};var t=function t(t,r){function n(n){n.source===t.contentWindow&&e(n)&&r(n.data)}return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}};var r=function e(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)};var n=function e(e,t,r,n,o,i,l,u,s,c,f){var d=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(d.searchParams.set("h",window.location.origin),t&&d.searchParams.set("theme",t),r&&d.searchParams.set("session",r),o&&d.searchParams.set("hide_price","true"),i&&d.searchParams.set("skip_redirect","true"),f&&d.searchParams.set("hide_submit_button","true"),l){var y=true,m=false,v=undefined,h=true,w=false,p=undefined;try{for(var b=Object.entries(l).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),g;!(h=(g=b.next()).done);h=true){var S=a(g.value,2),P=S[0],j=S[1];if(P.startsWith("utm_"))if(Array.isArray(j))try{for(var x=j[Symbol.iterator](),A;!(y=(A=x.next()).done);y=true){var _=A.value;d.searchParams.append(P,_)}}catch(e){m=true;v=e}finally{try{if(!y&&x.return!=null){x.return()}}finally{if(m){throw v}}}else d.searchParams.set(P,j)}}catch(e){w=true;p=e}finally{try{if(!h&&b.return!=null){b.return()}}finally{if(w){throw p}}}}if(u){var k=true,O=false,L=undefined,E=true,I=false,R=undefined;try{for(var U=Object.entries(u)[Symbol.iterator](),W;!(E=(W=U.next()).done);E=true){var C=a(W.value,2),M=C[0],q=C[1];if(q)try{for(var z=Object.entries(q)[Symbol.iterator](),T;!(k=(T=z.next()).done);k=true){var $=a(T.value,2),B=$[0],D=$[1];d.searchParams.set("style.".concat(M,".").concat(B),D.toString())}}catch(e){O=true;L=e}finally{try{if(!k&&z.return!=null){z.return()}}finally{if(O){throw L}}}}}catch(e){I=true;R=e}finally{try{if(!E&&U.return!=null){U.return()}}finally{if(I){throw R}}}}var F=true,G=false,H=undefined;if((s===null||s===void 0?void 0:s.email)&&d.searchParams.set("email",s.email),c)try{for(var J=Object.entries(c)[Symbol.iterator](),K;!(F=(K=J.next()).done);F=true){var N=a(K.value,2),Q=N[0],V=N[1];V&&d.searchParams.set("theme.".concat(Q),V)}}catch(e){G=true;H=e}finally{try{if(!F&&J.return!=null){J.return()}}finally{if(G){throw H}}}return d.toString()};var i=["resize","center","complete","state"];var l=["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"],u="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;"})();
1
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(function(){var e=function e(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&i.includes(e.data.event)};var t=function t(t,r){function n(n){n.source===t.contentWindow&&e(n)&&r(n.data)}return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}};var r=function e(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)};var n=function e(e,t,r,n,o,i,l,u,s,c,f,d){var y=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(y.searchParams.set("h",window.location.origin),t&&y.searchParams.set("theme",t),r&&y.searchParams.set("session",r),o&&y.searchParams.set("hide_price","true"),i&&y.searchParams.set("skip_redirect","true"),f&&y.searchParams.set("hide_submit_button","true"),d&&y.searchParams.set("hide_tos","true"),l){var m=true,v=false,h=undefined,w=true,p=false,b=undefined;try{for(var g=Object.entries(l).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),S;!(w=(S=g.next()).done);w=true){var P=a(S.value,2),j=P[0],x=P[1];if(j.startsWith("utm_"))if(Array.isArray(x))try{for(var A=x[Symbol.iterator](),_;!(m=(_=A.next()).done);m=true){var k=_.value;y.searchParams.append(j,k)}}catch(e){v=true;h=e}finally{try{if(!m&&A.return!=null){A.return()}}finally{if(v){throw h}}}else y.searchParams.set(j,x)}}catch(e){p=true;b=e}finally{try{if(!w&&g.return!=null){g.return()}}finally{if(p){throw b}}}}if(u){var O=true,L=false,E=undefined,I=true,R=false,U=undefined;try{for(var W=Object.entries(u)[Symbol.iterator](),C;!(I=(C=W.next()).done);I=true){var M=a(C.value,2),q=M[0],z=M[1];if(z)try{for(var T=Object.entries(z)[Symbol.iterator](),$;!(O=($=T.next()).done);O=true){var B=a($.value,2),D=B[0],F=B[1];y.searchParams.set("style.".concat(q,".").concat(D),F.toString())}}catch(e){L=true;E=e}finally{try{if(!O&&T.return!=null){T.return()}}finally{if(L){throw E}}}}}catch(e){R=true;U=e}finally{try{if(!I&&W.return!=null){W.return()}}finally{if(R){throw U}}}}var G=true,H=false,J=undefined;if((s===null||s===void 0?void 0:s.email)&&y.searchParams.set("email",s.email),c)try{for(var K=Object.entries(c)[Symbol.iterator](),N;!(G=(N=K.next()).done);G=true){var Q=a(N.value,2),V=Q[0],X=Q[1];X&&y.searchParams.set("theme.".concat(V),X)}}catch(e){H=true;J=e}finally{try{if(!G&&K.return!=null){K.return()}}finally{if(H){throw J}}}return y.toString()};var i=["resize","center","complete","state"];var l=["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"],u="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;"})();
@@ -1 +1 @@
1
- import{a as e,b as s,c as a,d as E,e as o,f as t}from"./chunk-IG6RUVWW.mjs";export{t as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,o as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,E as getEmbeddedCheckoutIframeUrl,e as isWhopCheckoutMessage,s as onWhopCheckoutMessage,a as submitCheckoutFrame};
1
+ import{a as e,b as s,c as E,d as a,e as o,f as t}from"./chunk-EAN646K5.mjs";export{t as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,o as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,a as getEmbeddedCheckoutIframeUrl,e as isWhopCheckoutMessage,s as onWhopCheckoutMessage,E as submitCheckoutFrame};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whop/checkout",
3
3
  "description": "Embed Whop checkout on any website",
4
- "version": "0.0.35",
4
+ "version": "0.0.36",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/whopio/whop-sdk-ts",
@@ -1 +0,0 @@
1
- function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var l=["resize","center","complete","state"];function u(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&l.includes(e.data.event)}function s(e,t){function r(r){r.source===e.contentWindow&&u(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function c(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function f(e,t,r,n,o,i,l,u,s,c,f){var d=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(d.searchParams.set("h",window.location.origin),t&&d.searchParams.set("theme",t),r&&d.searchParams.set("session",r),o&&d.searchParams.set("hide_price","true"),i&&d.searchParams.set("skip_redirect","true"),f&&d.searchParams.set("hide_submit_button","true"),l){var y=true,m=false,v=undefined,h=true,w=false,p=undefined;try{for(var b=Object.entries(l).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),g;!(h=(g=b.next()).done);h=true){var S=a(g.value,2),P=S[0],x=S[1];if(P.startsWith("utm_"))if(Array.isArray(x))try{for(var j=x[Symbol.iterator](),A;!(y=(A=j.next()).done);y=true){var _=A.value;d.searchParams.append(P,_)}}catch(e){m=true;v=e}finally{try{if(!y&&j.return!=null){j.return()}}finally{if(m){throw v}}}else d.searchParams.set(P,x)}}catch(e){w=true;p=e}finally{try{if(!h&&b.return!=null){b.return()}}finally{if(w){throw p}}}}if(u){var k=true,O=false,E=undefined,L=true,W=false,C=undefined;try{for(var I=Object.entries(u)[Symbol.iterator](),R;!(L=(R=I.next()).done);L=true){var U=a(R.value,2),M=U[0],q=U[1];if(q)try{for(var z=Object.entries(q)[Symbol.iterator](),T;!(k=(T=z.next()).done);k=true){var $=a(T.value,2),B=$[0],D=$[1];d.searchParams.set("style.".concat(M,".").concat(B),D.toString())}}catch(e){O=true;E=e}finally{try{if(!k&&z.return!=null){z.return()}}finally{if(O){throw E}}}}}catch(e){W=true;C=e}finally{try{if(!L&&I.return!=null){I.return()}}finally{if(W){throw C}}}}var F=true,G=false,H=undefined;if((s===null||s===void 0?void 0:s.email)&&d.searchParams.set("email",s.email),c)try{for(var J=Object.entries(c)[Symbol.iterator](),K;!(F=(K=J.next()).done);F=true){var N=a(K.value,2),Q=N[0],V=N[1];V&&d.searchParams.set("theme.".concat(Q),V)}}catch(e){G=true;H=e}finally{try{if(!F&&J.return!=null){J.return()}}finally{if(G){throw H}}}return d.toString()}var d=["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"],y="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";export{u as a,s as b,c as c,f as d,d as e,y as f};