@beamimpact/web-sdk 1.31.4 → 1.35.0

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 (275) hide show
  1. package/README.md +1 -0
  2. package/dist/chunks/_share-dialog-dependencies--nCXrht1.esm.js +2 -0
  3. package/dist/chunks/_share-dialog-dependencies--nCXrht1.esm.js.map +1 -0
  4. package/dist/chunks/_share-dialog-dependencies-JnuxDcVY.esm.js +2 -0
  5. package/dist/chunks/_share-dialog-dependencies-JnuxDcVY.esm.js.map +1 -0
  6. package/dist/chunks/beam-errors-AMvTvR1C.esm.js.map +1 -1
  7. package/dist/chunks/beam-errors-bKCZlkvr.esm.d.ts +40 -0
  8. package/dist/chunks/{cart-contents-P2GzTrNn.esm.d.ts → cart-contents-22-v_s94.esm.d.ts} +1 -1
  9. package/dist/chunks/{css-card-grid-RRkoiUTl.esm.js → css-card-grid-3b56QBzq.esm.js} +2 -2
  10. package/dist/chunks/{css-card-grid-RRkoiUTl.esm.js.map → css-card-grid-3b56QBzq.esm.js.map} +1 -1
  11. package/dist/chunks/{events-wNy5BoJV.esm.js → events-5IECSF-x.esm.js} +2 -2
  12. package/dist/chunks/events-5IECSF-x.esm.js.map +1 -0
  13. package/dist/chunks/{events-60jQoHQi.esm.d.ts → events-rt-wdsLM.esm.d.ts} +2 -2
  14. package/dist/chunks/index-46wslZBu.esm.js +2 -0
  15. package/dist/chunks/index-46wslZBu.esm.js.map +1 -0
  16. package/dist/chunks/index-9YcaEQju.esm.js +2 -0
  17. package/dist/chunks/index-9YcaEQju.esm.js.map +1 -0
  18. package/dist/chunks/{index-CItwC8WO.esm.d.ts → index-AMkIijwg.esm.d.ts} +1 -1
  19. package/dist/chunks/index-Bz6dEI8C.esm.js +2 -0
  20. package/dist/chunks/index-Bz6dEI8C.esm.js.map +1 -0
  21. package/dist/chunks/index-FAF7tYU6.esm.js +2 -0
  22. package/dist/chunks/index-FAF7tYU6.esm.js.map +1 -0
  23. package/dist/chunks/index-IOQZUYT9.esm.d.ts +34 -0
  24. package/dist/chunks/index-Rd8mJjwe.esm.js +2 -0
  25. package/dist/chunks/index-Rd8mJjwe.esm.js.map +1 -0
  26. package/dist/chunks/index-W0iPV4vm.esm.js +2 -0
  27. package/dist/chunks/index-W0iPV4vm.esm.js.map +1 -0
  28. package/dist/chunks/index-Z1UUeVXR.esm.js +2 -0
  29. package/dist/chunks/index-Z1UUeVXR.esm.js.map +1 -0
  30. package/dist/chunks/index-Zk8iwKr5.esm.js +2 -0
  31. package/dist/chunks/index-Zk8iwKr5.esm.js.map +1 -0
  32. package/dist/chunks/index-eVAoZiya.esm.js +2 -0
  33. package/dist/chunks/index-eVAoZiya.esm.js.map +1 -0
  34. package/dist/chunks/{index-L59voCOg.esm.d.ts → index-iPDohPMx.esm.d.ts} +1 -1
  35. package/dist/chunks/index-iiDaaPdW.esm.js +2 -0
  36. package/dist/chunks/index-iiDaaPdW.esm.js.map +1 -0
  37. package/dist/chunks/index-jVPzg3uh.esm.js +2 -0
  38. package/dist/chunks/index-jVPzg3uh.esm.js.map +1 -0
  39. package/dist/chunks/{index-l_MORcbP.esm.d.ts → index-m-fP6Gj8.esm.d.ts} +3 -3
  40. package/dist/chunks/index-rrdYIcOi.esm.js +2 -0
  41. package/dist/chunks/index-rrdYIcOi.esm.js.map +1 -0
  42. package/dist/chunks/index-uqEAgdEf.esm.js +2 -0
  43. package/dist/chunks/index-uqEAgdEf.esm.js.map +1 -0
  44. package/dist/chunks/index-w9_XpjIg.esm.js +2 -0
  45. package/dist/chunks/index-w9_XpjIg.esm.js.map +1 -0
  46. package/dist/chunks/index-xERV1BQn.esm.d.ts +34 -0
  47. package/dist/chunks/{lit-h1W25hjN.esm.js → lit-yVXn5Cbs.esm.js} +2 -2
  48. package/dist/chunks/lit-yVXn5Cbs.esm.js.map +1 -0
  49. package/dist/chunks/localize-BGPniqcI.esm.js +30 -0
  50. package/dist/chunks/localize-BGPniqcI.esm.js.map +1 -0
  51. package/dist/chunks/{localize-z-KGe7Y5.esm.js → localize-dXHrlK8g.esm.js} +2 -2
  52. package/dist/chunks/localize-dXHrlK8g.esm.js.map +1 -0
  53. package/dist/chunks/{lodash-ZxBiuGue.esm.js → lodash-P8OIs-at.esm.js} +2 -2
  54. package/dist/chunks/{lodash-ZxBiuGue.esm.js.map → lodash-P8OIs-at.esm.js.map} +1 -1
  55. package/dist/chunks/order-page-247E9hPD.esm.js +2 -0
  56. package/dist/chunks/order-page-247E9hPD.esm.js.map +1 -0
  57. package/dist/chunks/order-page-7VBIeXrp.esm.js +2 -0
  58. package/dist/chunks/order-page-7VBIeXrp.esm.js.map +1 -0
  59. package/dist/chunks/{order-page-40SzBc--.esm.d.ts → order-page-FTsKtTWj.esm.d.ts} +14 -11
  60. package/dist/chunks/{progress-bar-w3yfrrxD.esm.js → progress-bar-7gWYaGlq.esm.js} +2 -2
  61. package/dist/chunks/{progress-bar-w3yfrrxD.esm.js.map → progress-bar-7gWYaGlq.esm.js.map} +1 -1
  62. package/dist/chunks/{responsive-Rehmv-eo.esm.js → responsive-LYEag6TI.esm.js} +2 -2
  63. package/dist/chunks/{responsive-Rehmv-eo.esm.js.map → responsive-LYEag6TI.esm.js.map} +1 -1
  64. package/dist/chunks/routes-KzMkFmoc.esm.js +2 -0
  65. package/dist/chunks/routes-KzMkFmoc.esm.js.map +1 -0
  66. package/dist/chunks/routes-zmj1xQav.esm.js +2 -0
  67. package/dist/chunks/routes-zmj1xQav.esm.js.map +1 -0
  68. package/dist/chunks/{update-cart-3nc7XKMm.esm.d.ts → update-cart-DtpiRKny.esm.d.ts} +1 -1
  69. package/dist/chunks/update-cart-lChG0pOq.esm.js +2 -0
  70. package/dist/chunks/update-cart-lChG0pOq.esm.js.map +1 -0
  71. package/dist/chunks/update-cart-zsVlorOS.esm.js +2 -0
  72. package/dist/chunks/update-cart-zsVlorOS.esm.js.map +1 -0
  73. package/dist/chunks/{vendor-IGhQoYCM.esm.js → vendor-eeJfrOkP.esm.js} +2 -2
  74. package/dist/chunks/{vendor-IGhQoYCM.esm.js.map → vendor-eeJfrOkP.esm.js.map} +1 -1
  75. package/dist/components/beam-partner-logos.esm.js +1 -1
  76. package/dist/components/beam-partner-logos.js +1 -1
  77. package/dist/components/community-impact.esm.js +1 -1
  78. package/dist/components/community-impact.esm.js.map +1 -1
  79. package/dist/components/community-impact.js +1 -1
  80. package/dist/components/community-impact.js.map +1 -1
  81. package/dist/components/cumulative-impact.esm.js +1 -1
  82. package/dist/components/cumulative-impact.esm.js.map +1 -1
  83. package/dist/components/cumulative-impact.js +1 -1
  84. package/dist/components/cumulative-impact.js.map +1 -1
  85. package/dist/components/impact-overview.esm.js +2 -2
  86. package/dist/components/impact-overview.esm.js.map +1 -1
  87. package/dist/components/impact-overview.js +2 -2
  88. package/dist/components/impact-overview.js.map +1 -1
  89. package/dist/components/index.d.ts +1 -1
  90. package/dist/components/index.esm.js +1 -1
  91. package/dist/components/index.js +1 -1
  92. package/dist/components/post-purchase.d.ts +3 -2
  93. package/dist/components/post-purchase.esm.js +3 -3
  94. package/dist/components/post-purchase.esm.js.map +1 -1
  95. package/dist/components/post-purchase.js +3 -3
  96. package/dist/components/post-purchase.js.map +1 -1
  97. package/dist/components/redeem-transaction.d.ts +2 -2
  98. package/dist/components/redeem-transaction.esm.js +1 -1
  99. package/dist/components/redeem-transaction.esm.js.map +1 -1
  100. package/dist/components/redeem-transaction.js +1 -1
  101. package/dist/components/redeem-transaction.js.map +1 -1
  102. package/dist/components/select-nonprofit.d.ts +2 -2
  103. package/dist/components/select-nonprofit.esm.js +3 -3
  104. package/dist/components/select-nonprofit.esm.js.map +1 -1
  105. package/dist/components/select-nonprofit.js +3 -3
  106. package/dist/components/select-nonprofit.js.map +1 -1
  107. package/dist/components/shopify.d.ts +6 -6
  108. package/dist/components/shopify.esm.js +1 -1
  109. package/dist/components/shopify.esm.js.map +1 -1
  110. package/dist/components/shopify.js +1 -1
  111. package/dist/components/shopify.js.map +1 -1
  112. package/dist/index.d.ts +19 -10
  113. package/dist/index.esm.js +1 -1
  114. package/dist/index.js +1 -1
  115. package/dist/integrations/beam.esm.js +1 -1
  116. package/dist/integrations/beam.esm.js.map +1 -1
  117. package/dist/integrations/beam.js +1 -1
  118. package/dist/integrations/beam.js.map +1 -1
  119. package/dist/integrations/cart.d.ts +2 -2
  120. package/dist/integrations/cart.esm.js +1 -1
  121. package/dist/integrations/cart.js +1 -1
  122. package/dist/integrations/index.d.ts +18 -10
  123. package/dist/integrations/index.esm.js +1 -1
  124. package/dist/integrations/index.js +1 -1
  125. package/dist/integrations/logs.esm.js +1 -1
  126. package/dist/integrations/logs.js +1 -1
  127. package/dist/integrations/session.esm.js +1 -1
  128. package/dist/integrations/session.js +1 -1
  129. package/dist/integrations/shopify.d.ts +3 -3
  130. package/dist/integrations/shopify.esm.js +1 -1
  131. package/dist/integrations/shopify.js +1 -1
  132. package/dist/integrations/statsig.esm.js +2 -2
  133. package/dist/integrations/statsig.esm.js.map +1 -1
  134. package/dist/integrations/statsig.js +2 -2
  135. package/dist/integrations/statsig.js.map +1 -1
  136. package/dist/integrations/utils.d.ts +13 -6
  137. package/dist/integrations/utils.esm.js +1 -1
  138. package/dist/integrations/utils.js +1 -1
  139. package/dist/react/beam-partner-logos.esm.js +1 -1
  140. package/dist/react/beam-partner-logos.js +1 -1
  141. package/dist/react/community-impact.esm.js +1 -1
  142. package/dist/react/community-impact.esm.js.map +1 -1
  143. package/dist/react/community-impact.js +1 -1
  144. package/dist/react/community-impact.js.map +1 -1
  145. package/dist/react/cumulative-impact.esm.js +1 -1
  146. package/dist/react/cumulative-impact.esm.js.map +1 -1
  147. package/dist/react/cumulative-impact.js +1 -1
  148. package/dist/react/cumulative-impact.js.map +1 -1
  149. package/dist/react/impact-overview.esm.js +1 -1
  150. package/dist/react/impact-overview.esm.js.map +1 -1
  151. package/dist/react/impact-overview.js +1 -1
  152. package/dist/react/impact-overview.js.map +1 -1
  153. package/dist/react/index.d.ts +2 -2
  154. package/dist/react/index.esm.js +1 -1
  155. package/dist/react/index.js +1 -1
  156. package/dist/react/post-purchase.d.ts +1 -1
  157. package/dist/react/post-purchase.esm.js +1 -1
  158. package/dist/react/post-purchase.esm.js.map +1 -1
  159. package/dist/react/post-purchase.js +1 -1
  160. package/dist/react/post-purchase.js.map +1 -1
  161. package/dist/react/redeem-transaction.d.ts +2 -2
  162. package/dist/react/redeem-transaction.esm.js +1 -1
  163. package/dist/react/redeem-transaction.esm.js.map +1 -1
  164. package/dist/react/redeem-transaction.js +1 -1
  165. package/dist/react/redeem-transaction.js.map +1 -1
  166. package/dist/react/select-nonprofit.d.ts +2 -2
  167. package/dist/react/select-nonprofit.esm.js +1 -1
  168. package/dist/react/select-nonprofit.esm.js.map +1 -1
  169. package/dist/react/select-nonprofit.js +1 -1
  170. package/dist/react/select-nonprofit.js.map +1 -1
  171. package/dist/react/shopify.d.ts +2 -2
  172. package/dist/utils/beam-errors.d.ts +1 -0
  173. package/dist/utils/beam-errors.esm.js +2 -0
  174. package/dist/utils/beam-errors.esm.js.map +1 -0
  175. package/dist/utils/beam-errors.js +2 -0
  176. package/dist/utils/beam-errors.js.map +1 -0
  177. package/dist/utils/cookies.d.ts +58 -0
  178. package/dist/utils/cookies.esm.js +2 -0
  179. package/dist/utils/cookies.esm.js.map +1 -0
  180. package/dist/utils/cookies.js +2 -0
  181. package/dist/utils/cookies.js.map +1 -0
  182. package/dist/utils/debounce.d.ts +1 -0
  183. package/dist/utils/debounce.esm.js +2 -0
  184. package/dist/utils/debounce.esm.js.map +1 -0
  185. package/dist/utils/debounce.js +2 -0
  186. package/dist/utils/debounce.js.map +1 -0
  187. package/dist/utils/events.d.ts +4 -0
  188. package/dist/utils/events.esm.js +2 -0
  189. package/dist/utils/events.esm.js.map +1 -0
  190. package/dist/utils/events.js +2 -0
  191. package/dist/utils/events.js.map +1 -0
  192. package/dist/utils/index.d.ts +14 -0
  193. package/dist/utils/index.esm.js +2 -0
  194. package/dist/utils/index.esm.js.map +1 -0
  195. package/dist/utils/index.js +2 -0
  196. package/dist/utils/index.js.map +1 -0
  197. package/dist/utils/is-equal.d.ts +1 -0
  198. package/dist/utils/is-equal.esm.js +2 -0
  199. package/dist/utils/is-equal.esm.js.map +1 -0
  200. package/dist/utils/is-equal.js +2 -0
  201. package/dist/utils/is-equal.js.map +1 -0
  202. package/dist/utils/local-storage.d.ts +19 -0
  203. package/dist/utils/local-storage.esm.js +2 -0
  204. package/dist/utils/local-storage.esm.js.map +1 -0
  205. package/dist/utils/local-storage.js +2 -0
  206. package/dist/utils/local-storage.js.map +1 -0
  207. package/dist/utils/logger.d.ts +8 -0
  208. package/dist/utils/logger.esm.js +2 -0
  209. package/dist/utils/logger.esm.js.map +1 -0
  210. package/dist/utils/logger.js +2 -0
  211. package/dist/utils/logger.js.map +1 -0
  212. package/dist/utils/memoize-last.d.ts +17 -0
  213. package/dist/utils/memoize-last.esm.js +2 -0
  214. package/dist/utils/memoize-last.esm.js.map +1 -0
  215. package/dist/utils/memoize-last.js +2 -0
  216. package/dist/utils/memoize-last.js.map +1 -0
  217. package/dist/utils/network-listeners.d.ts +5 -0
  218. package/dist/utils/network-listeners.esm.js +2 -0
  219. package/dist/utils/network-listeners.esm.js.map +1 -0
  220. package/dist/utils/network-listeners.js +2 -0
  221. package/dist/utils/network-listeners.js.map +1 -0
  222. package/dist/utils/remote-session.d.ts +9 -0
  223. package/dist/utils/remote-session.esm.js +2 -0
  224. package/dist/utils/remote-session.esm.js.map +1 -0
  225. package/dist/utils/remote-session.js +2 -0
  226. package/dist/utils/remote-session.js.map +1 -0
  227. package/dist/utils/wait-for-element.d.ts +5 -0
  228. package/dist/utils/wait-for-element.esm.js +2 -0
  229. package/dist/utils/wait-for-element.esm.js.map +1 -0
  230. package/dist/utils/wait-for-element.js +2 -0
  231. package/dist/utils/wait-for-element.js.map +1 -0
  232. package/package.json +1 -1
  233. package/dist/chunks/_share-dialog-dependencies-UT3NgapK.esm.js +0 -2
  234. package/dist/chunks/_share-dialog-dependencies-UT3NgapK.esm.js.map +0 -1
  235. package/dist/chunks/_share-dialog-dependencies-yxOcNNpK.esm.js +0 -2
  236. package/dist/chunks/_share-dialog-dependencies-yxOcNNpK.esm.js.map +0 -1
  237. package/dist/chunks/cookies-H8TCP4v0.esm.js +0 -2
  238. package/dist/chunks/cookies-H8TCP4v0.esm.js.map +0 -1
  239. package/dist/chunks/events-wNy5BoJV.esm.js.map +0 -1
  240. package/dist/chunks/index-4ckY2-Lc.esm.js +0 -2
  241. package/dist/chunks/index-4ckY2-Lc.esm.js.map +0 -1
  242. package/dist/chunks/index-FZ0yrk2j.esm.js +0 -2
  243. package/dist/chunks/index-FZ0yrk2j.esm.js.map +0 -1
  244. package/dist/chunks/index-PXYriqGw.esm.js +0 -2
  245. package/dist/chunks/index-PXYriqGw.esm.js.map +0 -1
  246. package/dist/chunks/index-UODI8bvb.esm.js +0 -2
  247. package/dist/chunks/index-UODI8bvb.esm.js.map +0 -1
  248. package/dist/chunks/index-YKvnw1cF.esm.js +0 -2
  249. package/dist/chunks/index-YKvnw1cF.esm.js.map +0 -1
  250. package/dist/chunks/index-Zzs4grqC.esm.d.ts +0 -156
  251. package/dist/chunks/index-f-fjpKtx.esm.js +0 -2
  252. package/dist/chunks/index-f-fjpKtx.esm.js.map +0 -1
  253. package/dist/chunks/index-fXIUzndi.esm.js +0 -2
  254. package/dist/chunks/index-fXIUzndi.esm.js.map +0 -1
  255. package/dist/chunks/index-hrwZmHHJ.esm.js +0 -2
  256. package/dist/chunks/index-hrwZmHHJ.esm.js.map +0 -1
  257. package/dist/chunks/index-stfehQ0s.esm.js +0 -2
  258. package/dist/chunks/index-stfehQ0s.esm.js.map +0 -1
  259. package/dist/chunks/lit-h1W25hjN.esm.js.map +0 -1
  260. package/dist/chunks/local-storage-GYvYzZ_j.esm.js +0 -2
  261. package/dist/chunks/local-storage-GYvYzZ_j.esm.js.map +0 -1
  262. package/dist/chunks/localize-z-KGe7Y5.esm.js.map +0 -1
  263. package/dist/chunks/network-listeners-6tkaLA3D.esm.d.ts +0 -9
  264. package/dist/chunks/network-listeners-O5LKv8Yy.esm.js +0 -2
  265. package/dist/chunks/network-listeners-O5LKv8Yy.esm.js.map +0 -1
  266. package/dist/chunks/order-page-8P0D98JI.esm.js +0 -2
  267. package/dist/chunks/order-page-8P0D98JI.esm.js.map +0 -1
  268. package/dist/chunks/order-page-cWc57Sl-.esm.js +0 -2
  269. package/dist/chunks/order-page-cWc57Sl-.esm.js.map +0 -1
  270. package/dist/chunks/remote-session-V4YG-mcS.esm.js +0 -2
  271. package/dist/chunks/remote-session-V4YG-mcS.esm.js.map +0 -1
  272. package/dist/chunks/routes-RQDFRUiD.esm.js +0 -2
  273. package/dist/chunks/routes-RQDFRUiD.esm.js.map +0 -1
  274. package/dist/chunks/update-cart-qXTq0EoJ.esm.js +0 -2
  275. package/dist/chunks/update-cart-qXTq0EoJ.esm.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ import '../chunks/cart-contents-22-v_s94.esm.js';
2
+ import '../chunks/types-7kSi85Gv.esm.js';
3
+ export { b as BeamCartChangeEvent, c as BeamCartCreatedEvent, a as BeamNetworkCallEvent, B as BeamNonprofitSelectEvent, d as BeamOrderCreatedEvent, f as BeamStatusChangeEvent } from '../chunks/events-rt-wdsLM.esm.js';
4
+ import '../chunks/openapi-spec-scRfHArN.esm.js';
@@ -0,0 +1,2 @@
1
+ import{f as t,a as r,d as n,c as m,b as s,B}from"../chunks/events-5IECSF-x.esm.js";export{t as BeamCartChangeEvent,r as BeamCartCreatedEvent,n as BeamNetworkCallEvent,m as BeamNonprofitSelectEvent,s as BeamOrderCreatedEvent,B as BeamStatusChangeEvent};
2
+ //# sourceMappingURL=events.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{f as t,a as r,d as n,c as m,b as s,B}from"../chunks/events-5IECSF-x.esm.js";export{t as BeamCartChangeEvent,r as BeamCartCreatedEvent,n as BeamNetworkCallEvent,m as BeamNonprofitSelectEvent,s as BeamOrderCreatedEvent,B as BeamStatusChangeEvent};
2
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ export { b as errors } from '../chunks/beam-errors-bKCZlkvr.esm.js';
2
+ export { e as events } from '../chunks/events-rt-wdsLM.esm.js';
3
+ export { logger } from './logger.js';
4
+ export { fetchProxy, initNetworkListeners, xhrProxy } from './network-listeners.js';
5
+ export { createScopedLocalStorage } from './local-storage.js';
6
+ export { waitForElement } from './wait-for-element.js';
7
+ export { CookieChangeEvent, deleteCookieValue, getCookieMap, getCookieValue, setCookieValue } from './cookies.js';
8
+ export { getRemoteSession, saveRemoteSession } from './remote-session.js';
9
+ export { memoizeLast } from './memoize-last.js';
10
+ export { default as debounce } from 'lodash-es/debounce';
11
+ export { default as isEqual } from 'lodash-es/isEqual';
12
+ import '../chunks/cart-contents-22-v_s94.esm.js';
13
+ import '../chunks/openapi-spec-scRfHArN.esm.js';
14
+ import '../chunks/types-7kSi85Gv.esm.js';
@@ -0,0 +1,2 @@
1
+ import{b as r}from"../chunks/beam-errors-AMvTvR1C.esm.js";import{e as s}from"../chunks/events-5IECSF-x.esm.js";import{logger as m}from"./logger.esm.js";import{fetchProxy as x,initNetworkListeners as p,xhrProxy as f}from"./network-listeners.esm.js";import{createScopedLocalStorage as n}from"./local-storage.esm.js";import{waitForElement as c}from"./wait-for-element.esm.js";import{deleteCookieValue as u,getCookieMap as d,getCookieValue as C,setCookieValue as S}from"./cookies.esm.js";import{getRemoteSession as V,saveRemoteSession as b}from"./remote-session.esm.js";import{memoizeLast as v}from"./memoize-last.esm.js";import{d as y,i as E}from"../chunks/lodash-P8OIs-at.esm.js";export{n as createScopedLocalStorage,y as debounce,u as deleteCookieValue,r as errors,s as events,x as fetchProxy,d as getCookieMap,C as getCookieValue,V as getRemoteSession,p as initNetworkListeners,E as isEqual,m as logger,v as memoizeLast,b as saveRemoteSession,S as setCookieValue,c as waitForElement,f as xhrProxy};
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{b as r}from"../chunks/beam-errors-AMvTvR1C.esm.js";import{e as s}from"../chunks/events-5IECSF-x.esm.js";import{logger as m}from"./logger.js";import{fetchProxy as x,initNetworkListeners as p,xhrProxy as f}from"./network-listeners.js";import{createScopedLocalStorage as n}from"./local-storage.js";import{waitForElement as c}from"./wait-for-element.js";import{deleteCookieValue as u,getCookieMap as d,getCookieValue as C,setCookieValue as S}from"./cookies.js";import{getRemoteSession as V,saveRemoteSession as b}from"./remote-session.js";import{memoizeLast as v}from"./memoize-last.js";import{d as y,i as E}from"../chunks/lodash-P8OIs-at.esm.js";export{n as createScopedLocalStorage,y as debounce,u as deleteCookieValue,r as errors,s as events,x as fetchProxy,d as getCookieMap,C as getCookieValue,V as getRemoteSession,p as initNetworkListeners,E as isEqual,m as logger,v as memoizeLast,b as saveRemoteSession,S as setCookieValue,c as waitForElement,f as xhrProxy};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export { default as isEqual } from 'lodash-es/isEqual';
@@ -0,0 +1,2 @@
1
+ import{i as o}from"../chunks/lodash-P8OIs-at.esm.js";export{o as isEqual};
2
+ //# sourceMappingURL=is-equal.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-equal.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{i as o}from"../chunks/lodash-P8OIs-at.esm.js";export{o as isEqual};
2
+ //# sourceMappingURL=is-equal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-equal.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Creates an object that has the same API as normal localStorage, but adds a beam_ prefix and apiKey postfix to keys
3
+ * Also adds helper methods for JSON (de-)serialization
4
+ */
5
+ declare const createScopedLocalStorage: (config: {
6
+ apiKey: string;
7
+ }) => {
8
+ readonly prefix: string;
9
+ readonly postfix: string;
10
+ getItem(key: string): string | null;
11
+ setItem(key: string, value: unknown): void;
12
+ removeItem(key: string): void;
13
+ /** Safely parses value as JSON and return JS object */
14
+ getItemJson<T = Record<string, unknown>>(key: string): T | null;
15
+ /** Safely stringifies value as JSON */
16
+ setItemJson(key: string, value: object): void;
17
+ };
18
+
19
+ export { createScopedLocalStorage };
@@ -0,0 +1,2 @@
1
+ import{L as o}from"../chunks/beam-errors-AMvTvR1C.esm.js";const s=r=>({get prefix(){return"beam_"},get postfix(){return`_key_${r.apiKey}`},getItem(e){return localStorage.getItem(this.prefix+e+this.postfix)},setItem(e,t){return localStorage.setItem(this.prefix+e+this.postfix,`${t}`)},removeItem(e){return localStorage.removeItem(this.prefix+e+this.postfix)},getItemJson(e){try{const t=this.getItem(e);if(t)return JSON.parse(t)}catch{console.error(new o(`Could not parse JSON: ${e}`))}return null},setItemJson(e,t){return this.setItem(e,JSON.stringify(t))}});export{s as createScopedLocalStorage};
2
+ //# sourceMappingURL=local-storage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-storage.esm.js","sources":["../../src/utils/local-storage.ts"],"sourcesContent":["import { LocalStorageError } from \"./beam-errors\";\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 // TODO: this is where we can check the schema version and do cleanup/migrations of old data\n // TODO: consider using a single Beam key in localstorage and storing JSON 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 console.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"],"names":["createScopedLocalStorage","config","key","value","json","LocalStorageError"],"mappings":"0DAMa,MAAAA,EAA4BC,IAGhC,CACL,IAAI,QAAS,CACX,MAAO,OACT,EACA,IAAI,SAAU,CACZ,MAAO,QAAQA,EAAO,MAAM,EAC9B,EACA,QAAQC,EAA4B,CAClC,OAAO,aAAa,QAAQ,KAAK,OAASA,EAAM,KAAK,OAAO,CAC9D,EACA,QAAQA,EAAaC,EAAgB,CACnC,OAAO,aAAa,QAAQ,KAAK,OAASD,EAAM,KAAK,QAAS,GAAGC,CAAK,EAAE,CAC1E,EACA,WAAWD,EAAa,CACtB,OAAO,aAAa,WAAW,KAAK,OAASA,EAAM,KAAK,OAAO,CACjE,EAEA,YAAyCA,EAAa,CACpD,GAAI,CACF,MAAME,EAAO,KAAK,QAAQF,CAAG,EAC7B,GAAIE,EACF,OAAO,KAAK,MAAMA,CAAI,CAE1B,MAAc,CACZ,QAAQ,MAAM,IAAIC,EAAkB,yBAAyBH,CAAG,EAAE,CAAC,CACrE,CACA,OAAO,IACT,EAEA,YAAYA,EAAaC,EAAe,CACtC,OAAO,KAAK,QAAQD,EAAK,KAAK,UAAUC,CAAK,CAAC,CAChD,CACF"}
@@ -0,0 +1,2 @@
1
+ import{L as o}from"../chunks/beam-errors-AMvTvR1C.esm.js";const s=r=>({get prefix(){return"beam_"},get postfix(){return`_key_${r.apiKey}`},getItem(e){return localStorage.getItem(this.prefix+e+this.postfix)},setItem(e,t){return localStorage.setItem(this.prefix+e+this.postfix,`${t}`)},removeItem(e){return localStorage.removeItem(this.prefix+e+this.postfix)},getItemJson(e){try{const t=this.getItem(e);if(t)return JSON.parse(t)}catch{console.error(new o(`Could not parse JSON: ${e}`))}return null},setItemJson(e,t){return this.setItem(e,JSON.stringify(t))}});export{s as createScopedLocalStorage};
2
+ //# sourceMappingURL=local-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-storage.js","sources":["../../src/utils/local-storage.ts"],"sourcesContent":["import { LocalStorageError } from \"./beam-errors\";\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 // TODO: this is where we can check the schema version and do cleanup/migrations of old data\n // TODO: consider using a single Beam key in localstorage and storing JSON 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 console.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"],"names":["createScopedLocalStorage","config","key","value","json","LocalStorageError"],"mappings":"0DAMa,MAAAA,EAA4BC,IAGhC,CACL,IAAI,QAAS,CACX,MAAO,OACT,EACA,IAAI,SAAU,CACZ,MAAO,QAAQA,EAAO,MAAM,EAC9B,EACA,QAAQC,EAA4B,CAClC,OAAO,aAAa,QAAQ,KAAK,OAASA,EAAM,KAAK,OAAO,CAC9D,EACA,QAAQA,EAAaC,EAAgB,CACnC,OAAO,aAAa,QAAQ,KAAK,OAASD,EAAM,KAAK,QAAS,GAAGC,CAAK,EAAE,CAC1E,EACA,WAAWD,EAAa,CACtB,OAAO,aAAa,WAAW,KAAK,OAASA,EAAM,KAAK,OAAO,CACjE,EAEA,YAAyCA,EAAa,CACpD,GAAI,CACF,MAAME,EAAO,KAAK,QAAQF,CAAG,EAC7B,GAAIE,EACF,OAAO,KAAK,MAAMA,CAAI,CAE1B,MAAc,CACZ,QAAQ,MAAM,IAAIC,EAAkB,yBAAyBH,CAAG,EAAE,CAAC,CACrE,CACA,OAAO,IACT,EAEA,YAAYA,EAAaC,EAAe,CACtC,OAAO,KAAK,QAAQD,EAAK,KAAK,UAAUC,CAAK,CAAC,CAChD,CACF"}
@@ -0,0 +1,8 @@
1
+ declare const logger: {
2
+ error: (...args: any[]) => void;
3
+ log: (...args: any[]) => void;
4
+ warn: (...args: any[]) => void;
5
+ debug: (...args: any[]) => void;
6
+ };
7
+
8
+ export { logger };
@@ -0,0 +1,2 @@
1
+ const e="\u{1F308} Beam:",r={error:(...o)=>console.error(e,...o),log:(...o)=>console.log(e,...o),warn:(...o)=>console.warn(e,...o),debug:(...o)=>console.debug(e,...o)};export{r as logger};
2
+ //# sourceMappingURL=logger.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.esm.js","sources":["../../src/utils/logger.ts"],"sourcesContent":["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"],"names":["LOG_PREFIX","logger","args"],"mappings":"AAAA,MAAMA,EAAa,kBAINC,EAAS,CACpB,MAAO,IAAIC,IAAgB,QAAQ,MAAMF,EAAY,GAAGE,CAAI,EAC5D,IAAK,IAAIA,IAAgB,QAAQ,IAAIF,EAAY,GAAGE,CAAI,EACxD,KAAM,IAAIA,IAAgB,QAAQ,KAAKF,EAAY,GAAGE,CAAI,EAC1D,MAAO,IAAIA,IAAgB,QAAQ,MAAMF,EAAY,GAAGE,CAAI,CAC9D"}
@@ -0,0 +1,2 @@
1
+ const e="\u{1F308} Beam:",r={error:(...o)=>console.error(e,...o),log:(...o)=>console.log(e,...o),warn:(...o)=>console.warn(e,...o),debug:(...o)=>console.debug(e,...o)};export{r as logger};
2
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sources":["../../src/utils/logger.ts"],"sourcesContent":["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"],"names":["LOG_PREFIX","logger","args"],"mappings":"AAAA,MAAMA,EAAa,kBAINC,EAAS,CACpB,MAAO,IAAIC,IAAgB,QAAQ,MAAMF,EAAY,GAAGE,CAAI,EAC5D,IAAK,IAAIA,IAAgB,QAAQ,IAAIF,EAAY,GAAGE,CAAI,EACxD,KAAM,IAAIA,IAAgB,QAAQ,KAAKF,EAAY,GAAGE,CAAI,EAC1D,MAAO,IAAIA,IAAgB,QAAQ,MAAMF,EAAY,GAAGE,CAAI,CAC9D"}
@@ -0,0 +1,17 @@
1
+ type Func<T extends any[], R> = (...args: T) => R;
2
+ /**
3
+ * Takes a function and returns a new memoized function.
4
+ * If the same arguments are passed to the memoized function, it will return the previously computed result.
5
+ * This is a "memoize once" function meaning it only compares the previous and current arguments, not historic values.
6
+ * Results that throw errors or return rejected Promises are not cached.
7
+ *
8
+ * @param {Function} fn - The function to be memoized.
9
+ * @param {(value: any) => boolean} [isEqual]- The equality function used to compare arguments.
10
+ * @returns {Function} - The memoized function.
11
+ * @param func
12
+ */
13
+ declare function memoizeLast<T extends any[], R>(func: Func<T, R>, { isEqual }?: {
14
+ isEqual?: ((value: any, other: any) => boolean) | undefined;
15
+ }): Func<T, R>;
16
+
17
+ export { memoizeLast };
@@ -0,0 +1,2 @@
1
+ import{i as a}from"../chunks/lodash-P8OIs-at.esm.js";function c(s,{isEqual:u=a}={}){let r=null,n=null,e=!1,i=0;return(...o)=>{if(e&&u(r,o))return n;const t=s(...o);if(t instanceof Promise){i++;const l=i;t.catch(()=>{l===i&&(e=!1)})}return r=o,n=t,e=!0,t}}export{c as memoizeLast};
2
+ //# sourceMappingURL=memoize-last.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoize-last.esm.js","sources":["../../src/utils/memoize-last.ts"],"sourcesContent":["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>(func: Func<T, R>, { isEqual = defaultIsEqual } = {}): 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 return (...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"],"names":["memoizeLast","func","isEqual","defaultIsEqual","lastArgs","lastResult","hasResult","promiseCounter","args","result","promiseCounterAtStart"],"mappings":"qDAeO,SAASA,EAAgCC,EAAkB,CAAE,QAAAC,EAAUC,CAAe,EAAI,GAAgB,CAC/G,IAAIC,EAAqB,KACrBC,EAAuB,KACvBC,EAAY,GACZC,EAAiB,EAErB,MAAO,IAAIC,IAAe,CACxB,GAAIF,GAAaJ,EAAQE,EAAUI,CAAI,EACrC,OAAOH,EAGT,MAAMI,EAASR,EAAK,GAAGO,CAAI,EAE3B,GAAIC,aAAkB,QAAS,CAC7BF,IACA,MAAMG,EAAwBH,EAC9BE,EAAO,MAAM,IAAM,CAGbC,IAA0BH,IAC5BD,EAAY,GAEhB,CAAC,CACH,CAGA,OAAAF,EAAWI,EACXH,EAAaI,EACbH,EAAY,GAELG,CACT,CACF"}
@@ -0,0 +1,2 @@
1
+ import{i as a}from"../chunks/lodash-P8OIs-at.esm.js";function c(s,{isEqual:u=a}={}){let r=null,n=null,e=!1,i=0;return(...o)=>{if(e&&u(r,o))return n;const t=s(...o);if(t instanceof Promise){i++;const l=i;t.catch(()=>{l===i&&(e=!1)})}return r=o,n=t,e=!0,t}}export{c as memoizeLast};
2
+ //# sourceMappingURL=memoize-last.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoize-last.js","sources":["../../src/utils/memoize-last.ts"],"sourcesContent":["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>(func: Func<T, R>, { isEqual = defaultIsEqual } = {}): 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 return (...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"],"names":["memoizeLast","func","isEqual","defaultIsEqual","lastArgs","lastResult","hasResult","promiseCounter","args","result","promiseCounterAtStart"],"mappings":"qDAeO,SAASA,EAAgCC,EAAkB,CAAE,QAAAC,EAAUC,CAAe,EAAI,GAAgB,CAC/G,IAAIC,EAAqB,KACrBC,EAAuB,KACvBC,EAAY,GACZC,EAAiB,EAErB,MAAO,IAAIC,IAAe,CACxB,GAAIF,GAAaJ,EAAQE,EAAUI,CAAI,EACrC,OAAOH,EAGT,MAAMI,EAASR,EAAK,GAAGO,CAAI,EAE3B,GAAIC,aAAkB,QAAS,CAC7BF,IACA,MAAMG,EAAwBH,EAC9BE,EAAO,MAAM,IAAM,CAGbC,IAA0BH,IAC5BD,EAAY,GAEhB,CAAC,CACH,CAGA,OAAAF,EAAWI,EACXH,EAAaI,EACbH,EAAY,GAELG,CACT,CACF"}
@@ -0,0 +1,5 @@
1
+ declare const fetchProxy: any;
2
+ declare const xhrProxy: any;
3
+ declare const initNetworkListeners: () => void;
4
+
5
+ export { fetchProxy, initNetworkListeners, xhrProxy };
@@ -0,0 +1,2 @@
1
+ import{d as r}from"../chunks/events-5IECSF-x.esm.js";const h=window.fetch,d={apply:function(n,e,t){return n(...t).then(o=>{if(o.ok){const i=o.clone();window.dispatchEvent(new r({url:t[0].toString(),method:(t[1]?.method||"get").toLowerCase(),type:"fetch",response:i}))}return o})}},s=new Proxy(h,d),a=XMLHttpRequest,p={construct(n,e){const t=new n(...e);return t.addEventListener("load",()=>{window.dispatchEvent(new r({url:(e[1]||"").toString(),method:(e[0]||"get").toLowerCase(),type:"xhr",xhr:t}))}),t}},c=new Proxy(a,p);let w=!1;const u=()=>{w||(window.fetch=s,XMLHttpRequest=c,w=!0)};export{s as fetchProxy,u as initNetworkListeners,c as xhrProxy};
2
+ //# sourceMappingURL=network-listeners.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-listeners.esm.js","sources":["../../src/utils/network-listeners.ts"],"sourcesContent":["import { BeamNetworkCallEvent } from \"./events\";\n\n/**\n * Fetch Listener\n */\n\nconst originalFetch = window.fetch;\n\nconst fetchHandler = {\n apply: function (target: any, _thisArg: any, args: any[]) {\n return target(...args).then((response: Response) => {\n if (response.ok) {\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\nexport const fetchProxy = new Proxy(originalFetch, fetchHandler);\n\n/**\n * XMLHTTPRequest Listener\n */\n\nconst originalXhr = XMLHttpRequest;\n\nconst xhrHandler = {\n construct(TargetConstructor: any, args: any[]) {\n const xhr: XMLHttpRequest = new TargetConstructor(...args);\n xhr.addEventListener(\"load\", () => {\n window.dispatchEvent(\n new BeamNetworkCallEvent({\n url: (args[1] || \"\").toString(),\n method: (args[0] || \"get\").toLowerCase(),\n type: \"xhr\",\n xhr,\n })\n );\n });\n return xhr;\n },\n};\n\nexport const xhrProxy = new Proxy(originalXhr, xhrHandler);\n\n/**\n * Side-Effects Setup (initialize listeners)\n */\n\nlet initializedListeners = false;\n\nexport const initNetworkListeners = () => {\n if (initializedListeners) return;\n window.fetch = fetchProxy;\n XMLHttpRequest = xhrProxy;\n initializedListeners = true;\n};\n"],"names":["originalFetch","fetchHandler","target","_thisArg","args","response","responseCopy","BeamNetworkCallEvent","fetchProxy","originalXhr","xhrHandler","TargetConstructor","xhr","xhrProxy","initializedListeners","initNetworkListeners"],"mappings":"qDAMA,MAAMA,EAAgB,OAAO,MAEvBC,EAAe,CACnB,MAAO,SAAUC,EAAaC,EAAeC,EAAa,CACxD,OAAOF,EAAO,GAAGE,CAAI,EAAE,KAAMC,GAAuB,CAClD,GAAIA,EAAS,GAAI,CACf,MAAMC,EAAeD,EAAS,MAAM,EACpC,OAAO,cACL,IAAIE,EAAqB,CACvB,IAAKH,EAAK,CAAC,EAAE,SACb,EAAA,QAASA,EAAK,CAAC,GAAG,QAAU,OAAO,YAAY,EAC/C,KAAM,QACN,SAAUE,CACZ,CAAC,CACH,CACF,CACA,OAAOD,CACT,CAAC,CACH,CACF,EAEaG,EAAa,IAAI,MAAMR,EAAeC,CAAY,EAMzDQ,EAAc,eAEdC,EAAa,CACjB,UAAUC,EAAwBP,EAAa,CAC7C,MAAMQ,EAAsB,IAAID,EAAkB,GAAGP,CAAI,EACzD,OAAAQ,EAAI,iBAAiB,OAAQ,IAAM,CACjC,OAAO,cACL,IAAIL,EAAqB,CACvB,KAAMH,EAAK,CAAC,GAAK,IAAI,SAAA,EACrB,QAASA,EAAK,CAAC,GAAK,OAAO,cAC3B,KAAM,MACN,IAAAQ,CACF,CAAC,CACH,CACF,CAAC,EACMA,CACT,CACF,EAEaC,EAAW,IAAI,MAAMJ,EAAaC,CAAU,EAMzD,IAAII,EAAuB,SAEdC,EAAuB,IAAM,CACpCD,IACJ,OAAO,MAAQN,EACf,eAAiBK,EACjBC,EAAuB,GACzB"}
@@ -0,0 +1,2 @@
1
+ import{d as r}from"../chunks/events-5IECSF-x.esm.js";const h=window.fetch,d={apply:function(n,e,t){return n(...t).then(o=>{if(o.ok){const i=o.clone();window.dispatchEvent(new r({url:t[0].toString(),method:(t[1]?.method||"get").toLowerCase(),type:"fetch",response:i}))}return o})}},s=new Proxy(h,d),a=XMLHttpRequest,p={construct(n,e){const t=new n(...e);return t.addEventListener("load",()=>{window.dispatchEvent(new r({url:(e[1]||"").toString(),method:(e[0]||"get").toLowerCase(),type:"xhr",xhr:t}))}),t}},c=new Proxy(a,p);let w=!1;const u=()=>{w||(window.fetch=s,XMLHttpRequest=c,w=!0)};export{s as fetchProxy,u as initNetworkListeners,c as xhrProxy};
2
+ //# sourceMappingURL=network-listeners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-listeners.js","sources":["../../src/utils/network-listeners.ts"],"sourcesContent":["import { BeamNetworkCallEvent } from \"./events\";\n\n/**\n * Fetch Listener\n */\n\nconst originalFetch = window.fetch;\n\nconst fetchHandler = {\n apply: function (target: any, _thisArg: any, args: any[]) {\n return target(...args).then((response: Response) => {\n if (response.ok) {\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\nexport const fetchProxy = new Proxy(originalFetch, fetchHandler);\n\n/**\n * XMLHTTPRequest Listener\n */\n\nconst originalXhr = XMLHttpRequest;\n\nconst xhrHandler = {\n construct(TargetConstructor: any, args: any[]) {\n const xhr: XMLHttpRequest = new TargetConstructor(...args);\n xhr.addEventListener(\"load\", () => {\n window.dispatchEvent(\n new BeamNetworkCallEvent({\n url: (args[1] || \"\").toString(),\n method: (args[0] || \"get\").toLowerCase(),\n type: \"xhr\",\n xhr,\n })\n );\n });\n return xhr;\n },\n};\n\nexport const xhrProxy = new Proxy(originalXhr, xhrHandler);\n\n/**\n * Side-Effects Setup (initialize listeners)\n */\n\nlet initializedListeners = false;\n\nexport const initNetworkListeners = () => {\n if (initializedListeners) return;\n window.fetch = fetchProxy;\n XMLHttpRequest = xhrProxy;\n initializedListeners = true;\n};\n"],"names":["originalFetch","fetchHandler","target","_thisArg","args","response","responseCopy","BeamNetworkCallEvent","fetchProxy","originalXhr","xhrHandler","TargetConstructor","xhr","xhrProxy","initializedListeners","initNetworkListeners"],"mappings":"qDAMA,MAAMA,EAAgB,OAAO,MAEvBC,EAAe,CACnB,MAAO,SAAUC,EAAaC,EAAeC,EAAa,CACxD,OAAOF,EAAO,GAAGE,CAAI,EAAE,KAAMC,GAAuB,CAClD,GAAIA,EAAS,GAAI,CACf,MAAMC,EAAeD,EAAS,MAAM,EACpC,OAAO,cACL,IAAIE,EAAqB,CACvB,IAAKH,EAAK,CAAC,EAAE,SACb,EAAA,QAASA,EAAK,CAAC,GAAG,QAAU,OAAO,YAAY,EAC/C,KAAM,QACN,SAAUE,CACZ,CAAC,CACH,CACF,CACA,OAAOD,CACT,CAAC,CACH,CACF,EAEaG,EAAa,IAAI,MAAMR,EAAeC,CAAY,EAMzDQ,EAAc,eAEdC,EAAa,CACjB,UAAUC,EAAwBP,EAAa,CAC7C,MAAMQ,EAAsB,IAAID,EAAkB,GAAGP,CAAI,EACzD,OAAAQ,EAAI,iBAAiB,OAAQ,IAAM,CACjC,OAAO,cACL,IAAIL,EAAqB,CACvB,KAAMH,EAAK,CAAC,GAAK,IAAI,SAAA,EACrB,QAASA,EAAK,CAAC,GAAK,OAAO,cAC3B,KAAM,MACN,IAAAQ,CACF,CAAC,CACH,CACF,CAAC,EACMA,CACT,CACF,EAEaC,EAAW,IAAI,MAAMJ,EAAaC,CAAU,EAMzD,IAAII,EAAuB,SAEdC,EAAuB,IAAM,CACpCD,IACJ,OAAO,MAAQN,EACf,eAAiBK,EACjBC,EAAuB,GACzB"}
@@ -0,0 +1,9 @@
1
+ declare function saveRemoteSession({ remoteSessionId, apiKey }: {
2
+ remoteSessionId: string;
3
+ apiKey?: string;
4
+ }): void;
5
+ declare function getRemoteSession({ apiKey }: {
6
+ apiKey?: string;
7
+ }): string | null;
8
+
9
+ export { getRemoteSession, saveRemoteSession };
@@ -0,0 +1,2 @@
1
+ import{createScopedLocalStorage as o}from"./local-storage.esm.js";import"../chunks/beam-errors-AMvTvR1C.esm.js";const t="remote_session_id";function s({remoteSessionId:e,apiKey:i=""}){o({apiKey:i}).setItem(t,e)}function n({apiKey:e=""}){return o({apiKey:e}).getItem(t)}export{n as getRemoteSession,s as saveRemoteSession};
2
+ //# sourceMappingURL=remote-session.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-session.esm.js","sources":["../../src/utils/remote-session.ts"],"sourcesContent":["import { createScopedLocalStorage } from \"./local-storage\";\n\nconst REMOTE_SESSION_ID_KEY = \"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"],"names":["REMOTE_SESSION_ID_KEY","saveRemoteSession","remoteSessionId","apiKey","createScopedLocalStorage","getRemoteSession"],"mappings":"gHAEA,MAAMA,EAAwB,oBAEvB,SAASC,EAAkB,CAAE,gBAAAC,EAAiB,OAAAC,EAAS,EAAG,EAAiD,CACvFC,EAAyB,CAChD,OAAAD,CACF,CAAC,EACgB,QAAQH,EAAuBE,CAAe,CACjE,CAEO,SAASG,EAAiB,CAAE,OAAAF,EAAS,EAAG,EAAwB,CAIrE,OAHyBC,EAAyB,CAChD,OAAAD,CACF,CAAC,EACuB,QAAQH,CAAqB,CACvD"}
@@ -0,0 +1,2 @@
1
+ import{createScopedLocalStorage as o}from"./local-storage.js";import"../chunks/beam-errors-AMvTvR1C.esm.js";const t="remote_session_id";function s({remoteSessionId:e,apiKey:i=""}){o({apiKey:i}).setItem(t,e)}function n({apiKey:e=""}){return o({apiKey:e}).getItem(t)}export{n as getRemoteSession,s as saveRemoteSession};
2
+ //# sourceMappingURL=remote-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-session.js","sources":["../../src/utils/remote-session.ts"],"sourcesContent":["import { createScopedLocalStorage } from \"./local-storage\";\n\nconst REMOTE_SESSION_ID_KEY = \"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"],"names":["REMOTE_SESSION_ID_KEY","saveRemoteSession","remoteSessionId","apiKey","createScopedLocalStorage","getRemoteSession"],"mappings":"4GAEA,MAAMA,EAAwB,oBAEvB,SAASC,EAAkB,CAAE,gBAAAC,EAAiB,OAAAC,EAAS,EAAG,EAAiD,CACvFC,EAAyB,CAChD,OAAAD,CACF,CAAC,EACgB,QAAQH,EAAuBE,CAAe,CACjE,CAEO,SAASG,EAAiB,CAAE,OAAAF,EAAS,EAAG,EAAwB,CAIrE,OAHyBC,EAAyB,CAChD,OAAAD,CACF,CAAC,EACuB,QAAQH,CAAqB,CACvD"}
@@ -0,0 +1,5 @@
1
+ declare function waitForElement(selector: string, { timeout }?: {
2
+ timeout?: number | undefined;
3
+ }): Promise<Element>;
4
+
5
+ export { waitForElement };
@@ -0,0 +1,2 @@
1
+ import{B as s}from"../chunks/beam-errors-AMvTvR1C.esm.js";function l(t,{timeout:i=1e4}={}){return new Promise((r,m)=>{let e=document.querySelector(t);if(e){r(e);return}let o;const u=setTimeout(()=>{e||(o?.disconnect(),m(new s(`Timed out waiting for '${t}'`)))},i);new MutationObserver((a,n)=>{o=n,Array.from(document.querySelectorAll(t)).forEach(c=>{e=c,r(c),n.disconnect(),clearTimeout(u)})}).observe(document.documentElement,{childList:!0,subtree:!0})})}export{l as waitForElement};
2
+ //# sourceMappingURL=wait-for-element.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-for-element.esm.js","sources":["../../src/utils/wait-for-element.ts"],"sourcesContent":["// 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"],"names":["waitForElement","selector","timeout","resolve","reject","el","mutationObserver","timer","BeamError","_mutationRecords","observer","element"],"mappings":"0DAIO,SAASA,EAAeC,EAAkB,CAAE,QAAAC,EAAU,GAAM,EAAI,CAAsB,EAAA,CAC3F,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CACtC,IAAIC,EAAK,SAAS,cAAcJ,CAAQ,EACxC,GAAII,EAAI,CACNF,EAAQE,CAAE,EACV,MACF,CAEA,IAAIC,EAEJ,MAAMC,EAAQ,WAAW,IAAM,CACzBF,IACJC,GAAkB,WAAW,EAC7BF,EAAO,IAAII,EAAU,0BAA0BP,CAAQ,GAAG,CAAC,EAC7D,EAAGC,CAAO,EAEV,IAAI,iBAAiB,CAACO,EAAkBC,IAAa,CACnDJ,EAAmBI,EAEnB,MAAM,KAAK,SAAS,iBAAiBT,CAAQ,CAAC,EAAE,QAASU,GAAY,CACnEN,EAAKM,EACLR,EAAQQ,CAAO,EAEfD,EAAS,aACT,aAAaH,CAAK,CACpB,CAAC,CACH,CAAC,EAAE,QAAQ,SAAS,gBAAiB,CACnC,UAAW,GACX,QAAS,EACX,CAAC,CACH,CAAC,CACH"}
@@ -0,0 +1,2 @@
1
+ import{B as s}from"../chunks/beam-errors-AMvTvR1C.esm.js";function l(t,{timeout:i=1e4}={}){return new Promise((r,m)=>{let e=document.querySelector(t);if(e){r(e);return}let o;const u=setTimeout(()=>{e||(o?.disconnect(),m(new s(`Timed out waiting for '${t}'`)))},i);new MutationObserver((a,n)=>{o=n,Array.from(document.querySelectorAll(t)).forEach(c=>{e=c,r(c),n.disconnect(),clearTimeout(u)})}).observe(document.documentElement,{childList:!0,subtree:!0})})}export{l as waitForElement};
2
+ //# sourceMappingURL=wait-for-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-for-element.js","sources":["../../src/utils/wait-for-element.ts"],"sourcesContent":["// 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"],"names":["waitForElement","selector","timeout","resolve","reject","el","mutationObserver","timer","BeamError","_mutationRecords","observer","element"],"mappings":"0DAIO,SAASA,EAAeC,EAAkB,CAAE,QAAAC,EAAU,GAAM,EAAI,CAAsB,EAAA,CAC3F,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CACtC,IAAIC,EAAK,SAAS,cAAcJ,CAAQ,EACxC,GAAII,EAAI,CACNF,EAAQE,CAAE,EACV,MACF,CAEA,IAAIC,EAEJ,MAAMC,EAAQ,WAAW,IAAM,CACzBF,IACJC,GAAkB,WAAW,EAC7BF,EAAO,IAAII,EAAU,0BAA0BP,CAAQ,GAAG,CAAC,EAC7D,EAAGC,CAAO,EAEV,IAAI,iBAAiB,CAACO,EAAkBC,IAAa,CACnDJ,EAAmBI,EAEnB,MAAM,KAAK,SAAS,iBAAiBT,CAAQ,CAAC,EAAE,QAASU,GAAY,CACnEN,EAAKM,EACLR,EAAQQ,CAAO,EAEfD,EAAS,aACT,aAAaH,CAAK,CACpB,CAAC,CACH,CAAC,EAAE,QAAQ,SAAS,gBAAiB,CACnC,UAAW,GACX,QAAS,EACX,CAAC,CACH,CAAC,CACH"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beamimpact/web-sdk",
3
3
  "private": false,
4
- "version": "1.31.4",
4
+ "version": "1.35.0",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "engines": {
@@ -1,2 +0,0 @@
1
- import"./vendor-IGhQoYCM.esm.js";import"../components/impact-overview.js";import"./lit-h1W25hjN.esm.js";import"./lodash-ZxBiuGue.esm.js";import"./routes-RQDFRUiD.esm.js";import"./beam-errors-AMvTvR1C.esm.js";import"./progress-bar-w3yfrrxD.esm.js";import"./localize-z-KGe7Y5.esm.js";import"./is-all-html-elements-SdSkxirh.esm.js";import"../components/beam-partner-logos.js";import"./responsive-Rehmv-eo.esm.js";
2
- //# sourceMappingURL=_share-dialog-dependencies-UT3NgapK.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_share-dialog-dependencies-UT3NgapK.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import"./vendor-IGhQoYCM.esm.js";import"../components/impact-overview.esm.js";import"./lit-h1W25hjN.esm.js";import"./lodash-ZxBiuGue.esm.js";import"./routes-RQDFRUiD.esm.js";import"./beam-errors-AMvTvR1C.esm.js";import"./progress-bar-w3yfrrxD.esm.js";import"./localize-z-KGe7Y5.esm.js";import"./is-all-html-elements-SdSkxirh.esm.js";import"../components/beam-partner-logos.esm.js";import"./responsive-Rehmv-eo.esm.js";
2
- //# sourceMappingURL=_share-dialog-dependencies-yxOcNNpK.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_share-dialog-dependencies-yxOcNNpK.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- const a=()=>document.cookie.split("; ").reduce((e,t)=>{const[n,...o]=t.split("="),i=decodeURIComponent(o.join("="));return e.set(n,i)},new Map),C=e=>a().get(e),l=e=>{const{name:t,value:n,expires:o,...i}=e,c=encodeURIComponent(n),p=`${t}=${c}`,u=o!=null?` ;expires=${new Date(o).toUTCString()}`:"",d=Object.entries(i).map(([r,s])=>s!=null?` ;${r}=${s}`:"").join("");document.cookie=p+d+u},g=e=>l({...e,value:"",expires:0});export{C as a,g as d,a as g,l as s};
2
- //# sourceMappingURL=cookies-H8TCP4v0.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies-H8TCP4v0.esm.js","sources":["../../src/shared/cookies.ts"],"sourcesContent":["/*\n * Wrapper functions for CookieStore using document.cookie as a fallback if not supported\n */\n\nexport const getCookieMap = () => {\n return document.cookie.split(\"; \").reduce((res, x) => {\n const [key, ...restOfString] = x.split(\"=\");\n const value = decodeURIComponent(restOfString.join(\"=\"));\n return res.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 return setCookieValue({ ...options, value: \"\", expires: 0 });\n};\n\n/*\n * CookieStore API Types\n * https://developer.mozilla.org/en-US/docs/Web/API/CookieStore#browser_compatibility\n */\n\ninterface CookieListItem {\n name: string;\n value: string;\n path: string;\n domain: string | null;\n expires: number | null; // timestamp, unix time in ms\n secure: boolean;\n sameSite: \"strict\" | \"lax\" | \"none\";\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\n// https://wicg.github.io/cookie-store/#CookieChangeEvent\nexport interface CookieChangeEvent extends Event {\n readonly changed: CookieListItem[];\n readonly deleted: CookieListItem[];\n type: \"deleted\" | \"changed\";\n}\n\ntype SetCookie = {\n (options: CookieInit): Promise<undefined>;\n (name: string, value: string): Promise<undefined>;\n};\n\n// https://wicg.github.io/cookie-store/#CookieStore\ninterface CookieStore extends EventTarget {\n get: (name: string | { name: string; url: string }) => Promise<CookieListItem | undefined>;\n getAll: (name: string | { name: string; url: string }) => Promise<CookieListItem[]>;\n set: SetCookie; // function overload for multiple signatures\n delete: (name: string | { name: string; domain?: string | null; path?: string }) => Promise<undefined>;\n onchange: (event: CookieChangeEvent) => boolean | void | Promise<boolean | void>;\n}\n\ndeclare global {\n interface Window {\n cookieStore: CookieStore;\n }\n}\n"],"names":["getCookieMap","res","x","key","restOfString","value","getCookieValue","name","setCookieValue","options","expires","rest","encodedValue","base","expiration","modifiers","val","deleteCookieValue"],"mappings":"AAIa,MAAAA,EAAe,IACnB,SAAS,OAAO,MAAM,IAAI,EAAE,OAAO,CAACC,EAAKC,IAAM,CACpD,KAAM,CAACC,EAAK,GAAGC,CAAY,EAAIF,EAAE,MAAM,GAAG,EACpCG,EAAQ,mBAAmBD,EAAa,KAAK,GAAG,CAAC,EACvD,OAAOH,EAAI,IAAIE,EAAKE,CAAK,CAC3B,EAAG,IAAI,GAAqB,EAGjBC,EAAkBC,GAKtBP,IAAe,IAAIO,CAAI,EAGnBC,EAAkBC,GAAmC,CAQhE,KAAM,CAAE,KAAAF,EAAM,MAAAF,EAAO,QAAAK,EAAS,GAAGC,CAAK,EAAIF,EACpCG,EAAe,mBAAmBP,CAAK,EACvCQ,EAAO,GAAGN,CAAI,IAAIK,CAAY,GAC9BE,EAAaJ,GAAW,KAAO,aAAa,IAAI,KAAKA,CAAO,EAAE,YAAa,CAAA,GAAK,GAChFK,EAAY,OAAO,QAAQJ,CAAI,EAClC,IAAI,CAAC,CAACR,EAAKa,CAAG,IAAOA,GAAO,KAAO,KAAKb,CAAG,IAAIa,CAAG,GAAK,EAAG,EAC1D,KAAK,EAAE,EACV,SAAS,OAASH,EAAOE,EAAYD,CAEvC,EAEaG,EAAqBR,GACzBD,EAAe,CAAE,GAAGC,EAAS,MAAO,GAAI,QAAS,CAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"events-wNy5BoJV.esm.js","sources":["../../src/shared/events.ts"],"sourcesContent":["import { TCartApi } from \"./cart-contents\";\nimport { TId } from \"./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};\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};\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"],"names":["_BeamNetworkCallEvent","detail","BeamNetworkCallEvent","_BeamNonprofitSelectEvent","BeamNonprofitSelectEvent","_BeamCartChangeEvent","BeamCartChangeEvent","_BeamCartCreatedEvent","BeamCartCreatedEvent","_BeamOrderCreatedEvent","BeamOrderCreatedEvent","_BeamStatusChangeEvent","BeamStatusChangeEvent"],"mappings":"AAaO,MAAMA,EAAN,MAAMA,UAA6B,WAAgC,CAExE,YAAYC,EAA4B,CACtC,MAAMD,EAAqB,UAAW,CAAE,OAAAC,EAAQ,QAAS,GAAM,SAAU,EAAK,CAAC,CACjF,CACF,EALaD,EACJ,UAAY,kBADR,IAAAE,EAANF,EAoBA,MAAMG,EAAN,MAAMA,UAAiC,WAAmC,CAE/E,YAAYF,EAA+B,CACzC,MAAME,EAAyB,UAAW,CAAE,OAAAF,EAAQ,QAAS,GAAM,SAAU,EAAK,CAAC,CACrF,CACF,EALaE,EACJ,UAAY,0BADRC,EAAND,EAoBA,MAAME,EAAN,MAAMA,UAA4B,WAA8B,CAErE,YAAYJ,EAA0B,CACpC,MAAMI,EAAoB,UAAW,CAAE,OAAAJ,EAAQ,QAAS,GAAM,SAAU,EAAK,CAAC,CAChF,CACF,EALaI,EACJ,UAAY,iBADR,IAAAC,EAAND,EAgBA,MAAME,EAAN,MAAMA,UAA6B,WAA+B,CAEvE,YAAYN,EAA2B,CACrC,MAAMM,EAAqB,UAAW,CAAE,OAAAN,EAAQ,QAAS,GAAM,SAAU,EAAK,CAAC,CACjF,CACF,EALaM,EACJ,UAAY,sBADRC,EAAND,EAoBA,MAAME,EAAN,MAAMA,UAA8B,WAAgC,CAGzE,YAAYR,EAA4B,CACtC,MAAMQ,EAAsB,UAAW,CAAE,OAAAR,EAAQ,QAAS,GAAM,SAAU,EAAK,CAAC,CAClF,CACF,EANaQ,EACJ,UAAY,mBADd,IAAMC,EAAND,EAeA,MAAME,EAAN,MAAMA,UAA8B,WAAyC,CAGlF,YAAYV,EAAqC,CAC/C,MAAMU,EAAsB,UAAW,CAAE,OAAAV,EAAQ,QAAS,GAAM,SAAU,EAAK,CAAC,CAClF,CACF,EANaU,EACJ,UAAY,uBADRC,EAAND"}
@@ -1,2 +0,0 @@
1
- import{getConfig as e,init as o}from"../integrations/beam.esm.js";import{b as t}from"./beam-errors-AMvTvR1C.esm.js";import{e as r}from"./events-wNy5BoJV.esm.js";import{l as i}from"./routes-RQDFRUiD.esm.js";import{f as s,i as a,w as m,x as g}from"./network-listeners-O5LKv8Yy.esm.js";import{c as n}from"./local-storage-GYvYzZ_j.esm.js";import{d as l,g as f,a as p,s as c}from"./cookies-H8TCP4v0.esm.js";import{g as k,s as C}from"./remote-session-V4YG-mcS.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:n,deleteCookieValue:l,errors:t,events:r,fetchProxy:s,getConfig:e,getCookieMap:f,getCookieValue:p,getRemoteSession:k,init:o,initNetworkListeners:a,logger:i,saveRemoteSession:C,setCookieValue:c,waitForElement:m,xhrProxy:g});export{x as i};
2
- //# sourceMappingURL=index-4ckY2-Lc.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-4ckY2-Lc.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{h as e,C as r,B as t,s as a,N as o}from"./order-page-8P0D98JI.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
2
- //# sourceMappingURL=index-FZ0yrk2j.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-FZ0yrk2j.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{L as e}from"./update-cart-qXTq0EoJ.esm.js";var r=Object.freeze({__proto__:null,updateCart:e});export{r as i};
2
- //# sourceMappingURL=index-PXYriqGw.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-PXYriqGw.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{v as d}from"./vendor-IGhQoYCM.esm.js";import{a as i,s as p,d as l}from"./cookies-H8TCP4v0.esm.js";import{c as n}from"./local-storage-GYvYzZ_j.esm.js";const s="beam_session";async function c({cookieName:e=s,domain:o=window.location.hostname,apiKey:t=""}={}){if(await i(e))return;const a=d(),m=Date.now()+30*24*60*60*1e3;await p({name:e,value:a,domain:o,path:"/",expires:m}),n({apiKey:t}).setItemJson("cart",{cartId:a})}async function r({cookieName:e=s,domain:o=window.location.hostname,apiKey:t=""}={}){const a=await i(e);a&&(n({apiKey:t}).setItemJson("cart",{cartId:a}),await l({name:e,domain:o}))}var u=Object.freeze({__proto__:null,createSession:c,endSession:r});export{c,r as e,u as i};
2
- //# sourceMappingURL=index-UODI8bvb.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-UODI8bvb.esm.js","sources":["../../src/integrations/session/index.ts"],"sourcesContent":["/**\n If checkout and order page are on different subdomains, we can't access localStorage for nonprofitId/selectionId\n We can make post-transaction work by copying a \"cartID\"-style cookie to the expected localStorage key on the current\n domain, which will allow the post-transaction widgets to send that to the backend which can restore the selection\n from the cart.\n\n This will also work if we don't have a cart cookie for some other reason, although it is not directly integrated\n with the host site's concept of a cart (e.g., line items and expiration dates).\n\n Note: Use a module import rather than a self-executing script so that we can set cookies on the host domain\n rather than our 3rd party CDN domain, and customize the options via arguments.\n\n Usage:\n <script type=\"module\">\n import { createSession } from 'https://...';\n createSession({domain: 'mystore.com'})\n </script>\n */\n\nimport { v4 as uuid } from \"@lukeed/uuid/secure\";\nimport { deleteCookieValue, getCookieValue, setCookieValue } from \"../../shared/cookies\";\nimport { createScopedLocalStorage } from \"../../shared/local-storage\";\n\nconst DEFAULT_COOKIE_NAME = \"beam_session\";\n\nexport async function createSession({\n cookieName = DEFAULT_COOKIE_NAME,\n domain = window.location.hostname, // domain or subdomain to set cookie on\n apiKey = \"\", // optional unless scoping localStorage to api key\n} = {}) {\n const existingValue = await getCookieValue(cookieName);\n\n if (existingValue) {\n return; // do nothing\n }\n\n const cookieValue = uuid();\n\n const expires = Date.now() + 30 * 24 * 60 * 60 * 1000; // 30 days\n\n await setCookieValue({ name: cookieName, value: cookieValue, domain, path: \"/\", expires });\n\n const beamLocalStorage = createScopedLocalStorage({ apiKey });\n beamLocalStorage.setItemJson(\"cart\", { cartId: cookieValue });\n}\n\nexport async function endSession({\n cookieName = DEFAULT_COOKIE_NAME,\n domain = window.location.hostname, // domain to remove cookie from\n apiKey = \"\", // optional unless scoping localStorage to api key\n} = {}) {\n const cookieValue = await getCookieValue(cookieName);\n\n if (!cookieValue) {\n return; // do nothing\n }\n\n // copy cookie value into localStorage for widgets to use\n const beamLocalStorage = createScopedLocalStorage({ apiKey });\n beamLocalStorage.setItemJson(\"cart\", { cartId: cookieValue });\n\n // delete cookie to end session (will generate new one on next visit)\n await deleteCookieValue({ name: cookieName, domain });\n}\n"],"names":["DEFAULT_COOKIE_NAME","createSession","cookieName","domain","apiKey","getCookieValue","cookieValue","uuid","expires","setCookieValue","createScopedLocalStorage","endSession","deleteCookieValue"],"mappings":"6JAuBA,MAAMA,EAAsB,eAE5B,eAAsBC,EAAc,CAClC,WAAAC,EAAaF,EACb,OAAAG,EAAS,OAAO,SAAS,SACzB,OAAAC,EAAS,EACX,EAAI,CAAI,EAAA,CAGN,GAFsB,MAAMC,EAAeH,CAAU,EAGnD,OAGF,MAAMI,EAAcC,EAAK,EAEnBC,EAAU,KAAK,IAAA,EAAQ,GAAK,GAAK,GAAK,GAAK,IAEjD,MAAMC,EAAe,CAAE,KAAMP,EAAY,MAAOI,EAAa,OAAAH,EAAQ,KAAM,IAAK,QAAAK,CAAQ,CAAC,EAEhEE,EAAyB,CAAE,OAAAN,CAAO,CAAC,EAC3C,YAAY,OAAQ,CAAE,OAAQE,CAAY,CAAC,CAC9D,CAEA,eAAsBK,EAAW,CAC/B,WAAAT,EAAaF,EACb,OAAAG,EAAS,OAAO,SAAS,SACzB,OAAAC,EAAS,EACX,EAAI,GAAI,CACN,MAAME,EAAc,MAAMD,EAAeH,CAAU,EAE9CI,IAKoBI,EAAyB,CAAE,OAAAN,CAAO,CAAC,EAC3C,YAAY,OAAQ,CAAE,OAAQE,CAAY,CAAC,EAG5D,MAAMM,EAAkB,CAAE,KAAMV,EAAY,OAAAC,CAAO,CAAC,EACtD"}
@@ -1,2 +0,0 @@
1
- import{i}from"./index-4ckY2-Lc.esm.js";import{i as o}from"./index-FZ0yrk2j.esm.js";import{i as r}from"./index-UODI8bvb.esm.js";import{i as e}from"./index-PXYriqGw.esm.js";import{i as m}from"./index-f-fjpKtx.esm.js";var s=Object.freeze({__proto__:null,Cart:e,Logs:m,Session:r,Shopify:o,Utils:i});export{s as i};
2
- //# sourceMappingURL=index-YKvnw1cF.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-YKvnw1cF.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,156 +0,0 @@
1
- import { BeamConfigOptions, BeamPlugin, getConfig, init } from '../integrations/beam.js';
2
- import { e as events } from './events-60jQoHQi.esm.js';
3
- import { f as fetchProxy, i as initNetworkListeners, w as waitForElement, x as xhrProxy } from './network-listeners-6tkaLA3D.esm.js';
4
-
5
- declare class BeamError extends Error {
6
- supportUrl: string;
7
- constructor(msg?: string, { cause, name }?: {
8
- cause?: any;
9
- name?: string;
10
- });
11
- }
12
- declare class NetworkError extends BeamError {
13
- /** Fetch Response object with .ok, .status, etc.*/
14
- response: Response;
15
- /** If network response included JSON payload, it is parsed and available here */
16
- body?: Record<string, string>;
17
- constructor(response: Response, body?: Record<string, string>, msg?: string);
18
- }
19
- declare class MissingConfig extends BeamError {
20
- missingConfigKeyNames: string[];
21
- constructor(missingConfigKeyNames?: string[], msg?: string);
22
- }
23
- declare class LocalStorageError extends BeamError {
24
- constructor(msg?: string);
25
- }
26
- declare class SetupError extends BeamError {
27
- constructor(msg?: string);
28
- }
29
-
30
- type beamErrors_BeamError = BeamError;
31
- declare const beamErrors_BeamError: typeof BeamError;
32
- type beamErrors_LocalStorageError = LocalStorageError;
33
- declare const beamErrors_LocalStorageError: typeof LocalStorageError;
34
- type beamErrors_MissingConfig = MissingConfig;
35
- declare const beamErrors_MissingConfig: typeof MissingConfig;
36
- type beamErrors_NetworkError = NetworkError;
37
- declare const beamErrors_NetworkError: typeof NetworkError;
38
- type beamErrors_SetupError = SetupError;
39
- declare const beamErrors_SetupError: typeof SetupError;
40
- declare namespace beamErrors {
41
- export { beamErrors_BeamError as BeamError, beamErrors_LocalStorageError as LocalStorageError, beamErrors_MissingConfig as MissingConfig, beamErrors_NetworkError as NetworkError, beamErrors_SetupError as SetupError };
42
- }
43
-
44
- declare const logger: {
45
- error: (...args: any[]) => void;
46
- log: (...args: any[]) => void;
47
- warn: (...args: any[]) => void;
48
- debug: (...args: any[]) => void;
49
- };
50
-
51
- /**
52
- * Creates an object that has the same API as normal localStorage, but adds a beam_ prefix and apiKey postfix to keys
53
- * Also adds helper methods for JSON (de-)serialization
54
- */
55
- declare const createScopedLocalStorage: (config: {
56
- apiKey: string;
57
- }) => {
58
- readonly prefix: string;
59
- readonly postfix: string;
60
- getItem(key: string): string | null;
61
- setItem(key: string, value: unknown): void;
62
- removeItem(key: string): void;
63
- /** Safely parses value as JSON and return JS object */
64
- getItemJson<T = Record<string, unknown>>(key: string): T | null;
65
- /** Safely stringifies value as JSON */
66
- setItemJson(key: string, value: object): void;
67
- };
68
-
69
- declare const getCookieMap: () => Map<string, string>;
70
- declare const getCookieValue: (name: string) => string | undefined;
71
- declare const setCookieValue: (options: CookieInit) => undefined;
72
- declare const deleteCookieValue: (options: {
73
- name: string;
74
- domain?: string;
75
- path?: string;
76
- }) => undefined;
77
- interface CookieListItem {
78
- name: string;
79
- value: string;
80
- path: string;
81
- domain: string | null;
82
- expires: number | null;
83
- secure: boolean;
84
- sameSite: "strict" | "lax" | "none";
85
- }
86
- interface CookieInit {
87
- name: string;
88
- value: string;
89
- path?: string;
90
- domain?: string;
91
- expires?: number;
92
- sameSite?: "strict" | "lax" | "none";
93
- }
94
- interface CookieChangeEvent extends Event {
95
- readonly changed: CookieListItem[];
96
- readonly deleted: CookieListItem[];
97
- type: "deleted" | "changed";
98
- }
99
- type SetCookie = {
100
- (options: CookieInit): Promise<undefined>;
101
- (name: string, value: string): Promise<undefined>;
102
- };
103
- interface CookieStore extends EventTarget {
104
- get: (name: string | {
105
- name: string;
106
- url: string;
107
- }) => Promise<CookieListItem | undefined>;
108
- getAll: (name: string | {
109
- name: string;
110
- url: string;
111
- }) => Promise<CookieListItem[]>;
112
- set: SetCookie;
113
- delete: (name: string | {
114
- name: string;
115
- domain?: string | null;
116
- path?: string;
117
- }) => Promise<undefined>;
118
- onchange: (event: CookieChangeEvent) => boolean | void | Promise<boolean | void>;
119
- }
120
- declare global {
121
- interface Window {
122
- cookieStore: CookieStore;
123
- }
124
- }
125
-
126
- declare function saveRemoteSession({ remoteSessionId, apiKey }: {
127
- remoteSessionId: string;
128
- apiKey?: string;
129
- }): void;
130
- declare function getRemoteSession({ apiKey }: {
131
- apiKey?: string;
132
- }): string | null;
133
-
134
- declare const index_BeamConfigOptions: typeof BeamConfigOptions;
135
- declare const index_BeamPlugin: typeof BeamPlugin;
136
- type index_CookieChangeEvent = CookieChangeEvent;
137
- declare const index_createScopedLocalStorage: typeof createScopedLocalStorage;
138
- declare const index_deleteCookieValue: typeof deleteCookieValue;
139
- declare const index_events: typeof events;
140
- declare const index_fetchProxy: typeof fetchProxy;
141
- declare const index_getConfig: typeof getConfig;
142
- declare const index_getCookieMap: typeof getCookieMap;
143
- declare const index_getCookieValue: typeof getCookieValue;
144
- declare const index_getRemoteSession: typeof getRemoteSession;
145
- declare const index_init: typeof init;
146
- declare const index_initNetworkListeners: typeof initNetworkListeners;
147
- declare const index_logger: typeof logger;
148
- declare const index_saveRemoteSession: typeof saveRemoteSession;
149
- declare const index_setCookieValue: typeof setCookieValue;
150
- declare const index_waitForElement: typeof waitForElement;
151
- declare const index_xhrProxy: typeof xhrProxy;
152
- declare namespace index {
153
- export { index_BeamConfigOptions as BeamConfigOptions, index_BeamPlugin as BeamPlugin, type index_CookieChangeEvent as CookieChangeEvent, index_createScopedLocalStorage as createScopedLocalStorage, index_deleteCookieValue as deleteCookieValue, beamErrors as errors, index_events as events, index_fetchProxy as fetchProxy, index_getConfig as getConfig, index_getCookieMap as getCookieMap, index_getCookieValue as getCookieValue, index_getRemoteSession as getRemoteSession, index_init as init, index_initNetworkListeners as initNetworkListeners, index_logger as logger, index_saveRemoteSession as saveRemoteSession, index_setCookieValue as setCookieValue, index_waitForElement as waitForElement, index_xhrProxy as xhrProxy };
154
- }
155
-
156
- export { type CookieChangeEvent as C, getCookieValue as a, beamErrors as b, createScopedLocalStorage as c, deleteCookieValue as d, saveRemoteSession as e, getRemoteSession as f, getCookieMap as g, index as i, logger as l, setCookieValue as s };
@@ -1,2 +0,0 @@
1
- import{b as i,c as n,l}from"./routes-RQDFRUiD.esm.js";async function e(o,s){const{apiKey:a,baseUrl:r}=o;try{await n({baseUrl:r||i,headers:{authorization:`Api-Key ${a}`},requestBody:{...s}})}catch(t){l.error("Failed to send log",t)}}var c=Object.freeze({__proto__:null,sendLog:e});export{c as i,e as s};
2
- //# sourceMappingURL=index-f-fjpKtx.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-f-fjpKtx.esm.js","sources":["../../src/integrations/logs/index.ts"],"sourcesContent":["import { postLogs } from \"../../api-sdk/v3/routes\";\nimport { paths } from \"../../api-sdk/v3/openapi-spec\";\nimport { logger } from \"../../shared/logger\";\nimport { DEFAULT_LOG_URL } from \"../../api-sdk/constants\";\n\ntype PostLogsReq = paths[\"/logs\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\ninterface SendLogConfig {\n apiKey: string;\n baseUrl?: string;\n}\n\nexport async function sendLog(config: SendLogConfig, payload: PostLogsReq): Promise<void> {\n const { apiKey, baseUrl } = config;\n try {\n await postLogs({\n baseUrl: baseUrl || DEFAULT_LOG_URL,\n headers: {\n authorization: `Api-Key ${apiKey}`,\n },\n requestBody: {\n ...payload,\n },\n });\n } catch (err) {\n logger.error(\"Failed to send log\", err);\n }\n}\n"],"names":["sendLog","config","payload","apiKey","baseUrl","postLogs","DEFAULT_LOG_URL","err","logger"],"mappings":"sDAYA,eAAsBA,EAAQC,EAAuBC,EAAqC,CACxF,KAAM,CAAE,OAAAC,EAAQ,QAAAC,CAAQ,EAAIH,EAC5B,GAAI,CACF,MAAMI,EAAS,CACb,QAASD,GAAWE,EACpB,QAAS,CACP,cAAe,WAAWH,CAAM,EAClC,EACA,YAAa,CACX,GAAGD,CACL,CACF,CAAC,CACH,OAASK,EAAK,CACZC,EAAO,MAAM,qBAAsBD,CAAG,CACxC,CACF"}
@@ -1,2 +0,0 @@
1
- import{h as e,C as r,B as t,s as a,N as o}from"./order-page-cWc57Sl-.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
2
- //# sourceMappingURL=index-fXIUzndi.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-fXIUzndi.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{getConfig as e,init as o}from"../integrations/beam.js";import{b as t}from"./beam-errors-AMvTvR1C.esm.js";import{e as r}from"./events-wNy5BoJV.esm.js";import{l as i}from"./routes-RQDFRUiD.esm.js";import{f as s,i as a,w as m,x as g}from"./network-listeners-O5LKv8Yy.esm.js";import{c as n}from"./local-storage-GYvYzZ_j.esm.js";import{d as l,g as f,a as p,s as c}from"./cookies-H8TCP4v0.esm.js";import{g as k,s as C}from"./remote-session-V4YG-mcS.esm.js";var x=Object.freeze({__proto__:null,createScopedLocalStorage:n,deleteCookieValue:l,errors:t,events:r,fetchProxy:s,getConfig:e,getCookieMap:f,getCookieValue:p,getRemoteSession:k,init:o,initNetworkListeners:a,logger:i,saveRemoteSession:C,setCookieValue:c,waitForElement:m,xhrProxy:g});export{x as i};
2
- //# sourceMappingURL=index-hrwZmHHJ.esm.js.map