@pelcro/react-pelcro-js 3.1.0-beta.8 → 3.2.0-beta.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/dist/index.esm.js CHANGED
@@ -7064,8 +7064,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7064
7064
 
7065
7065
  let e={data:""},t=t=>"undefined"!=typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,n=(e,t)=>{let r,l="",a="",o="";for(let c in e){let s=e[c];"object"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):c,a+="@"==c[0]?"f"==c[1]?n(s,c):c+"{"+n(s,"k"==c[1]?"":t)+"}":n(s,r)):"@"==c[0]&&"i"==c[1]?l=c+" "+s+";":(c=c.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=n.p?n.p(c,s):c+":"+s+";");}return o[0]?(r=t?t+"{"+o+"}":o,l+r+a):l+a},o={},c=e=>{let t="";for(let r in e)t+=r+("object"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p="object"==typeof e?c(e):e,u=o[p]||(o[p]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(p));if(!o[u]){let t="object"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,""));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{["@keyframes "+u]:t}:t,r?"":"."+u);}return ((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":n(e,""):e;}return e+l+(null==o?"":o)},"");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,f,d;p.bind({g:1});let b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,f=r,d=l;}function y(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=p.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=c.as||e;return d&&i[0]&&d(c),u(i,c)}return t?t(a):a}}
7066
7066
 
7067
- function _extends$z() {
7068
- _extends$z = Object.assign || function (target) {
7067
+ function _extends$y() {
7068
+ _extends$y = Object.assign || function (target) {
7069
7069
  for (var i = 1; i < arguments.length; i++) {
7070
7070
  var source = arguments[i];
7071
7071
 
@@ -7079,7 +7079,7 @@ function _extends$z() {
7079
7079
  return target;
7080
7080
  };
7081
7081
 
7082
- return _extends$z.apply(this, arguments);
7082
+ return _extends$y.apply(this, arguments);
7083
7083
  }
7084
7084
 
7085
7085
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7169,7 +7169,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7169
7169
  var reducer = function reducer(state, action) {
7170
7170
  switch (action.type) {
7171
7171
  case ActionType.ADD_TOAST:
7172
- return _extends$z({}, state, {
7172
+ return _extends$y({}, state, {
7173
7173
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7174
7174
  });
7175
7175
 
@@ -7179,9 +7179,9 @@ var reducer = function reducer(state, action) {
7179
7179
  clearFromRemoveQueue(action.toast.id);
7180
7180
  }
7181
7181
 
7182
- return _extends$z({}, state, {
7182
+ return _extends$y({}, state, {
7183
7183
  toasts: state.toasts.map(function (t) {
7184
- return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7184
+ return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7185
7185
  })
7186
7186
  });
7187
7187
 
@@ -7208,9 +7208,9 @@ var reducer = function reducer(state, action) {
7208
7208
  });
7209
7209
  }
7210
7210
 
7211
- return _extends$z({}, state, {
7211
+ return _extends$y({}, state, {
7212
7212
  toasts: state.toasts.map(function (t) {
7213
- return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7213
+ return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7214
7214
  visible: false
7215
7215
  }) : t;
7216
7216
  })
@@ -7218,28 +7218,28 @@ var reducer = function reducer(state, action) {
7218
7218
 
7219
7219
  case ActionType.REMOVE_TOAST:
7220
7220
  if (action.toastId === undefined) {
7221
- return _extends$z({}, state, {
7221
+ return _extends$y({}, state, {
7222
7222
  toasts: []
7223
7223
  });
7224
7224
  }
7225
7225
 
7226
- return _extends$z({}, state, {
7226
+ return _extends$y({}, state, {
7227
7227
  toasts: state.toasts.filter(function (t) {
7228
7228
  return t.id !== action.toastId;
7229
7229
  })
7230
7230
  });
7231
7231
 
7232
7232
  case ActionType.START_PAUSE:
7233
- return _extends$z({}, state, {
7233
+ return _extends$y({}, state, {
7234
7234
  pausedAt: action.time
7235
7235
  });
7236
7236
 
7237
7237
  case ActionType.END_PAUSE:
7238
7238
  var diff = action.time - (state.pausedAt || 0);
7239
- return _extends$z({}, state, {
7239
+ return _extends$y({}, state, {
7240
7240
  pausedAt: undefined,
7241
7241
  toasts: state.toasts.map(function (t) {
7242
- return _extends$z({}, t, {
7242
+ return _extends$y({}, t, {
7243
7243
  pauseDuration: t.pauseDuration + diff
7244
7244
  });
7245
7245
  })
@@ -7286,12 +7286,12 @@ var useStore = function useStore(toastOptions) {
7286
7286
  var mergedToasts = state.toasts.map(function (t) {
7287
7287
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7288
7288
 
7289
- return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7289
+ return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7290
7290
  duration: t.duration || ((_toastOptions$t$type = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type.duration) || ((_toastOptions = toastOptions) == null ? void 0 : _toastOptions.duration) || defaultTimeouts[t.type],
7291
- style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7291
+ style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7292
7292
  });
7293
7293
  });
7294
- return _extends$z({}, state, {
7294
+ return _extends$y({}, state, {
7295
7295
  toasts: mergedToasts
7296
7296
  });
7297
7297
  };
@@ -7301,7 +7301,7 @@ var createToast = function createToast(message, type, opts) {
7301
7301
  type = 'blank';
7302
7302
  }
7303
7303
 
7304
- return _extends$z({
7304
+ return _extends$y({
7305
7305
  createdAt: Date.now(),
7306
7306
  visible: true,
7307
7307
  type: type,
@@ -7351,14 +7351,14 @@ toast.remove = function (toastId) {
7351
7351
  };
7352
7352
 
7353
7353
  toast.promise = function (promise, msgs, opts) {
7354
- var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7354
+ var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7355
7355
  promise.then(function (p) {
7356
- toast.success(resolveValue(msgs.success, p), _extends$z({
7356
+ toast.success(resolveValue(msgs.success, p), _extends$y({
7357
7357
  id: id
7358
7358
  }, opts, opts == null ? void 0 : opts.success));
7359
7359
  return p;
7360
7360
  })["catch"](function (e) {
7361
- toast.error(resolveValue(msgs.error, e), _extends$z({
7361
+ toast.error(resolveValue(msgs.error, e), _extends$y({
7362
7362
  id: id
7363
7363
  }, opts, opts == null ? void 0 : opts.error));
7364
7364
  });
@@ -7697,7 +7697,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
7697
7697
  var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7698
7698
  return createElement(ToastBarBase, {
7699
7699
  className: toast.className,
7700
- style: _extends$z({}, animationStyle, style, toast.style)
7700
+ style: _extends$y({}, animationStyle, style, toast.style)
7701
7701
  }, typeof children === 'function' ? children({
7702
7702
  icon: icon,
7703
7703
  message: message
@@ -7727,7 +7727,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7727
7727
  } : position.includes('right') ? {
7728
7728
  justifyContent: 'flex-end'
7729
7729
  } : {};
7730
- return _extends$z({
7730
+ return _extends$y({
7731
7731
  left: 0,
7732
7732
  right: 0,
7733
7733
  display: 'flex',
@@ -7754,7 +7754,7 @@ var Toaster = function Toaster(_ref) {
7754
7754
  handlers = _useToaster.handlers;
7755
7755
 
7756
7756
  return createElement("div", {
7757
- style: _extends$z({
7757
+ style: _extends$y({
7758
7758
  position: 'fixed',
7759
7759
  zIndex: 9999,
7760
7760
  top: DEFAULT_OFFSET,
@@ -7789,82 +7789,82 @@ var Toaster = function Toaster(_ref) {
7789
7789
  }));
7790
7790
  };
7791
7791
 
7792
- var _path$w;
7792
+ var _path$v;
7793
7793
 
7794
- function _extends$y() { _extends$y = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
7794
+ function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7795
7795
 
7796
7796
  function SvgCheckSolid(props) {
7797
- return /*#__PURE__*/React.createElement("svg", _extends$y({
7797
+ return /*#__PURE__*/React.createElement("svg", _extends$x({
7798
7798
  xmlns: "http://www.w3.org/2000/svg",
7799
7799
  className: "h-5 w-5",
7800
7800
  viewBox: "0 0 20 20",
7801
7801
  fill: "currentColor"
7802
- }, props), _path$w || (_path$w = /*#__PURE__*/React.createElement("path", {
7802
+ }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7803
7803
  fillRule: "evenodd",
7804
7804
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
7805
7805
  clipRule: "evenodd"
7806
7806
  })));
7807
7807
  }
7808
7808
 
7809
- var _path$v;
7809
+ var _path$u;
7810
7810
 
7811
- function _extends$x() { _extends$x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
7811
+ function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7812
7812
 
7813
7813
  function SvgXIcon(props) {
7814
- return /*#__PURE__*/React.createElement("svg", _extends$x({
7814
+ return /*#__PURE__*/React.createElement("svg", _extends$w({
7815
7815
  xmlns: "http://www.w3.org/2000/svg",
7816
7816
  viewBox: "0 0 20 20",
7817
7817
  fill: "currentColor"
7818
- }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7818
+ }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7819
7819
  fill: "evenodd",
7820
7820
  d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
7821
7821
  clipRule: "evenodd"
7822
7822
  })));
7823
7823
  }
7824
7824
 
7825
- var _path$u;
7825
+ var _path$t;
7826
7826
 
7827
- function _extends$w() { _extends$w = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
7827
+ function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7828
7828
 
7829
7829
  function SvgXIconSolid(props) {
7830
- return /*#__PURE__*/React.createElement("svg", _extends$w({
7830
+ return /*#__PURE__*/React.createElement("svg", _extends$v({
7831
7831
  className: "plc-w-4 plc-h-4",
7832
7832
  fill: "currentColor",
7833
7833
  xmlns: "http://www.w3.org/2000/svg",
7834
7834
  viewBox: "0 0 100 100"
7835
- }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7835
+ }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7836
7836
  d: "M94.842 48.408c0 24.852-20.148 44.999-45.002 44.999-24.851 0-44.997-20.146-44.997-44.999 0-24.854 20.146-45 44.997-45 24.853 0 45.002 20.146 45.002 45zM71.073 64.841L54.73 48.497l16.344-16.344-4.979-4.979-16.343 16.345-16.343-16.344-4.799 4.799 16.344 16.344L28.61 64.661l4.979 4.978 16.344-16.344 16.343 16.344 4.797-4.798z"
7837
7837
  })));
7838
7838
  }
7839
7839
 
7840
- var _path$t;
7840
+ var _path$s;
7841
7841
 
7842
- function _extends$v() { _extends$v = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
7842
+ function _extends$u() { _extends$u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
7843
7843
 
7844
7844
  function SvgExclamation(props) {
7845
- return /*#__PURE__*/React.createElement("svg", _extends$v({
7845
+ return /*#__PURE__*/React.createElement("svg", _extends$u({
7846
7846
  className: "plc-w-4 plc-h-4 plc-mr-1",
7847
7847
  xmlns: "http://www.w3.org/2000/svg",
7848
7848
  viewBox: "0 0 20 20",
7849
7849
  fill: "currentColor"
7850
- }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7850
+ }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7851
7851
  fillRule: "evenodd",
7852
7852
  d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
7853
7853
  clipRule: "evenodd"
7854
7854
  })));
7855
7855
  }
7856
7856
 
7857
- var _path$s, _path2$4;
7857
+ var _path$r, _path2$4;
7858
7858
 
7859
- function _extends$u() { _extends$u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
7859
+ function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
7860
7860
 
7861
7861
  function SvgSpinner(props) {
7862
- return /*#__PURE__*/React.createElement("svg", _extends$u({
7862
+ return /*#__PURE__*/React.createElement("svg", _extends$t({
7863
7863
  className: "plc-animate-spin",
7864
7864
  viewBox: "0 0 24 24",
7865
7865
  fill: "currentColor",
7866
7866
  xmlns: "http://www.w3.org/2000/svg"
7867
- }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7867
+ }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
7868
7868
  opacity: 0.2,
7869
7869
  fill: "evenodd",
7870
7870
  clipRule: "evenodd",
@@ -8599,6 +8599,7 @@ var pure_1 = pure.loadStripe;
8599
8599
  * @param {Object} error Error object
8600
8600
  * @return {string}
8601
8601
  */
8602
+
8602
8603
  const getErrorMessages = error => {
8603
8604
  var _error$error, _error$response, _error$response$data, _error$response3, _error$response3$data, _error$response3$data2, _error$response5, _error$response5$data;
8604
8605
 
@@ -8653,6 +8654,15 @@ const debounce = (func, waitTime) => {
8653
8654
  timeout = setTimeout(later, waitTime);
8654
8655
  };
8655
8656
  };
8657
+ function getSiteCardProcessor() {
8658
+ var _window$Pelcro$site$r;
8659
+
8660
+ if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_pay_page_id) {
8661
+ return "vantiv";
8662
+ }
8663
+
8664
+ return "stripe";
8665
+ }
8656
8666
 
8657
8667
  /**
8658
8668
  * @typedef {Object} OptionsType
@@ -8733,13 +8743,26 @@ const loadPaymentSDKs = () => {
8733
8743
  if (!window.Stripe) {
8734
8744
  pure_1(window.Pelcro.environment.stripe);
8735
8745
  }
8736
- }); // Load PayPal SDK's
8746
+ }); // Load PayPal SDKs
8737
8747
 
8738
8748
  const supportsPaypal = Boolean(window.Pelcro.site.read().braintree_tokenization);
8739
8749
 
8740
8750
  if (supportsPaypal) {
8741
8751
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/client.min.js", "braintree-sdk");
8742
8752
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/paypal-checkout.min.js", "braintree-paypal-sdk");
8753
+ } // Load Vantiv SDKs
8754
+
8755
+
8756
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_pay_page_id);
8757
+
8758
+ if (supportsVantiv) {
8759
+ if (!window.jQuery) {
8760
+ window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
8761
+ }
8762
+
8763
+ if (!window.EprotectIframeClient) {
8764
+ window.Pelcro.helpers.loadSDK("https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js", "vantiv-eprotect-sdk");
8765
+ }
8743
8766
  }
8744
8767
  };
8745
8768
  const loadAuth0SDK = () => {
@@ -8899,7 +8922,8 @@ const initViewFromURL = () => {
8899
8922
  }
8900
8923
 
8901
8924
  if (view === "invoice-details") {
8902
- return showInvoiceDetailsFromUrl();
8925
+ // FIXME: commented out to remove from the release
8926
+ return false; // return showInvoiceDetailsFromUrl();
8903
8927
  }
8904
8928
 
8905
8929
  switchView(view);
@@ -9078,43 +9102,6 @@ const verifyEmailTokenFromUrl = () => {
9078
9102
  });
9079
9103
  };
9080
9104
 
9081
- const showInvoiceDetailsFromUrl = () => {
9082
- const {
9083
- isAuthenticated,
9084
- setInvoice,
9085
- whenSiteReady,
9086
- switchView
9087
- } = usePelcro.getStore();
9088
- whenSiteReady(() => {
9089
- if (!isAuthenticated()) {
9090
- return switchView("login");
9091
- }
9092
-
9093
- const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9094
- const wasSetSuccessfully = setInvoice(invoiceId);
9095
-
9096
- if (!wasSetSuccessfully) {
9097
- const errorMessage = i18next.t("messages:invalidInvoice", {
9098
- returnObjects: true
9099
- });
9100
- return notify.error(errorMessage);
9101
- }
9102
-
9103
- const {
9104
- invoice
9105
- } = usePelcro.getStore();
9106
-
9107
- if (invoice.total === 0) {
9108
- const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9109
- returnObjects: true
9110
- });
9111
- return notify.error(errorMessage);
9112
- }
9113
-
9114
- return switchView("invoice-details");
9115
- });
9116
- };
9117
-
9118
9105
  const defaultOptions = {
9119
9106
  loadPaymentSDKs: true,
9120
9107
  loadAuth0SDK: true,
@@ -9884,16 +9871,16 @@ const LoginPassword = props => /*#__PURE__*/React__default.createElement(Passwor
9884
9871
  store: store$h
9885
9872
  }, props));
9886
9873
 
9887
- var _path$r;
9874
+ var _path$q;
9888
9875
 
9889
- function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
9876
+ function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
9890
9877
 
9891
9878
  function SvgCheck(props) {
9892
- return /*#__PURE__*/React.createElement("svg", _extends$t({
9879
+ return /*#__PURE__*/React.createElement("svg", _extends$s({
9893
9880
  xmlns: "http://www.w3.org/2000/svg",
9894
9881
  fill: "currentColor",
9895
9882
  viewBox: "0 0 20 20"
9896
- }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
9883
+ }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
9897
9884
  fillRule: "evenodd",
9898
9885
  d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
9899
9886
  clipRule: "evenodd"
@@ -10212,15 +10199,15 @@ function hasSecurityTokenEnabled$1() {
10212
10199
  return hasSecuritySdkLoaded;
10213
10200
  }
10214
10201
 
10215
- var _path$q;
10202
+ var _path$p;
10216
10203
 
10217
- function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
10204
+ function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
10218
10205
 
10219
10206
  function SvgFacebookLogo(props) {
10220
- return /*#__PURE__*/React.createElement("svg", _extends$s({
10207
+ return /*#__PURE__*/React.createElement("svg", _extends$r({
10221
10208
  xmlns: "http://www.w3.org/2000/svg",
10222
10209
  viewBox: "88.428 12.828 107.543 207.085"
10223
- }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
10210
+ }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10224
10211
  d: "M158.232 219.912v-94.461h31.707l4.747-36.813h-36.454V65.134c0-10.658 2.96-17.922 18.245-17.922l19.494-.009V14.278c-3.373-.447-14.944-1.449-28.406-1.449-28.106 0-47.348 17.155-47.348 48.661v27.149H88.428v36.813h31.788v94.461l38.016-.001z",
10225
10212
  fill: "#3c5a9a"
10226
10213
  })));
@@ -10293,15 +10280,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10293
10280
  unwrapExports(googleLogin);
10294
10281
  var googleLogin_1 = googleLogin.GoogleLogin;
10295
10282
 
10296
- var _path$p, _path2$3, _path3$1, _path4;
10283
+ var _path$o, _path2$3, _path3$1, _path4;
10297
10284
 
10298
- function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
10285
+ function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
10299
10286
 
10300
10287
  function SvgGoogleLogo(props) {
10301
- return /*#__PURE__*/React.createElement("svg", _extends$r({
10288
+ return /*#__PURE__*/React.createElement("svg", _extends$q({
10302
10289
  viewBox: "0 0 24 24",
10303
10290
  xmlns: "http://www.w3.org/2000/svg"
10304
- }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10291
+ }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10305
10292
  fill: "#4285F4",
10306
10293
  d: "M23.745 12.27c0-.79-.07-1.54-.19-2.27h-11.3v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"
10307
10294
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
@@ -10378,15 +10365,15 @@ const GoogleLoginButton = ({
10378
10365
  }) : null;
10379
10366
  };
10380
10367
 
10381
- var _path$o;
10368
+ var _path$n;
10382
10369
 
10383
- function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
10370
+ function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
10384
10371
 
10385
10372
  function SvgAuth0Logo(props) {
10386
- return /*#__PURE__*/React.createElement("svg", _extends$q({
10373
+ return /*#__PURE__*/React.createElement("svg", _extends$p({
10387
10374
  viewBox: "0 0 256 285",
10388
10375
  xmlns: "http://www.w3.org/2000/svg"
10389
- }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10376
+ }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10390
10377
  d: "M220.412 0h-92.415l28.562 89.006h92.416l-74.77 53.077 28.57 89.511c48.128-35.06 63.854-88.12 46.208-142.588L220.413 0zM7.018 89.006h92.416L127.997 0H35.589L7.019 89.006c-17.655 54.468-1.92 107.529 46.207 142.588l28.563-89.51-74.77-53.078zm46.208 142.588l74.77 52.97 74.77-52.97-74.77-53.847-74.77 53.847z"
10391
10378
  })));
10392
10379
  }
@@ -10562,15 +10549,15 @@ function LoginView(props) {
10562
10549
  }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null), /*#__PURE__*/React__default.createElement(Auth0LoginButton, null))))));
10563
10550
  }
10564
10551
 
10565
- var _path$n, _path2$2, _path3;
10552
+ var _path$m, _path2$2, _path3;
10566
10553
 
10567
- function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
10554
+ function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
10568
10555
 
10569
10556
  function SvgPelcroAuthorship(props) {
10570
- return /*#__PURE__*/React.createElement("svg", _extends$p({
10557
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
10571
10558
  xmlns: "http://www.w3.org/2000/svg",
10572
10559
  viewBox: "0 -80.652 497.072 179.991"
10573
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10560
+ }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
10574
10561
  fill: "none",
10575
10562
  stroke: "#4a4a4a",
10576
10563
  d: "M487.89 42.299c0 13.158-10.671 23.829-23.829 23.829H37.074c-13.162 0-23.832-10.671-23.832-23.829v-63.552c0-13.158 10.67-23.831 23.832-23.831H464.06c13.158 0 23.829 10.672 23.829 23.831l.001 63.552z"
@@ -12714,7 +12701,7 @@ var _generateUserError = /*#__PURE__*/new WeakMap();
12714
12701
  class Subscription {
12715
12702
  /**
12716
12703
  * Subscription service constructor
12717
- * @param {(StripeGateway|PaypalGateWay)} paymentGateway
12704
+ * @param {(StripeGateway|PaypalGateway|VantivGateway)} paymentGateway
12718
12705
  */
12719
12706
  constructor(paymentGateway) {
12720
12707
  _defineProperty$3(this, "execute", (options, callback) => {
@@ -12735,7 +12722,7 @@ class Subscription {
12735
12722
  _isPaymentGatewayInvalid.set(this, {
12736
12723
  writable: true,
12737
12724
  value: gateway => {
12738
- return gateway && !(gateway instanceof StripeGateway) && gateway && !(gateway instanceof PaypalGateWay);
12725
+ return gateway && !(gateway instanceof StripeGateway || gateway instanceof PaypalGateway || gateway instanceof VantivGateway);
12739
12726
  }
12740
12727
  });
12741
12728
 
@@ -12788,7 +12775,8 @@ class Subscription {
12788
12775
  }
12789
12776
  const PAYMENT_GATEWAYS_ENUM = {
12790
12777
  stripe: "stripe",
12791
- paypal: "braintree"
12778
+ paypal: "braintree",
12779
+ vantiv: "vantiv"
12792
12780
  };
12793
12781
  /**
12794
12782
  * Subscription Strategies
@@ -12980,7 +12968,7 @@ var _createGiftedSubscription2 = /*#__PURE__*/new WeakMap();
12980
12968
 
12981
12969
  var _payInvoice2 = /*#__PURE__*/new WeakMap();
12982
12970
 
12983
- class PaypalGateWay {
12971
+ class PaypalGateway {
12984
12972
  constructor() {
12985
12973
  _paymentGateway2.set(this, {
12986
12974
  writable: true,
@@ -13081,6 +13069,57 @@ class PaypalGateWay {
13081
13069
 
13082
13070
  }
13083
13071
 
13072
+ var _paymentGateway3 = /*#__PURE__*/new WeakMap();
13073
+
13074
+ var _createSubscription3 = /*#__PURE__*/new WeakMap();
13075
+
13076
+ class VantivGateway {
13077
+ constructor() {
13078
+ _paymentGateway3.set(this, {
13079
+ writable: true,
13080
+ value: PAYMENT_GATEWAYS_ENUM["vantiv"]
13081
+ });
13082
+
13083
+ _defineProperty$3(this, "execute", (options, callback) => {
13084
+ const types = SUBSCRIPTION_TYPES;
13085
+
13086
+ switch (options.type) {
13087
+ case types.CREATE_SUBSCRIPTION:
13088
+ return _classPrivateFieldGet(this, _createSubscription3).call(this, options, callback);
13089
+
13090
+ default:
13091
+ console.error("Unsupported subscriptiion method: vantiv Gateway");
13092
+ }
13093
+ });
13094
+
13095
+ _createSubscription3.set(this, {
13096
+ writable: true,
13097
+ value: (options, callback) => {
13098
+ const {
13099
+ token,
13100
+ plan,
13101
+ couponCode,
13102
+ product,
13103
+ quantity = 1,
13104
+ addressId
13105
+ } = options;
13106
+ window.Pelcro.subscription.create({
13107
+ quantity,
13108
+ gateway_token: token,
13109
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13110
+ auth_token: window.Pelcro.user.read().auth_token,
13111
+ plan_id: plan.id,
13112
+ coupon_code: couponCode,
13113
+ address_id: product.address_required ? addressId : null
13114
+ }, (err, res) => {
13115
+ callback(err, res);
13116
+ });
13117
+ }
13118
+ });
13119
+ }
13120
+
13121
+ }
13122
+
13084
13123
  /**
13085
13124
  * @typedef {Object} PaymentStateType
13086
13125
  * @property {boolean} disableSubmit
@@ -13168,6 +13207,78 @@ const PaymentMethodContainerWithoutStripe = ({
13168
13207
  updateTotalAmountWithTax();
13169
13208
  }, []);
13170
13209
 
13210
+ function submitVantivPayment() {
13211
+ if (!vantivInstanceRef.current) {
13212
+ return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13213
+ }
13214
+
13215
+ const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13216
+
13217
+ vantivInstanceRef.current.getPaypageRegistrationId({
13218
+ id: orderId,
13219
+ orderId: orderId
13220
+ });
13221
+ }
13222
+
13223
+ function handleVantivPayment(paymentRequest) {
13224
+ const SUCCESS_STATUS = "870";
13225
+
13226
+ if (paymentRequest.response !== SUCCESS_STATUS) {
13227
+ return handlePaymentError({
13228
+ error: new Error(paymentRequest.message)
13229
+ });
13230
+ }
13231
+
13232
+ const subscription = new Subscription(new VantivGateway());
13233
+ const {
13234
+ couponCode
13235
+ } = state;
13236
+ return subscription.execute({
13237
+ type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
13238
+ token: paymentRequest,
13239
+ quantity: plan.quantity,
13240
+ plan,
13241
+ couponCode,
13242
+ product,
13243
+ addressId: selectedAddressId
13244
+ }, (err, res) => {
13245
+ if (err) {
13246
+ return handlePaymentError(err);
13247
+ }
13248
+
13249
+ onSuccess(res);
13250
+ });
13251
+ }
13252
+
13253
+ const vantivInstanceRef = React__default.useRef(null);
13254
+ useEffect(() => {
13255
+ const cardProcessor = getSiteCardProcessor();
13256
+
13257
+ if (cardProcessor === "vantiv") {
13258
+ var _window$Pelcro$site$r;
13259
+
13260
+ const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_pay_page_id;
13261
+ vantivInstanceRef.current = new window.EprotectIframeClient({
13262
+ paypageId: payPageId,
13263
+ reportGroup: payPageId,
13264
+ style: "pelcro",
13265
+ height: "245",
13266
+ timeout: 50000,
13267
+ div: "eProtectiframe",
13268
+ callback: handleVantivPayment,
13269
+ showCvv: true,
13270
+ numYears: 8,
13271
+ placeholderText: {
13272
+ cvv: "CVV",
13273
+ accountNumber: "1234 1234 1234 1234"
13274
+ },
13275
+ enhancedUxFeatures: {
13276
+ inlineFieldValidations: true
13277
+ }
13278
+ });
13279
+ }
13280
+ }, []);
13281
+
13171
13282
  const initPaymentRequest = (state, dispatch) => {
13172
13283
  try {
13173
13284
  const paymentRequest = stripe.paymentRequest({
@@ -13238,9 +13349,9 @@ const PaymentMethodContainerWithoutStripe = ({
13238
13349
 
13239
13350
 
13240
13351
  const updateTotalAmountWithTax = () => {
13241
- var _window$Pelcro$site$r;
13352
+ var _window$Pelcro$site$r2;
13242
13353
 
13243
- const taxesEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.taxes_enabled;
13354
+ const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
13244
13355
 
13245
13356
  if (taxesEnabled && type === "createPayment") {
13246
13357
  dispatch({
@@ -13590,7 +13701,7 @@ const PaymentMethodContainerWithoutStripe = ({
13590
13701
 
13591
13702
 
13592
13703
  const handlePaypalSubscription = (state, paypalNonce) => {
13593
- const subscription = new Subscription(new PaypalGateWay());
13704
+ const subscription = new Subscription(new PaypalGateway());
13594
13705
  const {
13595
13706
  couponCode
13596
13707
  } = state;
@@ -13885,13 +13996,13 @@ const PaymentMethodContainerWithoutStripe = ({
13885
13996
 
13886
13997
 
13887
13998
  const resolveTaxCalculation = () => {
13888
- var _window$Pelcro$site$r2;
13999
+ var _window$Pelcro$site$r3;
13889
14000
 
13890
14001
  if (type === "invoicePayment") {
13891
14002
  return new Promise(resolve => resolve());
13892
14003
  }
13893
14004
 
13894
- const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
14005
+ const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
13895
14006
  return new Promise((resolve, reject) => {
13896
14007
  // resolve early if taxes isn't enabled
13897
14008
  if (!taxesEnabled) {
@@ -13970,6 +14081,8 @@ const PaymentMethodContainerWithoutStripe = ({
13970
14081
  };
13971
14082
 
13972
14083
  const handlePaymentError = error => {
14084
+ var _getErrorMessages;
14085
+
13973
14086
  if (error.type === "validation_error" && // Subscription creation & renewal
13974
14087
  type === "createPayment") {
13975
14088
  var _state$couponObject;
@@ -13988,7 +14101,7 @@ const PaymentMethodContainerWithoutStripe = ({
13988
14101
  type: SHOW_ALERT,
13989
14102
  payload: {
13990
14103
  type: "error",
13991
- content: error === null || error === void 0 ? void 0 : error.message
14104
+ content: (_getErrorMessages = getErrorMessages(error)) !== null && _getErrorMessages !== void 0 ? _getErrorMessages : error === null || error === void 0 ? void 0 : error.message
13992
14105
  }
13993
14106
  });
13994
14107
  dispatch({
@@ -14092,16 +14205,20 @@ const PaymentMethodContainerWithoutStripe = ({
14092
14205
  }
14093
14206
 
14094
14207
  if (type === "updatePaymentSource") {
14095
- updatePaymentSource(state, dispatch);
14096
- } else {
14097
- submitPayment(state);
14208
+ return updatePaymentSource(state, dispatch);
14098
14209
  }
14210
+
14211
+ if (getSiteCardProcessor() === "vantiv") {
14212
+ return submitVantivPayment();
14213
+ }
14214
+
14215
+ submitPayment(state);
14099
14216
  });
14100
14217
 
14101
14218
  case HANDLE_PAYPAL_SUBSCRIPTION:
14102
14219
  return lib_5(state, (state, dispatch) => {
14103
14220
  if (type === "invoicePayment") {
14104
- payInvoice(new PaypalGateWay(), action.payload, dispatch);
14221
+ payInvoice(new PaypalGateway(), action.payload, dispatch);
14105
14222
  } else {
14106
14223
  handlePaypalSubscription(state, action.payload);
14107
14224
  }
@@ -14284,19 +14401,35 @@ const CheckoutForm = () => {
14284
14401
  const {
14285
14402
  selectedPaymentMethodId
14286
14403
  } = usePelcro();
14287
- return !selectedPaymentMethodId && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(PelcroCardNumber, {
14288
- autoFocus: true
14289
- }), /*#__PURE__*/React__default.createElement("img", {
14290
- alt: "credit_cards",
14291
- className: "plc-h-4 plc-w-auto plc-mt-2",
14292
- src: "https://js.pelcro.com/ui/plugin/main/images/credit_cards.png"
14293
- }), /*#__PURE__*/React__default.createElement("div", {
14294
- className: "plc-flex plc-justify-between plc-my-2 plc-items-end"
14295
- }, /*#__PURE__*/React__default.createElement("div", {
14296
- className: "plc-w-6/12 plc-pr-4"
14297
- }, /*#__PURE__*/React__default.createElement(PelcroCardExpiry, null)), /*#__PURE__*/React__default.createElement("div", {
14298
- className: "plc-w-6/12 plc-pl-4"
14299
- }, /*#__PURE__*/React__default.createElement(PelcroCardCVC, null))));
14404
+ const cardProcessor = getSiteCardProcessor();
14405
+
14406
+ if (selectedPaymentMethodId) {
14407
+ return null;
14408
+ }
14409
+
14410
+ if (cardProcessor === "vantiv") {
14411
+ return /*#__PURE__*/React__default.createElement("div", {
14412
+ id: "eProtectiframe"
14413
+ });
14414
+ }
14415
+
14416
+ if (cardProcessor === "stripe") {
14417
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(PelcroCardNumber, {
14418
+ autoFocus: true
14419
+ }), /*#__PURE__*/React__default.createElement("img", {
14420
+ alt: "credit_cards",
14421
+ className: "plc-w-auto plc-h-4 plc-mt-2",
14422
+ src: "https://js.pelcro.com/ui/plugin/main/images/credit_cards.png"
14423
+ }), /*#__PURE__*/React__default.createElement("div", {
14424
+ className: "plc-flex plc-items-end plc-justify-between plc-my-2"
14425
+ }, /*#__PURE__*/React__default.createElement("div", {
14426
+ className: "plc-w-6/12 plc-pr-4"
14427
+ }, /*#__PURE__*/React__default.createElement(PelcroCardExpiry, null)), /*#__PURE__*/React__default.createElement("div", {
14428
+ className: "plc-w-6/12 plc-pl-4"
14429
+ }, /*#__PURE__*/React__default.createElement(PelcroCardCVC, null))));
14430
+ }
14431
+
14432
+ return null;
14300
14433
  };
14301
14434
 
14302
14435
  const DiscountedPrice = props => {
@@ -14383,17 +14516,17 @@ const SubmitPaymentMethod = ({
14383
14516
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14384
14517
  };
14385
14518
 
14386
- var _path$m;
14519
+ var _path$l;
14387
14520
 
14388
- function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
14521
+ function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
14389
14522
 
14390
14523
  function SvgArrowLeft(props) {
14391
- return /*#__PURE__*/React.createElement("svg", _extends$o({
14524
+ return /*#__PURE__*/React.createElement("svg", _extends$n({
14392
14525
  xmlns: "http://www.w3.org/2000/svg",
14393
14526
  fill: "none",
14394
14527
  viewBox: "0 0 24 24",
14395
14528
  stroke: "currentColor"
14396
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
14529
+ }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14397
14530
  strokeLinecap: "round",
14398
14531
  strokeLinejoin: "round",
14399
14532
  strokeWidth: 2,
@@ -14475,17 +14608,17 @@ const CouponCodeField = props => {
14475
14608
  }, props));
14476
14609
  };
14477
14610
 
14478
- var _path$l;
14611
+ var _path$k;
14479
14612
 
14480
- function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
14613
+ function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
14481
14614
 
14482
14615
  function SvgTicket(props) {
14483
- return /*#__PURE__*/React.createElement("svg", _extends$n({
14616
+ return /*#__PURE__*/React.createElement("svg", _extends$m({
14484
14617
  xmlns: "http://www.w3.org/2000/svg",
14485
14618
  fill: "none",
14486
14619
  viewBox: "0 0 24 24",
14487
14620
  stroke: "currentColor"
14488
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14621
+ }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
14489
14622
  strokeLinecap: "round",
14490
14623
  strokeLinejoin: "round",
14491
14624
  strokeWidth: 2,
@@ -14845,16 +14978,16 @@ const BankRedirection = () => {
14845
14978
  }));
14846
14979
  };
14847
14980
 
14848
- var _path$k;
14981
+ var _path$j;
14849
14982
 
14850
- function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
14983
+ function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
14851
14984
 
14852
14985
  function SvgLock(props) {
14853
- return /*#__PURE__*/React.createElement("svg", _extends$m({
14986
+ return /*#__PURE__*/React.createElement("svg", _extends$l({
14854
14987
  xmlns: "http://www.w3.org/2000/svg",
14855
14988
  viewBox: "0 0 20 20",
14856
14989
  fill: "currentColor"
14857
- }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
14990
+ }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
14858
14991
  fillRule: "evenodd",
14859
14992
  d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",
14860
14993
  clipRule: "evenodd"
@@ -14946,9 +15079,10 @@ function PaymentMethodView({
14946
15079
  const {
14947
15080
  t
14948
15081
  } = useTranslation("checkoutForm");
15082
+ const cardProcessor = getSiteCardProcessor();
14949
15083
  return /*#__PURE__*/React__default.createElement("div", {
14950
15084
  className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
14951
- }, /*#__PURE__*/React__default.createElement("div", {
15085
+ }, cardProcessor === "stripe" && /*#__PURE__*/React__default.createElement("div", {
14952
15086
  className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
14953
15087
  }, /*#__PURE__*/React__default.createElement(SvgLock, {
14954
15088
  className: "plc-w-5 plc-h-5 plc-mr-1"
@@ -15076,12 +15210,12 @@ function SubscriptionRenewModal({
15076
15210
  }
15077
15211
  SubscriptionRenewModal.viewId = "subscription-renew";
15078
15212
 
15079
- var _path$j;
15213
+ var _path$i;
15080
15214
 
15081
- function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
15215
+ function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
15082
15216
 
15083
15217
  function SvgGift(props) {
15084
- return /*#__PURE__*/React.createElement("svg", _extends$l({
15218
+ return /*#__PURE__*/React.createElement("svg", _extends$k({
15085
15219
  className: "plc-w-6 plc-h-6 plc-mr-2",
15086
15220
  fill: "none",
15087
15221
  stroke: "currentColor",
@@ -15090,7 +15224,7 @@ function SvgGift(props) {
15090
15224
  strokeWidth: 2,
15091
15225
  viewBox: "0 0 24 24",
15092
15226
  xmlns: "http://www.w3.org/2000/svg"
15093
- }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
15227
+ }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
15094
15228
  d: "M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z"
15095
15229
  })));
15096
15230
  }
@@ -16099,17 +16233,17 @@ const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone
16099
16233
 
16100
16234
  var userSolidIcon = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20class%3D%22plc-h-5%20plc-w-5%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22white%22%3E%20%20%3Cpath%20transform%3D%22translate%280%2C2%29%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%209a3%203%200%20100-6%203%203%200%20000%206zm-7%209a7%207%200%201114%200H3z%22%20clip-rule%3D%22evenodd%22%20%2F%3E%3C%2Fsvg%3E";
16101
16235
 
16102
- var _path$i;
16236
+ var _path$h;
16103
16237
 
16104
- function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
16238
+ function _extends$j() { _extends$j = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
16105
16239
 
16106
16240
  function SvgEdit(props) {
16107
- return /*#__PURE__*/React.createElement("svg", _extends$k({
16241
+ return /*#__PURE__*/React.createElement("svg", _extends$j({
16108
16242
  className: "plc-w-6 plc-h-6",
16109
16243
  xmlns: "http://www.w3.org/2000/svg",
16110
16244
  viewBox: "0 0 20 20",
16111
16245
  fill: "currentColor"
16112
- }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
16246
+ }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
16113
16247
  d: "M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zm-2.207 2.207L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
16114
16248
  })));
16115
16249
  }
@@ -19219,18 +19353,18 @@ const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(La
19219
19353
  store: store$6
19220
19354
  }, props));
19221
19355
 
19222
- var _path$h;
19356
+ var _path$g;
19223
19357
 
19224
- function _extends$j() { _extends$j = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
19358
+ function _extends$i() { _extends$i = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
19225
19359
 
19226
19360
  function SvgInfoCircle(props) {
19227
- return /*#__PURE__*/React.createElement("svg", _extends$j({
19361
+ return /*#__PURE__*/React.createElement("svg", _extends$i({
19228
19362
  xmlns: "http://www.w3.org/2000/svg",
19229
19363
  className: "plc-w-5 plc-h-5",
19230
19364
  fill: "none",
19231
19365
  viewBox: "0 0 24 24",
19232
19366
  stroke: "currentColor"
19233
- }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
19367
+ }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
19234
19368
  strokeLinecap: "round",
19235
19369
  strokeLinejoin: "round",
19236
19370
  strokeWidth: 2,
@@ -20242,8 +20376,8 @@ const PaymentMethodSelectModal = ({
20242
20376
  };
20243
20377
  PaymentMethodSelectModal.viewId = "payment-method-select";
20244
20378
 
20245
- function _extends$i() {
20246
- _extends$i = Object.assign || function (target) {
20379
+ function _extends$h() {
20380
+ _extends$h = Object.assign || function (target) {
20247
20381
  for (var i = 1; i < arguments.length; i++) {
20248
20382
  var source = arguments[i];
20249
20383
 
@@ -20257,7 +20391,7 @@ function _extends$i() {
20257
20391
  return target;
20258
20392
  };
20259
20393
 
20260
- return _extends$i.apply(this, arguments);
20394
+ return _extends$h.apply(this, arguments);
20261
20395
  }
20262
20396
 
20263
20397
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20441,7 +20575,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20441
20575
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20442
20576
  return null;
20443
20577
  }, _match[RenderStrategy.Hidden] = function () {
20444
- return _render(_extends$i({}, _rest, {
20578
+ return _render(_extends$h({}, _rest, {
20445
20579
  hidden: true,
20446
20580
  style: {
20447
20581
  display: 'none'
@@ -20969,7 +21103,7 @@ function TransitionChild(props) {
20969
21103
  var passthroughProps = rest;
20970
21104
  return React__default.createElement(NestingContext.Provider, {
20971
21105
  value: nesting
20972
- }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21106
+ }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20973
21107
  }
20974
21108
 
20975
21109
  function Transition(props) {
@@ -21013,7 +21147,7 @@ function Transition(props) {
21013
21147
  value: nestingBag
21014
21148
  }, React__default.createElement(TransitionContext.Provider, {
21015
21149
  value: transitionBag
21016
- }, render(_extends$i({}, sharedProps, {
21150
+ }, render(_extends$h({}, sharedProps, {
21017
21151
  as: Fragment,
21018
21152
  children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21019
21153
  }), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21140,12 +21274,12 @@ var ActionTypes;
21140
21274
  })(ActionTypes || (ActionTypes = {}));
21141
21275
 
21142
21276
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21143
- return _extends$i({}, state, {
21277
+ return _extends$h({}, state, {
21144
21278
  activeItemIndex: null,
21145
21279
  menuState: MenuStates.Closed
21146
21280
  });
21147
21281
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21148
- return _extends$i({}, state, {
21282
+ return _extends$h({}, state, {
21149
21283
  menuState: MenuStates.Open
21150
21284
  });
21151
21285
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21164,7 +21298,7 @@ var ActionTypes;
21164
21298
  }
21165
21299
  });
21166
21300
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21167
- return _extends$i({}, state, {
21301
+ return _extends$h({}, state, {
21168
21302
  searchQuery: '',
21169
21303
  activeItemIndex: activeItemIndex
21170
21304
  });
@@ -21175,19 +21309,19 @@ var ActionTypes;
21175
21309
 
21176
21310
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21177
21311
  });
21178
- if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
21312
+ if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21179
21313
  searchQuery: searchQuery
21180
21314
  });
21181
- return _extends$i({}, state, {
21315
+ return _extends$h({}, state, {
21182
21316
  searchQuery: searchQuery,
21183
21317
  activeItemIndex: match
21184
21318
  });
21185
21319
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21186
- return _extends$i({}, state, {
21320
+ return _extends$h({}, state, {
21187
21321
  searchQuery: ''
21188
21322
  });
21189
21323
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21190
- return _extends$i({}, state, {
21324
+ return _extends$h({}, state, {
21191
21325
  items: [].concat(state.items, [{
21192
21326
  id: action.id,
21193
21327
  dataRef: action.dataRef
@@ -21200,7 +21334,7 @@ var ActionTypes;
21200
21334
  return a.id === action.id;
21201
21335
  });
21202
21336
  if (idx !== -1) nextItems.splice(idx, 1);
21203
- return _extends$i({}, state, {
21337
+ return _extends$h({}, state, {
21204
21338
  items: nextItems,
21205
21339
  activeItemIndex: function () {
21206
21340
  if (idx === state.activeItemIndex) return null;
@@ -21239,19 +21373,19 @@ var ActionTypes$1;
21239
21373
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21240
21374
  if (state.disabled) return state;
21241
21375
  if (state.listboxState === ListboxStates.Closed) return state;
21242
- return _extends$i({}, state, {
21376
+ return _extends$h({}, state, {
21243
21377
  activeOptionIndex: null,
21244
21378
  listboxState: ListboxStates.Closed
21245
21379
  });
21246
21380
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21247
21381
  if (state.disabled) return state;
21248
21382
  if (state.listboxState === ListboxStates.Open) return state;
21249
- return _extends$i({}, state, {
21383
+ return _extends$h({}, state, {
21250
21384
  listboxState: ListboxStates.Open
21251
21385
  });
21252
21386
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21253
21387
  if (state.disabled === action.disabled) return state;
21254
- return _extends$i({}, state, {
21388
+ return _extends$h({}, state, {
21255
21389
  disabled: action.disabled
21256
21390
  });
21257
21391
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21272,7 +21406,7 @@ var ActionTypes$1;
21272
21406
  }
21273
21407
  });
21274
21408
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21275
- return _extends$i({}, state, {
21409
+ return _extends$h({}, state, {
21276
21410
  searchQuery: '',
21277
21411
  activeOptionIndex: activeOptionIndex
21278
21412
  });
@@ -21285,10 +21419,10 @@ var ActionTypes$1;
21285
21419
 
21286
21420
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21287
21421
  });
21288
- if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21422
+ if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21289
21423
  searchQuery: searchQuery
21290
21424
  });
21291
- return _extends$i({}, state, {
21425
+ return _extends$h({}, state, {
21292
21426
  searchQuery: searchQuery,
21293
21427
  activeOptionIndex: match
21294
21428
  });
@@ -21296,11 +21430,11 @@ var ActionTypes$1;
21296
21430
  if (state.disabled) return state;
21297
21431
  if (state.listboxState === ListboxStates.Closed) return state;
21298
21432
  if (state.searchQuery === '') return state;
21299
- return _extends$i({}, state, {
21433
+ return _extends$h({}, state, {
21300
21434
  searchQuery: ''
21301
21435
  });
21302
21436
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21303
- return _extends$i({}, state, {
21437
+ return _extends$h({}, state, {
21304
21438
  options: [].concat(state.options, [{
21305
21439
  id: action.id,
21306
21440
  dataRef: action.dataRef
@@ -21313,7 +21447,7 @@ var ActionTypes$1;
21313
21447
  return a.id === action.id;
21314
21448
  });
21315
21449
  if (idx !== -1) nextOptions.splice(idx, 1);
21316
- return _extends$i({}, state, {
21450
+ return _extends$h({}, state, {
21317
21451
  options: nextOptions,
21318
21452
  activeOptionIndex: function () {
21319
21453
  if (idx === state.activeOptionIndex) return null;
@@ -21374,18 +21508,18 @@ const getPaymentCardIcon = name => {
21374
21508
  }));
21375
21509
  };
21376
21510
 
21377
- var _path$g;
21511
+ var _path$f;
21378
21512
 
21379
- function _extends$h() { _extends$h = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
21513
+ function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
21380
21514
 
21381
21515
  function SvgChevronRight(props) {
21382
- return /*#__PURE__*/React.createElement("svg", _extends$h({
21516
+ return /*#__PURE__*/React.createElement("svg", _extends$g({
21383
21517
  className: "plc-w-6 plc-h-6",
21384
21518
  xmlns: "http://www.w3.org/2000/svg",
21385
21519
  fill: "none",
21386
21520
  viewBox: "0 0 24 24",
21387
21521
  stroke: "currentColor"
21388
- }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
21522
+ }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21389
21523
  strokeLinecap: "round",
21390
21524
  strokeLinejoin: "round",
21391
21525
  strokeWidth: 2,
@@ -21601,18 +21735,18 @@ const SavedItems = ({
21601
21735
  });
21602
21736
  };
21603
21737
 
21604
- var _path$f;
21738
+ var _path$e;
21605
21739
 
21606
- function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
21740
+ function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
21607
21741
 
21608
21742
  function SvgRefresh(props) {
21609
- return /*#__PURE__*/React.createElement("svg", _extends$g({
21743
+ return /*#__PURE__*/React.createElement("svg", _extends$f({
21610
21744
  className: "plc-w-4 plc-h-4 plc-mr-1",
21611
21745
  xmlns: "http://www.w3.org/2000/svg",
21612
21746
  fill: "none",
21613
21747
  viewBox: "0 0 24 24",
21614
21748
  stroke: "currentColor"
21615
- }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21749
+ }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21616
21750
  strokeLinecap: "round",
21617
21751
  strokeLinejoin: "round",
21618
21752
  strokeWidth: 2,
@@ -21620,35 +21754,35 @@ function SvgRefresh(props) {
21620
21754
  })));
21621
21755
  }
21622
21756
 
21623
- var _path$e;
21757
+ var _path$d;
21624
21758
 
21625
- function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
21759
+ function _extends$e() { _extends$e = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
21626
21760
 
21627
21761
  function SvgCalendar(props) {
21628
- return /*#__PURE__*/React.createElement("svg", _extends$f({
21762
+ return /*#__PURE__*/React.createElement("svg", _extends$e({
21629
21763
  xmlns: "http://www.w3.org/2000/svg",
21630
21764
  className: "plc-h-4 plc-w-4 plc-mr-1",
21631
21765
  viewBox: "0 0 20 20",
21632
21766
  fill: "currentColor"
21633
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21767
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21634
21768
  fillRule: "evenodd",
21635
21769
  d: "M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",
21636
21770
  clipRule: "evenodd"
21637
21771
  })));
21638
21772
  }
21639
21773
 
21640
- var _path$d;
21774
+ var _path$c;
21641
21775
 
21642
- function _extends$e() { _extends$e = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
21776
+ function _extends$d() { _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
21643
21777
 
21644
21778
  function SvgPlus(props) {
21645
- return /*#__PURE__*/React.createElement("svg", _extends$e({
21779
+ return /*#__PURE__*/React.createElement("svg", _extends$d({
21646
21780
  className: "plc-w-5 plc-h-5",
21647
21781
  xmlns: "http://www.w3.org/2000/svg",
21648
21782
  fill: "none",
21649
21783
  viewBox: "0 0 24 24",
21650
21784
  stroke: "currentColor"
21651
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21785
+ }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21652
21786
  strokeLinecap: "round",
21653
21787
  strokeLinejoin: "round",
21654
21788
  strokeWidth: 2,
@@ -21656,17 +21790,17 @@ function SvgPlus(props) {
21656
21790
  })));
21657
21791
  }
21658
21792
 
21659
- var _path$c;
21793
+ var _path$b;
21660
21794
 
21661
- function _extends$d() { _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
21795
+ function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
21662
21796
 
21663
21797
  function SvgCheckMark(props) {
21664
- return /*#__PURE__*/React.createElement("svg", _extends$d({
21798
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
21665
21799
  className: "plc-w-4 plc-h-4 plc-mr-1",
21666
21800
  xmlns: "http://www.w3.org/2000/svg",
21667
21801
  viewBox: "0 0 20 20",
21668
21802
  fill: "currentColor"
21669
- }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21803
+ }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
21670
21804
  fillRule: "evenodd",
21671
21805
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
21672
21806
  clipRule: "evenodd"
@@ -21961,31 +22095,13 @@ Accordion.item = function AccordionItem({
21961
22095
  }, content)) : null;
21962
22096
  };
21963
22097
 
21964
- var _path$b;
21965
-
21966
- function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
21967
-
21968
- function SvgExit(props) {
21969
- return /*#__PURE__*/React.createElement("svg", _extends$c({
21970
- className: "plc-w-6 plc-h-6",
21971
- xmlns: "http://www.w3.org/2000/svg",
21972
- fill: "none",
21973
- viewBox: "0 0 24 24",
21974
- stroke: "currentColor"
21975
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
21976
- strokeLinecap: "round",
21977
- strokeLinejoin: "round",
21978
- strokeWidth: 2,
21979
- d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
21980
- })));
21981
- }
21982
-
21983
22098
  var _path$a;
21984
22099
 
21985
22100
  function _extends$b() { _extends$b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
21986
22101
 
21987
- function SvgUser(props) {
22102
+ function SvgExit(props) {
21988
22103
  return /*#__PURE__*/React.createElement("svg", _extends$b({
22104
+ className: "plc-w-6 plc-h-6",
21989
22105
  xmlns: "http://www.w3.org/2000/svg",
21990
22106
  fill: "none",
21991
22107
  viewBox: "0 0 24 24",
@@ -21994,7 +22110,7 @@ function SvgUser(props) {
21994
22110
  strokeLinecap: "round",
21995
22111
  strokeLinejoin: "round",
21996
22112
  strokeWidth: 2,
21997
- d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
22113
+ d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
21998
22114
  })));
21999
22115
  }
22000
22116
 
@@ -22002,10 +22118,9 @@ var _path$9;
22002
22118
 
22003
22119
  function _extends$a() { _extends$a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
22004
22120
 
22005
- function SvgNewsletter(props) {
22121
+ function SvgUser(props) {
22006
22122
  return /*#__PURE__*/React.createElement("svg", _extends$a({
22007
22123
  xmlns: "http://www.w3.org/2000/svg",
22008
- className: "plc-h-5 plc-w-5",
22009
22124
  fill: "none",
22010
22125
  viewBox: "0 0 24 24",
22011
22126
  stroke: "currentColor"
@@ -22013,7 +22128,7 @@ function SvgNewsletter(props) {
22013
22128
  strokeLinecap: "round",
22014
22129
  strokeLinejoin: "round",
22015
22130
  strokeWidth: 2,
22016
- d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
22131
+ d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
22017
22132
  })));
22018
22133
  }
22019
22134
 
@@ -22021,10 +22136,10 @@ var _path$8;
22021
22136
 
22022
22137
  function _extends$9() { _extends$9 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
22023
22138
 
22024
- function SvgDocument(props) {
22139
+ function SvgNewsletter(props) {
22025
22140
  return /*#__PURE__*/React.createElement("svg", _extends$9({
22026
22141
  xmlns: "http://www.w3.org/2000/svg",
22027
- className: "plc-h-6 plc-w-6 plc-mr-2",
22142
+ className: "plc-h-5 plc-w-5",
22028
22143
  fill: "none",
22029
22144
  viewBox: "0 0 24 24",
22030
22145
  stroke: "currentColor"
@@ -22032,7 +22147,7 @@ function SvgDocument(props) {
22032
22147
  strokeLinecap: "round",
22033
22148
  strokeLinejoin: "round",
22034
22149
  strokeWidth: 2,
22035
- d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
22150
+ d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
22036
22151
  })));
22037
22152
  }
22038
22153
 
@@ -22212,138 +22327,6 @@ function formatStartDate(date) {
22212
22327
  return new Intl.DateTimeFormat("en-CA").format(startDate);
22213
22328
  }
22214
22329
 
22215
- const InvoicesMenu = props => {
22216
- const {
22217
- t
22218
- } = useTranslation("dashboard");
22219
- return /*#__PURE__*/React__default.createElement("table", {
22220
- className: "plc-w-full plc-table-fixed"
22221
- }, /*#__PURE__*/React__default.createElement("thead", {
22222
- className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22223
- }, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
22224
- className: "plc-w-4/12 "
22225
- }, t("labels.details")), /*#__PURE__*/React__default.createElement("th", {
22226
- className: "plc-w-4/12 "
22227
- }, t("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
22228
- className: "plc-w-3/12 "
22229
- }, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
22230
- className: "plc-h-4"
22231
- }), /*#__PURE__*/React__default.createElement(InvoicesItems, props)));
22232
- };
22233
-
22234
- const InvoicesItems = () => {
22235
- var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22236
-
22237
- const {
22238
- t
22239
- } = useTranslation("dashboard");
22240
- const {
22241
- setInvoice,
22242
- switchView
22243
- } = usePelcro();
22244
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22245
-
22246
- const showInvoiceDetails = event => {
22247
- if (setInvoice(event.target.dataset.id)) {
22248
- switchView("invoice-details");
22249
- }
22250
- };
22251
-
22252
- if (invoices.length === 0) return null;
22253
- return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22254
- const invoiceStatus = getInvoiceStatus(invoice);
22255
- const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22256
- return /*#__PURE__*/React__default.createElement("tr", {
22257
- key: invoice.id,
22258
- className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22259
- }, /*#__PURE__*/React__default.createElement("td", {
22260
- className: "plc-truncate"
22261
- }, /*#__PURE__*/React__default.createElement("span", {
22262
- className: "plc-font-semibold plc-text-gray-500"
22263
- }, `#${invoice.id}`), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22264
- className: "plc-text-sm plc-text-gray-500"
22265
- }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22266
- className: "plc-text-sm plc-text-gray-500"
22267
- }, formattedCreationDate)), /*#__PURE__*/React__default.createElement("td", {
22268
- className: "plc-py-2"
22269
- }, /*#__PURE__*/React__default.createElement("span", {
22270
- className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22271
- }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(Button, {
22272
- variant: "ghost",
22273
- className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22274
- icon: /*#__PURE__*/React__default.createElement(SvgDocument, {
22275
- className: "plc-w-4 plc-h-4"
22276
- }),
22277
- onClick: showInvoiceDetails,
22278
- "data-id": invoice.id
22279
- }, t("labels.view"))));
22280
- });
22281
- };
22282
-
22283
- function getInvoiceStatus(invoice) {
22284
- const translations = i18next.t("dashboard:labels", {
22285
- returnObjects: true
22286
- });
22287
-
22288
- switch (invoice.status) {
22289
- case "paid":
22290
- return {
22291
- textColor: "plc-text-green-700",
22292
- bgColor: "plc-bg-green-100",
22293
- icon: /*#__PURE__*/React__default.createElement(SvgCheckMark, null),
22294
- title: translations.paid
22295
- };
22296
-
22297
- case "past_due":
22298
- return {
22299
- textColor: "plc-text-orange-700",
22300
- bgColor: "plc-bg-orange-100",
22301
- icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22302
- title: translations.pastDue
22303
- };
22304
-
22305
- case "open":
22306
- return {
22307
- textColor: "plc-text-yellow-700",
22308
- bgColor: "plc-bg-yellow-100",
22309
- icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22310
- title: translations.open
22311
- };
22312
-
22313
- case "draft":
22314
- return {
22315
- textColor: "plc-text-blue-700",
22316
- bgColor: "plc-bg-blue-100",
22317
- icon: /*#__PURE__*/React__default.createElement(SvgEdit, null),
22318
- title: translations.draft
22319
- };
22320
-
22321
- case "scheduled":
22322
- return {
22323
- textColor: "plc-text-blue-700",
22324
- bgColor: "plc-bg-blue-100",
22325
- icon: /*#__PURE__*/React__default.createElement(SvgCalendar, null),
22326
- title: translations.scheduled
22327
- };
22328
-
22329
- case "uncollectible":
22330
- return {
22331
- textColor: "plc-text-red-700",
22332
- bgColor: "plc-bg-red-100",
22333
- icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22334
- title: translations.uncollectible
22335
- };
22336
-
22337
- case "void":
22338
- return {
22339
- textColor: "plc-text-gray-700",
22340
- bgColor: "plc-bg-gray-100",
22341
- icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22342
- title: translations.void
22343
- };
22344
- }
22345
- }
22346
-
22347
22330
  const SUB_MENUS = {
22348
22331
  PROFILE: "profile",
22349
22332
  SUBSCRIPTIONS: "subscriptions",
@@ -22897,12 +22880,6 @@ class Dashboard extends Component {
22897
22880
  icon: /*#__PURE__*/React__default.createElement(SvgShopping, null),
22898
22881
  title: this.locale("labels.orders.label"),
22899
22882
  content: /*#__PURE__*/React__default.createElement(OrdersMenu, null)
22900
- }), /*#__PURE__*/React__default.createElement(Accordion.item, {
22901
- show: hasInvoices(),
22902
- name: SUB_MENUS.INVOICES,
22903
- icon: /*#__PURE__*/React__default.createElement(SvgDocument, null),
22904
- title: this.locale("labels.invoices"),
22905
- content: /*#__PURE__*/React__default.createElement(InvoicesMenu, null)
22906
22883
  }), /*#__PURE__*/React__default.createElement(Accordion.item, {
22907
22884
  name: SUB_MENUS.SAVED_ITEMS,
22908
22885
  icon: /*#__PURE__*/React__default.createElement(SvgBookmark, null),
@@ -22918,13 +22895,6 @@ class Dashboard extends Component {
22918
22895
 
22919
22896
  }
22920
22897
 
22921
- function hasInvoices() {
22922
- var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22923
-
22924
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22925
- return invoices.length > 0;
22926
- }
22927
-
22928
22898
  function hasDonationSubs() {
22929
22899
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
22930
22900