@medipass/utils 11.73.2 → 11.73.3-chore-update-react-18.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 (94) hide show
  1. package/abn.js +40 -45
  2. package/{billable-items-f8291b1e.js → billable-items-5e559447.js} +1 -1
  3. package/build-validation-schema.js +81 -123
  4. package/{businesses-2633ab9b.js → businesses-94ec0280.js} +1 -1
  5. package/chart.js +7 -14
  6. package/claim-payment-status-formatted.js +5 -2
  7. package/claim-payment-status-icons.js +13 -2
  8. package/claim-payment-status-text-classes.js +14 -2
  9. package/constants.js +82 -69
  10. package/countries.js +6 -8
  11. package/datetime.js +6 -13
  12. package/document-types-formatted.js +8 -3
  13. package/document-types-icons.js +4 -2
  14. package/document-types-text-classes.js +5 -2
  15. package/documents/workflow-state-formatted-text-classes.js +13 -4
  16. package/documents/workflow-state-formatted.js +13 -4
  17. package/documents/workflow-state-icons.js +11 -2
  18. package/form-applications/assign-values-to-sections.js +10 -16
  19. package/{forms-e1c51a53.js → forms-646810f2.js} +1 -1
  20. package/funders.js +21 -56
  21. package/get-env.js +38 -75
  22. package/get-select-options.js +21 -40
  23. package/get-staff-type-display-name.js +2 -4
  24. package/google-addresses.js +46 -91
  25. package/{health-fund-accounts-88eac93c.js → health-fund-accounts-8eda8621.js} +1 -1
  26. package/{health-fund-settings-e7a0f2ec.js → health-fund-settings-6d803913.js} +1 -1
  27. package/{health-funds-7fea63a0.js → health-funds-5e838942.js} +2 -2
  28. package/i18n/index.js +15 -18
  29. package/i18n/translations.js +1 -1
  30. package/index.js +1 -3
  31. package/intercom.js +24 -69
  32. package/{members-8eb8d8d0.js → members-e1797829.js} +1 -1
  33. package/{modalities-2dfbea63.js → modalities-d9979fa4.js} +1 -1
  34. package/package.json +4 -4
  35. package/parse-health-fund-card-fields.js +4 -6
  36. package/{patients-dd3709c1.js → patients-aba388c0.js} +1 -1
  37. package/{payment-methods-d36bc018.js → payment-methods-4010f9e5.js} +1 -1
  38. package/payment-options.js +11 -33
  39. package/{practices-d6c480f1.js → practices-17c06e6c.js} +3 -3
  40. package/{products-0a392564.js → products-7054c705.js} +2 -2
  41. package/products.js +5 -12
  42. package/{professional-categories-157d1767.js → professional-categories-0927144e.js} +1 -1
  43. package/redux-actions.js +69 -108
  44. package/redux-reducer.js +53 -69
  45. package/sanitise-url.js +1 -1
  46. package/scroll.js +1 -3
  47. package/sensitive-keys.js +2 -2
  48. package/sentry.js +35 -59
  49. package/service-items.js +70 -111
  50. package/{services-f8480eba.js → services-a81b505c.js} +3 -3
  51. package/{specialties-25fbb171.js → specialties-c29f2f67.js} +1 -1
  52. package/{staff-646053b7.js → staff-fedb5a08.js} +4 -4
  53. package/status-icons.js +12 -2
  54. package/status-text-classes.js +12 -2
  55. package/{subscriptions-aef302aa.js → subscriptions-25d86dab.js} +5 -5
  56. package/test-framework/fixtures/accounts.js +1 -1
  57. package/test-framework/fixtures/billable-items.js +1 -1
  58. package/test-framework/fixtures/businesses.js +1 -1
  59. package/test-framework/fixtures/documents.js +3 -3
  60. package/test-framework/fixtures/form-application-templates.js +1 -1
  61. package/test-framework/fixtures/form-applications.js +1 -1
  62. package/test-framework/fixtures/forms.js +1 -1
  63. package/test-framework/fixtures/health-fund-accounts.js +1 -1
  64. package/test-framework/fixtures/health-fund-settings.js +1 -1
  65. package/test-framework/fixtures/health-funds.js +1 -1
  66. package/test-framework/fixtures/index.js +18 -18
  67. package/test-framework/fixtures/members.js +1 -1
  68. package/test-framework/fixtures/message-mappings.js +1 -1
  69. package/test-framework/fixtures/modalities.js +1 -1
  70. package/test-framework/fixtures/patients.js +1 -1
  71. package/test-framework/fixtures/payment-methods.js +1 -1
  72. package/test-framework/fixtures/practices.js +1 -1
  73. package/test-framework/fixtures/products.js +1 -1
  74. package/test-framework/fixtures/professional-categories.js +1 -1
  75. package/test-framework/fixtures/services.js +1 -1
  76. package/test-framework/fixtures/specialties.js +1 -1
  77. package/test-framework/fixtures/staff.js +1 -1
  78. package/test-framework/fixtures/subscriptions.js +1 -1
  79. package/test-framework/fixtures/transaction-reports.js +6 -6
  80. package/test-framework/fixtures/transactions.js +1 -1
  81. package/test-framework/fixtures/workflow-exceptions.js +2 -2
  82. package/test-framework/react.js +10 -12
  83. package/transaction-details-by-funder.js +20 -21
  84. package/transaction-status-formatted.js +13 -3
  85. package/transaction-status-helpers.js +21 -27
  86. package/transaction-status-icons.js +9 -2
  87. package/transaction-status-text-classes.js +16 -2
  88. package/transaction-status.js +7 -15
  89. package/{transactions-4a08e450.js → transactions-de63fd15.js} +14 -14
  90. package/validate-form.js +79 -269
  91. package/validate.js +16 -28
  92. package/webpack-config.js +6 -13
  93. package/workflow-state-formatted-text-classes.js +12 -4
  94. package/workflow-state-formatted.js +11 -2
package/funders.js CHANGED
@@ -7,9 +7,9 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
7
7
  var constants = require('./constants.js');
8
8
  var _get = _interopDefault(require('lodash/get'));
9
9
 
10
- var FUNDERS_WITH_ONBOARDING = [constants.FUNDERS.HICAPS, constants.FUNDERS.MEDICARE, constants.FUNDERS.ICARE, constants.FUNDERS.WCQ, constants.FUNDERS.COMCARE, constants.FUNDERS.WSV, constants.FUNDERS.NIB];
11
- var CLAIMABLE_FUNDERS = [constants.FUNDERS.ADF, constants.FUNDERS.COMCARE, constants.FUNDERS.DVA, constants.FUNDERS.ECLIPSE, constants.FUNDERS.GARRISON, constants.FUNDERS.HEALTHPOINT, constants.FUNDERS.HICAPS, constants.FUNDERS.ICARE, constants.FUNDERS.MEDICARE, constants.FUNDERS.NIB, constants.FUNDERS.OHC, constants.FUNDERS.WCQ, constants.FUNDERS.WSV];
12
- var getFunderCodeFromTransaction = function getFunderCodeFromTransaction(transaction, funderCode) {
10
+ const FUNDERS_WITH_ONBOARDING = [constants.FUNDERS.HICAPS, constants.FUNDERS.MEDICARE, constants.FUNDERS.ICARE, constants.FUNDERS.WCQ, constants.FUNDERS.COMCARE, constants.FUNDERS.WSV, constants.FUNDERS.NIB];
11
+ const CLAIMABLE_FUNDERS = [constants.FUNDERS.ADF, constants.FUNDERS.COMCARE, constants.FUNDERS.DVA, constants.FUNDERS.ECLIPSE, constants.FUNDERS.GARRISON, constants.FUNDERS.HEALTHPOINT, constants.FUNDERS.HICAPS, constants.FUNDERS.ICARE, constants.FUNDERS.MEDICARE, constants.FUNDERS.NIB, constants.FUNDERS.OHC, constants.FUNDERS.WCQ, constants.FUNDERS.WSV];
12
+ const getFunderCodeFromTransaction = (transaction, funderCode) => {
13
13
  if (transaction.isPatientFunded || _get(transaction, 'claims[0].isPatientFunded')) {
14
14
  return constants.FUNDERS.PATIENT;
15
15
  } else if (funderCode === constants.FUNDERS.HICAPS) {
@@ -45,61 +45,26 @@ var getFunderCodeFromTransaction = function getFunderCodeFromTransaction(transac
45
45
  } else if (funderCode === constants.FUNDERS.ECLIPSE) {
46
46
  return constants.FUNDERS.ECLIPSE;
47
47
  }
48
-
49
48
  return constants.FUNDERS.PATIENT;
50
49
  };
51
- var isADF = function isADF(funderCode) {
52
- return funderCode === constants.FUNDERS.ADF;
53
- };
54
- var isComcare = function isComcare(funderCode) {
55
- return funderCode === constants.FUNDERS.COMCARE;
56
- };
57
- var isDVA = function isDVA(funderCode) {
58
- return funderCode === constants.FUNDERS.DVA;
59
- };
60
- var isEclipse = function isEclipse(funderCode) {
61
- return funderCode === constants.FUNDERS.ECLIPSE;
62
- };
63
- var isGHS = function isGHS(funderCode) {
64
- return funderCode === constants.FUNDERS.GARRISON;
65
- };
66
- var isHBF = function isHBF(funderCode) {
67
- return funderCode === constants.FUNDERS.HBF;
68
- };
69
- var isHICAPS = function isHICAPS(funderCode) {
70
- return funderCode === constants.FUNDERS.HICAPS;
71
- };
72
- var isIcare = function isIcare(funderCode) {
73
- return funderCode === constants.FUNDERS.ICARE;
74
- };
75
- var isHealthPoint = function isHealthPoint(funderCode) {
76
- return funderCode === constants.FUNDERS.HEALTHPOINT;
77
- };
78
- var isMedicare = function isMedicare(funderCode) {
79
- return funderCode === constants.FUNDERS.MEDICARE;
80
- };
81
- var isNDIS = function isNDIS(funderCode) {
82
- return funderCode === constants.FUNDERS.NDIS;
83
- };
84
- var isNib = function isNib(funderCode) {
85
- return funderCode === constants.FUNDERS.NIB;
86
- };
87
- var isOHC = function isOHC(funderCode) {
88
- return funderCode === constants.FUNDERS.OHC;
89
- };
90
- var isPatientFunded = function isPatientFunded(funderCode) {
91
- return funderCode === constants.FUNDERS.PATIENT;
92
- };
93
- var isWCQ = function isWCQ(funderCode) {
94
- return funderCode === constants.FUNDERS.WCQ;
95
- };
96
- var isWSV = function isWSV(funderCode) {
97
- return funderCode === constants.FUNDERS.WSV;
98
- }; // @ts-expect-error
99
-
100
- var isFunderClaimable = function isFunderClaimable(funderCode) {
101
- return CLAIMABLE_FUNDERS.includes(funderCode);
102
- };
50
+ const isADF = funderCode => funderCode === constants.FUNDERS.ADF;
51
+ const isComcare = funderCode => funderCode === constants.FUNDERS.COMCARE;
52
+ const isDVA = funderCode => funderCode === constants.FUNDERS.DVA;
53
+ const isEclipse = funderCode => funderCode === constants.FUNDERS.ECLIPSE;
54
+ const isGHS = funderCode => funderCode === constants.FUNDERS.GARRISON;
55
+ const isHBF = funderCode => funderCode === constants.FUNDERS.HBF;
56
+ const isHICAPS = funderCode => funderCode === constants.FUNDERS.HICAPS;
57
+ const isIcare = funderCode => funderCode === constants.FUNDERS.ICARE;
58
+ const isHealthPoint = funderCode => funderCode === constants.FUNDERS.HEALTHPOINT;
59
+ const isMedicare = funderCode => funderCode === constants.FUNDERS.MEDICARE;
60
+ const isNDIS = funderCode => funderCode === constants.FUNDERS.NDIS;
61
+ const isNib = funderCode => funderCode === constants.FUNDERS.NIB;
62
+ const isOHC = funderCode => funderCode === constants.FUNDERS.OHC;
63
+ const isPatientFunded = funderCode => funderCode === constants.FUNDERS.PATIENT;
64
+ const isWCQ = funderCode => funderCode === constants.FUNDERS.WCQ;
65
+ const isWSV = funderCode => funderCode === constants.FUNDERS.WSV;
66
+ // @ts-expect-error
67
+ const isFunderClaimable = funderCode => CLAIMABLE_FUNDERS.includes(funderCode);
103
68
 
104
69
  exports.CLAIMABLE_FUNDERS = CLAIMABLE_FUNDERS;
105
70
  exports.FUNDERS_WITH_ONBOARDING = FUNDERS_WITH_ONBOARDING;
package/get-env.js CHANGED
@@ -9,17 +9,10 @@ var _get = _interopDefault(require('lodash/get'));
9
9
  var _isEmpty = _interopDefault(require('lodash/isEmpty'));
10
10
  var _omitBy = _interopDefault(require('lodash/omitBy'));
11
11
 
12
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
-
14
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
-
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
-
18
12
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
-
20
13
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
- var REQUIRED_VARIABLES = ['APP_URL'];
22
- var ENV_NAMES = {
14
+ const REQUIRED_VARIABLES = ['APP_URL'];
15
+ const ENV_NAMES = {
23
16
  LOCAL: 'local',
24
17
  DEV: 'dev',
25
18
  STG: 'staging',
@@ -27,9 +20,8 @@ var ENV_NAMES = {
27
20
  PREPROD: 'pre-prod',
28
21
  PROD: 'prod'
29
22
  };
30
-
31
- var getEnv = function getEnv(env) {
32
- var LOCAL = {
23
+ const getEnv = env => {
24
+ const LOCAL = {
33
25
  ENV: _objectSpread({}, _get(env, '_global', {}), {}, _get(env, 'local', {}), {
34
26
  ENV_NAME: ENV_NAMES.LOCAL,
35
27
  FUNDER_URL: 'https://dev-funder.medipass.io',
@@ -40,7 +32,7 @@ var getEnv = function getEnv(env) {
40
32
  CHECKOUT_URL: 'https://dev-checkout.medipass.io'
41
33
  })
42
34
  };
43
- var DEV = {
35
+ const DEV = {
44
36
  ENV: _objectSpread({}, _get(env, '_global', {}), {}, _get(env, 'dev', {}), {
45
37
  ENV_NAME: ENV_NAMES.DEV,
46
38
  FUNDER_URL: 'https://dev-funder.medipass.io',
@@ -51,7 +43,7 @@ var getEnv = function getEnv(env) {
51
43
  CHECKOUT_URL: 'https://dev-checkout.medipass.io'
52
44
  })
53
45
  };
54
- var STAGING = {
46
+ const STAGING = {
55
47
  ENV: _objectSpread({}, _get(env, '_global', {}), {}, _get(env, 'staging', {}), {
56
48
  ENV_NAME: ENV_NAMES.STG,
57
49
  FUNDER_URL: 'https://stg-funder.medipass.io',
@@ -62,7 +54,7 @@ var getEnv = function getEnv(env) {
62
54
  CHECKOUT_URL: 'https://stg-checkout.medipass.io'
63
55
  })
64
56
  };
65
- var PERF = {
57
+ const PERF = {
66
58
  ENV: _objectSpread({}, _get(env, '_global', {}), {}, _get(env, 'perf', {}), {
67
59
  ENV_NAME: ENV_NAMES.PERF,
68
60
  FUNDER_URL: 'https://perf-funder.medipass.io',
@@ -73,7 +65,7 @@ var getEnv = function getEnv(env) {
73
65
  CHECKOUT_URL: 'https://perf-checkout.medipass.io'
74
66
  })
75
67
  };
76
- var PREPROD = {
68
+ const PREPROD = {
77
69
  ENV: _objectSpread({}, _get(env, '_global', {}), {}, _get(env, 'preprod', {}), {
78
70
  ENV_NAME: ENV_NAMES.PREPROD,
79
71
  FUNDER_URL: 'https://funder-blue.medipass.io',
@@ -84,7 +76,7 @@ var getEnv = function getEnv(env) {
84
76
  CHECKOUT_URL: 'https://checkout-blue.medipass.io'
85
77
  })
86
78
  };
87
- var PROD = {
79
+ const PROD = {
88
80
  ENV: _objectSpread({}, _get(env, '_global', {}), {}, _get(env, 'prod', {}), {
89
81
  ENV_NAME: ENV_NAMES.PROD,
90
82
  FUNDER_URL: 'https://funder.medipass.io',
@@ -95,11 +87,8 @@ var getEnv = function getEnv(env) {
95
87
  CHECKOUT_URL: 'https://checkout.medipass.io'
96
88
  })
97
89
  };
98
-
99
- var fabSettings = _get(window, 'FAB_SETTINGS', {});
100
-
101
- var origin = window.location.origin;
102
-
90
+ const fabSettings = _get(window, 'FAB_SETTINGS', {});
91
+ const origin = window.location.origin;
103
92
  if (process.env.REACT_APP_ENV === 'dev' || fabSettings.REACT_APP_ENV === 'dev' || _get(DEV, 'ENV.APP_URL', '') === origin) {
104
93
  return DEV.ENV;
105
94
  } else if (process.env.REACT_APP_ENV === 'staging' || fabSettings.REACT_APP_ENV === 'staging' || _get(STAGING, 'ENV.APP_URL', '') === origin) {
@@ -113,100 +102,74 @@ var getEnv = function getEnv(env) {
113
102
  } else if (process.env.REACT_APP_ENV === 'prod' || _get(PROD, 'ENV.APP_URL', '') === origin) {
114
103
  return PROD.ENV;
115
104
  }
116
-
117
105
  return DEV.ENV;
118
106
  };
119
-
120
- var getEnvironmentsMissingVariables = function getEnvironmentsMissingVariables(envVariables) {
121
- var environmentsMissingVariables = [];
122
-
123
- for (var _iterator = _createForOfIteratorHelperLoose(REQUIRED_VARIABLES), _step; !(_step = _iterator()).done;) {
124
- var requiredVariable = _step.value;
125
-
107
+ const getEnvironmentsMissingVariables = envVariables => {
108
+ let environmentsMissingVariables = [];
109
+ for (const requiredVariable of REQUIRED_VARIABLES) {
126
110
  if (!envVariables[requiredVariable]) {
127
- environmentsMissingVariables = [].concat(environmentsMissingVariables, [requiredVariable]);
111
+ environmentsMissingVariables = [...environmentsMissingVariables, requiredVariable];
128
112
  }
129
113
  }
130
-
131
114
  return environmentsMissingVariables;
132
115
  };
133
-
134
- var getRequiredEnvironmentVariables = function getRequiredEnvironmentVariables(env) {
135
- var missingVariables = {};
136
-
137
- for (var key in env) {
116
+ const getRequiredEnvironmentVariables = env => {
117
+ const missingVariables = {};
118
+ for (const key in env) {
138
119
  if (key.includes('_')) {
139
120
  continue;
140
121
  }
141
-
142
122
  if (Object.prototype.hasOwnProperty.call(env, key)) {
143
123
  missingVariables[key] = getEnvironmentsMissingVariables(env[key]);
144
124
  }
145
125
  }
146
-
147
126
  return _omitBy(missingVariables, _isEmpty);
148
127
  };
149
-
150
- var logWarningForMissingRequiredEnvironmentVariables = function logWarningForMissingRequiredEnvironmentVariables(missingRequiredEnvironmentVariables) {
151
- for (var key in missingRequiredEnvironmentVariables) {
128
+ const logWarningForMissingRequiredEnvironmentVariables = missingRequiredEnvironmentVariables => {
129
+ for (const key in missingRequiredEnvironmentVariables) {
152
130
  if (Object.prototype.hasOwnProperty.call(missingRequiredEnvironmentVariables, key)) {
153
- console.error("Warning: Required variables " + missingRequiredEnvironmentVariables[key] + " not defined in the '" + key + "' environment.");
131
+ console.error(`Warning: Required variables ${missingRequiredEnvironmentVariables[key]} not defined in the '${key}' environment.`);
154
132
  }
155
133
  }
156
134
  };
157
-
158
- var Env = /*#__PURE__*/function () {
159
- function Env() {
135
+ class Env {
136
+ constructor() {
160
137
  _defineProperty(this, "ENV_NAME", void 0);
161
-
162
138
  _defineProperty(this, "FUNDER_URL", void 0);
163
-
164
139
  _defineProperty(this, "CONNECT_URL", void 0);
165
-
166
140
  _defineProperty(this, "CONSUMER_URL", void 0);
167
-
168
141
  _defineProperty(this, "ACCOUNTS_URL", void 0);
169
-
170
142
  _defineProperty(this, "QUOTES_URL", void 0);
171
-
172
143
  _defineProperty(this, "CHECKOUT_URL", void 0);
173
144
  }
174
-
175
- var _proto = Env.prototype;
176
-
177
- _proto.setup = function setup(env) {
145
+ setup(env) {
178
146
  this.clear();
179
- var missingRequiredEnvironmentVariables = getRequiredEnvironmentVariables(env);
147
+ const missingRequiredEnvironmentVariables = getRequiredEnvironmentVariables(env);
180
148
  logWarningForMissingRequiredEnvironmentVariables(missingRequiredEnvironmentVariables);
181
- var newEnv = getEnv(env);
182
-
183
- for (var key in newEnv) {
149
+ const newEnv = getEnv(env);
150
+ for (const key in newEnv) {
184
151
  if (Object.prototype.hasOwnProperty.call(newEnv, key)) {
185
152
  // $FlowFixMe
186
153
  this[key] = newEnv[key];
187
154
  }
188
155
  }
189
- };
190
-
191
- _proto.clear = function clear() {
192
- for (var key in this) {
156
+ }
157
+ clear() {
158
+ for (const key in this) {
193
159
  if (Object.prototype.hasOwnProperty.call(this, key)) {
194
160
  // $FlowFixMe
195
161
  delete this[key];
196
162
  }
197
163
  }
198
- };
199
-
200
- return Env;
201
- }();
202
-
164
+ }
165
+ }
203
166
  var getEnv$1 = new Env();
204
- var ERROR_MESSAGE__INTERNET_ERROR = process.env.REACT_APP_ERROR_MESSAGE__INTERNET_ERROR || 'We are unable to establish an internet connection. We will take you back once you are connected to the internet.';
205
- var ERROR_MESSAGE__NETWORK_ERROR = process.env.REACT_APP_ERROR_MESSAGE__NETWORK_ERROR || 'There are issues connecting to the Medipass platform. Please refresh the page and try again.';
206
- var ERROR_MESSAGE__SERVER_ERROR = process.env.REACT_APP_ERROR_MESSAGE__SERVER_ERROR || 'There are issues connecting to the Medipass platform. Please refresh the page and try again.';
207
- var ERROR_MESSAGE__PAYMENT_GATEWAY_ERROR = process.env.REACT_APP_ERROR_MESSAGE__PAYMENT_GATEWAY_ERROR || 'There are issues connecting to the payment gateway. Please refresh the page and try again.';
208
- var ERROR_MESSAGE__PAYMENT_ERROR = process.env.REACT_APP_ERROR_MESSAGE__PAYMENT_ERROR || 'An error occurred when processing the payment. Please try again. The card was not charged.';
209
- var ERROR_MESSAGE__PAYMENT_GATEWAY_FIELDS = process.env.REACT_APP_ERROR_MESSAGE__PAYMENT_GATEWAY_FIELDS || 'The payment card details you entered were invalid, please review the payment card credentials and try again.';
167
+ const ERROR_MESSAGE__INTERNET_ERROR = process.env.REACT_APP_ERROR_MESSAGE__INTERNET_ERROR || 'We are unable to establish an internet connection. We will take you back once you are connected to the internet.';
168
+ const ERROR_MESSAGE__NETWORK_ERROR = process.env.REACT_APP_ERROR_MESSAGE__NETWORK_ERROR || 'There are issues connecting to the Medipass platform. Please refresh the page and try again.';
169
+ const ERROR_MESSAGE__SERVER_ERROR = process.env.REACT_APP_ERROR_MESSAGE__SERVER_ERROR || 'There are issues connecting to the Medipass platform. Please refresh the page and try again.';
170
+ const ERROR_MESSAGE__PAYMENT_GATEWAY_ERROR = process.env.REACT_APP_ERROR_MESSAGE__PAYMENT_GATEWAY_ERROR || 'There are issues connecting to the payment gateway. Please refresh the page and try again.';
171
+ const ERROR_MESSAGE__PAYMENT_ERROR = process.env.REACT_APP_ERROR_MESSAGE__PAYMENT_ERROR || 'An error occurred when processing the payment. Please try again. The card was not charged.';
172
+ const ERROR_MESSAGE__PAYMENT_GATEWAY_FIELDS = process.env.REACT_APP_ERROR_MESSAGE__PAYMENT_GATEWAY_FIELDS || 'The payment card details you entered were invalid, please review the payment card credentials and try again.';
210
173
 
211
174
  exports.ERROR_MESSAGE__INTERNET_ERROR = ERROR_MESSAGE__INTERNET_ERROR;
212
175
  exports.ERROR_MESSAGE__NETWORK_ERROR = ERROR_MESSAGE__NETWORK_ERROR;
@@ -6,55 +6,36 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
6
6
 
7
7
  var _get = _interopDefault(require('lodash/get'));
8
8
 
9
- var getSelectOptions = function getSelectOptions(values, labelKey, valueKey, opts) {
9
+ const getSelectOptions = function (values, labelKey, valueKey, opts) {
10
10
  if (valueKey === void 0) {
11
11
  valueKey = null;
12
12
  }
13
-
14
13
  if (opts === void 0) {
15
14
  opts = {};
16
15
  }
17
-
18
16
  if (!values) {
19
17
  return [];
20
18
  }
21
-
22
- return values.map(function (value, i) {
23
- return {
24
- key: _get(value, '_id', i),
25
- // @ts-expect-error TS(2339): Property 'labelKeyFunc' does not exist on type '{}... Remove this comment to see the full error message
26
- label: opts.labelKeyFunc ? opts.labelKeyFunc(value) : _get(value, labelKey),
27
- value: valueKey ? _get(value, valueKey) : value
28
- };
29
- });
30
- };
31
- var getNameMobileEmail = function getNameMobileEmail(value) {
32
- return _get(value, 'firstName') + " " + _get(value, 'lastName') + " " + _get(value, 'mobile', '') + " " + _get(value, 'email', '');
33
- };
34
- var getDisplayNameAndICDCode = function getDisplayNameAndICDCode(value) {
35
- return _get(value, 'icdCode') + " - " + _get(value, 'displayName');
36
- };
37
- var getFullName = function getFullName(value) {
38
- return _get(value, 'firstName') + " " + _get(value, 'lastName');
39
- };
40
- var getSelectOptionsWithNameMobileEmail = function getSelectOptionsWithNameMobileEmail(data) {
41
- return getSelectOptions(data, null, null, {
42
- labelKeyFunc: getNameMobileEmail || []
43
- });
44
- };
45
- var getSelectOptionsWithDisplayName = function getSelectOptionsWithDisplayName(data) {
46
- return getSelectOptions(data, 'displayName');
47
- };
48
- var getSelectOptionsWithDisplayNameAndICDCode = function getSelectOptionsWithDisplayNameAndICDCode(data) {
49
- return getSelectOptions(data, null, null, {
50
- labelKeyFunc: getDisplayNameAndICDCode || []
51
- });
52
- };
53
- var getSelectOptionsWithFullName = function getSelectOptionsWithFullName(data) {
54
- return getSelectOptions(data, null, null, {
55
- labelKeyFunc: getFullName || []
56
- });
57
- };
19
+ return values.map((value, i) => ({
20
+ key: _get(value, '_id', i),
21
+ // @ts-expect-error TS(2339): Property 'labelKeyFunc' does not exist on type '{}... Remove this comment to see the full error message
22
+ label: opts.labelKeyFunc ? opts.labelKeyFunc(value) : _get(value, labelKey),
23
+ value: valueKey ? _get(value, valueKey) : value
24
+ }));
25
+ };
26
+ const getNameMobileEmail = value => `${_get(value, 'firstName')} ${_get(value, 'lastName')} ${_get(value, 'mobile', '')} ${_get(value, 'email', '')}`;
27
+ const getDisplayNameAndICDCode = value => `${_get(value, 'icdCode')} - ${_get(value, 'displayName')}`;
28
+ const getFullName = value => `${_get(value, 'firstName')} ${_get(value, 'lastName')}`;
29
+ const getSelectOptionsWithNameMobileEmail = data => getSelectOptions(data, null, null, {
30
+ labelKeyFunc: getNameMobileEmail || []
31
+ });
32
+ const getSelectOptionsWithDisplayName = data => getSelectOptions(data, 'displayName');
33
+ const getSelectOptionsWithDisplayNameAndICDCode = data => getSelectOptions(data, null, null, {
34
+ labelKeyFunc: getDisplayNameAndICDCode || []
35
+ });
36
+ const getSelectOptionsWithFullName = data => getSelectOptions(data, null, null, {
37
+ labelKeyFunc: getFullName || []
38
+ });
58
39
 
59
40
  exports.default = getSelectOptions;
60
41
  exports.getDisplayNameAndICDCode = getDisplayNameAndICDCode;
@@ -2,11 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var staffTypeDisplayNames = {
5
+ const staffTypeDisplayNames = {
6
6
  receptionist: 'practice manager'
7
7
  };
8
- var getStaffTypeDisplayName = (function (staffType) {
9
- return staffTypeDisplayNames[staffType] || staffType;
10
- });
8
+ var getStaffTypeDisplayName = (staffType => staffTypeDisplayNames[staffType] || staffType);
11
9
 
12
10
  exports.default = getStaffTypeDisplayName;
@@ -4,13 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
- var _regeneratorRuntime = _interopDefault(require('@babel/runtime/regenerator'));
8
- var _asyncToGenerator = _interopDefault(require('@babel/runtime/helpers/asyncToGenerator'));
9
7
  var reactPlacesAutocomplete = require('react-places-autocomplete');
10
8
  var _forEach = _interopDefault(require('lodash/forEach'));
11
9
  var _forOwn = _interopDefault(require('lodash/forOwn'));
12
10
 
13
- var ADDRESS_COMPONENT_MAPPINGS = {
11
+ const ADDRESS_COMPONENT_MAPPINGS = {
14
12
  subpremise: 'subpremise',
15
13
  streetNumber: 'street_number',
16
14
  route: 'route',
@@ -20,74 +18,30 @@ var ADDRESS_COMPONENT_MAPPINGS = {
20
18
  postcode: 'postal_code'
21
19
  };
22
20
  function geocodeAddress(address) {
23
- return new Promise( /*#__PURE__*/function () {
24
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(res, rej) {
25
- var results, latLng;
26
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
27
- while (1) {
28
- switch (_context2.prev = _context2.next) {
29
- case 0:
30
- _context2.prev = 0;
31
- _context2.next = 3;
32
- return reactPlacesAutocomplete.geocodeByAddress(address);
33
-
34
- case 3:
35
- results = _context2.sent;
36
- _context2.next = 6;
37
- return reactPlacesAutocomplete.getLatLng(results[0]);
38
-
39
- case 6:
40
- latLng = _context2.sent;
41
- res({
42
- results: results,
43
- latLng: latLng
44
- });
45
- _context2.next = 13;
46
- break;
47
-
48
- case 10:
49
- _context2.prev = 10;
50
- _context2.t0 = _context2["catch"](0);
51
-
52
- if (_context2.t0 === 'OVER_QUERY_LIMIT') {
53
- setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
54
- var result;
55
- return _regeneratorRuntime.wrap(function _callee$(_context) {
56
- while (1) {
57
- switch (_context.prev = _context.next) {
58
- case 0:
59
- result = geocodeAddress(address);
60
- res(result);
61
-
62
- case 2:
63
- case "end":
64
- return _context.stop();
65
- }
66
- }
67
- }, _callee);
68
- })), 1000);
69
- } else {
70
- rej(_context2.t0);
71
- }
72
-
73
- case 13:
74
- case "end":
75
- return _context2.stop();
76
- }
77
- }
78
- }, _callee2, null, [[0, 10]]);
79
- }));
80
-
81
- return function (_x, _x2) {
82
- return _ref.apply(this, arguments);
83
- };
84
- }());
21
+ return new Promise(async (res, rej) => {
22
+ try {
23
+ const results = await reactPlacesAutocomplete.geocodeByAddress(address);
24
+ const latLng = await reactPlacesAutocomplete.getLatLng(results[0]);
25
+ res({
26
+ results,
27
+ latLng
28
+ });
29
+ } catch (err) {
30
+ if (err === 'OVER_QUERY_LIMIT') {
31
+ setTimeout(async () => {
32
+ const result = geocodeAddress(address);
33
+ res(result);
34
+ }, 1000);
35
+ } else {
36
+ rej(err);
37
+ }
38
+ }
39
+ });
85
40
  }
86
- var mapAddressComponents = function mapAddressComponents(addressComponents) {
87
- var components = {};
88
-
89
- _forEach(addressComponents, function (component) {
90
- _forOwn(ADDRESS_COMPONENT_MAPPINGS, function (mapping, key) {
41
+ const mapAddressComponents = addressComponents => {
42
+ const components = {};
43
+ _forEach(addressComponents, component => {
44
+ _forOwn(ADDRESS_COMPONENT_MAPPINGS, (mapping, key) => {
91
45
  if (component.types[0] === mapping) {
92
46
  components[key] = {
93
47
  longName: component.long_name,
@@ -96,39 +50,40 @@ var mapAddressComponents = function mapAddressComponents(addressComponents) {
96
50
  }
97
51
  });
98
52
  });
99
-
100
53
  return components;
101
54
  };
102
- var parseAddress = function parseAddress(addressComponents) {
103
- var requestData = {};
104
-
55
+ const parseAddress = addressComponents => {
56
+ const requestData = {};
105
57
  if (addressComponents) {
106
- var address = mapAddressComponents(addressComponents); // @ts-expect-error TS(2339): Property 'route' does not exist on type '{}'.
58
+ const address = mapAddressComponents(addressComponents);
107
59
 
60
+ // @ts-expect-error TS(2339): Property 'route' does not exist on type '{}'.
108
61
  if (address.route) {
109
62
  // @ts-expect-error TS(2339): Property 'address' does not exist on type '{}'.
110
- requestData.address = // @ts-expect-error
111
- "" + (address.subpremise ? address.subpremise.longName + "/" : '') + ( // @ts-expect-error
112
- (address.streetNumber ? address.streetNumber.longName : '') + " ") + ( // @ts-expect-error
113
- "" + address.route.longName);
114
- } // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
115
-
116
-
63
+ requestData.address =
64
+ // @ts-expect-error
65
+ `${address.subpremise ? `${address.subpremise.longName}/` : ''}` +
66
+ // @ts-expect-error
67
+ `${address.streetNumber ? address.streetNumber.longName : ''} ` +
68
+ // @ts-expect-error
69
+ `${address.route.longName}`;
70
+ }
71
+
72
+ // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
117
73
  if (address.country) {
118
74
  // @ts-expect-error TS(2339): Property 'countryCode' does not exist on type '{}'... Remove this comment to see the full error message
119
- requestData.countryCode = address.country.shortName; // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
120
-
75
+ requestData.countryCode = address.country.shortName;
76
+ // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
121
77
  requestData.country = address.country.longName;
122
- } // @ts-expect-error TS(2339): Property 'state' does not exist on type '{}'.
123
-
124
-
125
- requestData.state = address.state ? address.state.longName : null; // @ts-expect-error TS(2339): Property 'city' does not exist on type '{}'.
126
-
127
- requestData.city = address.city ? address.city.longName : null; // @ts-expect-error TS(2339): Property 'postcode' does not exist on type '{}'.
78
+ }
128
79
 
80
+ // @ts-expect-error TS(2339): Property 'state' does not exist on type '{}'.
81
+ requestData.state = address.state ? address.state.longName : null;
82
+ // @ts-expect-error TS(2339): Property 'city' does not exist on type '{}'.
83
+ requestData.city = address.city ? address.city.longName : null;
84
+ // @ts-expect-error TS(2339): Property 'postcode' does not exist on type '{}'.
129
85
  requestData.postcode = address.postcode ? address.postcode.longName : null;
130
86
  }
131
-
132
87
  return requestData;
133
88
  };
134
89
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var defaultHealthFundAccount = {
3
+ const defaultHealthFundAccount = {
4
4
  memberNumber: '123456789',
5
5
  lastFour: '6789',
6
6
  rank: '01',
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var defaultHealthFundSetting = {
3
+ const defaultHealthFundSetting = {
4
4
  _id: 'healthFundSettingTrustedProviderDefaultId',
5
5
  settingType: 'trusted_provider',
6
6
  healthFundId: 'healthFundDefaultId',
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var defaultHealthFund = {
3
+ const defaultHealthFund = {
4
4
  _id: 'healthFundDefaultId',
5
5
  code: 'BHE',
6
6
  fullName: 'Be Healthy Pty Ltd',
@@ -91,7 +91,7 @@ var defaultHealthFund = {
91
91
  created: new Date('2015-01-01T00:00:00'),
92
92
  modified: new Date('2015-01-02T00:00:00Z')
93
93
  };
94
- var medicareHealthFund = {
94
+ const medicareHealthFund = {
95
95
  _id: 'medicareHealthFundDefaultId',
96
96
  code: 'MDC',
97
97
  fullName: 'Medicare',