@pelcro/react-pelcro-js 2.6.1 → 2.7.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.cjs.js CHANGED
@@ -6929,8 +6929,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
6929
6929
 
6930
6930
  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}}
6931
6931
 
6932
- function _extends$v() {
6933
- _extends$v = Object.assign || function (target) {
6932
+ function _extends$w() {
6933
+ _extends$w = Object.assign || function (target) {
6934
6934
  for (var i = 1; i < arguments.length; i++) {
6935
6935
  var source = arguments[i];
6936
6936
 
@@ -6944,7 +6944,7 @@ function _extends$v() {
6944
6944
  return target;
6945
6945
  };
6946
6946
 
6947
- return _extends$v.apply(this, arguments);
6947
+ return _extends$w.apply(this, arguments);
6948
6948
  }
6949
6949
 
6950
6950
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7034,7 +7034,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7034
7034
  var reducer = function reducer(state, action) {
7035
7035
  switch (action.type) {
7036
7036
  case ActionType.ADD_TOAST:
7037
- return _extends$v({}, state, {
7037
+ return _extends$w({}, state, {
7038
7038
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7039
7039
  });
7040
7040
 
@@ -7044,9 +7044,9 @@ var reducer = function reducer(state, action) {
7044
7044
  clearFromRemoveQueue(action.toast.id);
7045
7045
  }
7046
7046
 
7047
- return _extends$v({}, state, {
7047
+ return _extends$w({}, state, {
7048
7048
  toasts: state.toasts.map(function (t) {
7049
- return t.id === action.toast.id ? _extends$v({}, t, action.toast) : t;
7049
+ return t.id === action.toast.id ? _extends$w({}, t, action.toast) : t;
7050
7050
  })
7051
7051
  });
7052
7052
 
@@ -7073,9 +7073,9 @@ var reducer = function reducer(state, action) {
7073
7073
  });
7074
7074
  }
7075
7075
 
7076
- return _extends$v({}, state, {
7076
+ return _extends$w({}, state, {
7077
7077
  toasts: state.toasts.map(function (t) {
7078
- return t.id === toastId || toastId === undefined ? _extends$v({}, t, {
7078
+ return t.id === toastId || toastId === undefined ? _extends$w({}, t, {
7079
7079
  visible: false
7080
7080
  }) : t;
7081
7081
  })
@@ -7083,28 +7083,28 @@ var reducer = function reducer(state, action) {
7083
7083
 
7084
7084
  case ActionType.REMOVE_TOAST:
7085
7085
  if (action.toastId === undefined) {
7086
- return _extends$v({}, state, {
7086
+ return _extends$w({}, state, {
7087
7087
  toasts: []
7088
7088
  });
7089
7089
  }
7090
7090
 
7091
- return _extends$v({}, state, {
7091
+ return _extends$w({}, state, {
7092
7092
  toasts: state.toasts.filter(function (t) {
7093
7093
  return t.id !== action.toastId;
7094
7094
  })
7095
7095
  });
7096
7096
 
7097
7097
  case ActionType.START_PAUSE:
7098
- return _extends$v({}, state, {
7098
+ return _extends$w({}, state, {
7099
7099
  pausedAt: action.time
7100
7100
  });
7101
7101
 
7102
7102
  case ActionType.END_PAUSE:
7103
7103
  var diff = action.time - (state.pausedAt || 0);
7104
- return _extends$v({}, state, {
7104
+ return _extends$w({}, state, {
7105
7105
  pausedAt: undefined,
7106
7106
  toasts: state.toasts.map(function (t) {
7107
- return _extends$v({}, t, {
7107
+ return _extends$w({}, t, {
7108
7108
  pauseDuration: t.pauseDuration + diff
7109
7109
  });
7110
7110
  })
@@ -7151,12 +7151,12 @@ var useStore = function useStore(toastOptions) {
7151
7151
  var mergedToasts = state.toasts.map(function (t) {
7152
7152
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7153
7153
 
7154
- return _extends$v({}, toastOptions, toastOptions[t.type], t, {
7154
+ return _extends$w({}, toastOptions, toastOptions[t.type], t, {
7155
7155
  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],
7156
- style: _extends$v({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7156
+ style: _extends$w({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7157
7157
  });
7158
7158
  });
7159
- return _extends$v({}, state, {
7159
+ return _extends$w({}, state, {
7160
7160
  toasts: mergedToasts
7161
7161
  });
7162
7162
  };
@@ -7166,7 +7166,7 @@ var createToast = function createToast(message, type, opts) {
7166
7166
  type = 'blank';
7167
7167
  }
7168
7168
 
7169
- return _extends$v({
7169
+ return _extends$w({
7170
7170
  createdAt: Date.now(),
7171
7171
  visible: true,
7172
7172
  type: type,
@@ -7216,14 +7216,14 @@ toast.remove = function (toastId) {
7216
7216
  };
7217
7217
 
7218
7218
  toast.promise = function (promise, msgs, opts) {
7219
- var id = toast.loading(msgs.loading, _extends$v({}, opts, opts == null ? void 0 : opts.loading));
7219
+ var id = toast.loading(msgs.loading, _extends$w({}, opts, opts == null ? void 0 : opts.loading));
7220
7220
  promise.then(function (p) {
7221
- toast.success(resolveValue(msgs.success, p), _extends$v({
7221
+ toast.success(resolveValue(msgs.success, p), _extends$w({
7222
7222
  id: id
7223
7223
  }, opts, opts == null ? void 0 : opts.success));
7224
7224
  return p;
7225
7225
  })["catch"](function (e) {
7226
- toast.error(resolveValue(msgs.error, e), _extends$v({
7226
+ toast.error(resolveValue(msgs.error, e), _extends$w({
7227
7227
  id: id
7228
7228
  }, opts, opts == null ? void 0 : opts.error));
7229
7229
  });
@@ -7562,7 +7562,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7562
7562
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7563
7563
  return React.createElement(ToastBarBase, {
7564
7564
  className: toast.className,
7565
- style: _extends$v({}, animationStyle, style, toast.style)
7565
+ style: _extends$w({}, animationStyle, style, toast.style)
7566
7566
  }, typeof children === 'function' ? children({
7567
7567
  icon: icon,
7568
7568
  message: message
@@ -7592,7 +7592,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7592
7592
  } : position.includes('right') ? {
7593
7593
  justifyContent: 'flex-end'
7594
7594
  } : {};
7595
- return _extends$v({
7595
+ return _extends$w({
7596
7596
  left: 0,
7597
7597
  right: 0,
7598
7598
  display: 'flex',
@@ -7619,7 +7619,7 @@ var Toaster = function Toaster(_ref) {
7619
7619
  handlers = _useToaster.handlers;
7620
7620
 
7621
7621
  return React.createElement("div", {
7622
- style: _extends$v({
7622
+ style: _extends$w({
7623
7623
  position: 'fixed',
7624
7624
  zIndex: 9999,
7625
7625
  top: DEFAULT_OFFSET,
@@ -7654,82 +7654,82 @@ var Toaster = function Toaster(_ref) {
7654
7654
  }));
7655
7655
  };
7656
7656
 
7657
- var _path$s;
7657
+ var _path$t;
7658
7658
 
7659
- 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); }
7659
+ 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); }
7660
7660
 
7661
7661
  function SvgCheckSolid(props) {
7662
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7662
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7663
7663
  xmlns: "http://www.w3.org/2000/svg",
7664
7664
  className: "h-5 w-5",
7665
7665
  viewBox: "0 0 20 20",
7666
7666
  fill: "currentColor"
7667
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7667
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7668
7668
  fillRule: "evenodd",
7669
7669
  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",
7670
7670
  clipRule: "evenodd"
7671
7671
  })));
7672
7672
  }
7673
7673
 
7674
- var _path$r;
7674
+ var _path$s;
7675
7675
 
7676
- 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); }
7676
+ 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); }
7677
7677
 
7678
7678
  function SvgXIcon(props) {
7679
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
7679
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7680
7680
  xmlns: "http://www.w3.org/2000/svg",
7681
7681
  viewBox: "0 0 20 20",
7682
7682
  fill: "currentColor"
7683
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
7683
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7684
7684
  fill: "evenodd",
7685
7685
  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",
7686
7686
  clipRule: "evenodd"
7687
7687
  })));
7688
7688
  }
7689
7689
 
7690
- var _path$q;
7690
+ var _path$r;
7691
7691
 
7692
- 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); }
7692
+ 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); }
7693
7693
 
7694
7694
  function SvgXIconSolid(props) {
7695
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
7695
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
7696
7696
  className: "plc-w-4 plc-h-4",
7697
7697
  fill: "currentColor",
7698
7698
  xmlns: "http://www.w3.org/2000/svg",
7699
7699
  viewBox: "0 0 100 100"
7700
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
7700
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
7701
7701
  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"
7702
7702
  })));
7703
7703
  }
7704
7704
 
7705
- var _path$p;
7705
+ var _path$q;
7706
7706
 
7707
- 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); }
7707
+ 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); }
7708
7708
 
7709
7709
  function SvgExclamation(props) {
7710
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
7710
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
7711
7711
  className: "plc-w-4 plc-h-4 plc-mr-1",
7712
7712
  xmlns: "http://www.w3.org/2000/svg",
7713
7713
  viewBox: "0 0 20 20",
7714
7714
  fill: "currentColor"
7715
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
7715
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
7716
7716
  fillRule: "evenodd",
7717
7717
  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",
7718
7718
  clipRule: "evenodd"
7719
7719
  })));
7720
7720
  }
7721
7721
 
7722
- var _path$o, _path2$3;
7722
+ var _path$p, _path2$3;
7723
7723
 
7724
- 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); }
7724
+ 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); }
7725
7725
 
7726
7726
  function SvgSpinner(props) {
7727
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
7727
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
7728
7728
  className: "plc-animate-spin",
7729
7729
  viewBox: "0 0 24 24",
7730
7730
  fill: "currentColor",
7731
7731
  xmlns: "http://www.w3.org/2000/svg"
7732
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
7732
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
7733
7733
  opacity: 0.2,
7734
7734
  fill: "evenodd",
7735
7735
  clipRule: "evenodd",
@@ -8481,6 +8481,7 @@ const optionsController = options => {
8481
8481
 
8482
8482
  const optionsMethodsDict = {
8483
8483
  loadPaymentSDKs: loadPaymentSDKs,
8484
+ loadAuth0SDK: loadAuth0SDK,
8484
8485
  enableURLTriggers: initViewFromURL,
8485
8486
  enableTheme: applyPelcroTheme,
8486
8487
  enablePaywalls: initPaywalls,
@@ -8546,6 +8547,13 @@ const loadPaymentSDKs = () => {
8546
8547
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/paypal-checkout.min.js", "braintree-paypal-sdk");
8547
8548
  }
8548
8549
  };
8550
+ const loadAuth0SDK = () => {
8551
+ const auth0Enabled = Boolean(window.Pelcro.site.read().auth0_client_id && window.Pelcro.site.read().auth0_base_url);
8552
+
8553
+ if (auth0Enabled) {
8554
+ window.Pelcro.helpers.loadSDK("https://cdn.auth0.com/js/auth0/9.18/auth0.min.js", "auth0-sdk");
8555
+ }
8556
+ };
8549
8557
  const initSecuritySdk = () => {
8550
8558
  const {
8551
8559
  whenSiteReady
@@ -8842,6 +8850,7 @@ const initCartFromUrl = () => {
8842
8850
 
8843
8851
  const defaultOptions = {
8844
8852
  loadPaymentSDKs: true,
8853
+ loadAuth0SDK: true,
8845
8854
  enableURLTriggers: true,
8846
8855
  enableTheme: true,
8847
8856
  enablePaywalls: true,
@@ -9667,16 +9676,16 @@ const LoginPassword = props => /*#__PURE__*/React__default['default'].createElem
9667
9676
  store: store$f
9668
9677
  }, props));
9669
9678
 
9670
- var _path$n;
9679
+ var _path$o;
9671
9680
 
9672
- 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); }
9681
+ 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); }
9673
9682
 
9674
9683
  function SvgCheck(props) {
9675
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
9684
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
9676
9685
  xmlns: "http://www.w3.org/2000/svg",
9677
9686
  fill: "currentColor",
9678
9687
  viewBox: "0 0 20 20"
9679
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
9688
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
9680
9689
  fillRule: "evenodd",
9681
9690
  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",
9682
9691
  clipRule: "evenodd"
@@ -9993,15 +10002,15 @@ function hasSecurityTokenEnabled$1() {
9993
10002
  return hasSecuritySdkLoaded;
9994
10003
  }
9995
10004
 
9996
- var _path$m;
10005
+ var _path$n;
9997
10006
 
9998
- 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); }
10007
+ 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); }
9999
10008
 
10000
10009
  function SvgFacebookLogo(props) {
10001
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
10010
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10002
10011
  xmlns: "http://www.w3.org/2000/svg",
10003
10012
  viewBox: "88.428 12.828 107.543 207.085"
10004
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
10013
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10005
10014
  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",
10006
10015
  fill: "#3c5a9a"
10007
10016
  })));
@@ -10074,15 +10083,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10074
10083
  unwrapExports(googleLogin);
10075
10084
  var googleLogin_1 = googleLogin.GoogleLogin;
10076
10085
 
10077
- var _path$l, _path2$2, _path3$1, _path4;
10086
+ var _path$m, _path2$2, _path3$1, _path4;
10078
10087
 
10079
- 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); }
10088
+ 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); }
10080
10089
 
10081
10090
  function SvgGoogleLogo(props) {
10082
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
10091
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
10083
10092
  viewBox: "0 0 24 24",
10084
10093
  xmlns: "http://www.w3.org/2000/svg"
10085
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
10094
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
10086
10095
  fill: "#4285F4",
10087
10096
  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"
10088
10097
  })), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10159,17 +10168,123 @@ const GoogleLoginButton = ({
10159
10168
  }) : null;
10160
10169
  };
10161
10170
 
10171
+ var _path$l;
10172
+
10173
+ 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); }
10174
+
10175
+ function SvgAuth0Logo(props) {
10176
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
10177
+ viewBox: "0 0 256 285",
10178
+ xmlns: "http://www.w3.org/2000/svg"
10179
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
10180
+ 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"
10181
+ })));
10182
+ }
10183
+
10184
+ const Auth0LoginButton = ({
10185
+ label = "Auth0",
10186
+ className = "",
10187
+ labelClassName = "",
10188
+ iconClassName = ""
10189
+ }) => {
10190
+ const auth0Enabled = Boolean(window.Pelcro.site.read().auth0_client_id && window.Pelcro.site.read().auth0_base_url);
10191
+ const auth0InstanceRef = React__default['default'].useRef(null);
10192
+ React__default['default'].useEffect(() => {
10193
+ if (auth0Enabled) {
10194
+ auth0InstanceRef.current = new window.auth0.WebAuth({
10195
+ domain: window.Pelcro.site.read().auth0_base_url,
10196
+ clientID: window.Pelcro.site.read().auth0_client_id
10197
+ });
10198
+ }
10199
+ }, []);
10200
+ const {
10201
+ dispatch: loginDispatch
10202
+ } = React.useContext(store$f);
10203
+ const {
10204
+ dispatch: registerDispatch
10205
+ } = React.useContext(store$e);
10206
+
10207
+ function handleClick() {
10208
+ var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
10209
+
10210
+ (_auth0InstanceRef$cur = auth0InstanceRef.current) === null || _auth0InstanceRef$cur === void 0 ? void 0 : (_auth0InstanceRef$cur2 = _auth0InstanceRef$cur.popup) === null || _auth0InstanceRef$cur2 === void 0 ? void 0 : (_auth0InstanceRef$cur3 = _auth0InstanceRef$cur2.authorize) === null || _auth0InstanceRef$cur3 === void 0 ? void 0 : _auth0InstanceRef$cur3.call(_auth0InstanceRef$cur2, {
10211
+ responseType: "token id_token",
10212
+ owp: true // close popup when finished
10213
+
10214
+ }, function (error, authResult) {
10215
+ if (error) {
10216
+ return onFailure(error);
10217
+ }
10218
+
10219
+ onSuccess(authResult);
10220
+ });
10221
+ }
10222
+
10223
+ const onSuccess = authResult => {
10224
+ var _auth0InstanceRef$cur4, _auth0InstanceRef$cur5, _auth0InstanceRef$cur6;
10225
+
10226
+ const {
10227
+ accessToken
10228
+ } = authResult;
10229
+ (_auth0InstanceRef$cur4 = auth0InstanceRef.current) === null || _auth0InstanceRef$cur4 === void 0 ? void 0 : (_auth0InstanceRef$cur5 = _auth0InstanceRef$cur4.client) === null || _auth0InstanceRef$cur5 === void 0 ? void 0 : (_auth0InstanceRef$cur6 = _auth0InstanceRef$cur5.userInfo) === null || _auth0InstanceRef$cur6 === void 0 ? void 0 : _auth0InstanceRef$cur6.call(_auth0InstanceRef$cur5, accessToken, (error, user) => {
10230
+ if (error) {
10231
+ return onFailure(error);
10232
+ }
10233
+
10234
+ const {
10235
+ email,
10236
+ nickname
10237
+ } = user;
10238
+ loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
10239
+ type: HANDLE_SOCIAL_LOGIN,
10240
+ payload: {
10241
+ idpName: "auth0",
10242
+ idpToken: accessToken,
10243
+ firstName: nickname,
10244
+ email
10245
+ }
10246
+ });
10247
+ registerDispatch === null || registerDispatch === void 0 ? void 0 : registerDispatch({
10248
+ type: HANDLE_SOCIAL_LOGIN,
10249
+ payload: {
10250
+ idpName: "auth0",
10251
+ idpToken: accessToken,
10252
+ firstName: nickname,
10253
+ email
10254
+ }
10255
+ });
10256
+ });
10257
+ };
10258
+
10259
+ const onFailure = error => {
10260
+ console.error(error);
10261
+ };
10262
+
10263
+ if (auth0Enabled) {
10264
+ return /*#__PURE__*/React__default['default'].createElement("button", {
10265
+ onClick: handleClick,
10266
+ className: `plc-flex plc-items-center plc-justify-center plc-w-full plc-p-3 plc-space-x-3 plc-text-gray-700 plc-border plc-border-gray-200 plc-rounded-3xl hover:plc-bg-gray-200 pelcro-auth0-login ${className}`
10267
+ }, /*#__PURE__*/React__default['default'].createElement(SvgAuth0Logo, {
10268
+ className: `plc-w-6 plc-h-auto pelcro-auth0-login-icon" ${iconClassName}`
10269
+ }), /*#__PURE__*/React__default['default'].createElement("p", {
10270
+ className: `pelcro-auth0-login-label ${labelClassName}`
10271
+ }, label));
10272
+ }
10273
+
10274
+ return null;
10275
+ };
10276
+
10162
10277
  /**
10163
10278
  *
10164
10279
  */
10165
10280
 
10166
10281
  function LoginView(props) {
10167
- var _window$Pelcro$site$r, _window$Pelcro$site$r2;
10282
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3;
10168
10283
 
10169
10284
  const {
10170
10285
  t
10171
10286
  } = useTranslation("login");
10172
- const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id);
10287
+ const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
10173
10288
  return /*#__PURE__*/React__default['default'].createElement("div", {
10174
10289
  id: "pelcro-login-view"
10175
10290
  }, /*#__PURE__*/React__default['default'].createElement("div", {
@@ -10213,7 +10328,7 @@ function LoginView(props) {
10213
10328
  className: "plc-w-full plc-border-gray-300"
10214
10329
  })), /*#__PURE__*/React__default['default'].createElement("div", {
10215
10330
  className: "plc-flex plc-justify-center plc-px-5 plc-mt-1 plc-space-x-3"
10216
- }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null))))));
10331
+ }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10217
10332
  }
10218
10333
 
10219
10334
  var _path$k, _path2$1, _path3;
@@ -10572,7 +10687,7 @@ const RegisterLastName = props => /*#__PURE__*/React__default['default'].createE
10572
10687
  */
10573
10688
 
10574
10689
  function RegisterView(props) {
10575
- var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro, _window$Pelcro$uiSett;
10690
+ var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett;
10576
10691
 
10577
10692
  const {
10578
10693
  t
@@ -10582,7 +10697,7 @@ function RegisterView(props) {
10582
10697
  } = usePelcro();
10583
10698
  const title = (_product$paywall$regi = product === null || product === void 0 ? void 0 : (_product$paywall = product.paywall) === null || _product$paywall === void 0 ? void 0 : _product$paywall.register_title) !== null && _product$paywall$regi !== void 0 ? _product$paywall$regi : t("title");
10584
10699
  const subtitle = (_product$paywall$regi2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.register_subtitle) !== null && _product$paywall$regi2 !== void 0 ? _product$paywall$regi2 : t("subtitle");
10585
- const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id);
10700
+ const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
10586
10701
  const showNameFields = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableNameFieldsInRegister;
10587
10702
  return /*#__PURE__*/React__default['default'].createElement("div", {
10588
10703
  id: "pelcro-register-view"
@@ -10640,7 +10755,7 @@ function RegisterView(props) {
10640
10755
  className: "plc-w-full plc-border-gray-300"
10641
10756
  })), /*#__PURE__*/React__default['default'].createElement("div", {
10642
10757
  className: "plc-flex plc-justify-center plc-px-5 plc-mt-1 plc-space-x-3"
10643
- }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null))))));
10758
+ }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10644
10759
  }
10645
10760
  /**
10646
10761
  * Checks if the current site has security token enabled
@@ -10648,9 +10763,9 @@ function RegisterView(props) {
10648
10763
  */
10649
10764
 
10650
10765
  function hasSecurityTokenEnabled() {
10651
- var _window$Pelcro$site, _window$Pelcro$site$r3;
10766
+ var _window$Pelcro$site, _window$Pelcro$site$r4;
10652
10767
 
10653
- return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r3 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.security_key);
10768
+ return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r4 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.security_key);
10654
10769
  }
10655
10770
 
10656
10771
  function TextInput({
@@ -23923,6 +24038,7 @@ exports.AddressUpdateView = AddressUpdateView;
23923
24038
  exports.Alert = AlertWithContext;
23924
24039
  exports.AlertElement = Alert;
23925
24040
  exports.ApplyCouponButton = ApplyCouponButton;
24041
+ exports.Auth0LoginButton = Auth0LoginButton;
23926
24042
  exports.Badge = Badge;
23927
24043
  exports.BankRedirection = BankRedirection;
23928
24044
  exports.Button = Button;
package/dist/index.esm.js CHANGED
@@ -6899,8 +6899,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
6899
6899
 
6900
6900
  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}}
6901
6901
 
6902
- function _extends$v() {
6903
- _extends$v = Object.assign || function (target) {
6902
+ function _extends$w() {
6903
+ _extends$w = Object.assign || function (target) {
6904
6904
  for (var i = 1; i < arguments.length; i++) {
6905
6905
  var source = arguments[i];
6906
6906
 
@@ -6914,7 +6914,7 @@ function _extends$v() {
6914
6914
  return target;
6915
6915
  };
6916
6916
 
6917
- return _extends$v.apply(this, arguments);
6917
+ return _extends$w.apply(this, arguments);
6918
6918
  }
6919
6919
 
6920
6920
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7004,7 +7004,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7004
7004
  var reducer = function reducer(state, action) {
7005
7005
  switch (action.type) {
7006
7006
  case ActionType.ADD_TOAST:
7007
- return _extends$v({}, state, {
7007
+ return _extends$w({}, state, {
7008
7008
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7009
7009
  });
7010
7010
 
@@ -7014,9 +7014,9 @@ var reducer = function reducer(state, action) {
7014
7014
  clearFromRemoveQueue(action.toast.id);
7015
7015
  }
7016
7016
 
7017
- return _extends$v({}, state, {
7017
+ return _extends$w({}, state, {
7018
7018
  toasts: state.toasts.map(function (t) {
7019
- return t.id === action.toast.id ? _extends$v({}, t, action.toast) : t;
7019
+ return t.id === action.toast.id ? _extends$w({}, t, action.toast) : t;
7020
7020
  })
7021
7021
  });
7022
7022
 
@@ -7043,9 +7043,9 @@ var reducer = function reducer(state, action) {
7043
7043
  });
7044
7044
  }
7045
7045
 
7046
- return _extends$v({}, state, {
7046
+ return _extends$w({}, state, {
7047
7047
  toasts: state.toasts.map(function (t) {
7048
- return t.id === toastId || toastId === undefined ? _extends$v({}, t, {
7048
+ return t.id === toastId || toastId === undefined ? _extends$w({}, t, {
7049
7049
  visible: false
7050
7050
  }) : t;
7051
7051
  })
@@ -7053,28 +7053,28 @@ var reducer = function reducer(state, action) {
7053
7053
 
7054
7054
  case ActionType.REMOVE_TOAST:
7055
7055
  if (action.toastId === undefined) {
7056
- return _extends$v({}, state, {
7056
+ return _extends$w({}, state, {
7057
7057
  toasts: []
7058
7058
  });
7059
7059
  }
7060
7060
 
7061
- return _extends$v({}, state, {
7061
+ return _extends$w({}, state, {
7062
7062
  toasts: state.toasts.filter(function (t) {
7063
7063
  return t.id !== action.toastId;
7064
7064
  })
7065
7065
  });
7066
7066
 
7067
7067
  case ActionType.START_PAUSE:
7068
- return _extends$v({}, state, {
7068
+ return _extends$w({}, state, {
7069
7069
  pausedAt: action.time
7070
7070
  });
7071
7071
 
7072
7072
  case ActionType.END_PAUSE:
7073
7073
  var diff = action.time - (state.pausedAt || 0);
7074
- return _extends$v({}, state, {
7074
+ return _extends$w({}, state, {
7075
7075
  pausedAt: undefined,
7076
7076
  toasts: state.toasts.map(function (t) {
7077
- return _extends$v({}, t, {
7077
+ return _extends$w({}, t, {
7078
7078
  pauseDuration: t.pauseDuration + diff
7079
7079
  });
7080
7080
  })
@@ -7121,12 +7121,12 @@ var useStore = function useStore(toastOptions) {
7121
7121
  var mergedToasts = state.toasts.map(function (t) {
7122
7122
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7123
7123
 
7124
- return _extends$v({}, toastOptions, toastOptions[t.type], t, {
7124
+ return _extends$w({}, toastOptions, toastOptions[t.type], t, {
7125
7125
  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],
7126
- style: _extends$v({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7126
+ style: _extends$w({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7127
7127
  });
7128
7128
  });
7129
- return _extends$v({}, state, {
7129
+ return _extends$w({}, state, {
7130
7130
  toasts: mergedToasts
7131
7131
  });
7132
7132
  };
@@ -7136,7 +7136,7 @@ var createToast = function createToast(message, type, opts) {
7136
7136
  type = 'blank';
7137
7137
  }
7138
7138
 
7139
- return _extends$v({
7139
+ return _extends$w({
7140
7140
  createdAt: Date.now(),
7141
7141
  visible: true,
7142
7142
  type: type,
@@ -7186,14 +7186,14 @@ toast.remove = function (toastId) {
7186
7186
  };
7187
7187
 
7188
7188
  toast.promise = function (promise, msgs, opts) {
7189
- var id = toast.loading(msgs.loading, _extends$v({}, opts, opts == null ? void 0 : opts.loading));
7189
+ var id = toast.loading(msgs.loading, _extends$w({}, opts, opts == null ? void 0 : opts.loading));
7190
7190
  promise.then(function (p) {
7191
- toast.success(resolveValue(msgs.success, p), _extends$v({
7191
+ toast.success(resolveValue(msgs.success, p), _extends$w({
7192
7192
  id: id
7193
7193
  }, opts, opts == null ? void 0 : opts.success));
7194
7194
  return p;
7195
7195
  })["catch"](function (e) {
7196
- toast.error(resolveValue(msgs.error, e), _extends$v({
7196
+ toast.error(resolveValue(msgs.error, e), _extends$w({
7197
7197
  id: id
7198
7198
  }, opts, opts == null ? void 0 : opts.error));
7199
7199
  });
@@ -7532,7 +7532,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
7532
7532
  var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7533
7533
  return createElement(ToastBarBase, {
7534
7534
  className: toast.className,
7535
- style: _extends$v({}, animationStyle, style, toast.style)
7535
+ style: _extends$w({}, animationStyle, style, toast.style)
7536
7536
  }, typeof children === 'function' ? children({
7537
7537
  icon: icon,
7538
7538
  message: message
@@ -7562,7 +7562,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7562
7562
  } : position.includes('right') ? {
7563
7563
  justifyContent: 'flex-end'
7564
7564
  } : {};
7565
- return _extends$v({
7565
+ return _extends$w({
7566
7566
  left: 0,
7567
7567
  right: 0,
7568
7568
  display: 'flex',
@@ -7589,7 +7589,7 @@ var Toaster = function Toaster(_ref) {
7589
7589
  handlers = _useToaster.handlers;
7590
7590
 
7591
7591
  return createElement("div", {
7592
- style: _extends$v({
7592
+ style: _extends$w({
7593
7593
  position: 'fixed',
7594
7594
  zIndex: 9999,
7595
7595
  top: DEFAULT_OFFSET,
@@ -7624,82 +7624,82 @@ var Toaster = function Toaster(_ref) {
7624
7624
  }));
7625
7625
  };
7626
7626
 
7627
- var _path$s;
7627
+ var _path$t;
7628
7628
 
7629
- 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); }
7629
+ 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); }
7630
7630
 
7631
7631
  function SvgCheckSolid(props) {
7632
- return /*#__PURE__*/React.createElement("svg", _extends$u({
7632
+ return /*#__PURE__*/React.createElement("svg", _extends$v({
7633
7633
  xmlns: "http://www.w3.org/2000/svg",
7634
7634
  className: "h-5 w-5",
7635
7635
  viewBox: "0 0 20 20",
7636
7636
  fill: "currentColor"
7637
- }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7637
+ }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7638
7638
  fillRule: "evenodd",
7639
7639
  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",
7640
7640
  clipRule: "evenodd"
7641
7641
  })));
7642
7642
  }
7643
7643
 
7644
- var _path$r;
7644
+ var _path$s;
7645
7645
 
7646
- 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); }
7646
+ 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); }
7647
7647
 
7648
7648
  function SvgXIcon(props) {
7649
- return /*#__PURE__*/React.createElement("svg", _extends$t({
7649
+ return /*#__PURE__*/React.createElement("svg", _extends$u({
7650
7650
  xmlns: "http://www.w3.org/2000/svg",
7651
7651
  viewBox: "0 0 20 20",
7652
7652
  fill: "currentColor"
7653
- }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
7653
+ }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7654
7654
  fill: "evenodd",
7655
7655
  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",
7656
7656
  clipRule: "evenodd"
7657
7657
  })));
7658
7658
  }
7659
7659
 
7660
- var _path$q;
7660
+ var _path$r;
7661
7661
 
7662
- 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); }
7662
+ 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); }
7663
7663
 
7664
7664
  function SvgXIconSolid(props) {
7665
- return /*#__PURE__*/React.createElement("svg", _extends$s({
7665
+ return /*#__PURE__*/React.createElement("svg", _extends$t({
7666
7666
  className: "plc-w-4 plc-h-4",
7667
7667
  fill: "currentColor",
7668
7668
  xmlns: "http://www.w3.org/2000/svg",
7669
7669
  viewBox: "0 0 100 100"
7670
- }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
7670
+ }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
7671
7671
  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"
7672
7672
  })));
7673
7673
  }
7674
7674
 
7675
- var _path$p;
7675
+ var _path$q;
7676
7676
 
7677
- 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); }
7677
+ 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); }
7678
7678
 
7679
7679
  function SvgExclamation(props) {
7680
- return /*#__PURE__*/React.createElement("svg", _extends$r({
7680
+ return /*#__PURE__*/React.createElement("svg", _extends$s({
7681
7681
  className: "plc-w-4 plc-h-4 plc-mr-1",
7682
7682
  xmlns: "http://www.w3.org/2000/svg",
7683
7683
  viewBox: "0 0 20 20",
7684
7684
  fill: "currentColor"
7685
- }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
7685
+ }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
7686
7686
  fillRule: "evenodd",
7687
7687
  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",
7688
7688
  clipRule: "evenodd"
7689
7689
  })));
7690
7690
  }
7691
7691
 
7692
- var _path$o, _path2$3;
7692
+ var _path$p, _path2$3;
7693
7693
 
7694
- 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); }
7694
+ 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); }
7695
7695
 
7696
7696
  function SvgSpinner(props) {
7697
- return /*#__PURE__*/React.createElement("svg", _extends$q({
7697
+ return /*#__PURE__*/React.createElement("svg", _extends$r({
7698
7698
  className: "plc-animate-spin",
7699
7699
  viewBox: "0 0 24 24",
7700
7700
  fill: "currentColor",
7701
7701
  xmlns: "http://www.w3.org/2000/svg"
7702
- }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
7702
+ }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
7703
7703
  opacity: 0.2,
7704
7704
  fill: "evenodd",
7705
7705
  clipRule: "evenodd",
@@ -8451,6 +8451,7 @@ const optionsController = options => {
8451
8451
 
8452
8452
  const optionsMethodsDict = {
8453
8453
  loadPaymentSDKs: loadPaymentSDKs,
8454
+ loadAuth0SDK: loadAuth0SDK,
8454
8455
  enableURLTriggers: initViewFromURL,
8455
8456
  enableTheme: applyPelcroTheme,
8456
8457
  enablePaywalls: initPaywalls,
@@ -8516,6 +8517,13 @@ const loadPaymentSDKs = () => {
8516
8517
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/paypal-checkout.min.js", "braintree-paypal-sdk");
8517
8518
  }
8518
8519
  };
8520
+ const loadAuth0SDK = () => {
8521
+ const auth0Enabled = Boolean(window.Pelcro.site.read().auth0_client_id && window.Pelcro.site.read().auth0_base_url);
8522
+
8523
+ if (auth0Enabled) {
8524
+ window.Pelcro.helpers.loadSDK("https://cdn.auth0.com/js/auth0/9.18/auth0.min.js", "auth0-sdk");
8525
+ }
8526
+ };
8519
8527
  const initSecuritySdk = () => {
8520
8528
  const {
8521
8529
  whenSiteReady
@@ -8812,6 +8820,7 @@ const initCartFromUrl = () => {
8812
8820
 
8813
8821
  const defaultOptions = {
8814
8822
  loadPaymentSDKs: true,
8823
+ loadAuth0SDK: true,
8815
8824
  enableURLTriggers: true,
8816
8825
  enableTheme: true,
8817
8826
  enablePaywalls: true,
@@ -9637,16 +9646,16 @@ const LoginPassword = props => /*#__PURE__*/React__default.createElement(Passwor
9637
9646
  store: store$f
9638
9647
  }, props));
9639
9648
 
9640
- var _path$n;
9649
+ var _path$o;
9641
9650
 
9642
- 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); }
9651
+ 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); }
9643
9652
 
9644
9653
  function SvgCheck(props) {
9645
- return /*#__PURE__*/React.createElement("svg", _extends$p({
9654
+ return /*#__PURE__*/React.createElement("svg", _extends$q({
9646
9655
  xmlns: "http://www.w3.org/2000/svg",
9647
9656
  fill: "currentColor",
9648
9657
  viewBox: "0 0 20 20"
9649
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
9658
+ }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
9650
9659
  fillRule: "evenodd",
9651
9660
  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",
9652
9661
  clipRule: "evenodd"
@@ -9963,15 +9972,15 @@ function hasSecurityTokenEnabled$1() {
9963
9972
  return hasSecuritySdkLoaded;
9964
9973
  }
9965
9974
 
9966
- var _path$m;
9975
+ var _path$n;
9967
9976
 
9968
- 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); }
9977
+ 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); }
9969
9978
 
9970
9979
  function SvgFacebookLogo(props) {
9971
- return /*#__PURE__*/React.createElement("svg", _extends$o({
9980
+ return /*#__PURE__*/React.createElement("svg", _extends$p({
9972
9981
  xmlns: "http://www.w3.org/2000/svg",
9973
9982
  viewBox: "88.428 12.828 107.543 207.085"
9974
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
9983
+ }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
9975
9984
  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",
9976
9985
  fill: "#3c5a9a"
9977
9986
  })));
@@ -10044,15 +10053,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10044
10053
  unwrapExports(googleLogin);
10045
10054
  var googleLogin_1 = googleLogin.GoogleLogin;
10046
10055
 
10047
- var _path$l, _path2$2, _path3$1, _path4;
10056
+ var _path$m, _path2$2, _path3$1, _path4;
10048
10057
 
10049
- 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); }
10058
+ 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); }
10050
10059
 
10051
10060
  function SvgGoogleLogo(props) {
10052
- return /*#__PURE__*/React.createElement("svg", _extends$n({
10061
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
10053
10062
  viewBox: "0 0 24 24",
10054
10063
  xmlns: "http://www.w3.org/2000/svg"
10055
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
10064
+ }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
10056
10065
  fill: "#4285F4",
10057
10066
  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"
10058
10067
  })), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
@@ -10129,17 +10138,123 @@ const GoogleLoginButton = ({
10129
10138
  }) : null;
10130
10139
  };
10131
10140
 
10141
+ var _path$l;
10142
+
10143
+ 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); }
10144
+
10145
+ function SvgAuth0Logo(props) {
10146
+ return /*#__PURE__*/React.createElement("svg", _extends$n({
10147
+ viewBox: "0 0 256 285",
10148
+ xmlns: "http://www.w3.org/2000/svg"
10149
+ }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
10150
+ 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"
10151
+ })));
10152
+ }
10153
+
10154
+ const Auth0LoginButton = ({
10155
+ label = "Auth0",
10156
+ className = "",
10157
+ labelClassName = "",
10158
+ iconClassName = ""
10159
+ }) => {
10160
+ const auth0Enabled = Boolean(window.Pelcro.site.read().auth0_client_id && window.Pelcro.site.read().auth0_base_url);
10161
+ const auth0InstanceRef = React__default.useRef(null);
10162
+ React__default.useEffect(() => {
10163
+ if (auth0Enabled) {
10164
+ auth0InstanceRef.current = new window.auth0.WebAuth({
10165
+ domain: window.Pelcro.site.read().auth0_base_url,
10166
+ clientID: window.Pelcro.site.read().auth0_client_id
10167
+ });
10168
+ }
10169
+ }, []);
10170
+ const {
10171
+ dispatch: loginDispatch
10172
+ } = useContext(store$f);
10173
+ const {
10174
+ dispatch: registerDispatch
10175
+ } = useContext(store$e);
10176
+
10177
+ function handleClick() {
10178
+ var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
10179
+
10180
+ (_auth0InstanceRef$cur = auth0InstanceRef.current) === null || _auth0InstanceRef$cur === void 0 ? void 0 : (_auth0InstanceRef$cur2 = _auth0InstanceRef$cur.popup) === null || _auth0InstanceRef$cur2 === void 0 ? void 0 : (_auth0InstanceRef$cur3 = _auth0InstanceRef$cur2.authorize) === null || _auth0InstanceRef$cur3 === void 0 ? void 0 : _auth0InstanceRef$cur3.call(_auth0InstanceRef$cur2, {
10181
+ responseType: "token id_token",
10182
+ owp: true // close popup when finished
10183
+
10184
+ }, function (error, authResult) {
10185
+ if (error) {
10186
+ return onFailure(error);
10187
+ }
10188
+
10189
+ onSuccess(authResult);
10190
+ });
10191
+ }
10192
+
10193
+ const onSuccess = authResult => {
10194
+ var _auth0InstanceRef$cur4, _auth0InstanceRef$cur5, _auth0InstanceRef$cur6;
10195
+
10196
+ const {
10197
+ accessToken
10198
+ } = authResult;
10199
+ (_auth0InstanceRef$cur4 = auth0InstanceRef.current) === null || _auth0InstanceRef$cur4 === void 0 ? void 0 : (_auth0InstanceRef$cur5 = _auth0InstanceRef$cur4.client) === null || _auth0InstanceRef$cur5 === void 0 ? void 0 : (_auth0InstanceRef$cur6 = _auth0InstanceRef$cur5.userInfo) === null || _auth0InstanceRef$cur6 === void 0 ? void 0 : _auth0InstanceRef$cur6.call(_auth0InstanceRef$cur5, accessToken, (error, user) => {
10200
+ if (error) {
10201
+ return onFailure(error);
10202
+ }
10203
+
10204
+ const {
10205
+ email,
10206
+ nickname
10207
+ } = user;
10208
+ loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
10209
+ type: HANDLE_SOCIAL_LOGIN,
10210
+ payload: {
10211
+ idpName: "auth0",
10212
+ idpToken: accessToken,
10213
+ firstName: nickname,
10214
+ email
10215
+ }
10216
+ });
10217
+ registerDispatch === null || registerDispatch === void 0 ? void 0 : registerDispatch({
10218
+ type: HANDLE_SOCIAL_LOGIN,
10219
+ payload: {
10220
+ idpName: "auth0",
10221
+ idpToken: accessToken,
10222
+ firstName: nickname,
10223
+ email
10224
+ }
10225
+ });
10226
+ });
10227
+ };
10228
+
10229
+ const onFailure = error => {
10230
+ console.error(error);
10231
+ };
10232
+
10233
+ if (auth0Enabled) {
10234
+ return /*#__PURE__*/React__default.createElement("button", {
10235
+ onClick: handleClick,
10236
+ className: `plc-flex plc-items-center plc-justify-center plc-w-full plc-p-3 plc-space-x-3 plc-text-gray-700 plc-border plc-border-gray-200 plc-rounded-3xl hover:plc-bg-gray-200 pelcro-auth0-login ${className}`
10237
+ }, /*#__PURE__*/React__default.createElement(SvgAuth0Logo, {
10238
+ className: `plc-w-6 plc-h-auto pelcro-auth0-login-icon" ${iconClassName}`
10239
+ }), /*#__PURE__*/React__default.createElement("p", {
10240
+ className: `pelcro-auth0-login-label ${labelClassName}`
10241
+ }, label));
10242
+ }
10243
+
10244
+ return null;
10245
+ };
10246
+
10132
10247
  /**
10133
10248
  *
10134
10249
  */
10135
10250
 
10136
10251
  function LoginView(props) {
10137
- var _window$Pelcro$site$r, _window$Pelcro$site$r2;
10252
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3;
10138
10253
 
10139
10254
  const {
10140
10255
  t
10141
10256
  } = useTranslation("login");
10142
- const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id);
10257
+ const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
10143
10258
  return /*#__PURE__*/React__default.createElement("div", {
10144
10259
  id: "pelcro-login-view"
10145
10260
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -10183,7 +10298,7 @@ function LoginView(props) {
10183
10298
  className: "plc-w-full plc-border-gray-300"
10184
10299
  })), /*#__PURE__*/React__default.createElement("div", {
10185
10300
  className: "plc-flex plc-justify-center plc-px-5 plc-mt-1 plc-space-x-3"
10186
- }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null))))));
10301
+ }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null), /*#__PURE__*/React__default.createElement(Auth0LoginButton, null))))));
10187
10302
  }
10188
10303
 
10189
10304
  var _path$k, _path2$1, _path3;
@@ -10542,7 +10657,7 @@ const RegisterLastName = props => /*#__PURE__*/React__default.createElement(Last
10542
10657
  */
10543
10658
 
10544
10659
  function RegisterView(props) {
10545
- var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro, _window$Pelcro$uiSett;
10660
+ var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett;
10546
10661
 
10547
10662
  const {
10548
10663
  t
@@ -10552,7 +10667,7 @@ function RegisterView(props) {
10552
10667
  } = usePelcro();
10553
10668
  const title = (_product$paywall$regi = product === null || product === void 0 ? void 0 : (_product$paywall = product.paywall) === null || _product$paywall === void 0 ? void 0 : _product$paywall.register_title) !== null && _product$paywall$regi !== void 0 ? _product$paywall$regi : t("title");
10554
10669
  const subtitle = (_product$paywall$regi2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.register_subtitle) !== null && _product$paywall$regi2 !== void 0 ? _product$paywall$regi2 : t("subtitle");
10555
- const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id);
10670
+ const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
10556
10671
  const showNameFields = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableNameFieldsInRegister;
10557
10672
  return /*#__PURE__*/React__default.createElement("div", {
10558
10673
  id: "pelcro-register-view"
@@ -10610,7 +10725,7 @@ function RegisterView(props) {
10610
10725
  className: "plc-w-full plc-border-gray-300"
10611
10726
  })), /*#__PURE__*/React__default.createElement("div", {
10612
10727
  className: "plc-flex plc-justify-center plc-px-5 plc-mt-1 plc-space-x-3"
10613
- }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null))))));
10728
+ }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null), /*#__PURE__*/React__default.createElement(Auth0LoginButton, null))))));
10614
10729
  }
10615
10730
  /**
10616
10731
  * Checks if the current site has security token enabled
@@ -10618,9 +10733,9 @@ function RegisterView(props) {
10618
10733
  */
10619
10734
 
10620
10735
  function hasSecurityTokenEnabled() {
10621
- var _window$Pelcro$site, _window$Pelcro$site$r3;
10736
+ var _window$Pelcro$site, _window$Pelcro$site$r4;
10622
10737
 
10623
- return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r3 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.security_key);
10738
+ return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r4 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.security_key);
10624
10739
  }
10625
10740
 
10626
10741
  function TextInput({
@@ -23859,4 +23974,4 @@ function ProfilePicChangeModal({
23859
23974
  }
23860
23975
  ProfilePicChangeModal.viewId = "profile-picture";
23861
23976
 
23862
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, notify, unauthenticatedButtons, usePelcro };
23977
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, notify, unauthenticatedButtons, usePelcro };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "2.6.1",
4
+ "version": "2.7.0-beta.1",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",