@pelcro/react-pelcro-js 3.35.0 → 3.37.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.
package/dist/index.esm.js CHANGED
@@ -3333,12 +3333,19 @@ var paymentMethod_en = {
3333
3333
  select: select$6,
3334
3334
  "delete": {
3335
3335
  title: "Delete payment method",
3336
- subtitle: "This payment method could be associated with active subscriptions or serve as the default payment method. Please choose from the available options below for replacement.",
3336
+ subtitle: "Are you sure you want to delete the selected payment method?",
3337
+ details: "Payment method details",
3338
+ message: "This action is irreversible and will permanently remove the payment method from the system. Please ensure that there are no pending transactions or subscriptions associated with this payment method.",
3339
+ buttons: {
3340
+ "delete": "Delete payment method",
3341
+ back: "Go back"
3342
+ },
3337
3343
  options: {
3338
- select: "Select an existing payment method",
3344
+ select: "Select a payment method to be the default",
3339
3345
  add: "Add a new payment method"
3340
3346
  },
3341
- paymentMethodReplaced: "Payment Method Successfully Deleted and Replaced"
3347
+ paymentMethodReplaced: "Payment Method Successfully Deleted and Replaced",
3348
+ deletedSuccessfully: "Payment Method Successfully Deleted"
3342
3349
  },
3343
3350
  create: create$5
3344
3351
  };
@@ -9559,6 +9566,17 @@ const getPaymentCardIcon$1 = name => {
9559
9566
  }), /*#__PURE__*/React__default.createElement("path", {
9560
9567
  fill: "#FFF",
9561
9568
  d: "M22.255 20l-2.113 4.683L18.039 20h-2.695v6.726L12.341 20h-2.274L7 26.981h1.815l.671-1.558h3.432l.682 1.558h3.465v-5.185l2.299 5.185h1.563l2.351-5.095v5.095H25V20H22.255zM10.135 23.915l1.026-2.44 1.066 2.44H10.135zM37.883 23.413L41 20.018h-2.217l-1.994 2.164L34.86 20H28v6.982h6.635l2.092-2.311L38.767 27h2.21L37.883 23.413zM33.728 25.516h-4.011v-1.381h3.838v-1.323h-3.838v-1.308l4.234.012 1.693 1.897L33.728 25.516z"
9569
+ })),
9570
+ amex: /*#__PURE__*/React__default.createElement("svg", {
9571
+ className: "plc-w-16",
9572
+ xmlns: "http://www.w3.org/2000/svg",
9573
+ viewBox: "0 0 48 48"
9574
+ }, /*#__PURE__*/React__default.createElement("path", {
9575
+ fill: "#1976D2",
9576
+ d: "M45,35c0,2.209-1.791,4-4,4H7c-2.209,0-4-1.791-4-4V13c0-2.209,1.791-4,4-4h34c2.209,0,4,1.791,4,4V35z"
9577
+ }), /*#__PURE__*/React__default.createElement("path", {
9578
+ fill: "#FFF",
9579
+ d: "M22.255 20l-2.113 4.683L18.039 20h-2.695v6.726L12.341 20h-2.274L7 26.981h1.815l.671-1.558h3.432l.682 1.558h3.465v-5.185l2.299 5.185h1.563l2.351-5.095v5.095H25V20H22.255zM10.135 23.915l1.026-2.44 1.066 2.44H10.135zM37.883 23.413L41 20.018h-2.217l-1.994 2.164L34.86 20H28v6.982h6.635l2.092-2.311L38.767 27h2.21L37.883 23.413zM33.728 25.516h-4.011v-1.381h3.838v-1.323h-3.838v-1.308l4.234.012 1.693 1.897L33.728 25.516z"
9562
9580
  }))
9563
9581
  };
9564
9582
  return name ? icons[name.toLowerCase()] : /*#__PURE__*/React__default.createElement("svg", {
@@ -9610,6 +9628,19 @@ function notifyBugsnag(callback, startOptions) {
9610
9628
  }
9611
9629
  callback();
9612
9630
  }
9631
+ const refreshUser = () => {
9632
+ var _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro6$user$;
9633
+ window.Pelcro.user.refresh({
9634
+ auth_token: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : (_window$Pelcro6$user$ = _window$Pelcro6$user.read()) === null || _window$Pelcro6$user$ === void 0 ? void 0 : _window$Pelcro6$user$.auth_token
9635
+ }, (err, res) => {
9636
+ if (err) {
9637
+ console.error(err);
9638
+ }
9639
+ if (res) {
9640
+ return res.data;
9641
+ }
9642
+ });
9643
+ };
9613
9644
 
9614
9645
  const resources = {
9615
9646
  en: {
@@ -12580,8 +12611,8 @@ const SET_CANCEL_SUBSCRIPTION_REASON = "SET_CANCEL_SUBSCRIPTION_REASON";
12580
12611
  const SET_CANCEL_SUBSCRIPTION_OPTION = "SET_CANCEL_SUBSCRIPTION_OPTION";
12581
12612
  const HANDLE_CHECKBOX_CHANGE = "HANDLE_CHECKBOX_CHANGE";
12582
12613
  const SET_IS_DEFAULT_PAYMENT_METHOD = "SET_IS_DEFAULT_PAYMENT_METHOD";
12583
- const SET_DELETE_PAYMENT_METHOD_OPTION = "SET_DELETE_PAYMENT_METHOD_OPTION";
12584
12614
  const SET_PAYMENT_METHODS = "SET_PAYMENT_METHODS";
12615
+ const SHOW_PAYMENT_METHOD_SELECT = "SHOW_PAYMENT_METHOD_SELECT";
12585
12616
  const SET_SUBSCRIPTION_SUSPEND_DATE = "SET_SUBSCRIPTION_SUSPEND_DATE";
12586
12617
  const SET_EMAILS = "SET_EMAILS";
12587
12618
  const SET_EMAILS_ERROR = "SET_EMAILS_ERROR";
@@ -18095,6 +18126,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18095
18126
  content: t("messages.sourceCreated")
18096
18127
  }
18097
18128
  });
18129
+ refreshUser();
18098
18130
  onSuccess(res);
18099
18131
  });
18100
18132
  }
@@ -18149,6 +18181,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18149
18181
  }
18150
18182
  });
18151
18183
  }
18184
+ refreshUser();
18152
18185
  onSuccess(res);
18153
18186
  });
18154
18187
  }, 2000);
@@ -18210,6 +18243,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18210
18243
  content: t("messages.sourceUpdated")
18211
18244
  }
18212
18245
  });
18246
+ refreshUser();
18213
18247
  onSuccess(res);
18214
18248
  });
18215
18249
  }
@@ -18735,7 +18769,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18735
18769
  const confirmStripeIntentSetup = (response, flow, paymentMethodId) => {
18736
18770
  var _response$data2;
18737
18771
  const setupIntent = (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.setup_intent;
18738
- if (setupIntent !== null && setupIntent !== void 0 && setupIntent.client_secret) {
18772
+ if ((setupIntent === null || setupIntent === void 0 ? void 0 : setupIntent.status) === "requires_action" && setupIntent !== null && setupIntent !== void 0 && setupIntent.client_secret) {
18739
18773
  var _response$data3, _response$data3$sourc;
18740
18774
  stripe.confirmCardSetup(setupIntent.client_secret, {
18741
18775
  payment_method: (_response$data3 = response.data) === null || _response$data3 === void 0 ? void 0 : (_response$data3$sourc = _response$data3.source) === null || _response$data3$sourc === void 0 ? void 0 : _response$data3$sourc.object_id
@@ -18759,6 +18793,19 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18759
18793
  }
18760
18794
  });
18761
18795
  }
18796
+ if (flow === "subCreate") {
18797
+ dispatch({
18798
+ type: DISABLE_SUBMIT,
18799
+ payload: false
18800
+ });
18801
+ dispatch({
18802
+ type: LOADING,
18803
+ payload: false
18804
+ });
18805
+ refreshUser();
18806
+ onSuccess(res);
18807
+ return;
18808
+ }
18762
18809
  if (flow === "create") {
18763
18810
  dispatch({
18764
18811
  type: LOADING,
@@ -18771,6 +18818,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18771
18818
  content: t("messages.sourceCreated")
18772
18819
  }
18773
18820
  });
18821
+ refreshUser();
18774
18822
  onSuccess(res);
18775
18823
  return;
18776
18824
  }
@@ -18790,6 +18838,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18790
18838
  content: t("messages.sourceUpdated")
18791
18839
  }
18792
18840
  });
18841
+ refreshUser();
18793
18842
  onSuccess(res);
18794
18843
  return;
18795
18844
  }
@@ -18817,6 +18866,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18817
18866
  }
18818
18867
  });
18819
18868
  }
18869
+ refreshUser();
18820
18870
  onSuccess(res);
18821
18871
  });
18822
18872
  }, 2000);
@@ -18848,6 +18898,10 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18848
18898
  gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
18849
18899
  address_id: product.address_required ? selectedAddressId : null
18850
18900
  }, (err, res) => {
18901
+ var _res$data;
18902
+ if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.setup_intent) {
18903
+ return confirmStripeIntentSetup(res, "subCreate");
18904
+ }
18851
18905
  confirmStripeCardPayment(res, err, true);
18852
18906
  });
18853
18907
  } else {
@@ -19111,7 +19165,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19111
19165
  auth_token: window.Pelcro.user.read().auth_token,
19112
19166
  token: source.id
19113
19167
  }, (err, res) => {
19114
- var _res$data, _res$data$setup_inten, _res$data2, _res$data2$setup_inte;
19168
+ var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
19115
19169
  if (err) {
19116
19170
  dispatch({
19117
19171
  type: DISABLE_SUBMIT,
@@ -19130,7 +19184,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19130
19184
  }
19131
19185
  });
19132
19186
  }
19133
- if (((_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$setup_inten = _res$data.setup_intent) === null || _res$data$setup_inten === void 0 ? void 0 : _res$data$setup_inten.status) === "requires_action" || ((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_confirmation") {
19187
+ if (((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_action" || ((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_confirmation") {
19134
19188
  confirmStripeIntentSetup(res, "create");
19135
19189
  } else {
19136
19190
  dispatch({
@@ -19144,6 +19198,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19144
19198
  content: t("messages.sourceCreated")
19145
19199
  }
19146
19200
  });
19201
+ refreshUser();
19147
19202
  onSuccess(res);
19148
19203
  }
19149
19204
  });
@@ -19166,7 +19221,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19166
19221
  exp_year: year,
19167
19222
  is_default: isDefault
19168
19223
  }, (err, res) => {
19169
- var _res$data3, _res$data3$setup_inte, _res$data4, _res$data4$setup_inte;
19224
+ var _res$data4, _res$data4$setup_inte, _res$data5, _res$data5$setup_inte;
19170
19225
  dispatch({
19171
19226
  type: DISABLE_SUBMIT,
19172
19227
  payload: false
@@ -19185,7 +19240,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19185
19240
  }
19186
19241
  });
19187
19242
  }
19188
- if (((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_action" || ((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_confirmation") {
19243
+ if (((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_action" || ((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_confirmation") {
19189
19244
  confirmStripeIntentSetup(res, "update");
19190
19245
  } else {
19191
19246
  dispatch({
@@ -19195,6 +19250,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19195
19250
  content: t("messages.sourceUpdated")
19196
19251
  }
19197
19252
  });
19253
+ refreshUser();
19198
19254
  onSuccess(res);
19199
19255
  }
19200
19256
  });
@@ -19227,7 +19283,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19227
19283
  auth_token: window.Pelcro.user.read().auth_token,
19228
19284
  token: source.id
19229
19285
  }, (err, res) => {
19230
- var _res$data5, _res$data5$setup_inte, _res$data6, _res$data6$setup_inte;
19286
+ var _res$data6, _res$data6$setup_inte, _res$data7, _res$data7$setup_inte;
19231
19287
  if (err) {
19232
19288
  onFailure(err);
19233
19289
  return dispatch({
@@ -19238,7 +19294,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19238
19294
  }
19239
19295
  });
19240
19296
  }
19241
- if (((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_action" || ((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_confirmation") {
19297
+ if (((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_action" || ((_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : (_res$data7$setup_inte = _res$data7.setup_intent) === null || _res$data7$setup_inte === void 0 ? void 0 : _res$data7$setup_inte.status) === "requires_confirmation") {
19242
19298
  confirmStripeIntentSetup(res, "replace", paymentMethodId);
19243
19299
  } else {
19244
19300
  setTimeout(() => {
@@ -19264,6 +19320,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19264
19320
  }
19265
19321
  });
19266
19322
  }
19323
+ refreshUser();
19267
19324
  onSuccess(res);
19268
19325
  });
19269
19326
  }, 2000);
@@ -19359,12 +19416,12 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19359
19416
  coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
19360
19417
  address_id: selectedAddressId
19361
19418
  }, (error, res) => {
19362
- var _res$data7, _res$data8;
19419
+ var _res$data8, _res$data9;
19363
19420
  if (error) {
19364
19421
  return reject(error);
19365
19422
  }
19366
- const taxAmount = (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.taxes;
19367
- const totalAmountWithTax = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.total;
19423
+ const taxAmount = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.taxes;
19424
+ const totalAmountWithTax = (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.total;
19368
19425
  resolve({
19369
19426
  totalAmountWithTax,
19370
19427
  taxAmount
@@ -25290,7 +25347,8 @@ const PasswordResetContainer = _ref => {
25290
25347
  email,
25291
25348
  password,
25292
25349
  password_confirmation: confirmPassword,
25293
- token
25350
+ token,
25351
+ referer: window.location.origin
25294
25352
  }, (err, res) => {
25295
25353
  dispatch({
25296
25354
  type: DISABLE_SUBMIT,
@@ -25522,7 +25580,8 @@ const PasswordForgotContainer = _ref => {
25522
25580
  email
25523
25581
  } = _ref2;
25524
25582
  window.Pelcro.password.forgot({
25525
- email
25583
+ email,
25584
+ referer: window.location.origin
25526
25585
  }, (err, res) => {
25527
25586
  dispatch({
25528
25587
  type: DISABLE_SUBMIT,
@@ -27647,17 +27706,21 @@ const AddressSelectModal = _ref => {
27647
27706
  AddressSelectModal.viewId = "address-select";
27648
27707
 
27649
27708
  const moveDefaultPaymentMethodToStart = paymentMethods => {
27650
- var _window$Pelcro$user$r;
27651
- const defaultPaymentMethod = (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.source;
27709
+ const defaultPaymentMethod = getDefaultPaymentMethod(paymentMethods);
27652
27710
  const paymentMethodsWithoutDefault = paymentMethods.filter(paymentMethod => paymentMethod.id !== defaultPaymentMethod.id);
27653
27711
  if (defaultPaymentMethod.status !== "chargeable") {
27654
27712
  return paymentMethodsWithoutDefault;
27655
27713
  }
27656
27714
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
27657
27715
  };
27716
+ const getDefaultPaymentMethod = paymentMethods => {
27717
+ const defaultPaymentMethod = paymentMethods.find(paymentMethod => paymentMethod.is_default);
27718
+ return defaultPaymentMethod;
27719
+ };
27658
27720
  const initialState$5 = {
27659
27721
  paymentMethods: [],
27660
27722
  selectedPaymentMethodId: null,
27723
+ skeletonLoader: true,
27661
27724
  isSubmitting: false,
27662
27725
  alert: {
27663
27726
  type: "error",
@@ -27688,12 +27751,11 @@ const PaymentMethodSelectContainer = _ref => {
27688
27751
  });
27689
27752
  return onSuccess(selectedPaymentMethodId);
27690
27753
  };
27691
- const getInitialSelectedMethodId = () => {
27692
- var _window$Pelcro$user$r2;
27754
+ const getInitialSelectedMethodId = paymentMethods => {
27693
27755
  if (selectedPaymentMethodIdFromStore) {
27694
27756
  return selectedPaymentMethodIdFromStore;
27695
27757
  }
27696
- const defaultMethod = (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.source;
27758
+ const defaultMethod = getDefaultPaymentMethod(paymentMethods);
27697
27759
  if (defaultMethod && defaultMethod.status === "chargeable") {
27698
27760
  return String(defaultMethod.id);
27699
27761
  }
@@ -27710,7 +27772,12 @@ const PaymentMethodSelectContainer = _ref => {
27710
27772
  return lib_7({
27711
27773
  ...state,
27712
27774
  paymentMethods: moveDefaultPaymentMethodToStart(action.payload),
27713
- selectedPaymentMethodId: getInitialSelectedMethodId()
27775
+ selectedPaymentMethodId: getInitialSelectedMethodId(action.payload)
27776
+ });
27777
+ case SKELETON_LOADER:
27778
+ return lib_7({
27779
+ ...state,
27780
+ skeletonLoader: action.payload
27714
27781
  });
27715
27782
  case HANDLE_SUBMIT:
27716
27783
  return lib_5({
@@ -27722,10 +27789,23 @@ const PaymentMethodSelectContainer = _ref => {
27722
27789
  }
27723
27790
  }, initialState$5);
27724
27791
  useEffect(() => {
27725
- var _window$Pelcro$user$r3;
27726
- dispatch({
27727
- type: LOAD_PAYMENT_METHODS,
27728
- payload: (_window$Pelcro$user$r3 = window.Pelcro.user.read().sources) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : []
27792
+ window.Pelcro.paymentMethods.list({
27793
+ auth_token: window.Pelcro.user.read().auth_token
27794
+ }, (err, res) => {
27795
+ if (err) {
27796
+ return console.error(err);
27797
+ }
27798
+ if (res) {
27799
+ var _res$data;
27800
+ dispatch({
27801
+ type: LOAD_PAYMENT_METHODS,
27802
+ payload: (_res$data = res.data) !== null && _res$data !== void 0 ? _res$data : []
27803
+ });
27804
+ dispatch({
27805
+ type: SKELETON_LOADER,
27806
+ payload: false
27807
+ });
27808
+ }
27729
27809
  });
27730
27810
  }, []);
27731
27811
  return /*#__PURE__*/React__default.createElement("div", {
@@ -27754,7 +27834,8 @@ const PaymentMethodSelectList = () => {
27754
27834
  dispatch,
27755
27835
  state: {
27756
27836
  paymentMethods,
27757
- selectedPaymentMethodId
27837
+ selectedPaymentMethodId,
27838
+ skeletonLoader
27758
27839
  }
27759
27840
  } = useContext(store$5);
27760
27841
  const handlePaymentMethodSelect = event => {
@@ -27763,7 +27844,9 @@ const PaymentMethodSelectList = () => {
27763
27844
  payload: event.target.value
27764
27845
  });
27765
27846
  };
27766
- return /*#__PURE__*/React__default.createElement("div", {
27847
+ return /*#__PURE__*/React__default.createElement("div", null, skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
27848
+ className: "plc-w-full plc-h-20 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
27849
+ }) : /*#__PURE__*/React__default.createElement("div", {
27767
27850
  className: "plc-px-3 plc-py-2 plc-space-y-4 plc-overflow-y-scroll plc-max-h-80 pelcro-payment-method-select-wrapper"
27768
27851
  }, paymentMethods.map(paymentMethod => {
27769
27852
  var _paymentMethod$proper, _paymentMethod$proper2, _paymentMethod$proper3, _paymentMethod$proper4;
@@ -27786,7 +27869,7 @@ const PaymentMethodSelectList = () => {
27786
27869
  }, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ", (_paymentMethod$proper2 = paymentMethod.properties) === null || _paymentMethod$proper2 === void 0 ? void 0 : _paymentMethod$proper2.last4), /*#__PURE__*/React__default.createElement("p", {
27787
27870
  className: "plc-text-sm plc-text-gray-500"
27788
27871
  }, t("select.expires"), " ", (_paymentMethod$proper3 = paymentMethod.properties) === null || _paymentMethod$proper3 === void 0 ? void 0 : _paymentMethod$proper3.exp_month, "/", (_paymentMethod$proper4 = paymentMethod.properties) === null || _paymentMethod$proper4 === void 0 ? void 0 : _paymentMethod$proper4.exp_year))));
27789
- }));
27872
+ })));
27790
27873
  };
27791
27874
 
27792
27875
  const PaymentMethodSelectSubmit = _ref => {
@@ -27888,10 +27971,10 @@ const initialState$4 = {
27888
27971
  paymentMethods: [],
27889
27972
  selectedPaymentMethodId: null,
27890
27973
  isSubmitting: false,
27891
- deleteOption: "",
27892
- disableSubmit: false,
27974
+ disableSubmit: true,
27893
27975
  isLoading: false,
27894
27976
  skeletonLoader: true,
27977
+ showPaymentMethodSelect: false,
27895
27978
  alert: {
27896
27979
  type: "error",
27897
27980
  content: ""
@@ -27928,20 +28011,19 @@ const PaymentMethodDeleteContainer = _ref => {
27928
28011
  type: SKELETON_LOADER,
27929
28012
  payload: false
27930
28013
  });
27931
- if (res.data.length !== 1) {
28014
+ if (res.data.length !== 1 && paymentMethodToDelete.is_default && paymentMethodToDelete.deletable) {
27932
28015
  dispatch({
27933
- type: SET_DELETE_PAYMENT_METHOD_OPTION,
27934
- payload: "select"
27935
- });
27936
- } else {
27937
- dispatch({
27938
- type: SET_DELETE_PAYMENT_METHOD_OPTION,
27939
- payload: "add"
28016
+ type: SHOW_PAYMENT_METHOD_SELECT,
28017
+ payload: true
27940
28018
  });
27941
28019
  }
28020
+ dispatch({
28021
+ type: DISABLE_SUBMIT,
28022
+ payload: false
28023
+ });
27942
28024
  }
27943
28025
  });
27944
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
28026
+ }, [paymentMethodToDelete]); // eslint-disable-line react-hooks/exhaustive-deps
27945
28027
 
27946
28028
  const setDefaultPaymentMethod = () => {
27947
28029
  const {
@@ -27953,6 +28035,15 @@ const PaymentMethodDeleteContainer = _ref => {
27953
28035
  is_default: true
27954
28036
  }, (err, res) => {
27955
28037
  if (err) {
28038
+ dispatch({
28039
+ type: DISABLE_SUBMIT,
28040
+ payload: false
28041
+ });
28042
+ dispatch({
28043
+ type: LOADING,
28044
+ payload: false
28045
+ });
28046
+ console.log(err);
27956
28047
  onFailure(err);
27957
28048
  return dispatch({
27958
28049
  type: SHOW_ALERT,
@@ -27975,6 +28066,14 @@ const PaymentMethodDeleteContainer = _ref => {
27975
28066
  auth_token: window.Pelcro.user.read().auth_token,
27976
28067
  payment_method_id: paymentMethodId
27977
28068
  }, (err, res) => {
28069
+ dispatch({
28070
+ type: DISABLE_SUBMIT,
28071
+ payload: false
28072
+ });
28073
+ dispatch({
28074
+ type: LOADING,
28075
+ payload: false
28076
+ });
27978
28077
  if (err) {
27979
28078
  onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
27980
28079
  return dispatch({
@@ -27985,14 +28084,6 @@ const PaymentMethodDeleteContainer = _ref => {
27985
28084
  }
27986
28085
  });
27987
28086
  }
27988
- dispatch({
27989
- type: DISABLE_SUBMIT,
27990
- payload: false
27991
- });
27992
- dispatch({
27993
- type: LOADING,
27994
- payload: false
27995
- });
27996
28087
  onSuccess(res);
27997
28088
  });
27998
28089
  };
@@ -28008,11 +28099,12 @@ const PaymentMethodDeleteContainer = _ref => {
28008
28099
  ...state,
28009
28100
  disableSubmit: true,
28010
28101
  isLoading: true
28011
- }, (state, dispatch) => setDefaultPaymentMethod());
28012
- case SET_DELETE_PAYMENT_METHOD_OPTION:
28013
- return lib_7({
28014
- ...state,
28015
- deleteOption: action.payload
28102
+ }, (state, dispatch) => {
28103
+ if (state.showPaymentMethodSelect) {
28104
+ setDefaultPaymentMethod();
28105
+ } else {
28106
+ deletePaymentMethod();
28107
+ }
28016
28108
  });
28017
28109
  case SET_PAYMENT_METHODS:
28018
28110
  return lib_7({
@@ -28039,6 +28131,11 @@ const PaymentMethodDeleteContainer = _ref => {
28039
28131
  ...state,
28040
28132
  skeletonLoader: action.payload
28041
28133
  });
28134
+ case SHOW_PAYMENT_METHOD_SELECT:
28135
+ return lib_7({
28136
+ ...state,
28137
+ showPaymentMethodSelect: action.payload
28138
+ });
28042
28139
  default:
28043
28140
  return state;
28044
28141
  }
@@ -28061,6 +28158,91 @@ const PaymentMethodDeleteContainer = _ref => {
28061
28158
  })));
28062
28159
  };
28063
28160
 
28161
+ const PaymentMethodDeleteList = props => {
28162
+ const {
28163
+ t
28164
+ } = useTranslation("paymentMethod");
28165
+ const {
28166
+ dispatch,
28167
+ state: {
28168
+ selectedPaymentMethodId,
28169
+ paymentMethods,
28170
+ skeletonLoader,
28171
+ showPaymentMethodSelect
28172
+ }
28173
+ } = useContext(store$4);
28174
+ const {
28175
+ paymentMethodToDelete
28176
+ } = usePelcro();
28177
+ const createPaymentMethodItems = () => {
28178
+ if (paymentMethods.length) {
28179
+ return paymentMethods.filter(paymentMethod => (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id) !== (paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id)).map(paymentMethod => /*#__PURE__*/React__default.createElement("option", {
28180
+ key: paymentMethod.id,
28181
+ value: paymentMethod.id
28182
+ }, paymentMethod.properties.brand, " -", " ", paymentMethod.properties.last4, " -", " ", paymentMethod.properties.exp_month, " /", paymentMethod.properties.exp_year));
28183
+ }
28184
+ };
28185
+ const handlePaymentMethodSelect = event => {
28186
+ dispatch({
28187
+ type: SELECT_PAYMENT_METHOD,
28188
+ payload: event.target.value
28189
+ });
28190
+ };
28191
+ if (showPaymentMethodSelect) {
28192
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
28193
+ className: "plc-w-full plc-h-8 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
28194
+ }) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, paymentMethods && /*#__PURE__*/React__default.createElement("div", {
28195
+ className: "plc-mt-4"
28196
+ }, /*#__PURE__*/React__default.createElement(Select, {
28197
+ label: t("delete.options.select"),
28198
+ name: "default-payment-method",
28199
+ onChange: handlePaymentMethodSelect,
28200
+ value: selectedPaymentMethodId
28201
+ }, /*#__PURE__*/React__default.createElement("option", {
28202
+ value: "",
28203
+ disabled: true,
28204
+ selected: true
28205
+ }), createPaymentMethodItems()))));
28206
+ } else {
28207
+ return null;
28208
+ }
28209
+ };
28210
+
28211
+ const PaymentMethodDetails = () => {
28212
+ var _paymentMethodToDelet, _paymentMethodToDelet2, _paymentMethodToDelet3, _paymentMethodToDelet4;
28213
+ const {
28214
+ state: {
28215
+ skeletonLoader
28216
+ }
28217
+ } = useContext(store$4);
28218
+ const {
28219
+ t
28220
+ } = useTranslation("paymentMethod");
28221
+ const {
28222
+ paymentMethodToDelete
28223
+ } = usePelcro();
28224
+ return /*#__PURE__*/React__default.createElement("div", {
28225
+ className: "plc-text-left plc-mr-auto plc-mb-6"
28226
+ }, /*#__PURE__*/React__default.createElement("h4", {
28227
+ className: "plc-mb-2"
28228
+ }, t("delete.details")), skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
28229
+ className: "plc-w-full plc-h-16 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
28230
+ }) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, paymentMethodToDelete && /*#__PURE__*/React__default.createElement("div", {
28231
+ key: paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id,
28232
+ className: `plc-p-2 plc-pl-4 plc-shadow-md_dark plc-text-gray-900 plc-rounded pelcro-payment-method-wrapper`
28233
+ }, /*#__PURE__*/React__default.createElement("div", {
28234
+ className: "plc-flex plc-items-center plc-space-x-2 plc-w-full pelcro-select-payment-method-radio",
28235
+ id: `pelcro-payment-method-select-${paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id}`,
28236
+ name: "paymentMethod"
28237
+ }, getPaymentCardIcon$1((_paymentMethodToDelet = paymentMethodToDelete.properties) === null || _paymentMethodToDelet === void 0 ? void 0 : _paymentMethodToDelet.brand), /*#__PURE__*/React__default.createElement("div", {
28238
+ className: "plc-flex plc-flex-col plc-text-lg pelcro-payment-method-details"
28239
+ }, /*#__PURE__*/React__default.createElement("p", {
28240
+ className: "plc-font-semibold"
28241
+ }, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022", " ", (_paymentMethodToDelet2 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet2 === void 0 ? void 0 : _paymentMethodToDelet2.last4), /*#__PURE__*/React__default.createElement("p", {
28242
+ className: "plc-text-sm plc-text-gray-500"
28243
+ }, t("select.expires"), " ", (_paymentMethodToDelet3 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet3 === void 0 ? void 0 : _paymentMethodToDelet3.exp_month, "/", (_paymentMethodToDelet4 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet4 === void 0 ? void 0 : _paymentMethodToDelet4.exp_year))))));
28244
+ };
28245
+
28064
28246
  const PaymentMethodDeleteSubmit = _ref => {
28065
28247
  let {
28066
28248
  name,
@@ -28074,7 +28256,9 @@ const PaymentMethodDeleteSubmit = _ref => {
28074
28256
  dispatch,
28075
28257
  state: {
28076
28258
  isLoading,
28077
- isDisabled
28259
+ disableSubmit,
28260
+ showPaymentMethodSelect,
28261
+ selectedPaymentMethodId
28078
28262
  }
28079
28263
  } = useContext(store$4);
28080
28264
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
@@ -28084,116 +28268,38 @@ const PaymentMethodDeleteSubmit = _ref => {
28084
28268
  });
28085
28269
  onClick === null || onClick === void 0 ? void 0 : onClick();
28086
28270
  },
28087
- disabled: isDisabled,
28271
+ disabled: showPaymentMethodSelect ? !selectedPaymentMethodId : disableSubmit,
28088
28272
  isLoading: isLoading,
28089
28273
  className: "plc-w-full"
28090
- }, otherProps), name !== null && name !== void 0 ? name : t("select.buttons.selectPaymentMethod"));
28274
+ }, otherProps), name !== null && name !== void 0 ? name : t("delete.buttons.delete"));
28091
28275
  };
28092
28276
 
28093
- const PaymentMethodDeleteList = props => {
28277
+ const PaymentMethodDeleteBack = _ref => {
28278
+ let {
28279
+ name,
28280
+ onClick,
28281
+ ...otherProps
28282
+ } = _ref;
28094
28283
  const {
28095
28284
  t
28096
28285
  } = useTranslation("paymentMethod");
28097
28286
  const {
28098
- dispatch,
28099
- state: {
28100
- deleteOption,
28101
- selectedPaymentMethodId,
28102
- paymentMethods,
28103
- skeletonLoader
28104
- }
28105
- } = useContext(store$4);
28106
- const {
28107
- paymentMethodToDelete
28287
+ switchView
28108
28288
  } = usePelcro();
28109
- const handlePaymentMethodSelect = event => {
28110
- dispatch({
28111
- type: SELECT_PAYMENT_METHOD,
28112
- payload: event.target.value
28113
- });
28114
- };
28115
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
28116
- className: "plc-w-full plc-h-40 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
28117
- }) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, paymentMethods && deleteOption === "select" && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
28118
- className: "plc-px-3 plc-py-2 plc-space-y-4 plc-overflow-y-scroll no-scrollbar plc-max-h-80 pelcro-payment-method-select-wrapper plc-mb-4"
28119
- }, paymentMethods.filter(paymentMethod => (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id) !== (paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id)).map(paymentMethod => {
28120
- var _paymentMethod$proper, _paymentMethod$proper2, _paymentMethod$proper3, _paymentMethod$proper4;
28121
- const isSelected = selectedPaymentMethodId === String(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
28122
- return /*#__PURE__*/React__default.createElement("div", {
28123
- key: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id,
28124
- className: `plc-p-2 plc-pl-4 plc-shadow-md plc-text-gray-900 plc-rounded pelcro-payment-method-wrapper`
28125
- }, /*#__PURE__*/React__default.createElement(Radio, {
28126
- className: "plc-flex plc-items-center pelcro-select-payment-method-radio",
28127
- labelClassName: "plc-flex plc-items-center plc-space-x-2 plc-cursor-pointer plc-w-full",
28128
- id: `pelcro-payment-method-select-${paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id}`,
28129
- name: "paymentMethod",
28130
- checked: isSelected,
28131
- value: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id,
28132
- onChange: handlePaymentMethodSelect
28133
- }, getPaymentCardIcon$1((_paymentMethod$proper = paymentMethod.properties) === null || _paymentMethod$proper === void 0 ? void 0 : _paymentMethod$proper.brand), /*#__PURE__*/React__default.createElement("div", {
28134
- className: "plc-flex plc-flex-col plc-text-lg pelcro-payment-method-details"
28135
- }, /*#__PURE__*/React__default.createElement("p", {
28136
- className: "plc-font-semibold"
28137
- }, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022", " ", (_paymentMethod$proper2 = paymentMethod.properties) === null || _paymentMethod$proper2 === void 0 ? void 0 : _paymentMethod$proper2.last4), /*#__PURE__*/React__default.createElement("p", {
28138
- className: "plc-text-sm plc-text-gray-500"
28139
- }, t("select.expires"), " ", (_paymentMethod$proper3 = paymentMethod.properties) === null || _paymentMethod$proper3 === void 0 ? void 0 : _paymentMethod$proper3.exp_month, "/", (_paymentMethod$proper4 = paymentMethod.properties) === null || _paymentMethod$proper4 === void 0 ? void 0 : _paymentMethod$proper4.exp_year))));
28140
- })), /*#__PURE__*/React__default.createElement("div", {
28141
- className: "plc-px-3"
28142
- }, /*#__PURE__*/React__default.createElement(PaymentMethodDeleteSubmit, null))), deleteOption === "add" && /*#__PURE__*/React__default.createElement(PaymentMethodView, {
28143
- type: "deletePaymentSource",
28144
- showCoupon: false,
28145
- showExternalPaymentMethods: false,
28146
- showApplePayButton: false,
28147
- onDisplay: props.onDisplay,
28148
- onFailure: props.onFailure,
28149
- onSuccess: props.onSuccess,
28150
- setAsDefault: true
28151
- })));
28289
+ return /*#__PURE__*/React__default.createElement(Button, Object.assign({
28290
+ variant: "outline",
28291
+ onClick: () => {
28292
+ switchView("dashboard");
28293
+ onClick === null || onClick === void 0 ? void 0 : onClick();
28294
+ },
28295
+ className: "plc-w-full"
28296
+ }, otherProps), name !== null && name !== void 0 ? name : t("delete.buttons.back"));
28152
28297
  };
28153
28298
 
28154
- const PaymentMethodDeleteOptions = _ref => {
28155
- const {
28156
- state: {
28157
- deleteOption,
28158
- paymentMethods,
28159
- skeletonLoader
28160
- },
28161
- dispatch
28162
- } = useContext(store$4);
28299
+ function PaymentMethodDeleteView(props) {
28163
28300
  const {
28164
28301
  t
28165
28302
  } = useTranslation("paymentMethod");
28166
- const handleOptionSelect = event => {
28167
- dispatch({
28168
- type: SET_DELETE_PAYMENT_METHOD_OPTION,
28169
- payload: event.target.value
28170
- });
28171
- };
28172
- return /*#__PURE__*/React__default.createElement("div", {
28173
- className: "plc-text-left plc-mr-auto plc-mb-6"
28174
- }, skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
28175
- className: "plc-flex plc-flex-col plc-space-y-3"
28176
- }, /*#__PURE__*/React__default.createElement(Radio, {
28177
- className: "plc-animate-puls"
28178
- }, /*#__PURE__*/React__default.createElement("div", {
28179
- className: "plc-w-36 plc-bg-gray-300 plc-h-4 plc-rounded-md plc-animate-pulse"
28180
- })), /*#__PURE__*/React__default.createElement(Radio, {
28181
- className: "plc-animate-pulse"
28182
- }, /*#__PURE__*/React__default.createElement("div", {
28183
- className: "plc-w-36 plc-bg-gray-300 plc-h-4 plc-rounded-md plc-animate-pulse"
28184
- }))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, paymentMethods && paymentMethods.length !== 1 && /*#__PURE__*/React__default.createElement(Radio, {
28185
- onChange: handleOptionSelect,
28186
- checked: deleteOption === "select",
28187
- value: "select"
28188
- }, t("delete.options.select")), /*#__PURE__*/React__default.createElement(Radio, {
28189
- onChange: handleOptionSelect,
28190
- checked: deleteOption === "add",
28191
- value: "add"
28192
- }, t("delete.options.add"))));
28193
- };
28194
-
28195
- function PaymentMethodDeleteView(props) {
28196
- const [t] = useTranslation("paymentMethod");
28197
28303
  return /*#__PURE__*/React__default.createElement("div", {
28198
28304
  id: "pelcro-payment-method-delete-view"
28199
28305
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -28201,12 +28307,12 @@ function PaymentMethodDeleteView(props) {
28201
28307
  }, /*#__PURE__*/React__default.createElement("h4", {
28202
28308
  className: "plc-text-2xl plc-font-semibold plc-mb-2"
28203
28309
  }, t("delete.title")), /*#__PURE__*/React__default.createElement("p", {
28204
- className: ""
28205
- }, t("delete.subtitle"))), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteContainer, props, /*#__PURE__*/React__default.createElement(AlertWithContext, {
28206
- className: "plc-mb-2"
28207
- }), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteOptions, null), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteList, {
28208
- onSuccess: props.onSuccess
28209
- })));
28310
+ className: "plc-text-sm"
28311
+ }, t("delete.subtitle"))), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteContainer, props, /*#__PURE__*/React__default.createElement(AlertWithContext, null), /*#__PURE__*/React__default.createElement(PaymentMethodDetails, null), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteList, null), /*#__PURE__*/React__default.createElement("p", {
28312
+ className: "plc-text-sm plc-text-justify"
28313
+ }, t("delete.message")), /*#__PURE__*/React__default.createElement("div", {
28314
+ className: "plc-space-x-0 plc-space-y-3 plc-w-full plc-flex plc-flex-col plc-items-center plc-justify-center plc-mt-4"
28315
+ }, /*#__PURE__*/React__default.createElement(PaymentMethodDeleteSubmit, null), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteBack, null))));
28210
28316
  }
28211
28317
 
28212
28318
  const PaymentMethodDeleteModal = props => {
@@ -28233,7 +28339,7 @@ const PaymentMethodDeleteModal = props => {
28233
28339
  nonInteraction: true
28234
28340
  });
28235
28341
  }
28236
- notify$1.success(t("delete.paymentMethodReplaced"));
28342
+ notify$1.success(t("delete.deletedSuccessfully"));
28237
28343
  resetView();
28238
28344
  };
28239
28345
  return /*#__PURE__*/React__default.createElement(Modal, {
@@ -29419,6 +29525,14 @@ const getPaymentCardIcon = name => {
29419
29525
  viewBox: "0 0 50 50"
29420
29526
  }, /*#__PURE__*/React__default.createElement("path", {
29421
29527
  d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 8.5625 19.90625 L 4.84375 28.40625 L 7.0625 28.40625 L 7.875 26.5 L 12.0625 26.5 L 12.875 28.40625 L 17.09375 28.40625 L 17.09375 22.09375 L 19.90625 28.40625 L 21.8125 28.40625 L 24.65625 22.1875 L 24.65625 28.40625 L 26.75 28.40625 L 26.75 19.90625 L 23.40625 19.90625 L 20.84375 25.625 L 18.28125 19.90625 L 15 19.90625 L 15 28.09375 L 11.34375 19.90625 Z M 29.5 19.90625 L 29.5 28.4375 L 37.5 28.4375 L 40 25.59375 L 42.46875 28.4375 L 45.125 28.4375 L 41.375 24.0625 L 45.125 19.90625 L 42.46875 19.90625 L 40.0625 22.5625 L 37.75 19.90625 Z M 9.90625 21.6875 L 11.21875 24.6875 L 8.65625 24.6875 Z M 31.5625 21.71875 L 36.65625 21.75 L 38.6875 24.0625 L 36.40625 26.625 L 31.5625 26.625 L 31.5625 24.9375 L 36.1875 24.9375 L 36.1875 23.3125 L 31.5625 23.3125 Z"
29528
+ })),
29529
+ amex: /*#__PURE__*/React__default.createElement("svg", {
29530
+ className: "plc-w-12",
29531
+ fill: "#ffffff",
29532
+ xmlns: "http://www.w3.org/2000/svg",
29533
+ viewBox: "0 0 50 50"
29534
+ }, /*#__PURE__*/React__default.createElement("path", {
29535
+ d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 8.5625 19.90625 L 4.84375 28.40625 L 7.0625 28.40625 L 7.875 26.5 L 12.0625 26.5 L 12.875 28.40625 L 17.09375 28.40625 L 17.09375 22.09375 L 19.90625 28.40625 L 21.8125 28.40625 L 24.65625 22.1875 L 24.65625 28.40625 L 26.75 28.40625 L 26.75 19.90625 L 23.40625 19.90625 L 20.84375 25.625 L 18.28125 19.90625 L 15 19.90625 L 15 28.09375 L 11.34375 19.90625 Z M 29.5 19.90625 L 29.5 28.4375 L 37.5 28.4375 L 40 25.59375 L 42.46875 28.4375 L 45.125 28.4375 L 41.375 24.0625 L 45.125 19.90625 L 42.46875 19.90625 L 40.0625 22.5625 L 37.75 19.90625 Z M 9.90625 21.6875 L 11.21875 24.6875 L 8.65625 24.6875 Z M 31.5625 21.71875 L 36.65625 21.75 L 38.6875 24.0625 L 36.40625 26.625 L 31.5625 26.625 L 31.5625 24.9375 L 36.1875 24.9375 L 36.1875 23.3125 L 31.5625 23.3125 Z"
29422
29536
  }))
29423
29537
  };
29424
29538
  return (_icons$name$toLowerCa = icons[name === null || name === void 0 ? void 0 : name.toLowerCase()]) !== null && _icons$name$toLowerCa !== void 0 ? _icons$name$toLowerCa : /*#__PURE__*/React__default.createElement("svg", {
@@ -30745,23 +30859,8 @@ class Dashboard extends Component {
30745
30859
  });
30746
30860
  });
30747
30861
  _defineProperty$3(this, "onDeletePaymentMethodClick", source => {
30748
- const isDeletable = source === null || source === void 0 ? void 0 : source.deletable;
30749
- if (isDeletable) {
30750
- this.props.onClose();
30751
- notify$1.confirm((onSuccess, onFailure) => {
30752
- this.deletePaymentMethod(source.id, onSuccess, onFailure);
30753
- }, {
30754
- confirmMessage: this.locale("messages.paymentMethodDeletion.isSureToDelete"),
30755
- loadingMessage: this.locale("messages.paymentMethodDeletion.loading"),
30756
- successMessage: this.locale("messages.paymentMethodDeletion.success"),
30757
- errorMessage: this.locale("messages.paymentMethodDeletion.error")
30758
- }, {
30759
- closeButtonLabel: this.locale("labels.subCancellation.goBack")
30760
- });
30761
- } else {
30762
- this.props.setPaymentMethodToDelete(source.id);
30763
- return this.props.setView("payment-method-delete");
30764
- }
30862
+ this.props.setPaymentMethodToDelete(source.id);
30863
+ return this.props.setView("payment-method-delete");
30765
30864
  });
30766
30865
  _defineProperty$3(this, "displayRedeem", () => {
30767
30866
  return this.props.setView("gift-redeem");
@@ -35106,4 +35205,4 @@ const QrCodeModal = _ref => {
35106
35205
  };
35107
35206
  QrCodeModal.viewId = "qrcode";
35108
35207
 
35109
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplePayButton, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateFreeButton, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodCreateContainer, PaymentMethodCreateModal, PaymentMethodCreateView, PaymentMethodDeleteContainer, PaymentMethodDeleteList, PaymentMethodDeleteModal, PaymentMethodDeleteOptions, PaymentMethodDeleteSubmit, PaymentMethodDeleteView, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateSetDefault, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify$1 as notify, unauthenticatedButtons, usePelcro };
35208
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplePayButton, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateFreeButton, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodCreateContainer, PaymentMethodCreateModal, PaymentMethodCreateView, PaymentMethodDeleteContainer, PaymentMethodDeleteList, PaymentMethodDeleteModal, PaymentMethodDeleteSubmit, PaymentMethodDeleteView, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateSetDefault, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify$1 as notify, unauthenticatedButtons, usePelcro };