@shipengine/elements 0.24.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 +1442 -654
- package/index.js +1449 -668
- package/package.json +13 -4
- package/src/components/error-display/error-display.d.ts +1 -0
- package/src/components/error-display/error-display.styles.d.ts +19 -0
- package/src/components/error-display/index.d.ts +1 -0
- package/src/components/field/field.styles.d.ts +2 -12
- package/src/components/field/rate-card/rate-card.d.ts +1 -1
- package/src/components/history/history-card/history-card.styles.d.ts +12 -14
- package/src/components/history/history-card-extension/history-card-extension.d.ts +1 -0
- package/src/components/history/history-card-extension/history-card-extension.styles.d.ts +26 -0
- package/src/components/history/history-card-extension/index.d.ts +1 -0
- package/src/components/history/index.d.ts +1 -0
- package/src/components/index.d.ts +1 -0
- package/src/components/label/label.d.ts +1 -1
- package/src/components/label/label.styles.d.ts +5 -1
- package/src/components/label-layout/label-layout-settings.d.ts +3 -1
- package/src/components/link-action/link-action.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 +4 -1
- package/src/components/unit-settings/unit-settings.d.ts +1 -4
- package/src/constants/shipengine/address.d.ts +2 -0
- package/src/elements/configure-shipment/hooks/use-rates-form.d.ts +2 -0
- package/src/elements/list-carriers/list-carriers.d.ts +29 -14
- package/src/elements/manage-warehouses/manage-warehouses.d.ts +29 -14
- package/src/elements/onboarding/onboarding.d.ts +29 -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 +41 -20
- package/src/elements/view-shipment/view-shipment.d.ts +29 -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 +29 -14
- package/src/factories/shipengine/wallet-history.d.ts +52 -0
- package/src/features/wallet-history/wallet-history.styles.d.ts +4 -0
- 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 +29 -14
- package/src/mocks/account-settings/handlers.d.ts +8 -0
- package/src/mocks/account-settings/index.d.ts +1 -0
- package/src/mocks/index.d.ts +1 -0
- 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/rates.d.ts +1 -1
- package/src/utilities/shipengine/address.d.ts +4 -0
- package/src/utilities/shipengine/carrier.d.ts +1 -0
- package/vite.config.d.ts +2 -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.cjs
CHANGED
|
@@ -15,8 +15,10 @@ var react = require('@emotion/react');
|
|
|
15
15
|
var humps = require('humps');
|
|
16
16
|
var ReactDatePicker = require('react-datepicker');
|
|
17
17
|
var gigerTheme = require('@packlink/giger-theme');
|
|
18
|
+
var dateFns = require('date-fns');
|
|
19
|
+
var Locales = require('date-fns/locale');
|
|
18
20
|
var css = require('@emotion/css');
|
|
19
|
-
var _$
|
|
21
|
+
var _$3 = require('lodash');
|
|
20
22
|
var reactDom = require('react-dom');
|
|
21
23
|
var min$3 = require('libphonenumber-js/min');
|
|
22
24
|
var copy = require('copy-to-clipboard');
|
|
@@ -24,6 +26,7 @@ var jsBase64 = require('js-base64');
|
|
|
24
26
|
var cardValidator = require('card-validator');
|
|
25
27
|
var reactQuery = require('react-query');
|
|
26
28
|
var brands = require('@packlink/brands');
|
|
29
|
+
var reactApi = require('@shipengine/react-api');
|
|
27
30
|
|
|
28
31
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
29
32
|
|
|
@@ -49,7 +52,8 @@ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
|
49
52
|
var alchemy__default = /*#__PURE__*/_interopDefaultLegacy(alchemy);
|
|
50
53
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
51
54
|
var ReactDatePicker__default = /*#__PURE__*/_interopDefaultLegacy(ReactDatePicker);
|
|
52
|
-
var
|
|
55
|
+
var Locales__namespace = /*#__PURE__*/_interopNamespace(Locales);
|
|
56
|
+
var ___default = /*#__PURE__*/_interopDefaultLegacy(_$3);
|
|
53
57
|
var copy__default = /*#__PURE__*/_interopDefaultLegacy(copy);
|
|
54
58
|
var cardValidator__default = /*#__PURE__*/_interopDefaultLegacy(cardValidator);
|
|
55
59
|
|
|
@@ -99,10 +103,10 @@ var functionBindNative = !fails$o(function () {
|
|
|
99
103
|
|
|
100
104
|
var NATIVE_BIND$3 = functionBindNative;
|
|
101
105
|
|
|
102
|
-
var call$
|
|
106
|
+
var call$k = Function.prototype.call;
|
|
103
107
|
|
|
104
|
-
var functionCall = NATIVE_BIND$3 ? call$
|
|
105
|
-
return call$
|
|
108
|
+
var functionCall = NATIVE_BIND$3 ? call$k.bind(call$k) : function () {
|
|
109
|
+
return call$k.apply(call$k, arguments);
|
|
106
110
|
};
|
|
107
111
|
|
|
108
112
|
var objectPropertyIsEnumerable = {};
|
|
@@ -133,30 +137,30 @@ var createPropertyDescriptor$4 = function (bitmap, value) {
|
|
|
133
137
|
var NATIVE_BIND$2 = functionBindNative;
|
|
134
138
|
|
|
135
139
|
var FunctionPrototype$2 = Function.prototype;
|
|
136
|
-
var call$
|
|
137
|
-
var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$
|
|
140
|
+
var call$j = FunctionPrototype$2.call;
|
|
141
|
+
var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$j, call$j);
|
|
138
142
|
|
|
139
143
|
var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
|
|
140
144
|
return function () {
|
|
141
|
-
return call$
|
|
145
|
+
return call$j.apply(fn, arguments);
|
|
142
146
|
};
|
|
143
147
|
};
|
|
144
148
|
|
|
145
|
-
var uncurryThis$
|
|
149
|
+
var uncurryThis$r = functionUncurryThis;
|
|
146
150
|
|
|
147
|
-
var toString$
|
|
148
|
-
var stringSlice$
|
|
151
|
+
var toString$e = uncurryThis$r({}.toString);
|
|
152
|
+
var stringSlice$7 = uncurryThis$r(''.slice);
|
|
149
153
|
|
|
150
154
|
var classofRaw$2 = function (it) {
|
|
151
|
-
return stringSlice$
|
|
155
|
+
return stringSlice$7(toString$e(it), 8, -1);
|
|
152
156
|
};
|
|
153
157
|
|
|
154
|
-
var uncurryThis$
|
|
158
|
+
var uncurryThis$q = functionUncurryThis;
|
|
155
159
|
var fails$n = fails$q;
|
|
156
160
|
var classof$8 = classofRaw$2;
|
|
157
161
|
|
|
158
162
|
var $Object$4 = Object;
|
|
159
|
-
var split = uncurryThis$
|
|
163
|
+
var split = uncurryThis$q(''.split);
|
|
160
164
|
|
|
161
165
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
162
166
|
var indexedObject = fails$n(function () {
|
|
@@ -169,27 +173,27 @@ var indexedObject = fails$n(function () {
|
|
|
169
173
|
|
|
170
174
|
// we can't use just `it == null` since of `document.all` special case
|
|
171
175
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
172
|
-
var isNullOrUndefined$
|
|
176
|
+
var isNullOrUndefined$7 = function (it) {
|
|
173
177
|
return it === null || it === undefined;
|
|
174
178
|
};
|
|
175
179
|
|
|
176
|
-
var isNullOrUndefined$
|
|
180
|
+
var isNullOrUndefined$6 = isNullOrUndefined$7;
|
|
177
181
|
|
|
178
|
-
var $TypeError$
|
|
182
|
+
var $TypeError$i = TypeError;
|
|
179
183
|
|
|
180
184
|
// `RequireObjectCoercible` abstract operation
|
|
181
185
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
182
|
-
var requireObjectCoercible$
|
|
183
|
-
if (isNullOrUndefined$
|
|
186
|
+
var requireObjectCoercible$9 = function (it) {
|
|
187
|
+
if (isNullOrUndefined$6(it)) throw $TypeError$i("Can't call method on " + it);
|
|
184
188
|
return it;
|
|
185
189
|
};
|
|
186
190
|
|
|
187
191
|
// toObject with fallback for non-array-like ES3 strings
|
|
188
192
|
var IndexedObject$2 = indexedObject;
|
|
189
|
-
var requireObjectCoercible$
|
|
193
|
+
var requireObjectCoercible$8 = requireObjectCoercible$9;
|
|
190
194
|
|
|
191
195
|
var toIndexedObject$5 = function (it) {
|
|
192
|
-
return IndexedObject$2(requireObjectCoercible$
|
|
196
|
+
return IndexedObject$2(requireObjectCoercible$8(it));
|
|
193
197
|
};
|
|
194
198
|
|
|
195
199
|
var documentAll$2 = typeof document == 'object' && document.all;
|
|
@@ -208,37 +212,37 @@ var documentAll$1 = $documentAll$1.all;
|
|
|
208
212
|
|
|
209
213
|
// `IsCallable` abstract operation
|
|
210
214
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
211
|
-
var isCallable$
|
|
215
|
+
var isCallable$o = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
|
212
216
|
return typeof argument == 'function' || argument === documentAll$1;
|
|
213
217
|
} : function (argument) {
|
|
214
218
|
return typeof argument == 'function';
|
|
215
219
|
};
|
|
216
220
|
|
|
217
|
-
var isCallable$
|
|
221
|
+
var isCallable$n = isCallable$o;
|
|
218
222
|
var $documentAll = documentAll_1;
|
|
219
223
|
|
|
220
224
|
var documentAll = $documentAll.all;
|
|
221
225
|
|
|
222
226
|
var isObject$a = $documentAll.IS_HTMLDDA ? function (it) {
|
|
223
|
-
return typeof it == 'object' ? it !== null : isCallable$
|
|
227
|
+
return typeof it == 'object' ? it !== null : isCallable$n(it) || it === documentAll;
|
|
224
228
|
} : function (it) {
|
|
225
|
-
return typeof it == 'object' ? it !== null : isCallable$
|
|
229
|
+
return typeof it == 'object' ? it !== null : isCallable$n(it);
|
|
226
230
|
};
|
|
227
231
|
|
|
228
232
|
var global$o = global$p;
|
|
229
|
-
var isCallable$
|
|
233
|
+
var isCallable$m = isCallable$o;
|
|
230
234
|
|
|
231
235
|
var aFunction = function (argument) {
|
|
232
|
-
return isCallable$
|
|
236
|
+
return isCallable$m(argument) ? argument : undefined;
|
|
233
237
|
};
|
|
234
238
|
|
|
235
239
|
var getBuiltIn$8 = function (namespace, method) {
|
|
236
240
|
return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
|
|
237
241
|
};
|
|
238
242
|
|
|
239
|
-
var uncurryThis$
|
|
243
|
+
var uncurryThis$p = functionUncurryThis;
|
|
240
244
|
|
|
241
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
245
|
+
var objectIsPrototypeOf = uncurryThis$p({}.isPrototypeOf);
|
|
242
246
|
|
|
243
247
|
var getBuiltIn$7 = getBuiltIn$8;
|
|
244
248
|
|
|
@@ -296,7 +300,7 @@ var useSymbolAsUid = NATIVE_SYMBOL$2
|
|
|
296
300
|
&& typeof Symbol.iterator == 'symbol';
|
|
297
301
|
|
|
298
302
|
var getBuiltIn$6 = getBuiltIn$8;
|
|
299
|
-
var isCallable$
|
|
303
|
+
var isCallable$l = isCallable$o;
|
|
300
304
|
var isPrototypeOf$4 = objectIsPrototypeOf;
|
|
301
305
|
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
302
306
|
|
|
@@ -306,7 +310,7 @@ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
|
306
310
|
return typeof it == 'symbol';
|
|
307
311
|
} : function (it) {
|
|
308
312
|
var $Symbol = getBuiltIn$6('Symbol');
|
|
309
|
-
return isCallable$
|
|
313
|
+
return isCallable$l($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
|
|
310
314
|
};
|
|
311
315
|
|
|
312
316
|
var $String$4 = String;
|
|
@@ -319,41 +323,41 @@ var tryToString$5 = function (argument) {
|
|
|
319
323
|
}
|
|
320
324
|
};
|
|
321
325
|
|
|
322
|
-
var isCallable$
|
|
326
|
+
var isCallable$k = isCallable$o;
|
|
323
327
|
var tryToString$4 = tryToString$5;
|
|
324
328
|
|
|
325
|
-
var $TypeError$
|
|
329
|
+
var $TypeError$h = TypeError;
|
|
326
330
|
|
|
327
331
|
// `Assert: IsCallable(argument) is true`
|
|
328
332
|
var aCallable$a = function (argument) {
|
|
329
|
-
if (isCallable$
|
|
330
|
-
throw $TypeError$
|
|
333
|
+
if (isCallable$k(argument)) return argument;
|
|
334
|
+
throw $TypeError$h(tryToString$4(argument) + ' is not a function');
|
|
331
335
|
};
|
|
332
336
|
|
|
333
337
|
var aCallable$9 = aCallable$a;
|
|
334
|
-
var isNullOrUndefined$
|
|
338
|
+
var isNullOrUndefined$5 = isNullOrUndefined$7;
|
|
335
339
|
|
|
336
340
|
// `GetMethod` abstract operation
|
|
337
341
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
338
|
-
var getMethod$
|
|
342
|
+
var getMethod$6 = function (V, P) {
|
|
339
343
|
var func = V[P];
|
|
340
|
-
return isNullOrUndefined$
|
|
344
|
+
return isNullOrUndefined$5(func) ? undefined : aCallable$9(func);
|
|
341
345
|
};
|
|
342
346
|
|
|
343
|
-
var call$
|
|
344
|
-
var isCallable$
|
|
347
|
+
var call$i = functionCall;
|
|
348
|
+
var isCallable$j = isCallable$o;
|
|
345
349
|
var isObject$9 = isObject$a;
|
|
346
350
|
|
|
347
|
-
var $TypeError$
|
|
351
|
+
var $TypeError$g = TypeError;
|
|
348
352
|
|
|
349
353
|
// `OrdinaryToPrimitive` abstract operation
|
|
350
354
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
351
355
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
352
356
|
var fn, val;
|
|
353
|
-
if (pref === 'string' && isCallable$
|
|
354
|
-
if (isCallable$
|
|
355
|
-
if (pref !== 'string' && isCallable$
|
|
356
|
-
throw $TypeError$
|
|
357
|
+
if (pref === 'string' && isCallable$j(fn = input.toString) && !isObject$9(val = call$i(fn, input))) return val;
|
|
358
|
+
if (isCallable$j(fn = input.valueOf) && !isObject$9(val = call$i(fn, input))) return val;
|
|
359
|
+
if (pref !== 'string' && isCallable$j(fn = input.toString) && !isObject$9(val = call$i(fn, input))) return val;
|
|
360
|
+
throw $TypeError$g("Can't convert object to primitive value");
|
|
357
361
|
};
|
|
358
362
|
|
|
359
363
|
var shared$4 = {exports: {}};
|
|
@@ -391,20 +395,20 @@ var store$2 = sharedStore;
|
|
|
391
395
|
source: 'https://github.com/zloirock/core-js'
|
|
392
396
|
});
|
|
393
397
|
|
|
394
|
-
var requireObjectCoercible$
|
|
398
|
+
var requireObjectCoercible$7 = requireObjectCoercible$9;
|
|
395
399
|
|
|
396
400
|
var $Object$2 = Object;
|
|
397
401
|
|
|
398
402
|
// `ToObject` abstract operation
|
|
399
403
|
// https://tc39.es/ecma262/#sec-toobject
|
|
400
404
|
var toObject$7 = function (argument) {
|
|
401
|
-
return $Object$2(requireObjectCoercible$
|
|
405
|
+
return $Object$2(requireObjectCoercible$7(argument));
|
|
402
406
|
};
|
|
403
407
|
|
|
404
|
-
var uncurryThis$
|
|
408
|
+
var uncurryThis$o = functionUncurryThis;
|
|
405
409
|
var toObject$6 = toObject$7;
|
|
406
410
|
|
|
407
|
-
var hasOwnProperty = uncurryThis$
|
|
411
|
+
var hasOwnProperty = uncurryThis$o({}.hasOwnProperty);
|
|
408
412
|
|
|
409
413
|
// `HasOwnProperty` abstract operation
|
|
410
414
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
@@ -413,14 +417,14 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
|
413
417
|
return hasOwnProperty(toObject$6(it), key);
|
|
414
418
|
};
|
|
415
419
|
|
|
416
|
-
var uncurryThis$
|
|
420
|
+
var uncurryThis$n = functionUncurryThis;
|
|
417
421
|
|
|
418
422
|
var id = 0;
|
|
419
423
|
var postfix = Math.random();
|
|
420
|
-
var toString$
|
|
424
|
+
var toString$d = uncurryThis$n(1.0.toString);
|
|
421
425
|
|
|
422
426
|
var uid$2 = function (key) {
|
|
423
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$
|
|
427
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$d(++id + postfix, 36);
|
|
424
428
|
};
|
|
425
429
|
|
|
426
430
|
var global$k = global$p;
|
|
@@ -435,7 +439,7 @@ var Symbol$3 = global$k.Symbol;
|
|
|
435
439
|
var symbolFor = Symbol$3 && Symbol$3['for'];
|
|
436
440
|
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
|
|
437
441
|
|
|
438
|
-
var wellKnownSymbol$
|
|
442
|
+
var wellKnownSymbol$k = function (name) {
|
|
439
443
|
if (!hasOwn$b(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
440
444
|
var description = 'Symbol.' + name;
|
|
441
445
|
if (NATIVE_SYMBOL$1 && hasOwn$b(Symbol$3, name)) {
|
|
@@ -448,27 +452,27 @@ var wellKnownSymbol$j = function (name) {
|
|
|
448
452
|
} return WellKnownSymbolsStore[name];
|
|
449
453
|
};
|
|
450
454
|
|
|
451
|
-
var call$
|
|
455
|
+
var call$h = functionCall;
|
|
452
456
|
var isObject$8 = isObject$a;
|
|
453
457
|
var isSymbol$1 = isSymbol$2;
|
|
454
|
-
var getMethod$
|
|
458
|
+
var getMethod$5 = getMethod$6;
|
|
455
459
|
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
456
|
-
var wellKnownSymbol$
|
|
460
|
+
var wellKnownSymbol$j = wellKnownSymbol$k;
|
|
457
461
|
|
|
458
|
-
var $TypeError$
|
|
459
|
-
var TO_PRIMITIVE = wellKnownSymbol$
|
|
462
|
+
var $TypeError$f = TypeError;
|
|
463
|
+
var TO_PRIMITIVE = wellKnownSymbol$j('toPrimitive');
|
|
460
464
|
|
|
461
465
|
// `ToPrimitive` abstract operation
|
|
462
466
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
463
467
|
var toPrimitive$1 = function (input, pref) {
|
|
464
468
|
if (!isObject$8(input) || isSymbol$1(input)) return input;
|
|
465
|
-
var exoticToPrim = getMethod$
|
|
469
|
+
var exoticToPrim = getMethod$5(input, TO_PRIMITIVE);
|
|
466
470
|
var result;
|
|
467
471
|
if (exoticToPrim) {
|
|
468
472
|
if (pref === undefined) pref = 'default';
|
|
469
|
-
result = call$
|
|
473
|
+
result = call$h(exoticToPrim, input, pref);
|
|
470
474
|
if (!isObject$8(result) || isSymbol$1(result)) return result;
|
|
471
|
-
throw $TypeError$
|
|
475
|
+
throw $TypeError$f("Can't convert object to primitive value");
|
|
472
476
|
}
|
|
473
477
|
if (pref === undefined) pref = 'number';
|
|
474
478
|
return ordinaryToPrimitive(input, pref);
|
|
@@ -508,7 +512,7 @@ var ie8DomDefine = !DESCRIPTORS$b && !fails$l(function () {
|
|
|
508
512
|
});
|
|
509
513
|
|
|
510
514
|
var DESCRIPTORS$a = descriptors;
|
|
511
|
-
var call$
|
|
515
|
+
var call$g = functionCall;
|
|
512
516
|
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
513
517
|
var createPropertyDescriptor$3 = createPropertyDescriptor$4;
|
|
514
518
|
var toIndexedObject$4 = toIndexedObject$5;
|
|
@@ -527,7 +531,7 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$a ? $getOwnPropertyDescriptor$1 :
|
|
|
527
531
|
if (IE8_DOM_DEFINE$1) try {
|
|
528
532
|
return $getOwnPropertyDescriptor$1(O, P);
|
|
529
533
|
} catch (error) { /* empty */ }
|
|
530
|
-
if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$
|
|
534
|
+
if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$g(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
531
535
|
};
|
|
532
536
|
|
|
533
537
|
var objectDefineProperty = {};
|
|
@@ -548,12 +552,12 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$k(function () {
|
|
|
548
552
|
var isObject$6 = isObject$a;
|
|
549
553
|
|
|
550
554
|
var $String$3 = String;
|
|
551
|
-
var $TypeError$
|
|
555
|
+
var $TypeError$e = TypeError;
|
|
552
556
|
|
|
553
557
|
// `Assert: Type(argument) is Object`
|
|
554
558
|
var anObject$f = function (argument) {
|
|
555
559
|
if (isObject$6(argument)) return argument;
|
|
556
|
-
throw $TypeError$
|
|
560
|
+
throw $TypeError$e($String$3(argument) + ' is not an object');
|
|
557
561
|
};
|
|
558
562
|
|
|
559
563
|
var DESCRIPTORS$8 = descriptors;
|
|
@@ -562,7 +566,7 @@ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
|
562
566
|
var anObject$e = anObject$f;
|
|
563
567
|
var toPropertyKey$1 = toPropertyKey$3;
|
|
564
568
|
|
|
565
|
-
var $TypeError$
|
|
569
|
+
var $TypeError$d = TypeError;
|
|
566
570
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
567
571
|
var $defineProperty = Object.defineProperty;
|
|
568
572
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
@@ -595,7 +599,7 @@ objectDefineProperty.f = DESCRIPTORS$8 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
|
|
|
595
599
|
if (IE8_DOM_DEFINE) try {
|
|
596
600
|
return $defineProperty(O, P, Attributes);
|
|
597
601
|
} catch (error) { /* empty */ }
|
|
598
|
-
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$
|
|
602
|
+
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$d('Accessors not supported');
|
|
599
603
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
600
604
|
return O;
|
|
601
605
|
};
|
|
@@ -631,14 +635,14 @@ var functionName = {
|
|
|
631
635
|
CONFIGURABLE: CONFIGURABLE
|
|
632
636
|
};
|
|
633
637
|
|
|
634
|
-
var uncurryThis$
|
|
635
|
-
var isCallable$
|
|
638
|
+
var uncurryThis$m = functionUncurryThis;
|
|
639
|
+
var isCallable$i = isCallable$o;
|
|
636
640
|
var store$1 = sharedStore;
|
|
637
641
|
|
|
638
|
-
var functionToString = uncurryThis$
|
|
642
|
+
var functionToString = uncurryThis$m(Function.toString);
|
|
639
643
|
|
|
640
644
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
641
|
-
if (!isCallable$
|
|
645
|
+
if (!isCallable$i(store$1.inspectSource)) {
|
|
642
646
|
store$1.inspectSource = function (it) {
|
|
643
647
|
return functionToString(it);
|
|
644
648
|
};
|
|
@@ -647,11 +651,11 @@ if (!isCallable$h(store$1.inspectSource)) {
|
|
|
647
651
|
var inspectSource$3 = store$1.inspectSource;
|
|
648
652
|
|
|
649
653
|
var global$i = global$p;
|
|
650
|
-
var isCallable$
|
|
654
|
+
var isCallable$h = isCallable$o;
|
|
651
655
|
|
|
652
656
|
var WeakMap$1 = global$i.WeakMap;
|
|
653
657
|
|
|
654
|
-
var weakMapBasicDetection = isCallable$
|
|
658
|
+
var weakMapBasicDetection = isCallable$h(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
655
659
|
|
|
656
660
|
var shared$2 = shared$4.exports;
|
|
657
661
|
var uid = uid$2;
|
|
@@ -736,7 +740,7 @@ var internalState = {
|
|
|
736
740
|
};
|
|
737
741
|
|
|
738
742
|
var fails$j = fails$q;
|
|
739
|
-
var isCallable$
|
|
743
|
+
var isCallable$g = isCallable$o;
|
|
740
744
|
var hasOwn$7 = hasOwnProperty_1;
|
|
741
745
|
var DESCRIPTORS$5 = descriptors;
|
|
742
746
|
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
@@ -782,10 +786,10 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
|
782
786
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
783
787
|
// eslint-disable-next-line no-extend-native -- required
|
|
784
788
|
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
785
|
-
return isCallable$
|
|
789
|
+
return isCallable$g(this) && getInternalState$2(this).source || inspectSource$2(this);
|
|
786
790
|
}, 'toString');
|
|
787
791
|
|
|
788
|
-
var isCallable$
|
|
792
|
+
var isCallable$f = isCallable$o;
|
|
789
793
|
var definePropertyModule$4 = objectDefineProperty;
|
|
790
794
|
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
791
795
|
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
@@ -794,7 +798,7 @@ var defineBuiltIn$7 = function (O, key, value, options) {
|
|
|
794
798
|
if (!options) options = {};
|
|
795
799
|
var simple = options.enumerable;
|
|
796
800
|
var name = options.name !== undefined ? options.name : key;
|
|
797
|
-
if (isCallable$
|
|
801
|
+
if (isCallable$f(value)) makeBuiltIn(value, name, options);
|
|
798
802
|
if (options.global) {
|
|
799
803
|
if (simple) O[key] = value;
|
|
800
804
|
else defineGlobalProperty$1(key, value);
|
|
@@ -838,7 +842,7 @@ var toIntegerOrInfinity$6 = function (argument) {
|
|
|
838
842
|
|
|
839
843
|
var toIntegerOrInfinity$5 = toIntegerOrInfinity$6;
|
|
840
844
|
|
|
841
|
-
var max$
|
|
845
|
+
var max$3 = Math.max;
|
|
842
846
|
var min$2 = Math.min;
|
|
843
847
|
|
|
844
848
|
// Helper for a popular repeating case of the spec:
|
|
@@ -846,7 +850,7 @@ var min$2 = Math.min;
|
|
|
846
850
|
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
847
851
|
var toAbsoluteIndex$2 = function (index, length) {
|
|
848
852
|
var integer = toIntegerOrInfinity$5(index);
|
|
849
|
-
return integer < 0 ? max$
|
|
853
|
+
return integer < 0 ? max$3(integer + length, 0) : min$2(integer, length);
|
|
850
854
|
};
|
|
851
855
|
|
|
852
856
|
var toIntegerOrInfinity$4 = toIntegerOrInfinity$6;
|
|
@@ -900,13 +904,13 @@ var arrayIncludes = {
|
|
|
900
904
|
indexOf: createMethod$3(false)
|
|
901
905
|
};
|
|
902
906
|
|
|
903
|
-
var uncurryThis$
|
|
907
|
+
var uncurryThis$l = functionUncurryThis;
|
|
904
908
|
var hasOwn$6 = hasOwnProperty_1;
|
|
905
909
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
906
|
-
var indexOf$
|
|
910
|
+
var indexOf$2 = arrayIncludes.indexOf;
|
|
907
911
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
908
912
|
|
|
909
|
-
var push$2 = uncurryThis$
|
|
913
|
+
var push$2 = uncurryThis$l([].push);
|
|
910
914
|
|
|
911
915
|
var objectKeysInternal = function (object, names) {
|
|
912
916
|
var O = toIndexedObject$2(object);
|
|
@@ -916,7 +920,7 @@ var objectKeysInternal = function (object, names) {
|
|
|
916
920
|
for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$2(result, key);
|
|
917
921
|
// Don't enum bug & hidden keys
|
|
918
922
|
while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
|
|
919
|
-
~indexOf$
|
|
923
|
+
~indexOf$2(result, key) || push$2(result, key);
|
|
920
924
|
}
|
|
921
925
|
return result;
|
|
922
926
|
};
|
|
@@ -950,12 +954,12 @@ var objectGetOwnPropertySymbols = {};
|
|
|
950
954
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
951
955
|
|
|
952
956
|
var getBuiltIn$5 = getBuiltIn$8;
|
|
953
|
-
var uncurryThis$
|
|
957
|
+
var uncurryThis$k = functionUncurryThis;
|
|
954
958
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
955
959
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
956
960
|
var anObject$d = anObject$f;
|
|
957
961
|
|
|
958
|
-
var concat$2 = uncurryThis$
|
|
962
|
+
var concat$2 = uncurryThis$k([].concat);
|
|
959
963
|
|
|
960
964
|
// all object keys, includes non-enumerable and symbols
|
|
961
965
|
var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
@@ -982,7 +986,7 @@ var copyConstructorProperties$2 = function (target, source, exceptions) {
|
|
|
982
986
|
};
|
|
983
987
|
|
|
984
988
|
var fails$i = fails$q;
|
|
985
|
-
var isCallable$
|
|
989
|
+
var isCallable$e = isCallable$o;
|
|
986
990
|
|
|
987
991
|
var replacement = /#|\.prototype\./;
|
|
988
992
|
|
|
@@ -990,7 +994,7 @@ var isForced$2 = function (feature, detection) {
|
|
|
990
994
|
var value = data[normalize(feature)];
|
|
991
995
|
return value == POLYFILL ? true
|
|
992
996
|
: value == NATIVE ? false
|
|
993
|
-
: isCallable$
|
|
997
|
+
: isCallable$e(detection) ? fails$i(detection)
|
|
994
998
|
: !!detection;
|
|
995
999
|
};
|
|
996
1000
|
|
|
@@ -1070,8 +1074,8 @@ var objectKeys$2 = Object.keys || function keys(O) {
|
|
|
1070
1074
|
};
|
|
1071
1075
|
|
|
1072
1076
|
var DESCRIPTORS$4 = descriptors;
|
|
1073
|
-
var uncurryThis$
|
|
1074
|
-
var call$
|
|
1077
|
+
var uncurryThis$j = functionUncurryThis;
|
|
1078
|
+
var call$f = functionCall;
|
|
1075
1079
|
var fails$h = fails$q;
|
|
1076
1080
|
var objectKeys$1 = objectKeys$2;
|
|
1077
1081
|
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
@@ -1083,7 +1087,7 @@ var IndexedObject$1 = indexedObject;
|
|
|
1083
1087
|
var $assign = Object.assign;
|
|
1084
1088
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1085
1089
|
var defineProperty$4 = Object.defineProperty;
|
|
1086
|
-
var concat$1 = uncurryThis$
|
|
1090
|
+
var concat$1 = uncurryThis$j([].concat);
|
|
1087
1091
|
|
|
1088
1092
|
// `Object.assign` method
|
|
1089
1093
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
@@ -1121,18 +1125,18 @@ var objectAssign = !$assign || fails$h(function () {
|
|
|
1121
1125
|
var key;
|
|
1122
1126
|
while (length > j) {
|
|
1123
1127
|
key = keys[j++];
|
|
1124
|
-
if (!DESCRIPTORS$4 || call$
|
|
1128
|
+
if (!DESCRIPTORS$4 || call$f(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1125
1129
|
}
|
|
1126
1130
|
} return T;
|
|
1127
1131
|
} : $assign;
|
|
1128
1132
|
|
|
1129
|
-
var $$
|
|
1133
|
+
var $$k = _export;
|
|
1130
1134
|
var assign = objectAssign;
|
|
1131
1135
|
|
|
1132
1136
|
// `Object.assign` method
|
|
1133
1137
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
1134
1138
|
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1135
|
-
$$
|
|
1139
|
+
$$k({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1136
1140
|
assign: assign
|
|
1137
1141
|
});
|
|
1138
1142
|
|
|
@@ -1178,7 +1182,7 @@ var toObject$4 = toObject$7;
|
|
|
1178
1182
|
var IndexedObject = indexedObject;
|
|
1179
1183
|
var lengthOfArrayLike$5 = lengthOfArrayLike$7;
|
|
1180
1184
|
|
|
1181
|
-
var $TypeError$
|
|
1185
|
+
var $TypeError$c = TypeError;
|
|
1182
1186
|
|
|
1183
1187
|
// `Array.prototype.{ reduce, reduceRight }` methods implementation
|
|
1184
1188
|
var createMethod$2 = function (IS_RIGHT) {
|
|
@@ -1197,7 +1201,7 @@ var createMethod$2 = function (IS_RIGHT) {
|
|
|
1197
1201
|
}
|
|
1198
1202
|
index += i;
|
|
1199
1203
|
if (IS_RIGHT ? index < 0 : length <= index) {
|
|
1200
|
-
throw $TypeError$
|
|
1204
|
+
throw $TypeError$c('Reduce of empty array with no initial value');
|
|
1201
1205
|
}
|
|
1202
1206
|
}
|
|
1203
1207
|
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
|
@@ -1231,7 +1235,7 @@ var global$f = global$p;
|
|
|
1231
1235
|
|
|
1232
1236
|
var engineIsNode = classof$7(global$f.process) == 'process';
|
|
1233
1237
|
|
|
1234
|
-
var $$
|
|
1238
|
+
var $$j = _export;
|
|
1235
1239
|
var $reduce = arrayReduce.left;
|
|
1236
1240
|
var arrayMethodIsStrict$1 = arrayMethodIsStrict$2;
|
|
1237
1241
|
var CHROME_VERSION = engineV8Version;
|
|
@@ -1244,7 +1248,7 @@ var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
|
|
1244
1248
|
|
|
1245
1249
|
// `Array.prototype.reduce` method
|
|
1246
1250
|
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
1247
|
-
$$
|
|
1251
|
+
$$j({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
|
|
1248
1252
|
reduce: function reduce(callbackfn /* , initialValue */) {
|
|
1249
1253
|
var length = arguments.length;
|
|
1250
1254
|
return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
|
@@ -1371,11 +1375,11 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
1371
1375
|
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
1372
1376
|
};
|
|
1373
1377
|
|
|
1374
|
-
var wellKnownSymbol$
|
|
1378
|
+
var wellKnownSymbol$i = wellKnownSymbol$k;
|
|
1375
1379
|
var create$2 = objectCreate;
|
|
1376
1380
|
var defineProperty$3 = objectDefineProperty.f;
|
|
1377
1381
|
|
|
1378
|
-
var UNSCOPABLES = wellKnownSymbol$
|
|
1382
|
+
var UNSCOPABLES = wellKnownSymbol$i('unscopables');
|
|
1379
1383
|
var ArrayPrototype$1 = Array.prototype;
|
|
1380
1384
|
|
|
1381
1385
|
// Array.prototype[@@unscopables]
|
|
@@ -1404,7 +1408,7 @@ var correctPrototypeGetter = !fails$f(function () {
|
|
|
1404
1408
|
});
|
|
1405
1409
|
|
|
1406
1410
|
var hasOwn$4 = hasOwnProperty_1;
|
|
1407
|
-
var isCallable$
|
|
1411
|
+
var isCallable$d = isCallable$o;
|
|
1408
1412
|
var toObject$3 = toObject$7;
|
|
1409
1413
|
var sharedKey = sharedKey$3;
|
|
1410
1414
|
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
@@ -1420,19 +1424,19 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
|
|
|
1420
1424
|
var object = toObject$3(O);
|
|
1421
1425
|
if (hasOwn$4(object, IE_PROTO)) return object[IE_PROTO];
|
|
1422
1426
|
var constructor = object.constructor;
|
|
1423
|
-
if (isCallable$
|
|
1427
|
+
if (isCallable$d(constructor) && object instanceof constructor) {
|
|
1424
1428
|
return constructor.prototype;
|
|
1425
1429
|
} return object instanceof $Object$1 ? ObjectPrototype : null;
|
|
1426
1430
|
};
|
|
1427
1431
|
|
|
1428
1432
|
var fails$e = fails$q;
|
|
1429
|
-
var isCallable$
|
|
1433
|
+
var isCallable$c = isCallable$o;
|
|
1430
1434
|
var isObject$4 = isObject$a;
|
|
1431
1435
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1432
1436
|
var defineBuiltIn$5 = defineBuiltIn$7;
|
|
1433
|
-
var wellKnownSymbol$
|
|
1437
|
+
var wellKnownSymbol$h = wellKnownSymbol$k;
|
|
1434
1438
|
|
|
1435
|
-
var ITERATOR$7 = wellKnownSymbol$
|
|
1439
|
+
var ITERATOR$7 = wellKnownSymbol$h('iterator');
|
|
1436
1440
|
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1437
1441
|
|
|
1438
1442
|
// `%IteratorPrototype%` object
|
|
@@ -1460,7 +1464,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
|
1460
1464
|
|
|
1461
1465
|
// `%IteratorPrototype%[@@iterator]()` method
|
|
1462
1466
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1463
|
-
if (!isCallable$
|
|
1467
|
+
if (!isCallable$c(IteratorPrototype$2[ITERATOR$7])) {
|
|
1464
1468
|
defineBuiltIn$5(IteratorPrototype$2, ITERATOR$7, function () {
|
|
1465
1469
|
return this;
|
|
1466
1470
|
});
|
|
@@ -1473,9 +1477,9 @@ var iteratorsCore = {
|
|
|
1473
1477
|
|
|
1474
1478
|
var defineProperty$2 = objectDefineProperty.f;
|
|
1475
1479
|
var hasOwn$3 = hasOwnProperty_1;
|
|
1476
|
-
var wellKnownSymbol$
|
|
1480
|
+
var wellKnownSymbol$g = wellKnownSymbol$k;
|
|
1477
1481
|
|
|
1478
|
-
var TO_STRING_TAG$3 = wellKnownSymbol$
|
|
1482
|
+
var TO_STRING_TAG$3 = wellKnownSymbol$g('toStringTag');
|
|
1479
1483
|
|
|
1480
1484
|
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1481
1485
|
if (target && !STATIC) target = target.prototype;
|
|
@@ -1500,19 +1504,19 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
|
|
|
1500
1504
|
return IteratorConstructor;
|
|
1501
1505
|
};
|
|
1502
1506
|
|
|
1503
|
-
var isCallable$
|
|
1507
|
+
var isCallable$b = isCallable$o;
|
|
1504
1508
|
|
|
1505
1509
|
var $String$2 = String;
|
|
1506
|
-
var $TypeError$
|
|
1510
|
+
var $TypeError$b = TypeError;
|
|
1507
1511
|
|
|
1508
1512
|
var aPossiblePrototype$1 = function (argument) {
|
|
1509
|
-
if (typeof argument == 'object' || isCallable$
|
|
1510
|
-
throw $TypeError$
|
|
1513
|
+
if (typeof argument == 'object' || isCallable$b(argument)) return argument;
|
|
1514
|
+
throw $TypeError$b("Can't set " + $String$2(argument) + ' as a prototype');
|
|
1511
1515
|
};
|
|
1512
1516
|
|
|
1513
1517
|
/* eslint-disable no-proto -- safe */
|
|
1514
1518
|
|
|
1515
|
-
var uncurryThis$
|
|
1519
|
+
var uncurryThis$i = functionUncurryThis;
|
|
1516
1520
|
var anObject$a = anObject$f;
|
|
1517
1521
|
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1518
1522
|
|
|
@@ -1526,7 +1530,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1526
1530
|
var setter;
|
|
1527
1531
|
try {
|
|
1528
1532
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1529
|
-
setter = uncurryThis$
|
|
1533
|
+
setter = uncurryThis$i(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1530
1534
|
setter(test, []);
|
|
1531
1535
|
CORRECT_SETTER = test instanceof Array;
|
|
1532
1536
|
} catch (error) { /* empty */ }
|
|
@@ -1539,17 +1543,17 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1539
1543
|
};
|
|
1540
1544
|
}() : undefined);
|
|
1541
1545
|
|
|
1542
|
-
var $$
|
|
1543
|
-
var call$
|
|
1546
|
+
var $$i = _export;
|
|
1547
|
+
var call$e = functionCall;
|
|
1544
1548
|
var FunctionName = functionName;
|
|
1545
|
-
var isCallable$
|
|
1549
|
+
var isCallable$a = isCallable$o;
|
|
1546
1550
|
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1547
1551
|
var getPrototypeOf = objectGetPrototypeOf;
|
|
1548
1552
|
var setPrototypeOf$1 = objectSetPrototypeOf;
|
|
1549
1553
|
var setToStringTag$1 = setToStringTag$3;
|
|
1550
1554
|
var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
|
|
1551
1555
|
var defineBuiltIn$4 = defineBuiltIn$7;
|
|
1552
|
-
var wellKnownSymbol$
|
|
1556
|
+
var wellKnownSymbol$f = wellKnownSymbol$k;
|
|
1553
1557
|
var Iterators$3 = iterators;
|
|
1554
1558
|
var IteratorsCore = iteratorsCore;
|
|
1555
1559
|
|
|
@@ -1557,7 +1561,7 @@ var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
|
|
|
1557
1561
|
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1558
1562
|
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1559
1563
|
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1560
|
-
var ITERATOR$6 = wellKnownSymbol$
|
|
1564
|
+
var ITERATOR$6 = wellKnownSymbol$f('iterator');
|
|
1561
1565
|
var KEYS = 'keys';
|
|
1562
1566
|
var VALUES = 'values';
|
|
1563
1567
|
var ENTRIES = 'entries';
|
|
@@ -1594,7 +1598,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1594
1598
|
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1595
1599
|
if (setPrototypeOf$1) {
|
|
1596
1600
|
setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
|
|
1597
|
-
} else if (!isCallable$
|
|
1601
|
+
} else if (!isCallable$a(CurrentIteratorPrototype[ITERATOR$6])) {
|
|
1598
1602
|
defineBuiltIn$4(CurrentIteratorPrototype, ITERATOR$6, returnThis);
|
|
1599
1603
|
}
|
|
1600
1604
|
}
|
|
@@ -1609,7 +1613,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1609
1613
|
createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
|
|
1610
1614
|
} else {
|
|
1611
1615
|
INCORRECT_VALUES_NAME = true;
|
|
1612
|
-
defaultIterator = function values() { return call$
|
|
1616
|
+
defaultIterator = function values() { return call$e(nativeIterator, this); };
|
|
1613
1617
|
}
|
|
1614
1618
|
}
|
|
1615
1619
|
|
|
@@ -1624,7 +1628,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1624
1628
|
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1625
1629
|
defineBuiltIn$4(IterablePrototype, KEY, methods[KEY]);
|
|
1626
1630
|
}
|
|
1627
|
-
} else $$
|
|
1631
|
+
} else $$i({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1628
1632
|
}
|
|
1629
1633
|
|
|
1630
1634
|
// define iterator
|
|
@@ -1752,10 +1756,10 @@ var DOMIterables = domIterables;
|
|
|
1752
1756
|
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1753
1757
|
var ArrayIteratorMethods = es_array_iterator;
|
|
1754
1758
|
var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
|
|
1755
|
-
var wellKnownSymbol$
|
|
1759
|
+
var wellKnownSymbol$e = wellKnownSymbol$k;
|
|
1756
1760
|
|
|
1757
|
-
var ITERATOR$5 = wellKnownSymbol$
|
|
1758
|
-
var TO_STRING_TAG$2 = wellKnownSymbol$
|
|
1761
|
+
var ITERATOR$5 = wellKnownSymbol$e('iterator');
|
|
1762
|
+
var TO_STRING_TAG$2 = wellKnownSymbol$e('toStringTag');
|
|
1759
1763
|
var ArrayValues = ArrayIteratorMethods.values;
|
|
1760
1764
|
|
|
1761
1765
|
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
@@ -1874,6 +1878,18 @@ const createCodedErrors = err => {
|
|
|
1874
1878
|
message: err.message
|
|
1875
1879
|
}];
|
|
1876
1880
|
};
|
|
1881
|
+
/**
|
|
1882
|
+
* Joins a list of error-like object's messages and throws them as a single error.
|
|
1883
|
+
*/
|
|
1884
|
+
function throwJoinedMessages(errors) {
|
|
1885
|
+
throw new Error(errors.map(e => e.message).join(", "));
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* If any CodedErrors exist, throw them all as a single error, otherwise assert errors is null.
|
|
1889
|
+
*/
|
|
1890
|
+
function throwAny(errors) {
|
|
1891
|
+
if (errors) throwJoinedMessages(errors);
|
|
1892
|
+
}
|
|
1877
1893
|
|
|
1878
1894
|
/**
|
|
1879
1895
|
* @description
|
|
@@ -1911,9 +1927,9 @@ const formLogger = {
|
|
|
1911
1927
|
})
|
|
1912
1928
|
};
|
|
1913
1929
|
|
|
1914
|
-
var wellKnownSymbol$
|
|
1930
|
+
var wellKnownSymbol$d = wellKnownSymbol$k;
|
|
1915
1931
|
|
|
1916
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$
|
|
1932
|
+
var TO_STRING_TAG$1 = wellKnownSymbol$d('toStringTag');
|
|
1917
1933
|
var test$1 = {};
|
|
1918
1934
|
|
|
1919
1935
|
test$1[TO_STRING_TAG$1] = 'z';
|
|
@@ -1921,11 +1937,11 @@ test$1[TO_STRING_TAG$1] = 'z';
|
|
|
1921
1937
|
var toStringTagSupport = String(test$1) === '[object z]';
|
|
1922
1938
|
|
|
1923
1939
|
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1924
|
-
var isCallable$
|
|
1940
|
+
var isCallable$9 = isCallable$o;
|
|
1925
1941
|
var classofRaw$1 = classofRaw$2;
|
|
1926
|
-
var wellKnownSymbol$
|
|
1942
|
+
var wellKnownSymbol$c = wellKnownSymbol$k;
|
|
1927
1943
|
|
|
1928
|
-
var TO_STRING_TAG = wellKnownSymbol$
|
|
1944
|
+
var TO_STRING_TAG = wellKnownSymbol$c('toStringTag');
|
|
1929
1945
|
var $Object = Object;
|
|
1930
1946
|
|
|
1931
1947
|
// ES3 wrong here
|
|
@@ -1947,14 +1963,14 @@ var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
|
|
|
1947
1963
|
// builtinTag case
|
|
1948
1964
|
: CORRECT_ARGUMENTS ? classofRaw$1(O)
|
|
1949
1965
|
// ES3 arguments fallback
|
|
1950
|
-
: (result = classofRaw$1(O)) == 'Object' && isCallable$
|
|
1966
|
+
: (result = classofRaw$1(O)) == 'Object' && isCallable$9(O.callee) ? 'Arguments' : result;
|
|
1951
1967
|
};
|
|
1952
1968
|
|
|
1953
1969
|
var classof$5 = classof$6;
|
|
1954
1970
|
|
|
1955
1971
|
var $String$1 = String;
|
|
1956
1972
|
|
|
1957
|
-
var toString$
|
|
1973
|
+
var toString$c = function (argument) {
|
|
1958
1974
|
if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
1959
1975
|
return $String$1(argument);
|
|
1960
1976
|
};
|
|
@@ -1963,12 +1979,12 @@ var toString$b = function (argument) {
|
|
|
1963
1979
|
var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
1964
1980
|
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
1965
1981
|
|
|
1966
|
-
var uncurryThis$
|
|
1967
|
-
var requireObjectCoercible$
|
|
1968
|
-
var toString$
|
|
1982
|
+
var uncurryThis$h = functionUncurryThis;
|
|
1983
|
+
var requireObjectCoercible$6 = requireObjectCoercible$9;
|
|
1984
|
+
var toString$b = toString$c;
|
|
1969
1985
|
var whitespaces$3 = whitespaces$4;
|
|
1970
1986
|
|
|
1971
|
-
var replace$3 = uncurryThis$
|
|
1987
|
+
var replace$3 = uncurryThis$h(''.replace);
|
|
1972
1988
|
var whitespace = '[' + whitespaces$3 + ']';
|
|
1973
1989
|
var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
|
1974
1990
|
var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
@@ -1976,7 +1992,7 @@ var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
|
1976
1992
|
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
1977
1993
|
var createMethod$1 = function (TYPE) {
|
|
1978
1994
|
return function ($this) {
|
|
1979
|
-
var string = toString$
|
|
1995
|
+
var string = toString$b(requireObjectCoercible$6($this));
|
|
1980
1996
|
if (TYPE & 1) string = replace$3(string, ltrim, '');
|
|
1981
1997
|
if (TYPE & 2) string = replace$3(string, rtrim, '');
|
|
1982
1998
|
return string;
|
|
@@ -2011,13 +2027,13 @@ var stringTrimForced = function (METHOD_NAME) {
|
|
|
2011
2027
|
});
|
|
2012
2028
|
};
|
|
2013
2029
|
|
|
2014
|
-
var $$
|
|
2030
|
+
var $$h = _export;
|
|
2015
2031
|
var $trim = stringTrim.trim;
|
|
2016
2032
|
var forcedStringTrimMethod = stringTrimForced;
|
|
2017
2033
|
|
|
2018
2034
|
// `String.prototype.trim` method
|
|
2019
2035
|
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
2020
|
-
$$
|
|
2036
|
+
$$h({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
|
2021
2037
|
trim: function trim() {
|
|
2022
2038
|
return $trim(this);
|
|
2023
2039
|
}
|
|
@@ -2097,9 +2113,9 @@ var regexpUnsupportedNcg = fails$a(function () {
|
|
|
2097
2113
|
|
|
2098
2114
|
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
2099
2115
|
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
2100
|
-
var call$
|
|
2101
|
-
var uncurryThis$
|
|
2102
|
-
var toString$
|
|
2116
|
+
var call$d = functionCall;
|
|
2117
|
+
var uncurryThis$g = functionUncurryThis;
|
|
2118
|
+
var toString$a = toString$c;
|
|
2103
2119
|
var regexpFlags = regexpFlags$1;
|
|
2104
2120
|
var stickyHelpers = regexpStickyHelpers;
|
|
2105
2121
|
var shared = shared$4.exports;
|
|
@@ -2111,16 +2127,16 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
|
2111
2127
|
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
2112
2128
|
var nativeExec = RegExp.prototype.exec;
|
|
2113
2129
|
var patchedExec = nativeExec;
|
|
2114
|
-
var charAt$4 = uncurryThis$
|
|
2115
|
-
var indexOf = uncurryThis$
|
|
2116
|
-
var replace$2 = uncurryThis$
|
|
2117
|
-
var stringSlice$
|
|
2130
|
+
var charAt$4 = uncurryThis$g(''.charAt);
|
|
2131
|
+
var indexOf$1 = uncurryThis$g(''.indexOf);
|
|
2132
|
+
var replace$2 = uncurryThis$g(''.replace);
|
|
2133
|
+
var stringSlice$6 = uncurryThis$g(''.slice);
|
|
2118
2134
|
|
|
2119
2135
|
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
2120
2136
|
var re1 = /a/;
|
|
2121
2137
|
var re2 = /b*/g;
|
|
2122
|
-
call$
|
|
2123
|
-
call$
|
|
2138
|
+
call$d(nativeExec, re1, 'a');
|
|
2139
|
+
call$d(nativeExec, re2, 'a');
|
|
2124
2140
|
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
2125
2141
|
})();
|
|
2126
2142
|
|
|
@@ -2135,31 +2151,31 @@ if (PATCH) {
|
|
|
2135
2151
|
patchedExec = function exec(string) {
|
|
2136
2152
|
var re = this;
|
|
2137
2153
|
var state = getInternalState(re);
|
|
2138
|
-
var str = toString$
|
|
2154
|
+
var str = toString$a(string);
|
|
2139
2155
|
var raw = state.raw;
|
|
2140
2156
|
var result, reCopy, lastIndex, match, i, object, group;
|
|
2141
2157
|
|
|
2142
2158
|
if (raw) {
|
|
2143
2159
|
raw.lastIndex = re.lastIndex;
|
|
2144
|
-
result = call$
|
|
2160
|
+
result = call$d(patchedExec, raw, str);
|
|
2145
2161
|
re.lastIndex = raw.lastIndex;
|
|
2146
2162
|
return result;
|
|
2147
2163
|
}
|
|
2148
2164
|
|
|
2149
2165
|
var groups = state.groups;
|
|
2150
2166
|
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
2151
|
-
var flags = call$
|
|
2167
|
+
var flags = call$d(regexpFlags, re);
|
|
2152
2168
|
var source = re.source;
|
|
2153
2169
|
var charsAdded = 0;
|
|
2154
2170
|
var strCopy = str;
|
|
2155
2171
|
|
|
2156
2172
|
if (sticky) {
|
|
2157
2173
|
flags = replace$2(flags, 'y', '');
|
|
2158
|
-
if (indexOf(flags, 'g') === -1) {
|
|
2174
|
+
if (indexOf$1(flags, 'g') === -1) {
|
|
2159
2175
|
flags += 'g';
|
|
2160
2176
|
}
|
|
2161
2177
|
|
|
2162
|
-
strCopy = stringSlice$
|
|
2178
|
+
strCopy = stringSlice$6(str, re.lastIndex);
|
|
2163
2179
|
// Support anchored sticky behavior.
|
|
2164
2180
|
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
|
|
2165
2181
|
source = '(?: ' + source + ')';
|
|
@@ -2176,12 +2192,12 @@ if (PATCH) {
|
|
|
2176
2192
|
}
|
|
2177
2193
|
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
2178
2194
|
|
|
2179
|
-
match = call$
|
|
2195
|
+
match = call$d(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2180
2196
|
|
|
2181
2197
|
if (sticky) {
|
|
2182
2198
|
if (match) {
|
|
2183
|
-
match.input = stringSlice$
|
|
2184
|
-
match[0] = stringSlice$
|
|
2199
|
+
match.input = stringSlice$6(match.input, charsAdded);
|
|
2200
|
+
match[0] = stringSlice$6(match[0], charsAdded);
|
|
2185
2201
|
match.index = re.lastIndex;
|
|
2186
2202
|
re.lastIndex += match[0].length;
|
|
2187
2203
|
} else re.lastIndex = 0;
|
|
@@ -2191,7 +2207,7 @@ if (PATCH) {
|
|
|
2191
2207
|
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
2192
2208
|
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
2193
2209
|
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
2194
|
-
call$
|
|
2210
|
+
call$d(nativeReplace, match[0], reCopy, function () {
|
|
2195
2211
|
for (i = 1; i < arguments.length - 2; i++) {
|
|
2196
2212
|
if (arguments[i] === undefined) match[i] = undefined;
|
|
2197
2213
|
}
|
|
@@ -2212,12 +2228,12 @@ if (PATCH) {
|
|
|
2212
2228
|
|
|
2213
2229
|
var regexpExec$2 = patchedExec;
|
|
2214
2230
|
|
|
2215
|
-
var $$
|
|
2231
|
+
var $$g = _export;
|
|
2216
2232
|
var exec$2 = regexpExec$2;
|
|
2217
2233
|
|
|
2218
2234
|
// `RegExp.prototype.exec` method
|
|
2219
2235
|
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
2220
|
-
$$
|
|
2236
|
+
$$g({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
|
|
2221
2237
|
exec: exec$2
|
|
2222
2238
|
});
|
|
2223
2239
|
|
|
@@ -2225,37 +2241,37 @@ var NATIVE_BIND$1 = functionBindNative;
|
|
|
2225
2241
|
|
|
2226
2242
|
var FunctionPrototype = Function.prototype;
|
|
2227
2243
|
var apply$2 = FunctionPrototype.apply;
|
|
2228
|
-
var call$
|
|
2244
|
+
var call$c = FunctionPrototype.call;
|
|
2229
2245
|
|
|
2230
2246
|
// eslint-disable-next-line es/no-reflect -- safe
|
|
2231
|
-
var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$
|
|
2232
|
-
return call$
|
|
2247
|
+
var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$c.bind(apply$2) : function () {
|
|
2248
|
+
return call$c.apply(apply$2, arguments);
|
|
2233
2249
|
});
|
|
2234
2250
|
|
|
2235
2251
|
var classofRaw = classofRaw$2;
|
|
2236
|
-
var uncurryThis$
|
|
2252
|
+
var uncurryThis$f = functionUncurryThis;
|
|
2237
2253
|
|
|
2238
2254
|
var functionUncurryThisClause = function (fn) {
|
|
2239
2255
|
// Nashorn bug:
|
|
2240
2256
|
// https://github.com/zloirock/core-js/issues/1128
|
|
2241
2257
|
// https://github.com/zloirock/core-js/issues/1130
|
|
2242
|
-
if (classofRaw(fn) === 'Function') return uncurryThis$
|
|
2258
|
+
if (classofRaw(fn) === 'Function') return uncurryThis$f(fn);
|
|
2243
2259
|
};
|
|
2244
2260
|
|
|
2245
2261
|
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
2246
2262
|
|
|
2247
|
-
var uncurryThis$
|
|
2263
|
+
var uncurryThis$e = functionUncurryThisClause;
|
|
2248
2264
|
var defineBuiltIn$3 = defineBuiltIn$7;
|
|
2249
2265
|
var regexpExec$1 = regexpExec$2;
|
|
2250
2266
|
var fails$9 = fails$q;
|
|
2251
|
-
var wellKnownSymbol$
|
|
2267
|
+
var wellKnownSymbol$b = wellKnownSymbol$k;
|
|
2252
2268
|
var createNonEnumerableProperty = createNonEnumerableProperty$5;
|
|
2253
2269
|
|
|
2254
|
-
var SPECIES$4 = wellKnownSymbol$
|
|
2270
|
+
var SPECIES$4 = wellKnownSymbol$b('species');
|
|
2255
2271
|
var RegExpPrototype$2 = RegExp.prototype;
|
|
2256
2272
|
|
|
2257
2273
|
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
2258
|
-
var SYMBOL = wellKnownSymbol$
|
|
2274
|
+
var SYMBOL = wellKnownSymbol$b(KEY);
|
|
2259
2275
|
|
|
2260
2276
|
var DELEGATES_TO_SYMBOL = !fails$9(function () {
|
|
2261
2277
|
// String methods call symbol-named RegEp methods
|
|
@@ -2293,9 +2309,9 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
|
2293
2309
|
!DELEGATES_TO_EXEC ||
|
|
2294
2310
|
FORCED
|
|
2295
2311
|
) {
|
|
2296
|
-
var uncurriedNativeRegExpMethod = uncurryThis$
|
|
2312
|
+
var uncurriedNativeRegExpMethod = uncurryThis$e(/./[SYMBOL]);
|
|
2297
2313
|
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
2298
|
-
var uncurriedNativeMethod = uncurryThis$
|
|
2314
|
+
var uncurriedNativeMethod = uncurryThis$e(nativeMethod);
|
|
2299
2315
|
var $exec = regexp.exec;
|
|
2300
2316
|
if ($exec === regexpExec$1 || $exec === RegExpPrototype$2.exec) {
|
|
2301
2317
|
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
@@ -2316,18 +2332,18 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
|
2316
2332
|
if (SHAM) createNonEnumerableProperty(RegExpPrototype$2[SYMBOL], 'sham', true);
|
|
2317
2333
|
};
|
|
2318
2334
|
|
|
2319
|
-
var uncurryThis$
|
|
2335
|
+
var uncurryThis$d = functionUncurryThis;
|
|
2320
2336
|
var toIntegerOrInfinity$3 = toIntegerOrInfinity$6;
|
|
2321
|
-
var toString$
|
|
2322
|
-
var requireObjectCoercible$
|
|
2337
|
+
var toString$9 = toString$c;
|
|
2338
|
+
var requireObjectCoercible$5 = requireObjectCoercible$9;
|
|
2323
2339
|
|
|
2324
|
-
var charAt$3 = uncurryThis$
|
|
2325
|
-
var charCodeAt = uncurryThis$
|
|
2326
|
-
var stringSlice$
|
|
2340
|
+
var charAt$3 = uncurryThis$d(''.charAt);
|
|
2341
|
+
var charCodeAt = uncurryThis$d(''.charCodeAt);
|
|
2342
|
+
var stringSlice$5 = uncurryThis$d(''.slice);
|
|
2327
2343
|
|
|
2328
2344
|
var createMethod = function (CONVERT_TO_STRING) {
|
|
2329
2345
|
return function ($this, pos) {
|
|
2330
|
-
var S = toString$
|
|
2346
|
+
var S = toString$9(requireObjectCoercible$5($this));
|
|
2331
2347
|
var position = toIntegerOrInfinity$3(pos);
|
|
2332
2348
|
var size = S.length;
|
|
2333
2349
|
var first, second;
|
|
@@ -2339,7 +2355,7 @@ var createMethod = function (CONVERT_TO_STRING) {
|
|
|
2339
2355
|
? charAt$3(S, position)
|
|
2340
2356
|
: first
|
|
2341
2357
|
: CONVERT_TO_STRING
|
|
2342
|
-
? stringSlice$
|
|
2358
|
+
? stringSlice$5(S, position, position + 2)
|
|
2343
2359
|
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
2344
2360
|
};
|
|
2345
2361
|
};
|
|
@@ -2361,19 +2377,19 @@ var advanceStringIndex$2 = function (S, index, unicode) {
|
|
|
2361
2377
|
return index + (unicode ? charAt$2(S, index).length : 1);
|
|
2362
2378
|
};
|
|
2363
2379
|
|
|
2364
|
-
var uncurryThis$
|
|
2380
|
+
var uncurryThis$c = functionUncurryThis;
|
|
2365
2381
|
var toObject$2 = toObject$7;
|
|
2366
2382
|
|
|
2367
2383
|
var floor$2 = Math.floor;
|
|
2368
|
-
var charAt$1 = uncurryThis$
|
|
2369
|
-
var replace$1 = uncurryThis$
|
|
2370
|
-
var stringSlice$
|
|
2384
|
+
var charAt$1 = uncurryThis$c(''.charAt);
|
|
2385
|
+
var replace$1 = uncurryThis$c(''.replace);
|
|
2386
|
+
var stringSlice$4 = uncurryThis$c(''.slice);
|
|
2371
2387
|
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
2372
2388
|
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
2373
2389
|
|
|
2374
2390
|
// `GetSubstitution` abstract operation
|
|
2375
2391
|
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
2376
|
-
var getSubstitution$
|
|
2392
|
+
var getSubstitution$2 = function (matched, str, position, captures, namedCaptures, replacement) {
|
|
2377
2393
|
var tailPos = position + matched.length;
|
|
2378
2394
|
var m = captures.length;
|
|
2379
2395
|
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
@@ -2386,10 +2402,10 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
|
|
|
2386
2402
|
switch (charAt$1(ch, 0)) {
|
|
2387
2403
|
case '$': return '$';
|
|
2388
2404
|
case '&': return matched;
|
|
2389
|
-
case '`': return stringSlice$
|
|
2390
|
-
case "'": return stringSlice$
|
|
2405
|
+
case '`': return stringSlice$4(str, 0, position);
|
|
2406
|
+
case "'": return stringSlice$4(str, tailPos);
|
|
2391
2407
|
case '<':
|
|
2392
|
-
capture = namedCaptures[stringSlice$
|
|
2408
|
+
capture = namedCaptures[stringSlice$4(ch, 1, -1)];
|
|
2393
2409
|
break;
|
|
2394
2410
|
default: // \d\d?
|
|
2395
2411
|
var n = +ch;
|
|
@@ -2406,52 +2422,52 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
|
|
|
2406
2422
|
});
|
|
2407
2423
|
};
|
|
2408
2424
|
|
|
2409
|
-
var call$
|
|
2425
|
+
var call$b = functionCall;
|
|
2410
2426
|
var anObject$8 = anObject$f;
|
|
2411
|
-
var isCallable$
|
|
2427
|
+
var isCallable$8 = isCallable$o;
|
|
2412
2428
|
var classof$4 = classofRaw$2;
|
|
2413
2429
|
var regexpExec = regexpExec$2;
|
|
2414
2430
|
|
|
2415
|
-
var $TypeError$
|
|
2431
|
+
var $TypeError$a = TypeError;
|
|
2416
2432
|
|
|
2417
2433
|
// `RegExpExec` abstract operation
|
|
2418
2434
|
// https://tc39.es/ecma262/#sec-regexpexec
|
|
2419
2435
|
var regexpExecAbstract = function (R, S) {
|
|
2420
2436
|
var exec = R.exec;
|
|
2421
|
-
if (isCallable$
|
|
2422
|
-
var result = call$
|
|
2437
|
+
if (isCallable$8(exec)) {
|
|
2438
|
+
var result = call$b(exec, R, S);
|
|
2423
2439
|
if (result !== null) anObject$8(result);
|
|
2424
2440
|
return result;
|
|
2425
2441
|
}
|
|
2426
|
-
if (classof$4(R) === 'RegExp') return call$
|
|
2427
|
-
throw $TypeError$
|
|
2442
|
+
if (classof$4(R) === 'RegExp') return call$b(regexpExec, R, S);
|
|
2443
|
+
throw $TypeError$a('RegExp#exec called on incompatible receiver');
|
|
2428
2444
|
};
|
|
2429
2445
|
|
|
2430
2446
|
var apply$1 = functionApply;
|
|
2431
|
-
var call$
|
|
2432
|
-
var uncurryThis$
|
|
2447
|
+
var call$a = functionCall;
|
|
2448
|
+
var uncurryThis$b = functionUncurryThis;
|
|
2433
2449
|
var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
|
|
2434
2450
|
var fails$8 = fails$q;
|
|
2435
2451
|
var anObject$7 = anObject$f;
|
|
2436
|
-
var isCallable$
|
|
2437
|
-
var isNullOrUndefined$
|
|
2452
|
+
var isCallable$7 = isCallable$o;
|
|
2453
|
+
var isNullOrUndefined$4 = isNullOrUndefined$7;
|
|
2438
2454
|
var toIntegerOrInfinity$2 = toIntegerOrInfinity$6;
|
|
2439
2455
|
var toLength$1 = toLength$3;
|
|
2440
|
-
var toString$
|
|
2441
|
-
var requireObjectCoercible$
|
|
2456
|
+
var toString$8 = toString$c;
|
|
2457
|
+
var requireObjectCoercible$4 = requireObjectCoercible$9;
|
|
2442
2458
|
var advanceStringIndex$1 = advanceStringIndex$2;
|
|
2443
|
-
var getMethod$
|
|
2444
|
-
var getSubstitution = getSubstitution$
|
|
2459
|
+
var getMethod$4 = getMethod$6;
|
|
2460
|
+
var getSubstitution$1 = getSubstitution$2;
|
|
2445
2461
|
var regExpExec$1 = regexpExecAbstract;
|
|
2446
|
-
var wellKnownSymbol$
|
|
2462
|
+
var wellKnownSymbol$a = wellKnownSymbol$k;
|
|
2447
2463
|
|
|
2448
|
-
var REPLACE = wellKnownSymbol$
|
|
2449
|
-
var max$
|
|
2464
|
+
var REPLACE$1 = wellKnownSymbol$a('replace');
|
|
2465
|
+
var max$2 = Math.max;
|
|
2450
2466
|
var min = Math.min;
|
|
2451
|
-
var concat = uncurryThis$
|
|
2452
|
-
var push$1 = uncurryThis$
|
|
2453
|
-
var stringIndexOf$
|
|
2454
|
-
var stringSlice$
|
|
2467
|
+
var concat = uncurryThis$b([].concat);
|
|
2468
|
+
var push$1 = uncurryThis$b([].push);
|
|
2469
|
+
var stringIndexOf$2 = uncurryThis$b(''.indexOf);
|
|
2470
|
+
var stringSlice$3 = uncurryThis$b(''.slice);
|
|
2455
2471
|
|
|
2456
2472
|
var maybeToString = function (it) {
|
|
2457
2473
|
return it === undefined ? it : String(it);
|
|
@@ -2466,8 +2482,8 @@ var REPLACE_KEEPS_$0 = (function () {
|
|
|
2466
2482
|
|
|
2467
2483
|
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
2468
2484
|
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
2469
|
-
if (/./[REPLACE]) {
|
|
2470
|
-
return /./[REPLACE]('a', '$0') === '';
|
|
2485
|
+
if (/./[REPLACE$1]) {
|
|
2486
|
+
return /./[REPLACE$1]('a', '$0') === '';
|
|
2471
2487
|
}
|
|
2472
2488
|
return false;
|
|
2473
2489
|
})();
|
|
@@ -2491,29 +2507,29 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
|
|
|
2491
2507
|
// `String.prototype.replace` method
|
|
2492
2508
|
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
|
2493
2509
|
function replace(searchValue, replaceValue) {
|
|
2494
|
-
var O = requireObjectCoercible$
|
|
2495
|
-
var replacer = isNullOrUndefined$
|
|
2510
|
+
var O = requireObjectCoercible$4(this);
|
|
2511
|
+
var replacer = isNullOrUndefined$4(searchValue) ? undefined : getMethod$4(searchValue, REPLACE$1);
|
|
2496
2512
|
return replacer
|
|
2497
|
-
? call$
|
|
2498
|
-
: call$
|
|
2513
|
+
? call$a(replacer, searchValue, O, replaceValue)
|
|
2514
|
+
: call$a(nativeReplace, toString$8(O), searchValue, replaceValue);
|
|
2499
2515
|
},
|
|
2500
2516
|
// `RegExp.prototype[@@replace]` method
|
|
2501
2517
|
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
|
2502
2518
|
function (string, replaceValue) {
|
|
2503
2519
|
var rx = anObject$7(this);
|
|
2504
|
-
var S = toString$
|
|
2520
|
+
var S = toString$8(string);
|
|
2505
2521
|
|
|
2506
2522
|
if (
|
|
2507
2523
|
typeof replaceValue == 'string' &&
|
|
2508
|
-
stringIndexOf$
|
|
2509
|
-
stringIndexOf$
|
|
2524
|
+
stringIndexOf$2(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
|
2525
|
+
stringIndexOf$2(replaceValue, '$<') === -1
|
|
2510
2526
|
) {
|
|
2511
2527
|
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
|
2512
2528
|
if (res.done) return res.value;
|
|
2513
2529
|
}
|
|
2514
2530
|
|
|
2515
|
-
var functionalReplace = isCallable$
|
|
2516
|
-
if (!functionalReplace) replaceValue = toString$
|
|
2531
|
+
var functionalReplace = isCallable$7(replaceValue);
|
|
2532
|
+
if (!functionalReplace) replaceValue = toString$8(replaceValue);
|
|
2517
2533
|
|
|
2518
2534
|
var global = rx.global;
|
|
2519
2535
|
if (global) {
|
|
@@ -2528,7 +2544,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
|
|
|
2528
2544
|
push$1(results, result);
|
|
2529
2545
|
if (!global) break;
|
|
2530
2546
|
|
|
2531
|
-
var matchStr = toString$
|
|
2547
|
+
var matchStr = toString$8(result[0]);
|
|
2532
2548
|
if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
|
|
2533
2549
|
}
|
|
2534
2550
|
|
|
@@ -2537,8 +2553,8 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
|
|
|
2537
2553
|
for (var i = 0; i < results.length; i++) {
|
|
2538
2554
|
result = results[i];
|
|
2539
2555
|
|
|
2540
|
-
var matched = toString$
|
|
2541
|
-
var position = max$
|
|
2556
|
+
var matched = toString$8(result[0]);
|
|
2557
|
+
var position = max$2(min(toIntegerOrInfinity$2(result.index), S.length), 0);
|
|
2542
2558
|
var captures = [];
|
|
2543
2559
|
// NOTE: This is equivalent to
|
|
2544
2560
|
// captures = result.slice(1).map(maybeToString)
|
|
@@ -2550,16 +2566,16 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
|
|
|
2550
2566
|
if (functionalReplace) {
|
|
2551
2567
|
var replacerArgs = concat([matched], captures, position, S);
|
|
2552
2568
|
if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
|
|
2553
|
-
var replacement = toString$
|
|
2569
|
+
var replacement = toString$8(apply$1(replaceValue, undefined, replacerArgs));
|
|
2554
2570
|
} else {
|
|
2555
|
-
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
2571
|
+
replacement = getSubstitution$1(matched, S, position, captures, namedCaptures, replaceValue);
|
|
2556
2572
|
}
|
|
2557
2573
|
if (position >= nextSourcePosition) {
|
|
2558
|
-
accumulatedResult += stringSlice$
|
|
2574
|
+
accumulatedResult += stringSlice$3(S, nextSourcePosition, position) + replacement;
|
|
2559
2575
|
nextSourcePosition = position + matched.length;
|
|
2560
2576
|
}
|
|
2561
2577
|
}
|
|
2562
|
-
return accumulatedResult + stringSlice$
|
|
2578
|
+
return accumulatedResult + stringSlice$3(S, nextSourcePosition);
|
|
2563
2579
|
}
|
|
2564
2580
|
];
|
|
2565
2581
|
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
@@ -2594,10 +2610,15 @@ const formatExpiration = exp => {
|
|
|
2594
2610
|
|
|
2595
2611
|
const isString = x => typeof x === "string";
|
|
2596
2612
|
|
|
2597
|
-
const getRateRequiresAcknowledgement = serviceCode => {
|
|
2613
|
+
const getRateRequiresAcknowledgement = (serviceCode, packageType) => {
|
|
2598
2614
|
switch (serviceCode) {
|
|
2599
2615
|
case "usps_media_mail":
|
|
2600
2616
|
return true;
|
|
2617
|
+
case "usps_first_class_mail":
|
|
2618
|
+
if (packageType === "large_envelope_or_flat") {
|
|
2619
|
+
return true;
|
|
2620
|
+
}
|
|
2621
|
+
return false;
|
|
2601
2622
|
default:
|
|
2602
2623
|
return false;
|
|
2603
2624
|
}
|
|
@@ -2614,16 +2635,18 @@ const hasEuCustomsRules = true,
|
|
|
2614
2635
|
// United States territories that ship domestic but require customs
|
|
2615
2636
|
// https://blog.stamps.com/2015/09/23/how-to-ship-packages-to-u-s-territories/
|
|
2616
2637
|
isUnitedStatesTerritory$1 = true,
|
|
2638
|
+
isUnsupportedByUps$1 = true,
|
|
2617
2639
|
supportsByoa = true;
|
|
2618
2640
|
class Country {
|
|
2619
2641
|
constructor(name, code, rules = {}) {
|
|
2620
|
-
var _a, _b, _c, _d;
|
|
2642
|
+
var _a, _b, _c, _d, _e;
|
|
2621
2643
|
this.name = name;
|
|
2622
2644
|
this.code = code;
|
|
2623
2645
|
this.hasEuCustomsRules = (_a = rules.hasEuCustomsRules) !== null && _a !== void 0 ? _a : false;
|
|
2624
2646
|
this.hasProvinces = (_b = rules.hasProvinces) !== null && _b !== void 0 ? _b : false;
|
|
2625
2647
|
this.isUnitedStatesTerritory = (_c = rules.isUnitedStatesTerritory) !== null && _c !== void 0 ? _c : false;
|
|
2626
2648
|
this.supportsByoa = (_d = rules.supportsByoa) !== null && _d !== void 0 ? _d : false;
|
|
2649
|
+
this.isUnsupportedByUps = (_e = rules.isUnsupportedByUps) !== null && _e !== void 0 ? _e : false;
|
|
2627
2650
|
}
|
|
2628
2651
|
}
|
|
2629
2652
|
const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands", "AX"), new Country("Albania", "AL"), new Country("Algeria", "DZ"), new Country("American Samoa", "AS", {
|
|
@@ -2644,7 +2667,9 @@ const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands"
|
|
|
2644
2667
|
supportsByoa
|
|
2645
2668
|
}), new Country("Burkina Faso", "BF"), new Country("Burundi", "BI"), new Country("Canada", "CA", {
|
|
2646
2669
|
hasProvinces
|
|
2647
|
-
}), new Country("Cambodia", "KH"
|
|
2670
|
+
}), new Country("Cambodia", "KH", {
|
|
2671
|
+
isUnsupportedByUps: isUnsupportedByUps$1
|
|
2672
|
+
}), 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", {
|
|
2648
2673
|
hasEuCustomsRules,
|
|
2649
2674
|
supportsByoa
|
|
2650
2675
|
}), new Country("Cuba", "CU"), new Country("Curacao", "CW"), new Country("Cyprus", "CY", {
|
|
@@ -2705,7 +2730,9 @@ const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands"
|
|
|
2705
2730
|
}), 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", {
|
|
2706
2731
|
hasEuCustomsRules,
|
|
2707
2732
|
supportsByoa
|
|
2708
|
-
}), new Country("Netherlands Antilles", "AN"), new Country("New Caledonia", "NC"
|
|
2733
|
+
}), new Country("Netherlands Antilles", "AN"), new Country("New Caledonia", "NC", {
|
|
2734
|
+
isUnsupportedByUps: isUnsupportedByUps$1
|
|
2735
|
+
}), new Country("New Zealand", "NZ", {
|
|
2709
2736
|
supportsByoa
|
|
2710
2737
|
}), 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", {
|
|
2711
2738
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
@@ -2822,6 +2849,13 @@ const isUnitedStatesTerritory = address => {
|
|
|
2822
2849
|
var _a, _b;
|
|
2823
2850
|
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));
|
|
2824
2851
|
};
|
|
2852
|
+
/**
|
|
2853
|
+
* @category Utilities
|
|
2854
|
+
*/
|
|
2855
|
+
const isUnsupportedByUps = address => {
|
|
2856
|
+
var _a;
|
|
2857
|
+
return !!((_a = countries.find(c => c.code === address.countryCode)) === null || _a === void 0 ? void 0 : _a.isUnsupportedByUps);
|
|
2858
|
+
};
|
|
2825
2859
|
const PO_BOX_REGEX =
|
|
2826
2860
|
// eslint-disable-next-line no-useless-escape
|
|
2827
2861
|
/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i;
|
|
@@ -2834,7 +2868,7 @@ const isPoBox = addressLine => PO_BOX_REGEX.test(addressLine);
|
|
|
2834
2868
|
*/
|
|
2835
2869
|
const isPoBoxAddress = address => !!(isPoBox(address.addressLine1) || address.addressLine2 && isPoBox(address.addressLine2));
|
|
2836
2870
|
|
|
2837
|
-
var $$
|
|
2871
|
+
var $$f = _export;
|
|
2838
2872
|
var $includes = arrayIncludes.includes;
|
|
2839
2873
|
var fails$7 = fails$q;
|
|
2840
2874
|
var addToUnscopables$1 = addToUnscopables$3;
|
|
@@ -2846,7 +2880,7 @@ var BROKEN_ON_SPARSE = fails$7(function () {
|
|
|
2846
2880
|
|
|
2847
2881
|
// `Array.prototype.includes` method
|
|
2848
2882
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
2849
|
-
$$
|
|
2883
|
+
$$f({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
2850
2884
|
includes: function includes(el /* , fromIndex = 0 */) {
|
|
2851
2885
|
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
2852
2886
|
}
|
|
@@ -2857,6 +2891,7 @@ addToUnscopables$1('includes');
|
|
|
2857
2891
|
|
|
2858
2892
|
const USPS_CARRIER_CODES = ["usps", "stamps_com"];
|
|
2859
2893
|
const isUspsCarrier = carrierCode => USPS_CARRIER_CODES.includes(carrierCode);
|
|
2894
|
+
const isUpsCarrier = carrierCode => carrierCode === "ups";
|
|
2860
2895
|
|
|
2861
2896
|
function convertDimensions(dimensions, {
|
|
2862
2897
|
allowAllZeroes
|
|
@@ -2921,10 +2956,10 @@ const getSalesOrderItemsFromSalesOrderOrShipment = ({
|
|
|
2921
2956
|
|
|
2922
2957
|
var tryToString$3 = tryToString$5;
|
|
2923
2958
|
|
|
2924
|
-
var $TypeError$
|
|
2959
|
+
var $TypeError$9 = TypeError;
|
|
2925
2960
|
|
|
2926
2961
|
var deletePropertyOrThrow$1 = function (O, P) {
|
|
2927
|
-
if (!delete O[P]) throw $TypeError$
|
|
2962
|
+
if (!delete O[P]) throw $TypeError$9('Cannot delete property ' + tryToString$3(P) + ' of ' + tryToString$3(O));
|
|
2928
2963
|
};
|
|
2929
2964
|
|
|
2930
2965
|
var toPropertyKey = toPropertyKey$3;
|
|
@@ -2942,13 +2977,13 @@ var lengthOfArrayLike$4 = lengthOfArrayLike$7;
|
|
|
2942
2977
|
var createProperty$1 = createProperty$2;
|
|
2943
2978
|
|
|
2944
2979
|
var $Array$1 = Array;
|
|
2945
|
-
var max = Math.max;
|
|
2980
|
+
var max$1 = Math.max;
|
|
2946
2981
|
|
|
2947
2982
|
var arraySliceSimple = function (O, start, end) {
|
|
2948
2983
|
var length = lengthOfArrayLike$4(O);
|
|
2949
2984
|
var k = toAbsoluteIndex(start, length);
|
|
2950
2985
|
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
2951
|
-
var result = $Array$1(max(fin - k, 0));
|
|
2986
|
+
var result = $Array$1(max$1(fin - k, 0));
|
|
2952
2987
|
for (var n = 0; k < fin; k++, n++) createProperty$1(result, n, O[k]);
|
|
2953
2988
|
result.length = n;
|
|
2954
2989
|
return result;
|
|
@@ -3015,13 +3050,13 @@ var webkit = userAgent$3.match(/AppleWebKit\/(\d+)\./);
|
|
|
3015
3050
|
|
|
3016
3051
|
var engineWebkitVersion = !!webkit && +webkit[1];
|
|
3017
3052
|
|
|
3018
|
-
var $$
|
|
3019
|
-
var uncurryThis$
|
|
3053
|
+
var $$e = _export;
|
|
3054
|
+
var uncurryThis$a = functionUncurryThis;
|
|
3020
3055
|
var aCallable$7 = aCallable$a;
|
|
3021
3056
|
var toObject$1 = toObject$7;
|
|
3022
3057
|
var lengthOfArrayLike$3 = lengthOfArrayLike$7;
|
|
3023
3058
|
var deletePropertyOrThrow = deletePropertyOrThrow$1;
|
|
3024
|
-
var toString$
|
|
3059
|
+
var toString$7 = toString$c;
|
|
3025
3060
|
var fails$6 = fails$q;
|
|
3026
3061
|
var internalSort = arraySort;
|
|
3027
3062
|
var arrayMethodIsStrict = arrayMethodIsStrict$2;
|
|
@@ -3031,8 +3066,8 @@ var V8 = engineV8Version;
|
|
|
3031
3066
|
var WEBKIT = engineWebkitVersion;
|
|
3032
3067
|
|
|
3033
3068
|
var test = [];
|
|
3034
|
-
var nativeSort = uncurryThis$
|
|
3035
|
-
var push = uncurryThis$
|
|
3069
|
+
var nativeSort = uncurryThis$a(test.sort);
|
|
3070
|
+
var push = uncurryThis$a(test.push);
|
|
3036
3071
|
|
|
3037
3072
|
// IE8-
|
|
3038
3073
|
var FAILS_ON_UNDEFINED = fails$6(function () {
|
|
@@ -3087,13 +3122,13 @@ var getSortCompare = function (comparefn) {
|
|
|
3087
3122
|
if (y === undefined) return -1;
|
|
3088
3123
|
if (x === undefined) return 1;
|
|
3089
3124
|
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
|
3090
|
-
return toString$
|
|
3125
|
+
return toString$7(x) > toString$7(y) ? 1 : -1;
|
|
3091
3126
|
};
|
|
3092
3127
|
};
|
|
3093
3128
|
|
|
3094
3129
|
// `Array.prototype.sort` method
|
|
3095
3130
|
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
|
3096
|
-
$$
|
|
3131
|
+
$$e({ target: 'Array', proto: true, forced: FORCED$3 }, {
|
|
3097
3132
|
sort: function sort(comparefn) {
|
|
3098
3133
|
if (comparefn !== undefined) aCallable$7(comparefn);
|
|
3099
3134
|
|
|
@@ -3171,9 +3206,9 @@ function formatFractionalWeight(weight) {
|
|
|
3171
3206
|
|
|
3172
3207
|
var isObject$3 = isObject$a;
|
|
3173
3208
|
var classof$3 = classofRaw$2;
|
|
3174
|
-
var wellKnownSymbol$
|
|
3209
|
+
var wellKnownSymbol$9 = wellKnownSymbol$k;
|
|
3175
3210
|
|
|
3176
|
-
var MATCH$1 = wellKnownSymbol$
|
|
3211
|
+
var MATCH$1 = wellKnownSymbol$9('match');
|
|
3177
3212
|
|
|
3178
3213
|
// `IsRegExp` abstract operation
|
|
3179
3214
|
// https://tc39.es/ecma262/#sec-isregexp
|
|
@@ -3182,19 +3217,19 @@ var isRegexp = function (it) {
|
|
|
3182
3217
|
return isObject$3(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$3(it) == 'RegExp');
|
|
3183
3218
|
};
|
|
3184
3219
|
|
|
3185
|
-
var isRegExp = isRegexp;
|
|
3220
|
+
var isRegExp$1 = isRegexp;
|
|
3186
3221
|
|
|
3187
|
-
var $TypeError$
|
|
3222
|
+
var $TypeError$8 = TypeError;
|
|
3188
3223
|
|
|
3189
3224
|
var notARegexp = function (it) {
|
|
3190
|
-
if (isRegExp(it)) {
|
|
3191
|
-
throw $TypeError$
|
|
3225
|
+
if (isRegExp$1(it)) {
|
|
3226
|
+
throw $TypeError$8("The method doesn't accept regular expressions");
|
|
3192
3227
|
} return it;
|
|
3193
3228
|
};
|
|
3194
3229
|
|
|
3195
|
-
var wellKnownSymbol$
|
|
3230
|
+
var wellKnownSymbol$8 = wellKnownSymbol$k;
|
|
3196
3231
|
|
|
3197
|
-
var MATCH = wellKnownSymbol$
|
|
3232
|
+
var MATCH = wellKnownSymbol$8('match');
|
|
3198
3233
|
|
|
3199
3234
|
var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
3200
3235
|
var regexp = /./;
|
|
@@ -3208,22 +3243,22 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
|
3208
3243
|
} return false;
|
|
3209
3244
|
};
|
|
3210
3245
|
|
|
3211
|
-
var $$
|
|
3212
|
-
var uncurryThis$
|
|
3246
|
+
var $$d = _export;
|
|
3247
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
3213
3248
|
var notARegExp = notARegexp;
|
|
3214
|
-
var requireObjectCoercible$
|
|
3215
|
-
var toString$
|
|
3249
|
+
var requireObjectCoercible$3 = requireObjectCoercible$9;
|
|
3250
|
+
var toString$6 = toString$c;
|
|
3216
3251
|
var correctIsRegExpLogic = correctIsRegexpLogic;
|
|
3217
3252
|
|
|
3218
|
-
var stringIndexOf = uncurryThis$
|
|
3253
|
+
var stringIndexOf$1 = uncurryThis$9(''.indexOf);
|
|
3219
3254
|
|
|
3220
3255
|
// `String.prototype.includes` method
|
|
3221
3256
|
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
3222
|
-
$$
|
|
3257
|
+
$$d({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
|
3223
3258
|
includes: function includes(searchString /* , position = 0 */) {
|
|
3224
|
-
return !!~stringIndexOf(
|
|
3225
|
-
toString$
|
|
3226
|
-
toString$
|
|
3259
|
+
return !!~stringIndexOf$1(
|
|
3260
|
+
toString$6(requireObjectCoercible$3(this)),
|
|
3261
|
+
toString$6(notARegExp(searchString)),
|
|
3227
3262
|
arguments.length > 1 ? arguments[1] : undefined
|
|
3228
3263
|
);
|
|
3229
3264
|
}
|
|
@@ -3542,6 +3577,16 @@ const CheckboxInput = _a => {
|
|
|
3542
3577
|
};
|
|
3543
3578
|
|
|
3544
3579
|
const getOverrideStyles = theme => ({
|
|
3580
|
+
"&& .react-datepicker__aria-live": {
|
|
3581
|
+
// Hide aria alerts that are for screen readers in a way screen readers can still read them
|
|
3582
|
+
clip: "rect(0 0 0 0)",
|
|
3583
|
+
clipPath: "inset(50%)",
|
|
3584
|
+
height: "1px",
|
|
3585
|
+
overflow: "hidden",
|
|
3586
|
+
position: "absolute",
|
|
3587
|
+
whiteSpace: "nowrap",
|
|
3588
|
+
width: "1px"
|
|
3589
|
+
},
|
|
3545
3590
|
"&& input, && span[role='button']": {
|
|
3546
3591
|
cursor: "auto",
|
|
3547
3592
|
fontWeight: theme.typography.fontWeight.normal
|
|
@@ -3589,6 +3634,130 @@ const CreditCardInput = fieldProps => jsxRuntime.jsx(CreditCardInputController,
|
|
|
3589
3634
|
}
|
|
3590
3635
|
}));
|
|
3591
3636
|
|
|
3637
|
+
var call$9 = functionCall;
|
|
3638
|
+
var hasOwn$2 = hasOwnProperty_1;
|
|
3639
|
+
var isPrototypeOf$3 = objectIsPrototypeOf;
|
|
3640
|
+
var regExpFlags = regexpFlags$1;
|
|
3641
|
+
|
|
3642
|
+
var RegExpPrototype$1 = RegExp.prototype;
|
|
3643
|
+
|
|
3644
|
+
var regexpGetFlags = function (R) {
|
|
3645
|
+
var flags = R.flags;
|
|
3646
|
+
return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
|
|
3647
|
+
? call$9(regExpFlags, R) : flags;
|
|
3648
|
+
};
|
|
3649
|
+
|
|
3650
|
+
var $$c = _export;
|
|
3651
|
+
var call$8 = functionCall;
|
|
3652
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
3653
|
+
var requireObjectCoercible$2 = requireObjectCoercible$9;
|
|
3654
|
+
var isCallable$6 = isCallable$o;
|
|
3655
|
+
var isNullOrUndefined$3 = isNullOrUndefined$7;
|
|
3656
|
+
var isRegExp = isRegexp;
|
|
3657
|
+
var toString$5 = toString$c;
|
|
3658
|
+
var getMethod$3 = getMethod$6;
|
|
3659
|
+
var getRegExpFlags$1 = regexpGetFlags;
|
|
3660
|
+
var getSubstitution = getSubstitution$2;
|
|
3661
|
+
var wellKnownSymbol$7 = wellKnownSymbol$k;
|
|
3662
|
+
|
|
3663
|
+
var REPLACE = wellKnownSymbol$7('replace');
|
|
3664
|
+
var $TypeError$7 = TypeError;
|
|
3665
|
+
var indexOf = uncurryThis$8(''.indexOf);
|
|
3666
|
+
uncurryThis$8(''.replace);
|
|
3667
|
+
var stringSlice$2 = uncurryThis$8(''.slice);
|
|
3668
|
+
var max = Math.max;
|
|
3669
|
+
|
|
3670
|
+
var stringIndexOf = function (string, searchValue, fromIndex) {
|
|
3671
|
+
if (fromIndex > string.length) return -1;
|
|
3672
|
+
if (searchValue === '') return fromIndex;
|
|
3673
|
+
return indexOf(string, searchValue, fromIndex);
|
|
3674
|
+
};
|
|
3675
|
+
|
|
3676
|
+
// `String.prototype.replaceAll` method
|
|
3677
|
+
// https://tc39.es/ecma262/#sec-string.prototype.replaceall
|
|
3678
|
+
$$c({ target: 'String', proto: true }, {
|
|
3679
|
+
replaceAll: function replaceAll(searchValue, replaceValue) {
|
|
3680
|
+
var O = requireObjectCoercible$2(this);
|
|
3681
|
+
var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
|
|
3682
|
+
var position = 0;
|
|
3683
|
+
var endOfLastMatch = 0;
|
|
3684
|
+
var result = '';
|
|
3685
|
+
if (!isNullOrUndefined$3(searchValue)) {
|
|
3686
|
+
IS_REG_EXP = isRegExp(searchValue);
|
|
3687
|
+
if (IS_REG_EXP) {
|
|
3688
|
+
flags = toString$5(requireObjectCoercible$2(getRegExpFlags$1(searchValue)));
|
|
3689
|
+
if (!~indexOf(flags, 'g')) throw $TypeError$7('`.replaceAll` does not allow non-global regexes');
|
|
3690
|
+
}
|
|
3691
|
+
replacer = getMethod$3(searchValue, REPLACE);
|
|
3692
|
+
if (replacer) {
|
|
3693
|
+
return call$8(replacer, searchValue, O, replaceValue);
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
string = toString$5(O);
|
|
3697
|
+
searchString = toString$5(searchValue);
|
|
3698
|
+
functionalReplace = isCallable$6(replaceValue);
|
|
3699
|
+
if (!functionalReplace) replaceValue = toString$5(replaceValue);
|
|
3700
|
+
searchLength = searchString.length;
|
|
3701
|
+
advanceBy = max(1, searchLength);
|
|
3702
|
+
position = stringIndexOf(string, searchString, 0);
|
|
3703
|
+
while (position !== -1) {
|
|
3704
|
+
replacement = functionalReplace
|
|
3705
|
+
? toString$5(replaceValue(searchString, position, string))
|
|
3706
|
+
: getSubstitution(searchString, string, position, [], undefined, replaceValue);
|
|
3707
|
+
result += stringSlice$2(string, endOfLastMatch, position) + replacement;
|
|
3708
|
+
endOfLastMatch = position + searchLength;
|
|
3709
|
+
position = stringIndexOf(string, searchString, position + advanceBy);
|
|
3710
|
+
}
|
|
3711
|
+
if (endOfLastMatch < string.length) {
|
|
3712
|
+
result += stringSlice$2(string, endOfLastMatch);
|
|
3713
|
+
}
|
|
3714
|
+
return result;
|
|
3715
|
+
}
|
|
3716
|
+
});
|
|
3717
|
+
|
|
3718
|
+
let _LOCALE = navigator.language;
|
|
3719
|
+
const loadableLocale = _LOCALE.replaceAll("-", "");
|
|
3720
|
+
const loadableBackupLocale = _LOCALE.split("-")[0];
|
|
3721
|
+
let intlLocale = undefined;
|
|
3722
|
+
if (loadableLocale in Locales__namespace || loadableBackupLocale) {
|
|
3723
|
+
const targetLocale = loadableLocale in Locales__namespace ? loadableLocale : loadableBackupLocale;
|
|
3724
|
+
const l = Locales__namespace[targetLocale];
|
|
3725
|
+
ReactDatePicker.registerLocale(_LOCALE, l);
|
|
3726
|
+
intlLocale = l;
|
|
3727
|
+
ReactDatePicker.setDefaultLocale(_LOCALE);
|
|
3728
|
+
} else {
|
|
3729
|
+
// Really should never happen but this SHOULD revert to un-localized
|
|
3730
|
+
console.log(`User's navigator.language locale ${_LOCALE} could not be loaded because it was not found in date-fns.
|
|
3731
|
+
Backup attempt to load ${loadableBackupLocale} failed as well.
|
|
3732
|
+
Reverting to en-US.`);
|
|
3733
|
+
_LOCALE = "en-US";
|
|
3734
|
+
}
|
|
3735
|
+
const usaLocale = Locales__namespace["enUS"];
|
|
3736
|
+
const LOCALE = _LOCALE;
|
|
3737
|
+
/**
|
|
3738
|
+
* Parse a string in the CURRENT locale into a Date object.
|
|
3739
|
+
* current locale is determined by navigator.language for now
|
|
3740
|
+
* @param dateString
|
|
3741
|
+
*/
|
|
3742
|
+
const parseLocaleDate = dateString => dateString ? dateFns.parse(dateString, "P", new Date(), intlLocale ? {
|
|
3743
|
+
locale: intlLocale
|
|
3744
|
+
} : undefined) : null;
|
|
3745
|
+
const parseUSADate = dateString => dateString ? dateFns.parse(dateString, "P", new Date(), {
|
|
3746
|
+
locale: usaLocale
|
|
3747
|
+
}) : null;
|
|
3748
|
+
/**
|
|
3749
|
+
*
|
|
3750
|
+
* Format a date into a string in the CURRENT locale.
|
|
3751
|
+
* current locale is determined by navigator.language for now
|
|
3752
|
+
* @param date
|
|
3753
|
+
*/
|
|
3754
|
+
const formatLocaleDate = date => date ? dateFns.format(date, "P", {
|
|
3755
|
+
locale: intlLocale
|
|
3756
|
+
}) : null;
|
|
3757
|
+
const formatUSADate = date => date ? dateFns.format(date, "P", {
|
|
3758
|
+
locale: usaLocale
|
|
3759
|
+
}) : null;
|
|
3760
|
+
|
|
3592
3761
|
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)."; }
|
|
3593
3762
|
const getPopperStyles = theme => /*#__PURE__*/css.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== */");
|
|
3594
3763
|
const getWrapperStyles = theme => /*#__PURE__*/css.css(process.env.NODE_ENV === "production" ? {
|
|
@@ -3607,28 +3776,43 @@ const DatePicker = fieldProps => {
|
|
|
3607
3776
|
const datePickerRef = React.useRef(null);
|
|
3608
3777
|
return jsxRuntime.jsx(DatePickerController, Object.assign({}, fieldProps, {
|
|
3609
3778
|
children: _a => {
|
|
3610
|
-
var
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3779
|
+
var _datePickerProps = __rest(_a, ["ref"]);
|
|
3780
|
+
// Lens the form's usa date string into a locale date string
|
|
3781
|
+
// for the now localized date picker
|
|
3782
|
+
const onChange = date => {
|
|
3783
|
+
var _a;
|
|
3784
|
+
(_a = _datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(_datePickerProps, formatUSADate(parseLocaleDate(date)));
|
|
3785
|
+
};
|
|
3786
|
+
const value = formatLocaleDate(parseUSADate(_datePickerProps.value));
|
|
3787
|
+
const datePickerProps = Object.assign(Object.assign({}, _datePickerProps), {
|
|
3788
|
+
onChange,
|
|
3789
|
+
value
|
|
3790
|
+
});
|
|
3614
3791
|
return jsxRuntime.jsx("div", Object.assign({
|
|
3615
|
-
css: getOverrideStyles
|
|
3792
|
+
css: getOverrideStyles(theme)
|
|
3616
3793
|
}, {
|
|
3617
|
-
children: jsxRuntime.jsx(ReactDatePicker__default["default"], Object.assign({
|
|
3618
|
-
|
|
3794
|
+
children: jsxRuntime.jsx(ReactDatePicker__default["default"], Object.assign({
|
|
3795
|
+
locale: LOCALE
|
|
3796
|
+
}, datePickerProps, {
|
|
3797
|
+
customInput: /*#__PURE__*/React.createElement( /*#__PURE__*/React.forwardRef(function InputWrapper(_a, forwardedRef) {
|
|
3619
3798
|
var _b;
|
|
3620
3799
|
var {
|
|
3621
3800
|
value
|
|
3622
3801
|
} = _a,
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
ref
|
|
3802
|
+
inputProps = __rest(_a, ["value"]);
|
|
3803
|
+
if (typeof forwardedRef !== "function") throw new Error("DatePicker requires a callback-ref and should always be passing one (this should never happen)");
|
|
3804
|
+
// 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
|
|
3805
|
+
const mutableRef = React.useRef(null);
|
|
3806
|
+
// We wrap RDP's forwarded ref in order to setup our own mutable ref
|
|
3807
|
+
const callbackRef = React.useCallback(node => {
|
|
3808
|
+
// Invoke RDP's forwarded ref
|
|
3809
|
+
forwardedRef(node);
|
|
3810
|
+
// Setup our mutable ref
|
|
3811
|
+
if (node) mutableRef.current = node;
|
|
3812
|
+
}, [forwardedRef]);
|
|
3813
|
+
const isFocused = (_b = mutableRef.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
|
|
3814
|
+
return jsxRuntime.jsx(giger.Input, Object.assign({}, inputProps, {
|
|
3815
|
+
ref: callbackRef,
|
|
3632
3816
|
rightContent: jsxRuntime.jsx(giger.Icon
|
|
3633
3817
|
// Internally, RDP applies this class to the Input, but the Icon is absolute / in its own context
|
|
3634
3818
|
, {
|
|
@@ -3643,9 +3827,9 @@ const DatePicker = fieldProps => {
|
|
|
3643
3827
|
return (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(!datePickerRef.current.isCalendarOpen());
|
|
3644
3828
|
}
|
|
3645
3829
|
}),
|
|
3646
|
-
value: isFocused || value !== new Date()
|
|
3830
|
+
value: isFocused || value !== formatLocaleDate(new Date()) ? value : datePickerProps.placeholderText
|
|
3647
3831
|
}));
|
|
3648
|
-
}),
|
|
3832
|
+
})),
|
|
3649
3833
|
"data-testid": fieldProps.name ? humps.camelize(fieldProps.name) : "date",
|
|
3650
3834
|
onCalendarOpen: () => {
|
|
3651
3835
|
var _a;
|
|
@@ -3654,13 +3838,13 @@ const DatePicker = fieldProps => {
|
|
|
3654
3838
|
onChange: (date, event) => {
|
|
3655
3839
|
var _a;
|
|
3656
3840
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
3657
|
-
(_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? date
|
|
3841
|
+
(_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? formatLocaleDate(date) : null);
|
|
3658
3842
|
},
|
|
3659
3843
|
popperClassName: getPopperStyles(theme),
|
|
3660
3844
|
popperPlacement: "bottom-end",
|
|
3661
3845
|
preventOpenOnFocus: true,
|
|
3662
3846
|
ref: datePickerRef,
|
|
3663
|
-
selected:
|
|
3847
|
+
selected: parseLocaleDate(datePickerProps.value),
|
|
3664
3848
|
showPopperArrow: false,
|
|
3665
3849
|
wrapperClassName: getWrapperStyles()
|
|
3666
3850
|
}))
|
|
@@ -3770,7 +3954,7 @@ var flattenIntoArray_1 = flattenIntoArray$1;
|
|
|
3770
3954
|
|
|
3771
3955
|
var uncurryThis$6 = functionUncurryThis;
|
|
3772
3956
|
var fails$5 = fails$q;
|
|
3773
|
-
var isCallable$5 = isCallable$
|
|
3957
|
+
var isCallable$5 = isCallable$o;
|
|
3774
3958
|
var classof$1 = classof$6;
|
|
3775
3959
|
var getBuiltIn$3 = getBuiltIn$8;
|
|
3776
3960
|
var inspectSource$1 = inspectSource$3;
|
|
@@ -3824,7 +4008,7 @@ var isConstructor$2 = !construct || fails$5(function () {
|
|
|
3824
4008
|
var isArray = isArray$2;
|
|
3825
4009
|
var isConstructor$1 = isConstructor$2;
|
|
3826
4010
|
var isObject$2 = isObject$a;
|
|
3827
|
-
var wellKnownSymbol$6 = wellKnownSymbol$
|
|
4011
|
+
var wellKnownSymbol$6 = wellKnownSymbol$k;
|
|
3828
4012
|
|
|
3829
4013
|
var SPECIES$3 = wellKnownSymbol$6('species');
|
|
3830
4014
|
var $Array = Array;
|
|
@@ -4005,8 +4189,8 @@ var uncurryThis$5 = functionUncurryThis;
|
|
|
4005
4189
|
var thisNumberValue$1 = uncurryThis$5(1.0.valueOf);
|
|
4006
4190
|
|
|
4007
4191
|
var toIntegerOrInfinity$1 = toIntegerOrInfinity$6;
|
|
4008
|
-
var toString$4 = toString$
|
|
4009
|
-
var requireObjectCoercible$1 = requireObjectCoercible$
|
|
4192
|
+
var toString$4 = toString$c;
|
|
4193
|
+
var requireObjectCoercible$1 = requireObjectCoercible$9;
|
|
4010
4194
|
|
|
4011
4195
|
var $RangeError$1 = RangeError;
|
|
4012
4196
|
|
|
@@ -4155,7 +4339,7 @@ $$a({ target: 'Number', proto: true, forced: FORCED$2 }, {
|
|
|
4155
4339
|
var global$a = global$p;
|
|
4156
4340
|
var fails$3 = fails$q;
|
|
4157
4341
|
var uncurryThis$3 = functionUncurryThis;
|
|
4158
|
-
var toString$3 = toString$
|
|
4342
|
+
var toString$3 = toString$c;
|
|
4159
4343
|
var trim$1 = stringTrim.trim;
|
|
4160
4344
|
var whitespaces$1 = whitespaces$4;
|
|
4161
4345
|
|
|
@@ -4315,7 +4499,7 @@ const MoneyInput = _a => {
|
|
|
4315
4499
|
var global$9 = global$p;
|
|
4316
4500
|
var fails$2 = fails$q;
|
|
4317
4501
|
var uncurryThis$2 = functionUncurryThis;
|
|
4318
|
-
var toString$2 = toString$
|
|
4502
|
+
var toString$2 = toString$c;
|
|
4319
4503
|
var trim = stringTrim.trim;
|
|
4320
4504
|
var whitespaces = whitespaces$4;
|
|
4321
4505
|
|
|
@@ -4388,23 +4572,10 @@ const NumberInput = _a => {
|
|
|
4388
4572
|
}));
|
|
4389
4573
|
};
|
|
4390
4574
|
|
|
4391
|
-
var call$8 = functionCall;
|
|
4392
|
-
var hasOwn$2 = hasOwnProperty_1;
|
|
4393
|
-
var isPrototypeOf$3 = objectIsPrototypeOf;
|
|
4394
|
-
var regExpFlags = regexpFlags$1;
|
|
4395
|
-
|
|
4396
|
-
var RegExpPrototype$1 = RegExp.prototype;
|
|
4397
|
-
|
|
4398
|
-
var regexpGetFlags = function (R) {
|
|
4399
|
-
var flags = R.flags;
|
|
4400
|
-
return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
|
|
4401
|
-
? call$8(regExpFlags, R) : flags;
|
|
4402
|
-
};
|
|
4403
|
-
|
|
4404
4575
|
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
4405
4576
|
var defineBuiltIn$2 = defineBuiltIn$7;
|
|
4406
4577
|
var anObject$6 = anObject$f;
|
|
4407
|
-
var $toString = toString$
|
|
4578
|
+
var $toString = toString$c;
|
|
4408
4579
|
var fails$1 = fails$q;
|
|
4409
4580
|
var getRegExpFlags = regexpGetFlags;
|
|
4410
4581
|
|
|
@@ -4650,7 +4821,7 @@ const getDeliveryDaysLabel = deliveryDays => {
|
|
|
4650
4821
|
}
|
|
4651
4822
|
return `${deliveryDays.toString()} ${deliveryDays === 1 ? "day" : "days"}`;
|
|
4652
4823
|
};
|
|
4653
|
-
const getAcknowledgementLabel = serviceCode => {
|
|
4824
|
+
const getAcknowledgementLabel = (serviceCode, packageType) => {
|
|
4654
4825
|
switch (serviceCode) {
|
|
4655
4826
|
case "usps_media_mail":
|
|
4656
4827
|
return jsxRuntime.jsxs(reactI18next.Trans, Object.assign({
|
|
@@ -4665,6 +4836,13 @@ const getAcknowledgementLabel = serviceCode => {
|
|
|
4665
4836
|
children: "USPS guidelines for Media Mail®"
|
|
4666
4837
|
}))]
|
|
4667
4838
|
}));
|
|
4839
|
+
case "usps_first_class_mail":
|
|
4840
|
+
if (packageType === "large_envelope_or_flat") {
|
|
4841
|
+
return jsxRuntime.jsx(reactI18next.Trans, {
|
|
4842
|
+
i18nKey: "purchase-label:rates.uspsFirstClassMailAcknowledgement_leof"
|
|
4843
|
+
});
|
|
4844
|
+
}
|
|
4845
|
+
return;
|
|
4668
4846
|
default:
|
|
4669
4847
|
return null;
|
|
4670
4848
|
}
|
|
@@ -4687,6 +4865,7 @@ const RateCard = ({
|
|
|
4687
4865
|
requiresAcknowledgement,
|
|
4688
4866
|
selected: _selected = false,
|
|
4689
4867
|
serviceCode,
|
|
4868
|
+
packageType,
|
|
4690
4869
|
serviceType,
|
|
4691
4870
|
shippingAmount,
|
|
4692
4871
|
taxAmount,
|
|
@@ -4759,7 +4938,11 @@ const RateCard = ({
|
|
|
4759
4938
|
css: getFooterListItemStyles,
|
|
4760
4939
|
variant: "body2"
|
|
4761
4940
|
}, {
|
|
4762
|
-
children: msg
|
|
4941
|
+
children: packageType === "large_envelope_or_flat" ? t(msg, {
|
|
4942
|
+
weight: 13
|
|
4943
|
+
}) : t(msg, {
|
|
4944
|
+
weight: 16
|
|
4945
|
+
})
|
|
4763
4946
|
}), index + msg.length))
|
|
4764
4947
|
})), requiresAcknowledgement && onClickAcknowledgement && jsxRuntime.jsx("div", Object.assign({
|
|
4765
4948
|
css: getCheckboxWrapperStyles
|
|
@@ -4767,7 +4950,7 @@ const RateCard = ({
|
|
|
4767
4950
|
children: jsxRuntime.jsx(giger.Checkbox, {
|
|
4768
4951
|
checked: isAcknowledged,
|
|
4769
4952
|
css: getAcknowledgmentStyles,
|
|
4770
|
-
label: getAcknowledgementLabel(serviceCode),
|
|
4953
|
+
label: getAcknowledgementLabel(serviceCode, packageType),
|
|
4771
4954
|
onChange: e => onClickAcknowledgement(e.target.checked)
|
|
4772
4955
|
})
|
|
4773
4956
|
}))]
|
|
@@ -5191,17 +5374,43 @@ const useInsuranceProviderOptions = (insuranceAccount, features) => {
|
|
|
5191
5374
|
}), [t, insuranceAccount, features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance, features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance]);
|
|
5192
5375
|
};
|
|
5193
5376
|
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5377
|
+
const useShipmentMetadata = shipment => {
|
|
5378
|
+
const isInternational = React.useMemo(() => {
|
|
5379
|
+
return shipment ? getIsInternationalShipment(shipment) : false;
|
|
5380
|
+
}, [shipment]);
|
|
5381
|
+
const isPoBox = React.useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
|
|
5382
|
+
const isUnsupportedUpsCountry = React.useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isUnsupportedByUps(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
|
|
5383
|
+
const isCustomsRequired = React.useMemo(() => {
|
|
5384
|
+
return shipment ? getIsCustomsRequiredForShipment(shipment) : false;
|
|
5385
|
+
}, [shipment]);
|
|
5386
|
+
const isContentDescriptionRequired = React.useMemo(() => {
|
|
5387
|
+
var _a;
|
|
5388
|
+
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";
|
|
5389
|
+
}, [shipment]);
|
|
5390
|
+
return {
|
|
5391
|
+
isContentDescriptionRequired,
|
|
5392
|
+
isCustomsRequired,
|
|
5393
|
+
isInternational,
|
|
5394
|
+
isPoBox,
|
|
5395
|
+
isUnsupportedUpsCountry
|
|
5396
|
+
};
|
|
5397
|
+
};
|
|
5398
|
+
|
|
5399
|
+
let _$2 = t => t,
|
|
5400
|
+
_t$2,
|
|
5401
|
+
_t2$2;
|
|
5197
5402
|
const findGenericPackageFromCarriers = carriers => {
|
|
5198
5403
|
const carrier = carriers.find(c => c.packages.some(p => p.packageCode === "package"));
|
|
5199
5404
|
return carrier === null || carrier === void 0 ? void 0 : carrier.packages.find(p => p.packageCode === "package");
|
|
5200
5405
|
};
|
|
5201
|
-
const usePackageOptions = (carriers, customPackageTypes,
|
|
5406
|
+
const usePackageOptions = (carriers, customPackageTypes, shipment) => {
|
|
5202
5407
|
const {
|
|
5203
5408
|
t
|
|
5204
5409
|
} = reactI18next.useTranslation("common");
|
|
5410
|
+
const {
|
|
5411
|
+
isPoBox,
|
|
5412
|
+
isUnsupportedUpsCountry
|
|
5413
|
+
} = useShipmentMetadata(shipment);
|
|
5205
5414
|
return React.useMemo(() => {
|
|
5206
5415
|
if (!carriers) return undefined;
|
|
5207
5416
|
// Dictionary to lookup the uniqueness of each carrierCode
|
|
@@ -5210,7 +5419,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
|
|
|
5210
5419
|
}));
|
|
5211
5420
|
const genericPackage = findGenericPackageFromCarriers(carriers);
|
|
5212
5421
|
const packageOptions = [...(genericPackage ? [{
|
|
5213
|
-
label: t(_t$
|
|
5422
|
+
label: t(_t$2 || (_t$2 = _$2`packageCategories.browseRates`)),
|
|
5214
5423
|
options: [{
|
|
5215
5424
|
label: t("packageCodes.package"),
|
|
5216
5425
|
value: {
|
|
@@ -5218,7 +5427,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
|
|
|
5218
5427
|
}
|
|
5219
5428
|
}]
|
|
5220
5429
|
}] : []), ...((customPackageTypes === null || customPackageTypes === void 0 ? void 0 : customPackageTypes.length) ? [{
|
|
5221
|
-
label: t(_t2$
|
|
5430
|
+
label: t(_t2$2 || (_t2$2 = _$2`packageCategories.myCustomPackages`)),
|
|
5222
5431
|
options: customPackageTypes.sort((a, b) => a.name.localeCompare(b.name)).map(({
|
|
5223
5432
|
dimensions,
|
|
5224
5433
|
name,
|
|
@@ -5235,7 +5444,8 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
|
|
|
5235
5444
|
return carriers.reduce((options, carrier) => {
|
|
5236
5445
|
if (carrier.packages.length === 0) return options;
|
|
5237
5446
|
// Filter out non-USPS packages for PO Box shipments
|
|
5238
|
-
|
|
5447
|
+
// Filter out UPS packages for unsupported countries
|
|
5448
|
+
if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
|
|
5239
5449
|
return [...options, {
|
|
5240
5450
|
// Check the uniqueness of the carrierCode, if unique default to friendlyName and if non-unique use nickname.
|
|
5241
5451
|
label: isUniqueByCarrierCode[carrier.carrierCode] ? carrier.friendlyName : carrier.nickname,
|
|
@@ -5251,24 +5461,27 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
|
|
|
5251
5461
|
value: carrier.carrierId
|
|
5252
5462
|
}];
|
|
5253
5463
|
}, packageOptions);
|
|
5254
|
-
}, [carriers, customPackageTypes,
|
|
5464
|
+
}, [carriers, customPackageTypes, isPoBox, isUnsupportedUpsCountry, t]);
|
|
5255
5465
|
};
|
|
5256
5466
|
|
|
5257
5467
|
const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) => {
|
|
5258
|
-
const isInternationalShipment = React.useMemo(() => {
|
|
5259
|
-
return shipment ? getIsInternationalShipment(shipment) : false;
|
|
5260
|
-
}, [shipment]);
|
|
5261
|
-
const isPoBoxShipment = React.useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
|
|
5262
5468
|
const carriersById = React.useMemo(() => createDictionary(carriers, c => ({
|
|
5263
5469
|
[c.carrierId]: c
|
|
5264
5470
|
})), [carriers]);
|
|
5471
|
+
const {
|
|
5472
|
+
isInternational,
|
|
5473
|
+
isPoBox,
|
|
5474
|
+
isUnsupportedUpsCountry
|
|
5475
|
+
} = useShipmentMetadata(shipment);
|
|
5265
5476
|
return React.useMemo(() => {
|
|
5266
5477
|
return (rates !== null && rates !== void 0 ? rates : []).filter(r => {
|
|
5267
5478
|
const carrier = carriersById[r.carrierId];
|
|
5268
5479
|
const service = carrier === null || carrier === void 0 ? void 0 : carrier.services.find(s => s.serviceCode === r.serviceCode);
|
|
5269
|
-
return (service === null || service === void 0 ? void 0 : service.domestic) === !
|
|
5480
|
+
return (service === null || service === void 0 ? void 0 : service.domestic) === !isInternational && (!enableGlobalPostFiltering || !r.serviceCode.includes("globalpost_")) && (
|
|
5270
5481
|
// Filter out non-USPS carriers for PO Box shipments
|
|
5271
|
-
service && isUspsCarrier(service.carrierCode) || !
|
|
5482
|
+
service && isUspsCarrier(service.carrierCode) || !isPoBox) && (
|
|
5483
|
+
// Filter out UPS for unsupported countries
|
|
5484
|
+
service && !isUpsCarrier(service.carrierCode) || !isUnsupportedUpsCountry);
|
|
5272
5485
|
}).sort((a, b) => getTotalRateAmount(a) - getTotalRateAmount(b)).map(r => {
|
|
5273
5486
|
var _a, _b;
|
|
5274
5487
|
const balance = (_a = carriersById[r.carrierId]) === null || _a === void 0 ? void 0 : _a.balance;
|
|
@@ -5276,22 +5489,29 @@ const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) =>
|
|
|
5276
5489
|
return Object.assign(Object.assign({}, r), {
|
|
5277
5490
|
balance,
|
|
5278
5491
|
messages: r.warningMessages,
|
|
5279
|
-
requiresAcknowledgement: getRateRequiresAcknowledgement(r.serviceCode),
|
|
5492
|
+
requiresAcknowledgement: getRateRequiresAcknowledgement(r.serviceCode, r.packageType),
|
|
5280
5493
|
requiresFundedAmount
|
|
5281
5494
|
});
|
|
5282
5495
|
});
|
|
5283
|
-
}, [carriersById, enableGlobalPostFiltering,
|
|
5496
|
+
}, [carriersById, enableGlobalPostFiltering, isInternational, isPoBox, isUnsupportedUpsCountry, rates]);
|
|
5284
5497
|
};
|
|
5285
5498
|
|
|
5286
|
-
const useServiceCodeOptions = (carriers,
|
|
5499
|
+
const useServiceCodeOptions = (carriers, shipment) => {
|
|
5500
|
+
const {
|
|
5501
|
+
isInternational,
|
|
5502
|
+
isPoBox,
|
|
5503
|
+
isUnsupportedUpsCountry
|
|
5504
|
+
} = useShipmentMetadata(shipment);
|
|
5287
5505
|
return React.useMemo(() => {
|
|
5288
5506
|
// Dictionary to lookup the uniqueness of each carrierCode
|
|
5289
5507
|
const isUniqueByCarrierCode = createDictionary(carriers, (c, partialResults) => ({
|
|
5290
5508
|
[c.carrierCode]: partialResults[c.carrierCode] === undefined
|
|
5291
5509
|
}));
|
|
5292
5510
|
return (carriers !== null && carriers !== void 0 ? carriers : []).reduce((options, carrier) => {
|
|
5293
|
-
|
|
5294
|
-
|
|
5511
|
+
// Filter out non-USPS service for PO Box shipments
|
|
5512
|
+
// Filter out UPS service for unsupported countries
|
|
5513
|
+
if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
|
|
5514
|
+
const services = carrier.services.filter(s => s.domestic === !isInternational &&
|
|
5295
5515
|
// TODO: Pending LMNT-418, GlobalPost filtering should be wrapped in FF
|
|
5296
5516
|
!s.serviceCode.includes("globalpost_"));
|
|
5297
5517
|
if (services.length === 0) return options;
|
|
@@ -5309,7 +5529,7 @@ const useServiceCodeOptions = (carriers, domestic, poBox) => {
|
|
|
5309
5529
|
value: carrier.carrierId
|
|
5310
5530
|
}];
|
|
5311
5531
|
}, []);
|
|
5312
|
-
}, [carriers,
|
|
5532
|
+
}, [carriers, isInternational, isPoBox, isUnsupportedUpsCountry]);
|
|
5313
5533
|
};
|
|
5314
5534
|
|
|
5315
5535
|
const getContainerStyles = theme => /*#__PURE__*/react.css({
|
|
@@ -5368,13 +5588,16 @@ const createCategoryFromShippingPresets = (categoryName, presets) => presets ? [
|
|
|
5368
5588
|
const useShippingPresetsOptions = ({
|
|
5369
5589
|
platform,
|
|
5370
5590
|
user
|
|
5371
|
-
} = {},
|
|
5591
|
+
} = {}, shipment) => {
|
|
5372
5592
|
const {
|
|
5373
5593
|
t
|
|
5374
5594
|
} = reactI18next.useTranslation();
|
|
5375
|
-
|
|
5595
|
+
const {
|
|
5596
|
+
isInternational
|
|
5597
|
+
} = useShipmentMetadata(shipment);
|
|
5598
|
+
return React.useMemo(() => [...createCategoryFromShippingPresets(t("shippingPresets.user"), isInternational ? user === null || user === void 0 ? void 0 : user.international : user === null || user === void 0 ? void 0 : user.domestic),
|
|
5376
5599
|
// TODO - platform name should probably be a platform-specific environmental variable ?
|
|
5377
|
-
...createCategoryFromShippingPresets(t("shippingPresets.platform"),
|
|
5600
|
+
...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]);
|
|
5378
5601
|
};
|
|
5379
5602
|
|
|
5380
5603
|
const useStateCodeOptions = domestic => React.useMemo(() => usStates.flatMap(v => !domestic || !v.isMilitary && !v.isUnitedStatesTerritory ? {
|
|
@@ -5651,7 +5874,7 @@ const useRunOnceOnTrue = conditionalEffect => {
|
|
|
5651
5874
|
*/
|
|
5652
5875
|
const useToggle = (initialValue = false) => React.useReducer((prev, next) => next !== undefined && typeof next !== "object" ? next : !prev, initialValue);
|
|
5653
5876
|
|
|
5654
|
-
var wellKnownSymbol$5 = wellKnownSymbol$
|
|
5877
|
+
var wellKnownSymbol$5 = wellKnownSymbol$k;
|
|
5655
5878
|
var Iterators$1 = iterators;
|
|
5656
5879
|
|
|
5657
5880
|
var ITERATOR$2 = wellKnownSymbol$5('iterator');
|
|
@@ -5663,10 +5886,10 @@ var isArrayIteratorMethod$1 = function (it) {
|
|
|
5663
5886
|
};
|
|
5664
5887
|
|
|
5665
5888
|
var classof = classof$6;
|
|
5666
|
-
var getMethod$2 = getMethod$
|
|
5667
|
-
var isNullOrUndefined$2 = isNullOrUndefined$
|
|
5889
|
+
var getMethod$2 = getMethod$6;
|
|
5890
|
+
var isNullOrUndefined$2 = isNullOrUndefined$7;
|
|
5668
5891
|
var Iterators = iterators;
|
|
5669
|
-
var wellKnownSymbol$4 = wellKnownSymbol$
|
|
5892
|
+
var wellKnownSymbol$4 = wellKnownSymbol$k;
|
|
5670
5893
|
|
|
5671
5894
|
var ITERATOR$1 = wellKnownSymbol$4('iterator');
|
|
5672
5895
|
|
|
@@ -5692,7 +5915,7 @@ var getIterator$1 = function (argument, usingIterator) {
|
|
|
5692
5915
|
|
|
5693
5916
|
var call$6 = functionCall;
|
|
5694
5917
|
var anObject$4 = anObject$f;
|
|
5695
|
-
var getMethod$1 = getMethod$
|
|
5918
|
+
var getMethod$1 = getMethod$6;
|
|
5696
5919
|
|
|
5697
5920
|
var iteratorClose$1 = function (iterator, kind, value) {
|
|
5698
5921
|
var innerResult, innerError;
|
|
@@ -5940,7 +6163,7 @@ const AddressParser = ({
|
|
|
5940
6163
|
}));
|
|
5941
6164
|
};
|
|
5942
6165
|
|
|
5943
|
-
const styles$
|
|
6166
|
+
const styles$o = createStyles({
|
|
5944
6167
|
grow: {
|
|
5945
6168
|
flexGrow: 1
|
|
5946
6169
|
},
|
|
@@ -6040,13 +6263,13 @@ const AddressFields = ({
|
|
|
6040
6263
|
},
|
|
6041
6264
|
options: countryCodeOptions
|
|
6042
6265
|
}), jsxRuntime.jsxs("div", Object.assign({
|
|
6043
|
-
css: styles$
|
|
6266
|
+
css: styles$o.stateZipWrapper
|
|
6044
6267
|
}, {
|
|
6045
6268
|
children: [jsxRuntime.jsx("div", Object.assign({
|
|
6046
|
-
css: styles$
|
|
6269
|
+
css: styles$o.stateWrapper
|
|
6047
6270
|
}, {
|
|
6048
6271
|
children: jsxRuntime.jsx("div", Object.assign({
|
|
6049
|
-
css: styles$
|
|
6272
|
+
css: styles$o.grow
|
|
6050
6273
|
}, {
|
|
6051
6274
|
children: watchCountryCode === "US" ?
|
|
6052
6275
|
// Domestic States
|
|
@@ -6071,10 +6294,10 @@ const AddressFields = ({
|
|
|
6071
6294
|
})
|
|
6072
6295
|
}))
|
|
6073
6296
|
})), jsxRuntime.jsx("div", Object.assign({
|
|
6074
|
-
css: styles$
|
|
6297
|
+
css: styles$o.zipWrapper
|
|
6075
6298
|
}, {
|
|
6076
6299
|
children: jsxRuntime.jsx("div", Object.assign({
|
|
6077
|
-
css: styles$
|
|
6300
|
+
css: styles$o.grow
|
|
6078
6301
|
}, {
|
|
6079
6302
|
children: jsxRuntime.jsx(TextInput, {
|
|
6080
6303
|
control: form.control,
|
|
@@ -6114,11 +6337,11 @@ const extendZod = () => {
|
|
|
6114
6337
|
var call$4 = functionCall;
|
|
6115
6338
|
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
6116
6339
|
var anObject$2 = anObject$f;
|
|
6117
|
-
var isNullOrUndefined$1 = isNullOrUndefined$
|
|
6340
|
+
var isNullOrUndefined$1 = isNullOrUndefined$7;
|
|
6118
6341
|
var toLength = toLength$3;
|
|
6119
|
-
var toString$1 = toString$
|
|
6120
|
-
var requireObjectCoercible = requireObjectCoercible$
|
|
6121
|
-
var getMethod = getMethod$
|
|
6342
|
+
var toString$1 = toString$c;
|
|
6343
|
+
var requireObjectCoercible = requireObjectCoercible$9;
|
|
6344
|
+
var getMethod = getMethod$6;
|
|
6122
6345
|
var advanceStringIndex = advanceStringIndex$2;
|
|
6123
6346
|
var regExpExec = regexpExecAbstract;
|
|
6124
6347
|
|
|
@@ -6246,7 +6469,7 @@ const AddressForm = ({
|
|
|
6246
6469
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
6247
6470
|
css: theme => ({
|
|
6248
6471
|
display: "flex",
|
|
6249
|
-
|
|
6472
|
+
flexDirection: isAddressParserOpen ? "column" : "row",
|
|
6250
6473
|
paddingBottom: theme.spacing(4),
|
|
6251
6474
|
width: "100%"
|
|
6252
6475
|
})
|
|
@@ -6312,7 +6535,7 @@ const AddressForm = ({
|
|
|
6312
6535
|
}));
|
|
6313
6536
|
};
|
|
6314
6537
|
|
|
6315
|
-
const styles$
|
|
6538
|
+
const styles$n = createStyles({
|
|
6316
6539
|
agreement: {
|
|
6317
6540
|
alignItems: "center",
|
|
6318
6541
|
display: "flex",
|
|
@@ -6382,10 +6605,10 @@ const DisplayCarrierTerms = c => {
|
|
|
6382
6605
|
const listCarrierLinks = () => {
|
|
6383
6606
|
return c.carrierTerms.links.map((term, index) => {
|
|
6384
6607
|
return jsxRuntime.jsx("li", Object.assign({
|
|
6385
|
-
css: styles$
|
|
6608
|
+
css: styles$n.listItems
|
|
6386
6609
|
}, {
|
|
6387
6610
|
children: jsxRuntime.jsx(giger.Link, Object.assign({
|
|
6388
|
-
css: styles$
|
|
6611
|
+
css: styles$n.link,
|
|
6389
6612
|
href: term.url,
|
|
6390
6613
|
isExternal: true,
|
|
6391
6614
|
target: "_blank"
|
|
@@ -6401,18 +6624,18 @@ const DisplayCarrierTerms = c => {
|
|
|
6401
6624
|
};
|
|
6402
6625
|
const listCarrierTerms = () => {
|
|
6403
6626
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
6404
|
-
css: styles$
|
|
6627
|
+
css: styles$n.terms
|
|
6405
6628
|
}, {
|
|
6406
6629
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
6407
6630
|
variant: "subtitle1"
|
|
6408
6631
|
}, {
|
|
6409
6632
|
children: c.carrierTerms.title
|
|
6410
6633
|
})), jsxRuntime.jsx("div", Object.assign({
|
|
6411
|
-
css: styles$
|
|
6634
|
+
css: styles$n.terms
|
|
6412
6635
|
}, {
|
|
6413
6636
|
children: listCarrierContent()
|
|
6414
6637
|
})), jsxRuntime.jsx("ul", Object.assign({
|
|
6415
|
-
css: styles$
|
|
6638
|
+
css: styles$n.links
|
|
6416
6639
|
}, {
|
|
6417
6640
|
children: listCarrierLinks()
|
|
6418
6641
|
}))]
|
|
@@ -6642,7 +6865,7 @@ const AddressDisplay = ({
|
|
|
6642
6865
|
}));
|
|
6643
6866
|
};
|
|
6644
6867
|
|
|
6645
|
-
const styles$
|
|
6868
|
+
const styles$m = createStyles({
|
|
6646
6869
|
container: theme => ({
|
|
6647
6870
|
display: "flex",
|
|
6648
6871
|
gap: theme.spacing()
|
|
@@ -6680,13 +6903,13 @@ const Disclosure = ({
|
|
|
6680
6903
|
}, [open]);
|
|
6681
6904
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6682
6905
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
6683
|
-
css: styles$
|
|
6906
|
+
css: styles$m.container
|
|
6684
6907
|
}, {
|
|
6685
6908
|
children: [jsxRuntime.jsx("div", {
|
|
6686
6909
|
children: label
|
|
6687
6910
|
}), _showToggle && jsxRuntime.jsx("button", Object.assign({
|
|
6688
6911
|
"aria-expanded": isOpen,
|
|
6689
|
-
css: styles$
|
|
6912
|
+
css: styles$m.toggle,
|
|
6690
6913
|
onClick: () => {
|
|
6691
6914
|
setIsOpen(!isOpen);
|
|
6692
6915
|
onToggle(!isOpen);
|
|
@@ -6694,12 +6917,12 @@ const Disclosure = ({
|
|
|
6694
6917
|
type: "button"
|
|
6695
6918
|
}, {
|
|
6696
6919
|
children: jsxRuntime.jsx(giger.Icon, {
|
|
6697
|
-
css: styles$
|
|
6920
|
+
css: styles$m.icon,
|
|
6698
6921
|
name: isOpen ? gigerTheme.IconNames.CHEVRON_TOP : gigerTheme.IconNames.CHEVRON_BOTTOM
|
|
6699
6922
|
})
|
|
6700
6923
|
}))]
|
|
6701
6924
|
})), isOpen && jsxRuntime.jsx("div", Object.assign({
|
|
6702
|
-
css: styles$
|
|
6925
|
+
css: styles$m.content
|
|
6703
6926
|
}, {
|
|
6704
6927
|
children: typeof children === "function" ? children(() => setIsOpen(!isOpen)) : children
|
|
6705
6928
|
}))]
|
|
@@ -6739,14 +6962,10 @@ const AddressPreferenceDisplay = ({
|
|
|
6739
6962
|
}), [addressPreference, onChangePreference]);
|
|
6740
6963
|
const disclosureContentTitle = React.useMemo(() => addressPreference.status === "verified" ? t(`address.preference.${addressPreference.alternativeSource}`) : t("address.preference.addressNotValidated"), [addressPreference, t]);
|
|
6741
6964
|
const isVerified = React.useMemo(() => {
|
|
6742
|
-
if (
|
|
6743
|
-
return
|
|
6744
|
-
}
|
|
6745
|
-
// If the address is international and is modified, We might get "verified" even though we are displaying original "not verified" address
|
|
6746
|
-
if (addressPreference.isModified) {
|
|
6747
|
-
return false;
|
|
6965
|
+
if (addressPreference.status === "verified" && addressPreference.selectionSource === "matchedAddress") {
|
|
6966
|
+
return true;
|
|
6748
6967
|
}
|
|
6749
|
-
return
|
|
6968
|
+
return false;
|
|
6750
6969
|
}, [addressPreference]);
|
|
6751
6970
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6752
6971
|
children: [jsxRuntime.jsx(AddressDisplay, {
|
|
@@ -6849,7 +7068,7 @@ const getCarrierRecoverySchema = requiresAddress => zod.z.object({
|
|
|
6849
7068
|
address: requiresAddress ? baseSchema : baseSchema.optional()
|
|
6850
7069
|
});
|
|
6851
7070
|
|
|
6852
|
-
const styles$
|
|
7071
|
+
const styles$l = createStyles({
|
|
6853
7072
|
grid: theme => ({
|
|
6854
7073
|
margin: theme.spacing(4)
|
|
6855
7074
|
}),
|
|
@@ -6892,7 +7111,7 @@ const CarrierRecoveryForm = ({
|
|
|
6892
7111
|
onSubmit: formLogger.capture(handleSubmit)
|
|
6893
7112
|
}, {
|
|
6894
7113
|
children: jsxRuntime.jsxs(giger.Grid, Object.assign({
|
|
6895
|
-
css: styles$
|
|
7114
|
+
css: styles$l.grid,
|
|
6896
7115
|
noPadding: true
|
|
6897
7116
|
}, {
|
|
6898
7117
|
children: [requiresAddress && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -6900,14 +7119,14 @@ const CarrierRecoveryForm = ({
|
|
|
6900
7119
|
colSpan: 12
|
|
6901
7120
|
}, {
|
|
6902
7121
|
children: jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
6903
|
-
css: styles$
|
|
7122
|
+
css: styles$l.heading,
|
|
6904
7123
|
variant: "heading4"
|
|
6905
7124
|
}, {
|
|
6906
7125
|
children: t("register-wallet:sections.carriers.title")
|
|
6907
7126
|
}))
|
|
6908
7127
|
})), jsxRuntime.jsx(giger.GridChild, Object.assign({
|
|
6909
7128
|
colSpan: 12,
|
|
6910
|
-
css: styles$
|
|
7129
|
+
css: styles$l.subtitle
|
|
6911
7130
|
}, {
|
|
6912
7131
|
children: jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
6913
7132
|
variant: "subtitle1"
|
|
@@ -6993,7 +7212,7 @@ const CarrierTermsForm = ({
|
|
|
6993
7212
|
onSubmit(payload.agreement);
|
|
6994
7213
|
}));
|
|
6995
7214
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
6996
|
-
css: styles$
|
|
7215
|
+
css: styles$n.termsForm,
|
|
6997
7216
|
"data-testid": "carrier-terms-form"
|
|
6998
7217
|
}, {
|
|
6999
7218
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
@@ -7009,7 +7228,7 @@ const CarrierTermsForm = ({
|
|
|
7009
7228
|
})), jsxRuntime.jsx(Spacer, {
|
|
7010
7229
|
multiplier: 1
|
|
7011
7230
|
}), jsxRuntime.jsx("div", Object.assign({
|
|
7012
|
-
css: styles$
|
|
7231
|
+
css: styles$n.carrierLogos
|
|
7013
7232
|
}, {
|
|
7014
7233
|
children: metadatas.map(({
|
|
7015
7234
|
name,
|
|
@@ -7025,7 +7244,7 @@ const CarrierTermsForm = ({
|
|
|
7025
7244
|
onSubmit: formLogger.capture(handleSubmit)
|
|
7026
7245
|
}, {
|
|
7027
7246
|
children: jsxRuntime.jsxs("div", Object.assign({
|
|
7028
|
-
css: styles$
|
|
7247
|
+
css: styles$n.agreement
|
|
7029
7248
|
}, {
|
|
7030
7249
|
children: [jsxRuntime.jsx("div", {
|
|
7031
7250
|
children: jsxRuntime.jsx(CheckboxInput, {
|
|
@@ -7052,12 +7271,12 @@ const CarrierTermsForm = ({
|
|
|
7052
7271
|
name: "agreement"
|
|
7053
7272
|
})
|
|
7054
7273
|
}), showTerms && jsxRuntime.jsxs("div", Object.assign({
|
|
7055
|
-
css: styles$
|
|
7274
|
+
css: styles$n.well
|
|
7056
7275
|
}, {
|
|
7057
7276
|
children: [terms.map(t => jsxRuntime.jsx(DisplayCarrierTerms, {
|
|
7058
7277
|
carrierTerms: t
|
|
7059
7278
|
}, t.title)), jsxRuntime.jsx("div", Object.assign({
|
|
7060
|
-
css: styles$
|
|
7279
|
+
css: styles$n.close
|
|
7061
7280
|
}, {
|
|
7062
7281
|
children: jsxRuntime.jsx(giger.Button, Object.assign({
|
|
7063
7282
|
onClick: () => setShowTerms(false),
|
|
@@ -7089,9 +7308,9 @@ var DESCRIPTORS$1 = descriptors;
|
|
|
7089
7308
|
var global$8 = global$p;
|
|
7090
7309
|
var uncurryThis$1 = functionUncurryThis;
|
|
7091
7310
|
var hasOwn$1 = hasOwnProperty_1;
|
|
7092
|
-
var isCallable$4 = isCallable$
|
|
7311
|
+
var isCallable$4 = isCallable$o;
|
|
7093
7312
|
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
7094
|
-
var toString = toString$
|
|
7313
|
+
var toString = toString$c;
|
|
7095
7314
|
var defineProperty = objectDefineProperty.f;
|
|
7096
7315
|
var copyConstructorProperties = copyConstructorProperties$2;
|
|
7097
7316
|
|
|
@@ -7310,7 +7529,8 @@ const icons = {
|
|
|
7310
7529
|
add: gigerTheme.IconNames.ADD,
|
|
7311
7530
|
checkFilled: gigerTheme.IconNames.CHECK_FILLED,
|
|
7312
7531
|
copy: gigerTheme.IconNames.COPY,
|
|
7313
|
-
download: gigerTheme.IconNames.DOWNLOAD
|
|
7532
|
+
download: gigerTheme.IconNames.DOWNLOAD,
|
|
7533
|
+
retry: gigerTheme.IconNames.CIRCULAR_ARROW
|
|
7314
7534
|
};
|
|
7315
7535
|
const LinkAction = _a => {
|
|
7316
7536
|
var {
|
|
@@ -7318,11 +7538,12 @@ const LinkAction = _a => {
|
|
|
7318
7538
|
icon,
|
|
7319
7539
|
isDisabled,
|
|
7320
7540
|
isLoading,
|
|
7321
|
-
title
|
|
7541
|
+
title,
|
|
7542
|
+
isBold = true
|
|
7322
7543
|
} = _a,
|
|
7323
|
-
props = __rest(_a, ["css", "icon", "isDisabled", "isLoading", "title"]);
|
|
7544
|
+
props = __rest(_a, ["css", "icon", "isDisabled", "isLoading", "title", "isBold"]);
|
|
7324
7545
|
return jsxRuntime.jsx(giger.Link, Object.assign({}, props, {
|
|
7325
|
-
bold:
|
|
7546
|
+
bold: isBold,
|
|
7326
7547
|
css: theme => [Object.assign(Object.assign({
|
|
7327
7548
|
"&&&": {
|
|
7328
7549
|
textDecoration: "none"
|
|
@@ -7376,7 +7597,7 @@ const CopyButton = ({
|
|
|
7376
7597
|
}));
|
|
7377
7598
|
};
|
|
7378
7599
|
|
|
7379
|
-
const styles$
|
|
7600
|
+
const styles$k = createStyles({
|
|
7380
7601
|
trackingNumber: theme => ({
|
|
7381
7602
|
alignItems: "center",
|
|
7382
7603
|
display: "flex"
|
|
@@ -7422,10 +7643,10 @@ const Label = ({
|
|
|
7422
7643
|
shippingAmount: label.shipmentCost
|
|
7423
7644
|
}, {
|
|
7424
7645
|
children: label.trackingNumber && jsxRuntime.jsxs("div", Object.assign({
|
|
7425
|
-
css: styles$
|
|
7646
|
+
css: styles$k.trackingNumber
|
|
7426
7647
|
}, {
|
|
7427
7648
|
children: [jsxRuntime.jsx("div", Object.assign({
|
|
7428
|
-
css: styles$
|
|
7649
|
+
css: styles$k.truncatedTrackingNumber
|
|
7429
7650
|
}, {
|
|
7430
7651
|
children: label.trackingNumber.toString()
|
|
7431
7652
|
})), jsxRuntime.jsx(CopyButton, {
|
|
@@ -7537,7 +7758,7 @@ const LandingPageForm = ({
|
|
|
7537
7758
|
}));
|
|
7538
7759
|
};
|
|
7539
7760
|
|
|
7540
|
-
const styles$
|
|
7761
|
+
const styles$j = createStyles({
|
|
7541
7762
|
container: theme => ({
|
|
7542
7763
|
padding: theme.spacing(2)
|
|
7543
7764
|
}),
|
|
@@ -7559,11 +7780,11 @@ const LandingPage = ({
|
|
|
7559
7780
|
t
|
|
7560
7781
|
} = reactI18next.useTranslation();
|
|
7561
7782
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
7562
|
-
css: styles$
|
|
7783
|
+
css: styles$j.container,
|
|
7563
7784
|
"data-testid": "landing-page"
|
|
7564
7785
|
}, {
|
|
7565
7786
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
7566
|
-
css: styles$
|
|
7787
|
+
css: styles$j.header
|
|
7567
7788
|
}, {
|
|
7568
7789
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
7569
7790
|
variant: "heading4"
|
|
@@ -7581,7 +7802,7 @@ const LandingPage = ({
|
|
|
7581
7802
|
})), jsxRuntime.jsx(LandingPageForm, {
|
|
7582
7803
|
onSubmit: onSubmit
|
|
7583
7804
|
}), jsxRuntime.jsxs("div", Object.assign({
|
|
7584
|
-
css: styles$
|
|
7805
|
+
css: styles$j.header
|
|
7585
7806
|
}, {
|
|
7586
7807
|
children: [jsxRuntime.jsx(Spacer, {
|
|
7587
7808
|
multiplier: 6
|
|
@@ -7592,14 +7813,14 @@ const LandingPage = ({
|
|
|
7592
7813
|
})), jsxRuntime.jsx(Spacer, {
|
|
7593
7814
|
multiplier: 2
|
|
7594
7815
|
}), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
7595
|
-
css: styles$
|
|
7816
|
+
css: styles$j.description,
|
|
7596
7817
|
variant: "body1"
|
|
7597
7818
|
}, {
|
|
7598
7819
|
children: t("onboarding:landing.messageLine1")
|
|
7599
7820
|
})), jsxRuntime.jsx(Spacer, {
|
|
7600
7821
|
multiplier: 2
|
|
7601
7822
|
}), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
7602
|
-
css: styles$
|
|
7823
|
+
css: styles$j.description,
|
|
7603
7824
|
variant: "body1"
|
|
7604
7825
|
}, {
|
|
7605
7826
|
children: t("onboarding:landing.messageLine2")
|
|
@@ -7610,7 +7831,7 @@ const LandingPage = ({
|
|
|
7610
7831
|
}));
|
|
7611
7832
|
};
|
|
7612
7833
|
|
|
7613
|
-
const styles$
|
|
7834
|
+
const styles$i = createStyles({
|
|
7614
7835
|
icon: theme => ({
|
|
7615
7836
|
color: theme.palette.primary.main,
|
|
7616
7837
|
marginRight: theme.spacing(2)
|
|
@@ -7655,10 +7876,10 @@ const Section = _a => {
|
|
|
7655
7876
|
rest = __rest(_a, ["bold", "title", "children", "rightContent"]);
|
|
7656
7877
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7657
7878
|
children: [title && jsxRuntime.jsx("summary", Object.assign({
|
|
7658
|
-
css: styles$
|
|
7879
|
+
css: styles$i.summary
|
|
7659
7880
|
}, {
|
|
7660
7881
|
children: jsxRuntime.jsxs("div", Object.assign({
|
|
7661
|
-
css: styles$
|
|
7882
|
+
css: styles$i.summaryWrapper
|
|
7662
7883
|
}, {
|
|
7663
7884
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
7664
7885
|
bold: bold,
|
|
@@ -7666,20 +7887,20 @@ const Section = _a => {
|
|
|
7666
7887
|
}, {
|
|
7667
7888
|
children: title
|
|
7668
7889
|
})), rightContent && jsxRuntime.jsx("div", Object.assign({
|
|
7669
|
-
css: styles$
|
|
7890
|
+
css: styles$i.rightContentWrapper
|
|
7670
7891
|
}, {
|
|
7671
7892
|
children: rightContent
|
|
7672
7893
|
}))]
|
|
7673
7894
|
}))
|
|
7674
7895
|
})), jsxRuntime.jsx("section", Object.assign({
|
|
7675
|
-
css: styles$
|
|
7896
|
+
css: styles$i.section
|
|
7676
7897
|
}, rest, {
|
|
7677
7898
|
children: children
|
|
7678
7899
|
}))]
|
|
7679
7900
|
});
|
|
7680
7901
|
};
|
|
7681
7902
|
|
|
7682
|
-
const styles$
|
|
7903
|
+
const styles$h = createStyles({
|
|
7683
7904
|
container: {
|
|
7684
7905
|
display: "flex",
|
|
7685
7906
|
flexDirection: "column"
|
|
@@ -7739,14 +7960,14 @@ const ListCarriersRow = ({
|
|
|
7739
7960
|
setIsSubmitting(false);
|
|
7740
7961
|
});
|
|
7741
7962
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
7742
|
-
css: styles$
|
|
7963
|
+
css: styles$h.container,
|
|
7743
7964
|
"data-testid": "carrier-row"
|
|
7744
7965
|
}, {
|
|
7745
7966
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
7746
|
-
css: styles$
|
|
7967
|
+
css: styles$h.rowContainer
|
|
7747
7968
|
}, {
|
|
7748
7969
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
7749
|
-
css: styles$
|
|
7970
|
+
css: styles$h.logoContainer
|
|
7750
7971
|
}, {
|
|
7751
7972
|
children: [jsxRuntime.jsx("div", {
|
|
7752
7973
|
children: jsxRuntime.jsx("img", {
|
|
@@ -7764,7 +7985,7 @@ const ListCarriersRow = ({
|
|
|
7764
7985
|
css: _ref
|
|
7765
7986
|
}, {
|
|
7766
7987
|
children: jsxRuntime.jsx(LinkAction, {
|
|
7767
|
-
css: styles$
|
|
7988
|
+
css: styles$h.getConnectButton(isConnected),
|
|
7768
7989
|
isDisabled: isConnected || showDropDown,
|
|
7769
7990
|
isLoading: isSubmitting,
|
|
7770
7991
|
onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -7782,7 +8003,7 @@ const ListCarriersRow = ({
|
|
|
7782
8003
|
}));
|
|
7783
8004
|
};
|
|
7784
8005
|
|
|
7785
|
-
const styles$
|
|
8006
|
+
const styles$g = createStyles({
|
|
7786
8007
|
carriersList: theme => ({
|
|
7787
8008
|
"& > li:not(:last-of-type)": {
|
|
7788
8009
|
borderBottom: `1px solid ${theme.palette.gray.light}`
|
|
@@ -7835,7 +8056,7 @@ const ListCarriers = ({
|
|
|
7835
8056
|
}))
|
|
7836
8057
|
})), jsxRuntime.jsx(Spacer, {})]
|
|
7837
8058
|
}), jsxRuntime.jsx("ul", Object.assign({
|
|
7838
|
-
css: styles$
|
|
8059
|
+
css: styles$g.carriersList,
|
|
7839
8060
|
"data-testid": "carriers-list"
|
|
7840
8061
|
}, {
|
|
7841
8062
|
children: isLoading ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -7857,11 +8078,11 @@ const ListCarriers = ({
|
|
|
7857
8078
|
};
|
|
7858
8079
|
const LoadingSkeletonRow = () => {
|
|
7859
8080
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
7860
|
-
css: styles$
|
|
8081
|
+
css: styles$g.skeletonRow,
|
|
7861
8082
|
"data-testid": "skeleton-carrier-row"
|
|
7862
8083
|
}, {
|
|
7863
8084
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
7864
|
-
css: styles$
|
|
8085
|
+
css: styles$g.skeletonLogoContainer
|
|
7865
8086
|
}, {
|
|
7866
8087
|
children: [jsxRuntime.jsx(giger.Skeleton, {
|
|
7867
8088
|
animation: giger.SkeletonAnimation.WAVE,
|
|
@@ -8168,7 +8389,7 @@ const useAddressPreference = () => {
|
|
|
8168
8389
|
return context;
|
|
8169
8390
|
};
|
|
8170
8391
|
|
|
8171
|
-
const styles$
|
|
8392
|
+
const styles$f = createStyles({
|
|
8172
8393
|
body: theme => ({
|
|
8173
8394
|
borderTop: `1px solid ${theme.palette.gray.light}`,
|
|
8174
8395
|
color: theme.palette.black,
|
|
@@ -8219,14 +8440,14 @@ const SettingsCard = ({
|
|
|
8219
8440
|
verticallyAligned
|
|
8220
8441
|
}) => {
|
|
8221
8442
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
8222
|
-
css: verticallyAligned ? styles$
|
|
8443
|
+
css: verticallyAligned ? styles$f.verticalContainer : styles$f.container,
|
|
8223
8444
|
"data-testid": "settingsCard"
|
|
8224
8445
|
}, {
|
|
8225
8446
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
8226
|
-
css: styles$
|
|
8447
|
+
css: styles$f.header
|
|
8227
8448
|
}, {
|
|
8228
8449
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
8229
|
-
css: styles$
|
|
8450
|
+
css: styles$f.title
|
|
8230
8451
|
}, {
|
|
8231
8452
|
children: [typeof title === "string" ? jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
8232
8453
|
variant: "subtitle2"
|
|
@@ -8261,7 +8482,7 @@ const SettingsCard = ({
|
|
|
8261
8482
|
}))
|
|
8262
8483
|
}))]
|
|
8263
8484
|
})), children && jsxRuntime.jsx("div", Object.assign({
|
|
8264
|
-
css: styles$
|
|
8485
|
+
css: styles$f.body
|
|
8265
8486
|
}, {
|
|
8266
8487
|
children: jsxRuntime.jsxs("div", {
|
|
8267
8488
|
children: [children, accessoryAction && jsxRuntime.jsx(ButtonGroup, Object.assign({
|
|
@@ -8397,7 +8618,7 @@ const WarehouseForm = ({
|
|
|
8397
8618
|
returnAddress: Object.assign(Object.assign({}, warehouse.returnAddress), {
|
|
8398
8619
|
countryCode: warehouse.returnAddress.countryCode
|
|
8399
8620
|
}),
|
|
8400
|
-
returnToAddressIsDifferent: !_$
|
|
8621
|
+
returnToAddressIsDifferent: !_$3.isEqual(warehouse.originAddress, warehouse.returnAddress)
|
|
8401
8622
|
}) : {
|
|
8402
8623
|
isDefault: _isOnboarding ? true : false,
|
|
8403
8624
|
originAddress: {
|
|
@@ -8517,7 +8738,7 @@ const WarehouseForm = ({
|
|
|
8517
8738
|
}));
|
|
8518
8739
|
};
|
|
8519
8740
|
|
|
8520
|
-
const styles$
|
|
8741
|
+
const styles$e = createStyles({
|
|
8521
8742
|
cardSpacing: theme => ({
|
|
8522
8743
|
display: "flex",
|
|
8523
8744
|
flexDirection: "column",
|
|
@@ -8547,9 +8768,9 @@ const ManageWarehouses = ({
|
|
|
8547
8768
|
const [showAddNewWarehouseForm, toggleShowAddNewWarehouseForm] = useToggle(false);
|
|
8548
8769
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8549
8770
|
children: [showAddNewWarehouseForm ? jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
|
|
8550
|
-
css: styles$
|
|
8771
|
+
css: styles$e.well,
|
|
8551
8772
|
formHeader: jsxRuntime.jsxs("div", Object.assign({
|
|
8552
|
-
css: styles$
|
|
8773
|
+
css: styles$e.header
|
|
8553
8774
|
}, {
|
|
8554
8775
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
8555
8776
|
variant: "subtitle1"
|
|
@@ -8594,14 +8815,14 @@ const ManageWarehouses = ({
|
|
|
8594
8815
|
})]
|
|
8595
8816
|
}))
|
|
8596
8817
|
})), jsxRuntime.jsx("div", Object.assign({
|
|
8597
|
-
css: styles$
|
|
8818
|
+
css: styles$e.cardSpacing
|
|
8598
8819
|
}, {
|
|
8599
8820
|
children: warehouses.map(warehouse => {
|
|
8600
8821
|
if (editWarehouseId && editWarehouseId === warehouse.warehouseId) {
|
|
8601
8822
|
return jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
|
|
8602
|
-
css: styles$
|
|
8823
|
+
css: styles$e.well,
|
|
8603
8824
|
formHeader: jsxRuntime.jsxs("div", Object.assign({
|
|
8604
|
-
css: styles$
|
|
8825
|
+
css: styles$e.header
|
|
8605
8826
|
}, {
|
|
8606
8827
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
8607
8828
|
variant: "subtitle1"
|
|
@@ -8659,7 +8880,7 @@ const ManageWarehouses = ({
|
|
|
8659
8880
|
|
|
8660
8881
|
var getBuiltIn$2 = getBuiltIn$8;
|
|
8661
8882
|
var definePropertyModule = objectDefineProperty;
|
|
8662
|
-
var wellKnownSymbol$3 = wellKnownSymbol$
|
|
8883
|
+
var wellKnownSymbol$3 = wellKnownSymbol$k;
|
|
8663
8884
|
var DESCRIPTORS = descriptors;
|
|
8664
8885
|
|
|
8665
8886
|
var SPECIES$2 = wellKnownSymbol$3('species');
|
|
@@ -8698,8 +8919,8 @@ var aConstructor$1 = function (argument) {
|
|
|
8698
8919
|
|
|
8699
8920
|
var anObject$1 = anObject$f;
|
|
8700
8921
|
var aConstructor = aConstructor$1;
|
|
8701
|
-
var isNullOrUndefined = isNullOrUndefined$
|
|
8702
|
-
var wellKnownSymbol$2 = wellKnownSymbol$
|
|
8922
|
+
var isNullOrUndefined = isNullOrUndefined$7;
|
|
8923
|
+
var wellKnownSymbol$2 = wellKnownSymbol$k;
|
|
8703
8924
|
|
|
8704
8925
|
var SPECIES$1 = wellKnownSymbol$2('species');
|
|
8705
8926
|
|
|
@@ -8729,7 +8950,7 @@ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
|
|
|
8729
8950
|
var global$7 = global$p;
|
|
8730
8951
|
var apply = functionApply;
|
|
8731
8952
|
var bind$2 = functionBindContext;
|
|
8732
|
-
var isCallable$3 = isCallable$
|
|
8953
|
+
var isCallable$3 = isCallable$o;
|
|
8733
8954
|
var hasOwn = hasOwnProperty_1;
|
|
8734
8955
|
var fails = fails$q;
|
|
8735
8956
|
var html = html$2;
|
|
@@ -8996,10 +9217,10 @@ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
|
|
|
8996
9217
|
|
|
8997
9218
|
var global$2 = global$p;
|
|
8998
9219
|
var NativePromiseConstructor$3 = promiseNativeConstructor;
|
|
8999
|
-
var isCallable$2 = isCallable$
|
|
9220
|
+
var isCallable$2 = isCallable$o;
|
|
9000
9221
|
var isForced = isForced_1;
|
|
9001
9222
|
var inspectSource = inspectSource$3;
|
|
9002
|
-
var wellKnownSymbol$1 = wellKnownSymbol$
|
|
9223
|
+
var wellKnownSymbol$1 = wellKnownSymbol$k;
|
|
9003
9224
|
var IS_BROWSER = engineIsBrowser;
|
|
9004
9225
|
var IS_DENO = engineIsDeno;
|
|
9005
9226
|
var V8_VERSION = engineV8Version;
|
|
@@ -9071,7 +9292,7 @@ var setPrototypeOf = objectSetPrototypeOf;
|
|
|
9071
9292
|
var setToStringTag = setToStringTag$3;
|
|
9072
9293
|
var setSpecies = setSpecies$1;
|
|
9073
9294
|
var aCallable$2 = aCallable$a;
|
|
9074
|
-
var isCallable$1 = isCallable$
|
|
9295
|
+
var isCallable$1 = isCallable$o;
|
|
9075
9296
|
var isObject$1 = isObject$a;
|
|
9076
9297
|
var anInstance = anInstance$1;
|
|
9077
9298
|
var speciesConstructor = speciesConstructor$1;
|
|
@@ -9349,7 +9570,7 @@ $$5({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTR
|
|
|
9349
9570
|
setToStringTag(PromiseConstructor, PROMISE, false);
|
|
9350
9571
|
setSpecies(PROMISE);
|
|
9351
9572
|
|
|
9352
|
-
var wellKnownSymbol = wellKnownSymbol$
|
|
9573
|
+
var wellKnownSymbol = wellKnownSymbol$k;
|
|
9353
9574
|
|
|
9354
9575
|
var ITERATOR = wellKnownSymbol('iterator');
|
|
9355
9576
|
var SAFE_CLOSING = false;
|
|
@@ -9439,7 +9660,7 @@ var $$3 = _export;
|
|
|
9439
9660
|
var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
|
|
9440
9661
|
var NativePromiseConstructor = promiseNativeConstructor;
|
|
9441
9662
|
var getBuiltIn$1 = getBuiltIn$8;
|
|
9442
|
-
var isCallable = isCallable$
|
|
9663
|
+
var isCallable = isCallable$o;
|
|
9443
9664
|
var defineBuiltIn = defineBuiltIn$7;
|
|
9444
9665
|
|
|
9445
9666
|
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
|
@@ -9779,7 +10000,7 @@ const EditWalletAddressForm = ({
|
|
|
9779
10000
|
}));
|
|
9780
10001
|
};
|
|
9781
10002
|
|
|
9782
|
-
const styles$
|
|
10003
|
+
const styles$d = createStyles({
|
|
9783
10004
|
grid: theme => ({
|
|
9784
10005
|
margin: theme.spacing(4)
|
|
9785
10006
|
})
|
|
@@ -9841,7 +10062,7 @@ const WalletForm = ({
|
|
|
9841
10062
|
onSubmit: formLogger.capture(handleSubmit)
|
|
9842
10063
|
}, {
|
|
9843
10064
|
children: jsxRuntime.jsxs(giger.Grid, Object.assign({
|
|
9844
|
-
css: styles$
|
|
10065
|
+
css: styles$d.grid,
|
|
9845
10066
|
noPadding: true
|
|
9846
10067
|
}, {
|
|
9847
10068
|
children: [jsxRuntime.jsx(giger.GridChild, Object.assign({
|
|
@@ -9923,7 +10144,7 @@ const WalletForm = ({
|
|
|
9923
10144
|
}));
|
|
9924
10145
|
};
|
|
9925
10146
|
|
|
9926
|
-
const styles$
|
|
10147
|
+
const styles$c = createStyles({
|
|
9927
10148
|
container: theme => ({
|
|
9928
10149
|
padding: theme.spacing(2)
|
|
9929
10150
|
}),
|
|
@@ -10099,10 +10320,10 @@ const Onboarding = ({
|
|
|
10099
10320
|
const defaultWarehouse = (_a = warehouses.find(w => w.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
|
|
10100
10321
|
return jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
|
|
10101
10322
|
formHeader: jsxRuntime.jsxs("div", Object.assign({
|
|
10102
|
-
css: styles$
|
|
10323
|
+
css: styles$c.walletFormHeader
|
|
10103
10324
|
}, {
|
|
10104
10325
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
10105
|
-
css: styles$
|
|
10326
|
+
css: styles$c.walletFormTitle
|
|
10106
10327
|
}, {
|
|
10107
10328
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
10108
10329
|
variant: "heading4"
|
|
@@ -10179,38 +10400,38 @@ const Onboarding = ({
|
|
|
10179
10400
|
});
|
|
10180
10401
|
};
|
|
10181
10402
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
10182
|
-
css: styles$
|
|
10403
|
+
css: styles$c.container
|
|
10183
10404
|
}, {
|
|
10184
10405
|
children: [jsxRuntime.jsxs(giger.Stepper, Object.assign({
|
|
10185
10406
|
currentStep: currentStep
|
|
10186
10407
|
}, {
|
|
10187
10408
|
children: [jsxRuntime.jsx(giger.Step, {
|
|
10188
|
-
css: styles$
|
|
10409
|
+
css: styles$c.step,
|
|
10189
10410
|
label: t("onboarding:steps.login")
|
|
10190
10411
|
}), jsxRuntime.jsx(giger.Step, {
|
|
10191
|
-
css: styles$
|
|
10412
|
+
css: styles$c.step,
|
|
10192
10413
|
label: t("onboarding:steps.carriers")
|
|
10193
10414
|
}), jsxRuntime.jsx(giger.Step, {
|
|
10194
|
-
css: styles$
|
|
10415
|
+
css: styles$c.step,
|
|
10195
10416
|
label: t("onboarding:steps.addresses")
|
|
10196
10417
|
}), jsxRuntime.jsx(giger.Step, {
|
|
10197
|
-
css: styles$
|
|
10418
|
+
css: styles$c.step,
|
|
10198
10419
|
label: t("onboarding:steps.payment")
|
|
10199
10420
|
})]
|
|
10200
|
-
})), renderStep()]
|
|
10421
|
+
})), renderStep(), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
|
|
10201
10422
|
}));
|
|
10202
10423
|
};
|
|
10203
10424
|
|
|
10204
|
-
let _ = t => t,
|
|
10205
|
-
_t,
|
|
10206
|
-
_t2;
|
|
10425
|
+
let _$1 = t => t,
|
|
10426
|
+
_t$1,
|
|
10427
|
+
_t2$1;
|
|
10207
10428
|
const Cube = _a => {
|
|
10208
10429
|
var {
|
|
10209
10430
|
animate = false
|
|
10210
10431
|
} = _a,
|
|
10211
10432
|
props = __rest(_a, ["animate"]);
|
|
10212
10433
|
const theme = react.useTheme();
|
|
10213
|
-
const bounce = react.keyframes(_t || (_t = _`
|
|
10434
|
+
const bounce = react.keyframes(_t$1 || (_t$1 = _$1`
|
|
10214
10435
|
0%, 100% {
|
|
10215
10436
|
transform: translateY(-25%);
|
|
10216
10437
|
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
|
|
@@ -10220,7 +10441,7 @@ const Cube = _a => {
|
|
|
10220
10441
|
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
10221
10442
|
}
|
|
10222
10443
|
`));
|
|
10223
|
-
const spin = react.keyframes(_t2 || (_t2 = _`
|
|
10444
|
+
const spin = react.keyframes(_t2$1 || (_t2$1 = _$1`
|
|
10224
10445
|
from {
|
|
10225
10446
|
transform: rotate(0deg);
|
|
10226
10447
|
}
|
|
@@ -10323,12 +10544,12 @@ const Loader = props => {
|
|
|
10323
10544
|
}
|
|
10324
10545
|
}, {
|
|
10325
10546
|
children: jsxRuntime.jsx(giger.Spinner, Object.assign({}, props, {
|
|
10326
|
-
size: giger.SpinnerSize.SIZE_LARGE
|
|
10547
|
+
size: props.size || giger.SpinnerSize.SIZE_LARGE
|
|
10327
10548
|
}))
|
|
10328
10549
|
}));
|
|
10329
10550
|
};
|
|
10330
10551
|
|
|
10331
|
-
const styles$
|
|
10552
|
+
const styles$b = createStyles({
|
|
10332
10553
|
chipList: theme => ({
|
|
10333
10554
|
gap: theme.spacing(1)
|
|
10334
10555
|
}),
|
|
@@ -10439,7 +10660,7 @@ const AddFundsForm = ({
|
|
|
10439
10660
|
})), jsxRuntime.jsx(Spacer, {
|
|
10440
10661
|
multiplier: 2
|
|
10441
10662
|
}), jsxRuntime.jsx(giger.ChipList, Object.assign({
|
|
10442
|
-
css: styles$
|
|
10663
|
+
css: styles$b.chipList,
|
|
10443
10664
|
onChange: idx => {
|
|
10444
10665
|
const chip = chips[idx];
|
|
10445
10666
|
setSelectedChip(chip);
|
|
@@ -10454,7 +10675,7 @@ const AddFundsForm = ({
|
|
|
10454
10675
|
}
|
|
10455
10676
|
}, {
|
|
10456
10677
|
children: chips.map(chip => jsxRuntime.jsx(giger.Chip, Object.assign({
|
|
10457
|
-
css: styles$
|
|
10678
|
+
css: styles$b.getChip({
|
|
10458
10679
|
isDisabled: chip.value < _minimumAmount,
|
|
10459
10680
|
isSelected: chip.value === selectedChip.value
|
|
10460
10681
|
}),
|
|
@@ -10471,7 +10692,7 @@ const AddFundsForm = ({
|
|
|
10471
10692
|
multiplier: 1
|
|
10472
10693
|
}), jsxRuntime.jsx(MoneyInput, {
|
|
10473
10694
|
control: form.control,
|
|
10474
|
-
css: styles$
|
|
10695
|
+
css: styles$b.fundsInput,
|
|
10475
10696
|
defaultValue: {
|
|
10476
10697
|
amount: undefined,
|
|
10477
10698
|
currency: alchemy.SE.Currency.USD
|
|
@@ -10524,7 +10745,7 @@ const AddFundsForm = ({
|
|
|
10524
10745
|
});
|
|
10525
10746
|
};
|
|
10526
10747
|
|
|
10527
|
-
const styles$
|
|
10748
|
+
const styles$a = isLabelRight => createStyles({
|
|
10528
10749
|
inlineContainer: theme => ({
|
|
10529
10750
|
alignItems: "center",
|
|
10530
10751
|
display: "flex",
|
|
@@ -10539,14 +10760,14 @@ const InlineLabel = ({
|
|
|
10539
10760
|
isLabelRight,
|
|
10540
10761
|
labelProps: _labelProps = {}
|
|
10541
10762
|
}) => jsxRuntime.jsxs("div", Object.assign({
|
|
10542
|
-
css: styles$
|
|
10763
|
+
css: styles$a(isLabelRight).inlineContainer
|
|
10543
10764
|
}, {
|
|
10544
10765
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({}, _labelProps, {
|
|
10545
10766
|
children: label
|
|
10546
10767
|
})), children]
|
|
10547
10768
|
}));
|
|
10548
10769
|
|
|
10549
|
-
const styles$
|
|
10770
|
+
const styles$9 = createStyles({
|
|
10550
10771
|
getBalanceText: balance => theme => ({
|
|
10551
10772
|
color: balance === undefined ? theme.palette.alert.main : balance >= 0 ? theme.palette.secondary.dark : theme.palette.error.main
|
|
10552
10773
|
})
|
|
@@ -10569,7 +10790,7 @@ const CarrierBalance = ({
|
|
|
10569
10790
|
}, {
|
|
10570
10791
|
children: isLoadingCarrier || isRefetchingCarrier ? jsxRuntime.jsx(giger.Spinner, {}) : jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
10571
10792
|
bold: true,
|
|
10572
|
-
css: styles$
|
|
10793
|
+
css: styles$9.getBalanceText(balance)
|
|
10573
10794
|
}, {
|
|
10574
10795
|
children: balance === undefined ? t("manage-funding:errors.balanceUnknown") : formatMoney({
|
|
10575
10796
|
amount: balance,
|
|
@@ -10591,7 +10812,7 @@ const Spread = ({
|
|
|
10591
10812
|
children: children
|
|
10592
10813
|
}));
|
|
10593
10814
|
|
|
10594
|
-
const styles$
|
|
10815
|
+
const styles$8 = createStyles({
|
|
10595
10816
|
balanceText: theme => ({
|
|
10596
10817
|
color: theme.palette.secondary.dark
|
|
10597
10818
|
}),
|
|
@@ -10659,7 +10880,7 @@ const FundAndPurchase = ({
|
|
|
10659
10880
|
}, {
|
|
10660
10881
|
children: [jsxRuntime.jsx(giger.Button, Object.assign({
|
|
10661
10882
|
bold: false,
|
|
10662
|
-
css: styles$
|
|
10883
|
+
css: styles$8.saveRateButton,
|
|
10663
10884
|
disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
|
|
10664
10885
|
isLoading: isSavingRate,
|
|
10665
10886
|
onClick: handleSaveRate,
|
|
@@ -10679,7 +10900,7 @@ const FundAndPurchase = ({
|
|
|
10679
10900
|
// don't show balance or funding form
|
|
10680
10901
|
if (!isFundingRequired) return jsxRuntime.jsx("div", Object.assign({
|
|
10681
10902
|
className: className,
|
|
10682
|
-
css: styles$
|
|
10903
|
+
css: styles$8.container
|
|
10683
10904
|
}, {
|
|
10684
10905
|
children: renderActionButtons()
|
|
10685
10906
|
}));
|
|
@@ -10692,7 +10913,7 @@ const FundAndPurchase = ({
|
|
|
10692
10913
|
// show balance, but not the funding form.
|
|
10693
10914
|
if (!isFundingEnabled) return jsxRuntime.jsxs("div", Object.assign({
|
|
10694
10915
|
className: className,
|
|
10695
|
-
css: styles$
|
|
10916
|
+
css: styles$8.container
|
|
10696
10917
|
}, {
|
|
10697
10918
|
children: [jsxRuntime.jsx(CarrierBalance, {
|
|
10698
10919
|
carrierId: carrierId
|
|
@@ -10704,7 +10925,7 @@ const FundAndPurchase = ({
|
|
|
10704
10925
|
// show balance and funding form
|
|
10705
10926
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
10706
10927
|
className: className,
|
|
10707
|
-
css: styles$
|
|
10928
|
+
css: styles$8.container
|
|
10708
10929
|
}, {
|
|
10709
10930
|
children: [jsxRuntime.jsxs(Spread, {
|
|
10710
10931
|
children: [jsxRuntime.jsx(CarrierBalance, {
|
|
@@ -10735,13 +10956,13 @@ const FundAndPurchase = ({
|
|
|
10735
10956
|
var _a, _b;
|
|
10736
10957
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10737
10958
|
children: [jsxRuntime.jsxs("section", Object.assign({
|
|
10738
|
-
css: styles$
|
|
10959
|
+
css: styles$8.getFormExtension(addFundsForm.isCustomAmount)
|
|
10739
10960
|
}, {
|
|
10740
10961
|
children: [jsxRuntime.jsx(InlineLabel, Object.assign({
|
|
10741
10962
|
label: t("manage-funding:fundAndPurchase.newBalance")
|
|
10742
10963
|
}, {
|
|
10743
10964
|
children: jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
10744
|
-
css: styles$
|
|
10965
|
+
css: styles$8.balanceText
|
|
10745
10966
|
}, {
|
|
10746
10967
|
children: formatMoney({
|
|
10747
10968
|
amount: balance + ((_a = addFundsForm.selectedAmount) !== null && _a !== void 0 ? _a : 0),
|
|
@@ -10752,7 +10973,7 @@ const FundAndPurchase = ({
|
|
|
10752
10973
|
label: t("manage-funding:fundAndPurchase.finalBalance")
|
|
10753
10974
|
}, {
|
|
10754
10975
|
children: jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
10755
|
-
css: styles$
|
|
10976
|
+
css: styles$8.balanceText
|
|
10756
10977
|
}, {
|
|
10757
10978
|
children: formatMoney({
|
|
10758
10979
|
amount: balance + ((_b = addFundsForm.selectedAmount) !== null && _b !== void 0 ? _b : 0) - purchaseAmount,
|
|
@@ -10779,30 +11000,480 @@ const FundAndPurchase = ({
|
|
|
10779
11000
|
}));
|
|
10780
11001
|
};
|
|
10781
11002
|
|
|
10782
|
-
const
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
})
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
11003
|
+
const LabelLayoutPurchase = ({
|
|
11004
|
+
onChange
|
|
11005
|
+
}) => {
|
|
11006
|
+
const {
|
|
11007
|
+
t
|
|
11008
|
+
} = reactI18next.useTranslation(["common", "manage-defaults"]);
|
|
11009
|
+
const [layout, setLayout] = React.useState("4x6");
|
|
11010
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
11011
|
+
children: [jsxRuntime.jsx(giger.InlineNotification, Object.assign({
|
|
11012
|
+
title: t("manage-defaults:label.purchase.title"),
|
|
11013
|
+
type: giger.NotificationType.INFO
|
|
11014
|
+
}, {
|
|
11015
|
+
children: t("manage-defaults:label.purchase.description")
|
|
11016
|
+
})), jsxRuntime.jsx(Spacer, {
|
|
11017
|
+
multiplier: 1.5
|
|
11018
|
+
}), jsxRuntime.jsxs(giger.RadioGroup, Object.assign({
|
|
11019
|
+
name: "labelLayout",
|
|
11020
|
+
onChange: e => {
|
|
11021
|
+
setLayout(e.target.value);
|
|
11022
|
+
onChange(e.target.value);
|
|
11023
|
+
},
|
|
11024
|
+
value: layout
|
|
11025
|
+
}, {
|
|
11026
|
+
children: [jsxRuntime.jsx(giger.Radio, Object.assign({
|
|
11027
|
+
value: "Letter"
|
|
11028
|
+
}, {
|
|
11029
|
+
children: jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11030
|
+
bold: true
|
|
11031
|
+
}, {
|
|
11032
|
+
children: t("manage-defaults:label.letter.title")
|
|
11033
|
+
}))
|
|
11034
|
+
})), jsxRuntime.jsx(Spacer, {
|
|
11035
|
+
multiplier: 3
|
|
11036
|
+
}), jsxRuntime.jsx(giger.Radio, Object.assign({
|
|
11037
|
+
value: "4x6"
|
|
11038
|
+
}, {
|
|
11039
|
+
children: jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11040
|
+
bold: true
|
|
11041
|
+
}, {
|
|
11042
|
+
children: t("manage-defaults:label.thermal.title")
|
|
11043
|
+
}))
|
|
11044
|
+
}))]
|
|
11045
|
+
}))]
|
|
11046
|
+
});
|
|
11047
|
+
};
|
|
11048
|
+
|
|
11049
|
+
let _ = t => t,
|
|
11050
|
+
_t,
|
|
11051
|
+
_t2,
|
|
11052
|
+
_t3;
|
|
11053
|
+
const stroke = react.keyframes(_t || (_t = _`
|
|
11054
|
+
100% {
|
|
11055
|
+
stroke-dashoffset: 0;
|
|
11056
|
+
}
|
|
11057
|
+
`));
|
|
11058
|
+
const fadeInOut = react.keyframes(_t2 || (_t2 = _`
|
|
11059
|
+
0%, 100% {
|
|
11060
|
+
opacity: 0;
|
|
11061
|
+
}
|
|
11062
|
+
20% {
|
|
11063
|
+
opacity: 1;
|
|
11064
|
+
}
|
|
11065
|
+
85% {
|
|
11066
|
+
opacity: 1;
|
|
11067
|
+
}
|
|
11068
|
+
`));
|
|
11069
|
+
const fill = react.keyframes(_t3 || (_t3 = _`
|
|
11070
|
+
100% {
|
|
11071
|
+
box-shadow: inset 0px 0px 0px 30px #3F8200;
|
|
11072
|
+
`));
|
|
11073
|
+
const colors = {
|
|
11074
|
+
green: "#3F8200",
|
|
11075
|
+
grey: "#706F6F",
|
|
11076
|
+
red: "#EE3B3F"
|
|
11077
|
+
};
|
|
11078
|
+
const styles$7 = createStyles({
|
|
11079
|
+
checkmark: () => ({
|
|
11080
|
+
animation: `${fill} forwards`,
|
|
11081
|
+
borderRadius: "50%",
|
|
11082
|
+
height: "20px,",
|
|
11083
|
+
stroke: "#fff",
|
|
11084
|
+
width: "20px"
|
|
11085
|
+
}),
|
|
11086
|
+
checkmarkCheck: () => ({
|
|
11087
|
+
animation: `${stroke} 1s forwards`,
|
|
11088
|
+
strokeDasharray: "48",
|
|
11089
|
+
strokeDashoffset: "48"
|
|
11090
|
+
}),
|
|
11091
|
+
container: theme => ({
|
|
11092
|
+
alignItems: "center",
|
|
11093
|
+
animation: `${fadeInOut} 2.5s ease-in-out forwards`,
|
|
11094
|
+
display: "flex",
|
|
11095
|
+
justifyContent: "flex-start",
|
|
11096
|
+
padding: `0 ${theme.spacing(2)}px 0 0`
|
|
11097
|
+
}),
|
|
11098
|
+
saved: theme => ({
|
|
11099
|
+
color: colors.green,
|
|
11100
|
+
marginLeft: `${theme.spacing(1)}px`
|
|
11101
|
+
}),
|
|
11102
|
+
saving: theme => ({
|
|
11103
|
+
marginLeft: `${theme.spacing(1)}px`
|
|
11104
|
+
}),
|
|
11105
|
+
savingContainer: () => ({
|
|
11106
|
+
alignItems: "center",
|
|
11107
|
+
color: colors.grey,
|
|
11108
|
+
display: "flex",
|
|
11109
|
+
justifyContent: "flex-start"
|
|
11110
|
+
}),
|
|
11111
|
+
savingFailed: theme => ({
|
|
11112
|
+
color: "#EE3B3F",
|
|
11113
|
+
marginLeft: `${theme.spacing(1)}px`
|
|
11114
|
+
})
|
|
11115
|
+
});
|
|
11116
|
+
|
|
11117
|
+
const SaveStatus = ({
|
|
11118
|
+
errors,
|
|
11119
|
+
isSaving
|
|
11120
|
+
}) => {
|
|
11121
|
+
const {
|
|
11122
|
+
t
|
|
11123
|
+
} = reactI18next.useTranslation(["manage-defaults"]);
|
|
11124
|
+
if (isSaving) {
|
|
11125
|
+
return jsxRuntime.jsxs("div", Object.assign({
|
|
11126
|
+
css: styles$7.savingContainer
|
|
11127
|
+
}, {
|
|
11128
|
+
children: [jsxRuntime.jsx(Loader, {
|
|
11129
|
+
color: colors.grey,
|
|
11130
|
+
css: {
|
|
11131
|
+
color: colors.grey
|
|
11132
|
+
},
|
|
11133
|
+
size: giger.SpinnerSize.SIZE_SMALL
|
|
11134
|
+
}), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11135
|
+
css: styles$7.saving
|
|
11136
|
+
}, {
|
|
11137
|
+
children: t("manage-defaults:status.saving")
|
|
11138
|
+
}))]
|
|
11139
|
+
}));
|
|
11140
|
+
}
|
|
11141
|
+
return !isSaving && !errors ? jsxRuntime.jsxs("div", Object.assign({
|
|
11142
|
+
css: styles$7.container
|
|
11143
|
+
}, {
|
|
11144
|
+
children: [jsxRuntime.jsx("svg", Object.assign({
|
|
11145
|
+
css: styles$7.checkmark,
|
|
11146
|
+
viewBox: "0 0 52 52"
|
|
11147
|
+
}, {
|
|
11148
|
+
children: jsxRuntime.jsx("path", {
|
|
11149
|
+
css: styles$7.checkmarkCheck,
|
|
11150
|
+
d: "M14.1 27.2l7.1 7.2 16.7-16.8",
|
|
11151
|
+
fill: "none",
|
|
11152
|
+
strokeWidth: "5px"
|
|
11153
|
+
})
|
|
11154
|
+
})), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11155
|
+
css: styles$7.saved
|
|
11156
|
+
}, {
|
|
11157
|
+
children: t("manage-defaults:status.saved")
|
|
11158
|
+
}))]
|
|
11159
|
+
})) : jsxRuntime.jsxs("div", Object.assign({
|
|
11160
|
+
css: [styles$7.container, {
|
|
11161
|
+
padding: "0"
|
|
11162
|
+
}]
|
|
11163
|
+
}, {
|
|
11164
|
+
children: [jsxRuntime.jsx(giger.Icon, {
|
|
11165
|
+
css: {
|
|
11166
|
+
color: colors.red
|
|
11167
|
+
},
|
|
11168
|
+
name: gigerTheme.IconNames.CANCEL_FILLED
|
|
11169
|
+
}), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11170
|
+
css: styles$7.savingFailed
|
|
11171
|
+
}, {
|
|
11172
|
+
children: t("manage-defaults:status.savingFailed")
|
|
11173
|
+
}))]
|
|
11174
|
+
}));
|
|
11175
|
+
};
|
|
11176
|
+
|
|
11177
|
+
const styles$6 = createStyles({
|
|
11178
|
+
button: theme => ({
|
|
11179
|
+
backgroundColor: "transparent",
|
|
11180
|
+
padding: 0
|
|
11181
|
+
}),
|
|
11182
|
+
buttonContainer: theme => ({
|
|
11183
|
+
alignItems: "center",
|
|
11184
|
+
display: "flex",
|
|
11185
|
+
justifyContent: "left"
|
|
11186
|
+
}),
|
|
11187
|
+
icon: theme => ({
|
|
11188
|
+
color: theme.palette.secondary.main,
|
|
11189
|
+
position: "absolute",
|
|
11190
|
+
right: theme.spacing(1),
|
|
11191
|
+
top: theme.spacing(1)
|
|
11192
|
+
}),
|
|
11193
|
+
letter: theme => ({
|
|
11194
|
+
":hover": {
|
|
11195
|
+
border: `1px solid ${theme.palette.secondary.main}`
|
|
11196
|
+
},
|
|
11197
|
+
alignItems: "center",
|
|
11198
|
+
border: `1px solid ${theme.palette.gray.light}`,
|
|
11199
|
+
borderRadius: "10px",
|
|
11200
|
+
cursor: "pointer",
|
|
11201
|
+
display: "flex",
|
|
11202
|
+
flexDirection: "column",
|
|
11203
|
+
height: theme.spacing(31),
|
|
11204
|
+
marginRight: theme.spacing(3.5),
|
|
11205
|
+
position: "relative",
|
|
11206
|
+
width: theme.spacing(22)
|
|
11207
|
+
}),
|
|
11208
|
+
letterInner: theme => ({
|
|
11209
|
+
backgroundColor: "white",
|
|
11210
|
+
border: `1px solid ${theme.palette.gray.light}`,
|
|
11211
|
+
height: theme.spacing(14),
|
|
11212
|
+
marginBottom: theme.spacing(2),
|
|
11213
|
+
marginTop: theme.spacing(6),
|
|
11214
|
+
width: theme.spacing(10)
|
|
11215
|
+
}),
|
|
11216
|
+
letterLabel: theme => ({
|
|
11217
|
+
backgroundColor: "#95C2E0",
|
|
11218
|
+
height: theme.spacing(5),
|
|
11219
|
+
margin: theme.spacing(1.5)
|
|
11220
|
+
}),
|
|
11221
|
+
selectedLetter: theme => ({
|
|
11222
|
+
alignItems: "center",
|
|
11223
|
+
backgroundColor: "#EAF6FF",
|
|
11224
|
+
border: `1px solid ${theme.palette.secondary.main}`,
|
|
11225
|
+
borderRadius: "10px",
|
|
11226
|
+
boxShadow: `0 0 0 3px ${theme.palette.secondary.main}`,
|
|
11227
|
+
boxSizing: "border-box",
|
|
11228
|
+
cursor: "pointer",
|
|
11229
|
+
display: "flex",
|
|
11230
|
+
flexDirection: "column",
|
|
11231
|
+
height: theme.spacing(31),
|
|
11232
|
+
marginRight: theme.spacing(3.5),
|
|
11233
|
+
position: "relative",
|
|
11234
|
+
width: theme.spacing(22)
|
|
11235
|
+
}),
|
|
11236
|
+
selectedThermal: theme => ({
|
|
11237
|
+
alignItems: "center",
|
|
11238
|
+
backgroundColor: "#EAF6FF",
|
|
11239
|
+
border: `1px solid ${theme.palette.secondary.main}`,
|
|
11240
|
+
borderRadius: "10px",
|
|
11241
|
+
boxShadow: `0 0 0 3px ${theme.palette.secondary.main}`,
|
|
11242
|
+
cursor: "pointer",
|
|
11243
|
+
display: "flex",
|
|
11244
|
+
flexDirection: "column",
|
|
11245
|
+
height: theme.spacing(31),
|
|
11246
|
+
position: "relative",
|
|
11247
|
+
width: theme.spacing(22)
|
|
11248
|
+
}),
|
|
11249
|
+
thermal: theme => ({
|
|
11250
|
+
":hover": {
|
|
11251
|
+
border: `1px solid ${theme.palette.secondary.main}`
|
|
11252
|
+
},
|
|
11253
|
+
alignItems: "center",
|
|
11254
|
+
border: `1px solid ${theme.palette.gray.light}`,
|
|
11255
|
+
borderRadius: "10px",
|
|
11256
|
+
cursor: "pointer",
|
|
11257
|
+
display: "flex",
|
|
11258
|
+
flexDirection: "column",
|
|
11259
|
+
height: theme.spacing(31),
|
|
11260
|
+
position: "relative",
|
|
11261
|
+
width: theme.spacing(22)
|
|
11262
|
+
}),
|
|
11263
|
+
thermalIcon: theme => ({
|
|
11264
|
+
backgroundColor: "#95C2E0",
|
|
11265
|
+
height: theme.spacing(8),
|
|
11266
|
+
width: theme.spacing(5)
|
|
11267
|
+
}),
|
|
11268
|
+
thermalInner: theme => ({
|
|
11269
|
+
alignItems: "center",
|
|
11270
|
+
display: "flex",
|
|
11271
|
+
height: theme.spacing(14),
|
|
11272
|
+
justifyContent: "center",
|
|
11273
|
+
marginBottom: theme.spacing(2),
|
|
11274
|
+
marginTop: theme.spacing(6),
|
|
11275
|
+
width: theme.spacing(10)
|
|
11276
|
+
}),
|
|
11277
|
+
thermalLabel: theme => ({
|
|
11278
|
+
backgroundColor: "#95C2E0",
|
|
11279
|
+
height: theme.spacing(8),
|
|
11280
|
+
width: theme.spacing(5)
|
|
11281
|
+
})
|
|
11282
|
+
});
|
|
11283
|
+
|
|
11284
|
+
const LabelLayoutSettings = ({
|
|
11285
|
+
errors,
|
|
11286
|
+
isSaving,
|
|
11287
|
+
onChange
|
|
11288
|
+
}) => {
|
|
11289
|
+
var _a;
|
|
11290
|
+
const {
|
|
11291
|
+
t
|
|
11292
|
+
} = reactI18next.useTranslation(["common", "manage-defaults"]);
|
|
11293
|
+
const {
|
|
11294
|
+
data: accountSettings
|
|
11295
|
+
} = alchemy.useGetAccountSettings();
|
|
11296
|
+
const labelLayout = (_a = accountSettings === null || accountSettings === void 0 ? void 0 : accountSettings.defaultLabelLayout) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
11297
|
+
return jsxRuntime.jsx(Section, Object.assign({
|
|
11298
|
+
bold: true,
|
|
11299
|
+
rightContent: jsxRuntime.jsx(SaveStatus, {
|
|
11300
|
+
errors: errors,
|
|
11301
|
+
isSaving: isSaving
|
|
11302
|
+
}),
|
|
11303
|
+
title: t("manage-defaults:label.title")
|
|
11304
|
+
}, {
|
|
11305
|
+
children: jsxRuntime.jsxs("div", Object.assign({
|
|
11306
|
+
css: styles$6.buttonContainer
|
|
11307
|
+
}, {
|
|
11308
|
+
children: [jsxRuntime.jsx("button", Object.assign({
|
|
11309
|
+
css: styles$6.button,
|
|
11310
|
+
id: "letter",
|
|
11311
|
+
onClick: () => {
|
|
11312
|
+
onChange("Letter");
|
|
11313
|
+
},
|
|
11314
|
+
value: "letter"
|
|
11315
|
+
}, {
|
|
11316
|
+
children: jsxRuntime.jsxs("div", Object.assign({
|
|
11317
|
+
css: labelLayout === "letter" ? styles$6.selectedLetter : styles$6.letter
|
|
11318
|
+
}, {
|
|
11319
|
+
children: [labelLayout === "letter" && jsxRuntime.jsx(giger.Icon, {
|
|
11320
|
+
css: styles$6.icon,
|
|
11321
|
+
name: brands.IconNames.CHECK_FILLED
|
|
11322
|
+
}), jsxRuntime.jsx("div", Object.assign({
|
|
11323
|
+
css: styles$6.letterInner
|
|
11324
|
+
}, {
|
|
11325
|
+
children: jsxRuntime.jsx("div", {
|
|
11326
|
+
css: styles$6.letterLabel
|
|
11327
|
+
})
|
|
11328
|
+
})), jsxRuntime.jsx(giger.Typography, {
|
|
11329
|
+
children: t("manage-defaults:label.letter.title")
|
|
11330
|
+
}), jsxRuntime.jsx(Spacer, {
|
|
11331
|
+
multiplier: 0.5
|
|
11332
|
+
}), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11333
|
+
css: {
|
|
11334
|
+
color: "#6C757D"
|
|
11335
|
+
}
|
|
11336
|
+
}, {
|
|
11337
|
+
children: t("manage-defaults:label.letter.description")
|
|
11338
|
+
}))]
|
|
11339
|
+
}))
|
|
11340
|
+
})), jsxRuntime.jsx("button", Object.assign({
|
|
11341
|
+
css: styles$6.button,
|
|
11342
|
+
id: "4x6",
|
|
11343
|
+
onClick: e => {
|
|
11344
|
+
onChange(e.currentTarget.value);
|
|
11345
|
+
},
|
|
11346
|
+
value: "4x6"
|
|
11347
|
+
}, {
|
|
11348
|
+
children: jsxRuntime.jsxs("div", Object.assign({
|
|
11349
|
+
css: labelLayout === "4x6" ? styles$6.selectedThermal : styles$6.thermal
|
|
11350
|
+
}, {
|
|
11351
|
+
children: [labelLayout === "4x6" && jsxRuntime.jsx(giger.Icon, {
|
|
11352
|
+
css: styles$6.icon,
|
|
11353
|
+
name: brands.IconNames.CHECK_FILLED
|
|
11354
|
+
}), jsxRuntime.jsx("div", Object.assign({
|
|
11355
|
+
css: styles$6.thermalInner
|
|
11356
|
+
}, {
|
|
11357
|
+
children: jsxRuntime.jsx("div", {
|
|
11358
|
+
css: styles$6.thermalLabel
|
|
11359
|
+
})
|
|
11360
|
+
})), jsxRuntime.jsx(giger.Typography, {
|
|
11361
|
+
children: t("manage-defaults:label.thermal.title")
|
|
11362
|
+
}), jsxRuntime.jsx(Spacer, {
|
|
11363
|
+
multiplier: 0.5
|
|
11364
|
+
}), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11365
|
+
css: {
|
|
11366
|
+
color: "#6C757D"
|
|
11367
|
+
}
|
|
11368
|
+
}, {
|
|
11369
|
+
children: t("manage-defaults:label.thermal.description")
|
|
11370
|
+
}))]
|
|
11371
|
+
}))
|
|
11372
|
+
}))]
|
|
11373
|
+
}))
|
|
11374
|
+
}));
|
|
11375
|
+
};
|
|
11376
|
+
|
|
11377
|
+
const LabelLayout = ({
|
|
11378
|
+
display
|
|
11379
|
+
}) => {
|
|
11380
|
+
const {
|
|
11381
|
+
error: updateAccountSettingsErrors,
|
|
11382
|
+
isLoading: updatingAccountSettings,
|
|
11383
|
+
mutateAsync: updateAccountSettings
|
|
11384
|
+
} = alchemy.useUpdateAccountSettings();
|
|
11385
|
+
const {
|
|
11386
|
+
refetch: refreshAccountSettings
|
|
11387
|
+
} = alchemy.useGetAccountSettings();
|
|
11388
|
+
const handleSubmitUpdateAccountSettings = newLabelLayout => __awaiter(void 0, void 0, void 0, function* () {
|
|
11389
|
+
try {
|
|
11390
|
+
yield updateAccountSettings({
|
|
11391
|
+
defaultLabelLayout: newLabelLayout
|
|
11392
|
+
});
|
|
11393
|
+
} catch (error) {
|
|
11394
|
+
console.error(error);
|
|
11395
|
+
}
|
|
11396
|
+
yield refreshAccountSettings();
|
|
11397
|
+
});
|
|
11398
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
11399
|
+
children: [display === "settings" && jsxRuntime.jsx(LabelLayoutSettings, {
|
|
11400
|
+
errors: updateAccountSettingsErrors,
|
|
11401
|
+
isSaving: updatingAccountSettings,
|
|
11402
|
+
onChange: handleSubmitUpdateAccountSettings
|
|
11403
|
+
}), display === "purchase" && jsxRuntime.jsx(LabelLayoutPurchase, {
|
|
11404
|
+
onChange: handleSubmitUpdateAccountSettings
|
|
11405
|
+
})]
|
|
11406
|
+
});
|
|
11407
|
+
};
|
|
11408
|
+
|
|
11409
|
+
const styles$5 = createStyles({
|
|
11410
|
+
fundAndPurchase: theme => ({
|
|
11411
|
+
borderTop: `1px solid ${theme.palette.gray.ultraLight}`
|
|
11412
|
+
}),
|
|
11413
|
+
ratesInterstitial: {
|
|
11414
|
+
alignItems: "center",
|
|
11415
|
+
display: "flex",
|
|
11416
|
+
flexDirection: "column",
|
|
11417
|
+
justifyContent: "center",
|
|
11418
|
+
textAlign: "center"
|
|
11419
|
+
},
|
|
11420
|
+
showMoreOrLessRatesButton: {
|
|
11421
|
+
alignItems: "center",
|
|
11422
|
+
display: "flex"
|
|
11423
|
+
}
|
|
11424
|
+
});
|
|
11425
|
+
|
|
11426
|
+
const rateSchema = zod.z.object({
|
|
11427
|
+
rate: zod.z.object({
|
|
11428
|
+
isAcknowledged: zod.z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
|
|
10802
11429
|
rateId: zod.z.string()
|
|
10803
11430
|
})
|
|
10804
11431
|
}).transform(schema => schema.rate.rateId);
|
|
10805
11432
|
|
|
11433
|
+
var _path, _path2;
|
|
11434
|
+
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); }
|
|
11435
|
+
var SvgShipengineLogo = function SvgShipengineLogo(props) {
|
|
11436
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
11437
|
+
width: 244,
|
|
11438
|
+
height: 31,
|
|
11439
|
+
fill: "none",
|
|
11440
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11441
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
11442
|
+
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",
|
|
11443
|
+
fill: "#45AAF2"
|
|
11444
|
+
})), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
11445
|
+
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",
|
|
11446
|
+
fill: "#162948"
|
|
11447
|
+
})));
|
|
11448
|
+
};
|
|
11449
|
+
|
|
11450
|
+
const styles$4 = createStyles({
|
|
11451
|
+
poweredByShipEngine: {
|
|
11452
|
+
display: "flex",
|
|
11453
|
+
alignItems: "center",
|
|
11454
|
+
justifyContent: "center",
|
|
11455
|
+
textAlign: "center",
|
|
11456
|
+
margin: "1rem 0",
|
|
11457
|
+
gap: "1rem",
|
|
11458
|
+
color: "#818F9C"
|
|
11459
|
+
}
|
|
11460
|
+
});
|
|
11461
|
+
|
|
11462
|
+
const PoweredByShipEngine = () => {
|
|
11463
|
+
const {
|
|
11464
|
+
t
|
|
11465
|
+
} = reactI18next.useTranslation();
|
|
11466
|
+
return jsxRuntime.jsxs("div", Object.assign({
|
|
11467
|
+
css: styles$4.poweredByShipEngine
|
|
11468
|
+
}, {
|
|
11469
|
+
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11470
|
+
variant: "subtitle1"
|
|
11471
|
+
}, {
|
|
11472
|
+
children: t("powered-by")
|
|
11473
|
+
})), jsxRuntime.jsx(SvgShipengineLogo, {})]
|
|
11474
|
+
}));
|
|
11475
|
+
};
|
|
11476
|
+
|
|
10806
11477
|
const RateForm = ({
|
|
10807
11478
|
carriers,
|
|
10808
11479
|
disabled,
|
|
@@ -10811,6 +11482,8 @@ const RateForm = ({
|
|
|
10811
11482
|
displayableLabelErrors,
|
|
10812
11483
|
features,
|
|
10813
11484
|
labelErrors,
|
|
11485
|
+
labels,
|
|
11486
|
+
labelsLoading,
|
|
10814
11487
|
isLoading,
|
|
10815
11488
|
onSave,
|
|
10816
11489
|
onSelectRate,
|
|
@@ -10821,6 +11494,7 @@ const RateForm = ({
|
|
|
10821
11494
|
}) => {
|
|
10822
11495
|
features = Object.assign({
|
|
10823
11496
|
enableGlobalPostFiltering: false,
|
|
11497
|
+
labelLayout: false,
|
|
10824
11498
|
nicknameRate: true,
|
|
10825
11499
|
saveRate: true
|
|
10826
11500
|
}, features !== null && features !== void 0 ? features : {});
|
|
@@ -10885,6 +11559,14 @@ const RateForm = ({
|
|
|
10885
11559
|
index < 5 && rateOptions.length <= 6 || !option.requiresAcknowledgement && index < 6 && rateOptions.length > 6 || option.rateId === selectedRateId), [rateOptions, selectedRateId]);
|
|
10886
11560
|
// When rateOptions update, handle scrolling and single-rate auto-selection and form reset
|
|
10887
11561
|
React.useEffect(() => {
|
|
11562
|
+
if (!(rateOptions === null || rateOptions === void 0 ? void 0 : rateOptions.length)) {
|
|
11563
|
+
form.setValue("rate", {
|
|
11564
|
+
isAcknowledged: false,
|
|
11565
|
+
rateId: ""
|
|
11566
|
+
}, {
|
|
11567
|
+
shouldDirty: true
|
|
11568
|
+
});
|
|
11569
|
+
}
|
|
10888
11570
|
if (rateOptions.length === 1) {
|
|
10889
11571
|
form.setValue("rate", {
|
|
10890
11572
|
isAcknowledged: !rateOptions[0].requiresAcknowledgement,
|
|
@@ -10918,6 +11600,7 @@ const RateForm = ({
|
|
|
10918
11600
|
children: [!isLoading && !!rateOptions.length ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10919
11601
|
children: [jsxRuntime.jsx(RateSelect, {
|
|
10920
11602
|
control: form.control,
|
|
11603
|
+
displayErrors: false,
|
|
10921
11604
|
label: "Rate",
|
|
10922
11605
|
name: "rate",
|
|
10923
11606
|
nicknameFeature:
|
|
@@ -10926,7 +11609,7 @@ const RateForm = ({
|
|
|
10926
11609
|
onClick: onSelectRate,
|
|
10927
11610
|
options: showHiddenRates ? rateOptions : filteredRateOptions
|
|
10928
11611
|
}), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsxRuntime.jsx(giger.Link, Object.assign({
|
|
10929
|
-
css: styles$
|
|
11612
|
+
css: styles$5.showMoreOrLessRatesButton,
|
|
10930
11613
|
onClick: () => {
|
|
10931
11614
|
var _a;
|
|
10932
11615
|
setShowHiddenRates(!showHiddenRates);
|
|
@@ -10947,7 +11630,7 @@ const RateForm = ({
|
|
|
10947
11630
|
}))
|
|
10948
11631
|
}))]
|
|
10949
11632
|
}) : !isLoading && !!allDisplayableErrors.length ? null : jsxRuntime.jsxs("article", Object.assign({
|
|
10950
|
-
css: styles$
|
|
11633
|
+
css: styles$5.ratesInterstitial,
|
|
10951
11634
|
role: "presentation"
|
|
10952
11635
|
}, {
|
|
10953
11636
|
children: [jsxRuntime.jsx(Cube, {
|
|
@@ -10961,17 +11644,23 @@ const RateForm = ({
|
|
|
10961
11644
|
children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
|
|
10962
11645
|
})
|
|
10963
11646
|
}))]
|
|
11647
|
+
})), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsxRuntime.jsx(Section, Object.assign({
|
|
11648
|
+
title: t("manage-defaults:label.title")
|
|
11649
|
+
}, {
|
|
11650
|
+
children: jsxRuntime.jsx(LabelLayout, {
|
|
11651
|
+
display: "purchase"
|
|
11652
|
+
})
|
|
10964
11653
|
})), jsxRuntime.jsx(FundAndPurchase, {
|
|
10965
11654
|
carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
|
|
10966
11655
|
control: form.control,
|
|
10967
|
-
css: styles$
|
|
11656
|
+
css: styles$5.fundAndPurchase,
|
|
10968
11657
|
disabled: disabled,
|
|
10969
11658
|
isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
|
|
10970
11659
|
isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
|
|
10971
11660
|
onPurchase: handleSubmit,
|
|
10972
11661
|
onSave: handleSaveRate,
|
|
10973
11662
|
purchaseAmount: getTotalRateAmount(selectedRate)
|
|
10974
|
-
})]
|
|
11663
|
+
}), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
|
|
10975
11664
|
}));
|
|
10976
11665
|
};
|
|
10977
11666
|
|
|
@@ -11536,13 +12225,10 @@ const ShipmentForm = ({
|
|
|
11536
12225
|
} = reactI18next.useTranslation(["purchase-label"]);
|
|
11537
12226
|
const [requireMeasurements, setRequireMeasurements] = React.useState(true);
|
|
11538
12227
|
const [insuranceEnabled, setInsuranceEnabled] = React.useState(false);
|
|
11539
|
-
const
|
|
11540
|
-
|
|
11541
|
-
|
|
11542
|
-
|
|
11543
|
-
var _a;
|
|
11544
|
-
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";
|
|
11545
|
-
}, [shipment]);
|
|
12228
|
+
const {
|
|
12229
|
+
isContentDescriptionRequired,
|
|
12230
|
+
isCustomsRequired
|
|
12231
|
+
} = useShipmentMetadata(shipment);
|
|
11546
12232
|
const shipmentSchema = React.useMemo(() => getShipmentSchema({
|
|
11547
12233
|
isContentDescriptionRequired,
|
|
11548
12234
|
isCustomsRequired,
|
|
@@ -11553,7 +12239,7 @@ const ShipmentForm = ({
|
|
|
11553
12239
|
const form = reactHookForm.useForm({
|
|
11554
12240
|
defaultValues: {
|
|
11555
12241
|
__mode: features.browseRates ? "browse_rates" : "select_service",
|
|
11556
|
-
shipDate: minimumShipDate
|
|
12242
|
+
shipDate: formatUSADate(minimumShipDate || new Date())
|
|
11557
12243
|
},
|
|
11558
12244
|
resolver: validationResolver(shipmentSchema)
|
|
11559
12245
|
});
|
|
@@ -11578,10 +12264,6 @@ const ShipmentForm = ({
|
|
|
11578
12264
|
return (carriers !== null && carriers !== void 0 ? carriers : []).filter(c => carrierIds.includes(c.carrierId));
|
|
11579
12265
|
}, [carrierIds, carriers, selectedMode]);
|
|
11580
12266
|
const nonAddressValidationErrors = errors === null || errors === void 0 ? void 0 : errors.filter(e => e.errorCode !== "invalid_address");
|
|
11581
|
-
const isInternationalShipment = React.useMemo(() => {
|
|
11582
|
-
return shipment ? getIsInternationalShipment(shipment) : false;
|
|
11583
|
-
}, [shipment]);
|
|
11584
|
-
const isPoBoxShipment = React.useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
|
|
11585
12267
|
const confirmationOptions = useConfirmationOptions();
|
|
11586
12268
|
const customsContentsOptions = useCustomsContentsOptions();
|
|
11587
12269
|
const customsNonDeliveryOptions = useCustomsNonDeliveryOptions();
|
|
@@ -11589,9 +12271,9 @@ const ShipmentForm = ({
|
|
|
11589
12271
|
includeShipsuranceInsurance: features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance,
|
|
11590
12272
|
includeThirdPartyInsurance: features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance
|
|
11591
12273
|
});
|
|
11592
|
-
const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes,
|
|
11593
|
-
const serviceCodeOptions = useServiceCodeOptions(carriers,
|
|
11594
|
-
const shippingPresetOptions = useShippingPresetsOptions(shippingPresets,
|
|
12274
|
+
const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes, shipment);
|
|
12275
|
+
const serviceCodeOptions = useServiceCodeOptions(carriers, shipment);
|
|
12276
|
+
const shippingPresetOptions = useShippingPresetsOptions(shippingPresets, shipment);
|
|
11595
12277
|
const warehouseOptions = useWarehouseOptions(warehouses);
|
|
11596
12278
|
const [showItems, setShowItems] = React.useState(false);
|
|
11597
12279
|
const [showApplyPreset, setShowApplyPreset] = React.useState(false);
|
|
@@ -11689,7 +12371,7 @@ const ShipmentForm = ({
|
|
|
11689
12371
|
carrierId: updatedShipment.carrierId,
|
|
11690
12372
|
serviceCode: updatedShipment.serviceCode
|
|
11691
12373
|
} : undefined,
|
|
11692
|
-
shipDate: mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate)
|
|
12374
|
+
shipDate: formatUSADate(mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate)),
|
|
11693
12375
|
shipmentId: updatedShipment.shipmentId,
|
|
11694
12376
|
warehouseId: updatedShipment.warehouseId
|
|
11695
12377
|
}));
|
|
@@ -11851,6 +12533,7 @@ const ShipmentForm = ({
|
|
|
11851
12533
|
});
|
|
11852
12534
|
if (errors) throw new Error(errors.map(e => e.message).join(", "));
|
|
11853
12535
|
if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
|
|
12536
|
+
const isEmptyShipTo = Object.entries(shipment.shipTo).every(([key, value]) => key === "countryCode" || [null, "", "unknown"].includes(value));
|
|
11854
12537
|
return jsxRuntime.jsxs("form", Object.assign({
|
|
11855
12538
|
id: "shipment-form",
|
|
11856
12539
|
onSubmit: formLogger.capture(handleSubmit)
|
|
@@ -11874,7 +12557,12 @@ const ShipmentForm = ({
|
|
|
11874
12557
|
}), jsxRuntime.jsx(FieldLabel, Object.assign({
|
|
11875
12558
|
label: !isEditShipFormToOpen ? "purchase-label:fields.shipTo" : ""
|
|
11876
12559
|
}, {
|
|
11877
|
-
children: !isEditShipFormToOpen && (
|
|
12560
|
+
children: !isEditShipFormToOpen && (isEmptyShipTo ? jsxRuntime.jsx(giger.Button, Object.assign({
|
|
12561
|
+
onClick: toggleIsEditShipFormToOpen,
|
|
12562
|
+
variant: giger.ButtonVariant.OUTLINED
|
|
12563
|
+
}, {
|
|
12564
|
+
children: t("purchase-label:fields:addShipToAddress")
|
|
12565
|
+
})) : addressPreference ? jsxRuntime.jsx(AddressPreferenceDisplay, {
|
|
11878
12566
|
addressPreference: addressPreference,
|
|
11879
12567
|
onChangePreference: handleChangePreference,
|
|
11880
12568
|
onEditAddress: () => {
|
|
@@ -12479,7 +13167,7 @@ const Shipment = ({
|
|
|
12479
13167
|
})), "representative."]
|
|
12480
13168
|
}))
|
|
12481
13169
|
}))
|
|
12482
|
-
}))]
|
|
13170
|
+
})), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
|
|
12483
13171
|
});
|
|
12484
13172
|
};
|
|
12485
13173
|
|
|
@@ -12507,115 +13195,6 @@ const SuspendShipment = ({
|
|
|
12507
13195
|
}));
|
|
12508
13196
|
};
|
|
12509
13197
|
|
|
12510
|
-
const VoidLabel = ({
|
|
12511
|
-
onComplete,
|
|
12512
|
-
onSubmit,
|
|
12513
|
-
onViewShipment,
|
|
12514
|
-
shipment,
|
|
12515
|
-
voidRequest
|
|
12516
|
-
}) => {
|
|
12517
|
-
const {
|
|
12518
|
-
t
|
|
12519
|
-
} = reactI18next.useTranslation(["common", "void-label"]);
|
|
12520
|
-
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
12521
|
-
const handleSubmit = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
12522
|
-
setIsSubmitting(true);
|
|
12523
|
-
yield onSubmit();
|
|
12524
|
-
setIsSubmitting(false);
|
|
12525
|
-
}), [onSubmit]);
|
|
12526
|
-
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12527
|
-
children: [jsxRuntime.jsx(Section, {
|
|
12528
|
-
children: voidRequest ? jsxRuntime.jsxs("section", Object.assign({
|
|
12529
|
-
css: {
|
|
12530
|
-
textAlign: "center",
|
|
12531
|
-
width: "100%"
|
|
12532
|
-
}
|
|
12533
|
-
}, {
|
|
12534
|
-
children: [jsxRuntime.jsx(giger.Icon, {
|
|
12535
|
-
css: theme => ({
|
|
12536
|
-
color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
|
|
12537
|
-
}),
|
|
12538
|
-
name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? gigerTheme.IconNames.CHECK_FILLED : gigerTheme.IconNames.ALERT,
|
|
12539
|
-
size: giger.IconSize.SIZE_LARGE
|
|
12540
|
-
}), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12541
|
-
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
12542
|
-
component: "h2"
|
|
12543
|
-
}, {
|
|
12544
|
-
children: t("void-label:resultTitles.approved")
|
|
12545
|
-
})), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
12546
|
-
variant: "body1"
|
|
12547
|
-
}, {
|
|
12548
|
-
children: t("void-label:resultMessages.approved")
|
|
12549
|
-
}))]
|
|
12550
|
-
}) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12551
|
-
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
12552
|
-
component: "h2"
|
|
12553
|
-
}, {
|
|
12554
|
-
children: t("void-label:resultTitles.rejected")
|
|
12555
|
-
})), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
12556
|
-
variant: "body1"
|
|
12557
|
-
}, {
|
|
12558
|
-
children: jsxRuntime.jsx("p", {
|
|
12559
|
-
dangerouslySetInnerHTML: {
|
|
12560
|
-
__html: t("void-label:resultMessages.rejected")
|
|
12561
|
-
}
|
|
12562
|
-
})
|
|
12563
|
-
}))]
|
|
12564
|
-
})]
|
|
12565
|
-
})) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12566
|
-
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
12567
|
-
variant: "body1"
|
|
12568
|
-
}, {
|
|
12569
|
-
children: t("void-label:refund_process")
|
|
12570
|
-
})), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
12571
|
-
component: "p",
|
|
12572
|
-
variant: "body1"
|
|
12573
|
-
}, {
|
|
12574
|
-
children: t("void-label:refund_rules")
|
|
12575
|
-
}))]
|
|
12576
|
-
})
|
|
12577
|
-
}), jsxRuntime.jsx(giger.BottomSheet, Object.assign({
|
|
12578
|
-
alwaysVisible: true,
|
|
12579
|
-
css: theme => ({
|
|
12580
|
-
borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
|
|
12581
|
-
boxShadow: "none",
|
|
12582
|
-
position: "static"
|
|
12583
|
-
})
|
|
12584
|
-
}, {
|
|
12585
|
-
children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
|
|
12586
|
-
// Label has been voided
|
|
12587
|
-
jsxRuntime.jsxs(ButtonGroup, {
|
|
12588
|
-
children: [jsxRuntime.jsx(giger.Button, Object.assign({
|
|
12589
|
-
bold: false,
|
|
12590
|
-
onClick: () => shipment && onComplete(voidRequest, shipment),
|
|
12591
|
-
type: "button",
|
|
12592
|
-
variant: giger.ButtonVariant.OUTLINED
|
|
12593
|
-
}, {
|
|
12594
|
-
children: t("void-label:actions.complete")
|
|
12595
|
-
})), jsxRuntime.jsx(giger.Button, Object.assign({
|
|
12596
|
-
bold: false,
|
|
12597
|
-
isFullWidth: true,
|
|
12598
|
-
onClick: () => shipment && onViewShipment(shipment),
|
|
12599
|
-
type: "button"
|
|
12600
|
-
}, {
|
|
12601
|
-
children: t("void-label:actions.viewShipment")
|
|
12602
|
-
}))]
|
|
12603
|
-
}) :
|
|
12604
|
-
// Label has not yet been voided
|
|
12605
|
-
jsxRuntime.jsx(giger.Button, Object.assign({
|
|
12606
|
-
bold: false,
|
|
12607
|
-
disabled: isSubmitting,
|
|
12608
|
-
isFullWidth: true,
|
|
12609
|
-
isLoading: isSubmitting,
|
|
12610
|
-
onClick: handleSubmit,
|
|
12611
|
-
type: "submit"
|
|
12612
|
-
}, {
|
|
12613
|
-
children: t("void-label:actions.confirmVoid")
|
|
12614
|
-
}))
|
|
12615
|
-
}))]
|
|
12616
|
-
});
|
|
12617
|
-
};
|
|
12618
|
-
|
|
12619
13198
|
var index = /*#__PURE__*/Object.freeze({
|
|
12620
13199
|
__proto__: null,
|
|
12621
13200
|
AddCarrierForm: AddCarrierForm,
|
|
@@ -12648,9 +13227,8 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
12648
13227
|
Shipment: Shipment,
|
|
12649
13228
|
SuspendShipment: SuspendShipment,
|
|
12650
13229
|
WarehouseForm: WarehouseForm,
|
|
12651
|
-
VoidLabel: VoidLabel,
|
|
12652
13230
|
WalletForm: WalletForm,
|
|
12653
|
-
styles: styles$
|
|
13231
|
+
styles: styles$d,
|
|
12654
13232
|
billingAddressSchema: billingAddressSchema,
|
|
12655
13233
|
walletSchema: walletSchema,
|
|
12656
13234
|
BillingFields: BillingFields,
|
|
@@ -12935,6 +13513,7 @@ const DateRangeCombo = ({
|
|
|
12935
13513
|
dateFormat: "MM/dd/yyyy",
|
|
12936
13514
|
isClearable: true,
|
|
12937
13515
|
label: t("wallet-history:actions.chooseDate"),
|
|
13516
|
+
locale: LOCALE,
|
|
12938
13517
|
maxDate: new Date(),
|
|
12939
13518
|
onClickConfirm: dates => {
|
|
12940
13519
|
if (Array.isArray(dates) && dates.length === 2 && dates[1] !== null) handleConfirmCustomRange(dates);
|
|
@@ -13197,9 +13776,11 @@ var common = {
|
|
|
13197
13776
|
invalidNameOrCompany: "Recipient name and company name (if provided) must have two characters in first and last name.",
|
|
13198
13777
|
noWarehouses: "You must have an active Ship From Location to use this feature.",
|
|
13199
13778
|
unableToLoad: {
|
|
13779
|
+
accountSettings: "Unable to load account settings",
|
|
13200
13780
|
autoFundingSettings: "Unable to load auto funding settings",
|
|
13201
13781
|
carrier: "Unable to load carrier",
|
|
13202
13782
|
carriers: "Unable to load carriers",
|
|
13783
|
+
label: "Unable to load label",
|
|
13203
13784
|
salesOrder: "Unable to load order",
|
|
13204
13785
|
shipment: "Unable to load shipment",
|
|
13205
13786
|
warehouses: "Unable to load warehouses"
|
|
@@ -13225,10 +13806,12 @@ var common = {
|
|
|
13225
13806
|
thirdParty: "Third Party"
|
|
13226
13807
|
},
|
|
13227
13808
|
loading: {
|
|
13809
|
+
accountSettings: "Loading account settings...",
|
|
13228
13810
|
carrier: "Loading carrier...",
|
|
13229
13811
|
carriers: "Loading carriers...",
|
|
13230
13812
|
data: "Loading...",
|
|
13231
13813
|
importingSalesOrder: "Importing order...",
|
|
13814
|
+
label: "Loading label...",
|
|
13232
13815
|
onboarding: "Loading onboarding...",
|
|
13233
13816
|
salesOrder: "Loading order...",
|
|
13234
13817
|
shipment: "Loading shipment...",
|
|
@@ -13255,6 +13838,7 @@ var common = {
|
|
|
13255
13838
|
packageCodes: {
|
|
13256
13839
|
"package": "Custom"
|
|
13257
13840
|
},
|
|
13841
|
+
"powered-by": "Powered by",
|
|
13258
13842
|
schema: {
|
|
13259
13843
|
optionalLabel: "{{fieldLabel}} (optional)"
|
|
13260
13844
|
},
|
|
@@ -13325,21 +13909,8 @@ var listCarriers$1 = {
|
|
|
13325
13909
|
|
|
13326
13910
|
var manageDefaults = {
|
|
13327
13911
|
"manage-defaults": {
|
|
13328
|
-
units: {
|
|
13329
|
-
title: "Units of Measure",
|
|
13330
|
-
dimensions: {
|
|
13331
|
-
title: "Dimensions",
|
|
13332
|
-
standard: "Inches",
|
|
13333
|
-
metric: "Centimeters"
|
|
13334
|
-
},
|
|
13335
|
-
weight: {
|
|
13336
|
-
title: "Weight",
|
|
13337
|
-
standard: "Pounds & Ounces",
|
|
13338
|
-
g: "Grams",
|
|
13339
|
-
kg: "Kilograms"
|
|
13340
|
-
}
|
|
13341
|
-
},
|
|
13342
13912
|
label: {
|
|
13913
|
+
title: "Label Printing",
|
|
13343
13914
|
letter: {
|
|
13344
13915
|
title: "Letter (8.5 x 11 inch)",
|
|
13345
13916
|
description: "For desktop printers"
|
|
@@ -13351,8 +13922,26 @@ var manageDefaults = {
|
|
|
13351
13922
|
thermal: {
|
|
13352
13923
|
title: "Thermal (4 x 6 inch)",
|
|
13353
13924
|
description: "For label printers"
|
|
13925
|
+
}
|
|
13926
|
+
},
|
|
13927
|
+
status: {
|
|
13928
|
+
saving: "Saving...",
|
|
13929
|
+
saved: "Saved",
|
|
13930
|
+
savingFailed: "Saving Failed"
|
|
13931
|
+
},
|
|
13932
|
+
units: {
|
|
13933
|
+
title: "Units of Measure",
|
|
13934
|
+
dimensions: {
|
|
13935
|
+
title: "Dimensions",
|
|
13936
|
+
standard: "Inches",
|
|
13937
|
+
metric: "Centimeters"
|
|
13354
13938
|
},
|
|
13355
|
-
|
|
13939
|
+
weight: {
|
|
13940
|
+
title: "Weight",
|
|
13941
|
+
standard: "Pounds & Ounces",
|
|
13942
|
+
g: "Grams",
|
|
13943
|
+
kg: "Kilograms"
|
|
13944
|
+
}
|
|
13356
13945
|
}
|
|
13357
13946
|
}
|
|
13358
13947
|
};
|
|
@@ -13513,6 +14102,7 @@ var purchaseLabel$1 = {
|
|
|
13513
14102
|
shipDate: "Ship Date",
|
|
13514
14103
|
service: "Service",
|
|
13515
14104
|
shipTo: "Ship To",
|
|
14105
|
+
addShipToAddress: "Add Ship To Address",
|
|
13516
14106
|
warehouse: "Ship From",
|
|
13517
14107
|
weight: {
|
|
13518
14108
|
whole: "Pounds",
|
|
@@ -13538,7 +14128,8 @@ var purchaseLabel$1 = {
|
|
|
13538
14128
|
needToAcknowledge: "Need to accept Rate Compliance Agreement"
|
|
13539
14129
|
},
|
|
13540
14130
|
rates: {
|
|
13541
|
-
uspsMediaMailAcknowledgement: "I confirm that this package is compliant with <1>USPS guidelines for Media Mail®</1>"
|
|
14131
|
+
uspsMediaMailAcknowledgement: "I confirm that this package is compliant with <1>USPS guidelines for Media Mail®</1>",
|
|
14132
|
+
uspsFirstClassMailAcknowledgement_leof: "I understand the limitations and confirm that this package is compliant with USPS guidelines for First Class Mail Large Envelopes or Flats."
|
|
13542
14133
|
},
|
|
13543
14134
|
shipToAddressFormFields: "Ship To Address Form Fields",
|
|
13544
14135
|
sections: {
|
|
@@ -13647,6 +14238,9 @@ var voidLabel$1 = {
|
|
|
13647
14238
|
confirmVoid: "Confirm Void",
|
|
13648
14239
|
viewShipment: "View Shipment"
|
|
13649
14240
|
},
|
|
14241
|
+
errorMessages: {
|
|
14242
|
+
labelIdRequired: "A label id is required"
|
|
14243
|
+
},
|
|
13650
14244
|
resultMessages: {
|
|
13651
14245
|
approved: "Your refund request has been submitted to the carrier.",
|
|
13652
14246
|
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."
|
|
@@ -14148,7 +14742,7 @@ const useScrubErrors = ({
|
|
|
14148
14742
|
};
|
|
14149
14743
|
|
|
14150
14744
|
var usps_first_class_mail = [
|
|
14151
|
-
"First Class Mail
|
|
14745
|
+
"First Class Mail shipments must weigh less than {{weight}} oz. Shipments exceeding the weight entered when buying the label will be charged an adjustment fee by USPS."
|
|
14152
14746
|
];
|
|
14153
14747
|
var usps_media_mail = [
|
|
14154
14748
|
"Media Mail® can only be used for shipping books, sound recordings, manuscripts, printed music, and other media in packages weighing 70 lbs. or less. Packages containing unsupported items may be subject to post-billing adjustment fees or returned to the sender."
|
|
@@ -14188,7 +14782,7 @@ var rateMessages = {
|
|
|
14188
14782
|
"First Class Mail letter is not eligible for USPS tracking nor refund if unused. If the package weight exceeds the weight provided when buying the label, USPS will charge an adjustment fee."
|
|
14189
14783
|
],
|
|
14190
14784
|
"usps_first_class_mail:large_envelope_or_flat": [
|
|
14191
|
-
"
|
|
14785
|
+
"Tracking and refunds are not available for First Class Mail Large Envelopes or Flats labels."
|
|
14192
14786
|
],
|
|
14193
14787
|
usps_first_class_mail: usps_first_class_mail,
|
|
14194
14788
|
usps_media_mail: usps_media_mail,
|
|
@@ -14197,10 +14791,25 @@ var rateMessages = {
|
|
|
14197
14791
|
usps_priority_mail_express: usps_priority_mail_express,
|
|
14198
14792
|
ups_ground: ups_ground,
|
|
14199
14793
|
ups_2nd_day_air: ups_2nd_day_air,
|
|
14794
|
+
"ups_2nd_day_air:Saturday": [
|
|
14795
|
+
"Additional fees may apply post-delivery if picked up on a Saturday."
|
|
14796
|
+
],
|
|
14200
14797
|
ups_next_day_air_saver: ups_next_day_air_saver,
|
|
14798
|
+
"ups_next_day_air_saver:Saturday": [
|
|
14799
|
+
"Additional fees may apply post-delivery if picked up on a Saturday."
|
|
14800
|
+
],
|
|
14201
14801
|
ups_next_day_air: ups_next_day_air,
|
|
14802
|
+
"ups_next_day_air:Saturday": [
|
|
14803
|
+
"Additional fees may apply post-delivery if picked up on a Saturday."
|
|
14804
|
+
],
|
|
14202
14805
|
ups_next_day_air_early_am: ups_next_day_air_early_am,
|
|
14806
|
+
"ups_next_day_air_early_am:Saturday": [
|
|
14807
|
+
"Additional fees may apply post-delivery if picked up on a Saturday."
|
|
14808
|
+
],
|
|
14203
14809
|
ups_2nd_day_air_am: ups_2nd_day_air_am,
|
|
14810
|
+
"ups_2nd_day_air_am:Saturday": [
|
|
14811
|
+
"Additional fees may apply post-delivery if picked up on a Saturday."
|
|
14812
|
+
],
|
|
14204
14813
|
ups_3_day_select: ups_3_day_select
|
|
14205
14814
|
};
|
|
14206
14815
|
|
|
@@ -14234,16 +14843,24 @@ const useRequestRates = ({
|
|
|
14234
14843
|
if (result) yield onRatesCalculated === null || onRatesCalculated === void 0 ? void 0 : onRatesCalculated(result.rateResponse.rates, shipment);
|
|
14235
14844
|
}), [calculateRates, carriers, customPackageTypes, onRatesCalculated]);
|
|
14236
14845
|
let ratesResponse = ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.rateResponse;
|
|
14846
|
+
const shipDay = React.useMemo(() => {
|
|
14847
|
+
if (ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.shipDate) {
|
|
14848
|
+
return omitTime(ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.shipDate).toLocaleString("en-us", {
|
|
14849
|
+
weekday: "long"
|
|
14850
|
+
});
|
|
14851
|
+
}
|
|
14852
|
+
return;
|
|
14853
|
+
}, [ratedShipment]);
|
|
14237
14854
|
ratesResponse = React.useMemo(() => ratesResponse && Object.assign(Object.assign({}, ratesResponse), {
|
|
14238
14855
|
rates: ratesResponse.rates.map(rate => {
|
|
14239
|
-
var _a, _b;
|
|
14856
|
+
var _a, _b, _c;
|
|
14240
14857
|
return Object.assign(Object.assign({}, rate), {
|
|
14241
14858
|
warningMessages: [
|
|
14242
|
-
// add additional rateMessages based on combinations of serviceCode and
|
|
14243
|
-
...((_a = rateMessages[`${rate.serviceCode}:${
|
|
14859
|
+
// add additional rateMessages based on combinations of serviceCode, packageType and shipDay
|
|
14860
|
+
...((_a = rateMessages[`${rate.serviceCode}:${shipDay}`]) !== null && _a !== void 0 ? _a : []), ...((_b = rateMessages[`${rate.serviceCode}:${rate.packageType}`]) !== null && _b !== void 0 ? _b : []), ...((_c = rateMessages[rate.serviceCode]) !== null && _c !== void 0 ? _c : []), ...rate.warningMessages]
|
|
14244
14861
|
});
|
|
14245
14862
|
})
|
|
14246
|
-
}), [ratesResponse]);
|
|
14863
|
+
}), [ratesResponse, shipDay]);
|
|
14247
14864
|
return {
|
|
14248
14865
|
ratesCalculating,
|
|
14249
14866
|
ratesErrors,
|
|
@@ -14302,6 +14919,10 @@ const useRatesForm = ({
|
|
|
14302
14919
|
const {
|
|
14303
14920
|
data: carriers
|
|
14304
14921
|
} = alchemy.useListCarriers();
|
|
14922
|
+
const {
|
|
14923
|
+
data: labels,
|
|
14924
|
+
isLoading: labelsLoading
|
|
14925
|
+
} = alchemy.useListLabels();
|
|
14305
14926
|
const {
|
|
14306
14927
|
mutateAsync: updateShipment
|
|
14307
14928
|
} = alchemy.useUpdateSalesOrderShipment();
|
|
@@ -14402,6 +15023,8 @@ const useRatesForm = ({
|
|
|
14402
15023
|
errors: errors.length > 0 ? errors : undefined,
|
|
14403
15024
|
isLoading: ratesCalculating,
|
|
14404
15025
|
labelErrors: (labelErrors === null || labelErrors === void 0 ? void 0 : labelErrors.length) ? labelErrors : undefined,
|
|
15026
|
+
labels,
|
|
15027
|
+
labelsLoading,
|
|
14405
15028
|
onSave: handleSave,
|
|
14406
15029
|
onSubmit: handleSubmit,
|
|
14407
15030
|
rates: ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.rates,
|
|
@@ -14784,15 +15407,61 @@ const PurchaseLabelBySalesOrder = _a => {
|
|
|
14784
15407
|
}));
|
|
14785
15408
|
};
|
|
14786
15409
|
|
|
14787
|
-
|
|
14788
|
-
|
|
14789
|
-
|
|
15410
|
+
let shipmentsCreated = 0;
|
|
15411
|
+
const useGetOrCreateShipment = shipmentId => {
|
|
15412
|
+
const {
|
|
15413
|
+
client
|
|
15414
|
+
} = alchemy.useShipEngine();
|
|
15415
|
+
const shipmentCreation = React.useMemo(() => {
|
|
15416
|
+
return ++shipmentsCreated;
|
|
15417
|
+
},
|
|
15418
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15419
|
+
[]);
|
|
15420
|
+
return reactQuery.useQuery({
|
|
15421
|
+
onError: reactApi.onError,
|
|
15422
|
+
retry: shipmentId !== undefined,
|
|
15423
|
+
queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15424
|
+
var _a;
|
|
15425
|
+
if (shipmentId) {
|
|
15426
|
+
return (yield client.salesOrderShipments.get(shipmentId)).data;
|
|
15427
|
+
} else {
|
|
15428
|
+
const warehouses = (yield client.warehouses.list()).data.warehouses;
|
|
15429
|
+
const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
|
|
15430
|
+
if (defaultOrFirstWarehouse === undefined) {
|
|
15431
|
+
throw [alchemy.CodedError.fromObject({
|
|
15432
|
+
message: "errorMessages.noWarehouses",
|
|
15433
|
+
errorType: "unknown",
|
|
15434
|
+
errorCode: "unknown",
|
|
15435
|
+
errorSource: "client"
|
|
15436
|
+
})];
|
|
15437
|
+
}
|
|
15438
|
+
const shipTo = {
|
|
15439
|
+
addressLine1: "",
|
|
15440
|
+
cityLocality: "",
|
|
15441
|
+
countryCode: "",
|
|
15442
|
+
name: "",
|
|
15443
|
+
phone: "",
|
|
15444
|
+
postalCode: "",
|
|
15445
|
+
stateProvince: ""
|
|
15446
|
+
};
|
|
15447
|
+
const newShipment = yield client.shipments.create({
|
|
15448
|
+
shipTo: shipTo,
|
|
15449
|
+
warehouseId: defaultOrFirstWarehouse.warehouseId
|
|
15450
|
+
});
|
|
15451
|
+
return newShipment.data.shipments[0];
|
|
15452
|
+
}
|
|
15453
|
+
}),
|
|
15454
|
+
queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
|
|
15455
|
+
});
|
|
15456
|
+
};
|
|
15457
|
+
|
|
15458
|
+
const useLoadOrCreateShipment = shipmentId => {
|
|
14790
15459
|
const {
|
|
14791
15460
|
data: shipment,
|
|
14792
15461
|
error: loadShipmentErrors,
|
|
14793
15462
|
refetch: refetchShipment,
|
|
14794
15463
|
isLoading
|
|
14795
|
-
} =
|
|
15464
|
+
} = useGetOrCreateShipment(shipmentId);
|
|
14796
15465
|
const errors = [...(loadShipmentErrors !== null && loadShipmentErrors !== void 0 ? loadShipmentErrors : [])];
|
|
14797
15466
|
return {
|
|
14798
15467
|
errors: errors.length > 0 ? errors : undefined,
|
|
@@ -14804,15 +15473,12 @@ const useLoadShipment = ({
|
|
|
14804
15473
|
|
|
14805
15474
|
const PurchaseLabelByShipment = _a => {
|
|
14806
15475
|
var {
|
|
14807
|
-
shipmentId,
|
|
14808
15476
|
onLoad,
|
|
14809
15477
|
onShipmentUpdated,
|
|
14810
15478
|
features
|
|
14811
15479
|
} = _a,
|
|
14812
|
-
props = __rest(_a, ["
|
|
14813
|
-
const _b =
|
|
14814
|
-
shipmentId
|
|
14815
|
-
}),
|
|
15480
|
+
props = __rest(_a, ["onLoad", "onShipmentUpdated", "features"]);
|
|
15481
|
+
const _b = useLoadOrCreateShipment("shipmentId" in props ? props.shipmentId : undefined),
|
|
14816
15482
|
{
|
|
14817
15483
|
shipment
|
|
14818
15484
|
} = _b,
|
|
@@ -14844,16 +15510,11 @@ const PurchaseLabelByShipment = _a => {
|
|
|
14844
15510
|
};
|
|
14845
15511
|
|
|
14846
15512
|
const Component$2 = _a => {
|
|
14847
|
-
var
|
|
14848
|
-
|
|
14849
|
-
} = _a,
|
|
14850
|
-
props = __rest(_a, ["shipmentId"]);
|
|
14851
|
-
if (shipmentId) {
|
|
14852
|
-
return jsxRuntime.jsx(PurchaseLabelByShipment, Object.assign({
|
|
14853
|
-
shipmentId: shipmentId
|
|
14854
|
-
}, props));
|
|
14855
|
-
} else {
|
|
15513
|
+
var props = __rest(_a, []);
|
|
15514
|
+
if ("salesOrderId" in props) {
|
|
14856
15515
|
return jsxRuntime.jsx(PurchaseLabelBySalesOrder, Object.assign({}, props));
|
|
15516
|
+
} else {
|
|
15517
|
+
return jsxRuntime.jsx(PurchaseLabelByShipment, Object.assign({}, props));
|
|
14857
15518
|
}
|
|
14858
15519
|
};
|
|
14859
15520
|
const Element$2 = alchemy__default["default"].createElement(Component$2, ErrorFallback, {
|
|
@@ -14927,6 +15588,111 @@ var viewShipment = /*#__PURE__*/Object.freeze({
|
|
|
14927
15588
|
Element: Element$1
|
|
14928
15589
|
});
|
|
14929
15590
|
|
|
15591
|
+
const Actions = ({
|
|
15592
|
+
onComplete,
|
|
15593
|
+
onSubmit,
|
|
15594
|
+
onViewShipment,
|
|
15595
|
+
shipment,
|
|
15596
|
+
voidRequest
|
|
15597
|
+
}) => {
|
|
15598
|
+
const {
|
|
15599
|
+
t
|
|
15600
|
+
} = reactI18next.useTranslation(["common", "void-label"]);
|
|
15601
|
+
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
15602
|
+
const handleSubmit = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
15603
|
+
setIsSubmitting(true);
|
|
15604
|
+
yield onSubmit();
|
|
15605
|
+
setIsSubmitting(false);
|
|
15606
|
+
}), [onSubmit]);
|
|
15607
|
+
return jsxRuntime.jsx(giger.BottomSheet, Object.assign({
|
|
15608
|
+
alwaysVisible: true,
|
|
15609
|
+
css: theme => ({
|
|
15610
|
+
borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
|
|
15611
|
+
boxShadow: "none",
|
|
15612
|
+
position: "static"
|
|
15613
|
+
})
|
|
15614
|
+
}, {
|
|
15615
|
+
children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
|
|
15616
|
+
// The void request has been approved
|
|
15617
|
+
jsxRuntime.jsxs(ButtonGroup, {
|
|
15618
|
+
children: [jsxRuntime.jsx(giger.Button, Object.assign({
|
|
15619
|
+
bold: false,
|
|
15620
|
+
onClick: () => onComplete(voidRequest, shipment),
|
|
15621
|
+
variant: giger.ButtonVariant.OUTLINED
|
|
15622
|
+
}, {
|
|
15623
|
+
children: t("void-label:actions.complete")
|
|
15624
|
+
})), jsxRuntime.jsx(giger.Button, Object.assign({
|
|
15625
|
+
bold: false,
|
|
15626
|
+
isFullWidth: true,
|
|
15627
|
+
onClick: () => onViewShipment(shipment)
|
|
15628
|
+
}, {
|
|
15629
|
+
children: t("void-label:actions.viewShipment")
|
|
15630
|
+
}))]
|
|
15631
|
+
}) :
|
|
15632
|
+
// The void request has yet to be made or was rejected
|
|
15633
|
+
jsxRuntime.jsx(giger.Button, Object.assign({
|
|
15634
|
+
bold: false,
|
|
15635
|
+
isFullWidth: true,
|
|
15636
|
+
isLoading: isSubmitting,
|
|
15637
|
+
onClick: handleSubmit
|
|
15638
|
+
}, {
|
|
15639
|
+
children: t("void-label:actions.confirmVoid")
|
|
15640
|
+
}))
|
|
15641
|
+
}));
|
|
15642
|
+
};
|
|
15643
|
+
|
|
15644
|
+
const Message = ({
|
|
15645
|
+
voidRequest
|
|
15646
|
+
}) => {
|
|
15647
|
+
const {
|
|
15648
|
+
t
|
|
15649
|
+
} = reactI18next.useTranslation(["common", "void-label"]);
|
|
15650
|
+
return jsxRuntime.jsx(Section, {
|
|
15651
|
+
children: voidRequest ? jsxRuntime.jsxs("section", Object.assign({
|
|
15652
|
+
css: {
|
|
15653
|
+
textAlign: "center",
|
|
15654
|
+
width: "100%"
|
|
15655
|
+
}
|
|
15656
|
+
}, {
|
|
15657
|
+
children: [jsxRuntime.jsx(giger.Icon, {
|
|
15658
|
+
css: theme => ({
|
|
15659
|
+
color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
|
|
15660
|
+
}),
|
|
15661
|
+
name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? gigerTheme.IconNames.CHECK_FILLED : gigerTheme.IconNames.ALERT,
|
|
15662
|
+
size: giger.IconSize.SIZE_LARGE
|
|
15663
|
+
}), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
15664
|
+
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
15665
|
+
component: "h2"
|
|
15666
|
+
}, {
|
|
15667
|
+
children: t("void-label:resultTitles.approved")
|
|
15668
|
+
})), jsxRuntime.jsx(giger.Typography, {
|
|
15669
|
+
children: t("void-label:resultMessages.approved")
|
|
15670
|
+
})]
|
|
15671
|
+
}) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
15672
|
+
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
15673
|
+
component: "h2"
|
|
15674
|
+
}, {
|
|
15675
|
+
children: t("void-label:resultTitles.rejected")
|
|
15676
|
+
})), jsxRuntime.jsx(giger.Typography, {
|
|
15677
|
+
children: jsxRuntime.jsx("p", {
|
|
15678
|
+
dangerouslySetInnerHTML: {
|
|
15679
|
+
__html: t("void-label:resultMessages.rejected")
|
|
15680
|
+
}
|
|
15681
|
+
})
|
|
15682
|
+
})]
|
|
15683
|
+
})]
|
|
15684
|
+
})) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
15685
|
+
children: [jsxRuntime.jsx(giger.Typography, {
|
|
15686
|
+
children: t("void-label:refund_process")
|
|
15687
|
+
}), jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
15688
|
+
component: "p"
|
|
15689
|
+
}, {
|
|
15690
|
+
children: t("void-label:refund_rules")
|
|
15691
|
+
}))]
|
|
15692
|
+
})
|
|
15693
|
+
});
|
|
15694
|
+
};
|
|
15695
|
+
|
|
14930
15696
|
const Component = ({
|
|
14931
15697
|
labelId,
|
|
14932
15698
|
onComplete,
|
|
@@ -14934,24 +15700,40 @@ const Component = ({
|
|
|
14934
15700
|
onViewShipment
|
|
14935
15701
|
}) => {
|
|
14936
15702
|
var _a;
|
|
15703
|
+
// TODO [LMNT-910] - labelId should be a required prop
|
|
15704
|
+
if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
|
|
15705
|
+
const {
|
|
15706
|
+
t
|
|
15707
|
+
} = reactI18next.useTranslation();
|
|
14937
15708
|
const label = alchemy.useGetLabel(labelId);
|
|
14938
15709
|
const shipment = alchemy.useGetSalesOrderShipment((_a = label.data) === null || _a === void 0 ? void 0 : _a.shipmentId);
|
|
14939
15710
|
const voidLabel = alchemy.useVoidLabel();
|
|
15711
|
+
if (label.isLoading) return jsxRuntime.jsx(Loader, {
|
|
15712
|
+
message: t("loading.label")
|
|
15713
|
+
});
|
|
15714
|
+
if (shipment.isLoading) return jsxRuntime.jsx(Loader, {
|
|
15715
|
+
message: t("loading.shipment")
|
|
15716
|
+
});
|
|
15717
|
+
throwAny(label.error);
|
|
15718
|
+
throwAny(shipment.error);
|
|
15719
|
+
if (!label.data) throw new Error("errorMessages.unableToLoad.label");
|
|
15720
|
+
if (!shipment.data) throw new Error("errorMessages.unableToLoad.shipment");
|
|
14940
15721
|
const handleVoidLabelSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14941
|
-
if (!labelId) throw new Error("labelId is required");
|
|
14942
15722
|
const result = yield voidLabel.mutateAsync(labelId);
|
|
14943
|
-
|
|
14944
|
-
// but we aren't using Suspense so we still need to check.
|
|
14945
|
-
if ((result === null || result === void 0 ? void 0 : result.approved) && label.data && shipment.data) {
|
|
15723
|
+
if (result.approved) {
|
|
14946
15724
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(label.data, shipment.data);
|
|
14947
15725
|
}
|
|
14948
15726
|
});
|
|
14949
|
-
return jsxRuntime.
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
15727
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
15728
|
+
children: [jsxRuntime.jsx(Message, {
|
|
15729
|
+
voidRequest: voidLabel.data
|
|
15730
|
+
}), jsxRuntime.jsx(Actions, {
|
|
15731
|
+
onComplete: onComplete,
|
|
15732
|
+
onSubmit: handleVoidLabelSubmit,
|
|
15733
|
+
onViewShipment: onViewShipment,
|
|
15734
|
+
shipment: shipment.data,
|
|
15735
|
+
voidRequest: voidLabel.data
|
|
15736
|
+
}), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
|
|
14955
15737
|
});
|
|
14956
15738
|
};
|
|
14957
15739
|
const Element = alchemy__default["default"].createElement(Component, ErrorFallback, {
|
|
@@ -14994,6 +15776,7 @@ exports.ManageWarehouses = manageWarehouses;
|
|
|
14994
15776
|
exports.Onboarding = onboarding;
|
|
14995
15777
|
exports.PageLayoutProvider = PageLayoutProvider;
|
|
14996
15778
|
exports.Portal = Portal;
|
|
15779
|
+
exports.PoweredByShipEngine = PoweredByShipEngine;
|
|
14997
15780
|
exports.PurchaseLabel = purchaseLabel;
|
|
14998
15781
|
exports.RootPortalProvider = RootPortalProvider;
|
|
14999
15782
|
exports.Section = Section;
|
|
@@ -15047,6 +15830,8 @@ exports.isPoBox = isPoBox;
|
|
|
15047
15830
|
exports.isPoBoxAddress = isPoBoxAddress;
|
|
15048
15831
|
exports.isString = isString;
|
|
15049
15832
|
exports.isUnitedStatesTerritory = isUnitedStatesTerritory;
|
|
15833
|
+
exports.isUnsupportedByUps = isUnsupportedByUps;
|
|
15834
|
+
exports.isUpsCarrier = isUpsCarrier;
|
|
15050
15835
|
exports.isUspsCarrier = isUspsCarrier;
|
|
15051
15836
|
exports.moneySchema = moneySchema;
|
|
15052
15837
|
exports.mostRecent = mostRecent;
|
|
@@ -15057,6 +15842,8 @@ exports.phoneSchema = phoneSchema;
|
|
|
15057
15842
|
exports.phoneSchemaUnvalidated = phoneSchemaUnvalidated;
|
|
15058
15843
|
exports.postalCodeRegex = postalCodeRegex$3;
|
|
15059
15844
|
exports.sortByCreationDate = sortByCreationDate;
|
|
15845
|
+
exports.throwAny = throwAny;
|
|
15846
|
+
exports.throwJoinedMessages = throwJoinedMessages;
|
|
15060
15847
|
exports.usCities = usCities;
|
|
15061
15848
|
exports.usStateCodes = usStateCodes;
|
|
15062
15849
|
exports.usStates = usStates;
|
|
@@ -15076,6 +15863,7 @@ exports.useRateOptions = useRateOptions;
|
|
|
15076
15863
|
exports.useRootPortal = useRootPortal;
|
|
15077
15864
|
exports.useRunOnceOnTrue = useRunOnceOnTrue;
|
|
15078
15865
|
exports.useServiceCodeOptions = useServiceCodeOptions;
|
|
15866
|
+
exports.useShipmentMetadata = useShipmentMetadata;
|
|
15079
15867
|
exports.useShippingPresetsOptions = useShippingPresetsOptions;
|
|
15080
15868
|
exports.useStateCodeOptions = useStateCodeOptions;
|
|
15081
15869
|
exports.useToggle = useToggle;
|