@beamimpact/web-sdk 1.37.0 → 1.37.1
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 +21 -1
- package/dist/chunks/{_share-dialog-dependencies-Ex1exJdU.esm.js → _share-dialog-dependencies-FheD3_vQ.esm.js} +2 -2
- package/dist/chunks/_share-dialog-dependencies-FheD3_vQ.esm.js.map +1 -0
- package/dist/chunks/{_share-dialog-dependencies-GOqKRBIc.esm.js → _share-dialog-dependencies-l35ECwOP.esm.js} +2 -2
- package/dist/chunks/_share-dialog-dependencies-l35ECwOP.esm.js.map +1 -0
- package/dist/chunks/{cart-contents-Cdq4ob0J.esm.d.ts → cart-contents-IOhdr24g.esm.d.ts} +1 -1
- package/dist/chunks/events-Y8fYvSqM.esm.js +2 -0
- package/dist/chunks/{events-5IECSF-x.esm.js.map → events-Y8fYvSqM.esm.js.map} +1 -1
- package/dist/chunks/{events-3-Mzl-dS.esm.d.ts → events-j-SJ9Cot.esm.d.ts} +17 -3
- package/dist/chunks/{index-SZxnIRAX.esm.d.ts → index-3F_Wjm5v.esm.d.ts} +1 -1
- package/dist/chunks/{index-9gijHGwh.esm.js → index-8yrr7ZZv.esm.js} +2 -2
- package/dist/chunks/index-8yrr7ZZv.esm.js.map +1 -0
- package/dist/chunks/index-B2oj1JKu.esm.js +2 -0
- package/dist/chunks/index-B2oj1JKu.esm.js.map +1 -0
- package/dist/chunks/index-E_HMWZ2A.esm.js +2 -0
- package/dist/chunks/index-E_HMWZ2A.esm.js.map +1 -0
- package/dist/chunks/{index-jYAdXbGg.esm.js → index-Gz7Q9nUW.esm.js} +2 -2
- package/dist/chunks/{index-jYAdXbGg.esm.js.map → index-Gz7Q9nUW.esm.js.map} +1 -1
- package/dist/chunks/index-JsXH5Lnc.esm.js +2 -0
- package/dist/chunks/index-JsXH5Lnc.esm.js.map +1 -0
- package/dist/chunks/{index-OnjTwvAw.esm.js → index-Lw32NXij.esm.js} +2 -2
- package/dist/chunks/index-Lw32NXij.esm.js.map +1 -0
- package/dist/chunks/index-RDKeoKqc.esm.js +2 -0
- package/dist/chunks/index-RDKeoKqc.esm.js.map +1 -0
- package/dist/chunks/index-VGoZaoVm.esm.js +2 -0
- package/dist/chunks/index-VGoZaoVm.esm.js.map +1 -0
- package/dist/chunks/{index-9Cs92uGK.esm.d.ts → index-WX8Yyx2u.esm.d.ts} +1 -1
- package/dist/chunks/{index-7-XLaXA4.esm.d.ts → index-mWnpDGl1.esm.d.ts} +1 -1
- package/dist/chunks/{index-U8Oy2aur.esm.js → index-phDmC-TS.esm.js} +2 -2
- package/dist/chunks/index-phDmC-TS.esm.js.map +1 -0
- package/dist/chunks/{index-xRjeUrl2.esm.d.ts → index-s8uQH63W.esm.d.ts} +4 -4
- package/dist/chunks/{index-b3DeBLwb.esm.d.ts → index-slrOT8Gd.esm.d.ts} +1 -1
- package/dist/chunks/{index-wsdeaTHd.esm.js → index-uF-Qtewb.esm.js} +2 -2
- package/dist/chunks/index-uF-Qtewb.esm.js.map +1 -0
- package/dist/chunks/{index-KErjmUlF.esm.js → index-vpkWmZo_.esm.js} +2 -2
- package/dist/chunks/{index-KErjmUlF.esm.js.map → index-vpkWmZo_.esm.js.map} +1 -1
- package/dist/chunks/index-xYLcuL6Z.esm.js +2 -0
- package/dist/chunks/index-xYLcuL6Z.esm.js.map +1 -0
- package/dist/chunks/{index-AhT9jBIr.esm.d.ts → index-yXqJ9Znv.esm.d.ts} +1 -1
- package/dist/chunks/{openapi-spec-WpREPNjl.esm.d.ts → openapi-spec-b529HHW3.esm.d.ts} +7 -7
- package/dist/chunks/order-page-9B0nZVh1.esm.js +2 -0
- package/dist/chunks/order-page-9B0nZVh1.esm.js.map +1 -0
- package/dist/chunks/{order-page-eOCpZ8vN.esm.d.ts → order-page-jkuLE25f.esm.d.ts} +3 -4
- package/dist/chunks/order-page-yM2h67MI.esm.js +2 -0
- package/dist/chunks/order-page-yM2h67MI.esm.js.map +1 -0
- package/dist/chunks/routes-LFjgVNGB.esm.js +2 -0
- package/dist/chunks/routes-LFjgVNGB.esm.js.map +1 -0
- package/dist/chunks/routes-ad0I3Ayc.esm.js +2 -0
- package/dist/chunks/routes-ad0I3Ayc.esm.js.map +1 -0
- package/dist/chunks/{update-cart-8nDxTnnQ.esm.js → update-cart-A2hs4tF8.esm.js} +2 -2
- package/dist/chunks/{update-cart-8nDxTnnQ.esm.js.map → update-cart-A2hs4tF8.esm.js.map} +1 -1
- package/dist/chunks/{update-cart-D4jDrYC0.esm.d.ts → update-cart-EKZbvT8c.esm.d.ts} +1 -1
- package/dist/chunks/{update-cart-_cCsAqH9.esm.js → update-cart-vcujKNky.esm.js} +2 -2
- package/dist/chunks/{update-cart-_cCsAqH9.esm.js.map → update-cart-vcujKNky.esm.js.map} +1 -1
- package/dist/components/community-impact.esm.js +1 -1
- package/dist/components/community-impact.js +1 -1
- package/dist/components/cumulative-impact.esm.js +1 -1
- package/dist/components/cumulative-impact.js +1 -1
- package/dist/components/impact-overview.esm.js +1 -1
- package/dist/components/impact-overview.js +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/post-purchase.d.ts +3 -3
- package/dist/components/post-purchase.esm.js +1 -1
- package/dist/components/post-purchase.js +1 -1
- package/dist/components/redeem-transaction.d.ts +3 -3
- package/dist/components/redeem-transaction.esm.js +1 -1
- package/dist/components/redeem-transaction.js +1 -1
- package/dist/components/select-nonprofit.d.ts +3 -3
- package/dist/components/select-nonprofit.esm.js +19 -19
- package/dist/components/select-nonprofit.esm.js.map +1 -1
- package/dist/components/select-nonprofit.js +19 -19
- package/dist/components/select-nonprofit.js.map +1 -1
- package/dist/components/shopify.d.ts +5 -5
- package/dist/components/shopify.esm.js +1 -1
- package/dist/components/shopify.js +1 -1
- package/dist/components/subscription-management.d.ts +3 -3
- package/dist/components/subscription-management.esm.js +1 -1
- package/dist/components/subscription-management.js +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/beam.esm.js +1 -1
- package/dist/integrations/beam.js +1 -1
- package/dist/integrations/cart.d.ts +3 -3
- package/dist/integrations/cart.esm.js +1 -1
- package/dist/integrations/cart.js +1 -1
- package/dist/integrations/index.d.ts +9 -9
- package/dist/integrations/index.esm.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/logs.d.ts +2 -2
- package/dist/integrations/logs.esm.js +1 -1
- package/dist/integrations/logs.js +1 -1
- package/dist/integrations/shopify.d.ts +4 -4
- package/dist/integrations/shopify.esm.js +1 -1
- package/dist/integrations/shopify.js +1 -1
- package/dist/integrations/statsig.esm.js +1 -1
- package/dist/integrations/statsig.js +1 -1
- package/dist/integrations/utils.d.ts +3 -3
- package/dist/integrations/utils.esm.js +1 -1
- package/dist/integrations/utils.js +1 -1
- package/dist/react/community-impact.esm.js +1 -1
- package/dist/react/community-impact.js +1 -1
- package/dist/react/cumulative-impact.esm.js +1 -1
- package/dist/react/cumulative-impact.js +1 -1
- package/dist/react/impact-overview.esm.js +1 -1
- package/dist/react/impact-overview.js +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.esm.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/post-purchase.d.ts +2 -2
- package/dist/react/post-purchase.esm.js +1 -1
- package/dist/react/post-purchase.js +1 -1
- package/dist/react/redeem-transaction.d.ts +3 -3
- package/dist/react/redeem-transaction.esm.js +1 -1
- package/dist/react/redeem-transaction.js +1 -1
- package/dist/react/select-nonprofit.d.ts +3 -3
- package/dist/react/select-nonprofit.esm.js +1 -1
- package/dist/react/select-nonprofit.js +1 -1
- package/dist/react/subscription-management.d.ts +2 -2
- package/dist/react/subscription-management.esm.js +1 -1
- package/dist/react/subscription-management.js +1 -1
- package/dist/utils/events.d.ts +3 -3
- package/dist/utils/events.esm.js +1 -1
- package/dist/utils/events.js +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/network-listeners.esm.js +1 -1
- package/dist/utils/network-listeners.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/_share-dialog-dependencies-Ex1exJdU.esm.js.map +0 -1
- package/dist/chunks/_share-dialog-dependencies-GOqKRBIc.esm.js.map +0 -1
- package/dist/chunks/events-5IECSF-x.esm.js +0 -2
- package/dist/chunks/index-5AkzIYu3.esm.js +0 -2
- package/dist/chunks/index-5AkzIYu3.esm.js.map +0 -1
- package/dist/chunks/index-8VxiCO_y.esm.js +0 -2
- package/dist/chunks/index-8VxiCO_y.esm.js.map +0 -1
- package/dist/chunks/index-9gijHGwh.esm.js.map +0 -1
- package/dist/chunks/index-OnjTwvAw.esm.js.map +0 -1
- package/dist/chunks/index-U8Oy2aur.esm.js.map +0 -1
- package/dist/chunks/index-a9SRo_pt.esm.js +0 -2
- package/dist/chunks/index-a9SRo_pt.esm.js.map +0 -1
- package/dist/chunks/index-fdm0Zxu6.esm.js +0 -2
- package/dist/chunks/index-fdm0Zxu6.esm.js.map +0 -1
- package/dist/chunks/index-gfShfkGQ.esm.js +0 -2
- package/dist/chunks/index-gfShfkGQ.esm.js.map +0 -1
- package/dist/chunks/index-wsdeaTHd.esm.js.map +0 -1
- package/dist/chunks/index-yEHTVDWu.esm.js +0 -2
- package/dist/chunks/index-yEHTVDWu.esm.js.map +0 -1
- package/dist/chunks/order-page-ZyVxKalS.esm.js +0 -2
- package/dist/chunks/order-page-ZyVxKalS.esm.js.map +0 -1
- package/dist/chunks/order-page-nKOujF0G.esm.js +0 -2
- package/dist/chunks/order-page-nKOujF0G.esm.js.map +0 -1
- package/dist/chunks/routes-S3ZS-od_.esm.js +0 -2
- package/dist/chunks/routes-S3ZS-od_.esm.js.map +0 -1
- package/dist/chunks/routes-jQjZhNH9.esm.js +0 -2
- package/dist/chunks/routes-jQjZhNH9.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as R}from"../chunks/routes-
|
|
1
|
+
import{p as R}from"../chunks/routes-LFjgVNGB.esm.js";import{B as M}from"../chunks/cart-contents-h60geKWa.esm.js";import{a as D,b as O,c as W}from"../chunks/events-Y8fYvSqM.esm.js";import{B as m}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{getCookieValue as f,setCookieValue as $}from"../utils/cookies.esm.js";import{logger as C}from"../utils/logger.esm.js";import{saveRemoteSession as K}from"../utils/remote-session.esm.js";import"../utils/local-storage.esm.js";var w=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},d=(e,t,i)=>(w(e,t,"read from private field"),i?i.call(e):t.get(e)),n=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},_=(e,t,i,s)=>(w(e,t,"write to private field"),s?s.call(e,i):t.set(e,i),i),r=(e,t,i)=>(w(e,t,"access private method"),i),h,c,E,T,b,A,l,v,B,g,S,y,L,I,k;const P=4,j=`https://cdn.jsdelivr.net/npm/statsig-js@${P}/build/statsig-prod-web-sdk.min.js`,x="beam_statsig_session_id",o="data-beam-visibility",z="beam-sync-visibility",p={STATSIG_INIT:"statsig_init",CART_CREATED:"cart_created",ORDER_CREATED:"order_created",BEAM_SELECTION:"beam_selection"};class G{constructor(t){n(this,E),n(this,b),n(this,v),n(this,g),n(this,y),n(this,I),this.name="statsig",this.experiments={shouldShowBeam:!1,isLoggingEnabled:!0},n(this,h,void 0),n(this,c,void 0),n(this,l,[]),this.statsigApiKey=t.statsigApiKey}async init(t){_(this,h,t),r(this,E,T).call(this),r(this,g,S).call(this,"hide");const i=document.createElement("style");if(i.innerHTML=`
|
|
2
2
|
[${o}="hide"] beam-select-nonprofit,
|
|
3
3
|
[${o}="hide"] beam-post-purchase,
|
|
4
4
|
[${o}="hide"] beam-redeem-transaction,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as R}from"../chunks/routes-
|
|
1
|
+
import{p as R}from"../chunks/routes-ad0I3Ayc.esm.js";import{B as M}from"../chunks/cart-contents-h60geKWa.esm.js";import{a as D,b as O,c as W}from"../chunks/events-Y8fYvSqM.esm.js";import{B as m}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{getCookieValue as f,setCookieValue as $}from"../utils/cookies.js";import{logger as C}from"../utils/logger.js";import{saveRemoteSession as K}from"../utils/remote-session.js";import"../utils/local-storage.js";var w=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},d=(e,t,i)=>(w(e,t,"read from private field"),i?i.call(e):t.get(e)),n=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},_=(e,t,i,s)=>(w(e,t,"write to private field"),s?s.call(e,i):t.set(e,i),i),r=(e,t,i)=>(w(e,t,"access private method"),i),h,c,E,T,b,A,l,v,B,g,S,y,L,I,k;const P=4,j=`https://cdn.jsdelivr.net/npm/statsig-js@${P}/build/statsig-prod-web-sdk.min.js`,x="beam_statsig_session_id",o="data-beam-visibility",z="beam-sync-visibility",p={STATSIG_INIT:"statsig_init",CART_CREATED:"cart_created",ORDER_CREATED:"order_created",BEAM_SELECTION:"beam_selection"};class G{constructor(t){n(this,E),n(this,b),n(this,v),n(this,g),n(this,y),n(this,I),this.name="statsig",this.experiments={shouldShowBeam:!1,isLoggingEnabled:!0},n(this,h,void 0),n(this,c,void 0),n(this,l,[]),this.statsigApiKey=t.statsigApiKey}async init(t){_(this,h,t),r(this,E,T).call(this),r(this,g,S).call(this,"hide");const i=document.createElement("style");if(i.innerHTML=`
|
|
2
2
|
[${o}="hide"] beam-select-nonprofit,
|
|
3
3
|
[${o}="hide"] beam-post-purchase,
|
|
4
4
|
[${o}="hide"] beam-redeem-transaction,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { b as errors } from '../chunks/beam-errors-fXDkG1zo.esm.js';
|
|
2
|
-
export { e as events } from '../chunks/events-
|
|
2
|
+
export { e as events } from '../chunks/events-j-SJ9Cot.esm.js';
|
|
3
3
|
export { logger } from '../utils/logger.js';
|
|
4
4
|
export { fetchProxy, initNetworkListeners, xhrProxy } from '../utils/network-listeners.js';
|
|
5
5
|
export { createScopedLocalStorage } from '../utils/local-storage.js';
|
|
@@ -9,6 +9,6 @@ export { getRemoteSession, saveRemoteSession } from '../utils/remote-session.js'
|
|
|
9
9
|
export { memoizeLast } from '../utils/memoize-last.js';
|
|
10
10
|
export { default as debounce } from 'lodash-es/debounce';
|
|
11
11
|
export { default as isEqual } from 'lodash-es/isEqual';
|
|
12
|
-
import '../chunks/cart-contents-
|
|
13
|
-
import '../chunks/openapi-spec-
|
|
12
|
+
import '../chunks/cart-contents-IOhdr24g.esm.js';
|
|
13
|
+
import '../chunks/openapi-spec-b529HHW3.esm.js';
|
|
14
14
|
import '../chunks/types-7kSi85Gv.esm.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{e as s}from"../chunks/events-
|
|
1
|
+
import{b as r}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{e as s}from"../chunks/events-Y8fYvSqM.esm.js";import{logger as m}from"../utils/logger.esm.js";import{fetchProxy as x,initNetworkListeners as p,xhrProxy as f}from"../utils/network-listeners.esm.js";import{createScopedLocalStorage as n}from"../utils/local-storage.esm.js";import{waitForElement as c}from"../utils/wait-for-element.esm.js";import{deleteCookieValue as u,getCookieMap as d,getCookieValue as C,setCookieValue as S}from"../utils/cookies.esm.js";import{getRemoteSession as V,saveRemoteSession as b}from"../utils/remote-session.esm.js";import{memoizeLast as v}from"../utils/memoize-last.esm.js";import{d as y,i as E}from"../chunks/lodash-P8OIs-at.esm.js";export{n as createScopedLocalStorage,y as debounce,u as deleteCookieValue,r as errors,s as events,x as fetchProxy,d as getCookieMap,C as getCookieValue,V as getRemoteSession,p as initNetworkListeners,E as isEqual,m as logger,v as memoizeLast,b as saveRemoteSession,S as setCookieValue,c as waitForElement,f as xhrProxy};
|
|
2
2
|
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{e as s}from"../chunks/events-
|
|
1
|
+
import{b as r}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{e as s}from"../chunks/events-Y8fYvSqM.esm.js";import{logger as m}from"../utils/logger.js";import{fetchProxy as x,initNetworkListeners as p,xhrProxy as f}from"../utils/network-listeners.js";import{createScopedLocalStorage as n}from"../utils/local-storage.js";import{waitForElement as c}from"../utils/wait-for-element.js";import{deleteCookieValue as u,getCookieMap as d,getCookieValue as C,setCookieValue as S}from"../utils/cookies.js";import{getRemoteSession as V,saveRemoteSession as b}from"../utils/remote-session.js";import{memoizeLast as v}from"../utils/memoize-last.js";import{d as y,i as E}from"../chunks/lodash-P8OIs-at.esm.js";export{n as createScopedLocalStorage,y as debounce,u as deleteCookieValue,r as errors,s as events,x as fetchProxy,d as getCookieMap,C as getCookieValue,V as getRemoteSession,p as initNetworkListeners,E as isEqual,m as logger,v as memoizeLast,b as saveRemoteSession,S as setCookieValue,c as waitForElement,f as xhrProxy};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as r}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamCommunityImpact as m}from"../components/community-impact.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/routes-
|
|
1
|
+
import o from"react";import{l as r}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamCommunityImpact as m}from"../components/community-impact.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/routes-LFjgVNGB.esm.js";import"../chunks/localize-GCkVUD8S.esm.js";import"../chunks/css-card-grid-3b56QBzq.esm.js";const t=r({tagName:m.tagName,elementClass:m,react:o,events:{}});export{t as BeamCommunityImpact,t as default};
|
|
2
2
|
//# sourceMappingURL=community-impact.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as r}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamCommunityImpact as m}from"../components/community-impact.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/routes-
|
|
1
|
+
import o from"react";import{l as r}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamCommunityImpact as m}from"../components/community-impact.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/routes-ad0I3Ayc.esm.js";import"../chunks/localize-pzAAkBvG.esm.js";import"../chunks/css-card-grid-3b56QBzq.esm.js";const t=r({tagName:m.tagName,elementClass:m,react:o,events:{}});export{t as BeamCommunityImpact,t as default};
|
|
2
2
|
//# sourceMappingURL=community-impact.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import a from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamCumulativeImpact as m}from"../components/cumulative-impact.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/routes-
|
|
1
|
+
import a from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamCumulativeImpact as m}from"../components/cumulative-impact.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/routes-LFjgVNGB.esm.js";import"../chunks/localize-GCkVUD8S.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";const t=e({tagName:m.tagName,elementClass:m,react:a,events:{}});export{t as BeamCumulativeImpact,t as default};
|
|
2
2
|
//# sourceMappingURL=cumulative-impact.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import a from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamCumulativeImpact as m}from"../components/cumulative-impact.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/routes-
|
|
1
|
+
import a from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamCumulativeImpact as m}from"../components/cumulative-impact.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/routes-ad0I3Ayc.esm.js";import"../chunks/localize-pzAAkBvG.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";const t=e({tagName:m.tagName,elementClass:m,react:a,events:{}});export{t as BeamCumulativeImpact,t as default};
|
|
2
2
|
//# sourceMappingURL=cumulative-impact.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamImpactOverview as m}from"../components/impact-overview.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/routes-
|
|
1
|
+
import r from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamImpactOverview as m}from"../components/impact-overview.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/routes-LFjgVNGB.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/localize-GCkVUD8S.esm.js";import"../chunks/vendor-eeJfrOkP.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/responsive-LYEag6TI.esm.js";const t=e({tagName:m.tagName,elementClass:m,react:r,events:{}});export{t as BeamImpactOverview,t as default};
|
|
2
2
|
//# sourceMappingURL=impact-overview.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamImpactOverview as m}from"../components/impact-overview.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/routes-
|
|
1
|
+
import r from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamImpactOverview as m}from"../components/impact-overview.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/routes-ad0I3Ayc.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/localize-pzAAkBvG.esm.js";import"../chunks/vendor-eeJfrOkP.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../components/beam-partner-logos.js";import"../chunks/responsive-LYEag6TI.esm.js";const t=e({tagName:m.tagName,elementClass:m,react:r,events:{}});export{t as BeamImpactOverview,t as default};
|
|
2
2
|
//# sourceMappingURL=impact-overview.js.map
|
package/dist/react/index.d.ts
CHANGED
|
@@ -16,9 +16,9 @@ import '../chunks/types-7kSi85Gv.esm.js';
|
|
|
16
16
|
import '../components/cumulative-impact.js';
|
|
17
17
|
import 'lodash';
|
|
18
18
|
import '../components/impact-overview.js';
|
|
19
|
-
import '../chunks/events-
|
|
20
|
-
import '../chunks/cart-contents-
|
|
21
|
-
import '../chunks/openapi-spec-
|
|
19
|
+
import '../chunks/events-j-SJ9Cot.esm.js';
|
|
20
|
+
import '../chunks/cart-contents-IOhdr24g.esm.js';
|
|
21
|
+
import '../chunks/openapi-spec-b529HHW3.esm.js';
|
|
22
22
|
import '../components/select-nonprofit.js';
|
|
23
23
|
import '../components/redeem-transaction.js';
|
|
24
24
|
import '../components/post-purchase.js';
|
package/dist/react/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{BeamCommunityImpact as N}from"./community-impact.esm.js";import{BeamCumulativeImpact as R}from"./cumulative-impact.esm.js";import{BeamImpactOverview as j}from"./impact-overview.esm.js";import{BeamSelectNonprofit as q}from"./select-nonprofit.esm.js";import{BeamRedeemTransaction as A}from"./redeem-transaction.esm.js";import{BeamPostPurchase as E}from"./post-purchase.esm.js";import{BeamSubscriptionManagement as G}from"./subscription-management.esm.js";import"react";import"../chunks/lit-yVXn5Cbs.esm.js";import"../components/community-impact.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/routes-
|
|
1
|
+
import{BeamCommunityImpact as N}from"./community-impact.esm.js";import{BeamCumulativeImpact as R}from"./cumulative-impact.esm.js";import{BeamImpactOverview as j}from"./impact-overview.esm.js";import{BeamSelectNonprofit as q}from"./select-nonprofit.esm.js";import{BeamRedeemTransaction as A}from"./redeem-transaction.esm.js";import{BeamPostPurchase as E}from"./post-purchase.esm.js";import{BeamSubscriptionManagement as G}from"./subscription-management.esm.js";import"react";import"../chunks/lit-yVXn5Cbs.esm.js";import"../components/community-impact.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/routes-LFjgVNGB.esm.js";import"../chunks/localize-GCkVUD8S.esm.js";import"../chunks/css-card-grid-3b56QBzq.esm.js";import"../components/cumulative-impact.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../components/impact-overview.esm.js";import"../chunks/vendor-eeJfrOkP.esm.js";import"../chunks/responsive-LYEag6TI.esm.js";import"../chunks/events-Y8fYvSqM.esm.js";import"../components/select-nonprofit.esm.js";import"../utils/network-listeners.esm.js";import"../utils/local-storage.esm.js";import"../utils/cookies.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../components/redeem-transaction.esm.js";import"../components/post-purchase.esm.js";import"../components/subscription-management.esm.js";export{N as BeamCommunityImpact,R as BeamCumulativeImpact,j as BeamImpactOverview,E as BeamPostPurchase,A as BeamRedeemTransaction,q as BeamSelectNonprofit,G as BeamSubscriptionManagement};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/react/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{BeamCommunityImpact as N}from"./community-impact.js";import{BeamCumulativeImpact as R}from"./cumulative-impact.js";import{BeamImpactOverview as j}from"./impact-overview.js";import{BeamSelectNonprofit as q}from"./select-nonprofit.js";import{BeamRedeemTransaction as A}from"./redeem-transaction.js";import{BeamPostPurchase as E}from"./post-purchase.js";import{BeamSubscriptionManagement as G}from"./subscription-management.js";import"react";import"../chunks/lit-yVXn5Cbs.esm.js";import"../components/community-impact.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/routes-
|
|
1
|
+
import{BeamCommunityImpact as N}from"./community-impact.js";import{BeamCumulativeImpact as R}from"./cumulative-impact.js";import{BeamImpactOverview as j}from"./impact-overview.js";import{BeamSelectNonprofit as q}from"./select-nonprofit.js";import{BeamRedeemTransaction as A}from"./redeem-transaction.js";import{BeamPostPurchase as E}from"./post-purchase.js";import{BeamSubscriptionManagement as G}from"./subscription-management.js";import"react";import"../chunks/lit-yVXn5Cbs.esm.js";import"../components/community-impact.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/routes-ad0I3Ayc.esm.js";import"../chunks/localize-pzAAkBvG.esm.js";import"../chunks/css-card-grid-3b56QBzq.esm.js";import"../components/cumulative-impact.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../components/impact-overview.js";import"../chunks/vendor-eeJfrOkP.esm.js";import"../chunks/responsive-LYEag6TI.esm.js";import"../chunks/events-Y8fYvSqM.esm.js";import"../components/select-nonprofit.js";import"../utils/network-listeners.js";import"../utils/local-storage.js";import"../utils/cookies.js";import"../chunks/cart-contents-h60geKWa.esm.js";import"../components/redeem-transaction.js";import"../components/post-purchase.js";import"../components/subscription-management.js";export{N as BeamCommunityImpact,R as BeamCumulativeImpact,j as BeamImpactOverview,E as BeamPostPurchase,A as BeamRedeemTransaction,q as BeamSelectNonprofit,G as BeamSubscriptionManagement};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -8,8 +8,8 @@ import 'lodash';
|
|
|
8
8
|
import '../chunks/progress-bar-0VS_AmEf.esm.js';
|
|
9
9
|
import '../components/beam-partner-logos.js';
|
|
10
10
|
import '../chunks/types-7kSi85Gv.esm.js';
|
|
11
|
-
import '../chunks/cart-contents-
|
|
12
|
-
import '../chunks/openapi-spec-
|
|
11
|
+
import '../chunks/cart-contents-IOhdr24g.esm.js';
|
|
12
|
+
import '../chunks/openapi-spec-b529HHW3.esm.js';
|
|
13
13
|
import '../components/impact-overview.js';
|
|
14
14
|
|
|
15
15
|
declare const BeamPostPurchase: _lit_react.ReactWebComponent<BeamPostPurchase$1, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as r}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamPostPurchase as t}from"../components/post-purchase.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/cookies.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../utils/logger.esm.js";import"../utils/local-storage.esm.js";import"../chunks/routes-
|
|
1
|
+
import o from"react";import{l as r}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamPostPurchase as t}from"../components/post-purchase.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/cookies.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../utils/logger.esm.js";import"../utils/local-storage.esm.js";import"../chunks/routes-LFjgVNGB.esm.js";import"../components/redeem-transaction.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/localize-GCkVUD8S.esm.js";import"../chunks/css-card-grid-3b56QBzq.esm.js";import"../chunks/events-Y8fYvSqM.esm.js";import"../components/impact-overview.esm.js";import"../chunks/vendor-eeJfrOkP.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-LYEag6TI.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";const m=r({tagName:t.tagName,elementClass:t,react:o,events:{}});export{m as BeamPostPurchase,m as default};
|
|
2
2
|
//# sourceMappingURL=post-purchase.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as r}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamPostPurchase as t}from"../components/post-purchase.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/cookies.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../utils/logger.js";import"../utils/local-storage.js";import"../chunks/routes-
|
|
1
|
+
import o from"react";import{l as r}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamPostPurchase as t}from"../components/post-purchase.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/cookies.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../utils/logger.js";import"../utils/local-storage.js";import"../chunks/routes-ad0I3Ayc.esm.js";import"../components/redeem-transaction.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.js";import"../chunks/localize-pzAAkBvG.esm.js";import"../chunks/css-card-grid-3b56QBzq.esm.js";import"../chunks/events-Y8fYvSqM.esm.js";import"../components/impact-overview.js";import"../chunks/vendor-eeJfrOkP.esm.js";import"../chunks/is-all-html-elements-SdSkxirh.esm.js";import"../chunks/responsive-LYEag6TI.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";const m=r({tagName:t.tagName,elementClass:t,react:o,events:{}});export{m as BeamPostPurchase,m as default};
|
|
2
2
|
//# sourceMappingURL=post-purchase.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _lit_react from '@lit/react';
|
|
2
2
|
import { EventName } from '@lit/react';
|
|
3
|
-
import { B as BeamNonprofitSelectEvent } from '../chunks/events-
|
|
3
|
+
import { B as BeamNonprofitSelectEvent } from '../chunks/events-j-SJ9Cot.esm.js';
|
|
4
4
|
import { BeamRedeemTransaction as BeamRedeemTransaction$1 } from '../components/redeem-transaction.js';
|
|
5
|
-
import '../chunks/cart-contents-
|
|
6
|
-
import '../chunks/openapi-spec-
|
|
5
|
+
import '../chunks/cart-contents-IOhdr24g.esm.js';
|
|
6
|
+
import '../chunks/openapi-spec-b529HHW3.esm.js';
|
|
7
7
|
import '../chunks/types-7kSi85Gv.esm.js';
|
|
8
8
|
import 'lit-html';
|
|
9
9
|
import 'lit';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import m from"react";import{l as o}from"../chunks/lit-yVXn5Cbs.esm.js";import{c as r}from"../chunks/events-
|
|
1
|
+
import m from"react";import{l as o}from"../chunks/lit-yVXn5Cbs.esm.js";import{c as r}from"../chunks/events-Y8fYvSqM.esm.js";import{BeamRedeemTransaction as t}from"../components/redeem-transaction.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/routes-LFjgVNGB.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.esm.js";import"../chunks/localize-GCkVUD8S.esm.js";import"../utils/local-storage.esm.js";import"../chunks/css-card-grid-3b56QBzq.esm.js";const e=o({tagName:t.tagName,elementClass:t,react:m,events:{onNonprofitSelect:r.eventName}});export{e as BeamRedeemTransaction,e as default};
|
|
2
2
|
//# sourceMappingURL=redeem-transaction.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import m from"react";import{l as o}from"../chunks/lit-yVXn5Cbs.esm.js";import{c as r}from"../chunks/events-
|
|
1
|
+
import m from"react";import{l as o}from"../chunks/lit-yVXn5Cbs.esm.js";import{c as r}from"../chunks/events-Y8fYvSqM.esm.js";import{BeamRedeemTransaction as t}from"../components/redeem-transaction.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/routes-ad0I3Ayc.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../components/beam-partner-logos.js";import"../chunks/localize-pzAAkBvG.esm.js";import"../utils/local-storage.js";import"../chunks/css-card-grid-3b56QBzq.esm.js";const e=o({tagName:t.tagName,elementClass:t,react:m,events:{onNonprofitSelect:r.eventName}});export{e as BeamRedeemTransaction,e as default};
|
|
2
2
|
//# sourceMappingURL=redeem-transaction.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _lit_react from '@lit/react';
|
|
2
2
|
import { EventName } from '@lit/react';
|
|
3
|
-
import { B as BeamNonprofitSelectEvent } from '../chunks/events-
|
|
3
|
+
import { B as BeamNonprofitSelectEvent } from '../chunks/events-j-SJ9Cot.esm.js';
|
|
4
4
|
import { BeamSelectNonprofit as BeamSelectNonprofit$1 } from '../components/select-nonprofit.js';
|
|
5
|
-
import '../chunks/cart-contents-
|
|
6
|
-
import '../chunks/openapi-spec-
|
|
5
|
+
import '../chunks/cart-contents-IOhdr24g.esm.js';
|
|
6
|
+
import '../chunks/openapi-spec-b529HHW3.esm.js';
|
|
7
7
|
import '../chunks/types-7kSi85Gv.esm.js';
|
|
8
8
|
import 'lit-html';
|
|
9
9
|
import 'lit';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{c as m}from"../chunks/events-
|
|
1
|
+
import o from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{c as m}from"../chunks/events-Y8fYvSqM.esm.js";import{BeamSelectNonprofit as r}from"../components/select-nonprofit.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/routes-LFjgVNGB.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../chunks/localize-GCkVUD8S.esm.js";import"../utils/network-listeners.esm.js";import"../utils/local-storage.esm.js";import"../utils/cookies.esm.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/responsive-LYEag6TI.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";const t=e({tagName:"beam-select-nonprofit",elementClass:r,react:o,events:{onNonprofitSelect:m.eventName}});export{t as BeamSelectNonprofit,t as default};
|
|
2
2
|
//# sourceMappingURL=select-nonprofit.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{c as m}from"../chunks/events-
|
|
1
|
+
import o from"react";import{l as e}from"../chunks/lit-yVXn5Cbs.esm.js";import{c as m}from"../chunks/events-Y8fYvSqM.esm.js";import{BeamSelectNonprofit as r}from"../components/select-nonprofit.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/routes-ad0I3Ayc.esm.js";import"../chunks/progress-bar-7gWYaGlq.esm.js";import"../chunks/localize-pzAAkBvG.esm.js";import"../utils/network-listeners.js";import"../utils/local-storage.js";import"../utils/cookies.js";import"../chunks/lodash-P8OIs-at.esm.js";import"../chunks/responsive-LYEag6TI.esm.js";import"../chunks/cart-contents-h60geKWa.esm.js";const t=e({tagName:"beam-select-nonprofit",elementClass:r,react:o,events:{onNonprofitSelect:m.eventName}});export{t as BeamSelectNonprofit,t as default};
|
|
2
2
|
//# sourceMappingURL=select-nonprofit.js.map
|
|
@@ -3,8 +3,8 @@ import { BeamSubscriptionManagement as BeamSubscriptionManagement$1 } from '../c
|
|
|
3
3
|
import 'lit';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import '../chunks/types-aju0qrRe.esm.js';
|
|
6
|
-
import '../chunks/cart-contents-
|
|
7
|
-
import '../chunks/openapi-spec-
|
|
6
|
+
import '../chunks/cart-contents-IOhdr24g.esm.js';
|
|
7
|
+
import '../chunks/openapi-spec-b529HHW3.esm.js';
|
|
8
8
|
|
|
9
9
|
declare const BeamSubscriptionManagement: _lit_react.ReactWebComponent<BeamSubscriptionManagement$1, {}>;
|
|
10
10
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{l as a}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamSubscriptionManagement as t}from"../components/subscription-management.esm.js";import"../chunks/routes-
|
|
1
|
+
import e from"react";import{l as a}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamSubscriptionManagement as t}from"../components/subscription-management.esm.js";import"../chunks/routes-LFjgVNGB.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";import"../chunks/enforce-config-qna7hEL6.esm.js";import"../chunks/events-Y8fYvSqM.esm.js";const m=a({tagName:t.tagName,elementClass:t,react:e,events:{}});export{m as BeamSubscriptionManagement,m as default};
|
|
2
2
|
//# sourceMappingURL=subscription-management.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{l as a}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamSubscriptionManagement as t}from"../components/subscription-management.js";import"../chunks/routes-
|
|
1
|
+
import e from"react";import{l as a}from"../chunks/lit-yVXn5Cbs.esm.js";import{BeamSubscriptionManagement as t}from"../components/subscription-management.js";import"../chunks/routes-ad0I3Ayc.esm.js";import"../chunks/beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.js";import"../chunks/enforce-config-fo8kIfoY.esm.js";import"../chunks/events-Y8fYvSqM.esm.js";const m=a({tagName:t.tagName,elementClass:t,react:e,events:{}});export{m as BeamSubscriptionManagement,m as default};
|
|
2
2
|
//# sourceMappingURL=subscription-management.js.map
|
package/dist/utils/events.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../chunks/cart-contents-
|
|
1
|
+
import '../chunks/cart-contents-IOhdr24g.esm.js';
|
|
2
2
|
import '../chunks/types-7kSi85Gv.esm.js';
|
|
3
|
-
export { b as BeamCartChangeEvent, c as BeamCartCreatedEvent, a as BeamNetworkCallEvent, B as BeamNonprofitSelectEvent, d as BeamOrderCreatedEvent, f as BeamStatusChangeEvent } from '../chunks/events-
|
|
4
|
-
import '../chunks/openapi-spec-
|
|
3
|
+
export { b as BeamCartChangeEvent, c as BeamCartCreatedEvent, a as BeamNetworkCallEvent, B as BeamNonprofitSelectEvent, g as BeamNonprofitSelectionRemovedEvent, d as BeamOrderCreatedEvent, f as BeamStatusChangeEvent } from '../chunks/events-j-SJ9Cot.esm.js';
|
|
4
|
+
import '../chunks/openapi-spec-b529HHW3.esm.js';
|
package/dist/utils/events.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as t,a as
|
|
1
|
+
import{f as t,a as n,d as r,c as m,g as o,b as s,B as v}from"../chunks/events-Y8fYvSqM.esm.js";export{t as BeamCartChangeEvent,n as BeamCartCreatedEvent,r as BeamNetworkCallEvent,m as BeamNonprofitSelectEvent,o as BeamNonprofitSelectionRemovedEvent,s as BeamOrderCreatedEvent,v as BeamStatusChangeEvent};
|
|
2
2
|
//# sourceMappingURL=events.esm.js.map
|
package/dist/utils/events.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as t,a as
|
|
1
|
+
import{f as t,a as n,d as r,c as m,g as o,b as s,B as v}from"../chunks/events-Y8fYvSqM.esm.js";export{t as BeamCartChangeEvent,n as BeamCartCreatedEvent,r as BeamNetworkCallEvent,m as BeamNonprofitSelectEvent,o as BeamNonprofitSelectionRemovedEvent,s as BeamOrderCreatedEvent,v as BeamStatusChangeEvent};
|
|
2
2
|
//# sourceMappingURL=events.js.map
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { b as errors } from '../chunks/beam-errors-fXDkG1zo.esm.js';
|
|
2
|
-
export { e as events } from '../chunks/events-
|
|
2
|
+
export { e as events } from '../chunks/events-j-SJ9Cot.esm.js';
|
|
3
3
|
export { logger } from './logger.js';
|
|
4
4
|
export { fetchProxy, initNetworkListeners, xhrProxy } from './network-listeners.js';
|
|
5
5
|
export { createScopedLocalStorage } from './local-storage.js';
|
|
@@ -9,6 +9,6 @@ export { getRemoteSession, saveRemoteSession } from './remote-session.js';
|
|
|
9
9
|
export { memoizeLast } from './memoize-last.js';
|
|
10
10
|
export { default as debounce } from 'lodash-es/debounce';
|
|
11
11
|
export { default as isEqual } from 'lodash-es/isEqual';
|
|
12
|
-
import '../chunks/cart-contents-
|
|
13
|
-
import '../chunks/openapi-spec-
|
|
12
|
+
import '../chunks/cart-contents-IOhdr24g.esm.js';
|
|
13
|
+
import '../chunks/openapi-spec-b529HHW3.esm.js';
|
|
14
14
|
import '../chunks/types-7kSi85Gv.esm.js';
|
package/dist/utils/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{e as s}from"../chunks/events-
|
|
1
|
+
import{b as r}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{e as s}from"../chunks/events-Y8fYvSqM.esm.js";import{logger as m}from"./logger.esm.js";import{fetchProxy as x,initNetworkListeners as p,xhrProxy as f}from"./network-listeners.esm.js";import{createScopedLocalStorage as n}from"./local-storage.esm.js";import{waitForElement as c}from"./wait-for-element.esm.js";import{deleteCookieValue as u,getCookieMap as d,getCookieValue as C,setCookieValue as S}from"./cookies.esm.js";import{getRemoteSession as V,saveRemoteSession as b}from"./remote-session.esm.js";import{memoizeLast as v}from"./memoize-last.esm.js";import{d as y,i as E}from"../chunks/lodash-P8OIs-at.esm.js";export{n as createScopedLocalStorage,y as debounce,u as deleteCookieValue,r as errors,s as events,x as fetchProxy,d as getCookieMap,C as getCookieValue,V as getRemoteSession,p as initNetworkListeners,E as isEqual,m as logger,v as memoizeLast,b as saveRemoteSession,S as setCookieValue,c as waitForElement,f as xhrProxy};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{e as s}from"../chunks/events-
|
|
1
|
+
import{b as r}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{e as s}from"../chunks/events-Y8fYvSqM.esm.js";import{logger as m}from"./logger.js";import{fetchProxy as x,initNetworkListeners as p,xhrProxy as f}from"./network-listeners.js";import{createScopedLocalStorage as n}from"./local-storage.js";import{waitForElement as c}from"./wait-for-element.js";import{deleteCookieValue as u,getCookieMap as d,getCookieValue as C,setCookieValue as S}from"./cookies.js";import{getRemoteSession as V,saveRemoteSession as b}from"./remote-session.js";import{memoizeLast as v}from"./memoize-last.js";import{d as y,i as E}from"../chunks/lodash-P8OIs-at.esm.js";export{n as createScopedLocalStorage,y as debounce,u as deleteCookieValue,r as errors,s as events,x as fetchProxy,d as getCookieMap,C as getCookieValue,V as getRemoteSession,p as initNetworkListeners,E as isEqual,m as logger,v as memoizeLast,b as saveRemoteSession,S as setCookieValue,c as waitForElement,f as xhrProxy};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as r}from"../chunks/events-
|
|
1
|
+
import{d as r}from"../chunks/events-Y8fYvSqM.esm.js";const h=window.fetch,d={apply:function(n,e,t){return n(...t).then(o=>{if(o.ok){const i=o.clone();window.dispatchEvent(new r({url:t[0].toString(),method:(t[1]?.method||"get").toLowerCase(),type:"fetch",response:i}))}return o})}},s=new Proxy(h,d),a=XMLHttpRequest,p={construct(n,e){const t=new n(...e);return t.addEventListener("load",()=>{window.dispatchEvent(new r({url:(e[1]||"").toString(),method:(e[0]||"get").toLowerCase(),type:"xhr",xhr:t}))}),t}},c=new Proxy(a,p);let w=!1;const u=()=>{w||(window.fetch=s,XMLHttpRequest=c,w=!0)};export{s as fetchProxy,u as initNetworkListeners,c as xhrProxy};
|
|
2
2
|
//# sourceMappingURL=network-listeners.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as r}from"../chunks/events-
|
|
1
|
+
import{d as r}from"../chunks/events-Y8fYvSqM.esm.js";const h=window.fetch,d={apply:function(n,e,t){return n(...t).then(o=>{if(o.ok){const i=o.clone();window.dispatchEvent(new r({url:t[0].toString(),method:(t[1]?.method||"get").toLowerCase(),type:"fetch",response:i}))}return o})}},s=new Proxy(h,d),a=XMLHttpRequest,p={construct(n,e){const t=new n(...e);return t.addEventListener("load",()=>{window.dispatchEvent(new r({url:(e[1]||"").toString(),method:(e[0]||"get").toLowerCase(),type:"xhr",xhr:t}))}),t}},c=new Proxy(a,p);let w=!1;const u=()=>{w||(window.fetch=s,XMLHttpRequest=c,w=!0)};export{s as fetchProxy,u as initNetworkListeners,c as xhrProxy};
|
|
2
2
|
//# sourceMappingURL=network-listeners.js.map
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_share-dialog-dependencies-Ex1exJdU.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_share-dialog-dependencies-GOqKRBIc.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const t=class b extends CustomEvent{constructor(e){super(b.eventName,{detail:e,bubbles:!0,composed:!0})}};t.eventName="beamnetworkcall";let a=t;const s=class C extends CustomEvent{constructor(e){super(C.eventName,{detail:e,bubbles:!0,composed:!0})}};s.eventName="beamnonprofitselect";let n=s;const o=class E extends CustomEvent{constructor(e){super(E.eventName,{detail:e,bubbles:!0,composed:!0})}};o.eventName="beamcartchange";let r=o;const c=class p extends CustomEvent{constructor(e){super(p.eventName,{detail:e,bubbles:!0,composed:!0})}};c.eventName="beamcartcreated";let m=c;const l=class N extends CustomEvent{constructor(e){super(N.eventName,{detail:e,bubbles:!0,composed:!0})}};l.eventName="beamordercreated";let v=l;const d=class B extends CustomEvent{constructor(e){super(B.eventName,{detail:e,bubbles:!0,composed:!0})}};d.eventName="beamstatuschange";let u=d;var i=Object.freeze({__proto__:null,BeamCartChangeEvent:r,BeamCartCreatedEvent:m,BeamNetworkCallEvent:a,BeamNonprofitSelectEvent:n,BeamOrderCreatedEvent:v,BeamStatusChangeEvent:u});export{u as B,m as a,v as b,n as c,a as d,i as e,r as f};
|
|
2
|
-
//# sourceMappingURL=events-5IECSF-x.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-5AkzIYu3.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{g as e,C as r,L as t,s as a,P as o}from"./order-page-ZyVxKalS.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
|
|
2
|
-
//# sourceMappingURL=index-8VxiCO_y.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-8VxiCO_y.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-9gijHGwh.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-OnjTwvAw.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-U8Oy2aur.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{g as e,C as r,L as t,s as a,P as o}from"./order-page-nKOujF0G.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
|
|
2
|
-
//# sourceMappingURL=index-a9SRo_pt.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-a9SRo_pt.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-fdm0Zxu6.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i}from"./index-wsdeaTHd.esm.js";import{i as o}from"./index-8VxiCO_y.esm.js";import{i as r}from"./index-Z1UUeVXR.esm.js";import{i as e}from"./index-5AkzIYu3.esm.js";import{i as m}from"./index-jYAdXbGg.esm.js";var s=Object.freeze({__proto__:null,Cart:e,Logs:m,Session:r,Shopify:o,Utils:i});export{s as i};
|
|
2
|
-
//# sourceMappingURL=index-gfShfkGQ.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-gfShfkGQ.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-wsdeaTHd.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i}from"./index-OnjTwvAw.esm.js";import{i as o}from"./index-a9SRo_pt.esm.js";import{i as r}from"./index-9YcaEQju.esm.js";import{i as e}from"./index-fdm0Zxu6.esm.js";import{i as m}from"./index-KErjmUlF.esm.js";var s=Object.freeze({__proto__:null,Cart:e,Logs:m,Session:r,Shopify:o,Utils:i});export{s as i};
|
|
2
|
-
//# sourceMappingURL=index-yEHTVDWu.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-yEHTVDWu.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as L}from"./lodash-P8OIs-at.esm.js";import{d as T,f as v,c as O}from"./events-5IECSF-x.esm.js";import{logger as U}from"../utils/logger.js";import{initNetworkListeners as A}from"../utils/network-listeners.js";import{createScopedLocalStorage as _}from"../utils/local-storage.js";import{getCookieValue as w}from"../utils/cookies.js";import{memoizeLast as j}from"../utils/memoize-last.js";import{B as k}from"./cart-contents-h60geKWa.esm.js";import{x as h}from"./update-cart-_cCsAqH9.esm.js";import"../components/post-purchase.js";import{D as J}from"./routes-S3ZS-od_.esm.js";import{waitForElement as x}from"../utils/wait-for-element.js";import{B as K}from"./beam-errors-P-Lu07Ce.esm.js";const E=window.Shopify?.routes?.root||"/";let b=!1;const P="cart";async function R(e){if(b)return!1;const c=await I(e);await h(e,c.cart),A(),window.addEventListener(T.eventName,async i=>{const n=i,o=/cart\/(add|change|update|clear)/,r=n.detail.type==="xhr"?n.detail.xhr.responseURL:n.detail.response.url,m=new URL(r);if(!o.test(m.pathname))return;const a=await I(e);if(!a.changed)return;const p={schema:a.cart.schema,content:{items:a.cart.content.items}};window.dispatchEvent(new v(p)),await h(e,a.cart)});let s,d;return window.addEventListener(O.eventName,async i=>{const n=i,{selectedNonprofitId:o,selectionId:r}=n.detail,m=await w(P),a=await w(k),{chainId:p,storeId:l}=e;s===o&&d===r||(await S({selectedNonprofitId:o,selectionId:r,beamCartId:a,cartId:m,chainId:p,storeId:l}),d=r,s=o)}),b=!0,!0}async function I(e){const{token:c,total_price:s,item_count:d,currency:i,items:n}=await window.fetch(E+"cart.js",{method:"GET",headers:{"Content-Type":"application/json"}}).then(a=>a.json()),o={cartId:c,subtotal:s/100,itemCount:d,currencyCode:i,schema:{source:"generic"},content:{items:n.map(({sku:a,final_line_price:p,product_id:l})=>{const u=a||String(l),f=p/100;return{remoteProductIdentifier:u,localAmount:f}})}};let r=!1;const m=_(e).getItemJson("cart");return L(o,m)||(r=!0),{changed:r,cart:o}}const D=h,S=j(async function({selectedNonprofitId:e,selectionId:c,beamCartId:s,cartId:d,chainId:i,storeId:n}){const o={beam:JSON.stringify({nonprofit_id:e,selection_id:c,beam_cart_id:s,shopify_cart_id:d,chain_id:i,store_id:n})};try{await window.fetch(E+"cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:o})})}catch(r){U.error(r)}});async function q({parentSelector:e=".step__sections",apiKey:c,baseUrl:s=J,storeId:d,postalCode:i,countryCode:n,orderId:o,email:r,cartTotal:m,cart:a,discountCodes:p,currencyCode:l="USD",domain:u,lang:f="en",debug:N=!1}){const y=document.querySelector(e)||await x(e);if(!y)throw new K(`Timed out waiting for selector '${e}'. Could not render Beam post-purchase widget.`);const g=await w("cart");if(g){const C=_({apiKey:c}),B=C.getItemJson("cart")||{};C.setItemJson("cart",{...B,cartId:g})}const t=document.createElement("beam-post-purchase");t.apiKey=c,t.baseUrl=s,t.storeId=d,t.postalCode=i,t.countryCode=n,t.orderId=String(o),t.email=r,t.cartTotal=m,t.cart=a,t.discountCodes=p,t.currencyCode=l,t.domain=u,t.lang=f,t.debug=N,y.appendChild(t)}export{I as C,R as L,D as P,S as g,q as s};
|
|
2
|
-
//# sourceMappingURL=order-page-ZyVxKalS.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order-page-ZyVxKalS.esm.js","sources":["../../src/integrations/shopify/cart-page.ts","../../src/integrations/shopify/order-page.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport isEqual from \"lodash-es/isEqual\";\nimport { logger, memoizeLast } from \"../../utils\";\nimport { getCookieValue } from \"../../utils/cookies\";\nimport { initNetworkListeners } from \"../../utils/network-listeners\";\nimport { BeamCartChangeEvent, BeamNetworkCallEvent, BeamNonprofitSelectEvent } from \"../../utils/events\";\nimport { createScopedLocalStorage } from \"../../utils/local-storage\";\nimport { BEAM_CART_COOKIE_NAME, TCart, TCartApi, TCartItems } from \"../../shared/cart-contents\";\nimport { BeamCartAPIConfig, updateCart } from \"../cart\";\n\ntype BeamShopifyCartIntegrationConfig = BeamCartAPIConfig & {\n storeId: number; // will be added to cart custom_attributes, and used in cart API call\n chainId?: number; // will be added to cart custom_attributes\n};\n\nconst SHOPIFY_BASE_URL = window.Shopify?.routes?.root || \"/\"; // see window.d.ts\n\nlet isBeamCartIntegrationRegistered = false; // Skip registering event listeners if already set up\n\nconst SHOPIFY_CART_COOKIE_NAME = \"cart\";\n\n/**\n * @main registerCartIntegration - set up event listeners to integrate Beam with Shopify cart\n * @return {boolean} returns true if NEW listeners were created, false if setup was already done\n */\nasync function registerCartIntegration(config: BeamShopifyCartIntegrationConfig) {\n if (isBeamCartIntegrationRegistered) {\n return false; // Do nothing if listeners are already attached\n }\n\n // Handle full-page load, ie, first-time page load and reloads from form submit events\n // This creates a GET to /cart.js\n const currentCart = await getCurrentCart(config);\n await updateCart(config, currentCart.cart);\n\n // Set up event listeners for AJAX events\n initNetworkListeners();\n\n window.addEventListener(BeamNetworkCallEvent.eventName, async (_event: Event) => {\n const event = _event as BeamNetworkCallEvent;\n const cartChangePaths = /cart\\/(add|change|update|clear)/;\n // note: response urls below follow redirects\n const requestUrlStr = event.detail.type === \"xhr\" ? event.detail.xhr.responseURL : event.detail.response.url;\n const url = new URL(requestUrlStr);\n if (!cartChangePaths.test(url.pathname)) {\n return;\n }\n const currentCart = await getCurrentCart(config);\n if (!currentCart.changed) {\n return;\n }\n const eventDetail: TCartApi = {\n schema: currentCart.cart.schema as any, // TS union type can't figure out what variant applies here\n content: {\n items: currentCart.cart.content.items as any,\n },\n };\n window.dispatchEvent(new BeamCartChangeEvent(eventDetail));\n // Send cart to Beam to update timestamp, which is used for cart abandonment / ROI calc\n await updateCart(config, currentCart.cart);\n });\n\n // Listen to Beam's own events to integrate Beam data into Shopify order\n let lastNonprofitId: number | null | undefined;\n let lastSelectionId: string | null | undefined;\n window.addEventListener(BeamNonprofitSelectEvent.eventName, async (_event) => {\n const event = _event as BeamNonprofitSelectEvent;\n const { selectedNonprofitId, selectionId } = event.detail;\n const cartId = await getCookieValue(SHOPIFY_CART_COOKIE_NAME); // Shopify cart ID cookie\n const beamCartId = await getCookieValue(BEAM_CART_COOKIE_NAME); // Beam cart ID cookie\n const { chainId, storeId } = config;\n // Skip update if nothing changed (can happen if widget is re-initialized and\n // emits event after cache restoration, i.e., on cart re-render).\n if (lastNonprofitId === selectedNonprofitId && lastSelectionId === selectionId) {\n return;\n }\n await addBeamAttributesToCart({\n selectedNonprofitId,\n selectionId,\n beamCartId,\n cartId,\n chainId,\n storeId,\n });\n lastSelectionId = selectionId;\n lastNonprofitId = selectedNonprofitId;\n });\n\n isBeamCartIntegrationRegistered = true;\n\n return true;\n}\n\n/* ***************************************** HELPER FUNCTIONS *****************************************\n These may be used individually to integrate with carts if the registerCartIntegration\n script doesn't work for some reason.\n ****************************************************************************************************/\n\n/**\n * Detects change in cart since last page load,\n * by calling GET /cart.js, and returns cart values.\n * Used for:\n * - Form-based carts where the page refreshes to modify cart instead of using AJAX calls\n * - Hydrogen/GraphQL based carts (needs to be integrated manually)\n */\nasync function getCurrentCart(config: BeamShopifyCartIntegrationConfig): Promise<{\n changed: boolean;\n cart: {\n cartId: string;\n subtotal: number;\n itemCount: number;\n currencyCode: string;\n } & TCart;\n}> {\n const {\n token, // equal to \"cart\" cookie\n total_price, // this is the pretax value, after discounts, and multiplied by 100 (integer from decimal)\n item_count,\n currency,\n items,\n } = await window\n .fetch(SHOPIFY_BASE_URL + \"cart.js\", {\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" },\n })\n .then((res) => res.json());\n\n const cart = {\n cartId: token,\n subtotal: total_price / 100,\n itemCount: item_count,\n currencyCode: currency,\n schema: { source: \"generic\" } as const,\n content: {\n // pull out minimal fields from full line items\n items: (items as TCartItems).map(({ sku, final_line_price, product_id }) => {\n const remoteProductIdentifier = sku || String(product_id);\n const localAmount = final_line_price / 100;\n return { remoteProductIdentifier, localAmount };\n }),\n },\n };\n\n let changed = false;\n\n const localStorage = createScopedLocalStorage(config);\n\n const cachedCart = localStorage.getItemJson(\"cart\");\n\n if (!isEqual(cart, cachedCart)) {\n changed = true;\n }\n\n return { changed, cart };\n}\n\n/**\n * trackCart - Backwards-compatible alias for updateCart\n */\nconst trackCart = updateCart;\n\n/**\n * Sends Beam data to Shopify to integrate with order as custom attributes.\n * Memoized so that calls with the same data as the previous don't create additional API calls to Shopify.\n */\nconst addBeamAttributesToCart = memoizeLast(async function addBeamAttributesToCart({\n selectedNonprofitId,\n selectionId,\n beamCartId,\n cartId,\n chainId,\n storeId,\n}: {\n selectedNonprofitId?: number | null;\n selectionId?: string;\n beamCartId?: string;\n cartId?: string;\n chainId?: number;\n storeId?: number;\n}) {\n const beamCartAttrs = {\n beam: JSON.stringify({\n nonprofit_id: selectedNonprofitId,\n selection_id: selectionId,\n beam_cart_id: beamCartId,\n shopify_cart_id: cartId,\n chain_id: chainId,\n store_id: storeId,\n }),\n };\n\n try {\n await window.fetch(SHOPIFY_BASE_URL + \"cart/update.js\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ attributes: beamCartAttrs }),\n });\n } catch (err) {\n logger.error(err); // don't throw, allow later calls to continue\n }\n});\n\nexport { trackCart, getCurrentCart, addBeamAttributesToCart, registerCartIntegration };\n","import \"../../components/post-purchase\";\nimport { postTransaction } from \"../../api-sdk/v3/routes\";\nimport { DEFAULT_BASE_URL } from \"../../api-sdk/constants\";\nimport { LANGUAGES, TUrl } from \"../../api-sdk/types\";\nimport { waitForElement } from \"../../utils/wait-for-element\";\nimport { BeamError } from \"../../utils/beam-errors\";\nimport { getCookieValue } from \"../../utils/cookies\";\nimport { createScopedLocalStorage } from \"../../utils/local-storage\";\nimport { TCart } from \"../../shared/cart-contents\";\n\n// Shopify admin page: admin/settings/checkout\n\nexport type TBeamOrderPageParams = Parameters<typeof postTransaction>[0][\"requestBody\"] & {\n // Either storeId or postalCode + countryCode must be provided\n storeId?: number;\n postalCode?: string;\n countryCode?: string;\n orderId: string;\n email: string;\n cartTotal: number;\n cart: TCart;\n discountCodes: string[];\n currencyCode: string;\n parentSelector: string; // CSS Selector for parent of widget to be inserted into DOM\n apiKey: string;\n baseUrl: TUrl;\n domain?: string; // Base domain for setting cookies\n lang: LANGUAGES;\n debug: boolean;\n};\n\nexport async function showBeamOrderPageWidgets({\n parentSelector = \".step__sections\",\n apiKey,\n baseUrl = DEFAULT_BASE_URL,\n storeId,\n postalCode,\n countryCode,\n orderId,\n email,\n cartTotal,\n cart,\n discountCodes,\n currencyCode = \"USD\",\n domain,\n lang = \"en\",\n debug = false,\n}: TBeamOrderPageParams) {\n const parentElement = document.querySelector(parentSelector) || (await waitForElement(parentSelector));\n if (!parentElement) {\n throw new BeamError(\n `Timed out waiting for selector '${parentSelector}'. Could not render Beam post-purchase widget.`\n );\n }\n\n // If checkout and order page are on different subdomains, we can't access localStorage\n // We can make postTransaction work by copying the cart cookie to the expected localStorage key on the current domain\n const cartId = await getCookieValue(\"cart\"); // Shopify-only cart identifier\n if (cartId) {\n const beamLocalStorage = createScopedLocalStorage({ apiKey });\n const existingValue = beamLocalStorage.getItemJson(\"cart\") || {};\n beamLocalStorage.setItemJson(\"cart\", { ...existingValue, cartId });\n }\n\n // Note: assign properties one by one instead of bulk Object.assign to type check assignments\n const widget = document.createElement(\"beam-post-purchase\");\n widget.apiKey = apiKey;\n widget.baseUrl = baseUrl;\n widget.storeId = storeId;\n widget.postalCode = postalCode;\n widget.countryCode = countryCode;\n widget.orderId = String(orderId);\n widget.email = email;\n widget.cartTotal = cartTotal;\n widget.cart = cart;\n widget.discountCodes = discountCodes;\n widget.currencyCode = currencyCode;\n widget.domain = domain;\n widget.lang = lang;\n widget.debug = debug;\n\n // Insert widget into DOM\n parentElement.appendChild(widget);\n}\n"],"names":["SHOPIFY_BASE_URL","isBeamCartIntegrationRegistered","SHOPIFY_CART_COOKIE_NAME","registerCartIntegration","config","currentCart","getCurrentCart","updateCart","initNetworkListeners","BeamNetworkCallEvent","_event","event","cartChangePaths","requestUrlStr","url","eventDetail","BeamCartChangeEvent","lastNonprofitId","lastSelectionId","BeamNonprofitSelectEvent","selectedNonprofitId","selectionId","cartId","getCookieValue","beamCartId","BEAM_CART_COOKIE_NAME","chainId","storeId","addBeamAttributesToCart","token","total_price","item_count","currency","items","res","cart","sku","final_line_price","product_id","remoteProductIdentifier","localAmount","changed","cachedCart","createScopedLocalStorage","isEqual","trackCart","memoizeLast","beamCartAttrs","err","logger","showBeamOrderPageWidgets","parentSelector","apiKey","baseUrl","DEFAULT_BASE_URL","postalCode","countryCode","orderId","email","cartTotal","discountCodes","currencyCode","domain","lang","debug","parentElement","waitForElement","BeamError","beamLocalStorage","existingValue","widget"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as L}from"./lodash-P8OIs-at.esm.js";import{d as T,f as v,c as O}from"./events-5IECSF-x.esm.js";import{logger as U}from"../utils/logger.esm.js";import{initNetworkListeners as A}from"../utils/network-listeners.esm.js";import{createScopedLocalStorage as _}from"../utils/local-storage.esm.js";import{getCookieValue as w}from"../utils/cookies.esm.js";import{memoizeLast as j}from"../utils/memoize-last.esm.js";import{B as k}from"./cart-contents-h60geKWa.esm.js";import{x as h}from"./update-cart-8nDxTnnQ.esm.js";import"../components/post-purchase.esm.js";import{D as J}from"./routes-jQjZhNH9.esm.js";import{waitForElement as x}from"../utils/wait-for-element.esm.js";import{B as K}from"./beam-errors-P-Lu07Ce.esm.js";const E=window.Shopify?.routes?.root||"/";let b=!1;const P="cart";async function R(e){if(b)return!1;const c=await I(e);await h(e,c.cart),A(),window.addEventListener(T.eventName,async i=>{const n=i,o=/cart\/(add|change|update|clear)/,r=n.detail.type==="xhr"?n.detail.xhr.responseURL:n.detail.response.url,m=new URL(r);if(!o.test(m.pathname))return;const a=await I(e);if(!a.changed)return;const p={schema:a.cart.schema,content:{items:a.cart.content.items}};window.dispatchEvent(new v(p)),await h(e,a.cart)});let s,d;return window.addEventListener(O.eventName,async i=>{const n=i,{selectedNonprofitId:o,selectionId:r}=n.detail,m=await w(P),a=await w(k),{chainId:p,storeId:l}=e;s===o&&d===r||(await S({selectedNonprofitId:o,selectionId:r,beamCartId:a,cartId:m,chainId:p,storeId:l}),d=r,s=o)}),b=!0,!0}async function I(e){const{token:c,total_price:s,item_count:d,currency:i,items:n}=await window.fetch(E+"cart.js",{method:"GET",headers:{"Content-Type":"application/json"}}).then(a=>a.json()),o={cartId:c,subtotal:s/100,itemCount:d,currencyCode:i,schema:{source:"generic"},content:{items:n.map(({sku:a,final_line_price:p,product_id:l})=>{const u=a||String(l),f=p/100;return{remoteProductIdentifier:u,localAmount:f}})}};let r=!1;const m=_(e).getItemJson("cart");return L(o,m)||(r=!0),{changed:r,cart:o}}const D=h,S=j(async function({selectedNonprofitId:e,selectionId:c,beamCartId:s,cartId:d,chainId:i,storeId:n}){const o={beam:JSON.stringify({nonprofit_id:e,selection_id:c,beam_cart_id:s,shopify_cart_id:d,chain_id:i,store_id:n})};try{await window.fetch(E+"cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:o})})}catch(r){U.error(r)}});async function q({parentSelector:e=".step__sections",apiKey:c,baseUrl:s=J,storeId:d,postalCode:i,countryCode:n,orderId:o,email:r,cartTotal:m,cart:a,discountCodes:p,currencyCode:l="USD",domain:u,lang:f="en",debug:N=!1}){const y=document.querySelector(e)||await x(e);if(!y)throw new K(`Timed out waiting for selector '${e}'. Could not render Beam post-purchase widget.`);const g=await w("cart");if(g){const C=_({apiKey:c}),B=C.getItemJson("cart")||{};C.setItemJson("cart",{...B,cartId:g})}const t=document.createElement("beam-post-purchase");t.apiKey=c,t.baseUrl=s,t.storeId=d,t.postalCode=i,t.countryCode=n,t.orderId=String(o),t.email=r,t.cartTotal=m,t.cart=a,t.discountCodes=p,t.currencyCode=l,t.domain=u,t.lang=f,t.debug=N,y.appendChild(t)}export{I as C,R as L,D as P,S as g,q as s};
|
|
2
|
-
//# sourceMappingURL=order-page-nKOujF0G.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order-page-nKOujF0G.esm.js","sources":["../../src/integrations/shopify/cart-page.ts","../../src/integrations/shopify/order-page.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport isEqual from \"lodash-es/isEqual\";\nimport { logger, memoizeLast } from \"../../utils\";\nimport { getCookieValue } from \"../../utils/cookies\";\nimport { initNetworkListeners } from \"../../utils/network-listeners\";\nimport { BeamCartChangeEvent, BeamNetworkCallEvent, BeamNonprofitSelectEvent } from \"../../utils/events\";\nimport { createScopedLocalStorage } from \"../../utils/local-storage\";\nimport { BEAM_CART_COOKIE_NAME, TCart, TCartApi, TCartItems } from \"../../shared/cart-contents\";\nimport { BeamCartAPIConfig, updateCart } from \"../cart\";\n\ntype BeamShopifyCartIntegrationConfig = BeamCartAPIConfig & {\n storeId: number; // will be added to cart custom_attributes, and used in cart API call\n chainId?: number; // will be added to cart custom_attributes\n};\n\nconst SHOPIFY_BASE_URL = window.Shopify?.routes?.root || \"/\"; // see window.d.ts\n\nlet isBeamCartIntegrationRegistered = false; // Skip registering event listeners if already set up\n\nconst SHOPIFY_CART_COOKIE_NAME = \"cart\";\n\n/**\n * @main registerCartIntegration - set up event listeners to integrate Beam with Shopify cart\n * @return {boolean} returns true if NEW listeners were created, false if setup was already done\n */\nasync function registerCartIntegration(config: BeamShopifyCartIntegrationConfig) {\n if (isBeamCartIntegrationRegistered) {\n return false; // Do nothing if listeners are already attached\n }\n\n // Handle full-page load, ie, first-time page load and reloads from form submit events\n // This creates a GET to /cart.js\n const currentCart = await getCurrentCart(config);\n await updateCart(config, currentCart.cart);\n\n // Set up event listeners for AJAX events\n initNetworkListeners();\n\n window.addEventListener(BeamNetworkCallEvent.eventName, async (_event: Event) => {\n const event = _event as BeamNetworkCallEvent;\n const cartChangePaths = /cart\\/(add|change|update|clear)/;\n // note: response urls below follow redirects\n const requestUrlStr = event.detail.type === \"xhr\" ? event.detail.xhr.responseURL : event.detail.response.url;\n const url = new URL(requestUrlStr);\n if (!cartChangePaths.test(url.pathname)) {\n return;\n }\n const currentCart = await getCurrentCart(config);\n if (!currentCart.changed) {\n return;\n }\n const eventDetail: TCartApi = {\n schema: currentCart.cart.schema as any, // TS union type can't figure out what variant applies here\n content: {\n items: currentCart.cart.content.items as any,\n },\n };\n window.dispatchEvent(new BeamCartChangeEvent(eventDetail));\n // Send cart to Beam to update timestamp, which is used for cart abandonment / ROI calc\n await updateCart(config, currentCart.cart);\n });\n\n // Listen to Beam's own events to integrate Beam data into Shopify order\n let lastNonprofitId: number | null | undefined;\n let lastSelectionId: string | null | undefined;\n window.addEventListener(BeamNonprofitSelectEvent.eventName, async (_event) => {\n const event = _event as BeamNonprofitSelectEvent;\n const { selectedNonprofitId, selectionId } = event.detail;\n const cartId = await getCookieValue(SHOPIFY_CART_COOKIE_NAME); // Shopify cart ID cookie\n const beamCartId = await getCookieValue(BEAM_CART_COOKIE_NAME); // Beam cart ID cookie\n const { chainId, storeId } = config;\n // Skip update if nothing changed (can happen if widget is re-initialized and\n // emits event after cache restoration, i.e., on cart re-render).\n if (lastNonprofitId === selectedNonprofitId && lastSelectionId === selectionId) {\n return;\n }\n await addBeamAttributesToCart({\n selectedNonprofitId,\n selectionId,\n beamCartId,\n cartId,\n chainId,\n storeId,\n });\n lastSelectionId = selectionId;\n lastNonprofitId = selectedNonprofitId;\n });\n\n isBeamCartIntegrationRegistered = true;\n\n return true;\n}\n\n/* ***************************************** HELPER FUNCTIONS *****************************************\n These may be used individually to integrate with carts if the registerCartIntegration\n script doesn't work for some reason.\n ****************************************************************************************************/\n\n/**\n * Detects change in cart since last page load,\n * by calling GET /cart.js, and returns cart values.\n * Used for:\n * - Form-based carts where the page refreshes to modify cart instead of using AJAX calls\n * - Hydrogen/GraphQL based carts (needs to be integrated manually)\n */\nasync function getCurrentCart(config: BeamShopifyCartIntegrationConfig): Promise<{\n changed: boolean;\n cart: {\n cartId: string;\n subtotal: number;\n itemCount: number;\n currencyCode: string;\n } & TCart;\n}> {\n const {\n token, // equal to \"cart\" cookie\n total_price, // this is the pretax value, after discounts, and multiplied by 100 (integer from decimal)\n item_count,\n currency,\n items,\n } = await window\n .fetch(SHOPIFY_BASE_URL + \"cart.js\", {\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" },\n })\n .then((res) => res.json());\n\n const cart = {\n cartId: token,\n subtotal: total_price / 100,\n itemCount: item_count,\n currencyCode: currency,\n schema: { source: \"generic\" } as const,\n content: {\n // pull out minimal fields from full line items\n items: (items as TCartItems).map(({ sku, final_line_price, product_id }) => {\n const remoteProductIdentifier = sku || String(product_id);\n const localAmount = final_line_price / 100;\n return { remoteProductIdentifier, localAmount };\n }),\n },\n };\n\n let changed = false;\n\n const localStorage = createScopedLocalStorage(config);\n\n const cachedCart = localStorage.getItemJson(\"cart\");\n\n if (!isEqual(cart, cachedCart)) {\n changed = true;\n }\n\n return { changed, cart };\n}\n\n/**\n * trackCart - Backwards-compatible alias for updateCart\n */\nconst trackCart = updateCart;\n\n/**\n * Sends Beam data to Shopify to integrate with order as custom attributes.\n * Memoized so that calls with the same data as the previous don't create additional API calls to Shopify.\n */\nconst addBeamAttributesToCart = memoizeLast(async function addBeamAttributesToCart({\n selectedNonprofitId,\n selectionId,\n beamCartId,\n cartId,\n chainId,\n storeId,\n}: {\n selectedNonprofitId?: number | null;\n selectionId?: string;\n beamCartId?: string;\n cartId?: string;\n chainId?: number;\n storeId?: number;\n}) {\n const beamCartAttrs = {\n beam: JSON.stringify({\n nonprofit_id: selectedNonprofitId,\n selection_id: selectionId,\n beam_cart_id: beamCartId,\n shopify_cart_id: cartId,\n chain_id: chainId,\n store_id: storeId,\n }),\n };\n\n try {\n await window.fetch(SHOPIFY_BASE_URL + \"cart/update.js\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ attributes: beamCartAttrs }),\n });\n } catch (err) {\n logger.error(err); // don't throw, allow later calls to continue\n }\n});\n\nexport { trackCart, getCurrentCart, addBeamAttributesToCart, registerCartIntegration };\n","import \"../../components/post-purchase\";\nimport { postTransaction } from \"../../api-sdk/v3/routes\";\nimport { DEFAULT_BASE_URL } from \"../../api-sdk/constants\";\nimport { LANGUAGES, TUrl } from \"../../api-sdk/types\";\nimport { waitForElement } from \"../../utils/wait-for-element\";\nimport { BeamError } from \"../../utils/beam-errors\";\nimport { getCookieValue } from \"../../utils/cookies\";\nimport { createScopedLocalStorage } from \"../../utils/local-storage\";\nimport { TCart } from \"../../shared/cart-contents\";\n\n// Shopify admin page: admin/settings/checkout\n\nexport type TBeamOrderPageParams = Parameters<typeof postTransaction>[0][\"requestBody\"] & {\n // Either storeId or postalCode + countryCode must be provided\n storeId?: number;\n postalCode?: string;\n countryCode?: string;\n orderId: string;\n email: string;\n cartTotal: number;\n cart: TCart;\n discountCodes: string[];\n currencyCode: string;\n parentSelector: string; // CSS Selector for parent of widget to be inserted into DOM\n apiKey: string;\n baseUrl: TUrl;\n domain?: string; // Base domain for setting cookies\n lang: LANGUAGES;\n debug: boolean;\n};\n\nexport async function showBeamOrderPageWidgets({\n parentSelector = \".step__sections\",\n apiKey,\n baseUrl = DEFAULT_BASE_URL,\n storeId,\n postalCode,\n countryCode,\n orderId,\n email,\n cartTotal,\n cart,\n discountCodes,\n currencyCode = \"USD\",\n domain,\n lang = \"en\",\n debug = false,\n}: TBeamOrderPageParams) {\n const parentElement = document.querySelector(parentSelector) || (await waitForElement(parentSelector));\n if (!parentElement) {\n throw new BeamError(\n `Timed out waiting for selector '${parentSelector}'. Could not render Beam post-purchase widget.`\n );\n }\n\n // If checkout and order page are on different subdomains, we can't access localStorage\n // We can make postTransaction work by copying the cart cookie to the expected localStorage key on the current domain\n const cartId = await getCookieValue(\"cart\"); // Shopify-only cart identifier\n if (cartId) {\n const beamLocalStorage = createScopedLocalStorage({ apiKey });\n const existingValue = beamLocalStorage.getItemJson(\"cart\") || {};\n beamLocalStorage.setItemJson(\"cart\", { ...existingValue, cartId });\n }\n\n // Note: assign properties one by one instead of bulk Object.assign to type check assignments\n const widget = document.createElement(\"beam-post-purchase\");\n widget.apiKey = apiKey;\n widget.baseUrl = baseUrl;\n widget.storeId = storeId;\n widget.postalCode = postalCode;\n widget.countryCode = countryCode;\n widget.orderId = String(orderId);\n widget.email = email;\n widget.cartTotal = cartTotal;\n widget.cart = cart;\n widget.discountCodes = discountCodes;\n widget.currencyCode = currencyCode;\n widget.domain = domain;\n widget.lang = lang;\n widget.debug = debug;\n\n // Insert widget into DOM\n parentElement.appendChild(widget);\n}\n"],"names":["SHOPIFY_BASE_URL","isBeamCartIntegrationRegistered","SHOPIFY_CART_COOKIE_NAME","registerCartIntegration","config","currentCart","getCurrentCart","updateCart","initNetworkListeners","BeamNetworkCallEvent","_event","event","cartChangePaths","requestUrlStr","url","eventDetail","BeamCartChangeEvent","lastNonprofitId","lastSelectionId","BeamNonprofitSelectEvent","selectedNonprofitId","selectionId","cartId","getCookieValue","beamCartId","BEAM_CART_COOKIE_NAME","chainId","storeId","addBeamAttributesToCart","token","total_price","item_count","currency","items","res","cart","sku","final_line_price","product_id","remoteProductIdentifier","localAmount","changed","cachedCart","createScopedLocalStorage","isEqual","trackCart","memoizeLast","beamCartAttrs","err","logger","showBeamOrderPageWidgets","parentSelector","apiKey","baseUrl","DEFAULT_BASE_URL","postalCode","countryCode","orderId","email","cartTotal","discountCodes","currencyCode","domain","lang","debug","parentElement","waitForElement","BeamError","beamLocalStorage","existingValue","widget"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{B as E,N as l}from"./beam-errors-P-Lu07Ce.esm.js";import{logger as p}from"../utils/logger.js";var w="1.37.0",C={"@lit/react":"1.0.0","@lukeed/uuid":"2.0.0","@shoelace-style/shoelace":"2.11.2",lit:"2.6.1","lodash-es":"4.17.21","lucide-static":"0.292.0"};async function O(s,a){const c={method:"GET",...a,headers:{"Content-Type":"application/json",Accept:"application/json","X-Beam-Client":"WebSDK","X-Beam-Client-Version":w,...a?.headers},preflightContinue:!0,mode:a?.mode||"cors",body:a?.body!=null?a.body:void 0};let r;try{r=await fetch(s,c)}catch(e){const o=new E(`Network call failed (${c?.method.toUpperCase()} ${s})`);throw o.cause=e,p.error(o,s),o}let n,i;try{i=await r.text(),i&&(n=JSON.parse(i))}catch(e){let o=e;throw e instanceof SyntaxError&&(o=new l(r,n,`Response invalid. Expected JSON. Received: "${i}"`),o.cause=e),p.error(o),o}if(!r.ok){const e=new l(r,n,"Response was not OK");throw p.error(e),e}return n}const u="https://production-central-backend-ne.beamimpact.com",v="https://production.beamimpactlogs.com",U={en:"en",fr:"fr",de:"de",es:"es",it:"it",pl:"pl"},t=(s,a,c)=>({[s]:async function({headers:r={},baseUrl:n=u,apiRoot:i="/api/v3",pathParams:e={},queryParams:o={},requestBody:m}){const h=Object.entries(e).reduce((g,[y,N])=>g.replace(`{${y}}`,N),s),f=JSON.parse(JSON.stringify(o)),d=new URLSearchParams(f).toString(),S=n+i+h+(d&&`?${d}`),b={headers:r,method:a,body:JSON.stringify(m)};return O(S,b)}})[s],L=t("/impact","get"),R=t("/chain/{chainId}/cumulativeImpact","get"),T=t("/selectNonprofit","post"),k=t("/transaction","post"),A=t("/transaction/{transactionId}","put"),x=t("/cart","post"),B=t("/chain/findEligibleNonprofitsForCart","post"),J=t("/logs","post"),D=t("/experimentSession","post"),F=t("/subscriptions/updateSubscriptionNonprofit","post"),I=t("/subscriptions/findOrCreateSubscription","post");export{u as D,U as S,v as a,k as b,x as c,J as d,B as e,T as f,L as g,I as h,A as i,R as j,C as k,D as p,F as u};
|
|
2
|
-
//# sourceMappingURL=routes-S3ZS-od_.esm.js.map
|