@rebilly/instruments 8.18.0 → 8.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [8.18.1](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.18.0...instruments/core-v8.18.1) (2024-01-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **instruments:** Prevent event listeners from being attached multiple times ([#2766](https://github.com/Rebilly/rebilly/issues/2766)) ([e352f94](https://github.com/Rebilly/rebilly/commit/e352f9403bcb0dbcd4772044999a183f066f508a))
7
+
1
8
  ## [8.18.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.17.1...instruments/core-v8.18.0) (2024-01-05)
2
9
 
3
10
 
package/dist/index.js CHANGED
@@ -5987,7 +5987,7 @@ function cloneArrayDeep(val, instanceClone) {
5987
5987
  return res;
5988
5988
  }
5989
5989
  var cloneDeep_1 = cloneDeep;
5990
- const version = "55.9.2";
5990
+ const version = "55.10.0";
5991
5991
  let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
5992
5992
  let nanoid = (size2 = 21) => {
5993
5993
  let id2 = "";
@@ -15105,7 +15105,7 @@ const expressMethodsElement = ({ expressMethods }) => {
15105
15105
  return rootDiv;
15106
15106
  };
15107
15107
  async function mountMethodSelector() {
15108
- var _a, _b, _c, _d, _e, _f;
15108
+ var _a, _b, _c, _d, _e, _f, _g, _h;
15109
15109
  const contentEl = getElement("content");
15110
15110
  const formEl = getElement("form");
15111
15111
  const { expressMethods, methods } = getPaymentMethods();
@@ -15166,12 +15166,14 @@ async function mountMethodSelector() {
15166
15166
  name: "method-switch"
15167
15167
  });
15168
15168
  (_e = iframe == null ? void 0 : iframe.component) == null ? void 0 : _e.call("update", model);
15169
- (_f = iframe == null ? void 0 : iframe.component) == null ? void 0 : _f.on("choose-another-method", () => {
15170
- if (state.data.isPurchase) {
15171
- updateSummary();
15172
- }
15173
- mountMethodSelector();
15174
- });
15169
+ if (!((_g = (_f = iframe == null ? void 0 : iframe.component) == null ? void 0 : _f.events) == null ? void 0 : _g["choose-another-method"])) {
15170
+ (_h = iframe == null ? void 0 : iframe.component) == null ? void 0 : _h.on("choose-another-method", () => {
15171
+ if (state.data.isPurchase) {
15172
+ updateSummary();
15173
+ }
15174
+ mountMethodSelector();
15175
+ });
15176
+ }
15175
15177
  } else {
15176
15178
  state.loader.stopLoading({ id: "rebilly-instruments-form" });
15177
15179
  state.form.querySelector(
@@ -23295,7 +23297,7 @@ function handleComputedProperty(options) {
23295
23297
  var _a;
23296
23298
  return Object.assign({}, options, {
23297
23299
  _computed: {
23298
- version: "8.17.1",
23300
+ version: "8.18.0",
23299
23301
  paymentMethodsUrl: ((_a = options._dev) == null ? void 0 : _a.paymentMethodsUrl) ?? "https://forms.secure-payments.app"
23300
23302
  }
23301
23303
  });
@@ -26228,7 +26230,7 @@ async function setup({ payload }) {
26228
26230
  }
26229
26231
  }
26230
26232
  async function mountConfirmation({ payload: instrument }) {
26231
- var _a, _b, _c, _d;
26233
+ var _a, _b, _c, _d, _e, _f, _g, _h;
26232
26234
  if (instrument.billingAddress && state.summary && state.data.isPurchase) {
26233
26235
  updateSummary({ instrument });
26234
26236
  }
@@ -26247,18 +26249,22 @@ async function mountConfirmation({ payload: instrument }) {
26247
26249
  (_b = iframe == null ? void 0 : iframe.component) == null ? void 0 : _b.call("route", {
26248
26250
  name: "confirmation"
26249
26251
  });
26250
- (_c = iframe == null ? void 0 : iframe.component) == null ? void 0 : _c.on(
26251
- `${iframe.name}-confirm-purchase`,
26252
- (confirmedInstrument) => {
26253
- purchase({ payload: confirmedInstrument });
26254
- }
26255
- );
26256
- (_d = iframe == null ? void 0 : iframe.component) == null ? void 0 : _d.on(
26257
- `${iframe.name}-confirm-setup`,
26258
- (confirmedInstrument) => {
26259
- setup({ payload: confirmedInstrument });
26260
- }
26261
- );
26252
+ if (!((_d = (_c = iframe == null ? void 0 : iframe.component) == null ? void 0 : _c.events) == null ? void 0 : _d[`${iframe.name}-confirm-purchase`])) {
26253
+ (_e = iframe == null ? void 0 : iframe.component) == null ? void 0 : _e.on(
26254
+ `${iframe.name}-confirm-purchase`,
26255
+ (confirmedInstrument) => {
26256
+ purchase({ payload: confirmedInstrument });
26257
+ }
26258
+ );
26259
+ }
26260
+ if (!((_g = (_f = iframe == null ? void 0 : iframe.component) == null ? void 0 : _f.events) == null ? void 0 : _g[`${iframe.name}-confirm-setup`])) {
26261
+ (_h = iframe == null ? void 0 : iframe.component) == null ? void 0 : _h.on(
26262
+ `${iframe.name}-confirm-setup`,
26263
+ (confirmedInstrument) => {
26264
+ setup({ payload: confirmedInstrument });
26265
+ }
26266
+ );
26267
+ }
26262
26268
  }
26263
26269
  async function mountResult({ payload }) {
26264
26270
  var _a, _b;
@@ -26494,7 +26500,7 @@ class RebillyInstrumentsInstance {
26494
26500
  await show({ componentName, payload });
26495
26501
  }
26496
26502
  get version() {
26497
- return `RebillyInstruments Ver.${"8.17.1"}`;
26503
+ return `RebillyInstruments Ver.${"8.18.0"}`;
26498
26504
  }
26499
26505
  on(eventName, callback) {
26500
26506
  on({ eventName, callback });