@beamimpact/web-sdk 1.57.5 → 1.58.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.
Files changed (217) hide show
  1. package/dist/chunks/{_share-dialog-dependencies-DsJ2sKCC.esm.js → _share-dialog-dependencies-DPid-O65.esm.js} +2 -2
  2. package/dist/chunks/{_share-dialog-dependencies-DsJ2sKCC.esm.js.map → _share-dialog-dependencies-DPid-O65.esm.js.map} +1 -1
  3. package/dist/chunks/{cart-DKQHSz5X.esm.d.ts → cart-Cm16_NVB.esm.d.ts} +3 -4
  4. package/dist/chunks/{css-card-grid-CiqEjkwR.esm.js → css-card-grid-tjA36yWj.esm.js} +2 -2
  5. package/dist/chunks/{css-card-grid-CiqEjkwR.esm.js.map → css-card-grid-tjA36yWj.esm.js.map} +1 -1
  6. package/dist/chunks/{handlebars-B_i-to-h.esm.js → handlebars-3tRO54kz.esm.js} +7 -7
  7. package/dist/chunks/{handlebars-B_i-to-h.esm.js.map → handlebars-3tRO54kz.esm.js.map} +1 -1
  8. package/dist/chunks/{index-DGOC8m2r.esm.d.ts → index-BG63SUjk.esm.d.ts} +1 -1
  9. package/dist/chunks/index-BiOlmhqL.esm.js +32 -0
  10. package/dist/chunks/index-BiOlmhqL.esm.js.map +1 -0
  11. package/dist/chunks/{index-Bi9LFICg.esm.d.ts → index-Bn65er6F.esm.d.ts} +1 -1
  12. package/dist/chunks/index-BygeMtqf.esm.js +2 -0
  13. package/dist/chunks/{index-BaAhcyM6.esm.js.map → index-BygeMtqf.esm.js.map} +1 -1
  14. package/dist/chunks/{index-BebFL9KU.esm.js → index-C8pScO8d.esm.js} +4 -4
  15. package/dist/chunks/index-C8pScO8d.esm.js.map +1 -0
  16. package/dist/chunks/{index-h_-rDiMR.esm.d.ts → index-CSQv0_2I.esm.d.ts} +1 -1
  17. package/dist/chunks/index-CsNyA6Px.esm.js +2 -0
  18. package/dist/chunks/index-CsNyA6Px.esm.js.map +1 -0
  19. package/dist/chunks/index-DnFFgYbT.esm.js +2 -0
  20. package/dist/chunks/index-DnFFgYbT.esm.js.map +1 -0
  21. package/dist/chunks/index-U1QpwjdF.esm.js +32 -0
  22. package/dist/chunks/index-U1QpwjdF.esm.js.map +1 -0
  23. package/dist/chunks/{index-DQ89VjpD.esm.d.ts → index-_M2mg4n1.esm.d.ts} +1 -1
  24. package/dist/chunks/{index-B-QZylCa.esm.js → index-lSPlMuMz.esm.js} +4 -4
  25. package/dist/chunks/index-lSPlMuMz.esm.js.map +1 -0
  26. package/dist/chunks/{index-Beh5bQDw.esm.js → index-tkscjKkq.esm.js} +7 -7
  27. package/dist/chunks/{index-Beh5bQDw.esm.js.map → index-tkscjKkq.esm.js.map} +1 -1
  28. package/dist/chunks/{promo-pill-label-BWPhroK6.esm.js → promo-pill-label-DYR3PZH7.esm.js} +2 -2
  29. package/dist/chunks/{promo-pill-label-BWPhroK6.esm.js.map → promo-pill-label-DYR3PZH7.esm.js.map} +1 -1
  30. package/dist/chunks/{share-button-C-QLknal.esm.js → share-button-CqrSfHAr.esm.js} +2 -2
  31. package/dist/chunks/{share-button-C-QLknal.esm.js.map → share-button-CqrSfHAr.esm.js.map} +1 -1
  32. package/dist/chunks/{share-button-CIP03E7T.esm.js → share-button-DP2wLhmP.esm.js} +2 -2
  33. package/dist/chunks/{share-button-CIP03E7T.esm.js.map → share-button-DP2wLhmP.esm.js.map} +1 -1
  34. package/dist/chunks/statsig-DlszSNOf.esm.js +2 -0
  35. package/dist/chunks/statsig-DlszSNOf.esm.js.map +1 -0
  36. package/dist/chunks/{update-cart-B5Tr9N3V.esm.d.ts → update-cart-uoS0BDZq.esm.d.ts} +1 -1
  37. package/dist/chunks/{utils-BPcZ5h8J.esm.d.ts → utils-DfsVjUY-.esm.d.ts} +1 -0
  38. package/dist/chunks/{utils-C5hmbxa4.esm.js → utils-ly9wMwUO.esm.js} +2 -2
  39. package/dist/chunks/utils-ly9wMwUO.esm.js.map +1 -0
  40. package/dist/components/beam-partner-logos.d.ts +1 -1
  41. package/dist/components/community-impact.d.ts +1 -1
  42. package/dist/components/community-impact.esm.js +1 -1
  43. package/dist/components/community-impact.js +1 -1
  44. package/dist/components/cumulative-impact.d.ts +1 -1
  45. package/dist/components/cumulative-impact.esm.js +1 -1
  46. package/dist/components/cumulative-impact.js +1 -1
  47. package/dist/components/impact-overview.d.ts +1 -1
  48. package/dist/components/impact-overview.esm.js +1 -1
  49. package/dist/components/impact-overview.js +1 -1
  50. package/dist/components/index.d.ts +1 -1
  51. package/dist/components/index.esm.js +1 -1
  52. package/dist/components/index.js +1 -1
  53. package/dist/components/post-purchase.d.ts +1 -1
  54. package/dist/components/post-purchase.esm.js +1 -1
  55. package/dist/components/post-purchase.js +1 -1
  56. package/dist/components/product-details-page.d.ts +1 -1
  57. package/dist/components/product-details-page.esm.js +3 -3
  58. package/dist/components/product-details-page.js +3 -3
  59. package/dist/components/redeem-transaction.d.ts +1 -1
  60. package/dist/components/redeem-transaction.esm.js +1 -1
  61. package/dist/components/redeem-transaction.js +1 -1
  62. package/dist/components/select-nonprofit.d.ts +1 -1
  63. package/dist/components/select-nonprofit.esm.js +25 -27
  64. package/dist/components/select-nonprofit.esm.js.map +1 -1
  65. package/dist/components/select-nonprofit.js +25 -27
  66. package/dist/components/select-nonprofit.js.map +1 -1
  67. package/dist/components/select-subscription-nonprofit.d.ts +1 -1
  68. package/dist/components/select-subscription-nonprofit.esm.js +2 -2
  69. package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
  70. package/dist/components/select-subscription-nonprofit.js +2 -2
  71. package/dist/components/select-subscription-nonprofit.js.map +1 -1
  72. package/dist/components/shopify.d.ts +4 -4
  73. package/dist/components/shopify.esm.js +1 -1
  74. package/dist/components/shopify.esm.js.map +1 -1
  75. package/dist/components/shopify.js +1 -1
  76. package/dist/components/shopify.js.map +1 -1
  77. package/dist/components/social-share.d.ts +1 -1
  78. package/dist/components/social-share.esm.js +1 -1
  79. package/dist/components/social-share.js +1 -1
  80. package/dist/components/subscriber-select-nonprofit.d.ts +1 -1
  81. package/dist/components/subscriber-select-nonprofit.esm.js +4 -4
  82. package/dist/components/subscriber-select-nonprofit.esm.js.map +1 -1
  83. package/dist/components/subscriber-select-nonprofit.js +4 -4
  84. package/dist/components/subscriber-select-nonprofit.js.map +1 -1
  85. package/dist/components/subscription-impact.d.ts +1 -1
  86. package/dist/components/subscription-impact.esm.js +1 -1
  87. package/dist/components/subscription-impact.js +1 -1
  88. package/dist/components/subscription-management.d.ts +1 -1
  89. package/dist/components/subscription-management.esm.js +1 -1
  90. package/dist/components/subscription-management.esm.js.map +1 -1
  91. package/dist/components/subscription-management.js +1 -1
  92. package/dist/components/subscription-management.js.map +1 -1
  93. package/dist/index.d.ts +7 -7
  94. package/dist/index.esm.js +1 -1
  95. package/dist/index.js +1 -1
  96. package/dist/integrations/beam.d.ts +1 -1
  97. package/dist/integrations/beam.esm.js +1 -1
  98. package/dist/integrations/beam.js +1 -1
  99. package/dist/integrations/cart.d.ts +2 -2
  100. package/dist/integrations/cart.esm.js +1 -1
  101. package/dist/integrations/cart.js +1 -1
  102. package/dist/integrations/logs.d.ts +2 -2
  103. package/dist/integrations/logs.esm.js +1 -1
  104. package/dist/integrations/logs.js +1 -1
  105. package/dist/integrations/promoManager.d.ts +1 -1
  106. package/dist/integrations/promoManager.esm.js +1 -1
  107. package/dist/integrations/promoManager.js +1 -1
  108. package/dist/integrations/session.esm.js +1 -1
  109. package/dist/integrations/session.js +1 -1
  110. package/dist/integrations/shopify-order.d.ts +1 -1
  111. package/dist/integrations/shopify-order.esm.js +1 -1
  112. package/dist/integrations/shopify-order.js +1 -1
  113. package/dist/integrations/shopify.d.ts +3 -3
  114. package/dist/integrations/shopify.esm.js +1 -1
  115. package/dist/integrations/shopify.js +1 -1
  116. package/dist/integrations/statsig.d.ts +8 -5
  117. package/dist/integrations/statsig.esm.js +14 -14
  118. package/dist/integrations/statsig.esm.js.map +1 -1
  119. package/dist/integrations/statsig.js +14 -14
  120. package/dist/integrations/statsig.js.map +1 -1
  121. package/dist/integrations/utils.d.ts +1 -1
  122. package/dist/integrations/utils.esm.js +1 -1
  123. package/dist/integrations/utils.js +1 -1
  124. package/dist/react/beam-partner-logos.d.ts +1 -1
  125. package/dist/react/community-impact.d.ts +1 -1
  126. package/dist/react/community-impact.esm.js +1 -1
  127. package/dist/react/community-impact.js +1 -1
  128. package/dist/react/cumulative-impact.d.ts +1 -1
  129. package/dist/react/cumulative-impact.esm.js +1 -1
  130. package/dist/react/cumulative-impact.js +1 -1
  131. package/dist/react/impact-overview.d.ts +1 -1
  132. package/dist/react/impact-overview.esm.js +1 -1
  133. package/dist/react/impact-overview.js +1 -1
  134. package/dist/react/index.d.ts +1 -1
  135. package/dist/react/index.esm.js +1 -1
  136. package/dist/react/index.js +1 -1
  137. package/dist/react/post-purchase.d.ts +1 -1
  138. package/dist/react/post-purchase.esm.js +1 -1
  139. package/dist/react/post-purchase.js +1 -1
  140. package/dist/react/product-details-page.d.ts +1 -1
  141. package/dist/react/product-details-page.esm.js +1 -1
  142. package/dist/react/product-details-page.js +1 -1
  143. package/dist/react/redeem-transaction.d.ts +1 -1
  144. package/dist/react/redeem-transaction.esm.js +1 -1
  145. package/dist/react/redeem-transaction.js +1 -1
  146. package/dist/react/select-nonprofit.d.ts +1 -1
  147. package/dist/react/select-nonprofit.esm.js +1 -1
  148. package/dist/react/select-nonprofit.js +1 -1
  149. package/dist/react/select-subscription-nonprofit.d.ts +1 -1
  150. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  151. package/dist/react/select-subscription-nonprofit.js +1 -1
  152. package/dist/react/shopify.esm.js +1 -1
  153. package/dist/react/shopify.esm.js.map +1 -1
  154. package/dist/react/shopify.js +1 -1
  155. package/dist/react/shopify.js.map +1 -1
  156. package/dist/react/social-share.d.ts +1 -1
  157. package/dist/react/social-share.esm.js +1 -1
  158. package/dist/react/social-share.js +1 -1
  159. package/dist/react/subscriber-select-nonprofit.d.ts +1 -1
  160. package/dist/react/subscriber-select-nonprofit.esm.js +1 -1
  161. package/dist/react/subscriber-select-nonprofit.js +1 -1
  162. package/dist/react/subscription-impact.d.ts +1 -1
  163. package/dist/react/subscription-impact.esm.js +1 -1
  164. package/dist/react/subscription-impact.js +1 -1
  165. package/dist/react/subscription-management.d.ts +1 -1
  166. package/dist/react/subscription-management.esm.js +1 -1
  167. package/dist/react/subscription-management.js +1 -1
  168. package/dist/utils/beam-errors.d.ts +1 -1
  169. package/dist/utils/beam-errors.esm.js +1 -1
  170. package/dist/utils/beam-errors.js +1 -1
  171. package/dist/utils/cart.d.ts +1 -1
  172. package/dist/utils/cart.esm.js +1 -1
  173. package/dist/utils/cart.js +1 -1
  174. package/dist/utils/clear-beam-storage.d.ts +1 -1
  175. package/dist/utils/clear-beam-storage.esm.js +1 -1
  176. package/dist/utils/clear-beam-storage.js +1 -1
  177. package/dist/utils/cookies.d.ts +1 -1
  178. package/dist/utils/cookies.esm.js +1 -1
  179. package/dist/utils/cookies.js +1 -1
  180. package/dist/utils/events.d.ts +1 -1
  181. package/dist/utils/events.esm.js +1 -1
  182. package/dist/utils/events.js +1 -1
  183. package/dist/utils/local-storage.d.ts +1 -1
  184. package/dist/utils/local-storage.esm.js +1 -1
  185. package/dist/utils/local-storage.js +1 -1
  186. package/dist/utils/logger.d.ts +1 -1
  187. package/dist/utils/logger.esm.js +1 -1
  188. package/dist/utils/logger.js +1 -1
  189. package/dist/utils/makeApiKeyHeader.d.ts +1 -1
  190. package/dist/utils/makeApiKeyHeader.esm.js +1 -1
  191. package/dist/utils/makeApiKeyHeader.js +1 -1
  192. package/dist/utils/memoize-last.d.ts +1 -1
  193. package/dist/utils/memoize-last.esm.js +1 -1
  194. package/dist/utils/memoize-last.js +1 -1
  195. package/dist/utils/network-listeners.d.ts +1 -1
  196. package/dist/utils/network-listeners.esm.js +1 -1
  197. package/dist/utils/network-listeners.js +1 -1
  198. package/dist/utils/promoManager.d.ts +1 -1
  199. package/dist/utils/promoManager.esm.js +1 -1
  200. package/dist/utils/promoManager.js +1 -1
  201. package/dist/utils/remote-session.d.ts +1 -1
  202. package/dist/utils/remote-session.esm.js +1 -1
  203. package/dist/utils/remote-session.js +1 -1
  204. package/dist/utils/wait-for-element.d.ts +1 -1
  205. package/dist/utils/wait-for-element.esm.js +1 -1
  206. package/dist/utils/wait-for-element.js +1 -1
  207. package/package.json +2 -1
  208. package/dist/chunks/index-B-QZylCa.esm.js.map +0 -1
  209. package/dist/chunks/index-B8g4VHgI.esm.js +0 -32
  210. package/dist/chunks/index-B8g4VHgI.esm.js.map +0 -1
  211. package/dist/chunks/index-BX0p4BVY.esm.js +0 -32
  212. package/dist/chunks/index-BX0p4BVY.esm.js.map +0 -1
  213. package/dist/chunks/index-BaAhcyM6.esm.js +0 -2
  214. package/dist/chunks/index-BebFL9KU.esm.js.map +0 -1
  215. package/dist/chunks/index-Duq6tIq8.esm.js +0 -2
  216. package/dist/chunks/index-Duq6tIq8.esm.js.map +0 -1
  217. package/dist/chunks/utils-C5hmbxa4.esm.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import * as lodash from 'lodash';
2
- import { g as BeamBaseAPIConfig, h as TCartApi, M as MemoizedLast } from './utils-BPcZ5h8J.esm.js';
2
+ import { g as BeamBaseAPIConfig, h as TCartApi, M as MemoizedLast } from './utils-DfsVjUY-.esm.js';
3
3
 
4
4
  type BeamCartAPIConfig = BeamBaseAPIConfig & {
5
5
  storeId: number;
@@ -8297,6 +8297,7 @@ type NonprofitSelectDetail = {
8297
8297
  nonprofitName?: string | null;
8298
8298
  source?: WidgetName | null;
8299
8299
  timestamp?: Date;
8300
+ isFirstSelection?: boolean;
8300
8301
  };
8301
8302
  /**
8302
8303
  * beamnonprofitselect
@@ -1,2 +1,2 @@
1
- import{i as L,d as Me}from"./lodash-CrMU6wKg.esm.js";const Ke="https://api.beamimpact.com",Fe="https://production.beamimpactlogs.com",Ue={en:"en",fr:"fr",de:"de",es:"es",it:"it",pl:"pl",ja:"ja"},Je={select_nonprofit:"select-nonprofit",redeem_transaction:"redeem-transaction",impact_overview:"impact-overview",community_impact:"community-impact",cumulative_impact:"cumulative-impact",product_details_page:"product-details-page",subscription_management:"subscription-management",subscription_impact:"subscription-impact",select_subscription_nonprofit:"select-subscription-nonprofit",social_share:"social-share",subscriber_select_nonprofit:"subscriber-select-nonprofit"},De={subscription_management_widget:"subscription_management_widget",subscriber_select_nonprofit_widget:"subscriber_select_nonprofit_widget"},$e={cart_update:"cart_update"},C={TRANSACTION:"transaction",CART:"cart",PROMO:"promos",NONPROFIT:"nonprofit",NONPROFIT_SELECTED_AT:"nonprofit_selected_at",CHAIN_NONPROFITS:"chainNonprofits",REMOTE_SESSION_ID:"remote_session_id"},f={CART:"beam_cart",PROMO_CODES:"beam_promo_codes",SESSION:"beam_session",STATSIG_STABLE_ID:"beam_statsig_session_id"};class l extends Error{constructor(e,{cause:o,name:a="BeamError"}={}){super(e,{cause:o}),this.name=a,this.supportUrl="https://beamimpact.com"}}class R extends l{constructor(e,o,a){super(a,{name:"BeamNetworkError"}),this.response=e,this.body=o}}class x extends l{constructor(e=[],o){super(o,{name:"BeamMissingConfig"}),this.missingConfigKeyNames=e}}class v extends l{constructor(e){super(e,{name:"BeamLocalStorageError"})}}class k extends l{constructor(e){super(e,{name:"BeamSetupError"})}}var T=Object.freeze({__proto__:null,BeamError:l,LocalStorageError:v,MissingConfig:x,NetworkError:R,SetupError:k});const g="\u{1F308} Beam:",d={error:(...t)=>console.error(g,...t),log:(...t)=>console.log(g,...t),warn:(...t)=>console.warn(g,...t),debug:(...t)=>console.debug(g,...t)},M=class he extends CustomEvent{constructor(e){super(he.eventName,{detail:e,bubbles:!0,composed:!0})}};M.eventName="beamnetworkcall";let E=M;const K=class ye extends CustomEvent{constructor(e){super(ye.eventName,{detail:e,bubbles:!0,composed:!0})}};K.eventName="beamnonprofitselect";let F=K;const U=class we extends CustomEvent{constructor(e){super(we.eventName,{detail:e,bubbles:!0,composed:!0})}};U.eventName="beamcartchange";let J=U;const D=class Oe extends CustomEvent{constructor(e){super(Oe.eventName,{detail:e,bubbles:!0,composed:!0})}};D.eventName="beamcartcreated";let $=D;const j=class Ie extends CustomEvent{constructor(e){super(Ie.eventName,{detail:e,bubbles:!0,composed:!0})}};j.eventName="beamordercreated";let q=j;const z=class Ae extends CustomEvent{constructor(e){super(Ae.eventName,{detail:e,bubbles:!0,composed:!0})}};z.eventName="beamstatuschange";let W=z;const G=class Be extends CustomEvent{constructor(e){super(Be.eventName,{detail:e,bubbles:!0,composed:!0})}};G.eventName="beamnonprofitselectionremoved";let H=G;const V=class Le extends CustomEvent{constructor(e){super(Le.eventName,{detail:e,bubbles:!0,composed:!0})}};V.eventName="beampromocodesstored";let X=V;const Y=class Re extends CustomEvent{constructor(e){super(Re.eventName,{detail:e,bubbles:!0,composed:!0})}};Y.eventName="beamwidgetstoredpromocodes";let Q=Y;const Z=class xe extends CustomEvent{constructor(e){super(xe.eventName,{detail:e,bubbles:!0,composed:!0})}};Z.eventName="beamwidgetinitialnonprofitsync";let ee=Z;const te=class ke extends CustomEvent{constructor(e){super(ke.eventName,{detail:e,bubbles:!0,composed:!0})}};te.eventName="beamwidgetinitialnonprofitsynccancel";let oe=te;const re=class Te extends CustomEvent{constructor(e){super(Te.eventName,{detail:e,bubbles:!0,composed:!0})}};re.eventName="beamstatsiginitialized";let ae=re;var se=Object.freeze({__proto__:null,BeamCartChangeEvent:J,BeamCartCreatedEvent:$,BeamNetworkCallEvent:E,BeamNonprofitSelectEvent:F,BeamNonprofitSelectionRemovedEvent:H,BeamOrderCreatedEvent:q,BeamPromoCodesStoredEvent:X,BeamStatsigInitializedEvent:ae,BeamStatusChangeEvent:W,BeamWidgetInitialNonprofitSyncCancelEvent:oe,BeamWidgetInitialNonprofitSyncEvent:ee,BeamWidgetStoredPromoCodesEvent:Q});const je={apply:function(t,e,o){return t(...o).then(a=>{if(a.ok&&S){const r=a.clone();window.dispatchEvent(new E({url:o[0].toString(),method:(o[1]?.method||"get").toLowerCase(),type:"fetch",response:r}))}return a})}},qe={construct(t,e){const o=new t(...e),a=o.open;let r,s;return o.open=function(n,i){r=n,s=i,a.apply(this,arguments)},o.addEventListener("load",()=>{S&&window.dispatchEvent(new E({url:(s||"").toString(),method:(r||"get").toLowerCase(),type:"xhr",xhr:o}))}),o}};let ne=!1,S=!1;const ie=()=>{S=!0,!ne&&(window.fetch=new Proxy(window.fetch,je),XMLHttpRequest=new Proxy(XMLHttpRequest,qe),ne=!0)},me=()=>{S=!1},c=t=>({get prefix(){return"beam_"},get postfix(){return`_key_${t.apiKey}`},getItem(e){return localStorage.getItem(this.prefix+e+this.postfix)},setItem(e,o){return localStorage.setItem(this.prefix+e+this.postfix,`${o}`)},removeItem(e){return localStorage.removeItem(this.prefix+e+this.postfix)},getItemJson(e){try{const o=this.getItem(e);if(o)return JSON.parse(o)}catch{d.error(new v(`Could not parse JSON: ${e}`))}return null},setItemJson(e,o){return this.setItem(e,JSON.stringify(o))}});function ce(t,{timeout:e=1e4}={}){return new Promise((o,a)=>{let r=document.querySelector(t);if(r){o(r);return}let s;const n=setTimeout(()=>{r||(s?.disconnect(),a(new l(`Timed out waiting for '${t}'`)))},e);new MutationObserver((i,m)=>{s=m,Array.from(document.querySelectorAll(t)).forEach(u=>{r=u,o(u),m.disconnect(),clearTimeout(n)})}).observe(document.documentElement,{childList:!0,subtree:!0})})}const P=(t=document.cookie)=>t.split(";").reduce((e,o)=>{const a=o.trim(),[r,...s]=a.split("="),n=decodeURIComponent(s.join("="));return e.set(r,n)},new Map),p=t=>P().get(t),b=t=>{const{name:e,value:o,expires:a,...r}=t,s=encodeURIComponent(o),n=`${e}=${s}`,i=a!=null?` ;expires=${new Date(a).toUTCString()}`:"",m=Object.entries(r).map(([u,B])=>B!=null?` ;${u}=${B}`:"").join("");document.cookie=n+m+i},_=t=>{const{name:e,domain:o,path:a}=t,r={name:e,value:"",expires:0};return a!==void 0&&(r.path=a),o!==void 0&&(r.domain=o),b(r)},de=C.REMOTE_SESSION_ID;function le({remoteSessionId:t,apiKey:e=""}){c({apiKey:e}).setItem(de,t)}function ue({apiKey:t=""}){return c({apiKey:t}).getItem(de)}function pe(t,{isEqual:e=L}={}){let o=null,a=null,r=!1,s=0;const n=(...i)=>{if(r&&e(o,i))return a;const m=t(...i);if(m instanceof Promise){s++;const u=s;m.catch(()=>{u===s&&(r=!1)})}return o=i,a=m,r=!0,m};return n.reset=()=>{s++,o=null,a=null,r=!1},n}var N=(t=>(t.Manual="manual",t.Url="url",t))(N||{});const h=C.PROMO,y=f.PROMO_CODES,ze=100,We="utm_",Ge="discount_code",ve=()=>{const t=p(y);if(t)try{return JSON.parse(t)}catch(e){d.error("Failed to parse beam_promo_codes cookie:",e);return}},Ce=({validatedPromoCodes:t,domain:e})=>{const o={validatedPromoCodes:t},a=Date.now()+1e3*60*60*24*90;b({name:y,value:JSON.stringify(o),path:"/",domain:e,expires:a})},w=({apiKey:t})=>t?c({apiKey:t}).getItemJson(h)??{unvalidatedPromoCodes:[],validatedPromoCodes:[]}:(d.error(new v("API key is required to get promo codes")),null),O=({apiKey:t,promoCodes:e})=>{if(!t){d.error(new v("API key is required to set promo codes"));return}const o=c({apiKey:t}),a={unvalidatedPromoCodes:e?.unvalidatedPromoCodes||[],validatedPromoCodes:e?.validatedPromoCodes||[]};o.setItemJson(h,a)},I=({newPromos:t,apiKey:e})=>{const o=w({apiKey:e})??{unvalidatedPromoCodes:[],validatedPromoCodes:[]},a=(t?.unvalidatedPromoCodes||[]).filter(s=>!o.unvalidatedPromoCodes.some(n=>JSON.stringify(n)===JSON.stringify(s))),r={unvalidatedPromoCodes:[...o.unvalidatedPromoCodes,...a],validatedPromoCodes:[...o.validatedPromoCodes,...t?.validatedPromoCodes||[]]};return(r.unvalidatedPromoCodes.length>0||r.validatedPromoCodes.length>0)&&O({apiKey:e,promoCodes:r}),{...r}},A=t=>t.reduce((e,o)=>{const a=e||[];return o.url?a.push({type:N.Url,attributes:{url:o.url}}):o.value?a.push({type:N.Manual,attributes:{value:o.value}}):d.error("Invalid PromoAttribute - must contain either 'url' or 'value'",{attr:o}),a},[]),ge=(t,e)=>{const o=A(t);return I({newPromos:{unvalidatedPromoCodes:o},apiKey:e})},Ee=t=>{if(!t?.content)return[];const e=t.content.discounts?.filter(r=>r.applicable)?.map(r=>r.code)||[],o=t.content.items?.flatMap(r=>r.discounts?.filter(s=>s.applicable)?.map(s=>s.code)||[])||[],a=[...e,...o];return[...new Set(a)]},Se=()=>p(Ge)??null,be=t=>{if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)&&e.every(o=>typeof o=="string")?e:[]}catch(e){return d.error("Failed to parse JSON:",e),[]}},fe=()=>{try{const t=new URL(window.location.href);if(!t.search)return;const e=new URL(t.origin+t.pathname);let o=!1;t.searchParams.forEach((r,s)=>{const n=s.startsWith(We),i=r.length<=ze;n&&i&&(e.searchParams.append(s,r),o=!0)});const a=e.toString();return o?{url:a}:void 0}catch{return}},Pe=(t,e)=>{const o=a=>(Array.isArray(a)?a:[]).map(r=>r.type==="manual"?r.attributes?.value:r.type==="url"?r.attributes?.url:"").filter(Boolean).sort().join(",");return o(t?.unvalidatedPromoCodes)===o(e?.unvalidatedPromoCodes)},_e=t=>(!t.unvalidatedPromoCodes||t.unvalidatedPromoCodes.length===0)&&(!t.validatedPromoCodes||t.validatedPromoCodes.length===0);function Ne(t){const e=c(t);Object.values(C).forEach(o=>e.removeItem(o)),Object.values(f).forEach(o=>_({name:o,domain:t.domain,path:"/"}))}var He=Object.freeze({__proto__:null,clearBeamStorage:Ne,createScopedLocalStorage:c,debounce:Me,deleteCookieValue:_,errors:T,events:se,formatStoreAndReturnPromoCodes:ge,getAllPromoCodesFromCookie:ve,getCookieMap:P,getCookieValue:p,getPromoCodeFromShopifyCookie:Se,getPromoCodesFromCart:Ee,getPromoCodesLocalStorage:w,getRemoteSession:ue,getSanitizedUrlForStorage:fe,initNetworkListeners:ie,isEmptyPromoData:_e,isEqual:L,logger:d,mapToUnvalidatedPromoCodes:A,memoizeLast:pe,mergeStoreAndReturnPromos:I,parseJsonStringArray:be,promoCodesAreEqual:Pe,saveRemoteSession:le,setCookieValue:b,setPromoCodeInCookie:Ce,setPromoCodesInLocalStorage:O,teardownNetworkListeners:me,waitForElement:ce});const Ve=(t,e)=>c(e).getItemJson("cart")?.beamCartId??p(t)??null,Xe=(t,e)=>c(e).getItemJson("cart")?.cartId??p(t)??null;function Ye(t){return{authorization:`Api-Key ${t}`}}export{A as $,Ve as A,F as B,_e as C,Ke as D,Q as E,be as F,Ee as G,O as H,Ce as I,Xe as J,H as K,C as L,ee as M,oe as N,J as O,x as P,pe as Q,ue as R,k as S,$e as T,E as U,Ne as V,Je as W,me as X,_ as Y,T as Z,ve as _,P as a,I as a0,h as a1,y as a2,R as a3,v as a4,ie as b,W as c,Fe as d,se as e,w as f,p as g,ge as h,He as i,fe as j,Se as k,d as l,X as m,l as n,b as o,Pe as p,f as q,ae as r,le as s,$ as t,q as u,Ue as v,ce as w,Ye as x,De as y,c as z};
2
- //# sourceMappingURL=utils-C5hmbxa4.esm.js.map
1
+ import{i as L,d as Me}from"./lodash-CrMU6wKg.esm.js";const Ke="https://api.beamimpact.com",Fe="https://production.beamimpactlogs.com",Ue={en:"en",fr:"fr",de:"de",es:"es",it:"it",pl:"pl",ja:"ja"},Je={select_nonprofit:"select-nonprofit",redeem_transaction:"redeem-transaction",impact_overview:"impact-overview",community_impact:"community-impact",cumulative_impact:"cumulative-impact",product_details_page:"product-details-page",subscription_management:"subscription-management",subscription_impact:"subscription-impact",select_subscription_nonprofit:"select-subscription-nonprofit",social_share:"social-share",subscriber_select_nonprofit:"subscriber-select-nonprofit"},De={subscription_management_widget:"subscription_management_widget",subscriber_select_nonprofit_widget:"subscriber_select_nonprofit_widget"},$e={cart_update:"cart_update"},C={TRANSACTION:"transaction",CART:"cart",PROMO:"promos",NONPROFIT:"nonprofit",NONPROFIT_SELECTED_AT:"nonprofit_selected_at",CHAIN_NONPROFITS:"chainNonprofits",REMOTE_SESSION_ID:"remote_session_id"},f={CART:"beam_cart",PROMO_CODES:"beam_promo_codes",SESSION:"beam_session",STATSIG_STABLE_ID:"beam_statsig_session_id"};class l extends Error{constructor(e,{cause:o,name:a="BeamError"}={}){super(e,{cause:o}),this.name=a,this.supportUrl="https://beamimpact.com"}}class R extends l{constructor(e,o,a){super(a,{name:"BeamNetworkError"}),this.response=e,this.body=o}}class x extends l{constructor(e=[],o){super(o,{name:"BeamMissingConfig"}),this.missingConfigKeyNames=e}}class v extends l{constructor(e){super(e,{name:"BeamLocalStorageError"})}}class k extends l{constructor(e){super(e,{name:"BeamSetupError"})}}var T=Object.freeze({__proto__:null,BeamError:l,LocalStorageError:v,MissingConfig:x,NetworkError:R,SetupError:k});const g="\u{1F308} Beam:",d={error:(...t)=>console.error(g,...t),log:(...t)=>console.log(g,...t),warn:(...t)=>console.warn(g,...t),debug:(...t)=>console.debug(g,...t)},M=class he extends CustomEvent{constructor(e){super(he.eventName,{detail:e,bubbles:!0,composed:!0})}};M.eventName="beamnetworkcall";let E=M;const K=class ye extends CustomEvent{constructor(e){super(ye.eventName,{detail:e,bubbles:!0,composed:!0})}};K.eventName="beamnonprofitselect";let F=K;const U=class we extends CustomEvent{constructor(e){super(we.eventName,{detail:e,bubbles:!0,composed:!0})}};U.eventName="beamcartchange";let J=U;const D=class Oe extends CustomEvent{constructor(e){super(Oe.eventName,{detail:e,bubbles:!0,composed:!0})}};D.eventName="beamcartcreated";let $=D;const j=class Ie extends CustomEvent{constructor(e){super(Ie.eventName,{detail:e,bubbles:!0,composed:!0})}};j.eventName="beamordercreated";let q=j;const z=class Ae extends CustomEvent{constructor(e){super(Ae.eventName,{detail:e,bubbles:!0,composed:!0})}};z.eventName="beamstatuschange";let W=z;const G=class Be extends CustomEvent{constructor(e){super(Be.eventName,{detail:e,bubbles:!0,composed:!0})}};G.eventName="beamnonprofitselectionremoved";let H=G;const V=class Le extends CustomEvent{constructor(e){super(Le.eventName,{detail:e,bubbles:!0,composed:!0})}};V.eventName="beampromocodesstored";let X=V;const Y=class Re extends CustomEvent{constructor(e){super(Re.eventName,{detail:e,bubbles:!0,composed:!0})}};Y.eventName="beamwidgetstoredpromocodes";let Q=Y;const Z=class xe extends CustomEvent{constructor(e){super(xe.eventName,{detail:e,bubbles:!0,composed:!0})}};Z.eventName="beamwidgetinitialnonprofitsync";let ee=Z;const te=class ke extends CustomEvent{constructor(e){super(ke.eventName,{detail:e,bubbles:!0,composed:!0})}};te.eventName="beamwidgetinitialnonprofitsynccancel";let oe=te;const re=class Te extends CustomEvent{constructor(e){super(Te.eventName,{detail:e,bubbles:!0,composed:!0})}};re.eventName="beamstatsiginitialized";let ae=re;var se=Object.freeze({__proto__:null,BeamCartChangeEvent:J,BeamCartCreatedEvent:$,BeamNetworkCallEvent:E,BeamNonprofitSelectEvent:F,BeamNonprofitSelectionRemovedEvent:H,BeamOrderCreatedEvent:q,BeamPromoCodesStoredEvent:X,BeamStatsigInitializedEvent:ae,BeamStatusChangeEvent:W,BeamWidgetInitialNonprofitSyncCancelEvent:oe,BeamWidgetInitialNonprofitSyncEvent:ee,BeamWidgetStoredPromoCodesEvent:Q});const je={apply:function(t,e,o){return t(...o).then(a=>{if(a.ok&&S){const r=a.clone();window.dispatchEvent(new E({url:o[0].toString(),method:(o[1]?.method||"get").toLowerCase(),type:"fetch",response:r}))}return a})}},qe={construct(t,e){const o=new t(...e),a=o.open;let r,s;return o.open=function(n,i){r=n,s=i,a.apply(this,arguments)},o.addEventListener("load",()=>{S&&window.dispatchEvent(new E({url:(s||"").toString(),method:(r||"get").toLowerCase(),type:"xhr",xhr:o}))}),o}};let ne=!1,S=!1;const ie=()=>{S=!0,!ne&&(window.fetch=new Proxy(window.fetch,je),XMLHttpRequest=new Proxy(XMLHttpRequest,qe),ne=!0)},me=()=>{S=!1},c=t=>({get prefix(){return"beam_"},get postfix(){return`_key_${t.apiKey}`},getItem(e){return localStorage.getItem(this.prefix+e+this.postfix)},setItem(e,o){return localStorage.setItem(this.prefix+e+this.postfix,`${o}`)},removeItem(e){return localStorage.removeItem(this.prefix+e+this.postfix)},getItemJson(e){try{const o=this.getItem(e);if(o)return JSON.parse(o)}catch{d.error(new v(`Could not parse JSON: ${e}`))}return null},setItemJson(e,o){return this.setItem(e,JSON.stringify(o))}});function ce(t,{timeout:e=1e4}={}){return new Promise((o,a)=>{let r=document.querySelector(t);if(r){o(r);return}let s;const n=setTimeout(()=>{r||(s?.disconnect(),a(new l(`Timed out waiting for '${t}'`)))},e);new MutationObserver((i,m)=>{s=m,Array.from(document.querySelectorAll(t)).forEach(u=>{r=u,o(u),m.disconnect(),clearTimeout(n)})}).observe(document.documentElement,{childList:!0,subtree:!0})})}const P=(t=document.cookie)=>t.split(";").reduce((e,o)=>{const a=o.trim(),[r,...s]=a.split("="),n=decodeURIComponent(s.join("="));return e.set(r,n)},new Map),p=t=>P().get(t),b=t=>{const{name:e,value:o,expires:a,...r}=t,s=encodeURIComponent(o),n=`${e}=${s}`,i=a!=null?` ;expires=${new Date(a).toUTCString()}`:"",m=Object.entries(r).map(([u,B])=>B!=null?` ;${u}=${B}`:"").join("");document.cookie=n+m+i},_=t=>{const{name:e,domain:o,path:a}=t,r={name:e,value:"",expires:0};return a!==void 0&&(r.path=a),o!==void 0&&(r.domain=o),b(r)},de=C.REMOTE_SESSION_ID;function le({remoteSessionId:t,apiKey:e=""}){c({apiKey:e}).setItem(de,t)}function ue({apiKey:t=""}){return c({apiKey:t}).getItem(de)}function pe(t,{isEqual:e=L}={}){let o=null,a=null,r=!1,s=0;const n=(...i)=>{if(r&&e(o,i))return a;const m=t(...i);if(m instanceof Promise){s++;const u=s;m.catch(()=>{u===s&&(r=!1)})}return o=i,a=m,r=!0,m};return n.reset=()=>{s++,o=null,a=null,r=!1},n}var N=(t=>(t.Manual="manual",t.Url="url",t))(N||{});const h=C.PROMO,y=f.PROMO_CODES,ze=100,We="utm_",Ge="discount_code",ve=()=>{const t=p(y);if(t)try{return JSON.parse(t)}catch(e){d.error("Failed to parse beam_promo_codes cookie:",e);return}},Ce=({validatedPromoCodes:t,domain:e})=>{const o={validatedPromoCodes:t},a=Date.now()+1e3*60*60*24*90;b({name:y,value:JSON.stringify(o),path:"/",domain:e,expires:a})},w=({apiKey:t})=>t?c({apiKey:t}).getItemJson(h)??{unvalidatedPromoCodes:[],validatedPromoCodes:[]}:(d.error(new v("API key is required to get promo codes")),null),O=({apiKey:t,promoCodes:e})=>{if(!t){d.error(new v("API key is required to set promo codes"));return}const o=c({apiKey:t}),a={unvalidatedPromoCodes:e?.unvalidatedPromoCodes||[],validatedPromoCodes:e?.validatedPromoCodes||[]};o.setItemJson(h,a)},I=({newPromos:t,apiKey:e})=>{const o=w({apiKey:e})??{unvalidatedPromoCodes:[],validatedPromoCodes:[]},a=(t?.unvalidatedPromoCodes||[]).filter(s=>!o.unvalidatedPromoCodes.some(n=>JSON.stringify(n)===JSON.stringify(s))),r={unvalidatedPromoCodes:[...o.unvalidatedPromoCodes,...a],validatedPromoCodes:[...o.validatedPromoCodes,...t?.validatedPromoCodes||[]]};return(r.unvalidatedPromoCodes.length>0||r.validatedPromoCodes.length>0)&&O({apiKey:e,promoCodes:r}),{...r}},A=t=>t.reduce((e,o)=>{const a=e||[];return o.url?a.push({type:N.Url,attributes:{url:o.url}}):o.value?a.push({type:N.Manual,attributes:{value:o.value}}):d.error("Invalid PromoAttribute - must contain either 'url' or 'value'",{attr:o}),a},[]),ge=(t,e)=>{const o=A(t);return I({newPromos:{unvalidatedPromoCodes:o},apiKey:e})},Ee=t=>{if(!t?.content)return[];const e=t.content.discounts?.filter(r=>r.applicable)?.map(r=>r.code)||[],o=t.content.items?.flatMap(r=>r.discounts?.filter(s=>s.applicable)?.map(s=>s.code)||[])||[],a=[...e,...o];return[...new Set(a)]},Se=()=>p(Ge)??null,be=t=>{if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)&&e.every(o=>typeof o=="string")?e:[]}catch(e){return d.error("Failed to parse JSON:",e),[]}},fe=()=>{try{const t=new URL(window.location.href);if(!t.search)return;const e=new URL(t.origin+t.pathname);let o=!1;t.searchParams.forEach((r,s)=>{const n=s.startsWith(We),i=r.length<=ze;n&&i&&(e.searchParams.append(s,r),o=!0)});const a=e.toString();return o?{url:a}:void 0}catch{return}},Pe=(t,e)=>{const o=a=>(Array.isArray(a)?a:[]).map(r=>r.type==="manual"?r.attributes?.value:r.type==="url"?r.attributes?.url:"").filter(Boolean).sort().join(",");return o(t?.unvalidatedPromoCodes)===o(e?.unvalidatedPromoCodes)},_e=t=>(!t.unvalidatedPromoCodes||t.unvalidatedPromoCodes.length===0)&&(!t.validatedPromoCodes||t.validatedPromoCodes.length===0);function Ne(t){const e=c(t);Object.values(C).forEach(o=>e.removeItem(o)),Object.values(f).forEach(o=>_({name:o,domain:t.domain,path:"/"}))}var He=Object.freeze({__proto__:null,clearBeamStorage:Ne,createScopedLocalStorage:c,debounce:Me,deleteCookieValue:_,errors:T,events:se,formatStoreAndReturnPromoCodes:ge,getAllPromoCodesFromCookie:ve,getCookieMap:P,getCookieValue:p,getPromoCodeFromShopifyCookie:Se,getPromoCodesFromCart:Ee,getPromoCodesLocalStorage:w,getRemoteSession:ue,getSanitizedUrlForStorage:fe,initNetworkListeners:ie,isEmptyPromoData:_e,isEqual:L,logger:d,mapToUnvalidatedPromoCodes:A,memoizeLast:pe,mergeStoreAndReturnPromos:I,parseJsonStringArray:be,promoCodesAreEqual:Pe,saveRemoteSession:le,setCookieValue:b,setPromoCodeInCookie:Ce,setPromoCodesInLocalStorage:O,teardownNetworkListeners:me,waitForElement:ce});const Ve=(t,e)=>c(e).getItemJson("cart")?.beamCartId??p(t)??null,Xe=(t,e)=>c(e).getItemJson("cart")?.cartId??p(t)??null;function Ye(t){return{authorization:`Api-Key ${t}`}}export{A as $,c as A,F as B,Ve as C,Ke as D,_e as E,Q as F,be as G,Ee as H,O as I,Ce as J,Xe as K,C as L,H as M,ee as N,oe as O,J as P,x as Q,pe as R,k as S,$e as T,E as U,Ne as V,Je as W,me as X,_ as Y,T as Z,ve as _,P as a,I as a0,h as a1,y as a2,R as a3,v as a4,ie as b,W as c,Fe as d,se as e,w as f,p as g,ge as h,He as i,fe as j,Se as k,d as l,X as m,l as n,b as o,Pe as p,f as q,ae as r,le as s,$ as t,q as u,ue as v,ce as w,Ue as x,Ye as y,De as z};
2
+ //# sourceMappingURL=utils-ly9wMwUO.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-ly9wMwUO.esm.js","sources":["../../src/api-sdk/constants.ts","../../src/utils/beam-errors.ts","../../src/utils/logger.ts","../../src/utils/events.ts","../../src/utils/network-listeners.ts","../../src/utils/local-storage.ts","../../src/utils/wait-for-element.ts","../../src/utils/cookies.ts","../../src/utils/remote-session.ts","../../src/utils/memoize-last.ts","../../src/shared/promo-types.ts","../../src/utils/promoManager.ts","../../src/utils/clear-beam-storage.ts","../../src/utils/cart.ts","../../src/utils/makeApiKeyHeader.ts"],"sourcesContent":["import { LANGUAGES, TUrl } from \"./types\";\n\nexport const DEFAULT_BASE_URL: TUrl = \"https://api.beamimpact.com\";\n\nexport const DEFAULT_LOG_URL = \"https://production.beamimpactlogs.com\";\n\nexport const SUPPORTED_LANGUAGES: Record<string, LANGUAGES> = {\n en: \"en\",\n fr: \"fr\",\n de: \"de\",\n es: \"es\",\n it: \"it\",\n pl: \"pl\",\n ja: \"ja\",\n};\n\nexport const WIDGET_NAMES = {\n select_nonprofit: \"select-nonprofit\",\n redeem_transaction: \"redeem-transaction\",\n impact_overview: \"impact-overview\",\n community_impact: \"community-impact\",\n cumulative_impact: \"cumulative-impact\",\n product_details_page: \"product-details-page\",\n subscription_management: \"subscription-management\",\n subscription_impact: \"subscription-impact\",\n select_subscription_nonprofit: \"select-subscription-nonprofit\",\n social_share: \"social-share\",\n subscriber_select_nonprofit: \"subscriber-select-nonprofit\",\n} as const;\n\nexport const SELECTION_METHODS = {\n dashboard: \"dashboard\",\n remote_order: \"remote_order\",\n checkout: \"checkout\",\n subscription_management_widget: \"subscription_management_widget\",\n subscriber_select_nonprofit_widget: \"subscriber_select_nonprofit_widget\",\n} as const;\n\nexport const HELPER_NAMES = {\n cart_update: \"cart_update\",\n};\n\n/**\n * Every localStorage key this SDK writes.\n */\nexport const LOCAL_STORAGE_KEYS = {\n // Last selection id\n TRANSACTION: \"transaction\",\n // Cached cart snapshot used to detect changes across page loads/tabs\n CART: \"cart\",\n // Stored promo codes captured for the current cart\n PROMO: \"promos\",\n // Last-selected nonprofit id\n NONPROFIT: \"nonprofit\",\n // Timestamp of that nonprofit selection\n NONPROFIT_SELECTED_AT: \"nonprofit_selected_at\",\n // Cached chain nonprofit list\n CHAIN_NONPROFITS: \"chainNonprofits\",\n // Statsig stable id, mirrored into localStorage for cart-linking\n REMOTE_SESSION_ID: \"remote_session_id\",\n} as const;\n\n/**\n * Every cookie this SDK sets, across the cart integration and its sibling integrations.\n */\nexport const BEAM_COOKIE_NAMES = {\n // Beam's own cart id, used to identify the cart across subdomains\n CART: \"beam_cart\",\n // Promo codes captured for the current cart\n PROMO_CODES: \"beam_promo_codes\",\n // Cross-subdomain session id set by the separate Session integration\n SESSION: \"beam_session\",\n // Statsig A/B stable id, cached in a cookie to persist across subdomains\n STATSIG_STABLE_ID: \"beam_statsig_session_id\",\n} as const;\n","export class BeamError extends Error {\n supportUrl: string;\n constructor(msg?: string, { cause, name = \"BeamError\" }: { cause?: any; name?: string } = {}) {\n super(msg, { cause });\n this.name = name;\n this.supportUrl = \"https://beamimpact.com\";\n }\n}\n\nexport class NetworkError extends BeamError {\n /** Fetch Response object with .ok, .status, etc.*/\n response: Response;\n /** If network response included JSON payload, it is parsed and available here */\n body?: Record<string, string>;\n constructor(response: Response, body?: Record<string, string>, msg?: string) {\n super(msg, { name: \"BeamNetworkError\" });\n this.response = response;\n this.body = body;\n }\n}\n\nexport class MissingConfig extends BeamError {\n missingConfigKeyNames: string[];\n constructor(missingConfigKeyNames: string[] = [], msg?: string) {\n super(msg, { name: \"BeamMissingConfig\" });\n this.missingConfigKeyNames = missingConfigKeyNames;\n }\n}\n\nexport class LocalStorageError extends BeamError {\n constructor(msg?: string) {\n super(msg, { name: \"BeamLocalStorageError\" });\n }\n}\n\nexport class SetupError extends BeamError {\n constructor(msg?: string) {\n super(msg, { name: \"BeamSetupError\" });\n }\n}\n","const LOG_PREFIX = \"🌈 Beam:\";\n\n// This may eventually log output to Beam servers, control log verbosity, etc.\n// For now it is an alias of the default JS console\nexport const logger = {\n error: (...args: any[]) => console.error(LOG_PREFIX, ...args),\n log: (...args: any[]) => console.log(LOG_PREFIX, ...args),\n warn: (...args: any[]) => console.warn(LOG_PREFIX, ...args),\n debug: (...args: any[]) => console.debug(LOG_PREFIX, ...args),\n};\n","import { TCartApi } from \"../shared/cart-contents\";\nimport { TPromoCodeRequest } from \"../shared/promo-types\";\nimport { HelperName, TId, WidgetName } from \"../shared/types\";\n\n/* ------------------------------------------------------------------------------------------------------------------ */\n\ntype NetworkEventDetail =\n | { url: string; method: string; type: \"fetch\"; response: Response }\n | { url: string; method: string; type: \"xhr\"; xhr: XMLHttpRequest };\n\n/**\n * beamnetworkcall\n * Emitted by the Beam network listener whenever any API calls are made on the page\n */\nexport class BeamNetworkCallEvent extends CustomEvent<NetworkEventDetail> {\n static eventName = \"beamnetworkcall\" as const;\n constructor(detail: NetworkEventDetail) {\n super(BeamNetworkCallEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\n\ntype NonprofitSelectDetail = {\n selectionId?: string;\n selectedNonprofitId?: number | null;\n nonprofitName?: string | null;\n source?: WidgetName | null;\n timestamp?: Date;\n isFirstSelection?: boolean;\n};\n\n/**\n * beamnonprofitselect\n * Emitted when the end user selects a nonprofit in the Beam widget, and when the previous selection was restored\n * automatically\n */\nexport class BeamNonprofitSelectEvent extends CustomEvent<NonprofitSelectDetail> {\n static eventName = \"beamnonprofitselect\" as const;\n constructor(detail: NonprofitSelectDetail) {\n super(BeamNonprofitSelectEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\n\ntype CartChangeDetail = TCartApi & {\n cartId?: string;\n subtotal?: number;\n itemCount?: number;\n currencyCode?: string;\n};\n\n/**\n * beamcartchange\n * Emitted when Beam detects that cart contents have changed, and when items are added to the cart for the first time\n */\nexport class BeamCartChangeEvent extends CustomEvent<CartChangeDetail> {\n static eventName = \"beamcartchange\" as const;\n constructor(detail: CartChangeDetail) {\n super(BeamCartChangeEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\n\ntype CartCreatedDetail = CartChangeDetail;\n\n/**\n * beamcartcreated\n * Emitted when a cart is created in Beam for the first time, but NOT when the cart is updated\n * Beam's cart expiration rules are used to determine when a returning visit counts as the same cart\n */\nexport class BeamCartCreatedEvent extends CustomEvent<CartCreatedDetail> {\n static eventName = \"beamcartcreated\" as const;\n constructor(detail: CartCreatedDetail) {\n super(BeamCartCreatedEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\n\ntype OrderCreatedDetail = {\n orderId: TId;\n transactionId: TId;\n cartTotal: number;\n currencyCode: string;\n selectionId?: string | null;\n cartId?: string | null;\n beamCartId?: string | null;\n storeId?: number | null;\n postalCode?: string | null;\n countryCode?: string | null;\n remoteSessionId?: string | null;\n transactionNonprofitId?: number | null;\n orderProcessedAt?: string | null;\n};\n\n/**\n * beamordercreated\n * Emitted when an order is registered with Beam for the first time, but NOT on repeat visits, page refreshes, etc.\n */\nexport class BeamOrderCreatedEvent extends CustomEvent<OrderCreatedDetail> {\n static eventName = \"beamordercreated\" as const;\n\n constructor(detail: OrderCreatedDetail) {\n super(BeamOrderCreatedEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\n\n/**\n * beamstatuschange\n * Emitted when the Beam config object has finished initializing along with all plugins\n */\ntype BeamStatusChangeEventDetail = { status: \"pending\" } | { status: \"error\"; error: Error } | { status: \"ready\" };\nexport class BeamStatusChangeEvent extends CustomEvent<BeamStatusChangeEventDetail> {\n static eventName = \"beamstatuschange\" as const;\n\n constructor(detail: BeamStatusChangeEventDetail) {\n super(BeamStatusChangeEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\ntype NonprofitSelectionRemovedDetail = {\n previousNonprofitId?: number | null;\n newNonprofitId?: number | null;\n selectionId?: string;\n timestamp?: Date;\n};\n\n/**\n * beamnonprofitselectionremoved\n * Emitted when the nonprofit selection is removed from deselection or due to nonprofit cohort change\n */\nexport class BeamNonprofitSelectionRemovedEvent extends CustomEvent<NonprofitSelectionRemovedDetail> {\n static eventName = \"beamnonprofitselectionremoved\" as const;\n constructor(detail: NonprofitSelectionRemovedDetail) {\n super(BeamNonprofitSelectionRemovedEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\ntype PromoStoredDetail = {\n promoCodes: TPromoCodeRequest;\n};\n/**\n * Emitted when a URL with query parameters is sanitized and stored in localStorage\n *\n * @event beampromocodesstored\n */\nexport class BeamPromoCodesStoredEvent extends CustomEvent<PromoStoredDetail> {\n static eventName = \"beampromocodesstored\";\n\n constructor(detail: PromoStoredDetail) {\n super(BeamPromoCodesStoredEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\n\ntype WidgetStoredPromosDetail = {\n source?: WidgetName | HelperName | null;\n};\n/**\n * Emitted when a widget stores the url or manual promoCodes in local storage\n *\n * @event beamwidgetstoredpromocodes\n */\nexport class BeamWidgetStoredPromoCodesEvent extends CustomEvent<WidgetStoredPromosDetail> {\n static eventName = \"beamwidgetstoredpromocodes\" as const;\n\n constructor(detail: WidgetStoredPromosDetail) {\n super(BeamWidgetStoredPromoCodesEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\ntype WidgetInitialNonprofitSyncDetail = {\n nonprofitId?: number | null;\n nonprofitIdChanged?: boolean;\n selectionId?: string;\n selectionIdChanged?: boolean;\n};\n\n/**\n * [Shopify Specific] - Emitted the first time a widget restores nonprofit selection from custom attributes\n *\n * @event beamwidgetinitialnonprofitsync\n */\nexport class BeamWidgetInitialNonprofitSyncEvent extends CustomEvent<WidgetInitialNonprofitSyncDetail> {\n static eventName = \"beamwidgetinitialnonprofitsync\" as const;\n\n constructor(detail: WidgetInitialNonprofitSyncDetail) {\n super(BeamWidgetInitialNonprofitSyncEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\ntype BeamWidgetInitialNonprofitSyncCancelDetail = {\n cancelled?: boolean;\n};\n\n/**\n * [Shopify Specific] - Allows WidgetInitialNonprofitSyncDetail to be cancelled asynchronously\n *\n * @event beamwidgetinitialnonprofitsynccancel\n */\nexport class BeamWidgetInitialNonprofitSyncCancelEvent extends CustomEvent<BeamWidgetInitialNonprofitSyncCancelDetail> {\n static eventName = \"beamwidgetinitialnonprofitsynccancel\" as const;\n\n constructor(detail: BeamWidgetInitialNonprofitSyncCancelDetail) {\n super(BeamWidgetInitialNonprofitSyncCancelEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n\n/* ------------------------------------------------------------------------------------------------------------------ */\ntype BeamStatsigInitializedDetail = {\n showBeam: boolean;\n stableId?: string;\n};\n\n/**\n * Fired when Statsig experiment assignments for Beam are initialized\n *\n * @event beamstatsiginitialized\n */\nexport class BeamStatsigInitializedEvent extends CustomEvent<BeamStatsigInitializedDetail> {\n static eventName = \"beamstatsiginitialized\" as const;\n\n constructor(detail: BeamStatsigInitializedDetail) {\n super(BeamStatsigInitializedEvent.eventName, { detail, bubbles: true, composed: true });\n }\n}\n","import { BeamNetworkCallEvent } from \"./events\";\n\n/**\n * Fetch Listener\n */\n\nconst fetchHandler = {\n apply: function (target: any, _thisArg: any, args: any[]) {\n return target(...args).then((response: Response) => {\n if (response.ok && networkListenersEnabled) {\n const responseCopy = response.clone();\n window.dispatchEvent(\n new BeamNetworkCallEvent({\n url: args[0].toString(),\n method: (args[1]?.method || \"get\").toLowerCase(),\n type: \"fetch\",\n response: responseCopy,\n }),\n );\n }\n return response;\n });\n },\n};\n\n/**\n * XMLHTTPRequest Listener\n */\nconst xhrHandler = {\n construct(TargetConstructor: any, args: any[]) {\n const xhr: XMLHttpRequest = new TargetConstructor(...args);\n const _open: (method: string, url: string | URL) => void = xhr.open;\n let _method: string;\n let _url: string | URL;\n\n xhr.open = function (method: string, url: string | URL) {\n _method = method;\n _url = url;\n // @ts-expect-error arguments is untyped since xhr.open is an overloaded method\n // eslint-disable-next-line prefer-rest-params\n _open.apply(this, arguments);\n };\n\n // The enabled flag is checked at dispatch time (inside the load callback),\n // so XHRs constructed before an opt-out also go quiet once torn down.\n xhr.addEventListener(\"load\", () => {\n if (!networkListenersEnabled) return;\n window.dispatchEvent(\n new BeamNetworkCallEvent({\n url: (_url || \"\").toString(),\n method: (_method || \"get\").toLowerCase(),\n type: \"xhr\",\n xhr,\n }),\n );\n });\n\n return xhr;\n },\n};\n\n/**\n * Side-Effects Setup (initialize listeners)\n */\n\nlet initializedListeners = false; // Proxies installed once, ever (never un-patched)\nlet networkListenersEnabled = false; // whether the Proxies currently dispatch Beam events\n\nexport const initNetworkListeners = () => {\n networkListenersEnabled = true;\n\n if (initializedListeners) return; // Proxies already installed; dispatching just re-enabled\n window.fetch = new Proxy(window.fetch, fetchHandler);\n XMLHttpRequest = new Proxy(XMLHttpRequest, xhrHandler);\n initializedListeners = true;\n};\n\n/**\n * Disables Beam event dispatching from the fetch/XHR Proxies without\n * un-patching them (un-patching is unsafe if another script wrapped\n * fetch/XHR after us — restoring our saved reference would remove\n * their wrapper too).\n */\nexport const teardownNetworkListeners = () => {\n networkListenersEnabled = false;\n};\n","import { LocalStorageError } from \"./beam-errors\";\nimport { logger } from \"./logger\";\n\n/**\n * Creates an object that has the same API as normal localStorage, but adds a beam_ prefix and apiKey postfix to keys\n * Also adds helper methods for JSON (de-)serialization\n */\nexport const createScopedLocalStorage = (config: { apiKey: string }) => {\n return {\n get prefix() {\n return `beam_`;\n },\n get postfix() {\n return `_key_${config.apiKey}`;\n },\n getItem(key: string): string | null {\n return localStorage.getItem(this.prefix + key + this.postfix);\n },\n setItem(key: string, value: unknown) {\n return localStorage.setItem(this.prefix + key + this.postfix, `${value}`);\n },\n removeItem(key: string) {\n return localStorage.removeItem(this.prefix + key + this.postfix);\n },\n /** Safely parses value as JSON and return JS object */\n getItemJson<T = Record<string, unknown>>(key: string) {\n try {\n const json = this.getItem(key);\n if (json) {\n return JSON.parse(json) as T;\n }\n } catch (err) {\n logger.error(new LocalStorageError(`Could not parse JSON: ${key}`));\n }\n return null;\n },\n /** Safely stringifies value as JSON */\n setItemJson(key: string, value: object) {\n return this.setItem(key, JSON.stringify(value));\n },\n };\n};\n","// Based on https://gist.github.com/jwilson8767/db379026efcbd932f64382db4b02853e (MIT License, JWilson)\n\nimport { BeamError } from \"./beam-errors\";\n\nexport function waitForElement(selector: string, { timeout = 10000 } = {}): Promise<Element> {\n return new Promise((resolve, reject) => {\n let el = document.querySelector(selector);\n if (el) {\n resolve(el);\n return;\n }\n\n let mutationObserver: MutationObserver;\n\n const timer = setTimeout(() => {\n if (el) return; // no need to reject\n mutationObserver?.disconnect();\n reject(new BeamError(`Timed out waiting for '${selector}'`));\n }, timeout);\n\n new MutationObserver((_mutationRecords, observer) => {\n mutationObserver = observer;\n // Query for elements matching the specified selector\n Array.from(document.querySelectorAll(selector)).forEach((element) => {\n el = element;\n resolve(element);\n // Once we have resolved we don't need the observer anymore.\n observer.disconnect();\n clearTimeout(timer);\n });\n }).observe(document.documentElement, {\n childList: true,\n subtree: true,\n });\n });\n}\n","/*\n * Wrapper functions for CookieStore using document.cookie as a fallback if not supported\n */\n\nexport const getCookieMap = (cookieString = document.cookie) => {\n // document.cookie has the format: \"key1=value1; key2=value2; key3=value3\"\n return cookieString.split(\";\").reduce((result: Map<string, string>, next: string) => {\n const cookieKeyValuePair = next.trim(); // \" key=value \" => \"key=value\"\n const [key, ...restOfString] = cookieKeyValuePair.split(\"=\"); // [\"key\", [\"value\"]]\n const value = decodeURIComponent(restOfString.join(\"=\")); // .join() handles if value contained \"=\"\n return result.set(key, value);\n }, new Map<string, string>());\n};\n\nexport const getCookieValue = (name: string): string | undefined => {\n // New Async API, not supported in FF/Safari:\n // if (window.cookieStore) {\n // return (await window.cookieStore.get(name))?.value;\n // }\n return getCookieMap().get(name);\n};\n\nexport const setCookieValue = (options: CookieInit): undefined => {\n // New Async API, not supported in FF/Safari:\n // if (window.cookieStore) {\n // const { domain, ...rest } = options;\n // const validatedDomain = domain === \"localhost\" ? undefined : domain;\n // return await window.cookieStore.set({ ...rest, domain: validatedDomain });\n // }\n // https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie#write_a_new_cookie\n const { name, value, expires, ...rest } = options;\n const encodedValue = encodeURIComponent(value);\n const base = `${name}=${encodedValue}`;\n const expiration = expires != null ? ` ;expires=${new Date(expires).toUTCString()}` : \"\";\n const modifiers = Object.entries(rest)\n .map(([key, val]) => (val != null ? ` ;${key}=${val}` : \"\"))\n .join(\"\");\n document.cookie = base + modifiers + expiration;\n return;\n};\n\nexport const deleteCookieValue = (options: { name: string; domain?: string; path?: string }): undefined => {\n const { name, domain, path } = options;\n const cookieOptions: any = {\n name: name,\n value: \"\",\n expires: 0,\n };\n if (path !== undefined) {\n cookieOptions.path = path;\n }\n if (domain !== undefined) {\n cookieOptions.domain = domain;\n }\n return setCookieValue(cookieOptions);\n};\n\ninterface CookieInit {\n name: string;\n value: string;\n path?: string;\n domain?: string;\n expires?: number; // timestamp, unix time in ms\n sameSite?: \"strict\" | \"lax\" | \"none\";\n}\n","import { LOCAL_STORAGE_KEYS } from \"../api-sdk/constants\";\nimport { createScopedLocalStorage } from \"./local-storage\";\n\nconst REMOTE_SESSION_ID_KEY = LOCAL_STORAGE_KEYS.REMOTE_SESSION_ID;\n\nexport function saveRemoteSession({ remoteSessionId, apiKey = \"\" }: { remoteSessionId: string; apiKey?: string }) {\n const beamLocalStorage = createScopedLocalStorage({\n apiKey,\n });\n beamLocalStorage.setItem(REMOTE_SESSION_ID_KEY, remoteSessionId);\n}\n\nexport function getRemoteSession({ apiKey = \"\" }: { apiKey?: string }) {\n const beamLocalStorage = createScopedLocalStorage({\n apiKey,\n });\n return beamLocalStorage.getItem(REMOTE_SESSION_ID_KEY);\n}\n","import { isEqual as defaultIsEqual } from \"./is-equal\";\n\ntype Func<T extends any[], R> = (...args: T) => R;\n\n/**\n * Takes a function and returns a new memoized function.\n * If the same arguments are passed to the memoized function, it will return the previously computed result.\n * This is a \"memoize once\" function meaning it only compares the previous and current arguments, not historic values.\n * Results that throw errors or return rejected Promises are not cached.\n *\n * @param {Function} fn - The function to be memoized.\n * @param {(value: any) => boolean} [isEqual]- The equality function used to compare arguments.\n * @returns {Function} - The memoized function.\n * @param func\n */\nexport function memoizeLast<T extends any[], R>(\n func: Func<T, R>,\n { isEqual = defaultIsEqual } = {},\n): MemoizedLast<Func<T, R>> {\n let lastArgs: T | null = null;\n let lastResult: R | null = null;\n let hasResult = false; // Separate variable to track whether lastResult exists because lastResult could be falsy\n let promiseCounter = 0; // Used to keep track of result order in async invocation so we know to replace cache or not\n\n const memoized = (...args: T): R => {\n if (hasResult && isEqual(lastArgs, args)) {\n return lastResult as R;\n }\n\n const result = func(...args); // Errors here are not caught, so result will not cache if there is an error\n\n if (result instanceof Promise) {\n promiseCounter++;\n const promiseCounterAtStart = promiseCounter;\n result.catch(() => {\n // Don't return cached result next time if the Promise rejects, unless a new Promise has already replaced\n // the one that rejected\n if (promiseCounterAtStart === promiseCounter) {\n hasResult = false;\n }\n });\n }\n\n // Cache the latest args and result.\n lastArgs = args;\n lastResult = result;\n hasResult = true;\n\n return result;\n };\n\n memoized.reset = () => {\n // Bump the counter so a rejection from a still-in-flight call can't clear a fresher cache entry\n promiseCounter++;\n lastArgs = null;\n lastResult = null;\n hasResult = false;\n };\n\n return memoized;\n}\n\nexport type MemoizedLast<T extends (...args: any[]) => any> = T & {\n /** Clears the cached args/result so the next call always executes. */\n reset: () => void;\n};\n","import { paths } from \"../api-sdk/openapi-spec\";\nimport { LOCAL_STORAGE_KEYS, BEAM_COOKIE_NAMES } from \"../api-sdk/constants\";\nexport type TPromoCodeRequest =\n paths[\"/productDetailsPage\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"][\"promos\"];\nexport type TUnvalidatedPromoRequest = NonNullable<TPromoCodeRequest>[\"unvalidatedPromoCodes\"];\n\nexport type TPromoCodeAttribute = { value: string; url?: never } | { url: string; value?: never };\n\nexport type TPromoCodeResponse =\n paths[\"/productDetailsPage\"][\"post\"][\"responses\"][\"200\"][\"content\"][\"application/json\"][\"promos\"];\nexport type TValidatedPromoResponse = NonNullable<TPromoCodeResponse>[\"validatedPromoCodes\"];\n\nexport enum PromoCodeSource {\n Manual = \"manual\",\n Url = \"url\",\n}\n\ntype TManualPromoCode = {\n type: \"manual\";\n attributes: { value: string };\n};\n\ntype TUrlPromoCode = {\n type: \"url\";\n attributes: { url: string };\n};\n\nexport type TUnvalidatedPromoCode = TManualPromoCode | TUrlPromoCode;\n\nexport const PROMO_LOCAL_STORAGE_KEY = LOCAL_STORAGE_KEYS.PROMO;\nexport const PROMO_CODES_COOKIE_NAME = BEAM_COOKIE_NAMES.PROMO_CODES;\n","import { Discount, TBeamCartLocalStorage } from \"../shared/cart-contents\";\nimport {\n TPromoCodeAttribute,\n PromoCodeSource,\n TPromoCodeRequest,\n TPromoCodeResponse,\n TValidatedPromoResponse,\n TUnvalidatedPromoRequest,\n PROMO_LOCAL_STORAGE_KEY,\n PROMO_CODES_COOKIE_NAME,\n TUnvalidatedPromoCode,\n} from \"../shared/promo-types\";\nimport { LocalStorageError } from \"./beam-errors\";\nimport { getCookieValue, setCookieValue } from \"./cookies\";\nimport { createScopedLocalStorage } from \"./local-storage\";\nimport { logger } from \"./logger\";\n\nconst URL_QUERY_PARAM_CHAR_LIMIT = 100;\nconst ALLOWED_URL_PREFIX = \"utm_\";\n// Standard name for Shopify's discount tracking cookie\nconst DISCOUNT_CODE_COOKIE_NAME = \"discount_code\";\n// < --------- Cookie ------- >\n\n/**\n * Retrieves all validated promo codes stored in the \"beam_promo_codes\" cookie and parses it\n *\n * @returns {TPromoCodeResponse | undefined} An array of `ValidatedPromoCode` objects if found and parsed successfully, otherwise `undefined`\n */\nexport const getAllPromoCodesFromCookie = (): TPromoCodeResponse | undefined => {\n const promoCodesString = getCookieValue(PROMO_CODES_COOKIE_NAME);\n\n if (!promoCodesString) return undefined;\n\n try {\n const promoCodes: TPromoCodeResponse = JSON.parse(promoCodesString);\n return promoCodes;\n } catch (error) {\n logger.error(\"Failed to parse beam_promo_codes cookie:\", error);\n return undefined;\n }\n};\n\n/**\n * Stores the validated promo codes in the \"beam_promo_codes\" cookie, replaces and does not merge\n *\n * @param {TValidatedPromoResponse} validatedPromoCodes\n * @param {string} domain\n */\nexport const setPromoCodeInCookie = ({\n validatedPromoCodes,\n domain,\n}: {\n validatedPromoCodes: TValidatedPromoResponse;\n domain?: string;\n}) => {\n const promoCodeData = {\n validatedPromoCodes: validatedPromoCodes,\n };\n const threeMonthsFromNow = Date.now() + 1000 * 60 * 60 * 24 * 90;\n\n setCookieValue({\n name: PROMO_CODES_COOKIE_NAME,\n value: JSON.stringify(promoCodeData),\n path: \"/\",\n domain,\n // If we don't set an expiration, the cookie will be cleared when the tab is closed\n expires: threeMonthsFromNow,\n });\n};\n\n// < --------- Local Storage ------- >\n/**\n * Retrieves promo codes from localStorage, scoped by API key\n * @param {string} apiKey API key used for storage scoping\n * @returns {TPromoCodeRequest | null} - Returns stored promo codes object containing both\n * validated and unvalidated codes\n * - If no codes exist, returns a fresh object with empty arrays\n *\n */\nexport const getPromoCodesLocalStorage = ({ apiKey }: { apiKey: string }): TPromoCodeRequest | null => {\n if (!apiKey) {\n logger.error(new LocalStorageError(\"API key is required to get promo codes\"));\n return null;\n }\n\n const storage = createScopedLocalStorage({ apiKey });\n const allPromos = storage.getItemJson<TPromoCodeRequest>(PROMO_LOCAL_STORAGE_KEY) ?? {\n unvalidatedPromoCodes: [],\n validatedPromoCodes: [],\n };\n\n return allPromos;\n};\n\n/**\n * Sets promo codes in localStorage\n * @param {TPromoCodeRequest} promoCodes New promo codes to add\n * @param {string} apiKey API key for storage scoping\n */\nexport const setPromoCodesInLocalStorage = ({\n apiKey,\n promoCodes,\n}: {\n apiKey?: string;\n promoCodes: Partial<TPromoCodeRequest>;\n}): void => {\n if (!apiKey) {\n logger.error(new LocalStorageError(\"API key is required to set promo codes\"));\n return;\n }\n const storage = createScopedLocalStorage({ apiKey });\n const completePromoCodes: TPromoCodeRequest = {\n unvalidatedPromoCodes: promoCodes?.unvalidatedPromoCodes || [],\n validatedPromoCodes: promoCodes?.validatedPromoCodes || [],\n };\n storage.setItemJson(PROMO_LOCAL_STORAGE_KEY, completePromoCodes);\n};\n\n/**\n * Merges new promo codes with existing ones and returns the combined result\n * @param {Partial<TPromoCodeRequest>} newPromos New promo codes to add\n * @param {string} apiKey API key for storage scoping\n * @returns {TPromoCodeRequest} An object containing both validated and unvalidated promo codes\n * @example\n * const result = mergePromoCodes({\n * apiKey: 'beam_123',\n * newPromos: {\n * unvalidatedPromoCodes: [\n * { type: 'manual', attributes: { value: 'WINTER20' } },\n * { type: 'url', attributes: { url: 'www.example.com/?promo=HOLIDAY25' } }\n * ]\n * }\n * });\n */\nexport const mergeStoreAndReturnPromos = ({\n newPromos,\n apiKey,\n}: {\n newPromos: Partial<TPromoCodeRequest>;\n apiKey: string;\n}): TPromoCodeRequest => {\n const existing = getPromoCodesLocalStorage({ apiKey }) ?? {\n unvalidatedPromoCodes: [],\n validatedPromoCodes: [],\n };\n\n const uniqueNewUnvalidatedPromos = (newPromos?.unvalidatedPromoCodes || []).filter((newPromo) => {\n const isDuplicate = existing.unvalidatedPromoCodes.some((existingPromo) => {\n return JSON.stringify(existingPromo) === JSON.stringify(newPromo);\n });\n return !isDuplicate;\n });\n\n const mergedCodes: TPromoCodeRequest = {\n unvalidatedPromoCodes: [...existing.unvalidatedPromoCodes, ...uniqueNewUnvalidatedPromos],\n validatedPromoCodes: [...existing.validatedPromoCodes, ...(newPromos?.validatedPromoCodes || [])],\n };\n\n const shouldStore = mergedCodes.unvalidatedPromoCodes.length > 0 || mergedCodes.validatedPromoCodes.length > 0;\n\n if (shouldStore) {\n setPromoCodesInLocalStorage({ apiKey, promoCodes: mergedCodes });\n }\n return {\n ...mergedCodes,\n };\n};\n\n/**\n * Formats unvalidated promo codes by determining their source and attributes\n * The function will assign `QueryParam` as the source if a `url` exists,\n * otherwise, it will assign `Manual` as the source\n *\n * @param {TPromoCodeAttribute[]} promoAttributes An array of promo attributes to be formatted\n * @returns {TUnvalidatedPromoRequest} - An array of UnvalidatedPromoCode objects,\n * each with a source and attributes object\n */\nexport const mapToUnvalidatedPromoCodes = (promoAttributes: TPromoCodeAttribute[]): TUnvalidatedPromoRequest => {\n return promoAttributes.reduce<TUnvalidatedPromoRequest>((acc, attr) => {\n const result: TUnvalidatedPromoRequest = acc || [];\n if (attr.url) {\n result.push({\n type: PromoCodeSource.Url,\n attributes: { url: attr.url },\n });\n } else if (attr.value) {\n result.push({\n type: PromoCodeSource.Manual,\n attributes: { value: attr.value },\n });\n } else {\n logger.error(\"Invalid PromoAttribute - must contain either 'url' or 'value'\", { attr });\n }\n return result;\n }, []);\n};\n\n/**\n * @param {TPromoCodeAttribute[]} promoAttributes An array of promo attributes to be formatted\n * @param {string} apiKey API key for storage scoping\n * @returns {TPromoCodeRequest} An object containing both validated and unvalidated promo codes\n */\nexport const formatStoreAndReturnPromoCodes = (\n promoAttributes: TPromoCodeAttribute[],\n apiKey: string,\n): TPromoCodeRequest => {\n const unvalidatedPromoCodes = mapToUnvalidatedPromoCodes(promoAttributes);\n return mergeStoreAndReturnPromos({ newPromos: { unvalidatedPromoCodes }, apiKey });\n};\n\n/**\n * Extracts applicable promo codes from the cart object\n * This function retrieves discounts stored in the cart's `content.discounts` array,\n * filters out only the applicable promo codes, and returns them as an array of strings\n *\n * @param {TBeamCartLocalStorage} cart The cart object retrieved from local storage\n * @returns {string[]} An array of applicable promo codes\n */\nexport const getPromoCodesFromCart = (cart: TBeamCartLocalStorage): string[] => {\n if (!cart?.content) return [];\n\n const cartLevelCodes = cart.content.discounts?.filter((d) => d.applicable)?.map((d) => d.code) || [];\n\n const itemLevelCodes =\n cart.content.items?.flatMap(\n (item) => item.discounts?.filter((d: Discount) => d.applicable)?.map((d: Discount) => d.code) || [],\n ) || [];\n\n const allCodes = [...cartLevelCodes, ...itemLevelCodes];\n\n return [...new Set(allCodes)];\n};\n\n/**\n * Gets promo code exclusively from Shopify discount cookie\n * @returns {string | null} Single discount code or null if not found\n */\nexport const getPromoCodeFromShopifyCookie = (): string | null => {\n return getCookieValue(DISCOUNT_CODE_COOKIE_NAME) ?? null;\n};\n\n/**\n * Safely parses a JSON string into an array of strings\n * If parsing fails or the input is not a valid JSON array, it returns an empty array\n *\n * @param {string | undefined | null} jsonString The JSON string to parse\n * @returns {string[]} The parsed array of strings or an empty array if parsing fails\n */\nexport const parseJsonStringArray = (jsonString: string | undefined | null): string[] => {\n if (!jsonString) return [];\n try {\n const parsed = JSON.parse(jsonString);\n if (Array.isArray(parsed) && parsed.every((item) => typeof item === \"string\")) {\n return parsed;\n }\n return [];\n } catch (error) {\n logger.error(\"Failed to parse JSON:\", error);\n return [];\n }\n};\n\n/**\n * Retrieves and sanitizes the current URL for storage, preserving only safe query parameters\n *\n * @returns {TPromoCodeAttribute} Returns an object with only the `url` property set\n */\nexport const getSanitizedUrlForStorage = (): TPromoCodeAttribute | undefined => {\n try {\n const url = new URL(window.location.href);\n\n if (!url.search) return undefined;\n\n // Create NEW URL instead of modifying existing one\n const cleanUrl = new URL(url.origin + url.pathname);\n let hasValidParams = false;\n\n // Process all parameters\n url.searchParams.forEach((value, key) => {\n const isAllowed = key.startsWith(ALLOWED_URL_PREFIX);\n const isValidLength = value.length <= URL_QUERY_PARAM_CHAR_LIMIT;\n\n if (isAllowed && isValidLength) {\n cleanUrl.searchParams.append(key, value);\n hasValidParams = true;\n }\n });\n\n const finalUrl = cleanUrl.toString();\n return hasValidParams ? { url: finalUrl } : undefined;\n } catch (error) {\n return undefined;\n }\n};\n\nexport const promoCodesAreEqual = (a: TPromoCodeRequest, b: TPromoCodeRequest): boolean => {\n const extract = (codes: unknown): string => {\n const validCodes = (Array.isArray(codes) ? codes : []) as TUnvalidatedPromoCode[];\n\n const flattened = validCodes\n .map((c) => {\n if (c.type === \"manual\") {\n return c.attributes?.value;\n }\n if (c.type === \"url\") {\n return c.attributes?.url;\n }\n return \"\";\n })\n .filter(Boolean)\n .sort()\n .join(\",\");\n return flattened;\n };\n\n return extract(a?.unvalidatedPromoCodes) === extract(b?.unvalidatedPromoCodes);\n};\n\nexport const isEmptyPromoData = (promos: {\n unvalidatedPromoCodes?: unknown[];\n validatedPromoCodes?: unknown[];\n}): boolean => {\n return (\n (!promos.unvalidatedPromoCodes || promos.unvalidatedPromoCodes.length === 0) &&\n (!promos.validatedPromoCodes || promos.validatedPromoCodes.length === 0)\n );\n};\n","import { LOCAL_STORAGE_KEYS, BEAM_COOKIE_NAMES } from \"../api-sdk/constants\";\nimport { createScopedLocalStorage } from \"./local-storage\";\nimport { deleteCookieValue } from \"./cookies\";\n\n/**\n * Clears every piece of Beam-related browser state this SDK writes, by iterating the\n * LOCAL_STORAGE_KEYS/BEAM_COOKIE_NAMES registries (src/api-sdk/constants.ts) directly —\n * anything added to those objects is cleared automatically, with nothing to update here.\n *\n * Not tied to any one integration's lifecycle (e.g. registerCartIntegration/\n * unregisterCartIntegration) — safe to call on its own, from any integration or directly,\n * whenever a full reset of Beam's local footprint is needed.\n */\nexport function clearBeamStorage(config: { apiKey: string; domain?: string }) {\n const localStorage = createScopedLocalStorage(config);\n Object.values(LOCAL_STORAGE_KEYS).forEach((key) => localStorage.removeItem(key));\n Object.values(BEAM_COOKIE_NAMES).forEach((name) => deleteCookieValue({ name, domain: config.domain, path: \"/\" }));\n}\n","import { TBeamCartLocalStorage } from \"../shared/cart-contents\";\nimport { getCookieValue } from \"./cookies\";\nimport { createScopedLocalStorage } from \"./local-storage\";\n\n/**\n * Retrieves the Beam cart ID from cookies\n * @param CART_COOKIE_NAME - The name of the cookie that stores the Beam cart ID\n * @returns The Beam cart ID if present in cookies or local storage, otherwise null\n */\nexport const getBeamCartId = (CART_COOKIE_NAME: string, config: { apiKey: string }): string | null => {\n const localStorage = createScopedLocalStorage(config);\n\n // The cart cache is used to detect changes after page refreshes / across tabs\n const cachedCart: TBeamCartLocalStorage | null = localStorage.getItemJson(\"cart\");\n\n // Get the Beam cart cookie\n const beamCartId: string | null = cachedCart?.beamCartId ?? getCookieValue(CART_COOKIE_NAME) ?? null;\n return beamCartId;\n};\n\n/**\n * Retrieves the external cart ID\n * @param CART_COOKIE_NAME - The name of the cookie that stores the external cart ID\n * @returns The external cart ID if available or null if neither is available\n */\nexport const getExternalCartId = (CART_COOKIE_NAME: string, config: { apiKey: string }): string | null => {\n const localStorage = createScopedLocalStorage(config);\n\n // The cart cache is used to detect changes after page refreshes / across tabs\n const cachedCart: TBeamCartLocalStorage | null = localStorage.getItemJson(\"cart\");\n\n // Get external cart cookie\n const externalCartId: string | null = cachedCart?.cartId ?? getCookieValue(CART_COOKIE_NAME) ?? null;\n return externalCartId;\n};\n","export function makeApiKeyHeader(apiKey: string) {\n return {\n authorization: `Api-Key ${apiKey}`,\n };\n}\n"],"names":["DEFAULT_BASE_URL","DEFAULT_LOG_URL","SUPPORTED_LANGUAGES","WIDGET_NAMES","SELECTION_METHODS","HELPER_NAMES","LOCAL_STORAGE_KEYS","BEAM_COOKIE_NAMES","BeamError","msg","cause","name","NetworkError","response","body","MissingConfig","missingConfigKeyNames","LocalStorageError","SetupError","LOG_PREFIX","logger","args","_BeamNetworkCallEvent","detail","BeamNetworkCallEvent","_BeamNonprofitSelectEvent","BeamNonprofitSelectEvent","_BeamCartChangeEvent","BeamCartChangeEvent","_BeamCartCreatedEvent","BeamCartCreatedEvent","_BeamOrderCreatedEvent","BeamOrderCreatedEvent","_BeamStatusChangeEvent","BeamStatusChangeEvent","_BeamNonprofitSelectionRemovedEvent","BeamNonprofitSelectionRemovedEvent","_BeamPromoCodesStoredEvent","BeamPromoCodesStoredEvent","_BeamWidgetStoredPromoCodesEvent","BeamWidgetStoredPromoCodesEvent","_BeamWidgetInitialNonprofitSyncEvent","BeamWidgetInitialNonprofitSyncEvent","_BeamWidgetInitialNonprofitSyncCancelEvent","BeamWidgetInitialNonprofitSyncCancelEvent","_BeamStatsigInitializedEvent","BeamStatsigInitializedEvent","fetchHandler","target","_thisArg","networkListenersEnabled","responseCopy","xhrHandler","TargetConstructor","xhr","_open","_method","_url","method","url","initializedListeners","initNetworkListeners","teardownNetworkListeners","createScopedLocalStorage","config","key","value","json","waitForElement","selector","timeout","resolve","reject","el","mutationObserver","timer","_mutationRecords","observer","element","getCookieMap","cookieString","result","next","cookieKeyValuePair","restOfString","getCookieValue","setCookieValue","options","expires","rest","encodedValue","base","expiration","modifiers","val","deleteCookieValue","domain","path","cookieOptions","REMOTE_SESSION_ID_KEY","saveRemoteSession","remoteSessionId","apiKey","getRemoteSession","memoizeLast","func","isEqual","defaultIsEqual","lastArgs","lastResult","hasResult","promiseCounter","memoized","promiseCounterAtStart","PromoCodeSource","PROMO_LOCAL_STORAGE_KEY","PROMO_CODES_COOKIE_NAME","URL_QUERY_PARAM_CHAR_LIMIT","ALLOWED_URL_PREFIX","DISCOUNT_CODE_COOKIE_NAME","getAllPromoCodesFromCookie","promoCodesString","error","setPromoCodeInCookie","validatedPromoCodes","promoCodeData","threeMonthsFromNow","getPromoCodesLocalStorage","setPromoCodesInLocalStorage","promoCodes","storage","completePromoCodes","mergeStoreAndReturnPromos","newPromos","existing","uniqueNewUnvalidatedPromos","newPromo","existingPromo","mergedCodes","mapToUnvalidatedPromoCodes","promoAttributes","acc","attr","formatStoreAndReturnPromoCodes","unvalidatedPromoCodes","getPromoCodesFromCart","cart","cartLevelCodes","d","itemLevelCodes","item","allCodes","getPromoCodeFromShopifyCookie","parseJsonStringArray","jsonString","parsed","getSanitizedUrlForStorage","cleanUrl","hasValidParams","isAllowed","isValidLength","finalUrl","promoCodesAreEqual","a","b","extract","codes","c","isEmptyPromoData","promos","clearBeamStorage","localStorage","getBeamCartId","CART_COOKIE_NAME","getExternalCartId","makeApiKeyHeader"],"mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
- import { T as TUrl } from '../chunks/utils-BPcZ5h8J.esm.js';
4
+ import { T as TUrl } from '../chunks/utils-DfsVjUY-.esm.js';
5
5
  import 'lodash-es/debounce';
6
6
  import 'lodash-es/isEqual';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
- import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-BPcZ5h8J.esm.js';
4
+ import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-DfsVjUY-.esm.js';
5
5
  import 'lodash-es/debounce';
6
6
  import 'lodash-es/isEqual';
7
7
 
@@ -1,4 +1,4 @@
1
- import{i as x,n as g,r as I,a as v,h as u,b as l,j as b}from"../chunks/lit-BEag9MFp.esm.js";import{c as $,a as f,d as T,e as k}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{u as n,g as w,A as S,d as s,_ as L,c as C,e as m,f as A}from"../chunks/index-Beh5bQDw.esm.js";import{D as z,W as F,v as D,n as M}from"../chunks/utils-C5hmbxa4.esm.js";import{a as E}from"../chunks/share-button-CIP03E7T.esm.js";import{partnerLogosConfigDefaults as U}from"./beam-partner-logos.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const y={en:{fundedTimes:({times:e=0})=>`Funded <b>${e}</b> ${e>1?"times":"time"} so far`,learnMore:()=>"Learn more",seeAll:()=>"See All"},fr:{fundedTimes:({times:e=0})=>`Financ\xE9 <b>${e}</b> fois pour l'instant`,learnMore:()=>"En savoir plus",seeAll:()=>"Voir tout"},de:{fundedTimes:({times:e=0})=>`<b>${e}</b> Mal finanziert`,learnMore:()=>"Mehr erfahren",seeAll:()=>"Alle anzeigen"},es:{fundedTimes:({times:e=0})=>`Financiado <b>${e}</b> ${e>1?"vez":"veces"}`,learnMore:()=>"Saber m\xE1s",seeAll:()=>"Ver Todo"},it:{fundedTimes:({times:e=0})=>`Finanziato <b>${e}</b> ${e>1?"volta":"volte"}`,learnMore:()=>"Scopri di pi\xF9",seeAll:()=>"Vedi Tutto"},pl:{fundedTimes:({times:e=0})=>`Udzielono wsparcia <b>${e}</b> ${e>1?"razy":"raz"}`,learnMore:()=>"Dowiedz si\u0119 wi\u0119cej",seeAll:()=>"Zobacz wszystko"},ja:{fundedTimes:({times:e=0})=>`\u73FE\u5728\u307E\u3067\u306B<b>${e}</b>\u56DE\u3001\u3092\u9054\u6210`,learnMore:()=>"\u8A73\u3057\u304F\u898B\u308B",seeAll:()=>"\u3059\u3079\u3066\u898B\u308B"}};var B=Object.defineProperty,p=(e,a,t,r)=>{for(var o=void 0,i=e.length-1,d;i>=0;i--)(d=e[i])&&(o=d(a,t,o)||o);return o&&B(a,t,o),o};class c extends v{constructor(){super(...arguments),this.baseUrl=z,this.cardStyle="image",this.lang="en",this.debug=!1,this.draftConfig=!1,this.selectedFilter=null,this.getImpactData=async()=>(k(["apiKey","chainId"],this),w({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{chainId:this.chainId,personalImpactLimit:0,widgetName:F.community_impact,version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.impactDataController=new S(this,this.getImpactData),this.renderImageCard=a=>{const t=`${a.nonprofit?.name} image`,r=`Learn more about ${a.nonprofit?.name}`;return l`
1
+ import{i as x,n as g,r as I,a as v,h as u,b as l,j as b}from"../chunks/lit-BEag9MFp.esm.js";import{c as $,a as f,d as T,e as k}from"../chunks/css-card-grid-tjA36yWj.esm.js";import{u as n,g as w,A as S,d as s,_ as L,c as C,e as m,f as A}from"../chunks/index-tkscjKkq.esm.js";import{D as z,W as F,x as D,n as M}from"../chunks/utils-ly9wMwUO.esm.js";import{a as E}from"../chunks/share-button-DP2wLhmP.esm.js";import{partnerLogosConfigDefaults as U}from"./beam-partner-logos.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const y={en:{fundedTimes:({times:e=0})=>`Funded <b>${e}</b> ${e>1?"times":"time"} so far`,learnMore:()=>"Learn more",seeAll:()=>"See All"},fr:{fundedTimes:({times:e=0})=>`Financ\xE9 <b>${e}</b> fois pour l'instant`,learnMore:()=>"En savoir plus",seeAll:()=>"Voir tout"},de:{fundedTimes:({times:e=0})=>`<b>${e}</b> Mal finanziert`,learnMore:()=>"Mehr erfahren",seeAll:()=>"Alle anzeigen"},es:{fundedTimes:({times:e=0})=>`Financiado <b>${e}</b> ${e>1?"vez":"veces"}`,learnMore:()=>"Saber m\xE1s",seeAll:()=>"Ver Todo"},it:{fundedTimes:({times:e=0})=>`Finanziato <b>${e}</b> ${e>1?"volta":"volte"}`,learnMore:()=>"Scopri di pi\xF9",seeAll:()=>"Vedi Tutto"},pl:{fundedTimes:({times:e=0})=>`Udzielono wsparcia <b>${e}</b> ${e>1?"razy":"raz"}`,learnMore:()=>"Dowiedz si\u0119 wi\u0119cej",seeAll:()=>"Zobacz wszystko"},ja:{fundedTimes:({times:e=0})=>`\u73FE\u5728\u307E\u3067\u306B<b>${e}</b>\u56DE\u3001\u3092\u9054\u6210`,learnMore:()=>"\u8A73\u3057\u304F\u898B\u308B",seeAll:()=>"\u3059\u3079\u3066\u898B\u308B"}};var B=Object.defineProperty,p=(e,a,t,r)=>{for(var o=void 0,i=e.length-1,d;i>=0;i--)(d=e[i])&&(o=d(a,t,o)||o);return o&&B(a,t,o),o};class c extends v{constructor(){super(...arguments),this.baseUrl=z,this.cardStyle="image",this.lang="en",this.debug=!1,this.draftConfig=!1,this.selectedFilter=null,this.getImpactData=async()=>(k(["apiKey","chainId"],this),w({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{chainId:this.chainId,personalImpactLimit:0,widgetName:F.community_impact,version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.impactDataController=new S(this,this.getImpactData),this.renderImageCard=a=>{const t=`${a.nonprofit?.name} image`,r=`Learn more about ${a.nonprofit?.name}`;return l`
2
2
  <div class="image-card" part="nonprofit-card" style="display: flex; flex-direction: column;">
3
3
  <div
4
4
  class="image-card-image-box"
@@ -1,4 +1,4 @@
1
- import{i as x,n as g,r as I,a as v,h as u,b as l,j as b}from"../chunks/lit-BEag9MFp.esm.js";import{c as $,a as f,d as T,e as k}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{u as n,g as w,A as S,d as s,_ as L,c as C,e as m,f as A}from"../chunks/index-Beh5bQDw.esm.js";import{D as z,W as F,v as D,n as M}from"../chunks/utils-C5hmbxa4.esm.js";import{a as E}from"../chunks/share-button-CIP03E7T.esm.js";import{partnerLogosConfigDefaults as U}from"./beam-partner-logos.js";import"../chunks/lodash-CrMU6wKg.esm.js";const y={en:{fundedTimes:({times:e=0})=>`Funded <b>${e}</b> ${e>1?"times":"time"} so far`,learnMore:()=>"Learn more",seeAll:()=>"See All"},fr:{fundedTimes:({times:e=0})=>`Financ\xE9 <b>${e}</b> fois pour l'instant`,learnMore:()=>"En savoir plus",seeAll:()=>"Voir tout"},de:{fundedTimes:({times:e=0})=>`<b>${e}</b> Mal finanziert`,learnMore:()=>"Mehr erfahren",seeAll:()=>"Alle anzeigen"},es:{fundedTimes:({times:e=0})=>`Financiado <b>${e}</b> ${e>1?"vez":"veces"}`,learnMore:()=>"Saber m\xE1s",seeAll:()=>"Ver Todo"},it:{fundedTimes:({times:e=0})=>`Finanziato <b>${e}</b> ${e>1?"volta":"volte"}`,learnMore:()=>"Scopri di pi\xF9",seeAll:()=>"Vedi Tutto"},pl:{fundedTimes:({times:e=0})=>`Udzielono wsparcia <b>${e}</b> ${e>1?"razy":"raz"}`,learnMore:()=>"Dowiedz si\u0119 wi\u0119cej",seeAll:()=>"Zobacz wszystko"},ja:{fundedTimes:({times:e=0})=>`\u73FE\u5728\u307E\u3067\u306B<b>${e}</b>\u56DE\u3001\u3092\u9054\u6210`,learnMore:()=>"\u8A73\u3057\u304F\u898B\u308B",seeAll:()=>"\u3059\u3079\u3066\u898B\u308B"}};var B=Object.defineProperty,p=(e,a,t,r)=>{for(var o=void 0,i=e.length-1,d;i>=0;i--)(d=e[i])&&(o=d(a,t,o)||o);return o&&B(a,t,o),o};class c extends v{constructor(){super(...arguments),this.baseUrl=z,this.cardStyle="image",this.lang="en",this.debug=!1,this.draftConfig=!1,this.selectedFilter=null,this.getImpactData=async()=>(k(["apiKey","chainId"],this),w({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{chainId:this.chainId,personalImpactLimit:0,widgetName:F.community_impact,version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.impactDataController=new S(this,this.getImpactData),this.renderImageCard=a=>{const t=`${a.nonprofit?.name} image`,r=`Learn more about ${a.nonprofit?.name}`;return l`
1
+ import{i as x,n as g,r as I,a as v,h as u,b as l,j as b}from"../chunks/lit-BEag9MFp.esm.js";import{c as $,a as f,d as T,e as k}from"../chunks/css-card-grid-tjA36yWj.esm.js";import{u as n,g as w,A as S,d as s,_ as L,c as C,e as m,f as A}from"../chunks/index-tkscjKkq.esm.js";import{D as z,W as F,x as D,n as M}from"../chunks/utils-ly9wMwUO.esm.js";import{a as E}from"../chunks/share-button-DP2wLhmP.esm.js";import{partnerLogosConfigDefaults as U}from"./beam-partner-logos.js";import"../chunks/lodash-CrMU6wKg.esm.js";const y={en:{fundedTimes:({times:e=0})=>`Funded <b>${e}</b> ${e>1?"times":"time"} so far`,learnMore:()=>"Learn more",seeAll:()=>"See All"},fr:{fundedTimes:({times:e=0})=>`Financ\xE9 <b>${e}</b> fois pour l'instant`,learnMore:()=>"En savoir plus",seeAll:()=>"Voir tout"},de:{fundedTimes:({times:e=0})=>`<b>${e}</b> Mal finanziert`,learnMore:()=>"Mehr erfahren",seeAll:()=>"Alle anzeigen"},es:{fundedTimes:({times:e=0})=>`Financiado <b>${e}</b> ${e>1?"vez":"veces"}`,learnMore:()=>"Saber m\xE1s",seeAll:()=>"Ver Todo"},it:{fundedTimes:({times:e=0})=>`Finanziato <b>${e}</b> ${e>1?"volta":"volte"}`,learnMore:()=>"Scopri di pi\xF9",seeAll:()=>"Vedi Tutto"},pl:{fundedTimes:({times:e=0})=>`Udzielono wsparcia <b>${e}</b> ${e>1?"razy":"raz"}`,learnMore:()=>"Dowiedz si\u0119 wi\u0119cej",seeAll:()=>"Zobacz wszystko"},ja:{fundedTimes:({times:e=0})=>`\u73FE\u5728\u307E\u3067\u306B<b>${e}</b>\u56DE\u3001\u3092\u9054\u6210`,learnMore:()=>"\u8A73\u3057\u304F\u898B\u308B",seeAll:()=>"\u3059\u3079\u3066\u898B\u308B"}};var B=Object.defineProperty,p=(e,a,t,r)=>{for(var o=void 0,i=e.length-1,d;i>=0;i--)(d=e[i])&&(o=d(a,t,o)||o);return o&&B(a,t,o),o};class c extends v{constructor(){super(...arguments),this.baseUrl=z,this.cardStyle="image",this.lang="en",this.debug=!1,this.draftConfig=!1,this.selectedFilter=null,this.getImpactData=async()=>(k(["apiKey","chainId"],this),w({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{chainId:this.chainId,personalImpactLimit:0,widgetName:F.community_impact,version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.impactDataController=new S(this,this.getImpactData),this.renderImageCard=a=>{const t=`${a.nonprofit?.name} image`,r=`Learn more about ${a.nonprofit?.name}`;return l`
2
2
  <div class="image-card" part="nonprofit-card" style="display: flex; flex-direction: column;">
3
3
  <div
4
4
  class="image-card-image-box"
@@ -2,7 +2,7 @@ import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
4
  import * as lodash from 'lodash';
5
- import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-BPcZ5h8J.esm.js';
5
+ import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-DfsVjUY-.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,4 +1,4 @@
1
- import{r as C,a as b,b as u,n as c,i as y,g as I}from"../chunks/lit-BEag9MFp.esm.js";import{d as x}from"../chunks/lodash-CrMU6wKg.esm.js";import{c as T,d as S,e as E}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as z,u as p,b as B,A as $,_ as k,c as f,d,e as h,f as D}from"../chunks/index-Beh5bQDw.esm.js";import{D as L,v as V,n as A}from"../chunks/utils-C5hmbxa4.esm.js";var R=Object.defineProperty,v=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&R(e,t,a),a};class m extends b{constructor(){super(...arguments),this.finalValue=0,this.duration=1500,this.counter=0,this.intervalId=0,this.handleCounterAnimateIfInView=e=>{e.some(t=>t.isIntersecting)&&(this.animateCounter(),this.unobserveScrollTarget())},this.animateCounter=()=>{const e=41.666666666666664,t=e/this.duration*this.finalValue;this.intervalId=setInterval(()=>{const i=this.counter+t;if(i>=this.finalValue){this.counter=this.finalValue,clearInterval(this.intervalId);return}else this.counter=i},e)},this.observer=new IntersectionObserver(this.handleCounterAnimateIfInView,{threshold:.1}),this.observeScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.observe(e)},this.unobserveScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.unobserve(e)}}connectedCallback(){super.connectedCallback();const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.duration===0||e?this.counter=this.finalValue:this.observeScrollTarget()}disconnectedCallback(){super.disconnectedCallback(),this.unobserveScrollTarget(),clearInterval(this.intervalId)}get scrollTargetElement(){return this.scrollTarget?document.querySelector(this.scrollTarget):this}render(){return u`${Math.ceil(this.counter).toLocaleString()}`}}v([c({type:Number})],m.prototype,"finalValue"),v([c({type:Number})],m.prototype,"duration"),v([c({type:String})],m.prototype,"scrollTarget"),v([C()],m.prototype,"counter"),customElements.get("animated-counter")||customElements.define("animated-counter",m);const j=n=>{const e=n instanceof NodeList?Array.from(n):n;if(e.length===0||!z(e))return;const t=e.sort((a,o)=>{const s=getComputedStyle(a).getPropertyValue("width").replace("px",""),g=getComputedStyle(o).getPropertyValue("width").replace("px","");return parseInt(g)-parseInt(s)})[0],i=getComputedStyle(t).getPropertyValue("width");for(const a of e)getComputedStyle(a).getPropertyValue("width")!==i&&(a.style.width=i)},w={en:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."},fr:{cumulativeImpactTitle:()=>"Ce que nous avons financ\xE9",cumulativeImpactDescription:()=>"Voici l'impact que notre communaut\xE9 a eu jusqu'\xE0 pr\xE9sent en partenariat avec Beam. Notre impact grandit chaque jour : faites d\xE9filer pour d\xE9couvrir les objectifs vers lesquels nous travaillons ensemble en ce moment."},de:{cumulativeImpactTitle:()=>"Was wir finanziert haben",cumulativeImpactDescription:()=>"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung w\xE4chst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten."},es:{cumulativeImpactTitle:()=>"Lo que hemos financiado",cumulativeImpactDescription:()=>"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociaci\xF3n con Beam. Nuestro impacto crece cada d\xEDa; despl\xE1cese para ver los objetivos por los que estamos trabajando juntos en este momento."},it:{cumulativeImpactTitle:()=>"Cosa abbiamo finanziato",cumulativeImpactDescription:()=>"Ecco l'impatto che la nostra comunit\xE0 ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento."},pl:{cumulativeImpactTitle:()=>"Co sfinansowali\u015Bmy",cumulativeImpactDescription:()=>"Oto wp\u0142yw, jaki nasza spo\u0142eczno\u015B\u0107 wywar\u0142a dotychczas we wsp\xF3\u0142pracy z Beam. Nasz wp\u0142yw ro\u015Bnie z ka\u017Cdym dniem \u2014 przewi\u0144, aby sprawdzi\u0107 cele, nad kt\xF3rymi obecnie wsp\xF3lnie pracujemy."},ja:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."}};var q=Object.defineProperty,l=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&q(e,t,a),a};const U=1.5*1e3;class r extends b{constructor(){super(...arguments),this.baseUrl=L,this.lang="en",this.disableAnimation=!1,this.debug=!1,this.draftConfig=!1,this.getCumulativeImpactData=async()=>(E(["apiKey","chainId"],this),await B({baseUrl:this.baseUrl,pathParams:{chainId:this.chainId},headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.cumulativeImpactDataController=new $(this,this.getCumulativeImpactData),this.resizeElements=x(()=>{j(this.impactRowRefs)},50,{maxWait:50,leading:!0})}get configLang(){return V[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const t=["chainId","baseUrl","lang"];for(const i of t)if(e.has(i)){await this.cumulativeImpactDataController.exec();break}this.resizeElements()}render(){const{data:e,error:t,loading:i}=this.cumulativeImpactDataController;return i?k():t?this.debug?f({error:t}):"":e==null?this.debug?f({error:new A("Missing data")}):"":u`
1
+ import{r as C,a as b,b as u,n as c,i as y,g as I}from"../chunks/lit-BEag9MFp.esm.js";import{d as x}from"../chunks/lodash-CrMU6wKg.esm.js";import{c as T,d as S,e as E}from"../chunks/css-card-grid-tjA36yWj.esm.js";import{a as z,u as p,b as B,A as $,_ as k,c as f,d,e as h,f as D}from"../chunks/index-tkscjKkq.esm.js";import{D as L,x as V,n as A}from"../chunks/utils-ly9wMwUO.esm.js";var R=Object.defineProperty,v=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&R(e,t,a),a};class m extends b{constructor(){super(...arguments),this.finalValue=0,this.duration=1500,this.counter=0,this.intervalId=0,this.handleCounterAnimateIfInView=e=>{e.some(t=>t.isIntersecting)&&(this.animateCounter(),this.unobserveScrollTarget())},this.animateCounter=()=>{const e=41.666666666666664,t=e/this.duration*this.finalValue;this.intervalId=setInterval(()=>{const i=this.counter+t;if(i>=this.finalValue){this.counter=this.finalValue,clearInterval(this.intervalId);return}else this.counter=i},e)},this.observer=new IntersectionObserver(this.handleCounterAnimateIfInView,{threshold:.1}),this.observeScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.observe(e)},this.unobserveScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.unobserve(e)}}connectedCallback(){super.connectedCallback();const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.duration===0||e?this.counter=this.finalValue:this.observeScrollTarget()}disconnectedCallback(){super.disconnectedCallback(),this.unobserveScrollTarget(),clearInterval(this.intervalId)}get scrollTargetElement(){return this.scrollTarget?document.querySelector(this.scrollTarget):this}render(){return u`${Math.ceil(this.counter).toLocaleString()}`}}v([c({type:Number})],m.prototype,"finalValue"),v([c({type:Number})],m.prototype,"duration"),v([c({type:String})],m.prototype,"scrollTarget"),v([C()],m.prototype,"counter"),customElements.get("animated-counter")||customElements.define("animated-counter",m);const j=n=>{const e=n instanceof NodeList?Array.from(n):n;if(e.length===0||!z(e))return;const t=e.sort((a,o)=>{const s=getComputedStyle(a).getPropertyValue("width").replace("px",""),g=getComputedStyle(o).getPropertyValue("width").replace("px","");return parseInt(g)-parseInt(s)})[0],i=getComputedStyle(t).getPropertyValue("width");for(const a of e)getComputedStyle(a).getPropertyValue("width")!==i&&(a.style.width=i)},w={en:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."},fr:{cumulativeImpactTitle:()=>"Ce que nous avons financ\xE9",cumulativeImpactDescription:()=>"Voici l'impact que notre communaut\xE9 a eu jusqu'\xE0 pr\xE9sent en partenariat avec Beam. Notre impact grandit chaque jour : faites d\xE9filer pour d\xE9couvrir les objectifs vers lesquels nous travaillons ensemble en ce moment."},de:{cumulativeImpactTitle:()=>"Was wir finanziert haben",cumulativeImpactDescription:()=>"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung w\xE4chst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten."},es:{cumulativeImpactTitle:()=>"Lo que hemos financiado",cumulativeImpactDescription:()=>"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociaci\xF3n con Beam. Nuestro impacto crece cada d\xEDa; despl\xE1cese para ver los objetivos por los que estamos trabajando juntos en este momento."},it:{cumulativeImpactTitle:()=>"Cosa abbiamo finanziato",cumulativeImpactDescription:()=>"Ecco l'impatto che la nostra comunit\xE0 ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento."},pl:{cumulativeImpactTitle:()=>"Co sfinansowali\u015Bmy",cumulativeImpactDescription:()=>"Oto wp\u0142yw, jaki nasza spo\u0142eczno\u015B\u0107 wywar\u0142a dotychczas we wsp\xF3\u0142pracy z Beam. Nasz wp\u0142yw ro\u015Bnie z ka\u017Cdym dniem \u2014 przewi\u0144, aby sprawdzi\u0107 cele, nad kt\xF3rymi obecnie wsp\xF3lnie pracujemy."},ja:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."}};var q=Object.defineProperty,l=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&q(e,t,a),a};const U=1.5*1e3;class r extends b{constructor(){super(...arguments),this.baseUrl=L,this.lang="en",this.disableAnimation=!1,this.debug=!1,this.draftConfig=!1,this.getCumulativeImpactData=async()=>(E(["apiKey","chainId"],this),await B({baseUrl:this.baseUrl,pathParams:{chainId:this.chainId},headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.cumulativeImpactDataController=new $(this,this.getCumulativeImpactData),this.resizeElements=x(()=>{j(this.impactRowRefs)},50,{maxWait:50,leading:!0})}get configLang(){return V[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const t=["chainId","baseUrl","lang"];for(const i of t)if(e.has(i)){await this.cumulativeImpactDataController.exec();break}this.resizeElements()}render(){const{data:e,error:t,loading:i}=this.cumulativeImpactDataController;return i?k():t?this.debug?f({error:t}):"":e==null?this.debug?f({error:new A("Missing data")}):"":u`
2
2
  <style>
3
3
  :host {
4
4
  ${this.cssVariables.toCSS()}
@@ -1,4 +1,4 @@
1
- import{r as C,a as b,b as u,n as c,i as y,g as I}from"../chunks/lit-BEag9MFp.esm.js";import{d as x}from"../chunks/lodash-CrMU6wKg.esm.js";import{c as T,d as S,e as E}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as z,u as p,b as B,A as $,_ as k,c as f,d,e as h,f as D}from"../chunks/index-Beh5bQDw.esm.js";import{D as L,v as V,n as A}from"../chunks/utils-C5hmbxa4.esm.js";var R=Object.defineProperty,v=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&R(e,t,a),a};class m extends b{constructor(){super(...arguments),this.finalValue=0,this.duration=1500,this.counter=0,this.intervalId=0,this.handleCounterAnimateIfInView=e=>{e.some(t=>t.isIntersecting)&&(this.animateCounter(),this.unobserveScrollTarget())},this.animateCounter=()=>{const e=41.666666666666664,t=e/this.duration*this.finalValue;this.intervalId=setInterval(()=>{const i=this.counter+t;if(i>=this.finalValue){this.counter=this.finalValue,clearInterval(this.intervalId);return}else this.counter=i},e)},this.observer=new IntersectionObserver(this.handleCounterAnimateIfInView,{threshold:.1}),this.observeScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.observe(e)},this.unobserveScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.unobserve(e)}}connectedCallback(){super.connectedCallback();const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.duration===0||e?this.counter=this.finalValue:this.observeScrollTarget()}disconnectedCallback(){super.disconnectedCallback(),this.unobserveScrollTarget(),clearInterval(this.intervalId)}get scrollTargetElement(){return this.scrollTarget?document.querySelector(this.scrollTarget):this}render(){return u`${Math.ceil(this.counter).toLocaleString()}`}}v([c({type:Number})],m.prototype,"finalValue"),v([c({type:Number})],m.prototype,"duration"),v([c({type:String})],m.prototype,"scrollTarget"),v([C()],m.prototype,"counter"),customElements.get("animated-counter")||customElements.define("animated-counter",m);const j=n=>{const e=n instanceof NodeList?Array.from(n):n;if(e.length===0||!z(e))return;const t=e.sort((a,o)=>{const s=getComputedStyle(a).getPropertyValue("width").replace("px",""),g=getComputedStyle(o).getPropertyValue("width").replace("px","");return parseInt(g)-parseInt(s)})[0],i=getComputedStyle(t).getPropertyValue("width");for(const a of e)getComputedStyle(a).getPropertyValue("width")!==i&&(a.style.width=i)},w={en:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."},fr:{cumulativeImpactTitle:()=>"Ce que nous avons financ\xE9",cumulativeImpactDescription:()=>"Voici l'impact que notre communaut\xE9 a eu jusqu'\xE0 pr\xE9sent en partenariat avec Beam. Notre impact grandit chaque jour : faites d\xE9filer pour d\xE9couvrir les objectifs vers lesquels nous travaillons ensemble en ce moment."},de:{cumulativeImpactTitle:()=>"Was wir finanziert haben",cumulativeImpactDescription:()=>"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung w\xE4chst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten."},es:{cumulativeImpactTitle:()=>"Lo que hemos financiado",cumulativeImpactDescription:()=>"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociaci\xF3n con Beam. Nuestro impacto crece cada d\xEDa; despl\xE1cese para ver los objetivos por los que estamos trabajando juntos en este momento."},it:{cumulativeImpactTitle:()=>"Cosa abbiamo finanziato",cumulativeImpactDescription:()=>"Ecco l'impatto che la nostra comunit\xE0 ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento."},pl:{cumulativeImpactTitle:()=>"Co sfinansowali\u015Bmy",cumulativeImpactDescription:()=>"Oto wp\u0142yw, jaki nasza spo\u0142eczno\u015B\u0107 wywar\u0142a dotychczas we wsp\xF3\u0142pracy z Beam. Nasz wp\u0142yw ro\u015Bnie z ka\u017Cdym dniem \u2014 przewi\u0144, aby sprawdzi\u0107 cele, nad kt\xF3rymi obecnie wsp\xF3lnie pracujemy."},ja:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."}};var q=Object.defineProperty,l=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&q(e,t,a),a};const U=1.5*1e3;class r extends b{constructor(){super(...arguments),this.baseUrl=L,this.lang="en",this.disableAnimation=!1,this.debug=!1,this.draftConfig=!1,this.getCumulativeImpactData=async()=>(E(["apiKey","chainId"],this),await B({baseUrl:this.baseUrl,pathParams:{chainId:this.chainId},headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.cumulativeImpactDataController=new $(this,this.getCumulativeImpactData),this.resizeElements=x(()=>{j(this.impactRowRefs)},50,{maxWait:50,leading:!0})}get configLang(){return V[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const t=["chainId","baseUrl","lang"];for(const i of t)if(e.has(i)){await this.cumulativeImpactDataController.exec();break}this.resizeElements()}render(){const{data:e,error:t,loading:i}=this.cumulativeImpactDataController;return i?k():t?this.debug?f({error:t}):"":e==null?this.debug?f({error:new A("Missing data")}):"":u`
1
+ import{r as C,a as b,b as u,n as c,i as y,g as I}from"../chunks/lit-BEag9MFp.esm.js";import{d as x}from"../chunks/lodash-CrMU6wKg.esm.js";import{c as T,d as S,e as E}from"../chunks/css-card-grid-tjA36yWj.esm.js";import{a as z,u as p,b as B,A as $,_ as k,c as f,d,e as h,f as D}from"../chunks/index-tkscjKkq.esm.js";import{D as L,x as V,n as A}from"../chunks/utils-ly9wMwUO.esm.js";var R=Object.defineProperty,v=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&R(e,t,a),a};class m extends b{constructor(){super(...arguments),this.finalValue=0,this.duration=1500,this.counter=0,this.intervalId=0,this.handleCounterAnimateIfInView=e=>{e.some(t=>t.isIntersecting)&&(this.animateCounter(),this.unobserveScrollTarget())},this.animateCounter=()=>{const e=41.666666666666664,t=e/this.duration*this.finalValue;this.intervalId=setInterval(()=>{const i=this.counter+t;if(i>=this.finalValue){this.counter=this.finalValue,clearInterval(this.intervalId);return}else this.counter=i},e)},this.observer=new IntersectionObserver(this.handleCounterAnimateIfInView,{threshold:.1}),this.observeScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.observe(e)},this.unobserveScrollTarget=()=>{const e=this.scrollTargetElement;e&&this.observer.unobserve(e)}}connectedCallback(){super.connectedCallback();const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.duration===0||e?this.counter=this.finalValue:this.observeScrollTarget()}disconnectedCallback(){super.disconnectedCallback(),this.unobserveScrollTarget(),clearInterval(this.intervalId)}get scrollTargetElement(){return this.scrollTarget?document.querySelector(this.scrollTarget):this}render(){return u`${Math.ceil(this.counter).toLocaleString()}`}}v([c({type:Number})],m.prototype,"finalValue"),v([c({type:Number})],m.prototype,"duration"),v([c({type:String})],m.prototype,"scrollTarget"),v([C()],m.prototype,"counter"),customElements.get("animated-counter")||customElements.define("animated-counter",m);const j=n=>{const e=n instanceof NodeList?Array.from(n):n;if(e.length===0||!z(e))return;const t=e.sort((a,o)=>{const s=getComputedStyle(a).getPropertyValue("width").replace("px",""),g=getComputedStyle(o).getPropertyValue("width").replace("px","");return parseInt(g)-parseInt(s)})[0],i=getComputedStyle(t).getPropertyValue("width");for(const a of e)getComputedStyle(a).getPropertyValue("width")!==i&&(a.style.width=i)},w={en:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."},fr:{cumulativeImpactTitle:()=>"Ce que nous avons financ\xE9",cumulativeImpactDescription:()=>"Voici l'impact que notre communaut\xE9 a eu jusqu'\xE0 pr\xE9sent en partenariat avec Beam. Notre impact grandit chaque jour : faites d\xE9filer pour d\xE9couvrir les objectifs vers lesquels nous travaillons ensemble en ce moment."},de:{cumulativeImpactTitle:()=>"Was wir finanziert haben",cumulativeImpactDescription:()=>"Hier ist die Wirkung, die unsere Community bisher in Zusammenarbeit mit Beam erzielt hat. Unsere Wirkung w\xE4chst von Tag zu Tag - scrollen Sie, um einen Blick auf die Ziele zu werfen, auf die wir derzeit gemeinsam hinarbeiten."},es:{cumulativeImpactTitle:()=>"Lo que hemos financiado",cumulativeImpactDescription:()=>"Este es el impacto que nuestra comunidad ha tenido hasta ahora en asociaci\xF3n con Beam. Nuestro impacto crece cada d\xEDa; despl\xE1cese para ver los objetivos por los que estamos trabajando juntos en este momento."},it:{cumulativeImpactTitle:()=>"Cosa abbiamo finanziato",cumulativeImpactDescription:()=>"Ecco l'impatto che la nostra comunit\xE0 ha avuto finora in collaborazione con Beam. Il nostro impatto cresce ogni giorno: scorri per scoprire gli obiettivi a cui stiamo lavorando insieme in questo momento."},pl:{cumulativeImpactTitle:()=>"Co sfinansowali\u015Bmy",cumulativeImpactDescription:()=>"Oto wp\u0142yw, jaki nasza spo\u0142eczno\u015B\u0107 wywar\u0142a dotychczas we wsp\xF3\u0142pracy z Beam. Nasz wp\u0142yw ro\u015Bnie z ka\u017Cdym dniem \u2014 przewi\u0144, aby sprawdzi\u0107 cele, nad kt\xF3rymi obecnie wsp\xF3lnie pracujemy."},ja:{cumulativeImpactTitle:()=>"What we've funded",cumulativeImpactDescription:()=>"Here's the impact that our community has made so far in partnership with Beam. Our impact is growing every day\u2014 scroll to check out the goals we're working toward together right now."}};var q=Object.defineProperty,l=(n,e,t,i)=>{for(var a=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(a=s(e,t,a)||a);return a&&q(e,t,a),a};const U=1.5*1e3;class r extends b{constructor(){super(...arguments),this.baseUrl=L,this.lang="en",this.disableAnimation=!1,this.debug=!1,this.draftConfig=!1,this.getCumulativeImpactData=async()=>(E(["apiKey","chainId"],this),await B({baseUrl:this.baseUrl,pathParams:{chainId:this.chainId},headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{version:"1.0.0",lang:this.configLang,draftConfig:this.draftConfig}})),this.cumulativeImpactDataController=new $(this,this.getCumulativeImpactData),this.resizeElements=x(()=>{j(this.impactRowRefs)},50,{maxWait:50,leading:!0})}get configLang(){return V[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const t=["chainId","baseUrl","lang"];for(const i of t)if(e.has(i)){await this.cumulativeImpactDataController.exec();break}this.resizeElements()}render(){const{data:e,error:t,loading:i}=this.cumulativeImpactDataController;return i?k():t?this.debug?f({error:t}):"":e==null?this.debug?f({error:new A("Missing data")}):"":u`
2
2
  <style>
3
3
  :host {
4
4
  ${this.cssVariables.toCSS()}
@@ -2,7 +2,7 @@ import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
4
  import * as lodash from 'lodash';
5
- import { T as TUrl, b as TNumericId, c as TId, L as LANGUAGES } from '../chunks/utils-BPcZ5h8J.esm.js';
5
+ import { T as TUrl, b as TNumericId, c as TId, L as LANGUAGES } from '../chunks/utils-DfsVjUY-.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,4 +1,4 @@
1
- import{i as k,n as c,g as f,a as N,h as $,b as T}from"../chunks/lit-BEag9MFp.esm.js";import{d as F}from"../chunks/lodash-CrMU6wKg.esm.js";import{D as U,W as D,v as A,l as R}from"../chunks/utils-C5hmbxa4.esm.js";import{u as s,g as j,A as P,d as g,_,c as O,e as d,f as V}from"../chunks/index-Beh5bQDw.esm.js";import{a as W}from"../chunks/share-button-CIP03E7T.esm.js";import{c as G,d as K,e as M}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import{s as h,a as q}from"../chunks/share-button-C-QLknal.esm.js";import{partnerLogosConfigDefaults as Y}from"./beam-partner-logos.esm.js";import{c as H}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";const l={en:{descriptionTitle:({nonprofitName:a="a nonprofit"})=>`You just made an impact for ${a}`,descriptionSubtitle:({brandName:a=""})=>`Check out the impact your ${a} purchase made below.`,yourImpactTitle:()=>"You\u2019re funding",communityImpactTitle:()=>"Together we\u2019re funding",personalImpactLinkCopy:({nonprofitName:a=""})=>`Learn about ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`See all of the ${a} community's impact`,impactShareButton:()=>"Share to Grow Your Impact"},fr:{descriptionTitle:({nonprofitName:a="une organisation"})=>`Vous avez cr\xE9\xE9 un impact pour ${a}`,descriptionSubtitle:({brandName:a=""})=>`D\xE9couvrez ci-dessous l'impact de votre achat ${a}.`,yourImpactTitle:()=>"Vous financez",communityImpactTitle:()=>"Ensemble, nous finan\xE7ons",personalImpactLinkCopy:({nonprofitName:a=""})=>`En savoir plus sur ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Voir tout l'impact de la communaut\xE9 ${a}`,impactShareButton:()=>"Partagez pour d\xE9velopper votre impact"},de:{descriptionTitle:({nonprofitName:a="eine Organisation"})=>`Du hast einen Beitrag f\xFCr ${a} geleistet`,descriptionSubtitle:({brandName:a=""})=>`Sieh dir unten den Beitrag an, den dein ${a} Einkauf gemacht hat.`,yourImpactTitle:()=>"Du finanzierst",communityImpactTitle:()=>"Gemeinsam finanzieren wir",personalImpactLinkCopy:({nonprofitName:a=""})=>`Mehr \xFCber ${a} erfahren`,communityImpactLinkCopy:({brandName:a=""})=>`Sieh dir den gesamten Beitrag der ${a}-Community an`,impactShareButton:()=>"Teile, um deinen Beitrag zu vergr\xF6\xDFern"},es:{descriptionTitle:({nonprofitName:a="una organizaci\xF3n"})=>`Generaste un impacto para ${a}`,descriptionSubtitle:({brandName:a=""})=>`Mira a continuaci\xF3n el impacto que tu compra de ${a} ha generado.`,yourImpactTitle:()=>"Est\xE1s financiando",communityImpactTitle:()=>"Juntos estamos financiando",personalImpactLinkCopy:({nonprofitName:a=""})=>`Conoce m\xE1s sobre ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Mira todo el impacto de la comunidad ${a}`,impactShareButton:()=>"Comparte para hacer crecer tu impacto"},it:{descriptionTitle:({nonprofitName:a="un'organizzazione"})=>`Hai creato un impatto per ${a}`,descriptionSubtitle:({brandName:a=""})=>`Scopri qui sotto l'impatto del tuo acquisto ${a}.`,yourImpactTitle:()=>"Stai finanziando",communityImpactTitle:()=>"Insieme stiamo finanziando",personalImpactLinkCopy:({nonprofitName:a=""})=>`Scopri di pi\xF9 su ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Guarda tutto l'impatto della comunit\xE0 ${a}`,impactShareButton:()=>"Condividi per far crescere il tuo impatto"},pl:{descriptionTitle:({nonprofitName:a="organizacj\u0119"})=>`Wywar\u0142a\u015B_e\u015B wp\u0142yw na ${a}`,descriptionSubtitle:({brandName:a=""})=>`Sprawd\u017A poni\u017Cej, jaki wp\u0142yw mia\u0142 Tw\xF3j zakup ${a}.`,yourImpactTitle:()=>"Finansujesz",communityImpactTitle:()=>"Razem finansujemy",personalImpactLinkCopy:({nonprofitName:a=""})=>`Dowiedz si\u0119 wi\u0119cej o ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Zobacz ca\u0142y wp\u0142yw spo\u0142eczno\u015Bci ${a}`,impactShareButton:()=>"Udost\u0119pnij, aby powi\u0119kszy\u0107 sw\xF3j wp\u0142yw"},ja:{descriptionTitle:({nonprofitName:a=""})=>`\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\uFF01${a}\u3078\u306E\u5BC4\u4ED8\u306B\u3088\u308A\u3001\u4E16\u754C\u306B\u78BA\u304B\u306A\u5909\u5316\u3092\u3082\u305F\u3089\u3057\u307E\u3057\u305F\u3002`,descriptionSubtitle:({brandName:a=""})=>`${a}\u3067\u306E\u3054\u8CFC\u5165\u304C\u3001\u3069\u306E\u3088\u3046\u306B\u4EBA\u3005\u306E\u5F79\u306B\u7ACB\u3064\u304B\u3092\u3054\u78BA\u8A8D\u304F\u3060\u3055\u3044\u3002`,yourImpactTitle:()=>"\u3042\u306A\u305F\u306E\u652F\u63F4\u5B9F\u7E3E",communityImpactTitle:()=>"\u79C1\u305F\u3061\u306F\u5171\u306B\u652F\u63F4\u3057\u3066\u3044\u307E\u3059",personalImpactLinkCopy:({nonprofitName:a=""})=>`${a} \u306B\u3064\u3044\u3066\u8A73\u3057\u304F\u898B\u308B`,communityImpactLinkCopy:({brandName:a=""})=>`${a}\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u306E\u6D3B\u52D5\u5B9F\u7E3E\u3092\u3059\u3079\u3066\u898B\u308B `,impactShareButton:()=>"SNS\u3067\u30B7\u30A7\u30A2\u3059\u308B"}};var J=Object.defineProperty,i=(a,e,r,p)=>{for(var n=void 0,m=a.length-1,o;m>=0;m--)(o=a[m])&&(n=o(e,r,n)||n);return n&&J(e,r,n),n};class t extends N{constructor(){super(...arguments),this.baseUrl=U,this.lang="en",this.debug=!1,this.draftConfig=!1,this.getImpactData=async()=>(M(["apiKey","userId","nonprofitId"],this),await j({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{nonprofitId:this.nonprofitId,beamUserId:this.userId,personalImpactLimit:1,communityImpactLimit:1,storeId:this.storeId,widgetName:D.impact_overview,version:"1.0.0",draftConfig:this.draftConfig,lang:this.configLang,discountCodes:this.discountCodes&&this.discountCodes.length>0?this.discountCodes:void 0,transactionId:this.transactionId??void 0}})),this.impactDataController=new P(this,this.getImpactData),this.resizeElements=F(()=>{h(this.impactTitleRefs),h(this.impactDescriptionRefs),h(this.impactLinkRefs),h(this.goalCompletionTextRefs)},50,{maxWait:50,leading:!0})}get configLang(){return A[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const r=["baseUrl","storeId","apiKey","userId","lang","discountCodes"];for(const p of r)if(e.has(p)){await this.impactDataController.exec();break}this.resizeElements(),await this.handleFontLoad(this.resizeElements)}disconnectedCallback(){window.removeEventListener("resize",this.resizeElements),document.fonts.removeEventListener("loadingdone",this.resizeElements),super.disconnectedCallback()}async handleFontLoad(e){if(document.fonts.status==="loading")return await document.fonts.ready.catch(r=>R.error(r)),e()}renderCard({imageUrl:e,title:r,percentFunded:p,goalProgressText:n,description:m,urlCopy:o,impactUrl:b,isImage:u,cardType:y,goalCompletionText:v}){return T`
1
+ import{i as k,n as c,g as f,a as N,h as $,b as T}from"../chunks/lit-BEag9MFp.esm.js";import{d as F}from"../chunks/lodash-CrMU6wKg.esm.js";import{D as U,W as D,x as A,l as R}from"../chunks/utils-ly9wMwUO.esm.js";import{u as s,g as j,A as P,d as g,_,c as O,e as d,f as V}from"../chunks/index-tkscjKkq.esm.js";import{a as W}from"../chunks/share-button-DP2wLhmP.esm.js";import{c as G,d as K,e as M}from"../chunks/css-card-grid-tjA36yWj.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import{s as h,a as q}from"../chunks/share-button-CqrSfHAr.esm.js";import{partnerLogosConfigDefaults as Y}from"./beam-partner-logos.esm.js";import{c as H}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";const l={en:{descriptionTitle:({nonprofitName:a="a nonprofit"})=>`You just made an impact for ${a}`,descriptionSubtitle:({brandName:a=""})=>`Check out the impact your ${a} purchase made below.`,yourImpactTitle:()=>"You\u2019re funding",communityImpactTitle:()=>"Together we\u2019re funding",personalImpactLinkCopy:({nonprofitName:a=""})=>`Learn about ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`See all of the ${a} community's impact`,impactShareButton:()=>"Share to Grow Your Impact"},fr:{descriptionTitle:({nonprofitName:a="une organisation"})=>`Vous avez cr\xE9\xE9 un impact pour ${a}`,descriptionSubtitle:({brandName:a=""})=>`D\xE9couvrez ci-dessous l'impact de votre achat ${a}.`,yourImpactTitle:()=>"Vous financez",communityImpactTitle:()=>"Ensemble, nous finan\xE7ons",personalImpactLinkCopy:({nonprofitName:a=""})=>`En savoir plus sur ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Voir tout l'impact de la communaut\xE9 ${a}`,impactShareButton:()=>"Partagez pour d\xE9velopper votre impact"},de:{descriptionTitle:({nonprofitName:a="eine Organisation"})=>`Du hast einen Beitrag f\xFCr ${a} geleistet`,descriptionSubtitle:({brandName:a=""})=>`Sieh dir unten den Beitrag an, den dein ${a} Einkauf gemacht hat.`,yourImpactTitle:()=>"Du finanzierst",communityImpactTitle:()=>"Gemeinsam finanzieren wir",personalImpactLinkCopy:({nonprofitName:a=""})=>`Mehr \xFCber ${a} erfahren`,communityImpactLinkCopy:({brandName:a=""})=>`Sieh dir den gesamten Beitrag der ${a}-Community an`,impactShareButton:()=>"Teile, um deinen Beitrag zu vergr\xF6\xDFern"},es:{descriptionTitle:({nonprofitName:a="una organizaci\xF3n"})=>`Generaste un impacto para ${a}`,descriptionSubtitle:({brandName:a=""})=>`Mira a continuaci\xF3n el impacto que tu compra de ${a} ha generado.`,yourImpactTitle:()=>"Est\xE1s financiando",communityImpactTitle:()=>"Juntos estamos financiando",personalImpactLinkCopy:({nonprofitName:a=""})=>`Conoce m\xE1s sobre ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Mira todo el impacto de la comunidad ${a}`,impactShareButton:()=>"Comparte para hacer crecer tu impacto"},it:{descriptionTitle:({nonprofitName:a="un'organizzazione"})=>`Hai creato un impatto per ${a}`,descriptionSubtitle:({brandName:a=""})=>`Scopri qui sotto l'impatto del tuo acquisto ${a}.`,yourImpactTitle:()=>"Stai finanziando",communityImpactTitle:()=>"Insieme stiamo finanziando",personalImpactLinkCopy:({nonprofitName:a=""})=>`Scopri di pi\xF9 su ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Guarda tutto l'impatto della comunit\xE0 ${a}`,impactShareButton:()=>"Condividi per far crescere il tuo impatto"},pl:{descriptionTitle:({nonprofitName:a="organizacj\u0119"})=>`Wywar\u0142a\u015B_e\u015B wp\u0142yw na ${a}`,descriptionSubtitle:({brandName:a=""})=>`Sprawd\u017A poni\u017Cej, jaki wp\u0142yw mia\u0142 Tw\xF3j zakup ${a}.`,yourImpactTitle:()=>"Finansujesz",communityImpactTitle:()=>"Razem finansujemy",personalImpactLinkCopy:({nonprofitName:a=""})=>`Dowiedz si\u0119 wi\u0119cej o ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Zobacz ca\u0142y wp\u0142yw spo\u0142eczno\u015Bci ${a}`,impactShareButton:()=>"Udost\u0119pnij, aby powi\u0119kszy\u0107 sw\xF3j wp\u0142yw"},ja:{descriptionTitle:({nonprofitName:a=""})=>`\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\uFF01${a}\u3078\u306E\u5BC4\u4ED8\u306B\u3088\u308A\u3001\u4E16\u754C\u306B\u78BA\u304B\u306A\u5909\u5316\u3092\u3082\u305F\u3089\u3057\u307E\u3057\u305F\u3002`,descriptionSubtitle:({brandName:a=""})=>`${a}\u3067\u306E\u3054\u8CFC\u5165\u304C\u3001\u3069\u306E\u3088\u3046\u306B\u4EBA\u3005\u306E\u5F79\u306B\u7ACB\u3064\u304B\u3092\u3054\u78BA\u8A8D\u304F\u3060\u3055\u3044\u3002`,yourImpactTitle:()=>"\u3042\u306A\u305F\u306E\u652F\u63F4\u5B9F\u7E3E",communityImpactTitle:()=>"\u79C1\u305F\u3061\u306F\u5171\u306B\u652F\u63F4\u3057\u3066\u3044\u307E\u3059",personalImpactLinkCopy:({nonprofitName:a=""})=>`${a} \u306B\u3064\u3044\u3066\u8A73\u3057\u304F\u898B\u308B`,communityImpactLinkCopy:({brandName:a=""})=>`${a}\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u306E\u6D3B\u52D5\u5B9F\u7E3E\u3092\u3059\u3079\u3066\u898B\u308B `,impactShareButton:()=>"SNS\u3067\u30B7\u30A7\u30A2\u3059\u308B"}};var J=Object.defineProperty,i=(a,e,r,p)=>{for(var n=void 0,m=a.length-1,o;m>=0;m--)(o=a[m])&&(n=o(e,r,n)||n);return n&&J(e,r,n),n};class t extends N{constructor(){super(...arguments),this.baseUrl=U,this.lang="en",this.debug=!1,this.draftConfig=!1,this.getImpactData=async()=>(M(["apiKey","userId","nonprofitId"],this),await j({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{nonprofitId:this.nonprofitId,beamUserId:this.userId,personalImpactLimit:1,communityImpactLimit:1,storeId:this.storeId,widgetName:D.impact_overview,version:"1.0.0",draftConfig:this.draftConfig,lang:this.configLang,discountCodes:this.discountCodes&&this.discountCodes.length>0?this.discountCodes:void 0,transactionId:this.transactionId??void 0}})),this.impactDataController=new P(this,this.getImpactData),this.resizeElements=F(()=>{h(this.impactTitleRefs),h(this.impactDescriptionRefs),h(this.impactLinkRefs),h(this.goalCompletionTextRefs)},50,{maxWait:50,leading:!0})}get configLang(){return A[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const r=["baseUrl","storeId","apiKey","userId","lang","discountCodes"];for(const p of r)if(e.has(p)){await this.impactDataController.exec();break}this.resizeElements(),await this.handleFontLoad(this.resizeElements)}disconnectedCallback(){window.removeEventListener("resize",this.resizeElements),document.fonts.removeEventListener("loadingdone",this.resizeElements),super.disconnectedCallback()}async handleFontLoad(e){if(document.fonts.status==="loading")return await document.fonts.ready.catch(r=>R.error(r)),e()}renderCard({imageUrl:e,title:r,percentFunded:p,goalProgressText:n,description:m,urlCopy:o,impactUrl:b,isImage:u,cardType:y,goalCompletionText:v}){return T`
2
2
  <div class="impact-card ${u?"":"icon"}" part="impact-card">
3
3
  <div class="${u?"":"icon-background "}">
4
4
  <img
@@ -1,4 +1,4 @@
1
- import{i as k,n as c,g as f,a as N,h as $,b as T}from"../chunks/lit-BEag9MFp.esm.js";import{d as F}from"../chunks/lodash-CrMU6wKg.esm.js";import{D as U,W as D,v as A,l as R}from"../chunks/utils-C5hmbxa4.esm.js";import{u as s,g as j,A as P,d as g,_,c as O,e as d,f as V}from"../chunks/index-Beh5bQDw.esm.js";import{a as W}from"../chunks/share-button-CIP03E7T.esm.js";import{c as G,d as K,e as M}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import{s as h,a as q}from"../chunks/share-button-C-QLknal.esm.js";import{partnerLogosConfigDefaults as Y}from"./beam-partner-logos.js";import{c as H}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";const l={en:{descriptionTitle:({nonprofitName:a="a nonprofit"})=>`You just made an impact for ${a}`,descriptionSubtitle:({brandName:a=""})=>`Check out the impact your ${a} purchase made below.`,yourImpactTitle:()=>"You\u2019re funding",communityImpactTitle:()=>"Together we\u2019re funding",personalImpactLinkCopy:({nonprofitName:a=""})=>`Learn about ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`See all of the ${a} community's impact`,impactShareButton:()=>"Share to Grow Your Impact"},fr:{descriptionTitle:({nonprofitName:a="une organisation"})=>`Vous avez cr\xE9\xE9 un impact pour ${a}`,descriptionSubtitle:({brandName:a=""})=>`D\xE9couvrez ci-dessous l'impact de votre achat ${a}.`,yourImpactTitle:()=>"Vous financez",communityImpactTitle:()=>"Ensemble, nous finan\xE7ons",personalImpactLinkCopy:({nonprofitName:a=""})=>`En savoir plus sur ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Voir tout l'impact de la communaut\xE9 ${a}`,impactShareButton:()=>"Partagez pour d\xE9velopper votre impact"},de:{descriptionTitle:({nonprofitName:a="eine Organisation"})=>`Du hast einen Beitrag f\xFCr ${a} geleistet`,descriptionSubtitle:({brandName:a=""})=>`Sieh dir unten den Beitrag an, den dein ${a} Einkauf gemacht hat.`,yourImpactTitle:()=>"Du finanzierst",communityImpactTitle:()=>"Gemeinsam finanzieren wir",personalImpactLinkCopy:({nonprofitName:a=""})=>`Mehr \xFCber ${a} erfahren`,communityImpactLinkCopy:({brandName:a=""})=>`Sieh dir den gesamten Beitrag der ${a}-Community an`,impactShareButton:()=>"Teile, um deinen Beitrag zu vergr\xF6\xDFern"},es:{descriptionTitle:({nonprofitName:a="una organizaci\xF3n"})=>`Generaste un impacto para ${a}`,descriptionSubtitle:({brandName:a=""})=>`Mira a continuaci\xF3n el impacto que tu compra de ${a} ha generado.`,yourImpactTitle:()=>"Est\xE1s financiando",communityImpactTitle:()=>"Juntos estamos financiando",personalImpactLinkCopy:({nonprofitName:a=""})=>`Conoce m\xE1s sobre ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Mira todo el impacto de la comunidad ${a}`,impactShareButton:()=>"Comparte para hacer crecer tu impacto"},it:{descriptionTitle:({nonprofitName:a="un'organizzazione"})=>`Hai creato un impatto per ${a}`,descriptionSubtitle:({brandName:a=""})=>`Scopri qui sotto l'impatto del tuo acquisto ${a}.`,yourImpactTitle:()=>"Stai finanziando",communityImpactTitle:()=>"Insieme stiamo finanziando",personalImpactLinkCopy:({nonprofitName:a=""})=>`Scopri di pi\xF9 su ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Guarda tutto l'impatto della comunit\xE0 ${a}`,impactShareButton:()=>"Condividi per far crescere il tuo impatto"},pl:{descriptionTitle:({nonprofitName:a="organizacj\u0119"})=>`Wywar\u0142a\u015B_e\u015B wp\u0142yw na ${a}`,descriptionSubtitle:({brandName:a=""})=>`Sprawd\u017A poni\u017Cej, jaki wp\u0142yw mia\u0142 Tw\xF3j zakup ${a}.`,yourImpactTitle:()=>"Finansujesz",communityImpactTitle:()=>"Razem finansujemy",personalImpactLinkCopy:({nonprofitName:a=""})=>`Dowiedz si\u0119 wi\u0119cej o ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Zobacz ca\u0142y wp\u0142yw spo\u0142eczno\u015Bci ${a}`,impactShareButton:()=>"Udost\u0119pnij, aby powi\u0119kszy\u0107 sw\xF3j wp\u0142yw"},ja:{descriptionTitle:({nonprofitName:a=""})=>`\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\uFF01${a}\u3078\u306E\u5BC4\u4ED8\u306B\u3088\u308A\u3001\u4E16\u754C\u306B\u78BA\u304B\u306A\u5909\u5316\u3092\u3082\u305F\u3089\u3057\u307E\u3057\u305F\u3002`,descriptionSubtitle:({brandName:a=""})=>`${a}\u3067\u306E\u3054\u8CFC\u5165\u304C\u3001\u3069\u306E\u3088\u3046\u306B\u4EBA\u3005\u306E\u5F79\u306B\u7ACB\u3064\u304B\u3092\u3054\u78BA\u8A8D\u304F\u3060\u3055\u3044\u3002`,yourImpactTitle:()=>"\u3042\u306A\u305F\u306E\u652F\u63F4\u5B9F\u7E3E",communityImpactTitle:()=>"\u79C1\u305F\u3061\u306F\u5171\u306B\u652F\u63F4\u3057\u3066\u3044\u307E\u3059",personalImpactLinkCopy:({nonprofitName:a=""})=>`${a} \u306B\u3064\u3044\u3066\u8A73\u3057\u304F\u898B\u308B`,communityImpactLinkCopy:({brandName:a=""})=>`${a}\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u306E\u6D3B\u52D5\u5B9F\u7E3E\u3092\u3059\u3079\u3066\u898B\u308B `,impactShareButton:()=>"SNS\u3067\u30B7\u30A7\u30A2\u3059\u308B"}};var J=Object.defineProperty,i=(a,e,r,p)=>{for(var n=void 0,m=a.length-1,o;m>=0;m--)(o=a[m])&&(n=o(e,r,n)||n);return n&&J(e,r,n),n};class t extends N{constructor(){super(...arguments),this.baseUrl=U,this.lang="en",this.debug=!1,this.draftConfig=!1,this.getImpactData=async()=>(M(["apiKey","userId","nonprofitId"],this),await j({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{nonprofitId:this.nonprofitId,beamUserId:this.userId,personalImpactLimit:1,communityImpactLimit:1,storeId:this.storeId,widgetName:D.impact_overview,version:"1.0.0",draftConfig:this.draftConfig,lang:this.configLang,discountCodes:this.discountCodes&&this.discountCodes.length>0?this.discountCodes:void 0,transactionId:this.transactionId??void 0}})),this.impactDataController=new P(this,this.getImpactData),this.resizeElements=F(()=>{h(this.impactTitleRefs),h(this.impactDescriptionRefs),h(this.impactLinkRefs),h(this.goalCompletionTextRefs)},50,{maxWait:50,leading:!0})}get configLang(){return A[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const r=["baseUrl","storeId","apiKey","userId","lang","discountCodes"];for(const p of r)if(e.has(p)){await this.impactDataController.exec();break}this.resizeElements(),await this.handleFontLoad(this.resizeElements)}disconnectedCallback(){window.removeEventListener("resize",this.resizeElements),document.fonts.removeEventListener("loadingdone",this.resizeElements),super.disconnectedCallback()}async handleFontLoad(e){if(document.fonts.status==="loading")return await document.fonts.ready.catch(r=>R.error(r)),e()}renderCard({imageUrl:e,title:r,percentFunded:p,goalProgressText:n,description:m,urlCopy:o,impactUrl:b,isImage:u,cardType:y,goalCompletionText:v}){return T`
1
+ import{i as k,n as c,g as f,a as N,h as $,b as T}from"../chunks/lit-BEag9MFp.esm.js";import{d as F}from"../chunks/lodash-CrMU6wKg.esm.js";import{D as U,W as D,x as A,l as R}from"../chunks/utils-ly9wMwUO.esm.js";import{u as s,g as j,A as P,d as g,_,c as O,e as d,f as V}from"../chunks/index-tkscjKkq.esm.js";import{a as W}from"../chunks/share-button-DP2wLhmP.esm.js";import{c as G,d as K,e as M}from"../chunks/css-card-grid-tjA36yWj.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import{s as h,a as q}from"../chunks/share-button-CqrSfHAr.esm.js";import{partnerLogosConfigDefaults as Y}from"./beam-partner-logos.js";import{c as H}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";const l={en:{descriptionTitle:({nonprofitName:a="a nonprofit"})=>`You just made an impact for ${a}`,descriptionSubtitle:({brandName:a=""})=>`Check out the impact your ${a} purchase made below.`,yourImpactTitle:()=>"You\u2019re funding",communityImpactTitle:()=>"Together we\u2019re funding",personalImpactLinkCopy:({nonprofitName:a=""})=>`Learn about ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`See all of the ${a} community's impact`,impactShareButton:()=>"Share to Grow Your Impact"},fr:{descriptionTitle:({nonprofitName:a="une organisation"})=>`Vous avez cr\xE9\xE9 un impact pour ${a}`,descriptionSubtitle:({brandName:a=""})=>`D\xE9couvrez ci-dessous l'impact de votre achat ${a}.`,yourImpactTitle:()=>"Vous financez",communityImpactTitle:()=>"Ensemble, nous finan\xE7ons",personalImpactLinkCopy:({nonprofitName:a=""})=>`En savoir plus sur ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Voir tout l'impact de la communaut\xE9 ${a}`,impactShareButton:()=>"Partagez pour d\xE9velopper votre impact"},de:{descriptionTitle:({nonprofitName:a="eine Organisation"})=>`Du hast einen Beitrag f\xFCr ${a} geleistet`,descriptionSubtitle:({brandName:a=""})=>`Sieh dir unten den Beitrag an, den dein ${a} Einkauf gemacht hat.`,yourImpactTitle:()=>"Du finanzierst",communityImpactTitle:()=>"Gemeinsam finanzieren wir",personalImpactLinkCopy:({nonprofitName:a=""})=>`Mehr \xFCber ${a} erfahren`,communityImpactLinkCopy:({brandName:a=""})=>`Sieh dir den gesamten Beitrag der ${a}-Community an`,impactShareButton:()=>"Teile, um deinen Beitrag zu vergr\xF6\xDFern"},es:{descriptionTitle:({nonprofitName:a="una organizaci\xF3n"})=>`Generaste un impacto para ${a}`,descriptionSubtitle:({brandName:a=""})=>`Mira a continuaci\xF3n el impacto que tu compra de ${a} ha generado.`,yourImpactTitle:()=>"Est\xE1s financiando",communityImpactTitle:()=>"Juntos estamos financiando",personalImpactLinkCopy:({nonprofitName:a=""})=>`Conoce m\xE1s sobre ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Mira todo el impacto de la comunidad ${a}`,impactShareButton:()=>"Comparte para hacer crecer tu impacto"},it:{descriptionTitle:({nonprofitName:a="un'organizzazione"})=>`Hai creato un impatto per ${a}`,descriptionSubtitle:({brandName:a=""})=>`Scopri qui sotto l'impatto del tuo acquisto ${a}.`,yourImpactTitle:()=>"Stai finanziando",communityImpactTitle:()=>"Insieme stiamo finanziando",personalImpactLinkCopy:({nonprofitName:a=""})=>`Scopri di pi\xF9 su ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Guarda tutto l'impatto della comunit\xE0 ${a}`,impactShareButton:()=>"Condividi per far crescere il tuo impatto"},pl:{descriptionTitle:({nonprofitName:a="organizacj\u0119"})=>`Wywar\u0142a\u015B_e\u015B wp\u0142yw na ${a}`,descriptionSubtitle:({brandName:a=""})=>`Sprawd\u017A poni\u017Cej, jaki wp\u0142yw mia\u0142 Tw\xF3j zakup ${a}.`,yourImpactTitle:()=>"Finansujesz",communityImpactTitle:()=>"Razem finansujemy",personalImpactLinkCopy:({nonprofitName:a=""})=>`Dowiedz si\u0119 wi\u0119cej o ${a}`,communityImpactLinkCopy:({brandName:a=""})=>`Zobacz ca\u0142y wp\u0142yw spo\u0142eczno\u015Bci ${a}`,impactShareButton:()=>"Udost\u0119pnij, aby powi\u0119kszy\u0107 sw\xF3j wp\u0142yw"},ja:{descriptionTitle:({nonprofitName:a=""})=>`\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\uFF01${a}\u3078\u306E\u5BC4\u4ED8\u306B\u3088\u308A\u3001\u4E16\u754C\u306B\u78BA\u304B\u306A\u5909\u5316\u3092\u3082\u305F\u3089\u3057\u307E\u3057\u305F\u3002`,descriptionSubtitle:({brandName:a=""})=>`${a}\u3067\u306E\u3054\u8CFC\u5165\u304C\u3001\u3069\u306E\u3088\u3046\u306B\u4EBA\u3005\u306E\u5F79\u306B\u7ACB\u3064\u304B\u3092\u3054\u78BA\u8A8D\u304F\u3060\u3055\u3044\u3002`,yourImpactTitle:()=>"\u3042\u306A\u305F\u306E\u652F\u63F4\u5B9F\u7E3E",communityImpactTitle:()=>"\u79C1\u305F\u3061\u306F\u5171\u306B\u652F\u63F4\u3057\u3066\u3044\u307E\u3059",personalImpactLinkCopy:({nonprofitName:a=""})=>`${a} \u306B\u3064\u3044\u3066\u8A73\u3057\u304F\u898B\u308B`,communityImpactLinkCopy:({brandName:a=""})=>`${a}\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u306E\u6D3B\u52D5\u5B9F\u7E3E\u3092\u3059\u3079\u3066\u898B\u308B `,impactShareButton:()=>"SNS\u3067\u30B7\u30A7\u30A2\u3059\u308B"}};var J=Object.defineProperty,i=(a,e,r,p)=>{for(var n=void 0,m=a.length-1,o;m>=0;m--)(o=a[m])&&(n=o(e,r,n)||n);return n&&J(e,r,n),n};class t extends N{constructor(){super(...arguments),this.baseUrl=U,this.lang="en",this.debug=!1,this.draftConfig=!1,this.getImpactData=async()=>(M(["apiKey","userId","nonprofitId"],this),await j({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{nonprofitId:this.nonprofitId,beamUserId:this.userId,personalImpactLimit:1,communityImpactLimit:1,storeId:this.storeId,widgetName:D.impact_overview,version:"1.0.0",draftConfig:this.draftConfig,lang:this.configLang,discountCodes:this.discountCodes&&this.discountCodes.length>0?this.discountCodes:void 0,transactionId:this.transactionId??void 0}})),this.impactDataController=new P(this,this.getImpactData),this.resizeElements=F(()=>{h(this.impactTitleRefs),h(this.impactDescriptionRefs),h(this.impactLinkRefs),h(this.goalCompletionTextRefs)},50,{maxWait:50,leading:!0})}get configLang(){return A[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.resizeElements)}async updated(e){const r=["baseUrl","storeId","apiKey","userId","lang","discountCodes"];for(const p of r)if(e.has(p)){await this.impactDataController.exec();break}this.resizeElements(),await this.handleFontLoad(this.resizeElements)}disconnectedCallback(){window.removeEventListener("resize",this.resizeElements),document.fonts.removeEventListener("loadingdone",this.resizeElements),super.disconnectedCallback()}async handleFontLoad(e){if(document.fonts.status==="loading")return await document.fonts.ready.catch(r=>R.error(r)),e()}renderCard({imageUrl:e,title:r,percentFunded:p,goalProgressText:n,description:m,urlCopy:o,impactUrl:b,isImage:u,cardType:y,goalCompletionText:v}){return T`
2
2
  <div class="impact-card ${u?"":"icon"}" part="impact-card">
3
3
  <div class="${u?"":"icon-background "}">
4
4
  <img
@@ -12,7 +12,7 @@ export { BeamSocialShare } from './social-share.js';
12
12
  export { BeamSubscriberSelectNonprofit } from './subscriber-select-nonprofit.js';
13
13
  import 'lit';
14
14
  import 'lit-html';
15
- import '../chunks/utils-BPcZ5h8J.esm.js';
15
+ import '../chunks/utils-DfsVjUY-.esm.js';
16
16
  import 'lodash-es/debounce';
17
17
  import 'lodash-es/isEqual';
18
18
  import 'lodash';
@@ -1,2 +1,2 @@
1
- import{BeamCommunityImpact as S}from"./community-impact.esm.js";import{BeamCumulativeImpact as b}from"./cumulative-impact.esm.js";import{BeamImpactOverview as P}from"./impact-overview.esm.js";import{BeamSelectNonprofit as N}from"./select-nonprofit.esm.js";import{B as g}from"../chunks/index-BebFL9KU.esm.js";import{B as C}from"../chunks/index-B8g4VHgI.esm.js";import{BeamSubscriptionManagement as y}from"./subscription-management.esm.js";import{BeamSubscriptionImpact as M}from"./subscription-impact.esm.js";import{BeamProductDetailsPage as R}from"./product-details-page.esm.js";import{BeamSelectSubscriptionNonprofit as j}from"./select-subscription-nonprofit.esm.js";import{BeamSocialShare as q}from"./social-share.esm.js";import{BeamSubscriberSelectNonprofit as A}from"./subscriber-select-nonprofit.esm.js";import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Beh5bQDw.esm.js";import"../chunks/share-button-CIP03E7T.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-C-QLknal.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/handlebars-B_i-to-h.esm.js";export{S as BeamCommunityImpact,b as BeamCumulativeImpact,P as BeamImpactOverview,C as BeamPostPurchase,R as BeamProductDetailsPage,g as BeamRedeemTransaction,N as BeamSelectNonprofit,j as BeamSelectSubscriptionNonprofit,q as BeamSocialShare,A as BeamSubscriberSelectNonprofit,M as BeamSubscriptionImpact,y as BeamSubscriptionManagement};
1
+ import{BeamCommunityImpact as S}from"./community-impact.esm.js";import{BeamCumulativeImpact as b}from"./cumulative-impact.esm.js";import{BeamImpactOverview as P}from"./impact-overview.esm.js";import{BeamSelectNonprofit as N}from"./select-nonprofit.esm.js";import{B as g}from"../chunks/index-C8pScO8d.esm.js";import{B as C}from"../chunks/index-U1QpwjdF.esm.js";import{BeamSubscriptionManagement as y}from"./subscription-management.esm.js";import{BeamSubscriptionImpact as M}from"./subscription-impact.esm.js";import{BeamProductDetailsPage as R}from"./product-details-page.esm.js";import{BeamSelectSubscriptionNonprofit as j}from"./select-subscription-nonprofit.esm.js";import{BeamSocialShare as q}from"./social-share.esm.js";import{BeamSubscriberSelectNonprofit as A}from"./subscriber-select-nonprofit.esm.js";import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/css-card-grid-tjA36yWj.esm.js";import"../chunks/utils-ly9wMwUO.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-tkscjKkq.esm.js";import"../chunks/share-button-DP2wLhmP.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-CqrSfHAr.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/handlebars-3tRO54kz.esm.js";export{S as BeamCommunityImpact,b as BeamCumulativeImpact,P as BeamImpactOverview,C as BeamPostPurchase,R as BeamProductDetailsPage,g as BeamRedeemTransaction,N as BeamSelectNonprofit,j as BeamSelectSubscriptionNonprofit,q as BeamSocialShare,A as BeamSubscriberSelectNonprofit,M as BeamSubscriptionImpact,y as BeamSubscriptionManagement};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,2 +1,2 @@
1
- import{BeamCommunityImpact as S}from"./community-impact.js";import{BeamCumulativeImpact as b}from"./cumulative-impact.js";import{BeamImpactOverview as P}from"./impact-overview.js";import{BeamSelectNonprofit as N}from"./select-nonprofit.js";import{B as g}from"../chunks/index-B-QZylCa.esm.js";import{B as C}from"../chunks/index-BX0p4BVY.esm.js";import{BeamSubscriptionManagement as y}from"./subscription-management.js";import{BeamSubscriptionImpact as M}from"./subscription-impact.js";import{BeamProductDetailsPage as R}from"./product-details-page.js";import{BeamSelectSubscriptionNonprofit as j}from"./select-subscription-nonprofit.js";import{BeamSocialShare as q}from"./social-share.js";import{BeamSubscriberSelectNonprofit as A}from"./subscriber-select-nonprofit.js";import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Beh5bQDw.esm.js";import"../chunks/share-button-CIP03E7T.esm.js";import"./beam-partner-logos.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-C-QLknal.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/handlebars-B_i-to-h.esm.js";export{S as BeamCommunityImpact,b as BeamCumulativeImpact,P as BeamImpactOverview,C as BeamPostPurchase,R as BeamProductDetailsPage,g as BeamRedeemTransaction,N as BeamSelectNonprofit,j as BeamSelectSubscriptionNonprofit,q as BeamSocialShare,A as BeamSubscriberSelectNonprofit,M as BeamSubscriptionImpact,y as BeamSubscriptionManagement};
1
+ import{BeamCommunityImpact as S}from"./community-impact.js";import{BeamCumulativeImpact as b}from"./cumulative-impact.js";import{BeamImpactOverview as P}from"./impact-overview.js";import{BeamSelectNonprofit as N}from"./select-nonprofit.js";import{B as g}from"../chunks/index-lSPlMuMz.esm.js";import{B as C}from"../chunks/index-BiOlmhqL.esm.js";import{BeamSubscriptionManagement as y}from"./subscription-management.js";import{BeamSubscriptionImpact as M}from"./subscription-impact.js";import{BeamProductDetailsPage as R}from"./product-details-page.js";import{BeamSelectSubscriptionNonprofit as j}from"./select-subscription-nonprofit.js";import{BeamSocialShare as q}from"./social-share.js";import{BeamSubscriberSelectNonprofit as A}from"./subscriber-select-nonprofit.js";import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/css-card-grid-tjA36yWj.esm.js";import"../chunks/utils-ly9wMwUO.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-tkscjKkq.esm.js";import"../chunks/share-button-DP2wLhmP.esm.js";import"./beam-partner-logos.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-CqrSfHAr.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/handlebars-3tRO54kz.esm.js";export{S as BeamCommunityImpact,b as BeamCumulativeImpact,P as BeamImpactOverview,C as BeamPostPurchase,R as BeamProductDetailsPage,g as BeamRedeemTransaction,N as BeamSelectNonprofit,j as BeamSelectSubscriptionNonprofit,q as BeamSocialShare,A as BeamSubscriberSelectNonprofit,M as BeamSubscriptionImpact,y as BeamSubscriptionManagement};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
- import { L as LANGUAGES, d as TCart } from '../chunks/utils-BPcZ5h8J.esm.js';
4
+ import { L as LANGUAGES, d as TCart } from '../chunks/utils-DfsVjUY-.esm.js';
5
5
  import './redeem-transaction.js';
6
6
  import './impact-overview.js';
7
7
  import 'lodash-es/debounce';
@@ -1,2 +1,2 @@
1
- import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/index-Beh5bQDw.esm.js";import"../chunks/index-BebFL9KU.esm.js";import"./impact-overview.esm.js";import{B as b}from"../chunks/index-B8g4VHgI.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-CIP03E7T.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-C-QLknal.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";export{b as BeamPostPurchase};
1
+ import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/utils-ly9wMwUO.esm.js";import"../chunks/css-card-grid-tjA36yWj.esm.js";import"../chunks/index-tkscjKkq.esm.js";import"../chunks/index-C8pScO8d.esm.js";import"./impact-overview.esm.js";import{B as b}from"../chunks/index-U1QpwjdF.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-DP2wLhmP.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-CqrSfHAr.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";export{b as BeamPostPurchase};
2
2
  //# sourceMappingURL=post-purchase.esm.js.map
@@ -1,2 +1,2 @@
1
- import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/index-Beh5bQDw.esm.js";import"../chunks/index-B-QZylCa.esm.js";import"./impact-overview.js";import{B as b}from"../chunks/index-BX0p4BVY.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-CIP03E7T.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-C-QLknal.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";export{b as BeamPostPurchase};
1
+ import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/utils-ly9wMwUO.esm.js";import"../chunks/css-card-grid-tjA36yWj.esm.js";import"../chunks/index-tkscjKkq.esm.js";import"../chunks/index-lSPlMuMz.esm.js";import"./impact-overview.js";import{B as b}from"../chunks/index-BiOlmhqL.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-DP2wLhmP.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-CqrSfHAr.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";export{b as BeamPostPurchase};
2
2
  //# sourceMappingURL=post-purchase.js.map
@@ -2,7 +2,7 @@ import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
4
  import { p as postProductDetailsPage } from '../chunks/routes-BW8Dd3C1.esm.js';
5
- import { T as TUrl, L as LANGUAGES } from '../chunks/utils-BPcZ5h8J.esm.js';
5
+ import { T as TUrl, L as LANGUAGES } from '../chunks/utils-DfsVjUY-.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,4 +1,4 @@
1
- import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9MFp.esm.js";import{u as b,B as G,l as W,A as M,c as R,d as k,e as D,f as _}from"../chunks/index-Beh5bQDw.esm.js";import{D as O,z as j,A as H,h as U,C as K,E as w,W as y,x as N,v as V,F as q,G as J,H as Y,I as Z,m as S}from"../chunks/utils-C5hmbxa4.esm.js";import{c as Q,d as X,e as ee}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as te}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/_share-dialog-dependencies-DsJ2sKCC.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{p as oe}from"../chunks/promo-pill-label-BWPhroK6.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const ae=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},ie=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return E(` border-radius: var(${a}-borderRadius, ${e});
1
+ import{m as E,b as r,i as B,n as p,r as A,a as z,h as L}from"../chunks/lit-BEag9MFp.esm.js";import{u as b,B as G,l as W,A as M,c as R,d as k,e as D,f as _}from"../chunks/index-tkscjKkq.esm.js";import{D as O,A as j,C as H,h as U,E as K,F as w,W as y,y as N,x as V,G as q,H as J,I as Y,J as Z,m as S}from"../chunks/utils-ly9wMwUO.esm.js";import{c as Q,d as X,e as ee}from"../chunks/css-card-grid-tjA36yWj.esm.js";import{c as te}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/_share-dialog-dependencies-DPid-O65.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{p as oe}from"../chunks/promo-pill-label-DYR3PZH7.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const ae=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},ie=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return E(` border-radius: var(${a}-borderRadius, ${e});
2
2
  border-style: var(${a}-borderStyle, ${t});
3
3
  border-color: var(${a}-borderColor, ${o});
4
4
  border-width: var(${a}-borderWidth, ${i});
@@ -17,7 +17,7 @@ import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9
17
17
  <circle cx="12" cy="12" r="10"></circle>
18
18
  <path d="M12 16v-4"></path>
19
19
  <path d="M12 8h.01"></path>
20
- </svg>`,v={en:{ctaTitle:()=>"Choose Your Impact",ctaMessage:()=>"At no extra cost, 1% of every order will be donated to a nonprofit you choose. Add to cart to choose. Powered by Beam",inlineSeparator:()=>":"},fr:{ctaTitle:()=>"Choisissez votre impact",ctaMessage:()=>"Sans frais suppl\xE9mentaires, 1 % de chaque commande est revers\xE9 \xE0 l'association de votre choix. Ajoutez au panier pour choisir. Propuls\xE9 par Beam.",inlineSeparator:()=>":"},es:{ctaTitle:()=>"Elige tu impacto",ctaMessage:()=>"Sin coste adicional, el 1 % de cada pedido se dona a la organizaci\xF3n sin \xE1nimo de lucro que elijas. A\xF1\xE1delo al carrito para elegir. Impulsado por Beam.",inlineSeparator:()=>":"},de:{ctaTitle:()=>"W\xE4hlen Sie Ihren Impact",ctaMessage:()=>"Ohne zus\xE4tzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gew\xE4hlte gemeinn\xFCtzige Organisation gespendet. Zum Warenkorb hinzuf\xFCgen, um auszuw\xE4hlen. Unterst\xFCtzt von Beam.",inlineSeparator:()=>":"},it:{ctaTitle:()=>"Scegli il tuo impatto",ctaMessage:()=>"L'1 % di ogni acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a tua scelta. Aggiungi al carrello per scegliere. Promosso da Beam.",inlineSeparator:()=>":"},pl:{ctaTitle:()=>"Wybierz sw\xF3j wp\u0142yw",ctaMessage:()=>"1 % warto\u015Bci ka\u017Cdego zam\xF3wienia przekazywany jest na wybran\u0105 przez Ciebie organizacj\u0119 non-profit \u2013 bez dodatkowych koszt\xF3w. Dodaj do koszyka, aby wybra\u0107. Obs\u0142ugiwane przez Beam.",inlineSeparator:()=>":"},ja:{ctaTitle:()=>"\u5BC4\u4ED8\u5148\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002",ctaMessage:()=>"\u8FFD\u52A0\u8CBB\u7528\u306A\u3057\u3067\u3001\u3054\u6CE8\u6587\u91D1\u984D\u306E1%\u3092\u975E\u55B6\u5229\u56E3\u4F53\u3078\u5BC4\u4ED8\u3067\u304D\u307E\u3059\u3002\u3054\u5E0C\u671B\u306E\u5834\u5408\u3001\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0\u3057\u3066\u5BC4\u4ED8\u5185\u5BB9\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002Powered by Beam",inlineSeparator:()=>":"}};var se=Object.defineProperty,c=(n,e,t,o)=>{for(var i=void 0,a=n.length-1,l;a>=0;a--)(l=n[a])&&(i=l(e,t,i)||i);return i&&se(e,t,i),i};const le="--beam-ProductDetailsPage-imageUrl";class s extends A{constructor(){super(...arguments),this.baseUrl=O,this.lang="en",this.draftConfig=!1,this.debug=!1,this.localStorage=j(this),this.pluginPromoCodes=[],this.handlePromoCodesStored=e=>{const t=(e.detail.promoCodes?.unvalidatedPromoCodes??[]).map(o=>o.attributes?.value??o.attributes?.url??"").sort();this.pluginPromoCodes=t},this.postProductDetailsPageData=async()=>{ee(["apiKey","storeId"],this);const e=H(G,{apiKey:this.apiKey}),t=this.getManualPromoCodes(),o=U(t.map(l=>({value:l})),this.apiKey),i=o&&!K(o);i&&this.dispatchEvent(new w({source:y.product_details_page}));const a=await W({baseUrl:this.baseUrl,headers:N(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:y.product_details_page,draftConfig:this.draftConfig,remoteProductIdentifier:this.remoteProductIdentifier},requestBody:{...i&&{promos:o},beamCartId:e||void 0}});return this.handleValidatedPromoCodes(a),a},this.productDetailsPageDataController=new M(this,this.postProductDetailsPageData)}get configLang(){return V[this.lang]||"en"}get parsedPromoCodes(){return q(this.promoCodes)}getManualPromoCodes(){if(this.parsedPromoCodes&&this.parsedPromoCodes.length>0)return this.parsedPromoCodes;const e=this.localStorage.getItemJson("cart");return e?J(e):[]}async handleValidatedPromoCodes(e){e.promos?.validatedPromoCodes?.length&&(await Promise.all([Y({apiKey:this.apiKey,promoCodes:{validatedPromoCodes:e.promos.validatedPromoCodes,unvalidatedPromoCodes:[]}}),Z({validatedPromoCodes:e.promos.validatedPromoCodes,domain:this.domain})]),this.dispatchEvent(new w({source:y.product_details_page})))}async firstUpdated(){window.addEventListener(S.eventName,this.handlePromoCodesStored)}disconnectedCallback(){window.removeEventListener(S.eventName,this.handlePromoCodesStored),super.disconnectedCallback()}async updated(e){const t=["storeId","baseUrl","lang","apiKey","pluginPromoCodes","promoCodes"];this.pluginPromoCodes;for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}render(){const{data:e,loading:t}=this.productDetailsPageDataController,o=this.cssVariables["--beam-ProductDetailsPage-image-placement"],i=P=>P!=="0px"&&P!=="0",a=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayPromoPill"]==="true",l=!!e?.config?.web?.promo,g=i(this.cssVariables["--beam-ProductDetailsPage-imageHeight"]),h=i(this.cssVariables["--beam-ProductDetailsPage-title-fontSize"]),u=a&&l&&g&&h,m=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayColon"]==="true";return t?r``:e==null?this.debug?R({error:new Error("No data")}):"":r`
20
+ </svg>`,v={en:{ctaTitle:()=>"Choose Your Impact",ctaMessage:()=>"At no extra cost, 1% of every order will be donated to a nonprofit you choose. Add to cart to choose. Powered by Beam",inlineSeparator:()=>":"},fr:{ctaTitle:()=>"Choisissez votre impact",ctaMessage:()=>"Sans frais suppl\xE9mentaires, 1 % de chaque commande est revers\xE9 \xE0 l'association de votre choix. Ajoutez au panier pour choisir. Propuls\xE9 par Beam.",inlineSeparator:()=>":"},es:{ctaTitle:()=>"Elige tu impacto",ctaMessage:()=>"Sin coste adicional, el 1 % de cada pedido se dona a la organizaci\xF3n sin \xE1nimo de lucro que elijas. A\xF1\xE1delo al carrito para elegir. Impulsado por Beam.",inlineSeparator:()=>":"},de:{ctaTitle:()=>"W\xE4hlen Sie Ihren Impact",ctaMessage:()=>"Ohne zus\xE4tzliche Kosten wird 1 % jeder Bestellung an eine von Ihnen gew\xE4hlte gemeinn\xFCtzige Organisation gespendet. Zum Warenkorb hinzuf\xFCgen, um auszuw\xE4hlen. Unterst\xFCtzt von Beam.",inlineSeparator:()=>":"},it:{ctaTitle:()=>"Scegli il tuo impatto",ctaMessage:()=>"L'1 % di ogni acquisto viene donato, senza alcun costo aggiuntivo, a un'organizzazione no-profit a tua scelta. Aggiungi al carrello per scegliere. Promosso da Beam.",inlineSeparator:()=>":"},pl:{ctaTitle:()=>"Wybierz sw\xF3j wp\u0142yw",ctaMessage:()=>"1 % warto\u015Bci ka\u017Cdego zam\xF3wienia przekazywany jest na wybran\u0105 przez Ciebie organizacj\u0119 non-profit \u2013 bez dodatkowych koszt\xF3w. Dodaj do koszyka, aby wybra\u0107. Obs\u0142ugiwane przez Beam.",inlineSeparator:()=>":"},ja:{ctaTitle:()=>"\u5BC4\u4ED8\u5148\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002",ctaMessage:()=>"\u8FFD\u52A0\u8CBB\u7528\u306A\u3057\u3067\u3001\u3054\u6CE8\u6587\u91D1\u984D\u306E1%\u3092\u975E\u55B6\u5229\u56E3\u4F53\u3078\u5BC4\u4ED8\u3067\u304D\u307E\u3059\u3002\u3054\u5E0C\u671B\u306E\u5834\u5408\u3001\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0\u3057\u3066\u5BC4\u4ED8\u5185\u5BB9\u3092\u304A\u9078\u3073\u304F\u3060\u3055\u3044\u3002Powered by Beam",inlineSeparator:()=>":"}};var se=Object.defineProperty,c=(n,e,t,o)=>{for(var i=void 0,a=n.length-1,l;a>=0;a--)(l=n[a])&&(i=l(e,t,i)||i);return i&&se(e,t,i),i};const le="--beam-ProductDetailsPage-imageUrl";class s extends z{constructor(){super(...arguments),this.baseUrl=O,this.lang="en",this.draftConfig=!1,this.debug=!1,this.localStorage=j(this),this.pluginPromoCodes=[],this.handlePromoCodesStored=e=>{const t=(e.detail.promoCodes?.unvalidatedPromoCodes??[]).map(o=>o.attributes?.value??o.attributes?.url??"").sort();this.pluginPromoCodes=t},this.postProductDetailsPageData=async()=>{ee(["apiKey","storeId"],this);const e=H(G,{apiKey:this.apiKey}),t=this.getManualPromoCodes(),o=U(t.map(l=>({value:l})),this.apiKey),i=o&&!K(o);i&&this.dispatchEvent(new w({source:y.product_details_page}));const a=await W({baseUrl:this.baseUrl,headers:N(this.apiKey),queryParams:{version:"1.0.0",lang:this.configLang,storeId:this.storeId,widgetName:y.product_details_page,draftConfig:this.draftConfig,remoteProductIdentifier:this.remoteProductIdentifier},requestBody:{...i&&{promos:o},beamCartId:e||void 0}});return this.handleValidatedPromoCodes(a),a},this.productDetailsPageDataController=new M(this,this.postProductDetailsPageData)}get configLang(){return V[this.lang]||"en"}get parsedPromoCodes(){return q(this.promoCodes)}getManualPromoCodes(){if(this.parsedPromoCodes&&this.parsedPromoCodes.length>0)return this.parsedPromoCodes;const e=this.localStorage.getItemJson("cart");return e?J(e):[]}async handleValidatedPromoCodes(e){e.promos?.validatedPromoCodes?.length&&(await Promise.all([Y({apiKey:this.apiKey,promoCodes:{validatedPromoCodes:e.promos.validatedPromoCodes,unvalidatedPromoCodes:[]}}),Z({validatedPromoCodes:e.promos.validatedPromoCodes,domain:this.domain})]),this.dispatchEvent(new w({source:y.product_details_page})))}async firstUpdated(){window.addEventListener(S.eventName,this.handlePromoCodesStored)}disconnectedCallback(){window.removeEventListener(S.eventName,this.handlePromoCodesStored),super.disconnectedCallback()}async updated(e){const t=["storeId","baseUrl","lang","apiKey","pluginPromoCodes","promoCodes"];this.pluginPromoCodes;for(const o of t)if(e.has(o)){await this.productDetailsPageDataController.exec();break}}render(){const{data:e,loading:t}=this.productDetailsPageDataController,o=this.cssVariables["--beam-ProductDetailsPage-image-placement"],i=P=>P!=="0px"&&P!=="0",a=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayPromoPill"]==="true",l=!!e?.config?.web?.promo,g=i(this.cssVariables["--beam-ProductDetailsPage-imageHeight"]),h=i(this.cssVariables["--beam-ProductDetailsPage-title-fontSize"]),u=a&&l&&g&&h,m=this.cssVariables["--beam-ProductDetailsPage-shouldDisplayColon"]==="true";return t?r``:e==null?this.debug?R({error:new Error("No data")}):"":r`
21
21
  <style>
22
22
  :host {
23
23
  ${this.cssVariables.toCSS()}
@@ -287,5 +287,5 @@ import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9
287
287
  color: var(--beam-ProductDetailsPage-TooltipIcon-color);
288
288
  height: auto;
289
289
  }
290
- `],c([p({type:String,reflect:!0})],s.prototype,"baseUrl"),c([p({type:String,reflect:!1})],s.prototype,"apiKey"),c([p({type:Number})],s.prototype,"storeId"),c([p({type:String})],s.prototype,"lang"),c([p({type:Boolean})],s.prototype,"draftConfig"),c([p({type:Boolean})],s.prototype,"debug"),c([p({type:String})],s.prototype,"remoteProductIdentifier"),c([p({type:String})],s.prototype,"promoCodes"),c([p({type:String})],s.prototype,"domain"),c([z()],s.prototype,"pluginPromoCodes"),X(s);export{s as BeamProductDetailsPage};
290
+ `],c([p({type:String,reflect:!0})],s.prototype,"baseUrl"),c([p({type:String,reflect:!1})],s.prototype,"apiKey"),c([p({type:Number})],s.prototype,"storeId"),c([p({type:String})],s.prototype,"lang"),c([p({type:Boolean})],s.prototype,"draftConfig"),c([p({type:Boolean})],s.prototype,"debug"),c([p({type:String})],s.prototype,"remoteProductIdentifier"),c([p({type:String})],s.prototype,"promoCodes"),c([p({type:String})],s.prototype,"domain"),c([A()],s.prototype,"pluginPromoCodes"),X(s);export{s as BeamProductDetailsPage};
291
291
  //# sourceMappingURL=product-details-page.esm.js.map