@shipengine/elements 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1101 -640
- package/index.js +1108 -654
- package/package.json +12 -4
- package/src/components/field/field.styles.d.ts +2 -12
- package/src/components/index.d.ts +1 -0
- package/src/components/label-layout/label-layout-settings.d.ts +3 -1
- package/src/components/powered-by-shipengine/index.d.ts +1 -0
- package/src/components/powered-by-shipengine/powered-by-shipengine.d.ts +1 -0
- package/src/components/powered-by-shipengine/powered-by-shipengine.styles.d.ts +11 -0
- package/src/components/save-status/index.d.ts +2 -0
- package/src/components/save-status/save-status-styles.d.ts +43 -0
- package/src/components/save-status/save-status.d.ts +6 -0
- package/src/components/templates/index.d.ts +0 -1
- package/src/components/templates/rate-form/rate-form.d.ts +1 -0
- package/src/constants/shipengine/address.d.ts +2 -0
- package/src/elements/list-carriers/list-carriers.d.ts +26 -14
- package/src/elements/manage-warehouses/manage-warehouses.d.ts +26 -14
- package/src/elements/onboarding/onboarding.d.ts +26 -14
- package/src/elements/purchase-label/hooks/use-load-or-create-shipment.d.ts +6 -0
- package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +5 -2
- package/src/elements/purchase-label/purchase-label.d.ts +38 -20
- package/src/elements/view-shipment/view-shipment.d.ts +26 -14
- package/src/{components/templates/void-label/void-label.d.ts → elements/void-label/components/actions/actions.d.ts} +3 -3
- package/src/elements/void-label/components/actions/index.d.ts +1 -0
- package/src/elements/void-label/components/index.d.ts +2 -0
- package/src/elements/void-label/components/message/index.d.ts +1 -0
- package/src/elements/void-label/components/message/message.d.ts +6 -0
- package/src/elements/void-label/void-label.d.ts +26 -14
- package/src/hooks/options/index.d.ts +1 -0
- package/src/hooks/options/use-package-options.d.ts +1 -1
- package/src/hooks/options/use-service-code-options.d.ts +1 -1
- package/src/hooks/options/use-shipment-metadata.d.ts +8 -0
- package/src/hooks/options/use-shipping-presets-options.d.ts +2 -1
- package/src/hooks/use-get-or-create-shipment.d.ts +2 -0
- package/src/locales/en/index.d.ts +26 -14
- package/src/mocks/server.d.ts +1 -0
- package/src/testing/extensions/index.d.ts +2 -0
- package/src/testing/extensions/matchers/extend-matchers.d.ts +8 -0
- package/src/testing/extensions/matchers/index.d.ts +1 -0
- package/src/testing/extensions/matchers/matchers.d.ts +1 -0
- package/src/testing/extensions/matchers/to-have-loading-spinner.d.ts +2 -0
- package/src/testing/extensions/queries/by-icon-name.d.ts +4 -0
- package/src/testing/extensions/queries/index.d.ts +57 -0
- package/src/testing/extensions/queries/queries.d.ts +1 -0
- package/src/testing/index.d.ts +1 -1
- package/src/testing/test-utils.d.ts +292 -0
- package/src/utilities/error.d.ts +13 -0
- package/src/utilities/i18nDateUtils.d.ts +16 -0
- package/src/utilities/shipengine/address.d.ts +4 -0
- package/src/utilities/shipengine/carrier.d.ts +1 -0
- package/src/components/templates/void-label/index.d.ts +0 -1
- package/src/public-sdk.d.ts +0 -38
- 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,
|
|
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,
|
|
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,
|
|
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 _$
|
|
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$
|
|
74
|
+
var call$k = Function.prototype.call;
|
|
72
75
|
|
|
73
|
-
var functionCall = NATIVE_BIND$3 ? call$
|
|
74
|
-
return call$
|
|
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$
|
|
106
|
-
var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$
|
|
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$
|
|
113
|
+
return call$j.apply(fn, arguments);
|
|
111
114
|
};
|
|
112
115
|
};
|
|
113
116
|
|
|
114
|
-
var uncurryThis$
|
|
117
|
+
var uncurryThis$r = functionUncurryThis;
|
|
115
118
|
|
|
116
|
-
var toString$
|
|
117
|
-
var stringSlice$
|
|
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$
|
|
123
|
+
return stringSlice$7(toString$e(it), 8, -1);
|
|
121
124
|
};
|
|
122
125
|
|
|
123
|
-
var uncurryThis$
|
|
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$
|
|
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$
|
|
144
|
+
var isNullOrUndefined$7 = function (it) {
|
|
142
145
|
return it === null || it === undefined;
|
|
143
146
|
};
|
|
144
147
|
|
|
145
|
-
var isNullOrUndefined$
|
|
148
|
+
var isNullOrUndefined$6 = isNullOrUndefined$7;
|
|
146
149
|
|
|
147
|
-
var $TypeError$
|
|
150
|
+
var $TypeError$i = TypeError;
|
|
148
151
|
|
|
149
152
|
// `RequireObjectCoercible` abstract operation
|
|
150
153
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
151
|
-
var requireObjectCoercible$
|
|
152
|
-
if (isNullOrUndefined$
|
|
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$
|
|
161
|
+
var requireObjectCoercible$8 = requireObjectCoercible$9;
|
|
159
162
|
|
|
160
163
|
var toIndexedObject$5 = function (it) {
|
|
161
|
-
return IndexedObject$2(requireObjectCoercible$
|
|
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$
|
|
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$
|
|
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$
|
|
195
|
+
return typeof it == 'object' ? it !== null : isCallable$n(it) || it === documentAll;
|
|
193
196
|
} : function (it) {
|
|
194
|
-
return typeof it == 'object' ? it !== null : isCallable$
|
|
197
|
+
return typeof it == 'object' ? it !== null : isCallable$n(it);
|
|
195
198
|
};
|
|
196
199
|
|
|
197
200
|
var global$o = global$p;
|
|
198
|
-
var isCallable$
|
|
201
|
+
var isCallable$m = isCallable$o;
|
|
199
202
|
|
|
200
203
|
var aFunction = function (argument) {
|
|
201
|
-
return isCallable$
|
|
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$
|
|
211
|
+
var uncurryThis$p = functionUncurryThis;
|
|
209
212
|
|
|
210
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
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$
|
|
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$
|
|
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$
|
|
294
|
+
var isCallable$k = isCallable$o;
|
|
292
295
|
var tryToString$4 = tryToString$5;
|
|
293
296
|
|
|
294
|
-
var $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$
|
|
299
|
-
throw $TypeError$
|
|
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$
|
|
306
|
+
var isNullOrUndefined$5 = isNullOrUndefined$7;
|
|
304
307
|
|
|
305
308
|
// `GetMethod` abstract operation
|
|
306
309
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
307
|
-
var getMethod$
|
|
310
|
+
var getMethod$6 = function (V, P) {
|
|
308
311
|
var func = V[P];
|
|
309
|
-
return isNullOrUndefined$
|
|
312
|
+
return isNullOrUndefined$5(func) ? undefined : aCallable$9(func);
|
|
310
313
|
};
|
|
311
314
|
|
|
312
|
-
var call$
|
|
313
|
-
var isCallable$
|
|
315
|
+
var call$i = functionCall;
|
|
316
|
+
var isCallable$j = isCallable$o;
|
|
314
317
|
var isObject$9 = isObject$a;
|
|
315
318
|
|
|
316
|
-
var $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$
|
|
323
|
-
if (isCallable$
|
|
324
|
-
if (pref !== 'string' && isCallable$
|
|
325
|
-
throw $TypeError$
|
|
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$
|
|
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$
|
|
373
|
+
return $Object$2(requireObjectCoercible$7(argument));
|
|
371
374
|
};
|
|
372
375
|
|
|
373
|
-
var uncurryThis$
|
|
376
|
+
var uncurryThis$o = functionUncurryThis;
|
|
374
377
|
var toObject$6 = toObject$7;
|
|
375
378
|
|
|
376
|
-
var hasOwnProperty = uncurryThis$
|
|
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$
|
|
388
|
+
var uncurryThis$n = functionUncurryThis;
|
|
386
389
|
|
|
387
390
|
var id = 0;
|
|
388
391
|
var postfix = Math.random();
|
|
389
|
-
var 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$
|
|
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$
|
|
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$
|
|
423
|
+
var call$h = functionCall;
|
|
421
424
|
var isObject$8 = isObject$a;
|
|
422
425
|
var isSymbol$1 = isSymbol$2;
|
|
423
|
-
var getMethod$
|
|
426
|
+
var getMethod$5 = getMethod$6;
|
|
424
427
|
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
425
|
-
var wellKnownSymbol$
|
|
428
|
+
var wellKnownSymbol$j = wellKnownSymbol$k;
|
|
426
429
|
|
|
427
|
-
var $TypeError$
|
|
428
|
-
var TO_PRIMITIVE = wellKnownSymbol$
|
|
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$
|
|
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$
|
|
441
|
+
result = call$h(exoticToPrim, input, pref);
|
|
439
442
|
if (!isObject$8(result) || isSymbol$1(result)) return result;
|
|
440
|
-
throw $TypeError$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
604
|
-
var isCallable$
|
|
606
|
+
var uncurryThis$m = functionUncurryThis;
|
|
607
|
+
var isCallable$i = isCallable$o;
|
|
605
608
|
var store$1 = sharedStore;
|
|
606
609
|
|
|
607
|
-
var functionToString = uncurryThis$
|
|
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$
|
|
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$
|
|
622
|
+
var isCallable$h = isCallable$o;
|
|
620
623
|
|
|
621
624
|
var WeakMap$1 = global$i.WeakMap;
|
|
622
625
|
|
|
623
|
-
var weakMapBasicDetection = isCallable$
|
|
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$
|
|
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$
|
|
757
|
+
return isCallable$g(this) && getInternalState$2(this).source || inspectSource$2(this);
|
|
755
758
|
}, 'toString');
|
|
756
759
|
|
|
757
|
-
var isCallable$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
875
|
+
var uncurryThis$l = functionUncurryThis;
|
|
873
876
|
var hasOwn$6 = hasOwnProperty_1;
|
|
874
877
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
875
|
-
var indexOf$
|
|
878
|
+
var indexOf$2 = arrayIncludes.indexOf;
|
|
876
879
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
877
880
|
|
|
878
|
-
var push$2 = uncurryThis$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
1043
|
-
var call$
|
|
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$
|
|
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$
|
|
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 $$
|
|
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
|
-
$$
|
|
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$
|
|
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$
|
|
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 $$
|
|
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
|
-
$$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
1405
|
+
var wellKnownSymbol$h = wellKnownSymbol$k;
|
|
1403
1406
|
|
|
1404
|
-
var ITERATOR$7 = wellKnownSymbol$
|
|
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$
|
|
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$
|
|
1448
|
+
var wellKnownSymbol$g = wellKnownSymbol$k;
|
|
1446
1449
|
|
|
1447
|
-
var TO_STRING_TAG$3 = wellKnownSymbol$
|
|
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$
|
|
1475
|
+
var isCallable$b = isCallable$o;
|
|
1473
1476
|
|
|
1474
1477
|
var $String$2 = String;
|
|
1475
|
-
var $TypeError$
|
|
1478
|
+
var $TypeError$b = TypeError;
|
|
1476
1479
|
|
|
1477
1480
|
var aPossiblePrototype$1 = function (argument) {
|
|
1478
|
-
if (typeof argument == 'object' || isCallable$
|
|
1479
|
-
throw $TypeError$
|
|
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$
|
|
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$
|
|
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 $$
|
|
1512
|
-
var call$
|
|
1514
|
+
var $$i = _export;
|
|
1515
|
+
var call$e = functionCall;
|
|
1513
1516
|
var FunctionName = functionName;
|
|
1514
|
-
var isCallable$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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 $$
|
|
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$
|
|
1727
|
+
var wellKnownSymbol$e = wellKnownSymbol$k;
|
|
1725
1728
|
|
|
1726
|
-
var ITERATOR$5 = wellKnownSymbol$
|
|
1727
|
-
var TO_STRING_TAG$2 = wellKnownSymbol$
|
|
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$
|
|
1898
|
+
var wellKnownSymbol$d = wellKnownSymbol$k;
|
|
1884
1899
|
|
|
1885
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$
|
|
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$
|
|
1908
|
+
var isCallable$9 = isCallable$o;
|
|
1894
1909
|
var classofRaw$1 = classofRaw$2;
|
|
1895
|
-
var wellKnownSymbol$
|
|
1910
|
+
var wellKnownSymbol$c = wellKnownSymbol$k;
|
|
1896
1911
|
|
|
1897
|
-
var TO_STRING_TAG = wellKnownSymbol$
|
|
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$
|
|
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$
|
|
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$
|
|
1936
|
-
var requireObjectCoercible$
|
|
1937
|
-
var toString$
|
|
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$
|
|
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$
|
|
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 $$
|
|
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
|
-
$$
|
|
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$
|
|
2070
|
-
var uncurryThis$
|
|
2071
|
-
var toString$
|
|
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$
|
|
2084
|
-
var indexOf = uncurryThis$
|
|
2085
|
-
var replace$2 = uncurryThis$
|
|
2086
|
-
var stringSlice$
|
|
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$
|
|
2092
|
-
call$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
2163
|
+
match = call$d(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2149
2164
|
|
|
2150
2165
|
if (sticky) {
|
|
2151
2166
|
if (match) {
|
|
2152
|
-
match.input = stringSlice$
|
|
2153
|
-
match[0] = stringSlice$
|
|
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$
|
|
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 $$
|
|
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
|
-
$$
|
|
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$
|
|
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$
|
|
2201
|
-
return call$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
2235
|
+
var wellKnownSymbol$b = wellKnownSymbol$k;
|
|
2221
2236
|
var createNonEnumerableProperty = createNonEnumerableProperty$5;
|
|
2222
2237
|
|
|
2223
|
-
var SPECIES$4 = wellKnownSymbol$
|
|
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$
|
|
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$
|
|
2280
|
+
var uncurriedNativeRegExpMethod = uncurryThis$e(/./[SYMBOL]);
|
|
2266
2281
|
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
2267
|
-
var uncurriedNativeMethod = uncurryThis$
|
|
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$
|
|
2303
|
+
var uncurryThis$d = functionUncurryThis;
|
|
2289
2304
|
var toIntegerOrInfinity$3 = toIntegerOrInfinity$6;
|
|
2290
|
-
var toString$
|
|
2291
|
-
var requireObjectCoercible$
|
|
2305
|
+
var toString$9 = toString$c;
|
|
2306
|
+
var requireObjectCoercible$5 = requireObjectCoercible$9;
|
|
2292
2307
|
|
|
2293
|
-
var charAt$3 = uncurryThis$
|
|
2294
|
-
var charCodeAt = uncurryThis$
|
|
2295
|
-
var stringSlice$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
2338
|
-
var replace$1 = uncurryThis$
|
|
2339
|
-
var stringSlice$
|
|
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$
|
|
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$
|
|
2359
|
-
case "'": return stringSlice$
|
|
2373
|
+
case '`': return stringSlice$4(str, 0, position);
|
|
2374
|
+
case "'": return stringSlice$4(str, tailPos);
|
|
2360
2375
|
case '<':
|
|
2361
|
-
capture = namedCaptures[stringSlice$
|
|
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$
|
|
2393
|
+
var call$b = functionCall;
|
|
2379
2394
|
var anObject$8 = anObject$f;
|
|
2380
|
-
var isCallable$
|
|
2395
|
+
var isCallable$8 = isCallable$o;
|
|
2381
2396
|
var classof$4 = classofRaw$2;
|
|
2382
2397
|
var regexpExec = regexpExec$2;
|
|
2383
2398
|
|
|
2384
|
-
var $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$
|
|
2391
|
-
var result = call$
|
|
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$
|
|
2396
|
-
throw $TypeError$
|
|
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$
|
|
2401
|
-
var uncurryThis$
|
|
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$
|
|
2406
|
-
var isNullOrUndefined$
|
|
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$
|
|
2410
|
-
var requireObjectCoercible$
|
|
2424
|
+
var toString$8 = toString$c;
|
|
2425
|
+
var requireObjectCoercible$4 = requireObjectCoercible$9;
|
|
2411
2426
|
var advanceStringIndex$1 = advanceStringIndex$2;
|
|
2412
|
-
var getMethod$
|
|
2413
|
-
var getSubstitution = getSubstitution$
|
|
2427
|
+
var getMethod$4 = getMethod$6;
|
|
2428
|
+
var getSubstitution$1 = getSubstitution$2;
|
|
2414
2429
|
var regExpExec$1 = regexpExecAbstract;
|
|
2415
|
-
var wellKnownSymbol$
|
|
2430
|
+
var wellKnownSymbol$a = wellKnownSymbol$k;
|
|
2416
2431
|
|
|
2417
|
-
var REPLACE = wellKnownSymbol$
|
|
2418
|
-
var max$
|
|
2432
|
+
var REPLACE$1 = wellKnownSymbol$a('replace');
|
|
2433
|
+
var max$2 = Math.max;
|
|
2419
2434
|
var min = Math.min;
|
|
2420
|
-
var concat = uncurryThis$
|
|
2421
|
-
var push$1 = uncurryThis$
|
|
2422
|
-
var stringIndexOf$
|
|
2423
|
-
var stringSlice$
|
|
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$
|
|
2464
|
-
var replacer = isNullOrUndefined$
|
|
2478
|
+
var O = requireObjectCoercible$4(this);
|
|
2479
|
+
var replacer = isNullOrUndefined$4(searchValue) ? undefined : getMethod$4(searchValue, REPLACE$1);
|
|
2465
2480
|
return replacer
|
|
2466
|
-
? call$
|
|
2467
|
-
: call$
|
|
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$
|
|
2488
|
+
var S = toString$8(string);
|
|
2474
2489
|
|
|
2475
2490
|
if (
|
|
2476
2491
|
typeof replaceValue == 'string' &&
|
|
2477
|
-
stringIndexOf$
|
|
2478
|
-
stringIndexOf$
|
|
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$
|
|
2485
|
-
if (!functionalReplace) replaceValue = toString$
|
|
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$
|
|
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$
|
|
2510
|
-
var position = max$
|
|
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$
|
|
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$
|
|
2542
|
+
accumulatedResult += stringSlice$3(S, nextSourcePosition, position) + replacement;
|
|
2528
2543
|
nextSourcePosition = position + matched.length;
|
|
2529
2544
|
}
|
|
2530
2545
|
}
|
|
2531
|
-
return accumulatedResult + stringSlice$
|
|
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"
|
|
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"
|
|
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 $$
|
|
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
|
-
$$
|
|
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$
|
|
2927
|
+
var $TypeError$9 = TypeError;
|
|
2899
2928
|
|
|
2900
2929
|
var deletePropertyOrThrow$1 = function (O, P) {
|
|
2901
|
-
if (!delete O[P]) throw $TypeError$
|
|
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 $$
|
|
2993
|
-
var uncurryThis$
|
|
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$
|
|
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$
|
|
3009
|
-
var push = uncurryThis$
|
|
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$
|
|
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
|
-
$$
|
|
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$
|
|
3177
|
+
var wellKnownSymbol$9 = wellKnownSymbol$k;
|
|
3149
3178
|
|
|
3150
|
-
var MATCH$1 = wellKnownSymbol$
|
|
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$
|
|
3190
|
+
var $TypeError$8 = TypeError;
|
|
3162
3191
|
|
|
3163
3192
|
var notARegexp = function (it) {
|
|
3164
|
-
if (isRegExp(it)) {
|
|
3165
|
-
throw $TypeError$
|
|
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$
|
|
3198
|
+
var wellKnownSymbol$8 = wellKnownSymbol$k;
|
|
3170
3199
|
|
|
3171
|
-
var MATCH = wellKnownSymbol$
|
|
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 $$
|
|
3186
|
-
var uncurryThis$
|
|
3214
|
+
var $$d = _export;
|
|
3215
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
3187
3216
|
var notARegExp = notARegexp;
|
|
3188
|
-
var requireObjectCoercible$
|
|
3189
|
-
var toString$
|
|
3217
|
+
var requireObjectCoercible$3 = requireObjectCoercible$9;
|
|
3218
|
+
var toString$6 = toString$c;
|
|
3190
3219
|
var correctIsRegExpLogic = correctIsRegexpLogic;
|
|
3191
3220
|
|
|
3192
|
-
var stringIndexOf = uncurryThis$
|
|
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
|
-
$$
|
|
3225
|
+
$$d({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
|
3197
3226
|
includes: function includes(searchString /* , position = 0 */) {
|
|
3198
|
-
return !!~stringIndexOf(
|
|
3199
|
-
toString$
|
|
3200
|
-
toString$
|
|
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,130 @@ 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
|
+
let _LOCALE = navigator.language;
|
|
3687
|
+
const loadableLocale = _LOCALE.replaceAll("-", "");
|
|
3688
|
+
const loadableBackupLocale = _LOCALE.split("-")[0];
|
|
3689
|
+
let intlLocale = undefined;
|
|
3690
|
+
if (loadableLocale in Locales || loadableBackupLocale) {
|
|
3691
|
+
const targetLocale = loadableLocale in Locales ? loadableLocale : loadableBackupLocale;
|
|
3692
|
+
const l = Locales[targetLocale];
|
|
3693
|
+
registerLocale(_LOCALE, l);
|
|
3694
|
+
intlLocale = l;
|
|
3695
|
+
setDefaultLocale(_LOCALE);
|
|
3696
|
+
} else {
|
|
3697
|
+
// Really should never happen but this SHOULD revert to un-localized
|
|
3698
|
+
console.log(`User's navigator.language locale ${_LOCALE} could not be loaded because it was not found in date-fns.
|
|
3699
|
+
Backup attempt to load ${loadableBackupLocale} failed as well.
|
|
3700
|
+
Reverting to en-US.`);
|
|
3701
|
+
_LOCALE = "en-US";
|
|
3702
|
+
}
|
|
3703
|
+
const usaLocale = Locales["enUS"];
|
|
3704
|
+
const LOCALE = _LOCALE;
|
|
3705
|
+
/**
|
|
3706
|
+
* Parse a string in the CURRENT locale into a Date object.
|
|
3707
|
+
* current locale is determined by navigator.language for now
|
|
3708
|
+
* @param dateString
|
|
3709
|
+
*/
|
|
3710
|
+
const parseLocaleDate = dateString => dateString ? parse(dateString, "P", new Date(), intlLocale ? {
|
|
3711
|
+
locale: intlLocale
|
|
3712
|
+
} : undefined) : null;
|
|
3713
|
+
const parseUSADate = dateString => dateString ? parse(dateString, "P", new Date(), {
|
|
3714
|
+
locale: usaLocale
|
|
3715
|
+
}) : null;
|
|
3716
|
+
/**
|
|
3717
|
+
*
|
|
3718
|
+
* Format a date into a string in the CURRENT locale.
|
|
3719
|
+
* current locale is determined by navigator.language for now
|
|
3720
|
+
* @param date
|
|
3721
|
+
*/
|
|
3722
|
+
const formatLocaleDate = date => date ? format(date, "P", {
|
|
3723
|
+
locale: intlLocale
|
|
3724
|
+
}) : null;
|
|
3725
|
+
const formatUSADate = date => date ? format(date, "P", {
|
|
3726
|
+
locale: usaLocale
|
|
3727
|
+
}) : null;
|
|
3728
|
+
|
|
3566
3729
|
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
3730
|
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
3731
|
const getWrapperStyles = theme => /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
|
|
@@ -3581,28 +3744,43 @@ const DatePicker = fieldProps => {
|
|
|
3581
3744
|
const datePickerRef = useRef(null);
|
|
3582
3745
|
return jsx(DatePickerController, Object.assign({}, fieldProps, {
|
|
3583
3746
|
children: _a => {
|
|
3584
|
-
var
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3747
|
+
var _datePickerProps = __rest(_a, ["ref"]);
|
|
3748
|
+
// Lens the form's usa date string into a locale date string
|
|
3749
|
+
// for the now localized date picker
|
|
3750
|
+
const onChange = date => {
|
|
3751
|
+
var _a;
|
|
3752
|
+
(_a = _datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(_datePickerProps, formatUSADate(parseLocaleDate(date)));
|
|
3753
|
+
};
|
|
3754
|
+
const value = formatLocaleDate(parseUSADate(_datePickerProps.value));
|
|
3755
|
+
const datePickerProps = Object.assign(Object.assign({}, _datePickerProps), {
|
|
3756
|
+
onChange,
|
|
3757
|
+
value
|
|
3758
|
+
});
|
|
3588
3759
|
return jsx("div", Object.assign({
|
|
3589
|
-
css: getOverrideStyles
|
|
3760
|
+
css: getOverrideStyles(theme)
|
|
3590
3761
|
}, {
|
|
3591
|
-
children: jsx(ReactDatePicker, Object.assign({
|
|
3592
|
-
|
|
3762
|
+
children: jsx(ReactDatePicker, Object.assign({
|
|
3763
|
+
locale: LOCALE
|
|
3764
|
+
}, datePickerProps, {
|
|
3765
|
+
customInput: /*#__PURE__*/createElement$2( /*#__PURE__*/forwardRef(function InputWrapper(_a, forwardedRef) {
|
|
3593
3766
|
var _b;
|
|
3594
3767
|
var {
|
|
3595
3768
|
value
|
|
3596
3769
|
} = _a,
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
ref
|
|
3770
|
+
inputProps = __rest(_a, ["value"]);
|
|
3771
|
+
if (typeof forwardedRef !== "function") throw new Error("DatePicker requires a callback-ref and should always be passing one (this should never happen)");
|
|
3772
|
+
// 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
|
|
3773
|
+
const mutableRef = useRef(null);
|
|
3774
|
+
// We wrap RDP's forwarded ref in order to setup our own mutable ref
|
|
3775
|
+
const callbackRef = useCallback(node => {
|
|
3776
|
+
// Invoke RDP's forwarded ref
|
|
3777
|
+
forwardedRef(node);
|
|
3778
|
+
// Setup our mutable ref
|
|
3779
|
+
if (node) mutableRef.current = node;
|
|
3780
|
+
}, [forwardedRef]);
|
|
3781
|
+
const isFocused = (_b = mutableRef.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
|
|
3782
|
+
return jsx(Input, Object.assign({}, inputProps, {
|
|
3783
|
+
ref: callbackRef,
|
|
3606
3784
|
rightContent: jsx(Icon
|
|
3607
3785
|
// Internally, RDP applies this class to the Input, but the Icon is absolute / in its own context
|
|
3608
3786
|
, {
|
|
@@ -3617,9 +3795,9 @@ const DatePicker = fieldProps => {
|
|
|
3617
3795
|
return (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(!datePickerRef.current.isCalendarOpen());
|
|
3618
3796
|
}
|
|
3619
3797
|
}),
|
|
3620
|
-
value: isFocused || value !== new Date()
|
|
3798
|
+
value: isFocused || value !== formatLocaleDate(new Date()) ? value : datePickerProps.placeholderText
|
|
3621
3799
|
}));
|
|
3622
|
-
}),
|
|
3800
|
+
})),
|
|
3623
3801
|
"data-testid": fieldProps.name ? camelize(fieldProps.name) : "date",
|
|
3624
3802
|
onCalendarOpen: () => {
|
|
3625
3803
|
var _a;
|
|
@@ -3628,13 +3806,13 @@ const DatePicker = fieldProps => {
|
|
|
3628
3806
|
onChange: (date, event) => {
|
|
3629
3807
|
var _a;
|
|
3630
3808
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
3631
|
-
(_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? date
|
|
3809
|
+
(_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? formatLocaleDate(date) : null);
|
|
3632
3810
|
},
|
|
3633
3811
|
popperClassName: getPopperStyles(theme),
|
|
3634
3812
|
popperPlacement: "bottom-end",
|
|
3635
3813
|
preventOpenOnFocus: true,
|
|
3636
3814
|
ref: datePickerRef,
|
|
3637
|
-
selected:
|
|
3815
|
+
selected: parseLocaleDate(datePickerProps.value),
|
|
3638
3816
|
showPopperArrow: false,
|
|
3639
3817
|
wrapperClassName: getWrapperStyles()
|
|
3640
3818
|
}))
|
|
@@ -3744,7 +3922,7 @@ var flattenIntoArray_1 = flattenIntoArray$1;
|
|
|
3744
3922
|
|
|
3745
3923
|
var uncurryThis$6 = functionUncurryThis;
|
|
3746
3924
|
var fails$5 = fails$q;
|
|
3747
|
-
var isCallable$5 = isCallable$
|
|
3925
|
+
var isCallable$5 = isCallable$o;
|
|
3748
3926
|
var classof$1 = classof$6;
|
|
3749
3927
|
var getBuiltIn$3 = getBuiltIn$8;
|
|
3750
3928
|
var inspectSource$1 = inspectSource$3;
|
|
@@ -3798,7 +3976,7 @@ var isConstructor$2 = !construct || fails$5(function () {
|
|
|
3798
3976
|
var isArray = isArray$2;
|
|
3799
3977
|
var isConstructor$1 = isConstructor$2;
|
|
3800
3978
|
var isObject$2 = isObject$a;
|
|
3801
|
-
var wellKnownSymbol$6 = wellKnownSymbol$
|
|
3979
|
+
var wellKnownSymbol$6 = wellKnownSymbol$k;
|
|
3802
3980
|
|
|
3803
3981
|
var SPECIES$3 = wellKnownSymbol$6('species');
|
|
3804
3982
|
var $Array = Array;
|
|
@@ -3979,8 +4157,8 @@ var uncurryThis$5 = functionUncurryThis;
|
|
|
3979
4157
|
var thisNumberValue$1 = uncurryThis$5(1.0.valueOf);
|
|
3980
4158
|
|
|
3981
4159
|
var toIntegerOrInfinity$1 = toIntegerOrInfinity$6;
|
|
3982
|
-
var toString$4 = toString$
|
|
3983
|
-
var requireObjectCoercible$1 = requireObjectCoercible$
|
|
4160
|
+
var toString$4 = toString$c;
|
|
4161
|
+
var requireObjectCoercible$1 = requireObjectCoercible$9;
|
|
3984
4162
|
|
|
3985
4163
|
var $RangeError$1 = RangeError;
|
|
3986
4164
|
|
|
@@ -4129,7 +4307,7 @@ $$a({ target: 'Number', proto: true, forced: FORCED$2 }, {
|
|
|
4129
4307
|
var global$a = global$p;
|
|
4130
4308
|
var fails$3 = fails$q;
|
|
4131
4309
|
var uncurryThis$3 = functionUncurryThis;
|
|
4132
|
-
var toString$3 = toString$
|
|
4310
|
+
var toString$3 = toString$c;
|
|
4133
4311
|
var trim$1 = stringTrim.trim;
|
|
4134
4312
|
var whitespaces$1 = whitespaces$4;
|
|
4135
4313
|
|
|
@@ -4289,7 +4467,7 @@ const MoneyInput = _a => {
|
|
|
4289
4467
|
var global$9 = global$p;
|
|
4290
4468
|
var fails$2 = fails$q;
|
|
4291
4469
|
var uncurryThis$2 = functionUncurryThis;
|
|
4292
|
-
var toString$2 = toString$
|
|
4470
|
+
var toString$2 = toString$c;
|
|
4293
4471
|
var trim = stringTrim.trim;
|
|
4294
4472
|
var whitespaces = whitespaces$4;
|
|
4295
4473
|
|
|
@@ -4362,23 +4540,10 @@ const NumberInput = _a => {
|
|
|
4362
4540
|
}));
|
|
4363
4541
|
};
|
|
4364
4542
|
|
|
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
4543
|
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
4379
4544
|
var defineBuiltIn$2 = defineBuiltIn$7;
|
|
4380
4545
|
var anObject$6 = anObject$f;
|
|
4381
|
-
var $toString = toString$
|
|
4546
|
+
var $toString = toString$c;
|
|
4382
4547
|
var fails$1 = fails$q;
|
|
4383
4548
|
var getRegExpFlags = regexpGetFlags;
|
|
4384
4549
|
|
|
@@ -4872,7 +5037,7 @@ const Select = _a => {
|
|
|
4872
5037
|
}, {
|
|
4873
5038
|
children: jsx(Select$1, Object.assign({}, fieldProps, {
|
|
4874
5039
|
showLabel: !!props.nativeLabel,
|
|
4875
|
-
value: flatOptions === null || flatOptions === void 0 ? void 0 : flatOptions.find(option => _$
|
|
5040
|
+
value: flatOptions === null || flatOptions === void 0 ? void 0 : flatOptions.find(option => _$3.isEqual(option.value, fieldProps.value))
|
|
4876
5041
|
}, {
|
|
4877
5042
|
children: options === null || options === void 0 ? void 0 : options.map((option, idx) => {
|
|
4878
5043
|
if (isCategory(option)) {
|
|
@@ -4892,7 +5057,7 @@ const Select = _a => {
|
|
|
4892
5057
|
onCategoryChange === null || onCategoryChange === void 0 ? void 0 : onCategoryChange(option.value);
|
|
4893
5058
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
4894
5059
|
},
|
|
4895
|
-
selected: _$
|
|
5060
|
+
selected: _$3.isEqual(value, fieldProps.value),
|
|
4896
5061
|
showTick: true,
|
|
4897
5062
|
value: stringifiedValue
|
|
4898
5063
|
}, {
|
|
@@ -4909,7 +5074,7 @@ const Select = _a => {
|
|
|
4909
5074
|
customOnChange === null || customOnChange === void 0 ? void 0 : customOnChange(option.value);
|
|
4910
5075
|
onChange === null || onChange === void 0 ? void 0 : onChange(option.value);
|
|
4911
5076
|
},
|
|
4912
|
-
selected: _$
|
|
5077
|
+
selected: _$3.isEqual(option.value, fieldProps.value),
|
|
4913
5078
|
showTick: true,
|
|
4914
5079
|
value: stringifiedValue
|
|
4915
5080
|
}, {
|
|
@@ -5177,17 +5342,43 @@ const useInsuranceProviderOptions = (insuranceAccount, features) => {
|
|
|
5177
5342
|
}), [t, insuranceAccount, features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance, features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance]);
|
|
5178
5343
|
};
|
|
5179
5344
|
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5345
|
+
const useShipmentMetadata = shipment => {
|
|
5346
|
+
const isInternational = useMemo(() => {
|
|
5347
|
+
return shipment ? getIsInternationalShipment(shipment) : false;
|
|
5348
|
+
}, [shipment]);
|
|
5349
|
+
const isPoBox = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
|
|
5350
|
+
const isUnsupportedUpsCountry = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isUnsupportedByUps(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
|
|
5351
|
+
const isCustomsRequired = useMemo(() => {
|
|
5352
|
+
return shipment ? getIsCustomsRequiredForShipment(shipment) : false;
|
|
5353
|
+
}, [shipment]);
|
|
5354
|
+
const isContentDescriptionRequired = useMemo(() => {
|
|
5355
|
+
var _a;
|
|
5356
|
+
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";
|
|
5357
|
+
}, [shipment]);
|
|
5358
|
+
return {
|
|
5359
|
+
isContentDescriptionRequired,
|
|
5360
|
+
isCustomsRequired,
|
|
5361
|
+
isInternational,
|
|
5362
|
+
isPoBox,
|
|
5363
|
+
isUnsupportedUpsCountry
|
|
5364
|
+
};
|
|
5365
|
+
};
|
|
5366
|
+
|
|
5367
|
+
let _$2 = t => t,
|
|
5368
|
+
_t$2,
|
|
5369
|
+
_t2$2;
|
|
5183
5370
|
const findGenericPackageFromCarriers = carriers => {
|
|
5184
5371
|
const carrier = carriers.find(c => c.packages.some(p => p.packageCode === "package"));
|
|
5185
5372
|
return carrier === null || carrier === void 0 ? void 0 : carrier.packages.find(p => p.packageCode === "package");
|
|
5186
5373
|
};
|
|
5187
|
-
const usePackageOptions = (carriers, customPackageTypes,
|
|
5374
|
+
const usePackageOptions = (carriers, customPackageTypes, shipment) => {
|
|
5188
5375
|
const {
|
|
5189
5376
|
t
|
|
5190
5377
|
} = useTranslation("common");
|
|
5378
|
+
const {
|
|
5379
|
+
isPoBox,
|
|
5380
|
+
isUnsupportedUpsCountry
|
|
5381
|
+
} = useShipmentMetadata(shipment);
|
|
5191
5382
|
return useMemo(() => {
|
|
5192
5383
|
if (!carriers) return undefined;
|
|
5193
5384
|
// Dictionary to lookup the uniqueness of each carrierCode
|
|
@@ -5196,7 +5387,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
|
|
|
5196
5387
|
}));
|
|
5197
5388
|
const genericPackage = findGenericPackageFromCarriers(carriers);
|
|
5198
5389
|
const packageOptions = [...(genericPackage ? [{
|
|
5199
|
-
label: t(_t$
|
|
5390
|
+
label: t(_t$2 || (_t$2 = _$2`packageCategories.browseRates`)),
|
|
5200
5391
|
options: [{
|
|
5201
5392
|
label: t("packageCodes.package"),
|
|
5202
5393
|
value: {
|
|
@@ -5204,7 +5395,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
|
|
|
5204
5395
|
}
|
|
5205
5396
|
}]
|
|
5206
5397
|
}] : []), ...((customPackageTypes === null || customPackageTypes === void 0 ? void 0 : customPackageTypes.length) ? [{
|
|
5207
|
-
label: t(_t2$
|
|
5398
|
+
label: t(_t2$2 || (_t2$2 = _$2`packageCategories.myCustomPackages`)),
|
|
5208
5399
|
options: customPackageTypes.sort((a, b) => a.name.localeCompare(b.name)).map(({
|
|
5209
5400
|
dimensions,
|
|
5210
5401
|
name,
|
|
@@ -5221,7 +5412,8 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
|
|
|
5221
5412
|
return carriers.reduce((options, carrier) => {
|
|
5222
5413
|
if (carrier.packages.length === 0) return options;
|
|
5223
5414
|
// Filter out non-USPS packages for PO Box shipments
|
|
5224
|
-
|
|
5415
|
+
// Filter out UPS packages for unsupported countries
|
|
5416
|
+
if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
|
|
5225
5417
|
return [...options, {
|
|
5226
5418
|
// Check the uniqueness of the carrierCode, if unique default to friendlyName and if non-unique use nickname.
|
|
5227
5419
|
label: isUniqueByCarrierCode[carrier.carrierCode] ? carrier.friendlyName : carrier.nickname,
|
|
@@ -5237,24 +5429,27 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
|
|
|
5237
5429
|
value: carrier.carrierId
|
|
5238
5430
|
}];
|
|
5239
5431
|
}, packageOptions);
|
|
5240
|
-
}, [carriers, customPackageTypes,
|
|
5432
|
+
}, [carriers, customPackageTypes, isPoBox, isUnsupportedUpsCountry, t]);
|
|
5241
5433
|
};
|
|
5242
5434
|
|
|
5243
5435
|
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
5436
|
const carriersById = useMemo(() => createDictionary(carriers, c => ({
|
|
5249
5437
|
[c.carrierId]: c
|
|
5250
5438
|
})), [carriers]);
|
|
5439
|
+
const {
|
|
5440
|
+
isInternational,
|
|
5441
|
+
isPoBox,
|
|
5442
|
+
isUnsupportedUpsCountry
|
|
5443
|
+
} = useShipmentMetadata(shipment);
|
|
5251
5444
|
return useMemo(() => {
|
|
5252
5445
|
return (rates !== null && rates !== void 0 ? rates : []).filter(r => {
|
|
5253
5446
|
const carrier = carriersById[r.carrierId];
|
|
5254
5447
|
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) === !
|
|
5448
|
+
return (service === null || service === void 0 ? void 0 : service.domestic) === !isInternational && (!enableGlobalPostFiltering || !r.serviceCode.includes("globalpost_")) && (
|
|
5256
5449
|
// Filter out non-USPS carriers for PO Box shipments
|
|
5257
|
-
service && isUspsCarrier(service.carrierCode) || !
|
|
5450
|
+
service && isUspsCarrier(service.carrierCode) || !isPoBox) && (
|
|
5451
|
+
// Filter out UPS for unsupported countries
|
|
5452
|
+
service && !isUpsCarrier(service.carrierCode) || !isUnsupportedUpsCountry);
|
|
5258
5453
|
}).sort((a, b) => getTotalRateAmount(a) - getTotalRateAmount(b)).map(r => {
|
|
5259
5454
|
var _a, _b;
|
|
5260
5455
|
const balance = (_a = carriersById[r.carrierId]) === null || _a === void 0 ? void 0 : _a.balance;
|
|
@@ -5266,22 +5461,29 @@ const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) =>
|
|
|
5266
5461
|
requiresFundedAmount
|
|
5267
5462
|
});
|
|
5268
5463
|
});
|
|
5269
|
-
}, [carriersById, enableGlobalPostFiltering,
|
|
5464
|
+
}, [carriersById, enableGlobalPostFiltering, isInternational, isPoBox, isUnsupportedUpsCountry, rates]);
|
|
5270
5465
|
};
|
|
5271
5466
|
|
|
5272
|
-
const useServiceCodeOptions = (carriers,
|
|
5467
|
+
const useServiceCodeOptions = (carriers, shipment) => {
|
|
5468
|
+
const {
|
|
5469
|
+
isInternational,
|
|
5470
|
+
isPoBox,
|
|
5471
|
+
isUnsupportedUpsCountry
|
|
5472
|
+
} = useShipmentMetadata(shipment);
|
|
5273
5473
|
return useMemo(() => {
|
|
5274
5474
|
// Dictionary to lookup the uniqueness of each carrierCode
|
|
5275
5475
|
const isUniqueByCarrierCode = createDictionary(carriers, (c, partialResults) => ({
|
|
5276
5476
|
[c.carrierCode]: partialResults[c.carrierCode] === undefined
|
|
5277
5477
|
}));
|
|
5278
5478
|
return (carriers !== null && carriers !== void 0 ? carriers : []).reduce((options, carrier) => {
|
|
5279
|
-
|
|
5280
|
-
|
|
5479
|
+
// Filter out non-USPS service for PO Box shipments
|
|
5480
|
+
// Filter out UPS service for unsupported countries
|
|
5481
|
+
if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
|
|
5482
|
+
const services = carrier.services.filter(s => s.domestic === !isInternational &&
|
|
5281
5483
|
// TODO: Pending LMNT-418, GlobalPost filtering should be wrapped in FF
|
|
5282
5484
|
!s.serviceCode.includes("globalpost_"));
|
|
5283
5485
|
if (services.length === 0) return options;
|
|
5284
|
-
const sortedServices = _$
|
|
5486
|
+
const sortedServices = _$3.orderBy(services, "name", "asc");
|
|
5285
5487
|
return [...options, {
|
|
5286
5488
|
// Check the uniqueness of the carrierCode, if unique default to friendlyName and if non-unique use nickname.
|
|
5287
5489
|
label: isUniqueByCarrierCode[carrier.carrierCode] ? carrier.friendlyName : carrier.nickname,
|
|
@@ -5295,7 +5497,7 @@ const useServiceCodeOptions = (carriers, domestic, poBox) => {
|
|
|
5295
5497
|
value: carrier.carrierId
|
|
5296
5498
|
}];
|
|
5297
5499
|
}, []);
|
|
5298
|
-
}, [carriers,
|
|
5500
|
+
}, [carriers, isInternational, isPoBox, isUnsupportedUpsCountry]);
|
|
5299
5501
|
};
|
|
5300
5502
|
|
|
5301
5503
|
const getContainerStyles = theme => /*#__PURE__*/css$1({
|
|
@@ -5354,13 +5556,16 @@ const createCategoryFromShippingPresets = (categoryName, presets) => presets ? [
|
|
|
5354
5556
|
const useShippingPresetsOptions = ({
|
|
5355
5557
|
platform,
|
|
5356
5558
|
user
|
|
5357
|
-
} = {},
|
|
5559
|
+
} = {}, shipment) => {
|
|
5358
5560
|
const {
|
|
5359
5561
|
t
|
|
5360
5562
|
} = useTranslation();
|
|
5361
|
-
|
|
5563
|
+
const {
|
|
5564
|
+
isInternational
|
|
5565
|
+
} = useShipmentMetadata(shipment);
|
|
5566
|
+
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
5567
|
// TODO - platform name should probably be a platform-specific environmental variable ?
|
|
5363
|
-
...createCategoryFromShippingPresets(t("shippingPresets.platform"),
|
|
5568
|
+
...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
5569
|
};
|
|
5365
5570
|
|
|
5366
5571
|
const useStateCodeOptions = domestic => useMemo(() => usStates.flatMap(v => !domestic || !v.isMilitary && !v.isUnitedStatesTerritory ? {
|
|
@@ -5637,7 +5842,7 @@ const useRunOnceOnTrue = conditionalEffect => {
|
|
|
5637
5842
|
*/
|
|
5638
5843
|
const useToggle = (initialValue = false) => useReducer((prev, next) => next !== undefined && typeof next !== "object" ? next : !prev, initialValue);
|
|
5639
5844
|
|
|
5640
|
-
var wellKnownSymbol$5 = wellKnownSymbol$
|
|
5845
|
+
var wellKnownSymbol$5 = wellKnownSymbol$k;
|
|
5641
5846
|
var Iterators$1 = iterators;
|
|
5642
5847
|
|
|
5643
5848
|
var ITERATOR$2 = wellKnownSymbol$5('iterator');
|
|
@@ -5649,10 +5854,10 @@ var isArrayIteratorMethod$1 = function (it) {
|
|
|
5649
5854
|
};
|
|
5650
5855
|
|
|
5651
5856
|
var classof = classof$6;
|
|
5652
|
-
var getMethod$2 = getMethod$
|
|
5653
|
-
var isNullOrUndefined$2 = isNullOrUndefined$
|
|
5857
|
+
var getMethod$2 = getMethod$6;
|
|
5858
|
+
var isNullOrUndefined$2 = isNullOrUndefined$7;
|
|
5654
5859
|
var Iterators = iterators;
|
|
5655
|
-
var wellKnownSymbol$4 = wellKnownSymbol$
|
|
5860
|
+
var wellKnownSymbol$4 = wellKnownSymbol$k;
|
|
5656
5861
|
|
|
5657
5862
|
var ITERATOR$1 = wellKnownSymbol$4('iterator');
|
|
5658
5863
|
|
|
@@ -5678,7 +5883,7 @@ var getIterator$1 = function (argument, usingIterator) {
|
|
|
5678
5883
|
|
|
5679
5884
|
var call$6 = functionCall;
|
|
5680
5885
|
var anObject$4 = anObject$f;
|
|
5681
|
-
var getMethod$1 = getMethod$
|
|
5886
|
+
var getMethod$1 = getMethod$6;
|
|
5682
5887
|
|
|
5683
5888
|
var iteratorClose$1 = function (iterator, kind, value) {
|
|
5684
5889
|
var innerResult, innerError;
|
|
@@ -5799,7 +6004,7 @@ const useAddressValidation = () => {
|
|
|
5799
6004
|
if (matchedAddress.addressLine2 === "") {
|
|
5800
6005
|
matchedAddress.addressLine2 = null;
|
|
5801
6006
|
}
|
|
5802
|
-
if (_$
|
|
6007
|
+
if (_$3.isEqual(_$3.omit(matchedAddress, ["postalCode", "addressResidentialIndicator"]), _$3.omit(originalAddress, ["postalCode", "addressResidentialIndicator"]))) return true;else return false;
|
|
5803
6008
|
}, []);
|
|
5804
6009
|
const postalCodeCompare = useCallback((matched, original) => {
|
|
5805
6010
|
if (matched === undefined || original === undefined) return false;
|
|
@@ -5926,7 +6131,7 @@ const AddressParser = ({
|
|
|
5926
6131
|
}));
|
|
5927
6132
|
};
|
|
5928
6133
|
|
|
5929
|
-
const styles$
|
|
6134
|
+
const styles$o = createStyles({
|
|
5930
6135
|
grow: {
|
|
5931
6136
|
flexGrow: 1
|
|
5932
6137
|
},
|
|
@@ -6026,13 +6231,13 @@ const AddressFields = ({
|
|
|
6026
6231
|
},
|
|
6027
6232
|
options: countryCodeOptions
|
|
6028
6233
|
}), jsxs("div", Object.assign({
|
|
6029
|
-
css: styles$
|
|
6234
|
+
css: styles$o.stateZipWrapper
|
|
6030
6235
|
}, {
|
|
6031
6236
|
children: [jsx("div", Object.assign({
|
|
6032
|
-
css: styles$
|
|
6237
|
+
css: styles$o.stateWrapper
|
|
6033
6238
|
}, {
|
|
6034
6239
|
children: jsx("div", Object.assign({
|
|
6035
|
-
css: styles$
|
|
6240
|
+
css: styles$o.grow
|
|
6036
6241
|
}, {
|
|
6037
6242
|
children: watchCountryCode === "US" ?
|
|
6038
6243
|
// Domestic States
|
|
@@ -6057,10 +6262,10 @@ const AddressFields = ({
|
|
|
6057
6262
|
})
|
|
6058
6263
|
}))
|
|
6059
6264
|
})), jsx("div", Object.assign({
|
|
6060
|
-
css: styles$
|
|
6265
|
+
css: styles$o.zipWrapper
|
|
6061
6266
|
}, {
|
|
6062
6267
|
children: jsx("div", Object.assign({
|
|
6063
|
-
css: styles$
|
|
6268
|
+
css: styles$o.grow
|
|
6064
6269
|
}, {
|
|
6065
6270
|
children: jsx(TextInput, {
|
|
6066
6271
|
control: form.control,
|
|
@@ -6100,11 +6305,11 @@ const extendZod = () => {
|
|
|
6100
6305
|
var call$4 = functionCall;
|
|
6101
6306
|
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
6102
6307
|
var anObject$2 = anObject$f;
|
|
6103
|
-
var isNullOrUndefined$1 = isNullOrUndefined$
|
|
6308
|
+
var isNullOrUndefined$1 = isNullOrUndefined$7;
|
|
6104
6309
|
var toLength = toLength$3;
|
|
6105
|
-
var toString$1 = toString$
|
|
6106
|
-
var requireObjectCoercible = requireObjectCoercible$
|
|
6107
|
-
var getMethod = getMethod$
|
|
6310
|
+
var toString$1 = toString$c;
|
|
6311
|
+
var requireObjectCoercible = requireObjectCoercible$9;
|
|
6312
|
+
var getMethod = getMethod$6;
|
|
6108
6313
|
var advanceStringIndex = advanceStringIndex$2;
|
|
6109
6314
|
var regExpExec = regexpExecAbstract;
|
|
6110
6315
|
|
|
@@ -6232,7 +6437,7 @@ const AddressForm = ({
|
|
|
6232
6437
|
children: [jsxs("div", Object.assign({
|
|
6233
6438
|
css: theme => ({
|
|
6234
6439
|
display: "flex",
|
|
6235
|
-
|
|
6440
|
+
flexDirection: isAddressParserOpen ? "column" : "row",
|
|
6236
6441
|
paddingBottom: theme.spacing(4),
|
|
6237
6442
|
width: "100%"
|
|
6238
6443
|
})
|
|
@@ -6298,7 +6503,7 @@ const AddressForm = ({
|
|
|
6298
6503
|
}));
|
|
6299
6504
|
};
|
|
6300
6505
|
|
|
6301
|
-
const styles$
|
|
6506
|
+
const styles$n = createStyles({
|
|
6302
6507
|
agreement: {
|
|
6303
6508
|
alignItems: "center",
|
|
6304
6509
|
display: "flex",
|
|
@@ -6368,10 +6573,10 @@ const DisplayCarrierTerms = c => {
|
|
|
6368
6573
|
const listCarrierLinks = () => {
|
|
6369
6574
|
return c.carrierTerms.links.map((term, index) => {
|
|
6370
6575
|
return jsx("li", Object.assign({
|
|
6371
|
-
css: styles$
|
|
6576
|
+
css: styles$n.listItems
|
|
6372
6577
|
}, {
|
|
6373
6578
|
children: jsx(Link, Object.assign({
|
|
6374
|
-
css: styles$
|
|
6579
|
+
css: styles$n.link,
|
|
6375
6580
|
href: term.url,
|
|
6376
6581
|
isExternal: true,
|
|
6377
6582
|
target: "_blank"
|
|
@@ -6387,18 +6592,18 @@ const DisplayCarrierTerms = c => {
|
|
|
6387
6592
|
};
|
|
6388
6593
|
const listCarrierTerms = () => {
|
|
6389
6594
|
return jsxs("div", Object.assign({
|
|
6390
|
-
css: styles$
|
|
6595
|
+
css: styles$n.terms
|
|
6391
6596
|
}, {
|
|
6392
6597
|
children: [jsx(Typography, Object.assign({
|
|
6393
6598
|
variant: "subtitle1"
|
|
6394
6599
|
}, {
|
|
6395
6600
|
children: c.carrierTerms.title
|
|
6396
6601
|
})), jsx("div", Object.assign({
|
|
6397
|
-
css: styles$
|
|
6602
|
+
css: styles$n.terms
|
|
6398
6603
|
}, {
|
|
6399
6604
|
children: listCarrierContent()
|
|
6400
6605
|
})), jsx("ul", Object.assign({
|
|
6401
|
-
css: styles$
|
|
6606
|
+
css: styles$n.links
|
|
6402
6607
|
}, {
|
|
6403
6608
|
children: listCarrierLinks()
|
|
6404
6609
|
}))]
|
|
@@ -6628,7 +6833,7 @@ const AddressDisplay = ({
|
|
|
6628
6833
|
}));
|
|
6629
6834
|
};
|
|
6630
6835
|
|
|
6631
|
-
const styles$
|
|
6836
|
+
const styles$m = createStyles({
|
|
6632
6837
|
container: theme => ({
|
|
6633
6838
|
display: "flex",
|
|
6634
6839
|
gap: theme.spacing()
|
|
@@ -6666,13 +6871,13 @@ const Disclosure = ({
|
|
|
6666
6871
|
}, [open]);
|
|
6667
6872
|
return jsxs(Fragment, {
|
|
6668
6873
|
children: [jsxs("div", Object.assign({
|
|
6669
|
-
css: styles$
|
|
6874
|
+
css: styles$m.container
|
|
6670
6875
|
}, {
|
|
6671
6876
|
children: [jsx("div", {
|
|
6672
6877
|
children: label
|
|
6673
6878
|
}), _showToggle && jsx("button", Object.assign({
|
|
6674
6879
|
"aria-expanded": isOpen,
|
|
6675
|
-
css: styles$
|
|
6880
|
+
css: styles$m.toggle,
|
|
6676
6881
|
onClick: () => {
|
|
6677
6882
|
setIsOpen(!isOpen);
|
|
6678
6883
|
onToggle(!isOpen);
|
|
@@ -6680,12 +6885,12 @@ const Disclosure = ({
|
|
|
6680
6885
|
type: "button"
|
|
6681
6886
|
}, {
|
|
6682
6887
|
children: jsx(Icon, {
|
|
6683
|
-
css: styles$
|
|
6888
|
+
css: styles$m.icon,
|
|
6684
6889
|
name: isOpen ? IconNames.CHEVRON_TOP : IconNames.CHEVRON_BOTTOM
|
|
6685
6890
|
})
|
|
6686
6891
|
}))]
|
|
6687
6892
|
})), isOpen && jsx("div", Object.assign({
|
|
6688
|
-
css: styles$
|
|
6893
|
+
css: styles$m.content
|
|
6689
6894
|
}, {
|
|
6690
6895
|
children: typeof children === "function" ? children(() => setIsOpen(!isOpen)) : children
|
|
6691
6896
|
}))]
|
|
@@ -6725,14 +6930,10 @@ const AddressPreferenceDisplay = ({
|
|
|
6725
6930
|
}), [addressPreference, onChangePreference]);
|
|
6726
6931
|
const disclosureContentTitle = useMemo(() => addressPreference.status === "verified" ? t(`address.preference.${addressPreference.alternativeSource}`) : t("address.preference.addressNotValidated"), [addressPreference, t]);
|
|
6727
6932
|
const isVerified = useMemo(() => {
|
|
6728
|
-
if (
|
|
6729
|
-
return
|
|
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;
|
|
6933
|
+
if (addressPreference.status === "verified" && addressPreference.selectionSource === "matchedAddress") {
|
|
6934
|
+
return true;
|
|
6734
6935
|
}
|
|
6735
|
-
return
|
|
6936
|
+
return false;
|
|
6736
6937
|
}, [addressPreference]);
|
|
6737
6938
|
return jsxs(Fragment, {
|
|
6738
6939
|
children: [jsx(AddressDisplay, {
|
|
@@ -6835,7 +7036,7 @@ const getCarrierRecoverySchema = requiresAddress => z.object({
|
|
|
6835
7036
|
address: requiresAddress ? baseSchema : baseSchema.optional()
|
|
6836
7037
|
});
|
|
6837
7038
|
|
|
6838
|
-
const styles$
|
|
7039
|
+
const styles$l = createStyles({
|
|
6839
7040
|
grid: theme => ({
|
|
6840
7041
|
margin: theme.spacing(4)
|
|
6841
7042
|
}),
|
|
@@ -6878,7 +7079,7 @@ const CarrierRecoveryForm = ({
|
|
|
6878
7079
|
onSubmit: formLogger.capture(handleSubmit)
|
|
6879
7080
|
}, {
|
|
6880
7081
|
children: jsxs(Grid, Object.assign({
|
|
6881
|
-
css: styles$
|
|
7082
|
+
css: styles$l.grid,
|
|
6882
7083
|
noPadding: true
|
|
6883
7084
|
}, {
|
|
6884
7085
|
children: [requiresAddress && jsxs(Fragment, {
|
|
@@ -6886,14 +7087,14 @@ const CarrierRecoveryForm = ({
|
|
|
6886
7087
|
colSpan: 12
|
|
6887
7088
|
}, {
|
|
6888
7089
|
children: jsx(Typography, Object.assign({
|
|
6889
|
-
css: styles$
|
|
7090
|
+
css: styles$l.heading,
|
|
6890
7091
|
variant: "heading4"
|
|
6891
7092
|
}, {
|
|
6892
7093
|
children: t("register-wallet:sections.carriers.title")
|
|
6893
7094
|
}))
|
|
6894
7095
|
})), jsx(GridChild, Object.assign({
|
|
6895
7096
|
colSpan: 12,
|
|
6896
|
-
css: styles$
|
|
7097
|
+
css: styles$l.subtitle
|
|
6897
7098
|
}, {
|
|
6898
7099
|
children: jsx(Typography, Object.assign({
|
|
6899
7100
|
variant: "subtitle1"
|
|
@@ -6979,7 +7180,7 @@ const CarrierTermsForm = ({
|
|
|
6979
7180
|
onSubmit(payload.agreement);
|
|
6980
7181
|
}));
|
|
6981
7182
|
return jsxs("div", Object.assign({
|
|
6982
|
-
css: styles$
|
|
7183
|
+
css: styles$n.termsForm,
|
|
6983
7184
|
"data-testid": "carrier-terms-form"
|
|
6984
7185
|
}, {
|
|
6985
7186
|
children: [jsx(Typography, Object.assign({
|
|
@@ -6995,7 +7196,7 @@ const CarrierTermsForm = ({
|
|
|
6995
7196
|
})), jsx(Spacer, {
|
|
6996
7197
|
multiplier: 1
|
|
6997
7198
|
}), jsx("div", Object.assign({
|
|
6998
|
-
css: styles$
|
|
7199
|
+
css: styles$n.carrierLogos
|
|
6999
7200
|
}, {
|
|
7000
7201
|
children: metadatas.map(({
|
|
7001
7202
|
name,
|
|
@@ -7011,7 +7212,7 @@ const CarrierTermsForm = ({
|
|
|
7011
7212
|
onSubmit: formLogger.capture(handleSubmit)
|
|
7012
7213
|
}, {
|
|
7013
7214
|
children: jsxs("div", Object.assign({
|
|
7014
|
-
css: styles$
|
|
7215
|
+
css: styles$n.agreement
|
|
7015
7216
|
}, {
|
|
7016
7217
|
children: [jsx("div", {
|
|
7017
7218
|
children: jsx(CheckboxInput, {
|
|
@@ -7038,12 +7239,12 @@ const CarrierTermsForm = ({
|
|
|
7038
7239
|
name: "agreement"
|
|
7039
7240
|
})
|
|
7040
7241
|
}), showTerms && jsxs("div", Object.assign({
|
|
7041
|
-
css: styles$
|
|
7242
|
+
css: styles$n.well
|
|
7042
7243
|
}, {
|
|
7043
7244
|
children: [terms.map(t => jsx(DisplayCarrierTerms, {
|
|
7044
7245
|
carrierTerms: t
|
|
7045
7246
|
}, t.title)), jsx("div", Object.assign({
|
|
7046
|
-
css: styles$
|
|
7247
|
+
css: styles$n.close
|
|
7047
7248
|
}, {
|
|
7048
7249
|
children: jsx(Button, Object.assign({
|
|
7049
7250
|
onClick: () => setShowTerms(false),
|
|
@@ -7075,9 +7276,9 @@ var DESCRIPTORS$1 = descriptors;
|
|
|
7075
7276
|
var global$8 = global$p;
|
|
7076
7277
|
var uncurryThis$1 = functionUncurryThis;
|
|
7077
7278
|
var hasOwn$1 = hasOwnProperty_1;
|
|
7078
|
-
var isCallable$4 = isCallable$
|
|
7279
|
+
var isCallable$4 = isCallable$o;
|
|
7079
7280
|
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
7080
|
-
var toString = toString$
|
|
7281
|
+
var toString = toString$c;
|
|
7081
7282
|
var defineProperty = objectDefineProperty.f;
|
|
7082
7283
|
var copyConstructorProperties = copyConstructorProperties$2;
|
|
7083
7284
|
|
|
@@ -7364,7 +7565,7 @@ const CopyButton = ({
|
|
|
7364
7565
|
}));
|
|
7365
7566
|
};
|
|
7366
7567
|
|
|
7367
|
-
const styles$
|
|
7568
|
+
const styles$k = createStyles({
|
|
7368
7569
|
trackingNumber: theme => ({
|
|
7369
7570
|
alignItems: "center",
|
|
7370
7571
|
display: "flex"
|
|
@@ -7410,10 +7611,10 @@ const Label = ({
|
|
|
7410
7611
|
shippingAmount: label.shipmentCost
|
|
7411
7612
|
}, {
|
|
7412
7613
|
children: label.trackingNumber && jsxs("div", Object.assign({
|
|
7413
|
-
css: styles$
|
|
7614
|
+
css: styles$k.trackingNumber
|
|
7414
7615
|
}, {
|
|
7415
7616
|
children: [jsx("div", Object.assign({
|
|
7416
|
-
css: styles$
|
|
7617
|
+
css: styles$k.truncatedTrackingNumber
|
|
7417
7618
|
}, {
|
|
7418
7619
|
children: label.trackingNumber.toString()
|
|
7419
7620
|
})), jsx(CopyButton, {
|
|
@@ -7525,7 +7726,7 @@ const LandingPageForm = ({
|
|
|
7525
7726
|
}));
|
|
7526
7727
|
};
|
|
7527
7728
|
|
|
7528
|
-
const styles$
|
|
7729
|
+
const styles$j = createStyles({
|
|
7529
7730
|
container: theme => ({
|
|
7530
7731
|
padding: theme.spacing(2)
|
|
7531
7732
|
}),
|
|
@@ -7547,11 +7748,11 @@ const LandingPage = ({
|
|
|
7547
7748
|
t
|
|
7548
7749
|
} = useTranslation();
|
|
7549
7750
|
return jsxs("div", Object.assign({
|
|
7550
|
-
css: styles$
|
|
7751
|
+
css: styles$j.container,
|
|
7551
7752
|
"data-testid": "landing-page"
|
|
7552
7753
|
}, {
|
|
7553
7754
|
children: [jsxs("div", Object.assign({
|
|
7554
|
-
css: styles$
|
|
7755
|
+
css: styles$j.header
|
|
7555
7756
|
}, {
|
|
7556
7757
|
children: [jsx(Typography, Object.assign({
|
|
7557
7758
|
variant: "heading4"
|
|
@@ -7569,7 +7770,7 @@ const LandingPage = ({
|
|
|
7569
7770
|
})), jsx(LandingPageForm, {
|
|
7570
7771
|
onSubmit: onSubmit
|
|
7571
7772
|
}), jsxs("div", Object.assign({
|
|
7572
|
-
css: styles$
|
|
7773
|
+
css: styles$j.header
|
|
7573
7774
|
}, {
|
|
7574
7775
|
children: [jsx(Spacer, {
|
|
7575
7776
|
multiplier: 6
|
|
@@ -7580,14 +7781,14 @@ const LandingPage = ({
|
|
|
7580
7781
|
})), jsx(Spacer, {
|
|
7581
7782
|
multiplier: 2
|
|
7582
7783
|
}), jsx(Typography, Object.assign({
|
|
7583
|
-
css: styles$
|
|
7784
|
+
css: styles$j.description,
|
|
7584
7785
|
variant: "body1"
|
|
7585
7786
|
}, {
|
|
7586
7787
|
children: t("onboarding:landing.messageLine1")
|
|
7587
7788
|
})), jsx(Spacer, {
|
|
7588
7789
|
multiplier: 2
|
|
7589
7790
|
}), jsx(Typography, Object.assign({
|
|
7590
|
-
css: styles$
|
|
7791
|
+
css: styles$j.description,
|
|
7591
7792
|
variant: "body1"
|
|
7592
7793
|
}, {
|
|
7593
7794
|
children: t("onboarding:landing.messageLine2")
|
|
@@ -7598,7 +7799,7 @@ const LandingPage = ({
|
|
|
7598
7799
|
}));
|
|
7599
7800
|
};
|
|
7600
7801
|
|
|
7601
|
-
const styles$
|
|
7802
|
+
const styles$i = createStyles({
|
|
7602
7803
|
icon: theme => ({
|
|
7603
7804
|
color: theme.palette.primary.main,
|
|
7604
7805
|
marginRight: theme.spacing(2)
|
|
@@ -7643,10 +7844,10 @@ const Section = _a => {
|
|
|
7643
7844
|
rest = __rest(_a, ["bold", "title", "children", "rightContent"]);
|
|
7644
7845
|
return jsxs(Fragment, {
|
|
7645
7846
|
children: [title && jsx("summary", Object.assign({
|
|
7646
|
-
css: styles$
|
|
7847
|
+
css: styles$i.summary
|
|
7647
7848
|
}, {
|
|
7648
7849
|
children: jsxs("div", Object.assign({
|
|
7649
|
-
css: styles$
|
|
7850
|
+
css: styles$i.summaryWrapper
|
|
7650
7851
|
}, {
|
|
7651
7852
|
children: [jsx(Typography, Object.assign({
|
|
7652
7853
|
bold: bold,
|
|
@@ -7654,20 +7855,20 @@ const Section = _a => {
|
|
|
7654
7855
|
}, {
|
|
7655
7856
|
children: title
|
|
7656
7857
|
})), rightContent && jsx("div", Object.assign({
|
|
7657
|
-
css: styles$
|
|
7858
|
+
css: styles$i.rightContentWrapper
|
|
7658
7859
|
}, {
|
|
7659
7860
|
children: rightContent
|
|
7660
7861
|
}))]
|
|
7661
7862
|
}))
|
|
7662
7863
|
})), jsx("section", Object.assign({
|
|
7663
|
-
css: styles$
|
|
7864
|
+
css: styles$i.section
|
|
7664
7865
|
}, rest, {
|
|
7665
7866
|
children: children
|
|
7666
7867
|
}))]
|
|
7667
7868
|
});
|
|
7668
7869
|
};
|
|
7669
7870
|
|
|
7670
|
-
const styles$
|
|
7871
|
+
const styles$h = createStyles({
|
|
7671
7872
|
container: {
|
|
7672
7873
|
display: "flex",
|
|
7673
7874
|
flexDirection: "column"
|
|
@@ -7727,14 +7928,14 @@ const ListCarriersRow = ({
|
|
|
7727
7928
|
setIsSubmitting(false);
|
|
7728
7929
|
});
|
|
7729
7930
|
return jsxs("div", Object.assign({
|
|
7730
|
-
css: styles$
|
|
7931
|
+
css: styles$h.container,
|
|
7731
7932
|
"data-testid": "carrier-row"
|
|
7732
7933
|
}, {
|
|
7733
7934
|
children: [jsxs("div", Object.assign({
|
|
7734
|
-
css: styles$
|
|
7935
|
+
css: styles$h.rowContainer
|
|
7735
7936
|
}, {
|
|
7736
7937
|
children: [jsxs("div", Object.assign({
|
|
7737
|
-
css: styles$
|
|
7938
|
+
css: styles$h.logoContainer
|
|
7738
7939
|
}, {
|
|
7739
7940
|
children: [jsx("div", {
|
|
7740
7941
|
children: jsx("img", {
|
|
@@ -7752,7 +7953,7 @@ const ListCarriersRow = ({
|
|
|
7752
7953
|
css: _ref
|
|
7753
7954
|
}, {
|
|
7754
7955
|
children: jsx(LinkAction, {
|
|
7755
|
-
css: styles$
|
|
7956
|
+
css: styles$h.getConnectButton(isConnected),
|
|
7756
7957
|
isDisabled: isConnected || showDropDown,
|
|
7757
7958
|
isLoading: isSubmitting,
|
|
7758
7959
|
onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -7770,7 +7971,7 @@ const ListCarriersRow = ({
|
|
|
7770
7971
|
}));
|
|
7771
7972
|
};
|
|
7772
7973
|
|
|
7773
|
-
const styles$
|
|
7974
|
+
const styles$g = createStyles({
|
|
7774
7975
|
carriersList: theme => ({
|
|
7775
7976
|
"& > li:not(:last-of-type)": {
|
|
7776
7977
|
borderBottom: `1px solid ${theme.palette.gray.light}`
|
|
@@ -7823,7 +8024,7 @@ const ListCarriers = ({
|
|
|
7823
8024
|
}))
|
|
7824
8025
|
})), jsx(Spacer, {})]
|
|
7825
8026
|
}), jsx("ul", Object.assign({
|
|
7826
|
-
css: styles$
|
|
8027
|
+
css: styles$g.carriersList,
|
|
7827
8028
|
"data-testid": "carriers-list"
|
|
7828
8029
|
}, {
|
|
7829
8030
|
children: isLoading ? jsxs(Fragment, {
|
|
@@ -7845,11 +8046,11 @@ const ListCarriers = ({
|
|
|
7845
8046
|
};
|
|
7846
8047
|
const LoadingSkeletonRow = () => {
|
|
7847
8048
|
return jsxs("div", Object.assign({
|
|
7848
|
-
css: styles$
|
|
8049
|
+
css: styles$g.skeletonRow,
|
|
7849
8050
|
"data-testid": "skeleton-carrier-row"
|
|
7850
8051
|
}, {
|
|
7851
8052
|
children: [jsxs("div", Object.assign({
|
|
7852
|
-
css: styles$
|
|
8053
|
+
css: styles$g.skeletonLogoContainer
|
|
7853
8054
|
}, {
|
|
7854
8055
|
children: [jsx(Skeleton, {
|
|
7855
8056
|
animation: SkeletonAnimation.WAVE,
|
|
@@ -8100,7 +8301,7 @@ const AddressPreferenceProvider = props => {
|
|
|
8100
8301
|
returnAddress
|
|
8101
8302
|
} = validationPreference;
|
|
8102
8303
|
setPassengerData(data);
|
|
8103
|
-
if (_$
|
|
8304
|
+
if (_$3.isEqual(addresses.originAddress, _$3.omit(validationPreference.originAddress, ["addressLine3", "addressResidentialIndicator"]))) {
|
|
8104
8305
|
yield onValid({
|
|
8105
8306
|
originAddress: addresses.originAddress,
|
|
8106
8307
|
returnAddress: addresses === null || addresses === void 0 ? void 0 : addresses.returnAddress
|
|
@@ -8156,7 +8357,7 @@ const useAddressPreference = () => {
|
|
|
8156
8357
|
return context;
|
|
8157
8358
|
};
|
|
8158
8359
|
|
|
8159
|
-
const styles$
|
|
8360
|
+
const styles$f = createStyles({
|
|
8160
8361
|
body: theme => ({
|
|
8161
8362
|
borderTop: `1px solid ${theme.palette.gray.light}`,
|
|
8162
8363
|
color: theme.palette.black,
|
|
@@ -8207,14 +8408,14 @@ const SettingsCard = ({
|
|
|
8207
8408
|
verticallyAligned
|
|
8208
8409
|
}) => {
|
|
8209
8410
|
return jsxs("div", Object.assign({
|
|
8210
|
-
css: verticallyAligned ? styles$
|
|
8411
|
+
css: verticallyAligned ? styles$f.verticalContainer : styles$f.container,
|
|
8211
8412
|
"data-testid": "settingsCard"
|
|
8212
8413
|
}, {
|
|
8213
8414
|
children: [jsxs("div", Object.assign({
|
|
8214
|
-
css: styles$
|
|
8415
|
+
css: styles$f.header
|
|
8215
8416
|
}, {
|
|
8216
8417
|
children: [jsxs("div", Object.assign({
|
|
8217
|
-
css: styles$
|
|
8418
|
+
css: styles$f.title
|
|
8218
8419
|
}, {
|
|
8219
8420
|
children: [typeof title === "string" ? jsx(Typography, Object.assign({
|
|
8220
8421
|
variant: "subtitle2"
|
|
@@ -8249,7 +8450,7 @@ const SettingsCard = ({
|
|
|
8249
8450
|
}))
|
|
8250
8451
|
}))]
|
|
8251
8452
|
})), children && jsx("div", Object.assign({
|
|
8252
|
-
css: styles$
|
|
8453
|
+
css: styles$f.body
|
|
8253
8454
|
}, {
|
|
8254
8455
|
children: jsxs("div", {
|
|
8255
8456
|
children: [children, accessoryAction && jsx(ButtonGroup, Object.assign({
|
|
@@ -8505,7 +8706,7 @@ const WarehouseForm = ({
|
|
|
8505
8706
|
}));
|
|
8506
8707
|
};
|
|
8507
8708
|
|
|
8508
|
-
const styles$
|
|
8709
|
+
const styles$e = createStyles({
|
|
8509
8710
|
cardSpacing: theme => ({
|
|
8510
8711
|
display: "flex",
|
|
8511
8712
|
flexDirection: "column",
|
|
@@ -8535,9 +8736,9 @@ const ManageWarehouses = ({
|
|
|
8535
8736
|
const [showAddNewWarehouseForm, toggleShowAddNewWarehouseForm] = useToggle(false);
|
|
8536
8737
|
return jsxs(Fragment, {
|
|
8537
8738
|
children: [showAddNewWarehouseForm ? jsx(AddressPreferenceProvider, Object.assign({
|
|
8538
|
-
css: styles$
|
|
8739
|
+
css: styles$e.well,
|
|
8539
8740
|
formHeader: jsxs("div", Object.assign({
|
|
8540
|
-
css: styles$
|
|
8741
|
+
css: styles$e.header
|
|
8541
8742
|
}, {
|
|
8542
8743
|
children: [jsx(Typography, Object.assign({
|
|
8543
8744
|
variant: "subtitle1"
|
|
@@ -8582,14 +8783,14 @@ const ManageWarehouses = ({
|
|
|
8582
8783
|
})]
|
|
8583
8784
|
}))
|
|
8584
8785
|
})), jsx("div", Object.assign({
|
|
8585
|
-
css: styles$
|
|
8786
|
+
css: styles$e.cardSpacing
|
|
8586
8787
|
}, {
|
|
8587
8788
|
children: warehouses.map(warehouse => {
|
|
8588
8789
|
if (editWarehouseId && editWarehouseId === warehouse.warehouseId) {
|
|
8589
8790
|
return jsx(AddressPreferenceProvider, Object.assign({
|
|
8590
|
-
css: styles$
|
|
8791
|
+
css: styles$e.well,
|
|
8591
8792
|
formHeader: jsxs("div", Object.assign({
|
|
8592
|
-
css: styles$
|
|
8793
|
+
css: styles$e.header
|
|
8593
8794
|
}, {
|
|
8594
8795
|
children: [jsx(Typography, Object.assign({
|
|
8595
8796
|
variant: "subtitle1"
|
|
@@ -8647,7 +8848,7 @@ const ManageWarehouses = ({
|
|
|
8647
8848
|
|
|
8648
8849
|
var getBuiltIn$2 = getBuiltIn$8;
|
|
8649
8850
|
var definePropertyModule = objectDefineProperty;
|
|
8650
|
-
var wellKnownSymbol$3 = wellKnownSymbol$
|
|
8851
|
+
var wellKnownSymbol$3 = wellKnownSymbol$k;
|
|
8651
8852
|
var DESCRIPTORS = descriptors;
|
|
8652
8853
|
|
|
8653
8854
|
var SPECIES$2 = wellKnownSymbol$3('species');
|
|
@@ -8686,8 +8887,8 @@ var aConstructor$1 = function (argument) {
|
|
|
8686
8887
|
|
|
8687
8888
|
var anObject$1 = anObject$f;
|
|
8688
8889
|
var aConstructor = aConstructor$1;
|
|
8689
|
-
var isNullOrUndefined = isNullOrUndefined$
|
|
8690
|
-
var wellKnownSymbol$2 = wellKnownSymbol$
|
|
8890
|
+
var isNullOrUndefined = isNullOrUndefined$7;
|
|
8891
|
+
var wellKnownSymbol$2 = wellKnownSymbol$k;
|
|
8691
8892
|
|
|
8692
8893
|
var SPECIES$1 = wellKnownSymbol$2('species');
|
|
8693
8894
|
|
|
@@ -8717,7 +8918,7 @@ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
|
|
|
8717
8918
|
var global$7 = global$p;
|
|
8718
8919
|
var apply = functionApply;
|
|
8719
8920
|
var bind$2 = functionBindContext;
|
|
8720
|
-
var isCallable$3 = isCallable$
|
|
8921
|
+
var isCallable$3 = isCallable$o;
|
|
8721
8922
|
var hasOwn = hasOwnProperty_1;
|
|
8722
8923
|
var fails = fails$q;
|
|
8723
8924
|
var html = html$2;
|
|
@@ -8984,10 +9185,10 @@ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
|
|
|
8984
9185
|
|
|
8985
9186
|
var global$2 = global$p;
|
|
8986
9187
|
var NativePromiseConstructor$3 = promiseNativeConstructor;
|
|
8987
|
-
var isCallable$2 = isCallable$
|
|
9188
|
+
var isCallable$2 = isCallable$o;
|
|
8988
9189
|
var isForced = isForced_1;
|
|
8989
9190
|
var inspectSource = inspectSource$3;
|
|
8990
|
-
var wellKnownSymbol$1 = wellKnownSymbol$
|
|
9191
|
+
var wellKnownSymbol$1 = wellKnownSymbol$k;
|
|
8991
9192
|
var IS_BROWSER = engineIsBrowser;
|
|
8992
9193
|
var IS_DENO = engineIsDeno;
|
|
8993
9194
|
var V8_VERSION = engineV8Version;
|
|
@@ -9059,7 +9260,7 @@ var setPrototypeOf = objectSetPrototypeOf;
|
|
|
9059
9260
|
var setToStringTag = setToStringTag$3;
|
|
9060
9261
|
var setSpecies = setSpecies$1;
|
|
9061
9262
|
var aCallable$2 = aCallable$a;
|
|
9062
|
-
var isCallable$1 = isCallable$
|
|
9263
|
+
var isCallable$1 = isCallable$o;
|
|
9063
9264
|
var isObject$1 = isObject$a;
|
|
9064
9265
|
var anInstance = anInstance$1;
|
|
9065
9266
|
var speciesConstructor = speciesConstructor$1;
|
|
@@ -9337,7 +9538,7 @@ $$5({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTR
|
|
|
9337
9538
|
setToStringTag(PromiseConstructor, PROMISE, false);
|
|
9338
9539
|
setSpecies(PROMISE);
|
|
9339
9540
|
|
|
9340
|
-
var wellKnownSymbol = wellKnownSymbol$
|
|
9541
|
+
var wellKnownSymbol = wellKnownSymbol$k;
|
|
9341
9542
|
|
|
9342
9543
|
var ITERATOR = wellKnownSymbol('iterator');
|
|
9343
9544
|
var SAFE_CLOSING = false;
|
|
@@ -9427,7 +9628,7 @@ var $$3 = _export;
|
|
|
9427
9628
|
var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
|
|
9428
9629
|
var NativePromiseConstructor = promiseNativeConstructor;
|
|
9429
9630
|
var getBuiltIn$1 = getBuiltIn$8;
|
|
9430
|
-
var isCallable = isCallable$
|
|
9631
|
+
var isCallable = isCallable$o;
|
|
9431
9632
|
var defineBuiltIn = defineBuiltIn$7;
|
|
9432
9633
|
|
|
9433
9634
|
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
|
@@ -9767,7 +9968,7 @@ const EditWalletAddressForm = ({
|
|
|
9767
9968
|
}));
|
|
9768
9969
|
};
|
|
9769
9970
|
|
|
9770
|
-
const styles$
|
|
9971
|
+
const styles$d = createStyles({
|
|
9771
9972
|
grid: theme => ({
|
|
9772
9973
|
margin: theme.spacing(4)
|
|
9773
9974
|
})
|
|
@@ -9829,7 +10030,7 @@ const WalletForm = ({
|
|
|
9829
10030
|
onSubmit: formLogger.capture(handleSubmit)
|
|
9830
10031
|
}, {
|
|
9831
10032
|
children: jsxs(Grid, Object.assign({
|
|
9832
|
-
css: styles$
|
|
10033
|
+
css: styles$d.grid,
|
|
9833
10034
|
noPadding: true
|
|
9834
10035
|
}, {
|
|
9835
10036
|
children: [jsx(GridChild, Object.assign({
|
|
@@ -9911,7 +10112,7 @@ const WalletForm = ({
|
|
|
9911
10112
|
}));
|
|
9912
10113
|
};
|
|
9913
10114
|
|
|
9914
|
-
const styles$
|
|
10115
|
+
const styles$c = createStyles({
|
|
9915
10116
|
container: theme => ({
|
|
9916
10117
|
padding: theme.spacing(2)
|
|
9917
10118
|
}),
|
|
@@ -10087,10 +10288,10 @@ const Onboarding = ({
|
|
|
10087
10288
|
const defaultWarehouse = (_a = warehouses.find(w => w.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
|
|
10088
10289
|
return jsx(AddressPreferenceProvider, Object.assign({
|
|
10089
10290
|
formHeader: jsxs("div", Object.assign({
|
|
10090
|
-
css: styles$
|
|
10291
|
+
css: styles$c.walletFormHeader
|
|
10091
10292
|
}, {
|
|
10092
10293
|
children: [jsxs("div", Object.assign({
|
|
10093
|
-
css: styles$
|
|
10294
|
+
css: styles$c.walletFormTitle
|
|
10094
10295
|
}, {
|
|
10095
10296
|
children: [jsx(Typography, Object.assign({
|
|
10096
10297
|
variant: "heading4"
|
|
@@ -10167,38 +10368,38 @@ const Onboarding = ({
|
|
|
10167
10368
|
});
|
|
10168
10369
|
};
|
|
10169
10370
|
return jsxs("div", Object.assign({
|
|
10170
|
-
css: styles$
|
|
10371
|
+
css: styles$c.container
|
|
10171
10372
|
}, {
|
|
10172
10373
|
children: [jsxs(Stepper, Object.assign({
|
|
10173
10374
|
currentStep: currentStep
|
|
10174
10375
|
}, {
|
|
10175
10376
|
children: [jsx(Step, {
|
|
10176
|
-
css: styles$
|
|
10377
|
+
css: styles$c.step,
|
|
10177
10378
|
label: t("onboarding:steps.login")
|
|
10178
10379
|
}), jsx(Step, {
|
|
10179
|
-
css: styles$
|
|
10380
|
+
css: styles$c.step,
|
|
10180
10381
|
label: t("onboarding:steps.carriers")
|
|
10181
10382
|
}), jsx(Step, {
|
|
10182
|
-
css: styles$
|
|
10383
|
+
css: styles$c.step,
|
|
10183
10384
|
label: t("onboarding:steps.addresses")
|
|
10184
10385
|
}), jsx(Step, {
|
|
10185
|
-
css: styles$
|
|
10386
|
+
css: styles$c.step,
|
|
10186
10387
|
label: t("onboarding:steps.payment")
|
|
10187
10388
|
})]
|
|
10188
|
-
})), renderStep()]
|
|
10389
|
+
})), renderStep(), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
|
|
10189
10390
|
}));
|
|
10190
10391
|
};
|
|
10191
10392
|
|
|
10192
|
-
let _ = t => t,
|
|
10193
|
-
_t,
|
|
10194
|
-
_t2;
|
|
10393
|
+
let _$1 = t => t,
|
|
10394
|
+
_t$1,
|
|
10395
|
+
_t2$1;
|
|
10195
10396
|
const Cube = _a => {
|
|
10196
10397
|
var {
|
|
10197
10398
|
animate = false
|
|
10198
10399
|
} = _a,
|
|
10199
10400
|
props = __rest(_a, ["animate"]);
|
|
10200
10401
|
const theme = useTheme();
|
|
10201
|
-
const bounce = keyframes(_t || (_t = _`
|
|
10402
|
+
const bounce = keyframes(_t$1 || (_t$1 = _$1`
|
|
10202
10403
|
0%, 100% {
|
|
10203
10404
|
transform: translateY(-25%);
|
|
10204
10405
|
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
|
|
@@ -10208,7 +10409,7 @@ const Cube = _a => {
|
|
|
10208
10409
|
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
10209
10410
|
}
|
|
10210
10411
|
`));
|
|
10211
|
-
const spin = keyframes(_t2 || (_t2 = _`
|
|
10412
|
+
const spin = keyframes(_t2$1 || (_t2$1 = _$1`
|
|
10212
10413
|
from {
|
|
10213
10414
|
transform: rotate(0deg);
|
|
10214
10415
|
}
|
|
@@ -10311,12 +10512,12 @@ const Loader = props => {
|
|
|
10311
10512
|
}
|
|
10312
10513
|
}, {
|
|
10313
10514
|
children: jsx(Spinner, Object.assign({}, props, {
|
|
10314
|
-
size: SpinnerSize.SIZE_LARGE
|
|
10515
|
+
size: props.size || SpinnerSize.SIZE_LARGE
|
|
10315
10516
|
}))
|
|
10316
10517
|
}));
|
|
10317
10518
|
};
|
|
10318
10519
|
|
|
10319
|
-
const styles$
|
|
10520
|
+
const styles$b = createStyles({
|
|
10320
10521
|
chipList: theme => ({
|
|
10321
10522
|
gap: theme.spacing(1)
|
|
10322
10523
|
}),
|
|
@@ -10427,7 +10628,7 @@ const AddFundsForm = ({
|
|
|
10427
10628
|
})), jsx(Spacer, {
|
|
10428
10629
|
multiplier: 2
|
|
10429
10630
|
}), jsx(ChipList, Object.assign({
|
|
10430
|
-
css: styles$
|
|
10631
|
+
css: styles$b.chipList,
|
|
10431
10632
|
onChange: idx => {
|
|
10432
10633
|
const chip = chips[idx];
|
|
10433
10634
|
setSelectedChip(chip);
|
|
@@ -10442,7 +10643,7 @@ const AddFundsForm = ({
|
|
|
10442
10643
|
}
|
|
10443
10644
|
}, {
|
|
10444
10645
|
children: chips.map(chip => jsx(Chip, Object.assign({
|
|
10445
|
-
css: styles$
|
|
10646
|
+
css: styles$b.getChip({
|
|
10446
10647
|
isDisabled: chip.value < _minimumAmount,
|
|
10447
10648
|
isSelected: chip.value === selectedChip.value
|
|
10448
10649
|
}),
|
|
@@ -10459,7 +10660,7 @@ const AddFundsForm = ({
|
|
|
10459
10660
|
multiplier: 1
|
|
10460
10661
|
}), jsx(MoneyInput, {
|
|
10461
10662
|
control: form.control,
|
|
10462
|
-
css: styles$
|
|
10663
|
+
css: styles$b.fundsInput,
|
|
10463
10664
|
defaultValue: {
|
|
10464
10665
|
amount: undefined,
|
|
10465
10666
|
currency: SE.Currency.USD
|
|
@@ -10512,7 +10713,7 @@ const AddFundsForm = ({
|
|
|
10512
10713
|
});
|
|
10513
10714
|
};
|
|
10514
10715
|
|
|
10515
|
-
const styles$
|
|
10716
|
+
const styles$a = isLabelRight => createStyles({
|
|
10516
10717
|
inlineContainer: theme => ({
|
|
10517
10718
|
alignItems: "center",
|
|
10518
10719
|
display: "flex",
|
|
@@ -10527,14 +10728,14 @@ const InlineLabel = ({
|
|
|
10527
10728
|
isLabelRight,
|
|
10528
10729
|
labelProps: _labelProps = {}
|
|
10529
10730
|
}) => jsxs("div", Object.assign({
|
|
10530
|
-
css: styles$
|
|
10731
|
+
css: styles$a(isLabelRight).inlineContainer
|
|
10531
10732
|
}, {
|
|
10532
10733
|
children: [jsx(Typography, Object.assign({}, _labelProps, {
|
|
10533
10734
|
children: label
|
|
10534
10735
|
})), children]
|
|
10535
10736
|
}));
|
|
10536
10737
|
|
|
10537
|
-
const styles$
|
|
10738
|
+
const styles$9 = createStyles({
|
|
10538
10739
|
getBalanceText: balance => theme => ({
|
|
10539
10740
|
color: balance === undefined ? theme.palette.alert.main : balance >= 0 ? theme.palette.secondary.dark : theme.palette.error.main
|
|
10540
10741
|
})
|
|
@@ -10557,7 +10758,7 @@ const CarrierBalance = ({
|
|
|
10557
10758
|
}, {
|
|
10558
10759
|
children: isLoadingCarrier || isRefetchingCarrier ? jsx(Spinner, {}) : jsx(Typography, Object.assign({
|
|
10559
10760
|
bold: true,
|
|
10560
|
-
css: styles$
|
|
10761
|
+
css: styles$9.getBalanceText(balance)
|
|
10561
10762
|
}, {
|
|
10562
10763
|
children: balance === undefined ? t("manage-funding:errors.balanceUnknown") : formatMoney({
|
|
10563
10764
|
amount: balance,
|
|
@@ -10579,7 +10780,7 @@ const Spread = ({
|
|
|
10579
10780
|
children: children
|
|
10580
10781
|
}));
|
|
10581
10782
|
|
|
10582
|
-
const styles$
|
|
10783
|
+
const styles$8 = createStyles({
|
|
10583
10784
|
balanceText: theme => ({
|
|
10584
10785
|
color: theme.palette.secondary.dark
|
|
10585
10786
|
}),
|
|
@@ -10647,7 +10848,7 @@ const FundAndPurchase = ({
|
|
|
10647
10848
|
}, {
|
|
10648
10849
|
children: [jsx(Button, Object.assign({
|
|
10649
10850
|
bold: false,
|
|
10650
|
-
css: styles$
|
|
10851
|
+
css: styles$8.saveRateButton,
|
|
10651
10852
|
disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
|
|
10652
10853
|
isLoading: isSavingRate,
|
|
10653
10854
|
onClick: handleSaveRate,
|
|
@@ -10667,7 +10868,7 @@ const FundAndPurchase = ({
|
|
|
10667
10868
|
// don't show balance or funding form
|
|
10668
10869
|
if (!isFundingRequired) return jsx("div", Object.assign({
|
|
10669
10870
|
className: className,
|
|
10670
|
-
css: styles$
|
|
10871
|
+
css: styles$8.container
|
|
10671
10872
|
}, {
|
|
10672
10873
|
children: renderActionButtons()
|
|
10673
10874
|
}));
|
|
@@ -10680,7 +10881,7 @@ const FundAndPurchase = ({
|
|
|
10680
10881
|
// show balance, but not the funding form.
|
|
10681
10882
|
if (!isFundingEnabled) return jsxs("div", Object.assign({
|
|
10682
10883
|
className: className,
|
|
10683
|
-
css: styles$
|
|
10884
|
+
css: styles$8.container
|
|
10684
10885
|
}, {
|
|
10685
10886
|
children: [jsx(CarrierBalance, {
|
|
10686
10887
|
carrierId: carrierId
|
|
@@ -10692,7 +10893,7 @@ const FundAndPurchase = ({
|
|
|
10692
10893
|
// show balance and funding form
|
|
10693
10894
|
return jsxs("div", Object.assign({
|
|
10694
10895
|
className: className,
|
|
10695
|
-
css: styles$
|
|
10896
|
+
css: styles$8.container
|
|
10696
10897
|
}, {
|
|
10697
10898
|
children: [jsxs(Spread, {
|
|
10698
10899
|
children: [jsx(CarrierBalance, {
|
|
@@ -10723,13 +10924,13 @@ const FundAndPurchase = ({
|
|
|
10723
10924
|
var _a, _b;
|
|
10724
10925
|
return jsxs(Fragment, {
|
|
10725
10926
|
children: [jsxs("section", Object.assign({
|
|
10726
|
-
css: styles$
|
|
10927
|
+
css: styles$8.getFormExtension(addFundsForm.isCustomAmount)
|
|
10727
10928
|
}, {
|
|
10728
10929
|
children: [jsx(InlineLabel, Object.assign({
|
|
10729
10930
|
label: t("manage-funding:fundAndPurchase.newBalance")
|
|
10730
10931
|
}, {
|
|
10731
10932
|
children: jsx(Typography, Object.assign({
|
|
10732
|
-
css: styles$
|
|
10933
|
+
css: styles$8.balanceText
|
|
10733
10934
|
}, {
|
|
10734
10935
|
children: formatMoney({
|
|
10735
10936
|
amount: balance + ((_a = addFundsForm.selectedAmount) !== null && _a !== void 0 ? _a : 0),
|
|
@@ -10740,7 +10941,7 @@ const FundAndPurchase = ({
|
|
|
10740
10941
|
label: t("manage-funding:fundAndPurchase.finalBalance")
|
|
10741
10942
|
}, {
|
|
10742
10943
|
children: jsx(Typography, Object.assign({
|
|
10743
|
-
css: styles$
|
|
10944
|
+
css: styles$8.balanceText
|
|
10744
10945
|
}, {
|
|
10745
10946
|
children: formatMoney({
|
|
10746
10947
|
amount: balance + ((_b = addFundsForm.selectedAmount) !== null && _b !== void 0 ? _b : 0) - purchaseAmount,
|
|
@@ -10813,7 +11014,135 @@ const LabelLayoutPurchase = ({
|
|
|
10813
11014
|
});
|
|
10814
11015
|
};
|
|
10815
11016
|
|
|
10816
|
-
|
|
11017
|
+
let _ = t => t,
|
|
11018
|
+
_t,
|
|
11019
|
+
_t2,
|
|
11020
|
+
_t3;
|
|
11021
|
+
const stroke = keyframes(_t || (_t = _`
|
|
11022
|
+
100% {
|
|
11023
|
+
stroke-dashoffset: 0;
|
|
11024
|
+
}
|
|
11025
|
+
`));
|
|
11026
|
+
const fadeInOut = keyframes(_t2 || (_t2 = _`
|
|
11027
|
+
0%, 100% {
|
|
11028
|
+
opacity: 0;
|
|
11029
|
+
}
|
|
11030
|
+
20% {
|
|
11031
|
+
opacity: 1;
|
|
11032
|
+
}
|
|
11033
|
+
85% {
|
|
11034
|
+
opacity: 1;
|
|
11035
|
+
}
|
|
11036
|
+
`));
|
|
11037
|
+
const fill = keyframes(_t3 || (_t3 = _`
|
|
11038
|
+
100% {
|
|
11039
|
+
box-shadow: inset 0px 0px 0px 30px #3F8200;
|
|
11040
|
+
`));
|
|
11041
|
+
const colors = {
|
|
11042
|
+
green: "#3F8200",
|
|
11043
|
+
grey: "#706F6F",
|
|
11044
|
+
red: "#EE3B3F"
|
|
11045
|
+
};
|
|
11046
|
+
const styles$7 = createStyles({
|
|
11047
|
+
checkmark: () => ({
|
|
11048
|
+
animation: `${fill} forwards`,
|
|
11049
|
+
borderRadius: "50%",
|
|
11050
|
+
height: "20px,",
|
|
11051
|
+
stroke: "#fff",
|
|
11052
|
+
width: "20px"
|
|
11053
|
+
}),
|
|
11054
|
+
checkmarkCheck: () => ({
|
|
11055
|
+
animation: `${stroke} 1s forwards`,
|
|
11056
|
+
strokeDasharray: "48",
|
|
11057
|
+
strokeDashoffset: "48"
|
|
11058
|
+
}),
|
|
11059
|
+
container: theme => ({
|
|
11060
|
+
alignItems: "center",
|
|
11061
|
+
animation: `${fadeInOut} 2.5s ease-in-out forwards`,
|
|
11062
|
+
display: "flex",
|
|
11063
|
+
justifyContent: "flex-start",
|
|
11064
|
+
padding: `0 ${theme.spacing(2)}px 0 0`
|
|
11065
|
+
}),
|
|
11066
|
+
saved: theme => ({
|
|
11067
|
+
color: colors.green,
|
|
11068
|
+
marginLeft: `${theme.spacing(1)}px`
|
|
11069
|
+
}),
|
|
11070
|
+
saving: theme => ({
|
|
11071
|
+
marginLeft: `${theme.spacing(1)}px`
|
|
11072
|
+
}),
|
|
11073
|
+
savingContainer: () => ({
|
|
11074
|
+
alignItems: "center",
|
|
11075
|
+
color: colors.grey,
|
|
11076
|
+
display: "flex",
|
|
11077
|
+
justifyContent: "flex-start"
|
|
11078
|
+
}),
|
|
11079
|
+
savingFailed: theme => ({
|
|
11080
|
+
color: "#EE3B3F",
|
|
11081
|
+
marginLeft: `${theme.spacing(1)}px`
|
|
11082
|
+
})
|
|
11083
|
+
});
|
|
11084
|
+
|
|
11085
|
+
const SaveStatus = ({
|
|
11086
|
+
errors,
|
|
11087
|
+
isSaving
|
|
11088
|
+
}) => {
|
|
11089
|
+
const {
|
|
11090
|
+
t
|
|
11091
|
+
} = useTranslation(["manage-defaults"]);
|
|
11092
|
+
if (isSaving) {
|
|
11093
|
+
return jsxs("div", Object.assign({
|
|
11094
|
+
css: styles$7.savingContainer
|
|
11095
|
+
}, {
|
|
11096
|
+
children: [jsx(Loader, {
|
|
11097
|
+
color: colors.grey,
|
|
11098
|
+
css: {
|
|
11099
|
+
color: colors.grey
|
|
11100
|
+
},
|
|
11101
|
+
size: SpinnerSize.SIZE_SMALL
|
|
11102
|
+
}), jsx(Typography, Object.assign({
|
|
11103
|
+
css: styles$7.saving
|
|
11104
|
+
}, {
|
|
11105
|
+
children: t("manage-defaults:status.saving")
|
|
11106
|
+
}))]
|
|
11107
|
+
}));
|
|
11108
|
+
}
|
|
11109
|
+
return !isSaving && !errors ? jsxs("div", Object.assign({
|
|
11110
|
+
css: styles$7.container
|
|
11111
|
+
}, {
|
|
11112
|
+
children: [jsx("svg", Object.assign({
|
|
11113
|
+
css: styles$7.checkmark,
|
|
11114
|
+
viewBox: "0 0 52 52"
|
|
11115
|
+
}, {
|
|
11116
|
+
children: jsx("path", {
|
|
11117
|
+
css: styles$7.checkmarkCheck,
|
|
11118
|
+
d: "M14.1 27.2l7.1 7.2 16.7-16.8",
|
|
11119
|
+
fill: "none",
|
|
11120
|
+
strokeWidth: "5px"
|
|
11121
|
+
})
|
|
11122
|
+
})), jsx(Typography, Object.assign({
|
|
11123
|
+
css: styles$7.saved
|
|
11124
|
+
}, {
|
|
11125
|
+
children: t("manage-defaults:status.saved")
|
|
11126
|
+
}))]
|
|
11127
|
+
})) : jsxs("div", Object.assign({
|
|
11128
|
+
css: [styles$7.container, {
|
|
11129
|
+
padding: "0"
|
|
11130
|
+
}]
|
|
11131
|
+
}, {
|
|
11132
|
+
children: [jsx(Icon, {
|
|
11133
|
+
css: {
|
|
11134
|
+
color: colors.red
|
|
11135
|
+
},
|
|
11136
|
+
name: IconNames.CANCEL_FILLED
|
|
11137
|
+
}), jsx(Typography, Object.assign({
|
|
11138
|
+
css: styles$7.savingFailed
|
|
11139
|
+
}, {
|
|
11140
|
+
children: t("manage-defaults:status.savingFailed")
|
|
11141
|
+
}))]
|
|
11142
|
+
}));
|
|
11143
|
+
};
|
|
11144
|
+
|
|
11145
|
+
const styles$6 = createStyles({
|
|
10817
11146
|
button: theme => ({
|
|
10818
11147
|
backgroundColor: "transparent",
|
|
10819
11148
|
padding: 0
|
|
@@ -10839,10 +11168,10 @@ const styles$5 = createStyles({
|
|
|
10839
11168
|
cursor: "pointer",
|
|
10840
11169
|
display: "flex",
|
|
10841
11170
|
flexDirection: "column",
|
|
10842
|
-
height: theme.spacing(
|
|
11171
|
+
height: theme.spacing(31),
|
|
10843
11172
|
marginRight: theme.spacing(3.5),
|
|
10844
11173
|
position: "relative",
|
|
10845
|
-
width: theme.spacing(
|
|
11174
|
+
width: theme.spacing(22)
|
|
10846
11175
|
}),
|
|
10847
11176
|
letterInner: theme => ({
|
|
10848
11177
|
backgroundColor: "white",
|
|
@@ -10867,10 +11196,10 @@ const styles$5 = createStyles({
|
|
|
10867
11196
|
cursor: "pointer",
|
|
10868
11197
|
display: "flex",
|
|
10869
11198
|
flexDirection: "column",
|
|
10870
|
-
height: theme.spacing(
|
|
11199
|
+
height: theme.spacing(31),
|
|
10871
11200
|
marginRight: theme.spacing(3.5),
|
|
10872
11201
|
position: "relative",
|
|
10873
|
-
width: theme.spacing(
|
|
11202
|
+
width: theme.spacing(22)
|
|
10874
11203
|
}),
|
|
10875
11204
|
selectedThermal: theme => ({
|
|
10876
11205
|
alignItems: "center",
|
|
@@ -10881,9 +11210,9 @@ const styles$5 = createStyles({
|
|
|
10881
11210
|
cursor: "pointer",
|
|
10882
11211
|
display: "flex",
|
|
10883
11212
|
flexDirection: "column",
|
|
10884
|
-
height: theme.spacing(
|
|
11213
|
+
height: theme.spacing(31),
|
|
10885
11214
|
position: "relative",
|
|
10886
|
-
width: theme.spacing(
|
|
11215
|
+
width: theme.spacing(22)
|
|
10887
11216
|
}),
|
|
10888
11217
|
thermal: theme => ({
|
|
10889
11218
|
":hover": {
|
|
@@ -10895,9 +11224,9 @@ const styles$5 = createStyles({
|
|
|
10895
11224
|
cursor: "pointer",
|
|
10896
11225
|
display: "flex",
|
|
10897
11226
|
flexDirection: "column",
|
|
10898
|
-
height: theme.spacing(
|
|
11227
|
+
height: theme.spacing(31),
|
|
10899
11228
|
position: "relative",
|
|
10900
|
-
width: theme.spacing(
|
|
11229
|
+
width: theme.spacing(22)
|
|
10901
11230
|
}),
|
|
10902
11231
|
thermalIcon: theme => ({
|
|
10903
11232
|
backgroundColor: "#95C2E0",
|
|
@@ -10921,6 +11250,8 @@ const styles$5 = createStyles({
|
|
|
10921
11250
|
});
|
|
10922
11251
|
|
|
10923
11252
|
const LabelLayoutSettings = ({
|
|
11253
|
+
errors,
|
|
11254
|
+
isSaving,
|
|
10924
11255
|
onChange
|
|
10925
11256
|
}) => {
|
|
10926
11257
|
var _a;
|
|
@@ -10933,13 +11264,17 @@ const LabelLayoutSettings = ({
|
|
|
10933
11264
|
const labelLayout = (_a = accountSettings === null || accountSettings === void 0 ? void 0 : accountSettings.defaultLabelLayout) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
10934
11265
|
return jsx(Section, Object.assign({
|
|
10935
11266
|
bold: true,
|
|
11267
|
+
rightContent: jsx(SaveStatus, {
|
|
11268
|
+
errors: errors,
|
|
11269
|
+
isSaving: isSaving
|
|
11270
|
+
}),
|
|
10936
11271
|
title: t("manage-defaults:label.title")
|
|
10937
11272
|
}, {
|
|
10938
11273
|
children: jsxs("div", Object.assign({
|
|
10939
|
-
css: styles$
|
|
11274
|
+
css: styles$6.buttonContainer
|
|
10940
11275
|
}, {
|
|
10941
11276
|
children: [jsx("button", Object.assign({
|
|
10942
|
-
css: styles$
|
|
11277
|
+
css: styles$6.button,
|
|
10943
11278
|
id: "letter",
|
|
10944
11279
|
onClick: () => {
|
|
10945
11280
|
onChange("Letter");
|
|
@@ -10947,16 +11282,16 @@ const LabelLayoutSettings = ({
|
|
|
10947
11282
|
value: "letter"
|
|
10948
11283
|
}, {
|
|
10949
11284
|
children: jsxs("div", Object.assign({
|
|
10950
|
-
css: labelLayout === "letter" ? styles$
|
|
11285
|
+
css: labelLayout === "letter" ? styles$6.selectedLetter : styles$6.letter
|
|
10951
11286
|
}, {
|
|
10952
11287
|
children: [labelLayout === "letter" && jsx(Icon, {
|
|
10953
|
-
css: styles$
|
|
11288
|
+
css: styles$6.icon,
|
|
10954
11289
|
name: IconNames$1.CHECK_FILLED
|
|
10955
11290
|
}), jsx("div", Object.assign({
|
|
10956
|
-
css: styles$
|
|
11291
|
+
css: styles$6.letterInner
|
|
10957
11292
|
}, {
|
|
10958
11293
|
children: jsx("div", {
|
|
10959
|
-
css: styles$
|
|
11294
|
+
css: styles$6.letterLabel
|
|
10960
11295
|
})
|
|
10961
11296
|
})), jsx(Typography, {
|
|
10962
11297
|
children: t("manage-defaults:label.letter.title")
|
|
@@ -10971,7 +11306,7 @@ const LabelLayoutSettings = ({
|
|
|
10971
11306
|
}))]
|
|
10972
11307
|
}))
|
|
10973
11308
|
})), jsx("button", Object.assign({
|
|
10974
|
-
css: styles$
|
|
11309
|
+
css: styles$6.button,
|
|
10975
11310
|
id: "4x6",
|
|
10976
11311
|
onClick: e => {
|
|
10977
11312
|
onChange(e.currentTarget.value);
|
|
@@ -10979,16 +11314,16 @@ const LabelLayoutSettings = ({
|
|
|
10979
11314
|
value: "4x6"
|
|
10980
11315
|
}, {
|
|
10981
11316
|
children: jsxs("div", Object.assign({
|
|
10982
|
-
css: labelLayout === "4x6" ? styles$
|
|
11317
|
+
css: labelLayout === "4x6" ? styles$6.selectedThermal : styles$6.thermal
|
|
10983
11318
|
}, {
|
|
10984
11319
|
children: [labelLayout === "4x6" && jsx(Icon, {
|
|
10985
|
-
css: styles$
|
|
11320
|
+
css: styles$6.icon,
|
|
10986
11321
|
name: IconNames$1.CHECK_FILLED
|
|
10987
11322
|
}), jsx("div", Object.assign({
|
|
10988
|
-
css: styles$
|
|
11323
|
+
css: styles$6.thermalInner
|
|
10989
11324
|
}, {
|
|
10990
11325
|
children: jsx("div", {
|
|
10991
|
-
css: styles$
|
|
11326
|
+
css: styles$6.thermalLabel
|
|
10992
11327
|
})
|
|
10993
11328
|
})), jsx(Typography, {
|
|
10994
11329
|
children: t("manage-defaults:label.thermal.title")
|
|
@@ -11011,6 +11346,8 @@ const LabelLayout = ({
|
|
|
11011
11346
|
display
|
|
11012
11347
|
}) => {
|
|
11013
11348
|
const {
|
|
11349
|
+
error: updateAccountSettingsErrors,
|
|
11350
|
+
isLoading: updatingAccountSettings,
|
|
11014
11351
|
mutateAsync: updateAccountSettings
|
|
11015
11352
|
} = useUpdateAccountSettings();
|
|
11016
11353
|
const {
|
|
@@ -11028,6 +11365,8 @@ const LabelLayout = ({
|
|
|
11028
11365
|
});
|
|
11029
11366
|
return jsxs(Fragment, {
|
|
11030
11367
|
children: [display === "settings" && jsx(LabelLayoutSettings, {
|
|
11368
|
+
errors: updateAccountSettingsErrors,
|
|
11369
|
+
isSaving: updatingAccountSettings,
|
|
11031
11370
|
onChange: handleSubmitUpdateAccountSettings
|
|
11032
11371
|
}), display === "purchase" && jsx(LabelLayoutPurchase, {
|
|
11033
11372
|
onChange: handleSubmitUpdateAccountSettings
|
|
@@ -11035,7 +11374,7 @@ const LabelLayout = ({
|
|
|
11035
11374
|
});
|
|
11036
11375
|
};
|
|
11037
11376
|
|
|
11038
|
-
const styles$
|
|
11377
|
+
const styles$5 = createStyles({
|
|
11039
11378
|
fundAndPurchase: theme => ({
|
|
11040
11379
|
borderTop: `1px solid ${theme.palette.gray.ultraLight}`
|
|
11041
11380
|
}),
|
|
@@ -11059,6 +11398,50 @@ const rateSchema = z.object({
|
|
|
11059
11398
|
})
|
|
11060
11399
|
}).transform(schema => schema.rate.rateId);
|
|
11061
11400
|
|
|
11401
|
+
var _path, _path2;
|
|
11402
|
+
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); }
|
|
11403
|
+
var SvgShipengineLogo = function SvgShipengineLogo(props) {
|
|
11404
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
11405
|
+
width: 244,
|
|
11406
|
+
height: 31,
|
|
11407
|
+
fill: "none",
|
|
11408
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11409
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11410
|
+
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",
|
|
11411
|
+
fill: "#45AAF2"
|
|
11412
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
11413
|
+
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",
|
|
11414
|
+
fill: "#162948"
|
|
11415
|
+
})));
|
|
11416
|
+
};
|
|
11417
|
+
|
|
11418
|
+
const styles$4 = createStyles({
|
|
11419
|
+
poweredByShipEngine: {
|
|
11420
|
+
display: "flex",
|
|
11421
|
+
alignItems: "center",
|
|
11422
|
+
justifyContent: "center",
|
|
11423
|
+
textAlign: "center",
|
|
11424
|
+
margin: "1rem 0",
|
|
11425
|
+
gap: "1rem",
|
|
11426
|
+
color: "#818F9C"
|
|
11427
|
+
}
|
|
11428
|
+
});
|
|
11429
|
+
|
|
11430
|
+
const PoweredByShipEngine = () => {
|
|
11431
|
+
const {
|
|
11432
|
+
t
|
|
11433
|
+
} = useTranslation();
|
|
11434
|
+
return jsxs("div", Object.assign({
|
|
11435
|
+
css: styles$4.poweredByShipEngine
|
|
11436
|
+
}, {
|
|
11437
|
+
children: [jsx(Typography, Object.assign({
|
|
11438
|
+
variant: "subtitle1"
|
|
11439
|
+
}, {
|
|
11440
|
+
children: t("powered-by")
|
|
11441
|
+
})), jsx(SvgShipengineLogo, {})]
|
|
11442
|
+
}));
|
|
11443
|
+
};
|
|
11444
|
+
|
|
11062
11445
|
const RateForm = ({
|
|
11063
11446
|
carriers,
|
|
11064
11447
|
disabled,
|
|
@@ -11079,6 +11462,7 @@ const RateForm = ({
|
|
|
11079
11462
|
}) => {
|
|
11080
11463
|
features = Object.assign({
|
|
11081
11464
|
enableGlobalPostFiltering: false,
|
|
11465
|
+
labelLayout: false,
|
|
11082
11466
|
nicknameRate: true,
|
|
11083
11467
|
saveRate: true
|
|
11084
11468
|
}, features !== null && features !== void 0 ? features : {});
|
|
@@ -11143,6 +11527,14 @@ const RateForm = ({
|
|
|
11143
11527
|
index < 5 && rateOptions.length <= 6 || !option.requiresAcknowledgement && index < 6 && rateOptions.length > 6 || option.rateId === selectedRateId), [rateOptions, selectedRateId]);
|
|
11144
11528
|
// When rateOptions update, handle scrolling and single-rate auto-selection and form reset
|
|
11145
11529
|
useEffect(() => {
|
|
11530
|
+
if (!(rateOptions === null || rateOptions === void 0 ? void 0 : rateOptions.length)) {
|
|
11531
|
+
form.setValue("rate", {
|
|
11532
|
+
isAcknowledged: false,
|
|
11533
|
+
rateId: ""
|
|
11534
|
+
}, {
|
|
11535
|
+
shouldDirty: true
|
|
11536
|
+
});
|
|
11537
|
+
}
|
|
11146
11538
|
if (rateOptions.length === 1) {
|
|
11147
11539
|
form.setValue("rate", {
|
|
11148
11540
|
isAcknowledged: !rateOptions[0].requiresAcknowledgement,
|
|
@@ -11176,6 +11568,7 @@ const RateForm = ({
|
|
|
11176
11568
|
children: [!isLoading && !!rateOptions.length ? jsxs(Fragment, {
|
|
11177
11569
|
children: [jsx(RateSelect, {
|
|
11178
11570
|
control: form.control,
|
|
11571
|
+
displayErrors: false,
|
|
11179
11572
|
label: "Rate",
|
|
11180
11573
|
name: "rate",
|
|
11181
11574
|
nicknameFeature:
|
|
@@ -11184,7 +11577,7 @@ const RateForm = ({
|
|
|
11184
11577
|
onClick: onSelectRate,
|
|
11185
11578
|
options: showHiddenRates ? rateOptions : filteredRateOptions
|
|
11186
11579
|
}), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsx(Link, Object.assign({
|
|
11187
|
-
css: styles$
|
|
11580
|
+
css: styles$5.showMoreOrLessRatesButton,
|
|
11188
11581
|
onClick: () => {
|
|
11189
11582
|
var _a;
|
|
11190
11583
|
setShowHiddenRates(!showHiddenRates);
|
|
@@ -11205,7 +11598,7 @@ const RateForm = ({
|
|
|
11205
11598
|
}))
|
|
11206
11599
|
}))]
|
|
11207
11600
|
}) : !isLoading && !!allDisplayableErrors.length ? null : jsxs("article", Object.assign({
|
|
11208
|
-
css: styles$
|
|
11601
|
+
css: styles$5.ratesInterstitial,
|
|
11209
11602
|
role: "presentation"
|
|
11210
11603
|
}, {
|
|
11211
11604
|
children: [jsx(Cube, {
|
|
@@ -11219,7 +11612,7 @@ const RateForm = ({
|
|
|
11219
11612
|
children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
|
|
11220
11613
|
})
|
|
11221
11614
|
}))]
|
|
11222
|
-
})), !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
|
|
11615
|
+
})), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
|
|
11223
11616
|
title: t("manage-defaults:label.title")
|
|
11224
11617
|
}, {
|
|
11225
11618
|
children: jsx(LabelLayout, {
|
|
@@ -11228,14 +11621,14 @@ const RateForm = ({
|
|
|
11228
11621
|
})), jsx(FundAndPurchase, {
|
|
11229
11622
|
carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
|
|
11230
11623
|
control: form.control,
|
|
11231
|
-
css: styles$
|
|
11624
|
+
css: styles$5.fundAndPurchase,
|
|
11232
11625
|
disabled: disabled,
|
|
11233
11626
|
isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
|
|
11234
11627
|
isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
|
|
11235
11628
|
onPurchase: handleSubmit,
|
|
11236
11629
|
onSave: handleSaveRate,
|
|
11237
11630
|
purchaseAmount: getTotalRateAmount(selectedRate)
|
|
11238
|
-
})]
|
|
11631
|
+
}), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
|
|
11239
11632
|
}));
|
|
11240
11633
|
};
|
|
11241
11634
|
|
|
@@ -11800,13 +12193,10 @@ const ShipmentForm = ({
|
|
|
11800
12193
|
} = useTranslation(["purchase-label"]);
|
|
11801
12194
|
const [requireMeasurements, setRequireMeasurements] = useState(true);
|
|
11802
12195
|
const [insuranceEnabled, setInsuranceEnabled] = useState(false);
|
|
11803
|
-
const
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
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]);
|
|
12196
|
+
const {
|
|
12197
|
+
isContentDescriptionRequired,
|
|
12198
|
+
isCustomsRequired
|
|
12199
|
+
} = useShipmentMetadata(shipment);
|
|
11810
12200
|
const shipmentSchema = useMemo(() => getShipmentSchema({
|
|
11811
12201
|
isContentDescriptionRequired,
|
|
11812
12202
|
isCustomsRequired,
|
|
@@ -11817,7 +12207,7 @@ const ShipmentForm = ({
|
|
|
11817
12207
|
const form = useForm({
|
|
11818
12208
|
defaultValues: {
|
|
11819
12209
|
__mode: features.browseRates ? "browse_rates" : "select_service",
|
|
11820
|
-
shipDate: minimumShipDate
|
|
12210
|
+
shipDate: formatUSADate(minimumShipDate || new Date())
|
|
11821
12211
|
},
|
|
11822
12212
|
resolver: validationResolver(shipmentSchema)
|
|
11823
12213
|
});
|
|
@@ -11842,10 +12232,6 @@ const ShipmentForm = ({
|
|
|
11842
12232
|
return (carriers !== null && carriers !== void 0 ? carriers : []).filter(c => carrierIds.includes(c.carrierId));
|
|
11843
12233
|
}, [carrierIds, carriers, selectedMode]);
|
|
11844
12234
|
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
12235
|
const confirmationOptions = useConfirmationOptions();
|
|
11850
12236
|
const customsContentsOptions = useCustomsContentsOptions();
|
|
11851
12237
|
const customsNonDeliveryOptions = useCustomsNonDeliveryOptions();
|
|
@@ -11853,9 +12239,9 @@ const ShipmentForm = ({
|
|
|
11853
12239
|
includeShipsuranceInsurance: features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance,
|
|
11854
12240
|
includeThirdPartyInsurance: features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance
|
|
11855
12241
|
});
|
|
11856
|
-
const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes,
|
|
11857
|
-
const serviceCodeOptions = useServiceCodeOptions(carriers,
|
|
11858
|
-
const shippingPresetOptions = useShippingPresetsOptions(shippingPresets,
|
|
12242
|
+
const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes, shipment);
|
|
12243
|
+
const serviceCodeOptions = useServiceCodeOptions(carriers, shipment);
|
|
12244
|
+
const shippingPresetOptions = useShippingPresetsOptions(shippingPresets, shipment);
|
|
11859
12245
|
const warehouseOptions = useWarehouseOptions(warehouses);
|
|
11860
12246
|
const [showItems, setShowItems] = useState(false);
|
|
11861
12247
|
const [showApplyPreset, setShowApplyPreset] = useState(false);
|
|
@@ -11953,7 +12339,7 @@ const ShipmentForm = ({
|
|
|
11953
12339
|
carrierId: updatedShipment.carrierId,
|
|
11954
12340
|
serviceCode: updatedShipment.serviceCode
|
|
11955
12341
|
} : undefined,
|
|
11956
|
-
shipDate: mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate)
|
|
12342
|
+
shipDate: formatUSADate(mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate)),
|
|
11957
12343
|
shipmentId: updatedShipment.shipmentId,
|
|
11958
12344
|
warehouseId: updatedShipment.warehouseId
|
|
11959
12345
|
}));
|
|
@@ -11963,7 +12349,7 @@ const ShipmentForm = ({
|
|
|
11963
12349
|
// Hydrate only the customs items portion of the shipment form
|
|
11964
12350
|
const hydrateCustomsItems = useCallback(updatedShipment => {
|
|
11965
12351
|
const formCustoms = form.getValues("customs");
|
|
11966
|
-
if (updatedShipment.customs && !_$
|
|
12352
|
+
if (updatedShipment.customs && !_$3.isEqual(formCustoms === null || formCustoms === void 0 ? void 0 : formCustoms.customsItems, updatedShipment.customs.customsItems)) {
|
|
11967
12353
|
form.setValue("customs.customsItems", updatedShipment.customs.customsItems.map(ci => Object.assign(Object.assign({}, ci), {
|
|
11968
12354
|
value: typeof ci.value === "number" ? ci.value : ci.value.amount
|
|
11969
12355
|
})), {
|
|
@@ -12004,7 +12390,7 @@ const ShipmentForm = ({
|
|
|
12004
12390
|
// Autopopulate package dimensions if user selects a custom package
|
|
12005
12391
|
useEffect(() => {
|
|
12006
12392
|
const customPackage = findCustomPackage(selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.code);
|
|
12007
|
-
if ((customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions) && !_$
|
|
12393
|
+
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
12394
|
const {
|
|
12009
12395
|
length,
|
|
12010
12396
|
width,
|
|
@@ -12115,6 +12501,7 @@ const ShipmentForm = ({
|
|
|
12115
12501
|
});
|
|
12116
12502
|
if (errors) throw new Error(errors.map(e => e.message).join(", "));
|
|
12117
12503
|
if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
|
|
12504
|
+
const isEmptyShipTo = Object.entries(shipment.shipTo).every(([key, value]) => key === "countryCode" || [null, "", "unknown"].includes(value));
|
|
12118
12505
|
return jsxs("form", Object.assign({
|
|
12119
12506
|
id: "shipment-form",
|
|
12120
12507
|
onSubmit: formLogger.capture(handleSubmit)
|
|
@@ -12138,7 +12525,12 @@ const ShipmentForm = ({
|
|
|
12138
12525
|
}), jsx(FieldLabel, Object.assign({
|
|
12139
12526
|
label: !isEditShipFormToOpen ? "purchase-label:fields.shipTo" : ""
|
|
12140
12527
|
}, {
|
|
12141
|
-
children: !isEditShipFormToOpen && (
|
|
12528
|
+
children: !isEditShipFormToOpen && (isEmptyShipTo ? jsx(Button, Object.assign({
|
|
12529
|
+
onClick: toggleIsEditShipFormToOpen,
|
|
12530
|
+
variant: ButtonVariant.OUTLINED
|
|
12531
|
+
}, {
|
|
12532
|
+
children: t("purchase-label:fields:addShipToAddress")
|
|
12533
|
+
})) : addressPreference ? jsx(AddressPreferenceDisplay, {
|
|
12142
12534
|
addressPreference: addressPreference,
|
|
12143
12535
|
onChangePreference: handleChangePreference,
|
|
12144
12536
|
onEditAddress: () => {
|
|
@@ -12301,7 +12693,7 @@ const ShipmentForm = ({
|
|
|
12301
12693
|
onClick: () => {
|
|
12302
12694
|
handleApplyPreset(preset.value);
|
|
12303
12695
|
},
|
|
12304
|
-
selected: _$
|
|
12696
|
+
selected: _$3.isEqual(selectedPreset, preset.value),
|
|
12305
12697
|
value: JSON.stringify(preset.value)
|
|
12306
12698
|
}, {
|
|
12307
12699
|
children: preset.description
|
|
@@ -12743,7 +13135,7 @@ const Shipment = ({
|
|
|
12743
13135
|
})), "representative."]
|
|
12744
13136
|
}))
|
|
12745
13137
|
}))
|
|
12746
|
-
}))]
|
|
13138
|
+
})), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
|
|
12747
13139
|
});
|
|
12748
13140
|
};
|
|
12749
13141
|
|
|
@@ -12771,115 +13163,6 @@ const SuspendShipment = ({
|
|
|
12771
13163
|
}));
|
|
12772
13164
|
};
|
|
12773
13165
|
|
|
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
13166
|
var index = /*#__PURE__*/Object.freeze({
|
|
12884
13167
|
__proto__: null,
|
|
12885
13168
|
AddCarrierForm: AddCarrierForm,
|
|
@@ -12912,9 +13195,8 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
12912
13195
|
Shipment: Shipment,
|
|
12913
13196
|
SuspendShipment: SuspendShipment,
|
|
12914
13197
|
WarehouseForm: WarehouseForm,
|
|
12915
|
-
VoidLabel: VoidLabel,
|
|
12916
13198
|
WalletForm: WalletForm,
|
|
12917
|
-
styles: styles$
|
|
13199
|
+
styles: styles$d,
|
|
12918
13200
|
billingAddressSchema: billingAddressSchema,
|
|
12919
13201
|
walletSchema: walletSchema,
|
|
12920
13202
|
BillingFields: BillingFields,
|
|
@@ -13199,6 +13481,7 @@ const DateRangeCombo = ({
|
|
|
13199
13481
|
dateFormat: "MM/dd/yyyy",
|
|
13200
13482
|
isClearable: true,
|
|
13201
13483
|
label: t("wallet-history:actions.chooseDate"),
|
|
13484
|
+
locale: LOCALE,
|
|
13202
13485
|
maxDate: new Date(),
|
|
13203
13486
|
onClickConfirm: dates => {
|
|
13204
13487
|
if (Array.isArray(dates) && dates.length === 2 && dates[1] !== null) handleConfirmCustomRange(dates);
|
|
@@ -13465,6 +13748,7 @@ var common = {
|
|
|
13465
13748
|
autoFundingSettings: "Unable to load auto funding settings",
|
|
13466
13749
|
carrier: "Unable to load carrier",
|
|
13467
13750
|
carriers: "Unable to load carriers",
|
|
13751
|
+
label: "Unable to load label",
|
|
13468
13752
|
salesOrder: "Unable to load order",
|
|
13469
13753
|
shipment: "Unable to load shipment",
|
|
13470
13754
|
warehouses: "Unable to load warehouses"
|
|
@@ -13495,6 +13779,7 @@ var common = {
|
|
|
13495
13779
|
carriers: "Loading carriers...",
|
|
13496
13780
|
data: "Loading...",
|
|
13497
13781
|
importingSalesOrder: "Importing order...",
|
|
13782
|
+
label: "Loading label...",
|
|
13498
13783
|
onboarding: "Loading onboarding...",
|
|
13499
13784
|
salesOrder: "Loading order...",
|
|
13500
13785
|
shipment: "Loading shipment...",
|
|
@@ -13521,6 +13806,7 @@ var common = {
|
|
|
13521
13806
|
packageCodes: {
|
|
13522
13807
|
"package": "Custom"
|
|
13523
13808
|
},
|
|
13809
|
+
"powered-by": "Powered by",
|
|
13524
13810
|
schema: {
|
|
13525
13811
|
optionalLabel: "{{fieldLabel}} (optional)"
|
|
13526
13812
|
},
|
|
@@ -13591,21 +13877,8 @@ var listCarriers$1 = {
|
|
|
13591
13877
|
|
|
13592
13878
|
var manageDefaults = {
|
|
13593
13879
|
"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
13880
|
label: {
|
|
13881
|
+
title: "Label Printing",
|
|
13609
13882
|
letter: {
|
|
13610
13883
|
title: "Letter (8.5 x 11 inch)",
|
|
13611
13884
|
description: "For desktop printers"
|
|
@@ -13617,8 +13890,26 @@ var manageDefaults = {
|
|
|
13617
13890
|
thermal: {
|
|
13618
13891
|
title: "Thermal (4 x 6 inch)",
|
|
13619
13892
|
description: "For label printers"
|
|
13893
|
+
}
|
|
13894
|
+
},
|
|
13895
|
+
status: {
|
|
13896
|
+
saving: "Saving...",
|
|
13897
|
+
saved: "Saved",
|
|
13898
|
+
savingFailed: "Saving Failed"
|
|
13899
|
+
},
|
|
13900
|
+
units: {
|
|
13901
|
+
title: "Units of Measure",
|
|
13902
|
+
dimensions: {
|
|
13903
|
+
title: "Dimensions",
|
|
13904
|
+
standard: "Inches",
|
|
13905
|
+
metric: "Centimeters"
|
|
13620
13906
|
},
|
|
13621
|
-
|
|
13907
|
+
weight: {
|
|
13908
|
+
title: "Weight",
|
|
13909
|
+
standard: "Pounds & Ounces",
|
|
13910
|
+
g: "Grams",
|
|
13911
|
+
kg: "Kilograms"
|
|
13912
|
+
}
|
|
13622
13913
|
}
|
|
13623
13914
|
}
|
|
13624
13915
|
};
|
|
@@ -13779,6 +14070,7 @@ var purchaseLabel$1 = {
|
|
|
13779
14070
|
shipDate: "Ship Date",
|
|
13780
14071
|
service: "Service",
|
|
13781
14072
|
shipTo: "Ship To",
|
|
14073
|
+
addShipToAddress: "Add Ship To Address",
|
|
13782
14074
|
warehouse: "Ship From",
|
|
13783
14075
|
weight: {
|
|
13784
14076
|
whole: "Pounds",
|
|
@@ -13914,6 +14206,9 @@ var voidLabel$1 = {
|
|
|
13914
14206
|
confirmVoid: "Confirm Void",
|
|
13915
14207
|
viewShipment: "View Shipment"
|
|
13916
14208
|
},
|
|
14209
|
+
errorMessages: {
|
|
14210
|
+
labelIdRequired: "A label id is required"
|
|
14211
|
+
},
|
|
13917
14212
|
resultMessages: {
|
|
13918
14213
|
approved: "Your refund request has been submitted to the carrier.",
|
|
13919
14214
|
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 +14515,7 @@ const useAddress = ({
|
|
|
14220
14515
|
// If the address is international, we always default to the original due to issues with SE-API's validation
|
|
14221
14516
|
const selectionSource = isDomesticAddress(originalAddress) && status !== "error" ? matchedAddress ? "matchedAddress" : "originalAddress" : "originalAddress";
|
|
14222
14517
|
const alternativeSource = selectionSource === "matchedAddress" ? "originalAddress" : "matchedAddress";
|
|
14223
|
-
const newAddressPreference = Object.assign(Object.assign(Object.assign({}, validation), _$
|
|
14518
|
+
const newAddressPreference = Object.assign(Object.assign(Object.assign({}, validation), _$3.isEqual(originalAddress, matchedAddress) ? {
|
|
14224
14519
|
// An exact match in SE-API will *sometimes* return a matchedAddress exactly mirroring the originalAddress,
|
|
14225
14520
|
// but it's supposed to return no matchedAddress at all. We handle this case by placing the fallbackAddress
|
|
14226
14521
|
// (if given) into the originalAddress slot.
|
|
@@ -15080,15 +15375,61 @@ const PurchaseLabelBySalesOrder = _a => {
|
|
|
15080
15375
|
}));
|
|
15081
15376
|
};
|
|
15082
15377
|
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15378
|
+
let shipmentsCreated = 0;
|
|
15379
|
+
const useGetOrCreateShipment = shipmentId => {
|
|
15380
|
+
const {
|
|
15381
|
+
client
|
|
15382
|
+
} = useShipEngine();
|
|
15383
|
+
const shipmentCreation = useMemo(() => {
|
|
15384
|
+
return ++shipmentsCreated;
|
|
15385
|
+
},
|
|
15386
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15387
|
+
[]);
|
|
15388
|
+
return useQuery({
|
|
15389
|
+
onError,
|
|
15390
|
+
retry: shipmentId !== undefined,
|
|
15391
|
+
queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15392
|
+
var _a;
|
|
15393
|
+
if (shipmentId) {
|
|
15394
|
+
return (yield client.salesOrderShipments.get(shipmentId)).data;
|
|
15395
|
+
} else {
|
|
15396
|
+
const warehouses = (yield client.warehouses.list()).data.warehouses;
|
|
15397
|
+
const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
|
|
15398
|
+
if (defaultOrFirstWarehouse === undefined) {
|
|
15399
|
+
throw [CodedError.fromObject({
|
|
15400
|
+
message: "errorMessages.noWarehouses",
|
|
15401
|
+
errorType: "unknown",
|
|
15402
|
+
errorCode: "unknown",
|
|
15403
|
+
errorSource: "client"
|
|
15404
|
+
})];
|
|
15405
|
+
}
|
|
15406
|
+
const shipTo = {
|
|
15407
|
+
addressLine1: "",
|
|
15408
|
+
cityLocality: "",
|
|
15409
|
+
countryCode: "",
|
|
15410
|
+
name: "",
|
|
15411
|
+
phone: "",
|
|
15412
|
+
postalCode: "",
|
|
15413
|
+
stateProvince: ""
|
|
15414
|
+
};
|
|
15415
|
+
const newShipment = yield client.shipments.create({
|
|
15416
|
+
shipTo: shipTo,
|
|
15417
|
+
warehouseId: defaultOrFirstWarehouse.warehouseId
|
|
15418
|
+
});
|
|
15419
|
+
return newShipment.data.shipments[0];
|
|
15420
|
+
}
|
|
15421
|
+
}),
|
|
15422
|
+
queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
|
|
15423
|
+
});
|
|
15424
|
+
};
|
|
15425
|
+
|
|
15426
|
+
const useLoadOrCreateShipment = shipmentId => {
|
|
15086
15427
|
const {
|
|
15087
15428
|
data: shipment,
|
|
15088
15429
|
error: loadShipmentErrors,
|
|
15089
15430
|
refetch: refetchShipment,
|
|
15090
15431
|
isLoading
|
|
15091
|
-
} =
|
|
15432
|
+
} = useGetOrCreateShipment(shipmentId);
|
|
15092
15433
|
const errors = [...(loadShipmentErrors !== null && loadShipmentErrors !== void 0 ? loadShipmentErrors : [])];
|
|
15093
15434
|
return {
|
|
15094
15435
|
errors: errors.length > 0 ? errors : undefined,
|
|
@@ -15100,15 +15441,12 @@ const useLoadShipment = ({
|
|
|
15100
15441
|
|
|
15101
15442
|
const PurchaseLabelByShipment = _a => {
|
|
15102
15443
|
var {
|
|
15103
|
-
shipmentId,
|
|
15104
15444
|
onLoad,
|
|
15105
15445
|
onShipmentUpdated,
|
|
15106
15446
|
features
|
|
15107
15447
|
} = _a,
|
|
15108
|
-
props = __rest(_a, ["
|
|
15109
|
-
const _b =
|
|
15110
|
-
shipmentId
|
|
15111
|
-
}),
|
|
15448
|
+
props = __rest(_a, ["onLoad", "onShipmentUpdated", "features"]);
|
|
15449
|
+
const _b = useLoadOrCreateShipment("shipmentId" in props ? props.shipmentId : undefined),
|
|
15112
15450
|
{
|
|
15113
15451
|
shipment
|
|
15114
15452
|
} = _b,
|
|
@@ -15140,16 +15478,11 @@ const PurchaseLabelByShipment = _a => {
|
|
|
15140
15478
|
};
|
|
15141
15479
|
|
|
15142
15480
|
const Component$2 = _a => {
|
|
15143
|
-
var
|
|
15144
|
-
|
|
15145
|
-
} = _a,
|
|
15146
|
-
props = __rest(_a, ["shipmentId"]);
|
|
15147
|
-
if (shipmentId) {
|
|
15148
|
-
return jsx(PurchaseLabelByShipment, Object.assign({
|
|
15149
|
-
shipmentId: shipmentId
|
|
15150
|
-
}, props));
|
|
15151
|
-
} else {
|
|
15481
|
+
var props = __rest(_a, []);
|
|
15482
|
+
if ("salesOrderId" in props) {
|
|
15152
15483
|
return jsx(PurchaseLabelBySalesOrder, Object.assign({}, props));
|
|
15484
|
+
} else {
|
|
15485
|
+
return jsx(PurchaseLabelByShipment, Object.assign({}, props));
|
|
15153
15486
|
}
|
|
15154
15487
|
};
|
|
15155
15488
|
const Element$2 = alchemy.createElement(Component$2, ErrorFallback, {
|
|
@@ -15223,6 +15556,111 @@ var viewShipment = /*#__PURE__*/Object.freeze({
|
|
|
15223
15556
|
Element: Element$1
|
|
15224
15557
|
});
|
|
15225
15558
|
|
|
15559
|
+
const Actions = ({
|
|
15560
|
+
onComplete,
|
|
15561
|
+
onSubmit,
|
|
15562
|
+
onViewShipment,
|
|
15563
|
+
shipment,
|
|
15564
|
+
voidRequest
|
|
15565
|
+
}) => {
|
|
15566
|
+
const {
|
|
15567
|
+
t
|
|
15568
|
+
} = useTranslation(["common", "void-label"]);
|
|
15569
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
15570
|
+
const handleSubmit = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
15571
|
+
setIsSubmitting(true);
|
|
15572
|
+
yield onSubmit();
|
|
15573
|
+
setIsSubmitting(false);
|
|
15574
|
+
}), [onSubmit]);
|
|
15575
|
+
return jsx(BottomSheet, Object.assign({
|
|
15576
|
+
alwaysVisible: true,
|
|
15577
|
+
css: theme => ({
|
|
15578
|
+
borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
|
|
15579
|
+
boxShadow: "none",
|
|
15580
|
+
position: "static"
|
|
15581
|
+
})
|
|
15582
|
+
}, {
|
|
15583
|
+
children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
|
|
15584
|
+
// The void request has been approved
|
|
15585
|
+
jsxs(ButtonGroup, {
|
|
15586
|
+
children: [jsx(Button, Object.assign({
|
|
15587
|
+
bold: false,
|
|
15588
|
+
onClick: () => onComplete(voidRequest, shipment),
|
|
15589
|
+
variant: ButtonVariant.OUTLINED
|
|
15590
|
+
}, {
|
|
15591
|
+
children: t("void-label:actions.complete")
|
|
15592
|
+
})), jsx(Button, Object.assign({
|
|
15593
|
+
bold: false,
|
|
15594
|
+
isFullWidth: true,
|
|
15595
|
+
onClick: () => onViewShipment(shipment)
|
|
15596
|
+
}, {
|
|
15597
|
+
children: t("void-label:actions.viewShipment")
|
|
15598
|
+
}))]
|
|
15599
|
+
}) :
|
|
15600
|
+
// The void request has yet to be made or was rejected
|
|
15601
|
+
jsx(Button, Object.assign({
|
|
15602
|
+
bold: false,
|
|
15603
|
+
isFullWidth: true,
|
|
15604
|
+
isLoading: isSubmitting,
|
|
15605
|
+
onClick: handleSubmit
|
|
15606
|
+
}, {
|
|
15607
|
+
children: t("void-label:actions.confirmVoid")
|
|
15608
|
+
}))
|
|
15609
|
+
}));
|
|
15610
|
+
};
|
|
15611
|
+
|
|
15612
|
+
const Message = ({
|
|
15613
|
+
voidRequest
|
|
15614
|
+
}) => {
|
|
15615
|
+
const {
|
|
15616
|
+
t
|
|
15617
|
+
} = useTranslation(["common", "void-label"]);
|
|
15618
|
+
return jsx(Section, {
|
|
15619
|
+
children: voidRequest ? jsxs("section", Object.assign({
|
|
15620
|
+
css: {
|
|
15621
|
+
textAlign: "center",
|
|
15622
|
+
width: "100%"
|
|
15623
|
+
}
|
|
15624
|
+
}, {
|
|
15625
|
+
children: [jsx(Icon, {
|
|
15626
|
+
css: theme => ({
|
|
15627
|
+
color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
|
|
15628
|
+
}),
|
|
15629
|
+
name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? IconNames.CHECK_FILLED : IconNames.ALERT,
|
|
15630
|
+
size: IconSize.SIZE_LARGE
|
|
15631
|
+
}), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxs(Fragment, {
|
|
15632
|
+
children: [jsx(Typography, Object.assign({
|
|
15633
|
+
component: "h2"
|
|
15634
|
+
}, {
|
|
15635
|
+
children: t("void-label:resultTitles.approved")
|
|
15636
|
+
})), jsx(Typography, {
|
|
15637
|
+
children: t("void-label:resultMessages.approved")
|
|
15638
|
+
})]
|
|
15639
|
+
}) : jsxs(Fragment, {
|
|
15640
|
+
children: [jsx(Typography, Object.assign({
|
|
15641
|
+
component: "h2"
|
|
15642
|
+
}, {
|
|
15643
|
+
children: t("void-label:resultTitles.rejected")
|
|
15644
|
+
})), jsx(Typography, {
|
|
15645
|
+
children: jsx("p", {
|
|
15646
|
+
dangerouslySetInnerHTML: {
|
|
15647
|
+
__html: t("void-label:resultMessages.rejected")
|
|
15648
|
+
}
|
|
15649
|
+
})
|
|
15650
|
+
})]
|
|
15651
|
+
})]
|
|
15652
|
+
})) : jsxs(Fragment, {
|
|
15653
|
+
children: [jsx(Typography, {
|
|
15654
|
+
children: t("void-label:refund_process")
|
|
15655
|
+
}), jsx(Typography, Object.assign({
|
|
15656
|
+
component: "p"
|
|
15657
|
+
}, {
|
|
15658
|
+
children: t("void-label:refund_rules")
|
|
15659
|
+
}))]
|
|
15660
|
+
})
|
|
15661
|
+
});
|
|
15662
|
+
};
|
|
15663
|
+
|
|
15226
15664
|
const Component = ({
|
|
15227
15665
|
labelId,
|
|
15228
15666
|
onComplete,
|
|
@@ -15230,24 +15668,40 @@ const Component = ({
|
|
|
15230
15668
|
onViewShipment
|
|
15231
15669
|
}) => {
|
|
15232
15670
|
var _a;
|
|
15671
|
+
// TODO [LMNT-910] - labelId should be a required prop
|
|
15672
|
+
if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
|
|
15673
|
+
const {
|
|
15674
|
+
t
|
|
15675
|
+
} = useTranslation();
|
|
15233
15676
|
const label = useGetLabel(labelId);
|
|
15234
15677
|
const shipment = useGetSalesOrderShipment((_a = label.data) === null || _a === void 0 ? void 0 : _a.shipmentId);
|
|
15235
15678
|
const voidLabel = useVoidLabel();
|
|
15679
|
+
if (label.isLoading) return jsx(Loader, {
|
|
15680
|
+
message: t("loading.label")
|
|
15681
|
+
});
|
|
15682
|
+
if (shipment.isLoading) return jsx(Loader, {
|
|
15683
|
+
message: t("loading.shipment")
|
|
15684
|
+
});
|
|
15685
|
+
throwAny(label.error);
|
|
15686
|
+
throwAny(shipment.error);
|
|
15687
|
+
if (!label.data) throw new Error("errorMessages.unableToLoad.label");
|
|
15688
|
+
if (!shipment.data) throw new Error("errorMessages.unableToLoad.shipment");
|
|
15236
15689
|
const handleVoidLabelSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15237
|
-
if (!labelId) throw new Error("labelId is required");
|
|
15238
15690
|
const result = yield voidLabel.mutateAsync(labelId);
|
|
15239
|
-
|
|
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) {
|
|
15691
|
+
if (result.approved) {
|
|
15242
15692
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(label.data, shipment.data);
|
|
15243
15693
|
}
|
|
15244
15694
|
});
|
|
15245
|
-
return
|
|
15246
|
-
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15695
|
+
return jsxs(Fragment, {
|
|
15696
|
+
children: [jsx(Message, {
|
|
15697
|
+
voidRequest: voidLabel.data
|
|
15698
|
+
}), jsx(Actions, {
|
|
15699
|
+
onComplete: onComplete,
|
|
15700
|
+
onSubmit: handleVoidLabelSubmit,
|
|
15701
|
+
onViewShipment: onViewShipment,
|
|
15702
|
+
shipment: shipment.data,
|
|
15703
|
+
voidRequest: voidLabel.data
|
|
15704
|
+
}), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
|
|
15251
15705
|
});
|
|
15252
15706
|
};
|
|
15253
15707
|
const Element = alchemy.createElement(Component, ErrorFallback, {
|
|
@@ -15266,4 +15720,4 @@ var voidLabel = /*#__PURE__*/Object.freeze({
|
|
|
15266
15720
|
Element: Element
|
|
15267
15721
|
});
|
|
15268
15722
|
|
|
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 };
|
|
15723
|
+
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 };
|