tf-checkout-react 1.4.26 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/api/index.d.ts +1 -0
  2. package/dist/api/preRegistrationComplete.d.ts +3 -0
  3. package/dist/components/billing-info-container/index.d.ts +1 -3
  4. package/dist/components/common/CopyField.d.ts +12 -0
  5. package/dist/components/common/CopyMessageModal.d.ts +7 -0
  6. package/dist/components/common/index.d.ts +1 -0
  7. package/dist/components/common/socials.d.ts +10 -0
  8. package/dist/components/confirmationContainer/index.d.ts +7 -7
  9. package/dist/components/confirmationContainer/social-buttons.d.ts +5 -2
  10. package/dist/components/forgotPasswordModal/index.d.ts +2 -3
  11. package/dist/components/loginForm/index.d.ts +1 -0
  12. package/dist/components/loginModal/index.d.ts +2 -3
  13. package/dist/components/preRegistration/FieldsSection.d.ts +13 -0
  14. package/dist/components/preRegistration/Influancers.d.ts +2 -0
  15. package/dist/components/preRegistration/PreRegistrationComplete.d.ts +5 -0
  16. package/dist/components/preRegistration/PreRegistrationInformations.d.ts +2 -0
  17. package/dist/components/preRegistration/Prewards.d.ts +2 -0
  18. package/dist/components/preRegistration/ShareOptions.d.ts +2 -0
  19. package/dist/components/preRegistration/constants.d.ts +2 -0
  20. package/dist/components/preRegistration/index.d.ts +17 -0
  21. package/dist/components/preRegistration/utils.d.ts +12 -0
  22. package/dist/components/ticketsContainer/TicketRow.d.ts +3 -2
  23. package/dist/components/ticketsContainer/utils.d.ts +9 -0
  24. package/dist/hooks/index.d.ts +1 -0
  25. package/dist/hooks/useEventListener.d.ts +1 -0
  26. package/dist/hooks/useLocalStorageListener.d.ts +1 -0
  27. package/dist/images/instagram.svg +5 -0
  28. package/dist/images/spotify.svg +6 -0
  29. package/dist/index.d.ts +4 -1
  30. package/dist/tf-checkout-react.cjs.development.js +1508 -157
  31. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  32. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  33. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  34. package/dist/tf-checkout-react.esm.js +1509 -157
  35. package/dist/tf-checkout-react.esm.js.map +1 -1
  36. package/dist/utils/isValidNumber.d.ts +1 -0
  37. package/package.json +1 -1
  38. package/src/api/index.ts +28 -0
  39. package/src/api/preRegistrationComplete.ts +37 -0
  40. package/src/assets/images/instagram.svg +5 -0
  41. package/src/assets/images/spotify.svg +6 -0
  42. package/src/components/billing-info-container/index.tsx +1 -7
  43. package/src/components/common/CopyField.tsx +53 -0
  44. package/src/components/common/CopyMessageModal.tsx +34 -0
  45. package/src/components/common/NativeSelectFeild/index.tsx +1 -1
  46. package/src/components/common/index.tsx +1 -0
  47. package/src/components/common/socials.tsx +33 -0
  48. package/src/components/confirmationContainer/config.ts +62 -55
  49. package/src/components/confirmationContainer/index.tsx +11 -31
  50. package/src/components/confirmationContainer/social-buttons.tsx +43 -20
  51. package/src/components/forgotPasswordModal/index.tsx +4 -4
  52. package/src/components/loginForm/index.tsx +4 -0
  53. package/src/components/loginModal/index.tsx +5 -4
  54. package/src/components/preRegistration/FieldsSection.tsx +142 -0
  55. package/src/components/preRegistration/Influancers.tsx +34 -0
  56. package/src/components/preRegistration/PreRegistrationComplete.tsx +164 -0
  57. package/src/components/preRegistration/PreRegistrationInformations.tsx +54 -0
  58. package/src/components/preRegistration/Prewards.tsx +41 -0
  59. package/src/components/preRegistration/ShareOptions.tsx +77 -0
  60. package/src/components/preRegistration/constants.tsx +161 -0
  61. package/src/components/preRegistration/index.tsx +274 -0
  62. package/src/components/preRegistration/utils.ts +155 -0
  63. package/src/components/ticketsContainer/ReferralLogic.tsx +1 -1
  64. package/src/components/ticketsContainer/TicketRow.tsx +17 -14
  65. package/src/components/ticketsContainer/TicketsSection.tsx +2 -0
  66. package/src/components/ticketsContainer/index.tsx +77 -8
  67. package/src/components/ticketsContainer/utils.ts +30 -6
  68. package/src/hooks/index.ts +1 -0
  69. package/src/hooks/useEventListener.ts +32 -0
  70. package/src/hooks/useLocalStorageListener.ts +27 -0
  71. package/src/index.ts +6 -2
  72. package/src/types/api/preRegistration.d.ts +11 -0
  73. package/src/types/api/preRegistrationComplete.d.ts +95 -0
  74. package/src/types/pre-registration-complete.d.ts +42 -0
  75. package/src/utils/cookies.ts +7 -7
  76. package/src/utils/isValidNumber.ts +8 -0
@@ -53,8 +53,8 @@ import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
53
53
  import jwt_decode from 'jwt-decode';
54
54
  import _filter from 'lodash-es/filter';
55
55
  import _some from 'lodash-es/some';
56
- import Button$1 from 'react-bootstrap/Button';
57
56
  import moment from 'moment-timezone';
57
+ import Button$1 from 'react-bootstrap/Button';
58
58
  import _sortBy from 'lodash-es/sortBy';
59
59
  import Autocomplete from '@mui/material/Autocomplete';
60
60
  import Paper from '@mui/material/Paper';
@@ -77,6 +77,8 @@ import SeatMapView from 'tf-seat-map-view';
77
77
  import InputLabel$1 from '@mui/material/InputLabel';
78
78
  import Tooltip from '@mui/material/Tooltip';
79
79
  import { Button as Button$3 } from 'react-bootstrap';
80
+ import _split from 'lodash-es/split';
81
+ import _slice from 'lodash-es/slice';
80
82
 
81
83
  function _regeneratorRuntime() {
82
84
  _regeneratorRuntime = function () {
@@ -546,7 +548,7 @@ function setCustomCookie(name, value, days) {
546
548
  }
547
549
  if (typeof window !== 'undefined') {
548
550
  var domain = getDomain(window.location.hostname);
549
- document.cookie = name + '=' + (value || '') + expires + '; path=/' + ("; domain=" + domain);
551
+ document.cookie = name + '=' + (value || '') + expires + ("; path=/; domain=" + domain);
550
552
  }
551
553
  }
552
554
  function getCookieByName(cname) {
@@ -555,10 +557,10 @@ function getCookieByName(cname) {
555
557
  var ca = document.cookie.split(';');
556
558
  for (var i = 0; i < ca.length; i++) {
557
559
  var c = ca[i];
558
- while (c.charAt(0) == ' ') {
560
+ while (c.charAt(0) === ' ') {
559
561
  c = c.substring(1);
560
562
  }
561
- if (c.indexOf(name) == 0) {
563
+ if (c.indexOf(name) === 0) {
562
564
  return c.substring(name.length, c.length);
563
565
  }
564
566
  }
@@ -1580,70 +1582,79 @@ var getCheckoutPageConfigs = /*#__PURE__*/function () {
1580
1582
  return _ref2.apply(this, arguments);
1581
1583
  };
1582
1584
  }();
1583
- var getSeatMapData = /*#__PURE__*/function () {
1584
- var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventId) {
1585
- var reservedSeatsHash, params, response;
1585
+ var confirmPreRegistration = /*#__PURE__*/function () {
1586
+ var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventId, data) {
1587
+ var response;
1586
1588
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1587
1589
  while (1) switch (_context3.prev = _context3.next) {
1588
1590
  case 0:
1589
- localStorage.setItem('tierId', '');
1590
- reservedSeatsHash = getQueryVariable('reserved_seats_hash');
1591
- params = {};
1592
- if (reservedSeatsHash) {
1593
- params.reserved_seats_hash = reservedSeatsHash;
1594
- }
1595
- _context3.next = 6;
1596
- return publicRequest.get("v1/event/" + eventId + "/seat-map-data", {
1597
- params: params
1591
+ _context3.next = 2;
1592
+ return publicRequest.post("v1/event/" + eventId + "/pre-registration/confirm", {
1593
+ data: {
1594
+ attributes: data
1595
+ }
1598
1596
  });
1599
- case 6:
1597
+ case 2:
1600
1598
  response = _context3.sent;
1601
1599
  return _context3.abrupt("return", response.data);
1602
- case 8:
1600
+ case 4:
1603
1601
  case "end":
1604
1602
  return _context3.stop();
1605
1603
  }
1606
1604
  }, _callee3);
1607
1605
  }));
1608
- return function getSeatMapData(_x2) {
1606
+ return function confirmPreRegistration(_x2, _x3) {
1609
1607
  return _ref3.apply(this, arguments);
1610
1608
  };
1611
1609
  }();
1612
- var getSeatMapStatuses = /*#__PURE__*/function () {
1610
+ // seat map <--start-->
1611
+ // const makeId = (length = 20) => {
1612
+ // let result = ''
1613
+ // const characters =
1614
+ // 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
1615
+ // const charactersLength = characters.length
1616
+ // for (let i = 0; i < length; i++) {
1617
+ // result += characters.charAt(Math.floor(Math.random() * charactersLength))
1618
+ // }
1619
+ // return result
1620
+ // }
1621
+ var getSeatMapData = /*#__PURE__*/function () {
1613
1622
  var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(eventId) {
1614
- var response;
1623
+ var reservedSeatsHash, params, response;
1615
1624
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1616
1625
  while (1) switch (_context4.prev = _context4.next) {
1617
1626
  case 0:
1618
- _context4.next = 2;
1619
- return publicRequest.get("v1/event/" + eventId + "/seats/status");
1620
- case 2:
1627
+ localStorage.setItem('tierId', '');
1628
+ reservedSeatsHash = getQueryVariable('reserved_seats_hash');
1629
+ params = {};
1630
+ if (reservedSeatsHash) {
1631
+ params.reserved_seats_hash = reservedSeatsHash;
1632
+ }
1633
+ _context4.next = 6;
1634
+ return publicRequest.get("v1/event/" + eventId + "/seat-map-data", {
1635
+ params: params
1636
+ });
1637
+ case 6:
1621
1638
  response = _context4.sent;
1622
1639
  return _context4.abrupt("return", response.data);
1623
- case 4:
1640
+ case 8:
1624
1641
  case "end":
1625
1642
  return _context4.stop();
1626
1643
  }
1627
1644
  }, _callee4);
1628
1645
  }));
1629
- return function getSeatMapStatuses(_x3) {
1646
+ return function getSeatMapData(_x4) {
1630
1647
  return _ref4.apply(this, arguments);
1631
1648
  };
1632
1649
  }();
1633
- var reserveSeat = /*#__PURE__*/function () {
1634
- var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventId, tierId, seatId) {
1650
+ var getSeatMapStatuses = /*#__PURE__*/function () {
1651
+ var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventId) {
1635
1652
  var response;
1636
1653
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1637
1654
  while (1) switch (_context5.prev = _context5.next) {
1638
1655
  case 0:
1639
1656
  _context5.next = 2;
1640
- return publicRequest.post("v1/event/" + eventId + "/seats/reserve", {
1641
- data: {
1642
- tierId: tierId,
1643
- seatId: seatId,
1644
- ttl: 10
1645
- }
1646
- });
1657
+ return publicRequest.get("v1/event/" + eventId + "/seats/status");
1647
1658
  case 2:
1648
1659
  response = _context5.sent;
1649
1660
  return _context5.abrupt("return", response.data);
@@ -1653,21 +1664,22 @@ var reserveSeat = /*#__PURE__*/function () {
1653
1664
  }
1654
1665
  }, _callee5);
1655
1666
  }));
1656
- return function reserveSeat(_x4, _x5, _x6) {
1667
+ return function getSeatMapStatuses(_x5) {
1657
1668
  return _ref5.apply(this, arguments);
1658
1669
  };
1659
1670
  }();
1660
- var removeSeatReserve = /*#__PURE__*/function () {
1661
- var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(eventId, tierId, seatIds) {
1671
+ var reserveSeat = /*#__PURE__*/function () {
1672
+ var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(eventId, tierId, seatId) {
1662
1673
  var response;
1663
1674
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1664
1675
  while (1) switch (_context6.prev = _context6.next) {
1665
1676
  case 0:
1666
1677
  _context6.next = 2;
1667
- return publicRequest["delete"]("v1/event/" + eventId + "/seats/delete-reserved", {
1678
+ return publicRequest.post("v1/event/" + eventId + "/seats/reserve", {
1668
1679
  data: {
1669
1680
  tierId: tierId,
1670
- seatIds: seatIds
1681
+ seatId: seatId,
1682
+ ttl: 10
1671
1683
  }
1672
1684
  });
1673
1685
  case 2:
@@ -1679,30 +1691,23 @@ var removeSeatReserve = /*#__PURE__*/function () {
1679
1691
  }
1680
1692
  }, _callee6);
1681
1693
  }));
1682
- return function removeSeatReserve(_x7, _x8, _x9) {
1694
+ return function reserveSeat(_x6, _x7, _x8) {
1683
1695
  return _ref6.apply(this, arguments);
1684
1696
  };
1685
1697
  }();
1686
- // seat map <--end-->
1687
- function getPixelScript(id, pageOptions) {
1688
- var response = publicRequest.get("v1/event/" + id + "/track", {
1689
- params: {
1690
- page_url: pageOptions.pageUrl,
1691
- page: pageOptions.page,
1692
- order_hash: pageOptions.orderHash
1693
- }
1694
- });
1695
- return response;
1696
- }
1697
- // ID Verification
1698
- var getNetverifyUrl = /*#__PURE__*/function () {
1699
- var _ref7 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
1698
+ var removeSeatReserve = /*#__PURE__*/function () {
1699
+ var _ref7 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(eventId, tierId, seatIds) {
1700
1700
  var response;
1701
1701
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1702
1702
  while (1) switch (_context7.prev = _context7.next) {
1703
1703
  case 0:
1704
1704
  _context7.next = 2;
1705
- return publicRequest.get('v1/authenticate/verify');
1705
+ return publicRequest["delete"]("v1/event/" + eventId + "/seats/delete-reserved", {
1706
+ data: {
1707
+ tierId: tierId,
1708
+ seatIds: seatIds
1709
+ }
1710
+ });
1706
1711
  case 2:
1707
1712
  response = _context7.sent;
1708
1713
  return _context7.abrupt("return", response.data);
@@ -1712,18 +1717,30 @@ var getNetverifyUrl = /*#__PURE__*/function () {
1712
1717
  }
1713
1718
  }, _callee7);
1714
1719
  }));
1715
- return function getNetverifyUrl() {
1720
+ return function removeSeatReserve(_x9, _x10, _x11) {
1716
1721
  return _ref7.apply(this, arguments);
1717
1722
  };
1718
1723
  }();
1719
- var checkVerificationStatus = /*#__PURE__*/function () {
1724
+ // seat map <--end-->
1725
+ function getPixelScript(id, pageOptions) {
1726
+ var response = publicRequest.get("v1/event/" + id + "/track", {
1727
+ params: {
1728
+ page_url: pageOptions.pageUrl,
1729
+ page: pageOptions.page,
1730
+ order_hash: pageOptions.orderHash
1731
+ }
1732
+ });
1733
+ return response;
1734
+ }
1735
+ // ID Verification
1736
+ var getNetverifyUrl = /*#__PURE__*/function () {
1720
1737
  var _ref8 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
1721
1738
  var response;
1722
1739
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1723
1740
  while (1) switch (_context8.prev = _context8.next) {
1724
1741
  case 0:
1725
1742
  _context8.next = 2;
1726
- return publicRequest.get('v1/authenticate/get-verification-info');
1743
+ return publicRequest.get('v1/authenticate/verify');
1727
1744
  case 2:
1728
1745
  response = _context8.sent;
1729
1746
  return _context8.abrupt("return", response.data);
@@ -1733,26 +1750,18 @@ var checkVerificationStatus = /*#__PURE__*/function () {
1733
1750
  }
1734
1751
  }, _callee8);
1735
1752
  }));
1736
- return function checkVerificationStatus() {
1753
+ return function getNetverifyUrl() {
1737
1754
  return _ref8.apply(this, arguments);
1738
1755
  };
1739
1756
  }();
1740
- var updateVerificationStatus = /*#__PURE__*/function () {
1757
+ var checkVerificationStatus = /*#__PURE__*/function () {
1741
1758
  var _ref9 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
1742
1759
  var response;
1743
1760
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1744
1761
  while (1) switch (_context9.prev = _context9.next) {
1745
1762
  case 0:
1746
1763
  _context9.next = 2;
1747
- return publicRequest.patch('v1/authenticate/verify', {
1748
- data: {
1749
- attributes: {
1750
- verification: {
1751
- verificationStatus: 'PENDING'
1752
- }
1753
- }
1754
- }
1755
- });
1764
+ return publicRequest.get('v1/authenticate/get-verification-info');
1756
1765
  case 2:
1757
1766
  response = _context9.sent;
1758
1767
  return _context9.abrupt("return", response.data);
@@ -1762,18 +1771,26 @@ var updateVerificationStatus = /*#__PURE__*/function () {
1762
1771
  }
1763
1772
  }, _callee9);
1764
1773
  }));
1765
- return function updateVerificationStatus() {
1774
+ return function checkVerificationStatus() {
1766
1775
  return _ref9.apply(this, arguments);
1767
1776
  };
1768
1777
  }();
1769
- var checkCustomerOrder = /*#__PURE__*/function () {
1770
- var _ref10 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(orderHash) {
1778
+ var updateVerificationStatus = /*#__PURE__*/function () {
1779
+ var _ref10 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
1771
1780
  var response;
1772
1781
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1773
1782
  while (1) switch (_context10.prev = _context10.next) {
1774
1783
  case 0:
1775
1784
  _context10.next = 2;
1776
- return publicRequest.get("v1/order/" + orderHash + "/verify-customer-order");
1785
+ return publicRequest.patch('v1/authenticate/verify', {
1786
+ data: {
1787
+ attributes: {
1788
+ verification: {
1789
+ verificationStatus: 'PENDING'
1790
+ }
1791
+ }
1792
+ }
1793
+ });
1777
1794
  case 2:
1778
1795
  response = _context10.sent;
1779
1796
  return _context10.abrupt("return", response.data);
@@ -1783,33 +1800,54 @@ var checkCustomerOrder = /*#__PURE__*/function () {
1783
1800
  }
1784
1801
  }, _callee10);
1785
1802
  }));
1786
- return function checkCustomerOrder(_x10) {
1803
+ return function updateVerificationStatus() {
1787
1804
  return _ref10.apply(this, arguments);
1788
1805
  };
1789
1806
  }();
1790
- var refreshSeatReservation = /*#__PURE__*/function () {
1791
- var _ref11 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(eventId, orderId) {
1807
+ var checkCustomerOrder = /*#__PURE__*/function () {
1808
+ var _ref11 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(orderHash) {
1792
1809
  var response;
1793
1810
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1794
1811
  while (1) switch (_context11.prev = _context11.next) {
1795
1812
  case 0:
1796
1813
  _context11.next = 2;
1797
- return publicRequest.patch("event/" + eventId + "/reservation/refresh/", {
1798
- order_id: orderId
1799
- });
1814
+ return publicRequest.get("v1/order/" + orderHash + "/verify-customer-order");
1800
1815
  case 2:
1801
1816
  response = _context11.sent;
1802
- return _context11.abrupt("return", response);
1817
+ return _context11.abrupt("return", response.data);
1803
1818
  case 4:
1804
1819
  case "end":
1805
1820
  return _context11.stop();
1806
1821
  }
1807
1822
  }, _callee11);
1808
1823
  }));
1809
- return function refreshSeatReservation(_x11, _x12) {
1824
+ return function checkCustomerOrder(_x12) {
1810
1825
  return _ref11.apply(this, arguments);
1811
1826
  };
1812
1827
  }();
1828
+ var refreshSeatReservation = /*#__PURE__*/function () {
1829
+ var _ref12 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(eventId, orderId) {
1830
+ var response;
1831
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1832
+ while (1) switch (_context12.prev = _context12.next) {
1833
+ case 0:
1834
+ _context12.next = 2;
1835
+ return publicRequest.patch("event/" + eventId + "/reservation/refresh/", {
1836
+ order_id: orderId
1837
+ });
1838
+ case 2:
1839
+ response = _context12.sent;
1840
+ return _context12.abrupt("return", response);
1841
+ case 4:
1842
+ case "end":
1843
+ return _context12.stop();
1844
+ }
1845
+ }, _callee12);
1846
+ }));
1847
+ return function refreshSeatReservation(_x13, _x14) {
1848
+ return _ref12.apply(this, arguments);
1849
+ };
1850
+ }();
1813
1851
 
1814
1852
  function appendScriptsToHeader(code) {
1815
1853
  if (isBrowser && code) {
@@ -2109,8 +2147,8 @@ var Schema = /*#__PURE__*/object().shape({
2109
2147
  var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
2110
2148
  var _ref$onClose = _ref.onClose,
2111
2149
  onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
2112
- _ref$onLogin = _ref.onLogin,
2113
- onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
2150
+ _ref$onLoginButtonCli = _ref.onLoginButtonClick,
2151
+ onLoginButtonClick = _ref$onLoginButtonCli === void 0 ? function () {} : _ref$onLoginButtonCli,
2114
2152
  _ref$onForgotPassword = _ref.onForgotPasswordSuccess,
2115
2153
  onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ? function () {} : _ref$onForgotPassword,
2116
2154
  _ref$onForgotPassword2 = _ref.onForgotPasswordError,
@@ -2199,7 +2237,7 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
2199
2237
  }) : 'Submit')), React.createElement("div", {
2200
2238
  className: "login"
2201
2239
  }, React.createElement("span", {
2202
- onClick: onLogin
2240
+ onClick: onLoginButtonClick
2203
2241
  }, "Back to Log In")), showPoweredByImage ? React.createElement(PoweredBy, null) : null);
2204
2242
  }))));
2205
2243
  };
@@ -2329,7 +2367,7 @@ var LoginModal = function LoginModal(_ref) {
2329
2367
  },
2330
2368
  onSubmit: function () {
2331
2369
  var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
2332
- var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
2370
+ var email, password, body, authRes, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
2333
2371
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2334
2372
  while (1) switch (_context.prev = _context.next) {
2335
2373
  case 0:
@@ -2342,23 +2380,24 @@ var LoginModal = function LoginModal(_ref) {
2342
2380
  _context.next = 5;
2343
2381
  return authorize(body);
2344
2382
  case 5:
2383
+ authRes = _context.sent;
2345
2384
  profileResponse = null;
2346
- _context.prev = 6;
2347
- _context.next = 9;
2385
+ _context.prev = 7;
2386
+ _context.next = 10;
2348
2387
  return getProfileData();
2349
- case 9:
2388
+ case 10:
2350
2389
  profileResponse = _context.sent;
2351
2390
  onGetProfileDataSuccess(profileResponse.data);
2352
- _context.next = 17;
2391
+ _context.next = 18;
2353
2392
  break;
2354
- case 13:
2355
- _context.prev = 13;
2356
- _context.t0 = _context["catch"](6);
2393
+ case 14:
2394
+ _context.prev = 14;
2395
+ _context.t0 = _context["catch"](7);
2357
2396
  if (axios.isAxiosError(_context.t0)) {
2358
2397
  onGetProfileDataError(_context.t0);
2359
2398
  }
2360
2399
  return _context.abrupt("return");
2361
- case 17:
2400
+ case 18:
2362
2401
  profileSpecifiedData = profileResponse.data;
2363
2402
  profileDataObj = setLoggedUserData(profileSpecifiedData);
2364
2403
  if (isBrowser) {
@@ -2366,11 +2405,11 @@ var LoginModal = function LoginModal(_ref) {
2366
2405
  event = new window.CustomEvent('tf-login');
2367
2406
  window.document.dispatchEvent(event);
2368
2407
  }
2369
- onLogin();
2370
- _context.next = 26;
2408
+ onLogin(_get(authRes, 'data.data'));
2409
+ _context.next = 27;
2371
2410
  break;
2372
- case 23:
2373
- _context.prev = 23;
2411
+ case 24:
2412
+ _context.prev = 24;
2374
2413
  _context.t1 = _context["catch"](1);
2375
2414
  if (axios.isAxiosError(_context.t1)) {
2376
2415
  _error = (_context.t1 == null ? void 0 : (_e$response = _context.t1.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message) || 'Error';
@@ -2378,11 +2417,11 @@ var LoginModal = function LoginModal(_ref) {
2378
2417
  } else if (_context.t1 instanceof Error) {
2379
2418
  setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
2380
2419
  }
2381
- case 26:
2420
+ case 27:
2382
2421
  case "end":
2383
2422
  return _context.stop();
2384
2423
  }
2385
- }, _callee, null, [[1, 23], [6, 13]]);
2424
+ }, _callee, null, [[1, 24], [7, 14]]);
2386
2425
  }));
2387
2426
  function onSubmit(_x) {
2388
2427
  return _onSubmit.apply(this, arguments);
@@ -2886,6 +2925,29 @@ function SelectField(_ref) {
2886
2925
  }, error) : null));
2887
2926
  }
2888
2927
 
2928
+ var CopyMessageModal = function CopyMessageModal(props) {
2929
+ var _props$showCopyModal = props.showCopyModal,
2930
+ showCopyModal = _props$showCopyModal === void 0 ? false : _props$showCopyModal,
2931
+ onClose = props.onClose;
2932
+ return React.createElement(Modal$2, {
2933
+ open: showCopyModal,
2934
+ onClose: onClose,
2935
+ "aria-labelledby": "modal-modal-title",
2936
+ "aria-describedby": "modal-modal-description",
2937
+ className: "success-copy-modal"
2938
+ }, React.createElement("div", {
2939
+ className: "message-copy-success-box"
2940
+ }, React.createElement("div", {
2941
+ className: "message-copy-success"
2942
+ }, React.createElement("span", null, "Copied to your clipboard! Now paste your link in a Snapchat message,"), React.createElement("span", null, "your Instagram bio, Whatsapp, Facebook or a text :)")), React.createElement("div", {
2943
+ className: "footer"
2944
+ }, React.createElement("button", {
2945
+ className: "footer-button",
2946
+ type: "button",
2947
+ onClick: onClose
2948
+ }, "OK"))));
2949
+ };
2950
+
2889
2951
  var DATE_SIZE = 32;
2890
2952
  var compactStyles = {
2891
2953
  '& > div': {
@@ -3009,7 +3071,7 @@ var NativeSelectField = function NativeSelectField(_ref) {
3009
3071
  id: field.name
3010
3072
  },
3011
3073
  "native": true,
3012
- className: theme,
3074
+ className: "Mui-Select " + theme,
3013
3075
  MenuProps: {
3014
3076
  className: theme
3015
3077
  }
@@ -3409,10 +3471,6 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
3409
3471
  _onGetProfileDataSuccess = _ref4$onGetProfileDat === void 0 ? _identity : _ref4$onGetProfileDat,
3410
3472
  _ref4$onGetProfileDat2 = _ref4.onGetProfileDataError,
3411
3473
  onGetProfileDataError = _ref4$onGetProfileDat2 === void 0 ? _identity : _ref4$onGetProfileDat2,
3412
- _ref4$onAuthorizeSucc = _ref4.onAuthorizeSuccess,
3413
- onAuthorizeSuccess = _ref4$onAuthorizeSucc === void 0 ? _identity : _ref4$onAuthorizeSucc,
3414
- _ref4$onAuthorizeErro = _ref4.onAuthorizeError,
3415
- onAuthorizeError = _ref4$onAuthorizeErro === void 0 ? _identity : _ref4$onAuthorizeErro,
3416
3474
  onLogin = _ref4.onLogin,
3417
3475
  _ref4$onLoginSuccess = _ref4.onLoginSuccess,
3418
3476
  onLoginSuccess = _ref4$onLoginSuccess === void 0 ? _identity : _ref4$onLoginSuccess,
@@ -4232,8 +4290,6 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
4232
4290
  },
4233
4291
  alreadyHasUser: alreadyHasUser,
4234
4292
  userExpired: userExpired,
4235
- onAuthorizeSuccess: onAuthorizeSuccess,
4236
- onAuthorizeError: onAuthorizeError,
4237
4293
  onGetProfileDataSuccess: function onGetProfileDataSuccess(data) {
4238
4294
  fetchCart();
4239
4295
  _onGetProfileDataSuccess(data);
@@ -4265,7 +4321,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
4265
4321
  onClose: function onClose() {
4266
4322
  setShowModalForgotPassword(false);
4267
4323
  },
4268
- onLogin: function onLogin() {
4324
+ onLoginButtonClick: function onLoginButtonClick() {
4269
4325
  setShowModalForgotPassword(false);
4270
4326
  setShowModalLogin(true);
4271
4327
  },
@@ -5183,6 +5239,52 @@ var PaymentContainer = function PaymentContainer(_ref) {
5183
5239
  }) : isFreeTickets ? 'Complete Registration' : 'Confirm Payment Plan')))));
5184
5240
  };
5185
5241
 
5242
+ var isValidNumber = function isValidNumber(value) {
5243
+ if (isNaN(Number(value))) {
5244
+ return false;
5245
+ }
5246
+ return _isNumber(Number(value));
5247
+ };
5248
+
5249
+ var getImage = function getImage(name) {
5250
+ if (name === void 0) {
5251
+ name = '';
5252
+ }
5253
+ var image = '';
5254
+ if (!name.trim().length) {
5255
+ return image;
5256
+ }
5257
+ if (process.env.NODE_ENV === 'production') {
5258
+ image = require("./images/" + name);
5259
+ return image["default"];
5260
+ }
5261
+ return image;
5262
+ };
5263
+
5264
+ var SpotifyIcon = function SpotifyIcon() {
5265
+ return React.createElement(SVG, {
5266
+ src: getImage('spotify.svg')
5267
+ });
5268
+ };
5269
+ var InstagramIcon = function InstagramIcon() {
5270
+ return React.createElement(SVG, {
5271
+ src: getImage('instagram.svg')
5272
+ });
5273
+ };
5274
+ var SocialButton = function SocialButton(props) {
5275
+ var children = props.children,
5276
+ url = props.url,
5277
+ disabled = props.disabled;
5278
+ var handleClick = function handleClick() {
5279
+ window.open(url);
5280
+ };
5281
+ return React.createElement("button", {
5282
+ className: "react-share__ShareButton " + (disabled ? 'disabled-action' : ''),
5283
+ type: "button",
5284
+ onClick: !disabled ? handleClick : _identity
5285
+ }, children);
5286
+ };
5287
+
5186
5288
  var config = {
5187
5289
  facebook: {
5188
5290
  component: FacebookShareButton,
@@ -5267,6 +5369,14 @@ var config = {
5267
5369
  hatena: {
5268
5370
  component: HatenaShareButton,
5269
5371
  icon: HatenaIcon
5372
+ },
5373
+ instagram: {
5374
+ component: SocialButton,
5375
+ icon: InstagramIcon
5376
+ },
5377
+ spotify: {
5378
+ component: SocialButton,
5379
+ icon: SpotifyIcon
5270
5380
  }
5271
5381
  };
5272
5382
  function config$1 (key) {
@@ -5278,11 +5388,20 @@ var SocialComponent = function SocialComponent(_ref) {
5278
5388
  var mainLabel = _ref.mainLabel,
5279
5389
  subLabel = _ref.subLabel,
5280
5390
  platform = _ref.platform,
5281
- shareData = _ref.shareData;
5391
+ shareData = _ref.shareData,
5392
+ points = _ref.points,
5393
+ onAfterShare = _ref.onAfterShare,
5394
+ alreadyApplied = _ref.alreadyApplied,
5395
+ oneTimeAction = _ref.oneTimeAction;
5282
5396
  var Component = (_config = config$1(platform)) == null ? void 0 : _config.component;
5283
5397
  var Icon = (_config2 = config$1(platform)) == null ? void 0 : _config2.icon;
5284
- return React.createElement(React.Fragment, null, Component && React.createElement(Component, Object.assign({}, shareData), React.createElement("div", {
5285
- className: "social-media-sharing"
5398
+ var isActionDisabled = alreadyApplied && oneTimeAction;
5399
+ return React.createElement(React.Fragment, null, Component && React.createElement(Component, Object.assign({}, shareData, {
5400
+ disabled: isActionDisabled
5401
+ }), React.createElement("div", {
5402
+ onKeyDown: _identity,
5403
+ onClick: !isActionDisabled ? onAfterShare : _identity,
5404
+ className: "social-media-sharing " + platform
5286
5405
  }, React.createElement("div", {
5287
5406
  className: "share-icon"
5288
5407
  }, React.createElement(Icon, {
@@ -5290,7 +5409,17 @@ var SocialComponent = function SocialComponent(_ref) {
5290
5409
  round: true
5291
5410
  })), React.createElement("span", {
5292
5411
  className: "share-text"
5293
- }, mainLabel, React.createElement("br", null), " ", subLabel))));
5412
+ }, React.createElement("span", {
5413
+ className: "main-label"
5414
+ }, mainLabel, " "), React.createElement("span", {
5415
+ className: "sub-label"
5416
+ }, subLabel)), isValidNumber(points) && React.createElement("div", {
5417
+ className: "share-points"
5418
+ }, React.createElement("span", {
5419
+ className: "points-count"
5420
+ }, points), React.createElement("span", {
5421
+ className: "points-text"
5422
+ }, "Points")))));
5294
5423
  };
5295
5424
  var SocialButtons = function SocialButtons(_ref2) {
5296
5425
  var showDefaultShareButtons = _ref2.showDefaultShareButtons,
@@ -5298,11 +5427,18 @@ var SocialButtons = function SocialButtons(_ref2) {
5298
5427
  name = _ref2.name,
5299
5428
  appId = _ref2.appId,
5300
5429
  shareButtons = _ref2.shareButtons,
5430
+ _ref2$titleText = _ref2.titleText,
5431
+ titleText = _ref2$titleText === void 0 ? 'or use one of these convenient buttons:' : _ref2$titleText,
5432
+ _ref2$footerText = _ref2.footerText,
5433
+ footerText = _ref2$footerText === void 0 ? React.createElement("p", null, "We ", React.createElement("strong", null, "never"), " post on Facebook without your permission!") : _ref2$footerText,
5301
5434
  clientLabel = _ref2.clientLabel,
5302
- showReferralsInfoText = _ref2.showReferralsInfoText;
5303
- return React.createElement(React.Fragment, null, React.createElement("div", {
5435
+ _ref2$onAfterShare = _ref2.onAfterShare,
5436
+ _onAfterShare = _ref2$onAfterShare === void 0 ? _identity : _ref2$onAfterShare,
5437
+ _ref2$showReferralsIn = _ref2.showReferralsInfoText,
5438
+ showReferralsInfoText = _ref2$showReferralsIn === void 0 ? false : _ref2$showReferralsIn;
5439
+ return React.createElement(React.Fragment, null, titleText && React.createElement("div", {
5304
5440
  className: "convenient_buttons"
5305
- }, "or use one of these convenient buttons:"), React.createElement("div", {
5441
+ }, titleText), React.createElement("div", {
5306
5442
  className: "social-media-btns"
5307
5443
  }, showDefaultShareButtons && React.createElement(React.Fragment, null, React.createElement(SocialComponent, {
5308
5444
  mainLabel: "Share on",
@@ -5338,9 +5474,12 @@ var SocialButtons = function SocialButtons(_ref2) {
5338
5474
  }
5339
5475
  })), shareButtons.map(function (shareButton, index) {
5340
5476
  return React.createElement(SocialComponent, Object.assign({
5477
+ onAfterShare: function onAfterShare() {
5478
+ return _onAfterShare(shareButton.eventActionId);
5479
+ },
5341
5480
  key: index
5342
5481
  }, shareButton));
5343
- })), (showDefaultShareButtons || shareButtons.length) && React.createElement("p", null, "We ", React.createElement("strong", null, "never"), " post on Facebook without your permission!"), (showReferralsInfoText || Boolean(clientLabel)) && React.createElement("p", {
5482
+ })), showDefaultShareButtons || shareButtons.length ? footerText : null, (showReferralsInfoText || Boolean(clientLabel)) && React.createElement("p", {
5344
5483
  className: "note-message"
5345
5484
  }, React.createElement("span", null, "*Please note, only purchases made from a different", ' ', clientLabel || 'Ticket Fairy', " account can count towards your referrals"), React.createElement("span", null, ' ', "so please make sure you ask your friends to buy their own tickets using their own ", clientLabel || 'Ticket Fairy', " account!")));
5346
5485
  };
@@ -5420,7 +5559,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
5420
5559
  case 12:
5421
5560
  _context.prev = 12;
5422
5561
  _context.t0 = _context["catch"](1);
5423
- onGetConfirmationDataError(_context.t0.response);
5562
+ if (axios.isAxiosError(_context.t0)) onGetConfirmationDataError(_context.t0);
5424
5563
  case 15:
5425
5564
  case "end":
5426
5565
  return _context.stop();
@@ -5460,23 +5599,10 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
5460
5599
  });
5461
5600
  return React.createElement("div", {
5462
5601
  className: "confirmation-page"
5463
- }, showCopyInfoModal && React.createElement(Modal$2, {
5464
- open: showCopyModal,
5602
+ }, showCopyInfoModal && React.createElement(CopyMessageModal, {
5465
5603
  onClose: onClose,
5466
- "aria-labelledby": "modal-modal-title",
5467
- "aria-describedby": "modal-modal-description",
5468
- className: "success-copy-modal"
5469
- }, React.createElement("div", {
5470
- className: "message-copy-success-box"
5471
- }, React.createElement("div", {
5472
- className: "message-copy-success"
5473
- }, React.createElement("span", null, "Copied to your clipboard! Now paste your link in a Snapchat message,"), React.createElement("span", null, "your Instagram bio, Whatsapp, Facebook or a text :)")), React.createElement("div", {
5474
- className: "footer"
5475
- }, React.createElement("button", {
5476
- className: "footer-button",
5477
- type: "button",
5478
- onClick: onClose
5479
- }, "OK")))), data && React.createElement(React.Fragment, null, React.createElement("div", {
5604
+ showCopyModal: showCopyModal
5605
+ }), data && React.createElement(React.Fragment, null, React.createElement("div", {
5480
5606
  className: "header-container"
5481
5607
  }, React.createElement("div", {
5482
5608
  className: "header-product-image"
@@ -5586,16 +5712,89 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
5586
5712
  }, "^ This is based on the most expensive ticket in your order."))))));
5587
5713
  };
5588
5714
 
5589
- var X_TF_ECOMMERCE = 'X-TF-ECOMMERCE';
5590
-
5591
- var useCookieListener = function useCookieListener(key, handler) {
5592
- var getCookie = function getCookie() {
5593
- return getCookieByName(key);
5715
+ var getPreRegistrationInfluancers = /*#__PURE__*/function () {
5716
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
5717
+ var response;
5718
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
5719
+ while (1) switch (_context.prev = _context.next) {
5720
+ case 0:
5721
+ _context.next = 2;
5722
+ return publicRequest.get("v1/event/" + data.eventId + "/pre-registration/influencers");
5723
+ case 2:
5724
+ response = _context.sent;
5725
+ return _context.abrupt("return", response.data);
5726
+ case 4:
5727
+ case "end":
5728
+ return _context.stop();
5729
+ }
5730
+ }, _callee);
5731
+ }));
5732
+ return function getPreRegistrationInfluancers(_x) {
5733
+ return _ref.apply(this, arguments);
5594
5734
  };
5595
- var _useState = useState(),
5596
- intervalValue = _useState[0],
5597
- setIntervalValue = _useState[1];
5598
- var cookieRef = useRef(getCookie());
5735
+ }();
5736
+ var getPreRegistrationShareOptions = /*#__PURE__*/function () {
5737
+ var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {
5738
+ var response;
5739
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
5740
+ while (1) switch (_context2.prev = _context2.next) {
5741
+ case 0:
5742
+ _context2.next = 2;
5743
+ return publicRequest.get("/v1/pre-registration/" + data.hash + "/confirmation-page");
5744
+ case 2:
5745
+ response = _context2.sent;
5746
+ return _context2.abrupt("return", response.data);
5747
+ case 4:
5748
+ case "end":
5749
+ return _context2.stop();
5750
+ }
5751
+ }, _callee2);
5752
+ }));
5753
+ return function getPreRegistrationShareOptions(_x2) {
5754
+ return _ref2.apply(this, arguments);
5755
+ };
5756
+ }();
5757
+ var submitShareAction = /*#__PURE__*/function () {
5758
+ var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
5759
+ var eventActionId, accessToken, hash, response;
5760
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
5761
+ while (1) switch (_context3.prev = _context3.next) {
5762
+ case 0:
5763
+ eventActionId = data.eventActionId, accessToken = data.accessToken, hash = data.hash;
5764
+ _context3.next = 3;
5765
+ return publicRequest.post("/v1/pre-registration/" + hash + "/submit-action", {
5766
+ data: {
5767
+ attributes: {
5768
+ phase: 'pre-registration',
5769
+ eventActionId: Number(eventActionId),
5770
+ accessToken: accessToken
5771
+ }
5772
+ }
5773
+ });
5774
+ case 3:
5775
+ response = _context3.sent;
5776
+ return _context3.abrupt("return", response.data);
5777
+ case 5:
5778
+ case "end":
5779
+ return _context3.stop();
5780
+ }
5781
+ }, _callee3);
5782
+ }));
5783
+ return function submitShareAction(_x3) {
5784
+ return _ref3.apply(this, arguments);
5785
+ };
5786
+ }();
5787
+
5788
+ var X_TF_ECOMMERCE = 'X-TF-ECOMMERCE';
5789
+
5790
+ var useCookieListener = function useCookieListener(key, handler) {
5791
+ var getCookie = function getCookie() {
5792
+ return getCookieByName(key);
5793
+ };
5794
+ var _useState = useState(),
5795
+ intervalValue = _useState[0],
5796
+ setIntervalValue = _useState[1];
5797
+ var cookieRef = useRef(getCookie());
5599
5798
  var handleCookieChange = function handleCookieChange() {
5600
5799
  var currentCookie = getCookie();
5601
5800
  var prevCookie = cookieRef.current;
@@ -5614,6 +5813,26 @@ var useCookieListener = function useCookieListener(key, handler) {
5614
5813
  }, []);
5615
5814
  };
5616
5815
 
5816
+ function useLocalStorageListener(key, callback) {
5817
+ var isWindowDefined = typeof window !== 'undefined';
5818
+ var _useState = useState(isWindowDefined ? localStorage.getItem(key) : ''),
5819
+ value = _useState[0],
5820
+ setValue = _useState[1];
5821
+ useEffect(function () {
5822
+ var intervalId = setInterval(function () {
5823
+ var newValue = localStorage.getItem(key);
5824
+ if (newValue !== value) {
5825
+ setValue(newValue);
5826
+ callback(JSON.parse(newValue || ''));
5827
+ }
5828
+ }, 100);
5829
+ return function () {
5830
+ clearInterval(intervalId);
5831
+ };
5832
+ }, [key, value, callback]);
5833
+ return value;
5834
+ }
5835
+
5617
5836
  var style$4 = {
5618
5837
  position: 'absolute',
5619
5838
  top: '50%',
@@ -5987,7 +6206,7 @@ var ReferralLogic = function ReferralLogic(props) {
5987
6206
  var isWindowDefined = typeof window !== 'undefined';
5988
6207
  if (isWindowDefined) {
5989
6208
  var params = new URL("" + window.location).searchParams;
5990
- var referralId = params.get('ttf_r') || '';
6209
+ var referralId = params.get('ttf_r') || params.get('referrer_id') || '';
5991
6210
  var referralValue = [eventId, '.', referralId].join('');
5992
6211
  var isAlreadyCounted = localStorage.getItem('referral_key') === referralValue;
5993
6212
  if (referralId && eventId && !isAlreadyCounted) {
@@ -6031,7 +6250,7 @@ var getTicketSelectOptions = function getTicketSelectOptions(maxCount, minCount,
6031
6250
  label: 0,
6032
6251
  value: 0
6033
6252
  }];
6034
- for (var i = minCount; i <= Math.min(50, maxCount); i += multiplier) {
6253
+ for (var i = minCount || 1; i <= Math.min(50, maxCount); i += multiplier) {
6035
6254
  options.push({
6036
6255
  label: i,
6037
6256
  value: i
@@ -6039,16 +6258,42 @@ var getTicketSelectOptions = function getTicketSelectOptions(maxCount, minCount,
6039
6258
  }
6040
6259
  return options;
6041
6260
  };
6261
+ var defineIsSalesClosed = function defineIsSalesClosed(eventDatesInfo) {
6262
+ var salesStarted = eventDatesInfo.salesStarted,
6263
+ salesEnded = eventDatesInfo.salesEnded,
6264
+ presalesStarted = eventDatesInfo.presalesStarted,
6265
+ presalesEnded = eventDatesInfo.presalesEnded,
6266
+ presalesEnabled = eventDatesInfo.presalesEnabled;
6267
+ var isSalesClosed = false;
6268
+ if (!salesStarted || salesStarted && salesEnded) {
6269
+ isSalesClosed = true;
6270
+ }
6271
+ if (presalesEnabled) {
6272
+ if (!presalesStarted && !presalesEnded || presalesStarted && presalesEnded && !salesStarted) {
6273
+ isSalesClosed = true;
6274
+ } else {
6275
+ isSalesClosed = false;
6276
+ }
6277
+ }
6278
+ return isSalesClosed;
6279
+ };
6042
6280
 
6043
6281
  var TicketRow = function TicketRow(_ref) {
6044
6282
  var ticketTier = _ref.ticketTier,
6045
6283
  prevTicketTier = _ref.prevTicketTier,
6046
6284
  selectedTickets = _ref.selectedTickets,
6047
6285
  handleTicketSelect = _ref.handleTicketSelect,
6286
+ event = _ref.event,
6048
6287
  isSeatMapAllowed = _ref.isSeatMapAllowed,
6049
6288
  tableType = _ref.tableType;
6050
6289
  var soldOutMessage = ticketTier.soldOutMessage ? ("" + ticketTier.soldOutMessage).toUpperCase() : 'SOLD OUT';
6051
- var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded;
6290
+ var isSalesClosed = defineIsSalesClosed({
6291
+ salesStarted: ticketTier.salesStarted,
6292
+ salesEnded: ticketTier.salesEnded,
6293
+ presalesStarted: event == null ? void 0 : event.presalesStarted,
6294
+ presalesEnded: event == null ? void 0 : event.presalesEnded,
6295
+ presalesEnabled: event == null ? void 0 : event.presales_enabled
6296
+ });
6052
6297
  var maxCount = tableType ? ticketTier.maxGuests : ticketTier.maxQuantity;
6053
6298
  var minCount = tableType ? ticketTier.minGuests : ticketTier.minQuantity;
6054
6299
  var multiplier = ticketTier.multiplier;
@@ -6096,7 +6341,7 @@ var TicketRow = function TicketRow(_ref) {
6096
6341
  } else if (canPurchaseTicket && isSeatMapAllowed && !isDirectPurchaseAllowed) {
6097
6342
  // Seat Map Tickets renderer logic
6098
6343
  returnValue = null;
6099
- } else if (canPurchaseTicket) {
6344
+ } else if (canPurchaseTicket || canPurchaseTicket && event != null && event.presalesStarted && !(event != null && event.presalesEnded)) {
6100
6345
  returnValue = onSaleContent;
6101
6346
  } else if (_get(prevTicketTier, 'in_stock')) {
6102
6347
  returnValue = 'SOON';
@@ -6170,7 +6415,8 @@ var TicketsSection = function TicketsSection(_ref) {
6170
6415
  ticketTier: ticket,
6171
6416
  prevTicketTier: arr[i - 1],
6172
6417
  selectedTickets: selectedTickets,
6173
- handleTicketSelect: ticketSelect
6418
+ handleTicketSelect: ticketSelect,
6419
+ event: event
6174
6420
  })))));
6175
6421
  }), !hideTableTicketsHeader && tableTicketsHeaderComponent, tableTickets.map(function (ticket, i, arr) {
6176
6422
  var _arr2;
@@ -6219,7 +6465,8 @@ var TicketsSection = function TicketsSection(_ref) {
6219
6465
  prevTicketTier: arr[i - 1],
6220
6466
  selectedTickets: selectedTickets,
6221
6467
  handleTicketSelect: ticketSelect,
6222
- isSeatMapAllowed: isSeatMapAllowed
6468
+ isSeatMapAllowed: isSeatMapAllowed,
6469
+ event: event
6223
6470
  }))))));
6224
6471
  }));
6225
6472
  };
@@ -6300,6 +6547,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
6300
6547
  var _useState = useState({}),
6301
6548
  selectedTickets = _useState[0],
6302
6549
  setSelectedTickets = _useState[1];
6550
+ var isWindowDefined = typeof window !== 'undefined';
6303
6551
  var _useState2 = useState(Boolean(getCookieByName(X_TF_ECOMMERCE))),
6304
6552
  isLogged = _useState2[0],
6305
6553
  setIsLogged = _useState2[1];
@@ -6354,16 +6602,31 @@ var TicketsContainer = function TicketsContainer(_ref) {
6354
6602
  var _useState19 = useState(),
6355
6603
  pendingVerificationMessage = _useState19[0],
6356
6604
  setPendingVerificationMessage = _useState19[1];
6605
+ var _useState20 = useState([]),
6606
+ preregistereds = _useState20[0],
6607
+ setPreregistereds = _useState20[1];
6608
+ var _useState21 = useState(false),
6609
+ ticketsNotAvailableModalOpen = _useState21[0],
6610
+ setTicketsNotAvailableModalOpen = _useState21[1];
6611
+ var _useState22 = useState(checkUserPreregistration()),
6612
+ isPreregistred = _useState22[0],
6613
+ setIsPreregisred = _useState22[1];
6357
6614
  var ticketsContainerRef = useRef(null);
6358
6615
  var pageUrl = isBrowser ? window.location.href.split('?')[0] : '';
6359
6616
  useCookieListener(X_TF_ECOMMERCE, function (value) {
6360
6617
  return setIsLogged(Boolean(value));
6361
6618
  });
6619
+ useLocalStorageListener('user_data', function (user) {
6620
+ var isPreregistredUser = _some(preregistereds, function (item) {
6621
+ return item.email === (user == null ? void 0 : user.email);
6622
+ });
6623
+ setIsPreregisred(isPreregistredUser);
6624
+ });
6362
6625
  usePixel(eventId, {
6363
6626
  pageUrl: pageUrl
6364
6627
  });
6365
6628
  useEffect(function () {
6366
- if (typeof window !== 'undefined') {
6629
+ if (isWindowDefined) {
6367
6630
  var access_token = window.localStorage.getItem('access_token');
6368
6631
  if (access_token) {
6369
6632
  var decoded = jwt_decode(access_token);
@@ -6376,8 +6639,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
6376
6639
  }
6377
6640
  }, []);
6378
6641
  useEffect(function () {
6379
- !!eventId && getTicketsApi();
6642
+ if (eventId) {
6643
+ getTicketsApi();
6644
+ fetchPreregisteredsData();
6645
+ }
6380
6646
  }, [eventId]);
6647
+ useEffect(function () {
6648
+ setIsPreregisred(checkUserPreregistration());
6649
+ }, [preregistereds]);
6381
6650
  useEffect(function () {
6382
6651
  if (isLogged) {
6383
6652
  fetchUserData().then(function (res) {
@@ -6498,6 +6767,39 @@ var TicketsContainer = function TicketsContainer(_ref) {
6498
6767
  }));
6499
6768
  return _getTicketsApi.apply(this, arguments);
6500
6769
  }
6770
+ function fetchPreregisteredsData() {
6771
+ return _fetchPreregisteredsData.apply(this, arguments);
6772
+ }
6773
+ function _fetchPreregisteredsData() {
6774
+ _fetchPreregisteredsData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
6775
+ var preregistrationData;
6776
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
6777
+ while (1) switch (_context5.prev = _context5.next) {
6778
+ case 0:
6779
+ _context5.prev = 0;
6780
+ _context5.next = 3;
6781
+ return getPreRegistrationInfluancers({
6782
+ eventId: eventId
6783
+ });
6784
+ case 3:
6785
+ preregistrationData = _context5.sent;
6786
+ setPreregistereds(preregistrationData.data.attributes.influencers);
6787
+ _context5.next = 10;
6788
+ break;
6789
+ case 7:
6790
+ _context5.prev = 7;
6791
+ _context5.t0 = _context5["catch"](0);
6792
+ if (axios.isAxiosError(_context5.t0)) {
6793
+ setError(_get(_context5.t0, 'response.data.message'));
6794
+ }
6795
+ case 10:
6796
+ case "end":
6797
+ return _context5.stop();
6798
+ }
6799
+ }, _callee5, null, [[0, 7]]);
6800
+ }));
6801
+ return _fetchPreregisteredsData.apply(this, arguments);
6802
+ }
6501
6803
  var handleTicketSelect = function handleTicketSelect(key, value, isTable) {
6502
6804
  if (isTable === void 0) {
6503
6805
  isTable = false;
@@ -6510,6 +6812,17 @@ var TicketsContainer = function TicketsContainer(_ref) {
6510
6812
  return _ref3 = {}, _ref3[key] = value, _ref3.isTable = isTable, _ref3;
6511
6813
  });
6512
6814
  };
6815
+ function checkUserPreregistration() {
6816
+ var userDataString = isWindowDefined ? window.localStorage.getItem('user_data') : '';
6817
+ var isPreregistredUser = false;
6818
+ if (userDataString) {
6819
+ var user = JSON.parse(userDataString);
6820
+ isPreregistredUser = _some(preregistereds, function (item) {
6821
+ return item.email === (user == null ? void 0 : user.email);
6822
+ });
6823
+ }
6824
+ return isPreregistredUser;
6825
+ }
6513
6826
  var handleOrdersClick = function handleOrdersClick() {
6514
6827
  if (isBrowser) {
6515
6828
  window.location.href = ordersPath != null ? ordersPath : '/orders';
@@ -6693,7 +7006,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
6693
7006
  };
6694
7007
  }();
6695
7008
  var isTicketOnSale = _some(tickets, function (item) {
6696
- return item.salesStarted && !item.salesEnded && !item.soldOut;
7009
+ return (item.salesStarted || (event == null ? void 0 : event.presalesStarted)) && !item.salesEnded && !item.soldOut;
6697
7010
  });
6698
7011
  var eventHasTickets = !_isEmpty(tickets);
6699
7012
  var isSalesClosed = event == null ? void 0 : event.salesEnded;
@@ -6719,9 +7032,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
6719
7032
  }
6720
7033
  }
6721
7034
  };
7035
+ var handleNotAvailableTicketsClick = function handleNotAvailableTicketsClick() {
7036
+ if (!_isEmpty(selectedTickets)) {
7037
+ setTicketsNotAvailableModalOpen(true);
7038
+ }
7039
+ };
6722
7040
  var bookButtonIsDisabled = (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0) && !(event != null && event.flagSeatMapAllowed);
6723
7041
  var isTicketAvailable = _some(tickets, function (ticket) {
6724
- return ticket.displayTicket && !ticket.soldOut && ticket.salesStarted;
7042
+ return ticket.displayTicket && !ticket.soldOut && (ticket.salesStarted || (event == null ? void 0 : event.presalesStarted) && !(event != null && event.presalesEnded));
6725
7043
  });
6726
7044
  var wrappedActionsSectionComponent = React.isValidElement(ActionsSectionComponent) ? React.cloneElement(ActionsSectionComponent, {
6727
7045
  handleGetTicketClick: handleGetTicketClick,
@@ -6749,6 +7067,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
6749
7067
  var hideTopInfluencers = event == null ? void 0 : event.hideTopInfluencers;
6750
7068
  var isSeatMapAllowed = _get(event, 'seatMapAllowed', false);
6751
7069
  var isTableMapEnabled = _get(event, 'tableMapEnabled', false);
7070
+ var notAvailableTicketsMessage = "Tickets for this event are not available until " + moment(event == null ? void 0 : event.salesStart).format('dddd, DD MMMM YYYY') + ". \n If you pre-registered, log into your account first to buy your pre-sale ticket.";
6752
7071
  var tableTickets = _filter(tickets, function (ticket) {
6753
7072
  return ticket.isTable;
6754
7073
  });
@@ -6790,7 +7109,16 @@ var TicketsContainer = function TicketsContainer(_ref) {
6790
7109
  style: {
6791
7110
  width: '350px'
6792
7111
  }
6793
- }, error), isLoading ? React.createElement(Loader, null) : React.createElement("div", {
7112
+ }, error), ticketsNotAvailableModalOpen && React.createElement(ConfirmModal, {
7113
+ message: notAvailableTicketsMessage,
7114
+ hideCancelBtn: true,
7115
+ onClose: function onClose() {
7116
+ return _onClose('invalidLink');
7117
+ },
7118
+ onConfirm: function onConfirm() {
7119
+ return setTicketsNotAvailableModalOpen(false);
7120
+ }
7121
+ }), isLoading ? React.createElement(Loader, null) : React.createElement("div", {
6794
7122
  ref: ticketsContainerRef
6795
7123
  }, !isSalesClosed && React.createElement(TicketsSection, {
6796
7124
  event: event,
@@ -6840,7 +7168,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
6840
7168
  }) : null, wrappedActionsSectionComponent, canShowGetTicketBtn() && React.createElement(Button$1, {
6841
7169
  "aria-hidden": true,
6842
7170
  className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
6843
- onClick: handleGetTicketClick
7171
+ onClick: event != null && event.salesStart && event != null && event.presalesStarted && !(event != null && event.presalesEnded) && (!isPreregistred || !isLogged) ? handleNotAvailableTicketsClick : handleGetTicketClick
6844
7172
  }, selectedTickets.isTable ? 'RESERVE TABLES' : getTicketsLabel || 'GET TICKETS'), isSeatMapAllowed && !(event != null && event.salesEnded) && isTicketAvailable && React.createElement(Button$1, {
6845
7173
  className: "reserve-button",
6846
7174
  "aria-hidden": true,
@@ -8756,7 +9084,9 @@ var LoginForm = function LoginForm(_ref) {
8756
9084
  _ref$showForgotPasswo = _ref.showForgotPasswordButton,
8757
9085
  showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
8758
9086
  _ref$showSignUpButton = _ref.showSignUpButton,
8759
- showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton;
9087
+ showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
9088
+ _ref$showPoweredByIma = _ref.showPoweredByImage,
9089
+ showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
8760
9090
  var _useState = useState(''),
8761
9091
  error = _useState[0],
8762
9092
  setError = _useState[1];
@@ -8880,7 +9210,7 @@ var LoginForm = function LoginForm(_ref) {
8880
9210
  }, React.createElement("span", {
8881
9211
  "aria-hidden": "true",
8882
9212
  onClick: onSignupButtonClick
8883
- }, "Sign up"))));
9213
+ }, "Sign up")), showPoweredByImage ? React.createElement(PoweredBy, null) : null));
8884
9214
  }));
8885
9215
  };
8886
9216
 
@@ -11177,5 +11507,1027 @@ var RsvpContainer = function RsvpContainer(_ref) {
11177
11507
  }, "RSVP"))))))));
11178
11508
  };
11179
11509
 
11180
- export { AddonsContainter, BillingInfoContainer, ConfirmationContainer, DelegationsContainer, ForgotPasswordModal, IDVerification, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, PoweredBy, RedirectModal, ResetPasswordContainer, RsvpContainer, SeatMapContainer, TicketResaleContainer, TicketsContainer, VERIFICATION_STATUSES, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs, useCookieListener };
11510
+ var formFieldsNotLoggedIn = [{
11511
+ name: 'basic-info',
11512
+ groupLabel: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "If you want to enter your details manually, please type them below to create an account, then click on"), /*#__PURE__*/React.createElement("b", null, " Confirm Registration:")),
11513
+ groupLabelClassName: '',
11514
+ groupClassName: '',
11515
+ fields: [{
11516
+ className: 'half-width',
11517
+ name: 'firstName',
11518
+ label: 'First Name',
11519
+ type: 'text',
11520
+ required: true,
11521
+ onValidate: null
11522
+ }, {
11523
+ className: 'half-width',
11524
+ name: 'lastName',
11525
+ label: 'Last Name',
11526
+ type: 'text',
11527
+ required: true,
11528
+ onValidate: null
11529
+ }, {
11530
+ name: 'email',
11531
+ label: 'Email',
11532
+ type: 'email',
11533
+ required: true,
11534
+ onValidate: null
11535
+ }, {
11536
+ name: 'confirmEmail',
11537
+ label: 'Confirm Email',
11538
+ type: 'email',
11539
+ required: true,
11540
+ onValidate: null
11541
+ }]
11542
+ }, {
11543
+ name: 'billing-info',
11544
+ groupLabel: '',
11545
+ groupLabelClassName: '',
11546
+ groupClassName: '',
11547
+ fields: [{
11548
+ className: 'half-width',
11549
+ name: 'zip',
11550
+ label: 'Post Code/Zip',
11551
+ type: 'text',
11552
+ required: true,
11553
+ onValidate: null
11554
+ }, {
11555
+ className: 'half-width',
11556
+ name: 'country',
11557
+ label: 'Country',
11558
+ type: 'select',
11559
+ required: true,
11560
+ onValidate: null
11561
+ }]
11562
+ }, {
11563
+ name: 'password-info',
11564
+ groupLabel: /*#__PURE__*/React.createElement("div", {
11565
+ className: "email-info-block"
11566
+ }, /*#__PURE__*/React.createElement("span", null, "Choose a password for your new"), /*#__PURE__*/React.createElement("b", null, " Mana Common "), /*#__PURE__*/React.createElement("span", null, "account")),
11567
+ groupLabelClassName: '',
11568
+ groupClassName: '',
11569
+ fields: [{
11570
+ className: 'half-width',
11571
+ name: 'password',
11572
+ label: 'Password',
11573
+ type: 'password',
11574
+ required: true,
11575
+ onValidate: null
11576
+ }, {
11577
+ className: 'half-width',
11578
+ name: 'confirmPassword',
11579
+ label: 'Confirm Password',
11580
+ type: 'password',
11581
+ required: true,
11582
+ onValidate: null
11583
+ }]
11584
+ }];
11585
+ var formFieldsLoggedIn = [{
11586
+ name: 'basic-info-logged-in',
11587
+ groupLabel: 'To confirm your pre-registration for {event_name} simply click on the confirmation button below.',
11588
+ groupLabelClassName: '',
11589
+ groupClassName: '',
11590
+ fields: [{
11591
+ name: 'email',
11592
+ label: 'Email',
11593
+ type: 'email',
11594
+ required: true,
11595
+ onValidate: null
11596
+ }, {
11597
+ name: 'confirmEmail',
11598
+ label: 'Confirm Email',
11599
+ type: 'email',
11600
+ required: true,
11601
+ onValidate: null
11602
+ }]
11603
+ }, {
11604
+ name: 'billing-info-logged-in',
11605
+ groupLabel: '',
11606
+ groupLabelClassName: '',
11607
+ groupClassName: '',
11608
+ fields: [{
11609
+ name: 'numTickets',
11610
+ label: 'How many tickets do you want to buy?',
11611
+ type: 'select',
11612
+ required: true,
11613
+ options: /*#__PURE__*/new Array(10).fill(null).map(function (_, index) {
11614
+ return {
11615
+ label: index + 1,
11616
+ value: index + 1
11617
+ };
11618
+ }),
11619
+ onValidate: null
11620
+ }, {
11621
+ name: 'holderAge',
11622
+ label: 'Ticket Holder Age',
11623
+ type: 'date',
11624
+ required: true,
11625
+ onValidate: null
11626
+ }, {
11627
+ name: 'brandOptIn',
11628
+ label: 'I would like to be updated on Mana Common news, events and offers.',
11629
+ type: 'checkbox'
11630
+ }]
11631
+ }];
11632
+
11633
+ var getValidateFunctions$2 = function getValidateFunctions(_ref) {
11634
+ var element = _ref.element,
11635
+ values = _ref.values;
11636
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11637
+ var validationFunctions = [];
11638
+ if (element.required) {
11639
+ validationFunctions.push(requiredValidator);
11640
+ }
11641
+ if (element.onValidate) {
11642
+ validationFunctions.push(element.onValidate);
11643
+ }
11644
+ if (element.name === 'confirmEmail') {
11645
+ var isSameEmail = function isSameEmail(confirmEmail) {
11646
+ return values.email !== confirmEmail ? 'Please confirm your email address correctly' : null;
11647
+ };
11648
+ validationFunctions.push(isSameEmail);
11649
+ }
11650
+ if (element.name === 'confirmPassword') {
11651
+ var isSame = function isSame(confirmPassword) {
11652
+ return values.password !== confirmPassword ? 'Password confirmation does not match' : null;
11653
+ };
11654
+ validationFunctions.push(isSame);
11655
+ }
11656
+ return combineValidators.apply(void 0, validationFunctions);
11657
+ };
11658
+ var getFormInitialValues$1 = function getFormInitialValues(fieldsSections) {
11659
+ var initialValues = {};
11660
+ var isWindowDefined = typeof window !== 'undefined';
11661
+ var userData = JSON.parse(isWindowDefined ? window.localStorage.getItem('user_data') || '{}' : '{}');
11662
+ _forEach(fieldsSections, function (item) {
11663
+ _forEach(item.fields, function (fieldItem) {
11664
+ switch (fieldItem.name) {
11665
+ case 'country':
11666
+ case 'numTickets':
11667
+ initialValues[fieldItem.name] = 1;
11668
+ break;
11669
+ case 'brandOptIn':
11670
+ initialValues[fieldItem.name] = true;
11671
+ break;
11672
+ case 'confirmEmail':
11673
+ initialValues[fieldItem.name] = _get(userData, fieldItem.name) || _get(userData, 'email') || '';
11674
+ break;
11675
+ default:
11676
+ initialValues[fieldItem.name] = _get(userData, fieldItem.name) || '';
11677
+ break;
11678
+ }
11679
+ });
11680
+ });
11681
+ return initialValues;
11682
+ };
11683
+ var updateFormFieldsAttributes$1 = function updateFormFieldsAttributes(formFields, attributes) {
11684
+ if (attributes && !_isEmpty(attributes)) {
11685
+ var updatedFormFields = _map(formFields, function (fieldSection) {
11686
+ var fieldSectionAttributes = attributes[fieldSection.name] || {};
11687
+ var updatedFields = _map(fieldSection.fields, function (fieldItem) {
11688
+ var fieldItemAttributes = attributes[fieldItem.name] || {};
11689
+ return _extends({}, fieldItem, fieldItemAttributes);
11690
+ });
11691
+ return _extends({}, fieldSection, fieldSectionAttributes, {
11692
+ fields: updatedFields
11693
+ });
11694
+ });
11695
+ return updatedFormFields;
11696
+ }
11697
+ return formFields;
11698
+ };
11699
+ var shareOptionsAdapter = function shareOptionsAdapter(data, shareUrl) {
11700
+ var adaptedData = [];
11701
+ _forEach(data, function (option) {
11702
+ if (option.action !== 'shared_url') {
11703
+ var _split2 = _split(option.action, '_'),
11704
+ platform = _split2[0],
11705
+ method = _split2[1];
11706
+ var mainLabel = method ? method[0].toUpperCase() + method.substring(1) : 'Share';
11707
+ adaptedData.push({
11708
+ mainLabel: option.action === 'twitter' ? 'Tweet' : mainLabel + ' on',
11709
+ subLabel: option.action === 'twitter' ? ' to your followers' : platform[0].toUpperCase() + platform.substring(1),
11710
+ platform: platform,
11711
+ shareData: {
11712
+ quote: 'as',
11713
+ url: option.socialUrl || shareUrl
11714
+ },
11715
+ points: option.point,
11716
+ eventActionId: option.id,
11717
+ oneTimeAction: option.oneTimeAction,
11718
+ alreadyApplied: option.alreadyApplied
11719
+ });
11720
+ }
11721
+ });
11722
+ return adaptedData;
11723
+ };
11724
+ var getShuffleMethodByName = function getShuffleMethodByName(tokenShuffleMethod) {
11725
+ var reverseString = function reverseString(value) {
11726
+ return value.split('').reverse().join('');
11727
+ };
11728
+ var symmetricShuffleString = function symmetricShuffleString(value) {
11729
+ var lengthOfStr = value.length;
11730
+ var part1 = value.substring(0, lengthOfStr / 2);
11731
+ return value.substring(lengthOfStr / 2) + part1;
11732
+ };
11733
+ var shuffleEveryTwoSymbolsInString = function shuffleEveryTwoSymbolsInString(value) {
11734
+ var words = value.split('');
11735
+ var shuffledStr = '';
11736
+ for (var i = 0; i < words.length; i += 2) {
11737
+ shuffledStr = shuffledStr.concat(words[i + 1], words[i]);
11738
+ }
11739
+ return shuffledStr;
11740
+ };
11741
+ if (tokenShuffleMethod === 'reverse_string') {
11742
+ return reverseString;
11743
+ } else if (tokenShuffleMethod === 'symmetric_shuffle_string') {
11744
+ return symmetricShuffleString;
11745
+ } else if (tokenShuffleMethod === 'shuffle_every_two_symbols_in_string') return shuffleEveryTwoSymbolsInString;
11746
+ return _identity;
11747
+ };
11748
+
11749
+ var isDocumentDefined = typeof document !== 'undefined';
11750
+ var SectionContainer$1 = function SectionContainer(_ref) {
11751
+ var children = _ref.children,
11752
+ className = _ref.className;
11753
+ return React.createElement("div", {
11754
+ className: className
11755
+ }, children);
11756
+ };
11757
+ var insertHTML$1 = function insertHTML(elementId, text) {
11758
+ if (text === void 0) {
11759
+ text = '';
11760
+ }
11761
+ if (isDocumentDefined) {
11762
+ var elem = document && document.getElementById(elementId);
11763
+ if (!(elem != null && elem.childNodes.length)) {
11764
+ elem == null ? void 0 : elem.insertAdjacentHTML('afterbegin', text);
11765
+ }
11766
+ }
11767
+ return null;
11768
+ };
11769
+ var getFieldClassNames$1 = function getFieldClassNames(id, existingClassNames) {
11770
+ if (isDocumentDefined) {
11771
+ var _elem$parentElement;
11772
+ var elem = document && document.getElementById(id);
11773
+ if (((elem == null ? void 0 : (_elem$parentElement = elem.parentElement) == null ? void 0 : _elem$parentElement.clientWidth) || 0) < 375) {
11774
+ return existingClassNames + ' full-width';
11775
+ }
11776
+ }
11777
+ return existingClassNames;
11778
+ };
11779
+ var FieldsSection$1 = function FieldsSection(_ref2) {
11780
+ var _ref2$formFields = _ref2.formFields,
11781
+ formFields = _ref2$formFields === void 0 ? [] : _ref2$formFields,
11782
+ _ref2$countries = _ref2.countries,
11783
+ countries = _ref2$countries === void 0 ? [] : _ref2$countries,
11784
+ values = _ref2.values,
11785
+ setFieldValue = _ref2.setFieldValue,
11786
+ theme = _ref2.theme,
11787
+ _ref2$containerClass = _ref2.containerClass,
11788
+ containerClass = _ref2$containerClass === void 0 ? '' : _ref2$containerClass;
11789
+ return React.createElement(React.Fragment, null, _map(formFields, function (item, index) {
11790
+ var name = item.name,
11791
+ groupLabel = item.groupLabel,
11792
+ _item$groupLabelVars = item.groupLabelVars,
11793
+ groupLabelVars = _item$groupLabelVars === void 0 ? [] : _item$groupLabelVars,
11794
+ groupLabelClassName = item.groupLabelClassName,
11795
+ _item$groupClassName = item.groupClassName,
11796
+ groupClassName = _item$groupClassName === void 0 ? '' : _item$groupClassName,
11797
+ fields = item.fields;
11798
+ return React.createElement(SectionContainer$1, {
11799
+ key: name,
11800
+ className: groupClassName
11801
+ }, React.createElement("span", {
11802
+ id: "group_label_" + index,
11803
+ className: groupLabelClassName
11804
+ }, typeof groupLabel === 'string' ? insertHTML$1("group_label_" + index, replaceVarInString(groupLabel, groupLabelVars)) : groupLabel), React.createElement("div", {
11805
+ className: "fields-container " + groupClassName
11806
+ }, _map(fields, function (fieldData, fieldIndex) {
11807
+ var name = fieldData.name,
11808
+ label = fieldData.label,
11809
+ _fieldData$className = fieldData.className,
11810
+ className = _fieldData$className === void 0 ? 'full-width' : _fieldData$className,
11811
+ type = fieldData.type,
11812
+ component = fieldData.component,
11813
+ _fieldData$options = fieldData.options,
11814
+ options = _fieldData$options === void 0 ? [] : _fieldData$options;
11815
+ var id = name + "-" + fieldIndex;
11816
+ var classNames = containerClass + "-container__field " + className;
11817
+ return component || React.createElement("div", {
11818
+ key: name,
11819
+ id: id,
11820
+ className: getFieldClassNames$1(id, classNames)
11821
+ }, React.createElement(Field, {
11822
+ name: name,
11823
+ label: label,
11824
+ type: type,
11825
+ validate: getValidateFunctions$2({
11826
+ element: fieldData,
11827
+ values: values
11828
+ }),
11829
+ setFieldValue: setFieldValue,
11830
+ component: type === 'checkbox' ? CheckboxField : type === 'select' ? NativeSelectField : type === 'phone' ? PhoneNumberField : type === 'date' ? DatePickerField : CustomField,
11831
+ selectOptions: name === 'country' ? countries : options,
11832
+ theme: theme
11833
+ }));
11834
+ })));
11835
+ }));
11836
+ };
11837
+
11838
+ var X_TF_ECOMMERCE$2 = 'X-TF-ECOMMERCE';
11839
+ var isWindowDefined$1 = typeof window !== 'undefined';
11840
+ var PreRegistration = function PreRegistration(_ref) {
11841
+ var eventId = _ref.eventId,
11842
+ pFormFields = _ref.formFields,
11843
+ additionalFieldAttribute = _ref.additionalFieldAttribute,
11844
+ isPreregistrationStarted = _ref.isPreregistrationStarted,
11845
+ logo = _ref.logo,
11846
+ showForgotPasswordButton = _ref.showForgotPasswordButton,
11847
+ _ref$onLoginSuccess = _ref.onLoginSuccess,
11848
+ onLoginSuccess = _ref$onLoginSuccess === void 0 ? _identity : _ref$onLoginSuccess,
11849
+ _ref$onForgotPassword = _ref.onForgotPasswordSuccess,
11850
+ onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
11851
+ _ref$onForgotPassword2 = _ref.onForgotPasswordError,
11852
+ onForgotPasswordError = _ref$onForgotPassword2 === void 0 ? _identity : _ref$onForgotPassword2,
11853
+ _ref$onGetCountriesSu = _ref.onGetCountriesSuccess,
11854
+ onGetCountriesSuccess = _ref$onGetCountriesSu === void 0 ? _identity : _ref$onGetCountriesSu,
11855
+ _ref$onGetCountriesEr = _ref.onGetCountriesError,
11856
+ onGetCountriesError = _ref$onGetCountriesEr === void 0 ? _identity : _ref$onGetCountriesEr,
11857
+ _ref$onConfirmationSu = _ref.onConfirmationSuccess,
11858
+ onConfirmationSuccess = _ref$onConfirmationSu === void 0 ? _identity : _ref$onConfirmationSu,
11859
+ _ref$onConfirmationEr = _ref.onConfirmationError,
11860
+ onConfirmationError = _ref$onConfirmationEr === void 0 ? _identity : _ref$onConfirmationEr;
11861
+ var _useState = useState(''),
11862
+ error = _useState[0],
11863
+ setError = _useState[1];
11864
+ var _useState2 = useState(false),
11865
+ showModalLogin = _useState2[0],
11866
+ setShowModalLogin = _useState2[1];
11867
+ var _useState3 = useState(false),
11868
+ alreadyHasUser = _useState3[0],
11869
+ setAlreadyHasUser = _useState3[1];
11870
+ var _useState4 = useState(false),
11871
+ showModalForgotPassword = _useState4[0],
11872
+ setShowModalForgotPassword = _useState4[1];
11873
+ var _useState5 = useState([]),
11874
+ countries = _useState5[0],
11875
+ setCountries = _useState5[1];
11876
+ var _useState6 = useState(Boolean(getCookieByName(X_TF_ECOMMERCE$2))),
11877
+ isLoggedIn = _useState6[0],
11878
+ setIsLoggedIn = _useState6[1];
11879
+ var _useState7 = useState({
11880
+ show: false,
11881
+ message: ''
11882
+ }),
11883
+ confirmModalState = _useState7[0],
11884
+ setConfirmModalState = _useState7[1];
11885
+ useCookieListener(X_TF_ECOMMERCE$2, function (value) {
11886
+ return setIsLoggedIn(Boolean(value));
11887
+ });
11888
+ var formFields = updateFormFieldsAttributes$1(pFormFields || isLoggedIn ? formFieldsLoggedIn : formFieldsNotLoggedIn, additionalFieldAttribute);
11889
+ useEffect(function () {
11890
+ // fetch countries data
11891
+ var fetchCountries = /*#__PURE__*/function () {
11892
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11893
+ var res, _e$response, _e$response$data, _error;
11894
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11895
+ while (1) switch (_context.prev = _context.next) {
11896
+ case 0:
11897
+ _context.prev = 0;
11898
+ _context.next = 3;
11899
+ return getCountries();
11900
+ case 3:
11901
+ res = _context.sent;
11902
+ setCountries(_map(_get(res, 'data'), function (item) {
11903
+ return {
11904
+ label: item.name,
11905
+ value: Number(item.id)
11906
+ };
11907
+ }));
11908
+ onGetCountriesSuccess(res.data);
11909
+ _context.next = 11;
11910
+ break;
11911
+ case 8:
11912
+ _context.prev = 8;
11913
+ _context.t0 = _context["catch"](0);
11914
+ if (axios.isAxiosError(_context.t0)) {
11915
+ _error = (_context.t0 == null ? void 0 : (_e$response = _context.t0.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message) || 'Error';
11916
+ setError(_error);
11917
+ onGetCountriesError(_context.t0);
11918
+ }
11919
+ case 11:
11920
+ case "end":
11921
+ return _context.stop();
11922
+ }
11923
+ }, _callee, null, [[0, 8]]);
11924
+ }));
11925
+ return function fetchCountries() {
11926
+ return _ref2.apply(this, arguments);
11927
+ };
11928
+ }();
11929
+ fetchCountries();
11930
+ }, []);
11931
+ var hash = getQueryVariable('hash') || '';
11932
+ var referrerId = getQueryVariable('referrer_id') || '';
11933
+ return React.createElement("div", {
11934
+ className: "pre-registration-container"
11935
+ }, React.createElement(SnackbarAlert, {
11936
+ type: "error",
11937
+ isOpen: !!error,
11938
+ message: error || '',
11939
+ onClose: function onClose() {
11940
+ setError('');
11941
+ }
11942
+ }), confirmModalState.show && React.createElement(ConfirmModal, {
11943
+ hideCancelBtn: true,
11944
+ onConfirm: function onConfirm() {
11945
+ return setConfirmModalState({
11946
+ show: false,
11947
+ message: ''
11948
+ });
11949
+ },
11950
+ message: confirmModalState.message
11951
+ }), !isLoggedIn && React.createElement("div", {
11952
+ className: "account-actions-block"
11953
+ }, React.createElement("div", {
11954
+ className: "action-item"
11955
+ }, React.createElement("div", null, React.createElement("span", null, "Create (or log in to) your account, then click on Confirm Registration."), React.createElement("span", null, " If you have a"), React.createElement("b", null, " Mana Common "), React.createElement("span", null, "account and password already"))), React.createElement("div", {
11956
+ className: "action-item login-block"
11957
+ }, React.createElement("button", {
11958
+ className: "login-register-button",
11959
+ type: "button",
11960
+ onClick: function onClick() {
11961
+ setShowModalLogin(true);
11962
+ }
11963
+ }, "Login"))), showModalLogin && React.createElement(LoginModal, {
11964
+ logo: logo,
11965
+ onClose: function onClose() {
11966
+ setShowModalLogin(false);
11967
+ },
11968
+ onLogin: function onLogin(res) {
11969
+ setShowModalLogin(false);
11970
+ onLoginSuccess(res);
11971
+ },
11972
+ showForgotPasswordButton: showForgotPasswordButton,
11973
+ onForgotPassword: function onForgotPassword() {
11974
+ setShowModalLogin(false);
11975
+ setShowModalForgotPassword(true);
11976
+ },
11977
+ alreadyHasUser: alreadyHasUser
11978
+ }), showModalForgotPassword && React.createElement(ForgotPasswordModal, {
11979
+ onClose: function onClose() {
11980
+ setShowModalForgotPassword(false);
11981
+ },
11982
+ onLoginButtonClick: function onLoginButtonClick() {
11983
+ setShowModalForgotPassword(false);
11984
+ setShowModalLogin(true);
11985
+ },
11986
+ onForgotPasswordSuccess: onForgotPasswordSuccess,
11987
+ onForgotPasswordError: onForgotPasswordError
11988
+ }), React.createElement("h2", null, "Pre-Registration"), React.createElement(Formik, {
11989
+ initialValues: getFormInitialValues$1(formFields),
11990
+ enableReinitialize: true,
11991
+ onSubmit: function () {
11992
+ var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
11993
+ var updatedValues, holderAgeDate, confirmationData, bodyFormData, res, profileRes, _e$response2, _e$response2$data, _e$response2$data$mes, _e$response3, _e$response3$data, errorMessage, emailErrors, _e$response4, _e$response4$data;
11994
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11995
+ while (1) switch (_context2.prev = _context2.next) {
11996
+ case 0:
11997
+ _context2.prev = 0;
11998
+ if (!isLoggedIn) {
11999
+ _context2.next = 21;
12000
+ break;
12001
+ }
12002
+ if (!isPreregistrationStarted) {
12003
+ _context2.next = 18;
12004
+ break;
12005
+ }
12006
+ updatedValues = _extends({}, values);
12007
+ holderAgeDate = new Date(values.holderAge);
12008
+ updatedValues.dobDay = holderAgeDate.getDate();
12009
+ updatedValues.dobMonth = holderAgeDate.getMonth() + 1;
12010
+ updatedValues.dobYear = holderAgeDate.getFullYear();
12011
+ updatedValues.referrerId = referrerId;
12012
+ updatedValues.shareHash = hash;
12013
+ // remove date picker string value
12014
+ delete updatedValues.holderAge;
12015
+ _context2.next = 13;
12016
+ return confirmPreRegistration(eventId, updatedValues);
12017
+ case 13:
12018
+ confirmationData = _context2.sent;
12019
+ if (isWindowDefined$1) {
12020
+ window.localStorage.setItem('pre-registration-hash', _get(confirmationData, 'attributes.hash'));
12021
+ }
12022
+ onConfirmationSuccess(confirmationData);
12023
+ _context2.next = 19;
12024
+ break;
12025
+ case 18:
12026
+ setConfirmModalState({
12027
+ show: true,
12028
+ message: 'The preregistration has not started'
12029
+ });
12030
+ case 19:
12031
+ _context2.next = 41;
12032
+ break;
12033
+ case 21:
12034
+ bodyFormData = new FormData();
12035
+ bodyFormData.append('first_name', values.firstName);
12036
+ bodyFormData.append('last_name', values.lastName);
12037
+ bodyFormData.append('email', values.email);
12038
+ bodyFormData.append('confirm_email', values.confirmEmail);
12039
+ bodyFormData.append('zip', values.zip);
12040
+ bodyFormData.append('country', values.country);
12041
+ bodyFormData.append('password', values.password);
12042
+ bodyFormData.append('password_confirmation', values.confirmPassword);
12043
+ bodyFormData.append('client_id', CONFIGS.CLIENT_ID);
12044
+ bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET);
12045
+ bodyFormData.append('register_for', 'prereg');
12046
+ _context2.next = 35;
12047
+ return register(bodyFormData);
12048
+ case 35:
12049
+ res = _context2.sent;
12050
+ _context2.next = 38;
12051
+ return getProfileData();
12052
+ case 38:
12053
+ profileRes = _context2.sent;
12054
+ onLoginSuccess(res.data);
12055
+ if (isWindowDefined$1) {
12056
+ window.localStorage.setItem('user_data', JSON.stringify(_get(profileRes, 'data')));
12057
+ }
12058
+ case 41:
12059
+ _context2.next = 50;
12060
+ break;
12061
+ case 43:
12062
+ _context2.prev = 43;
12063
+ _context2.t0 = _context2["catch"](0);
12064
+ errorMessage = (_context2.t0 == null ? void 0 : _context2.t0.message) || 'Error';
12065
+ emailErrors = _context2.t0 == null ? void 0 : (_e$response2 = _context2.t0.response) == null ? void 0 : (_e$response2$data = _e$response2.data) == null ? void 0 : (_e$response2$data$mes = _e$response2$data.message) == null ? void 0 : _e$response2$data$mes.email;
12066
+ if (typeof (_context2.t0 == null ? void 0 : (_e$response3 = _context2.t0.response) == null ? void 0 : (_e$response3$data = _e$response3.data) == null ? void 0 : _e$response3$data.message) === 'string') {
12067
+ errorMessage = _context2.t0 == null ? void 0 : (_e$response4 = _context2.t0.response) == null ? void 0 : (_e$response4$data = _e$response4.data) == null ? void 0 : _e$response4$data.message;
12068
+ }
12069
+ if ((emailErrors == null ? void 0 : emailErrors.length) > 0) {
12070
+ if (emailErrors[0] === 'The email is already used') {
12071
+ setShowModalLogin(true);
12072
+ setAlreadyHasUser(true);
12073
+ }
12074
+ } else {
12075
+ setError(errorMessage);
12076
+ }
12077
+ onConfirmationError(_context2.t0);
12078
+ case 50:
12079
+ case "end":
12080
+ return _context2.stop();
12081
+ }
12082
+ }, _callee2, null, [[0, 43]]);
12083
+ }));
12084
+ function onSubmit(_x) {
12085
+ return _onSubmit.apply(this, arguments);
12086
+ }
12087
+ return onSubmit;
12088
+ }()
12089
+ }, function (props) {
12090
+ return React.createElement(Form, null, React.createElement("div", {
12091
+ className: "login-modal-body"
12092
+ }, React.createElement(FieldsSection$1, {
12093
+ formFields: formFields,
12094
+ values: props.values,
12095
+ setFieldValue: props.setFieldValue,
12096
+ containerClass: "pre-registration",
12097
+ countries: countries
12098
+ })), React.createElement("div", {
12099
+ className: "button-container"
12100
+ }, React.createElement(Button$2, {
12101
+ type: "submit",
12102
+ variant: "contained",
12103
+ className: "login-register-button",
12104
+ disabled: props.isSubmitting
12105
+ }, props.isSubmitting ? React.createElement(CircularProgress, {
12106
+ size: 26
12107
+ }) : isLoggedIn ? 'Confirm Pre-Registration' : 'Create Account')));
12108
+ }));
12109
+ };
12110
+
12111
+ var Prewards = function Prewards(props) {
12112
+ var data = props.data,
12113
+ _props$classNamePrefi = props.classNamePrefix,
12114
+ classNamePrefix = _props$classNamePrefi === void 0 ? '' : _props$classNamePrefi,
12115
+ _props$headerNode = props.headerNode,
12116
+ headerNode = _props$headerNode === void 0 ? React.createElement(React.Fragment, null, "PRE", React.createElement("span", null, "WARDS\u2122")) : _props$headerNode;
12117
+ return React.createElement("div", {
12118
+ className: classNamePrefix + "_prewards"
12119
+ }, !_isEmpty(data) && React.createElement("div", {
12120
+ className: classNamePrefix + "_prewards_heder"
12121
+ }, headerNode), React.createElement("div", {
12122
+ className: classNamePrefix + "_prizes"
12123
+ }, _map(data, function (prize) {
12124
+ var description = prize.description,
12125
+ name = prize.name,
12126
+ image = prize.image,
12127
+ id = prize.id;
12128
+ return React.createElement("div", {
12129
+ className: classNamePrefix + "_prize",
12130
+ key: id
12131
+ }, image && React.createElement("img", {
12132
+ className: classNamePrefix + "_image",
12133
+ alt: "",
12134
+ src: image
12135
+ }), React.createElement("div", {
12136
+ className: classNamePrefix + "_info"
12137
+ }, React.createElement("h4", {
12138
+ className: classNamePrefix + "_name"
12139
+ }, name), description && React.createElement("article", {
12140
+ className: classNamePrefix + "_description"
12141
+ }, description)));
12142
+ })));
12143
+ };
12144
+
12145
+ var CopyField = function CopyField(props) {
12146
+ var copyValue = props.copyValue,
12147
+ _props$copyIconSrc = props.copyIconSrc,
12148
+ copyIconSrc = _props$copyIconSrc === void 0 ? 'https://img.icons8.com/office/50/000000/copy.png' : _props$copyIconSrc,
12149
+ _props$copyTitle = props.copyTitle,
12150
+ copyTitle = _props$copyTitle === void 0 ? 'Copy' : _props$copyTitle,
12151
+ _props$hasCopyIcon = props.hasCopyIcon,
12152
+ hasCopyIcon = _props$hasCopyIcon === void 0 ? false : _props$hasCopyIcon,
12153
+ _props$onLinkCopied = props.onLinkCopied,
12154
+ onLinkCopied = _props$onLinkCopied === void 0 ? _identity : _props$onLinkCopied,
12155
+ _props$classNamePrefi = props.classNamePrefix,
12156
+ classNamePrefix = _props$classNamePrefi === void 0 ? '' : _props$classNamePrefi,
12157
+ _props$messageText = props.messageText,
12158
+ messageText = _props$messageText === void 0 ? '' : _props$messageText;
12159
+ var inputRef = useRef(null);
12160
+ return React.createElement(React.Fragment, null, messageText && React.createElement("span", {
12161
+ className: "message-text"
12162
+ }, messageText), React.createElement("input", {
12163
+ ref: inputRef,
12164
+ className: classNamePrefix + "_share-input",
12165
+ defaultValue: copyValue,
12166
+ readOnly: true
12167
+ }), React.createElement("div", {
12168
+ className: classNamePrefix + "_share-by-link-copy-icon",
12169
+ "aria-hidden": true,
12170
+ onClick: function onClick() {
12171
+ navigator.clipboard.writeText(_get(inputRef, 'current.value'));
12172
+ onLinkCopied();
12173
+ }
12174
+ }, hasCopyIcon ? React.createElement("img", {
12175
+ src: copyIconSrc,
12176
+ alt: "copy"
12177
+ }) : React.createElement("span", {
12178
+ className: classNamePrefix + "_copy-icon"
12179
+ }, copyTitle)));
12180
+ };
12181
+
12182
+ var ShareOptions = function ShareOptions(props) {
12183
+ var classNamePrefix = props.classNamePrefix,
12184
+ data = props.data,
12185
+ _props$hasCopyIcon = props.hasCopyIcon,
12186
+ hasCopyIcon = _props$hasCopyIcon === void 0 ? true : _props$hasCopyIcon,
12187
+ _props$onLinkCopied = props.onLinkCopied,
12188
+ onLinkCopied = _props$onLinkCopied === void 0 ? _identity : _props$onLinkCopied,
12189
+ _props$headerText = props.headerText,
12190
+ headerText = _props$headerText === void 0 ? 'Share with your friends here ...' : _props$headerText,
12191
+ hash = props.hash,
12192
+ updateShareActionData = props.updateShareActionData,
12193
+ shareActionData = props.shareActionData;
12194
+ var _data$attributes = data.attributes,
12195
+ actions = _data$attributes.actions,
12196
+ shareUrl = _data$attributes.shareUrl;
12197
+ var shareButtons = shareOptionsAdapter(actions, shareUrl);
12198
+ var isShareLinkEnabled = _some(actions, function (item) {
12199
+ return item.action === 'shared_url';
12200
+ });
12201
+ var _onAfterShare = /*#__PURE__*/function () {
12202
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(eventActionId) {
12203
+ var shareActionToken, tokenShuffleMethod, accessToken;
12204
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12205
+ while (1) switch (_context.prev = _context.next) {
12206
+ case 0:
12207
+ shareActionToken = shareActionData.shareActionToken, tokenShuffleMethod = shareActionData.tokenShuffleMethod;
12208
+ accessToken = getShuffleMethodByName(tokenShuffleMethod)(shareActionToken);
12209
+ if (!(typeof eventActionId === 'string')) {
12210
+ _context.next = 6;
12211
+ break;
12212
+ }
12213
+ _context.next = 5;
12214
+ return submitShareAction({
12215
+ eventActionId: eventActionId,
12216
+ accessToken: accessToken,
12217
+ hash: hash
12218
+ });
12219
+ case 5:
12220
+ updateShareActionData();
12221
+ case 6:
12222
+ case "end":
12223
+ return _context.stop();
12224
+ }
12225
+ }, _callee);
12226
+ }));
12227
+ return function onAfterShare(_x) {
12228
+ return _ref.apply(this, arguments);
12229
+ };
12230
+ }();
12231
+ return React.createElement("div", {
12232
+ className: classNamePrefix + "_share_options"
12233
+ }, !_isEmpty(actions) && React.createElement(React.Fragment, null, React.createElement("div", {
12234
+ className: classNamePrefix + "_share_header"
12235
+ }, headerText), React.createElement(SocialButtons, {
12236
+ shareLink: data.attributes.shareUrl,
12237
+ name: "",
12238
+ appId: "",
12239
+ showDefaultShareButtons: false,
12240
+ shareButtons: shareButtons,
12241
+ titleText: "",
12242
+ footerText: "",
12243
+ onAfterShare: function onAfterShare(eventActionId) {
12244
+ return _onAfterShare(eventActionId);
12245
+ }
12246
+ }), isShareLinkEnabled && React.createElement("div", {
12247
+ className: classNamePrefix + "_share_btn_inner"
12248
+ }, React.createElement(CopyField, {
12249
+ copyValue: shareUrl,
12250
+ onLinkCopied: onLinkCopied,
12251
+ hasCopyIcon: hasCopyIcon,
12252
+ classNamePrefix: classNamePrefix,
12253
+ messageText: "Share your link"
12254
+ }))));
12255
+ };
12256
+
12257
+ var isWindowDefined$2 = typeof window !== 'undefined';
12258
+ var PreRegistrationComplete = function PreRegistrationComplete(_ref) {
12259
+ var pEventId = _ref.eventId,
12260
+ _ref$classNamePrefix = _ref.classNamePrefix,
12261
+ classNamePrefix = _ref$classNamePrefix === void 0 ? '' : _ref$classNamePrefix,
12262
+ _ref$onLinkCopied = _ref.onLinkCopied,
12263
+ _onLinkCopied = _ref$onLinkCopied === void 0 ? _identity : _ref$onLinkCopied,
12264
+ _ref$hasCopyIcon = _ref.hasCopyIcon,
12265
+ hasCopyIcon = _ref$hasCopyIcon === void 0 ? false : _ref$hasCopyIcon,
12266
+ _ref$pageHeader = _ref.pageHeader,
12267
+ pageHeader = _ref$pageHeader === void 0 ? 'Pre-Registration Confirmation' : _ref$pageHeader,
12268
+ _ref$onGetConfirmatio = _ref.onGetConfirmationDataError,
12269
+ onGetConfirmationDataError = _ref$onGetConfirmatio === void 0 ? _identity : _ref$onGetConfirmatio,
12270
+ _ref$onGetConfirmatio2 = _ref.onGetConfirmationDataSuccess,
12271
+ onGetConfirmationDataSuccess = _ref$onGetConfirmatio2 === void 0 ? _identity : _ref$onGetConfirmatio2,
12272
+ _ref$pageMessage = _ref.pageMessage,
12273
+ pageMessage = _ref$pageMessage === void 0 ? 'Pre registration was successful!' : _ref$pageMessage,
12274
+ _ref$onLoginSuccess = _ref.onLoginSuccess,
12275
+ onLoginSuccess = _ref$onLoginSuccess === void 0 ? _identity : _ref$onLoginSuccess,
12276
+ logo = _ref.logo;
12277
+ var localStorageHash = isWindowDefined$2 ? localStorage.getItem('pre-registration-hash') : '';
12278
+ var queryHash = getQueryVariable('hash') || '';
12279
+ queryHash && isWindowDefined$2 && window.localStorage.setItem('pre-registration-hash', queryHash);
12280
+ var hash = queryHash || localStorageHash;
12281
+ var _useState = useState(Boolean(getCookieByName(X_TF_ECOMMERCE))),
12282
+ isLoggedIn = _useState[0],
12283
+ setIsLoggedIn = _useState[1];
12284
+ var _useState2 = useState(!isLoggedIn),
12285
+ showModalLogin = _useState2[0],
12286
+ setShowModalLogin = _useState2[1];
12287
+ var _useState3 = useState(false),
12288
+ showCopyModal = _useState3[0],
12289
+ setShowCopyModal = _useState3[1];
12290
+ var _useState4 = useState([]),
12291
+ prizes = _useState4[0],
12292
+ setPrizes = _useState4[1];
12293
+ var _useState5 = useState({}),
12294
+ shareOptions = _useState5[0],
12295
+ setShareOptions = _useState5[1];
12296
+ var _useState6 = useState({}),
12297
+ shareActionData = _useState6[0],
12298
+ setShareActionData = _useState6[1];
12299
+ var _useState7 = useState({}),
12300
+ error = _useState7[0],
12301
+ setError = _useState7[1];
12302
+ useCookieListener(X_TF_ECOMMERCE, function (value) {
12303
+ return setIsLoggedIn(Boolean(value));
12304
+ });
12305
+ useEffect(function () {
12306
+ var fetchConfirmationData = /*#__PURE__*/function () {
12307
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
12308
+ var shareOptionsData, attributes, eventId, influencersData, _error$response;
12309
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12310
+ while (1) switch (_context.prev = _context.next) {
12311
+ case 0:
12312
+ _context.prev = 0;
12313
+ if (!(hash && isLoggedIn)) {
12314
+ _context.next = 15;
12315
+ break;
12316
+ }
12317
+ _context.next = 4;
12318
+ return getPreRegistrationShareOptions({
12319
+ hash: hash
12320
+ });
12321
+ case 4:
12322
+ shareOptionsData = _context.sent;
12323
+ attributes = shareOptionsData.data.attributes;
12324
+ setShareOptions(shareOptionsData.data);
12325
+ setShareActionData({
12326
+ shareActionToken: attributes.shareActionToken,
12327
+ tokenShuffleMethod: attributes.tokenShuffleMethod
12328
+ });
12329
+ eventId = _get(shareOptionsData, 'data.attributes.eventId');
12330
+ if (!(eventId || pEventId)) {
12331
+ _context.next = 14;
12332
+ break;
12333
+ }
12334
+ _context.next = 12;
12335
+ return getPreRegistrationInfluancers({
12336
+ eventId: eventId || pEventId
12337
+ });
12338
+ case 12:
12339
+ influencersData = _context.sent;
12340
+ setPrizes(influencersData.data.attributes.prizes);
12341
+ case 14:
12342
+ onGetConfirmationDataSuccess();
12343
+ case 15:
12344
+ _context.next = 20;
12345
+ break;
12346
+ case 17:
12347
+ _context.prev = 17;
12348
+ _context.t0 = _context["catch"](0);
12349
+ if (axios.isAxiosError(_context.t0)) {
12350
+ setError((_error$response = _context.t0.response) == null ? void 0 : _error$response.data);
12351
+ }
12352
+ case 20:
12353
+ case "end":
12354
+ return _context.stop();
12355
+ }
12356
+ }, _callee, null, [[0, 17]]);
12357
+ }));
12358
+ return function fetchConfirmationData() {
12359
+ return _ref2.apply(this, arguments);
12360
+ };
12361
+ }();
12362
+ fetchConfirmationData();
12363
+ }, [pEventId, hash, onGetConfirmationDataError, onGetConfirmationDataSuccess, isLoggedIn]);
12364
+ var onClose = function onClose() {
12365
+ setShowCopyModal(false);
12366
+ };
12367
+ var updateShareActionData = /*#__PURE__*/function () {
12368
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
12369
+ var shareOptionsData;
12370
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
12371
+ while (1) switch (_context2.prev = _context2.next) {
12372
+ case 0:
12373
+ if (!hash) {
12374
+ _context2.next = 6;
12375
+ break;
12376
+ }
12377
+ _context2.next = 3;
12378
+ return getPreRegistrationShareOptions({
12379
+ hash: hash
12380
+ });
12381
+ case 3:
12382
+ shareOptionsData = _context2.sent;
12383
+ setShareOptions(shareOptionsData.data);
12384
+ setShareActionData({
12385
+ shareActionToken: shareOptionsData.data.attributes.shareActionToken,
12386
+ tokenShuffleMethod: shareOptionsData.data.attributes.tokenShuffleMethod
12387
+ });
12388
+ case 6:
12389
+ case "end":
12390
+ return _context2.stop();
12391
+ }
12392
+ }, _callee2);
12393
+ }));
12394
+ return function updateShareActionData() {
12395
+ return _ref3.apply(this, arguments);
12396
+ };
12397
+ }();
12398
+ return React.createElement(React.Fragment, null, isLoggedIn && _isEmpty(error) ? React.createElement("div", {
12399
+ className: classNamePrefix + "_pre_registration_complete_container"
12400
+ }, React.createElement(CopyMessageModal, {
12401
+ showCopyModal: showCopyModal,
12402
+ onClose: onClose
12403
+ }), React.createElement("p", {
12404
+ className: classNamePrefix + "_pre_registration_complete_header"
12405
+ }, pageHeader), React.createElement("div", {
12406
+ className: classNamePrefix + "_pre_registration_complete_message"
12407
+ }, pageMessage), React.createElement("div", {
12408
+ className: classNamePrefix + "_pre_registration_complete_body"
12409
+ }, !_isEmpty(prizes) && React.createElement(Prewards, {
12410
+ classNamePrefix: classNamePrefix,
12411
+ data: prizes
12412
+ }), !_isEmpty(shareOptions) && React.createElement(ShareOptions, {
12413
+ classNamePrefix: classNamePrefix,
12414
+ data: shareOptions,
12415
+ onLinkCopied: function onLinkCopied() {
12416
+ setShowCopyModal(true);
12417
+ _onLinkCopied();
12418
+ },
12419
+ shareActionData: shareActionData,
12420
+ updateShareActionData: updateShareActionData,
12421
+ hasCopyIcon: hasCopyIcon,
12422
+ hash: hash
12423
+ }))) : showModalLogin && React.createElement(LoginModal, {
12424
+ logo: logo,
12425
+ onClose: function onClose() {
12426
+ setShowModalLogin(false);
12427
+ },
12428
+ onLogin: function onLogin(res) {
12429
+ setShowModalLogin(false);
12430
+ onLoginSuccess(res);
12431
+ }
12432
+ }), !_isEmpty(error) && React.createElement(ConfirmModal, {
12433
+ hideCancelBtn: true,
12434
+ message: error.message,
12435
+ onConfirm: function onConfirm() {
12436
+ return onGetConfirmationDataError(error);
12437
+ }
12438
+ }));
12439
+ };
12440
+
12441
+ var Influancers = function Influancers(props) {
12442
+ var data = props.data,
12443
+ classNamePrefix = props.classNamePrefix,
12444
+ _props$headerNode = props.headerNode,
12445
+ headerNode = _props$headerNode === void 0 ? React.createElement(React.Fragment, null, "TOP", React.createElement("span", null, "\xA0INFLUANCERS")) : _props$headerNode;
12446
+ return React.createElement("div", {
12447
+ className: classNamePrefix + "_influencers_container"
12448
+ }, !_isEmpty(data) && React.createElement("div", {
12449
+ className: classNamePrefix + "_influencers_header"
12450
+ }, headerNode), React.createElement("div", {
12451
+ className: classNamePrefix + "_influencers"
12452
+ }, _map(data, function (influencer, index) {
12453
+ return React.createElement("div", {
12454
+ key: influencer.prereg_id,
12455
+ className: classNamePrefix + "_influencer"
12456
+ }, React.createElement("span", {
12457
+ className: classNamePrefix + "_influencer_index"
12458
+ }, index + 1), React.createElement("span", {
12459
+ className: classNamePrefix + "_influencer_title"
12460
+ }, "INFLUENCER"), React.createElement("span", {
12461
+ className: classNamePrefix + "_influencer_name"
12462
+ }, influencer.name));
12463
+ })));
12464
+ };
12465
+
12466
+ var PreRegistrationInformations = function PreRegistrationInformations(props) {
12467
+ var classNamePrefix = props.classNamePrefix,
12468
+ eventId = props.eventId,
12469
+ _props$onGetPreregist = props.onGetPreregistrationDataSuccess,
12470
+ onGetPreregistrationDataSuccess = _props$onGetPreregist === void 0 ? _identity : _props$onGetPreregist,
12471
+ _props$onGetPreregist2 = props.onGetPreregistrationDataError,
12472
+ onGetPreregistrationDataError = _props$onGetPreregist2 === void 0 ? _identity : _props$onGetPreregist2,
12473
+ influancersHeaderNode = props.influancersHeaderNode,
12474
+ prewardsHeaderNode = props.prewardsHeaderNode;
12475
+ var _useState = useState([]),
12476
+ prizes = _useState[0],
12477
+ setPrizes = _useState[1];
12478
+ var _useState2 = useState([]),
12479
+ influencers = _useState2[0],
12480
+ setInfluencers = _useState2[1];
12481
+ var topInfluancers = _slice(influencers, 0, 10);
12482
+ useEffect(function () {
12483
+ var fetchPreregistrationData = /*#__PURE__*/function () {
12484
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
12485
+ var preregistrationData;
12486
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12487
+ while (1) switch (_context.prev = _context.next) {
12488
+ case 0:
12489
+ _context.prev = 0;
12490
+ _context.next = 3;
12491
+ return getPreRegistrationInfluancers({
12492
+ eventId: eventId
12493
+ });
12494
+ case 3:
12495
+ preregistrationData = _context.sent;
12496
+ setPrizes(preregistrationData.data.attributes.prizes);
12497
+ setInfluencers(preregistrationData.data.attributes.influencers);
12498
+ onGetPreregistrationDataSuccess();
12499
+ _context.next = 12;
12500
+ break;
12501
+ case 9:
12502
+ _context.prev = 9;
12503
+ _context.t0 = _context["catch"](0);
12504
+ if (_context.t0) {
12505
+ onGetPreregistrationDataError();
12506
+ }
12507
+ case 12:
12508
+ case "end":
12509
+ return _context.stop();
12510
+ }
12511
+ }, _callee, null, [[0, 9]]);
12512
+ }));
12513
+ return function fetchPreregistrationData() {
12514
+ return _ref.apply(this, arguments);
12515
+ };
12516
+ }();
12517
+ fetchPreregistrationData();
12518
+ }, [eventId, onGetPreregistrationDataError, onGetPreregistrationDataSuccess]);
12519
+ return React.createElement("div", {
12520
+ className: classNamePrefix + "_pre_registration_info_container"
12521
+ }, React.createElement(Prewards, {
12522
+ headerNode: prewardsHeaderNode,
12523
+ data: prizes,
12524
+ classNamePrefix: classNamePrefix
12525
+ }), React.createElement(Influancers, {
12526
+ headerNode: influancersHeaderNode,
12527
+ data: topInfluancers,
12528
+ classNamePrefix: classNamePrefix
12529
+ }));
12530
+ };
12531
+
12532
+ export { AddonsContainter, BillingInfoContainer, ConfirmationContainer, DelegationsContainer, ForgotPasswordModal, IDVerification, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, PoweredBy, PreRegistration, PreRegistrationComplete, PreRegistrationInformations, RedirectModal, ResetPasswordContainer, RsvpContainer, SeatMapContainer, TicketResaleContainer, TicketsContainer, VERIFICATION_STATUSES, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs, useCookieListener };
11181
12533
  //# sourceMappingURL=tf-checkout-react.esm.js.map