@blockchyp/blockchyp-ts 2.30.1 → 2.30.3

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.
@@ -29603,6 +29603,12 @@ class BlockChypClient {
29603
29603
  surchargeReview(request) {
29604
29604
  return this._gatewayRequest('post', '/api/surcharge-review', request);
29605
29605
  }
29606
+ /**
29607
+ * Generates a short-lived API key scoped to terminal and payment operations.
29608
+ */
29609
+ transientKey(request) {
29610
+ return this._gatewayRequest('post', '/api/transient-credentials', request);
29611
+ }
29606
29612
  /**
29607
29613
  * Captures a preauthorization.
29608
29614
  */
@@ -30373,8 +30379,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
30373
30379
  exports.TransactionStatus = exports.PaymentLinkStatusResponse = exports.PaymentLinkStatusRequest = exports.TransactionStatusRequest = exports.AuthorizationResponse = exports.TermsAndConditionsResponse = exports.TermsAndConditionsRequest = exports.CloseBatchResponse = exports.CloseBatchRequest = exports.GiftActivateResponse = exports.GiftActivateRequest = exports.ClearTerminalRequest = exports.EnrollResponse = exports.EnrollRequest = exports.VoidResponse = exports.VoidRequest = exports.CaptureResponse = exports.CaptureRequest = exports.RefundRequest = exports.BalanceResponse = exports.BalanceRequest = exports.CardMetadataResponse = exports.CardMetadataRequest = exports.CardMetadata = exports.AuthorizationRequest = exports.WhiteListedCard = exports.BooleanPromptResponse = exports.TextPromptResponse = exports.CustomerToken = exports.UpdateTokenResponse = exports.UpdateTokenRequest = exports.TokenMetadataResponse = exports.TokenMetadataRequest = exports.Customer = exports.CustomerSearchResponse = exports.UpdateCustomerRequest = exports.CustomerSearchRequest = exports.CustomerResponse = exports.CustomerRequest = exports.TextPromptRequest = exports.BooleanPromptRequest = exports.MessageRequest = exports.LocateResponse = exports.LocateRequest = exports.PingResponse = exports.PingRequest = exports.CaptureSignatureResponse = exports.CaptureSignatureRequest = exports.Acknowledgement = exports.ReceiptSuggestions = void 0;
30374
30380
  exports.UpdateMerchantPlatformRequest = exports.MerchantPlatformsResponse = exports.MerchantUser = exports.MerchantUsersResponse = exports.GetMerchantsResponse = exports.GetMerchantsRequest = exports.HealthcareGroup = exports.HealthcareMetadata = exports.UnlinkTokenRequest = exports.LinkTokenRequest = exports.DeleteTokenResponse = exports.DeleteTokenRequest = exports.DeleteCustomerResponse = exports.DeleteCustomerRequest = exports.DeleteQueuedTransactionResponse = exports.DeleteQueuedTransactionRequest = exports.ListQueuedTransactionsResponse = exports.ListQueuedTransactionsRequest = exports.BankAccount = exports.MerchantProfileResponse = exports.MerchantProfile = exports.Address = exports.InviteMerchantUserRequest = exports.MerchantPlatformRequest = exports.MerchantProfileRequest = exports.AddGatewayMerchantRequest = exports.AddTestMerchantRequest = exports.TerminalVolume = exports.BatchDetailsResponse = exports.BatchDetailsRequest = exports.BatchSummary = exports.BatchHistoryResponse = exports.BatchHistoryRequest = exports.TransactionHistoryResponse = exports.TransactionHistoryRequest = exports.CashDiscountResponse = exports.CashDiscountRequest = exports.ResendPaymentLinkResponse = exports.ResendPaymentLinkRequest = exports.CancelPaymentLinkResponse = exports.CancelPaymentLinkRequest = exports.PaymentLinkResponse = exports.PaymentLinkRequest = exports.TerminalStatusResponse = exports.TerminalStatusRequest = exports.HeartbeatResponse = exports.TransactionDisplayRequest = exports.TransactionDisplayTransaction = exports.TransactionDisplayItem = exports.TransactionDisplayDiscount = void 0;
30375
30381
  exports.StatementDeposit = exports.InvoicePayment = exports.InvoiceLineItem = exports.MerchantInvoiceDetailResponse = exports.MerchantInvoiceDetailRequest = exports.MerchantInvoiceSummary = exports.MerchantInvoiceListResponse = exports.MerchantInvoiceListRequest = exports.PartnerStatementAdjustment = exports.PartnerStatementDisbursement = exports.PartnerStatementLineItem = exports.PartnerStatementDetailResponse = exports.PartnerStatementDetailRequest = exports.PartnerStatementListResponse = exports.PartnerStatementSummary = exports.PartnerStatementListRequest = exports.PricingPolicyResponse = exports.PricePoint = exports.PricingPolicyRequest = exports.BrandingAssetResponse = exports.BrandingAsset = exports.BrandingAssetRequest = exports.SlideShowRequest = exports.SlideShowResponse = exports.SlideShow = exports.Slide = exports.MediaLibraryResponse = exports.MediaRequest = exports.UploadStatusRequest = exports.UploadStatus = exports.UploadMetadata = exports.MediaMetadata = exports.SurveyResultsRequest = exports.SurveyDataPoint = exports.SurveyQuestionResponse = exports.SurveyQuestionRequest = exports.SurveyQuestion = exports.TermsAndConditionsLogEntry = exports.TermsAndConditionsLogResponse = exports.TermsAndConditionsLogRequest = exports.TermsAndConditionsTemplateResponse = exports.TermsAndConditionsTemplateRequest = exports.TermsAndConditionsTemplate = exports.TerminalProfile = exports.TerminalActivationRequest = exports.TerminalDeactivationRequest = exports.TerminalProfileResponse = exports.TerminalProfileRequest = exports.MerchantPlatform = exports.UpdateMerchantPlatformResponse = void 0;
30376
- exports.PaymentMethod = exports.PaymentAmounts = exports.CryptocurrencyResponse = exports.PaymentMethodResponse = exports.CoreRequest = exports.TimeoutRequest = exports.ApprovalResponse = exports.SignatureRequest = exports.SignatureResponse = exports.TerminalReference = exports.AbstractAcknowledgement = exports.TerminalDeleteQueuedTransactionRequest = exports.TerminalListQueuedTransactionsRequest = exports.TerminalTerminalStatusRequest = exports.TerminalTransactionDisplayRequest = exports.TerminalTermsAndConditionsResponse = exports.TerminalTermsAndConditionsRequest = exports.TerminalGiftActivateRequest = exports.TerminalClearTerminalRequest = exports.TerminalEnrollRequest = exports.TerminalRefundRequest = exports.TerminalBalanceRequest = exports.TerminalCardMetadataRequest = exports.TerminalAuthorizationRequest = exports.TerminalTextPromptRequest = exports.TerminalBooleanPromptRequest = exports.TerminalMessageRequest = exports.TerminalLocateRequest = exports.TerminalPingRequest = exports.TerminalCaptureSignatureRequest = exports.PricingResponse = exports.ErrorType = exports.PricingResponseData = exports.PricingResponseAttributes = exports.PricingRequest = exports.PricingRequestData = exports.PricingRequestAttributes = exports.PricingMerchantSettings = exports.StateCheckSettings = exports.SubmitApplicationRequest = exports.MerchantApplication = exports.ApplicationAccount = exports.Owner = exports.AggregateBillingLineItemStats = exports.AggregateBillingLineItem = exports.BuyRateLineItem = exports.MerchantCredentialGenerationResponse = exports.MerchantCredentialGenerationRequest = exports.PartnerCommissionBreakdownResponse = exports.PartnerCommissionBreakdownRequest = void 0;
30377
- exports.CoreResponse = exports.PreviousTransaction = exports.Subtotals = exports.RequestAmount = void 0;
30382
+ exports.PreviousTransaction = exports.Subtotals = exports.RequestAmount = exports.PaymentMethod = exports.PaymentAmounts = exports.CryptocurrencyResponse = exports.PaymentMethodResponse = exports.CoreRequest = exports.TimeoutRequest = exports.ApprovalResponse = exports.SignatureRequest = exports.SignatureResponse = exports.TerminalReference = exports.AbstractAcknowledgement = exports.TerminalDeleteQueuedTransactionRequest = exports.TerminalListQueuedTransactionsRequest = exports.TerminalTerminalStatusRequest = exports.TerminalTransactionDisplayRequest = exports.TerminalTermsAndConditionsResponse = exports.TerminalTermsAndConditionsRequest = exports.TerminalGiftActivateRequest = exports.TerminalClearTerminalRequest = exports.TerminalEnrollRequest = exports.TerminalRefundRequest = exports.TerminalBalanceRequest = exports.TerminalCardMetadataRequest = exports.TerminalAuthorizationRequest = exports.TerminalTextPromptRequest = exports.TerminalBooleanPromptRequest = exports.TerminalMessageRequest = exports.TerminalLocateRequest = exports.TerminalPingRequest = exports.TerminalCaptureSignatureRequest = exports.TransientKeyResponse = exports.TransientKeyRequest = exports.SurchargeReviewResponse = exports.SurchargeAttributeResponseData = exports.SurchargeReviewResponseData = exports.SurchargeReviewRequest = exports.SubmitApplicationRequest = exports.MerchantApplication = exports.ApplicationAccount = exports.Owner = exports.AggregateBillingLineItemStats = exports.AggregateBillingLineItem = exports.BuyRateLineItem = exports.MerchantCredentialGenerationResponse = exports.MerchantCredentialGenerationRequest = exports.PartnerCommissionBreakdownResponse = exports.PartnerCommissionBreakdownRequest = void 0;
30383
+ exports.CoreResponse = void 0;
30378
30384
  // CardType is used to differentiate credit, debit, and EBT.
30379
30385
  var CardType;
30380
30386
  (function (CardType) {
@@ -31522,7 +31528,7 @@ exports.WhiteListedCard = WhiteListedCard;
31522
31528
  */
31523
31529
  class AuthorizationRequest {
31524
31530
  // Constructor with default values for optional fields
31525
- constructor(timeout = null, test = null, transactionRef = undefined, autogeneratedRef = null, async = null, queue = null, waitForRemovedCard = false, force = false, orderRef = undefined, destinationAccount = undefined, testCase = undefined, token = undefined, track1 = undefined, track2 = undefined, pan = undefined, routingNumber = undefined, cardholderName = undefined, expMonth = undefined, expYear = undefined, cvv = undefined, address = undefined, postalCode = undefined, country = undefined, manualEntry = false, ksn = undefined, pinBlock = undefined, cardType = undefined, paymentType = undefined, currencyCode = null, amount = null, taxExempt = null, surcharge = null, cashDiscount = null, sigFile = undefined, sigFormat = undefined, sigWidth = 0, disableSignature = false, tipAmount = undefined, taxAmount = undefined, terminalName = undefined, resetConnection = null, transactionId = undefined, onlineAuthCode = undefined, enroll = false, bypassDupeFilter = false, description = undefined, promptForTip = false, cashBackEnabled = false, cardOnFile = false, recurring = false, cit = false, mit = false, subscription = false, purchaseOrderNumber = undefined, supplierReferenceNumber = undefined, lineItems = null, altPrices = undefined, customer = undefined, roundingMode = undefined, healthcareMetadata = undefined, cryptocurrency = undefined, cryptoNetwork = undefined, cryptoReceiveAddress = undefined, paymentRequestLabel = undefined, paymentRequestMessage = undefined, simulateChipRejection = false, simulateOutOfOrderReversal = false, asyncReversals = false, passthroughSurcharge = undefined, healthcare = false, healthcareTotal = undefined, ebtTotal = undefined, cardMetadataLookup = false, totalDiscountAmount = undefined, shippingAmount = undefined, dutyAmount = undefined, processorId = undefined, externalCustomerId = undefined, destinationCountryCode = undefined, shipFromPostalCode = undefined, shipToPostalCode = undefined, orderDate = undefined, shipmentCount = null, shipmentNumber = null) {
31531
+ constructor(timeout = null, test = null, transactionRef = undefined, autogeneratedRef = null, async = null, queue = null, waitForRemovedCard = false, force = false, orderRef = undefined, destinationAccount = undefined, testCase = undefined, token = undefined, track1 = undefined, track2 = undefined, pan = undefined, routingNumber = undefined, cardholderName = undefined, expMonth = undefined, expYear = undefined, cvv = undefined, address = undefined, postalCode = undefined, country = undefined, manualEntry = false, ksn = undefined, pinBlock = undefined, cardType = undefined, paymentType = undefined, currencyCode = null, amount = null, taxExempt = null, surcharge = null, cashDiscount = null, sigFile = undefined, sigFormat = undefined, sigWidth = 0, disableSignature = false, tipAmount = undefined, taxAmount = undefined, terminalName = undefined, resetConnection = null, transactionId = undefined, onlineAuthCode = undefined, enroll = false, bypassDupeFilter = false, description = undefined, promptForTip = false, cashBackEnabled = false, cardOnFile = false, recurring = false, cit = false, mit = false, subscription = false, purchaseOrderNumber = undefined, supplierReferenceNumber = undefined, lineItems = null, altPrices = undefined, customer = undefined, roundingMode = undefined, healthcareMetadata = undefined, cryptocurrency = undefined, cryptoNetwork = undefined, cryptoReceiveAddress = undefined, paymentRequestLabel = undefined, paymentRequestMessage = undefined, simulateChipRejection = false, simulateOutOfOrderReversal = false, asyncReversals = false, passthroughSurcharge = undefined, healthcare = false, healthcareTotal = undefined, ebtTotal = undefined, cardMetadataLookup = false, totalDiscountAmount = undefined, shippingAmount = undefined, dutyAmount = undefined, processorId = undefined, externalCustomerId = undefined, destinationCountryCode = undefined, shipFromPostalCode = undefined, shipToPostalCode = undefined, orderDate = undefined, shipmentCount = null, shipmentNumber = null, externalPartnerMetadata = undefined) {
31526
31532
  /**
31527
31533
  * The request timeout in seconds.
31528
31534
  */
@@ -31668,6 +31674,7 @@ class AuthorizationRequest {
31668
31674
  this.orderDate = orderDate;
31669
31675
  this.shipmentCount = shipmentCount;
31670
31676
  this.shipmentNumber = shipmentNumber;
31677
+ this.externalPartnerMetadata = externalPartnerMetadata;
31671
31678
  }
31672
31679
  }
31673
31680
  exports.AuthorizationRequest = AuthorizationRequest;
@@ -32219,7 +32226,7 @@ exports.CaptureRequest = CaptureRequest;
32219
32226
  */
32220
32227
  class CaptureResponse {
32221
32228
  // Constructor with default values for optional fields
32222
- constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null) {
32229
+ constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, enhancedDataPassed = false) {
32223
32230
  /**
32224
32231
  * Whether or not the request succeeded.
32225
32232
  */
@@ -32359,6 +32366,7 @@ class CaptureResponse {
32359
32366
  this.receiptSuggestions = receiptSuggestions;
32360
32367
  this.customer = customer;
32361
32368
  this.customers = customers;
32369
+ this.enhancedDataPassed = enhancedDataPassed;
32362
32370
  }
32363
32371
  }
32364
32372
  exports.CaptureResponse = CaptureResponse;
@@ -33129,7 +33137,7 @@ exports.TermsAndConditionsResponse = TermsAndConditionsResponse;
33129
33137
  */
33130
33138
  class AuthorizationResponse {
33131
33139
  // Constructor with default values for optional fields
33132
- constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, confirmed = null, cryptoAuthorizedAmount = null, cryptoNetworkFee = null, cryptocurrency = null, cryptoNetwork = null, cryptoReceiveAddress = null, cryptoBlock = null, cryptoTransactionId = null, cryptoPaymentRequest = null, cryptoStatus = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, sigFile = undefined, whiteListedCard = undefined, storeAndForward = null, status = null, cardMetadata = undefined) {
33140
+ constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, confirmed = null, cryptoAuthorizedAmount = null, cryptoNetworkFee = null, cryptocurrency = null, cryptoNetwork = null, cryptoReceiveAddress = null, cryptoBlock = null, cryptoTransactionId = null, cryptoPaymentRequest = null, cryptoStatus = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, sigFile = undefined, whiteListedCard = undefined, storeAndForward = null, status = null, cardMetadata = undefined, enhancedDataPassed = false) {
33133
33141
  /**
33134
33142
  * Whether or not the request succeeded.
33135
33143
  */
@@ -33336,6 +33344,7 @@ class AuthorizationResponse {
33336
33344
  this.storeAndForward = storeAndForward;
33337
33345
  this.status = status;
33338
33346
  this.cardMetadata = cardMetadata;
33347
+ this.enhancedDataPassed = enhancedDataPassed;
33339
33348
  }
33340
33349
  }
33341
33350
  exports.AuthorizationResponse = AuthorizationResponse;
@@ -40394,133 +40403,102 @@ class SubmitApplicationRequest {
40394
40403
  }
40395
40404
  exports.SubmitApplicationRequest = SubmitApplicationRequest;
40396
40405
  /**
40397
- * Models settings related to state checks for a merchant.
40406
+ * Models a surcharge review request.
40398
40407
  */
40399
- class StateCheckSettings {
40408
+ class SurchargeReviewRequest {
40400
40409
  // Constructor with default values for optional fields
40401
- constructor(enabled = null, surchargeExemptStates = null) {
40410
+ constructor(timeout = null, test = null, cardNumber = undefined, token = undefined, amount = undefined, surchargeRate = undefined, debitTransFee = undefined, debitDiscountRate = undefined, surchargePolicy = null, excludedMerchantStates = null, zip = null, state = null, exemptForeignCards = null, surchargingMode = null, pricingPlan = null) {
40402
40411
  /**
40403
- * If state checks are enabled for the merchant.
40412
+ * The request timeout in seconds.
40404
40413
  */
40405
- this.enabled = null;
40414
+ this.timeout = null;
40406
40415
  /**
40407
- * The list of states that are exempt from surcharges.
40416
+ * Whether or not to route transaction to the test gateway.
40408
40417
  */
40409
- this.surchargeExemptStates = null;
40410
- this.enabled = enabled;
40411
- this.surchargeExemptStates = surchargeExemptStates;
40412
- }
40413
- }
40414
- exports.StateCheckSettings = StateCheckSettings;
40415
- /**
40416
- * Models merchant settings and configuration.
40417
- */
40418
- class PricingMerchantSettings {
40419
- // Constructor with default values for optional fields
40420
- constructor(account = null, gateway = null, surchargingEnabled = null, customSurchargePercent = 0, reducedRate = false, inversePricingEnabled = false, creditDiscountRate = 0, acquiringSolution = null, acceptDebit = false, stateCheckSettings = undefined) {
40418
+ this.test = null;
40421
40419
  /**
40422
- * The merchant account identifier.
40420
+ * The surcharge policy.
40423
40421
  */
40424
- this.account = null;
40422
+ this.surchargePolicy = null;
40425
40423
  /**
40426
- * The gateway identifier.
40424
+ * The list of excluded merchant states.
40427
40425
  */
40428
- this.gateway = null;
40426
+ this.excludedMerchantStates = null;
40429
40427
  /**
40430
- * Whether surcharging is enabled for the merchant.
40428
+ * The zip code.
40431
40429
  */
40432
- this.surchargingEnabled = null;
40430
+ this.zip = null;
40433
40431
  /**
40434
- * The acquiring solution identifier.
40432
+ * The state or province.
40435
40433
  */
40436
- this.acquiringSolution = null;
40437
- this.account = account;
40438
- this.gateway = gateway;
40439
- this.surchargingEnabled = surchargingEnabled;
40440
- this.customSurchargePercent = customSurchargePercent;
40441
- this.reducedRate = reducedRate;
40442
- this.inversePricingEnabled = inversePricingEnabled;
40443
- this.creditDiscountRate = creditDiscountRate;
40444
- this.acquiringSolution = acquiringSolution;
40445
- this.acceptDebit = acceptDebit;
40446
- this.stateCheckSettings = stateCheckSettings;
40447
- }
40448
- }
40449
- exports.PricingMerchantSettings = PricingMerchantSettings;
40450
- /**
40451
- * Models the attributes for a pricing request.
40452
- */
40453
- class PricingRequestAttributes {
40454
- // Constructor with default values for optional fields
40455
- constructor(cardNumber = undefined, token = null, merchantIdentifier = undefined, amount = null, country = undefined, postalCode = undefined, state = undefined, merchantSettings = undefined) {
40434
+ this.state = null;
40456
40435
  /**
40457
- * The payment token.
40436
+ * If foreign cards are exempt.
40458
40437
  */
40459
- this.token = null;
40438
+ this.exemptForeignCards = null;
40460
40439
  /**
40461
- * The transaction amount.
40440
+ * The surcharging mode.
40462
40441
  */
40463
- this.amount = null;
40442
+ this.surchargingMode = null;
40443
+ /**
40444
+ * The pricing plan.
40445
+ */
40446
+ this.pricingPlan = null;
40447
+ this.timeout = timeout;
40448
+ this.test = test;
40464
40449
  this.cardNumber = cardNumber;
40465
40450
  this.token = token;
40466
- this.merchantIdentifier = merchantIdentifier;
40467
40451
  this.amount = amount;
40468
- this.country = country;
40469
- this.postalCode = postalCode;
40452
+ this.surchargeRate = surchargeRate;
40453
+ this.debitTransFee = debitTransFee;
40454
+ this.debitDiscountRate = debitDiscountRate;
40455
+ this.surchargePolicy = surchargePolicy;
40456
+ this.excludedMerchantStates = excludedMerchantStates;
40457
+ this.zip = zip;
40470
40458
  this.state = state;
40471
- this.merchantSettings = merchantSettings;
40459
+ this.exemptForeignCards = exemptForeignCards;
40460
+ this.surchargingMode = surchargingMode;
40461
+ this.pricingPlan = pricingPlan;
40472
40462
  }
40473
40463
  }
40474
- exports.PricingRequestAttributes = PricingRequestAttributes;
40464
+ exports.SurchargeReviewRequest = SurchargeReviewRequest;
40475
40465
  /**
40476
- * Models the data wrapper for a pricing request.
40466
+ * Models the data included in a surcharge review response.
40477
40467
  */
40478
- class PricingRequestData {
40468
+ class SurchargeReviewResponseData {
40479
40469
  // Constructor with default values for optional fields
40480
40470
  constructor(type = null, attributes = null) {
40481
40471
  /**
40482
- * The type of the request.
40472
+ * The type of the response.
40483
40473
  */
40484
40474
  this.type = null;
40485
40475
  /**
40486
- * The pricing request attributes.
40476
+ * The attributes of the response.
40487
40477
  */
40488
40478
  this.attributes = null;
40489
40479
  this.type = type;
40490
40480
  this.attributes = attributes;
40491
40481
  }
40492
40482
  }
40493
- exports.PricingRequestData = PricingRequestData;
40483
+ exports.SurchargeReviewResponseData = SurchargeReviewResponseData;
40494
40484
  /**
40495
- * Models a pricing request.
40485
+ * Models the surcharge attributes included in a surcharge review response.
40496
40486
  */
40497
- class PricingRequest {
40487
+ class SurchargeAttributeResponseData {
40498
40488
  // Constructor with default values for optional fields
40499
- constructor(timeout = null, test = null, data = null) {
40489
+ constructor(totalWithSurchargeAmount = null, success = null, type = null, surchargePercent = null, surchargeAmount = null, surchargeExempt = null, cardType = null, cardToken = undefined, brand = null, bin = null, commercialIndicator = undefined, isCommercial = null, isRegulated = null, exemptionReason = undefined, debitFeeAmount = undefined, disclosure = undefined, debitCategory = undefined, countryCode = null, state = undefined, uuid = null, expirationDate = undefined, disclosureAdditional = undefined, cardholderInfo = undefined) {
40500
40490
  /**
40501
- * The request timeout in seconds.
40491
+ * The total amount including surcharge.
40502
40492
  */
40503
- this.timeout = null;
40493
+ this.totalWithSurchargeAmount = null;
40504
40494
  /**
40505
- * Whether or not to route transaction to the test gateway.
40495
+ * If the surcharge review was successful.
40506
40496
  */
40507
- this.test = null;
40497
+ this.success = null;
40508
40498
  /**
40509
- * The pricing request data.
40499
+ * The type of the response.
40510
40500
  */
40511
- this.data = null;
40512
- this.timeout = timeout;
40513
- this.test = test;
40514
- this.data = data;
40515
- }
40516
- }
40517
- exports.PricingRequest = PricingRequest;
40518
- /**
40519
- * Models pricing response data for new handler for pricing api responses.
40520
- */
40521
- class PricingResponseAttributes {
40522
- // Constructor with default values for optional fields
40523
- constructor(surchargePercent = null, surchargeAmount = null, surchargeExempt = null, cardType = null, cardToken = undefined, brand = null, bin = null, commercialIndicator = null, disclosure = undefined, debitCategory = null, countryIssued = null, uuid = null) {
40501
+ this.type = null;
40524
40502
  /**
40525
40503
  * The surcharge percentage.
40526
40504
  */
@@ -40546,21 +40524,24 @@ class PricingResponseAttributes {
40546
40524
  */
40547
40525
  this.bin = null;
40548
40526
  /**
40549
- * The commercial card indicator.
40527
+ * If the card is commercial.
40550
40528
  */
40551
- this.commercialIndicator = null;
40529
+ this.isCommercial = null;
40552
40530
  /**
40553
- * The debit card category.
40531
+ * If the card is Durbin-regulated (US debit).
40554
40532
  */
40555
- this.debitCategory = null;
40533
+ this.isRegulated = null;
40556
40534
  /**
40557
40535
  * The country where the card was issued.
40558
40536
  */
40559
- this.countryIssued = null;
40537
+ this.countryCode = null;
40560
40538
  /**
40561
40539
  * The unique identifier for the pricing response.
40562
40540
  */
40563
40541
  this.uuid = null;
40542
+ this.totalWithSurchargeAmount = totalWithSurchargeAmount;
40543
+ this.success = success;
40544
+ this.type = type;
40564
40545
  this.surchargePercent = surchargePercent;
40565
40546
  this.surchargeAmount = surchargeAmount;
40566
40547
  this.surchargeExempt = surchargeExempt;
@@ -40569,62 +40550,76 @@ class PricingResponseAttributes {
40569
40550
  this.brand = brand;
40570
40551
  this.bin = bin;
40571
40552
  this.commercialIndicator = commercialIndicator;
40553
+ this.isCommercial = isCommercial;
40554
+ this.isRegulated = isRegulated;
40555
+ this.exemptionReason = exemptionReason;
40556
+ this.debitFeeAmount = debitFeeAmount;
40572
40557
  this.disclosure = disclosure;
40573
40558
  this.debitCategory = debitCategory;
40574
- this.countryIssued = countryIssued;
40559
+ this.countryCode = countryCode;
40560
+ this.state = state;
40575
40561
  this.uuid = uuid;
40562
+ this.expirationDate = expirationDate;
40563
+ this.disclosureAdditional = disclosureAdditional;
40564
+ this.cardholderInfo = cardholderInfo;
40576
40565
  }
40577
40566
  }
40578
- exports.PricingResponseAttributes = PricingResponseAttributes;
40567
+ exports.SurchargeAttributeResponseData = SurchargeAttributeResponseData;
40579
40568
  /**
40580
- * Models the data wrapper for a pricing response.
40569
+ * Models a surcharge review response.
40581
40570
  */
40582
- class PricingResponseData {
40571
+ class SurchargeReviewResponse {
40583
40572
  // Constructor with default values for optional fields
40584
- constructor(type = null, attributes = null) {
40573
+ constructor(success = null, error = null, responseDescription = null, data = null) {
40585
40574
  /**
40586
- * The type of the response.
40575
+ * Whether or not the request succeeded.
40587
40576
  */
40588
- this.type = null;
40577
+ this.success = null;
40578
+ /**
40579
+ * The error, if an error occurred.
40580
+ */
40581
+ this.error = null;
40589
40582
  /**
40590
- * The pricing response attributes.
40583
+ * A narrative description of the transaction result.
40591
40584
  */
40592
- this.attributes = null;
40593
- this.type = type;
40594
- this.attributes = attributes;
40585
+ this.responseDescription = null;
40586
+ /**
40587
+ * The data included in the surcharge review response.
40588
+ */
40589
+ this.data = null;
40590
+ this.success = success;
40591
+ this.error = error;
40592
+ this.responseDescription = responseDescription;
40593
+ this.data = data;
40595
40594
  }
40596
40595
  }
40597
- exports.PricingResponseData = PricingResponseData;
40596
+ exports.SurchargeReviewResponse = SurchargeReviewResponse;
40598
40597
  /**
40599
- * Models an error response.
40598
+ * Models a request for short-lived API credentials.
40600
40599
  */
40601
- class ErrorType {
40600
+ class TransientKeyRequest {
40602
40601
  // Constructor with default values for optional fields
40603
- constructor(status = null, title = null, detail = null) {
40604
- /**
40605
- * The HTTP status code.
40606
- */
40607
- this.status = null;
40602
+ constructor(timeout = null, test = null, oneTime = false) {
40608
40603
  /**
40609
- * The error title.
40604
+ * The request timeout in seconds.
40610
40605
  */
40611
- this.title = null;
40606
+ this.timeout = null;
40612
40607
  /**
40613
- * The detailed error message.
40608
+ * Whether or not to route transaction to the test gateway.
40614
40609
  */
40615
- this.detail = null;
40616
- this.status = status;
40617
- this.title = title;
40618
- this.detail = detail;
40610
+ this.test = null;
40611
+ this.timeout = timeout;
40612
+ this.test = test;
40613
+ this.oneTime = oneTime;
40619
40614
  }
40620
40615
  }
40621
- exports.ErrorType = ErrorType;
40616
+ exports.TransientKeyRequest = TransientKeyRequest;
40622
40617
  /**
40623
- * Models a pricing response.
40618
+ * Models a response containing short-lived API credentials.
40624
40619
  */
40625
- class PricingResponse {
40620
+ class TransientKeyResponse {
40626
40621
  // Constructor with default values for optional fields
40627
- constructor(success = null, error = null, responseDescription = null, data = null) {
40622
+ constructor(success = null, error = null, responseDescription = null, apiKey = null, bearerToken = null, signingKey = null) {
40628
40623
  /**
40629
40624
  * Whether or not the request succeeded.
40630
40625
  */
@@ -40638,16 +40633,26 @@ class PricingResponse {
40638
40633
  */
40639
40634
  this.responseDescription = null;
40640
40635
  /**
40641
- * The pricing response data.
40636
+ * The transient API key.
40642
40637
  */
40643
- this.data = null;
40638
+ this.apiKey = null;
40639
+ /**
40640
+ * The transient bearer token.
40641
+ */
40642
+ this.bearerToken = null;
40643
+ /**
40644
+ * The transient signing key.
40645
+ */
40646
+ this.signingKey = null;
40644
40647
  this.success = success;
40645
40648
  this.error = error;
40646
40649
  this.responseDescription = responseDescription;
40647
- this.data = data;
40650
+ this.apiKey = apiKey;
40651
+ this.bearerToken = bearerToken;
40652
+ this.signingKey = signingKey;
40648
40653
  }
40649
40654
  }
40650
- exports.PricingResponse = PricingResponse;
40655
+ exports.TransientKeyResponse = TransientKeyResponse;
40651
40656
  /**
40652
40657
  * A request for customer signature data.
40653
40658
  */
@@ -41291,7 +41296,7 @@ exports.CoreResponse = CoreResponse;
41291
41296
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
41292
41297
 
41293
41298
  "use strict";
41294
- /*! Axios v1.13.4 Copyright (c) 2026 Matt Zabriskie and contributors */
41299
+ /*! Axios v1.15.2 Copyright (c) 2026 Matt Zabriskie and contributors */
41295
41300
 
41296
41301
 
41297
41302
  /**
@@ -41309,30 +41314,30 @@ function bind(fn, thisArg) {
41309
41314
 
41310
41315
  // utils is a library of generic helper functions non-specific to axios
41311
41316
 
41312
- const {toString} = Object.prototype;
41313
- const {getPrototypeOf} = Object;
41314
- const {iterator, toStringTag} = Symbol;
41317
+ const { toString } = Object.prototype;
41318
+ const { getPrototypeOf } = Object;
41319
+ const { iterator, toStringTag } = Symbol;
41315
41320
 
41316
- const kindOf = (cache => thing => {
41317
- const str = toString.call(thing);
41318
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
41321
+ const kindOf = ((cache) => (thing) => {
41322
+ const str = toString.call(thing);
41323
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
41319
41324
  })(Object.create(null));
41320
41325
 
41321
41326
  const kindOfTest = (type) => {
41322
41327
  type = type.toLowerCase();
41323
- return (thing) => kindOf(thing) === type
41328
+ return (thing) => kindOf(thing) === type;
41324
41329
  };
41325
41330
 
41326
- const typeOfTest = type => thing => typeof thing === type;
41331
+ const typeOfTest = (type) => (thing) => typeof thing === type;
41327
41332
 
41328
41333
  /**
41329
- * Determine if a value is an Array
41334
+ * Determine if a value is a non-null object
41330
41335
  *
41331
41336
  * @param {Object} val The value to test
41332
41337
  *
41333
41338
  * @returns {boolean} True if value is an Array, otherwise false
41334
41339
  */
41335
- const {isArray} = Array;
41340
+ const { isArray } = Array;
41336
41341
 
41337
41342
  /**
41338
41343
  * Determine if a value is undefined
@@ -41351,8 +41356,14 @@ const isUndefined = typeOfTest('undefined');
41351
41356
  * @returns {boolean} True if value is a Buffer, otherwise false
41352
41357
  */
41353
41358
  function isBuffer(val) {
41354
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
41355
- && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
41359
+ return (
41360
+ val !== null &&
41361
+ !isUndefined(val) &&
41362
+ val.constructor !== null &&
41363
+ !isUndefined(val.constructor) &&
41364
+ isFunction$1(val.constructor.isBuffer) &&
41365
+ val.constructor.isBuffer(val)
41366
+ );
41356
41367
  }
41357
41368
 
41358
41369
  /**
@@ -41364,7 +41375,6 @@ function isBuffer(val) {
41364
41375
  */
41365
41376
  const isArrayBuffer = kindOfTest('ArrayBuffer');
41366
41377
 
41367
-
41368
41378
  /**
41369
41379
  * Determine if a value is a view on an ArrayBuffer
41370
41380
  *
@@ -41374,10 +41384,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
41374
41384
  */
41375
41385
  function isArrayBufferView(val) {
41376
41386
  let result;
41377
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
41387
+ if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
41378
41388
  result = ArrayBuffer.isView(val);
41379
41389
  } else {
41380
- result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
41390
+ result = val && val.buffer && isArrayBuffer(val.buffer);
41381
41391
  }
41382
41392
  return result;
41383
41393
  }
@@ -41423,7 +41433,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object';
41423
41433
  * @param {*} thing The value to test
41424
41434
  * @returns {boolean} True if value is a Boolean, otherwise false
41425
41435
  */
41426
- const isBoolean = thing => thing === true || thing === false;
41436
+ const isBoolean = (thing) => thing === true || thing === false;
41427
41437
 
41428
41438
  /**
41429
41439
  * Determine if a value is a plain Object
@@ -41438,7 +41448,13 @@ const isPlainObject = (val) => {
41438
41448
  }
41439
41449
 
41440
41450
  const prototype = getPrototypeOf(val);
41441
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
41451
+ return (
41452
+ (prototype === null ||
41453
+ prototype === Object.prototype ||
41454
+ Object.getPrototypeOf(prototype) === null) &&
41455
+ !(toStringTag in val) &&
41456
+ !(iterator in val)
41457
+ );
41442
41458
  };
41443
41459
 
41444
41460
  /**
@@ -41480,6 +41496,31 @@ const isDate = kindOfTest('Date');
41480
41496
  */
41481
41497
  const isFile = kindOfTest('File');
41482
41498
 
41499
+ /**
41500
+ * Determine if a value is a React Native Blob
41501
+ * React Native "blob": an object with a `uri` attribute. Optionally, it can
41502
+ * also have a `name` and `type` attribute to specify filename and content type
41503
+ *
41504
+ * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
41505
+ *
41506
+ * @param {*} value The value to test
41507
+ *
41508
+ * @returns {boolean} True if value is a React Native Blob, otherwise false
41509
+ */
41510
+ const isReactNativeBlob = (value) => {
41511
+ return !!(value && typeof value.uri !== 'undefined');
41512
+ };
41513
+
41514
+ /**
41515
+ * Determine if environment is React Native
41516
+ * ReactNative `FormData` has a non-standard `getParts()` method
41517
+ *
41518
+ * @param {*} formData The formData to test
41519
+ *
41520
+ * @returns {boolean} True if environment is React Native, otherwise false
41521
+ */
41522
+ const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
41523
+
41483
41524
  /**
41484
41525
  * Determine if a value is a Blob
41485
41526
  *
@@ -41514,17 +41555,28 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
41514
41555
  *
41515
41556
  * @returns {boolean} True if value is an FormData, otherwise false
41516
41557
  */
41558
+ function getGlobal() {
41559
+ if (typeof globalThis !== 'undefined') return globalThis;
41560
+ if (typeof self !== 'undefined') return self;
41561
+ if (typeof window !== 'undefined') return window;
41562
+ if (typeof __webpack_require__.g !== 'undefined') return __webpack_require__.g;
41563
+ return {};
41564
+ }
41565
+
41566
+ const G = getGlobal();
41567
+ const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
41568
+
41517
41569
  const isFormData = (thing) => {
41518
- let kind;
41519
- return thing && (
41520
- (typeof FormData === 'function' && thing instanceof FormData) || (
41521
- isFunction$1(thing.append) && (
41522
- (kind = kindOf(thing)) === 'formdata' ||
41523
- // detect form-data instance
41524
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
41525
- )
41526
- )
41527
- )
41570
+ if (!thing) return false;
41571
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
41572
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
41573
+ const proto = getPrototypeOf(thing);
41574
+ if (!proto || proto === Object.prototype) return false;
41575
+ if (!isFunction$1(thing.append)) return false;
41576
+ const kind = kindOf(thing);
41577
+ return kind === 'formdata' ||
41578
+ // detect form-data instance
41579
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
41528
41580
  };
41529
41581
 
41530
41582
  /**
@@ -41536,7 +41588,12 @@ const isFormData = (thing) => {
41536
41588
  */
41537
41589
  const isURLSearchParams = kindOfTest('URLSearchParams');
41538
41590
 
41539
- const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
41591
+ const [isReadableStream, isRequest, isResponse, isHeaders] = [
41592
+ 'ReadableStream',
41593
+ 'Request',
41594
+ 'Response',
41595
+ 'Headers',
41596
+ ].map(kindOfTest);
41540
41597
 
41541
41598
  /**
41542
41599
  * Trim excess whitespace off the beginning and end of a string
@@ -41545,9 +41602,9 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
41545
41602
  *
41546
41603
  * @returns {String} The String freed of excess whitespace
41547
41604
  */
41548
- const trim = (str) => str.trim ?
41549
- str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
41550
-
41605
+ const trim = (str) => {
41606
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
41607
+ };
41551
41608
  /**
41552
41609
  * Iterate over an Array or an Object invoking a function for each item.
41553
41610
  *
@@ -41564,7 +41621,7 @@ const trim = (str) => str.trim ?
41564
41621
  * @param {Boolean} [options.allOwnKeys = false]
41565
41622
  * @returns {any}
41566
41623
  */
41567
- function forEach(obj, fn, {allOwnKeys = false} = {}) {
41624
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
41568
41625
  // Don't bother if no value provided
41569
41626
  if (obj === null || typeof obj === 'undefined') {
41570
41627
  return;
@@ -41602,8 +41659,16 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
41602
41659
  }
41603
41660
  }
41604
41661
 
41662
+ /**
41663
+ * Finds a key in an object, case-insensitive, returning the actual key name.
41664
+ * Returns null if the object is a Buffer or if no match is found.
41665
+ *
41666
+ * @param {Object} obj - The object to search.
41667
+ * @param {string} key - The key to find (case-insensitive).
41668
+ * @returns {?string} The actual key name if found, otherwise null.
41669
+ */
41605
41670
  function findKey(obj, key) {
41606
- if (isBuffer(obj)){
41671
+ if (isBuffer(obj)) {
41607
41672
  return null;
41608
41673
  }
41609
41674
 
@@ -41622,8 +41687,8 @@ function findKey(obj, key) {
41622
41687
 
41623
41688
  const _global = (() => {
41624
41689
  /*eslint no-undef:0*/
41625
- if (typeof globalThis !== "undefined") return globalThis;
41626
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g)
41690
+ if (typeof globalThis !== 'undefined') return globalThis;
41691
+ return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : __webpack_require__.g;
41627
41692
  })();
41628
41693
 
41629
41694
  const isContextDefined = (context) => !isUndefined(context) && context !== _global;
@@ -41647,10 +41712,15 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
41647
41712
  * @returns {Object} Result of all merge properties
41648
41713
  */
41649
41714
  function merge(/* obj1, obj2, obj3, ... */) {
41650
- const {caseless, skipUndefined} = isContextDefined(this) && this || {};
41715
+ const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
41651
41716
  const result = {};
41652
41717
  const assignValue = (val, key) => {
41653
- const targetKey = caseless && findKey(result, key) || key;
41718
+ // Skip dangerous property names to prevent prototype pollution
41719
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
41720
+ return;
41721
+ }
41722
+
41723
+ const targetKey = (caseless && findKey(result, key)) || key;
41654
41724
  if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
41655
41725
  result[targetKey] = merge(result[targetKey], val);
41656
41726
  } else if (isPlainObject(val)) {
@@ -41679,24 +41749,28 @@ function merge(/* obj1, obj2, obj3, ... */) {
41679
41749
  * @param {Boolean} [options.allOwnKeys]
41680
41750
  * @returns {Object} The resulting value of object a
41681
41751
  */
41682
- const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
41683
- forEach(b, (val, key) => {
41684
- if (thisArg && isFunction$1(val)) {
41685
- Object.defineProperty(a, key, {
41686
- value: bind(val, thisArg),
41687
- writable: true,
41688
- enumerable: true,
41689
- configurable: true
41690
- });
41691
- } else {
41692
- Object.defineProperty(a, key, {
41693
- value: val,
41694
- writable: true,
41695
- enumerable: true,
41696
- configurable: true
41697
- });
41698
- }
41699
- }, {allOwnKeys});
41752
+ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
41753
+ forEach(
41754
+ b,
41755
+ (val, key) => {
41756
+ if (thisArg && isFunction$1(val)) {
41757
+ Object.defineProperty(a, key, {
41758
+ value: bind(val, thisArg),
41759
+ writable: true,
41760
+ enumerable: true,
41761
+ configurable: true,
41762
+ });
41763
+ } else {
41764
+ Object.defineProperty(a, key, {
41765
+ value: val,
41766
+ writable: true,
41767
+ enumerable: true,
41768
+ configurable: true,
41769
+ });
41770
+ }
41771
+ },
41772
+ { allOwnKeys }
41773
+ );
41700
41774
  return a;
41701
41775
  };
41702
41776
 
@@ -41708,7 +41782,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
41708
41782
  * @returns {string} content value without BOM
41709
41783
  */
41710
41784
  const stripBOM = (content) => {
41711
- if (content.charCodeAt(0) === 0xFEFF) {
41785
+ if (content.charCodeAt(0) === 0xfeff) {
41712
41786
  content = content.slice(1);
41713
41787
  }
41714
41788
  return content;
@@ -41729,10 +41803,10 @@ const inherits = (constructor, superConstructor, props, descriptors) => {
41729
41803
  value: constructor,
41730
41804
  writable: true,
41731
41805
  enumerable: false,
41732
- configurable: true
41806
+ configurable: true,
41733
41807
  });
41734
41808
  Object.defineProperty(constructor, 'super', {
41735
- value: superConstructor.prototype
41809
+ value: superConstructor.prototype,
41736
41810
  });
41737
41811
  props && Object.assign(constructor.prototype, props);
41738
41812
  };
@@ -41791,7 +41865,6 @@ const endsWith = (str, searchString, position) => {
41791
41865
  return lastIndex !== -1 && lastIndex === position;
41792
41866
  };
41793
41867
 
41794
-
41795
41868
  /**
41796
41869
  * Returns new array from array like object or null if failed
41797
41870
  *
@@ -41820,9 +41893,9 @@ const toArray = (thing) => {
41820
41893
  * @returns {Array}
41821
41894
  */
41822
41895
  // eslint-disable-next-line func-names
41823
- const isTypedArray = (TypedArray => {
41896
+ const isTypedArray = ((TypedArray) => {
41824
41897
  // eslint-disable-next-line func-names
41825
- return thing => {
41898
+ return (thing) => {
41826
41899
  return TypedArray && thing instanceof TypedArray;
41827
41900
  };
41828
41901
  })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
@@ -41870,16 +41943,18 @@ const matchAll = (regExp, str) => {
41870
41943
  /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
41871
41944
  const isHTMLForm = kindOfTest('HTMLFormElement');
41872
41945
 
41873
- const toCamelCase = str => {
41874
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
41875
- function replacer(m, p1, p2) {
41876
- return p1.toUpperCase() + p2;
41877
- }
41878
- );
41946
+ const toCamelCase = (str) => {
41947
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
41948
+ return p1.toUpperCase() + p2;
41949
+ });
41879
41950
  };
41880
41951
 
41881
41952
  /* Creating a function that will check if an object has a property. */
41882
- const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
41953
+ const hasOwnProperty = (
41954
+ ({ hasOwnProperty }) =>
41955
+ (obj, prop) =>
41956
+ hasOwnProperty.call(obj, prop)
41957
+ )(Object.prototype);
41883
41958
 
41884
41959
  /**
41885
41960
  * Determine if a value is a RegExp object
@@ -41929,17 +42004,25 @@ const freezeMethods = (obj) => {
41929
42004
 
41930
42005
  if (!descriptor.set) {
41931
42006
  descriptor.set = () => {
41932
- throw Error('Can not rewrite read-only method \'' + name + '\'');
42007
+ throw Error("Can not rewrite read-only method '" + name + "'");
41933
42008
  };
41934
42009
  }
41935
42010
  });
41936
42011
  };
41937
42012
 
42013
+ /**
42014
+ * Converts an array or a delimited string into an object set with values as keys and true as values.
42015
+ * Useful for fast membership checks.
42016
+ *
42017
+ * @param {Array|string} arrayOrString - The array or string to convert.
42018
+ * @param {string} delimiter - The delimiter to use if input is a string.
42019
+ * @returns {Object} An object with keys from the array or string, values set to true.
42020
+ */
41938
42021
  const toObjectSet = (arrayOrString, delimiter) => {
41939
42022
  const obj = {};
41940
42023
 
41941
42024
  const define = (arr) => {
41942
- arr.forEach(value => {
42025
+ arr.forEach((value) => {
41943
42026
  obj[value] = true;
41944
42027
  });
41945
42028
  };
@@ -41952,11 +42035,9 @@ const toObjectSet = (arrayOrString, delimiter) => {
41952
42035
  const noop = () => {};
41953
42036
 
41954
42037
  const toFiniteNumber = (value, defaultValue) => {
41955
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
42038
+ return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
41956
42039
  };
41957
42040
 
41958
-
41959
-
41960
42041
  /**
41961
42042
  * If the thing is a FormData object, return true, otherwise return false.
41962
42043
  *
@@ -41965,14 +42046,24 @@ const toFiniteNumber = (value, defaultValue) => {
41965
42046
  * @returns {boolean}
41966
42047
  */
41967
42048
  function isSpecCompliantForm(thing) {
41968
- return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
42049
+ return !!(
42050
+ thing &&
42051
+ isFunction$1(thing.append) &&
42052
+ thing[toStringTag] === 'FormData' &&
42053
+ thing[iterator]
42054
+ );
41969
42055
  }
41970
42056
 
42057
+ /**
42058
+ * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
42059
+ *
42060
+ * @param {Object} obj - The object to convert.
42061
+ * @returns {Object} The JSON-compatible object.
42062
+ */
41971
42063
  const toJSONObject = (obj) => {
41972
42064
  const stack = new Array(10);
41973
42065
 
41974
42066
  const visit = (source, i) => {
41975
-
41976
42067
  if (isObject(source)) {
41977
42068
  if (stack.indexOf(source) >= 0) {
41978
42069
  return;
@@ -41983,7 +42074,7 @@ const toJSONObject = (obj) => {
41983
42074
  return source;
41984
42075
  }
41985
42076
 
41986
- if(!('toJSON' in source)) {
42077
+ if (!('toJSON' in source)) {
41987
42078
  stack[i] = source;
41988
42079
  const target = isArray(source) ? [] : {};
41989
42080
 
@@ -42004,45 +42095,77 @@ const toJSONObject = (obj) => {
42004
42095
  return visit(obj, 0);
42005
42096
  };
42006
42097
 
42098
+ /**
42099
+ * Determines if a value is an async function.
42100
+ *
42101
+ * @param {*} thing - The value to test.
42102
+ * @returns {boolean} True if value is an async function, otherwise false.
42103
+ */
42007
42104
  const isAsyncFn = kindOfTest('AsyncFunction');
42008
42105
 
42106
+ /**
42107
+ * Determines if a value is thenable (has then and catch methods).
42108
+ *
42109
+ * @param {*} thing - The value to test.
42110
+ * @returns {boolean} True if value is thenable, otherwise false.
42111
+ */
42009
42112
  const isThenable = (thing) =>
42010
- thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
42113
+ thing &&
42114
+ (isObject(thing) || isFunction$1(thing)) &&
42115
+ isFunction$1(thing.then) &&
42116
+ isFunction$1(thing.catch);
42011
42117
 
42012
42118
  // original code
42013
42119
  // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
42014
42120
 
42121
+ /**
42122
+ * Provides a cross-platform setImmediate implementation.
42123
+ * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
42124
+ *
42125
+ * @param {boolean} setImmediateSupported - Whether setImmediate is supported.
42126
+ * @param {boolean} postMessageSupported - Whether postMessage is supported.
42127
+ * @returns {Function} A function to schedule a callback asynchronously.
42128
+ */
42015
42129
  const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
42016
42130
  if (setImmediateSupported) {
42017
42131
  return setImmediate;
42018
42132
  }
42019
42133
 
42020
- return postMessageSupported ? ((token, callbacks) => {
42021
- _global.addEventListener("message", ({source, data}) => {
42022
- if (source === _global && data === token) {
42023
- callbacks.length && callbacks.shift()();
42024
- }
42025
- }, false);
42134
+ return postMessageSupported
42135
+ ? ((token, callbacks) => {
42136
+ _global.addEventListener(
42137
+ 'message',
42138
+ ({ source, data }) => {
42139
+ if (source === _global && data === token) {
42140
+ callbacks.length && callbacks.shift()();
42141
+ }
42142
+ },
42143
+ false
42144
+ );
42026
42145
 
42027
- return (cb) => {
42028
- callbacks.push(cb);
42029
- _global.postMessage(token, "*");
42030
- }
42031
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
42032
- })(
42033
- typeof setImmediate === 'function',
42034
- isFunction$1(_global.postMessage)
42035
- );
42146
+ return (cb) => {
42147
+ callbacks.push(cb);
42148
+ _global.postMessage(token, '*');
42149
+ };
42150
+ })(`axios@${Math.random()}`, [])
42151
+ : (cb) => setTimeout(cb);
42152
+ })(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
42036
42153
 
42037
- const asap = typeof queueMicrotask !== 'undefined' ?
42038
- queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
42154
+ /**
42155
+ * Schedules a microtask or asynchronous callback as soon as possible.
42156
+ * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
42157
+ *
42158
+ * @type {Function}
42159
+ */
42160
+ const asap =
42161
+ typeof queueMicrotask !== 'undefined'
42162
+ ? queueMicrotask.bind(_global)
42163
+ : (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
42039
42164
 
42040
42165
  // *********************
42041
42166
 
42042
-
42043
42167
  const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
42044
42168
 
42045
-
42046
42169
  var utils$1 = {
42047
42170
  isArray,
42048
42171
  isArrayBuffer,
@@ -42062,6 +42185,8 @@ var utils$1 = {
42062
42185
  isUndefined,
42063
42186
  isDate,
42064
42187
  isFile,
42188
+ isReactNativeBlob,
42189
+ isReactNative,
42065
42190
  isBlob,
42066
42191
  isRegExp,
42067
42192
  isFunction: isFunction$1,
@@ -42100,61 +42225,78 @@ var utils$1 = {
42100
42225
  isThenable,
42101
42226
  setImmediate: _setImmediate,
42102
42227
  asap,
42103
- isIterable
42228
+ isIterable,
42104
42229
  };
42105
42230
 
42106
42231
  class AxiosError extends Error {
42107
- static from(error, code, config, request, response, customProps) {
42108
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
42109
- axiosError.cause = error;
42110
- axiosError.name = error.name;
42111
- customProps && Object.assign(axiosError, customProps);
42112
- return axiosError;
42113
- }
42232
+ static from(error, code, config, request, response, customProps) {
42233
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
42234
+ axiosError.cause = error;
42235
+ axiosError.name = error.name;
42114
42236
 
42115
- /**
42116
- * Create an Error with the specified message, config, error code, request and response.
42117
- *
42118
- * @param {string} message The error message.
42119
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
42120
- * @param {Object} [config] The config.
42121
- * @param {Object} [request] The request.
42122
- * @param {Object} [response] The response.
42123
- *
42124
- * @returns {Error} The created error.
42125
- */
42126
- constructor(message, code, config, request, response) {
42127
- super(message);
42128
- this.name = 'AxiosError';
42129
- this.isAxiosError = true;
42130
- code && (this.code = code);
42131
- config && (this.config = config);
42132
- request && (this.request = request);
42133
- if (response) {
42134
- this.response = response;
42135
- this.status = response.status;
42136
- }
42237
+ // Preserve status from the original error if not already set from response
42238
+ if (error.status != null && axiosError.status == null) {
42239
+ axiosError.status = error.status;
42137
42240
  }
42138
42241
 
42139
- toJSON() {
42140
- return {
42141
- // Standard
42142
- message: this.message,
42143
- name: this.name,
42144
- // Microsoft
42145
- description: this.description,
42146
- number: this.number,
42147
- // Mozilla
42148
- fileName: this.fileName,
42149
- lineNumber: this.lineNumber,
42150
- columnNumber: this.columnNumber,
42151
- stack: this.stack,
42152
- // Axios
42153
- config: utils$1.toJSONObject(this.config),
42154
- code: this.code,
42155
- status: this.status,
42156
- };
42242
+ customProps && Object.assign(axiosError, customProps);
42243
+ return axiosError;
42244
+ }
42245
+
42246
+ /**
42247
+ * Create an Error with the specified message, config, error code, request and response.
42248
+ *
42249
+ * @param {string} message The error message.
42250
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
42251
+ * @param {Object} [config] The config.
42252
+ * @param {Object} [request] The request.
42253
+ * @param {Object} [response] The response.
42254
+ *
42255
+ * @returns {Error} The created error.
42256
+ */
42257
+ constructor(message, code, config, request, response) {
42258
+ super(message);
42259
+
42260
+ // Make message enumerable to maintain backward compatibility
42261
+ // The native Error constructor sets message as non-enumerable,
42262
+ // but axios < v1.13.3 had it as enumerable
42263
+ Object.defineProperty(this, 'message', {
42264
+ value: message,
42265
+ enumerable: true,
42266
+ writable: true,
42267
+ configurable: true,
42268
+ });
42269
+
42270
+ this.name = 'AxiosError';
42271
+ this.isAxiosError = true;
42272
+ code && (this.code = code);
42273
+ config && (this.config = config);
42274
+ request && (this.request = request);
42275
+ if (response) {
42276
+ this.response = response;
42277
+ this.status = response.status;
42157
42278
  }
42279
+ }
42280
+
42281
+ toJSON() {
42282
+ return {
42283
+ // Standard
42284
+ message: this.message,
42285
+ name: this.name,
42286
+ // Microsoft
42287
+ description: this.description,
42288
+ number: this.number,
42289
+ // Mozilla
42290
+ fileName: this.fileName,
42291
+ lineNumber: this.lineNumber,
42292
+ columnNumber: this.columnNumber,
42293
+ stack: this.stack,
42294
+ // Axios
42295
+ config: utils$1.toJSONObject(this.config),
42296
+ code: this.code,
42297
+ status: this.status,
42298
+ };
42299
+ }
42158
42300
  }
42159
42301
 
42160
42302
  // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
@@ -42170,8 +42312,7 @@ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
42170
42312
  AxiosError.ERR_CANCELED = 'ERR_CANCELED';
42171
42313
  AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
42172
42314
  AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
42173
-
42174
- var AxiosError$1 = AxiosError;
42315
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
42175
42316
 
42176
42317
  // eslint-disable-next-line strict
42177
42318
  var httpAdapter = null;
@@ -42209,11 +42350,14 @@ function removeBrackets(key) {
42209
42350
  */
42210
42351
  function renderKey(path, key, dots) {
42211
42352
  if (!path) return key;
42212
- return path.concat(key).map(function each(token, i) {
42213
- // eslint-disable-next-line no-param-reassign
42214
- token = removeBrackets(token);
42215
- return !dots && i ? '[' + token + ']' : token;
42216
- }).join(dots ? '.' : '');
42353
+ return path
42354
+ .concat(key)
42355
+ .map(function each(token, i) {
42356
+ // eslint-disable-next-line no-param-reassign
42357
+ token = removeBrackets(token);
42358
+ return !dots && i ? '[' + token + ']' : token;
42359
+ })
42360
+ .join(dots ? '.' : '');
42217
42361
  }
42218
42362
 
42219
42363
  /**
@@ -42263,21 +42407,27 @@ function toFormData(obj, formData, options) {
42263
42407
  formData = formData || new (FormData)();
42264
42408
 
42265
42409
  // eslint-disable-next-line no-param-reassign
42266
- options = utils$1.toFlatObject(options, {
42267
- metaTokens: true,
42268
- dots: false,
42269
- indexes: false
42270
- }, false, function defined(option, source) {
42271
- // eslint-disable-next-line no-eq-null,eqeqeq
42272
- return !utils$1.isUndefined(source[option]);
42273
- });
42410
+ options = utils$1.toFlatObject(
42411
+ options,
42412
+ {
42413
+ metaTokens: true,
42414
+ dots: false,
42415
+ indexes: false,
42416
+ },
42417
+ false,
42418
+ function defined(option, source) {
42419
+ // eslint-disable-next-line no-eq-null,eqeqeq
42420
+ return !utils$1.isUndefined(source[option]);
42421
+ }
42422
+ );
42274
42423
 
42275
42424
  const metaTokens = options.metaTokens;
42276
42425
  // eslint-disable-next-line no-use-before-define
42277
42426
  const visitor = options.visitor || defaultVisitor;
42278
42427
  const dots = options.dots;
42279
42428
  const indexes = options.indexes;
42280
- const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
42429
+ const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
42430
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
42281
42431
  const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
42282
42432
 
42283
42433
  if (!utils$1.isFunction(visitor)) {
@@ -42296,7 +42446,7 @@ function toFormData(obj, formData, options) {
42296
42446
  }
42297
42447
 
42298
42448
  if (!useBlob && utils$1.isBlob(value)) {
42299
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
42449
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
42300
42450
  }
42301
42451
 
42302
42452
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
@@ -42319,6 +42469,11 @@ function toFormData(obj, formData, options) {
42319
42469
  function defaultVisitor(value, key, path) {
42320
42470
  let arr = value;
42321
42471
 
42472
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
42473
+ formData.append(renderKey(path, key, dots), convertValue(value));
42474
+ return false;
42475
+ }
42476
+
42322
42477
  if (value && !path && typeof value === 'object') {
42323
42478
  if (utils$1.endsWith(key, '{}')) {
42324
42479
  // eslint-disable-next-line no-param-reassign
@@ -42327,17 +42482,22 @@ function toFormData(obj, formData, options) {
42327
42482
  value = JSON.stringify(value);
42328
42483
  } else if (
42329
42484
  (utils$1.isArray(value) && isFlatArray(value)) ||
42330
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
42331
- )) {
42485
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
42486
+ ) {
42332
42487
  // eslint-disable-next-line no-param-reassign
42333
42488
  key = removeBrackets(key);
42334
42489
 
42335
42490
  arr.forEach(function each(el, index) {
42336
- !(utils$1.isUndefined(el) || el === null) && formData.append(
42337
- // eslint-disable-next-line no-nested-ternary
42338
- indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
42339
- convertValue(el)
42340
- );
42491
+ !(utils$1.isUndefined(el) || el === null) &&
42492
+ formData.append(
42493
+ // eslint-disable-next-line no-nested-ternary
42494
+ indexes === true
42495
+ ? renderKey([key], index, dots)
42496
+ : indexes === null
42497
+ ? key
42498
+ : key + '[]',
42499
+ convertValue(el)
42500
+ );
42341
42501
  });
42342
42502
  return false;
42343
42503
  }
@@ -42357,12 +42517,19 @@ function toFormData(obj, formData, options) {
42357
42517
  const exposedHelpers = Object.assign(predicates, {
42358
42518
  defaultVisitor,
42359
42519
  convertValue,
42360
- isVisitable
42520
+ isVisitable,
42361
42521
  });
42362
42522
 
42363
- function build(value, path) {
42523
+ function build(value, path, depth = 0) {
42364
42524
  if (utils$1.isUndefined(value)) return;
42365
42525
 
42526
+ if (depth > maxDepth) {
42527
+ throw new AxiosError(
42528
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
42529
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
42530
+ );
42531
+ }
42532
+
42366
42533
  if (stack.indexOf(value) !== -1) {
42367
42534
  throw Error('Circular reference detected in ' + path.join('.'));
42368
42535
  }
@@ -42370,12 +42537,12 @@ function toFormData(obj, formData, options) {
42370
42537
  stack.push(value);
42371
42538
 
42372
42539
  utils$1.forEach(value, function each(el, key) {
42373
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
42374
- formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
42375
- );
42540
+ const result =
42541
+ !(utils$1.isUndefined(el) || el === null) &&
42542
+ visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
42376
42543
 
42377
42544
  if (result === true) {
42378
- build(el, path ? path.concat(key) : [key]);
42545
+ build(el, path ? path.concat(key) : [key], depth + 1);
42379
42546
  }
42380
42547
  });
42381
42548
 
@@ -42407,9 +42574,8 @@ function encode$1(str) {
42407
42574
  ')': '%29',
42408
42575
  '~': '%7E',
42409
42576
  '%20': '+',
42410
- '%00': '\x00'
42411
42577
  };
42412
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
42578
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
42413
42579
  return charMap[match];
42414
42580
  });
42415
42581
  }
@@ -42435,29 +42601,33 @@ prototype.append = function append(name, value) {
42435
42601
  };
42436
42602
 
42437
42603
  prototype.toString = function toString(encoder) {
42438
- const _encode = encoder ? function(value) {
42439
- return encoder.call(this, value, encode$1);
42440
- } : encode$1;
42604
+ const _encode = encoder
42605
+ ? function (value) {
42606
+ return encoder.call(this, value, encode$1);
42607
+ }
42608
+ : encode$1;
42441
42609
 
42442
- return this._pairs.map(function each(pair) {
42443
- return _encode(pair[0]) + '=' + _encode(pair[1]);
42444
- }, '').join('&');
42610
+ return this._pairs
42611
+ .map(function each(pair) {
42612
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
42613
+ }, '')
42614
+ .join('&');
42445
42615
  };
42446
42616
 
42447
42617
  /**
42448
- * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
42449
- * URI encoded counterparts
42618
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
42619
+ * their plain counterparts (`:`, `$`, `,`, `+`).
42450
42620
  *
42451
42621
  * @param {string} val The value to be encoded.
42452
42622
  *
42453
42623
  * @returns {string} The encoded value.
42454
42624
  */
42455
42625
  function encode(val) {
42456
- return encodeURIComponent(val).
42457
- replace(/%3A/gi, ':').
42458
- replace(/%24/g, '$').
42459
- replace(/%2C/gi, ',').
42460
- replace(/%20/g, '+');
42626
+ return encodeURIComponent(val)
42627
+ .replace(/%3A/gi, ':')
42628
+ .replace(/%24/g, '$')
42629
+ .replace(/%2C/gi, ',')
42630
+ .replace(/%20/g, '+');
42461
42631
  }
42462
42632
 
42463
42633
  /**
@@ -42474,11 +42644,13 @@ function buildURL(url, params, options) {
42474
42644
  return url;
42475
42645
  }
42476
42646
 
42477
- const _encode = options && options.encode || encode;
42647
+ const _encode = (options && options.encode) || encode;
42478
42648
 
42479
- const _options = utils$1.isFunction(options) ? {
42480
- serialize: options
42481
- } : options;
42649
+ const _options = utils$1.isFunction(options)
42650
+ ? {
42651
+ serialize: options,
42652
+ }
42653
+ : options;
42482
42654
 
42483
42655
  const serializeFn = _options && _options.serialize;
42484
42656
 
@@ -42487,13 +42659,13 @@ function buildURL(url, params, options) {
42487
42659
  if (serializeFn) {
42488
42660
  serializedParams = serializeFn(params, _options);
42489
42661
  } else {
42490
- serializedParams = utils$1.isURLSearchParams(params) ?
42491
- params.toString() :
42492
- new AxiosURLSearchParams(params, _options).toString(_encode);
42662
+ serializedParams = utils$1.isURLSearchParams(params)
42663
+ ? params.toString()
42664
+ : new AxiosURLSearchParams(params, _options).toString(_encode);
42493
42665
  }
42494
42666
 
42495
42667
  if (serializedParams) {
42496
- const hashmarkIndex = url.indexOf("#");
42668
+ const hashmarkIndex = url.indexOf('#');
42497
42669
 
42498
42670
  if (hashmarkIndex !== -1) {
42499
42671
  url = url.slice(0, hashmarkIndex);
@@ -42523,7 +42695,7 @@ class InterceptorManager {
42523
42695
  fulfilled,
42524
42696
  rejected,
42525
42697
  synchronous: options ? options.synchronous : false,
42526
- runWhen: options ? options.runWhen : null
42698
+ runWhen: options ? options.runWhen : null,
42527
42699
  });
42528
42700
  return this.handlers.length - 1;
42529
42701
  }
@@ -42571,12 +42743,11 @@ class InterceptorManager {
42571
42743
  }
42572
42744
  }
42573
42745
 
42574
- var InterceptorManager$1 = InterceptorManager;
42575
-
42576
42746
  var transitionalDefaults = {
42577
42747
  silentJSONParsing: true,
42578
42748
  forcedJSONParsing: true,
42579
- clarifyTimeoutError: false
42749
+ clarifyTimeoutError: false,
42750
+ legacyInterceptorReqResOrdering: true,
42580
42751
  };
42581
42752
 
42582
42753
  var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
@@ -42590,14 +42761,14 @@ var platform$1 = {
42590
42761
  classes: {
42591
42762
  URLSearchParams: URLSearchParams$1,
42592
42763
  FormData: FormData$1,
42593
- Blob: Blob$1
42764
+ Blob: Blob$1,
42594
42765
  },
42595
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
42766
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
42596
42767
  };
42597
42768
 
42598
42769
  const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
42599
42770
 
42600
- const _navigator = typeof navigator === 'object' && navigator || undefined;
42771
+ const _navigator = (typeof navigator === 'object' && navigator) || undefined;
42601
42772
 
42602
42773
  /**
42603
42774
  * Determine if we're running in a standard browser environment
@@ -42616,7 +42787,8 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
42616
42787
  *
42617
42788
  * @returns {boolean}
42618
42789
  */
42619
- const hasStandardBrowserEnv = hasBrowserEnv &&
42790
+ const hasStandardBrowserEnv =
42791
+ hasBrowserEnv &&
42620
42792
  (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
42621
42793
 
42622
42794
  /**
@@ -42637,25 +42809,25 @@ const hasStandardBrowserWebWorkerEnv = (() => {
42637
42809
  );
42638
42810
  })();
42639
42811
 
42640
- const origin = hasBrowserEnv && window.location.href || 'http://localhost';
42812
+ const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
42641
42813
 
42642
42814
  var utils = /*#__PURE__*/Object.freeze({
42643
42815
  __proto__: null,
42644
42816
  hasBrowserEnv: hasBrowserEnv,
42645
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
42646
42817
  hasStandardBrowserEnv: hasStandardBrowserEnv,
42818
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
42647
42819
  navigator: _navigator,
42648
42820
  origin: origin
42649
42821
  });
42650
42822
 
42651
42823
  var platform = {
42652
42824
  ...utils,
42653
- ...platform$1
42825
+ ...platform$1,
42654
42826
  };
42655
42827
 
42656
42828
  function toURLEncodedForm(data, options) {
42657
42829
  return toFormData(data, new platform.classes.URLSearchParams(), {
42658
- visitor: function(value, key, path, helpers) {
42830
+ visitor: function (value, key, path, helpers) {
42659
42831
  if (platform.isNode && utils$1.isBuffer(value)) {
42660
42832
  this.append(key, value.toString('base64'));
42661
42833
  return false;
@@ -42663,7 +42835,7 @@ function toURLEncodedForm(data, options) {
42663
42835
 
42664
42836
  return helpers.defaultVisitor.apply(this, arguments);
42665
42837
  },
42666
- ...options
42838
+ ...options,
42667
42839
  });
42668
42840
  }
42669
42841
 
@@ -42679,7 +42851,7 @@ function parsePropPath(name) {
42679
42851
  // foo.x.y.z
42680
42852
  // foo-x-y-z
42681
42853
  // foo x y z
42682
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
42854
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
42683
42855
  return match[0] === '[]' ? '' : match[1] || match[0];
42684
42856
  });
42685
42857
  }
@@ -42723,7 +42895,9 @@ function formDataToJSON(formData) {
42723
42895
 
42724
42896
  if (isLast) {
42725
42897
  if (utils$1.hasOwnProp(target, name)) {
42726
- target[name] = [target[name], value];
42898
+ target[name] = utils$1.isArray(target[name])
42899
+ ? target[name].concat(value)
42900
+ : [target[name], value];
42727
42901
  } else {
42728
42902
  target[name] = value;
42729
42903
  }
@@ -42757,6 +42931,8 @@ function formDataToJSON(formData) {
42757
42931
  return null;
42758
42932
  }
42759
42933
 
42934
+ const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
42935
+
42760
42936
  /**
42761
42937
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
42762
42938
  * of the input
@@ -42783,96 +42959,110 @@ function stringifySafely(rawValue, parser, encoder) {
42783
42959
  }
42784
42960
 
42785
42961
  const defaults = {
42786
-
42787
42962
  transitional: transitionalDefaults,
42788
42963
 
42789
42964
  adapter: ['xhr', 'http', 'fetch'],
42790
42965
 
42791
- transformRequest: [function transformRequest(data, headers) {
42792
- const contentType = headers.getContentType() || '';
42793
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
42794
- const isObjectPayload = utils$1.isObject(data);
42966
+ transformRequest: [
42967
+ function transformRequest(data, headers) {
42968
+ const contentType = headers.getContentType() || '';
42969
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
42970
+ const isObjectPayload = utils$1.isObject(data);
42795
42971
 
42796
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
42797
- data = new FormData(data);
42798
- }
42972
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
42973
+ data = new FormData(data);
42974
+ }
42799
42975
 
42800
- const isFormData = utils$1.isFormData(data);
42976
+ const isFormData = utils$1.isFormData(data);
42801
42977
 
42802
- if (isFormData) {
42803
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
42804
- }
42978
+ if (isFormData) {
42979
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
42980
+ }
42805
42981
 
42806
- if (utils$1.isArrayBuffer(data) ||
42807
- utils$1.isBuffer(data) ||
42808
- utils$1.isStream(data) ||
42809
- utils$1.isFile(data) ||
42810
- utils$1.isBlob(data) ||
42811
- utils$1.isReadableStream(data)
42812
- ) {
42813
- return data;
42814
- }
42815
- if (utils$1.isArrayBufferView(data)) {
42816
- return data.buffer;
42817
- }
42818
- if (utils$1.isURLSearchParams(data)) {
42819
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
42820
- return data.toString();
42821
- }
42982
+ if (
42983
+ utils$1.isArrayBuffer(data) ||
42984
+ utils$1.isBuffer(data) ||
42985
+ utils$1.isStream(data) ||
42986
+ utils$1.isFile(data) ||
42987
+ utils$1.isBlob(data) ||
42988
+ utils$1.isReadableStream(data)
42989
+ ) {
42990
+ return data;
42991
+ }
42992
+ if (utils$1.isArrayBufferView(data)) {
42993
+ return data.buffer;
42994
+ }
42995
+ if (utils$1.isURLSearchParams(data)) {
42996
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
42997
+ return data.toString();
42998
+ }
42822
42999
 
42823
- let isFileList;
43000
+ let isFileList;
42824
43001
 
42825
- if (isObjectPayload) {
42826
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
42827
- return toURLEncodedForm(data, this.formSerializer).toString();
42828
- }
43002
+ if (isObjectPayload) {
43003
+ const formSerializer = own(this, 'formSerializer');
43004
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
43005
+ return toURLEncodedForm(data, formSerializer).toString();
43006
+ }
42829
43007
 
42830
- if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
42831
- const _FormData = this.env && this.env.FormData;
43008
+ if (
43009
+ (isFileList = utils$1.isFileList(data)) ||
43010
+ contentType.indexOf('multipart/form-data') > -1
43011
+ ) {
43012
+ const env = own(this, 'env');
43013
+ const _FormData = env && env.FormData;
42832
43014
 
42833
- return toFormData(
42834
- isFileList ? {'files[]': data} : data,
42835
- _FormData && new _FormData(),
42836
- this.formSerializer
42837
- );
43015
+ return toFormData(
43016
+ isFileList ? { 'files[]': data } : data,
43017
+ _FormData && new _FormData(),
43018
+ formSerializer
43019
+ );
43020
+ }
42838
43021
  }
42839
- }
42840
43022
 
42841
- if (isObjectPayload || hasJSONContentType ) {
42842
- headers.setContentType('application/json', false);
42843
- return stringifySafely(data);
42844
- }
43023
+ if (isObjectPayload || hasJSONContentType) {
43024
+ headers.setContentType('application/json', false);
43025
+ return stringifySafely(data);
43026
+ }
42845
43027
 
42846
- return data;
42847
- }],
43028
+ return data;
43029
+ },
43030
+ ],
42848
43031
 
42849
- transformResponse: [function transformResponse(data) {
42850
- const transitional = this.transitional || defaults.transitional;
42851
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
42852
- const JSONRequested = this.responseType === 'json';
43032
+ transformResponse: [
43033
+ function transformResponse(data) {
43034
+ const transitional = own(this, 'transitional') || defaults.transitional;
43035
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
43036
+ const responseType = own(this, 'responseType');
43037
+ const JSONRequested = responseType === 'json';
42853
43038
 
42854
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
42855
- return data;
42856
- }
43039
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
43040
+ return data;
43041
+ }
42857
43042
 
42858
- if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
42859
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
42860
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
43043
+ if (
43044
+ data &&
43045
+ utils$1.isString(data) &&
43046
+ ((forcedJSONParsing && !responseType) || JSONRequested)
43047
+ ) {
43048
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
43049
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
42861
43050
 
42862
- try {
42863
- return JSON.parse(data, this.parseReviver);
42864
- } catch (e) {
42865
- if (strictJSONParsing) {
42866
- if (e.name === 'SyntaxError') {
42867
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
43051
+ try {
43052
+ return JSON.parse(data, own(this, 'parseReviver'));
43053
+ } catch (e) {
43054
+ if (strictJSONParsing) {
43055
+ if (e.name === 'SyntaxError') {
43056
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
43057
+ }
43058
+ throw e;
42868
43059
  }
42869
- throw e;
42870
43060
  }
42871
43061
  }
42872
- }
42873
43062
 
42874
- return data;
42875
- }],
43063
+ return data;
43064
+ },
43065
+ ],
42876
43066
 
42877
43067
  /**
42878
43068
  * A timeout in milliseconds to abort a request. If set to 0 (default) a
@@ -42888,7 +43078,7 @@ const defaults = {
42888
43078
 
42889
43079
  env: {
42890
43080
  FormData: platform.classes.FormData,
42891
- Blob: platform.classes.Blob
43081
+ Blob: platform.classes.Blob,
42892
43082
  },
42893
43083
 
42894
43084
  validateStatus: function validateStatus(status) {
@@ -42897,25 +43087,36 @@ const defaults = {
42897
43087
 
42898
43088
  headers: {
42899
43089
  common: {
42900
- 'Accept': 'application/json, text/plain, */*',
42901
- 'Content-Type': undefined
42902
- }
42903
- }
43090
+ Accept: 'application/json, text/plain, */*',
43091
+ 'Content-Type': undefined,
43092
+ },
43093
+ },
42904
43094
  };
42905
43095
 
42906
43096
  utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
42907
43097
  defaults.headers[method] = {};
42908
43098
  });
42909
43099
 
42910
- var defaults$1 = defaults;
42911
-
42912
43100
  // RawAxiosHeaders whose duplicates are ignored by node
42913
43101
  // c.f. https://nodejs.org/api/http.html#http_message_headers
42914
43102
  const ignoreDuplicateOf = utils$1.toObjectSet([
42915
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
42916
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
42917
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
42918
- 'referer', 'retry-after', 'user-agent'
43103
+ 'age',
43104
+ 'authorization',
43105
+ 'content-length',
43106
+ 'content-type',
43107
+ 'etag',
43108
+ 'expires',
43109
+ 'from',
43110
+ 'host',
43111
+ 'if-modified-since',
43112
+ 'if-unmodified-since',
43113
+ 'last-modified',
43114
+ 'location',
43115
+ 'max-forwards',
43116
+ 'proxy-authorization',
43117
+ 'referer',
43118
+ 'retry-after',
43119
+ 'user-agent',
42919
43120
  ]);
42920
43121
 
42921
43122
  /**
@@ -42932,47 +43133,81 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
42932
43133
  *
42933
43134
  * @returns {Object} Headers parsed into an object
42934
43135
  */
42935
- var parseHeaders = rawHeaders => {
43136
+ var parseHeaders = (rawHeaders) => {
42936
43137
  const parsed = {};
42937
43138
  let key;
42938
43139
  let val;
42939
43140
  let i;
42940
43141
 
42941
- rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
42942
- i = line.indexOf(':');
42943
- key = line.substring(0, i).trim().toLowerCase();
42944
- val = line.substring(i + 1).trim();
43142
+ rawHeaders &&
43143
+ rawHeaders.split('\n').forEach(function parser(line) {
43144
+ i = line.indexOf(':');
43145
+ key = line.substring(0, i).trim().toLowerCase();
43146
+ val = line.substring(i + 1).trim();
42945
43147
 
42946
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
42947
- return;
42948
- }
43148
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
43149
+ return;
43150
+ }
42949
43151
 
42950
- if (key === 'set-cookie') {
42951
- if (parsed[key]) {
42952
- parsed[key].push(val);
43152
+ if (key === 'set-cookie') {
43153
+ if (parsed[key]) {
43154
+ parsed[key].push(val);
43155
+ } else {
43156
+ parsed[key] = [val];
43157
+ }
42953
43158
  } else {
42954
- parsed[key] = [val];
43159
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
42955
43160
  }
42956
- } else {
42957
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
42958
- }
42959
- });
43161
+ });
42960
43162
 
42961
43163
  return parsed;
42962
43164
  };
42963
43165
 
42964
43166
  const $internals = Symbol('internals');
42965
43167
 
43168
+ const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
43169
+
43170
+ function trimSPorHTAB(str) {
43171
+ let start = 0;
43172
+ let end = str.length;
43173
+
43174
+ while (start < end) {
43175
+ const code = str.charCodeAt(start);
43176
+
43177
+ if (code !== 0x09 && code !== 0x20) {
43178
+ break;
43179
+ }
43180
+
43181
+ start += 1;
43182
+ }
43183
+
43184
+ while (end > start) {
43185
+ const code = str.charCodeAt(end - 1);
43186
+
43187
+ if (code !== 0x09 && code !== 0x20) {
43188
+ break;
43189
+ }
43190
+
43191
+ end -= 1;
43192
+ }
43193
+
43194
+ return start === 0 && end === str.length ? str : str.slice(start, end);
43195
+ }
43196
+
42966
43197
  function normalizeHeader(header) {
42967
43198
  return header && String(header).trim().toLowerCase();
42968
43199
  }
42969
43200
 
43201
+ function sanitizeHeaderValue(str) {
43202
+ return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
43203
+ }
43204
+
42970
43205
  function normalizeValue(value) {
42971
43206
  if (value === false || value == null) {
42972
43207
  return value;
42973
43208
  }
42974
43209
 
42975
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
43210
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
42976
43211
  }
42977
43212
 
42978
43213
  function parseTokens(str) {
@@ -43010,8 +43245,10 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
43010
43245
  }
43011
43246
 
43012
43247
  function formatHeader(header) {
43013
- return header.trim()
43014
- .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
43248
+ return header
43249
+ .trim()
43250
+ .toLowerCase()
43251
+ .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
43015
43252
  return char.toUpperCase() + str;
43016
43253
  });
43017
43254
  }
@@ -43019,12 +43256,12 @@ function formatHeader(header) {
43019
43256
  function buildAccessors(obj, header) {
43020
43257
  const accessorName = utils$1.toCamelCase(' ' + header);
43021
43258
 
43022
- ['get', 'set', 'has'].forEach(methodName => {
43259
+ ['get', 'set', 'has'].forEach((methodName) => {
43023
43260
  Object.defineProperty(obj, methodName + accessorName, {
43024
- value: function(arg1, arg2, arg3) {
43261
+ value: function (arg1, arg2, arg3) {
43025
43262
  return this[methodName].call(this, header, arg1, arg2, arg3);
43026
43263
  },
43027
- configurable: true
43264
+ configurable: true,
43028
43265
  });
43029
43266
  });
43030
43267
  }
@@ -43046,7 +43283,12 @@ class AxiosHeaders {
43046
43283
 
43047
43284
  const key = utils$1.findKey(self, lHeader);
43048
43285
 
43049
- if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
43286
+ if (
43287
+ !key ||
43288
+ self[key] === undefined ||
43289
+ _rewrite === true ||
43290
+ (_rewrite === undefined && self[key] !== false)
43291
+ ) {
43050
43292
  self[key || _header] = normalizeValue(_value);
43051
43293
  }
43052
43294
  }
@@ -43056,17 +43298,22 @@ class AxiosHeaders {
43056
43298
 
43057
43299
  if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
43058
43300
  setHeaders(header, valueOrRewrite);
43059
- } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
43301
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
43060
43302
  setHeaders(parseHeaders(header), valueOrRewrite);
43061
43303
  } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
43062
- let obj = {}, dest, key;
43304
+ let obj = {},
43305
+ dest,
43306
+ key;
43063
43307
  for (const entry of header) {
43064
43308
  if (!utils$1.isArray(entry)) {
43065
43309
  throw TypeError('Object iterator must return a key-value pair');
43066
43310
  }
43067
43311
 
43068
- obj[key = entry[0]] = (dest = obj[key]) ?
43069
- (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
43312
+ obj[(key = entry[0])] = (dest = obj[key])
43313
+ ? utils$1.isArray(dest)
43314
+ ? [...dest, entry[1]]
43315
+ : [dest, entry[1]]
43316
+ : entry[1];
43070
43317
  }
43071
43318
 
43072
43319
  setHeaders(obj, valueOrRewrite);
@@ -43113,7 +43360,11 @@ class AxiosHeaders {
43113
43360
  if (header) {
43114
43361
  const key = utils$1.findKey(this, header);
43115
43362
 
43116
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
43363
+ return !!(
43364
+ key &&
43365
+ this[key] !== undefined &&
43366
+ (!matcher || matchHeaderValue(this, this[key], key, matcher))
43367
+ );
43117
43368
  }
43118
43369
 
43119
43370
  return false;
@@ -43153,7 +43404,7 @@ class AxiosHeaders {
43153
43404
 
43154
43405
  while (i--) {
43155
43406
  const key = keys[i];
43156
- if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
43407
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
43157
43408
  delete this[key];
43158
43409
  deleted = true;
43159
43410
  }
@@ -43197,7 +43448,9 @@ class AxiosHeaders {
43197
43448
  const obj = Object.create(null);
43198
43449
 
43199
43450
  utils$1.forEach(this, (value, header) => {
43200
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
43451
+ value != null &&
43452
+ value !== false &&
43453
+ (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
43201
43454
  });
43202
43455
 
43203
43456
  return obj;
@@ -43208,11 +43461,13 @@ class AxiosHeaders {
43208
43461
  }
43209
43462
 
43210
43463
  toString() {
43211
- return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
43464
+ return Object.entries(this.toJSON())
43465
+ .map(([header, value]) => header + ': ' + value)
43466
+ .join('\n');
43212
43467
  }
43213
43468
 
43214
43469
  getSetCookie() {
43215
- return this.get("set-cookie") || [];
43470
+ return this.get('set-cookie') || [];
43216
43471
  }
43217
43472
 
43218
43473
  get [Symbol.toStringTag]() {
@@ -43232,9 +43487,12 @@ class AxiosHeaders {
43232
43487
  }
43233
43488
 
43234
43489
  static accessor(header) {
43235
- const internals = this[$internals] = (this[$internals] = {
43236
- accessors: {}
43237
- });
43490
+ const internals =
43491
+ (this[$internals] =
43492
+ this[$internals] =
43493
+ {
43494
+ accessors: {},
43495
+ });
43238
43496
 
43239
43497
  const accessors = internals.accessors;
43240
43498
  const prototype = this.prototype;
@@ -43254,23 +43512,28 @@ class AxiosHeaders {
43254
43512
  }
43255
43513
  }
43256
43514
 
43257
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
43515
+ AxiosHeaders.accessor([
43516
+ 'Content-Type',
43517
+ 'Content-Length',
43518
+ 'Accept',
43519
+ 'Accept-Encoding',
43520
+ 'User-Agent',
43521
+ 'Authorization',
43522
+ ]);
43258
43523
 
43259
43524
  // reserved names hotfix
43260
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
43525
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
43261
43526
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
43262
43527
  return {
43263
43528
  get: () => value,
43264
43529
  set(headerValue) {
43265
43530
  this[mapped] = headerValue;
43266
- }
43267
- }
43531
+ },
43532
+ };
43268
43533
  });
43269
43534
 
43270
43535
  utils$1.freezeMethods(AxiosHeaders);
43271
43536
 
43272
- var AxiosHeaders$1 = AxiosHeaders;
43273
-
43274
43537
  /**
43275
43538
  * Transform the data for a request or a response
43276
43539
  *
@@ -43280,9 +43543,9 @@ var AxiosHeaders$1 = AxiosHeaders;
43280
43543
  * @returns {*} The resulting transformed data
43281
43544
  */
43282
43545
  function transformData(fns, response) {
43283
- const config = this || defaults$1;
43546
+ const config = this || defaults;
43284
43547
  const context = response || config;
43285
- const headers = AxiosHeaders$1.from(context.headers);
43548
+ const headers = AxiosHeaders.from(context.headers);
43286
43549
  let data = context.data;
43287
43550
 
43288
43551
  utils$1.forEach(fns, function transform(fn) {
@@ -43298,7 +43561,7 @@ function isCancel(value) {
43298
43561
  return !!(value && value.__CANCEL__);
43299
43562
  }
43300
43563
 
43301
- class CanceledError extends AxiosError$1 {
43564
+ class CanceledError extends AxiosError {
43302
43565
  /**
43303
43566
  * A `CanceledError` is an object that is thrown when an operation is canceled.
43304
43567
  *
@@ -43309,14 +43572,12 @@ class CanceledError extends AxiosError$1 {
43309
43572
  * @returns {CanceledError} The created error.
43310
43573
  */
43311
43574
  constructor(message, config, request) {
43312
- super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
43575
+ super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
43313
43576
  this.name = 'CanceledError';
43314
43577
  this.__CANCEL__ = true;
43315
43578
  }
43316
43579
  }
43317
43580
 
43318
- var CanceledError$1 = CanceledError;
43319
-
43320
43581
  /**
43321
43582
  * Resolve or reject a Promise based on response status.
43322
43583
  *
@@ -43331,19 +43592,23 @@ function settle(resolve, reject, response) {
43331
43592
  if (!response.status || !validateStatus || validateStatus(response.status)) {
43332
43593
  resolve(response);
43333
43594
  } else {
43334
- reject(new AxiosError$1(
43335
- 'Request failed with status code ' + response.status,
43336
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
43337
- response.config,
43338
- response.request,
43339
- response
43340
- ));
43595
+ reject(
43596
+ new AxiosError(
43597
+ 'Request failed with status code ' + response.status,
43598
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][
43599
+ Math.floor(response.status / 100) - 4
43600
+ ],
43601
+ response.config,
43602
+ response.request,
43603
+ response
43604
+ )
43605
+ );
43341
43606
  }
43342
43607
  }
43343
43608
 
43344
43609
  function parseProtocol(url) {
43345
43610
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
43346
- return match && match[1] || '';
43611
+ return (match && match[1]) || '';
43347
43612
  }
43348
43613
 
43349
43614
  /**
@@ -43394,7 +43659,7 @@ function speedometer(samplesCount, min) {
43394
43659
 
43395
43660
  const passed = startedAt && now - startedAt;
43396
43661
 
43397
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
43662
+ return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
43398
43663
  };
43399
43664
  }
43400
43665
 
@@ -43423,7 +43688,7 @@ function throttle(fn, freq) {
43423
43688
  const throttled = (...args) => {
43424
43689
  const now = Date.now();
43425
43690
  const passed = now - timestamp;
43426
- if ( passed >= threshold) {
43691
+ if (passed >= threshold) {
43427
43692
  invoke(args, now);
43428
43693
  } else {
43429
43694
  lastArgs = args;
@@ -43445,25 +43710,25 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
43445
43710
  let bytesNotified = 0;
43446
43711
  const _speedometer = speedometer(50, 250);
43447
43712
 
43448
- return throttle(e => {
43449
- const loaded = e.loaded;
43713
+ return throttle((e) => {
43714
+ const rawLoaded = e.loaded;
43450
43715
  const total = e.lengthComputable ? e.total : undefined;
43451
- const progressBytes = loaded - bytesNotified;
43716
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
43717
+ const progressBytes = Math.max(0, loaded - bytesNotified);
43452
43718
  const rate = _speedometer(progressBytes);
43453
- const inRange = loaded <= total;
43454
43719
 
43455
- bytesNotified = loaded;
43720
+ bytesNotified = Math.max(bytesNotified, loaded);
43456
43721
 
43457
43722
  const data = {
43458
43723
  loaded,
43459
43724
  total,
43460
- progress: total ? (loaded / total) : undefined,
43725
+ progress: total ? loaded / total : undefined,
43461
43726
  bytes: progressBytes,
43462
43727
  rate: rate ? rate : undefined,
43463
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
43728
+ estimated: rate && total ? (total - loaded) / rate : undefined,
43464
43729
  event: e,
43465
43730
  lengthComputable: total != null,
43466
- [isDownloadStream ? 'download' : 'upload']: true
43731
+ [isDownloadStream ? 'download' : 'upload']: true,
43467
43732
  };
43468
43733
 
43469
43734
  listener(data);
@@ -43473,77 +43738,82 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
43473
43738
  const progressEventDecorator = (total, throttled) => {
43474
43739
  const lengthComputable = total != null;
43475
43740
 
43476
- return [(loaded) => throttled[0]({
43477
- lengthComputable,
43478
- total,
43479
- loaded
43480
- }), throttled[1]];
43741
+ return [
43742
+ (loaded) =>
43743
+ throttled[0]({
43744
+ lengthComputable,
43745
+ total,
43746
+ loaded,
43747
+ }),
43748
+ throttled[1],
43749
+ ];
43481
43750
  };
43482
43751
 
43483
- const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
43484
-
43485
- var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
43486
- url = new URL(url, platform.origin);
43752
+ const asyncDecorator =
43753
+ (fn) =>
43754
+ (...args) =>
43755
+ utils$1.asap(() => fn(...args));
43487
43756
 
43488
- return (
43489
- origin.protocol === url.protocol &&
43490
- origin.host === url.host &&
43491
- (isMSIE || origin.port === url.port)
43492
- );
43493
- })(
43494
- new URL(platform.origin),
43495
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
43496
- ) : () => true;
43757
+ var isURLSameOrigin = platform.hasStandardBrowserEnv
43758
+ ? ((origin, isMSIE) => (url) => {
43759
+ url = new URL(url, platform.origin);
43497
43760
 
43498
- var cookies = platform.hasStandardBrowserEnv ?
43761
+ return (
43762
+ origin.protocol === url.protocol &&
43763
+ origin.host === url.host &&
43764
+ (isMSIE || origin.port === url.port)
43765
+ );
43766
+ })(
43767
+ new URL(platform.origin),
43768
+ platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
43769
+ )
43770
+ : () => true;
43499
43771
 
43500
- // Standard browser envs support document.cookie
43501
- {
43502
- write(name, value, expires, path, domain, secure, sameSite) {
43503
- if (typeof document === 'undefined') return;
43772
+ var cookies = platform.hasStandardBrowserEnv
43773
+ ? // Standard browser envs support document.cookie
43774
+ {
43775
+ write(name, value, expires, path, domain, secure, sameSite) {
43776
+ if (typeof document === 'undefined') return;
43504
43777
 
43505
- const cookie = [`${name}=${encodeURIComponent(value)}`];
43778
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
43506
43779
 
43507
- if (utils$1.isNumber(expires)) {
43508
- cookie.push(`expires=${new Date(expires).toUTCString()}`);
43509
- }
43510
- if (utils$1.isString(path)) {
43511
- cookie.push(`path=${path}`);
43512
- }
43513
- if (utils$1.isString(domain)) {
43514
- cookie.push(`domain=${domain}`);
43515
- }
43516
- if (secure === true) {
43517
- cookie.push('secure');
43518
- }
43519
- if (utils$1.isString(sameSite)) {
43520
- cookie.push(`SameSite=${sameSite}`);
43521
- }
43780
+ if (utils$1.isNumber(expires)) {
43781
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
43782
+ }
43783
+ if (utils$1.isString(path)) {
43784
+ cookie.push(`path=${path}`);
43785
+ }
43786
+ if (utils$1.isString(domain)) {
43787
+ cookie.push(`domain=${domain}`);
43788
+ }
43789
+ if (secure === true) {
43790
+ cookie.push('secure');
43791
+ }
43792
+ if (utils$1.isString(sameSite)) {
43793
+ cookie.push(`SameSite=${sameSite}`);
43794
+ }
43522
43795
 
43523
- document.cookie = cookie.join('; ');
43524
- },
43796
+ document.cookie = cookie.join('; ');
43797
+ },
43525
43798
 
43526
- read(name) {
43527
- if (typeof document === 'undefined') return null;
43528
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
43529
- return match ? decodeURIComponent(match[1]) : null;
43530
- },
43799
+ read(name) {
43800
+ if (typeof document === 'undefined') return null;
43801
+ const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
43802
+ return match ? decodeURIComponent(match[1]) : null;
43803
+ },
43531
43804
 
43532
- remove(name) {
43533
- this.write(name, '', Date.now() - 86400000, '/');
43805
+ remove(name) {
43806
+ this.write(name, '', Date.now() - 86400000, '/');
43807
+ },
43534
43808
  }
43535
- }
43536
-
43537
- :
43538
-
43539
- // Non-standard browser env (web workers, react-native) lack needed support.
43540
- {
43541
- write() {},
43542
- read() {
43543
- return null;
43544
- },
43545
- remove() {}
43546
- };
43809
+ : // Non-standard browser env (web workers, react-native) lack needed support.
43810
+ {
43811
+ write() {},
43812
+ read() {
43813
+ return null;
43814
+ },
43815
+ remove() {},
43816
+ };
43547
43817
 
43548
43818
  /**
43549
43819
  * Determines whether the specified URL is absolute
@@ -43556,6 +43826,10 @@ function isAbsoluteURL(url) {
43556
43826
  // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
43557
43827
  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
43558
43828
  // by any combination of letters, digits, plus, period, or hyphen.
43829
+ if (typeof url !== 'string') {
43830
+ return false;
43831
+ }
43832
+
43559
43833
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
43560
43834
  }
43561
43835
 
@@ -43585,13 +43859,13 @@ function combineURLs(baseURL, relativeURL) {
43585
43859
  */
43586
43860
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
43587
43861
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
43588
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
43862
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
43589
43863
  return combineURLs(baseURL, requestedURL);
43590
43864
  }
43591
43865
  return requestedURL;
43592
43866
  }
43593
43867
 
43594
- const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
43868
+ const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);
43595
43869
 
43596
43870
  /**
43597
43871
  * Config-specific merge-function which creates a new config-object
@@ -43605,7 +43879,18 @@ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing
43605
43879
  function mergeConfig(config1, config2) {
43606
43880
  // eslint-disable-next-line no-param-reassign
43607
43881
  config2 = config2 || {};
43608
- const config = {};
43882
+
43883
+ // Use a null-prototype object so that downstream reads such as `config.auth`
43884
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype
43885
+ // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
43886
+ // own slot to preserve ergonomics for user code that relies on it.
43887
+ const config = Object.create(null);
43888
+ Object.defineProperty(config, 'hasOwnProperty', {
43889
+ value: Object.prototype.hasOwnProperty,
43890
+ enumerable: false,
43891
+ writable: true,
43892
+ configurable: true,
43893
+ });
43609
43894
 
43610
43895
  function getMergedValue(target, source, prop, caseless) {
43611
43896
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
@@ -43644,9 +43929,9 @@ function mergeConfig(config1, config2) {
43644
43929
 
43645
43930
  // eslint-disable-next-line consistent-return
43646
43931
  function mergeDirectKeys(a, b, prop) {
43647
- if (prop in config2) {
43932
+ if (utils$1.hasOwnProp(config2, prop)) {
43648
43933
  return getMergedValue(a, b);
43649
- } else if (prop in config1) {
43934
+ } else if (utils$1.hasOwnProp(config1, prop)) {
43650
43935
  return getMergedValue(undefined, a);
43651
43936
  }
43652
43937
  }
@@ -43678,14 +43963,19 @@ function mergeConfig(config1, config2) {
43678
43963
  httpsAgent: defaultToConfig2,
43679
43964
  cancelToken: defaultToConfig2,
43680
43965
  socketPath: defaultToConfig2,
43966
+ allowedSocketPaths: defaultToConfig2,
43681
43967
  responseEncoding: defaultToConfig2,
43682
43968
  validateStatus: mergeDirectKeys,
43683
- headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
43969
+ headers: (a, b, prop) =>
43970
+ mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
43684
43971
  };
43685
43972
 
43686
43973
  utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
43687
- const merge = mergeMap[prop] || mergeDeepProperties;
43688
- const configValue = merge(config1[prop], config2[prop], prop);
43974
+ if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
43975
+ const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
43976
+ const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
43977
+ const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
43978
+ const configValue = merge(a, b, prop);
43689
43979
  (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
43690
43980
  });
43691
43981
 
@@ -43695,16 +43985,38 @@ function mergeConfig(config1, config2) {
43695
43985
  var resolveConfig = (config) => {
43696
43986
  const newConfig = mergeConfig({}, config);
43697
43987
 
43698
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
43699
-
43700
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
43701
-
43702
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
43988
+ // Read only own properties to prevent prototype pollution gadgets
43989
+ // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
43990
+ const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
43991
+
43992
+ const data = own('data');
43993
+ let withXSRFToken = own('withXSRFToken');
43994
+ const xsrfHeaderName = own('xsrfHeaderName');
43995
+ const xsrfCookieName = own('xsrfCookieName');
43996
+ let headers = own('headers');
43997
+ const auth = own('auth');
43998
+ const baseURL = own('baseURL');
43999
+ const allowAbsoluteUrls = own('allowAbsoluteUrls');
44000
+ const url = own('url');
44001
+
44002
+ newConfig.headers = headers = AxiosHeaders.from(headers);
44003
+
44004
+ newConfig.url = buildURL(
44005
+ buildFullPath(baseURL, url, allowAbsoluteUrls),
44006
+ config.params,
44007
+ config.paramsSerializer
44008
+ );
43703
44009
 
43704
44010
  // HTTP basic authentication
43705
44011
  if (auth) {
43706
- headers.set('Authorization', 'Basic ' +
43707
- btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
44012
+ headers.set(
44013
+ 'Authorization',
44014
+ 'Basic ' +
44015
+ btoa(
44016
+ (auth.username || '') +
44017
+ ':' +
44018
+ (auth.password ? unescape(encodeURIComponent(auth.password)) : '')
44019
+ )
43708
44020
  );
43709
44021
  }
43710
44022
 
@@ -43722,17 +44034,25 @@ var resolveConfig = (config) => {
43722
44034
  }
43723
44035
  });
43724
44036
  }
43725
- }
44037
+ }
43726
44038
 
43727
44039
  // Add xsrf header
43728
44040
  // This is only done if running in a standard browser environment.
43729
44041
  // Specifically not if we're in a web worker, or react-native.
43730
44042
 
43731
44043
  if (platform.hasStandardBrowserEnv) {
43732
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
44044
+ if (utils$1.isFunction(withXSRFToken)) {
44045
+ withXSRFToken = withXSRFToken(newConfig);
44046
+ }
43733
44047
 
43734
- if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
43735
- // Add xsrf header
44048
+ // Strict boolean check prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
44049
+ // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
44050
+ // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
44051
+ const shouldSendXSRF =
44052
+ withXSRFToken === true ||
44053
+ (withXSRFToken == null && isURLSameOrigin(newConfig.url));
44054
+
44055
+ if (shouldSendXSRF) {
43736
44056
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
43737
44057
 
43738
44058
  if (xsrfValue) {
@@ -43746,196 +44066,218 @@ var resolveConfig = (config) => {
43746
44066
 
43747
44067
  const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
43748
44068
 
43749
- var xhrAdapter = isXHRAdapterSupported && function (config) {
43750
- return new Promise(function dispatchXhrRequest(resolve, reject) {
43751
- const _config = resolveConfig(config);
43752
- let requestData = _config.data;
43753
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
43754
- let {responseType, onUploadProgress, onDownloadProgress} = _config;
43755
- let onCanceled;
43756
- let uploadThrottled, downloadThrottled;
43757
- let flushUpload, flushDownload;
44069
+ var xhrAdapter = isXHRAdapterSupported &&
44070
+ function (config) {
44071
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
44072
+ const _config = resolveConfig(config);
44073
+ let requestData = _config.data;
44074
+ const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
44075
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
44076
+ let onCanceled;
44077
+ let uploadThrottled, downloadThrottled;
44078
+ let flushUpload, flushDownload;
43758
44079
 
43759
- function done() {
43760
- flushUpload && flushUpload(); // flush events
43761
- flushDownload && flushDownload(); // flush events
44080
+ function done() {
44081
+ flushUpload && flushUpload(); // flush events
44082
+ flushDownload && flushDownload(); // flush events
43762
44083
 
43763
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
44084
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
43764
44085
 
43765
- _config.signal && _config.signal.removeEventListener('abort', onCanceled);
43766
- }
44086
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
44087
+ }
43767
44088
 
43768
- let request = new XMLHttpRequest();
44089
+ let request = new XMLHttpRequest();
43769
44090
 
43770
- request.open(_config.method.toUpperCase(), _config.url, true);
44091
+ request.open(_config.method.toUpperCase(), _config.url, true);
43771
44092
 
43772
- // Set the request timeout in MS
43773
- request.timeout = _config.timeout;
44093
+ // Set the request timeout in MS
44094
+ request.timeout = _config.timeout;
43774
44095
 
43775
- function onloadend() {
43776
- if (!request) {
43777
- return;
44096
+ function onloadend() {
44097
+ if (!request) {
44098
+ return;
44099
+ }
44100
+ // Prepare the response
44101
+ const responseHeaders = AxiosHeaders.from(
44102
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
44103
+ );
44104
+ const responseData =
44105
+ !responseType || responseType === 'text' || responseType === 'json'
44106
+ ? request.responseText
44107
+ : request.response;
44108
+ const response = {
44109
+ data: responseData,
44110
+ status: request.status,
44111
+ statusText: request.statusText,
44112
+ headers: responseHeaders,
44113
+ config,
44114
+ request,
44115
+ };
44116
+
44117
+ settle(
44118
+ function _resolve(value) {
44119
+ resolve(value);
44120
+ done();
44121
+ },
44122
+ function _reject(err) {
44123
+ reject(err);
44124
+ done();
44125
+ },
44126
+ response
44127
+ );
44128
+
44129
+ // Clean up request
44130
+ request = null;
43778
44131
  }
43779
- // Prepare the response
43780
- const responseHeaders = AxiosHeaders$1.from(
43781
- 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
43782
- );
43783
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
43784
- request.responseText : request.response;
43785
- const response = {
43786
- data: responseData,
43787
- status: request.status,
43788
- statusText: request.statusText,
43789
- headers: responseHeaders,
43790
- config,
43791
- request
43792
- };
43793
44132
 
43794
- settle(function _resolve(value) {
43795
- resolve(value);
43796
- done();
43797
- }, function _reject(err) {
43798
- reject(err);
43799
- done();
43800
- }, response);
44133
+ if ('onloadend' in request) {
44134
+ // Use onloadend if available
44135
+ request.onloadend = onloadend;
44136
+ } else {
44137
+ // Listen for ready state to emulate onloadend
44138
+ request.onreadystatechange = function handleLoad() {
44139
+ if (!request || request.readyState !== 4) {
44140
+ return;
44141
+ }
43801
44142
 
43802
- // Clean up request
43803
- request = null;
43804
- }
44143
+ // The request errored out and we didn't get a response, this will be
44144
+ // handled by onerror instead
44145
+ // With one exception: request that using file: protocol, most browsers
44146
+ // will return status as 0 even though it's a successful request
44147
+ if (
44148
+ request.status === 0 &&
44149
+ !(request.responseURL && request.responseURL.indexOf('file:') === 0)
44150
+ ) {
44151
+ return;
44152
+ }
44153
+ // readystate handler is calling before onerror or ontimeout handlers,
44154
+ // so we should call onloadend on the next 'tick'
44155
+ setTimeout(onloadend);
44156
+ };
44157
+ }
43805
44158
 
43806
- if ('onloadend' in request) {
43807
- // Use onloadend if available
43808
- request.onloadend = onloadend;
43809
- } else {
43810
- // Listen for ready state to emulate onloadend
43811
- request.onreadystatechange = function handleLoad() {
43812
- if (!request || request.readyState !== 4) {
44159
+ // Handle browser request cancellation (as opposed to a manual cancellation)
44160
+ request.onabort = function handleAbort() {
44161
+ if (!request) {
43813
44162
  return;
43814
44163
  }
43815
44164
 
43816
- // The request errored out and we didn't get a response, this will be
43817
- // handled by onerror instead
43818
- // With one exception: request that using file: protocol, most browsers
43819
- // will return status as 0 even though it's a successful request
43820
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
43821
- return;
43822
- }
43823
- // readystate handler is calling before onerror or ontimeout handlers,
43824
- // so we should call onloadend on the next 'tick'
43825
- setTimeout(onloadend);
44165
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
44166
+
44167
+ // Clean up request
44168
+ request = null;
43826
44169
  };
43827
- }
43828
44170
 
43829
- // Handle browser request cancellation (as opposed to a manual cancellation)
43830
- request.onabort = function handleAbort() {
43831
- if (!request) {
43832
- return;
43833
- }
44171
+ // Handle low level network errors
44172
+ request.onerror = function handleError(event) {
44173
+ // Browsers deliver a ProgressEvent in XHR onerror
44174
+ // (message may be empty; when present, surface it)
44175
+ // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
44176
+ const msg = event && event.message ? event.message : 'Network Error';
44177
+ const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
44178
+ // attach the underlying event for consumers who want details
44179
+ err.event = event || null;
44180
+ reject(err);
44181
+ request = null;
44182
+ };
43834
44183
 
43835
- reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
44184
+ // Handle timeout
44185
+ request.ontimeout = function handleTimeout() {
44186
+ let timeoutErrorMessage = _config.timeout
44187
+ ? 'timeout of ' + _config.timeout + 'ms exceeded'
44188
+ : 'timeout exceeded';
44189
+ const transitional = _config.transitional || transitionalDefaults;
44190
+ if (_config.timeoutErrorMessage) {
44191
+ timeoutErrorMessage = _config.timeoutErrorMessage;
44192
+ }
44193
+ reject(
44194
+ new AxiosError(
44195
+ timeoutErrorMessage,
44196
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
44197
+ config,
44198
+ request
44199
+ )
44200
+ );
43836
44201
 
43837
- // Clean up request
43838
- request = null;
43839
- };
44202
+ // Clean up request
44203
+ request = null;
44204
+ };
43840
44205
 
43841
- // Handle low level network errors
43842
- request.onerror = function handleError(event) {
43843
- // Browsers deliver a ProgressEvent in XHR onerror
43844
- // (message may be empty; when present, surface it)
43845
- // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
43846
- const msg = event && event.message ? event.message : 'Network Error';
43847
- const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
43848
- // attach the underlying event for consumers who want details
43849
- err.event = event || null;
43850
- reject(err);
43851
- request = null;
43852
- };
43853
-
43854
- // Handle timeout
43855
- request.ontimeout = function handleTimeout() {
43856
- let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
43857
- const transitional = _config.transitional || transitionalDefaults;
43858
- if (_config.timeoutErrorMessage) {
43859
- timeoutErrorMessage = _config.timeoutErrorMessage;
43860
- }
43861
- reject(new AxiosError$1(
43862
- timeoutErrorMessage,
43863
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
43864
- config,
43865
- request));
43866
-
43867
- // Clean up request
43868
- request = null;
43869
- };
44206
+ // Remove Content-Type if data is undefined
44207
+ requestData === undefined && requestHeaders.setContentType(null);
43870
44208
 
43871
- // Remove Content-Type if data is undefined
43872
- requestData === undefined && requestHeaders.setContentType(null);
44209
+ // Add headers to the request
44210
+ if ('setRequestHeader' in request) {
44211
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
44212
+ request.setRequestHeader(key, val);
44213
+ });
44214
+ }
43873
44215
 
43874
- // Add headers to the request
43875
- if ('setRequestHeader' in request) {
43876
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
43877
- request.setRequestHeader(key, val);
43878
- });
43879
- }
44216
+ // Add withCredentials to request if needed
44217
+ if (!utils$1.isUndefined(_config.withCredentials)) {
44218
+ request.withCredentials = !!_config.withCredentials;
44219
+ }
43880
44220
 
43881
- // Add withCredentials to request if needed
43882
- if (!utils$1.isUndefined(_config.withCredentials)) {
43883
- request.withCredentials = !!_config.withCredentials;
43884
- }
44221
+ // Add responseType to request if needed
44222
+ if (responseType && responseType !== 'json') {
44223
+ request.responseType = _config.responseType;
44224
+ }
43885
44225
 
43886
- // Add responseType to request if needed
43887
- if (responseType && responseType !== 'json') {
43888
- request.responseType = _config.responseType;
43889
- }
44226
+ // Handle progress if needed
44227
+ if (onDownloadProgress) {
44228
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
44229
+ request.addEventListener('progress', downloadThrottled);
44230
+ }
43890
44231
 
43891
- // Handle progress if needed
43892
- if (onDownloadProgress) {
43893
- ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
43894
- request.addEventListener('progress', downloadThrottled);
43895
- }
44232
+ // Not all browsers support upload events
44233
+ if (onUploadProgress && request.upload) {
44234
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
43896
44235
 
43897
- // Not all browsers support upload events
43898
- if (onUploadProgress && request.upload) {
43899
- ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
44236
+ request.upload.addEventListener('progress', uploadThrottled);
43900
44237
 
43901
- request.upload.addEventListener('progress', uploadThrottled);
44238
+ request.upload.addEventListener('loadend', flushUpload);
44239
+ }
43902
44240
 
43903
- request.upload.addEventListener('loadend', flushUpload);
43904
- }
44241
+ if (_config.cancelToken || _config.signal) {
44242
+ // Handle cancellation
44243
+ // eslint-disable-next-line func-names
44244
+ onCanceled = (cancel) => {
44245
+ if (!request) {
44246
+ return;
44247
+ }
44248
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
44249
+ request.abort();
44250
+ request = null;
44251
+ };
43905
44252
 
43906
- if (_config.cancelToken || _config.signal) {
43907
- // Handle cancellation
43908
- // eslint-disable-next-line func-names
43909
- onCanceled = cancel => {
43910
- if (!request) {
43911
- return;
44253
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
44254
+ if (_config.signal) {
44255
+ _config.signal.aborted
44256
+ ? onCanceled()
44257
+ : _config.signal.addEventListener('abort', onCanceled);
43912
44258
  }
43913
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
43914
- request.abort();
43915
- request = null;
43916
- };
43917
-
43918
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
43919
- if (_config.signal) {
43920
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
43921
44259
  }
43922
- }
43923
-
43924
- const protocol = parseProtocol(_config.url);
43925
44260
 
43926
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
43927
- reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
43928
- return;
43929
- }
44261
+ const protocol = parseProtocol(_config.url);
43930
44262
 
44263
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
44264
+ reject(
44265
+ new AxiosError(
44266
+ 'Unsupported protocol ' + protocol + ':',
44267
+ AxiosError.ERR_BAD_REQUEST,
44268
+ config
44269
+ )
44270
+ );
44271
+ return;
44272
+ }
43931
44273
 
43932
- // Send the request
43933
- request.send(requestData || null);
43934
- });
43935
- };
44274
+ // Send the request
44275
+ request.send(requestData || null);
44276
+ });
44277
+ };
43936
44278
 
43937
44279
  const composeSignals = (signals, timeout) => {
43938
- const {length} = (signals = signals ? signals.filter(Boolean) : []);
44280
+ const { length } = (signals = signals ? signals.filter(Boolean) : []);
43939
44281
 
43940
44282
  if (timeout || length) {
43941
44283
  let controller = new AbortController();
@@ -43947,21 +44289,29 @@ const composeSignals = (signals, timeout) => {
43947
44289
  aborted = true;
43948
44290
  unsubscribe();
43949
44291
  const err = reason instanceof Error ? reason : this.reason;
43950
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
44292
+ controller.abort(
44293
+ err instanceof AxiosError
44294
+ ? err
44295
+ : new CanceledError(err instanceof Error ? err.message : err)
44296
+ );
43951
44297
  }
43952
44298
  };
43953
44299
 
43954
- let timer = timeout && setTimeout(() => {
43955
- timer = null;
43956
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
43957
- }, timeout);
44300
+ let timer =
44301
+ timeout &&
44302
+ setTimeout(() => {
44303
+ timer = null;
44304
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
44305
+ }, timeout);
43958
44306
 
43959
44307
  const unsubscribe = () => {
43960
44308
  if (signals) {
43961
44309
  timer && clearTimeout(timer);
43962
44310
  timer = null;
43963
- signals.forEach(signal => {
43964
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
44311
+ signals.forEach((signal) => {
44312
+ signal.unsubscribe
44313
+ ? signal.unsubscribe(onabort)
44314
+ : signal.removeEventListener('abort', onabort);
43965
44315
  });
43966
44316
  signals = null;
43967
44317
  }
@@ -43969,7 +44319,7 @@ const composeSignals = (signals, timeout) => {
43969
44319
 
43970
44320
  signals.forEach((signal) => signal.addEventListener('abort', onabort));
43971
44321
 
43972
- const {signal} = controller;
44322
+ const { signal } = controller;
43973
44323
 
43974
44324
  signal.unsubscribe = () => utils$1.asap(unsubscribe);
43975
44325
 
@@ -43977,12 +44327,10 @@ const composeSignals = (signals, timeout) => {
43977
44327
  }
43978
44328
  };
43979
44329
 
43980
- var composeSignals$1 = composeSignals;
43981
-
43982
44330
  const streamChunk = function* (chunk, chunkSize) {
43983
44331
  let len = chunk.byteLength;
43984
44332
 
43985
- if (!chunkSize || len < chunkSize) {
44333
+ if (len < chunkSize) {
43986
44334
  yield chunk;
43987
44335
  return;
43988
44336
  }
@@ -44012,7 +44360,7 @@ const readStream = async function* (stream) {
44012
44360
  const reader = stream.getReader();
44013
44361
  try {
44014
44362
  for (;;) {
44015
- const {done, value} = await reader.read();
44363
+ const { done, value } = await reader.read();
44016
44364
  if (done) {
44017
44365
  break;
44018
44366
  }
@@ -44035,64 +44383,69 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
44035
44383
  }
44036
44384
  };
44037
44385
 
44038
- return new ReadableStream({
44039
- async pull(controller) {
44040
- try {
44041
- const {done, value} = await iterator.next();
44386
+ return new ReadableStream(
44387
+ {
44388
+ async pull(controller) {
44389
+ try {
44390
+ const { done, value } = await iterator.next();
44042
44391
 
44043
- if (done) {
44044
- _onFinish();
44045
- controller.close();
44046
- return;
44047
- }
44392
+ if (done) {
44393
+ _onFinish();
44394
+ controller.close();
44395
+ return;
44396
+ }
44048
44397
 
44049
- let len = value.byteLength;
44050
- if (onProgress) {
44051
- let loadedBytes = bytes += len;
44052
- onProgress(loadedBytes);
44398
+ let len = value.byteLength;
44399
+ if (onProgress) {
44400
+ let loadedBytes = (bytes += len);
44401
+ onProgress(loadedBytes);
44402
+ }
44403
+ controller.enqueue(new Uint8Array(value));
44404
+ } catch (err) {
44405
+ _onFinish(err);
44406
+ throw err;
44053
44407
  }
44054
- controller.enqueue(new Uint8Array(value));
44055
- } catch (err) {
44056
- _onFinish(err);
44057
- throw err;
44058
- }
44408
+ },
44409
+ cancel(reason) {
44410
+ _onFinish(reason);
44411
+ return iterator.return();
44412
+ },
44059
44413
  },
44060
- cancel(reason) {
44061
- _onFinish(reason);
44062
- return iterator.return();
44414
+ {
44415
+ highWaterMark: 2,
44063
44416
  }
44064
- }, {
44065
- highWaterMark: 2
44066
- })
44417
+ );
44067
44418
  };
44068
44419
 
44069
44420
  const DEFAULT_CHUNK_SIZE = 64 * 1024;
44070
44421
 
44071
- const {isFunction} = utils$1;
44422
+ const { isFunction } = utils$1;
44072
44423
 
44073
- const globalFetchAPI = (({Request, Response}) => ({
44074
- Request, Response
44424
+ const globalFetchAPI = (({ Request, Response }) => ({
44425
+ Request,
44426
+ Response,
44075
44427
  }))(utils$1.global);
44076
44428
 
44077
- const {
44078
- ReadableStream: ReadableStream$1, TextEncoder
44079
- } = utils$1.global;
44080
-
44429
+ const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
44081
44430
 
44082
44431
  const test = (fn, ...args) => {
44083
44432
  try {
44084
44433
  return !!fn(...args);
44085
44434
  } catch (e) {
44086
- return false
44435
+ return false;
44087
44436
  }
44088
44437
  };
44089
44438
 
44090
44439
  const factory = (env) => {
44091
- env = utils$1.merge.call({
44092
- skipUndefined: true
44093
- }, globalFetchAPI, env);
44440
+ env = utils$1.merge.call(
44441
+ {
44442
+ skipUndefined: true,
44443
+ },
44444
+ globalFetchAPI,
44445
+ env
44446
+ );
44094
44447
 
44095
- const {fetch: envFetch, Request, Response} = env;
44448
+ const { fetch: envFetch, Request, Response } = env;
44096
44449
  const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
44097
44450
  const isRequestSupported = isFunction(Request);
44098
44451
  const isResponseSupported = isFunction(Response);
@@ -44103,46 +44456,67 @@ const factory = (env) => {
44103
44456
 
44104
44457
  const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
44105
44458
 
44106
- const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
44107
- ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
44108
- async (str) => new Uint8Array(await new Request(str).arrayBuffer())
44109
- );
44459
+ const encodeText =
44460
+ isFetchSupported &&
44461
+ (typeof TextEncoder === 'function'
44462
+ ? (
44463
+ (encoder) => (str) =>
44464
+ encoder.encode(str)
44465
+ )(new TextEncoder())
44466
+ : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
44467
+
44468
+ const supportsRequestStream =
44469
+ isRequestSupported &&
44470
+ isReadableStreamSupported &&
44471
+ test(() => {
44472
+ let duplexAccessed = false;
44473
+
44474
+ const request = new Request(platform.origin, {
44475
+ body: new ReadableStream$1(),
44476
+ method: 'POST',
44477
+ get duplex() {
44478
+ duplexAccessed = true;
44479
+ return 'half';
44480
+ },
44481
+ });
44110
44482
 
44111
- const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
44112
- let duplexAccessed = false;
44483
+ const hasContentType = request.headers.has('Content-Type');
44113
44484
 
44114
- const hasContentType = new Request(platform.origin, {
44115
- body: new ReadableStream$1(),
44116
- method: 'POST',
44117
- get duplex() {
44118
- duplexAccessed = true;
44119
- return 'half';
44120
- },
44121
- }).headers.has('Content-Type');
44485
+ if (request.body != null) {
44486
+ request.body.cancel();
44487
+ }
44122
44488
 
44123
- return duplexAccessed && !hasContentType;
44124
- });
44489
+ return duplexAccessed && !hasContentType;
44490
+ });
44125
44491
 
44126
- const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
44492
+ const supportsResponseStream =
44493
+ isResponseSupported &&
44494
+ isReadableStreamSupported &&
44127
44495
  test(() => utils$1.isReadableStream(new Response('').body));
44128
44496
 
44129
44497
  const resolvers = {
44130
- stream: supportsResponseStream && ((res) => res.body)
44498
+ stream: supportsResponseStream && ((res) => res.body),
44131
44499
  };
44132
44500
 
44133
- isFetchSupported && ((() => {
44134
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
44135
- !resolvers[type] && (resolvers[type] = (res, config) => {
44136
- let method = res && res[type];
44501
+ isFetchSupported &&
44502
+ (() => {
44503
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
44504
+ !resolvers[type] &&
44505
+ (resolvers[type] = (res, config) => {
44506
+ let method = res && res[type];
44137
44507
 
44138
- if (method) {
44139
- return method.call(res);
44140
- }
44508
+ if (method) {
44509
+ return method.call(res);
44510
+ }
44141
44511
 
44142
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
44512
+ throw new AxiosError(
44513
+ `Response type '${type}' is not supported`,
44514
+ AxiosError.ERR_NOT_SUPPORT,
44515
+ config
44516
+ );
44517
+ });
44143
44518
  });
44144
- });
44145
- })());
44519
+ })();
44146
44520
 
44147
44521
  const getBodyLength = async (body) => {
44148
44522
  if (body == null) {
@@ -44193,32 +44567,41 @@ const factory = (env) => {
44193
44567
  responseType,
44194
44568
  headers,
44195
44569
  withCredentials = 'same-origin',
44196
- fetchOptions
44570
+ fetchOptions,
44197
44571
  } = resolveConfig(config);
44198
44572
 
44199
44573
  let _fetch = envFetch || fetch;
44200
44574
 
44201
44575
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
44202
44576
 
44203
- let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
44577
+ let composedSignal = composeSignals(
44578
+ [signal, cancelToken && cancelToken.toAbortSignal()],
44579
+ timeout
44580
+ );
44204
44581
 
44205
44582
  let request = null;
44206
44583
 
44207
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
44208
- composedSignal.unsubscribe();
44209
- });
44584
+ const unsubscribe =
44585
+ composedSignal &&
44586
+ composedSignal.unsubscribe &&
44587
+ (() => {
44588
+ composedSignal.unsubscribe();
44589
+ });
44210
44590
 
44211
44591
  let requestContentLength;
44212
44592
 
44213
44593
  try {
44214
44594
  if (
44215
- onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
44595
+ onUploadProgress &&
44596
+ supportsRequestStream &&
44597
+ method !== 'get' &&
44598
+ method !== 'head' &&
44216
44599
  (requestContentLength = await resolveBodyLength(headers, data)) !== 0
44217
44600
  ) {
44218
44601
  let _request = new Request(url, {
44219
44602
  method: 'POST',
44220
44603
  body: data,
44221
- duplex: "half"
44604
+ duplex: 'half',
44222
44605
  });
44223
44606
 
44224
44607
  let contentTypeHeader;
@@ -44243,7 +44626,20 @@ const factory = (env) => {
44243
44626
 
44244
44627
  // Cloudflare Workers throws when credentials are defined
44245
44628
  // see https://github.com/cloudflare/workerd/issues/902
44246
- const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
44629
+ const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
44630
+
44631
+ // If data is FormData and Content-Type is multipart/form-data without boundary,
44632
+ // delete it so fetch can set it correctly with the boundary
44633
+ if (utils$1.isFormData(data)) {
44634
+ const contentType = headers.getContentType();
44635
+ if (
44636
+ contentType &&
44637
+ /^multipart\/form-data/i.test(contentType) &&
44638
+ !/boundary=/i.test(contentType)
44639
+ ) {
44640
+ headers.delete('content-type');
44641
+ }
44642
+ }
44247
44643
 
44248
44644
  const resolvedOptions = {
44249
44645
  ...fetchOptions,
@@ -44251,29 +44647,35 @@ const factory = (env) => {
44251
44647
  method: method.toUpperCase(),
44252
44648
  headers: headers.normalize().toJSON(),
44253
44649
  body: data,
44254
- duplex: "half",
44255
- credentials: isCredentialsSupported ? withCredentials : undefined
44650
+ duplex: 'half',
44651
+ credentials: isCredentialsSupported ? withCredentials : undefined,
44256
44652
  };
44257
44653
 
44258
44654
  request = isRequestSupported && new Request(url, resolvedOptions);
44259
44655
 
44260
- let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
44656
+ let response = await (isRequestSupported
44657
+ ? _fetch(request, fetchOptions)
44658
+ : _fetch(url, resolvedOptions));
44261
44659
 
44262
- const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
44660
+ const isStreamResponse =
44661
+ supportsResponseStream && (responseType === 'stream' || responseType === 'response');
44263
44662
 
44264
44663
  if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
44265
44664
  const options = {};
44266
44665
 
44267
- ['status', 'statusText', 'headers'].forEach(prop => {
44666
+ ['status', 'statusText', 'headers'].forEach((prop) => {
44268
44667
  options[prop] = response[prop];
44269
44668
  });
44270
44669
 
44271
44670
  const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
44272
44671
 
44273
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
44274
- responseContentLength,
44275
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
44276
- ) || [];
44672
+ const [onProgress, flush] =
44673
+ (onDownloadProgress &&
44674
+ progressEventDecorator(
44675
+ responseContentLength,
44676
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
44677
+ )) ||
44678
+ [];
44277
44679
 
44278
44680
  response = new Response(
44279
44681
  trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
@@ -44286,54 +44688,64 @@ const factory = (env) => {
44286
44688
 
44287
44689
  responseType = responseType || 'text';
44288
44690
 
44289
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
44691
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
44692
+ response,
44693
+ config
44694
+ );
44290
44695
 
44291
44696
  !isStreamResponse && unsubscribe && unsubscribe();
44292
44697
 
44293
44698
  return await new Promise((resolve, reject) => {
44294
44699
  settle(resolve, reject, {
44295
44700
  data: responseData,
44296
- headers: AxiosHeaders$1.from(response.headers),
44701
+ headers: AxiosHeaders.from(response.headers),
44297
44702
  status: response.status,
44298
44703
  statusText: response.statusText,
44299
44704
  config,
44300
- request
44705
+ request,
44301
44706
  });
44302
- })
44707
+ });
44303
44708
  } catch (err) {
44304
44709
  unsubscribe && unsubscribe();
44305
44710
 
44306
44711
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
44307
44712
  throw Object.assign(
44308
- new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
44713
+ new AxiosError(
44714
+ 'Network Error',
44715
+ AxiosError.ERR_NETWORK,
44716
+ config,
44717
+ request,
44718
+ err && err.response
44719
+ ),
44309
44720
  {
44310
- cause: err.cause || err
44721
+ cause: err.cause || err,
44311
44722
  }
44312
- )
44723
+ );
44313
44724
  }
44314
44725
 
44315
- throw AxiosError$1.from(err, err && err.code, config, request);
44726
+ throw AxiosError.from(err, err && err.code, config, request, err && err.response);
44316
44727
  }
44317
- }
44728
+ };
44318
44729
  };
44319
44730
 
44320
44731
  const seedCache = new Map();
44321
44732
 
44322
44733
  const getFetch = (config) => {
44323
44734
  let env = (config && config.env) || {};
44324
- const {fetch, Request, Response} = env;
44325
- const seeds = [
44326
- Request, Response, fetch
44327
- ];
44735
+ const { fetch, Request, Response } = env;
44736
+ const seeds = [Request, Response, fetch];
44328
44737
 
44329
- let len = seeds.length, i = len,
44330
- seed, target, map = seedCache;
44738
+ let len = seeds.length,
44739
+ i = len,
44740
+ seed,
44741
+ target,
44742
+ map = seedCache;
44331
44743
 
44332
44744
  while (i--) {
44333
44745
  seed = seeds[i];
44334
44746
  target = map.get(seed);
44335
44747
 
44336
- target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
44748
+ target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
44337
44749
 
44338
44750
  map = target;
44339
44751
  }
@@ -44349,7 +44761,7 @@ getFetch();
44349
44761
  * - `http` for Node.js
44350
44762
  * - `xhr` for browsers
44351
44763
  * - `fetch` for fetch API-based requests
44352
- *
44764
+ *
44353
44765
  * @type {Object<string, Function|Object>}
44354
44766
  */
44355
44767
  const knownAdapters = {
@@ -44357,7 +44769,7 @@ const knownAdapters = {
44357
44769
  xhr: xhrAdapter,
44358
44770
  fetch: {
44359
44771
  get: getFetch,
44360
- }
44772
+ },
44361
44773
  };
44362
44774
 
44363
44775
  // Assign adapter names for easier debugging and identification
@@ -44374,7 +44786,7 @@ utils$1.forEach(knownAdapters, (fn, value) => {
44374
44786
 
44375
44787
  /**
44376
44788
  * Render a rejection reason string for unknown or unsupported adapters
44377
- *
44789
+ *
44378
44790
  * @param {string} reason
44379
44791
  * @returns {string}
44380
44792
  */
@@ -44382,17 +44794,18 @@ const renderReason = (reason) => `- ${reason}`;
44382
44794
 
44383
44795
  /**
44384
44796
  * Check if the adapter is resolved (function, null, or false)
44385
- *
44797
+ *
44386
44798
  * @param {Function|null|false} adapter
44387
44799
  * @returns {boolean}
44388
44800
  */
44389
- const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
44801
+ const isResolvedHandle = (adapter) =>
44802
+ utils$1.isFunction(adapter) || adapter === null || adapter === false;
44390
44803
 
44391
44804
  /**
44392
44805
  * Get the first suitable adapter from the provided list.
44393
44806
  * Tries each adapter in order until a supported one is found.
44394
44807
  * Throws an AxiosError if no adapter is suitable.
44395
- *
44808
+ *
44396
44809
  * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
44397
44810
  * @param {Object} config - Axios request configuration
44398
44811
  * @throws {AxiosError} If no suitable adapter is available
@@ -44417,7 +44830,7 @@ function getAdapter(adapters, config) {
44417
44830
  adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
44418
44831
 
44419
44832
  if (adapter === undefined) {
44420
- throw new AxiosError$1(`Unknown adapter '${id}'`);
44833
+ throw new AxiosError(`Unknown adapter '${id}'`);
44421
44834
  }
44422
44835
  }
44423
44836
 
@@ -44429,16 +44842,19 @@ function getAdapter(adapters, config) {
44429
44842
  }
44430
44843
 
44431
44844
  if (!adapter) {
44432
- const reasons = Object.entries(rejectedReasons)
44433
- .map(([id, state]) => `adapter ${id} ` +
44845
+ const reasons = Object.entries(rejectedReasons).map(
44846
+ ([id, state]) =>
44847
+ `adapter ${id} ` +
44434
44848
  (state === false ? 'is not supported by the environment' : 'is not available in the build')
44435
- );
44849
+ );
44436
44850
 
44437
- let s = length ?
44438
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
44439
- 'as no adapter specified';
44851
+ let s = length
44852
+ ? reasons.length > 1
44853
+ ? 'since :\n' + reasons.map(renderReason).join('\n')
44854
+ : ' ' + renderReason(reasons[0])
44855
+ : 'as no adapter specified';
44440
44856
 
44441
- throw new AxiosError$1(
44857
+ throw new AxiosError(
44442
44858
  `There is no suitable adapter to dispatch the request ` + s,
44443
44859
  'ERR_NOT_SUPPORT'
44444
44860
  );
@@ -44461,7 +44877,7 @@ var adapters = {
44461
44877
  * Exposes all known adapters
44462
44878
  * @type {Object<string, Function|Object>}
44463
44879
  */
44464
- adapters: knownAdapters
44880
+ adapters: knownAdapters,
44465
44881
  };
44466
44882
 
44467
44883
  /**
@@ -44477,7 +44893,7 @@ function throwIfCancellationRequested(config) {
44477
44893
  }
44478
44894
 
44479
44895
  if (config.signal && config.signal.aborted) {
44480
- throw new CanceledError$1(null, config);
44896
+ throw new CanceledError(null, config);
44481
44897
  }
44482
44898
  }
44483
44899
 
@@ -44491,53 +44907,49 @@ function throwIfCancellationRequested(config) {
44491
44907
  function dispatchRequest(config) {
44492
44908
  throwIfCancellationRequested(config);
44493
44909
 
44494
- config.headers = AxiosHeaders$1.from(config.headers);
44910
+ config.headers = AxiosHeaders.from(config.headers);
44495
44911
 
44496
44912
  // Transform request data
44497
- config.data = transformData.call(
44498
- config,
44499
- config.transformRequest
44500
- );
44913
+ config.data = transformData.call(config, config.transformRequest);
44501
44914
 
44502
44915
  if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
44503
44916
  config.headers.setContentType('application/x-www-form-urlencoded', false);
44504
44917
  }
44505
44918
 
44506
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
44919
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
44507
44920
 
44508
- return adapter(config).then(function onAdapterResolution(response) {
44509
- throwIfCancellationRequested(config);
44510
-
44511
- // Transform response data
44512
- response.data = transformData.call(
44513
- config,
44514
- config.transformResponse,
44515
- response
44516
- );
44517
-
44518
- response.headers = AxiosHeaders$1.from(response.headers);
44519
-
44520
- return response;
44521
- }, function onAdapterRejection(reason) {
44522
- if (!isCancel(reason)) {
44921
+ return adapter(config).then(
44922
+ function onAdapterResolution(response) {
44523
44923
  throwIfCancellationRequested(config);
44524
44924
 
44525
44925
  // Transform response data
44526
- if (reason && reason.response) {
44527
- reason.response.data = transformData.call(
44528
- config,
44529
- config.transformResponse,
44530
- reason.response
44531
- );
44532
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
44926
+ response.data = transformData.call(config, config.transformResponse, response);
44927
+
44928
+ response.headers = AxiosHeaders.from(response.headers);
44929
+
44930
+ return response;
44931
+ },
44932
+ function onAdapterRejection(reason) {
44933
+ if (!isCancel(reason)) {
44934
+ throwIfCancellationRequested(config);
44935
+
44936
+ // Transform response data
44937
+ if (reason && reason.response) {
44938
+ reason.response.data = transformData.call(
44939
+ config,
44940
+ config.transformResponse,
44941
+ reason.response
44942
+ );
44943
+ reason.response.headers = AxiosHeaders.from(reason.response.headers);
44944
+ }
44533
44945
  }
44534
- }
44535
44946
 
44536
- return Promise.reject(reason);
44537
- });
44947
+ return Promise.reject(reason);
44948
+ }
44949
+ );
44538
44950
  }
44539
44951
 
44540
- const VERSION = "1.13.4";
44952
+ const VERSION = "1.15.2";
44541
44953
 
44542
44954
  const validators$1 = {};
44543
44955
 
@@ -44561,15 +44973,23 @@ const deprecatedWarnings = {};
44561
44973
  */
44562
44974
  validators$1.transitional = function transitional(validator, version, message) {
44563
44975
  function formatMessage(opt, desc) {
44564
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
44976
+ return (
44977
+ '[Axios v' +
44978
+ VERSION +
44979
+ "] Transitional option '" +
44980
+ opt +
44981
+ "'" +
44982
+ desc +
44983
+ (message ? '. ' + message : '')
44984
+ );
44565
44985
  }
44566
44986
 
44567
44987
  // eslint-disable-next-line func-names
44568
44988
  return (value, opt, opts) => {
44569
44989
  if (validator === false) {
44570
- throw new AxiosError$1(
44990
+ throw new AxiosError(
44571
44991
  formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
44572
- AxiosError$1.ERR_DEPRECATED
44992
+ AxiosError.ERR_DEPRECATED
44573
44993
  );
44574
44994
  }
44575
44995
 
@@ -44593,7 +45013,7 @@ validators$1.spelling = function spelling(correctSpelling) {
44593
45013
  // eslint-disable-next-line no-console
44594
45014
  console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
44595
45015
  return true;
44596
- }
45016
+ };
44597
45017
  };
44598
45018
 
44599
45019
  /**
@@ -44608,30 +45028,35 @@ validators$1.spelling = function spelling(correctSpelling) {
44608
45028
 
44609
45029
  function assertOptions(options, schema, allowUnknown) {
44610
45030
  if (typeof options !== 'object') {
44611
- throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
45031
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
44612
45032
  }
44613
45033
  const keys = Object.keys(options);
44614
45034
  let i = keys.length;
44615
45035
  while (i-- > 0) {
44616
45036
  const opt = keys[i];
44617
- const validator = schema[opt];
45037
+ // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
45038
+ // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
45039
+ const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
44618
45040
  if (validator) {
44619
45041
  const value = options[opt];
44620
45042
  const result = value === undefined || validator(value, opt, options);
44621
45043
  if (result !== true) {
44622
- throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
45044
+ throw new AxiosError(
45045
+ 'option ' + opt + ' must be ' + result,
45046
+ AxiosError.ERR_BAD_OPTION_VALUE
45047
+ );
44623
45048
  }
44624
45049
  continue;
44625
45050
  }
44626
45051
  if (allowUnknown !== true) {
44627
- throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
45052
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
44628
45053
  }
44629
45054
  }
44630
45055
  }
44631
45056
 
44632
45057
  var validator = {
44633
45058
  assertOptions,
44634
- validators: validators$1
45059
+ validators: validators$1,
44635
45060
  };
44636
45061
 
44637
45062
  const validators = validator.validators;
@@ -44647,8 +45072,8 @@ class Axios {
44647
45072
  constructor(instanceConfig) {
44648
45073
  this.defaults = instanceConfig || {};
44649
45074
  this.interceptors = {
44650
- request: new InterceptorManager$1(),
44651
- response: new InterceptorManager$1()
45075
+ request: new InterceptorManager(),
45076
+ response: new InterceptorManager(),
44652
45077
  };
44653
45078
  }
44654
45079
 
@@ -44670,13 +45095,29 @@ class Axios {
44670
45095
  Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
44671
45096
 
44672
45097
  // slice off the Error: ... line
44673
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
45098
+ const stack = (() => {
45099
+ if (!dummy.stack) {
45100
+ return '';
45101
+ }
45102
+
45103
+ const firstNewlineIndex = dummy.stack.indexOf('\n');
45104
+
45105
+ return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
45106
+ })();
44674
45107
  try {
44675
45108
  if (!err.stack) {
44676
45109
  err.stack = stack;
44677
45110
  // match without the 2 top stack lines
44678
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
44679
- err.stack += '\n' + stack;
45111
+ } else if (stack) {
45112
+ const firstNewlineIndex = stack.indexOf('\n');
45113
+ const secondNewlineIndex =
45114
+ firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
45115
+ const stackWithoutTwoTopLines =
45116
+ secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
45117
+
45118
+ if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
45119
+ err.stack += '\n' + stack;
45120
+ }
44680
45121
  }
44681
45122
  } catch (e) {
44682
45123
  // ignore the case where "stack" is an un-writable property
@@ -44699,26 +45140,35 @@ class Axios {
44699
45140
 
44700
45141
  config = mergeConfig(this.defaults, config);
44701
45142
 
44702
- const {transitional, paramsSerializer, headers} = config;
45143
+ const { transitional, paramsSerializer, headers } = config;
44703
45144
 
44704
45145
  if (transitional !== undefined) {
44705
- validator.assertOptions(transitional, {
44706
- silentJSONParsing: validators.transitional(validators.boolean),
44707
- forcedJSONParsing: validators.transitional(validators.boolean),
44708
- clarifyTimeoutError: validators.transitional(validators.boolean)
44709
- }, false);
45146
+ validator.assertOptions(
45147
+ transitional,
45148
+ {
45149
+ silentJSONParsing: validators.transitional(validators.boolean),
45150
+ forcedJSONParsing: validators.transitional(validators.boolean),
45151
+ clarifyTimeoutError: validators.transitional(validators.boolean),
45152
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
45153
+ },
45154
+ false
45155
+ );
44710
45156
  }
44711
45157
 
44712
45158
  if (paramsSerializer != null) {
44713
45159
  if (utils$1.isFunction(paramsSerializer)) {
44714
45160
  config.paramsSerializer = {
44715
- serialize: paramsSerializer
45161
+ serialize: paramsSerializer,
44716
45162
  };
44717
45163
  } else {
44718
- validator.assertOptions(paramsSerializer, {
44719
- encode: validators.function,
44720
- serialize: validators.function
44721
- }, true);
45164
+ validator.assertOptions(
45165
+ paramsSerializer,
45166
+ {
45167
+ encode: validators.function,
45168
+ serialize: validators.function,
45169
+ },
45170
+ true
45171
+ );
44722
45172
  }
44723
45173
  }
44724
45174
 
@@ -44729,28 +45179,27 @@ class Axios {
44729
45179
  config.allowAbsoluteUrls = true;
44730
45180
  }
44731
45181
 
44732
- validator.assertOptions(config, {
44733
- baseUrl: validators.spelling('baseURL'),
44734
- withXsrfToken: validators.spelling('withXSRFToken')
44735
- }, true);
45182
+ validator.assertOptions(
45183
+ config,
45184
+ {
45185
+ baseUrl: validators.spelling('baseURL'),
45186
+ withXsrfToken: validators.spelling('withXSRFToken'),
45187
+ },
45188
+ true
45189
+ );
44736
45190
 
44737
45191
  // Set config.method
44738
45192
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
44739
45193
 
44740
45194
  // Flatten headers
44741
- let contextHeaders = headers && utils$1.merge(
44742
- headers.common,
44743
- headers[config.method]
44744
- );
45195
+ let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
44745
45196
 
44746
- headers && utils$1.forEach(
44747
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
44748
- (method) => {
45197
+ headers &&
45198
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
44749
45199
  delete headers[method];
44750
- }
44751
- );
45200
+ });
44752
45201
 
44753
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
45202
+ config.headers = AxiosHeaders.concat(contextHeaders, headers);
44754
45203
 
44755
45204
  // filter out skipped interceptors
44756
45205
  const requestInterceptorChain = [];
@@ -44762,7 +45211,15 @@ class Axios {
44762
45211
 
44763
45212
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
44764
45213
 
44765
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
45214
+ const transitional = config.transitional || transitionalDefaults;
45215
+ const legacyInterceptorReqResOrdering =
45216
+ transitional && transitional.legacyInterceptorReqResOrdering;
45217
+
45218
+ if (legacyInterceptorReqResOrdering) {
45219
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
45220
+ } else {
45221
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
45222
+ }
44766
45223
  });
44767
45224
 
44768
45225
  const responseInterceptorChain = [];
@@ -44830,28 +45287,32 @@ class Axios {
44830
45287
  // Provide aliases for supported request methods
44831
45288
  utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
44832
45289
  /*eslint func-names:0*/
44833
- Axios.prototype[method] = function(url, config) {
44834
- return this.request(mergeConfig(config || {}, {
44835
- method,
44836
- url,
44837
- data: (config || {}).data
44838
- }));
45290
+ Axios.prototype[method] = function (url, config) {
45291
+ return this.request(
45292
+ mergeConfig(config || {}, {
45293
+ method,
45294
+ url,
45295
+ data: (config || {}).data,
45296
+ })
45297
+ );
44839
45298
  };
44840
45299
  });
44841
45300
 
44842
45301
  utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
44843
- /*eslint func-names:0*/
44844
-
44845
45302
  function generateHTTPMethod(isForm) {
44846
45303
  return function httpMethod(url, data, config) {
44847
- return this.request(mergeConfig(config || {}, {
44848
- method,
44849
- headers: isForm ? {
44850
- 'Content-Type': 'multipart/form-data'
44851
- } : {},
44852
- url,
44853
- data
44854
- }));
45304
+ return this.request(
45305
+ mergeConfig(config || {}, {
45306
+ method,
45307
+ headers: isForm
45308
+ ? {
45309
+ 'Content-Type': 'multipart/form-data',
45310
+ }
45311
+ : {},
45312
+ url,
45313
+ data,
45314
+ })
45315
+ );
44855
45316
  };
44856
45317
  }
44857
45318
 
@@ -44860,8 +45321,6 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
44860
45321
  Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
44861
45322
  });
44862
45323
 
44863
- var Axios$1 = Axios;
44864
-
44865
45324
  /**
44866
45325
  * A `CancelToken` is an object that can be used to request cancellation of an operation.
44867
45326
  *
@@ -44884,7 +45343,7 @@ class CancelToken {
44884
45343
  const token = this;
44885
45344
 
44886
45345
  // eslint-disable-next-line func-names
44887
- this.promise.then(cancel => {
45346
+ this.promise.then((cancel) => {
44888
45347
  if (!token._listeners) return;
44889
45348
 
44890
45349
  let i = token._listeners.length;
@@ -44896,10 +45355,10 @@ class CancelToken {
44896
45355
  });
44897
45356
 
44898
45357
  // eslint-disable-next-line func-names
44899
- this.promise.then = onfulfilled => {
45358
+ this.promise.then = (onfulfilled) => {
44900
45359
  let _resolve;
44901
45360
  // eslint-disable-next-line func-names
44902
- const promise = new Promise(resolve => {
45361
+ const promise = new Promise((resolve) => {
44903
45362
  token.subscribe(resolve);
44904
45363
  _resolve = resolve;
44905
45364
  }).then(onfulfilled);
@@ -44917,7 +45376,7 @@ class CancelToken {
44917
45376
  return;
44918
45377
  }
44919
45378
 
44920
- token.reason = new CanceledError$1(message, config, request);
45379
+ token.reason = new CanceledError(message, config, request);
44921
45380
  resolvePromise(token.reason);
44922
45381
  });
44923
45382
  }
@@ -44987,13 +45446,11 @@ class CancelToken {
44987
45446
  });
44988
45447
  return {
44989
45448
  token,
44990
- cancel
45449
+ cancel,
44991
45450
  };
44992
45451
  }
44993
45452
  }
44994
45453
 
44995
- var CancelToken$1 = CancelToken;
44996
-
44997
45454
  /**
44998
45455
  * Syntactic sugar for invoking a function and expanding an array for arguments.
44999
45456
  *
@@ -45029,7 +45486,7 @@ function spread(callback) {
45029
45486
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
45030
45487
  */
45031
45488
  function isAxiosError(payload) {
45032
- return utils$1.isObject(payload) && (payload.isAxiosError === true);
45489
+ return utils$1.isObject(payload) && payload.isAxiosError === true;
45033
45490
  }
45034
45491
 
45035
45492
  const HttpStatusCode = {
@@ -45108,8 +45565,6 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
45108
45565
  HttpStatusCode[value] = key;
45109
45566
  });
45110
45567
 
45111
- var HttpStatusCode$1 = HttpStatusCode;
45112
-
45113
45568
  /**
45114
45569
  * Create an instance of Axios
45115
45570
  *
@@ -45118,14 +45573,14 @@ var HttpStatusCode$1 = HttpStatusCode;
45118
45573
  * @returns {Axios} A new instance of Axios
45119
45574
  */
45120
45575
  function createInstance(defaultConfig) {
45121
- const context = new Axios$1(defaultConfig);
45122
- const instance = bind(Axios$1.prototype.request, context);
45576
+ const context = new Axios(defaultConfig);
45577
+ const instance = bind(Axios.prototype.request, context);
45123
45578
 
45124
45579
  // Copy axios.prototype to instance
45125
- utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
45580
+ utils$1.extend(instance, Axios.prototype, context, { allOwnKeys: true });
45126
45581
 
45127
45582
  // Copy context to instance
45128
- utils$1.extend(instance, context, null, {allOwnKeys: true});
45583
+ utils$1.extend(instance, context, null, { allOwnKeys: true });
45129
45584
 
45130
45585
  // Factory for creating new instances
45131
45586
  instance.create = function create(instanceConfig) {
@@ -45136,20 +45591,20 @@ function createInstance(defaultConfig) {
45136
45591
  }
45137
45592
 
45138
45593
  // Create the default instance to be exported
45139
- const axios = createInstance(defaults$1);
45594
+ const axios = createInstance(defaults);
45140
45595
 
45141
45596
  // Expose Axios class to allow class inheritance
45142
- axios.Axios = Axios$1;
45597
+ axios.Axios = Axios;
45143
45598
 
45144
45599
  // Expose Cancel & CancelToken
45145
- axios.CanceledError = CanceledError$1;
45146
- axios.CancelToken = CancelToken$1;
45600
+ axios.CanceledError = CanceledError;
45601
+ axios.CancelToken = CancelToken;
45147
45602
  axios.isCancel = isCancel;
45148
45603
  axios.VERSION = VERSION;
45149
45604
  axios.toFormData = toFormData;
45150
45605
 
45151
45606
  // Expose AxiosError class
45152
- axios.AxiosError = AxiosError$1;
45607
+ axios.AxiosError = AxiosError;
45153
45608
 
45154
45609
  // alias for CanceledError for backward compatibility
45155
45610
  axios.Cancel = axios.CanceledError;
@@ -45167,13 +45622,13 @@ axios.isAxiosError = isAxiosError;
45167
45622
  // Expose mergeConfig
45168
45623
  axios.mergeConfig = mergeConfig;
45169
45624
 
45170
- axios.AxiosHeaders = AxiosHeaders$1;
45625
+ axios.AxiosHeaders = AxiosHeaders;
45171
45626
 
45172
- axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
45627
+ axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
45173
45628
 
45174
45629
  axios.getAdapter = adapters.getAdapter;
45175
45630
 
45176
- axios.HttpStatusCode = HttpStatusCode$1;
45631
+ axios.HttpStatusCode = HttpStatusCode;
45177
45632
 
45178
45633
  axios.default = axios;
45179
45634