@paydock/client-sdk 1.135.14-beta → 1.137.1-beta

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 (26) hide show
  1. package/README.md +24 -1
  2. package/bundles/index.cjs +69 -50
  3. package/bundles/index.cjs.d.ts +6 -2
  4. package/bundles/index.mjs +69 -50
  5. package/bundles/index.mjs.d.ts +6 -2
  6. package/bundles/types/checkout/v3/instructions/instruction.saved_card_form.show.d.ts +0 -1
  7. package/bundles/types/checkout/v3/instructions/instruction.saved_card_form.show.d.ts.map +1 -1
  8. package/bundles/types/checkout/v3/models/card.model.d.ts +0 -1
  9. package/bundles/types/checkout/v3/models/card.model.d.ts.map +1 -1
  10. package/bundles/types/helper/browser.d.ts.map +1 -1
  11. package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts +5 -1
  12. package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts.map +1 -1
  13. package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts.map +1 -1
  14. package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts.map +1 -1
  15. package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts.map +1 -1
  16. package/bundles/types/wallet-buttons-express/index.d.ts +1 -1
  17. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -1
  18. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +1 -1
  19. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
  20. package/bundles/widget.umd.js +69 -50
  21. package/bundles/widget.umd.js.d.ts +6 -2
  22. package/bundles/widget.umd.js.min.d.ts +6 -2
  23. package/bundles/widget.umd.min.js +1 -1
  24. package/docs/wallet-buttons-express-examples.md +23 -0
  25. package/docs/wallet-buttons-express.md +1 -1
  26. package/package.json +5 -8
package/README.md CHANGED
@@ -4267,6 +4267,29 @@ button.onShippingAddressChange(async function(data) {
4267
4267
  });
4268
4268
  ```
4269
4269
 
4270
+ #### No shipping address
4271
+
4272
+ This is the case where no shipping address is required at all in the popup (e.g., digital goods, services, or virtual products, or Shipping Address collected separately by the merchant). The "Send to" UI field will not be shown in the Apple Pay sheet, it will be hidden.
4273
+
4274
+ **Important:**
4275
+ - No shipping address should be provided in the meta object.
4276
+ - Shipping address could be provided in the initial POST `/v1/charges/wallet` endpoint, if collected previously.
4277
+
4278
+ The required meta parameters for this case are:
4279
+ - `required_shipping_contact_fields`: Only include contact fields if needed (phone, email), but NOT `postalAddress`.
4280
+
4281
+ ```javascript
4282
+ meta: {
4283
+ "amount_label": "TOTAL",
4284
+ "country": "AU",
4285
+ "currency": "AUD",
4286
+ "amount": 10,
4287
+ "shipping_editing_mode": "available",
4288
+ "required_shipping_contact_fields": ["phone", "email"],
4289
+ "apple_pay_capabilities": ["credentials_available", "credentials_status_unknown", "credentials_unavailable"]
4290
+ }
4291
+ ```
4292
+
4270
4293
  ### Paypal Wallet Button Express
4271
4294
  A full description of the meta parameters for [PaypalWalletButtonExpress](#PaypalWalletButtonExpress) meta parameters can be found [here](#PaypalWalletMeta). Below you will find a fully working html example.
4272
4295
 
@@ -4490,7 +4513,7 @@ If the determinated value is credentials_status_unknown, the payment possbily sh
4490
4513
  | [merchant_capabilities] | <code>Array.&lt;(&#x27;supports3DS&#x27;\|&#x27;supportsEMV&#x27;\|&#x27;supportsCredit&#x27;\|&#x27;supportsDebit&#x27;)&gt;</code> | Array of capabilities that the merchant supports, influencing the transaction processing features available. |
4491
4514
  | [supported_networks] | <code>Array.&lt;(&#x27;visa&#x27;\|&#x27;masterCard&#x27;\|&#x27;amex&#x27;\|&#x27;chinaUnionPay&#x27;\|&#x27;discover&#x27;\|&#x27;interac&#x27;\|&#x27;jcb&#x27;\|&#x27;privateLabel&#x27;)&gt;</code> | List of payment networks supported by the merchant for ApplePay transactions. |
4492
4515
  | [required_billing_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;name&#x27;\|&#x27;phone&#x27;\|&#x27;postalAddress&#x27;)&gt;</code> | Contact fields required from the user for billing purposes, improving transaction verification and fraud prevention. Phone and email are currently not returned by Apple. |
4493
- | [required_shipping_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;phone&#x27;)&gt;</code> | Shipping contact fields that are mandatory to complete the transaction. Use email and phone to collect from customer wallet in the abscense of billing one. Required for onShippingAddressChange callback. |
4516
+ | [required_shipping_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;phone&#x27;\|&#x27;postalAddress&#x27;)&gt;</code> | Shipping contact fields that are mandatory to complete the transaction. Use email and phone to collect from customer wallet in the abscense of billing one. Include 'postalAddress' to show shipping address fields collection in the Apple Pay sheet. Required handling of onShippingAddressChange callback. |
4494
4517
  | [supported_countries] | <code>Array.&lt;string&gt;</code> | List of countries where ApplePay is supported by the merchant, restricting usage to specified regions. |
4495
4518
  | [style] | <code>object</code> | Styling configuration for ApplePay buttons displayed during checkout. |
4496
4519
  | [style.button_type] | <code>ApplePayButtonType</code> | Enum type to select the type of ApplePay button (e.g., 'buy', 'donate', etc.), providing user interface customization. |
package/bundles/index.cjs CHANGED
@@ -813,7 +813,7 @@ var Browser = /*#__PURE__*/function () {
813
813
  }, {
814
814
  key: "isSupportPopUp",
815
815
  value: function isSupportPopUp() {
816
- return !this.isFacebook() && !this.isInstagram();
816
+ return !Browser.isFacebook() && !Browser.isInstagram();
817
817
  }
818
818
  }, {
819
819
  key: "getLanguage",
@@ -869,18 +869,18 @@ var Browser = /*#__PURE__*/function () {
869
869
  var M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
870
870
  var tem;
871
871
  if (/trident/i.test(M[1])) {
872
- tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
872
+ tem = /\brv[ :](\d+)/.exec(ua) || [];
873
873
  return {
874
874
  name: 'IE',
875
875
  version: tem[1] || ''
876
876
  };
877
877
  }
878
878
  if (M[1] === 'Chrome') {
879
- tem = ua.match(/\bOPR|Edge\/(\d+)/);
879
+ tem = ua.match(/\b(OPR|Edge)\/(\d+)/);
880
880
  if (tem != null) {
881
881
  return {
882
- name: 'Opera',
883
- version: tem[1]
882
+ name: tem[1] === 'OPR' ? 'Opera' : 'Edge',
883
+ version: tem[2]
884
884
  };
885
885
  }
886
886
  }
@@ -1189,7 +1189,7 @@ SDK.headerKeys = Object.freeze({
1189
1189
  version: 'x-sdk-version',
1190
1190
  type: 'x-sdk-type'
1191
1191
  });
1192
- SDK._version = 'v1.135.14-beta';
1192
+ SDK._version = 'v1.137.1-beta';
1193
1193
 
1194
1194
  function isFunction(value) {
1195
1195
  return typeof value === 'function';
@@ -4413,7 +4413,7 @@ var InstrumentationAgent = /*#__PURE__*/function (_MicroAgent) {
4413
4413
  _classCallCheck(this, InstrumentationAgent);
4414
4414
  _this = _callSuper(this, InstrumentationAgent, [config]);
4415
4415
  _this.call = function (method) {
4416
- if (_this.isAvailable()) {
4416
+ if (_this.isAvailable() && InstrumentationAgent.agent) {
4417
4417
  var _InstrumentationAgent;
4418
4418
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4419
4419
  args[_key - 1] = arguments[_key];
@@ -4432,21 +4432,28 @@ var InstrumentationAgent = /*#__PURE__*/function (_MicroAgent) {
4432
4432
  }], [{
4433
4433
  key: "instance",
4434
4434
  get: function get() {
4435
+ var _a;
4435
4436
  if (!InstrumentationAgent.initialized) {
4436
4437
  var _getConfig = getConfig(),
4437
4438
  available = _getConfig.available,
4438
4439
  options = _getConfig.options;
4439
4440
  InstrumentationAgent.available = available;
4441
+ InstrumentationAgent.agent = undefined;
4440
4442
  if (available) {
4441
4443
  InstrumentationAgent.agent = new InstrumentationAgent(options);
4442
4444
  InstrumentationAgent.agent.start([Instrument$2.featureName, Instrument.featureName, Instrument$1.featureName]);
4443
4445
  }
4444
4446
  InstrumentationAgent.initialized = true;
4445
4447
  }
4446
- return InstrumentationAgent.agent;
4448
+ return (_a = InstrumentationAgent.agent) !== null && _a !== void 0 ? _a : InstrumentationAgent.noopClient;
4447
4449
  }
4448
4450
  }]);
4449
4451
  }(MicroAgent);
4452
+ InstrumentationAgent.noopClient = {
4453
+ call: function call() {
4454
+ // no-op: instrumentation unavailable (missing/invalid config)
4455
+ }
4456
+ };
4450
4457
 
4451
4458
  var ActionRepository = /*#__PURE__*/function () {
4452
4459
  function ActionRepository() {
@@ -18017,7 +18024,7 @@ function addItemInfoBlockStyles() {
18017
18024
  }
18018
18025
  }
18019
18026
 
18020
- var modalStyles = "<style>\n .pd-modal-overlay {\n width: 100%;\n height: 100%;\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n }\n \n .pd-modal-overlay.hidden {\n display: none;\n }\n \n .pd-modal-container {\n padding: 24px;\n max-width: 310px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n background: #ffffff;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n border-radius: 28px;\n box-sizing: border-box;\n }\n \n .pd-modal-title {\n margin: 0;\n color: var(--pd-text-color, #000000);\n font-family: var(--pd-font-family, 'sans-serif'), 'sans-serif';\n font-size: calc(var(--pd-font-size, 22px) * 1.4);\n font-weight: 400;\n }\n \n .pd-modal-message {\n margin: 0;\n color: var(--pd-text-color, #000000);\n font-family: var(--pd-font-family, 'sans-serif'), 'sans-serif';\n font-size: var(--pd-font-size, 16px);\n font-weight: 300;\n line-height: 1.5;\n }\n \n .pd-modal-buttons {\n margin-top: 8px;\n width: 60%;\n display: flex;\n align-self: flex-end;\n gap: 12px;\n }\n \n .pd-modal-buttons .pd-button {\n height: 40px;\n flex: 1;\n box-shadow: none;\n background: transparent;\n }\n \n .pd-modal-buttons .pd-button-text {\n font-size: 14px;\n font-weight: 300;\n }\n \n .pd-modal-container .pd-button:not(:disabled):hover {\n box-shadow: none;\n transform: none;\n background-color: transparent !important;\n }\n \n .pd-modal-cancel-button {\n color: #000000 !important;\n }\n \n .pd-modal-confirm-button {\n color: #ff0000 !important;\n }\n</style>";
18027
+ var modalStyles = "<style>\n .pd-modal-overlay {\n width: 100%;\n height: 100%;\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n }\n \n .pd-modal-overlay.hidden {\n display: none;\n }\n \n .pd-modal-container {\n padding: 24px;\n max-width: 310px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n background: #ffffff;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n border-radius: 28px;\n box-sizing: border-box;\n }\n \n .pd-modal-title {\n margin: 0;\n color: var(--pd-text-color, #000000);\n font-family: var(--pd-font-family, 'sans-serif'), 'sans-serif';\n font-size: 22px;\n font-weight: 400;\n }\n \n .pd-modal-message {\n margin: 0;\n color: var(--pd-text-color, #000000);\n font-family: var(--pd-font-family, 'sans-serif'), 'sans-serif';\n font-size: 16px;\n font-weight: 300;\n line-height: 1.5;\n }\n \n .pd-modal-buttons {\n margin-top: 8px;\n width: 60%;\n display: flex;\n align-self: flex-end;\n gap: 12px;\n }\n \n .pd-modal-buttons .pd-button {\n height: 40px;\n flex: 1;\n box-shadow: none;\n background: transparent;\n }\n \n .pd-modal-buttons .pd-button-text {\n font-size: 14px;\n font-weight: 300;\n }\n \n .pd-modal-container .pd-button:not(:disabled):hover {\n box-shadow: none;\n transform: none;\n background-color: transparent !important;\n }\n \n .pd-modal-cancel-button {\n color: #000000 !important;\n }\n \n .pd-modal-confirm-button {\n color: #ff0000 !important;\n }\n</style>";
18021
18028
  function createModal(options) {
18022
18029
  var _this = this;
18023
18030
  addModalStyles();
@@ -18147,7 +18154,6 @@ var _IMG_MAPPING;
18147
18154
  var AvailableCardSchema;
18148
18155
  (function (AvailableCardSchema) {
18149
18156
  AvailableCardSchema["Amex"] = "amex";
18150
- AvailableCardSchema["Ausbc"] = "ausbc";
18151
18157
  AvailableCardSchema["Diners"] = "diners";
18152
18158
  AvailableCardSchema["Discover"] = "discover";
18153
18159
  AvailableCardSchema["Japcb"] = "japcb";
@@ -18159,7 +18165,7 @@ var AvailableCardSchema;
18159
18165
  AvailableCardSchema["Union"] = "unionpay";
18160
18166
  AvailableCardSchema["GenericCardSvg"] = "GenericCardSvg";
18161
18167
  })(AvailableCardSchema || (AvailableCardSchema = {}));
18162
- var IMG_MAPPING = (_IMG_MAPPING = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_IMG_MAPPING, AvailableCardSchema.Amex, AmexSvg), AvailableCardSchema.Ausbc, GenericCardSvg), AvailableCardSchema.Diners, DinersSvg), AvailableCardSchema.Discover, DiscoverSvg), AvailableCardSchema.Japcb, JapbcSvg), AvailableCardSchema.Laser, GenericCardSvg), AvailableCardSchema.Mastercard, MastercardSvg), AvailableCardSchema.Solo, SoloSvg), AvailableCardSchema.Visa, VisaSvg), AvailableCardSchema.Eftpos, EftposSvg), _defineProperty(_defineProperty(_IMG_MAPPING, AvailableCardSchema.Union, UnionSvg), AvailableCardSchema.GenericCardSvg, GenericCardSvg));
18168
+ var IMG_MAPPING = (_IMG_MAPPING = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_IMG_MAPPING, AvailableCardSchema.Amex, AmexSvg), AvailableCardSchema.Diners, DinersSvg), AvailableCardSchema.Discover, DiscoverSvg), AvailableCardSchema.Japcb, JapbcSvg), AvailableCardSchema.Laser, GenericCardSvg), AvailableCardSchema.Mastercard, MastercardSvg), AvailableCardSchema.Solo, SoloSvg), AvailableCardSchema.Visa, VisaSvg), AvailableCardSchema.Eftpos, EftposSvg), AvailableCardSchema.Union, UnionSvg), _defineProperty(_IMG_MAPPING, AvailableCardSchema.GenericCardSvg, GenericCardSvg));
18163
18169
 
18164
18170
  var DELETE_ICON_SVG = "\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7 1H13M1 4H19M17 4L16.2987 14.5193C16.1935 16.0975 16.1409 16.8867 15.8 17.485C15.4999 18.0118 15.0472 18.4353 14.5017 18.6997C13.882 19 13.0911 19 11.5093 19H8.49065C6.90891 19 6.11803 19 5.49834 18.6997C4.95276 18.4353 4.50009 18.0118 4.19998 17.485C3.85911 16.8867 3.8065 16.0975 3.70129 14.5193L3 4M8 8.5V13.5M12 8.5V13.5\" stroke=\"#191919\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n";
18165
18171
  var SAVED_CARD_DELETE_STYLES = "<style>\n .pd-saved-card-container {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .pd-saved-card-info {\n display: flex;\n align-items: center;\n flex: 1;\n }\n \n .pd-delete-button {\n padding: 12px;\n width: 70px;\n height: 70px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n justify-content: center;\n background: transparent;\n border: none;\n border-radius: 12px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n }\n \n .pd-delete-button:hover {\n background-color: rgba(0, 0, 0, 0.05);\n }\n \n .pd-delete-button:active {\n background-color: rgba(0, 0, 0, 0.1);\n }\n \n .pd-delete-button svg {\n width: 20px;\n height: 20px;\n }\n \n .pd-button.pd-base-button:not(:disabled):hover {\n background: var(--pd-button-color, linear-gradient(92.03deg, #ffffff 0%, #f8f9fa 101.01%)) !important;\n }\n \n .pd-button:not(:disabled).pd-saved-card-info:hover {\n transform: none;\n }\n \n .pd-button.pd-saved-card-info:focus,\n .pd-delete-button:focus,\n .pd-button.pd-saved-card-info:focus-visible,\n .pd-delete-button:focus-visible {\n transform: none;\n outline: none;\n }\n</style>";
@@ -18168,11 +18174,7 @@ var InstructionSavedCardFormShow = /*#__PURE__*/function (_InstructionHandler) {
18168
18174
  var _this;
18169
18175
  _classCallCheck(this, InstructionSavedCardFormShow);
18170
18176
  _this = _callSuper(this, InstructionSavedCardFormShow, arguments);
18171
- _this.isRemoveSavedCardsEnabled =
18172
- // @ts-expect-error feature flag will be replaced at build time
18173
- 'false' === 'true';
18174
18177
  _this.cardSchemaMap = {
18175
- ausbc: 'Australian Bank Card',
18176
18178
  visa: 'Visa',
18177
18179
  mastercard: 'MasterCard',
18178
18180
  diners: "Diner's Club",
@@ -18323,17 +18325,15 @@ var InstructionSavedCardFormShow = /*#__PURE__*/function (_InstructionHandler) {
18323
18325
  });
18324
18326
  cardInfoButton.classList.add('pd-saved-card-info');
18325
18327
  container.appendChild(cardInfoButton);
18326
- if (_this3.isRemoveSavedCardsEnabled) {
18327
- var deleteButton = document.createElement('button');
18328
- deleteButton.classList.add('pd-delete-button');
18329
- deleteButton.type = 'button';
18330
- deleteButton.innerHTML = DELETE_ICON_SVG;
18331
- deleteButton.addEventListener('click', function (e) {
18332
- e.stopPropagation();
18333
- _this3.showDeleteConfirmation(savedCard.id, savedCard.last4, savedCards);
18334
- });
18335
- container.appendChild(deleteButton);
18336
- }
18328
+ var deleteButton = document.createElement('button');
18329
+ deleteButton.classList.add('pd-delete-button');
18330
+ deleteButton.type = 'button';
18331
+ deleteButton.innerHTML = DELETE_ICON_SVG;
18332
+ deleteButton.addEventListener('click', function (e) {
18333
+ e.stopPropagation();
18334
+ _this3.showDeleteConfirmation(savedCard.id, savedCard.last4, savedCards);
18335
+ });
18336
+ container.appendChild(deleteButton);
18337
18337
  var wrapperButton = createButton({
18338
18338
  children: [container],
18339
18339
  styles: _extends(_extends({}, styles), {
@@ -22659,26 +22659,39 @@ var ApplePayWalletButtonExpress = /*#__PURE__*/function (_BaseWalletButton) {
22659
22659
  });
22660
22660
  };
22661
22661
  _this.onPaymentAuthorized = function (event) {
22662
+ var _a, _b, _c, _d;
22662
22663
  var _event$payment = event.payment,
22663
22664
  token = _event$payment.token,
22664
22665
  billingContact = _event$payment.billingContact,
22665
22666
  shippingContact = _event$payment.shippingContact;
22666
- _this.executeWalletCapture(_extends(_extends({}, shippingContact && {
22667
- shipping: {
22668
- address_line1: shippingContact.addressLines[0],
22669
- address_line2: shippingContact.addressLines[1],
22670
- address_line3: shippingContact.addressLines[2],
22671
- address_country: shippingContact.countryCode,
22672
- address_city: shippingContact.locality,
22673
- address_postcode: shippingContact.postalCode,
22674
- address_state: shippingContact.administrativeArea,
22675
- contact: {
22676
- phone: shippingContact.phoneNumber,
22677
- email: shippingContact.emailAddress,
22678
- first_name: shippingContact.givenName,
22667
+ var hasShippingFields = !!(((_a = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _a === void 0 ? void 0 : _a.length) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.countryCode) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.postalCode) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.locality) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.administrativeArea));
22668
+ var hasContactFields = !!((shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.phoneNumber) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.emailAddress) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.givenName) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.familyName));
22669
+ _this.executeWalletCapture(_extends(_extends({}, (hasShippingFields || hasContactFields) && {
22670
+ shipping: _extends(_extends(_extends(_extends(_extends(_extends(_extends(_extends({}, ((_b = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _b === void 0 ? void 0 : _b[0]) && {
22671
+ address_line1: shippingContact.addressLines[0]
22672
+ }), ((_c = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _c === void 0 ? void 0 : _c[1]) && {
22673
+ address_line2: shippingContact.addressLines[1]
22674
+ }), ((_d = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _d === void 0 ? void 0 : _d[2]) && {
22675
+ address_line3: shippingContact.addressLines[2]
22676
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.countryCode) && {
22677
+ address_country: shippingContact.countryCode
22678
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.locality) && {
22679
+ address_city: shippingContact.locality
22680
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.postalCode) && {
22681
+ address_postcode: shippingContact.postalCode
22682
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.administrativeArea) && {
22683
+ address_state: shippingContact.administrativeArea
22684
+ }), hasContactFields && {
22685
+ contact: _extends(_extends(_extends(_extends({}, (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.phoneNumber) && {
22686
+ phone: shippingContact.phoneNumber
22687
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.emailAddress) && {
22688
+ email: shippingContact.emailAddress
22689
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.givenName) && {
22690
+ first_name: shippingContact.givenName
22691
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.familyName) && {
22679
22692
  last_name: shippingContact.familyName
22680
- }
22681
- }
22693
+ })
22694
+ })
22682
22695
  }), {
22683
22696
  customer: {
22684
22697
  first_name: billingContact === null || billingContact === void 0 ? void 0 : billingContact.givenName,
@@ -22928,24 +22941,30 @@ var ApplePayWalletButtonExpress = /*#__PURE__*/function (_BaseWalletButton) {
22928
22941
  }, {
22929
22942
  key: "parseShippingContact",
22930
22943
  value: function parseShippingContact() {
22931
- var _a, _b, _c, _d;
22944
+ var _a, _b, _c, _d, _e, _f, _g, _h;
22932
22945
  if (!((_b = (_a = this.chargeWalletTokenMeta) === null || _a === void 0 ? void 0 : _a.charge) === null || _b === void 0 ? void 0 : _b.shipping) && !this.meta.shipping) {
22933
22946
  return {};
22934
22947
  }
22935
22948
  var shipping = ((_d = (_c = this.chargeWalletTokenMeta) === null || _c === void 0 ? void 0 : _c.charge) === null || _d === void 0 ? void 0 : _d.shipping) || this.meta.shipping;
22936
- return _extends(_extends({}, (shipping === null || shipping === void 0 ? void 0 : shipping.contact) && {
22949
+ var shippingFromCharge = !!((_f = (_e = this.chargeWalletTokenMeta) === null || _e === void 0 ? void 0 : _e.charge) === null || _f === void 0 ? void 0 : _f.shipping);
22950
+ var requiresPostalAddress = (_h = (_g = this.meta.required_shipping_contact_fields) === null || _g === void 0 ? void 0 : _g.includes('postalAddress')) !== null && _h !== void 0 ? _h : false;
22951
+ var contact = _extends({}, (shipping === null || shipping === void 0 ? void 0 : shipping.contact) && {
22937
22952
  phoneNumber: shipping.contact.phone,
22938
22953
  emailAddress: shipping.contact.email,
22939
22954
  givenName: shipping.contact.first_name,
22940
22955
  familyName: shipping.contact.last_name
22941
- }), {
22942
- addressLines: [shipping.address_line1, shipping.address_line2, shipping.address_line3].filter(Boolean),
22943
- locality: shipping.address_city,
22944
- postalCode: shipping.address_postcode,
22945
- administrativeArea: shipping.address_state,
22946
- country: shipping.address_country,
22947
- countryCode: shipping.address_country_code ? shipping.address_country_code : shipping.address_country
22948
22956
  });
22957
+ if (requiresPostalAddress || shippingFromCharge) {
22958
+ return _extends(_extends({}, contact), {
22959
+ addressLines: [shipping.address_line1, shipping.address_line2, shipping.address_line3].filter(Boolean),
22960
+ locality: shipping.address_city,
22961
+ postalCode: shipping.address_postcode,
22962
+ administrativeArea: shipping.address_state,
22963
+ country: shipping.address_country,
22964
+ countryCode: shipping.address_country_code ? shipping.address_country_code : shipping.address_country
22965
+ });
22966
+ }
22967
+ return contact;
22949
22968
  }
22950
22969
  }, {
22951
22970
  key: "parseShippingMethod",
@@ -139,12 +139,16 @@ type HttpRequestUrl = string | URL;
139
139
  type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
140
140
  type AgentMethodNames = keyof AgentPrototype;
141
141
  type AgentMethodParameters<T extends AgentMethodNames> = Parameters<AgentPrototype[T]>;
142
+ type InstrumentationClient = {
143
+ call<T extends AgentMethodNames>(method: T, ...args: AgentMethodParameters<T>): void;
144
+ };
142
145
  declare class InstrumentationAgent extends MicroAgent {
143
146
  private static agent;
144
147
  private static available;
145
148
  private static initialized;
149
+ private static readonly noopClient;
146
150
  private constructor();
147
- static get instance(): InstrumentationAgent;
151
+ static get instance(): InstrumentationClient;
148
152
  isAvailable(): boolean;
149
153
  call: <T extends "addPageAction" | "noticeError">(method: T, ...args: AgentMethodParameters<T>) => void;
150
154
  }
@@ -5014,7 +5018,7 @@ interface ApplePayWalletMeta extends BaseWalletMeta {
5014
5018
  merchant_capabilities?: Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>;
5015
5019
  supported_networks?: Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>;
5016
5020
  required_billing_contact_fields?: Array<'email' | 'name' | 'phone' | 'postalAddress'>;
5017
- required_shipping_contact_fields?: Array<'email' | 'phone'>;
5021
+ required_shipping_contact_fields?: Array<'email' | 'phone' | 'postalAddress'>;
5018
5022
  apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
5019
5023
  supported_countries?: string[];
5020
5024
  style?: {
package/bundles/index.mjs CHANGED
@@ -811,7 +811,7 @@ var Browser = /*#__PURE__*/function () {
811
811
  }, {
812
812
  key: "isSupportPopUp",
813
813
  value: function isSupportPopUp() {
814
- return !this.isFacebook() && !this.isInstagram();
814
+ return !Browser.isFacebook() && !Browser.isInstagram();
815
815
  }
816
816
  }, {
817
817
  key: "getLanguage",
@@ -867,18 +867,18 @@ var Browser = /*#__PURE__*/function () {
867
867
  var M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
868
868
  var tem;
869
869
  if (/trident/i.test(M[1])) {
870
- tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
870
+ tem = /\brv[ :](\d+)/.exec(ua) || [];
871
871
  return {
872
872
  name: 'IE',
873
873
  version: tem[1] || ''
874
874
  };
875
875
  }
876
876
  if (M[1] === 'Chrome') {
877
- tem = ua.match(/\bOPR|Edge\/(\d+)/);
877
+ tem = ua.match(/\b(OPR|Edge)\/(\d+)/);
878
878
  if (tem != null) {
879
879
  return {
880
- name: 'Opera',
881
- version: tem[1]
880
+ name: tem[1] === 'OPR' ? 'Opera' : 'Edge',
881
+ version: tem[2]
882
882
  };
883
883
  }
884
884
  }
@@ -1187,7 +1187,7 @@ SDK.headerKeys = Object.freeze({
1187
1187
  version: 'x-sdk-version',
1188
1188
  type: 'x-sdk-type'
1189
1189
  });
1190
- SDK._version = 'v1.135.14-beta';
1190
+ SDK._version = 'v1.137.1-beta';
1191
1191
 
1192
1192
  function isFunction(value) {
1193
1193
  return typeof value === 'function';
@@ -4411,7 +4411,7 @@ var InstrumentationAgent = /*#__PURE__*/function (_MicroAgent) {
4411
4411
  _classCallCheck(this, InstrumentationAgent);
4412
4412
  _this = _callSuper(this, InstrumentationAgent, [config]);
4413
4413
  _this.call = function (method) {
4414
- if (_this.isAvailable()) {
4414
+ if (_this.isAvailable() && InstrumentationAgent.agent) {
4415
4415
  var _InstrumentationAgent;
4416
4416
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4417
4417
  args[_key - 1] = arguments[_key];
@@ -4430,21 +4430,28 @@ var InstrumentationAgent = /*#__PURE__*/function (_MicroAgent) {
4430
4430
  }], [{
4431
4431
  key: "instance",
4432
4432
  get: function get() {
4433
+ var _a;
4433
4434
  if (!InstrumentationAgent.initialized) {
4434
4435
  var _getConfig = getConfig(),
4435
4436
  available = _getConfig.available,
4436
4437
  options = _getConfig.options;
4437
4438
  InstrumentationAgent.available = available;
4439
+ InstrumentationAgent.agent = undefined;
4438
4440
  if (available) {
4439
4441
  InstrumentationAgent.agent = new InstrumentationAgent(options);
4440
4442
  InstrumentationAgent.agent.start([Instrument$2.featureName, Instrument.featureName, Instrument$1.featureName]);
4441
4443
  }
4442
4444
  InstrumentationAgent.initialized = true;
4443
4445
  }
4444
- return InstrumentationAgent.agent;
4446
+ return (_a = InstrumentationAgent.agent) !== null && _a !== void 0 ? _a : InstrumentationAgent.noopClient;
4445
4447
  }
4446
4448
  }]);
4447
4449
  }(MicroAgent);
4450
+ InstrumentationAgent.noopClient = {
4451
+ call: function call() {
4452
+ // no-op: instrumentation unavailable (missing/invalid config)
4453
+ }
4454
+ };
4448
4455
 
4449
4456
  var ActionRepository = /*#__PURE__*/function () {
4450
4457
  function ActionRepository() {
@@ -18015,7 +18022,7 @@ function addItemInfoBlockStyles() {
18015
18022
  }
18016
18023
  }
18017
18024
 
18018
- var modalStyles = "<style>\n .pd-modal-overlay {\n width: 100%;\n height: 100%;\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n }\n \n .pd-modal-overlay.hidden {\n display: none;\n }\n \n .pd-modal-container {\n padding: 24px;\n max-width: 310px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n background: #ffffff;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n border-radius: 28px;\n box-sizing: border-box;\n }\n \n .pd-modal-title {\n margin: 0;\n color: var(--pd-text-color, #000000);\n font-family: var(--pd-font-family, 'sans-serif'), 'sans-serif';\n font-size: calc(var(--pd-font-size, 22px) * 1.4);\n font-weight: 400;\n }\n \n .pd-modal-message {\n margin: 0;\n color: var(--pd-text-color, #000000);\n font-family: var(--pd-font-family, 'sans-serif'), 'sans-serif';\n font-size: var(--pd-font-size, 16px);\n font-weight: 300;\n line-height: 1.5;\n }\n \n .pd-modal-buttons {\n margin-top: 8px;\n width: 60%;\n display: flex;\n align-self: flex-end;\n gap: 12px;\n }\n \n .pd-modal-buttons .pd-button {\n height: 40px;\n flex: 1;\n box-shadow: none;\n background: transparent;\n }\n \n .pd-modal-buttons .pd-button-text {\n font-size: 14px;\n font-weight: 300;\n }\n \n .pd-modal-container .pd-button:not(:disabled):hover {\n box-shadow: none;\n transform: none;\n background-color: transparent !important;\n }\n \n .pd-modal-cancel-button {\n color: #000000 !important;\n }\n \n .pd-modal-confirm-button {\n color: #ff0000 !important;\n }\n</style>";
18025
+ var modalStyles = "<style>\n .pd-modal-overlay {\n width: 100%;\n height: 100%;\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n }\n \n .pd-modal-overlay.hidden {\n display: none;\n }\n \n .pd-modal-container {\n padding: 24px;\n max-width: 310px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n background: #ffffff;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n border-radius: 28px;\n box-sizing: border-box;\n }\n \n .pd-modal-title {\n margin: 0;\n color: var(--pd-text-color, #000000);\n font-family: var(--pd-font-family, 'sans-serif'), 'sans-serif';\n font-size: 22px;\n font-weight: 400;\n }\n \n .pd-modal-message {\n margin: 0;\n color: var(--pd-text-color, #000000);\n font-family: var(--pd-font-family, 'sans-serif'), 'sans-serif';\n font-size: 16px;\n font-weight: 300;\n line-height: 1.5;\n }\n \n .pd-modal-buttons {\n margin-top: 8px;\n width: 60%;\n display: flex;\n align-self: flex-end;\n gap: 12px;\n }\n \n .pd-modal-buttons .pd-button {\n height: 40px;\n flex: 1;\n box-shadow: none;\n background: transparent;\n }\n \n .pd-modal-buttons .pd-button-text {\n font-size: 14px;\n font-weight: 300;\n }\n \n .pd-modal-container .pd-button:not(:disabled):hover {\n box-shadow: none;\n transform: none;\n background-color: transparent !important;\n }\n \n .pd-modal-cancel-button {\n color: #000000 !important;\n }\n \n .pd-modal-confirm-button {\n color: #ff0000 !important;\n }\n</style>";
18019
18026
  function createModal(options) {
18020
18027
  var _this = this;
18021
18028
  addModalStyles();
@@ -18145,7 +18152,6 @@ var _IMG_MAPPING;
18145
18152
  var AvailableCardSchema;
18146
18153
  (function (AvailableCardSchema) {
18147
18154
  AvailableCardSchema["Amex"] = "amex";
18148
- AvailableCardSchema["Ausbc"] = "ausbc";
18149
18155
  AvailableCardSchema["Diners"] = "diners";
18150
18156
  AvailableCardSchema["Discover"] = "discover";
18151
18157
  AvailableCardSchema["Japcb"] = "japcb";
@@ -18157,7 +18163,7 @@ var AvailableCardSchema;
18157
18163
  AvailableCardSchema["Union"] = "unionpay";
18158
18164
  AvailableCardSchema["GenericCardSvg"] = "GenericCardSvg";
18159
18165
  })(AvailableCardSchema || (AvailableCardSchema = {}));
18160
- var IMG_MAPPING = (_IMG_MAPPING = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_IMG_MAPPING, AvailableCardSchema.Amex, AmexSvg), AvailableCardSchema.Ausbc, GenericCardSvg), AvailableCardSchema.Diners, DinersSvg), AvailableCardSchema.Discover, DiscoverSvg), AvailableCardSchema.Japcb, JapbcSvg), AvailableCardSchema.Laser, GenericCardSvg), AvailableCardSchema.Mastercard, MastercardSvg), AvailableCardSchema.Solo, SoloSvg), AvailableCardSchema.Visa, VisaSvg), AvailableCardSchema.Eftpos, EftposSvg), _defineProperty(_defineProperty(_IMG_MAPPING, AvailableCardSchema.Union, UnionSvg), AvailableCardSchema.GenericCardSvg, GenericCardSvg));
18166
+ var IMG_MAPPING = (_IMG_MAPPING = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_IMG_MAPPING, AvailableCardSchema.Amex, AmexSvg), AvailableCardSchema.Diners, DinersSvg), AvailableCardSchema.Discover, DiscoverSvg), AvailableCardSchema.Japcb, JapbcSvg), AvailableCardSchema.Laser, GenericCardSvg), AvailableCardSchema.Mastercard, MastercardSvg), AvailableCardSchema.Solo, SoloSvg), AvailableCardSchema.Visa, VisaSvg), AvailableCardSchema.Eftpos, EftposSvg), AvailableCardSchema.Union, UnionSvg), _defineProperty(_IMG_MAPPING, AvailableCardSchema.GenericCardSvg, GenericCardSvg));
18161
18167
 
18162
18168
  var DELETE_ICON_SVG = "\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7 1H13M1 4H19M17 4L16.2987 14.5193C16.1935 16.0975 16.1409 16.8867 15.8 17.485C15.4999 18.0118 15.0472 18.4353 14.5017 18.6997C13.882 19 13.0911 19 11.5093 19H8.49065C6.90891 19 6.11803 19 5.49834 18.6997C4.95276 18.4353 4.50009 18.0118 4.19998 17.485C3.85911 16.8867 3.8065 16.0975 3.70129 14.5193L3 4M8 8.5V13.5M12 8.5V13.5\" stroke=\"#191919\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n";
18163
18169
  var SAVED_CARD_DELETE_STYLES = "<style>\n .pd-saved-card-container {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .pd-saved-card-info {\n display: flex;\n align-items: center;\n flex: 1;\n }\n \n .pd-delete-button {\n padding: 12px;\n width: 70px;\n height: 70px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n justify-content: center;\n background: transparent;\n border: none;\n border-radius: 12px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n }\n \n .pd-delete-button:hover {\n background-color: rgba(0, 0, 0, 0.05);\n }\n \n .pd-delete-button:active {\n background-color: rgba(0, 0, 0, 0.1);\n }\n \n .pd-delete-button svg {\n width: 20px;\n height: 20px;\n }\n \n .pd-button.pd-base-button:not(:disabled):hover {\n background: var(--pd-button-color, linear-gradient(92.03deg, #ffffff 0%, #f8f9fa 101.01%)) !important;\n }\n \n .pd-button:not(:disabled).pd-saved-card-info:hover {\n transform: none;\n }\n \n .pd-button.pd-saved-card-info:focus,\n .pd-delete-button:focus,\n .pd-button.pd-saved-card-info:focus-visible,\n .pd-delete-button:focus-visible {\n transform: none;\n outline: none;\n }\n</style>";
@@ -18166,11 +18172,7 @@ var InstructionSavedCardFormShow = /*#__PURE__*/function (_InstructionHandler) {
18166
18172
  var _this;
18167
18173
  _classCallCheck(this, InstructionSavedCardFormShow);
18168
18174
  _this = _callSuper(this, InstructionSavedCardFormShow, arguments);
18169
- _this.isRemoveSavedCardsEnabled =
18170
- // @ts-expect-error feature flag will be replaced at build time
18171
- 'false' === 'true';
18172
18175
  _this.cardSchemaMap = {
18173
- ausbc: 'Australian Bank Card',
18174
18176
  visa: 'Visa',
18175
18177
  mastercard: 'MasterCard',
18176
18178
  diners: "Diner's Club",
@@ -18321,17 +18323,15 @@ var InstructionSavedCardFormShow = /*#__PURE__*/function (_InstructionHandler) {
18321
18323
  });
18322
18324
  cardInfoButton.classList.add('pd-saved-card-info');
18323
18325
  container.appendChild(cardInfoButton);
18324
- if (_this3.isRemoveSavedCardsEnabled) {
18325
- var deleteButton = document.createElement('button');
18326
- deleteButton.classList.add('pd-delete-button');
18327
- deleteButton.type = 'button';
18328
- deleteButton.innerHTML = DELETE_ICON_SVG;
18329
- deleteButton.addEventListener('click', function (e) {
18330
- e.stopPropagation();
18331
- _this3.showDeleteConfirmation(savedCard.id, savedCard.last4, savedCards);
18332
- });
18333
- container.appendChild(deleteButton);
18334
- }
18326
+ var deleteButton = document.createElement('button');
18327
+ deleteButton.classList.add('pd-delete-button');
18328
+ deleteButton.type = 'button';
18329
+ deleteButton.innerHTML = DELETE_ICON_SVG;
18330
+ deleteButton.addEventListener('click', function (e) {
18331
+ e.stopPropagation();
18332
+ _this3.showDeleteConfirmation(savedCard.id, savedCard.last4, savedCards);
18333
+ });
18334
+ container.appendChild(deleteButton);
18335
18335
  var wrapperButton = createButton({
18336
18336
  children: [container],
18337
18337
  styles: _extends(_extends({}, styles), {
@@ -22657,26 +22657,39 @@ var ApplePayWalletButtonExpress = /*#__PURE__*/function (_BaseWalletButton) {
22657
22657
  });
22658
22658
  };
22659
22659
  _this.onPaymentAuthorized = function (event) {
22660
+ var _a, _b, _c, _d;
22660
22661
  var _event$payment = event.payment,
22661
22662
  token = _event$payment.token,
22662
22663
  billingContact = _event$payment.billingContact,
22663
22664
  shippingContact = _event$payment.shippingContact;
22664
- _this.executeWalletCapture(_extends(_extends({}, shippingContact && {
22665
- shipping: {
22666
- address_line1: shippingContact.addressLines[0],
22667
- address_line2: shippingContact.addressLines[1],
22668
- address_line3: shippingContact.addressLines[2],
22669
- address_country: shippingContact.countryCode,
22670
- address_city: shippingContact.locality,
22671
- address_postcode: shippingContact.postalCode,
22672
- address_state: shippingContact.administrativeArea,
22673
- contact: {
22674
- phone: shippingContact.phoneNumber,
22675
- email: shippingContact.emailAddress,
22676
- first_name: shippingContact.givenName,
22665
+ var hasShippingFields = !!(((_a = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _a === void 0 ? void 0 : _a.length) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.countryCode) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.postalCode) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.locality) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.administrativeArea));
22666
+ var hasContactFields = !!((shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.phoneNumber) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.emailAddress) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.givenName) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.familyName));
22667
+ _this.executeWalletCapture(_extends(_extends({}, (hasShippingFields || hasContactFields) && {
22668
+ shipping: _extends(_extends(_extends(_extends(_extends(_extends(_extends(_extends({}, ((_b = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _b === void 0 ? void 0 : _b[0]) && {
22669
+ address_line1: shippingContact.addressLines[0]
22670
+ }), ((_c = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _c === void 0 ? void 0 : _c[1]) && {
22671
+ address_line2: shippingContact.addressLines[1]
22672
+ }), ((_d = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _d === void 0 ? void 0 : _d[2]) && {
22673
+ address_line3: shippingContact.addressLines[2]
22674
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.countryCode) && {
22675
+ address_country: shippingContact.countryCode
22676
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.locality) && {
22677
+ address_city: shippingContact.locality
22678
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.postalCode) && {
22679
+ address_postcode: shippingContact.postalCode
22680
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.administrativeArea) && {
22681
+ address_state: shippingContact.administrativeArea
22682
+ }), hasContactFields && {
22683
+ contact: _extends(_extends(_extends(_extends({}, (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.phoneNumber) && {
22684
+ phone: shippingContact.phoneNumber
22685
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.emailAddress) && {
22686
+ email: shippingContact.emailAddress
22687
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.givenName) && {
22688
+ first_name: shippingContact.givenName
22689
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.familyName) && {
22677
22690
  last_name: shippingContact.familyName
22678
- }
22679
- }
22691
+ })
22692
+ })
22680
22693
  }), {
22681
22694
  customer: {
22682
22695
  first_name: billingContact === null || billingContact === void 0 ? void 0 : billingContact.givenName,
@@ -22926,24 +22939,30 @@ var ApplePayWalletButtonExpress = /*#__PURE__*/function (_BaseWalletButton) {
22926
22939
  }, {
22927
22940
  key: "parseShippingContact",
22928
22941
  value: function parseShippingContact() {
22929
- var _a, _b, _c, _d;
22942
+ var _a, _b, _c, _d, _e, _f, _g, _h;
22930
22943
  if (!((_b = (_a = this.chargeWalletTokenMeta) === null || _a === void 0 ? void 0 : _a.charge) === null || _b === void 0 ? void 0 : _b.shipping) && !this.meta.shipping) {
22931
22944
  return {};
22932
22945
  }
22933
22946
  var shipping = ((_d = (_c = this.chargeWalletTokenMeta) === null || _c === void 0 ? void 0 : _c.charge) === null || _d === void 0 ? void 0 : _d.shipping) || this.meta.shipping;
22934
- return _extends(_extends({}, (shipping === null || shipping === void 0 ? void 0 : shipping.contact) && {
22947
+ var shippingFromCharge = !!((_f = (_e = this.chargeWalletTokenMeta) === null || _e === void 0 ? void 0 : _e.charge) === null || _f === void 0 ? void 0 : _f.shipping);
22948
+ var requiresPostalAddress = (_h = (_g = this.meta.required_shipping_contact_fields) === null || _g === void 0 ? void 0 : _g.includes('postalAddress')) !== null && _h !== void 0 ? _h : false;
22949
+ var contact = _extends({}, (shipping === null || shipping === void 0 ? void 0 : shipping.contact) && {
22935
22950
  phoneNumber: shipping.contact.phone,
22936
22951
  emailAddress: shipping.contact.email,
22937
22952
  givenName: shipping.contact.first_name,
22938
22953
  familyName: shipping.contact.last_name
22939
- }), {
22940
- addressLines: [shipping.address_line1, shipping.address_line2, shipping.address_line3].filter(Boolean),
22941
- locality: shipping.address_city,
22942
- postalCode: shipping.address_postcode,
22943
- administrativeArea: shipping.address_state,
22944
- country: shipping.address_country,
22945
- countryCode: shipping.address_country_code ? shipping.address_country_code : shipping.address_country
22946
22954
  });
22955
+ if (requiresPostalAddress || shippingFromCharge) {
22956
+ return _extends(_extends({}, contact), {
22957
+ addressLines: [shipping.address_line1, shipping.address_line2, shipping.address_line3].filter(Boolean),
22958
+ locality: shipping.address_city,
22959
+ postalCode: shipping.address_postcode,
22960
+ administrativeArea: shipping.address_state,
22961
+ country: shipping.address_country,
22962
+ countryCode: shipping.address_country_code ? shipping.address_country_code : shipping.address_country
22963
+ });
22964
+ }
22965
+ return contact;
22947
22966
  }
22948
22967
  }, {
22949
22968
  key: "parseShippingMethod",
@@ -139,12 +139,16 @@ type HttpRequestUrl = string | URL;
139
139
  type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
140
140
  type AgentMethodNames = keyof AgentPrototype;
141
141
  type AgentMethodParameters<T extends AgentMethodNames> = Parameters<AgentPrototype[T]>;
142
+ type InstrumentationClient = {
143
+ call<T extends AgentMethodNames>(method: T, ...args: AgentMethodParameters<T>): void;
144
+ };
142
145
  declare class InstrumentationAgent extends MicroAgent {
143
146
  private static agent;
144
147
  private static available;
145
148
  private static initialized;
149
+ private static readonly noopClient;
146
150
  private constructor();
147
- static get instance(): InstrumentationAgent;
151
+ static get instance(): InstrumentationClient;
148
152
  isAvailable(): boolean;
149
153
  call: <T extends "addPageAction" | "noticeError">(method: T, ...args: AgentMethodParameters<T>) => void;
150
154
  }
@@ -5014,7 +5018,7 @@ interface ApplePayWalletMeta extends BaseWalletMeta {
5014
5018
  merchant_capabilities?: Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>;
5015
5019
  supported_networks?: Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>;
5016
5020
  required_billing_contact_fields?: Array<'email' | 'name' | 'phone' | 'postalAddress'>;
5017
- required_shipping_contact_fields?: Array<'email' | 'phone'>;
5021
+ required_shipping_contact_fields?: Array<'email' | 'phone' | 'postalAddress'>;
5018
5022
  apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
5019
5023
  supported_countries?: string[];
5020
5024
  style?: {
@@ -6,7 +6,6 @@ declare global {
6
6
  }
7
7
  }
8
8
  export declare class InstructionSavedCardFormShow extends InstructionHandler {
9
- private isRemoveSavedCardsEnabled;
10
9
  handle(context: {
11
10
  instruction_token: string;
12
11
  payload: {
@@ -1 +1 @@
1
- {"version":3,"file":"instruction.saved_card_form.show.d.ts","sourceRoot":"","sources":["../../../../src/checkout/v3/instructions/instruction.saved_card_form.show.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAMvE,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAoExF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,wBAAwB,EAAE,OAAO,CAAC;KACnC;CACF;AAED,qBACa,4BAA6B,SAAQ,kBAAkB;IAClE,OAAO,CAAC,yBAAyB,CAEwB;IAEzD,MAAM,CAAC,OAAO,EAAE;QACd,iBAAiB,EAAE,MAAM,CAAC;QAC1B,OAAO,EAAE;YACP,KAAK,EAAE,SAAS,EAAE,CAAC;YACnB,aAAa,CAAC,EAAE;gBACd,IAAI,CAAC,EAAE;oBACL,gBAAgB,CAAC,EAAE,MAAM,CAAC;oBAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;oBACtB,UAAU,CAAC,EAAE,MAAM,CAAC;oBACpB,YAAY,CAAC,EAAE,MAAM,CAAC;oBACtB,WAAW,CAAC,EAAE,MAAM,CAAC;oBACrB,SAAS,CAAC,EAAE,MAAM,CAAC;iBACpB,CAAC;aACH,CAAC;SACH,CAAC;KACH,GAAG,IAAI;YAWM,iBAAiB;YAoBjB,UAAU;IA4BxB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,yBAAyB;IA6EjC,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,aAAa,CAa2B;CACjD"}
1
+ {"version":3,"file":"instruction.saved_card_form.show.d.ts","sourceRoot":"","sources":["../../../../src/checkout/v3/instructions/instruction.saved_card_form.show.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAMvE,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAoExF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,wBAAwB,EAAE,OAAO,CAAC;KACnC;CACF;AAED,qBACa,4BAA6B,SAAQ,kBAAkB;IAClE,MAAM,CAAC,OAAO,EAAE;QACd,iBAAiB,EAAE,MAAM,CAAC;QAC1B,OAAO,EAAE;YACP,KAAK,EAAE,SAAS,EAAE,CAAC;YACnB,aAAa,CAAC,EAAE;gBACd,IAAI,CAAC,EAAE;oBACL,gBAAgB,CAAC,EAAE,MAAM,CAAC;oBAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;oBACtB,UAAU,CAAC,EAAE,MAAM,CAAC;oBACpB,YAAY,CAAC,EAAE,MAAM,CAAC;oBACtB,WAAW,CAAC,EAAE,MAAM,CAAC;oBACrB,SAAS,CAAC,EAAE,MAAM,CAAC;iBACpB,CAAC;aACH,CAAC;SACH,CAAC;KACH,GAAG,IAAI;YAWM,iBAAiB;YAoBjB,UAAU;IA4BxB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,yBAAyB;IA2EjC,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,aAAa,CAY2B;CACjD"}
@@ -6,7 +6,6 @@ export interface SavedCard {
6
6
  }
7
7
  export declare enum AvailableCardSchema {
8
8
  Amex = "amex",
9
- Ausbc = "ausbc",
10
9
  Diners = "diners",
11
10
  Discover = "discover",
12
11
  Japcb = "japcb",
@@ -1 +1 @@
1
- {"version":3,"file":"card.model.d.ts","sourceRoot":"","sources":["../../../../src/checkout/v3/models/card.model.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,aAAa;IAClB,cAAc,mBAAmB;CAClC;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa9C,CAAC"}
1
+ {"version":3,"file":"card.model.d.ts","sourceRoot":"","sources":["../../../../src/checkout/v3/models/card.model.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,aAAa;IAClB,cAAc,mBAAmB;CAClC;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAY9C,CAAC"}