@shipengine/elements 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/index.cjs +430 -103
  2. package/index.js +431 -104
  3. package/package.json +4 -3
  4. package/src/components/error-display/error-display.d.ts +1 -0
  5. package/src/components/error-display/error-display.styles.d.ts +19 -0
  6. package/src/components/error-display/index.d.ts +1 -0
  7. package/src/components/field/rate-card/rate-card.d.ts +1 -1
  8. package/src/components/history/history-card/history-card.styles.d.ts +12 -14
  9. package/src/components/history/history-card-extension/history-card-extension.d.ts +1 -0
  10. package/src/components/history/history-card-extension/history-card-extension.styles.d.ts +26 -0
  11. package/src/components/history/history-card-extension/index.d.ts +1 -0
  12. package/src/components/history/index.d.ts +1 -0
  13. package/src/components/label/label.d.ts +1 -1
  14. package/src/components/label/label.styles.d.ts +5 -1
  15. package/src/components/link-action/link-action.d.ts +3 -1
  16. package/src/components/templates/rate-form/rate-form.d.ts +3 -1
  17. package/src/components/unit-settings/unit-settings.d.ts +1 -4
  18. package/src/elements/configure-shipment/hooks/use-rates-form.d.ts +2 -0
  19. package/src/elements/list-carriers/list-carriers.d.ts +3 -0
  20. package/src/elements/manage-warehouses/manage-warehouses.d.ts +3 -0
  21. package/src/elements/onboarding/onboarding.d.ts +3 -0
  22. package/src/elements/purchase-label/purchase-label.d.ts +3 -0
  23. package/src/elements/view-shipment/view-shipment.d.ts +3 -0
  24. package/src/elements/void-label/void-label.d.ts +3 -0
  25. package/src/factories/shipengine/wallet-history.d.ts +52 -0
  26. package/src/features/wallet-history/wallet-history.styles.d.ts +4 -0
  27. package/src/locales/en/index.d.ts +3 -0
  28. package/src/mocks/account-settings/handlers.d.ts +8 -0
  29. package/src/mocks/account-settings/index.d.ts +1 -0
  30. package/src/mocks/index.d.ts +1 -0
  31. package/src/utilities/rates.d.ts +1 -1
  32. package/vite.config.d.ts +2 -0
package/index.cjs CHANGED
@@ -2594,10 +2594,15 @@ const formatExpiration = exp => {
2594
2594
 
2595
2595
  const isString = x => typeof x === "string";
2596
2596
 
2597
- const getRateRequiresAcknowledgement = serviceCode => {
2597
+ const getRateRequiresAcknowledgement = (serviceCode, packageType) => {
2598
2598
  switch (serviceCode) {
2599
2599
  case "usps_media_mail":
2600
2600
  return true;
2601
+ case "usps_first_class_mail":
2602
+ if (packageType === "large_envelope_or_flat") {
2603
+ return true;
2604
+ }
2605
+ return false;
2601
2606
  default:
2602
2607
  return false;
2603
2608
  }
@@ -4650,7 +4655,7 @@ const getDeliveryDaysLabel = deliveryDays => {
4650
4655
  }
4651
4656
  return `${deliveryDays.toString()} ${deliveryDays === 1 ? "day" : "days"}`;
4652
4657
  };
4653
- const getAcknowledgementLabel = serviceCode => {
4658
+ const getAcknowledgementLabel = (serviceCode, packageType) => {
4654
4659
  switch (serviceCode) {
4655
4660
  case "usps_media_mail":
4656
4661
  return jsxRuntime.jsxs(reactI18next.Trans, Object.assign({
@@ -4665,6 +4670,13 @@ const getAcknowledgementLabel = serviceCode => {
4665
4670
  children: "USPS guidelines for Media Mail®"
4666
4671
  }))]
4667
4672
  }));
4673
+ case "usps_first_class_mail":
4674
+ if (packageType === "large_envelope_or_flat") {
4675
+ return jsxRuntime.jsx(reactI18next.Trans, {
4676
+ i18nKey: "purchase-label:rates.uspsFirstClassMailAcknowledgement_leof"
4677
+ });
4678
+ }
4679
+ return;
4668
4680
  default:
4669
4681
  return null;
4670
4682
  }
@@ -4687,6 +4699,7 @@ const RateCard = ({
4687
4699
  requiresAcknowledgement,
4688
4700
  selected: _selected = false,
4689
4701
  serviceCode,
4702
+ packageType,
4690
4703
  serviceType,
4691
4704
  shippingAmount,
4692
4705
  taxAmount,
@@ -4759,7 +4772,11 @@ const RateCard = ({
4759
4772
  css: getFooterListItemStyles,
4760
4773
  variant: "body2"
4761
4774
  }, {
4762
- children: msg
4775
+ children: packageType === "large_envelope_or_flat" ? t(msg, {
4776
+ weight: 13
4777
+ }) : t(msg, {
4778
+ weight: 16
4779
+ })
4763
4780
  }), index + msg.length))
4764
4781
  })), requiresAcknowledgement && onClickAcknowledgement && jsxRuntime.jsx("div", Object.assign({
4765
4782
  css: getCheckboxWrapperStyles
@@ -4767,7 +4784,7 @@ const RateCard = ({
4767
4784
  children: jsxRuntime.jsx(giger.Checkbox, {
4768
4785
  checked: isAcknowledged,
4769
4786
  css: getAcknowledgmentStyles,
4770
- label: getAcknowledgementLabel(serviceCode),
4787
+ label: getAcknowledgementLabel(serviceCode, packageType),
4771
4788
  onChange: e => onClickAcknowledgement(e.target.checked)
4772
4789
  })
4773
4790
  }))]
@@ -5276,7 +5293,7 @@ const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) =>
5276
5293
  return Object.assign(Object.assign({}, r), {
5277
5294
  balance,
5278
5295
  messages: r.warningMessages,
5279
- requiresAcknowledgement: getRateRequiresAcknowledgement(r.serviceCode),
5296
+ requiresAcknowledgement: getRateRequiresAcknowledgement(r.serviceCode, r.packageType),
5280
5297
  requiresFundedAmount
5281
5298
  });
5282
5299
  });
@@ -5940,7 +5957,7 @@ const AddressParser = ({
5940
5957
  }));
5941
5958
  };
5942
5959
 
5943
- const styles$l = createStyles({
5960
+ const styles$m = createStyles({
5944
5961
  grow: {
5945
5962
  flexGrow: 1
5946
5963
  },
@@ -6040,13 +6057,13 @@ const AddressFields = ({
6040
6057
  },
6041
6058
  options: countryCodeOptions
6042
6059
  }), jsxRuntime.jsxs("div", Object.assign({
6043
- css: styles$l.stateZipWrapper
6060
+ css: styles$m.stateZipWrapper
6044
6061
  }, {
6045
6062
  children: [jsxRuntime.jsx("div", Object.assign({
6046
- css: styles$l.stateWrapper
6063
+ css: styles$m.stateWrapper
6047
6064
  }, {
6048
6065
  children: jsxRuntime.jsx("div", Object.assign({
6049
- css: styles$l.grow
6066
+ css: styles$m.grow
6050
6067
  }, {
6051
6068
  children: watchCountryCode === "US" ?
6052
6069
  // Domestic States
@@ -6071,10 +6088,10 @@ const AddressFields = ({
6071
6088
  })
6072
6089
  }))
6073
6090
  })), jsxRuntime.jsx("div", Object.assign({
6074
- css: styles$l.zipWrapper
6091
+ css: styles$m.zipWrapper
6075
6092
  }, {
6076
6093
  children: jsxRuntime.jsx("div", Object.assign({
6077
- css: styles$l.grow
6094
+ css: styles$m.grow
6078
6095
  }, {
6079
6096
  children: jsxRuntime.jsx(TextInput, {
6080
6097
  control: form.control,
@@ -6312,7 +6329,7 @@ const AddressForm = ({
6312
6329
  }));
6313
6330
  };
6314
6331
 
6315
- const styles$k = createStyles({
6332
+ const styles$l = createStyles({
6316
6333
  agreement: {
6317
6334
  alignItems: "center",
6318
6335
  display: "flex",
@@ -6382,10 +6399,10 @@ const DisplayCarrierTerms = c => {
6382
6399
  const listCarrierLinks = () => {
6383
6400
  return c.carrierTerms.links.map((term, index) => {
6384
6401
  return jsxRuntime.jsx("li", Object.assign({
6385
- css: styles$k.listItems
6402
+ css: styles$l.listItems
6386
6403
  }, {
6387
6404
  children: jsxRuntime.jsx(giger.Link, Object.assign({
6388
- css: styles$k.link,
6405
+ css: styles$l.link,
6389
6406
  href: term.url,
6390
6407
  isExternal: true,
6391
6408
  target: "_blank"
@@ -6401,18 +6418,18 @@ const DisplayCarrierTerms = c => {
6401
6418
  };
6402
6419
  const listCarrierTerms = () => {
6403
6420
  return jsxRuntime.jsxs("div", Object.assign({
6404
- css: styles$k.terms
6421
+ css: styles$l.terms
6405
6422
  }, {
6406
6423
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
6407
6424
  variant: "subtitle1"
6408
6425
  }, {
6409
6426
  children: c.carrierTerms.title
6410
6427
  })), jsxRuntime.jsx("div", Object.assign({
6411
- css: styles$k.terms
6428
+ css: styles$l.terms
6412
6429
  }, {
6413
6430
  children: listCarrierContent()
6414
6431
  })), jsxRuntime.jsx("ul", Object.assign({
6415
- css: styles$k.links
6432
+ css: styles$l.links
6416
6433
  }, {
6417
6434
  children: listCarrierLinks()
6418
6435
  }))]
@@ -6642,7 +6659,7 @@ const AddressDisplay = ({
6642
6659
  }));
6643
6660
  };
6644
6661
 
6645
- const styles$j = createStyles({
6662
+ const styles$k = createStyles({
6646
6663
  container: theme => ({
6647
6664
  display: "flex",
6648
6665
  gap: theme.spacing()
@@ -6680,13 +6697,13 @@ const Disclosure = ({
6680
6697
  }, [open]);
6681
6698
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
6682
6699
  children: [jsxRuntime.jsxs("div", Object.assign({
6683
- css: styles$j.container
6700
+ css: styles$k.container
6684
6701
  }, {
6685
6702
  children: [jsxRuntime.jsx("div", {
6686
6703
  children: label
6687
6704
  }), _showToggle && jsxRuntime.jsx("button", Object.assign({
6688
6705
  "aria-expanded": isOpen,
6689
- css: styles$j.toggle,
6706
+ css: styles$k.toggle,
6690
6707
  onClick: () => {
6691
6708
  setIsOpen(!isOpen);
6692
6709
  onToggle(!isOpen);
@@ -6694,12 +6711,12 @@ const Disclosure = ({
6694
6711
  type: "button"
6695
6712
  }, {
6696
6713
  children: jsxRuntime.jsx(giger.Icon, {
6697
- css: styles$j.icon,
6714
+ css: styles$k.icon,
6698
6715
  name: isOpen ? gigerTheme.IconNames.CHEVRON_TOP : gigerTheme.IconNames.CHEVRON_BOTTOM
6699
6716
  })
6700
6717
  }))]
6701
6718
  })), isOpen && jsxRuntime.jsx("div", Object.assign({
6702
- css: styles$j.content
6719
+ css: styles$k.content
6703
6720
  }, {
6704
6721
  children: typeof children === "function" ? children(() => setIsOpen(!isOpen)) : children
6705
6722
  }))]
@@ -6849,7 +6866,7 @@ const getCarrierRecoverySchema = requiresAddress => zod.z.object({
6849
6866
  address: requiresAddress ? baseSchema : baseSchema.optional()
6850
6867
  });
6851
6868
 
6852
- const styles$i = createStyles({
6869
+ const styles$j = createStyles({
6853
6870
  grid: theme => ({
6854
6871
  margin: theme.spacing(4)
6855
6872
  }),
@@ -6892,7 +6909,7 @@ const CarrierRecoveryForm = ({
6892
6909
  onSubmit: formLogger.capture(handleSubmit)
6893
6910
  }, {
6894
6911
  children: jsxRuntime.jsxs(giger.Grid, Object.assign({
6895
- css: styles$i.grid,
6912
+ css: styles$j.grid,
6896
6913
  noPadding: true
6897
6914
  }, {
6898
6915
  children: [requiresAddress && jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -6900,14 +6917,14 @@ const CarrierRecoveryForm = ({
6900
6917
  colSpan: 12
6901
6918
  }, {
6902
6919
  children: jsxRuntime.jsx(giger.Typography, Object.assign({
6903
- css: styles$i.heading,
6920
+ css: styles$j.heading,
6904
6921
  variant: "heading4"
6905
6922
  }, {
6906
6923
  children: t("register-wallet:sections.carriers.title")
6907
6924
  }))
6908
6925
  })), jsxRuntime.jsx(giger.GridChild, Object.assign({
6909
6926
  colSpan: 12,
6910
- css: styles$i.subtitle
6927
+ css: styles$j.subtitle
6911
6928
  }, {
6912
6929
  children: jsxRuntime.jsx(giger.Typography, Object.assign({
6913
6930
  variant: "subtitle1"
@@ -6993,7 +7010,7 @@ const CarrierTermsForm = ({
6993
7010
  onSubmit(payload.agreement);
6994
7011
  }));
6995
7012
  return jsxRuntime.jsxs("div", Object.assign({
6996
- css: styles$k.termsForm,
7013
+ css: styles$l.termsForm,
6997
7014
  "data-testid": "carrier-terms-form"
6998
7015
  }, {
6999
7016
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
@@ -7009,7 +7026,7 @@ const CarrierTermsForm = ({
7009
7026
  })), jsxRuntime.jsx(Spacer, {
7010
7027
  multiplier: 1
7011
7028
  }), jsxRuntime.jsx("div", Object.assign({
7012
- css: styles$k.carrierLogos
7029
+ css: styles$l.carrierLogos
7013
7030
  }, {
7014
7031
  children: metadatas.map(({
7015
7032
  name,
@@ -7025,7 +7042,7 @@ const CarrierTermsForm = ({
7025
7042
  onSubmit: formLogger.capture(handleSubmit)
7026
7043
  }, {
7027
7044
  children: jsxRuntime.jsxs("div", Object.assign({
7028
- css: styles$k.agreement
7045
+ css: styles$l.agreement
7029
7046
  }, {
7030
7047
  children: [jsxRuntime.jsx("div", {
7031
7048
  children: jsxRuntime.jsx(CheckboxInput, {
@@ -7052,12 +7069,12 @@ const CarrierTermsForm = ({
7052
7069
  name: "agreement"
7053
7070
  })
7054
7071
  }), showTerms && jsxRuntime.jsxs("div", Object.assign({
7055
- css: styles$k.well
7072
+ css: styles$l.well
7056
7073
  }, {
7057
7074
  children: [terms.map(t => jsxRuntime.jsx(DisplayCarrierTerms, {
7058
7075
  carrierTerms: t
7059
7076
  }, t.title)), jsxRuntime.jsx("div", Object.assign({
7060
- css: styles$k.close
7077
+ css: styles$l.close
7061
7078
  }, {
7062
7079
  children: jsxRuntime.jsx(giger.Button, Object.assign({
7063
7080
  onClick: () => setShowTerms(false),
@@ -7310,7 +7327,8 @@ const icons = {
7310
7327
  add: gigerTheme.IconNames.ADD,
7311
7328
  checkFilled: gigerTheme.IconNames.CHECK_FILLED,
7312
7329
  copy: gigerTheme.IconNames.COPY,
7313
- download: gigerTheme.IconNames.DOWNLOAD
7330
+ download: gigerTheme.IconNames.DOWNLOAD,
7331
+ retry: gigerTheme.IconNames.CIRCULAR_ARROW
7314
7332
  };
7315
7333
  const LinkAction = _a => {
7316
7334
  var {
@@ -7318,11 +7336,12 @@ const LinkAction = _a => {
7318
7336
  icon,
7319
7337
  isDisabled,
7320
7338
  isLoading,
7321
- title
7339
+ title,
7340
+ isBold = true
7322
7341
  } = _a,
7323
- props = __rest(_a, ["css", "icon", "isDisabled", "isLoading", "title"]);
7342
+ props = __rest(_a, ["css", "icon", "isDisabled", "isLoading", "title", "isBold"]);
7324
7343
  return jsxRuntime.jsx(giger.Link, Object.assign({}, props, {
7325
- bold: true,
7344
+ bold: isBold,
7326
7345
  css: theme => [Object.assign(Object.assign({
7327
7346
  "&&&": {
7328
7347
  textDecoration: "none"
@@ -7376,7 +7395,7 @@ const CopyButton = ({
7376
7395
  }));
7377
7396
  };
7378
7397
 
7379
- const styles$h = createStyles({
7398
+ const styles$i = createStyles({
7380
7399
  trackingNumber: theme => ({
7381
7400
  alignItems: "center",
7382
7401
  display: "flex"
@@ -7422,10 +7441,10 @@ const Label = ({
7422
7441
  shippingAmount: label.shipmentCost
7423
7442
  }, {
7424
7443
  children: label.trackingNumber && jsxRuntime.jsxs("div", Object.assign({
7425
- css: styles$h.trackingNumber
7444
+ css: styles$i.trackingNumber
7426
7445
  }, {
7427
7446
  children: [jsxRuntime.jsx("div", Object.assign({
7428
- css: styles$h.truncatedTrackingNumber
7447
+ css: styles$i.truncatedTrackingNumber
7429
7448
  }, {
7430
7449
  children: label.trackingNumber.toString()
7431
7450
  })), jsxRuntime.jsx(CopyButton, {
@@ -7537,7 +7556,7 @@ const LandingPageForm = ({
7537
7556
  }));
7538
7557
  };
7539
7558
 
7540
- const styles$g = createStyles({
7559
+ const styles$h = createStyles({
7541
7560
  container: theme => ({
7542
7561
  padding: theme.spacing(2)
7543
7562
  }),
@@ -7559,11 +7578,11 @@ const LandingPage = ({
7559
7578
  t
7560
7579
  } = reactI18next.useTranslation();
7561
7580
  return jsxRuntime.jsxs("div", Object.assign({
7562
- css: styles$g.container,
7581
+ css: styles$h.container,
7563
7582
  "data-testid": "landing-page"
7564
7583
  }, {
7565
7584
  children: [jsxRuntime.jsxs("div", Object.assign({
7566
- css: styles$g.header
7585
+ css: styles$h.header
7567
7586
  }, {
7568
7587
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
7569
7588
  variant: "heading4"
@@ -7581,7 +7600,7 @@ const LandingPage = ({
7581
7600
  })), jsxRuntime.jsx(LandingPageForm, {
7582
7601
  onSubmit: onSubmit
7583
7602
  }), jsxRuntime.jsxs("div", Object.assign({
7584
- css: styles$g.header
7603
+ css: styles$h.header
7585
7604
  }, {
7586
7605
  children: [jsxRuntime.jsx(Spacer, {
7587
7606
  multiplier: 6
@@ -7592,14 +7611,14 @@ const LandingPage = ({
7592
7611
  })), jsxRuntime.jsx(Spacer, {
7593
7612
  multiplier: 2
7594
7613
  }), jsxRuntime.jsx(giger.Typography, Object.assign({
7595
- css: styles$g.description,
7614
+ css: styles$h.description,
7596
7615
  variant: "body1"
7597
7616
  }, {
7598
7617
  children: t("onboarding:landing.messageLine1")
7599
7618
  })), jsxRuntime.jsx(Spacer, {
7600
7619
  multiplier: 2
7601
7620
  }), jsxRuntime.jsx(giger.Typography, Object.assign({
7602
- css: styles$g.description,
7621
+ css: styles$h.description,
7603
7622
  variant: "body1"
7604
7623
  }, {
7605
7624
  children: t("onboarding:landing.messageLine2")
@@ -7610,7 +7629,7 @@ const LandingPage = ({
7610
7629
  }));
7611
7630
  };
7612
7631
 
7613
- const styles$f = createStyles({
7632
+ const styles$g = createStyles({
7614
7633
  icon: theme => ({
7615
7634
  color: theme.palette.primary.main,
7616
7635
  marginRight: theme.spacing(2)
@@ -7655,10 +7674,10 @@ const Section = _a => {
7655
7674
  rest = __rest(_a, ["bold", "title", "children", "rightContent"]);
7656
7675
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
7657
7676
  children: [title && jsxRuntime.jsx("summary", Object.assign({
7658
- css: styles$f.summary
7677
+ css: styles$g.summary
7659
7678
  }, {
7660
7679
  children: jsxRuntime.jsxs("div", Object.assign({
7661
- css: styles$f.summaryWrapper
7680
+ css: styles$g.summaryWrapper
7662
7681
  }, {
7663
7682
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
7664
7683
  bold: bold,
@@ -7666,20 +7685,20 @@ const Section = _a => {
7666
7685
  }, {
7667
7686
  children: title
7668
7687
  })), rightContent && jsxRuntime.jsx("div", Object.assign({
7669
- css: styles$f.rightContentWrapper
7688
+ css: styles$g.rightContentWrapper
7670
7689
  }, {
7671
7690
  children: rightContent
7672
7691
  }))]
7673
7692
  }))
7674
7693
  })), jsxRuntime.jsx("section", Object.assign({
7675
- css: styles$f.section
7694
+ css: styles$g.section
7676
7695
  }, rest, {
7677
7696
  children: children
7678
7697
  }))]
7679
7698
  });
7680
7699
  };
7681
7700
 
7682
- const styles$e = createStyles({
7701
+ const styles$f = createStyles({
7683
7702
  container: {
7684
7703
  display: "flex",
7685
7704
  flexDirection: "column"
@@ -7739,14 +7758,14 @@ const ListCarriersRow = ({
7739
7758
  setIsSubmitting(false);
7740
7759
  });
7741
7760
  return jsxRuntime.jsxs("div", Object.assign({
7742
- css: styles$e.container,
7761
+ css: styles$f.container,
7743
7762
  "data-testid": "carrier-row"
7744
7763
  }, {
7745
7764
  children: [jsxRuntime.jsxs("div", Object.assign({
7746
- css: styles$e.rowContainer
7765
+ css: styles$f.rowContainer
7747
7766
  }, {
7748
7767
  children: [jsxRuntime.jsxs("div", Object.assign({
7749
- css: styles$e.logoContainer
7768
+ css: styles$f.logoContainer
7750
7769
  }, {
7751
7770
  children: [jsxRuntime.jsx("div", {
7752
7771
  children: jsxRuntime.jsx("img", {
@@ -7764,7 +7783,7 @@ const ListCarriersRow = ({
7764
7783
  css: _ref
7765
7784
  }, {
7766
7785
  children: jsxRuntime.jsx(LinkAction, {
7767
- css: styles$e.getConnectButton(isConnected),
7786
+ css: styles$f.getConnectButton(isConnected),
7768
7787
  isDisabled: isConnected || showDropDown,
7769
7788
  isLoading: isSubmitting,
7770
7789
  onClick: () => __awaiter(void 0, void 0, void 0, function* () {
@@ -7782,7 +7801,7 @@ const ListCarriersRow = ({
7782
7801
  }));
7783
7802
  };
7784
7803
 
7785
- const styles$d = createStyles({
7804
+ const styles$e = createStyles({
7786
7805
  carriersList: theme => ({
7787
7806
  "& > li:not(:last-of-type)": {
7788
7807
  borderBottom: `1px solid ${theme.palette.gray.light}`
@@ -7835,7 +7854,7 @@ const ListCarriers = ({
7835
7854
  }))
7836
7855
  })), jsxRuntime.jsx(Spacer, {})]
7837
7856
  }), jsxRuntime.jsx("ul", Object.assign({
7838
- css: styles$d.carriersList,
7857
+ css: styles$e.carriersList,
7839
7858
  "data-testid": "carriers-list"
7840
7859
  }, {
7841
7860
  children: isLoading ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -7857,11 +7876,11 @@ const ListCarriers = ({
7857
7876
  };
7858
7877
  const LoadingSkeletonRow = () => {
7859
7878
  return jsxRuntime.jsxs("div", Object.assign({
7860
- css: styles$d.skeletonRow,
7879
+ css: styles$e.skeletonRow,
7861
7880
  "data-testid": "skeleton-carrier-row"
7862
7881
  }, {
7863
7882
  children: [jsxRuntime.jsxs("div", Object.assign({
7864
- css: styles$d.skeletonLogoContainer
7883
+ css: styles$e.skeletonLogoContainer
7865
7884
  }, {
7866
7885
  children: [jsxRuntime.jsx(giger.Skeleton, {
7867
7886
  animation: giger.SkeletonAnimation.WAVE,
@@ -8168,7 +8187,7 @@ const useAddressPreference = () => {
8168
8187
  return context;
8169
8188
  };
8170
8189
 
8171
- const styles$c = createStyles({
8190
+ const styles$d = createStyles({
8172
8191
  body: theme => ({
8173
8192
  borderTop: `1px solid ${theme.palette.gray.light}`,
8174
8193
  color: theme.palette.black,
@@ -8219,14 +8238,14 @@ const SettingsCard = ({
8219
8238
  verticallyAligned
8220
8239
  }) => {
8221
8240
  return jsxRuntime.jsxs("div", Object.assign({
8222
- css: verticallyAligned ? styles$c.verticalContainer : styles$c.container,
8241
+ css: verticallyAligned ? styles$d.verticalContainer : styles$d.container,
8223
8242
  "data-testid": "settingsCard"
8224
8243
  }, {
8225
8244
  children: [jsxRuntime.jsxs("div", Object.assign({
8226
- css: styles$c.header
8245
+ css: styles$d.header
8227
8246
  }, {
8228
8247
  children: [jsxRuntime.jsxs("div", Object.assign({
8229
- css: styles$c.title
8248
+ css: styles$d.title
8230
8249
  }, {
8231
8250
  children: [typeof title === "string" ? jsxRuntime.jsx(giger.Typography, Object.assign({
8232
8251
  variant: "subtitle2"
@@ -8261,7 +8280,7 @@ const SettingsCard = ({
8261
8280
  }))
8262
8281
  }))]
8263
8282
  })), children && jsxRuntime.jsx("div", Object.assign({
8264
- css: styles$c.body
8283
+ css: styles$d.body
8265
8284
  }, {
8266
8285
  children: jsxRuntime.jsxs("div", {
8267
8286
  children: [children, accessoryAction && jsxRuntime.jsx(ButtonGroup, Object.assign({
@@ -8517,7 +8536,7 @@ const WarehouseForm = ({
8517
8536
  }));
8518
8537
  };
8519
8538
 
8520
- const styles$b = createStyles({
8539
+ const styles$c = createStyles({
8521
8540
  cardSpacing: theme => ({
8522
8541
  display: "flex",
8523
8542
  flexDirection: "column",
@@ -8547,9 +8566,9 @@ const ManageWarehouses = ({
8547
8566
  const [showAddNewWarehouseForm, toggleShowAddNewWarehouseForm] = useToggle(false);
8548
8567
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
8549
8568
  children: [showAddNewWarehouseForm ? jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
8550
- css: styles$b.well,
8569
+ css: styles$c.well,
8551
8570
  formHeader: jsxRuntime.jsxs("div", Object.assign({
8552
- css: styles$b.header
8571
+ css: styles$c.header
8553
8572
  }, {
8554
8573
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
8555
8574
  variant: "subtitle1"
@@ -8594,14 +8613,14 @@ const ManageWarehouses = ({
8594
8613
  })]
8595
8614
  }))
8596
8615
  })), jsxRuntime.jsx("div", Object.assign({
8597
- css: styles$b.cardSpacing
8616
+ css: styles$c.cardSpacing
8598
8617
  }, {
8599
8618
  children: warehouses.map(warehouse => {
8600
8619
  if (editWarehouseId && editWarehouseId === warehouse.warehouseId) {
8601
8620
  return jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
8602
- css: styles$b.well,
8621
+ css: styles$c.well,
8603
8622
  formHeader: jsxRuntime.jsxs("div", Object.assign({
8604
- css: styles$b.header
8623
+ css: styles$c.header
8605
8624
  }, {
8606
8625
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
8607
8626
  variant: "subtitle1"
@@ -9779,7 +9798,7 @@ const EditWalletAddressForm = ({
9779
9798
  }));
9780
9799
  };
9781
9800
 
9782
- const styles$a = createStyles({
9801
+ const styles$b = createStyles({
9783
9802
  grid: theme => ({
9784
9803
  margin: theme.spacing(4)
9785
9804
  })
@@ -9841,7 +9860,7 @@ const WalletForm = ({
9841
9860
  onSubmit: formLogger.capture(handleSubmit)
9842
9861
  }, {
9843
9862
  children: jsxRuntime.jsxs(giger.Grid, Object.assign({
9844
- css: styles$a.grid,
9863
+ css: styles$b.grid,
9845
9864
  noPadding: true
9846
9865
  }, {
9847
9866
  children: [jsxRuntime.jsx(giger.GridChild, Object.assign({
@@ -9923,7 +9942,7 @@ const WalletForm = ({
9923
9942
  }));
9924
9943
  };
9925
9944
 
9926
- const styles$9 = createStyles({
9945
+ const styles$a = createStyles({
9927
9946
  container: theme => ({
9928
9947
  padding: theme.spacing(2)
9929
9948
  }),
@@ -10099,10 +10118,10 @@ const Onboarding = ({
10099
10118
  const defaultWarehouse = (_a = warehouses.find(w => w.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
10100
10119
  return jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
10101
10120
  formHeader: jsxRuntime.jsxs("div", Object.assign({
10102
- css: styles$9.walletFormHeader
10121
+ css: styles$a.walletFormHeader
10103
10122
  }, {
10104
10123
  children: [jsxRuntime.jsxs("div", Object.assign({
10105
- css: styles$9.walletFormTitle
10124
+ css: styles$a.walletFormTitle
10106
10125
  }, {
10107
10126
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
10108
10127
  variant: "heading4"
@@ -10179,22 +10198,22 @@ const Onboarding = ({
10179
10198
  });
10180
10199
  };
10181
10200
  return jsxRuntime.jsxs("div", Object.assign({
10182
- css: styles$9.container
10201
+ css: styles$a.container
10183
10202
  }, {
10184
10203
  children: [jsxRuntime.jsxs(giger.Stepper, Object.assign({
10185
10204
  currentStep: currentStep
10186
10205
  }, {
10187
10206
  children: [jsxRuntime.jsx(giger.Step, {
10188
- css: styles$9.step,
10207
+ css: styles$a.step,
10189
10208
  label: t("onboarding:steps.login")
10190
10209
  }), jsxRuntime.jsx(giger.Step, {
10191
- css: styles$9.step,
10210
+ css: styles$a.step,
10192
10211
  label: t("onboarding:steps.carriers")
10193
10212
  }), jsxRuntime.jsx(giger.Step, {
10194
- css: styles$9.step,
10213
+ css: styles$a.step,
10195
10214
  label: t("onboarding:steps.addresses")
10196
10215
  }), jsxRuntime.jsx(giger.Step, {
10197
- css: styles$9.step,
10216
+ css: styles$a.step,
10198
10217
  label: t("onboarding:steps.payment")
10199
10218
  })]
10200
10219
  })), renderStep()]
@@ -10328,7 +10347,7 @@ const Loader = props => {
10328
10347
  }));
10329
10348
  };
10330
10349
 
10331
- const styles$8 = createStyles({
10350
+ const styles$9 = createStyles({
10332
10351
  chipList: theme => ({
10333
10352
  gap: theme.spacing(1)
10334
10353
  }),
@@ -10439,7 +10458,7 @@ const AddFundsForm = ({
10439
10458
  })), jsxRuntime.jsx(Spacer, {
10440
10459
  multiplier: 2
10441
10460
  }), jsxRuntime.jsx(giger.ChipList, Object.assign({
10442
- css: styles$8.chipList,
10461
+ css: styles$9.chipList,
10443
10462
  onChange: idx => {
10444
10463
  const chip = chips[idx];
10445
10464
  setSelectedChip(chip);
@@ -10454,7 +10473,7 @@ const AddFundsForm = ({
10454
10473
  }
10455
10474
  }, {
10456
10475
  children: chips.map(chip => jsxRuntime.jsx(giger.Chip, Object.assign({
10457
- css: styles$8.getChip({
10476
+ css: styles$9.getChip({
10458
10477
  isDisabled: chip.value < _minimumAmount,
10459
10478
  isSelected: chip.value === selectedChip.value
10460
10479
  }),
@@ -10471,7 +10490,7 @@ const AddFundsForm = ({
10471
10490
  multiplier: 1
10472
10491
  }), jsxRuntime.jsx(MoneyInput, {
10473
10492
  control: form.control,
10474
- css: styles$8.fundsInput,
10493
+ css: styles$9.fundsInput,
10475
10494
  defaultValue: {
10476
10495
  amount: undefined,
10477
10496
  currency: alchemy.SE.Currency.USD
@@ -10524,7 +10543,7 @@ const AddFundsForm = ({
10524
10543
  });
10525
10544
  };
10526
10545
 
10527
- const styles$7 = isLabelRight => createStyles({
10546
+ const styles$8 = isLabelRight => createStyles({
10528
10547
  inlineContainer: theme => ({
10529
10548
  alignItems: "center",
10530
10549
  display: "flex",
@@ -10539,14 +10558,14 @@ const InlineLabel = ({
10539
10558
  isLabelRight,
10540
10559
  labelProps: _labelProps = {}
10541
10560
  }) => jsxRuntime.jsxs("div", Object.assign({
10542
- css: styles$7(isLabelRight).inlineContainer
10561
+ css: styles$8(isLabelRight).inlineContainer
10543
10562
  }, {
10544
10563
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({}, _labelProps, {
10545
10564
  children: label
10546
10565
  })), children]
10547
10566
  }));
10548
10567
 
10549
- const styles$6 = createStyles({
10568
+ const styles$7 = createStyles({
10550
10569
  getBalanceText: balance => theme => ({
10551
10570
  color: balance === undefined ? theme.palette.alert.main : balance >= 0 ? theme.palette.secondary.dark : theme.palette.error.main
10552
10571
  })
@@ -10569,7 +10588,7 @@ const CarrierBalance = ({
10569
10588
  }, {
10570
10589
  children: isLoadingCarrier || isRefetchingCarrier ? jsxRuntime.jsx(giger.Spinner, {}) : jsxRuntime.jsx(giger.Typography, Object.assign({
10571
10590
  bold: true,
10572
- css: styles$6.getBalanceText(balance)
10591
+ css: styles$7.getBalanceText(balance)
10573
10592
  }, {
10574
10593
  children: balance === undefined ? t("manage-funding:errors.balanceUnknown") : formatMoney({
10575
10594
  amount: balance,
@@ -10591,7 +10610,7 @@ const Spread = ({
10591
10610
  children: children
10592
10611
  }));
10593
10612
 
10594
- const styles$5 = createStyles({
10613
+ const styles$6 = createStyles({
10595
10614
  balanceText: theme => ({
10596
10615
  color: theme.palette.secondary.dark
10597
10616
  }),
@@ -10659,7 +10678,7 @@ const FundAndPurchase = ({
10659
10678
  }, {
10660
10679
  children: [jsxRuntime.jsx(giger.Button, Object.assign({
10661
10680
  bold: false,
10662
- css: styles$5.saveRateButton,
10681
+ css: styles$6.saveRateButton,
10663
10682
  disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
10664
10683
  isLoading: isSavingRate,
10665
10684
  onClick: handleSaveRate,
@@ -10679,7 +10698,7 @@ const FundAndPurchase = ({
10679
10698
  // don't show balance or funding form
10680
10699
  if (!isFundingRequired) return jsxRuntime.jsx("div", Object.assign({
10681
10700
  className: className,
10682
- css: styles$5.container
10701
+ css: styles$6.container
10683
10702
  }, {
10684
10703
  children: renderActionButtons()
10685
10704
  }));
@@ -10692,7 +10711,7 @@ const FundAndPurchase = ({
10692
10711
  // show balance, but not the funding form.
10693
10712
  if (!isFundingEnabled) return jsxRuntime.jsxs("div", Object.assign({
10694
10713
  className: className,
10695
- css: styles$5.container
10714
+ css: styles$6.container
10696
10715
  }, {
10697
10716
  children: [jsxRuntime.jsx(CarrierBalance, {
10698
10717
  carrierId: carrierId
@@ -10704,7 +10723,7 @@ const FundAndPurchase = ({
10704
10723
  // show balance and funding form
10705
10724
  return jsxRuntime.jsxs("div", Object.assign({
10706
10725
  className: className,
10707
- css: styles$5.container
10726
+ css: styles$6.container
10708
10727
  }, {
10709
10728
  children: [jsxRuntime.jsxs(Spread, {
10710
10729
  children: [jsxRuntime.jsx(CarrierBalance, {
@@ -10735,13 +10754,13 @@ const FundAndPurchase = ({
10735
10754
  var _a, _b;
10736
10755
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
10737
10756
  children: [jsxRuntime.jsxs("section", Object.assign({
10738
- css: styles$5.getFormExtension(addFundsForm.isCustomAmount)
10757
+ css: styles$6.getFormExtension(addFundsForm.isCustomAmount)
10739
10758
  }, {
10740
10759
  children: [jsxRuntime.jsx(InlineLabel, Object.assign({
10741
10760
  label: t("manage-funding:fundAndPurchase.newBalance")
10742
10761
  }, {
10743
10762
  children: jsxRuntime.jsx(giger.Typography, Object.assign({
10744
- css: styles$5.balanceText
10763
+ css: styles$6.balanceText
10745
10764
  }, {
10746
10765
  children: formatMoney({
10747
10766
  amount: balance + ((_a = addFundsForm.selectedAmount) !== null && _a !== void 0 ? _a : 0),
@@ -10752,7 +10771,7 @@ const FundAndPurchase = ({
10752
10771
  label: t("manage-funding:fundAndPurchase.finalBalance")
10753
10772
  }, {
10754
10773
  children: jsxRuntime.jsx(giger.Typography, Object.assign({
10755
- css: styles$5.balanceText
10774
+ css: styles$6.balanceText
10756
10775
  }, {
10757
10776
  children: formatMoney({
10758
10777
  amount: balance + ((_b = addFundsForm.selectedAmount) !== null && _b !== void 0 ? _b : 0) - purchaseAmount,
@@ -10779,6 +10798,274 @@ const FundAndPurchase = ({
10779
10798
  }));
10780
10799
  };
10781
10800
 
10801
+ const LabelLayoutPurchase = ({
10802
+ onChange
10803
+ }) => {
10804
+ const {
10805
+ t
10806
+ } = reactI18next.useTranslation(["common", "manage-defaults"]);
10807
+ const [layout, setLayout] = React.useState("4x6");
10808
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
10809
+ children: [jsxRuntime.jsx(giger.InlineNotification, Object.assign({
10810
+ title: t("manage-defaults:label.purchase.title"),
10811
+ type: giger.NotificationType.INFO
10812
+ }, {
10813
+ children: t("manage-defaults:label.purchase.description")
10814
+ })), jsxRuntime.jsx(Spacer, {
10815
+ multiplier: 1.5
10816
+ }), jsxRuntime.jsxs(giger.RadioGroup, Object.assign({
10817
+ name: "labelLayout",
10818
+ onChange: e => {
10819
+ setLayout(e.target.value);
10820
+ onChange(e.target.value);
10821
+ },
10822
+ value: layout
10823
+ }, {
10824
+ children: [jsxRuntime.jsx(giger.Radio, Object.assign({
10825
+ value: "Letter"
10826
+ }, {
10827
+ children: jsxRuntime.jsx(giger.Typography, Object.assign({
10828
+ bold: true
10829
+ }, {
10830
+ children: t("manage-defaults:label.letter.title")
10831
+ }))
10832
+ })), jsxRuntime.jsx(Spacer, {
10833
+ multiplier: 3
10834
+ }), jsxRuntime.jsx(giger.Radio, Object.assign({
10835
+ value: "4x6"
10836
+ }, {
10837
+ children: jsxRuntime.jsx(giger.Typography, Object.assign({
10838
+ bold: true
10839
+ }, {
10840
+ children: t("manage-defaults:label.thermal.title")
10841
+ }))
10842
+ }))]
10843
+ }))]
10844
+ });
10845
+ };
10846
+
10847
+ const styles$5 = createStyles({
10848
+ button: theme => ({
10849
+ backgroundColor: "transparent",
10850
+ padding: 0
10851
+ }),
10852
+ buttonContainer: theme => ({
10853
+ alignItems: "center",
10854
+ display: "flex",
10855
+ justifyContent: "left"
10856
+ }),
10857
+ icon: theme => ({
10858
+ color: theme.palette.secondary.main,
10859
+ position: "absolute",
10860
+ right: theme.spacing(1),
10861
+ top: theme.spacing(1)
10862
+ }),
10863
+ letter: theme => ({
10864
+ ":hover": {
10865
+ border: `1px solid ${theme.palette.secondary.main}`
10866
+ },
10867
+ alignItems: "center",
10868
+ border: `1px solid ${theme.palette.gray.light}`,
10869
+ borderRadius: "10px",
10870
+ cursor: "pointer",
10871
+ display: "flex",
10872
+ flexDirection: "column",
10873
+ height: theme.spacing(32),
10874
+ marginRight: theme.spacing(3.5),
10875
+ position: "relative",
10876
+ width: theme.spacing(24)
10877
+ }),
10878
+ letterInner: theme => ({
10879
+ backgroundColor: "white",
10880
+ border: `1px solid ${theme.palette.gray.light}`,
10881
+ height: theme.spacing(14),
10882
+ marginBottom: theme.spacing(2),
10883
+ marginTop: theme.spacing(6),
10884
+ width: theme.spacing(10)
10885
+ }),
10886
+ letterLabel: theme => ({
10887
+ backgroundColor: "#95C2E0",
10888
+ height: theme.spacing(5),
10889
+ margin: theme.spacing(1.5)
10890
+ }),
10891
+ selectedLetter: theme => ({
10892
+ alignItems: "center",
10893
+ backgroundColor: "#EAF6FF",
10894
+ border: `1px solid ${theme.palette.secondary.main}`,
10895
+ borderRadius: "10px",
10896
+ boxShadow: `0 0 0 3px ${theme.palette.secondary.main}`,
10897
+ boxSizing: "border-box",
10898
+ cursor: "pointer",
10899
+ display: "flex",
10900
+ flexDirection: "column",
10901
+ height: theme.spacing(32),
10902
+ marginRight: theme.spacing(3.5),
10903
+ position: "relative",
10904
+ width: theme.spacing(24)
10905
+ }),
10906
+ selectedThermal: theme => ({
10907
+ alignItems: "center",
10908
+ backgroundColor: "#EAF6FF",
10909
+ border: `1px solid ${theme.palette.secondary.main}`,
10910
+ borderRadius: "10px",
10911
+ boxShadow: `0 0 0 3px ${theme.palette.secondary.main}`,
10912
+ cursor: "pointer",
10913
+ display: "flex",
10914
+ flexDirection: "column",
10915
+ height: theme.spacing(32),
10916
+ position: "relative",
10917
+ width: theme.spacing(24)
10918
+ }),
10919
+ thermal: theme => ({
10920
+ ":hover": {
10921
+ border: `1px solid ${theme.palette.secondary.main}`
10922
+ },
10923
+ alignItems: "center",
10924
+ border: `1px solid ${theme.palette.gray.light}`,
10925
+ borderRadius: "10px",
10926
+ cursor: "pointer",
10927
+ display: "flex",
10928
+ flexDirection: "column",
10929
+ height: theme.spacing(32),
10930
+ position: "relative",
10931
+ width: theme.spacing(24)
10932
+ }),
10933
+ thermalIcon: theme => ({
10934
+ backgroundColor: "#95C2E0",
10935
+ height: theme.spacing(8),
10936
+ width: theme.spacing(5)
10937
+ }),
10938
+ thermalInner: theme => ({
10939
+ alignItems: "center",
10940
+ display: "flex",
10941
+ height: theme.spacing(14),
10942
+ justifyContent: "center",
10943
+ marginBottom: theme.spacing(2),
10944
+ marginTop: theme.spacing(6),
10945
+ width: theme.spacing(10)
10946
+ }),
10947
+ thermalLabel: theme => ({
10948
+ backgroundColor: "#95C2E0",
10949
+ height: theme.spacing(8),
10950
+ width: theme.spacing(5)
10951
+ })
10952
+ });
10953
+
10954
+ const LabelLayoutSettings = ({
10955
+ onChange
10956
+ }) => {
10957
+ var _a;
10958
+ const {
10959
+ t
10960
+ } = reactI18next.useTranslation(["common", "manage-defaults"]);
10961
+ const {
10962
+ data: accountSettings
10963
+ } = alchemy.useGetAccountSettings();
10964
+ const labelLayout = (_a = accountSettings === null || accountSettings === void 0 ? void 0 : accountSettings.defaultLabelLayout) === null || _a === void 0 ? void 0 : _a.toLowerCase();
10965
+ return jsxRuntime.jsx(Section, Object.assign({
10966
+ bold: true,
10967
+ title: t("manage-defaults:label.title")
10968
+ }, {
10969
+ children: jsxRuntime.jsxs("div", Object.assign({
10970
+ css: styles$5.buttonContainer
10971
+ }, {
10972
+ children: [jsxRuntime.jsx("button", Object.assign({
10973
+ css: styles$5.button,
10974
+ id: "letter",
10975
+ onClick: () => {
10976
+ onChange("Letter");
10977
+ },
10978
+ value: "letter"
10979
+ }, {
10980
+ children: jsxRuntime.jsxs("div", Object.assign({
10981
+ css: labelLayout === "letter" ? styles$5.selectedLetter : styles$5.letter
10982
+ }, {
10983
+ children: [labelLayout === "letter" && jsxRuntime.jsx(giger.Icon, {
10984
+ css: styles$5.icon,
10985
+ name: brands.IconNames.CHECK_FILLED
10986
+ }), jsxRuntime.jsx("div", Object.assign({
10987
+ css: styles$5.letterInner
10988
+ }, {
10989
+ children: jsxRuntime.jsx("div", {
10990
+ css: styles$5.letterLabel
10991
+ })
10992
+ })), jsxRuntime.jsx(giger.Typography, {
10993
+ children: t("manage-defaults:label.letter.title")
10994
+ }), jsxRuntime.jsx(Spacer, {
10995
+ multiplier: 0.5
10996
+ }), jsxRuntime.jsx(giger.Typography, Object.assign({
10997
+ css: {
10998
+ color: "#6C757D"
10999
+ }
11000
+ }, {
11001
+ children: t("manage-defaults:label.letter.description")
11002
+ }))]
11003
+ }))
11004
+ })), jsxRuntime.jsx("button", Object.assign({
11005
+ css: styles$5.button,
11006
+ id: "4x6",
11007
+ onClick: e => {
11008
+ onChange(e.currentTarget.value);
11009
+ },
11010
+ value: "4x6"
11011
+ }, {
11012
+ children: jsxRuntime.jsxs("div", Object.assign({
11013
+ css: labelLayout === "4x6" ? styles$5.selectedThermal : styles$5.thermal
11014
+ }, {
11015
+ children: [labelLayout === "4x6" && jsxRuntime.jsx(giger.Icon, {
11016
+ css: styles$5.icon,
11017
+ name: brands.IconNames.CHECK_FILLED
11018
+ }), jsxRuntime.jsx("div", Object.assign({
11019
+ css: styles$5.thermalInner
11020
+ }, {
11021
+ children: jsxRuntime.jsx("div", {
11022
+ css: styles$5.thermalLabel
11023
+ })
11024
+ })), jsxRuntime.jsx(giger.Typography, {
11025
+ children: t("manage-defaults:label.thermal.title")
11026
+ }), jsxRuntime.jsx(Spacer, {
11027
+ multiplier: 0.5
11028
+ }), jsxRuntime.jsx(giger.Typography, Object.assign({
11029
+ css: {
11030
+ color: "#6C757D"
11031
+ }
11032
+ }, {
11033
+ children: t("manage-defaults:label.thermal.description")
11034
+ }))]
11035
+ }))
11036
+ }))]
11037
+ }))
11038
+ }));
11039
+ };
11040
+
11041
+ const LabelLayout = ({
11042
+ display
11043
+ }) => {
11044
+ const {
11045
+ mutateAsync: updateAccountSettings
11046
+ } = alchemy.useUpdateAccountSettings();
11047
+ const {
11048
+ refetch: refreshAccountSettings
11049
+ } = alchemy.useGetAccountSettings();
11050
+ const handleSubmitUpdateAccountSettings = newLabelLayout => __awaiter(void 0, void 0, void 0, function* () {
11051
+ try {
11052
+ yield updateAccountSettings({
11053
+ defaultLabelLayout: newLabelLayout
11054
+ });
11055
+ } catch (error) {
11056
+ console.error(error);
11057
+ }
11058
+ yield refreshAccountSettings();
11059
+ });
11060
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
11061
+ children: [display === "settings" && jsxRuntime.jsx(LabelLayoutSettings, {
11062
+ onChange: handleSubmitUpdateAccountSettings
11063
+ }), display === "purchase" && jsxRuntime.jsx(LabelLayoutPurchase, {
11064
+ onChange: handleSubmitUpdateAccountSettings
11065
+ })]
11066
+ });
11067
+ };
11068
+
10782
11069
  const styles$4 = createStyles({
10783
11070
  fundAndPurchase: theme => ({
10784
11071
  borderTop: `1px solid ${theme.palette.gray.ultraLight}`
@@ -10811,6 +11098,8 @@ const RateForm = ({
10811
11098
  displayableLabelErrors,
10812
11099
  features,
10813
11100
  labelErrors,
11101
+ labels,
11102
+ labelsLoading,
10814
11103
  isLoading,
10815
11104
  onSave,
10816
11105
  onSelectRate,
@@ -10961,6 +11250,12 @@ const RateForm = ({
10961
11250
  children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
10962
11251
  })
10963
11252
  }))]
11253
+ })), !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsxRuntime.jsx(Section, Object.assign({
11254
+ title: t("manage-defaults:label.title")
11255
+ }, {
11256
+ children: jsxRuntime.jsx(LabelLayout, {
11257
+ display: "purchase"
11258
+ })
10964
11259
  })), jsxRuntime.jsx(FundAndPurchase, {
10965
11260
  carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
10966
11261
  control: form.control,
@@ -12650,7 +12945,7 @@ var index = /*#__PURE__*/Object.freeze({
12650
12945
  WarehouseForm: WarehouseForm,
12651
12946
  VoidLabel: VoidLabel,
12652
12947
  WalletForm: WalletForm,
12653
- styles: styles$a,
12948
+ styles: styles$b,
12654
12949
  billingAddressSchema: billingAddressSchema,
12655
12950
  walletSchema: walletSchema,
12656
12951
  BillingFields: BillingFields,
@@ -13197,6 +13492,7 @@ var common = {
13197
13492
  invalidNameOrCompany: "Recipient name and company name (if provided) must have two characters in first and last name.",
13198
13493
  noWarehouses: "You must have an active Ship From Location to use this feature.",
13199
13494
  unableToLoad: {
13495
+ accountSettings: "Unable to load account settings",
13200
13496
  autoFundingSettings: "Unable to load auto funding settings",
13201
13497
  carrier: "Unable to load carrier",
13202
13498
  carriers: "Unable to load carriers",
@@ -13225,6 +13521,7 @@ var common = {
13225
13521
  thirdParty: "Third Party"
13226
13522
  },
13227
13523
  loading: {
13524
+ accountSettings: "Loading account settings...",
13228
13525
  carrier: "Loading carrier...",
13229
13526
  carriers: "Loading carriers...",
13230
13527
  data: "Loading...",
@@ -13538,7 +13835,8 @@ var purchaseLabel$1 = {
13538
13835
  needToAcknowledge: "Need to accept Rate Compliance Agreement"
13539
13836
  },
13540
13837
  rates: {
13541
- uspsMediaMailAcknowledgement: "I confirm that this package is compliant with <1>USPS guidelines for Media Mail®</1>"
13838
+ uspsMediaMailAcknowledgement: "I confirm that this package is compliant with <1>USPS guidelines for Media Mail®</1>",
13839
+ 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
13840
  },
13543
13841
  shipToAddressFormFields: "Ship To Address Form Fields",
13544
13842
  sections: {
@@ -14148,7 +14446,7 @@ const useScrubErrors = ({
14148
14446
  };
14149
14447
 
14150
14448
  var usps_first_class_mail = [
14151
- "First Class Mail packages must weigh less than 16 oz. If the package weight exceeds the weight provided when buying the label, USPS will charge an adjustment fee."
14449
+ "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
14450
  ];
14153
14451
  var usps_media_mail = [
14154
14452
  "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 +14486,7 @@ var rateMessages = {
14188
14486
  "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
14487
  ],
14190
14488
  "usps_first_class_mail:large_envelope_or_flat": [
14191
- "First Class Mail large envelope or flats 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."
14489
+ "Tracking and refunds are not available for First Class Mail Large Envelopes or Flats labels."
14192
14490
  ],
14193
14491
  usps_first_class_mail: usps_first_class_mail,
14194
14492
  usps_media_mail: usps_media_mail,
@@ -14197,10 +14495,25 @@ var rateMessages = {
14197
14495
  usps_priority_mail_express: usps_priority_mail_express,
14198
14496
  ups_ground: ups_ground,
14199
14497
  ups_2nd_day_air: ups_2nd_day_air,
14498
+ "ups_2nd_day_air:Saturday": [
14499
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14500
+ ],
14200
14501
  ups_next_day_air_saver: ups_next_day_air_saver,
14502
+ "ups_next_day_air_saver:Saturday": [
14503
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14504
+ ],
14201
14505
  ups_next_day_air: ups_next_day_air,
14506
+ "ups_next_day_air:Saturday": [
14507
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14508
+ ],
14202
14509
  ups_next_day_air_early_am: ups_next_day_air_early_am,
14510
+ "ups_next_day_air_early_am:Saturday": [
14511
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14512
+ ],
14203
14513
  ups_2nd_day_air_am: ups_2nd_day_air_am,
14514
+ "ups_2nd_day_air_am:Saturday": [
14515
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14516
+ ],
14204
14517
  ups_3_day_select: ups_3_day_select
14205
14518
  };
14206
14519
 
@@ -14234,16 +14547,24 @@ const useRequestRates = ({
14234
14547
  if (result) yield onRatesCalculated === null || onRatesCalculated === void 0 ? void 0 : onRatesCalculated(result.rateResponse.rates, shipment);
14235
14548
  }), [calculateRates, carriers, customPackageTypes, onRatesCalculated]);
14236
14549
  let ratesResponse = ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.rateResponse;
14550
+ const shipDay = React.useMemo(() => {
14551
+ if (ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.shipDate) {
14552
+ return omitTime(ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.shipDate).toLocaleString("en-us", {
14553
+ weekday: "long"
14554
+ });
14555
+ }
14556
+ return;
14557
+ }, [ratedShipment]);
14237
14558
  ratesResponse = React.useMemo(() => ratesResponse && Object.assign(Object.assign({}, ratesResponse), {
14238
14559
  rates: ratesResponse.rates.map(rate => {
14239
- var _a, _b;
14560
+ var _a, _b, _c;
14240
14561
  return Object.assign(Object.assign({}, rate), {
14241
14562
  warningMessages: [
14242
- // add additional rateMessages based on combinations of serviceCode and packageType
14243
- ...((_a = rateMessages[`${rate.serviceCode}:${rate.packageType}`]) !== null && _a !== void 0 ? _a : []), ...((_b = rateMessages[rate.serviceCode]) !== null && _b !== void 0 ? _b : []), ...rate.warningMessages]
14563
+ // add additional rateMessages based on combinations of serviceCode, packageType and shipDay
14564
+ ...((_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
14565
  });
14245
14566
  })
14246
- }), [ratesResponse]);
14567
+ }), [ratesResponse, shipDay]);
14247
14568
  return {
14248
14569
  ratesCalculating,
14249
14570
  ratesErrors,
@@ -14302,6 +14623,10 @@ const useRatesForm = ({
14302
14623
  const {
14303
14624
  data: carriers
14304
14625
  } = alchemy.useListCarriers();
14626
+ const {
14627
+ data: labels,
14628
+ isLoading: labelsLoading
14629
+ } = alchemy.useListLabels();
14305
14630
  const {
14306
14631
  mutateAsync: updateShipment
14307
14632
  } = alchemy.useUpdateSalesOrderShipment();
@@ -14402,6 +14727,8 @@ const useRatesForm = ({
14402
14727
  errors: errors.length > 0 ? errors : undefined,
14403
14728
  isLoading: ratesCalculating,
14404
14729
  labelErrors: (labelErrors === null || labelErrors === void 0 ? void 0 : labelErrors.length) ? labelErrors : undefined,
14730
+ labels,
14731
+ labelsLoading,
14405
14732
  onSave: handleSave,
14406
14733
  onSubmit: handleSubmit,
14407
14734
  rates: ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.rates,