@shipengine/elements 0.25.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/index.cjs +1147 -663
  2. package/index.js +1154 -677
  3. package/package.json +12 -4
  4. package/src/components/field/field.styles.d.ts +2 -12
  5. package/src/components/index.d.ts +1 -0
  6. package/src/components/label-layout/label-layout-settings.d.ts +3 -1
  7. package/src/components/powered-by-shipengine/index.d.ts +1 -0
  8. package/src/components/powered-by-shipengine/powered-by-shipengine.d.ts +1 -0
  9. package/src/components/powered-by-shipengine/powered-by-shipengine.styles.d.ts +11 -0
  10. package/src/components/save-status/index.d.ts +2 -0
  11. package/src/components/save-status/save-status-styles.d.ts +43 -0
  12. package/src/components/save-status/save-status.d.ts +6 -0
  13. package/src/components/templates/index.d.ts +0 -1
  14. package/src/components/templates/rate-form/rate-form.d.ts +1 -0
  15. package/src/constants/shipengine/address.d.ts +2 -0
  16. package/src/elements/list-carriers/list-carriers.d.ts +28 -14
  17. package/src/elements/manage-warehouses/manage-warehouses.d.ts +28 -14
  18. package/src/elements/onboarding/onboarding.d.ts +28 -14
  19. package/src/elements/purchase-label/hooks/use-load-or-create-shipment.d.ts +6 -0
  20. package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +5 -2
  21. package/src/elements/purchase-label/purchase-label.d.ts +40 -20
  22. package/src/elements/view-shipment/view-shipment.d.ts +28 -14
  23. package/src/{components/templates/void-label/void-label.d.ts → elements/void-label/components/actions/actions.d.ts} +3 -3
  24. package/src/elements/void-label/components/actions/index.d.ts +1 -0
  25. package/src/elements/void-label/components/index.d.ts +2 -0
  26. package/src/elements/void-label/components/message/index.d.ts +1 -0
  27. package/src/elements/void-label/components/message/message.d.ts +6 -0
  28. package/src/elements/void-label/void-label.d.ts +28 -14
  29. package/src/hooks/options/index.d.ts +1 -0
  30. package/src/hooks/options/use-package-options.d.ts +1 -1
  31. package/src/hooks/options/use-service-code-options.d.ts +1 -1
  32. package/src/hooks/options/use-shipment-metadata.d.ts +8 -0
  33. package/src/hooks/options/use-shipping-presets-options.d.ts +2 -1
  34. package/src/hooks/use-get-or-create-shipment.d.ts +2 -0
  35. package/src/locales/en/index.d.ts +28 -14
  36. package/src/mocks/server.d.ts +1 -0
  37. package/src/testing/extensions/index.d.ts +2 -0
  38. package/src/testing/extensions/matchers/extend-matchers.d.ts +8 -0
  39. package/src/testing/extensions/matchers/index.d.ts +1 -0
  40. package/src/testing/extensions/matchers/matchers.d.ts +1 -0
  41. package/src/testing/extensions/matchers/to-have-loading-spinner.d.ts +2 -0
  42. package/src/testing/extensions/queries/by-icon-name.d.ts +4 -0
  43. package/src/testing/extensions/queries/index.d.ts +57 -0
  44. package/src/testing/extensions/queries/queries.d.ts +1 -0
  45. package/src/testing/index.d.ts +1 -1
  46. package/src/testing/test-utils.d.ts +292 -0
  47. package/src/utilities/error.d.ts +13 -0
  48. package/src/utilities/i18nDateUtils.d.ts +16 -0
  49. package/src/utilities/shipengine/address.d.ts +4 -0
  50. package/src/utilities/shipengine/carrier.d.ts +1 -0
  51. package/src/components/templates/void-label/index.d.ts +0 -1
  52. package/src/public-sdk.d.ts +0 -38
  53. package/src/testing/render.d.ts +0 -6
package/index.js CHANGED
@@ -1,26 +1,29 @@
1
1
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
2
2
  import { useController, get as get$1, set as set$2, useWatch, useFormState, useForm } from 'react-hook-form';
3
3
  import { useTranslation, Trans } from 'react-i18next';
4
- import { Typography, FormField, FieldMessageType, Checkbox, Input, Icon, Divider, Link, SelectAutocomplete, Select as Select$1, OptionGroup, Option, Button, Switch as Switch$1, Textarea, ButtonVariant, InlineNotification, NotificationType, ButtonColor, Grid, GridChild, Tag, TagColor, ButtonSize, Spinner, IconSize, Skeleton, SkeletonAnimation, SkeletonVariant, SkeletonBackgroundColor, RadioGroup, Radio, Stepper, Step, SpinnerSize, ChipList, Chip, Table, TableBody, TableBaseRow, TableBodyCell, TableHeader, TableHeaderCell, Popover, DropdownOptionList, BottomSheet, DatePicker as DatePicker$1 } from '@packlink/giger';
4
+ import { Typography, FormField, FieldMessageType, Checkbox, Input, Icon, Divider, Link, SelectAutocomplete, Select as Select$1, OptionGroup, Option, Button, Switch as Switch$1, Textarea, ButtonVariant, InlineNotification, NotificationType, ButtonColor, Grid, GridChild, Tag, TagColor, ButtonSize, Spinner, IconSize, Skeleton, SkeletonAnimation, SkeletonVariant, SkeletonBackgroundColor, RadioGroup, Radio, Stepper, Step, SpinnerSize, ChipList, Chip, Table, TableBody, TableBaseRow, TableBodyCell, TableHeader, TableHeaderCell, Popover, DropdownOptionList, DatePicker as DatePicker$1, BottomSheet } from '@packlink/giger';
5
5
  import axios from 'axios';
6
- import alchemy, { logger, SE, useValidateAddresses, useAddFunds, useGetCarrierById, useGetAccountSettings, useUpdateAccountSettings, useUpdateAutoFunding, useGetAutoFundingConfiguration, Currency, useListCarriers, useConnectCarrier, useListWarehouses, useUpdateWarehouse, useCreateWarehouse, useDeleteWarehouse, useUpdateSalesOrderShipment, useParseAddress, useListCustomPackageTypes, useCalculateRates, useGetShipmentRates, useListLabels, useCreateLabel, useListSalesOrderShipments, useCreateSalesOrderShipment, useListSalesOrders, useGetSalesOrder, useListOrderSources, useRefreshOrderSource, useGetShipment, useGetSalesOrderShipment, useGetLabel, useVoidLabel } from '@shipengine/alchemy';
6
+ import alchemy, { logger, SE, useValidateAddresses, useAddFunds, useGetCarrierById, useGetAccountSettings, useUpdateAccountSettings, useUpdateAutoFunding, useGetAutoFundingConfiguration, Currency, useListCarriers, useConnectCarrier, useListWarehouses, useUpdateWarehouse, useCreateWarehouse, useDeleteWarehouse, useUpdateSalesOrderShipment, useParseAddress, useListCustomPackageTypes, useCalculateRates, useGetShipmentRates, useListLabels, useCreateLabel, useListSalesOrderShipments, useCreateSalesOrderShipment, useListSalesOrders, useGetSalesOrder, useListOrderSources, useRefreshOrderSource, useShipEngine, CodedError, useGetSalesOrderShipment, useGetLabel, useVoidLabel } from '@shipengine/alchemy';
7
7
  import { zodResolver } from '@hookform/resolvers/zod';
8
8
  import { z } from 'zod';
9
9
  import * as React from 'react';
10
- import { useEffect, useRef, createElement as createElement$2, useCallback, useReducer, useMemo, memo, forwardRef, useState, createContext, useContext, Fragment as Fragment$1 } from 'react';
10
+ import { useEffect, useRef, createElement as createElement$2, forwardRef, useCallback, useReducer, useMemo, memo, useState, createContext, useContext, Fragment as Fragment$1 } from 'react';
11
11
  import { useTheme, css as css$1, createElement as createElement$3, keyframes } from '@emotion/react';
12
12
  import { camelize } from 'humps';
13
- import ReactDatePicker from 'react-datepicker';
13
+ import ReactDatePicker, { registerLocale, setDefaultLocale } from 'react-datepicker';
14
14
  import { IconNames } from '@packlink/giger-theme';
15
+ import { parse, format } from 'date-fns';
16
+ import * as Locales from 'date-fns/locale';
15
17
  import { css } from '@emotion/css';
16
- import _$2, { isEqual } from 'lodash';
18
+ import _$3, { isEqual } from 'lodash';
17
19
  import { createPortal } from 'react-dom';
18
20
  import { isValidPhoneNumber } from 'libphonenumber-js/min';
19
21
  import copy from 'copy-to-clipboard';
20
22
  import { encode } from 'js-base64';
21
23
  import cardValidator from 'card-validator';
22
- import { useQueryClient } from 'react-query';
24
+ import { useQueryClient, useQuery } from 'react-query';
23
25
  import { IconNames as IconNames$1 } from '@packlink/brands';
26
+ import { onError } from '@shipengine/react-api';
24
27
 
25
28
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
26
29
 
@@ -68,10 +71,10 @@ var functionBindNative = !fails$o(function () {
68
71
 
69
72
  var NATIVE_BIND$3 = functionBindNative;
70
73
 
71
- var call$j = Function.prototype.call;
74
+ var call$k = Function.prototype.call;
72
75
 
73
- var functionCall = NATIVE_BIND$3 ? call$j.bind(call$j) : function () {
74
- return call$j.apply(call$j, arguments);
76
+ var functionCall = NATIVE_BIND$3 ? call$k.bind(call$k) : function () {
77
+ return call$k.apply(call$k, arguments);
75
78
  };
76
79
 
77
80
  var objectPropertyIsEnumerable = {};
@@ -102,30 +105,30 @@ var createPropertyDescriptor$4 = function (bitmap, value) {
102
105
  var NATIVE_BIND$2 = functionBindNative;
103
106
 
104
107
  var FunctionPrototype$2 = Function.prototype;
105
- var call$i = FunctionPrototype$2.call;
106
- var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$i, call$i);
108
+ var call$j = FunctionPrototype$2.call;
109
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$j, call$j);
107
110
 
108
111
  var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
109
112
  return function () {
110
- return call$i.apply(fn, arguments);
113
+ return call$j.apply(fn, arguments);
111
114
  };
112
115
  };
113
116
 
114
- var uncurryThis$q = functionUncurryThis;
117
+ var uncurryThis$r = functionUncurryThis;
115
118
 
116
- var toString$d = uncurryThis$q({}.toString);
117
- var stringSlice$6 = uncurryThis$q(''.slice);
119
+ var toString$e = uncurryThis$r({}.toString);
120
+ var stringSlice$7 = uncurryThis$r(''.slice);
118
121
 
119
122
  var classofRaw$2 = function (it) {
120
- return stringSlice$6(toString$d(it), 8, -1);
123
+ return stringSlice$7(toString$e(it), 8, -1);
121
124
  };
122
125
 
123
- var uncurryThis$p = functionUncurryThis;
126
+ var uncurryThis$q = functionUncurryThis;
124
127
  var fails$n = fails$q;
125
128
  var classof$8 = classofRaw$2;
126
129
 
127
130
  var $Object$4 = Object;
128
- var split = uncurryThis$p(''.split);
131
+ var split = uncurryThis$q(''.split);
129
132
 
130
133
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
131
134
  var indexedObject = fails$n(function () {
@@ -138,27 +141,27 @@ var indexedObject = fails$n(function () {
138
141
 
139
142
  // we can't use just `it == null` since of `document.all` special case
140
143
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
141
- var isNullOrUndefined$6 = function (it) {
144
+ var isNullOrUndefined$7 = function (it) {
142
145
  return it === null || it === undefined;
143
146
  };
144
147
 
145
- var isNullOrUndefined$5 = isNullOrUndefined$6;
148
+ var isNullOrUndefined$6 = isNullOrUndefined$7;
146
149
 
147
- var $TypeError$h = TypeError;
150
+ var $TypeError$i = TypeError;
148
151
 
149
152
  // `RequireObjectCoercible` abstract operation
150
153
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
151
- var requireObjectCoercible$8 = function (it) {
152
- if (isNullOrUndefined$5(it)) throw $TypeError$h("Can't call method on " + it);
154
+ var requireObjectCoercible$9 = function (it) {
155
+ if (isNullOrUndefined$6(it)) throw $TypeError$i("Can't call method on " + it);
153
156
  return it;
154
157
  };
155
158
 
156
159
  // toObject with fallback for non-array-like ES3 strings
157
160
  var IndexedObject$2 = indexedObject;
158
- var requireObjectCoercible$7 = requireObjectCoercible$8;
161
+ var requireObjectCoercible$8 = requireObjectCoercible$9;
159
162
 
160
163
  var toIndexedObject$5 = function (it) {
161
- return IndexedObject$2(requireObjectCoercible$7(it));
164
+ return IndexedObject$2(requireObjectCoercible$8(it));
162
165
  };
163
166
 
164
167
  var documentAll$2 = typeof document == 'object' && document.all;
@@ -177,37 +180,37 @@ var documentAll$1 = $documentAll$1.all;
177
180
 
178
181
  // `IsCallable` abstract operation
179
182
  // https://tc39.es/ecma262/#sec-iscallable
180
- var isCallable$n = $documentAll$1.IS_HTMLDDA ? function (argument) {
183
+ var isCallable$o = $documentAll$1.IS_HTMLDDA ? function (argument) {
181
184
  return typeof argument == 'function' || argument === documentAll$1;
182
185
  } : function (argument) {
183
186
  return typeof argument == 'function';
184
187
  };
185
188
 
186
- var isCallable$m = isCallable$n;
189
+ var isCallable$n = isCallable$o;
187
190
  var $documentAll = documentAll_1;
188
191
 
189
192
  var documentAll = $documentAll.all;
190
193
 
191
194
  var isObject$a = $documentAll.IS_HTMLDDA ? function (it) {
192
- return typeof it == 'object' ? it !== null : isCallable$m(it) || it === documentAll;
195
+ return typeof it == 'object' ? it !== null : isCallable$n(it) || it === documentAll;
193
196
  } : function (it) {
194
- return typeof it == 'object' ? it !== null : isCallable$m(it);
197
+ return typeof it == 'object' ? it !== null : isCallable$n(it);
195
198
  };
196
199
 
197
200
  var global$o = global$p;
198
- var isCallable$l = isCallable$n;
201
+ var isCallable$m = isCallable$o;
199
202
 
200
203
  var aFunction = function (argument) {
201
- return isCallable$l(argument) ? argument : undefined;
204
+ return isCallable$m(argument) ? argument : undefined;
202
205
  };
203
206
 
204
207
  var getBuiltIn$8 = function (namespace, method) {
205
208
  return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
206
209
  };
207
210
 
208
- var uncurryThis$o = functionUncurryThis;
211
+ var uncurryThis$p = functionUncurryThis;
209
212
 
210
- var objectIsPrototypeOf = uncurryThis$o({}.isPrototypeOf);
213
+ var objectIsPrototypeOf = uncurryThis$p({}.isPrototypeOf);
211
214
 
212
215
  var getBuiltIn$7 = getBuiltIn$8;
213
216
 
@@ -265,7 +268,7 @@ var useSymbolAsUid = NATIVE_SYMBOL$2
265
268
  && typeof Symbol.iterator == 'symbol';
266
269
 
267
270
  var getBuiltIn$6 = getBuiltIn$8;
268
- var isCallable$k = isCallable$n;
271
+ var isCallable$l = isCallable$o;
269
272
  var isPrototypeOf$4 = objectIsPrototypeOf;
270
273
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
271
274
 
@@ -275,7 +278,7 @@ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
275
278
  return typeof it == 'symbol';
276
279
  } : function (it) {
277
280
  var $Symbol = getBuiltIn$6('Symbol');
278
- return isCallable$k($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
281
+ return isCallable$l($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
279
282
  };
280
283
 
281
284
  var $String$4 = String;
@@ -288,41 +291,41 @@ var tryToString$5 = function (argument) {
288
291
  }
289
292
  };
290
293
 
291
- var isCallable$j = isCallable$n;
294
+ var isCallable$k = isCallable$o;
292
295
  var tryToString$4 = tryToString$5;
293
296
 
294
- var $TypeError$g = TypeError;
297
+ var $TypeError$h = TypeError;
295
298
 
296
299
  // `Assert: IsCallable(argument) is true`
297
300
  var aCallable$a = function (argument) {
298
- if (isCallable$j(argument)) return argument;
299
- throw $TypeError$g(tryToString$4(argument) + ' is not a function');
301
+ if (isCallable$k(argument)) return argument;
302
+ throw $TypeError$h(tryToString$4(argument) + ' is not a function');
300
303
  };
301
304
 
302
305
  var aCallable$9 = aCallable$a;
303
- var isNullOrUndefined$4 = isNullOrUndefined$6;
306
+ var isNullOrUndefined$5 = isNullOrUndefined$7;
304
307
 
305
308
  // `GetMethod` abstract operation
306
309
  // https://tc39.es/ecma262/#sec-getmethod
307
- var getMethod$5 = function (V, P) {
310
+ var getMethod$6 = function (V, P) {
308
311
  var func = V[P];
309
- return isNullOrUndefined$4(func) ? undefined : aCallable$9(func);
312
+ return isNullOrUndefined$5(func) ? undefined : aCallable$9(func);
310
313
  };
311
314
 
312
- var call$h = functionCall;
313
- var isCallable$i = isCallable$n;
315
+ var call$i = functionCall;
316
+ var isCallable$j = isCallable$o;
314
317
  var isObject$9 = isObject$a;
315
318
 
316
- var $TypeError$f = TypeError;
319
+ var $TypeError$g = TypeError;
317
320
 
318
321
  // `OrdinaryToPrimitive` abstract operation
319
322
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
320
323
  var ordinaryToPrimitive$1 = function (input, pref) {
321
324
  var fn, val;
322
- if (pref === 'string' && isCallable$i(fn = input.toString) && !isObject$9(val = call$h(fn, input))) return val;
323
- if (isCallable$i(fn = input.valueOf) && !isObject$9(val = call$h(fn, input))) return val;
324
- if (pref !== 'string' && isCallable$i(fn = input.toString) && !isObject$9(val = call$h(fn, input))) return val;
325
- throw $TypeError$f("Can't convert object to primitive value");
325
+ if (pref === 'string' && isCallable$j(fn = input.toString) && !isObject$9(val = call$i(fn, input))) return val;
326
+ if (isCallable$j(fn = input.valueOf) && !isObject$9(val = call$i(fn, input))) return val;
327
+ if (pref !== 'string' && isCallable$j(fn = input.toString) && !isObject$9(val = call$i(fn, input))) return val;
328
+ throw $TypeError$g("Can't convert object to primitive value");
326
329
  };
327
330
 
328
331
  var shared$4 = {exports: {}};
@@ -360,20 +363,20 @@ var store$2 = sharedStore;
360
363
  source: 'https://github.com/zloirock/core-js'
361
364
  });
362
365
 
363
- var requireObjectCoercible$6 = requireObjectCoercible$8;
366
+ var requireObjectCoercible$7 = requireObjectCoercible$9;
364
367
 
365
368
  var $Object$2 = Object;
366
369
 
367
370
  // `ToObject` abstract operation
368
371
  // https://tc39.es/ecma262/#sec-toobject
369
372
  var toObject$7 = function (argument) {
370
- return $Object$2(requireObjectCoercible$6(argument));
373
+ return $Object$2(requireObjectCoercible$7(argument));
371
374
  };
372
375
 
373
- var uncurryThis$n = functionUncurryThis;
376
+ var uncurryThis$o = functionUncurryThis;
374
377
  var toObject$6 = toObject$7;
375
378
 
376
- var hasOwnProperty = uncurryThis$n({}.hasOwnProperty);
379
+ var hasOwnProperty = uncurryThis$o({}.hasOwnProperty);
377
380
 
378
381
  // `HasOwnProperty` abstract operation
379
382
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -382,14 +385,14 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
382
385
  return hasOwnProperty(toObject$6(it), key);
383
386
  };
384
387
 
385
- var uncurryThis$m = functionUncurryThis;
388
+ var uncurryThis$n = functionUncurryThis;
386
389
 
387
390
  var id = 0;
388
391
  var postfix = Math.random();
389
- var toString$c = uncurryThis$m(1.0.toString);
392
+ var toString$d = uncurryThis$n(1.0.toString);
390
393
 
391
394
  var uid$2 = function (key) {
392
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$c(++id + postfix, 36);
395
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$d(++id + postfix, 36);
393
396
  };
394
397
 
395
398
  var global$k = global$p;
@@ -404,7 +407,7 @@ var Symbol$3 = global$k.Symbol;
404
407
  var symbolFor = Symbol$3 && Symbol$3['for'];
405
408
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
406
409
 
407
- var wellKnownSymbol$j = function (name) {
410
+ var wellKnownSymbol$k = function (name) {
408
411
  if (!hasOwn$b(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
409
412
  var description = 'Symbol.' + name;
410
413
  if (NATIVE_SYMBOL$1 && hasOwn$b(Symbol$3, name)) {
@@ -417,27 +420,27 @@ var wellKnownSymbol$j = function (name) {
417
420
  } return WellKnownSymbolsStore[name];
418
421
  };
419
422
 
420
- var call$g = functionCall;
423
+ var call$h = functionCall;
421
424
  var isObject$8 = isObject$a;
422
425
  var isSymbol$1 = isSymbol$2;
423
- var getMethod$4 = getMethod$5;
426
+ var getMethod$5 = getMethod$6;
424
427
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
425
- var wellKnownSymbol$i = wellKnownSymbol$j;
428
+ var wellKnownSymbol$j = wellKnownSymbol$k;
426
429
 
427
- var $TypeError$e = TypeError;
428
- var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
430
+ var $TypeError$f = TypeError;
431
+ var TO_PRIMITIVE = wellKnownSymbol$j('toPrimitive');
429
432
 
430
433
  // `ToPrimitive` abstract operation
431
434
  // https://tc39.es/ecma262/#sec-toprimitive
432
435
  var toPrimitive$1 = function (input, pref) {
433
436
  if (!isObject$8(input) || isSymbol$1(input)) return input;
434
- var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
437
+ var exoticToPrim = getMethod$5(input, TO_PRIMITIVE);
435
438
  var result;
436
439
  if (exoticToPrim) {
437
440
  if (pref === undefined) pref = 'default';
438
- result = call$g(exoticToPrim, input, pref);
441
+ result = call$h(exoticToPrim, input, pref);
439
442
  if (!isObject$8(result) || isSymbol$1(result)) return result;
440
- throw $TypeError$e("Can't convert object to primitive value");
443
+ throw $TypeError$f("Can't convert object to primitive value");
441
444
  }
442
445
  if (pref === undefined) pref = 'number';
443
446
  return ordinaryToPrimitive(input, pref);
@@ -477,7 +480,7 @@ var ie8DomDefine = !DESCRIPTORS$b && !fails$l(function () {
477
480
  });
478
481
 
479
482
  var DESCRIPTORS$a = descriptors;
480
- var call$f = functionCall;
483
+ var call$g = functionCall;
481
484
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
482
485
  var createPropertyDescriptor$3 = createPropertyDescriptor$4;
483
486
  var toIndexedObject$4 = toIndexedObject$5;
@@ -496,7 +499,7 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$a ? $getOwnPropertyDescriptor$1 :
496
499
  if (IE8_DOM_DEFINE$1) try {
497
500
  return $getOwnPropertyDescriptor$1(O, P);
498
501
  } catch (error) { /* empty */ }
499
- if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$f(propertyIsEnumerableModule$1.f, O, P), O[P]);
502
+ if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$g(propertyIsEnumerableModule$1.f, O, P), O[P]);
500
503
  };
501
504
 
502
505
  var objectDefineProperty = {};
@@ -517,12 +520,12 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$k(function () {
517
520
  var isObject$6 = isObject$a;
518
521
 
519
522
  var $String$3 = String;
520
- var $TypeError$d = TypeError;
523
+ var $TypeError$e = TypeError;
521
524
 
522
525
  // `Assert: Type(argument) is Object`
523
526
  var anObject$f = function (argument) {
524
527
  if (isObject$6(argument)) return argument;
525
- throw $TypeError$d($String$3(argument) + ' is not an object');
528
+ throw $TypeError$e($String$3(argument) + ' is not an object');
526
529
  };
527
530
 
528
531
  var DESCRIPTORS$8 = descriptors;
@@ -531,7 +534,7 @@ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
531
534
  var anObject$e = anObject$f;
532
535
  var toPropertyKey$1 = toPropertyKey$3;
533
536
 
534
- var $TypeError$c = TypeError;
537
+ var $TypeError$d = TypeError;
535
538
  // eslint-disable-next-line es/no-object-defineproperty -- safe
536
539
  var $defineProperty = Object.defineProperty;
537
540
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -564,7 +567,7 @@ objectDefineProperty.f = DESCRIPTORS$8 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
564
567
  if (IE8_DOM_DEFINE) try {
565
568
  return $defineProperty(O, P, Attributes);
566
569
  } catch (error) { /* empty */ }
567
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$c('Accessors not supported');
570
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$d('Accessors not supported');
568
571
  if ('value' in Attributes) O[P] = Attributes.value;
569
572
  return O;
570
573
  };
@@ -600,14 +603,14 @@ var functionName = {
600
603
  CONFIGURABLE: CONFIGURABLE
601
604
  };
602
605
 
603
- var uncurryThis$l = functionUncurryThis;
604
- var isCallable$h = isCallable$n;
606
+ var uncurryThis$m = functionUncurryThis;
607
+ var isCallable$i = isCallable$o;
605
608
  var store$1 = sharedStore;
606
609
 
607
- var functionToString = uncurryThis$l(Function.toString);
610
+ var functionToString = uncurryThis$m(Function.toString);
608
611
 
609
612
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
610
- if (!isCallable$h(store$1.inspectSource)) {
613
+ if (!isCallable$i(store$1.inspectSource)) {
611
614
  store$1.inspectSource = function (it) {
612
615
  return functionToString(it);
613
616
  };
@@ -616,11 +619,11 @@ if (!isCallable$h(store$1.inspectSource)) {
616
619
  var inspectSource$3 = store$1.inspectSource;
617
620
 
618
621
  var global$i = global$p;
619
- var isCallable$g = isCallable$n;
622
+ var isCallable$h = isCallable$o;
620
623
 
621
624
  var WeakMap$1 = global$i.WeakMap;
622
625
 
623
- var weakMapBasicDetection = isCallable$g(WeakMap$1) && /native code/.test(String(WeakMap$1));
626
+ var weakMapBasicDetection = isCallable$h(WeakMap$1) && /native code/.test(String(WeakMap$1));
624
627
 
625
628
  var shared$2 = shared$4.exports;
626
629
  var uid = uid$2;
@@ -705,7 +708,7 @@ var internalState = {
705
708
  };
706
709
 
707
710
  var fails$j = fails$q;
708
- var isCallable$f = isCallable$n;
711
+ var isCallable$g = isCallable$o;
709
712
  var hasOwn$7 = hasOwnProperty_1;
710
713
  var DESCRIPTORS$5 = descriptors;
711
714
  var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
@@ -751,10 +754,10 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
751
754
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
752
755
  // eslint-disable-next-line no-extend-native -- required
753
756
  Function.prototype.toString = makeBuiltIn$1(function toString() {
754
- return isCallable$f(this) && getInternalState$2(this).source || inspectSource$2(this);
757
+ return isCallable$g(this) && getInternalState$2(this).source || inspectSource$2(this);
755
758
  }, 'toString');
756
759
 
757
- var isCallable$e = isCallable$n;
760
+ var isCallable$f = isCallable$o;
758
761
  var definePropertyModule$4 = objectDefineProperty;
759
762
  var makeBuiltIn = makeBuiltIn$2.exports;
760
763
  var defineGlobalProperty$1 = defineGlobalProperty$3;
@@ -763,7 +766,7 @@ var defineBuiltIn$7 = function (O, key, value, options) {
763
766
  if (!options) options = {};
764
767
  var simple = options.enumerable;
765
768
  var name = options.name !== undefined ? options.name : key;
766
- if (isCallable$e(value)) makeBuiltIn(value, name, options);
769
+ if (isCallable$f(value)) makeBuiltIn(value, name, options);
767
770
  if (options.global) {
768
771
  if (simple) O[key] = value;
769
772
  else defineGlobalProperty$1(key, value);
@@ -807,7 +810,7 @@ var toIntegerOrInfinity$6 = function (argument) {
807
810
 
808
811
  var toIntegerOrInfinity$5 = toIntegerOrInfinity$6;
809
812
 
810
- var max$2 = Math.max;
813
+ var max$3 = Math.max;
811
814
  var min$2 = Math.min;
812
815
 
813
816
  // Helper for a popular repeating case of the spec:
@@ -815,7 +818,7 @@ var min$2 = Math.min;
815
818
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
816
819
  var toAbsoluteIndex$2 = function (index, length) {
817
820
  var integer = toIntegerOrInfinity$5(index);
818
- return integer < 0 ? max$2(integer + length, 0) : min$2(integer, length);
821
+ return integer < 0 ? max$3(integer + length, 0) : min$2(integer, length);
819
822
  };
820
823
 
821
824
  var toIntegerOrInfinity$4 = toIntegerOrInfinity$6;
@@ -869,13 +872,13 @@ var arrayIncludes = {
869
872
  indexOf: createMethod$3(false)
870
873
  };
871
874
 
872
- var uncurryThis$k = functionUncurryThis;
875
+ var uncurryThis$l = functionUncurryThis;
873
876
  var hasOwn$6 = hasOwnProperty_1;
874
877
  var toIndexedObject$2 = toIndexedObject$5;
875
- var indexOf$1 = arrayIncludes.indexOf;
878
+ var indexOf$2 = arrayIncludes.indexOf;
876
879
  var hiddenKeys$2 = hiddenKeys$4;
877
880
 
878
- var push$2 = uncurryThis$k([].push);
881
+ var push$2 = uncurryThis$l([].push);
879
882
 
880
883
  var objectKeysInternal = function (object, names) {
881
884
  var O = toIndexedObject$2(object);
@@ -885,7 +888,7 @@ var objectKeysInternal = function (object, names) {
885
888
  for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$2(result, key);
886
889
  // Don't enum bug & hidden keys
887
890
  while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
888
- ~indexOf$1(result, key) || push$2(result, key);
891
+ ~indexOf$2(result, key) || push$2(result, key);
889
892
  }
890
893
  return result;
891
894
  };
@@ -919,12 +922,12 @@ var objectGetOwnPropertySymbols = {};
919
922
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
920
923
 
921
924
  var getBuiltIn$5 = getBuiltIn$8;
922
- var uncurryThis$j = functionUncurryThis;
925
+ var uncurryThis$k = functionUncurryThis;
923
926
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
924
927
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
925
928
  var anObject$d = anObject$f;
926
929
 
927
- var concat$2 = uncurryThis$j([].concat);
930
+ var concat$2 = uncurryThis$k([].concat);
928
931
 
929
932
  // all object keys, includes non-enumerable and symbols
930
933
  var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -951,7 +954,7 @@ var copyConstructorProperties$2 = function (target, source, exceptions) {
951
954
  };
952
955
 
953
956
  var fails$i = fails$q;
954
- var isCallable$d = isCallable$n;
957
+ var isCallable$e = isCallable$o;
955
958
 
956
959
  var replacement = /#|\.prototype\./;
957
960
 
@@ -959,7 +962,7 @@ var isForced$2 = function (feature, detection) {
959
962
  var value = data[normalize(feature)];
960
963
  return value == POLYFILL ? true
961
964
  : value == NATIVE ? false
962
- : isCallable$d(detection) ? fails$i(detection)
965
+ : isCallable$e(detection) ? fails$i(detection)
963
966
  : !!detection;
964
967
  };
965
968
 
@@ -1039,8 +1042,8 @@ var objectKeys$2 = Object.keys || function keys(O) {
1039
1042
  };
1040
1043
 
1041
1044
  var DESCRIPTORS$4 = descriptors;
1042
- var uncurryThis$i = functionUncurryThis;
1043
- var call$e = functionCall;
1045
+ var uncurryThis$j = functionUncurryThis;
1046
+ var call$f = functionCall;
1044
1047
  var fails$h = fails$q;
1045
1048
  var objectKeys$1 = objectKeys$2;
1046
1049
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
@@ -1052,7 +1055,7 @@ var IndexedObject$1 = indexedObject;
1052
1055
  var $assign = Object.assign;
1053
1056
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1054
1057
  var defineProperty$4 = Object.defineProperty;
1055
- var concat$1 = uncurryThis$i([].concat);
1058
+ var concat$1 = uncurryThis$j([].concat);
1056
1059
 
1057
1060
  // `Object.assign` method
1058
1061
  // https://tc39.es/ecma262/#sec-object.assign
@@ -1090,18 +1093,18 @@ var objectAssign = !$assign || fails$h(function () {
1090
1093
  var key;
1091
1094
  while (length > j) {
1092
1095
  key = keys[j++];
1093
- if (!DESCRIPTORS$4 || call$e(propertyIsEnumerable, S, key)) T[key] = S[key];
1096
+ if (!DESCRIPTORS$4 || call$f(propertyIsEnumerable, S, key)) T[key] = S[key];
1094
1097
  }
1095
1098
  } return T;
1096
1099
  } : $assign;
1097
1100
 
1098
- var $$j = _export;
1101
+ var $$k = _export;
1099
1102
  var assign = objectAssign;
1100
1103
 
1101
1104
  // `Object.assign` method
1102
1105
  // https://tc39.es/ecma262/#sec-object.assign
1103
1106
  // eslint-disable-next-line es/no-object-assign -- required for testing
1104
- $$j({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1107
+ $$k({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1105
1108
  assign: assign
1106
1109
  });
1107
1110
 
@@ -1147,7 +1150,7 @@ var toObject$4 = toObject$7;
1147
1150
  var IndexedObject = indexedObject;
1148
1151
  var lengthOfArrayLike$5 = lengthOfArrayLike$7;
1149
1152
 
1150
- var $TypeError$b = TypeError;
1153
+ var $TypeError$c = TypeError;
1151
1154
 
1152
1155
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
1153
1156
  var createMethod$2 = function (IS_RIGHT) {
@@ -1166,7 +1169,7 @@ var createMethod$2 = function (IS_RIGHT) {
1166
1169
  }
1167
1170
  index += i;
1168
1171
  if (IS_RIGHT ? index < 0 : length <= index) {
1169
- throw $TypeError$b('Reduce of empty array with no initial value');
1172
+ throw $TypeError$c('Reduce of empty array with no initial value');
1170
1173
  }
1171
1174
  }
1172
1175
  for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
@@ -1200,7 +1203,7 @@ var global$f = global$p;
1200
1203
 
1201
1204
  var engineIsNode = classof$7(global$f.process) == 'process';
1202
1205
 
1203
- var $$i = _export;
1206
+ var $$j = _export;
1204
1207
  var $reduce = arrayReduce.left;
1205
1208
  var arrayMethodIsStrict$1 = arrayMethodIsStrict$2;
1206
1209
  var CHROME_VERSION = engineV8Version;
@@ -1213,7 +1216,7 @@ var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1213
1216
 
1214
1217
  // `Array.prototype.reduce` method
1215
1218
  // https://tc39.es/ecma262/#sec-array.prototype.reduce
1216
- $$i({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
1219
+ $$j({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
1217
1220
  reduce: function reduce(callbackfn /* , initialValue */) {
1218
1221
  var length = arguments.length;
1219
1222
  return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
@@ -1340,11 +1343,11 @@ var objectCreate = Object.create || function create(O, Properties) {
1340
1343
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1341
1344
  };
1342
1345
 
1343
- var wellKnownSymbol$h = wellKnownSymbol$j;
1346
+ var wellKnownSymbol$i = wellKnownSymbol$k;
1344
1347
  var create$2 = objectCreate;
1345
1348
  var defineProperty$3 = objectDefineProperty.f;
1346
1349
 
1347
- var UNSCOPABLES = wellKnownSymbol$h('unscopables');
1350
+ var UNSCOPABLES = wellKnownSymbol$i('unscopables');
1348
1351
  var ArrayPrototype$1 = Array.prototype;
1349
1352
 
1350
1353
  // Array.prototype[@@unscopables]
@@ -1373,7 +1376,7 @@ var correctPrototypeGetter = !fails$f(function () {
1373
1376
  });
1374
1377
 
1375
1378
  var hasOwn$4 = hasOwnProperty_1;
1376
- var isCallable$c = isCallable$n;
1379
+ var isCallable$d = isCallable$o;
1377
1380
  var toObject$3 = toObject$7;
1378
1381
  var sharedKey = sharedKey$3;
1379
1382
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
@@ -1389,19 +1392,19 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
1389
1392
  var object = toObject$3(O);
1390
1393
  if (hasOwn$4(object, IE_PROTO)) return object[IE_PROTO];
1391
1394
  var constructor = object.constructor;
1392
- if (isCallable$c(constructor) && object instanceof constructor) {
1395
+ if (isCallable$d(constructor) && object instanceof constructor) {
1393
1396
  return constructor.prototype;
1394
1397
  } return object instanceof $Object$1 ? ObjectPrototype : null;
1395
1398
  };
1396
1399
 
1397
1400
  var fails$e = fails$q;
1398
- var isCallable$b = isCallable$n;
1401
+ var isCallable$c = isCallable$o;
1399
1402
  var isObject$4 = isObject$a;
1400
1403
  var getPrototypeOf$1 = objectGetPrototypeOf;
1401
1404
  var defineBuiltIn$5 = defineBuiltIn$7;
1402
- var wellKnownSymbol$g = wellKnownSymbol$j;
1405
+ var wellKnownSymbol$h = wellKnownSymbol$k;
1403
1406
 
1404
- var ITERATOR$7 = wellKnownSymbol$g('iterator');
1407
+ var ITERATOR$7 = wellKnownSymbol$h('iterator');
1405
1408
  var BUGGY_SAFARI_ITERATORS$1 = false;
1406
1409
 
1407
1410
  // `%IteratorPrototype%` object
@@ -1429,7 +1432,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1429
1432
 
1430
1433
  // `%IteratorPrototype%[@@iterator]()` method
1431
1434
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1432
- if (!isCallable$b(IteratorPrototype$2[ITERATOR$7])) {
1435
+ if (!isCallable$c(IteratorPrototype$2[ITERATOR$7])) {
1433
1436
  defineBuiltIn$5(IteratorPrototype$2, ITERATOR$7, function () {
1434
1437
  return this;
1435
1438
  });
@@ -1442,9 +1445,9 @@ var iteratorsCore = {
1442
1445
 
1443
1446
  var defineProperty$2 = objectDefineProperty.f;
1444
1447
  var hasOwn$3 = hasOwnProperty_1;
1445
- var wellKnownSymbol$f = wellKnownSymbol$j;
1448
+ var wellKnownSymbol$g = wellKnownSymbol$k;
1446
1449
 
1447
- var TO_STRING_TAG$3 = wellKnownSymbol$f('toStringTag');
1450
+ var TO_STRING_TAG$3 = wellKnownSymbol$g('toStringTag');
1448
1451
 
1449
1452
  var setToStringTag$3 = function (target, TAG, STATIC) {
1450
1453
  if (target && !STATIC) target = target.prototype;
@@ -1469,19 +1472,19 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
1469
1472
  return IteratorConstructor;
1470
1473
  };
1471
1474
 
1472
- var isCallable$a = isCallable$n;
1475
+ var isCallable$b = isCallable$o;
1473
1476
 
1474
1477
  var $String$2 = String;
1475
- var $TypeError$a = TypeError;
1478
+ var $TypeError$b = TypeError;
1476
1479
 
1477
1480
  var aPossiblePrototype$1 = function (argument) {
1478
- if (typeof argument == 'object' || isCallable$a(argument)) return argument;
1479
- throw $TypeError$a("Can't set " + $String$2(argument) + ' as a prototype');
1481
+ if (typeof argument == 'object' || isCallable$b(argument)) return argument;
1482
+ throw $TypeError$b("Can't set " + $String$2(argument) + ' as a prototype');
1480
1483
  };
1481
1484
 
1482
1485
  /* eslint-disable no-proto -- safe */
1483
1486
 
1484
- var uncurryThis$h = functionUncurryThis;
1487
+ var uncurryThis$i = functionUncurryThis;
1485
1488
  var anObject$a = anObject$f;
1486
1489
  var aPossiblePrototype = aPossiblePrototype$1;
1487
1490
 
@@ -1495,7 +1498,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1495
1498
  var setter;
1496
1499
  try {
1497
1500
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1498
- setter = uncurryThis$h(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1501
+ setter = uncurryThis$i(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1499
1502
  setter(test, []);
1500
1503
  CORRECT_SETTER = test instanceof Array;
1501
1504
  } catch (error) { /* empty */ }
@@ -1508,17 +1511,17 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1508
1511
  };
1509
1512
  }() : undefined);
1510
1513
 
1511
- var $$h = _export;
1512
- var call$d = functionCall;
1514
+ var $$i = _export;
1515
+ var call$e = functionCall;
1513
1516
  var FunctionName = functionName;
1514
- var isCallable$9 = isCallable$n;
1517
+ var isCallable$a = isCallable$o;
1515
1518
  var createIteratorConstructor = iteratorCreateConstructor;
1516
1519
  var getPrototypeOf = objectGetPrototypeOf;
1517
1520
  var setPrototypeOf$1 = objectSetPrototypeOf;
1518
1521
  var setToStringTag$1 = setToStringTag$3;
1519
1522
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1520
1523
  var defineBuiltIn$4 = defineBuiltIn$7;
1521
- var wellKnownSymbol$e = wellKnownSymbol$j;
1524
+ var wellKnownSymbol$f = wellKnownSymbol$k;
1522
1525
  var Iterators$3 = iterators;
1523
1526
  var IteratorsCore = iteratorsCore;
1524
1527
 
@@ -1526,7 +1529,7 @@ var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
1526
1529
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1527
1530
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1528
1531
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1529
- var ITERATOR$6 = wellKnownSymbol$e('iterator');
1532
+ var ITERATOR$6 = wellKnownSymbol$f('iterator');
1530
1533
  var KEYS = 'keys';
1531
1534
  var VALUES = 'values';
1532
1535
  var ENTRIES = 'entries';
@@ -1563,7 +1566,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1563
1566
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1564
1567
  if (setPrototypeOf$1) {
1565
1568
  setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1566
- } else if (!isCallable$9(CurrentIteratorPrototype[ITERATOR$6])) {
1569
+ } else if (!isCallable$a(CurrentIteratorPrototype[ITERATOR$6])) {
1567
1570
  defineBuiltIn$4(CurrentIteratorPrototype, ITERATOR$6, returnThis);
1568
1571
  }
1569
1572
  }
@@ -1578,7 +1581,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1578
1581
  createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1579
1582
  } else {
1580
1583
  INCORRECT_VALUES_NAME = true;
1581
- defaultIterator = function values() { return call$d(nativeIterator, this); };
1584
+ defaultIterator = function values() { return call$e(nativeIterator, this); };
1582
1585
  }
1583
1586
  }
1584
1587
 
@@ -1593,7 +1596,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1593
1596
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1594
1597
  defineBuiltIn$4(IterablePrototype, KEY, methods[KEY]);
1595
1598
  }
1596
- } else $$h({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1599
+ } else $$i({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1597
1600
  }
1598
1601
 
1599
1602
  // define iterator
@@ -1721,10 +1724,10 @@ var DOMIterables = domIterables;
1721
1724
  var DOMTokenListPrototype = domTokenListPrototype;
1722
1725
  var ArrayIteratorMethods = es_array_iterator;
1723
1726
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1724
- var wellKnownSymbol$d = wellKnownSymbol$j;
1727
+ var wellKnownSymbol$e = wellKnownSymbol$k;
1725
1728
 
1726
- var ITERATOR$5 = wellKnownSymbol$d('iterator');
1727
- var TO_STRING_TAG$2 = wellKnownSymbol$d('toStringTag');
1729
+ var ITERATOR$5 = wellKnownSymbol$e('iterator');
1730
+ var TO_STRING_TAG$2 = wellKnownSymbol$e('toStringTag');
1728
1731
  var ArrayValues = ArrayIteratorMethods.values;
1729
1732
 
1730
1733
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
@@ -1843,6 +1846,18 @@ const createCodedErrors = err => {
1843
1846
  message: err.message
1844
1847
  }];
1845
1848
  };
1849
+ /**
1850
+ * Joins a list of error-like object's messages and throws them as a single error.
1851
+ */
1852
+ function throwJoinedMessages(errors) {
1853
+ throw new Error(errors.map(e => e.message).join(", "));
1854
+ }
1855
+ /**
1856
+ * If any CodedErrors exist, throw them all as a single error, otherwise assert errors is null.
1857
+ */
1858
+ function throwAny(errors) {
1859
+ if (errors) throwJoinedMessages(errors);
1860
+ }
1846
1861
 
1847
1862
  /**
1848
1863
  * @description
@@ -1880,9 +1895,9 @@ const formLogger = {
1880
1895
  })
1881
1896
  };
1882
1897
 
1883
- var wellKnownSymbol$c = wellKnownSymbol$j;
1898
+ var wellKnownSymbol$d = wellKnownSymbol$k;
1884
1899
 
1885
- var TO_STRING_TAG$1 = wellKnownSymbol$c('toStringTag');
1900
+ var TO_STRING_TAG$1 = wellKnownSymbol$d('toStringTag');
1886
1901
  var test$1 = {};
1887
1902
 
1888
1903
  test$1[TO_STRING_TAG$1] = 'z';
@@ -1890,11 +1905,11 @@ test$1[TO_STRING_TAG$1] = 'z';
1890
1905
  var toStringTagSupport = String(test$1) === '[object z]';
1891
1906
 
1892
1907
  var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1893
- var isCallable$8 = isCallable$n;
1908
+ var isCallable$9 = isCallable$o;
1894
1909
  var classofRaw$1 = classofRaw$2;
1895
- var wellKnownSymbol$b = wellKnownSymbol$j;
1910
+ var wellKnownSymbol$c = wellKnownSymbol$k;
1896
1911
 
1897
- var TO_STRING_TAG = wellKnownSymbol$b('toStringTag');
1912
+ var TO_STRING_TAG = wellKnownSymbol$c('toStringTag');
1898
1913
  var $Object = Object;
1899
1914
 
1900
1915
  // ES3 wrong here
@@ -1916,14 +1931,14 @@ var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1916
1931
  // builtinTag case
1917
1932
  : CORRECT_ARGUMENTS ? classofRaw$1(O)
1918
1933
  // ES3 arguments fallback
1919
- : (result = classofRaw$1(O)) == 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
1934
+ : (result = classofRaw$1(O)) == 'Object' && isCallable$9(O.callee) ? 'Arguments' : result;
1920
1935
  };
1921
1936
 
1922
1937
  var classof$5 = classof$6;
1923
1938
 
1924
1939
  var $String$1 = String;
1925
1940
 
1926
- var toString$b = function (argument) {
1941
+ var toString$c = function (argument) {
1927
1942
  if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1928
1943
  return $String$1(argument);
1929
1944
  };
@@ -1932,12 +1947,12 @@ var toString$b = function (argument) {
1932
1947
  var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1933
1948
  '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1934
1949
 
1935
- var uncurryThis$g = functionUncurryThis;
1936
- var requireObjectCoercible$5 = requireObjectCoercible$8;
1937
- var toString$a = toString$b;
1950
+ var uncurryThis$h = functionUncurryThis;
1951
+ var requireObjectCoercible$6 = requireObjectCoercible$9;
1952
+ var toString$b = toString$c;
1938
1953
  var whitespaces$3 = whitespaces$4;
1939
1954
 
1940
- var replace$3 = uncurryThis$g(''.replace);
1955
+ var replace$3 = uncurryThis$h(''.replace);
1941
1956
  var whitespace = '[' + whitespaces$3 + ']';
1942
1957
  var ltrim = RegExp('^' + whitespace + whitespace + '*');
1943
1958
  var rtrim = RegExp(whitespace + whitespace + '*$');
@@ -1945,7 +1960,7 @@ var rtrim = RegExp(whitespace + whitespace + '*$');
1945
1960
  // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1946
1961
  var createMethod$1 = function (TYPE) {
1947
1962
  return function ($this) {
1948
- var string = toString$a(requireObjectCoercible$5($this));
1963
+ var string = toString$b(requireObjectCoercible$6($this));
1949
1964
  if (TYPE & 1) string = replace$3(string, ltrim, '');
1950
1965
  if (TYPE & 2) string = replace$3(string, rtrim, '');
1951
1966
  return string;
@@ -1980,13 +1995,13 @@ var stringTrimForced = function (METHOD_NAME) {
1980
1995
  });
1981
1996
  };
1982
1997
 
1983
- var $$g = _export;
1998
+ var $$h = _export;
1984
1999
  var $trim = stringTrim.trim;
1985
2000
  var forcedStringTrimMethod = stringTrimForced;
1986
2001
 
1987
2002
  // `String.prototype.trim` method
1988
2003
  // https://tc39.es/ecma262/#sec-string.prototype.trim
1989
- $$g({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
2004
+ $$h({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1990
2005
  trim: function trim() {
1991
2006
  return $trim(this);
1992
2007
  }
@@ -2066,9 +2081,9 @@ var regexpUnsupportedNcg = fails$a(function () {
2066
2081
 
2067
2082
  /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
2068
2083
  /* eslint-disable regexp/no-useless-quantifier -- testing */
2069
- var call$c = functionCall;
2070
- var uncurryThis$f = functionUncurryThis;
2071
- var toString$9 = toString$b;
2084
+ var call$d = functionCall;
2085
+ var uncurryThis$g = functionUncurryThis;
2086
+ var toString$a = toString$c;
2072
2087
  var regexpFlags = regexpFlags$1;
2073
2088
  var stickyHelpers = regexpStickyHelpers;
2074
2089
  var shared = shared$4.exports;
@@ -2080,16 +2095,16 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
2080
2095
  var nativeReplace = shared('native-string-replace', String.prototype.replace);
2081
2096
  var nativeExec = RegExp.prototype.exec;
2082
2097
  var patchedExec = nativeExec;
2083
- var charAt$4 = uncurryThis$f(''.charAt);
2084
- var indexOf = uncurryThis$f(''.indexOf);
2085
- var replace$2 = uncurryThis$f(''.replace);
2086
- var stringSlice$5 = uncurryThis$f(''.slice);
2098
+ var charAt$4 = uncurryThis$g(''.charAt);
2099
+ var indexOf$1 = uncurryThis$g(''.indexOf);
2100
+ var replace$2 = uncurryThis$g(''.replace);
2101
+ var stringSlice$6 = uncurryThis$g(''.slice);
2087
2102
 
2088
2103
  var UPDATES_LAST_INDEX_WRONG = (function () {
2089
2104
  var re1 = /a/;
2090
2105
  var re2 = /b*/g;
2091
- call$c(nativeExec, re1, 'a');
2092
- call$c(nativeExec, re2, 'a');
2106
+ call$d(nativeExec, re1, 'a');
2107
+ call$d(nativeExec, re2, 'a');
2093
2108
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2094
2109
  })();
2095
2110
 
@@ -2104,31 +2119,31 @@ if (PATCH) {
2104
2119
  patchedExec = function exec(string) {
2105
2120
  var re = this;
2106
2121
  var state = getInternalState(re);
2107
- var str = toString$9(string);
2122
+ var str = toString$a(string);
2108
2123
  var raw = state.raw;
2109
2124
  var result, reCopy, lastIndex, match, i, object, group;
2110
2125
 
2111
2126
  if (raw) {
2112
2127
  raw.lastIndex = re.lastIndex;
2113
- result = call$c(patchedExec, raw, str);
2128
+ result = call$d(patchedExec, raw, str);
2114
2129
  re.lastIndex = raw.lastIndex;
2115
2130
  return result;
2116
2131
  }
2117
2132
 
2118
2133
  var groups = state.groups;
2119
2134
  var sticky = UNSUPPORTED_Y && re.sticky;
2120
- var flags = call$c(regexpFlags, re);
2135
+ var flags = call$d(regexpFlags, re);
2121
2136
  var source = re.source;
2122
2137
  var charsAdded = 0;
2123
2138
  var strCopy = str;
2124
2139
 
2125
2140
  if (sticky) {
2126
2141
  flags = replace$2(flags, 'y', '');
2127
- if (indexOf(flags, 'g') === -1) {
2142
+ if (indexOf$1(flags, 'g') === -1) {
2128
2143
  flags += 'g';
2129
2144
  }
2130
2145
 
2131
- strCopy = stringSlice$5(str, re.lastIndex);
2146
+ strCopy = stringSlice$6(str, re.lastIndex);
2132
2147
  // Support anchored sticky behavior.
2133
2148
  if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
2134
2149
  source = '(?: ' + source + ')';
@@ -2145,12 +2160,12 @@ if (PATCH) {
2145
2160
  }
2146
2161
  if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2147
2162
 
2148
- match = call$c(nativeExec, sticky ? reCopy : re, strCopy);
2163
+ match = call$d(nativeExec, sticky ? reCopy : re, strCopy);
2149
2164
 
2150
2165
  if (sticky) {
2151
2166
  if (match) {
2152
- match.input = stringSlice$5(match.input, charsAdded);
2153
- match[0] = stringSlice$5(match[0], charsAdded);
2167
+ match.input = stringSlice$6(match.input, charsAdded);
2168
+ match[0] = stringSlice$6(match[0], charsAdded);
2154
2169
  match.index = re.lastIndex;
2155
2170
  re.lastIndex += match[0].length;
2156
2171
  } else re.lastIndex = 0;
@@ -2160,7 +2175,7 @@ if (PATCH) {
2160
2175
  if (NPCG_INCLUDED && match && match.length > 1) {
2161
2176
  // Fix browsers whose `exec` methods don't consistently return `undefined`
2162
2177
  // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
2163
- call$c(nativeReplace, match[0], reCopy, function () {
2178
+ call$d(nativeReplace, match[0], reCopy, function () {
2164
2179
  for (i = 1; i < arguments.length - 2; i++) {
2165
2180
  if (arguments[i] === undefined) match[i] = undefined;
2166
2181
  }
@@ -2181,12 +2196,12 @@ if (PATCH) {
2181
2196
 
2182
2197
  var regexpExec$2 = patchedExec;
2183
2198
 
2184
- var $$f = _export;
2199
+ var $$g = _export;
2185
2200
  var exec$2 = regexpExec$2;
2186
2201
 
2187
2202
  // `RegExp.prototype.exec` method
2188
2203
  // https://tc39.es/ecma262/#sec-regexp.prototype.exec
2189
- $$f({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2204
+ $$g({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2190
2205
  exec: exec$2
2191
2206
  });
2192
2207
 
@@ -2194,37 +2209,37 @@ var NATIVE_BIND$1 = functionBindNative;
2194
2209
 
2195
2210
  var FunctionPrototype = Function.prototype;
2196
2211
  var apply$2 = FunctionPrototype.apply;
2197
- var call$b = FunctionPrototype.call;
2212
+ var call$c = FunctionPrototype.call;
2198
2213
 
2199
2214
  // eslint-disable-next-line es/no-reflect -- safe
2200
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$b.bind(apply$2) : function () {
2201
- return call$b.apply(apply$2, arguments);
2215
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$c.bind(apply$2) : function () {
2216
+ return call$c.apply(apply$2, arguments);
2202
2217
  });
2203
2218
 
2204
2219
  var classofRaw = classofRaw$2;
2205
- var uncurryThis$e = functionUncurryThis;
2220
+ var uncurryThis$f = functionUncurryThis;
2206
2221
 
2207
2222
  var functionUncurryThisClause = function (fn) {
2208
2223
  // Nashorn bug:
2209
2224
  // https://github.com/zloirock/core-js/issues/1128
2210
2225
  // https://github.com/zloirock/core-js/issues/1130
2211
- if (classofRaw(fn) === 'Function') return uncurryThis$e(fn);
2226
+ if (classofRaw(fn) === 'Function') return uncurryThis$f(fn);
2212
2227
  };
2213
2228
 
2214
2229
  // TODO: Remove from `core-js@4` since it's moved to entry points
2215
2230
 
2216
- var uncurryThis$d = functionUncurryThisClause;
2231
+ var uncurryThis$e = functionUncurryThisClause;
2217
2232
  var defineBuiltIn$3 = defineBuiltIn$7;
2218
2233
  var regexpExec$1 = regexpExec$2;
2219
2234
  var fails$9 = fails$q;
2220
- var wellKnownSymbol$a = wellKnownSymbol$j;
2235
+ var wellKnownSymbol$b = wellKnownSymbol$k;
2221
2236
  var createNonEnumerableProperty = createNonEnumerableProperty$5;
2222
2237
 
2223
- var SPECIES$4 = wellKnownSymbol$a('species');
2238
+ var SPECIES$4 = wellKnownSymbol$b('species');
2224
2239
  var RegExpPrototype$2 = RegExp.prototype;
2225
2240
 
2226
2241
  var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2227
- var SYMBOL = wellKnownSymbol$a(KEY);
2242
+ var SYMBOL = wellKnownSymbol$b(KEY);
2228
2243
 
2229
2244
  var DELEGATES_TO_SYMBOL = !fails$9(function () {
2230
2245
  // String methods call symbol-named RegEp methods
@@ -2262,9 +2277,9 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2262
2277
  !DELEGATES_TO_EXEC ||
2263
2278
  FORCED
2264
2279
  ) {
2265
- var uncurriedNativeRegExpMethod = uncurryThis$d(/./[SYMBOL]);
2280
+ var uncurriedNativeRegExpMethod = uncurryThis$e(/./[SYMBOL]);
2266
2281
  var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2267
- var uncurriedNativeMethod = uncurryThis$d(nativeMethod);
2282
+ var uncurriedNativeMethod = uncurryThis$e(nativeMethod);
2268
2283
  var $exec = regexp.exec;
2269
2284
  if ($exec === regexpExec$1 || $exec === RegExpPrototype$2.exec) {
2270
2285
  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
@@ -2285,18 +2300,18 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2285
2300
  if (SHAM) createNonEnumerableProperty(RegExpPrototype$2[SYMBOL], 'sham', true);
2286
2301
  };
2287
2302
 
2288
- var uncurryThis$c = functionUncurryThis;
2303
+ var uncurryThis$d = functionUncurryThis;
2289
2304
  var toIntegerOrInfinity$3 = toIntegerOrInfinity$6;
2290
- var toString$8 = toString$b;
2291
- var requireObjectCoercible$4 = requireObjectCoercible$8;
2305
+ var toString$9 = toString$c;
2306
+ var requireObjectCoercible$5 = requireObjectCoercible$9;
2292
2307
 
2293
- var charAt$3 = uncurryThis$c(''.charAt);
2294
- var charCodeAt = uncurryThis$c(''.charCodeAt);
2295
- var stringSlice$4 = uncurryThis$c(''.slice);
2308
+ var charAt$3 = uncurryThis$d(''.charAt);
2309
+ var charCodeAt = uncurryThis$d(''.charCodeAt);
2310
+ var stringSlice$5 = uncurryThis$d(''.slice);
2296
2311
 
2297
2312
  var createMethod = function (CONVERT_TO_STRING) {
2298
2313
  return function ($this, pos) {
2299
- var S = toString$8(requireObjectCoercible$4($this));
2314
+ var S = toString$9(requireObjectCoercible$5($this));
2300
2315
  var position = toIntegerOrInfinity$3(pos);
2301
2316
  var size = S.length;
2302
2317
  var first, second;
@@ -2308,7 +2323,7 @@ var createMethod = function (CONVERT_TO_STRING) {
2308
2323
  ? charAt$3(S, position)
2309
2324
  : first
2310
2325
  : CONVERT_TO_STRING
2311
- ? stringSlice$4(S, position, position + 2)
2326
+ ? stringSlice$5(S, position, position + 2)
2312
2327
  : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2313
2328
  };
2314
2329
  };
@@ -2330,19 +2345,19 @@ var advanceStringIndex$2 = function (S, index, unicode) {
2330
2345
  return index + (unicode ? charAt$2(S, index).length : 1);
2331
2346
  };
2332
2347
 
2333
- var uncurryThis$b = functionUncurryThis;
2348
+ var uncurryThis$c = functionUncurryThis;
2334
2349
  var toObject$2 = toObject$7;
2335
2350
 
2336
2351
  var floor$2 = Math.floor;
2337
- var charAt$1 = uncurryThis$b(''.charAt);
2338
- var replace$1 = uncurryThis$b(''.replace);
2339
- var stringSlice$3 = uncurryThis$b(''.slice);
2352
+ var charAt$1 = uncurryThis$c(''.charAt);
2353
+ var replace$1 = uncurryThis$c(''.replace);
2354
+ var stringSlice$4 = uncurryThis$c(''.slice);
2340
2355
  var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2341
2356
  var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2342
2357
 
2343
2358
  // `GetSubstitution` abstract operation
2344
2359
  // https://tc39.es/ecma262/#sec-getsubstitution
2345
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
2360
+ var getSubstitution$2 = function (matched, str, position, captures, namedCaptures, replacement) {
2346
2361
  var tailPos = position + matched.length;
2347
2362
  var m = captures.length;
2348
2363
  var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
@@ -2355,10 +2370,10 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
2355
2370
  switch (charAt$1(ch, 0)) {
2356
2371
  case '$': return '$';
2357
2372
  case '&': return matched;
2358
- case '`': return stringSlice$3(str, 0, position);
2359
- case "'": return stringSlice$3(str, tailPos);
2373
+ case '`': return stringSlice$4(str, 0, position);
2374
+ case "'": return stringSlice$4(str, tailPos);
2360
2375
  case '<':
2361
- capture = namedCaptures[stringSlice$3(ch, 1, -1)];
2376
+ capture = namedCaptures[stringSlice$4(ch, 1, -1)];
2362
2377
  break;
2363
2378
  default: // \d\d?
2364
2379
  var n = +ch;
@@ -2375,52 +2390,52 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
2375
2390
  });
2376
2391
  };
2377
2392
 
2378
- var call$a = functionCall;
2393
+ var call$b = functionCall;
2379
2394
  var anObject$8 = anObject$f;
2380
- var isCallable$7 = isCallable$n;
2395
+ var isCallable$8 = isCallable$o;
2381
2396
  var classof$4 = classofRaw$2;
2382
2397
  var regexpExec = regexpExec$2;
2383
2398
 
2384
- var $TypeError$9 = TypeError;
2399
+ var $TypeError$a = TypeError;
2385
2400
 
2386
2401
  // `RegExpExec` abstract operation
2387
2402
  // https://tc39.es/ecma262/#sec-regexpexec
2388
2403
  var regexpExecAbstract = function (R, S) {
2389
2404
  var exec = R.exec;
2390
- if (isCallable$7(exec)) {
2391
- var result = call$a(exec, R, S);
2405
+ if (isCallable$8(exec)) {
2406
+ var result = call$b(exec, R, S);
2392
2407
  if (result !== null) anObject$8(result);
2393
2408
  return result;
2394
2409
  }
2395
- if (classof$4(R) === 'RegExp') return call$a(regexpExec, R, S);
2396
- throw $TypeError$9('RegExp#exec called on incompatible receiver');
2410
+ if (classof$4(R) === 'RegExp') return call$b(regexpExec, R, S);
2411
+ throw $TypeError$a('RegExp#exec called on incompatible receiver');
2397
2412
  };
2398
2413
 
2399
2414
  var apply$1 = functionApply;
2400
- var call$9 = functionCall;
2401
- var uncurryThis$a = functionUncurryThis;
2415
+ var call$a = functionCall;
2416
+ var uncurryThis$b = functionUncurryThis;
2402
2417
  var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
2403
2418
  var fails$8 = fails$q;
2404
2419
  var anObject$7 = anObject$f;
2405
- var isCallable$6 = isCallable$n;
2406
- var isNullOrUndefined$3 = isNullOrUndefined$6;
2420
+ var isCallable$7 = isCallable$o;
2421
+ var isNullOrUndefined$4 = isNullOrUndefined$7;
2407
2422
  var toIntegerOrInfinity$2 = toIntegerOrInfinity$6;
2408
2423
  var toLength$1 = toLength$3;
2409
- var toString$7 = toString$b;
2410
- var requireObjectCoercible$3 = requireObjectCoercible$8;
2424
+ var toString$8 = toString$c;
2425
+ var requireObjectCoercible$4 = requireObjectCoercible$9;
2411
2426
  var advanceStringIndex$1 = advanceStringIndex$2;
2412
- var getMethod$3 = getMethod$5;
2413
- var getSubstitution = getSubstitution$1;
2427
+ var getMethod$4 = getMethod$6;
2428
+ var getSubstitution$1 = getSubstitution$2;
2414
2429
  var regExpExec$1 = regexpExecAbstract;
2415
- var wellKnownSymbol$9 = wellKnownSymbol$j;
2430
+ var wellKnownSymbol$a = wellKnownSymbol$k;
2416
2431
 
2417
- var REPLACE = wellKnownSymbol$9('replace');
2418
- var max$1 = Math.max;
2432
+ var REPLACE$1 = wellKnownSymbol$a('replace');
2433
+ var max$2 = Math.max;
2419
2434
  var min = Math.min;
2420
- var concat = uncurryThis$a([].concat);
2421
- var push$1 = uncurryThis$a([].push);
2422
- var stringIndexOf$1 = uncurryThis$a(''.indexOf);
2423
- var stringSlice$2 = uncurryThis$a(''.slice);
2435
+ var concat = uncurryThis$b([].concat);
2436
+ var push$1 = uncurryThis$b([].push);
2437
+ var stringIndexOf$2 = uncurryThis$b(''.indexOf);
2438
+ var stringSlice$3 = uncurryThis$b(''.slice);
2424
2439
 
2425
2440
  var maybeToString = function (it) {
2426
2441
  return it === undefined ? it : String(it);
@@ -2435,8 +2450,8 @@ var REPLACE_KEEPS_$0 = (function () {
2435
2450
 
2436
2451
  // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2437
2452
  var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2438
- if (/./[REPLACE]) {
2439
- return /./[REPLACE]('a', '$0') === '';
2453
+ if (/./[REPLACE$1]) {
2454
+ return /./[REPLACE$1]('a', '$0') === '';
2440
2455
  }
2441
2456
  return false;
2442
2457
  })();
@@ -2460,29 +2475,29 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2460
2475
  // `String.prototype.replace` method
2461
2476
  // https://tc39.es/ecma262/#sec-string.prototype.replace
2462
2477
  function replace(searchValue, replaceValue) {
2463
- var O = requireObjectCoercible$3(this);
2464
- var replacer = isNullOrUndefined$3(searchValue) ? undefined : getMethod$3(searchValue, REPLACE);
2478
+ var O = requireObjectCoercible$4(this);
2479
+ var replacer = isNullOrUndefined$4(searchValue) ? undefined : getMethod$4(searchValue, REPLACE$1);
2465
2480
  return replacer
2466
- ? call$9(replacer, searchValue, O, replaceValue)
2467
- : call$9(nativeReplace, toString$7(O), searchValue, replaceValue);
2481
+ ? call$a(replacer, searchValue, O, replaceValue)
2482
+ : call$a(nativeReplace, toString$8(O), searchValue, replaceValue);
2468
2483
  },
2469
2484
  // `RegExp.prototype[@@replace]` method
2470
2485
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2471
2486
  function (string, replaceValue) {
2472
2487
  var rx = anObject$7(this);
2473
- var S = toString$7(string);
2488
+ var S = toString$8(string);
2474
2489
 
2475
2490
  if (
2476
2491
  typeof replaceValue == 'string' &&
2477
- stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2478
- stringIndexOf$1(replaceValue, '$<') === -1
2492
+ stringIndexOf$2(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2493
+ stringIndexOf$2(replaceValue, '$<') === -1
2479
2494
  ) {
2480
2495
  var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2481
2496
  if (res.done) return res.value;
2482
2497
  }
2483
2498
 
2484
- var functionalReplace = isCallable$6(replaceValue);
2485
- if (!functionalReplace) replaceValue = toString$7(replaceValue);
2499
+ var functionalReplace = isCallable$7(replaceValue);
2500
+ if (!functionalReplace) replaceValue = toString$8(replaceValue);
2486
2501
 
2487
2502
  var global = rx.global;
2488
2503
  if (global) {
@@ -2497,7 +2512,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2497
2512
  push$1(results, result);
2498
2513
  if (!global) break;
2499
2514
 
2500
- var matchStr = toString$7(result[0]);
2515
+ var matchStr = toString$8(result[0]);
2501
2516
  if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
2502
2517
  }
2503
2518
 
@@ -2506,8 +2521,8 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2506
2521
  for (var i = 0; i < results.length; i++) {
2507
2522
  result = results[i];
2508
2523
 
2509
- var matched = toString$7(result[0]);
2510
- var position = max$1(min(toIntegerOrInfinity$2(result.index), S.length), 0);
2524
+ var matched = toString$8(result[0]);
2525
+ var position = max$2(min(toIntegerOrInfinity$2(result.index), S.length), 0);
2511
2526
  var captures = [];
2512
2527
  // NOTE: This is equivalent to
2513
2528
  // captures = result.slice(1).map(maybeToString)
@@ -2519,16 +2534,16 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2519
2534
  if (functionalReplace) {
2520
2535
  var replacerArgs = concat([matched], captures, position, S);
2521
2536
  if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
2522
- var replacement = toString$7(apply$1(replaceValue, undefined, replacerArgs));
2537
+ var replacement = toString$8(apply$1(replaceValue, undefined, replacerArgs));
2523
2538
  } else {
2524
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2539
+ replacement = getSubstitution$1(matched, S, position, captures, namedCaptures, replaceValue);
2525
2540
  }
2526
2541
  if (position >= nextSourcePosition) {
2527
- accumulatedResult += stringSlice$2(S, nextSourcePosition, position) + replacement;
2542
+ accumulatedResult += stringSlice$3(S, nextSourcePosition, position) + replacement;
2528
2543
  nextSourcePosition = position + matched.length;
2529
2544
  }
2530
2545
  }
2531
- return accumulatedResult + stringSlice$2(S, nextSourcePosition);
2546
+ return accumulatedResult + stringSlice$3(S, nextSourcePosition);
2532
2547
  }
2533
2548
  ];
2534
2549
  }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
@@ -2588,16 +2603,18 @@ const hasEuCustomsRules = true,
2588
2603
  // United States territories that ship domestic but require customs
2589
2604
  // https://blog.stamps.com/2015/09/23/how-to-ship-packages-to-u-s-territories/
2590
2605
  isUnitedStatesTerritory$1 = true,
2606
+ isUnsupportedByUps$1 = true,
2591
2607
  supportsByoa = true;
2592
2608
  class Country {
2593
2609
  constructor(name, code, rules = {}) {
2594
- var _a, _b, _c, _d;
2610
+ var _a, _b, _c, _d, _e;
2595
2611
  this.name = name;
2596
2612
  this.code = code;
2597
2613
  this.hasEuCustomsRules = (_a = rules.hasEuCustomsRules) !== null && _a !== void 0 ? _a : false;
2598
2614
  this.hasProvinces = (_b = rules.hasProvinces) !== null && _b !== void 0 ? _b : false;
2599
2615
  this.isUnitedStatesTerritory = (_c = rules.isUnitedStatesTerritory) !== null && _c !== void 0 ? _c : false;
2600
2616
  this.supportsByoa = (_d = rules.supportsByoa) !== null && _d !== void 0 ? _d : false;
2617
+ this.isUnsupportedByUps = (_e = rules.isUnsupportedByUps) !== null && _e !== void 0 ? _e : false;
2601
2618
  }
2602
2619
  }
2603
2620
  const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands", "AX"), new Country("Albania", "AL"), new Country("Algeria", "DZ"), new Country("American Samoa", "AS", {
@@ -2618,7 +2635,9 @@ const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands"
2618
2635
  supportsByoa
2619
2636
  }), new Country("Burkina Faso", "BF"), new Country("Burundi", "BI"), new Country("Canada", "CA", {
2620
2637
  hasProvinces
2621
- }), new Country("Cambodia", "KH"), new Country("Cameroon", "CM"), new Country("Cape Verde Islands", "CV"), new Country("Cayman Islands", "KY"), new Country("Central African Republic", "CF"), new Country("Chad", "TD"), new Country("Chile", "CL"), new Country("China", "CN"), new Country("Christmas Island", "CX"), new Country("Cocos(Keeling) Islands", "CC"), new Country("Colombia", "CO"), new Country("Comoros", "KM"), new Country("Congo", "CG"), new Country("Congo, The Democratic Republic of", "CD"), new Country("Cook Islands", "CK"), new Country("Costa Rica", "CR"), new Country("Croatia", "HR", {
2638
+ }), new Country("Cambodia", "KH", {
2639
+ isUnsupportedByUps: isUnsupportedByUps$1
2640
+ }), new Country("Cameroon", "CM"), new Country("Cape Verde Islands", "CV"), new Country("Cayman Islands", "KY"), new Country("Central African Republic", "CF"), new Country("Chad", "TD"), new Country("Chile", "CL"), new Country("China", "CN"), new Country("Christmas Island", "CX"), new Country("Cocos(Keeling) Islands", "CC"), new Country("Colombia", "CO"), new Country("Comoros", "KM"), new Country("Congo", "CG"), new Country("Congo, The Democratic Republic of", "CD"), new Country("Cook Islands", "CK"), new Country("Costa Rica", "CR"), new Country("Croatia", "HR", {
2622
2641
  hasEuCustomsRules,
2623
2642
  supportsByoa
2624
2643
  }), new Country("Cuba", "CU"), new Country("Curacao", "CW"), new Country("Cyprus", "CY", {
@@ -2679,7 +2698,9 @@ const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands"
2679
2698
  }), new Country("Moldova", "MD"), new Country("Monaco", "MC"), new Country("Mongolia", "MN"), new Country("Montenegro", "ME"), new Country("Montserrat", "MS"), new Country("Morocco", "MA"), new Country("Mozambique", "MZ"), new Country("Myanmar", "MM"), new Country("Namibia", "NA"), new Country("Nauru", "NR"), new Country("Nepal", "NP"), new Country("Netherlands", "NL", {
2680
2699
  hasEuCustomsRules,
2681
2700
  supportsByoa
2682
- }), new Country("Netherlands Antilles", "AN"), new Country("New Caledonia", "NC"), new Country("New Zealand", "NZ", {
2701
+ }), new Country("Netherlands Antilles", "AN"), new Country("New Caledonia", "NC", {
2702
+ isUnsupportedByUps: isUnsupportedByUps$1
2703
+ }), new Country("New Zealand", "NZ", {
2683
2704
  supportsByoa
2684
2705
  }), new Country("Nicaragua", "NI"), new Country("Niger", "NE"), new Country("Nigeria", "NG"), new Country("Niue", "NU"), new Country("Norfolk Island", "NF"), new Country("North Korea", "KP"), new Country("Northern Mariana Islands", "MP", {
2685
2706
  isUnitedStatesTerritory: isUnitedStatesTerritory$1
@@ -2796,6 +2817,13 @@ const isUnitedStatesTerritory = address => {
2796
2817
  var _a, _b;
2797
2818
  return !!(((_a = countries.find(c => c.code === address.countryCode)) === null || _a === void 0 ? void 0 : _a.isUnitedStatesTerritory) || ((_b = usStates.find(s => s.code === address.stateProvince)) === null || _b === void 0 ? void 0 : _b.isUnitedStatesTerritory));
2798
2819
  };
2820
+ /**
2821
+ * @category Utilities
2822
+ */
2823
+ const isUnsupportedByUps = address => {
2824
+ var _a;
2825
+ return !!((_a = countries.find(c => c.code === address.countryCode)) === null || _a === void 0 ? void 0 : _a.isUnsupportedByUps);
2826
+ };
2799
2827
  const PO_BOX_REGEX =
2800
2828
  // eslint-disable-next-line no-useless-escape
2801
2829
  /^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i;
@@ -2808,7 +2836,7 @@ const isPoBox = addressLine => PO_BOX_REGEX.test(addressLine);
2808
2836
  */
2809
2837
  const isPoBoxAddress = address => !!(isPoBox(address.addressLine1) || address.addressLine2 && isPoBox(address.addressLine2));
2810
2838
 
2811
- var $$e = _export;
2839
+ var $$f = _export;
2812
2840
  var $includes = arrayIncludes.includes;
2813
2841
  var fails$7 = fails$q;
2814
2842
  var addToUnscopables$1 = addToUnscopables$3;
@@ -2820,7 +2848,7 @@ var BROKEN_ON_SPARSE = fails$7(function () {
2820
2848
 
2821
2849
  // `Array.prototype.includes` method
2822
2850
  // https://tc39.es/ecma262/#sec-array.prototype.includes
2823
- $$e({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2851
+ $$f({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2824
2852
  includes: function includes(el /* , fromIndex = 0 */) {
2825
2853
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2826
2854
  }
@@ -2831,6 +2859,7 @@ addToUnscopables$1('includes');
2831
2859
 
2832
2860
  const USPS_CARRIER_CODES = ["usps", "stamps_com"];
2833
2861
  const isUspsCarrier = carrierCode => USPS_CARRIER_CODES.includes(carrierCode);
2862
+ const isUpsCarrier = carrierCode => carrierCode === "ups";
2834
2863
 
2835
2864
  function convertDimensions(dimensions, {
2836
2865
  allowAllZeroes
@@ -2895,10 +2924,10 @@ const getSalesOrderItemsFromSalesOrderOrShipment = ({
2895
2924
 
2896
2925
  var tryToString$3 = tryToString$5;
2897
2926
 
2898
- var $TypeError$8 = TypeError;
2927
+ var $TypeError$9 = TypeError;
2899
2928
 
2900
2929
  var deletePropertyOrThrow$1 = function (O, P) {
2901
- if (!delete O[P]) throw $TypeError$8('Cannot delete property ' + tryToString$3(P) + ' of ' + tryToString$3(O));
2930
+ if (!delete O[P]) throw $TypeError$9('Cannot delete property ' + tryToString$3(P) + ' of ' + tryToString$3(O));
2902
2931
  };
2903
2932
 
2904
2933
  var toPropertyKey = toPropertyKey$3;
@@ -2916,13 +2945,13 @@ var lengthOfArrayLike$4 = lengthOfArrayLike$7;
2916
2945
  var createProperty$1 = createProperty$2;
2917
2946
 
2918
2947
  var $Array$1 = Array;
2919
- var max = Math.max;
2948
+ var max$1 = Math.max;
2920
2949
 
2921
2950
  var arraySliceSimple = function (O, start, end) {
2922
2951
  var length = lengthOfArrayLike$4(O);
2923
2952
  var k = toAbsoluteIndex(start, length);
2924
2953
  var fin = toAbsoluteIndex(end === undefined ? length : end, length);
2925
- var result = $Array$1(max(fin - k, 0));
2954
+ var result = $Array$1(max$1(fin - k, 0));
2926
2955
  for (var n = 0; k < fin; k++, n++) createProperty$1(result, n, O[k]);
2927
2956
  result.length = n;
2928
2957
  return result;
@@ -2989,13 +3018,13 @@ var webkit = userAgent$3.match(/AppleWebKit\/(\d+)\./);
2989
3018
 
2990
3019
  var engineWebkitVersion = !!webkit && +webkit[1];
2991
3020
 
2992
- var $$d = _export;
2993
- var uncurryThis$9 = functionUncurryThis;
3021
+ var $$e = _export;
3022
+ var uncurryThis$a = functionUncurryThis;
2994
3023
  var aCallable$7 = aCallable$a;
2995
3024
  var toObject$1 = toObject$7;
2996
3025
  var lengthOfArrayLike$3 = lengthOfArrayLike$7;
2997
3026
  var deletePropertyOrThrow = deletePropertyOrThrow$1;
2998
- var toString$6 = toString$b;
3027
+ var toString$7 = toString$c;
2999
3028
  var fails$6 = fails$q;
3000
3029
  var internalSort = arraySort;
3001
3030
  var arrayMethodIsStrict = arrayMethodIsStrict$2;
@@ -3005,8 +3034,8 @@ var V8 = engineV8Version;
3005
3034
  var WEBKIT = engineWebkitVersion;
3006
3035
 
3007
3036
  var test = [];
3008
- var nativeSort = uncurryThis$9(test.sort);
3009
- var push = uncurryThis$9(test.push);
3037
+ var nativeSort = uncurryThis$a(test.sort);
3038
+ var push = uncurryThis$a(test.push);
3010
3039
 
3011
3040
  // IE8-
3012
3041
  var FAILS_ON_UNDEFINED = fails$6(function () {
@@ -3061,13 +3090,13 @@ var getSortCompare = function (comparefn) {
3061
3090
  if (y === undefined) return -1;
3062
3091
  if (x === undefined) return 1;
3063
3092
  if (comparefn !== undefined) return +comparefn(x, y) || 0;
3064
- return toString$6(x) > toString$6(y) ? 1 : -1;
3093
+ return toString$7(x) > toString$7(y) ? 1 : -1;
3065
3094
  };
3066
3095
  };
3067
3096
 
3068
3097
  // `Array.prototype.sort` method
3069
3098
  // https://tc39.es/ecma262/#sec-array.prototype.sort
3070
- $$d({ target: 'Array', proto: true, forced: FORCED$3 }, {
3099
+ $$e({ target: 'Array', proto: true, forced: FORCED$3 }, {
3071
3100
  sort: function sort(comparefn) {
3072
3101
  if (comparefn !== undefined) aCallable$7(comparefn);
3073
3102
 
@@ -3145,9 +3174,9 @@ function formatFractionalWeight(weight) {
3145
3174
 
3146
3175
  var isObject$3 = isObject$a;
3147
3176
  var classof$3 = classofRaw$2;
3148
- var wellKnownSymbol$8 = wellKnownSymbol$j;
3177
+ var wellKnownSymbol$9 = wellKnownSymbol$k;
3149
3178
 
3150
- var MATCH$1 = wellKnownSymbol$8('match');
3179
+ var MATCH$1 = wellKnownSymbol$9('match');
3151
3180
 
3152
3181
  // `IsRegExp` abstract operation
3153
3182
  // https://tc39.es/ecma262/#sec-isregexp
@@ -3156,19 +3185,19 @@ var isRegexp = function (it) {
3156
3185
  return isObject$3(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$3(it) == 'RegExp');
3157
3186
  };
3158
3187
 
3159
- var isRegExp = isRegexp;
3188
+ var isRegExp$1 = isRegexp;
3160
3189
 
3161
- var $TypeError$7 = TypeError;
3190
+ var $TypeError$8 = TypeError;
3162
3191
 
3163
3192
  var notARegexp = function (it) {
3164
- if (isRegExp(it)) {
3165
- throw $TypeError$7("The method doesn't accept regular expressions");
3193
+ if (isRegExp$1(it)) {
3194
+ throw $TypeError$8("The method doesn't accept regular expressions");
3166
3195
  } return it;
3167
3196
  };
3168
3197
 
3169
- var wellKnownSymbol$7 = wellKnownSymbol$j;
3198
+ var wellKnownSymbol$8 = wellKnownSymbol$k;
3170
3199
 
3171
- var MATCH = wellKnownSymbol$7('match');
3200
+ var MATCH = wellKnownSymbol$8('match');
3172
3201
 
3173
3202
  var correctIsRegexpLogic = function (METHOD_NAME) {
3174
3203
  var regexp = /./;
@@ -3182,22 +3211,22 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
3182
3211
  } return false;
3183
3212
  };
3184
3213
 
3185
- var $$c = _export;
3186
- var uncurryThis$8 = functionUncurryThis;
3214
+ var $$d = _export;
3215
+ var uncurryThis$9 = functionUncurryThis;
3187
3216
  var notARegExp = notARegexp;
3188
- var requireObjectCoercible$2 = requireObjectCoercible$8;
3189
- var toString$5 = toString$b;
3217
+ var requireObjectCoercible$3 = requireObjectCoercible$9;
3218
+ var toString$6 = toString$c;
3190
3219
  var correctIsRegExpLogic = correctIsRegexpLogic;
3191
3220
 
3192
- var stringIndexOf = uncurryThis$8(''.indexOf);
3221
+ var stringIndexOf$1 = uncurryThis$9(''.indexOf);
3193
3222
 
3194
3223
  // `String.prototype.includes` method
3195
3224
  // https://tc39.es/ecma262/#sec-string.prototype.includes
3196
- $$c({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
3225
+ $$d({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
3197
3226
  includes: function includes(searchString /* , position = 0 */) {
3198
- return !!~stringIndexOf(
3199
- toString$5(requireObjectCoercible$2(this)),
3200
- toString$5(notARegExp(searchString)),
3227
+ return !!~stringIndexOf$1(
3228
+ toString$6(requireObjectCoercible$3(this)),
3229
+ toString$6(notARegExp(searchString)),
3201
3230
  arguments.length > 1 ? arguments[1] : undefined
3202
3231
  );
3203
3232
  }
@@ -3516,6 +3545,16 @@ const CheckboxInput = _a => {
3516
3545
  };
3517
3546
 
3518
3547
  const getOverrideStyles = theme => ({
3548
+ "&& .react-datepicker__aria-live": {
3549
+ // Hide aria alerts that are for screen readers in a way screen readers can still read them
3550
+ clip: "rect(0 0 0 0)",
3551
+ clipPath: "inset(50%)",
3552
+ height: "1px",
3553
+ overflow: "hidden",
3554
+ position: "absolute",
3555
+ whiteSpace: "nowrap",
3556
+ width: "1px"
3557
+ },
3519
3558
  "&& input, && span[role='button']": {
3520
3559
  cursor: "auto",
3521
3560
  fontWeight: theme.typography.fontWeight.normal
@@ -3563,6 +3602,131 @@ const CreditCardInput = fieldProps => jsx(CreditCardInputController, Object.assi
3563
3602
  }
3564
3603
  }));
3565
3604
 
3605
+ var call$9 = functionCall;
3606
+ var hasOwn$2 = hasOwnProperty_1;
3607
+ var isPrototypeOf$3 = objectIsPrototypeOf;
3608
+ var regExpFlags = regexpFlags$1;
3609
+
3610
+ var RegExpPrototype$1 = RegExp.prototype;
3611
+
3612
+ var regexpGetFlags = function (R) {
3613
+ var flags = R.flags;
3614
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
3615
+ ? call$9(regExpFlags, R) : flags;
3616
+ };
3617
+
3618
+ var $$c = _export;
3619
+ var call$8 = functionCall;
3620
+ var uncurryThis$8 = functionUncurryThis;
3621
+ var requireObjectCoercible$2 = requireObjectCoercible$9;
3622
+ var isCallable$6 = isCallable$o;
3623
+ var isNullOrUndefined$3 = isNullOrUndefined$7;
3624
+ var isRegExp = isRegexp;
3625
+ var toString$5 = toString$c;
3626
+ var getMethod$3 = getMethod$6;
3627
+ var getRegExpFlags$1 = regexpGetFlags;
3628
+ var getSubstitution = getSubstitution$2;
3629
+ var wellKnownSymbol$7 = wellKnownSymbol$k;
3630
+
3631
+ var REPLACE = wellKnownSymbol$7('replace');
3632
+ var $TypeError$7 = TypeError;
3633
+ var indexOf = uncurryThis$8(''.indexOf);
3634
+ uncurryThis$8(''.replace);
3635
+ var stringSlice$2 = uncurryThis$8(''.slice);
3636
+ var max = Math.max;
3637
+
3638
+ var stringIndexOf = function (string, searchValue, fromIndex) {
3639
+ if (fromIndex > string.length) return -1;
3640
+ if (searchValue === '') return fromIndex;
3641
+ return indexOf(string, searchValue, fromIndex);
3642
+ };
3643
+
3644
+ // `String.prototype.replaceAll` method
3645
+ // https://tc39.es/ecma262/#sec-string.prototype.replaceall
3646
+ $$c({ target: 'String', proto: true }, {
3647
+ replaceAll: function replaceAll(searchValue, replaceValue) {
3648
+ var O = requireObjectCoercible$2(this);
3649
+ var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
3650
+ var position = 0;
3651
+ var endOfLastMatch = 0;
3652
+ var result = '';
3653
+ if (!isNullOrUndefined$3(searchValue)) {
3654
+ IS_REG_EXP = isRegExp(searchValue);
3655
+ if (IS_REG_EXP) {
3656
+ flags = toString$5(requireObjectCoercible$2(getRegExpFlags$1(searchValue)));
3657
+ if (!~indexOf(flags, 'g')) throw $TypeError$7('`.replaceAll` does not allow non-global regexes');
3658
+ }
3659
+ replacer = getMethod$3(searchValue, REPLACE);
3660
+ if (replacer) {
3661
+ return call$8(replacer, searchValue, O, replaceValue);
3662
+ }
3663
+ }
3664
+ string = toString$5(O);
3665
+ searchString = toString$5(searchValue);
3666
+ functionalReplace = isCallable$6(replaceValue);
3667
+ if (!functionalReplace) replaceValue = toString$5(replaceValue);
3668
+ searchLength = searchString.length;
3669
+ advanceBy = max(1, searchLength);
3670
+ position = stringIndexOf(string, searchString, 0);
3671
+ while (position !== -1) {
3672
+ replacement = functionalReplace
3673
+ ? toString$5(replaceValue(searchString, position, string))
3674
+ : getSubstitution(searchString, string, position, [], undefined, replaceValue);
3675
+ result += stringSlice$2(string, endOfLastMatch, position) + replacement;
3676
+ endOfLastMatch = position + searchLength;
3677
+ position = stringIndexOf(string, searchString, position + advanceBy);
3678
+ }
3679
+ if (endOfLastMatch < string.length) {
3680
+ result += stringSlice$2(string, endOfLastMatch);
3681
+ }
3682
+ return result;
3683
+ }
3684
+ });
3685
+
3686
+ var _a;
3687
+ let _LOCALE = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.language) !== null && _a !== void 0 ? _a : "en-US";
3688
+ const loadableLocale = _LOCALE.replaceAll("-", "");
3689
+ const loadableBackupLocale = _LOCALE.split("-")[0];
3690
+ let intlLocale = undefined;
3691
+ if (loadableLocale in Locales || loadableBackupLocale) {
3692
+ const targetLocale = loadableLocale in Locales ? loadableLocale : loadableBackupLocale;
3693
+ const l = Locales[targetLocale];
3694
+ registerLocale(_LOCALE, l);
3695
+ intlLocale = l;
3696
+ setDefaultLocale(_LOCALE);
3697
+ } else {
3698
+ // Really should never happen but this SHOULD revert to un-localized
3699
+ console.log(`User's navigator.language locale ${_LOCALE} could not be loaded because it was not found in date-fns.
3700
+ Backup attempt to load ${loadableBackupLocale} failed as well.
3701
+ Reverting to en-US.`);
3702
+ _LOCALE = "en-US";
3703
+ }
3704
+ const usaLocale = Locales["enUS"];
3705
+ const LOCALE = _LOCALE;
3706
+ /**
3707
+ * Parse a string in the CURRENT locale into a Date object.
3708
+ * current locale is determined by navigator.language for now
3709
+ * @param dateString
3710
+ */
3711
+ const parseLocaleDate = dateString => dateString ? parse(dateString, "P", new Date(), intlLocale ? {
3712
+ locale: intlLocale
3713
+ } : undefined) : null;
3714
+ const parseUSADate = dateString => dateString ? parse(dateString, "P", new Date(), {
3715
+ locale: usaLocale
3716
+ }) : null;
3717
+ /**
3718
+ *
3719
+ * Format a date into a string in the CURRENT locale.
3720
+ * current locale is determined by navigator.language for now
3721
+ * @param date
3722
+ */
3723
+ const formatLocaleDate = date => date ? format(date, "P", {
3724
+ locale: intlLocale
3725
+ }) : null;
3726
+ const formatUSADate = date => date ? format(date, "P", {
3727
+ locale: usaLocale
3728
+ }) : null;
3729
+
3566
3730
  function _EMOTION_STRINGIFIED_CSS_ERROR__$4() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
3567
3731
  const getPopperStyles = theme => /*#__PURE__*/css("padding-top:10px;z-index:10;.react-datepicker{background-color:", theme.palette.white, ";border-radius:0.25rem;box-shadow:", theme.getElevation("above").boxShadow, ";display:inline-block;font-size:1rem;position:relative;&__month-container{float:left;}&__header{border-top-left-radius:", theme.borderRadius.M, ";border-top-right-radius:", theme.borderRadius.M, ";padding:", theme.spacing(2), "px 0 ", theme.spacing(1), "px 0;position:relative;text-align:center;}&__current-month{color:", theme.palette.black, ";font-size:1rem;font-weight:600;line-height:1.25rem;margin-bottom:", theme.spacing(2), "px;}&__navigation{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:32px;justify-content:center;overflow:hidden;position:absolute;text-align:center;text-indent:-999em;top:0.688rem;width:32px;z-index:1;&--previous{left:1rem;}&--next{right:1rem;}&:hover *::before{border-color:", theme.palette.gray.light, ";}&-icon{position:relative;top:-0.125rem;width:0;&::before{border-color:", theme.palette.gray.main, ";border-style:solid;border-width:2.5px 2.5px 0 0;content:\"\";display:block;height:6px;position:absolute;top:6px;width:6px;}&--previous{right:0rem;&::before{right:-0.438rem;transform:rotate(225deg);}}&--next{left:0rem;&::before{left:-0.438rem;transform:rotate(45deg);}}}} &__month{padding:0 1rem 1rem 1rem;text-align:center;}&__week{white-space:nowrap;} &__day{color:", theme.palette.black, ";cursor:pointer;display:inline-block;font-size:1rem;line-height:2rem;margin:0.25rem;text-align:center;width:2rem;&:hover[aria-selected=\"false\"]:not(&--disabled){background-color:", theme.palette.gray.ultraLight, ";border-radius:0.25rem;}&-name{color:", theme.palette.gray.main, ";display:inline-block;font-size:0.75rem;font-weight:600;line-height:1rem;margin:0 0.25rem;text-align:center;width:2rem;}&-names{white-space:nowrap;}&--disabled{color:", theme.palette.gray.main, ";cursor:default;&:hover{background-color:transparent;}}&--today[aria-selected=\"false\"]{position:relative;&::before{border-bottom:0.125rem solid ", theme.palette.primary.main, ";content:\"\";display:block;inset:0;position:absolute;}}&--highlighted{background-color:#3dcc4a;border-radius:0.25rem;color:#fff;&:hover{background-color:", theme.palette.secondary.main, ";}&-custom-1{color:magenta;}&-custom-2{color:green;}}&--selected,&--in-selecting-range,&--in-range{background-color:", theme.palette.primary.main, ";border-radius:0.25rem;color:#fff;&[aria-selected=\"true\"]{cursor:default;}&[aria-selected=\"false\"]:hover{background-color:", theme.palette.primary.dark, ";}}&--in-selecting-range:not(&--in-range){background-color:rgba(33, 107, 165, 0.5);}&--keyboard-selected{border-radius:0.25rem;outline:0.125rem solid ", theme.palette.primary.main, ";} &--selected:not(&--keyboard-selected):focus-visible{outline:0.125rem solid ", theme.palette.primary.main, ";}} &__input-container{display:inline-block;position:relative;width:100%;}}" + (process.env.NODE_ENV === "production" ? "" : ";label:getPopperStyles;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRhdGUtcGlja2VyLnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDOEMiLCJmaWxlIjoiZGF0ZS1waWNrZXIuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL2Nzc1wiO1xyXG5leHBvcnQgY29uc3QgZ2V0UG9wcGVyU3R5bGVzID0gKHRoZW1lKSA9PiBjc3MgYFxuICBwYWRkaW5nLXRvcDogMTBweDtcbiAgei1pbmRleDogMTA7XG4gIC5yZWFjdC1kYXRlcGlja2VyIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiAke3RoZW1lLnBhbGV0dGUud2hpdGV9O1xuICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgYm94LXNoYWRvdzogJHt0aGVtZS5nZXRFbGV2YXRpb24oXCJhYm92ZVwiKS5ib3hTaGFkb3d9O1xuICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICBmb250LXNpemU6IDFyZW07XG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICZfX21vbnRoLWNvbnRhaW5lciB7XG4gICAgICBmbG9hdDogbGVmdDtcbiAgICB9XG4gICAgJl9faGVhZGVyIHtcbiAgICAgIGJvcmRlci10b3AtbGVmdC1yYWRpdXM6ICR7dGhlbWUuYm9yZGVyUmFkaXVzLk19O1xuICAgICAgYm9yZGVyLXRvcC1yaWdodC1yYWRpdXM6ICR7dGhlbWUuYm9yZGVyUmFkaXVzLk19O1xuICAgICAgcGFkZGluZzogJHt0aGVtZS5zcGFjaW5nKDIpfXB4IDAgJHt0aGVtZS5zcGFjaW5nKDEpfXB4IDA7XG4gICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgfVxuICAgICZfX2N1cnJlbnQtbW9udGgge1xuICAgICAgY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5ibGFja307XG4gICAgICBmb250LXNpemU6IDFyZW07XG4gICAgICBmb250LXdlaWdodDogNjAwO1xuICAgICAgbGluZS1oZWlnaHQ6IDEuMjVyZW07XG4gICAgICBtYXJnaW4tYm90dG9tOiAke3RoZW1lLnNwYWNpbmcoMil9cHg7XG4gICAgfVxuICAgICZfX25hdmlnYXRpb24ge1xuICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgIGJhY2tncm91bmQ6IG5vbmU7XG4gICAgICBib3JkZXI6IG5vbmU7XG4gICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgaGVpZ2h0OiAzMnB4O1xuICAgICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgdGV4dC1pbmRlbnQ6IC05OTllbTtcbiAgICAgIHRvcDogMC42ODhyZW07XG4gICAgICB3aWR0aDogMzJweDtcbiAgICAgIHotaW5kZXg6IDE7XG4gICAgICAmLS1wcmV2aW91cyB7XG4gICAgICAgIGxlZnQ6IDFyZW07XG4gICAgICB9XG4gICAgICAmLS1uZXh0IHtcbiAgICAgICAgcmlnaHQ6IDFyZW07XG4gICAgICB9XG4gICAgICAmOmhvdmVyICo6OmJlZm9yZSB7XG4gICAgICAgIGJvcmRlci1jb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkubGlnaHR9O1xuICAgICAgfVxuICAgICAgJi1pY29uIHtcbiAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICAgICB0b3A6IC0wLjEyNXJlbTtcbiAgICAgICAgd2lkdGg6IDA7XG4gICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgYm9yZGVyLWNvbG9yOiAke3RoZW1lLnBhbGV0dGUuZ3JheS5tYWlufTtcbiAgICAgICAgICBib3JkZXItc3R5bGU6IHNvbGlkO1xuICAgICAgICAgIGJvcmRlci13aWR0aDogMi41cHggMi41cHggMCAwO1xuICAgICAgICAgIGNvbnRlbnQ6IFwiXCI7XG4gICAgICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgICAgICAgaGVpZ2h0OiA2cHg7XG4gICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgICAgIHRvcDogNnB4O1xuICAgICAgICAgIHdpZHRoOiA2cHg7XG4gICAgICAgIH1cbiAgICAgICAgJi0tcHJldmlvdXMge1xuICAgICAgICAgIHJpZ2h0OiAwcmVtO1xuICAgICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgICByaWdodDogLTAuNDM4cmVtO1xuICAgICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoMjI1ZGVnKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgJi0tbmV4dCB7XG4gICAgICAgICAgbGVmdDogMHJlbTtcbiAgICAgICAgICAmOjpiZWZvcmUge1xuICAgICAgICAgICAgbGVmdDogLTAuNDM4cmVtO1xuICAgICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoNDVkZWcpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICAkeyAvKiAjZW5kcmVnaW9uICovXCJcIn1cbiAgICAmX19tb250aCB7XG4gICAgICBwYWRkaW5nOiAwIDFyZW0gMXJlbSAxcmVtO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgIH1cbiAgICAmX193ZWVrIHtcbiAgICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgfVxuICAgICR7IC8qICNyZWdpb24gWyByZ2JhKDEyMCw1MCwxNTAsMC4xKSBdIERheXMgKi9cIlwifVxuICAgICZfX2RheSB7XG4gICAgICBjb2xvcjogJHt0aGVtZS5wYWxldHRlLmJsYWNrfTtcbiAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgIGZvbnQtc2l6ZTogMXJlbTtcbiAgICAgIGxpbmUtaGVpZ2h0OiAycmVtO1xuICAgICAgbWFyZ2luOiAwLjI1cmVtO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgd2lkdGg6IDJyZW07XG4gICAgICAmOmhvdmVyW2FyaWEtc2VsZWN0ZWQ9XCJmYWxzZVwiXTpub3QoJi0tZGlzYWJsZWQpIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkudWx0cmFMaWdodH07XG4gICAgICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgICB9XG4gICAgICAmLW5hbWUge1xuICAgICAgICBjb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkubWFpbn07XG4gICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgICAgZm9udC1zaXplOiAwLjc1cmVtO1xuICAgICAgICBmb250LXdlaWdodDogNjAwO1xuICAgICAgICBsaW5lLWhlaWdodDogMXJlbTtcbiAgICAgICAgbWFyZ2luOiAwIDAuMjVyZW07XG4gICAgICAgIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgICAgICAgd2lkdGg6IDJyZW07XG4gICAgICB9XG4gICAgICAmLW5hbWVzIHtcbiAgICAgICAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgICAgIH1cbiAgICAgICYtLWRpc2FibGVkIHtcbiAgICAgICAgY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5ncmF5Lm1haW59O1xuICAgICAgICBjdXJzb3I6IGRlZmF1bHQ7XG4gICAgICAgICY6aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS10b2RheVthcmlhLXNlbGVjdGVkPVwiZmFsc2VcIl0ge1xuICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgYm9yZGVyLWJvdHRvbTogMC4xMjVyZW0gc29saWQgJHt0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbn07XG4gICAgICAgICAgY29udGVudDogXCJcIjtcbiAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgICBpbnNldDogMDtcbiAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgICYtLWhpZ2hsaWdodGVkIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogIzNkY2M0YTtcbiAgICAgICAgYm9yZGVyLXJhZGl1czogMC4yNXJlbTtcbiAgICAgICAgY29sb3I6ICNmZmY7XG4gICAgICAgICY6aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5zZWNvbmRhcnkubWFpbn07XG4gICAgICAgIH1cbiAgICAgICAgJi1jdXN0b20tMSB7XG4gICAgICAgICAgY29sb3I6IG1hZ2VudGE7XG4gICAgICAgIH1cbiAgICAgICAgJi1jdXN0b20tMiB7XG4gICAgICAgICAgY29sb3I6IGdyZWVuO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS1zZWxlY3RlZCxcbiAgICAgICYtLWluLXNlbGVjdGluZy1yYW5nZSxcbiAgICAgICYtLWluLXJhbmdlIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbn07XG4gICAgICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgICAgIGNvbG9yOiAjZmZmO1xuICAgICAgICAmW2FyaWEtc2VsZWN0ZWQ9XCJ0cnVlXCJdIHtcbiAgICAgICAgICBjdXJzb3I6IGRlZmF1bHQ7XG4gICAgICAgIH1cbiAgICAgICAgJlthcmlhLXNlbGVjdGVkPVwiZmFsc2VcIl06aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5wcmltYXJ5LmRhcmt9O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS1pbi1zZWxlY3RpbmctcmFuZ2U6bm90KCYtLWluLXJhbmdlKSB7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMzMsIDEwNywgMTY1LCAwLjUpO1xuICAgICAgfVxuICAgICAgJi0ta2V5Ym9hcmQtc2VsZWN0ZWQge1xuICAgICAgICBib3JkZXItcmFkaXVzOiAwLjI1cmVtO1xuICAgICAgICBvdXRsaW5lOiAwLjEyNXJlbSBzb2xpZCAke3RoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWlufTtcbiAgICAgIH1cbiAgICAgICR7XHJcbi8qIFJEUCBkb2Vzbid0IGF0dGFjaCB0aGUgLS1rZXlib2FyZC1zZWxlY3RlZCBjbGFzcyBpZiB5b3UgYXJyb3ctbmF2aWdhdGUgdG8gdGhlIGN1cnJlbnRseVxyXG4gICAgIHNlbGVjdGVkIGRhdGUsIHdoaWNoIHdvdWxkIHJlc3VsdCBpbiBhIGRlZmF1bHQgYnJvd3NlciBmb2N1cy1yaW5nICovIFwiXCJ9XG4gICAgICAmLS1zZWxlY3RlZDpub3QoJi0ta2V5Ym9hcmQtc2VsZWN0ZWQpOmZvY3VzLXZpc2libGUge1xuICAgICAgICBvdXRsaW5lOiAwLjEyNXJlbSBzb2xpZCAke3RoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWlufTtcbiAgICAgIH1cbiAgICB9XG4gICAgJHsgLyogI2VuZHJlZ2lvbiAqL1wiXCJ9XG4gICAgJl9faW5wdXQtY29udGFpbmVyIHtcbiAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICAgIHdpZHRoOiAxMDAlO1xuICAgIH1cbiAgfVxuYDtcclxuZXhwb3J0IGNvbnN0IGdldFdyYXBwZXJTdHlsZXMgPSAodGhlbWUpID0+IGNzcyBgXG4gIGJvcmRlcjogMDtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBwYWRkaW5nOiAwO1xuICB3aWR0aDogMTAwJTtcbiAgei1pbmRleDogMjAwO1xuYDtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9ZGF0ZS1waWNrZXIuc3R5bGVzLmpzLm1hcCJdfQ== */");
3568
3732
  const getWrapperStyles = theme => /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
@@ -3581,28 +3745,43 @@ const DatePicker = fieldProps => {
3581
3745
  const datePickerRef = useRef(null);
3582
3746
  return jsx(DatePickerController, Object.assign({}, fieldProps, {
3583
3747
  children: _a => {
3584
- var {
3585
- ref
3586
- } = _a,
3587
- datePickerProps = __rest(_a, ["ref"]);
3748
+ var _datePickerProps = __rest(_a, ["ref"]);
3749
+ // Lens the form's usa date string into a locale date string
3750
+ // for the now localized date picker
3751
+ const onChange = date => {
3752
+ var _a;
3753
+ (_a = _datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(_datePickerProps, formatUSADate(parseLocaleDate(date)));
3754
+ };
3755
+ const value = formatLocaleDate(parseUSADate(_datePickerProps.value));
3756
+ const datePickerProps = Object.assign(Object.assign({}, _datePickerProps), {
3757
+ onChange,
3758
+ value
3759
+ });
3588
3760
  return jsx("div", Object.assign({
3589
- css: getOverrideStyles
3761
+ css: getOverrideStyles(theme)
3590
3762
  }, {
3591
- children: jsx(ReactDatePicker, Object.assign({}, datePickerProps, {
3592
- customInput: /*#__PURE__*/createElement$2(function InputWrapper(_a) {
3763
+ children: jsx(ReactDatePicker, Object.assign({
3764
+ locale: LOCALE
3765
+ }, datePickerProps, {
3766
+ customInput: /*#__PURE__*/createElement$2( /*#__PURE__*/forwardRef(function InputWrapper(_a, forwardedRef) {
3593
3767
  var _b;
3594
3768
  var {
3595
3769
  value
3596
3770
  } = _a,
3597
- props = __rest(_a, ["value"]);
3598
- const innerRef = useRef(null);
3599
- const refInterceptor = useCallback(node => {
3600
- ref(node);
3601
- innerRef.current = node;
3602
- }, []);
3603
- const isFocused = (_b = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
3604
- return jsx(Input, Object.assign({}, props, {
3605
- ref: refInterceptor,
3771
+ inputProps = __rest(_a, ["value"]);
3772
+ if (typeof forwardedRef !== "function") throw new Error("DatePicker requires a callback-ref and should always be passing one (this should never happen)");
3773
+ // The forwarded ref that RDP supplies is a callback ref; we need a *mutable* ref in order to check if the DOM element is focused
3774
+ const mutableRef = useRef(null);
3775
+ // We wrap RDP's forwarded ref in order to setup our own mutable ref
3776
+ const callbackRef = useCallback(node => {
3777
+ // Invoke RDP's forwarded ref
3778
+ forwardedRef(node);
3779
+ // Setup our mutable ref
3780
+ if (node) mutableRef.current = node;
3781
+ }, [forwardedRef]);
3782
+ const isFocused = (_b = mutableRef.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
3783
+ return jsx(Input, Object.assign({}, inputProps, {
3784
+ ref: callbackRef,
3606
3785
  rightContent: jsx(Icon
3607
3786
  // Internally, RDP applies this class to the Input, but the Icon is absolute / in its own context
3608
3787
  , {
@@ -3617,9 +3796,9 @@ const DatePicker = fieldProps => {
3617
3796
  return (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(!datePickerRef.current.isCalendarOpen());
3618
3797
  }
3619
3798
  }),
3620
- value: isFocused || value !== new Date().toLocaleDateString("en-US") ? value : datePickerProps.placeholderText
3799
+ value: isFocused || value !== formatLocaleDate(new Date()) ? value : datePickerProps.placeholderText
3621
3800
  }));
3622
- }),
3801
+ })),
3623
3802
  "data-testid": fieldProps.name ? camelize(fieldProps.name) : "date",
3624
3803
  onCalendarOpen: () => {
3625
3804
  var _a;
@@ -3628,13 +3807,13 @@ const DatePicker = fieldProps => {
3628
3807
  onChange: (date, event) => {
3629
3808
  var _a;
3630
3809
  event === null || event === void 0 ? void 0 : event.preventDefault();
3631
- (_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? date.toLocaleDateString("en-US") : null);
3810
+ (_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? formatLocaleDate(date) : null);
3632
3811
  },
3633
3812
  popperClassName: getPopperStyles(theme),
3634
3813
  popperPlacement: "bottom-end",
3635
3814
  preventOpenOnFocus: true,
3636
3815
  ref: datePickerRef,
3637
- selected: datePickerProps.value ? new Date(datePickerProps.value) : null,
3816
+ selected: parseLocaleDate(datePickerProps.value),
3638
3817
  showPopperArrow: false,
3639
3818
  wrapperClassName: getWrapperStyles()
3640
3819
  }))
@@ -3744,7 +3923,7 @@ var flattenIntoArray_1 = flattenIntoArray$1;
3744
3923
 
3745
3924
  var uncurryThis$6 = functionUncurryThis;
3746
3925
  var fails$5 = fails$q;
3747
- var isCallable$5 = isCallable$n;
3926
+ var isCallable$5 = isCallable$o;
3748
3927
  var classof$1 = classof$6;
3749
3928
  var getBuiltIn$3 = getBuiltIn$8;
3750
3929
  var inspectSource$1 = inspectSource$3;
@@ -3798,7 +3977,7 @@ var isConstructor$2 = !construct || fails$5(function () {
3798
3977
  var isArray = isArray$2;
3799
3978
  var isConstructor$1 = isConstructor$2;
3800
3979
  var isObject$2 = isObject$a;
3801
- var wellKnownSymbol$6 = wellKnownSymbol$j;
3980
+ var wellKnownSymbol$6 = wellKnownSymbol$k;
3802
3981
 
3803
3982
  var SPECIES$3 = wellKnownSymbol$6('species');
3804
3983
  var $Array = Array;
@@ -3979,8 +4158,8 @@ var uncurryThis$5 = functionUncurryThis;
3979
4158
  var thisNumberValue$1 = uncurryThis$5(1.0.valueOf);
3980
4159
 
3981
4160
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$6;
3982
- var toString$4 = toString$b;
3983
- var requireObjectCoercible$1 = requireObjectCoercible$8;
4161
+ var toString$4 = toString$c;
4162
+ var requireObjectCoercible$1 = requireObjectCoercible$9;
3984
4163
 
3985
4164
  var $RangeError$1 = RangeError;
3986
4165
 
@@ -4129,7 +4308,7 @@ $$a({ target: 'Number', proto: true, forced: FORCED$2 }, {
4129
4308
  var global$a = global$p;
4130
4309
  var fails$3 = fails$q;
4131
4310
  var uncurryThis$3 = functionUncurryThis;
4132
- var toString$3 = toString$b;
4311
+ var toString$3 = toString$c;
4133
4312
  var trim$1 = stringTrim.trim;
4134
4313
  var whitespaces$1 = whitespaces$4;
4135
4314
 
@@ -4289,7 +4468,7 @@ const MoneyInput = _a => {
4289
4468
  var global$9 = global$p;
4290
4469
  var fails$2 = fails$q;
4291
4470
  var uncurryThis$2 = functionUncurryThis;
4292
- var toString$2 = toString$b;
4471
+ var toString$2 = toString$c;
4293
4472
  var trim = stringTrim.trim;
4294
4473
  var whitespaces = whitespaces$4;
4295
4474
 
@@ -4362,23 +4541,10 @@ const NumberInput = _a => {
4362
4541
  }));
4363
4542
  };
4364
4543
 
4365
- var call$8 = functionCall;
4366
- var hasOwn$2 = hasOwnProperty_1;
4367
- var isPrototypeOf$3 = objectIsPrototypeOf;
4368
- var regExpFlags = regexpFlags$1;
4369
-
4370
- var RegExpPrototype$1 = RegExp.prototype;
4371
-
4372
- var regexpGetFlags = function (R) {
4373
- var flags = R.flags;
4374
- return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
4375
- ? call$8(regExpFlags, R) : flags;
4376
- };
4377
-
4378
4544
  var PROPER_FUNCTION_NAME = functionName.PROPER;
4379
4545
  var defineBuiltIn$2 = defineBuiltIn$7;
4380
4546
  var anObject$6 = anObject$f;
4381
- var $toString = toString$b;
4547
+ var $toString = toString$c;
4382
4548
  var fails$1 = fails$q;
4383
4549
  var getRegExpFlags = regexpGetFlags;
4384
4550
 
@@ -4872,7 +5038,7 @@ const Select = _a => {
4872
5038
  }, {
4873
5039
  children: jsx(Select$1, Object.assign({}, fieldProps, {
4874
5040
  showLabel: !!props.nativeLabel,
4875
- value: flatOptions === null || flatOptions === void 0 ? void 0 : flatOptions.find(option => _$2.isEqual(option.value, fieldProps.value))
5041
+ value: flatOptions === null || flatOptions === void 0 ? void 0 : flatOptions.find(option => _$3.isEqual(option.value, fieldProps.value))
4876
5042
  }, {
4877
5043
  children: options === null || options === void 0 ? void 0 : options.map((option, idx) => {
4878
5044
  if (isCategory(option)) {
@@ -4892,7 +5058,7 @@ const Select = _a => {
4892
5058
  onCategoryChange === null || onCategoryChange === void 0 ? void 0 : onCategoryChange(option.value);
4893
5059
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
4894
5060
  },
4895
- selected: _$2.isEqual(value, fieldProps.value),
5061
+ selected: _$3.isEqual(value, fieldProps.value),
4896
5062
  showTick: true,
4897
5063
  value: stringifiedValue
4898
5064
  }, {
@@ -4909,7 +5075,7 @@ const Select = _a => {
4909
5075
  customOnChange === null || customOnChange === void 0 ? void 0 : customOnChange(option.value);
4910
5076
  onChange === null || onChange === void 0 ? void 0 : onChange(option.value);
4911
5077
  },
4912
- selected: _$2.isEqual(option.value, fieldProps.value),
5078
+ selected: _$3.isEqual(option.value, fieldProps.value),
4913
5079
  showTick: true,
4914
5080
  value: stringifiedValue
4915
5081
  }, {
@@ -5177,17 +5343,43 @@ const useInsuranceProviderOptions = (insuranceAccount, features) => {
5177
5343
  }), [t, insuranceAccount, features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance, features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance]);
5178
5344
  };
5179
5345
 
5180
- let _$1 = t => t,
5181
- _t$1,
5182
- _t2$1;
5346
+ const useShipmentMetadata = shipment => {
5347
+ const isInternational = useMemo(() => {
5348
+ return shipment ? getIsInternationalShipment(shipment) : false;
5349
+ }, [shipment]);
5350
+ const isPoBox = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5351
+ const isUnsupportedUpsCountry = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isUnsupportedByUps(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5352
+ const isCustomsRequired = useMemo(() => {
5353
+ return shipment ? getIsCustomsRequiredForShipment(shipment) : false;
5354
+ }, [shipment]);
5355
+ const isContentDescriptionRequired = useMemo(() => {
5356
+ var _a;
5357
+ return shipment && ((_a = shipment.shipFrom) === null || _a === void 0 ? void 0 : _a.countryCode) === "MX" || (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo.countryCode) === "MX";
5358
+ }, [shipment]);
5359
+ return {
5360
+ isContentDescriptionRequired,
5361
+ isCustomsRequired,
5362
+ isInternational,
5363
+ isPoBox,
5364
+ isUnsupportedUpsCountry
5365
+ };
5366
+ };
5367
+
5368
+ let _$2 = t => t,
5369
+ _t$2,
5370
+ _t2$2;
5183
5371
  const findGenericPackageFromCarriers = carriers => {
5184
5372
  const carrier = carriers.find(c => c.packages.some(p => p.packageCode === "package"));
5185
5373
  return carrier === null || carrier === void 0 ? void 0 : carrier.packages.find(p => p.packageCode === "package");
5186
5374
  };
5187
- const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5375
+ const usePackageOptions = (carriers, customPackageTypes, shipment) => {
5188
5376
  const {
5189
5377
  t
5190
5378
  } = useTranslation("common");
5379
+ const {
5380
+ isPoBox,
5381
+ isUnsupportedUpsCountry
5382
+ } = useShipmentMetadata(shipment);
5191
5383
  return useMemo(() => {
5192
5384
  if (!carriers) return undefined;
5193
5385
  // Dictionary to lookup the uniqueness of each carrierCode
@@ -5196,7 +5388,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5196
5388
  }));
5197
5389
  const genericPackage = findGenericPackageFromCarriers(carriers);
5198
5390
  const packageOptions = [...(genericPackage ? [{
5199
- label: t(_t$1 || (_t$1 = _$1`packageCategories.browseRates`)),
5391
+ label: t(_t$2 || (_t$2 = _$2`packageCategories.browseRates`)),
5200
5392
  options: [{
5201
5393
  label: t("packageCodes.package"),
5202
5394
  value: {
@@ -5204,7 +5396,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5204
5396
  }
5205
5397
  }]
5206
5398
  }] : []), ...((customPackageTypes === null || customPackageTypes === void 0 ? void 0 : customPackageTypes.length) ? [{
5207
- label: t(_t2$1 || (_t2$1 = _$1`packageCategories.myCustomPackages`)),
5399
+ label: t(_t2$2 || (_t2$2 = _$2`packageCategories.myCustomPackages`)),
5208
5400
  options: customPackageTypes.sort((a, b) => a.name.localeCompare(b.name)).map(({
5209
5401
  dimensions,
5210
5402
  name,
@@ -5221,7 +5413,8 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5221
5413
  return carriers.reduce((options, carrier) => {
5222
5414
  if (carrier.packages.length === 0) return options;
5223
5415
  // Filter out non-USPS packages for PO Box shipments
5224
- if (!isUspsCarrier(carrier.carrierCode) && poBox) return options;
5416
+ // Filter out UPS packages for unsupported countries
5417
+ if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
5225
5418
  return [...options, {
5226
5419
  // Check the uniqueness of the carrierCode, if unique default to friendlyName and if non-unique use nickname.
5227
5420
  label: isUniqueByCarrierCode[carrier.carrierCode] ? carrier.friendlyName : carrier.nickname,
@@ -5237,24 +5430,27 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5237
5430
  value: carrier.carrierId
5238
5431
  }];
5239
5432
  }, packageOptions);
5240
- }, [carriers, customPackageTypes, poBox, t]);
5433
+ }, [carriers, customPackageTypes, isPoBox, isUnsupportedUpsCountry, t]);
5241
5434
  };
5242
5435
 
5243
5436
  const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) => {
5244
- const isInternationalShipment = useMemo(() => {
5245
- return shipment ? getIsInternationalShipment(shipment) : false;
5246
- }, [shipment]);
5247
- const isPoBoxShipment = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5248
5437
  const carriersById = useMemo(() => createDictionary(carriers, c => ({
5249
5438
  [c.carrierId]: c
5250
5439
  })), [carriers]);
5440
+ const {
5441
+ isInternational,
5442
+ isPoBox,
5443
+ isUnsupportedUpsCountry
5444
+ } = useShipmentMetadata(shipment);
5251
5445
  return useMemo(() => {
5252
5446
  return (rates !== null && rates !== void 0 ? rates : []).filter(r => {
5253
5447
  const carrier = carriersById[r.carrierId];
5254
5448
  const service = carrier === null || carrier === void 0 ? void 0 : carrier.services.find(s => s.serviceCode === r.serviceCode);
5255
- return (service === null || service === void 0 ? void 0 : service.domestic) === !isInternationalShipment && (!enableGlobalPostFiltering || !r.serviceCode.includes("globalpost_")) && (
5449
+ return (service === null || service === void 0 ? void 0 : service.domestic) === !isInternational && (!enableGlobalPostFiltering || !r.serviceCode.includes("globalpost_")) && (
5256
5450
  // Filter out non-USPS carriers for PO Box shipments
5257
- service && isUspsCarrier(service.carrierCode) || !isPoBoxShipment);
5451
+ service && isUspsCarrier(service.carrierCode) || !isPoBox) && (
5452
+ // Filter out UPS for unsupported countries
5453
+ service && !isUpsCarrier(service.carrierCode) || !isUnsupportedUpsCountry);
5258
5454
  }).sort((a, b) => getTotalRateAmount(a) - getTotalRateAmount(b)).map(r => {
5259
5455
  var _a, _b;
5260
5456
  const balance = (_a = carriersById[r.carrierId]) === null || _a === void 0 ? void 0 : _a.balance;
@@ -5266,22 +5462,29 @@ const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) =>
5266
5462
  requiresFundedAmount
5267
5463
  });
5268
5464
  });
5269
- }, [carriersById, enableGlobalPostFiltering, isInternationalShipment, isPoBoxShipment, rates]);
5465
+ }, [carriersById, enableGlobalPostFiltering, isInternational, isPoBox, isUnsupportedUpsCountry, rates]);
5270
5466
  };
5271
5467
 
5272
- const useServiceCodeOptions = (carriers, domestic, poBox) => {
5468
+ const useServiceCodeOptions = (carriers, shipment) => {
5469
+ const {
5470
+ isInternational,
5471
+ isPoBox,
5472
+ isUnsupportedUpsCountry
5473
+ } = useShipmentMetadata(shipment);
5273
5474
  return useMemo(() => {
5274
5475
  // Dictionary to lookup the uniqueness of each carrierCode
5275
5476
  const isUniqueByCarrierCode = createDictionary(carriers, (c, partialResults) => ({
5276
5477
  [c.carrierCode]: partialResults[c.carrierCode] === undefined
5277
5478
  }));
5278
5479
  return (carriers !== null && carriers !== void 0 ? carriers : []).reduce((options, carrier) => {
5279
- if (!isUspsCarrier(carrier.carrierCode) && poBox) return options;
5280
- const services = carrier.services.filter(s => s.domestic === domestic &&
5480
+ // Filter out non-USPS service for PO Box shipments
5481
+ // Filter out UPS service for unsupported countries
5482
+ if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
5483
+ const services = carrier.services.filter(s => s.domestic === !isInternational &&
5281
5484
  // TODO: Pending LMNT-418, GlobalPost filtering should be wrapped in FF
5282
5485
  !s.serviceCode.includes("globalpost_"));
5283
5486
  if (services.length === 0) return options;
5284
- const sortedServices = _$2.orderBy(services, "name", "asc");
5487
+ const sortedServices = _$3.orderBy(services, "name", "asc");
5285
5488
  return [...options, {
5286
5489
  // Check the uniqueness of the carrierCode, if unique default to friendlyName and if non-unique use nickname.
5287
5490
  label: isUniqueByCarrierCode[carrier.carrierCode] ? carrier.friendlyName : carrier.nickname,
@@ -5295,7 +5498,7 @@ const useServiceCodeOptions = (carriers, domestic, poBox) => {
5295
5498
  value: carrier.carrierId
5296
5499
  }];
5297
5500
  }, []);
5298
- }, [carriers, domestic, poBox]);
5501
+ }, [carriers, isInternational, isPoBox, isUnsupportedUpsCountry]);
5299
5502
  };
5300
5503
 
5301
5504
  const getContainerStyles = theme => /*#__PURE__*/css$1({
@@ -5354,13 +5557,16 @@ const createCategoryFromShippingPresets = (categoryName, presets) => presets ? [
5354
5557
  const useShippingPresetsOptions = ({
5355
5558
  platform,
5356
5559
  user
5357
- } = {}, isInternationalShipment) => {
5560
+ } = {}, shipment) => {
5358
5561
  const {
5359
5562
  t
5360
5563
  } = useTranslation();
5361
- return useMemo(() => [...createCategoryFromShippingPresets(t("shippingPresets.user"), isInternationalShipment ? user === null || user === void 0 ? void 0 : user.international : user === null || user === void 0 ? void 0 : user.domestic),
5564
+ const {
5565
+ isInternational
5566
+ } = useShipmentMetadata(shipment);
5567
+ return useMemo(() => [...createCategoryFromShippingPresets(t("shippingPresets.user"), isInternational ? user === null || user === void 0 ? void 0 : user.international : user === null || user === void 0 ? void 0 : user.domestic),
5362
5568
  // TODO - platform name should probably be a platform-specific environmental variable ?
5363
- ...createCategoryFromShippingPresets(t("shippingPresets.platform"), isInternationalShipment ? platform === null || platform === void 0 ? void 0 : platform.international : platform === null || platform === void 0 ? void 0 : platform.domestic)], [isInternationalShipment, platform, t, user]);
5569
+ ...createCategoryFromShippingPresets(t("shippingPresets.platform"), isInternational ? platform === null || platform === void 0 ? void 0 : platform.international : platform === null || platform === void 0 ? void 0 : platform.domestic)], [isInternational, platform, t, user]);
5364
5570
  };
5365
5571
 
5366
5572
  const useStateCodeOptions = domestic => useMemo(() => usStates.flatMap(v => !domestic || !v.isMilitary && !v.isUnitedStatesTerritory ? {
@@ -5637,7 +5843,7 @@ const useRunOnceOnTrue = conditionalEffect => {
5637
5843
  */
5638
5844
  const useToggle = (initialValue = false) => useReducer((prev, next) => next !== undefined && typeof next !== "object" ? next : !prev, initialValue);
5639
5845
 
5640
- var wellKnownSymbol$5 = wellKnownSymbol$j;
5846
+ var wellKnownSymbol$5 = wellKnownSymbol$k;
5641
5847
  var Iterators$1 = iterators;
5642
5848
 
5643
5849
  var ITERATOR$2 = wellKnownSymbol$5('iterator');
@@ -5649,10 +5855,10 @@ var isArrayIteratorMethod$1 = function (it) {
5649
5855
  };
5650
5856
 
5651
5857
  var classof = classof$6;
5652
- var getMethod$2 = getMethod$5;
5653
- var isNullOrUndefined$2 = isNullOrUndefined$6;
5858
+ var getMethod$2 = getMethod$6;
5859
+ var isNullOrUndefined$2 = isNullOrUndefined$7;
5654
5860
  var Iterators = iterators;
5655
- var wellKnownSymbol$4 = wellKnownSymbol$j;
5861
+ var wellKnownSymbol$4 = wellKnownSymbol$k;
5656
5862
 
5657
5863
  var ITERATOR$1 = wellKnownSymbol$4('iterator');
5658
5864
 
@@ -5678,7 +5884,7 @@ var getIterator$1 = function (argument, usingIterator) {
5678
5884
 
5679
5885
  var call$6 = functionCall;
5680
5886
  var anObject$4 = anObject$f;
5681
- var getMethod$1 = getMethod$5;
5887
+ var getMethod$1 = getMethod$6;
5682
5888
 
5683
5889
  var iteratorClose$1 = function (iterator, kind, value) {
5684
5890
  var innerResult, innerError;
@@ -5799,7 +6005,7 @@ const useAddressValidation = () => {
5799
6005
  if (matchedAddress.addressLine2 === "") {
5800
6006
  matchedAddress.addressLine2 = null;
5801
6007
  }
5802
- if (_$2.isEqual(_$2.omit(matchedAddress, ["postalCode", "addressResidentialIndicator"]), _$2.omit(originalAddress, ["postalCode", "addressResidentialIndicator"]))) return true;else return false;
6008
+ if (_$3.isEqual(_$3.omit(matchedAddress, ["postalCode", "addressResidentialIndicator"]), _$3.omit(originalAddress, ["postalCode", "addressResidentialIndicator"]))) return true;else return false;
5803
6009
  }, []);
5804
6010
  const postalCodeCompare = useCallback((matched, original) => {
5805
6011
  if (matched === undefined || original === undefined) return false;
@@ -5926,7 +6132,7 @@ const AddressParser = ({
5926
6132
  }));
5927
6133
  };
5928
6134
 
5929
- const styles$m = createStyles({
6135
+ const styles$o = createStyles({
5930
6136
  grow: {
5931
6137
  flexGrow: 1
5932
6138
  },
@@ -6026,13 +6232,13 @@ const AddressFields = ({
6026
6232
  },
6027
6233
  options: countryCodeOptions
6028
6234
  }), jsxs("div", Object.assign({
6029
- css: styles$m.stateZipWrapper
6235
+ css: styles$o.stateZipWrapper
6030
6236
  }, {
6031
6237
  children: [jsx("div", Object.assign({
6032
- css: styles$m.stateWrapper
6238
+ css: styles$o.stateWrapper
6033
6239
  }, {
6034
6240
  children: jsx("div", Object.assign({
6035
- css: styles$m.grow
6241
+ css: styles$o.grow
6036
6242
  }, {
6037
6243
  children: watchCountryCode === "US" ?
6038
6244
  // Domestic States
@@ -6057,10 +6263,10 @@ const AddressFields = ({
6057
6263
  })
6058
6264
  }))
6059
6265
  })), jsx("div", Object.assign({
6060
- css: styles$m.zipWrapper
6266
+ css: styles$o.zipWrapper
6061
6267
  }, {
6062
6268
  children: jsx("div", Object.assign({
6063
- css: styles$m.grow
6269
+ css: styles$o.grow
6064
6270
  }, {
6065
6271
  children: jsx(TextInput, {
6066
6272
  control: form.control,
@@ -6100,11 +6306,11 @@ const extendZod = () => {
6100
6306
  var call$4 = functionCall;
6101
6307
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
6102
6308
  var anObject$2 = anObject$f;
6103
- var isNullOrUndefined$1 = isNullOrUndefined$6;
6309
+ var isNullOrUndefined$1 = isNullOrUndefined$7;
6104
6310
  var toLength = toLength$3;
6105
- var toString$1 = toString$b;
6106
- var requireObjectCoercible = requireObjectCoercible$8;
6107
- var getMethod = getMethod$5;
6311
+ var toString$1 = toString$c;
6312
+ var requireObjectCoercible = requireObjectCoercible$9;
6313
+ var getMethod = getMethod$6;
6108
6314
  var advanceStringIndex = advanceStringIndex$2;
6109
6315
  var regExpExec = regexpExecAbstract;
6110
6316
 
@@ -6232,7 +6438,7 @@ const AddressForm = ({
6232
6438
  children: [jsxs("div", Object.assign({
6233
6439
  css: theme => ({
6234
6440
  display: "flex",
6235
- justifyContent: isAddressParserOpen ? "normal" : "flex-end",
6441
+ flexDirection: isAddressParserOpen ? "column" : "row",
6236
6442
  paddingBottom: theme.spacing(4),
6237
6443
  width: "100%"
6238
6444
  })
@@ -6298,7 +6504,7 @@ const AddressForm = ({
6298
6504
  }));
6299
6505
  };
6300
6506
 
6301
- const styles$l = createStyles({
6507
+ const styles$n = createStyles({
6302
6508
  agreement: {
6303
6509
  alignItems: "center",
6304
6510
  display: "flex",
@@ -6368,10 +6574,10 @@ const DisplayCarrierTerms = c => {
6368
6574
  const listCarrierLinks = () => {
6369
6575
  return c.carrierTerms.links.map((term, index) => {
6370
6576
  return jsx("li", Object.assign({
6371
- css: styles$l.listItems
6577
+ css: styles$n.listItems
6372
6578
  }, {
6373
6579
  children: jsx(Link, Object.assign({
6374
- css: styles$l.link,
6580
+ css: styles$n.link,
6375
6581
  href: term.url,
6376
6582
  isExternal: true,
6377
6583
  target: "_blank"
@@ -6387,18 +6593,18 @@ const DisplayCarrierTerms = c => {
6387
6593
  };
6388
6594
  const listCarrierTerms = () => {
6389
6595
  return jsxs("div", Object.assign({
6390
- css: styles$l.terms
6596
+ css: styles$n.terms
6391
6597
  }, {
6392
6598
  children: [jsx(Typography, Object.assign({
6393
6599
  variant: "subtitle1"
6394
6600
  }, {
6395
6601
  children: c.carrierTerms.title
6396
6602
  })), jsx("div", Object.assign({
6397
- css: styles$l.terms
6603
+ css: styles$n.terms
6398
6604
  }, {
6399
6605
  children: listCarrierContent()
6400
6606
  })), jsx("ul", Object.assign({
6401
- css: styles$l.links
6607
+ css: styles$n.links
6402
6608
  }, {
6403
6609
  children: listCarrierLinks()
6404
6610
  }))]
@@ -6628,7 +6834,7 @@ const AddressDisplay = ({
6628
6834
  }));
6629
6835
  };
6630
6836
 
6631
- const styles$k = createStyles({
6837
+ const styles$m = createStyles({
6632
6838
  container: theme => ({
6633
6839
  display: "flex",
6634
6840
  gap: theme.spacing()
@@ -6666,13 +6872,13 @@ const Disclosure = ({
6666
6872
  }, [open]);
6667
6873
  return jsxs(Fragment, {
6668
6874
  children: [jsxs("div", Object.assign({
6669
- css: styles$k.container
6875
+ css: styles$m.container
6670
6876
  }, {
6671
6877
  children: [jsx("div", {
6672
6878
  children: label
6673
6879
  }), _showToggle && jsx("button", Object.assign({
6674
6880
  "aria-expanded": isOpen,
6675
- css: styles$k.toggle,
6881
+ css: styles$m.toggle,
6676
6882
  onClick: () => {
6677
6883
  setIsOpen(!isOpen);
6678
6884
  onToggle(!isOpen);
@@ -6680,12 +6886,12 @@ const Disclosure = ({
6680
6886
  type: "button"
6681
6887
  }, {
6682
6888
  children: jsx(Icon, {
6683
- css: styles$k.icon,
6889
+ css: styles$m.icon,
6684
6890
  name: isOpen ? IconNames.CHEVRON_TOP : IconNames.CHEVRON_BOTTOM
6685
6891
  })
6686
6892
  }))]
6687
6893
  })), isOpen && jsx("div", Object.assign({
6688
- css: styles$k.content
6894
+ css: styles$m.content
6689
6895
  }, {
6690
6896
  children: typeof children === "function" ? children(() => setIsOpen(!isOpen)) : children
6691
6897
  }))]
@@ -6725,14 +6931,10 @@ const AddressPreferenceDisplay = ({
6725
6931
  }), [addressPreference, onChangePreference]);
6726
6932
  const disclosureContentTitle = useMemo(() => addressPreference.status === "verified" ? t(`address.preference.${addressPreference.alternativeSource}`) : t("address.preference.addressNotValidated"), [addressPreference, t]);
6727
6933
  const isVerified = useMemo(() => {
6728
- if (isDomesticAddress(addressPreference.selection) || addressPreference.selectionSource === "matchedAddress") {
6729
- return addressPreference.status === "verified";
6730
- }
6731
- // If the address is international and is modified, We might get "verified" even though we are displaying original "not verified" address
6732
- if (addressPreference.isModified) {
6733
- return false;
6934
+ if (addressPreference.status === "verified" && addressPreference.selectionSource === "matchedAddress") {
6935
+ return true;
6734
6936
  }
6735
- return addressPreference.status === "verified";
6937
+ return false;
6736
6938
  }, [addressPreference]);
6737
6939
  return jsxs(Fragment, {
6738
6940
  children: [jsx(AddressDisplay, {
@@ -6835,7 +7037,7 @@ const getCarrierRecoverySchema = requiresAddress => z.object({
6835
7037
  address: requiresAddress ? baseSchema : baseSchema.optional()
6836
7038
  });
6837
7039
 
6838
- const styles$j = createStyles({
7040
+ const styles$l = createStyles({
6839
7041
  grid: theme => ({
6840
7042
  margin: theme.spacing(4)
6841
7043
  }),
@@ -6878,7 +7080,7 @@ const CarrierRecoveryForm = ({
6878
7080
  onSubmit: formLogger.capture(handleSubmit)
6879
7081
  }, {
6880
7082
  children: jsxs(Grid, Object.assign({
6881
- css: styles$j.grid,
7083
+ css: styles$l.grid,
6882
7084
  noPadding: true
6883
7085
  }, {
6884
7086
  children: [requiresAddress && jsxs(Fragment, {
@@ -6886,14 +7088,14 @@ const CarrierRecoveryForm = ({
6886
7088
  colSpan: 12
6887
7089
  }, {
6888
7090
  children: jsx(Typography, Object.assign({
6889
- css: styles$j.heading,
7091
+ css: styles$l.heading,
6890
7092
  variant: "heading4"
6891
7093
  }, {
6892
7094
  children: t("register-wallet:sections.carriers.title")
6893
7095
  }))
6894
7096
  })), jsx(GridChild, Object.assign({
6895
7097
  colSpan: 12,
6896
- css: styles$j.subtitle
7098
+ css: styles$l.subtitle
6897
7099
  }, {
6898
7100
  children: jsx(Typography, Object.assign({
6899
7101
  variant: "subtitle1"
@@ -6979,7 +7181,7 @@ const CarrierTermsForm = ({
6979
7181
  onSubmit(payload.agreement);
6980
7182
  }));
6981
7183
  return jsxs("div", Object.assign({
6982
- css: styles$l.termsForm,
7184
+ css: styles$n.termsForm,
6983
7185
  "data-testid": "carrier-terms-form"
6984
7186
  }, {
6985
7187
  children: [jsx(Typography, Object.assign({
@@ -6995,7 +7197,7 @@ const CarrierTermsForm = ({
6995
7197
  })), jsx(Spacer, {
6996
7198
  multiplier: 1
6997
7199
  }), jsx("div", Object.assign({
6998
- css: styles$l.carrierLogos
7200
+ css: styles$n.carrierLogos
6999
7201
  }, {
7000
7202
  children: metadatas.map(({
7001
7203
  name,
@@ -7011,7 +7213,7 @@ const CarrierTermsForm = ({
7011
7213
  onSubmit: formLogger.capture(handleSubmit)
7012
7214
  }, {
7013
7215
  children: jsxs("div", Object.assign({
7014
- css: styles$l.agreement
7216
+ css: styles$n.agreement
7015
7217
  }, {
7016
7218
  children: [jsx("div", {
7017
7219
  children: jsx(CheckboxInput, {
@@ -7038,12 +7240,12 @@ const CarrierTermsForm = ({
7038
7240
  name: "agreement"
7039
7241
  })
7040
7242
  }), showTerms && jsxs("div", Object.assign({
7041
- css: styles$l.well
7243
+ css: styles$n.well
7042
7244
  }, {
7043
7245
  children: [terms.map(t => jsx(DisplayCarrierTerms, {
7044
7246
  carrierTerms: t
7045
7247
  }, t.title)), jsx("div", Object.assign({
7046
- css: styles$l.close
7248
+ css: styles$n.close
7047
7249
  }, {
7048
7250
  children: jsx(Button, Object.assign({
7049
7251
  onClick: () => setShowTerms(false),
@@ -7075,9 +7277,9 @@ var DESCRIPTORS$1 = descriptors;
7075
7277
  var global$8 = global$p;
7076
7278
  var uncurryThis$1 = functionUncurryThis;
7077
7279
  var hasOwn$1 = hasOwnProperty_1;
7078
- var isCallable$4 = isCallable$n;
7280
+ var isCallable$4 = isCallable$o;
7079
7281
  var isPrototypeOf$1 = objectIsPrototypeOf;
7080
- var toString = toString$b;
7282
+ var toString = toString$c;
7081
7283
  var defineProperty = objectDefineProperty.f;
7082
7284
  var copyConstructorProperties = copyConstructorProperties$2;
7083
7285
 
@@ -7364,7 +7566,7 @@ const CopyButton = ({
7364
7566
  }));
7365
7567
  };
7366
7568
 
7367
- const styles$i = createStyles({
7569
+ const styles$k = createStyles({
7368
7570
  trackingNumber: theme => ({
7369
7571
  alignItems: "center",
7370
7572
  display: "flex"
@@ -7410,10 +7612,10 @@ const Label = ({
7410
7612
  shippingAmount: label.shipmentCost
7411
7613
  }, {
7412
7614
  children: label.trackingNumber && jsxs("div", Object.assign({
7413
- css: styles$i.trackingNumber
7615
+ css: styles$k.trackingNumber
7414
7616
  }, {
7415
7617
  children: [jsx("div", Object.assign({
7416
- css: styles$i.truncatedTrackingNumber
7618
+ css: styles$k.truncatedTrackingNumber
7417
7619
  }, {
7418
7620
  children: label.trackingNumber.toString()
7419
7621
  })), jsx(CopyButton, {
@@ -7525,7 +7727,7 @@ const LandingPageForm = ({
7525
7727
  }));
7526
7728
  };
7527
7729
 
7528
- const styles$h = createStyles({
7730
+ const styles$j = createStyles({
7529
7731
  container: theme => ({
7530
7732
  padding: theme.spacing(2)
7531
7733
  }),
@@ -7547,11 +7749,11 @@ const LandingPage = ({
7547
7749
  t
7548
7750
  } = useTranslation();
7549
7751
  return jsxs("div", Object.assign({
7550
- css: styles$h.container,
7752
+ css: styles$j.container,
7551
7753
  "data-testid": "landing-page"
7552
7754
  }, {
7553
7755
  children: [jsxs("div", Object.assign({
7554
- css: styles$h.header
7756
+ css: styles$j.header
7555
7757
  }, {
7556
7758
  children: [jsx(Typography, Object.assign({
7557
7759
  variant: "heading4"
@@ -7569,7 +7771,7 @@ const LandingPage = ({
7569
7771
  })), jsx(LandingPageForm, {
7570
7772
  onSubmit: onSubmit
7571
7773
  }), jsxs("div", Object.assign({
7572
- css: styles$h.header
7774
+ css: styles$j.header
7573
7775
  }, {
7574
7776
  children: [jsx(Spacer, {
7575
7777
  multiplier: 6
@@ -7580,14 +7782,14 @@ const LandingPage = ({
7580
7782
  })), jsx(Spacer, {
7581
7783
  multiplier: 2
7582
7784
  }), jsx(Typography, Object.assign({
7583
- css: styles$h.description,
7785
+ css: styles$j.description,
7584
7786
  variant: "body1"
7585
7787
  }, {
7586
7788
  children: t("onboarding:landing.messageLine1")
7587
7789
  })), jsx(Spacer, {
7588
7790
  multiplier: 2
7589
7791
  }), jsx(Typography, Object.assign({
7590
- css: styles$h.description,
7792
+ css: styles$j.description,
7591
7793
  variant: "body1"
7592
7794
  }, {
7593
7795
  children: t("onboarding:landing.messageLine2")
@@ -7598,7 +7800,7 @@ const LandingPage = ({
7598
7800
  }));
7599
7801
  };
7600
7802
 
7601
- const styles$g = createStyles({
7803
+ const styles$i = createStyles({
7602
7804
  icon: theme => ({
7603
7805
  color: theme.palette.primary.main,
7604
7806
  marginRight: theme.spacing(2)
@@ -7643,10 +7845,10 @@ const Section = _a => {
7643
7845
  rest = __rest(_a, ["bold", "title", "children", "rightContent"]);
7644
7846
  return jsxs(Fragment, {
7645
7847
  children: [title && jsx("summary", Object.assign({
7646
- css: styles$g.summary
7848
+ css: styles$i.summary
7647
7849
  }, {
7648
7850
  children: jsxs("div", Object.assign({
7649
- css: styles$g.summaryWrapper
7851
+ css: styles$i.summaryWrapper
7650
7852
  }, {
7651
7853
  children: [jsx(Typography, Object.assign({
7652
7854
  bold: bold,
@@ -7654,20 +7856,20 @@ const Section = _a => {
7654
7856
  }, {
7655
7857
  children: title
7656
7858
  })), rightContent && jsx("div", Object.assign({
7657
- css: styles$g.rightContentWrapper
7859
+ css: styles$i.rightContentWrapper
7658
7860
  }, {
7659
7861
  children: rightContent
7660
7862
  }))]
7661
7863
  }))
7662
7864
  })), jsx("section", Object.assign({
7663
- css: styles$g.section
7865
+ css: styles$i.section
7664
7866
  }, rest, {
7665
7867
  children: children
7666
7868
  }))]
7667
7869
  });
7668
7870
  };
7669
7871
 
7670
- const styles$f = createStyles({
7872
+ const styles$h = createStyles({
7671
7873
  container: {
7672
7874
  display: "flex",
7673
7875
  flexDirection: "column"
@@ -7727,14 +7929,14 @@ const ListCarriersRow = ({
7727
7929
  setIsSubmitting(false);
7728
7930
  });
7729
7931
  return jsxs("div", Object.assign({
7730
- css: styles$f.container,
7932
+ css: styles$h.container,
7731
7933
  "data-testid": "carrier-row"
7732
7934
  }, {
7733
7935
  children: [jsxs("div", Object.assign({
7734
- css: styles$f.rowContainer
7936
+ css: styles$h.rowContainer
7735
7937
  }, {
7736
7938
  children: [jsxs("div", Object.assign({
7737
- css: styles$f.logoContainer
7939
+ css: styles$h.logoContainer
7738
7940
  }, {
7739
7941
  children: [jsx("div", {
7740
7942
  children: jsx("img", {
@@ -7752,7 +7954,7 @@ const ListCarriersRow = ({
7752
7954
  css: _ref
7753
7955
  }, {
7754
7956
  children: jsx(LinkAction, {
7755
- css: styles$f.getConnectButton(isConnected),
7957
+ css: styles$h.getConnectButton(isConnected),
7756
7958
  isDisabled: isConnected || showDropDown,
7757
7959
  isLoading: isSubmitting,
7758
7960
  onClick: () => __awaiter(void 0, void 0, void 0, function* () {
@@ -7770,7 +7972,7 @@ const ListCarriersRow = ({
7770
7972
  }));
7771
7973
  };
7772
7974
 
7773
- const styles$e = createStyles({
7975
+ const styles$g = createStyles({
7774
7976
  carriersList: theme => ({
7775
7977
  "& > li:not(:last-of-type)": {
7776
7978
  borderBottom: `1px solid ${theme.palette.gray.light}`
@@ -7823,7 +8025,7 @@ const ListCarriers = ({
7823
8025
  }))
7824
8026
  })), jsx(Spacer, {})]
7825
8027
  }), jsx("ul", Object.assign({
7826
- css: styles$e.carriersList,
8028
+ css: styles$g.carriersList,
7827
8029
  "data-testid": "carriers-list"
7828
8030
  }, {
7829
8031
  children: isLoading ? jsxs(Fragment, {
@@ -7845,11 +8047,11 @@ const ListCarriers = ({
7845
8047
  };
7846
8048
  const LoadingSkeletonRow = () => {
7847
8049
  return jsxs("div", Object.assign({
7848
- css: styles$e.skeletonRow,
8050
+ css: styles$g.skeletonRow,
7849
8051
  "data-testid": "skeleton-carrier-row"
7850
8052
  }, {
7851
8053
  children: [jsxs("div", Object.assign({
7852
- css: styles$e.skeletonLogoContainer
8054
+ css: styles$g.skeletonLogoContainer
7853
8055
  }, {
7854
8056
  children: [jsx(Skeleton, {
7855
8057
  animation: SkeletonAnimation.WAVE,
@@ -8100,7 +8302,7 @@ const AddressPreferenceProvider = props => {
8100
8302
  returnAddress
8101
8303
  } = validationPreference;
8102
8304
  setPassengerData(data);
8103
- if (_$2.isEqual(addresses.originAddress, _$2.omit(validationPreference.originAddress, ["addressLine3", "addressResidentialIndicator"]))) {
8305
+ if (_$3.isEqual(addresses.originAddress, _$3.omit(validationPreference.originAddress, ["addressLine3", "addressResidentialIndicator"]))) {
8104
8306
  yield onValid({
8105
8307
  originAddress: addresses.originAddress,
8106
8308
  returnAddress: addresses === null || addresses === void 0 ? void 0 : addresses.returnAddress
@@ -8156,7 +8358,7 @@ const useAddressPreference = () => {
8156
8358
  return context;
8157
8359
  };
8158
8360
 
8159
- const styles$d = createStyles({
8361
+ const styles$f = createStyles({
8160
8362
  body: theme => ({
8161
8363
  borderTop: `1px solid ${theme.palette.gray.light}`,
8162
8364
  color: theme.palette.black,
@@ -8207,14 +8409,14 @@ const SettingsCard = ({
8207
8409
  verticallyAligned
8208
8410
  }) => {
8209
8411
  return jsxs("div", Object.assign({
8210
- css: verticallyAligned ? styles$d.verticalContainer : styles$d.container,
8412
+ css: verticallyAligned ? styles$f.verticalContainer : styles$f.container,
8211
8413
  "data-testid": "settingsCard"
8212
8414
  }, {
8213
8415
  children: [jsxs("div", Object.assign({
8214
- css: styles$d.header
8416
+ css: styles$f.header
8215
8417
  }, {
8216
8418
  children: [jsxs("div", Object.assign({
8217
- css: styles$d.title
8419
+ css: styles$f.title
8218
8420
  }, {
8219
8421
  children: [typeof title === "string" ? jsx(Typography, Object.assign({
8220
8422
  variant: "subtitle2"
@@ -8249,7 +8451,7 @@ const SettingsCard = ({
8249
8451
  }))
8250
8452
  }))]
8251
8453
  })), children && jsx("div", Object.assign({
8252
- css: styles$d.body
8454
+ css: styles$f.body
8253
8455
  }, {
8254
8456
  children: jsxs("div", {
8255
8457
  children: [children, accessoryAction && jsx(ButtonGroup, Object.assign({
@@ -8505,7 +8707,7 @@ const WarehouseForm = ({
8505
8707
  }));
8506
8708
  };
8507
8709
 
8508
- const styles$c = createStyles({
8710
+ const styles$e = createStyles({
8509
8711
  cardSpacing: theme => ({
8510
8712
  display: "flex",
8511
8713
  flexDirection: "column",
@@ -8535,9 +8737,9 @@ const ManageWarehouses = ({
8535
8737
  const [showAddNewWarehouseForm, toggleShowAddNewWarehouseForm] = useToggle(false);
8536
8738
  return jsxs(Fragment, {
8537
8739
  children: [showAddNewWarehouseForm ? jsx(AddressPreferenceProvider, Object.assign({
8538
- css: styles$c.well,
8740
+ css: styles$e.well,
8539
8741
  formHeader: jsxs("div", Object.assign({
8540
- css: styles$c.header
8742
+ css: styles$e.header
8541
8743
  }, {
8542
8744
  children: [jsx(Typography, Object.assign({
8543
8745
  variant: "subtitle1"
@@ -8582,14 +8784,14 @@ const ManageWarehouses = ({
8582
8784
  })]
8583
8785
  }))
8584
8786
  })), jsx("div", Object.assign({
8585
- css: styles$c.cardSpacing
8787
+ css: styles$e.cardSpacing
8586
8788
  }, {
8587
8789
  children: warehouses.map(warehouse => {
8588
8790
  if (editWarehouseId && editWarehouseId === warehouse.warehouseId) {
8589
8791
  return jsx(AddressPreferenceProvider, Object.assign({
8590
- css: styles$c.well,
8792
+ css: styles$e.well,
8591
8793
  formHeader: jsxs("div", Object.assign({
8592
- css: styles$c.header
8794
+ css: styles$e.header
8593
8795
  }, {
8594
8796
  children: [jsx(Typography, Object.assign({
8595
8797
  variant: "subtitle1"
@@ -8647,7 +8849,7 @@ const ManageWarehouses = ({
8647
8849
 
8648
8850
  var getBuiltIn$2 = getBuiltIn$8;
8649
8851
  var definePropertyModule = objectDefineProperty;
8650
- var wellKnownSymbol$3 = wellKnownSymbol$j;
8852
+ var wellKnownSymbol$3 = wellKnownSymbol$k;
8651
8853
  var DESCRIPTORS = descriptors;
8652
8854
 
8653
8855
  var SPECIES$2 = wellKnownSymbol$3('species');
@@ -8686,8 +8888,8 @@ var aConstructor$1 = function (argument) {
8686
8888
 
8687
8889
  var anObject$1 = anObject$f;
8688
8890
  var aConstructor = aConstructor$1;
8689
- var isNullOrUndefined = isNullOrUndefined$6;
8690
- var wellKnownSymbol$2 = wellKnownSymbol$j;
8891
+ var isNullOrUndefined = isNullOrUndefined$7;
8892
+ var wellKnownSymbol$2 = wellKnownSymbol$k;
8691
8893
 
8692
8894
  var SPECIES$1 = wellKnownSymbol$2('species');
8693
8895
 
@@ -8717,7 +8919,7 @@ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
8717
8919
  var global$7 = global$p;
8718
8920
  var apply = functionApply;
8719
8921
  var bind$2 = functionBindContext;
8720
- var isCallable$3 = isCallable$n;
8922
+ var isCallable$3 = isCallable$o;
8721
8923
  var hasOwn = hasOwnProperty_1;
8722
8924
  var fails = fails$q;
8723
8925
  var html = html$2;
@@ -8984,10 +9186,10 @@ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
8984
9186
 
8985
9187
  var global$2 = global$p;
8986
9188
  var NativePromiseConstructor$3 = promiseNativeConstructor;
8987
- var isCallable$2 = isCallable$n;
9189
+ var isCallable$2 = isCallable$o;
8988
9190
  var isForced = isForced_1;
8989
9191
  var inspectSource = inspectSource$3;
8990
- var wellKnownSymbol$1 = wellKnownSymbol$j;
9192
+ var wellKnownSymbol$1 = wellKnownSymbol$k;
8991
9193
  var IS_BROWSER = engineIsBrowser;
8992
9194
  var IS_DENO = engineIsDeno;
8993
9195
  var V8_VERSION = engineV8Version;
@@ -9059,7 +9261,7 @@ var setPrototypeOf = objectSetPrototypeOf;
9059
9261
  var setToStringTag = setToStringTag$3;
9060
9262
  var setSpecies = setSpecies$1;
9061
9263
  var aCallable$2 = aCallable$a;
9062
- var isCallable$1 = isCallable$n;
9264
+ var isCallable$1 = isCallable$o;
9063
9265
  var isObject$1 = isObject$a;
9064
9266
  var anInstance = anInstance$1;
9065
9267
  var speciesConstructor = speciesConstructor$1;
@@ -9337,7 +9539,7 @@ $$5({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTR
9337
9539
  setToStringTag(PromiseConstructor, PROMISE, false);
9338
9540
  setSpecies(PROMISE);
9339
9541
 
9340
- var wellKnownSymbol = wellKnownSymbol$j;
9542
+ var wellKnownSymbol = wellKnownSymbol$k;
9341
9543
 
9342
9544
  var ITERATOR = wellKnownSymbol('iterator');
9343
9545
  var SAFE_CLOSING = false;
@@ -9427,7 +9629,7 @@ var $$3 = _export;
9427
9629
  var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
9428
9630
  var NativePromiseConstructor = promiseNativeConstructor;
9429
9631
  var getBuiltIn$1 = getBuiltIn$8;
9430
- var isCallable = isCallable$n;
9632
+ var isCallable = isCallable$o;
9431
9633
  var defineBuiltIn = defineBuiltIn$7;
9432
9634
 
9433
9635
  var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
@@ -9767,7 +9969,7 @@ const EditWalletAddressForm = ({
9767
9969
  }));
9768
9970
  };
9769
9971
 
9770
- const styles$b = createStyles({
9972
+ const styles$d = createStyles({
9771
9973
  grid: theme => ({
9772
9974
  margin: theme.spacing(4)
9773
9975
  })
@@ -9829,7 +10031,7 @@ const WalletForm = ({
9829
10031
  onSubmit: formLogger.capture(handleSubmit)
9830
10032
  }, {
9831
10033
  children: jsxs(Grid, Object.assign({
9832
- css: styles$b.grid,
10034
+ css: styles$d.grid,
9833
10035
  noPadding: true
9834
10036
  }, {
9835
10037
  children: [jsx(GridChild, Object.assign({
@@ -9911,7 +10113,7 @@ const WalletForm = ({
9911
10113
  }));
9912
10114
  };
9913
10115
 
9914
- const styles$a = createStyles({
10116
+ const styles$c = createStyles({
9915
10117
  container: theme => ({
9916
10118
  padding: theme.spacing(2)
9917
10119
  }),
@@ -10087,10 +10289,10 @@ const Onboarding = ({
10087
10289
  const defaultWarehouse = (_a = warehouses.find(w => w.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
10088
10290
  return jsx(AddressPreferenceProvider, Object.assign({
10089
10291
  formHeader: jsxs("div", Object.assign({
10090
- css: styles$a.walletFormHeader
10292
+ css: styles$c.walletFormHeader
10091
10293
  }, {
10092
10294
  children: [jsxs("div", Object.assign({
10093
- css: styles$a.walletFormTitle
10295
+ css: styles$c.walletFormTitle
10094
10296
  }, {
10095
10297
  children: [jsx(Typography, Object.assign({
10096
10298
  variant: "heading4"
@@ -10167,38 +10369,38 @@ const Onboarding = ({
10167
10369
  });
10168
10370
  };
10169
10371
  return jsxs("div", Object.assign({
10170
- css: styles$a.container
10372
+ css: styles$c.container
10171
10373
  }, {
10172
10374
  children: [jsxs(Stepper, Object.assign({
10173
10375
  currentStep: currentStep
10174
10376
  }, {
10175
10377
  children: [jsx(Step, {
10176
- css: styles$a.step,
10378
+ css: styles$c.step,
10177
10379
  label: t("onboarding:steps.login")
10178
10380
  }), jsx(Step, {
10179
- css: styles$a.step,
10381
+ css: styles$c.step,
10180
10382
  label: t("onboarding:steps.carriers")
10181
10383
  }), jsx(Step, {
10182
- css: styles$a.step,
10384
+ css: styles$c.step,
10183
10385
  label: t("onboarding:steps.addresses")
10184
10386
  }), jsx(Step, {
10185
- css: styles$a.step,
10387
+ css: styles$c.step,
10186
10388
  label: t("onboarding:steps.payment")
10187
10389
  })]
10188
- })), renderStep()]
10390
+ })), renderStep(), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
10189
10391
  }));
10190
10392
  };
10191
10393
 
10192
- let _ = t => t,
10193
- _t,
10194
- _t2;
10394
+ let _$1 = t => t,
10395
+ _t$1,
10396
+ _t2$1;
10195
10397
  const Cube = _a => {
10196
10398
  var {
10197
10399
  animate = false
10198
10400
  } = _a,
10199
10401
  props = __rest(_a, ["animate"]);
10200
10402
  const theme = useTheme();
10201
- const bounce = keyframes(_t || (_t = _`
10403
+ const bounce = keyframes(_t$1 || (_t$1 = _$1`
10202
10404
  0%, 100% {
10203
10405
  transform: translateY(-25%);
10204
10406
  animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
@@ -10208,7 +10410,7 @@ const Cube = _a => {
10208
10410
  animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
10209
10411
  }
10210
10412
  `));
10211
- const spin = keyframes(_t2 || (_t2 = _`
10413
+ const spin = keyframes(_t2$1 || (_t2$1 = _$1`
10212
10414
  from {
10213
10415
  transform: rotate(0deg);
10214
10416
  }
@@ -10311,12 +10513,12 @@ const Loader = props => {
10311
10513
  }
10312
10514
  }, {
10313
10515
  children: jsx(Spinner, Object.assign({}, props, {
10314
- size: SpinnerSize.SIZE_LARGE
10516
+ size: props.size || SpinnerSize.SIZE_LARGE
10315
10517
  }))
10316
10518
  }));
10317
10519
  };
10318
10520
 
10319
- const styles$9 = createStyles({
10521
+ const styles$b = createStyles({
10320
10522
  chipList: theme => ({
10321
10523
  gap: theme.spacing(1)
10322
10524
  }),
@@ -10427,7 +10629,7 @@ const AddFundsForm = ({
10427
10629
  })), jsx(Spacer, {
10428
10630
  multiplier: 2
10429
10631
  }), jsx(ChipList, Object.assign({
10430
- css: styles$9.chipList,
10632
+ css: styles$b.chipList,
10431
10633
  onChange: idx => {
10432
10634
  const chip = chips[idx];
10433
10635
  setSelectedChip(chip);
@@ -10442,7 +10644,7 @@ const AddFundsForm = ({
10442
10644
  }
10443
10645
  }, {
10444
10646
  children: chips.map(chip => jsx(Chip, Object.assign({
10445
- css: styles$9.getChip({
10647
+ css: styles$b.getChip({
10446
10648
  isDisabled: chip.value < _minimumAmount,
10447
10649
  isSelected: chip.value === selectedChip.value
10448
10650
  }),
@@ -10459,7 +10661,7 @@ const AddFundsForm = ({
10459
10661
  multiplier: 1
10460
10662
  }), jsx(MoneyInput, {
10461
10663
  control: form.control,
10462
- css: styles$9.fundsInput,
10664
+ css: styles$b.fundsInput,
10463
10665
  defaultValue: {
10464
10666
  amount: undefined,
10465
10667
  currency: SE.Currency.USD
@@ -10512,7 +10714,7 @@ const AddFundsForm = ({
10512
10714
  });
10513
10715
  };
10514
10716
 
10515
- const styles$8 = isLabelRight => createStyles({
10717
+ const styles$a = isLabelRight => createStyles({
10516
10718
  inlineContainer: theme => ({
10517
10719
  alignItems: "center",
10518
10720
  display: "flex",
@@ -10527,14 +10729,14 @@ const InlineLabel = ({
10527
10729
  isLabelRight,
10528
10730
  labelProps: _labelProps = {}
10529
10731
  }) => jsxs("div", Object.assign({
10530
- css: styles$8(isLabelRight).inlineContainer
10732
+ css: styles$a(isLabelRight).inlineContainer
10531
10733
  }, {
10532
10734
  children: [jsx(Typography, Object.assign({}, _labelProps, {
10533
10735
  children: label
10534
10736
  })), children]
10535
10737
  }));
10536
10738
 
10537
- const styles$7 = createStyles({
10739
+ const styles$9 = createStyles({
10538
10740
  getBalanceText: balance => theme => ({
10539
10741
  color: balance === undefined ? theme.palette.alert.main : balance >= 0 ? theme.palette.secondary.dark : theme.palette.error.main
10540
10742
  })
@@ -10557,7 +10759,7 @@ const CarrierBalance = ({
10557
10759
  }, {
10558
10760
  children: isLoadingCarrier || isRefetchingCarrier ? jsx(Spinner, {}) : jsx(Typography, Object.assign({
10559
10761
  bold: true,
10560
- css: styles$7.getBalanceText(balance)
10762
+ css: styles$9.getBalanceText(balance)
10561
10763
  }, {
10562
10764
  children: balance === undefined ? t("manage-funding:errors.balanceUnknown") : formatMoney({
10563
10765
  amount: balance,
@@ -10579,7 +10781,7 @@ const Spread = ({
10579
10781
  children: children
10580
10782
  }));
10581
10783
 
10582
- const styles$6 = createStyles({
10784
+ const styles$8 = createStyles({
10583
10785
  balanceText: theme => ({
10584
10786
  color: theme.palette.secondary.dark
10585
10787
  }),
@@ -10633,41 +10835,61 @@ const FundAndPurchase = ({
10633
10835
  control
10634
10836
  });
10635
10837
  const [isSavingRate, setIsSavingRate] = useState(false);
10838
+ const [isSavingError, setIsSavingError] = useState(false);
10636
10839
  const handleSaveRate = () => __awaiter(void 0, void 0, void 0, function* () {
10637
10840
  setIsSavingRate(true);
10638
- yield onSave();
10639
- setIsSavingRate(false);
10841
+ setIsSavingError(false);
10842
+ try {
10843
+ yield onSave();
10844
+ } catch (e) {
10845
+ setIsSavingError(true);
10846
+ } finally {
10847
+ setIsSavingRate(false);
10848
+ }
10640
10849
  });
10641
10850
  // Automatically open the Add Funds form if the carrier's balance is insufficient.
10642
10851
  useEffect(() => {
10643
10852
  if (isFundingEnabled && isFundingRequired && (carrier === null || carrier === void 0 ? void 0 : carrier.balance) !== undefined && carrier.balance < purchaseAmount) setIsAddFundsFormOpen(true);
10644
10853
  }, [carrier === null || carrier === void 0 ? void 0 : carrier.balance, isFundingEnabled, isFundingRequired, purchaseAmount]);
10645
- const renderActionButtons = (addFundsForm = {}) => jsxs(ButtonGroup, Object.assign({
10646
- justify: "end"
10647
- }, {
10648
- children: [jsx(Button, Object.assign({
10649
- bold: false,
10650
- css: styles$6.saveRateButton,
10651
- disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
10652
- isLoading: isSavingRate,
10653
- onClick: handleSaveRate,
10654
- variant: ButtonVariant.OUTLINED
10655
- }, {
10656
- children: t("purchase-label:actions.saveRate")
10657
- })), jsx(Button, Object.assign({
10658
- "data-testid": "submit-fund-and-purchase",
10659
- disabled: disabled || !carrierId || !isRateFormValid || isFundingEnabled && isFundingRequired && isAddFundsFormOpen && addFundsForm.isSubmitted && !addFundsForm.isValid,
10660
- isLoading: addFundsForm.isSubmitting || isRateFormSubmitting,
10661
- onClick: isAddFundsFormOpen ? addFundsForm.submit : onPurchase
10854
+ const renderActionButtons = (addFundsForm = {}) => jsxs(Fragment, {
10855
+ children: [isSavingError && jsxs(Fragment, {
10856
+ children: [jsx(InlineNotification, Object.assign({
10857
+ type: NotificationType.ERROR,
10858
+ title: t("purchase-label:errorMessages.saveRateFailedTitle")
10859
+ }, {
10860
+ children: jsx(Typography, {
10861
+ children: t("purchase-label:errorMessages.saveRateFailedMessage")
10862
+ })
10863
+ })), jsx(Spacer, {
10864
+ multiplier: 2
10865
+ })]
10866
+ }), jsxs(ButtonGroup, Object.assign({
10867
+ justify: "end"
10662
10868
  }, {
10663
- children: isAddFundsFormOpen ? t("manage-funding:actions.addFundsAndPurchase") : t("purchase-label:actions.purchaseNow")
10869
+ children: [jsx(Button, Object.assign({
10870
+ bold: false,
10871
+ css: styles$8.saveRateButton,
10872
+ disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
10873
+ isLoading: isSavingRate,
10874
+ onClick: handleSaveRate,
10875
+ variant: ButtonVariant.OUTLINED
10876
+ }, {
10877
+ children: t("purchase-label:actions.saveRate")
10878
+ })), jsx(Button, Object.assign({
10879
+ "data-testid": "submit-fund-and-purchase",
10880
+ disabled: disabled || !carrierId || !isRateFormValid || isFundingEnabled && isFundingRequired && isAddFundsFormOpen && addFundsForm.isSubmitted && !addFundsForm.isValid,
10881
+ isLoading: addFundsForm.isSubmitting || isRateFormSubmitting,
10882
+ onClick: isAddFundsFormOpen ? addFundsForm.submit : onPurchase
10883
+ }, {
10884
+ children: isAddFundsFormOpen ? t("manage-funding:actions.addFundsAndPurchase") : t("purchase-label:actions.purchaseNow")
10885
+ }))]
10664
10886
  }))]
10665
- }));
10887
+ });
10666
10888
  // Render: not a walleted carrier;
10667
10889
  // don't show balance or funding form
10668
10890
  if (!isFundingRequired) return jsx("div", Object.assign({
10669
10891
  className: className,
10670
- css: styles$6.container
10892
+ css: styles$8.container
10671
10893
  }, {
10672
10894
  children: renderActionButtons()
10673
10895
  }));
@@ -10680,7 +10902,7 @@ const FundAndPurchase = ({
10680
10902
  // show balance, but not the funding form.
10681
10903
  if (!isFundingEnabled) return jsxs("div", Object.assign({
10682
10904
  className: className,
10683
- css: styles$6.container
10905
+ css: styles$8.container
10684
10906
  }, {
10685
10907
  children: [jsx(CarrierBalance, {
10686
10908
  carrierId: carrierId
@@ -10692,7 +10914,7 @@ const FundAndPurchase = ({
10692
10914
  // show balance and funding form
10693
10915
  return jsxs("div", Object.assign({
10694
10916
  className: className,
10695
- css: styles$6.container
10917
+ css: styles$8.container
10696
10918
  }, {
10697
10919
  children: [jsxs(Spread, {
10698
10920
  children: [jsx(CarrierBalance, {
@@ -10723,13 +10945,13 @@ const FundAndPurchase = ({
10723
10945
  var _a, _b;
10724
10946
  return jsxs(Fragment, {
10725
10947
  children: [jsxs("section", Object.assign({
10726
- css: styles$6.getFormExtension(addFundsForm.isCustomAmount)
10948
+ css: styles$8.getFormExtension(addFundsForm.isCustomAmount)
10727
10949
  }, {
10728
10950
  children: [jsx(InlineLabel, Object.assign({
10729
10951
  label: t("manage-funding:fundAndPurchase.newBalance")
10730
10952
  }, {
10731
10953
  children: jsx(Typography, Object.assign({
10732
- css: styles$6.balanceText
10954
+ css: styles$8.balanceText
10733
10955
  }, {
10734
10956
  children: formatMoney({
10735
10957
  amount: balance + ((_a = addFundsForm.selectedAmount) !== null && _a !== void 0 ? _a : 0),
@@ -10740,7 +10962,7 @@ const FundAndPurchase = ({
10740
10962
  label: t("manage-funding:fundAndPurchase.finalBalance")
10741
10963
  }, {
10742
10964
  children: jsx(Typography, Object.assign({
10743
- css: styles$6.balanceText
10965
+ css: styles$8.balanceText
10744
10966
  }, {
10745
10967
  children: formatMoney({
10746
10968
  amount: balance + ((_b = addFundsForm.selectedAmount) !== null && _b !== void 0 ? _b : 0) - purchaseAmount,
@@ -10813,9 +11035,137 @@ const LabelLayoutPurchase = ({
10813
11035
  });
10814
11036
  };
10815
11037
 
10816
- const styles$5 = createStyles({
10817
- button: theme => ({
10818
- backgroundColor: "transparent",
11038
+ let _ = t => t,
11039
+ _t,
11040
+ _t2,
11041
+ _t3;
11042
+ const stroke = keyframes(_t || (_t = _`
11043
+ 100% {
11044
+ stroke-dashoffset: 0;
11045
+ }
11046
+ `));
11047
+ const fadeInOut = keyframes(_t2 || (_t2 = _`
11048
+ 0%, 100% {
11049
+ opacity: 0;
11050
+ }
11051
+ 20% {
11052
+ opacity: 1;
11053
+ }
11054
+ 85% {
11055
+ opacity: 1;
11056
+ }
11057
+ `));
11058
+ const fill = keyframes(_t3 || (_t3 = _`
11059
+ 100% {
11060
+ box-shadow: inset 0px 0px 0px 30px #3F8200;
11061
+ `));
11062
+ const colors = {
11063
+ green: "#3F8200",
11064
+ grey: "#706F6F",
11065
+ red: "#EE3B3F"
11066
+ };
11067
+ const styles$7 = createStyles({
11068
+ checkmark: () => ({
11069
+ animation: `${fill} forwards`,
11070
+ borderRadius: "50%",
11071
+ height: "20px,",
11072
+ stroke: "#fff",
11073
+ width: "20px"
11074
+ }),
11075
+ checkmarkCheck: () => ({
11076
+ animation: `${stroke} 1s forwards`,
11077
+ strokeDasharray: "48",
11078
+ strokeDashoffset: "48"
11079
+ }),
11080
+ container: theme => ({
11081
+ alignItems: "center",
11082
+ animation: `${fadeInOut} 2.5s ease-in-out forwards`,
11083
+ display: "flex",
11084
+ justifyContent: "flex-start",
11085
+ padding: `0 ${theme.spacing(2)}px 0 0`
11086
+ }),
11087
+ saved: theme => ({
11088
+ color: colors.green,
11089
+ marginLeft: `${theme.spacing(1)}px`
11090
+ }),
11091
+ saving: theme => ({
11092
+ marginLeft: `${theme.spacing(1)}px`
11093
+ }),
11094
+ savingContainer: () => ({
11095
+ alignItems: "center",
11096
+ color: colors.grey,
11097
+ display: "flex",
11098
+ justifyContent: "flex-start"
11099
+ }),
11100
+ savingFailed: theme => ({
11101
+ color: "#EE3B3F",
11102
+ marginLeft: `${theme.spacing(1)}px`
11103
+ })
11104
+ });
11105
+
11106
+ const SaveStatus = ({
11107
+ errors,
11108
+ isSaving
11109
+ }) => {
11110
+ const {
11111
+ t
11112
+ } = useTranslation(["manage-defaults"]);
11113
+ if (isSaving) {
11114
+ return jsxs("div", Object.assign({
11115
+ css: styles$7.savingContainer
11116
+ }, {
11117
+ children: [jsx(Loader, {
11118
+ color: colors.grey,
11119
+ css: {
11120
+ color: colors.grey
11121
+ },
11122
+ size: SpinnerSize.SIZE_SMALL
11123
+ }), jsx(Typography, Object.assign({
11124
+ css: styles$7.saving
11125
+ }, {
11126
+ children: t("manage-defaults:status.saving")
11127
+ }))]
11128
+ }));
11129
+ }
11130
+ return !isSaving && !errors ? jsxs("div", Object.assign({
11131
+ css: styles$7.container
11132
+ }, {
11133
+ children: [jsx("svg", Object.assign({
11134
+ css: styles$7.checkmark,
11135
+ viewBox: "0 0 52 52"
11136
+ }, {
11137
+ children: jsx("path", {
11138
+ css: styles$7.checkmarkCheck,
11139
+ d: "M14.1 27.2l7.1 7.2 16.7-16.8",
11140
+ fill: "none",
11141
+ strokeWidth: "5px"
11142
+ })
11143
+ })), jsx(Typography, Object.assign({
11144
+ css: styles$7.saved
11145
+ }, {
11146
+ children: t("manage-defaults:status.saved")
11147
+ }))]
11148
+ })) : jsxs("div", Object.assign({
11149
+ css: [styles$7.container, {
11150
+ padding: "0"
11151
+ }]
11152
+ }, {
11153
+ children: [jsx(Icon, {
11154
+ css: {
11155
+ color: colors.red
11156
+ },
11157
+ name: IconNames.CANCEL_FILLED
11158
+ }), jsx(Typography, Object.assign({
11159
+ css: styles$7.savingFailed
11160
+ }, {
11161
+ children: t("manage-defaults:status.savingFailed")
11162
+ }))]
11163
+ }));
11164
+ };
11165
+
11166
+ const styles$6 = createStyles({
11167
+ button: theme => ({
11168
+ backgroundColor: "transparent",
10819
11169
  padding: 0
10820
11170
  }),
10821
11171
  buttonContainer: theme => ({
@@ -10839,10 +11189,10 @@ const styles$5 = createStyles({
10839
11189
  cursor: "pointer",
10840
11190
  display: "flex",
10841
11191
  flexDirection: "column",
10842
- height: theme.spacing(32),
11192
+ height: theme.spacing(31),
10843
11193
  marginRight: theme.spacing(3.5),
10844
11194
  position: "relative",
10845
- width: theme.spacing(24)
11195
+ width: theme.spacing(22)
10846
11196
  }),
10847
11197
  letterInner: theme => ({
10848
11198
  backgroundColor: "white",
@@ -10867,10 +11217,10 @@ const styles$5 = createStyles({
10867
11217
  cursor: "pointer",
10868
11218
  display: "flex",
10869
11219
  flexDirection: "column",
10870
- height: theme.spacing(32),
11220
+ height: theme.spacing(31),
10871
11221
  marginRight: theme.spacing(3.5),
10872
11222
  position: "relative",
10873
- width: theme.spacing(24)
11223
+ width: theme.spacing(22)
10874
11224
  }),
10875
11225
  selectedThermal: theme => ({
10876
11226
  alignItems: "center",
@@ -10881,9 +11231,9 @@ const styles$5 = createStyles({
10881
11231
  cursor: "pointer",
10882
11232
  display: "flex",
10883
11233
  flexDirection: "column",
10884
- height: theme.spacing(32),
11234
+ height: theme.spacing(31),
10885
11235
  position: "relative",
10886
- width: theme.spacing(24)
11236
+ width: theme.spacing(22)
10887
11237
  }),
10888
11238
  thermal: theme => ({
10889
11239
  ":hover": {
@@ -10895,9 +11245,9 @@ const styles$5 = createStyles({
10895
11245
  cursor: "pointer",
10896
11246
  display: "flex",
10897
11247
  flexDirection: "column",
10898
- height: theme.spacing(32),
11248
+ height: theme.spacing(31),
10899
11249
  position: "relative",
10900
- width: theme.spacing(24)
11250
+ width: theme.spacing(22)
10901
11251
  }),
10902
11252
  thermalIcon: theme => ({
10903
11253
  backgroundColor: "#95C2E0",
@@ -10921,6 +11271,8 @@ const styles$5 = createStyles({
10921
11271
  });
10922
11272
 
10923
11273
  const LabelLayoutSettings = ({
11274
+ errors,
11275
+ isSaving,
10924
11276
  onChange
10925
11277
  }) => {
10926
11278
  var _a;
@@ -10933,13 +11285,17 @@ const LabelLayoutSettings = ({
10933
11285
  const labelLayout = (_a = accountSettings === null || accountSettings === void 0 ? void 0 : accountSettings.defaultLabelLayout) === null || _a === void 0 ? void 0 : _a.toLowerCase();
10934
11286
  return jsx(Section, Object.assign({
10935
11287
  bold: true,
11288
+ rightContent: jsx(SaveStatus, {
11289
+ errors: errors,
11290
+ isSaving: isSaving
11291
+ }),
10936
11292
  title: t("manage-defaults:label.title")
10937
11293
  }, {
10938
11294
  children: jsxs("div", Object.assign({
10939
- css: styles$5.buttonContainer
11295
+ css: styles$6.buttonContainer
10940
11296
  }, {
10941
11297
  children: [jsx("button", Object.assign({
10942
- css: styles$5.button,
11298
+ css: styles$6.button,
10943
11299
  id: "letter",
10944
11300
  onClick: () => {
10945
11301
  onChange("Letter");
@@ -10947,16 +11303,16 @@ const LabelLayoutSettings = ({
10947
11303
  value: "letter"
10948
11304
  }, {
10949
11305
  children: jsxs("div", Object.assign({
10950
- css: labelLayout === "letter" ? styles$5.selectedLetter : styles$5.letter
11306
+ css: labelLayout === "letter" ? styles$6.selectedLetter : styles$6.letter
10951
11307
  }, {
10952
11308
  children: [labelLayout === "letter" && jsx(Icon, {
10953
- css: styles$5.icon,
11309
+ css: styles$6.icon,
10954
11310
  name: IconNames$1.CHECK_FILLED
10955
11311
  }), jsx("div", Object.assign({
10956
- css: styles$5.letterInner
11312
+ css: styles$6.letterInner
10957
11313
  }, {
10958
11314
  children: jsx("div", {
10959
- css: styles$5.letterLabel
11315
+ css: styles$6.letterLabel
10960
11316
  })
10961
11317
  })), jsx(Typography, {
10962
11318
  children: t("manage-defaults:label.letter.title")
@@ -10971,7 +11327,7 @@ const LabelLayoutSettings = ({
10971
11327
  }))]
10972
11328
  }))
10973
11329
  })), jsx("button", Object.assign({
10974
- css: styles$5.button,
11330
+ css: styles$6.button,
10975
11331
  id: "4x6",
10976
11332
  onClick: e => {
10977
11333
  onChange(e.currentTarget.value);
@@ -10979,16 +11335,16 @@ const LabelLayoutSettings = ({
10979
11335
  value: "4x6"
10980
11336
  }, {
10981
11337
  children: jsxs("div", Object.assign({
10982
- css: labelLayout === "4x6" ? styles$5.selectedThermal : styles$5.thermal
11338
+ css: labelLayout === "4x6" ? styles$6.selectedThermal : styles$6.thermal
10983
11339
  }, {
10984
11340
  children: [labelLayout === "4x6" && jsx(Icon, {
10985
- css: styles$5.icon,
11341
+ css: styles$6.icon,
10986
11342
  name: IconNames$1.CHECK_FILLED
10987
11343
  }), jsx("div", Object.assign({
10988
- css: styles$5.thermalInner
11344
+ css: styles$6.thermalInner
10989
11345
  }, {
10990
11346
  children: jsx("div", {
10991
- css: styles$5.thermalLabel
11347
+ css: styles$6.thermalLabel
10992
11348
  })
10993
11349
  })), jsx(Typography, {
10994
11350
  children: t("manage-defaults:label.thermal.title")
@@ -11011,6 +11367,8 @@ const LabelLayout = ({
11011
11367
  display
11012
11368
  }) => {
11013
11369
  const {
11370
+ error: updateAccountSettingsErrors,
11371
+ isLoading: updatingAccountSettings,
11014
11372
  mutateAsync: updateAccountSettings
11015
11373
  } = useUpdateAccountSettings();
11016
11374
  const {
@@ -11028,6 +11386,8 @@ const LabelLayout = ({
11028
11386
  });
11029
11387
  return jsxs(Fragment, {
11030
11388
  children: [display === "settings" && jsx(LabelLayoutSettings, {
11389
+ errors: updateAccountSettingsErrors,
11390
+ isSaving: updatingAccountSettings,
11031
11391
  onChange: handleSubmitUpdateAccountSettings
11032
11392
  }), display === "purchase" && jsx(LabelLayoutPurchase, {
11033
11393
  onChange: handleSubmitUpdateAccountSettings
@@ -11035,7 +11395,7 @@ const LabelLayout = ({
11035
11395
  });
11036
11396
  };
11037
11397
 
11038
- const styles$4 = createStyles({
11398
+ const styles$5 = createStyles({
11039
11399
  fundAndPurchase: theme => ({
11040
11400
  borderTop: `1px solid ${theme.palette.gray.ultraLight}`
11041
11401
  }),
@@ -11059,6 +11419,50 @@ const rateSchema = z.object({
11059
11419
  })
11060
11420
  }).transform(schema => schema.rate.rateId);
11061
11421
 
11422
+ var _path, _path2;
11423
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11424
+ var SvgShipengineLogo = function SvgShipengineLogo(props) {
11425
+ return /*#__PURE__*/React.createElement("svg", _extends({
11426
+ width: 244,
11427
+ height: 31,
11428
+ fill: "none",
11429
+ xmlns: "http://www.w3.org/2000/svg"
11430
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
11431
+ d: "M25.038 15.5c0-.954-.357-1.789-1.073-2.504-.715-.715-1.55-1.073-2.503-1.073-.954 0-1.789.358-2.504 1.073-.716.715-1.073 1.55-1.073 2.504s.357 1.788 1.073 2.504c.715.715 1.55 1.073 2.504 1.073.953 0 1.788-.358 2.503-1.073.716-.716 1.073-1.55 1.073-2.504zm7.154-1.55v3.1c0 .12 0 .238-.119.358l-.238.238-2.623.358c-.12.477-.358.954-.597 1.192.358.477.835 1.073 1.55 1.908.12.12.12.238.12.358 0 .119 0 .238-.12.357-.238.358-.715.835-1.311 1.55-.596.716-1.073.954-1.312.954-.119 0-.238 0-.357-.12l-2.027-1.55c-.358.24-.835.359-1.312.478-.12 1.311-.238 2.146-.358 2.623 0 .357-.238.477-.476.477h-3.1c-.12 0-.239 0-.358-.12-.12-.119-.12-.238-.12-.357l-.357-2.623c-.477-.12-.835-.358-1.312-.477l-2.027 1.55c-.119.12-.238.12-.357.12-.12 0-.239 0-.358-.12-1.192-1.073-1.908-1.789-2.265-2.385-.12-.119-.12-.238-.12-.357 0-.12 0-.239.12-.358.119-.239.357-.477.715-.954s.596-.715.715-.954c-.238-.477-.477-.954-.596-1.43l-2.504-.358c-.119 0-.238-.12-.238-.12s-.12-.119-.12-.238v-3.1c0-.12 0-.239.12-.358l.238-.238 2.623-.358c.12-.477.358-.835.597-1.311-.358-.477-.835-1.193-1.55-1.908-.12-.12-.12-.239-.12-.358s0-.238.12-.357c.238-.358.715-.835 1.43-1.55.716-.716 1.073-.954 1.312-.954.12 0 .238 0 .358.119l1.907 1.55c.358-.239.835-.358 1.312-.477.12-1.312.238-2.146.358-2.623.119-.239.238-.358.477-.358h3.1c.119 0 .238 0 .357.12.12.119.12.238.12.357l.357 2.623c.477.12.835.358 1.312.477l2.027-1.55c.119-.12.238-.12.357-.12.12 0 .239 0 .358.12 1.192 1.073 2.027 1.908 2.265 2.385.12.119.12.119.12.357 0 .12 0 .239-.12.358-.119.239-.357.477-.715.954s-.596.715-.715.954c.238.477.477.954.596 1.311l2.504.358c.119 0 .238.12.238.12s.12.238.12.357z",
11432
+ fill: "#45AAF2"
11433
+ })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
11434
+ d: "M0 16.335v-1.789a1.7 1.7 0 0 0 1.43-.715c.358-.477.478-1.073.478-1.789V4.77c0-1.43.477-2.623 1.311-3.457C4.173.358 5.127 0 6.32 0h2.146v2.027H6.32c-.596 0-1.192.238-1.669.835-.477.596-.715 1.192-.715 2.026V12.4c0 1.67-.597 2.623-1.67 3.1 1.073.477 1.67 1.55 1.67 3.1v7.63c0 .835.238 1.55.715 2.028.477.596 1.073.834 1.67.834h2.145V31H6.32c-1.192 0-2.265-.477-3.1-1.311-.954-.835-1.311-2.027-1.311-3.458v-7.393c0-.715-.12-1.311-.477-1.788A1.7 1.7 0 0 0 0 16.335zm34.577 12.638h2.146c.596 0 1.192-.238 1.67-.834.476-.597.715-1.193.715-2.027V18.6c0-1.67.596-2.742 1.669-3.1-1.073-.477-1.67-1.55-1.67-3.1V4.888c0-.834-.238-1.55-.715-2.026-.477-.597-1.073-.835-1.669-.835h-2.146V0h2.146c1.192 0 2.265.477 3.1 1.312.835.834 1.312 2.026 1.312 3.457v7.273c0 .716.119 1.312.477 1.789.357.477.834.715 1.311.715v1.789c-.477 0-.835.238-1.192.715-.358.477-.477 1.073-.477 1.788v7.393c0 1.43-.477 2.504-1.312 3.457-.954.835-2.027 1.312-3.219 1.312h-2.146v-2.027zm17.884-7.75 1.193-1.55c.596.716 1.311 1.192 2.146 1.67.835.476 1.788.596 2.861.596.716 0 1.312-.12 1.789-.239.477-.12.954-.358 1.192-.715.358-.12.596-.477.716-.716.119-.357.238-.596.238-.954 0-.477-.12-.834-.358-1.192a2.784 2.784 0 0 0-.834-.835c-.358-.238-.835-.357-1.312-.596-.477-.238-.954-.357-1.55-.477-.596-.119-1.073-.238-1.55-.476a8.281 8.281 0 0 1-1.55-.597c-.477-.238-.954-.477-1.311-.834-.358-.358-.716-.716-.835-1.193-.238-.476-.358-1.073-.358-1.669 0-1.311.477-2.384 1.55-3.22 1.073-.834 2.385-1.191 3.935-1.191 2.385 0 4.292.715 5.723 2.265l-1.192 1.43c-1.193-1.31-2.743-1.907-4.65-1.907-.954 0-1.789.239-2.385.715-.596.477-.954 1.073-.954 1.789 0 .358.12.715.358 1.073s.477.477.835.715c.357.239.834.358 1.311.477.477.12.954.239 1.55.477.596.239 1.073.477 1.55.596a8.28 8.28 0 0 1 1.55.597c.477.238.954.476 1.312.834.357.358.715.715.834 1.192.12.477.358 1.073.358 1.67 0 .477-.12.954-.239 1.43-.119.477-.357.835-.596 1.312l-1.073 1.073a3.562 3.562 0 0 1-1.669.715c-.835.239-1.55.358-2.385.358-2.623 0-4.65-.834-6.2-2.623zm18.958 2.385V7.512h2.027v6.796h9.42V7.392h2.026v16.096h-2.027v-7.392h-9.419v7.392h-2.027v.12zm20.985 0V7.512h2.027v16.096h-2.027zm9.657 0V7.512h6.439c1.55 0 2.742.476 3.696 1.43.954.954 1.312 2.146 1.312 3.458a5.193 5.193 0 0 1-1.312 3.458c-.954.834-2.146 1.311-3.696 1.311h-4.531v6.439h-1.908zm2.027-8.227h4.173c.954 0 1.67-.239 2.385-.835.715-.596.954-1.311.954-2.265 0-.954-.358-1.67-.954-2.266-.596-.596-1.431-.834-2.385-.834h-4.173v6.2zm15.5 8.227V7.512h11.804v3.577h-7.631v2.503h7.512v3.577h-7.512v2.742h7.631v3.577h-11.804v.12zm18.123 0V7.512h4.174l6.557 8.823V7.512h4.173v16.096h-4.054l-6.796-9.3v9.3h-4.054zm20.866-8.108c0-1.192.238-2.385.715-3.458.477-1.073 1.073-1.907 1.908-2.623.835-.715 1.669-1.311 2.742-1.669 1.073-.358 2.146-.596 3.458-.596.835 0 1.669.12 2.385.358.715.238 1.43.476 1.907.834.596.358 1.073.835 1.431 1.192l1.073 1.431-3.458 1.789a4.103 4.103 0 0 0-1.43-1.431c-.597-.358-1.312-.596-2.027-.596-1.312 0-2.385.477-3.22 1.311-.834.835-1.311 2.027-1.311 3.339 0 1.311.477 2.384 1.311 3.338.835.835 1.908 1.312 3.22 1.312.596 0 1.073-.12 1.669-.239.596-.238.954-.477 1.311-.715v-1.192h-3.576v-3.577h7.75v6.438c-1.908 2.146-4.293 3.1-7.154 3.1-1.193 0-2.385-.238-3.458-.596a7.074 7.074 0 0 1-2.742-1.67c-.835-.715-1.431-1.55-1.908-2.622-.358-1.073-.596-2.266-.596-3.458zm22.058 8.108V7.512h4.173v16.096h-4.173zm10.85 0V7.512h4.292l6.558 8.823V7.512h4.173v16.096h-4.054l-6.796-9.3v9.3h-4.173zm21.7 0V7.512h11.803v3.577h-7.63v2.503h7.511v3.577h-7.511v2.742h7.63v3.577h-11.803v.12zm18.123-13.712c0-.715.238-1.43.834-1.908.596-.476 1.193-.834 1.908-.834.477 0 .954.12 1.431.358.477.238.715.596.954.953.238.358.357.835.357 1.431 0 .715-.238 1.43-.834 1.908-.597.477-1.193.835-1.908.835-.715 0-1.431-.239-1.908-.835-.477-.596-.834-1.193-.834-1.908zm.477 0c0 .596.238 1.192.715 1.67.477.476 1.073.715 1.669.715.596 0 1.192-.239 1.669-.716a2.353 2.353 0 0 0 .716-1.669c0-.715-.239-1.192-.716-1.67a2.356 2.356 0 0 0-1.669-.714c-.715 0-1.192.238-1.669.715-.477.358-.715.954-.715 1.67zm1.311 1.55v-3.1h1.312c.238 0 .477.12.715.239s.238.357.238.715-.119.596-.238.715c-.119.12-.358.239-.477.239l.835 1.311h-.596l-.835-1.311h-.596v1.311h-.358v-.119zm.358-1.55h.834c.12 0 .239 0 .358-.12.239-.238.239-.357.239-.476 0-.12 0-.358-.12-.477-.119-.12-.238-.12-.357-.12h-.835v1.193h-.119z",
11435
+ fill: "#162948"
11436
+ })));
11437
+ };
11438
+
11439
+ const styles$4 = createStyles({
11440
+ poweredByShipEngine: {
11441
+ display: "flex",
11442
+ alignItems: "center",
11443
+ justifyContent: "center",
11444
+ textAlign: "center",
11445
+ margin: "1rem 0",
11446
+ gap: "1rem",
11447
+ color: "#818F9C"
11448
+ }
11449
+ });
11450
+
11451
+ const PoweredByShipEngine = () => {
11452
+ const {
11453
+ t
11454
+ } = useTranslation();
11455
+ return jsxs("div", Object.assign({
11456
+ css: styles$4.poweredByShipEngine
11457
+ }, {
11458
+ children: [jsx(Typography, Object.assign({
11459
+ variant: "subtitle1"
11460
+ }, {
11461
+ children: t("powered-by")
11462
+ })), jsx(SvgShipengineLogo, {})]
11463
+ }));
11464
+ };
11465
+
11062
11466
  const RateForm = ({
11063
11467
  carriers,
11064
11468
  disabled,
@@ -11079,6 +11483,7 @@ const RateForm = ({
11079
11483
  }) => {
11080
11484
  features = Object.assign({
11081
11485
  enableGlobalPostFiltering: false,
11486
+ labelLayout: false,
11082
11487
  nicknameRate: true,
11083
11488
  saveRate: true
11084
11489
  }, features !== null && features !== void 0 ? features : {});
@@ -11143,6 +11548,14 @@ const RateForm = ({
11143
11548
  index < 5 && rateOptions.length <= 6 || !option.requiresAcknowledgement && index < 6 && rateOptions.length > 6 || option.rateId === selectedRateId), [rateOptions, selectedRateId]);
11144
11549
  // When rateOptions update, handle scrolling and single-rate auto-selection and form reset
11145
11550
  useEffect(() => {
11551
+ if (!(rateOptions === null || rateOptions === void 0 ? void 0 : rateOptions.length)) {
11552
+ form.setValue("rate", {
11553
+ isAcknowledged: false,
11554
+ rateId: ""
11555
+ }, {
11556
+ shouldDirty: true
11557
+ });
11558
+ }
11146
11559
  if (rateOptions.length === 1) {
11147
11560
  form.setValue("rate", {
11148
11561
  isAcknowledged: !rateOptions[0].requiresAcknowledgement,
@@ -11176,6 +11589,7 @@ const RateForm = ({
11176
11589
  children: [!isLoading && !!rateOptions.length ? jsxs(Fragment, {
11177
11590
  children: [jsx(RateSelect, {
11178
11591
  control: form.control,
11592
+ displayErrors: false,
11179
11593
  label: "Rate",
11180
11594
  name: "rate",
11181
11595
  nicknameFeature:
@@ -11184,7 +11598,7 @@ const RateForm = ({
11184
11598
  onClick: onSelectRate,
11185
11599
  options: showHiddenRates ? rateOptions : filteredRateOptions
11186
11600
  }), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsx(Link, Object.assign({
11187
- css: styles$4.showMoreOrLessRatesButton,
11601
+ css: styles$5.showMoreOrLessRatesButton,
11188
11602
  onClick: () => {
11189
11603
  var _a;
11190
11604
  setShowHiddenRates(!showHiddenRates);
@@ -11205,7 +11619,7 @@ const RateForm = ({
11205
11619
  }))
11206
11620
  }))]
11207
11621
  }) : !isLoading && !!allDisplayableErrors.length ? null : jsxs("article", Object.assign({
11208
- css: styles$4.ratesInterstitial,
11622
+ css: styles$5.ratesInterstitial,
11209
11623
  role: "presentation"
11210
11624
  }, {
11211
11625
  children: [jsx(Cube, {
@@ -11219,7 +11633,7 @@ const RateForm = ({
11219
11633
  children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
11220
11634
  })
11221
11635
  }))]
11222
- })), !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
11636
+ })), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
11223
11637
  title: t("manage-defaults:label.title")
11224
11638
  }, {
11225
11639
  children: jsx(LabelLayout, {
@@ -11228,14 +11642,14 @@ const RateForm = ({
11228
11642
  })), jsx(FundAndPurchase, {
11229
11643
  carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
11230
11644
  control: form.control,
11231
- css: styles$4.fundAndPurchase,
11645
+ css: styles$5.fundAndPurchase,
11232
11646
  disabled: disabled,
11233
11647
  isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
11234
11648
  isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
11235
11649
  onPurchase: handleSubmit,
11236
11650
  onSave: handleSaveRate,
11237
11651
  purchaseAmount: getTotalRateAmount(selectedRate)
11238
- })]
11652
+ }), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
11239
11653
  }));
11240
11654
  };
11241
11655
 
@@ -11800,13 +12214,10 @@ const ShipmentForm = ({
11800
12214
  } = useTranslation(["purchase-label"]);
11801
12215
  const [requireMeasurements, setRequireMeasurements] = useState(true);
11802
12216
  const [insuranceEnabled, setInsuranceEnabled] = useState(false);
11803
- const isCustomsRequired = useMemo(() => {
11804
- return shipment ? getIsCustomsRequiredForShipment(shipment) : false;
11805
- }, [shipment]);
11806
- const isContentDescriptionRequired = useMemo(() => {
11807
- var _a;
11808
- return shipment && ((_a = shipment.shipFrom) === null || _a === void 0 ? void 0 : _a.countryCode) === "MX" || (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo.countryCode) === "MX";
11809
- }, [shipment]);
12217
+ const {
12218
+ isContentDescriptionRequired,
12219
+ isCustomsRequired
12220
+ } = useShipmentMetadata(shipment);
11810
12221
  const shipmentSchema = useMemo(() => getShipmentSchema({
11811
12222
  isContentDescriptionRequired,
11812
12223
  isCustomsRequired,
@@ -11817,7 +12228,7 @@ const ShipmentForm = ({
11817
12228
  const form = useForm({
11818
12229
  defaultValues: {
11819
12230
  __mode: features.browseRates ? "browse_rates" : "select_service",
11820
- shipDate: minimumShipDate.toLocaleDateString("en-US")
12231
+ shipDate: formatUSADate(minimumShipDate || new Date())
11821
12232
  },
11822
12233
  resolver: validationResolver(shipmentSchema)
11823
12234
  });
@@ -11842,10 +12253,6 @@ const ShipmentForm = ({
11842
12253
  return (carriers !== null && carriers !== void 0 ? carriers : []).filter(c => carrierIds.includes(c.carrierId));
11843
12254
  }, [carrierIds, carriers, selectedMode]);
11844
12255
  const nonAddressValidationErrors = errors === null || errors === void 0 ? void 0 : errors.filter(e => e.errorCode !== "invalid_address");
11845
- const isInternationalShipment = useMemo(() => {
11846
- return shipment ? getIsInternationalShipment(shipment) : false;
11847
- }, [shipment]);
11848
- const isPoBoxShipment = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
11849
12256
  const confirmationOptions = useConfirmationOptions();
11850
12257
  const customsContentsOptions = useCustomsContentsOptions();
11851
12258
  const customsNonDeliveryOptions = useCustomsNonDeliveryOptions();
@@ -11853,9 +12260,9 @@ const ShipmentForm = ({
11853
12260
  includeShipsuranceInsurance: features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance,
11854
12261
  includeThirdPartyInsurance: features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance
11855
12262
  });
11856
- const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes, isPoBoxShipment);
11857
- const serviceCodeOptions = useServiceCodeOptions(carriers, !isInternationalShipment, isPoBoxShipment);
11858
- const shippingPresetOptions = useShippingPresetsOptions(shippingPresets, isInternationalShipment);
12263
+ const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes, shipment);
12264
+ const serviceCodeOptions = useServiceCodeOptions(carriers, shipment);
12265
+ const shippingPresetOptions = useShippingPresetsOptions(shippingPresets, shipment);
11859
12266
  const warehouseOptions = useWarehouseOptions(warehouses);
11860
12267
  const [showItems, setShowItems] = useState(false);
11861
12268
  const [showApplyPreset, setShowApplyPreset] = useState(false);
@@ -11953,7 +12360,7 @@ const ShipmentForm = ({
11953
12360
  carrierId: updatedShipment.carrierId,
11954
12361
  serviceCode: updatedShipment.serviceCode
11955
12362
  } : undefined,
11956
- shipDate: mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate).toLocaleDateString("en-US"),
12363
+ shipDate: formatUSADate(mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate)),
11957
12364
  shipmentId: updatedShipment.shipmentId,
11958
12365
  warehouseId: updatedShipment.warehouseId
11959
12366
  }));
@@ -11963,7 +12370,7 @@ const ShipmentForm = ({
11963
12370
  // Hydrate only the customs items portion of the shipment form
11964
12371
  const hydrateCustomsItems = useCallback(updatedShipment => {
11965
12372
  const formCustoms = form.getValues("customs");
11966
- if (updatedShipment.customs && !_$2.isEqual(formCustoms === null || formCustoms === void 0 ? void 0 : formCustoms.customsItems, updatedShipment.customs.customsItems)) {
12373
+ if (updatedShipment.customs && !_$3.isEqual(formCustoms === null || formCustoms === void 0 ? void 0 : formCustoms.customsItems, updatedShipment.customs.customsItems)) {
11967
12374
  form.setValue("customs.customsItems", updatedShipment.customs.customsItems.map(ci => Object.assign(Object.assign({}, ci), {
11968
12375
  value: typeof ci.value === "number" ? ci.value : ci.value.amount
11969
12376
  })), {
@@ -12004,7 +12411,7 @@ const ShipmentForm = ({
12004
12411
  // Autopopulate package dimensions if user selects a custom package
12005
12412
  useEffect(() => {
12006
12413
  const customPackage = findCustomPackage(selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.code);
12007
- if ((customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions) && !_$2.isEqual(customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions, form.getValues("packages.0.dimensions"))) {
12414
+ if ((customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions) && !_$3.isEqual(customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions, form.getValues("packages.0.dimensions"))) {
12008
12415
  const {
12009
12416
  length,
12010
12417
  width,
@@ -12115,6 +12522,7 @@ const ShipmentForm = ({
12115
12522
  });
12116
12523
  if (errors) throw new Error(errors.map(e => e.message).join(", "));
12117
12524
  if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
12525
+ const isEmptyShipTo = Object.entries(shipment.shipTo).every(([key, value]) => key === "countryCode" || [null, "", "unknown"].includes(value));
12118
12526
  return jsxs("form", Object.assign({
12119
12527
  id: "shipment-form",
12120
12528
  onSubmit: formLogger.capture(handleSubmit)
@@ -12138,7 +12546,12 @@ const ShipmentForm = ({
12138
12546
  }), jsx(FieldLabel, Object.assign({
12139
12547
  label: !isEditShipFormToOpen ? "purchase-label:fields.shipTo" : ""
12140
12548
  }, {
12141
- children: !isEditShipFormToOpen && (addressPreference ? jsx(AddressPreferenceDisplay, {
12549
+ children: !isEditShipFormToOpen && (isEmptyShipTo ? jsx(Button, Object.assign({
12550
+ onClick: toggleIsEditShipFormToOpen,
12551
+ variant: ButtonVariant.OUTLINED
12552
+ }, {
12553
+ children: t("purchase-label:fields:addShipToAddress")
12554
+ })) : addressPreference ? jsx(AddressPreferenceDisplay, {
12142
12555
  addressPreference: addressPreference,
12143
12556
  onChangePreference: handleChangePreference,
12144
12557
  onEditAddress: () => {
@@ -12301,7 +12714,7 @@ const ShipmentForm = ({
12301
12714
  onClick: () => {
12302
12715
  handleApplyPreset(preset.value);
12303
12716
  },
12304
- selected: _$2.isEqual(selectedPreset, preset.value),
12717
+ selected: _$3.isEqual(selectedPreset, preset.value),
12305
12718
  value: JSON.stringify(preset.value)
12306
12719
  }, {
12307
12720
  children: preset.description
@@ -12743,7 +13156,7 @@ const Shipment = ({
12743
13156
  })), "representative."]
12744
13157
  }))
12745
13158
  }))
12746
- }))]
13159
+ })), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
12747
13160
  });
12748
13161
  };
12749
13162
 
@@ -12771,115 +13184,6 @@ const SuspendShipment = ({
12771
13184
  }));
12772
13185
  };
12773
13186
 
12774
- const VoidLabel = ({
12775
- onComplete,
12776
- onSubmit,
12777
- onViewShipment,
12778
- shipment,
12779
- voidRequest
12780
- }) => {
12781
- const {
12782
- t
12783
- } = useTranslation(["common", "void-label"]);
12784
- const [isSubmitting, setIsSubmitting] = useState(false);
12785
- const handleSubmit = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
12786
- setIsSubmitting(true);
12787
- yield onSubmit();
12788
- setIsSubmitting(false);
12789
- }), [onSubmit]);
12790
- return jsxs(Fragment, {
12791
- children: [jsx(Section, {
12792
- children: voidRequest ? jsxs("section", Object.assign({
12793
- css: {
12794
- textAlign: "center",
12795
- width: "100%"
12796
- }
12797
- }, {
12798
- children: [jsx(Icon, {
12799
- css: theme => ({
12800
- color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
12801
- }),
12802
- name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? IconNames.CHECK_FILLED : IconNames.ALERT,
12803
- size: IconSize.SIZE_LARGE
12804
- }), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxs(Fragment, {
12805
- children: [jsx(Typography, Object.assign({
12806
- component: "h2"
12807
- }, {
12808
- children: t("void-label:resultTitles.approved")
12809
- })), jsx(Typography, Object.assign({
12810
- variant: "body1"
12811
- }, {
12812
- children: t("void-label:resultMessages.approved")
12813
- }))]
12814
- }) : jsxs(Fragment, {
12815
- children: [jsx(Typography, Object.assign({
12816
- component: "h2"
12817
- }, {
12818
- children: t("void-label:resultTitles.rejected")
12819
- })), jsx(Typography, Object.assign({
12820
- variant: "body1"
12821
- }, {
12822
- children: jsx("p", {
12823
- dangerouslySetInnerHTML: {
12824
- __html: t("void-label:resultMessages.rejected")
12825
- }
12826
- })
12827
- }))]
12828
- })]
12829
- })) : jsxs(Fragment, {
12830
- children: [jsx(Typography, Object.assign({
12831
- variant: "body1"
12832
- }, {
12833
- children: t("void-label:refund_process")
12834
- })), jsx(Typography, Object.assign({
12835
- component: "p",
12836
- variant: "body1"
12837
- }, {
12838
- children: t("void-label:refund_rules")
12839
- }))]
12840
- })
12841
- }), jsx(BottomSheet, Object.assign({
12842
- alwaysVisible: true,
12843
- css: theme => ({
12844
- borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
12845
- boxShadow: "none",
12846
- position: "static"
12847
- })
12848
- }, {
12849
- children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
12850
- // Label has been voided
12851
- jsxs(ButtonGroup, {
12852
- children: [jsx(Button, Object.assign({
12853
- bold: false,
12854
- onClick: () => shipment && onComplete(voidRequest, shipment),
12855
- type: "button",
12856
- variant: ButtonVariant.OUTLINED
12857
- }, {
12858
- children: t("void-label:actions.complete")
12859
- })), jsx(Button, Object.assign({
12860
- bold: false,
12861
- isFullWidth: true,
12862
- onClick: () => shipment && onViewShipment(shipment),
12863
- type: "button"
12864
- }, {
12865
- children: t("void-label:actions.viewShipment")
12866
- }))]
12867
- }) :
12868
- // Label has not yet been voided
12869
- jsx(Button, Object.assign({
12870
- bold: false,
12871
- disabled: isSubmitting,
12872
- isFullWidth: true,
12873
- isLoading: isSubmitting,
12874
- onClick: handleSubmit,
12875
- type: "submit"
12876
- }, {
12877
- children: t("void-label:actions.confirmVoid")
12878
- }))
12879
- }))]
12880
- });
12881
- };
12882
-
12883
13187
  var index = /*#__PURE__*/Object.freeze({
12884
13188
  __proto__: null,
12885
13189
  AddCarrierForm: AddCarrierForm,
@@ -12912,9 +13216,8 @@ var index = /*#__PURE__*/Object.freeze({
12912
13216
  Shipment: Shipment,
12913
13217
  SuspendShipment: SuspendShipment,
12914
13218
  WarehouseForm: WarehouseForm,
12915
- VoidLabel: VoidLabel,
12916
13219
  WalletForm: WalletForm,
12917
- styles: styles$b,
13220
+ styles: styles$d,
12918
13221
  billingAddressSchema: billingAddressSchema,
12919
13222
  walletSchema: walletSchema,
12920
13223
  BillingFields: BillingFields,
@@ -13199,6 +13502,7 @@ const DateRangeCombo = ({
13199
13502
  dateFormat: "MM/dd/yyyy",
13200
13503
  isClearable: true,
13201
13504
  label: t("wallet-history:actions.chooseDate"),
13505
+ locale: LOCALE,
13202
13506
  maxDate: new Date(),
13203
13507
  onClickConfirm: dates => {
13204
13508
  if (Array.isArray(dates) && dates.length === 2 && dates[1] !== null) handleConfirmCustomRange(dates);
@@ -13465,6 +13769,7 @@ var common = {
13465
13769
  autoFundingSettings: "Unable to load auto funding settings",
13466
13770
  carrier: "Unable to load carrier",
13467
13771
  carriers: "Unable to load carriers",
13772
+ label: "Unable to load label",
13468
13773
  salesOrder: "Unable to load order",
13469
13774
  shipment: "Unable to load shipment",
13470
13775
  warehouses: "Unable to load warehouses"
@@ -13495,6 +13800,7 @@ var common = {
13495
13800
  carriers: "Loading carriers...",
13496
13801
  data: "Loading...",
13497
13802
  importingSalesOrder: "Importing order...",
13803
+ label: "Loading label...",
13498
13804
  onboarding: "Loading onboarding...",
13499
13805
  salesOrder: "Loading order...",
13500
13806
  shipment: "Loading shipment...",
@@ -13521,6 +13827,7 @@ var common = {
13521
13827
  packageCodes: {
13522
13828
  "package": "Custom"
13523
13829
  },
13830
+ "powered-by": "Powered by",
13524
13831
  schema: {
13525
13832
  optionalLabel: "{{fieldLabel}} (optional)"
13526
13833
  },
@@ -13591,21 +13898,8 @@ var listCarriers$1 = {
13591
13898
 
13592
13899
  var manageDefaults = {
13593
13900
  "manage-defaults": {
13594
- units: {
13595
- title: "Units of Measure",
13596
- dimensions: {
13597
- title: "Dimensions",
13598
- standard: "Inches",
13599
- metric: "Centimeters"
13600
- },
13601
- weight: {
13602
- title: "Weight",
13603
- standard: "Pounds & Ounces",
13604
- g: "Grams",
13605
- kg: "Kilograms"
13606
- }
13607
- },
13608
13901
  label: {
13902
+ title: "Label Printing",
13609
13903
  letter: {
13610
13904
  title: "Letter (8.5 x 11 inch)",
13611
13905
  description: "For desktop printers"
@@ -13617,8 +13911,26 @@ var manageDefaults = {
13617
13911
  thermal: {
13618
13912
  title: "Thermal (4 x 6 inch)",
13619
13913
  description: "For label printers"
13914
+ }
13915
+ },
13916
+ status: {
13917
+ saving: "Saving...",
13918
+ saved: "Saved",
13919
+ savingFailed: "Saving Failed"
13920
+ },
13921
+ units: {
13922
+ title: "Units of Measure",
13923
+ dimensions: {
13924
+ title: "Dimensions",
13925
+ standard: "Inches",
13926
+ metric: "Centimeters"
13620
13927
  },
13621
- title: "Shipping Label Layout"
13928
+ weight: {
13929
+ title: "Weight",
13930
+ standard: "Pounds & Ounces",
13931
+ g: "Grams",
13932
+ kg: "Kilograms"
13933
+ }
13622
13934
  }
13623
13935
  }
13624
13936
  };
@@ -13751,7 +14063,9 @@ var purchaseLabel$1 = {
13751
14063
  invalidAddress: "The address cannot be validated. Please confirm the address details with your customer and <link>edit the address in ShipStation</link>.",
13752
14064
  noRates: "We were unable to find any rates matching your shipment information",
13753
14065
  salesOrderNotLoaded: "Sales order has not been loaded",
13754
- unsupportedAddress: "At this time, we do not support shipping to international addresses that require customs declarations, including international, military, and US Territory addresses. You can create a label for this order in ShipStation."
14066
+ unsupportedAddress: "At this time, we do not support shipping to international addresses that require customs declarations, including international, military, and US Territory addresses. You can create a label for this order in ShipStation.",
14067
+ saveRateFailedMessage: "Saving DHL Express Worldwide rates is temporarily unavailable. Please try again later.",
14068
+ saveRateFailedTitle: "Unable To Save Rate"
13755
14069
  },
13756
14070
  errorTypes: {
13757
14071
  results: "No results returned"
@@ -13779,6 +14093,7 @@ var purchaseLabel$1 = {
13779
14093
  shipDate: "Ship Date",
13780
14094
  service: "Service",
13781
14095
  shipTo: "Ship To",
14096
+ addShipToAddress: "Add Ship To Address",
13782
14097
  warehouse: "Ship From",
13783
14098
  weight: {
13784
14099
  whole: "Pounds",
@@ -13914,6 +14229,9 @@ var voidLabel$1 = {
13914
14229
  confirmVoid: "Confirm Void",
13915
14230
  viewShipment: "View Shipment"
13916
14231
  },
14232
+ errorMessages: {
14233
+ labelIdRequired: "A label id is required"
14234
+ },
13917
14235
  resultMessages: {
13918
14236
  approved: "Your refund request has been submitted to the carrier.",
13919
14237
  rejected: "Your label may have already been scanned by the carrier or the label type is ineligible for voiding.<br /><br />Contact your carrier for assistance with shipments currently in transit."
@@ -14220,7 +14538,7 @@ const useAddress = ({
14220
14538
  // If the address is international, we always default to the original due to issues with SE-API's validation
14221
14539
  const selectionSource = isDomesticAddress(originalAddress) && status !== "error" ? matchedAddress ? "matchedAddress" : "originalAddress" : "originalAddress";
14222
14540
  const alternativeSource = selectionSource === "matchedAddress" ? "originalAddress" : "matchedAddress";
14223
- const newAddressPreference = Object.assign(Object.assign(Object.assign({}, validation), _$2.isEqual(originalAddress, matchedAddress) ? {
14541
+ const newAddressPreference = Object.assign(Object.assign(Object.assign({}, validation), _$3.isEqual(originalAddress, matchedAddress) ? {
14224
14542
  // An exact match in SE-API will *sometimes* return a matchedAddress exactly mirroring the originalAddress,
14225
14543
  // but it's supposed to return no matchedAddress at all. We handle this case by placing the fallbackAddress
14226
14544
  // (if given) into the originalAddress slot.
@@ -15080,15 +15398,61 @@ const PurchaseLabelBySalesOrder = _a => {
15080
15398
  }));
15081
15399
  };
15082
15400
 
15083
- const useLoadShipment = ({
15084
- shipmentId
15085
- }) => {
15401
+ let shipmentsCreated = 0;
15402
+ const useGetOrCreateShipment = shipmentId => {
15403
+ const {
15404
+ client
15405
+ } = useShipEngine();
15406
+ const shipmentCreation = useMemo(() => {
15407
+ return ++shipmentsCreated;
15408
+ },
15409
+ // eslint-disable-next-line react-hooks/exhaustive-deps
15410
+ []);
15411
+ return useQuery({
15412
+ onError,
15413
+ retry: shipmentId !== undefined,
15414
+ queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
15415
+ var _a;
15416
+ if (shipmentId) {
15417
+ return (yield client.salesOrderShipments.get(shipmentId)).data;
15418
+ } else {
15419
+ const warehouses = (yield client.warehouses.list()).data.warehouses;
15420
+ const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
15421
+ if (defaultOrFirstWarehouse === undefined) {
15422
+ throw [CodedError.fromObject({
15423
+ message: "errorMessages.noWarehouses",
15424
+ errorType: "unknown",
15425
+ errorCode: "unknown",
15426
+ errorSource: "client"
15427
+ })];
15428
+ }
15429
+ const shipTo = {
15430
+ addressLine1: "",
15431
+ cityLocality: "",
15432
+ countryCode: "",
15433
+ name: "",
15434
+ phone: "",
15435
+ postalCode: "",
15436
+ stateProvince: ""
15437
+ };
15438
+ const newShipment = yield client.shipments.create({
15439
+ shipTo: shipTo,
15440
+ warehouseId: defaultOrFirstWarehouse.warehouseId
15441
+ });
15442
+ return newShipment.data.shipments[0];
15443
+ }
15444
+ }),
15445
+ queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
15446
+ });
15447
+ };
15448
+
15449
+ const useLoadOrCreateShipment = shipmentId => {
15086
15450
  const {
15087
15451
  data: shipment,
15088
15452
  error: loadShipmentErrors,
15089
15453
  refetch: refetchShipment,
15090
15454
  isLoading
15091
- } = useGetShipment(shipmentId);
15455
+ } = useGetOrCreateShipment(shipmentId);
15092
15456
  const errors = [...(loadShipmentErrors !== null && loadShipmentErrors !== void 0 ? loadShipmentErrors : [])];
15093
15457
  return {
15094
15458
  errors: errors.length > 0 ? errors : undefined,
@@ -15100,15 +15464,12 @@ const useLoadShipment = ({
15100
15464
 
15101
15465
  const PurchaseLabelByShipment = _a => {
15102
15466
  var {
15103
- shipmentId,
15104
15467
  onLoad,
15105
15468
  onShipmentUpdated,
15106
15469
  features
15107
15470
  } = _a,
15108
- props = __rest(_a, ["shipmentId", "onLoad", "onShipmentUpdated", "features"]);
15109
- const _b = useLoadShipment({
15110
- shipmentId
15111
- }),
15471
+ props = __rest(_a, ["onLoad", "onShipmentUpdated", "features"]);
15472
+ const _b = useLoadOrCreateShipment("shipmentId" in props ? props.shipmentId : undefined),
15112
15473
  {
15113
15474
  shipment
15114
15475
  } = _b,
@@ -15140,16 +15501,11 @@ const PurchaseLabelByShipment = _a => {
15140
15501
  };
15141
15502
 
15142
15503
  const Component$2 = _a => {
15143
- var {
15144
- shipmentId
15145
- } = _a,
15146
- props = __rest(_a, ["shipmentId"]);
15147
- if (shipmentId) {
15148
- return jsx(PurchaseLabelByShipment, Object.assign({
15149
- shipmentId: shipmentId
15150
- }, props));
15151
- } else {
15504
+ var props = __rest(_a, []);
15505
+ if ("salesOrderId" in props) {
15152
15506
  return jsx(PurchaseLabelBySalesOrder, Object.assign({}, props));
15507
+ } else {
15508
+ return jsx(PurchaseLabelByShipment, Object.assign({}, props));
15153
15509
  }
15154
15510
  };
15155
15511
  const Element$2 = alchemy.createElement(Component$2, ErrorFallback, {
@@ -15223,6 +15579,111 @@ var viewShipment = /*#__PURE__*/Object.freeze({
15223
15579
  Element: Element$1
15224
15580
  });
15225
15581
 
15582
+ const Actions = ({
15583
+ onComplete,
15584
+ onSubmit,
15585
+ onViewShipment,
15586
+ shipment,
15587
+ voidRequest
15588
+ }) => {
15589
+ const {
15590
+ t
15591
+ } = useTranslation(["common", "void-label"]);
15592
+ const [isSubmitting, setIsSubmitting] = useState(false);
15593
+ const handleSubmit = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
15594
+ setIsSubmitting(true);
15595
+ yield onSubmit();
15596
+ setIsSubmitting(false);
15597
+ }), [onSubmit]);
15598
+ return jsx(BottomSheet, Object.assign({
15599
+ alwaysVisible: true,
15600
+ css: theme => ({
15601
+ borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
15602
+ boxShadow: "none",
15603
+ position: "static"
15604
+ })
15605
+ }, {
15606
+ children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
15607
+ // The void request has been approved
15608
+ jsxs(ButtonGroup, {
15609
+ children: [jsx(Button, Object.assign({
15610
+ bold: false,
15611
+ onClick: () => onComplete(voidRequest, shipment),
15612
+ variant: ButtonVariant.OUTLINED
15613
+ }, {
15614
+ children: t("void-label:actions.complete")
15615
+ })), jsx(Button, Object.assign({
15616
+ bold: false,
15617
+ isFullWidth: true,
15618
+ onClick: () => onViewShipment(shipment)
15619
+ }, {
15620
+ children: t("void-label:actions.viewShipment")
15621
+ }))]
15622
+ }) :
15623
+ // The void request has yet to be made or was rejected
15624
+ jsx(Button, Object.assign({
15625
+ bold: false,
15626
+ isFullWidth: true,
15627
+ isLoading: isSubmitting,
15628
+ onClick: handleSubmit
15629
+ }, {
15630
+ children: t("void-label:actions.confirmVoid")
15631
+ }))
15632
+ }));
15633
+ };
15634
+
15635
+ const Message = ({
15636
+ voidRequest
15637
+ }) => {
15638
+ const {
15639
+ t
15640
+ } = useTranslation(["common", "void-label"]);
15641
+ return jsx(Section, {
15642
+ children: voidRequest ? jsxs("section", Object.assign({
15643
+ css: {
15644
+ textAlign: "center",
15645
+ width: "100%"
15646
+ }
15647
+ }, {
15648
+ children: [jsx(Icon, {
15649
+ css: theme => ({
15650
+ color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
15651
+ }),
15652
+ name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? IconNames.CHECK_FILLED : IconNames.ALERT,
15653
+ size: IconSize.SIZE_LARGE
15654
+ }), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxs(Fragment, {
15655
+ children: [jsx(Typography, Object.assign({
15656
+ component: "h2"
15657
+ }, {
15658
+ children: t("void-label:resultTitles.approved")
15659
+ })), jsx(Typography, {
15660
+ children: t("void-label:resultMessages.approved")
15661
+ })]
15662
+ }) : jsxs(Fragment, {
15663
+ children: [jsx(Typography, Object.assign({
15664
+ component: "h2"
15665
+ }, {
15666
+ children: t("void-label:resultTitles.rejected")
15667
+ })), jsx(Typography, {
15668
+ children: jsx("p", {
15669
+ dangerouslySetInnerHTML: {
15670
+ __html: t("void-label:resultMessages.rejected")
15671
+ }
15672
+ })
15673
+ })]
15674
+ })]
15675
+ })) : jsxs(Fragment, {
15676
+ children: [jsx(Typography, {
15677
+ children: t("void-label:refund_process")
15678
+ }), jsx(Typography, Object.assign({
15679
+ component: "p"
15680
+ }, {
15681
+ children: t("void-label:refund_rules")
15682
+ }))]
15683
+ })
15684
+ });
15685
+ };
15686
+
15226
15687
  const Component = ({
15227
15688
  labelId,
15228
15689
  onComplete,
@@ -15230,24 +15691,40 @@ const Component = ({
15230
15691
  onViewShipment
15231
15692
  }) => {
15232
15693
  var _a;
15694
+ // TODO [LMNT-910] - labelId should be a required prop
15695
+ if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
15696
+ const {
15697
+ t
15698
+ } = useTranslation();
15233
15699
  const label = useGetLabel(labelId);
15234
15700
  const shipment = useGetSalesOrderShipment((_a = label.data) === null || _a === void 0 ? void 0 : _a.shipmentId);
15235
15701
  const voidLabel = useVoidLabel();
15702
+ if (label.isLoading) return jsx(Loader, {
15703
+ message: t("loading.label")
15704
+ });
15705
+ if (shipment.isLoading) return jsx(Loader, {
15706
+ message: t("loading.shipment")
15707
+ });
15708
+ throwAny(label.error);
15709
+ throwAny(shipment.error);
15710
+ if (!label.data) throw new Error("errorMessages.unableToLoad.label");
15711
+ if (!shipment.data) throw new Error("errorMessages.unableToLoad.shipment");
15236
15712
  const handleVoidLabelSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
15237
- if (!labelId) throw new Error("labelId is required");
15238
15713
  const result = yield voidLabel.mutateAsync(labelId);
15239
- // We should always have label.data and shipment.data if the request was approved,
15240
- // but we aren't using Suspense so we still need to check.
15241
- if ((result === null || result === void 0 ? void 0 : result.approved) && label.data && shipment.data) {
15714
+ if (result.approved) {
15242
15715
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(label.data, shipment.data);
15243
15716
  }
15244
15717
  });
15245
- return jsx(VoidLabel, {
15246
- onComplete: onComplete,
15247
- onSubmit: handleVoidLabelSubmit,
15248
- onViewShipment: onViewShipment,
15249
- shipment: shipment.data,
15250
- voidRequest: voidLabel.data
15718
+ return jsxs(Fragment, {
15719
+ children: [jsx(Message, {
15720
+ voidRequest: voidLabel.data
15721
+ }), jsx(Actions, {
15722
+ onComplete: onComplete,
15723
+ onSubmit: handleVoidLabelSubmit,
15724
+ onViewShipment: onViewShipment,
15725
+ shipment: shipment.data,
15726
+ voidRequest: voidLabel.data
15727
+ }), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
15251
15728
  });
15252
15729
  };
15253
15730
  const Element = alchemy.createElement(Component, ErrorFallback, {
@@ -15266,4 +15743,4 @@ var voidLabel = /*#__PURE__*/Object.freeze({
15266
15743
  Element: Element
15267
15744
  });
15268
15745
 
15269
- export { AddFundsForm, AutoFundingForm, ButtonGroup, CarrierBalance, CopyButton, Country, Cube, DateRangeCombo, DateRangeSelect, ErrorFallback, fields as Field, FieldLabel, FormPortal, FundAndPurchase, InlineLabel, ItemsBreakdown, LinkAction, listCarriers as ListCarriers, Loader, ManageFunding, manageWarehouses as ManageWarehouses, onboarding as Onboarding, PageLayoutProvider, Portal, purchaseLabel as PurchaseLabel, RootPortalProvider, Section, Spacer, Spread, StoryNotes, index as Templates, UsState, UsaCity, viewShipment as ViewShipment, voidLabel as VoidLabel, autoFundingSchema, calculateTotal, capitalizeFirstLetter, convertDimensions, convertWeight, countries, countryCodes, createCodedErrors, createDictionary, createStyles, currencySymbol, daysAfter, errorMap, euCountryCodes, extendZod, formLogger, formatCreditCardNumber, formatDate, formatDateDDMMYY, formatExpiration, formatFractionalWeight, formatMoney, getAddFundsSchema, getCustomsFromSalesOrder, getExpirationYears, getIsCustomsRequiredForSalesOrder, getIsCustomsRequiredForShipment, getIsInternationalShipment, getPendingShipment, getRateRequiresAcknowledgement, getRelativeDates, getRequestedServices, getSalesOrderItemsFromSalesOrderOrShipment, getTotalRateAmount, isDomesticAddress, isFlatRatePackageCode, isMilitaryAddress, isNowOrInTheFuture, isPoBox, isPoBoxAddress, isString, isUnitedStatesTerritory, isUspsCarrier, moneySchema, mostRecent, nextDayCutoff, omitTime, overrideCarrierCodes$1 as overrideCarrierCodes, phoneSchema, phoneSchemaUnvalidated, postalCodeRegex$3 as postalCodeRegex, sortByCreationDate, usCities, usStateCodes, usStates, useAddressValidation, useCarrierMetadata, useConfirmationOptions, useCountryCodeOptions, useCustomsContentsOptions, useCustomsNonDeliveryOptions, useDateRangeOptions, useExpirationMonthOptions, useInsuranceProviderOptions, useNestedForm, usePackageOptions, usePageLayout, useRateOptions, useRootPortal, useRunOnceOnTrue, useServiceCodeOptions, useShippingPresetsOptions, useStateCodeOptions, useToggle, useWarehouseOptions, validationResolver };
15746
+ export { AddFundsForm, AutoFundingForm, ButtonGroup, CarrierBalance, CopyButton, Country, Cube, DateRangeCombo, DateRangeSelect, ErrorFallback, fields as Field, FieldLabel, FormPortal, FundAndPurchase, InlineLabel, ItemsBreakdown, LinkAction, listCarriers as ListCarriers, Loader, ManageFunding, manageWarehouses as ManageWarehouses, onboarding as Onboarding, PageLayoutProvider, Portal, PoweredByShipEngine, purchaseLabel as PurchaseLabel, RootPortalProvider, Section, Spacer, Spread, StoryNotes, index as Templates, UsState, UsaCity, viewShipment as ViewShipment, voidLabel as VoidLabel, autoFundingSchema, calculateTotal, capitalizeFirstLetter, convertDimensions, convertWeight, countries, countryCodes, createCodedErrors, createDictionary, createStyles, currencySymbol, daysAfter, errorMap, euCountryCodes, extendZod, formLogger, formatCreditCardNumber, formatDate, formatDateDDMMYY, formatExpiration, formatFractionalWeight, formatMoney, getAddFundsSchema, getCustomsFromSalesOrder, getExpirationYears, getIsCustomsRequiredForSalesOrder, getIsCustomsRequiredForShipment, getIsInternationalShipment, getPendingShipment, getRateRequiresAcknowledgement, getRelativeDates, getRequestedServices, getSalesOrderItemsFromSalesOrderOrShipment, getTotalRateAmount, isDomesticAddress, isFlatRatePackageCode, isMilitaryAddress, isNowOrInTheFuture, isPoBox, isPoBoxAddress, isString, isUnitedStatesTerritory, isUnsupportedByUps, isUpsCarrier, isUspsCarrier, moneySchema, mostRecent, nextDayCutoff, omitTime, overrideCarrierCodes$1 as overrideCarrierCodes, phoneSchema, phoneSchemaUnvalidated, postalCodeRegex$3 as postalCodeRegex, sortByCreationDate, throwAny, throwJoinedMessages, usCities, usStateCodes, usStates, useAddressValidation, useCarrierMetadata, useConfirmationOptions, useCountryCodeOptions, useCustomsContentsOptions, useCustomsNonDeliveryOptions, useDateRangeOptions, useExpirationMonthOptions, useInsuranceProviderOptions, useNestedForm, usePackageOptions, usePageLayout, useRateOptions, useRootPortal, useRunOnceOnTrue, useServiceCodeOptions, useShipmentMetadata, useShippingPresetsOptions, useStateCodeOptions, useToggle, useWarehouseOptions, validationResolver };