@gvnrdao/dh-mcp 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/boundary.js +1606 -446
- package/dist/connector-embed.js +1606 -446
- package/dist/connector.js +1606 -446
- package/dist/index.js +1606 -446
- package/package.json +2 -2
package/dist/connector-embed.js
CHANGED
|
@@ -14313,6 +14313,9 @@ var require_pkg_src = __commonJS({
|
|
|
14313
14313
|
});
|
|
14314
14314
|
var index_exports = {};
|
|
14315
14315
|
__export3(index_exports, {
|
|
14316
|
+
BORROWER_AUTHORIZATION_ENCODE_TYPES: () => BORROWER_AUTHORIZATION_ENCODE_TYPES,
|
|
14317
|
+
BORROWER_AUTHORIZATION_FIELDS: () => BORROWER_AUTHORIZATION_FIELDS,
|
|
14318
|
+
BORROWER_AUTHORIZATION_PRIMARY_TYPES: () => BORROWER_AUTHORIZATION_PRIMARY_TYPES,
|
|
14316
14319
|
CHIPOTLE_DEPLOYMENTS: () => CHIPOTLE_DEPLOYMENTS,
|
|
14317
14320
|
DEFAULT_CACHE_CONFIG: () => DEFAULT_CACHE_CONFIG,
|
|
14318
14321
|
DEFAULT_DEBUG_CONFIG: () => DEFAULT_DEBUG_CONFIG,
|
|
@@ -14325,6 +14328,8 @@ var require_pkg_src = __commonJS({
|
|
|
14325
14328
|
PerformanceTracker: () => PerformanceTracker,
|
|
14326
14329
|
RetryStrategy: () => RetryStrategy,
|
|
14327
14330
|
analyzeError: () => analyzeError,
|
|
14331
|
+
borrowerAuthorizationTypes: () => borrowerAuthorizationTypes,
|
|
14332
|
+
buildBorrowerAuthorizationDomain: () => buildBorrowerAuthorizationDomain,
|
|
14328
14333
|
calculateDelay: () => calculateDelay,
|
|
14329
14334
|
cidToHex: () => cidToHex,
|
|
14330
14335
|
classifyError: () => classifyError,
|
|
@@ -14571,30 +14576,30 @@ var require_pkg_src = __commonJS({
|
|
|
14571
14576
|
}
|
|
14572
14577
|
},
|
|
14573
14578
|
btcTransactionSigner: {
|
|
14574
|
-
cid: "
|
|
14579
|
+
cid: "QmVi1BYdxvCX3QUhXwPtP6FjWMzqSPtXzrS54YsXjTgjYf",
|
|
14575
14580
|
authorizedCidHex: cidToHex(
|
|
14576
|
-
"
|
|
14581
|
+
"QmVi1BYdxvCX3QUhXwPtP6FjWMzqSPtXzrS54YsXjTgjYf"
|
|
14577
14582
|
),
|
|
14578
14583
|
name: "Btc Transaction Signer",
|
|
14579
14584
|
description: "Production Btc Transaction Signer",
|
|
14580
14585
|
version: "1.1.1",
|
|
14581
14586
|
deployed: true,
|
|
14582
|
-
deployedAt:
|
|
14583
|
-
size:
|
|
14584
|
-
hash: "
|
|
14587
|
+
deployedAt: 1787923905597,
|
|
14588
|
+
size: 70646,
|
|
14589
|
+
hash: "37c3bb72a660c8275d92e1b73f9482742d86b64789480b9246304c0ca1bab47a"
|
|
14585
14590
|
},
|
|
14586
14591
|
ucdMintValidator: {
|
|
14587
|
-
cid: "
|
|
14592
|
+
cid: "QmUWR5fLiyimLT9TPXpYx3HgwNwkvR6MxjZ7hdeYCFodbc",
|
|
14588
14593
|
authorizedCidHex: cidToHex(
|
|
14589
|
-
"
|
|
14594
|
+
"QmUWR5fLiyimLT9TPXpYx3HgwNwkvR6MxjZ7hdeYCFodbc"
|
|
14590
14595
|
),
|
|
14591
14596
|
name: "Ucd Mint Validator",
|
|
14592
14597
|
description: "Production Ucd Mint Validator",
|
|
14593
14598
|
version: "1.2.1",
|
|
14594
14599
|
deployed: true,
|
|
14595
|
-
deployedAt:
|
|
14596
|
-
size:
|
|
14597
|
-
hash: "
|
|
14600
|
+
deployedAt: 1787923919527,
|
|
14601
|
+
size: 86197,
|
|
14602
|
+
hash: "c2d80939746cc37f65ef2f63c6a3215b929214a63f10c78144e1f5c98320dabf",
|
|
14598
14603
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
14599
14604
|
pkp: {
|
|
14600
14605
|
publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
|
|
@@ -14602,17 +14607,17 @@ var require_pkg_src = __commonJS({
|
|
|
14602
14607
|
}
|
|
14603
14608
|
},
|
|
14604
14609
|
processPaymentValidator: {
|
|
14605
|
-
cid: "
|
|
14610
|
+
cid: "QmXmXuMRAjMLdgKGyTf9KQdGwYrDp8DxkiF44TvSXDf7wF",
|
|
14606
14611
|
authorizedCidHex: cidToHex(
|
|
14607
|
-
"
|
|
14612
|
+
"QmXmXuMRAjMLdgKGyTf9KQdGwYrDp8DxkiF44TvSXDf7wF"
|
|
14608
14613
|
),
|
|
14609
14614
|
name: "Process Payment Validator",
|
|
14610
14615
|
description: "Production Process Payment Validator",
|
|
14611
14616
|
version: "1.2.1",
|
|
14612
14617
|
deployed: true,
|
|
14613
|
-
deployedAt:
|
|
14614
|
-
size:
|
|
14615
|
-
hash: "
|
|
14618
|
+
deployedAt: 1787923987153,
|
|
14619
|
+
size: 82217,
|
|
14620
|
+
hash: "13defa19614215ab3b1fe88955d69e530d13a09475396af932fe0e213637da2f",
|
|
14616
14621
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
14617
14622
|
pkp: {
|
|
14618
14623
|
publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
|
|
@@ -14620,17 +14625,17 @@ var require_pkg_src = __commonJS({
|
|
|
14620
14625
|
}
|
|
14621
14626
|
},
|
|
14622
14627
|
extendPositionValidator: {
|
|
14623
|
-
cid: "
|
|
14628
|
+
cid: "QmU8h99EEVEsQkxroXiYqLsKZw9gNjE6N5CcTpE9aUc12m",
|
|
14624
14629
|
authorizedCidHex: cidToHex(
|
|
14625
|
-
"
|
|
14630
|
+
"QmU8h99EEVEsQkxroXiYqLsKZw9gNjE6N5CcTpE9aUc12m"
|
|
14626
14631
|
),
|
|
14627
14632
|
name: "Extend Position Validator",
|
|
14628
14633
|
description: "Production Extend Position Validator",
|
|
14629
14634
|
version: "1.2.1",
|
|
14630
14635
|
deployed: true,
|
|
14631
|
-
deployedAt:
|
|
14632
|
-
size:
|
|
14633
|
-
hash: "
|
|
14636
|
+
deployedAt: 1787923999294,
|
|
14637
|
+
size: 79975,
|
|
14638
|
+
hash: "31c1aaf883ef22f37681ddb0a4a949be5c05304b6aef178989475a2da935ef9a",
|
|
14634
14639
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
14635
14640
|
pkp: {
|
|
14636
14641
|
publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
|
|
@@ -14638,17 +14643,17 @@ var require_pkg_src = __commonJS({
|
|
|
14638
14643
|
}
|
|
14639
14644
|
},
|
|
14640
14645
|
btcWithdrawal: {
|
|
14641
|
-
cid: "
|
|
14646
|
+
cid: "QmZQWET9pzrVD4gwQuSzYZmqa24JrUNtnnGFDd513sxMCY",
|
|
14642
14647
|
authorizedCidHex: cidToHex(
|
|
14643
|
-
"
|
|
14648
|
+
"QmZQWET9pzrVD4gwQuSzYZmqa24JrUNtnnGFDd513sxMCY"
|
|
14644
14649
|
),
|
|
14645
14650
|
name: "Btc Withdrawal",
|
|
14646
14651
|
description: "Production Btc Withdrawal",
|
|
14647
14652
|
version: "1.2.7",
|
|
14648
14653
|
deployed: true,
|
|
14649
|
-
deployedAt:
|
|
14650
|
-
size:
|
|
14651
|
-
hash: "
|
|
14654
|
+
deployedAt: 1787924017769,
|
|
14655
|
+
size: 100069,
|
|
14656
|
+
hash: "4f8e27414e4da235e63d6ae1325c63f3d2fb956464515a21aa007a99935f0f13",
|
|
14652
14657
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
14653
14658
|
pkp: {
|
|
14654
14659
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
@@ -14760,30 +14765,30 @@ var require_pkg_src = __commonJS({
|
|
|
14760
14765
|
hash: "03ee5be239c91c735d2c95db89a0d1b77e602cfc18af8eb64b3281fddcd90a72"
|
|
14761
14766
|
},
|
|
14762
14767
|
agentModuleExecutor: {
|
|
14763
|
-
cid: "
|
|
14768
|
+
cid: "QmcD65vuremot5fsHVgp9JBAmei6gAaEtm5mdtLP7Yt9Kf",
|
|
14764
14769
|
authorizedCidHex: cidToHex(
|
|
14765
|
-
"
|
|
14770
|
+
"QmcD65vuremot5fsHVgp9JBAmei6gAaEtm5mdtLP7Yt9Kf"
|
|
14766
14771
|
),
|
|
14767
14772
|
name: "Agent Module Executor",
|
|
14768
14773
|
description: "Production Agent Module Executor",
|
|
14769
14774
|
version: "1.1.1",
|
|
14770
14775
|
deployed: true,
|
|
14771
|
-
deployedAt:
|
|
14772
|
-
size:
|
|
14773
|
-
hash: "
|
|
14776
|
+
deployedAt: 1787924032013,
|
|
14777
|
+
size: 13878,
|
|
14778
|
+
hash: "a7f0204700912e26e5a354bee13a1242a2baa218643b3bb22d28481f67f9baf4"
|
|
14774
14779
|
},
|
|
14775
14780
|
staleSpendRecoveryValidator: {
|
|
14776
|
-
cid: "
|
|
14781
|
+
cid: "QmNuwo4PT4AikAmhMdZgPWCb2mJDwWa9TnUqrqvofjbrT8",
|
|
14777
14782
|
authorizedCidHex: cidToHex(
|
|
14778
|
-
"
|
|
14783
|
+
"QmNuwo4PT4AikAmhMdZgPWCb2mJDwWa9TnUqrqvofjbrT8"
|
|
14779
14784
|
),
|
|
14780
14785
|
name: "Stale Spend Recovery Validator",
|
|
14781
14786
|
description: "Production Stale Spend Recovery Validator",
|
|
14782
14787
|
version: "1.1.2",
|
|
14783
14788
|
deployed: true,
|
|
14784
|
-
deployedAt:
|
|
14785
|
-
size:
|
|
14786
|
-
hash: "
|
|
14789
|
+
deployedAt: 1787924048772,
|
|
14790
|
+
size: 41424,
|
|
14791
|
+
hash: "3c5f028d2bef4344768462993616d45e30d9d44ef126e04d6eb579821d57d99c",
|
|
14787
14792
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
14788
14793
|
pkp: {
|
|
14789
14794
|
publicKey: "0x046da0ad6da7dd4a0063cbeac6f2bdb6a9889c2178b23470833356a8ee5630f7f0eee0db348d9d9aaaadd23eccf0063c8f68ee5e446abe30b882bf1de4c932bc21",
|
|
@@ -14791,17 +14796,17 @@ var require_pkg_src = __commonJS({
|
|
|
14791
14796
|
}
|
|
14792
14797
|
},
|
|
14793
14798
|
btcUtxoInvalidator: {
|
|
14794
|
-
cid: "
|
|
14799
|
+
cid: "QmaNGeWut7EiGwW4zUc2sFSt7RY5NWFgxYboyG333TwrJf",
|
|
14795
14800
|
authorizedCidHex: cidToHex(
|
|
14796
|
-
"
|
|
14801
|
+
"QmaNGeWut7EiGwW4zUc2sFSt7RY5NWFgxYboyG333TwrJf"
|
|
14797
14802
|
),
|
|
14798
14803
|
name: "Btc Utxo Invalidator",
|
|
14799
14804
|
description: "Production Btc Utxo Invalidator",
|
|
14800
14805
|
version: "1.0.0",
|
|
14801
14806
|
deployed: true,
|
|
14802
|
-
deployedAt:
|
|
14803
|
-
size:
|
|
14804
|
-
hash: "
|
|
14807
|
+
deployedAt: 1787924133241,
|
|
14808
|
+
size: 66026,
|
|
14809
|
+
hash: "603bc50920d7f1dee77086f2c518d9e2922ab3858a419d3fbea8221ea3a6d9e9"
|
|
14805
14810
|
}
|
|
14806
14811
|
};
|
|
14807
14812
|
function getDeploymentsForNetwork(network) {
|
|
@@ -15560,6 +15565,101 @@ ${errorReport}`);
|
|
|
15560
15565
|
var SECONDS_PER_DAY = 86400;
|
|
15561
15566
|
var DAYS_PER_MONTH = 30;
|
|
15562
15567
|
var LIT_ACTION_ETH_RPC_TIMEOUT_MS = 8e3;
|
|
15568
|
+
var PINNED_CONTRACT_ADDRESSES = {
|
|
15569
|
+
1: {
|
|
15570
|
+
PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
|
|
15571
|
+
LoanOperationsManagerModule: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
|
|
15572
|
+
BTCSpendAuthorizer: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
|
|
15573
|
+
BitcoinProviderRegistry: "0x4ab3Fb96e02893Ed6FAa61bad1918390c8DbbFFC",
|
|
15574
|
+
LITActionValidator: "0xD2c5d59c2CC5c409AC65ce0A817236aeC6869512",
|
|
15575
|
+
PositionDelegateRegistry: "0xf0aa2678aD4F60f49e8F7725089B5E86B7F8FE4C"
|
|
15576
|
+
},
|
|
15577
|
+
11155111: {
|
|
15578
|
+
PositionManager: "0x68e0507D982AEBF1D1C1Af8FBbd842327e2deeFF",
|
|
15579
|
+
LoanOperationsManagerModule: "0x3e05e760a87715207b7F4e8fD35EF7559BcA72C0",
|
|
15580
|
+
BTCSpendAuthorizer: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
15581
|
+
BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
15582
|
+
LITActionValidator: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
|
|
15583
|
+
PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9"
|
|
15584
|
+
}
|
|
15585
|
+
};
|
|
15586
|
+
function getPinnedContractAddresses(chainId) {
|
|
15587
|
+
return PINNED_CONTRACT_ADDRESSES[chainId] ?? null;
|
|
15588
|
+
}
|
|
15589
|
+
var PROTOCOL_EIP712_DOMAIN_NAME = "DiamondHands.Protocol";
|
|
15590
|
+
var PROTOCOL_EIP712_DOMAIN_VERSION = "1";
|
|
15591
|
+
var BORROWER_AUTHORIZATION_PRIMARY_TYPES = {
|
|
15592
|
+
MINT: "MintRequest",
|
|
15593
|
+
REPAY: "RepayRequest",
|
|
15594
|
+
RENEW: "RenewRequest",
|
|
15595
|
+
WITHDRAW: "WithdrawRequest"
|
|
15596
|
+
};
|
|
15597
|
+
var BORROWER_AUTHORIZATION_FIELDS = {
|
|
15598
|
+
MintRequest: [
|
|
15599
|
+
{ name: "positionId", type: "bytes32" },
|
|
15600
|
+
{ name: "mintAmount", type: "uint256" },
|
|
15601
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
15602
|
+
],
|
|
15603
|
+
RepayRequest: [
|
|
15604
|
+
{ name: "positionId", type: "bytes32" },
|
|
15605
|
+
{ name: "paymentAmount", type: "uint256" },
|
|
15606
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
15607
|
+
],
|
|
15608
|
+
RenewRequest: [
|
|
15609
|
+
{ name: "positionId", type: "bytes32" },
|
|
15610
|
+
{ name: "selectedTerm", type: "uint256" },
|
|
15611
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
15612
|
+
],
|
|
15613
|
+
WithdrawRequest: [
|
|
15614
|
+
{ name: "positionId", type: "bytes32" },
|
|
15615
|
+
{ name: "totalDeduction", type: "uint256" },
|
|
15616
|
+
{ name: "withdrawalAddress", type: "string" },
|
|
15617
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
15618
|
+
]
|
|
15619
|
+
};
|
|
15620
|
+
var BORROWER_AUTHORIZATION_ENCODE_TYPES = {
|
|
15621
|
+
MintRequest: "MintRequest(bytes32 positionId,uint256 mintAmount,uint256 quantumTimestamp)",
|
|
15622
|
+
RepayRequest: "RepayRequest(bytes32 positionId,uint256 paymentAmount,uint256 quantumTimestamp)",
|
|
15623
|
+
RenewRequest: "RenewRequest(bytes32 positionId,uint256 selectedTerm,uint256 quantumTimestamp)",
|
|
15624
|
+
WithdrawRequest: "WithdrawRequest(bytes32 positionId,uint256 totalDeduction,string withdrawalAddress,uint256 quantumTimestamp)"
|
|
15625
|
+
};
|
|
15626
|
+
function borrowerAuthorizationTypes(primaryType) {
|
|
15627
|
+
const fields = BORROWER_AUTHORIZATION_FIELDS[primaryType];
|
|
15628
|
+
if (!fields) {
|
|
15629
|
+
throw new Error(
|
|
15630
|
+
`Unknown borrower authorization primary type "${primaryType}"; expected one of ${Object.keys(BORROWER_AUTHORIZATION_FIELDS).join(", ")}`
|
|
15631
|
+
);
|
|
15632
|
+
}
|
|
15633
|
+
return { [primaryType]: fields.map((field) => ({ ...field })) };
|
|
15634
|
+
}
|
|
15635
|
+
function buildBorrowerAuthorizationDomain(chainId, verifyingContractOverride) {
|
|
15636
|
+
if (!Number.isInteger(chainId) || chainId <= 0) {
|
|
15637
|
+
throw new Error(
|
|
15638
|
+
`Borrower authorization domain requires a positive integer chainId, got ${String(chainId)}`
|
|
15639
|
+
);
|
|
15640
|
+
}
|
|
15641
|
+
const pinned = getPinnedContractAddresses(chainId);
|
|
15642
|
+
const pinnedLom = pinned?.LoanOperationsManagerModule;
|
|
15643
|
+
if (pinnedLom && verifyingContractOverride) {
|
|
15644
|
+
if (pinnedLom.toLowerCase() !== verifyingContractOverride.toLowerCase()) {
|
|
15645
|
+
throw new Error(
|
|
15646
|
+
`Refusing a caller-supplied verifyingContract that contradicts the pin for chainId ${chainId}: caller ${verifyingContractOverride}, pinned ${pinnedLom}`
|
|
15647
|
+
);
|
|
15648
|
+
}
|
|
15649
|
+
}
|
|
15650
|
+
const verifyingContract = pinnedLom ?? verifyingContractOverride;
|
|
15651
|
+
if (!verifyingContract) {
|
|
15652
|
+
throw new Error(
|
|
15653
|
+
`No pinned LoanOperationsManagerModule for chainId ${chainId} and no verifyingContract supplied; refusing to build a borrower authorization domain without one`
|
|
15654
|
+
);
|
|
15655
|
+
}
|
|
15656
|
+
return {
|
|
15657
|
+
name: PROTOCOL_EIP712_DOMAIN_NAME,
|
|
15658
|
+
version: PROTOCOL_EIP712_DOMAIN_VERSION,
|
|
15659
|
+
chainId,
|
|
15660
|
+
verifyingContract
|
|
15661
|
+
};
|
|
15662
|
+
}
|
|
15563
15663
|
var EVMChain = /* @__PURE__ */ ((EVMChain3) => {
|
|
15564
15664
|
EVMChain3["SEPOLIA"] = "sepolia";
|
|
15565
15665
|
EVMChain3["ETHEREUM"] = "ethereum";
|
|
@@ -17361,11 +17461,11 @@ ${auth.clientId}`;
|
|
|
17361
17461
|
);
|
|
17362
17462
|
const prices = await Promise.race([fetchAll, timeoutPromise]);
|
|
17363
17463
|
const sorted = [...prices].sort((a, b) => a - b);
|
|
17364
|
-
let
|
|
17464
|
+
let median2;
|
|
17365
17465
|
if (this.devSingleProvider) {
|
|
17366
|
-
|
|
17466
|
+
median2 = sorted[0];
|
|
17367
17467
|
} else {
|
|
17368
|
-
|
|
17468
|
+
median2 = sorted[1];
|
|
17369
17469
|
const spread3 = (sorted[2] - sorted[0]) / sorted[0];
|
|
17370
17470
|
if (spread3 > PRICE_ORACLE_TOLERANCE) {
|
|
17371
17471
|
const names = this.sources.map((s) => s.name).join(", ");
|
|
@@ -17375,10 +17475,10 @@ ${auth.clientId}`;
|
|
|
17375
17475
|
);
|
|
17376
17476
|
}
|
|
17377
17477
|
}
|
|
17378
|
-
const priceCents = Math.round(
|
|
17478
|
+
const priceCents = Math.round(median2 * 100);
|
|
17379
17479
|
const priceWith8Decimals = BigInt(priceCents) * 1000000n;
|
|
17380
17480
|
const totalElapsed = Date.now() - startTime;
|
|
17381
|
-
console.log(`[Price Oracle] Median price: $${
|
|
17481
|
+
console.log(`[Price Oracle] Median price: $${median2.toLocaleString()} \u2014 total time: ${totalElapsed}ms`);
|
|
17382
17482
|
console.log(`[Price Oracle] Price with 8 decimals: ${priceWith8Decimals}`);
|
|
17383
17483
|
return priceWith8Decimals;
|
|
17384
17484
|
}
|
|
@@ -18806,22 +18906,82 @@ var require_axios = __commonJS({
|
|
|
18806
18906
|
var hasOwnProperty2 = (({
|
|
18807
18907
|
hasOwnProperty: hasOwnProperty3
|
|
18808
18908
|
}) => (obj, prop) => hasOwnProperty3.call(obj, prop))(Object.prototype);
|
|
18909
|
+
var isUnsafeObjectKey2 = (prop) => typeof prop === "string" && (prop === "__proto__" || prop === "constructor" || prop === "prototype");
|
|
18910
|
+
var isPrototypeBoundary2 = (obj, prototype3, source) => obj === Object.prototype || !source && prototype3 === null;
|
|
18911
|
+
var isSafeAndFullyMutable2 = (obj) => {
|
|
18912
|
+
if (!Object.isExtensible(obj)) {
|
|
18913
|
+
return false;
|
|
18914
|
+
}
|
|
18915
|
+
const props = Object.getOwnPropertyNames(obj);
|
|
18916
|
+
if (Object.getOwnPropertySymbols) {
|
|
18917
|
+
props.push(...Object.getOwnPropertySymbols(obj));
|
|
18918
|
+
}
|
|
18919
|
+
return props.every((prop) => {
|
|
18920
|
+
if (isUnsafeObjectKey2(prop)) {
|
|
18921
|
+
return false;
|
|
18922
|
+
}
|
|
18923
|
+
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
18924
|
+
return !!descriptor && descriptor.configurable && descriptor.writable === true;
|
|
18925
|
+
});
|
|
18926
|
+
};
|
|
18809
18927
|
var hasOwnInPrototypeChain2 = (thing, prop) => {
|
|
18810
18928
|
let obj = thing;
|
|
18811
18929
|
const seen = [];
|
|
18812
|
-
while (obj != null
|
|
18930
|
+
while (obj != null) {
|
|
18813
18931
|
if (seen.indexOf(obj) !== -1) {
|
|
18814
18932
|
return false;
|
|
18815
18933
|
}
|
|
18816
18934
|
seen.push(obj);
|
|
18935
|
+
const prototype3 = getPrototypeOf2(obj);
|
|
18936
|
+
if (isPrototypeBoundary2(obj, prototype3, obj === thing)) {
|
|
18937
|
+
return false;
|
|
18938
|
+
}
|
|
18817
18939
|
if (hasOwnProperty2(obj, prop)) {
|
|
18818
18940
|
return true;
|
|
18819
18941
|
}
|
|
18820
|
-
obj =
|
|
18942
|
+
obj = prototype3;
|
|
18821
18943
|
}
|
|
18822
18944
|
return false;
|
|
18823
18945
|
};
|
|
18824
18946
|
var getSafeProp2 = (obj, prop) => obj != null && hasOwnInPrototypeChain2(obj, prop) ? obj[prop] : void 0;
|
|
18947
|
+
var toSafeFlatObject2 = (thing) => {
|
|
18948
|
+
if (thing == null || typeof thing !== "object" && typeof thing !== "function") {
|
|
18949
|
+
return thing;
|
|
18950
|
+
}
|
|
18951
|
+
const sourcePrototype = getPrototypeOf2(thing);
|
|
18952
|
+
if (sourcePrototype === null && isSafeAndFullyMutable2(thing)) {
|
|
18953
|
+
return thing;
|
|
18954
|
+
}
|
|
18955
|
+
const result = /* @__PURE__ */ Object.create(null);
|
|
18956
|
+
const merged = /* @__PURE__ */ Object.create(null);
|
|
18957
|
+
const seen = [];
|
|
18958
|
+
let current = thing;
|
|
18959
|
+
while (current != null) {
|
|
18960
|
+
if (seen.indexOf(current) !== -1) {
|
|
18961
|
+
break;
|
|
18962
|
+
}
|
|
18963
|
+
seen.push(current);
|
|
18964
|
+
const prototype3 = current === thing ? sourcePrototype : getPrototypeOf2(current);
|
|
18965
|
+
if (isPrototypeBoundary2(current, prototype3, current === thing)) {
|
|
18966
|
+
break;
|
|
18967
|
+
}
|
|
18968
|
+
const props = Object.getOwnPropertyNames(current);
|
|
18969
|
+
if (Object.getOwnPropertySymbols) {
|
|
18970
|
+
props.push(...Object.getOwnPropertySymbols(current));
|
|
18971
|
+
}
|
|
18972
|
+
for (const prop of props) {
|
|
18973
|
+
if (isUnsafeObjectKey2(prop)) {
|
|
18974
|
+
continue;
|
|
18975
|
+
}
|
|
18976
|
+
if (!hasOwnProperty2(merged, prop)) {
|
|
18977
|
+
result[prop] = thing[prop];
|
|
18978
|
+
merged[prop] = true;
|
|
18979
|
+
}
|
|
18980
|
+
}
|
|
18981
|
+
current = prototype3;
|
|
18982
|
+
}
|
|
18983
|
+
return result;
|
|
18984
|
+
};
|
|
18825
18985
|
var kindOf2 = /* @__PURE__ */ ((cache) => (thing) => {
|
|
18826
18986
|
const str = toString3.call(thing);
|
|
18827
18987
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -18858,9 +19018,9 @@ var require_axios = __commonJS({
|
|
|
18858
19018
|
return false;
|
|
18859
19019
|
}
|
|
18860
19020
|
const prototype3 = getPrototypeOf2(val);
|
|
18861
|
-
return (prototype3 === null || prototype3 === Object.prototype || getPrototypeOf2(prototype3) === null) && // Treat
|
|
18862
|
-
//
|
|
18863
|
-
//
|
|
19021
|
+
return (prototype3 === null || prototype3 === Object.prototype || getPrototypeOf2(prototype3) === null) && // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as
|
|
19022
|
+
// evidence the value is tagged/iterable, while ignoring members reachable
|
|
19023
|
+
// only through shared or terminal prototype boundaries.
|
|
18864
19024
|
!hasOwnInPrototypeChain2(val, toStringTag2) && !hasOwnInPrototypeChain2(val, iterator2);
|
|
18865
19025
|
};
|
|
18866
19026
|
var isEmptyObject2 = (val) => {
|
|
@@ -19272,6 +19432,7 @@ var require_axios = __commonJS({
|
|
|
19272
19432
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
19273
19433
|
hasOwnInPrototypeChain: hasOwnInPrototypeChain2,
|
|
19274
19434
|
getSafeProp: getSafeProp2,
|
|
19435
|
+
toSafeFlatObject: toSafeFlatObject2,
|
|
19275
19436
|
reduceDescriptors: reduceDescriptors2,
|
|
19276
19437
|
freezeMethods: freezeMethods2,
|
|
19277
19438
|
toObjectSet: toObjectSet2,
|
|
@@ -19352,7 +19513,7 @@ var require_axios = __commonJS({
|
|
|
19352
19513
|
});
|
|
19353
19514
|
return byteStringHeaders;
|
|
19354
19515
|
}
|
|
19355
|
-
var $
|
|
19516
|
+
var $internals$1 = Symbol("internals");
|
|
19356
19517
|
function normalizeHeader2(header) {
|
|
19357
19518
|
return header && String(header).trim().toLowerCase();
|
|
19358
19519
|
}
|
|
@@ -19648,7 +19809,7 @@ var require_axios = __commonJS({
|
|
|
19648
19809
|
return computed;
|
|
19649
19810
|
}
|
|
19650
19811
|
static accessor(header) {
|
|
19651
|
-
const internals = this[$
|
|
19812
|
+
const internals = this[$internals$1] = this[$internals$1] = {
|
|
19652
19813
|
accessors: {}
|
|
19653
19814
|
};
|
|
19654
19815
|
const accessors = internals.accessors;
|
|
@@ -19869,19 +20030,16 @@ var require_axios = __commonJS({
|
|
|
19869
20030
|
throw new TypeError("target must be an object");
|
|
19870
20031
|
}
|
|
19871
20032
|
formData = formData || new (FormData$1 || FormData)();
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
const
|
|
19880
|
-
const
|
|
19881
|
-
const
|
|
19882
|
-
const indexes = options.indexes;
|
|
19883
|
-
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
19884
|
-
const maxDepth = options.maxDepth === void 0 ? DEFAULT_FORM_DATA_MAX_DEPTH2 : options.maxDepth;
|
|
20033
|
+
const option = (name, fallback) => {
|
|
20034
|
+
const value = utils$1.getSafeProp(options, name);
|
|
20035
|
+
return utils$1.isUndefined(value) ? fallback : value;
|
|
20036
|
+
};
|
|
20037
|
+
const metaTokens = option("metaTokens", true);
|
|
20038
|
+
const visitor = option("visitor") || defaultVisitor;
|
|
20039
|
+
const dots = option("dots", false);
|
|
20040
|
+
const indexes = option("indexes", false);
|
|
20041
|
+
const _Blob = option("Blob") || typeof Blob !== "undefined" && Blob;
|
|
20042
|
+
const maxDepth = option("maxDepth", DEFAULT_FORM_DATA_MAX_DEPTH2);
|
|
19885
20043
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
19886
20044
|
const stack = [];
|
|
19887
20045
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -20040,9 +20198,47 @@ var require_axios = __commonJS({
|
|
|
20040
20198
|
}
|
|
20041
20199
|
return url3;
|
|
20042
20200
|
}
|
|
20201
|
+
var $internals3 = Symbol("internals");
|
|
20202
|
+
function countHandlers2(handlers) {
|
|
20203
|
+
return handlers ? handlers.length : 0;
|
|
20204
|
+
}
|
|
20205
|
+
function trimHandlers2(handlers) {
|
|
20206
|
+
if (!handlers) {
|
|
20207
|
+
return;
|
|
20208
|
+
}
|
|
20209
|
+
while (handlers.length && handlers[handlers.length - 1] === null) {
|
|
20210
|
+
handlers.pop();
|
|
20211
|
+
}
|
|
20212
|
+
}
|
|
20213
|
+
function syncHandlerEntries2(manager, internals) {
|
|
20214
|
+
const handlers = manager.handlers;
|
|
20215
|
+
const length = countHandlers2(handlers);
|
|
20216
|
+
if (handlers !== internals.handlersRef) {
|
|
20217
|
+
internals.handlersRef = handlers;
|
|
20218
|
+
internals.handlerEntries.clear();
|
|
20219
|
+
} else if (length !== internals.handlersLength) {
|
|
20220
|
+
if (!length) {
|
|
20221
|
+
internals.handlerEntries.clear();
|
|
20222
|
+
} else {
|
|
20223
|
+
internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {
|
|
20224
|
+
if (handlers[entry.index] !== entry.handler) {
|
|
20225
|
+
internals.handlerEntries.delete(id);
|
|
20226
|
+
}
|
|
20227
|
+
});
|
|
20228
|
+
}
|
|
20229
|
+
}
|
|
20230
|
+
internals.handlersLength = length;
|
|
20231
|
+
}
|
|
20043
20232
|
var InterceptorManager2 = class {
|
|
20044
20233
|
constructor() {
|
|
20045
20234
|
this.handlers = [];
|
|
20235
|
+
this[$internals3] = {
|
|
20236
|
+
handlersRef: this.handlers,
|
|
20237
|
+
handlersLength: this.handlers.length,
|
|
20238
|
+
handlerEntries: /* @__PURE__ */ new Map(),
|
|
20239
|
+
iterationDepth: 0,
|
|
20240
|
+
nextId: 0
|
|
20241
|
+
};
|
|
20046
20242
|
}
|
|
20047
20243
|
/**
|
|
20048
20244
|
* Add a new interceptor to the stack
|
|
@@ -20054,13 +20250,25 @@ var require_axios = __commonJS({
|
|
|
20054
20250
|
* @return {Number} An ID used to remove interceptor later
|
|
20055
20251
|
*/
|
|
20056
20252
|
use(fulfilled, rejected, options) {
|
|
20057
|
-
|
|
20253
|
+
const handler = {
|
|
20058
20254
|
fulfilled,
|
|
20059
20255
|
rejected,
|
|
20060
20256
|
synchronous: options ? options.synchronous : false,
|
|
20061
20257
|
runWhen: options ? options.runWhen : null
|
|
20258
|
+
};
|
|
20259
|
+
const internals = this[$internals3];
|
|
20260
|
+
if (this.handlers == null) {
|
|
20261
|
+
this.handlers = [];
|
|
20262
|
+
}
|
|
20263
|
+
syncHandlerEntries2(this, internals);
|
|
20264
|
+
const id = internals.nextId++;
|
|
20265
|
+
this.handlers.push(handler);
|
|
20266
|
+
internals.handlerEntries.set(id, {
|
|
20267
|
+
handler,
|
|
20268
|
+
index: this.handlers.length - 1
|
|
20062
20269
|
});
|
|
20063
|
-
|
|
20270
|
+
internals.handlersLength = this.handlers.length;
|
|
20271
|
+
return id;
|
|
20064
20272
|
}
|
|
20065
20273
|
/**
|
|
20066
20274
|
* Remove an interceptor from the stack
|
|
@@ -20070,8 +20278,19 @@ var require_axios = __commonJS({
|
|
|
20070
20278
|
* @returns {void}
|
|
20071
20279
|
*/
|
|
20072
20280
|
eject(id) {
|
|
20073
|
-
|
|
20074
|
-
|
|
20281
|
+
const internals = this[$internals3];
|
|
20282
|
+
syncHandlerEntries2(this, internals);
|
|
20283
|
+
const entry = internals.handlerEntries.get(id);
|
|
20284
|
+
if (entry) {
|
|
20285
|
+
internals.handlerEntries.delete(id);
|
|
20286
|
+
if (this.handlers[entry.index] !== entry.handler) {
|
|
20287
|
+
return;
|
|
20288
|
+
}
|
|
20289
|
+
this.handlers[entry.index] = null;
|
|
20290
|
+
if (!internals.iterationDepth) {
|
|
20291
|
+
trimHandlers2(this.handlers);
|
|
20292
|
+
internals.handlersLength = this.handlers.length;
|
|
20293
|
+
}
|
|
20075
20294
|
}
|
|
20076
20295
|
}
|
|
20077
20296
|
/**
|
|
@@ -20082,6 +20301,7 @@ var require_axios = __commonJS({
|
|
|
20082
20301
|
clear() {
|
|
20083
20302
|
if (this.handlers) {
|
|
20084
20303
|
this.handlers = [];
|
|
20304
|
+
syncHandlerEntries2(this, this[$internals3]);
|
|
20085
20305
|
}
|
|
20086
20306
|
}
|
|
20087
20307
|
/**
|
|
@@ -20095,11 +20315,22 @@ var require_axios = __commonJS({
|
|
|
20095
20315
|
* @returns {void}
|
|
20096
20316
|
*/
|
|
20097
20317
|
forEach(fn) {
|
|
20098
|
-
|
|
20099
|
-
|
|
20100
|
-
|
|
20318
|
+
const internals = this[$internals3];
|
|
20319
|
+
syncHandlerEntries2(this, internals);
|
|
20320
|
+
internals.iterationDepth++;
|
|
20321
|
+
try {
|
|
20322
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
20323
|
+
if (h !== null) {
|
|
20324
|
+
fn(h);
|
|
20325
|
+
}
|
|
20326
|
+
});
|
|
20327
|
+
} finally {
|
|
20328
|
+
if (!--internals.iterationDepth) {
|
|
20329
|
+
syncHandlerEntries2(this, internals);
|
|
20330
|
+
trimHandlers2(this.handlers);
|
|
20331
|
+
internals.handlersLength = countHandlers2(this.handlers);
|
|
20101
20332
|
}
|
|
20102
|
-
}
|
|
20333
|
+
}
|
|
20103
20334
|
}
|
|
20104
20335
|
};
|
|
20105
20336
|
var transitionalDefaults = {
|
|
@@ -20235,6 +20466,7 @@ var require_axios = __commonJS({
|
|
|
20235
20466
|
}
|
|
20236
20467
|
return null;
|
|
20237
20468
|
}
|
|
20469
|
+
var methodList2 = Object.freeze(["get", "delete", "head", "options", "post", "put", "patch", "purge", "link", "unlink", "query"]);
|
|
20238
20470
|
var own2 = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0;
|
|
20239
20471
|
function stringifySafely3(rawValue, parser, encoder) {
|
|
20240
20472
|
if (utils$1.isString(rawValue)) {
|
|
@@ -20340,7 +20572,7 @@ var require_axios = __commonJS({
|
|
|
20340
20572
|
}
|
|
20341
20573
|
}
|
|
20342
20574
|
};
|
|
20343
|
-
utils$1.forEach(
|
|
20575
|
+
utils$1.forEach(methodList2, (method) => {
|
|
20344
20576
|
defaults2.headers[method] = {};
|
|
20345
20577
|
});
|
|
20346
20578
|
function transformData2(fns, response) {
|
|
@@ -20397,18 +20629,18 @@ var require_axios = __commonJS({
|
|
|
20397
20629
|
}
|
|
20398
20630
|
return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, "");
|
|
20399
20631
|
}
|
|
20400
|
-
var
|
|
20401
|
-
var httpProtocolControlCharacters2 = /[\t\n\r]/g;
|
|
20402
|
-
function stripLeadingC0ControlOrSpace2(url3) {
|
|
20403
|
-
let i = 0;
|
|
20404
|
-
while (i < url3.length && url3.charCodeAt(i) <= 32) {
|
|
20405
|
-
i++;
|
|
20406
|
-
}
|
|
20407
|
-
return url3.slice(i);
|
|
20408
|
-
}
|
|
20632
|
+
var urlParserControlCharacters2 = /[\t\n\r]/g;
|
|
20409
20633
|
function normalizeURLForProtocolCheck2(url3) {
|
|
20410
|
-
|
|
20634
|
+
if (typeof url3 !== "string") {
|
|
20635
|
+
return url3;
|
|
20636
|
+
}
|
|
20637
|
+
let start = 0;
|
|
20638
|
+
while (start < url3.length && url3.charCodeAt(start) <= 32) {
|
|
20639
|
+
start++;
|
|
20640
|
+
}
|
|
20641
|
+
return url3.slice(start).replace(urlParserControlCharacters2, "");
|
|
20411
20642
|
}
|
|
20643
|
+
var malformedHttpProtocol2 = /^https?:(?!\/\/)/i;
|
|
20412
20644
|
function redactFragment2(fragment) {
|
|
20413
20645
|
if (!fragment) {
|
|
20414
20646
|
return fragment;
|
|
@@ -20509,12 +20741,12 @@ var require_axios = __commonJS({
|
|
|
20509
20741
|
function getEnv2(key) {
|
|
20510
20742
|
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
20511
20743
|
}
|
|
20512
|
-
var VERSION3 = "1.
|
|
20744
|
+
var VERSION3 = "1.20.0";
|
|
20513
20745
|
function parseProtocol2(url3) {
|
|
20514
20746
|
const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url3);
|
|
20515
20747
|
return match && match[1] || "";
|
|
20516
20748
|
}
|
|
20517
|
-
var DATA_URL_PATTERN2 = /^([
|
|
20749
|
+
var DATA_URL_PATTERN2 = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
|
|
20518
20750
|
function fromDataURI2(uri, asBlob, options) {
|
|
20519
20751
|
const _Blob = options && options.Blob || platform.classes.Blob;
|
|
20520
20752
|
const protocol = parseProtocol2(uri);
|
|
@@ -20791,7 +21023,7 @@ var require_axios = __commonJS({
|
|
|
20791
21023
|
this.sessions = /* @__PURE__ */ Object.create(null);
|
|
20792
21024
|
}
|
|
20793
21025
|
getSession(authority, options) {
|
|
20794
|
-
options = Object.assign({
|
|
21026
|
+
options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
20795
21027
|
sessionTimeout: 1e3
|
|
20796
21028
|
}, options);
|
|
20797
21029
|
let authoritySessions = this.sessions[authority];
|
|
@@ -20856,6 +21088,7 @@ var require_axios = __commonJS({
|
|
|
20856
21088
|
};
|
|
20857
21089
|
}
|
|
20858
21090
|
session.once("close", removeSession);
|
|
21091
|
+
session.once("error", removeSession);
|
|
20859
21092
|
let entry = [session, options];
|
|
20860
21093
|
authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
|
|
20861
21094
|
return session;
|
|
@@ -20874,6 +21107,13 @@ var require_axios = __commonJS({
|
|
|
20874
21107
|
} : fn;
|
|
20875
21108
|
};
|
|
20876
21109
|
var LOOPBACK_HOSTNAMES2 = /* @__PURE__ */ new Set(["localhost", "0.0.0.0"]);
|
|
21110
|
+
var trimTrailingDots2 = (value) => {
|
|
21111
|
+
let end = value.length;
|
|
21112
|
+
while (end && value.charCodeAt(end - 1) === 46) {
|
|
21113
|
+
end--;
|
|
21114
|
+
}
|
|
21115
|
+
return end === value.length ? value : value.slice(0, end);
|
|
21116
|
+
};
|
|
20877
21117
|
var isIPv4Loopback2 = (host) => {
|
|
20878
21118
|
const parts = host.split(".");
|
|
20879
21119
|
if (parts.length !== 4) return false;
|
|
@@ -20906,7 +21146,7 @@ var require_axios = __commonJS({
|
|
|
20906
21146
|
if (h.charAt(0) === "[" && h.charAt(h.length - 1) === "]") {
|
|
20907
21147
|
h = h.slice(1, -1);
|
|
20908
21148
|
}
|
|
20909
|
-
h = h
|
|
21149
|
+
h = trimTrailingDots2(h);
|
|
20910
21150
|
if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host;
|
|
20911
21151
|
const parts = h.split(".");
|
|
20912
21152
|
if (parts.some((p) => p === "")) return host;
|
|
@@ -21018,6 +21258,40 @@ var require_axios = __commonJS({
|
|
|
21018
21258
|
}
|
|
21019
21259
|
return host;
|
|
21020
21260
|
};
|
|
21261
|
+
var IPV4_OCTET_RE2 = /^(?:0|[1-9]\d{0,2})$/;
|
|
21262
|
+
var ipv4ToBytes2 = (host) => {
|
|
21263
|
+
const parts = host.split(".");
|
|
21264
|
+
return parts.length === 4 && parts.every((part) => IPV4_OCTET_RE2.test(part) && Number(part) <= 255) ? parts.map(Number) : null;
|
|
21265
|
+
};
|
|
21266
|
+
var IPV6_GROUP_RE2 = /^[0-9a-f]{1,4}$/i;
|
|
21267
|
+
var ipv6ToBytes2 = (host) => {
|
|
21268
|
+
const halves = host.split("::");
|
|
21269
|
+
if (halves.length > 2) {
|
|
21270
|
+
return null;
|
|
21271
|
+
}
|
|
21272
|
+
const groups = halves[0] ? halves[0].split(":") : [];
|
|
21273
|
+
if (halves.length === 2) {
|
|
21274
|
+
const rear = halves[1] ? halves[1].split(":") : [];
|
|
21275
|
+
const missing = 8 - groups.length - rear.length;
|
|
21276
|
+
if (missing < 1) {
|
|
21277
|
+
return null;
|
|
21278
|
+
}
|
|
21279
|
+
groups.push(...new Array(missing).fill("0"), ...rear);
|
|
21280
|
+
}
|
|
21281
|
+
if (groups.length !== 8 || groups.some((group) => !IPV6_GROUP_RE2.test(group))) {
|
|
21282
|
+
return null;
|
|
21283
|
+
}
|
|
21284
|
+
return groups.flatMap((group) => {
|
|
21285
|
+
const value = Number.parseInt(group, 16);
|
|
21286
|
+
return [value >> 8 & 255, value & 255];
|
|
21287
|
+
});
|
|
21288
|
+
};
|
|
21289
|
+
var ipToBytes2 = (host) => {
|
|
21290
|
+
if (typeof host !== "string" || !host) {
|
|
21291
|
+
return null;
|
|
21292
|
+
}
|
|
21293
|
+
return host.indexOf(":") !== -1 ? ipv6ToBytes2(host) : ipv4ToBytes2(host);
|
|
21294
|
+
};
|
|
21021
21295
|
var normalizeNoProxyHost2 = (hostname) => {
|
|
21022
21296
|
if (!hostname) {
|
|
21023
21297
|
return hostname;
|
|
@@ -21025,13 +21299,99 @@ var require_axios = __commonJS({
|
|
|
21025
21299
|
if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
|
|
21026
21300
|
hostname = hostname.slice(1, -1);
|
|
21027
21301
|
}
|
|
21028
|
-
const trimmed = hostname
|
|
21302
|
+
const trimmed = trimTrailingDots2(hostname);
|
|
21029
21303
|
const ipv4 = normalizeIPAddress2(trimmed);
|
|
21030
21304
|
if (ipv4 !== trimmed) {
|
|
21031
21305
|
return ipv4;
|
|
21032
21306
|
}
|
|
21033
21307
|
return unmapIPv4MappedIPv62(trimmed);
|
|
21034
21308
|
};
|
|
21309
|
+
var normalizeCidrBase2 = (input) => {
|
|
21310
|
+
let base = input;
|
|
21311
|
+
const startsBracket = base.charAt(0) === "[";
|
|
21312
|
+
const endsBracket = base.charAt(base.length - 1) === "]";
|
|
21313
|
+
const hasBracket = base.includes("[") || base.includes("]");
|
|
21314
|
+
if (startsBracket || endsBracket) {
|
|
21315
|
+
if (!startsBracket || !endsBracket) {
|
|
21316
|
+
return null;
|
|
21317
|
+
}
|
|
21318
|
+
base = base.slice(1, -1);
|
|
21319
|
+
if (base.indexOf(":") === -1 || base.includes("[") || base.includes("]")) {
|
|
21320
|
+
return null;
|
|
21321
|
+
}
|
|
21322
|
+
} else if (hasBracket) {
|
|
21323
|
+
return null;
|
|
21324
|
+
}
|
|
21325
|
+
if (!base || base.charAt(base.length - 1) === ".") {
|
|
21326
|
+
return null;
|
|
21327
|
+
}
|
|
21328
|
+
const wasIPv6 = base.indexOf(":") !== -1;
|
|
21329
|
+
if (wasIPv6) {
|
|
21330
|
+
try {
|
|
21331
|
+
base = new URL(`http://[${base}]/`).hostname.slice(1, -1);
|
|
21332
|
+
} catch (_err) {
|
|
21333
|
+
return null;
|
|
21334
|
+
}
|
|
21335
|
+
} else {
|
|
21336
|
+
base = normalizeIPAddress2(base);
|
|
21337
|
+
if (!ipv4ToBytes2(base)) {
|
|
21338
|
+
return null;
|
|
21339
|
+
}
|
|
21340
|
+
}
|
|
21341
|
+
return {
|
|
21342
|
+
normalized: unmapIPv4MappedIPv62(base),
|
|
21343
|
+
wasIPv6
|
|
21344
|
+
};
|
|
21345
|
+
};
|
|
21346
|
+
var CIDR_ENTRY_RE2 = /^(.+)\/(0|[1-9]\d{0,2})$/;
|
|
21347
|
+
var parseCidrEntry2 = (entry) => {
|
|
21348
|
+
if (entry.indexOf("/") === -1) {
|
|
21349
|
+
return void 0;
|
|
21350
|
+
}
|
|
21351
|
+
const match = CIDR_ENTRY_RE2.exec(entry);
|
|
21352
|
+
if (!match) {
|
|
21353
|
+
return null;
|
|
21354
|
+
}
|
|
21355
|
+
let prefix = Number(match[2]);
|
|
21356
|
+
const parsedBase = normalizeCidrBase2(match[1]);
|
|
21357
|
+
if (!parsedBase) {
|
|
21358
|
+
return null;
|
|
21359
|
+
}
|
|
21360
|
+
const {
|
|
21361
|
+
normalized,
|
|
21362
|
+
wasIPv6
|
|
21363
|
+
} = parsedBase;
|
|
21364
|
+
if (wasIPv6 && normalized.indexOf(":") === -1) {
|
|
21365
|
+
if (prefix < 96) {
|
|
21366
|
+
return null;
|
|
21367
|
+
}
|
|
21368
|
+
prefix -= 96;
|
|
21369
|
+
}
|
|
21370
|
+
const bytes = ipToBytes2(normalized);
|
|
21371
|
+
if (!bytes || prefix > bytes.length * 8) {
|
|
21372
|
+
return null;
|
|
21373
|
+
}
|
|
21374
|
+
return {
|
|
21375
|
+
bytes,
|
|
21376
|
+
prefix
|
|
21377
|
+
};
|
|
21378
|
+
};
|
|
21379
|
+
var isInSubnet2 = (addressBytes, networkBytes, prefix) => {
|
|
21380
|
+
const fullBytes = prefix >> 3;
|
|
21381
|
+
for (let i = 0; i < fullBytes; i++) {
|
|
21382
|
+
if (addressBytes[i] !== networkBytes[i]) {
|
|
21383
|
+
return false;
|
|
21384
|
+
}
|
|
21385
|
+
}
|
|
21386
|
+
const remainingBits = prefix & 7;
|
|
21387
|
+
if (remainingBits) {
|
|
21388
|
+
const mask = 255 << 8 - remainingBits & 255;
|
|
21389
|
+
if ((addressBytes[fullBytes] & mask) !== (networkBytes[fullBytes] & mask)) {
|
|
21390
|
+
return false;
|
|
21391
|
+
}
|
|
21392
|
+
}
|
|
21393
|
+
return true;
|
|
21394
|
+
};
|
|
21035
21395
|
function shouldBypassProxy2(location) {
|
|
21036
21396
|
let parsed;
|
|
21037
21397
|
try {
|
|
@@ -21048,6 +21408,7 @@ var require_axios = __commonJS({
|
|
|
21048
21408
|
}
|
|
21049
21409
|
const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS3[parsed.protocol.split(":", 1)[0]] || 0;
|
|
21050
21410
|
const hostname = normalizeNoProxyHost2(parsed.hostname.toLowerCase());
|
|
21411
|
+
const hostnameBytes = ipToBytes2(hostname);
|
|
21051
21412
|
return noProxy.split(/[\s,]+/).some((entry) => {
|
|
21052
21413
|
if (!entry) {
|
|
21053
21414
|
return false;
|
|
@@ -21055,6 +21416,10 @@ var require_axios = __commonJS({
|
|
|
21055
21416
|
if (entry === "*") {
|
|
21056
21417
|
return true;
|
|
21057
21418
|
}
|
|
21419
|
+
const cidr = parseCidrEntry2(entry);
|
|
21420
|
+
if (cidr !== void 0) {
|
|
21421
|
+
return cidr !== null && !!hostnameBytes && hostnameBytes.length === cidr.bytes.length && isInSubnet2(hostnameBytes, cidr.bytes, cidr.prefix);
|
|
21422
|
+
}
|
|
21058
21423
|
let [entryHost, entryPort] = parseNoProxyEntry2(entry);
|
|
21059
21424
|
entryHost = normalizeNoProxyHost2(entryHost);
|
|
21060
21425
|
if (!entryHost) {
|
|
@@ -21135,13 +21500,14 @@ var require_axios = __commonJS({
|
|
|
21135
21500
|
}
|
|
21136
21501
|
};
|
|
21137
21502
|
const flush = () => lastArgs && invoke(lastArgs);
|
|
21138
|
-
|
|
21503
|
+
const flushWith = (...args) => invoke(args);
|
|
21504
|
+
return [throttled, flush, flushWith];
|
|
21139
21505
|
}
|
|
21140
21506
|
var progressEventReducer2 = (listener, isDownloadStream, freq = 3) => {
|
|
21141
21507
|
let bytesNotified = 0;
|
|
21142
21508
|
const _speedometer = speedometer2(50, 250);
|
|
21143
21509
|
return throttle2((e) => {
|
|
21144
|
-
if (!e ||
|
|
21510
|
+
if (!e || !utils$1.isNumber(e.loaded)) {
|
|
21145
21511
|
return;
|
|
21146
21512
|
}
|
|
21147
21513
|
const rawLoaded = e.loaded;
|
|
@@ -21295,6 +21661,12 @@ var require_axios = __commonJS({
|
|
|
21295
21661
|
var isHttps2 = /https:?/;
|
|
21296
21662
|
var kAxiosSocketListener2 = Symbol("axios.http.socketListener");
|
|
21297
21663
|
var kAxiosCurrentReq2 = Symbol("axios.http.currentReq");
|
|
21664
|
+
function handleSocketError2(err) {
|
|
21665
|
+
const current = this[kAxiosCurrentReq2];
|
|
21666
|
+
if (current && !current.destroyed) {
|
|
21667
|
+
current.destroy(err);
|
|
21668
|
+
}
|
|
21669
|
+
}
|
|
21298
21670
|
var kAxiosInstalledTunnel2 = Symbol("axios.http.installedTunnel");
|
|
21299
21671
|
var tunnelingAgentCache2 = /* @__PURE__ */ new Map();
|
|
21300
21672
|
var tunnelingAgentCacheUser2 = /* @__PURE__ */ new WeakMap();
|
|
@@ -21403,10 +21775,10 @@ var require_axios = __commonJS({
|
|
|
21403
21775
|
return false;
|
|
21404
21776
|
}
|
|
21405
21777
|
}
|
|
21406
|
-
function setProxy2(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
|
|
21778
|
+
function setProxy2(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent, allowEnvProxy = true) {
|
|
21407
21779
|
let proxy = configProxy;
|
|
21408
21780
|
const proxyEnvAgent = getProxyEnvAgent2(options, configHttpAgent, configHttpsAgent);
|
|
21409
|
-
if (!proxy && proxy !== false && !isNodeEnvProxyEnabled2(proxyEnvAgent)) {
|
|
21781
|
+
if (!proxy && proxy !== false && allowEnvProxy && !isNodeEnvProxyEnabled2(proxyEnvAgent)) {
|
|
21410
21782
|
const proxyUrl = getProxyForUrl2(location);
|
|
21411
21783
|
if (proxyUrl) {
|
|
21412
21784
|
if (!shouldBypassProxy2(location)) {
|
|
@@ -21497,8 +21869,9 @@ var require_axios = __commonJS({
|
|
|
21497
21869
|
}
|
|
21498
21870
|
}
|
|
21499
21871
|
options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
|
|
21500
|
-
setProxy2(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);
|
|
21872
|
+
setProxy2(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent, allowEnvProxy);
|
|
21501
21873
|
};
|
|
21874
|
+
return Boolean(proxy || configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled2(proxyEnvAgent));
|
|
21502
21875
|
}
|
|
21503
21876
|
var isHttpAdapterSupported2 = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
|
|
21504
21877
|
var wrapAsync2 = (asyncExecutor) => {
|
|
@@ -21526,7 +21899,7 @@ var require_axios = __commonJS({
|
|
|
21526
21899
|
family
|
|
21527
21900
|
}) => {
|
|
21528
21901
|
if (!utils$1.isString(address)) {
|
|
21529
|
-
throw
|
|
21902
|
+
throw new AxiosError3("address must be a string", AxiosError3.ERR_BAD_OPTION_VALUE);
|
|
21530
21903
|
}
|
|
21531
21904
|
return {
|
|
21532
21905
|
address,
|
|
@@ -21537,6 +21910,30 @@ var require_axios = __commonJS({
|
|
|
21537
21910
|
address,
|
|
21538
21911
|
family
|
|
21539
21912
|
});
|
|
21913
|
+
var normalizedLookupCache2 = /* @__PURE__ */ new WeakMap();
|
|
21914
|
+
var normalizeLookup2 = (lookup) => {
|
|
21915
|
+
let normalized = normalizedLookupCache2.get(lookup);
|
|
21916
|
+
if (normalized) {
|
|
21917
|
+
return normalized;
|
|
21918
|
+
}
|
|
21919
|
+
const callbackLookup = callbackify2(lookup, (value) => utils$1.isArray(value) ? value : [value]);
|
|
21920
|
+
normalized = (hostname, opt, cb) => {
|
|
21921
|
+
callbackLookup(hostname, opt, (err, arg0, arg1) => {
|
|
21922
|
+
if (err) {
|
|
21923
|
+
return cb(err);
|
|
21924
|
+
}
|
|
21925
|
+
let addresses;
|
|
21926
|
+
try {
|
|
21927
|
+
addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry2(addr)) : [buildAddressEntry2(arg0, arg1)];
|
|
21928
|
+
} catch (error) {
|
|
21929
|
+
return cb(error);
|
|
21930
|
+
}
|
|
21931
|
+
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
21932
|
+
});
|
|
21933
|
+
};
|
|
21934
|
+
normalizedLookupCache2.set(lookup, normalized);
|
|
21935
|
+
return normalized;
|
|
21936
|
+
};
|
|
21540
21937
|
var http2Transport2 = {
|
|
21541
21938
|
request(options, cb) {
|
|
21542
21939
|
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
|
|
@@ -21581,6 +21978,7 @@ var require_axios = __commonJS({
|
|
|
21581
21978
|
let family = own3("family");
|
|
21582
21979
|
let httpVersion = own3("httpVersion");
|
|
21583
21980
|
if (httpVersion === void 0) httpVersion = 1;
|
|
21981
|
+
const rawHttpVersion = httpVersion;
|
|
21584
21982
|
let http2Options = own3("http2Options");
|
|
21585
21983
|
const httpAgent = own3("httpAgent");
|
|
21586
21984
|
const httpsAgent = own3("httpsAgent");
|
|
@@ -21597,25 +21995,20 @@ var require_axios = __commonJS({
|
|
|
21597
21995
|
let rejected = false;
|
|
21598
21996
|
let req;
|
|
21599
21997
|
let connectPhaseTimer;
|
|
21600
|
-
|
|
21998
|
+
try {
|
|
21999
|
+
httpVersion = +httpVersion;
|
|
22000
|
+
} catch (err) {
|
|
22001
|
+
throw new AxiosError3("Invalid protocol version: value is not a number", AxiosError3.ERR_BAD_OPTION_VALUE, config);
|
|
22002
|
+
}
|
|
21601
22003
|
if (Number.isNaN(httpVersion)) {
|
|
21602
|
-
throw
|
|
22004
|
+
throw new AxiosError3(`Invalid protocol version: '${rawHttpVersion}' is not a number`, AxiosError3.ERR_BAD_OPTION_VALUE, config);
|
|
21603
22005
|
}
|
|
21604
22006
|
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
21605
|
-
throw
|
|
22007
|
+
throw new AxiosError3(`Unsupported protocol version '${httpVersion}'`, AxiosError3.ERR_BAD_OPTION_VALUE, config);
|
|
21606
22008
|
}
|
|
21607
22009
|
const isHttp2 = httpVersion === 2;
|
|
21608
22010
|
if (lookup) {
|
|
21609
|
-
|
|
21610
|
-
lookup = (hostname, opt, cb) => {
|
|
21611
|
-
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
21612
|
-
if (err) {
|
|
21613
|
-
return cb(err);
|
|
21614
|
-
}
|
|
21615
|
-
const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry2(addr)) : [buildAddressEntry2(arg0, arg1)];
|
|
21616
|
-
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
21617
|
-
});
|
|
21618
|
-
};
|
|
22011
|
+
lookup = normalizeLookup2(lookup);
|
|
21619
22012
|
}
|
|
21620
22013
|
const abortEmitter = new events.EventEmitter();
|
|
21621
22014
|
function abort(reason) {
|
|
@@ -21808,6 +22201,11 @@ var require_axios = __commonJS({
|
|
|
21808
22201
|
}));
|
|
21809
22202
|
}
|
|
21810
22203
|
headers.set("Accept-Encoding", utils$1.hasOwnProp(transitional2, "advertiseZstdAcceptEncoding") && transitional2.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD2 : ACCEPT_ENCODING2, false);
|
|
22204
|
+
if (isHttp2 && lookup) {
|
|
22205
|
+
http2Options = Object.assign(/* @__PURE__ */ Object.create(null), http2Options, {
|
|
22206
|
+
lookup
|
|
22207
|
+
});
|
|
22208
|
+
}
|
|
21811
22209
|
const options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
21812
22210
|
path: path$1,
|
|
21813
22211
|
method,
|
|
@@ -21821,9 +22219,11 @@ var require_axios = __commonJS({
|
|
|
21821
22219
|
family,
|
|
21822
22220
|
beforeRedirect: dispatchBeforeRedirect2,
|
|
21823
22221
|
beforeRedirects: /* @__PURE__ */ Object.create(null),
|
|
21824
|
-
http2Options
|
|
22222
|
+
http2Options,
|
|
22223
|
+
createConnection: void 0
|
|
21825
22224
|
});
|
|
21826
22225
|
!utils$1.isUndefined(lookup) && (options.lookup = lookup);
|
|
22226
|
+
let proxyApplied = false;
|
|
21827
22227
|
if (socketPath) {
|
|
21828
22228
|
if (typeof socketPath !== "string") {
|
|
21829
22229
|
return reject(new AxiosError3("socketPath must be a string", AxiosError3.ERR_BAD_OPTION_VALUE, config));
|
|
@@ -21841,7 +22241,18 @@ var require_axios = __commonJS({
|
|
|
21841
22241
|
} else {
|
|
21842
22242
|
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
21843
22243
|
options.port = parsed.port;
|
|
21844
|
-
|
|
22244
|
+
proxyApplied = setProxy2(
|
|
22245
|
+
options,
|
|
22246
|
+
configProxy,
|
|
22247
|
+
protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path,
|
|
22248
|
+
false,
|
|
22249
|
+
httpsAgent,
|
|
22250
|
+
httpAgent,
|
|
22251
|
+
// The HTTP/2 transport connects independently of HTTP/1 agents, so it
|
|
22252
|
+
// cannot apply either axios-resolved or agent-local environment proxies.
|
|
22253
|
+
// Explicit proxy config is still processed and rejected below.
|
|
22254
|
+
!isHttp2
|
|
22255
|
+
);
|
|
21845
22256
|
}
|
|
21846
22257
|
let transport;
|
|
21847
22258
|
let isNativeTransport = false;
|
|
@@ -21851,6 +22262,9 @@ var require_axios = __commonJS({
|
|
|
21851
22262
|
options.agent = isHttpsRequest ? httpsAgent : httpAgent;
|
|
21852
22263
|
}
|
|
21853
22264
|
if (isHttp2) {
|
|
22265
|
+
if (proxyApplied) {
|
|
22266
|
+
return reject(new AxiosError3("HTTP/2 requests with a proxy are not supported", AxiosError3.ERR_NOT_SUPPORT, config));
|
|
22267
|
+
}
|
|
21854
22268
|
transport = http2Transport2;
|
|
21855
22269
|
} else {
|
|
21856
22270
|
const configTransport = own3("transport");
|
|
@@ -22048,12 +22462,7 @@ var require_axios = __commonJS({
|
|
|
22048
22462
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
22049
22463
|
}
|
|
22050
22464
|
if (!socket[kAxiosSocketListener2]) {
|
|
22051
|
-
socket.on("error",
|
|
22052
|
-
const current = socket[kAxiosCurrentReq2];
|
|
22053
|
-
if (current && !current.destroyed) {
|
|
22054
|
-
current.destroy(err);
|
|
22055
|
-
}
|
|
22056
|
-
});
|
|
22465
|
+
socket.on("error", handleSocketError2);
|
|
22057
22466
|
socket[kAxiosSocketListener2] = true;
|
|
22058
22467
|
}
|
|
22059
22468
|
socket[kAxiosCurrentReq2] = req;
|
|
@@ -22269,7 +22678,7 @@ var require_axios = __commonJS({
|
|
|
22269
22678
|
transformResponse: defaultToConfig2,
|
|
22270
22679
|
paramsSerializer: defaultToConfig2,
|
|
22271
22680
|
timeout: defaultToConfig2,
|
|
22272
|
-
|
|
22681
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
22273
22682
|
withCredentials: defaultToConfig2,
|
|
22274
22683
|
withXSRFToken: defaultToConfig2,
|
|
22275
22684
|
adapter: defaultToConfig2,
|
|
@@ -22337,10 +22746,11 @@ var require_axios = __commonJS({
|
|
|
22337
22746
|
}
|
|
22338
22747
|
}
|
|
22339
22748
|
if (utils$1.isFormData(data)) {
|
|
22749
|
+
const getHeaders = utils$1.getSafeProp(data, "getHeaders");
|
|
22340
22750
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
|
|
22341
22751
|
headers.setContentType(void 0);
|
|
22342
|
-
} else if (utils$1.isFunction(
|
|
22343
|
-
setFormDataHeaders2(headers,
|
|
22752
|
+
} else if (utils$1.isFunction(getHeaders)) {
|
|
22753
|
+
setFormDataHeaders2(headers, getHeaders.call(data), own3("formDataHeaderPolicy"));
|
|
22344
22754
|
}
|
|
22345
22755
|
}
|
|
22346
22756
|
if (platform.hasStandardBrowserEnv) {
|
|
@@ -22370,7 +22780,7 @@ var require_axios = __commonJS({
|
|
|
22370
22780
|
} = _config;
|
|
22371
22781
|
let onCanceled;
|
|
22372
22782
|
let uploadThrottled, downloadThrottled;
|
|
22373
|
-
let flushUpload, flushDownload;
|
|
22783
|
+
let flushUpload, flushDownload, flushDownloadWithEvent;
|
|
22374
22784
|
function done() {
|
|
22375
22785
|
flushUpload && flushUpload();
|
|
22376
22786
|
flushDownload && flushDownload();
|
|
@@ -22380,7 +22790,27 @@ var require_axios = __commonJS({
|
|
|
22380
22790
|
let request = new XMLHttpRequest();
|
|
22381
22791
|
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
22382
22792
|
request.timeout = _config.timeout;
|
|
22383
|
-
function onloadend() {
|
|
22793
|
+
function onloadend(event) {
|
|
22794
|
+
if (!request) {
|
|
22795
|
+
return;
|
|
22796
|
+
}
|
|
22797
|
+
if (request.status === 0 && (parseProtocol2(normalizeURLForProtocolCheck2(_config.url)) || parseProtocol2(platform.origin)) !== "file" && !(request.responseURL && request.responseURL.startsWith("file:"))) {
|
|
22798
|
+
reject(new AxiosError3("Request aborted", AxiosError3.ECONNABORTED, config, request));
|
|
22799
|
+
done();
|
|
22800
|
+
request = null;
|
|
22801
|
+
return;
|
|
22802
|
+
}
|
|
22803
|
+
try {
|
|
22804
|
+
if (event) {
|
|
22805
|
+
flushDownloadWithEvent && flushDownloadWithEvent(event);
|
|
22806
|
+
} else {
|
|
22807
|
+
flushDownload && flushDownload();
|
|
22808
|
+
}
|
|
22809
|
+
} catch (err) {
|
|
22810
|
+
setTimeout(() => {
|
|
22811
|
+
throw err;
|
|
22812
|
+
});
|
|
22813
|
+
}
|
|
22384
22814
|
if (!request) {
|
|
22385
22815
|
return;
|
|
22386
22816
|
}
|
|
@@ -22455,7 +22885,7 @@ var require_axios = __commonJS({
|
|
|
22455
22885
|
request.responseType = _config.responseType;
|
|
22456
22886
|
}
|
|
22457
22887
|
if (onDownloadProgress) {
|
|
22458
|
-
[downloadThrottled, flushDownload] = progressEventReducer2(onDownloadProgress, true);
|
|
22888
|
+
[downloadThrottled, flushDownload, flushDownloadWithEvent] = progressEventReducer2(onDownloadProgress, true);
|
|
22459
22889
|
request.addEventListener("progress", downloadThrottled);
|
|
22460
22890
|
}
|
|
22461
22891
|
if (onUploadProgress && request.upload) {
|
|
@@ -22617,6 +23047,17 @@ var require_axios = __commonJS({
|
|
|
22617
23047
|
});
|
|
22618
23048
|
};
|
|
22619
23049
|
var DEFAULT_CHUNK_SIZE2 = 64 * 1024;
|
|
23050
|
+
var DEFAULT_REQUEST_OPTIONS2 = {
|
|
23051
|
+
cache: "default",
|
|
23052
|
+
redirect: "follow",
|
|
23053
|
+
referrer: "about:client",
|
|
23054
|
+
referrerPolicy: "",
|
|
23055
|
+
mode: "cors",
|
|
23056
|
+
integrity: "",
|
|
23057
|
+
keepalive: false,
|
|
23058
|
+
priority: "auto",
|
|
23059
|
+
window: null
|
|
23060
|
+
};
|
|
22620
23061
|
var {
|
|
22621
23062
|
isFunction: isFunction3
|
|
22622
23063
|
} = utils$1;
|
|
@@ -22745,7 +23186,8 @@ var require_axios = __commonJS({
|
|
|
22745
23186
|
withCredentials = "same-origin",
|
|
22746
23187
|
fetchOptions,
|
|
22747
23188
|
maxContentLength,
|
|
22748
|
-
maxBodyLength
|
|
23189
|
+
maxBodyLength,
|
|
23190
|
+
maxRedirects
|
|
22749
23191
|
} = resolveConfig2(config);
|
|
22750
23192
|
const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
|
|
22751
23193
|
const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
@@ -22846,17 +23288,44 @@ var require_axios = __commonJS({
|
|
|
22846
23288
|
}
|
|
22847
23289
|
}
|
|
22848
23290
|
headers.set("User-Agent", "axios/" + VERSION3, false);
|
|
22849
|
-
const
|
|
22850
|
-
|
|
23291
|
+
const safeFetchOptions = fetchOptions == null ? fetchOptions : Object.assign(/* @__PURE__ */ Object.create(null), fetchOptions);
|
|
23292
|
+
if (safeFetchOptions) {
|
|
23293
|
+
delete safeFetchOptions.body;
|
|
23294
|
+
delete safeFetchOptions.headers;
|
|
23295
|
+
delete safeFetchOptions.method;
|
|
23296
|
+
delete safeFetchOptions.signal;
|
|
23297
|
+
delete safeFetchOptions.duplex;
|
|
23298
|
+
delete safeFetchOptions.credentials;
|
|
23299
|
+
}
|
|
23300
|
+
const resolvedOptions = Object.assign(/* @__PURE__ */ Object.create(null), safeFetchOptions, {
|
|
22851
23301
|
signal: composedSignal,
|
|
22852
23302
|
method: method.toUpperCase(),
|
|
22853
23303
|
headers: toByteStringHeaderObject2(headers.normalize()),
|
|
22854
23304
|
body: data,
|
|
22855
23305
|
duplex: "half",
|
|
22856
23306
|
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
22857
|
-
};
|
|
23307
|
+
});
|
|
23308
|
+
if (isRequestSupported) {
|
|
23309
|
+
utils$1.forEach(DEFAULT_REQUEST_OPTIONS2, (value, key) => {
|
|
23310
|
+
if (resolvedOptions[key] === void 0) {
|
|
23311
|
+
resolvedOptions[key] = value;
|
|
23312
|
+
}
|
|
23313
|
+
});
|
|
23314
|
+
if (resolvedOptions.signal === void 0) {
|
|
23315
|
+
resolvedOptions.signal = null;
|
|
23316
|
+
}
|
|
23317
|
+
if (resolvedOptions.body === void 0) {
|
|
23318
|
+
resolvedOptions.body = null;
|
|
23319
|
+
}
|
|
23320
|
+
}
|
|
23321
|
+
if (maxRedirects === 0) {
|
|
23322
|
+
resolvedOptions.redirect = "manual";
|
|
23323
|
+
if (safeFetchOptions) {
|
|
23324
|
+
safeFetchOptions.redirect = "manual";
|
|
23325
|
+
}
|
|
23326
|
+
}
|
|
22858
23327
|
request = isRequestSupported && new Request(url3, resolvedOptions);
|
|
22859
|
-
let response = await (isRequestSupported ? _fetch(request,
|
|
23328
|
+
let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url3, resolvedOptions));
|
|
22860
23329
|
const responseHeaders = AxiosHeaders3.from(response.headers);
|
|
22861
23330
|
if (hasMaxContentLength) {
|
|
22862
23331
|
const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
|
|
@@ -23048,9 +23517,10 @@ var require_axios = __commonJS({
|
|
|
23048
23517
|
throw new CanceledError3(null, config);
|
|
23049
23518
|
}
|
|
23050
23519
|
}
|
|
23051
|
-
function dispatchRequest2(
|
|
23520
|
+
function dispatchRequest2(_config) {
|
|
23521
|
+
const config = utils$1.toSafeFlatObject(_config);
|
|
23052
23522
|
throwIfCancellationRequested2(config);
|
|
23053
|
-
config.headers = AxiosHeaders3.from(config
|
|
23523
|
+
config.headers = AxiosHeaders3.from(utils$1.getSafeProp(config, "headers"));
|
|
23054
23524
|
config.data = transformData2.call(config, config.transformRequest);
|
|
23055
23525
|
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
23056
23526
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
@@ -23158,16 +23628,15 @@ var require_axios = __commonJS({
|
|
|
23158
23628
|
return await this._request(configOrUrl, config);
|
|
23159
23629
|
} catch (err) {
|
|
23160
23630
|
if (err instanceof Error) {
|
|
23161
|
-
let dummy = {};
|
|
23162
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
23163
|
-
const stack = (() => {
|
|
23164
|
-
if (!dummy.stack) {
|
|
23165
|
-
return "";
|
|
23166
|
-
}
|
|
23167
|
-
const firstNewlineIndex = dummy.stack.indexOf("\n");
|
|
23168
|
-
return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
|
|
23169
|
-
})();
|
|
23170
23631
|
try {
|
|
23632
|
+
let dummy = {};
|
|
23633
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
23634
|
+
const dummyStack = dummy.stack;
|
|
23635
|
+
let stack = "";
|
|
23636
|
+
if (typeof dummyStack === "string") {
|
|
23637
|
+
const firstNewlineIndex = dummyStack.indexOf("\n");
|
|
23638
|
+
stack = firstNewlineIndex === -1 ? "" : dummyStack.slice(firstNewlineIndex + 1);
|
|
23639
|
+
}
|
|
23171
23640
|
if (!err.stack) {
|
|
23172
23641
|
err.stack = stack;
|
|
23173
23642
|
} else if (stack) {
|
|
@@ -23229,9 +23698,9 @@ var require_axios = __commonJS({
|
|
|
23229
23698
|
baseUrl: validators3.spelling("baseURL"),
|
|
23230
23699
|
withXsrfToken: validators3.spelling("withXSRFToken")
|
|
23231
23700
|
}, true);
|
|
23232
|
-
config.method = (config
|
|
23701
|
+
config.method = (utils$1.getSafeProp(config, "method") || utils$1.getSafeProp(this.defaults, "method") || "get").toLowerCase();
|
|
23233
23702
|
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
23234
|
-
headers && utils$1.forEach(
|
|
23703
|
+
headers && utils$1.forEach(methodList2.concat("common"), (method) => {
|
|
23235
23704
|
delete headers[method];
|
|
23236
23705
|
});
|
|
23237
23706
|
config.headers = AxiosHeaders3.concat(contextHeaders, headers);
|
|
@@ -23478,14 +23947,22 @@ var require_axios = __commonJS({
|
|
|
23478
23947
|
Gone: 410,
|
|
23479
23948
|
LengthRequired: 411,
|
|
23480
23949
|
PreconditionFailed: 412,
|
|
23950
|
+
/**
|
|
23951
|
+
* @deprecated Use `ContentTooLarge` instead.
|
|
23952
|
+
*/
|
|
23481
23953
|
PayloadTooLarge: 413,
|
|
23954
|
+
ContentTooLarge: 413,
|
|
23482
23955
|
UriTooLong: 414,
|
|
23483
23956
|
UnsupportedMediaType: 415,
|
|
23484
23957
|
RangeNotSatisfiable: 416,
|
|
23485
23958
|
ExpectationFailed: 417,
|
|
23486
23959
|
ImATeapot: 418,
|
|
23487
23960
|
MisdirectedRequest: 421,
|
|
23961
|
+
/**
|
|
23962
|
+
* @deprecated Use `UnprocessableContent` instead.
|
|
23963
|
+
*/
|
|
23488
23964
|
UnprocessableEntity: 422,
|
|
23965
|
+
UnprocessableContent: 422,
|
|
23489
23966
|
Locked: 423,
|
|
23490
23967
|
FailedDependency: 424,
|
|
23491
23968
|
TooEarly: 425,
|
|
@@ -23514,7 +23991,9 @@ var require_axios = __commonJS({
|
|
|
23514
23991
|
InvalidSslCertificate: 526
|
|
23515
23992
|
};
|
|
23516
23993
|
Object.entries(HttpStatusCode3).forEach(([key, value]) => {
|
|
23517
|
-
HttpStatusCode3[value]
|
|
23994
|
+
if (HttpStatusCode3[value] === void 0) {
|
|
23995
|
+
HttpStatusCode3[value] = key;
|
|
23996
|
+
}
|
|
23518
23997
|
});
|
|
23519
23998
|
function createInstance2(defaultConfig) {
|
|
23520
23999
|
const context = new Axios3(defaultConfig);
|
|
@@ -45673,22 +46152,82 @@ var { toString } = Object.prototype;
|
|
|
45673
46152
|
var { getPrototypeOf } = Object;
|
|
45674
46153
|
var { iterator, toStringTag } = Symbol;
|
|
45675
46154
|
var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
46155
|
+
var isUnsafeObjectKey = (prop) => typeof prop === "string" && (prop === "__proto__" || prop === "constructor" || prop === "prototype");
|
|
46156
|
+
var isPrototypeBoundary = (obj, prototype2, source) => obj === Object.prototype || !source && prototype2 === null;
|
|
46157
|
+
var isSafeAndFullyMutable = (obj) => {
|
|
46158
|
+
if (!Object.isExtensible(obj)) {
|
|
46159
|
+
return false;
|
|
46160
|
+
}
|
|
46161
|
+
const props = Object.getOwnPropertyNames(obj);
|
|
46162
|
+
if (Object.getOwnPropertySymbols) {
|
|
46163
|
+
props.push(...Object.getOwnPropertySymbols(obj));
|
|
46164
|
+
}
|
|
46165
|
+
return props.every((prop) => {
|
|
46166
|
+
if (isUnsafeObjectKey(prop)) {
|
|
46167
|
+
return false;
|
|
46168
|
+
}
|
|
46169
|
+
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
46170
|
+
return !!descriptor && descriptor.configurable && descriptor.writable === true;
|
|
46171
|
+
});
|
|
46172
|
+
};
|
|
45676
46173
|
var hasOwnInPrototypeChain = (thing, prop) => {
|
|
45677
46174
|
let obj = thing;
|
|
45678
46175
|
const seen = [];
|
|
45679
|
-
while (obj != null
|
|
46176
|
+
while (obj != null) {
|
|
45680
46177
|
if (seen.indexOf(obj) !== -1) {
|
|
45681
46178
|
return false;
|
|
45682
46179
|
}
|
|
45683
46180
|
seen.push(obj);
|
|
46181
|
+
const prototype2 = getPrototypeOf(obj);
|
|
46182
|
+
if (isPrototypeBoundary(obj, prototype2, obj === thing)) {
|
|
46183
|
+
return false;
|
|
46184
|
+
}
|
|
45684
46185
|
if (hasOwnProperty(obj, prop)) {
|
|
45685
46186
|
return true;
|
|
45686
46187
|
}
|
|
45687
|
-
obj =
|
|
46188
|
+
obj = prototype2;
|
|
45688
46189
|
}
|
|
45689
46190
|
return false;
|
|
45690
46191
|
};
|
|
45691
46192
|
var getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0;
|
|
46193
|
+
var toSafeFlatObject = (thing) => {
|
|
46194
|
+
if (thing == null || typeof thing !== "object" && typeof thing !== "function") {
|
|
46195
|
+
return thing;
|
|
46196
|
+
}
|
|
46197
|
+
const sourcePrototype = getPrototypeOf(thing);
|
|
46198
|
+
if (sourcePrototype === null && isSafeAndFullyMutable(thing)) {
|
|
46199
|
+
return thing;
|
|
46200
|
+
}
|
|
46201
|
+
const result = /* @__PURE__ */ Object.create(null);
|
|
46202
|
+
const merged = /* @__PURE__ */ Object.create(null);
|
|
46203
|
+
const seen = [];
|
|
46204
|
+
let current = thing;
|
|
46205
|
+
while (current != null) {
|
|
46206
|
+
if (seen.indexOf(current) !== -1) {
|
|
46207
|
+
break;
|
|
46208
|
+
}
|
|
46209
|
+
seen.push(current);
|
|
46210
|
+
const prototype2 = current === thing ? sourcePrototype : getPrototypeOf(current);
|
|
46211
|
+
if (isPrototypeBoundary(current, prototype2, current === thing)) {
|
|
46212
|
+
break;
|
|
46213
|
+
}
|
|
46214
|
+
const props = Object.getOwnPropertyNames(current);
|
|
46215
|
+
if (Object.getOwnPropertySymbols) {
|
|
46216
|
+
props.push(...Object.getOwnPropertySymbols(current));
|
|
46217
|
+
}
|
|
46218
|
+
for (const prop of props) {
|
|
46219
|
+
if (isUnsafeObjectKey(prop)) {
|
|
46220
|
+
continue;
|
|
46221
|
+
}
|
|
46222
|
+
if (!hasOwnProperty(merged, prop)) {
|
|
46223
|
+
result[prop] = thing[prop];
|
|
46224
|
+
merged[prop] = true;
|
|
46225
|
+
}
|
|
46226
|
+
}
|
|
46227
|
+
current = prototype2;
|
|
46228
|
+
}
|
|
46229
|
+
return result;
|
|
46230
|
+
};
|
|
45692
46231
|
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
45693
46232
|
const str = toString.call(thing);
|
|
45694
46233
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -45723,9 +46262,9 @@ var isPlainObject = (val) => {
|
|
|
45723
46262
|
return false;
|
|
45724
46263
|
}
|
|
45725
46264
|
const prototype2 = getPrototypeOf(val);
|
|
45726
|
-
return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat
|
|
45727
|
-
//
|
|
45728
|
-
//
|
|
46265
|
+
return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as
|
|
46266
|
+
// evidence the value is tagged/iterable, while ignoring members reachable
|
|
46267
|
+
// only through shared or terminal prototype boundaries.
|
|
45729
46268
|
!hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
|
|
45730
46269
|
};
|
|
45731
46270
|
var isEmptyObject = (val) => {
|
|
@@ -46136,6 +46675,7 @@ var utils_default = {
|
|
|
46136
46675
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
46137
46676
|
hasOwnInPrototypeChain,
|
|
46138
46677
|
getSafeProp,
|
|
46678
|
+
toSafeFlatObject,
|
|
46139
46679
|
reduceDescriptors,
|
|
46140
46680
|
freezeMethods,
|
|
46141
46681
|
toObjectSet,
|
|
@@ -46774,24 +47314,16 @@ function toFormData(obj, formData, options) {
|
|
|
46774
47314
|
throw new TypeError("target must be an object");
|
|
46775
47315
|
}
|
|
46776
47316
|
formData = formData || new (FormData_default || FormData)();
|
|
46777
|
-
|
|
46778
|
-
options,
|
|
46779
|
-
|
|
46780
|
-
|
|
46781
|
-
|
|
46782
|
-
|
|
46783
|
-
|
|
46784
|
-
|
|
46785
|
-
|
|
46786
|
-
|
|
46787
|
-
}
|
|
46788
|
-
);
|
|
46789
|
-
const metaTokens = options.metaTokens;
|
|
46790
|
-
const visitor = options.visitor || defaultVisitor;
|
|
46791
|
-
const dots = options.dots;
|
|
46792
|
-
const indexes = options.indexes;
|
|
46793
|
-
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
46794
|
-
const maxDepth = options.maxDepth === void 0 ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
|
|
47317
|
+
const option = (name, fallback) => {
|
|
47318
|
+
const value = utils_default.getSafeProp(options, name);
|
|
47319
|
+
return utils_default.isUndefined(value) ? fallback : value;
|
|
47320
|
+
};
|
|
47321
|
+
const metaTokens = option("metaTokens", true);
|
|
47322
|
+
const visitor = option("visitor") || defaultVisitor;
|
|
47323
|
+
const dots = option("dots", false);
|
|
47324
|
+
const indexes = option("indexes", false);
|
|
47325
|
+
const _Blob = option("Blob") || typeof Blob !== "undefined" && Blob;
|
|
47326
|
+
const maxDepth = option("maxDepth", DEFAULT_FORM_DATA_MAX_DEPTH);
|
|
46795
47327
|
const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
|
|
46796
47328
|
const stack = [];
|
|
46797
47329
|
if (!utils_default.isFunction(visitor)) {
|
|
@@ -46815,7 +47347,10 @@ function toFormData(obj, formData, options) {
|
|
|
46815
47347
|
if (Buffer_default && Buffer_default.isBufferAvailable()) {
|
|
46816
47348
|
return Buffer_default.from(value);
|
|
46817
47349
|
}
|
|
46818
|
-
throw new AxiosError_default(
|
|
47350
|
+
throw new AxiosError_default(
|
|
47351
|
+
"Blob is not supported. Use a Buffer instead.",
|
|
47352
|
+
AxiosError_default.ERR_NOT_SUPPORT
|
|
47353
|
+
);
|
|
46819
47354
|
}
|
|
46820
47355
|
return value;
|
|
46821
47356
|
}
|
|
@@ -46961,9 +47496,47 @@ function buildURL(url2, params, options) {
|
|
|
46961
47496
|
}
|
|
46962
47497
|
|
|
46963
47498
|
// node_modules/axios/lib/core/InterceptorManager.js
|
|
47499
|
+
var $internals2 = Symbol("internals");
|
|
47500
|
+
function countHandlers(handlers) {
|
|
47501
|
+
return handlers ? handlers.length : 0;
|
|
47502
|
+
}
|
|
47503
|
+
function trimHandlers(handlers) {
|
|
47504
|
+
if (!handlers) {
|
|
47505
|
+
return;
|
|
47506
|
+
}
|
|
47507
|
+
while (handlers.length && handlers[handlers.length - 1] === null) {
|
|
47508
|
+
handlers.pop();
|
|
47509
|
+
}
|
|
47510
|
+
}
|
|
47511
|
+
function syncHandlerEntries(manager, internals) {
|
|
47512
|
+
const handlers = manager.handlers;
|
|
47513
|
+
const length = countHandlers(handlers);
|
|
47514
|
+
if (handlers !== internals.handlersRef) {
|
|
47515
|
+
internals.handlersRef = handlers;
|
|
47516
|
+
internals.handlerEntries.clear();
|
|
47517
|
+
} else if (length !== internals.handlersLength) {
|
|
47518
|
+
if (!length) {
|
|
47519
|
+
internals.handlerEntries.clear();
|
|
47520
|
+
} else {
|
|
47521
|
+
internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {
|
|
47522
|
+
if (handlers[entry.index] !== entry.handler) {
|
|
47523
|
+
internals.handlerEntries.delete(id);
|
|
47524
|
+
}
|
|
47525
|
+
});
|
|
47526
|
+
}
|
|
47527
|
+
}
|
|
47528
|
+
internals.handlersLength = length;
|
|
47529
|
+
}
|
|
46964
47530
|
var InterceptorManager = class {
|
|
46965
47531
|
constructor() {
|
|
46966
47532
|
this.handlers = [];
|
|
47533
|
+
this[$internals2] = {
|
|
47534
|
+
handlersRef: this.handlers,
|
|
47535
|
+
handlersLength: this.handlers.length,
|
|
47536
|
+
handlerEntries: /* @__PURE__ */ new Map(),
|
|
47537
|
+
iterationDepth: 0,
|
|
47538
|
+
nextId: 0
|
|
47539
|
+
};
|
|
46967
47540
|
}
|
|
46968
47541
|
/**
|
|
46969
47542
|
* Add a new interceptor to the stack
|
|
@@ -46975,13 +47548,25 @@ var InterceptorManager = class {
|
|
|
46975
47548
|
* @return {Number} An ID used to remove interceptor later
|
|
46976
47549
|
*/
|
|
46977
47550
|
use(fulfilled, rejected, options) {
|
|
46978
|
-
|
|
47551
|
+
const handler = {
|
|
46979
47552
|
fulfilled,
|
|
46980
47553
|
rejected,
|
|
46981
47554
|
synchronous: options ? options.synchronous : false,
|
|
46982
47555
|
runWhen: options ? options.runWhen : null
|
|
47556
|
+
};
|
|
47557
|
+
const internals = this[$internals2];
|
|
47558
|
+
if (this.handlers == null) {
|
|
47559
|
+
this.handlers = [];
|
|
47560
|
+
}
|
|
47561
|
+
syncHandlerEntries(this, internals);
|
|
47562
|
+
const id = internals.nextId++;
|
|
47563
|
+
this.handlers.push(handler);
|
|
47564
|
+
internals.handlerEntries.set(id, {
|
|
47565
|
+
handler,
|
|
47566
|
+
index: this.handlers.length - 1
|
|
46983
47567
|
});
|
|
46984
|
-
|
|
47568
|
+
internals.handlersLength = this.handlers.length;
|
|
47569
|
+
return id;
|
|
46985
47570
|
}
|
|
46986
47571
|
/**
|
|
46987
47572
|
* Remove an interceptor from the stack
|
|
@@ -46991,8 +47576,19 @@ var InterceptorManager = class {
|
|
|
46991
47576
|
* @returns {void}
|
|
46992
47577
|
*/
|
|
46993
47578
|
eject(id) {
|
|
46994
|
-
|
|
46995
|
-
|
|
47579
|
+
const internals = this[$internals2];
|
|
47580
|
+
syncHandlerEntries(this, internals);
|
|
47581
|
+
const entry = internals.handlerEntries.get(id);
|
|
47582
|
+
if (entry) {
|
|
47583
|
+
internals.handlerEntries.delete(id);
|
|
47584
|
+
if (this.handlers[entry.index] !== entry.handler) {
|
|
47585
|
+
return;
|
|
47586
|
+
}
|
|
47587
|
+
this.handlers[entry.index] = null;
|
|
47588
|
+
if (!internals.iterationDepth) {
|
|
47589
|
+
trimHandlers(this.handlers);
|
|
47590
|
+
internals.handlersLength = this.handlers.length;
|
|
47591
|
+
}
|
|
46996
47592
|
}
|
|
46997
47593
|
}
|
|
46998
47594
|
/**
|
|
@@ -47003,6 +47599,7 @@ var InterceptorManager = class {
|
|
|
47003
47599
|
clear() {
|
|
47004
47600
|
if (this.handlers) {
|
|
47005
47601
|
this.handlers = [];
|
|
47602
|
+
syncHandlerEntries(this, this[$internals2]);
|
|
47006
47603
|
}
|
|
47007
47604
|
}
|
|
47008
47605
|
/**
|
|
@@ -47016,11 +47613,22 @@ var InterceptorManager = class {
|
|
|
47016
47613
|
* @returns {void}
|
|
47017
47614
|
*/
|
|
47018
47615
|
forEach(fn) {
|
|
47019
|
-
|
|
47020
|
-
|
|
47021
|
-
|
|
47616
|
+
const internals = this[$internals2];
|
|
47617
|
+
syncHandlerEntries(this, internals);
|
|
47618
|
+
internals.iterationDepth++;
|
|
47619
|
+
try {
|
|
47620
|
+
utils_default.forEach(this.handlers, function forEachHandler(h) {
|
|
47621
|
+
if (h !== null) {
|
|
47622
|
+
fn(h);
|
|
47623
|
+
}
|
|
47624
|
+
});
|
|
47625
|
+
} finally {
|
|
47626
|
+
if (!--internals.iterationDepth) {
|
|
47627
|
+
syncHandlerEntries(this, internals);
|
|
47628
|
+
trimHandlers(this.handlers);
|
|
47629
|
+
internals.handlersLength = countHandlers(this.handlers);
|
|
47022
47630
|
}
|
|
47023
|
-
}
|
|
47631
|
+
}
|
|
47024
47632
|
}
|
|
47025
47633
|
};
|
|
47026
47634
|
var InterceptorManager_default = InterceptorManager;
|
|
@@ -47178,6 +47786,22 @@ function formDataToJSON(formData) {
|
|
|
47178
47786
|
}
|
|
47179
47787
|
var formDataToJSON_default = formDataToJSON;
|
|
47180
47788
|
|
|
47789
|
+
// node_modules/axios/lib/core/methodList.js
|
|
47790
|
+
var methodList = Object.freeze([
|
|
47791
|
+
"get",
|
|
47792
|
+
"delete",
|
|
47793
|
+
"head",
|
|
47794
|
+
"options",
|
|
47795
|
+
"post",
|
|
47796
|
+
"put",
|
|
47797
|
+
"patch",
|
|
47798
|
+
"purge",
|
|
47799
|
+
"link",
|
|
47800
|
+
"unlink",
|
|
47801
|
+
"query"
|
|
47802
|
+
]);
|
|
47803
|
+
var methodList_default = methodList;
|
|
47804
|
+
|
|
47181
47805
|
// node_modules/axios/lib/defaults/index.js
|
|
47182
47806
|
var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0;
|
|
47183
47807
|
function stringifySafely2(rawValue, parser, encoder) {
|
|
@@ -47290,7 +47914,7 @@ var defaults = {
|
|
|
47290
47914
|
}
|
|
47291
47915
|
}
|
|
47292
47916
|
};
|
|
47293
|
-
utils_default.forEach(
|
|
47917
|
+
utils_default.forEach(methodList_default, (method) => {
|
|
47294
47918
|
defaults.headers[method] = {};
|
|
47295
47919
|
});
|
|
47296
47920
|
var defaults_default = defaults;
|
|
@@ -47368,19 +47992,21 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
47368
47992
|
return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, "");
|
|
47369
47993
|
}
|
|
47370
47994
|
|
|
47371
|
-
// node_modules/axios/lib/
|
|
47372
|
-
var
|
|
47373
|
-
var httpProtocolControlCharacters = /[\t\n\r]/g;
|
|
47374
|
-
function stripLeadingC0ControlOrSpace(url2) {
|
|
47375
|
-
let i = 0;
|
|
47376
|
-
while (i < url2.length && url2.charCodeAt(i) <= 32) {
|
|
47377
|
-
i++;
|
|
47378
|
-
}
|
|
47379
|
-
return url2.slice(i);
|
|
47380
|
-
}
|
|
47995
|
+
// node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js
|
|
47996
|
+
var urlParserControlCharacters = /[\t\n\r]/g;
|
|
47381
47997
|
function normalizeURLForProtocolCheck(url2) {
|
|
47382
|
-
|
|
47998
|
+
if (typeof url2 !== "string") {
|
|
47999
|
+
return url2;
|
|
48000
|
+
}
|
|
48001
|
+
let start = 0;
|
|
48002
|
+
while (start < url2.length && url2.charCodeAt(start) <= 32) {
|
|
48003
|
+
start++;
|
|
48004
|
+
}
|
|
48005
|
+
return url2.slice(start).replace(urlParserControlCharacters, "");
|
|
47383
48006
|
}
|
|
48007
|
+
|
|
48008
|
+
// node_modules/axios/lib/core/buildFullPath.js
|
|
48009
|
+
var malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
47384
48010
|
function redactFragment(fragment) {
|
|
47385
48011
|
if (!fragment) {
|
|
47386
48012
|
return fragment;
|
|
@@ -47502,7 +48128,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
|
47502
48128
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
47503
48129
|
|
|
47504
48130
|
// node_modules/axios/lib/env/data.js
|
|
47505
|
-
var VERSION = "1.
|
|
48131
|
+
var VERSION = "1.20.0";
|
|
47506
48132
|
|
|
47507
48133
|
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
47508
48134
|
function parseProtocol(url2) {
|
|
@@ -47511,7 +48137,7 @@ function parseProtocol(url2) {
|
|
|
47511
48137
|
}
|
|
47512
48138
|
|
|
47513
48139
|
// node_modules/axios/lib/helpers/fromDataURI.js
|
|
47514
|
-
var DATA_URL_PATTERN = /^([
|
|
48140
|
+
var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
|
|
47515
48141
|
function fromDataURI(uri, asBlob, options) {
|
|
47516
48142
|
const _Blob = options && options.Blob || platform_default.classes.Blob;
|
|
47517
48143
|
const protocol = parseProtocol(uri);
|
|
@@ -47824,6 +48450,7 @@ var Http2Sessions = class {
|
|
|
47824
48450
|
}
|
|
47825
48451
|
getSession(authority, options) {
|
|
47826
48452
|
options = Object.assign(
|
|
48453
|
+
/* @__PURE__ */ Object.create(null),
|
|
47827
48454
|
{
|
|
47828
48455
|
sessionTimeout: 1e3
|
|
47829
48456
|
},
|
|
@@ -47889,6 +48516,7 @@ var Http2Sessions = class {
|
|
|
47889
48516
|
};
|
|
47890
48517
|
}
|
|
47891
48518
|
session.once("close", removeSession);
|
|
48519
|
+
session.once("error", removeSession);
|
|
47892
48520
|
let entry = [session, options];
|
|
47893
48521
|
authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
|
|
47894
48522
|
return session;
|
|
@@ -47913,6 +48541,13 @@ var callbackify_default = callbackify;
|
|
|
47913
48541
|
|
|
47914
48542
|
// node_modules/axios/lib/helpers/shouldBypassProxy.js
|
|
47915
48543
|
var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "0.0.0.0"]);
|
|
48544
|
+
var trimTrailingDots = (value) => {
|
|
48545
|
+
let end = value.length;
|
|
48546
|
+
while (end && value.charCodeAt(end - 1) === 46) {
|
|
48547
|
+
end--;
|
|
48548
|
+
}
|
|
48549
|
+
return end === value.length ? value : value.slice(0, end);
|
|
48550
|
+
};
|
|
47916
48551
|
var isIPv4Loopback = (host) => {
|
|
47917
48552
|
const parts = host.split(".");
|
|
47918
48553
|
if (parts.length !== 4) return false;
|
|
@@ -47945,7 +48580,7 @@ var normalizeIPAddress = (host) => {
|
|
|
47945
48580
|
if (h.charAt(0) === "[" && h.charAt(h.length - 1) === "]") {
|
|
47946
48581
|
h = h.slice(1, -1);
|
|
47947
48582
|
}
|
|
47948
|
-
h = h
|
|
48583
|
+
h = trimTrailingDots(h);
|
|
47949
48584
|
if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host;
|
|
47950
48585
|
const parts = h.split(".");
|
|
47951
48586
|
if (parts.some((p) => p === "")) return host;
|
|
@@ -48057,6 +48692,40 @@ var unmapIPv4MappedIPv6 = (host) => {
|
|
|
48057
48692
|
}
|
|
48058
48693
|
return host;
|
|
48059
48694
|
};
|
|
48695
|
+
var IPV4_OCTET_RE = /^(?:0|[1-9]\d{0,2})$/;
|
|
48696
|
+
var ipv4ToBytes = (host) => {
|
|
48697
|
+
const parts = host.split(".");
|
|
48698
|
+
return parts.length === 4 && parts.every((part) => IPV4_OCTET_RE.test(part) && Number(part) <= 255) ? parts.map(Number) : null;
|
|
48699
|
+
};
|
|
48700
|
+
var IPV6_GROUP_RE = /^[0-9a-f]{1,4}$/i;
|
|
48701
|
+
var ipv6ToBytes = (host) => {
|
|
48702
|
+
const halves = host.split("::");
|
|
48703
|
+
if (halves.length > 2) {
|
|
48704
|
+
return null;
|
|
48705
|
+
}
|
|
48706
|
+
const groups = halves[0] ? halves[0].split(":") : [];
|
|
48707
|
+
if (halves.length === 2) {
|
|
48708
|
+
const rear = halves[1] ? halves[1].split(":") : [];
|
|
48709
|
+
const missing = 8 - groups.length - rear.length;
|
|
48710
|
+
if (missing < 1) {
|
|
48711
|
+
return null;
|
|
48712
|
+
}
|
|
48713
|
+
groups.push(...new Array(missing).fill("0"), ...rear);
|
|
48714
|
+
}
|
|
48715
|
+
if (groups.length !== 8 || groups.some((group) => !IPV6_GROUP_RE.test(group))) {
|
|
48716
|
+
return null;
|
|
48717
|
+
}
|
|
48718
|
+
return groups.flatMap((group) => {
|
|
48719
|
+
const value = Number.parseInt(group, 16);
|
|
48720
|
+
return [value >> 8 & 255, value & 255];
|
|
48721
|
+
});
|
|
48722
|
+
};
|
|
48723
|
+
var ipToBytes = (host) => {
|
|
48724
|
+
if (typeof host !== "string" || !host) {
|
|
48725
|
+
return null;
|
|
48726
|
+
}
|
|
48727
|
+
return host.indexOf(":") !== -1 ? ipv6ToBytes(host) : ipv4ToBytes(host);
|
|
48728
|
+
};
|
|
48060
48729
|
var normalizeNoProxyHost = (hostname) => {
|
|
48061
48730
|
if (!hostname) {
|
|
48062
48731
|
return hostname;
|
|
@@ -48064,13 +48733,90 @@ var normalizeNoProxyHost = (hostname) => {
|
|
|
48064
48733
|
if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
|
|
48065
48734
|
hostname = hostname.slice(1, -1);
|
|
48066
48735
|
}
|
|
48067
|
-
const trimmed = hostname
|
|
48736
|
+
const trimmed = trimTrailingDots(hostname);
|
|
48068
48737
|
const ipv4 = normalizeIPAddress(trimmed);
|
|
48069
48738
|
if (ipv4 !== trimmed) {
|
|
48070
48739
|
return ipv4;
|
|
48071
48740
|
}
|
|
48072
48741
|
return unmapIPv4MappedIPv6(trimmed);
|
|
48073
48742
|
};
|
|
48743
|
+
var normalizeCidrBase = (input) => {
|
|
48744
|
+
let base = input;
|
|
48745
|
+
const startsBracket = base.charAt(0) === "[";
|
|
48746
|
+
const endsBracket = base.charAt(base.length - 1) === "]";
|
|
48747
|
+
const hasBracket = base.includes("[") || base.includes("]");
|
|
48748
|
+
if (startsBracket || endsBracket) {
|
|
48749
|
+
if (!startsBracket || !endsBracket) {
|
|
48750
|
+
return null;
|
|
48751
|
+
}
|
|
48752
|
+
base = base.slice(1, -1);
|
|
48753
|
+
if (base.indexOf(":") === -1 || base.includes("[") || base.includes("]")) {
|
|
48754
|
+
return null;
|
|
48755
|
+
}
|
|
48756
|
+
} else if (hasBracket) {
|
|
48757
|
+
return null;
|
|
48758
|
+
}
|
|
48759
|
+
if (!base || base.charAt(base.length - 1) === ".") {
|
|
48760
|
+
return null;
|
|
48761
|
+
}
|
|
48762
|
+
const wasIPv6 = base.indexOf(":") !== -1;
|
|
48763
|
+
if (wasIPv6) {
|
|
48764
|
+
try {
|
|
48765
|
+
base = new URL(`http://[${base}]/`).hostname.slice(1, -1);
|
|
48766
|
+
} catch (_err) {
|
|
48767
|
+
return null;
|
|
48768
|
+
}
|
|
48769
|
+
} else {
|
|
48770
|
+
base = normalizeIPAddress(base);
|
|
48771
|
+
if (!ipv4ToBytes(base)) {
|
|
48772
|
+
return null;
|
|
48773
|
+
}
|
|
48774
|
+
}
|
|
48775
|
+
return { normalized: unmapIPv4MappedIPv6(base), wasIPv6 };
|
|
48776
|
+
};
|
|
48777
|
+
var CIDR_ENTRY_RE = /^(.+)\/(0|[1-9]\d{0,2})$/;
|
|
48778
|
+
var parseCidrEntry = (entry) => {
|
|
48779
|
+
if (entry.indexOf("/") === -1) {
|
|
48780
|
+
return void 0;
|
|
48781
|
+
}
|
|
48782
|
+
const match = CIDR_ENTRY_RE.exec(entry);
|
|
48783
|
+
if (!match) {
|
|
48784
|
+
return null;
|
|
48785
|
+
}
|
|
48786
|
+
let prefix = Number(match[2]);
|
|
48787
|
+
const parsedBase = normalizeCidrBase(match[1]);
|
|
48788
|
+
if (!parsedBase) {
|
|
48789
|
+
return null;
|
|
48790
|
+
}
|
|
48791
|
+
const { normalized, wasIPv6 } = parsedBase;
|
|
48792
|
+
if (wasIPv6 && normalized.indexOf(":") === -1) {
|
|
48793
|
+
if (prefix < 96) {
|
|
48794
|
+
return null;
|
|
48795
|
+
}
|
|
48796
|
+
prefix -= 96;
|
|
48797
|
+
}
|
|
48798
|
+
const bytes = ipToBytes(normalized);
|
|
48799
|
+
if (!bytes || prefix > bytes.length * 8) {
|
|
48800
|
+
return null;
|
|
48801
|
+
}
|
|
48802
|
+
return { bytes, prefix };
|
|
48803
|
+
};
|
|
48804
|
+
var isInSubnet = (addressBytes, networkBytes, prefix) => {
|
|
48805
|
+
const fullBytes = prefix >> 3;
|
|
48806
|
+
for (let i = 0; i < fullBytes; i++) {
|
|
48807
|
+
if (addressBytes[i] !== networkBytes[i]) {
|
|
48808
|
+
return false;
|
|
48809
|
+
}
|
|
48810
|
+
}
|
|
48811
|
+
const remainingBits = prefix & 7;
|
|
48812
|
+
if (remainingBits) {
|
|
48813
|
+
const mask = 255 << 8 - remainingBits & 255;
|
|
48814
|
+
if ((addressBytes[fullBytes] & mask) !== (networkBytes[fullBytes] & mask)) {
|
|
48815
|
+
return false;
|
|
48816
|
+
}
|
|
48817
|
+
}
|
|
48818
|
+
return true;
|
|
48819
|
+
};
|
|
48074
48820
|
function shouldBypassProxy(location) {
|
|
48075
48821
|
let parsed;
|
|
48076
48822
|
try {
|
|
@@ -48087,6 +48833,7 @@ function shouldBypassProxy(location) {
|
|
|
48087
48833
|
}
|
|
48088
48834
|
const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS2[parsed.protocol.split(":", 1)[0]] || 0;
|
|
48089
48835
|
const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
|
|
48836
|
+
const hostnameBytes = ipToBytes(hostname);
|
|
48090
48837
|
return noProxy.split(/[\s,]+/).some((entry) => {
|
|
48091
48838
|
if (!entry) {
|
|
48092
48839
|
return false;
|
|
@@ -48094,6 +48841,10 @@ function shouldBypassProxy(location) {
|
|
|
48094
48841
|
if (entry === "*") {
|
|
48095
48842
|
return true;
|
|
48096
48843
|
}
|
|
48844
|
+
const cidr = parseCidrEntry(entry);
|
|
48845
|
+
if (cidr !== void 0) {
|
|
48846
|
+
return cidr !== null && !!hostnameBytes && hostnameBytes.length === cidr.bytes.length && isInSubnet(hostnameBytes, cidr.bytes, cidr.prefix);
|
|
48847
|
+
}
|
|
48097
48848
|
let [entryHost, entryPort] = parseNoProxyEntry(entry);
|
|
48098
48849
|
entryHost = normalizeNoProxyHost(entryHost);
|
|
48099
48850
|
if (!entryHost) {
|
|
@@ -48179,7 +48930,8 @@ function throttle(fn, freq) {
|
|
|
48179
48930
|
}
|
|
48180
48931
|
};
|
|
48181
48932
|
const flush = () => lastArgs && invoke(lastArgs);
|
|
48182
|
-
|
|
48933
|
+
const flushWith = (...args) => invoke(args);
|
|
48934
|
+
return [throttled, flush, flushWith];
|
|
48183
48935
|
}
|
|
48184
48936
|
var throttle_default = throttle;
|
|
48185
48937
|
|
|
@@ -48188,7 +48940,7 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
48188
48940
|
let bytesNotified = 0;
|
|
48189
48941
|
const _speedometer = speedometer_default(50, 250);
|
|
48190
48942
|
return throttle_default((e) => {
|
|
48191
|
-
if (!e ||
|
|
48943
|
+
if (!e || !utils_default.isNumber(e.loaded)) {
|
|
48192
48944
|
return;
|
|
48193
48945
|
}
|
|
48194
48946
|
const rawLoaded = e.loaded;
|
|
@@ -48349,6 +49101,12 @@ var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
|
|
|
48349
49101
|
var isHttps = /https:?/;
|
|
48350
49102
|
var kAxiosSocketListener = Symbol("axios.http.socketListener");
|
|
48351
49103
|
var kAxiosCurrentReq = Symbol("axios.http.currentReq");
|
|
49104
|
+
function handleSocketError(err) {
|
|
49105
|
+
const current = this[kAxiosCurrentReq];
|
|
49106
|
+
if (current && !current.destroyed) {
|
|
49107
|
+
current.destroy(err);
|
|
49108
|
+
}
|
|
49109
|
+
}
|
|
48352
49110
|
var kAxiosInstalledTunnel = Symbol("axios.http.installedTunnel");
|
|
48353
49111
|
var tunnelingAgentCache = /* @__PURE__ */ new Map();
|
|
48354
49112
|
var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
|
|
@@ -48451,10 +49209,10 @@ function isSameOriginRedirect(redirectOptions, requestDetails) {
|
|
|
48451
49209
|
return false;
|
|
48452
49210
|
}
|
|
48453
49211
|
}
|
|
48454
|
-
function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
|
|
49212
|
+
function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent, allowEnvProxy = true) {
|
|
48455
49213
|
let proxy = configProxy;
|
|
48456
49214
|
const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
|
|
48457
|
-
if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
|
|
49215
|
+
if (!proxy && proxy !== false && allowEnvProxy && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
|
|
48458
49216
|
const proxyUrl = getProxyForUrl(location);
|
|
48459
49217
|
if (proxyUrl) {
|
|
48460
49218
|
if (!shouldBypassProxy(location)) {
|
|
@@ -48551,9 +49309,13 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent,
|
|
|
48551
49309
|
redirectOptions.href,
|
|
48552
49310
|
true,
|
|
48553
49311
|
configHttpsAgent,
|
|
48554
|
-
configHttpAgent
|
|
49312
|
+
configHttpAgent,
|
|
49313
|
+
allowEnvProxy
|
|
48555
49314
|
);
|
|
48556
49315
|
};
|
|
49316
|
+
return Boolean(
|
|
49317
|
+
proxy || configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent)
|
|
49318
|
+
);
|
|
48557
49319
|
}
|
|
48558
49320
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
48559
49321
|
var wrapAsync = (asyncExecutor) => {
|
|
@@ -48578,7 +49340,7 @@ var wrapAsync = (asyncExecutor) => {
|
|
|
48578
49340
|
};
|
|
48579
49341
|
var resolveFamily = ({ address, family }) => {
|
|
48580
49342
|
if (!utils_default.isString(address)) {
|
|
48581
|
-
throw
|
|
49343
|
+
throw new AxiosError_default("address must be a string", AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
48582
49344
|
}
|
|
48583
49345
|
return {
|
|
48584
49346
|
address,
|
|
@@ -48586,6 +49348,30 @@ var resolveFamily = ({ address, family }) => {
|
|
|
48586
49348
|
};
|
|
48587
49349
|
};
|
|
48588
49350
|
var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
|
|
49351
|
+
var normalizedLookupCache = /* @__PURE__ */ new WeakMap();
|
|
49352
|
+
var normalizeLookup = (lookup) => {
|
|
49353
|
+
let normalized = normalizedLookupCache.get(lookup);
|
|
49354
|
+
if (normalized) {
|
|
49355
|
+
return normalized;
|
|
49356
|
+
}
|
|
49357
|
+
const callbackLookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
|
|
49358
|
+
normalized = (hostname, opt, cb) => {
|
|
49359
|
+
callbackLookup(hostname, opt, (err, arg0, arg1) => {
|
|
49360
|
+
if (err) {
|
|
49361
|
+
return cb(err);
|
|
49362
|
+
}
|
|
49363
|
+
let addresses;
|
|
49364
|
+
try {
|
|
49365
|
+
addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
49366
|
+
} catch (error) {
|
|
49367
|
+
return cb(error);
|
|
49368
|
+
}
|
|
49369
|
+
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
49370
|
+
});
|
|
49371
|
+
};
|
|
49372
|
+
normalizedLookupCache.set(lookup, normalized);
|
|
49373
|
+
return normalized;
|
|
49374
|
+
};
|
|
48589
49375
|
var http2Transport = {
|
|
48590
49376
|
request(options, cb) {
|
|
48591
49377
|
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
|
|
@@ -48622,6 +49408,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
48622
49408
|
let family = own2("family");
|
|
48623
49409
|
let httpVersion = own2("httpVersion");
|
|
48624
49410
|
if (httpVersion === void 0) httpVersion = 1;
|
|
49411
|
+
const rawHttpVersion = httpVersion;
|
|
48625
49412
|
let http2Options = own2("http2Options");
|
|
48626
49413
|
const httpAgent = own2("httpAgent");
|
|
48627
49414
|
const httpsAgent = own2("httpsAgent");
|
|
@@ -48638,25 +49425,32 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
48638
49425
|
let rejected = false;
|
|
48639
49426
|
let req;
|
|
48640
49427
|
let connectPhaseTimer;
|
|
48641
|
-
|
|
49428
|
+
try {
|
|
49429
|
+
httpVersion = +httpVersion;
|
|
49430
|
+
} catch (err) {
|
|
49431
|
+
throw new AxiosError_default(
|
|
49432
|
+
"Invalid protocol version: value is not a number",
|
|
49433
|
+
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
49434
|
+
config
|
|
49435
|
+
);
|
|
49436
|
+
}
|
|
48642
49437
|
if (Number.isNaN(httpVersion)) {
|
|
48643
|
-
throw
|
|
49438
|
+
throw new AxiosError_default(
|
|
49439
|
+
`Invalid protocol version: '${rawHttpVersion}' is not a number`,
|
|
49440
|
+
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
49441
|
+
config
|
|
49442
|
+
);
|
|
48644
49443
|
}
|
|
48645
49444
|
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
48646
|
-
throw
|
|
49445
|
+
throw new AxiosError_default(
|
|
49446
|
+
`Unsupported protocol version '${httpVersion}'`,
|
|
49447
|
+
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
49448
|
+
config
|
|
49449
|
+
);
|
|
48647
49450
|
}
|
|
48648
49451
|
const isHttp2 = httpVersion === 2;
|
|
48649
49452
|
if (lookup) {
|
|
48650
|
-
|
|
48651
|
-
lookup = (hostname, opt, cb) => {
|
|
48652
|
-
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
48653
|
-
if (err) {
|
|
48654
|
-
return cb(err);
|
|
48655
|
-
}
|
|
48656
|
-
const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
48657
|
-
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
48658
|
-
});
|
|
48659
|
-
};
|
|
49453
|
+
lookup = normalizeLookup(lookup);
|
|
48660
49454
|
}
|
|
48661
49455
|
const abortEmitter = new import_events.EventEmitter();
|
|
48662
49456
|
function abort(reason) {
|
|
@@ -48899,6 +49693,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
48899
49693
|
utils_default.hasOwnProp(transitional2, "advertiseZstdAcceptEncoding") && transitional2.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING,
|
|
48900
49694
|
false
|
|
48901
49695
|
);
|
|
49696
|
+
if (isHttp2 && lookup) {
|
|
49697
|
+
http2Options = Object.assign(/* @__PURE__ */ Object.create(null), http2Options, { lookup });
|
|
49698
|
+
}
|
|
48902
49699
|
const options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
48903
49700
|
path: path5,
|
|
48904
49701
|
method,
|
|
@@ -48909,9 +49706,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
48909
49706
|
family,
|
|
48910
49707
|
beforeRedirect: dispatchBeforeRedirect,
|
|
48911
49708
|
beforeRedirects: /* @__PURE__ */ Object.create(null),
|
|
48912
|
-
http2Options
|
|
49709
|
+
http2Options,
|
|
49710
|
+
createConnection: void 0
|
|
48913
49711
|
});
|
|
48914
49712
|
!utils_default.isUndefined(lookup) && (options.lookup = lookup);
|
|
49713
|
+
let proxyApplied = false;
|
|
48915
49714
|
if (socketPath) {
|
|
48916
49715
|
if (typeof socketPath !== "string") {
|
|
48917
49716
|
return reject(
|
|
@@ -48939,13 +49738,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
48939
49738
|
} else {
|
|
48940
49739
|
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
48941
49740
|
options.port = parsed.port;
|
|
48942
|
-
setProxy(
|
|
49741
|
+
proxyApplied = setProxy(
|
|
48943
49742
|
options,
|
|
48944
49743
|
configProxy,
|
|
48945
49744
|
protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path,
|
|
48946
49745
|
false,
|
|
48947
49746
|
httpsAgent,
|
|
48948
|
-
httpAgent
|
|
49747
|
+
httpAgent,
|
|
49748
|
+
// The HTTP/2 transport connects independently of HTTP/1 agents, so it
|
|
49749
|
+
// cannot apply either axios-resolved or agent-local environment proxies.
|
|
49750
|
+
// Explicit proxy config is still processed and rejected below.
|
|
49751
|
+
!isHttp2
|
|
48949
49752
|
);
|
|
48950
49753
|
}
|
|
48951
49754
|
let transport;
|
|
@@ -48956,6 +49759,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
48956
49759
|
options.agent = isHttpsRequest ? httpsAgent : httpAgent;
|
|
48957
49760
|
}
|
|
48958
49761
|
if (isHttp2) {
|
|
49762
|
+
if (proxyApplied) {
|
|
49763
|
+
return reject(
|
|
49764
|
+
new AxiosError_default(
|
|
49765
|
+
"HTTP/2 requests with a proxy are not supported",
|
|
49766
|
+
AxiosError_default.ERR_NOT_SUPPORT,
|
|
49767
|
+
config
|
|
49768
|
+
)
|
|
49769
|
+
);
|
|
49770
|
+
}
|
|
48959
49771
|
transport = http2Transport;
|
|
48960
49772
|
} else {
|
|
48961
49773
|
const configTransport = own2("transport");
|
|
@@ -49043,7 +49855,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
49043
49855
|
transformStream,
|
|
49044
49856
|
progressEventDecorator(
|
|
49045
49857
|
responseLength,
|
|
49046
|
-
progressEventReducer(
|
|
49858
|
+
progressEventReducer(
|
|
49859
|
+
asyncDecorator(onDownloadProgress, scheduleProgress),
|
|
49860
|
+
true,
|
|
49861
|
+
3
|
|
49862
|
+
)
|
|
49047
49863
|
)
|
|
49048
49864
|
)
|
|
49049
49865
|
);
|
|
@@ -49192,12 +50008,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
49192
50008
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
49193
50009
|
}
|
|
49194
50010
|
if (!socket[kAxiosSocketListener]) {
|
|
49195
|
-
socket.on("error",
|
|
49196
|
-
const current = socket[kAxiosCurrentReq];
|
|
49197
|
-
if (current && !current.destroyed) {
|
|
49198
|
-
current.destroy(err);
|
|
49199
|
-
}
|
|
49200
|
-
});
|
|
50011
|
+
socket.on("error", handleSocketError);
|
|
49201
50012
|
socket[kAxiosSocketListener] = true;
|
|
49202
50013
|
}
|
|
49203
50014
|
socket[kAxiosCurrentReq] = req;
|
|
@@ -49442,7 +50253,7 @@ function mergeConfig(config1, config2) {
|
|
|
49442
50253
|
transformResponse: defaultToConfig2,
|
|
49443
50254
|
paramsSerializer: defaultToConfig2,
|
|
49444
50255
|
timeout: defaultToConfig2,
|
|
49445
|
-
|
|
50256
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
49446
50257
|
withCredentials: defaultToConfig2,
|
|
49447
50258
|
withXSRFToken: defaultToConfig2,
|
|
49448
50259
|
adapter: defaultToConfig2,
|
|
@@ -49519,10 +50330,11 @@ function resolveConfig(config) {
|
|
|
49519
50330
|
}
|
|
49520
50331
|
}
|
|
49521
50332
|
if (utils_default.isFormData(data)) {
|
|
50333
|
+
const getHeaders = utils_default.getSafeProp(data, "getHeaders");
|
|
49522
50334
|
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv || utils_default.isReactNative(data)) {
|
|
49523
50335
|
headers.setContentType(void 0);
|
|
49524
|
-
} else if (utils_default.isFunction(
|
|
49525
|
-
setFormDataHeaders(headers,
|
|
50336
|
+
} else if (utils_default.isFunction(getHeaders)) {
|
|
50337
|
+
setFormDataHeaders(headers, getHeaders.call(data), own2("formDataHeaderPolicy"));
|
|
49526
50338
|
}
|
|
49527
50339
|
}
|
|
49528
50340
|
if (platform_default.hasStandardBrowserEnv) {
|
|
@@ -49551,7 +50363,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
49551
50363
|
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
49552
50364
|
let onCanceled;
|
|
49553
50365
|
let uploadThrottled, downloadThrottled;
|
|
49554
|
-
let flushUpload, flushDownload;
|
|
50366
|
+
let flushUpload, flushDownload, flushDownloadWithEvent;
|
|
49555
50367
|
function done() {
|
|
49556
50368
|
flushUpload && flushUpload();
|
|
49557
50369
|
flushDownload && flushDownload();
|
|
@@ -49561,7 +50373,27 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
49561
50373
|
let request = new XMLHttpRequest();
|
|
49562
50374
|
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
49563
50375
|
request.timeout = _config.timeout;
|
|
49564
|
-
function onloadend() {
|
|
50376
|
+
function onloadend(event) {
|
|
50377
|
+
if (!request) {
|
|
50378
|
+
return;
|
|
50379
|
+
}
|
|
50380
|
+
if (request.status === 0 && (parseProtocol(normalizeURLForProtocolCheck(_config.url)) || parseProtocol(platform_default.origin)) !== "file" && !(request.responseURL && request.responseURL.startsWith("file:"))) {
|
|
50381
|
+
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
|
|
50382
|
+
done();
|
|
50383
|
+
request = null;
|
|
50384
|
+
return;
|
|
50385
|
+
}
|
|
50386
|
+
try {
|
|
50387
|
+
if (event) {
|
|
50388
|
+
flushDownloadWithEvent && flushDownloadWithEvent(event);
|
|
50389
|
+
} else {
|
|
50390
|
+
flushDownload && flushDownload();
|
|
50391
|
+
}
|
|
50392
|
+
} catch (err) {
|
|
50393
|
+
setTimeout(() => {
|
|
50394
|
+
throw err;
|
|
50395
|
+
});
|
|
50396
|
+
}
|
|
49565
50397
|
if (!request) {
|
|
49566
50398
|
return;
|
|
49567
50399
|
}
|
|
@@ -49649,7 +50481,10 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
49649
50481
|
request.responseType = _config.responseType;
|
|
49650
50482
|
}
|
|
49651
50483
|
if (onDownloadProgress) {
|
|
49652
|
-
[downloadThrottled, flushDownload] = progressEventReducer(
|
|
50484
|
+
[downloadThrottled, flushDownload, flushDownloadWithEvent] = progressEventReducer(
|
|
50485
|
+
onDownloadProgress,
|
|
50486
|
+
true
|
|
50487
|
+
);
|
|
49653
50488
|
request.addEventListener("progress", downloadThrottled);
|
|
49654
50489
|
}
|
|
49655
50490
|
if (onUploadProgress && request.upload) {
|
|
@@ -49819,6 +50654,17 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
|
|
|
49819
50654
|
|
|
49820
50655
|
// node_modules/axios/lib/adapters/fetch.js
|
|
49821
50656
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
50657
|
+
var DEFAULT_REQUEST_OPTIONS = {
|
|
50658
|
+
cache: "default",
|
|
50659
|
+
redirect: "follow",
|
|
50660
|
+
referrer: "about:client",
|
|
50661
|
+
referrerPolicy: "",
|
|
50662
|
+
mode: "cors",
|
|
50663
|
+
integrity: "",
|
|
50664
|
+
keepalive: false,
|
|
50665
|
+
priority: "auto",
|
|
50666
|
+
window: null
|
|
50667
|
+
};
|
|
49822
50668
|
var { isFunction: isFunction2 } = utils_default;
|
|
49823
50669
|
var encodeUTF82 = (str) => encodeURIComponent(str).replace(
|
|
49824
50670
|
/%([0-9A-F]{2})/gi,
|
|
@@ -49949,7 +50795,8 @@ var factory = (env) => {
|
|
|
49949
50795
|
withCredentials = "same-origin",
|
|
49950
50796
|
fetchOptions,
|
|
49951
50797
|
maxContentLength,
|
|
49952
|
-
maxBodyLength
|
|
50798
|
+
maxBodyLength,
|
|
50799
|
+
maxRedirects
|
|
49953
50800
|
} = resolveConfig_default(config);
|
|
49954
50801
|
const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1;
|
|
49955
50802
|
const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
@@ -50079,17 +50926,44 @@ var factory = (env) => {
|
|
|
50079
50926
|
}
|
|
50080
50927
|
}
|
|
50081
50928
|
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
50082
|
-
const
|
|
50083
|
-
|
|
50929
|
+
const safeFetchOptions = fetchOptions == null ? fetchOptions : Object.assign(/* @__PURE__ */ Object.create(null), fetchOptions);
|
|
50930
|
+
if (safeFetchOptions) {
|
|
50931
|
+
delete safeFetchOptions.body;
|
|
50932
|
+
delete safeFetchOptions.headers;
|
|
50933
|
+
delete safeFetchOptions.method;
|
|
50934
|
+
delete safeFetchOptions.signal;
|
|
50935
|
+
delete safeFetchOptions.duplex;
|
|
50936
|
+
delete safeFetchOptions.credentials;
|
|
50937
|
+
}
|
|
50938
|
+
const resolvedOptions = Object.assign(/* @__PURE__ */ Object.create(null), safeFetchOptions, {
|
|
50084
50939
|
signal: composedSignal,
|
|
50085
50940
|
method: method.toUpperCase(),
|
|
50086
50941
|
headers: toByteStringHeaderObject(headers.normalize()),
|
|
50087
50942
|
body: data,
|
|
50088
50943
|
duplex: "half",
|
|
50089
50944
|
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
50090
|
-
};
|
|
50945
|
+
});
|
|
50946
|
+
if (isRequestSupported) {
|
|
50947
|
+
utils_default.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => {
|
|
50948
|
+
if (resolvedOptions[key] === void 0) {
|
|
50949
|
+
resolvedOptions[key] = value;
|
|
50950
|
+
}
|
|
50951
|
+
});
|
|
50952
|
+
if (resolvedOptions.signal === void 0) {
|
|
50953
|
+
resolvedOptions.signal = null;
|
|
50954
|
+
}
|
|
50955
|
+
if (resolvedOptions.body === void 0) {
|
|
50956
|
+
resolvedOptions.body = null;
|
|
50957
|
+
}
|
|
50958
|
+
}
|
|
50959
|
+
if (maxRedirects === 0) {
|
|
50960
|
+
resolvedOptions.redirect = "manual";
|
|
50961
|
+
if (safeFetchOptions) {
|
|
50962
|
+
safeFetchOptions.redirect = "manual";
|
|
50963
|
+
}
|
|
50964
|
+
}
|
|
50091
50965
|
request = isRequestSupported && new Request(url2, resolvedOptions);
|
|
50092
|
-
let response = await (isRequestSupported ? _fetch(request,
|
|
50966
|
+
let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url2, resolvedOptions));
|
|
50093
50967
|
const responseHeaders = AxiosHeaders_default.from(response.headers);
|
|
50094
50968
|
if (hasMaxContentLength) {
|
|
50095
50969
|
const declaredLength = utils_default.toFiniteNumber(responseHeaders.getContentLength());
|
|
@@ -50308,9 +51182,10 @@ function throwIfCancellationRequested(config) {
|
|
|
50308
51182
|
throw new CanceledError_default(null, config);
|
|
50309
51183
|
}
|
|
50310
51184
|
}
|
|
50311
|
-
function dispatchRequest(
|
|
51185
|
+
function dispatchRequest(_config) {
|
|
51186
|
+
const config = utils_default.toSafeFlatObject(_config);
|
|
50312
51187
|
throwIfCancellationRequested(config);
|
|
50313
|
-
config.headers = AxiosHeaders_default.from(config
|
|
51188
|
+
config.headers = AxiosHeaders_default.from(utils_default.getSafeProp(config, "headers"));
|
|
50314
51189
|
config.data = transformData.call(config, config.transformRequest);
|
|
50315
51190
|
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
50316
51191
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
@@ -50440,16 +51315,15 @@ var Axios = class {
|
|
|
50440
51315
|
return await this._request(configOrUrl, config);
|
|
50441
51316
|
} catch (err) {
|
|
50442
51317
|
if (err instanceof Error) {
|
|
50443
|
-
let dummy = {};
|
|
50444
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
50445
|
-
const stack = (() => {
|
|
50446
|
-
if (!dummy.stack) {
|
|
50447
|
-
return "";
|
|
50448
|
-
}
|
|
50449
|
-
const firstNewlineIndex = dummy.stack.indexOf("\n");
|
|
50450
|
-
return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
|
|
50451
|
-
})();
|
|
50452
51318
|
try {
|
|
51319
|
+
let dummy = {};
|
|
51320
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
51321
|
+
const dummyStack = dummy.stack;
|
|
51322
|
+
let stack = "";
|
|
51323
|
+
if (typeof dummyStack === "string") {
|
|
51324
|
+
const firstNewlineIndex = dummyStack.indexOf("\n");
|
|
51325
|
+
stack = firstNewlineIndex === -1 ? "" : dummyStack.slice(firstNewlineIndex + 1);
|
|
51326
|
+
}
|
|
50453
51327
|
if (!err.stack) {
|
|
50454
51328
|
err.stack = stack;
|
|
50455
51329
|
} else if (stack) {
|
|
@@ -50519,9 +51393,9 @@ var Axios = class {
|
|
|
50519
51393
|
},
|
|
50520
51394
|
true
|
|
50521
51395
|
);
|
|
50522
|
-
config.method = (config
|
|
51396
|
+
config.method = (utils_default.getSafeProp(config, "method") || utils_default.getSafeProp(this.defaults, "method") || "get").toLowerCase();
|
|
50523
51397
|
let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
|
|
50524
|
-
headers && utils_default.forEach(
|
|
51398
|
+
headers && utils_default.forEach(methodList_default.concat("common"), (method) => {
|
|
50525
51399
|
delete headers[method];
|
|
50526
51400
|
});
|
|
50527
51401
|
config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
|
|
@@ -50784,14 +51658,22 @@ var HttpStatusCode = {
|
|
|
50784
51658
|
Gone: 410,
|
|
50785
51659
|
LengthRequired: 411,
|
|
50786
51660
|
PreconditionFailed: 412,
|
|
51661
|
+
/**
|
|
51662
|
+
* @deprecated Use `ContentTooLarge` instead.
|
|
51663
|
+
*/
|
|
50787
51664
|
PayloadTooLarge: 413,
|
|
51665
|
+
ContentTooLarge: 413,
|
|
50788
51666
|
UriTooLong: 414,
|
|
50789
51667
|
UnsupportedMediaType: 415,
|
|
50790
51668
|
RangeNotSatisfiable: 416,
|
|
50791
51669
|
ExpectationFailed: 417,
|
|
50792
51670
|
ImATeapot: 418,
|
|
50793
51671
|
MisdirectedRequest: 421,
|
|
51672
|
+
/**
|
|
51673
|
+
* @deprecated Use `UnprocessableContent` instead.
|
|
51674
|
+
*/
|
|
50794
51675
|
UnprocessableEntity: 422,
|
|
51676
|
+
UnprocessableContent: 422,
|
|
50795
51677
|
Locked: 423,
|
|
50796
51678
|
FailedDependency: 424,
|
|
50797
51679
|
TooEarly: 425,
|
|
@@ -50820,7 +51702,9 @@ var HttpStatusCode = {
|
|
|
50820
51702
|
InvalidSslCertificate: 526
|
|
50821
51703
|
};
|
|
50822
51704
|
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
50823
|
-
HttpStatusCode[value]
|
|
51705
|
+
if (HttpStatusCode[value] === void 0) {
|
|
51706
|
+
HttpStatusCode[value] = key;
|
|
51707
|
+
}
|
|
50824
51708
|
});
|
|
50825
51709
|
var HttpStatusCode_default = HttpStatusCode;
|
|
50826
51710
|
|
|
@@ -52000,6 +52884,9 @@ var require_pkg_src2 = __commonJS2({
|
|
|
52000
52884
|
});
|
|
52001
52885
|
var index_exports = {};
|
|
52002
52886
|
__export22(index_exports, {
|
|
52887
|
+
BORROWER_AUTHORIZATION_ENCODE_TYPES: () => BORROWER_AUTHORIZATION_ENCODE_TYPES,
|
|
52888
|
+
BORROWER_AUTHORIZATION_FIELDS: () => BORROWER_AUTHORIZATION_FIELDS,
|
|
52889
|
+
BORROWER_AUTHORIZATION_PRIMARY_TYPES: () => BORROWER_AUTHORIZATION_PRIMARY_TYPES,
|
|
52003
52890
|
CHIPOTLE_DEPLOYMENTS: () => CHIPOTLE_DEPLOYMENTS,
|
|
52004
52891
|
DEFAULT_CACHE_CONFIG: () => DEFAULT_CACHE_CONFIG,
|
|
52005
52892
|
DEFAULT_DEBUG_CONFIG: () => DEFAULT_DEBUG_CONFIG,
|
|
@@ -52012,6 +52899,8 @@ var require_pkg_src2 = __commonJS2({
|
|
|
52012
52899
|
PerformanceTracker: () => PerformanceTracker,
|
|
52013
52900
|
RetryStrategy: () => RetryStrategy,
|
|
52014
52901
|
analyzeError: () => analyzeError,
|
|
52902
|
+
borrowerAuthorizationTypes: () => borrowerAuthorizationTypes,
|
|
52903
|
+
buildBorrowerAuthorizationDomain: () => buildBorrowerAuthorizationDomain,
|
|
52015
52904
|
calculateDelay: () => calculateDelay,
|
|
52016
52905
|
cidToHex: () => cidToHex,
|
|
52017
52906
|
classifyError: () => classifyError,
|
|
@@ -52258,30 +53147,30 @@ var require_pkg_src2 = __commonJS2({
|
|
|
52258
53147
|
}
|
|
52259
53148
|
},
|
|
52260
53149
|
btcTransactionSigner: {
|
|
52261
|
-
cid: "
|
|
53150
|
+
cid: "QmVi1BYdxvCX3QUhXwPtP6FjWMzqSPtXzrS54YsXjTgjYf",
|
|
52262
53151
|
authorizedCidHex: cidToHex(
|
|
52263
|
-
"
|
|
53152
|
+
"QmVi1BYdxvCX3QUhXwPtP6FjWMzqSPtXzrS54YsXjTgjYf"
|
|
52264
53153
|
),
|
|
52265
53154
|
name: "Btc Transaction Signer",
|
|
52266
53155
|
description: "Production Btc Transaction Signer",
|
|
52267
53156
|
version: "1.1.1",
|
|
52268
53157
|
deployed: true,
|
|
52269
|
-
deployedAt:
|
|
52270
|
-
size:
|
|
52271
|
-
hash: "
|
|
53158
|
+
deployedAt: 1787923905597,
|
|
53159
|
+
size: 70646,
|
|
53160
|
+
hash: "37c3bb72a660c8275d92e1b73f9482742d86b64789480b9246304c0ca1bab47a"
|
|
52272
53161
|
},
|
|
52273
53162
|
ucdMintValidator: {
|
|
52274
|
-
cid: "
|
|
53163
|
+
cid: "QmUWR5fLiyimLT9TPXpYx3HgwNwkvR6MxjZ7hdeYCFodbc",
|
|
52275
53164
|
authorizedCidHex: cidToHex(
|
|
52276
|
-
"
|
|
53165
|
+
"QmUWR5fLiyimLT9TPXpYx3HgwNwkvR6MxjZ7hdeYCFodbc"
|
|
52277
53166
|
),
|
|
52278
53167
|
name: "Ucd Mint Validator",
|
|
52279
53168
|
description: "Production Ucd Mint Validator",
|
|
52280
53169
|
version: "1.2.1",
|
|
52281
53170
|
deployed: true,
|
|
52282
|
-
deployedAt:
|
|
52283
|
-
size:
|
|
52284
|
-
hash: "
|
|
53171
|
+
deployedAt: 1787923919527,
|
|
53172
|
+
size: 86197,
|
|
53173
|
+
hash: "c2d80939746cc37f65ef2f63c6a3215b929214a63f10c78144e1f5c98320dabf",
|
|
52285
53174
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
52286
53175
|
pkp: {
|
|
52287
53176
|
publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
|
|
@@ -52289,17 +53178,17 @@ var require_pkg_src2 = __commonJS2({
|
|
|
52289
53178
|
}
|
|
52290
53179
|
},
|
|
52291
53180
|
processPaymentValidator: {
|
|
52292
|
-
cid: "
|
|
53181
|
+
cid: "QmXmXuMRAjMLdgKGyTf9KQdGwYrDp8DxkiF44TvSXDf7wF",
|
|
52293
53182
|
authorizedCidHex: cidToHex(
|
|
52294
|
-
"
|
|
53183
|
+
"QmXmXuMRAjMLdgKGyTf9KQdGwYrDp8DxkiF44TvSXDf7wF"
|
|
52295
53184
|
),
|
|
52296
53185
|
name: "Process Payment Validator",
|
|
52297
53186
|
description: "Production Process Payment Validator",
|
|
52298
53187
|
version: "1.2.1",
|
|
52299
53188
|
deployed: true,
|
|
52300
|
-
deployedAt:
|
|
52301
|
-
size:
|
|
52302
|
-
hash: "
|
|
53189
|
+
deployedAt: 1787923987153,
|
|
53190
|
+
size: 82217,
|
|
53191
|
+
hash: "13defa19614215ab3b1fe88955d69e530d13a09475396af932fe0e213637da2f",
|
|
52303
53192
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
52304
53193
|
pkp: {
|
|
52305
53194
|
publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
|
|
@@ -52307,17 +53196,17 @@ var require_pkg_src2 = __commonJS2({
|
|
|
52307
53196
|
}
|
|
52308
53197
|
},
|
|
52309
53198
|
extendPositionValidator: {
|
|
52310
|
-
cid: "
|
|
53199
|
+
cid: "QmU8h99EEVEsQkxroXiYqLsKZw9gNjE6N5CcTpE9aUc12m",
|
|
52311
53200
|
authorizedCidHex: cidToHex(
|
|
52312
|
-
"
|
|
53201
|
+
"QmU8h99EEVEsQkxroXiYqLsKZw9gNjE6N5CcTpE9aUc12m"
|
|
52313
53202
|
),
|
|
52314
53203
|
name: "Extend Position Validator",
|
|
52315
53204
|
description: "Production Extend Position Validator",
|
|
52316
53205
|
version: "1.2.1",
|
|
52317
53206
|
deployed: true,
|
|
52318
|
-
deployedAt:
|
|
52319
|
-
size:
|
|
52320
|
-
hash: "
|
|
53207
|
+
deployedAt: 1787923999294,
|
|
53208
|
+
size: 79975,
|
|
53209
|
+
hash: "31c1aaf883ef22f37681ddb0a4a949be5c05304b6aef178989475a2da935ef9a",
|
|
52321
53210
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
52322
53211
|
pkp: {
|
|
52323
53212
|
publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
|
|
@@ -52325,17 +53214,17 @@ var require_pkg_src2 = __commonJS2({
|
|
|
52325
53214
|
}
|
|
52326
53215
|
},
|
|
52327
53216
|
btcWithdrawal: {
|
|
52328
|
-
cid: "
|
|
53217
|
+
cid: "QmZQWET9pzrVD4gwQuSzYZmqa24JrUNtnnGFDd513sxMCY",
|
|
52329
53218
|
authorizedCidHex: cidToHex(
|
|
52330
|
-
"
|
|
53219
|
+
"QmZQWET9pzrVD4gwQuSzYZmqa24JrUNtnnGFDd513sxMCY"
|
|
52331
53220
|
),
|
|
52332
53221
|
name: "Btc Withdrawal",
|
|
52333
53222
|
description: "Production Btc Withdrawal",
|
|
52334
53223
|
version: "1.2.7",
|
|
52335
53224
|
deployed: true,
|
|
52336
|
-
deployedAt:
|
|
52337
|
-
size:
|
|
52338
|
-
hash: "
|
|
53225
|
+
deployedAt: 1787924017769,
|
|
53226
|
+
size: 100069,
|
|
53227
|
+
hash: "4f8e27414e4da235e63d6ae1325c63f3d2fb956464515a21aa007a99935f0f13",
|
|
52339
53228
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
52340
53229
|
pkp: {
|
|
52341
53230
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
@@ -52447,30 +53336,30 @@ var require_pkg_src2 = __commonJS2({
|
|
|
52447
53336
|
hash: "03ee5be239c91c735d2c95db89a0d1b77e602cfc18af8eb64b3281fddcd90a72"
|
|
52448
53337
|
},
|
|
52449
53338
|
agentModuleExecutor: {
|
|
52450
|
-
cid: "
|
|
53339
|
+
cid: "QmcD65vuremot5fsHVgp9JBAmei6gAaEtm5mdtLP7Yt9Kf",
|
|
52451
53340
|
authorizedCidHex: cidToHex(
|
|
52452
|
-
"
|
|
53341
|
+
"QmcD65vuremot5fsHVgp9JBAmei6gAaEtm5mdtLP7Yt9Kf"
|
|
52453
53342
|
),
|
|
52454
53343
|
name: "Agent Module Executor",
|
|
52455
53344
|
description: "Production Agent Module Executor",
|
|
52456
53345
|
version: "1.1.1",
|
|
52457
53346
|
deployed: true,
|
|
52458
|
-
deployedAt:
|
|
52459
|
-
size:
|
|
52460
|
-
hash: "
|
|
53347
|
+
deployedAt: 1787924032013,
|
|
53348
|
+
size: 13878,
|
|
53349
|
+
hash: "a7f0204700912e26e5a354bee13a1242a2baa218643b3bb22d28481f67f9baf4"
|
|
52461
53350
|
},
|
|
52462
53351
|
staleSpendRecoveryValidator: {
|
|
52463
|
-
cid: "
|
|
53352
|
+
cid: "QmNuwo4PT4AikAmhMdZgPWCb2mJDwWa9TnUqrqvofjbrT8",
|
|
52464
53353
|
authorizedCidHex: cidToHex(
|
|
52465
|
-
"
|
|
53354
|
+
"QmNuwo4PT4AikAmhMdZgPWCb2mJDwWa9TnUqrqvofjbrT8"
|
|
52466
53355
|
),
|
|
52467
53356
|
name: "Stale Spend Recovery Validator",
|
|
52468
53357
|
description: "Production Stale Spend Recovery Validator",
|
|
52469
53358
|
version: "1.1.2",
|
|
52470
53359
|
deployed: true,
|
|
52471
|
-
deployedAt:
|
|
52472
|
-
size:
|
|
52473
|
-
hash: "
|
|
53360
|
+
deployedAt: 1787924048772,
|
|
53361
|
+
size: 41424,
|
|
53362
|
+
hash: "3c5f028d2bef4344768462993616d45e30d9d44ef126e04d6eb579821d57d99c",
|
|
52474
53363
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
52475
53364
|
pkp: {
|
|
52476
53365
|
publicKey: "0x046da0ad6da7dd4a0063cbeac6f2bdb6a9889c2178b23470833356a8ee5630f7f0eee0db348d9d9aaaadd23eccf0063c8f68ee5e446abe30b882bf1de4c932bc21",
|
|
@@ -52478,17 +53367,17 @@ var require_pkg_src2 = __commonJS2({
|
|
|
52478
53367
|
}
|
|
52479
53368
|
},
|
|
52480
53369
|
btcUtxoInvalidator: {
|
|
52481
|
-
cid: "
|
|
53370
|
+
cid: "QmaNGeWut7EiGwW4zUc2sFSt7RY5NWFgxYboyG333TwrJf",
|
|
52482
53371
|
authorizedCidHex: cidToHex(
|
|
52483
|
-
"
|
|
53372
|
+
"QmaNGeWut7EiGwW4zUc2sFSt7RY5NWFgxYboyG333TwrJf"
|
|
52484
53373
|
),
|
|
52485
53374
|
name: "Btc Utxo Invalidator",
|
|
52486
53375
|
description: "Production Btc Utxo Invalidator",
|
|
52487
53376
|
version: "1.0.0",
|
|
52488
53377
|
deployed: true,
|
|
52489
|
-
deployedAt:
|
|
52490
|
-
size:
|
|
52491
|
-
hash: "
|
|
53378
|
+
deployedAt: 1787924133241,
|
|
53379
|
+
size: 66026,
|
|
53380
|
+
hash: "603bc50920d7f1dee77086f2c518d9e2922ab3858a419d3fbea8221ea3a6d9e9"
|
|
52492
53381
|
}
|
|
52493
53382
|
};
|
|
52494
53383
|
function getDeploymentsForNetwork(network) {
|
|
@@ -53249,6 +54138,101 @@ ${errorReport}`);
|
|
|
53249
54138
|
var SECONDS_PER_DAY = 86400;
|
|
53250
54139
|
var DAYS_PER_MONTH = 30;
|
|
53251
54140
|
var LIT_ACTION_ETH_RPC_TIMEOUT_MS = 8e3;
|
|
54141
|
+
var PINNED_CONTRACT_ADDRESSES = {
|
|
54142
|
+
1: {
|
|
54143
|
+
PositionManager: "0x12A1836e56139ccaD8722B89519d84233efc224B",
|
|
54144
|
+
LoanOperationsManagerModule: "0x2561974A40F1AEed1251d0A090A83cF8536FB9E9",
|
|
54145
|
+
BTCSpendAuthorizer: "0xfBbF108486fa07F1B06a811C5b66ed68DD9c508a",
|
|
54146
|
+
BitcoinProviderRegistry: "0x4ab3Fb96e02893Ed6FAa61bad1918390c8DbbFFC",
|
|
54147
|
+
LITActionValidator: "0xD2c5d59c2CC5c409AC65ce0A817236aeC6869512",
|
|
54148
|
+
PositionDelegateRegistry: "0xf0aa2678aD4F60f49e8F7725089B5E86B7F8FE4C"
|
|
54149
|
+
},
|
|
54150
|
+
11155111: {
|
|
54151
|
+
PositionManager: "0x68e0507D982AEBF1D1C1Af8FBbd842327e2deeFF",
|
|
54152
|
+
LoanOperationsManagerModule: "0x3e05e760a87715207b7F4e8fD35EF7559BcA72C0",
|
|
54153
|
+
BTCSpendAuthorizer: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
54154
|
+
BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
54155
|
+
LITActionValidator: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
|
|
54156
|
+
PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9"
|
|
54157
|
+
}
|
|
54158
|
+
};
|
|
54159
|
+
function getPinnedContractAddresses(chainId) {
|
|
54160
|
+
return PINNED_CONTRACT_ADDRESSES[chainId] ?? null;
|
|
54161
|
+
}
|
|
54162
|
+
var PROTOCOL_EIP712_DOMAIN_NAME = "DiamondHands.Protocol";
|
|
54163
|
+
var PROTOCOL_EIP712_DOMAIN_VERSION = "1";
|
|
54164
|
+
var BORROWER_AUTHORIZATION_PRIMARY_TYPES = {
|
|
54165
|
+
MINT: "MintRequest",
|
|
54166
|
+
REPAY: "RepayRequest",
|
|
54167
|
+
RENEW: "RenewRequest",
|
|
54168
|
+
WITHDRAW: "WithdrawRequest"
|
|
54169
|
+
};
|
|
54170
|
+
var BORROWER_AUTHORIZATION_FIELDS = {
|
|
54171
|
+
MintRequest: [
|
|
54172
|
+
{ name: "positionId", type: "bytes32" },
|
|
54173
|
+
{ name: "mintAmount", type: "uint256" },
|
|
54174
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
54175
|
+
],
|
|
54176
|
+
RepayRequest: [
|
|
54177
|
+
{ name: "positionId", type: "bytes32" },
|
|
54178
|
+
{ name: "paymentAmount", type: "uint256" },
|
|
54179
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
54180
|
+
],
|
|
54181
|
+
RenewRequest: [
|
|
54182
|
+
{ name: "positionId", type: "bytes32" },
|
|
54183
|
+
{ name: "selectedTerm", type: "uint256" },
|
|
54184
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
54185
|
+
],
|
|
54186
|
+
WithdrawRequest: [
|
|
54187
|
+
{ name: "positionId", type: "bytes32" },
|
|
54188
|
+
{ name: "totalDeduction", type: "uint256" },
|
|
54189
|
+
{ name: "withdrawalAddress", type: "string" },
|
|
54190
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
54191
|
+
]
|
|
54192
|
+
};
|
|
54193
|
+
var BORROWER_AUTHORIZATION_ENCODE_TYPES = {
|
|
54194
|
+
MintRequest: "MintRequest(bytes32 positionId,uint256 mintAmount,uint256 quantumTimestamp)",
|
|
54195
|
+
RepayRequest: "RepayRequest(bytes32 positionId,uint256 paymentAmount,uint256 quantumTimestamp)",
|
|
54196
|
+
RenewRequest: "RenewRequest(bytes32 positionId,uint256 selectedTerm,uint256 quantumTimestamp)",
|
|
54197
|
+
WithdrawRequest: "WithdrawRequest(bytes32 positionId,uint256 totalDeduction,string withdrawalAddress,uint256 quantumTimestamp)"
|
|
54198
|
+
};
|
|
54199
|
+
function borrowerAuthorizationTypes(primaryType) {
|
|
54200
|
+
const fields = BORROWER_AUTHORIZATION_FIELDS[primaryType];
|
|
54201
|
+
if (!fields) {
|
|
54202
|
+
throw new Error(
|
|
54203
|
+
`Unknown borrower authorization primary type "${primaryType}"; expected one of ${Object.keys(BORROWER_AUTHORIZATION_FIELDS).join(", ")}`
|
|
54204
|
+
);
|
|
54205
|
+
}
|
|
54206
|
+
return { [primaryType]: fields.map((field) => ({ ...field })) };
|
|
54207
|
+
}
|
|
54208
|
+
function buildBorrowerAuthorizationDomain(chainId, verifyingContractOverride) {
|
|
54209
|
+
if (!Number.isInteger(chainId) || chainId <= 0) {
|
|
54210
|
+
throw new Error(
|
|
54211
|
+
`Borrower authorization domain requires a positive integer chainId, got ${String(chainId)}`
|
|
54212
|
+
);
|
|
54213
|
+
}
|
|
54214
|
+
const pinned = getPinnedContractAddresses(chainId);
|
|
54215
|
+
const pinnedLom = pinned?.LoanOperationsManagerModule;
|
|
54216
|
+
if (pinnedLom && verifyingContractOverride) {
|
|
54217
|
+
if (pinnedLom.toLowerCase() !== verifyingContractOverride.toLowerCase()) {
|
|
54218
|
+
throw new Error(
|
|
54219
|
+
`Refusing a caller-supplied verifyingContract that contradicts the pin for chainId ${chainId}: caller ${verifyingContractOverride}, pinned ${pinnedLom}`
|
|
54220
|
+
);
|
|
54221
|
+
}
|
|
54222
|
+
}
|
|
54223
|
+
const verifyingContract = pinnedLom ?? verifyingContractOverride;
|
|
54224
|
+
if (!verifyingContract) {
|
|
54225
|
+
throw new Error(
|
|
54226
|
+
`No pinned LoanOperationsManagerModule for chainId ${chainId} and no verifyingContract supplied; refusing to build a borrower authorization domain without one`
|
|
54227
|
+
);
|
|
54228
|
+
}
|
|
54229
|
+
return {
|
|
54230
|
+
name: PROTOCOL_EIP712_DOMAIN_NAME,
|
|
54231
|
+
version: PROTOCOL_EIP712_DOMAIN_VERSION,
|
|
54232
|
+
chainId,
|
|
54233
|
+
verifyingContract
|
|
54234
|
+
};
|
|
54235
|
+
}
|
|
53252
54236
|
var EVMChain = /* @__PURE__ */ ((EVMChain3) => {
|
|
53253
54237
|
EVMChain3["SEPOLIA"] = "sepolia";
|
|
53254
54238
|
EVMChain3["ETHEREUM"] = "ethereum";
|
|
@@ -55059,11 +56043,11 @@ ${auth.clientId}`;
|
|
|
55059
56043
|
);
|
|
55060
56044
|
const prices = await Promise.race([fetchAll, timeoutPromise]);
|
|
55061
56045
|
const sorted = [...prices].sort((a, b) => a - b);
|
|
55062
|
-
let
|
|
56046
|
+
let median2;
|
|
55063
56047
|
if (this.devSingleProvider) {
|
|
55064
|
-
|
|
56048
|
+
median2 = sorted[0];
|
|
55065
56049
|
} else {
|
|
55066
|
-
|
|
56050
|
+
median2 = sorted[1];
|
|
55067
56051
|
const spread3 = (sorted[2] - sorted[0]) / sorted[0];
|
|
55068
56052
|
if (spread3 > PRICE_ORACLE_TOLERANCE) {
|
|
55069
56053
|
const names = this.sources.map((s) => s.name).join(", ");
|
|
@@ -55073,10 +56057,10 @@ ${auth.clientId}`;
|
|
|
55073
56057
|
);
|
|
55074
56058
|
}
|
|
55075
56059
|
}
|
|
55076
|
-
const priceCents = Math.round(
|
|
56060
|
+
const priceCents = Math.round(median2 * 100);
|
|
55077
56061
|
const priceWith8Decimals = BigInt(priceCents) * 1000000n;
|
|
55078
56062
|
const totalElapsed = Date.now() - startTime;
|
|
55079
|
-
console.log(`[Price Oracle] Median price: $${
|
|
56063
|
+
console.log(`[Price Oracle] Median price: $${median2.toLocaleString()} \u2014 total time: ${totalElapsed}ms`);
|
|
55080
56064
|
console.log(`[Price Oracle] Price with 8 decimals: ${priceWith8Decimals}`);
|
|
55081
56065
|
return priceWith8Decimals;
|
|
55082
56066
|
}
|
|
@@ -56841,26 +57825,83 @@ var MAKE_PAYMENT_GAS_CEILING = BigInt(1e6);
|
|
|
56841
57825
|
var EXTEND_POSITION_GAS_CEILING = BigInt(1e6);
|
|
56842
57826
|
var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(1e6);
|
|
56843
57827
|
var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(2e6);
|
|
56844
|
-
|
|
56845
|
-
|
|
56846
|
-
|
|
56847
|
-
|
|
56848
|
-
|
|
56849
|
-
|
|
56850
|
-
|
|
56851
|
-
|
|
56852
|
-
|
|
56853
|
-
|
|
56854
|
-
|
|
57828
|
+
var PRIORITY_FEE_FLOOR_WEI = (0, import_ethers15.parseUnits)("0.1", "gwei");
|
|
57829
|
+
var PRIORITY_FEE_CAP_WEI = (0, import_ethers15.parseUnits)("3", "gwei");
|
|
57830
|
+
var FEE_HISTORY_BLOCK_COUNT = 20;
|
|
57831
|
+
var FEE_HISTORY_REWARD_PERCENTILE = 75;
|
|
57832
|
+
function isJsonRpcSendable(provider) {
|
|
57833
|
+
return typeof provider.send === "function";
|
|
57834
|
+
}
|
|
57835
|
+
function parseFeeHistory(raw) {
|
|
57836
|
+
if (typeof raw !== "object" || raw === null) {
|
|
57837
|
+
throw new Error(`eth_feeHistory returned a non-object result: ${JSON.stringify(raw)}`);
|
|
57838
|
+
}
|
|
57839
|
+
const { baseFeePerGas, reward } = raw;
|
|
57840
|
+
if (!Array.isArray(baseFeePerGas) || baseFeePerGas.length === 0) {
|
|
57841
|
+
throw new Error(
|
|
57842
|
+
`eth_feeHistory returned no baseFeePerGas \u2014 the RPC does not support EIP-1559 fee history: ${JSON.stringify(raw)}`
|
|
57843
|
+
);
|
|
56855
57844
|
}
|
|
57845
|
+
if (!Array.isArray(reward) || reward.length === 0) {
|
|
57846
|
+
throw new Error(
|
|
57847
|
+
`eth_feeHistory returned no reward percentiles \u2014 the RPC ignored the rewardPercentiles argument: ${JSON.stringify(raw)}`
|
|
57848
|
+
);
|
|
57849
|
+
}
|
|
57850
|
+
const nextBaseFee = (0, import_ethers15.getBigInt)(baseFeePerGas[baseFeePerGas.length - 1], "baseFeePerGas");
|
|
57851
|
+
const tips = reward.map((perBlock, i) => {
|
|
57852
|
+
if (!Array.isArray(perBlock) || perBlock.length === 0) {
|
|
57853
|
+
throw new Error(`eth_feeHistory reward row ${i} is empty: ${JSON.stringify(raw)}`);
|
|
57854
|
+
}
|
|
57855
|
+
return (0, import_ethers15.getBigInt)(perBlock[0], `reward[${i}]`);
|
|
57856
|
+
});
|
|
57857
|
+
return { nextBaseFee, tips };
|
|
57858
|
+
}
|
|
57859
|
+
function median(values) {
|
|
57860
|
+
const sorted = [...values].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
57861
|
+
const mid = sorted.length >> 1;
|
|
57862
|
+
const hi = sorted[mid];
|
|
57863
|
+
if (hi === void 0) {
|
|
57864
|
+
throw new Error("median: no values");
|
|
57865
|
+
}
|
|
57866
|
+
if (sorted.length % 2 === 1)
|
|
57867
|
+
return hi;
|
|
57868
|
+
const lo = sorted[mid - 1];
|
|
57869
|
+
if (lo === void 0) {
|
|
57870
|
+
throw new Error("median: no values");
|
|
57871
|
+
}
|
|
57872
|
+
return (lo + hi) / 2n;
|
|
57873
|
+
}
|
|
57874
|
+
function clamp(value, floor, cap) {
|
|
57875
|
+
if (value < floor)
|
|
57876
|
+
return floor;
|
|
57877
|
+
if (value > cap)
|
|
57878
|
+
return cap;
|
|
57879
|
+
return value;
|
|
57880
|
+
}
|
|
57881
|
+
async function resolveEip1559FeeFields(feeProvider) {
|
|
57882
|
+
if (!isJsonRpcSendable(feeProvider)) {
|
|
57883
|
+
throw new Error(
|
|
57884
|
+
"resolveEip1559FeeFields: feeProvider must be a JSON-RPC provider exposing send() (the SDK read provider), not a wallet BrowserProvider \u2014 eth_feeHistory is required"
|
|
57885
|
+
);
|
|
57886
|
+
}
|
|
57887
|
+
const history = parseFeeHistory(
|
|
57888
|
+
await feeProvider.send("eth_feeHistory", [
|
|
57889
|
+
(0, import_ethers15.toQuantity)(FEE_HISTORY_BLOCK_COUNT),
|
|
57890
|
+
"latest",
|
|
57891
|
+
[FEE_HISTORY_REWARD_PERCENTILE]
|
|
57892
|
+
])
|
|
57893
|
+
);
|
|
57894
|
+
const marketTip = median(history.tips);
|
|
57895
|
+
const maxPriorityFeePerGas = clamp(marketTip, PRIORITY_FEE_FLOOR_WEI, PRIORITY_FEE_CAP_WEI);
|
|
57896
|
+
const maxFeePerGas = history.nextBaseFee * 2n + maxPriorityFeePerGas;
|
|
56856
57897
|
return { maxFeePerGas, maxPriorityFeePerGas };
|
|
56857
57898
|
}
|
|
56858
57899
|
async function sendEip1559Transaction(params) {
|
|
56859
|
-
const { signer, to, data, gasLimit } = params;
|
|
57900
|
+
const { signer, feeProvider, to, data, gasLimit } = params;
|
|
56860
57901
|
if (!signer.provider) {
|
|
56861
57902
|
throw new Error("Signer must have a provider attached");
|
|
56862
57903
|
}
|
|
56863
|
-
const fees = await resolveEip1559FeeFields(
|
|
57904
|
+
const fees = await resolveEip1559FeeFields(feeProvider);
|
|
56864
57905
|
return signer.sendTransaction({
|
|
56865
57906
|
to,
|
|
56866
57907
|
data,
|
|
@@ -57044,6 +58085,77 @@ async function awaitSafeSubmissionWindowOnChain(signatureQuantum, chainNow, slee
|
|
|
57044
58085
|
);
|
|
57045
58086
|
return { waited: waitedSeconds > 0, waitedSeconds };
|
|
57046
58087
|
}
|
|
58088
|
+
init_deployment_addresses();
|
|
58089
|
+
var BORROWER_AUTHORIZATION_712_DOMAIN_NAME = "DiamondHands.Protocol";
|
|
58090
|
+
var BORROWER_AUTHORIZATION_712_DOMAIN_VERSION = "1";
|
|
58091
|
+
var BORROWER_AUTHORIZATION_712_FIELDS = {
|
|
58092
|
+
MintRequest: [
|
|
58093
|
+
{ name: "positionId", type: "bytes32" },
|
|
58094
|
+
{ name: "mintAmount", type: "uint256" },
|
|
58095
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
58096
|
+
],
|
|
58097
|
+
RepayRequest: [
|
|
58098
|
+
{ name: "positionId", type: "bytes32" },
|
|
58099
|
+
{ name: "paymentAmount", type: "uint256" },
|
|
58100
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
58101
|
+
],
|
|
58102
|
+
RenewRequest: [
|
|
58103
|
+
{ name: "positionId", type: "bytes32" },
|
|
58104
|
+
{ name: "selectedTerm", type: "uint256" },
|
|
58105
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
58106
|
+
],
|
|
58107
|
+
WithdrawRequest: [
|
|
58108
|
+
{ name: "positionId", type: "bytes32" },
|
|
58109
|
+
{ name: "totalDeduction", type: "uint256" },
|
|
58110
|
+
{ name: "withdrawalAddress", type: "string" },
|
|
58111
|
+
{ name: "quantumTimestamp", type: "uint256" }
|
|
58112
|
+
]
|
|
58113
|
+
};
|
|
58114
|
+
function borrowerAuthorization712Types(primaryType) {
|
|
58115
|
+
const fields = BORROWER_AUTHORIZATION_712_FIELDS[primaryType];
|
|
58116
|
+
if (!fields) {
|
|
58117
|
+
throw new Error(
|
|
58118
|
+
`Unknown borrower authorization primary type "${primaryType}"; expected one of ` + Object.keys(BORROWER_AUTHORIZATION_712_FIELDS).join(", ")
|
|
58119
|
+
);
|
|
58120
|
+
}
|
|
58121
|
+
return { [primaryType]: fields.map((field) => ({ ...field })) };
|
|
58122
|
+
}
|
|
58123
|
+
function buildBorrowerAuthorization712Domain(chainId) {
|
|
58124
|
+
if (!Number.isInteger(chainId) || chainId <= 0) {
|
|
58125
|
+
throw new Error(
|
|
58126
|
+
`Borrower authorization domain requires a positive integer chainId, got ${String(chainId)}`
|
|
58127
|
+
);
|
|
58128
|
+
}
|
|
58129
|
+
const deployment = Object.values(ALL_DEPLOYMENTS).find(
|
|
58130
|
+
(d) => d.chainId === chainId
|
|
58131
|
+
);
|
|
58132
|
+
const verifyingContract = deployment?.contracts?.LoanOperationsManagerModule;
|
|
58133
|
+
if (!verifyingContract) {
|
|
58134
|
+
throw new Error(
|
|
58135
|
+
`No LoanOperationsManagerModule deployment known for chainId ${chainId}; refusing to build a borrower authorization domain without one`
|
|
58136
|
+
);
|
|
58137
|
+
}
|
|
58138
|
+
return {
|
|
58139
|
+
name: BORROWER_AUTHORIZATION_712_DOMAIN_NAME,
|
|
58140
|
+
version: BORROWER_AUTHORIZATION_712_DOMAIN_VERSION,
|
|
58141
|
+
chainId,
|
|
58142
|
+
verifyingContract
|
|
58143
|
+
};
|
|
58144
|
+
}
|
|
58145
|
+
async function signBorrowerAuthorization712(signer, primaryType, chainId, message) {
|
|
58146
|
+
const signTypedData = signer.signTypedData;
|
|
58147
|
+
if (typeof signTypedData !== "function") {
|
|
58148
|
+
throw new Error(
|
|
58149
|
+
`Signer has no signTypedData \u2014 cannot produce an EIP-712 ${primaryType}. Wallets without typed-data support must supply the signature via an authorizationProvider instead of a connected signer.`
|
|
58150
|
+
);
|
|
58151
|
+
}
|
|
58152
|
+
return signTypedData.call(
|
|
58153
|
+
signer,
|
|
58154
|
+
buildBorrowerAuthorization712Domain(chainId),
|
|
58155
|
+
borrowerAuthorization712Types(primaryType),
|
|
58156
|
+
message
|
|
58157
|
+
);
|
|
58158
|
+
}
|
|
57047
58159
|
var PKP_NFT_ABI = [
|
|
57048
58160
|
"function getPubkey(uint256 tokenId) external view returns (bytes memory)"
|
|
57049
58161
|
];
|
|
@@ -57056,29 +58168,11 @@ async function generateMintAuthorization(positionId, amount, chainId, signerOrPr
|
|
|
57056
58168
|
const signer = signerOrPrecomputed;
|
|
57057
58169
|
const timestamp = calculateNextQuantumTimestamp();
|
|
57058
58170
|
const action = "mint-ucd";
|
|
57059
|
-
const
|
|
57060
|
-
const types = [
|
|
57061
|
-
"bytes32",
|
|
57062
|
-
// positionId
|
|
57063
|
-
"uint256",
|
|
57064
|
-
// timestamp
|
|
57065
|
-
"uint256",
|
|
57066
|
-
// chainId
|
|
57067
|
-
"uint256",
|
|
57068
|
-
// amount
|
|
57069
|
-
"bytes32"
|
|
57070
|
-
// actionHash
|
|
57071
|
-
];
|
|
57072
|
-
const values = [
|
|
58171
|
+
const signature = await signBorrowerAuthorization712(signer, "MintRequest", chainId, {
|
|
57073
58172
|
positionId,
|
|
57074
|
-
|
|
57075
|
-
|
|
57076
|
-
|
|
57077
|
-
actionHash
|
|
57078
|
-
];
|
|
57079
|
-
const messageHash = (0, import_ethers16.solidityPackedKeccak256)(types, values);
|
|
57080
|
-
const messageHashBytes = (0, import_ethers16.getBytes)(messageHash);
|
|
57081
|
-
const signature = await signer.signMessage(messageHashBytes);
|
|
58173
|
+
mintAmount: amount.toString(),
|
|
58174
|
+
quantumTimestamp: timestamp
|
|
58175
|
+
});
|
|
57082
58176
|
return {
|
|
57083
58177
|
positionId,
|
|
57084
58178
|
timestamp,
|
|
@@ -57115,44 +58209,17 @@ async function generatePaymentAuthorization(positionId, amount, chainId, signerO
|
|
|
57115
58209
|
throw new Error(`timestamp must be a number, got ${typeof timestamp}`);
|
|
57116
58210
|
}
|
|
57117
58211
|
const action = "make-payment";
|
|
57118
|
-
const actionHash = (0, import_ethers16.keccak256)((0, import_ethers16.toUtf8Bytes)(action));
|
|
57119
|
-
if (typeof actionHash !== "string") {
|
|
57120
|
-
throw new Error(`actionHash must be a string, got ${typeof actionHash}`);
|
|
57121
|
-
}
|
|
57122
|
-
const types = [
|
|
57123
|
-
"bytes32",
|
|
57124
|
-
// positionId
|
|
57125
|
-
"uint256",
|
|
57126
|
-
// timestamp
|
|
57127
|
-
"uint256",
|
|
57128
|
-
// chainId
|
|
57129
|
-
"uint256",
|
|
57130
|
-
// amount
|
|
57131
|
-
"bytes32"
|
|
57132
|
-
// actionHash
|
|
57133
|
-
];
|
|
57134
58212
|
const amountStr = amount.toString();
|
|
57135
|
-
|
|
57136
|
-
|
|
57137
|
-
|
|
57138
|
-
|
|
57139
|
-
}
|
|
57140
|
-
const values = [positionId, timestamp, chainId, amountStr, actionHash];
|
|
57141
|
-
for (let i = 0; i < values.length; i++) {
|
|
57142
|
-
if (typeof values[i] === "object" && values[i] !== null) {
|
|
57143
|
-
throw new Error(
|
|
57144
|
-
`Value at index ${i} is an object: ${JSON.stringify(values[i])}`
|
|
57145
|
-
);
|
|
57146
|
-
}
|
|
57147
|
-
}
|
|
57148
|
-
const messageHash = (0, import_ethers16.solidityPackedKeccak256)(types, values);
|
|
57149
|
-
const messageHashBytes = (0, import_ethers16.getBytes)(messageHash);
|
|
57150
|
-
const signature = await signer.signMessage(messageHashBytes);
|
|
58213
|
+
const signature = await signBorrowerAuthorization712(signer, "RepayRequest", chainId, {
|
|
58214
|
+
positionId,
|
|
58215
|
+
paymentAmount: amountStr,
|
|
58216
|
+
quantumTimestamp: timestamp
|
|
58217
|
+
});
|
|
57151
58218
|
return {
|
|
57152
58219
|
positionId,
|
|
57153
58220
|
timestamp,
|
|
57154
58221
|
chainId,
|
|
57155
|
-
amount:
|
|
58222
|
+
amount: amountStr,
|
|
57156
58223
|
action,
|
|
57157
58224
|
signature
|
|
57158
58225
|
};
|
|
@@ -57239,32 +58306,12 @@ async function generateWithdrawAuthorization(positionId, amount, chainId, signer
|
|
|
57239
58306
|
const signer = signerOrPrecomputed;
|
|
57240
58307
|
const timestamp = calculateNextQuantumTimestamp();
|
|
57241
58308
|
const action = "withdraw-btc";
|
|
57242
|
-
const
|
|
57243
|
-
const types = [
|
|
57244
|
-
"bytes32",
|
|
57245
|
-
// positionId
|
|
57246
|
-
"uint256",
|
|
57247
|
-
// timestamp
|
|
57248
|
-
"uint256",
|
|
57249
|
-
// chainId
|
|
57250
|
-
"uint256",
|
|
57251
|
-
// amount (in satoshis)
|
|
57252
|
-
"string",
|
|
57253
|
-
// destinationAddress (Bitcoin address)
|
|
57254
|
-
"bytes32"
|
|
57255
|
-
// actionHash
|
|
57256
|
-
];
|
|
57257
|
-
const values = [
|
|
58309
|
+
const signature = await signBorrowerAuthorization712(signer, "WithdrawRequest", chainId, {
|
|
57258
58310
|
positionId,
|
|
57259
|
-
|
|
57260
|
-
|
|
57261
|
-
|
|
57262
|
-
|
|
57263
|
-
actionHash
|
|
57264
|
-
];
|
|
57265
|
-
const messageHash = (0, import_ethers16.solidityPackedKeccak256)(types, values);
|
|
57266
|
-
const messageHashBytes = (0, import_ethers16.getBytes)(messageHash);
|
|
57267
|
-
const signature = await signer.signMessage(messageHashBytes);
|
|
58311
|
+
totalDeduction: amount.toString(),
|
|
58312
|
+
withdrawalAddress: destinationAddress,
|
|
58313
|
+
quantumTimestamp: timestamp
|
|
58314
|
+
});
|
|
57268
58315
|
return {
|
|
57269
58316
|
positionId,
|
|
57270
58317
|
timestamp,
|
|
@@ -57313,29 +58360,11 @@ async function generateExtendAuthorization(positionId, newTerm, chainId, signerO
|
|
|
57313
58360
|
const signer = signerOrPrecomputed;
|
|
57314
58361
|
const timestamp = calculateNextQuantumTimestamp();
|
|
57315
58362
|
const action = "extend-position";
|
|
57316
|
-
const
|
|
57317
|
-
const types = [
|
|
57318
|
-
"bytes32",
|
|
57319
|
-
// positionId
|
|
57320
|
-
"uint256",
|
|
57321
|
-
// timestamp
|
|
57322
|
-
"uint256",
|
|
57323
|
-
// chainId
|
|
57324
|
-
"uint256",
|
|
57325
|
-
// newTerm (extension term in months)
|
|
57326
|
-
"bytes32"
|
|
57327
|
-
// actionHash
|
|
57328
|
-
];
|
|
57329
|
-
const values = [
|
|
58363
|
+
const signature = await signBorrowerAuthorization712(signer, "RenewRequest", chainId, {
|
|
57330
58364
|
positionId,
|
|
57331
|
-
|
|
57332
|
-
|
|
57333
|
-
|
|
57334
|
-
actionHash
|
|
57335
|
-
];
|
|
57336
|
-
const messageHash = (0, import_ethers17.solidityPackedKeccak256)(types, values);
|
|
57337
|
-
const messageHashBytes = (0, import_ethers17.getBytes)(messageHash);
|
|
57338
|
-
const signature = await signer.signMessage(messageHashBytes);
|
|
58365
|
+
selectedTerm: newTerm,
|
|
58366
|
+
quantumTimestamp: timestamp
|
|
58367
|
+
});
|
|
57339
58368
|
return {
|
|
57340
58369
|
positionId,
|
|
57341
58370
|
timestamp,
|
|
@@ -57570,6 +58599,7 @@ var ServerSession = class {
|
|
|
57570
58599
|
store;
|
|
57571
58600
|
onSignaturePrompt;
|
|
57572
58601
|
onSignatureResolved;
|
|
58602
|
+
onSessionRestored;
|
|
57573
58603
|
now;
|
|
57574
58604
|
fetchImpl;
|
|
57575
58605
|
cached = null;
|
|
@@ -57610,6 +58640,7 @@ var ServerSession = class {
|
|
|
57610
58640
|
this.store = opts.persistSession === false ? null : opts.sessionStore ?? createDefaultSessionStore();
|
|
57611
58641
|
this.onSignaturePrompt = opts.onSignaturePrompt;
|
|
57612
58642
|
this.onSignatureResolved = opts.onSignatureResolved;
|
|
58643
|
+
this.onSessionRestored = opts.onSessionRestored;
|
|
57613
58644
|
this.now = opts.now ?? (() => Math.floor(Date.now() / 1e3));
|
|
57614
58645
|
this.fetchImpl = opts.fetchImpl ?? ((...a) => fetch(...a));
|
|
57615
58646
|
}
|
|
@@ -57690,7 +58721,7 @@ var ServerSession = class {
|
|
|
57690
58721
|
*/
|
|
57691
58722
|
async logout() {
|
|
57692
58723
|
const cached = this.cached;
|
|
57693
|
-
const token = cached && cached.expiresAt > this.now() ? cached.token : await this.
|
|
58724
|
+
const token = cached && cached.expiresAt > this.now() ? cached.token : await this.tryResolveSilently(this.generation, false).then((session) => session?.token ?? null).catch(() => null);
|
|
57694
58725
|
await this.clearPersisted();
|
|
57695
58726
|
if (!token)
|
|
57696
58727
|
return;
|
|
@@ -57762,8 +58793,9 @@ var ServerSession = class {
|
|
|
57762
58793
|
*
|
|
57763
58794
|
* `gen` is the caller's clear-generation snapshot: writes to `this.cached`
|
|
57764
58795
|
* and the store are skipped if a `clearPersisted()` landed meanwhile.
|
|
58796
|
+
* `announce` gates `onSessionRestored` for the two persisted-store outcomes.
|
|
57765
58797
|
*/
|
|
57766
|
-
async tryResolveSilently(gen) {
|
|
58798
|
+
async tryResolveSilently(gen, announce = true) {
|
|
57767
58799
|
const nowSec = this.now();
|
|
57768
58800
|
if (this.cached && this.cached.expiresAt - REFRESH_LEEWAY_SECONDS > nowSec) {
|
|
57769
58801
|
return this.cached;
|
|
@@ -57778,6 +58810,8 @@ var ServerSession = class {
|
|
|
57778
58810
|
};
|
|
57779
58811
|
if (gen === this.generation)
|
|
57780
58812
|
this.cached = adopted;
|
|
58813
|
+
if (announce)
|
|
58814
|
+
this.onSessionRestored?.();
|
|
57781
58815
|
return adopted;
|
|
57782
58816
|
}
|
|
57783
58817
|
try {
|
|
@@ -57786,6 +58820,8 @@ var ServerSession = class {
|
|
|
57786
58820
|
this.persist(persisted.payload, session);
|
|
57787
58821
|
this.cached = session;
|
|
57788
58822
|
}
|
|
58823
|
+
if (announce)
|
|
58824
|
+
this.onSessionRestored?.();
|
|
57789
58825
|
return session;
|
|
57790
58826
|
} catch (error) {
|
|
57791
58827
|
if (!isLoginRejection(error))
|
|
@@ -60871,6 +61907,10 @@ function normalizePkpId(pkpId) {
|
|
|
60871
61907
|
}
|
|
60872
61908
|
return pkpId;
|
|
60873
61909
|
}
|
|
61910
|
+
function isNormalizedChipotlePkpId(pkpId) {
|
|
61911
|
+
const rawId = pkpId.startsWith("0x") ? pkpId.slice(2) : pkpId;
|
|
61912
|
+
return rawId.length === 40;
|
|
61913
|
+
}
|
|
60874
61914
|
function padPkpIdForSubgraph(pkpId) {
|
|
60875
61915
|
const raw = pkpId.startsWith("0x") ? pkpId.slice(2) : pkpId;
|
|
60876
61916
|
if (raw.length === 40) {
|
|
@@ -61155,7 +62195,7 @@ var LoanQuery = class {
|
|
|
61155
62195
|
batch.map(async (loan) => {
|
|
61156
62196
|
try {
|
|
61157
62197
|
const rawId = loan.pkpId?.startsWith("0x") ? loan.pkpId.slice(2) : loan.pkpId;
|
|
61158
|
-
const isChipotlePkpId2 = typeof rawId === "string" && rawId
|
|
62198
|
+
const isChipotlePkpId2 = typeof rawId === "string" && isNormalizedChipotlePkpId(rawId);
|
|
61159
62199
|
if (isChipotlePkpId2) {
|
|
61160
62200
|
if (this.config.positionManagerCoreAddress && this.config.provider) {
|
|
61161
62201
|
const pmContract = new import_ethers26.Contract(
|
|
@@ -61482,6 +62522,7 @@ function createLoanQuery(config) {
|
|
|
61482
62522
|
);
|
|
61483
62523
|
}
|
|
61484
62524
|
}
|
|
62525
|
+
var STATIC_CALL_DIAGNOSTIC_TIMEOUT_MS = 5e3;
|
|
61485
62526
|
var WithdrawalAddressModule = class {
|
|
61486
62527
|
config;
|
|
61487
62528
|
graphClient;
|
|
@@ -61527,13 +62568,17 @@ var WithdrawalAddressModule = class {
|
|
|
61527
62568
|
const reg = this.getRegistry();
|
|
61528
62569
|
if (!reg.success)
|
|
61529
62570
|
return reg;
|
|
62571
|
+
const normalized = normalizeBitcoinAddress(btcAddress2);
|
|
61530
62572
|
try {
|
|
61531
|
-
const tx2 = await reg.value.addAddress(
|
|
61532
|
-
normalizeBitcoinAddress(btcAddress2)
|
|
61533
|
-
);
|
|
62573
|
+
const tx2 = await reg.value.addAddress(normalized);
|
|
61534
62574
|
return success(tx2);
|
|
61535
62575
|
} catch (error) {
|
|
61536
|
-
return this.txFailure(
|
|
62576
|
+
return this.txFailure(
|
|
62577
|
+
"addAddress",
|
|
62578
|
+
error,
|
|
62579
|
+
btcAddress2,
|
|
62580
|
+
await this.staticCallDiagnostic(reg.value, "addAddress", normalized)
|
|
62581
|
+
);
|
|
61537
62582
|
}
|
|
61538
62583
|
}
|
|
61539
62584
|
/** Remove a Bitcoin address from the caller's allowlist (effective immediately). */
|
|
@@ -61541,13 +62586,17 @@ var WithdrawalAddressModule = class {
|
|
|
61541
62586
|
const reg = this.getRegistry();
|
|
61542
62587
|
if (!reg.success)
|
|
61543
62588
|
return reg;
|
|
62589
|
+
const normalized = normalizeBitcoinAddress(btcAddress2);
|
|
61544
62590
|
try {
|
|
61545
|
-
const tx2 = await reg.value.removeAddress(
|
|
61546
|
-
normalizeBitcoinAddress(btcAddress2)
|
|
61547
|
-
);
|
|
62591
|
+
const tx2 = await reg.value.removeAddress(normalized);
|
|
61548
62592
|
return success(tx2);
|
|
61549
62593
|
} catch (error) {
|
|
61550
|
-
return this.txFailure(
|
|
62594
|
+
return this.txFailure(
|
|
62595
|
+
"removeAddress",
|
|
62596
|
+
error,
|
|
62597
|
+
btcAddress2,
|
|
62598
|
+
await this.staticCallDiagnostic(reg.value, "removeAddress", normalized)
|
|
62599
|
+
);
|
|
61551
62600
|
}
|
|
61552
62601
|
}
|
|
61553
62602
|
/**
|
|
@@ -61643,16 +62692,59 @@ var WithdrawalAddressModule = class {
|
|
|
61643
62692
|
}
|
|
61644
62693
|
return success(void 0);
|
|
61645
62694
|
}
|
|
61646
|
-
|
|
62695
|
+
/**
|
|
62696
|
+
* Ask the node for the reason a failed write did not carry.
|
|
62697
|
+
*
|
|
62698
|
+
* A failing `eth_estimateGas` frequently answers with NOTHING to decode — ethers renders that
|
|
62699
|
+
* as `missing revert data ... data=null, reason=null, revert=null`, which names no cause and
|
|
62700
|
+
* cannot distinguish "the contract rejected this" from "the RPC hiccuped". An `eth_call` of the
|
|
62701
|
+
* same calldata usually does carry the revert reason or custom-error selector, so this runs one
|
|
62702
|
+
* and folds the answer into the reported error.
|
|
62703
|
+
*
|
|
62704
|
+
* Three deliberate properties:
|
|
62705
|
+
*
|
|
62706
|
+
* 1. It runs ONLY after the write has already failed. Gating the write on a static call would
|
|
62707
|
+
* let a flaky endpoint — precisely the condition this exists to diagnose — block an add that
|
|
62708
|
+
* would otherwise have succeeded.
|
|
62709
|
+
* 2. It costs NO extra signature. `staticCall` is `eth_call`: a node read, never a wallet prompt.
|
|
62710
|
+
* 3. It can never throw. A diagnostic that escapes would replace the real cause with itself.
|
|
62711
|
+
* (The `try/catch` here is the authorized exception to CLAUDE.md's forbidden-patterns rule;
|
|
62712
|
+
* it swallows nothing — every branch returns text that is reported alongside the original.)
|
|
62713
|
+
*
|
|
62714
|
+
* A static call that SUCCEEDS is itself a finding: the contract accepts this call, so the
|
|
62715
|
+
* failure lay outside contract logic (RPC, gas, or nonce).
|
|
62716
|
+
*/
|
|
62717
|
+
async staticCallDiagnostic(registry, op, normalizedAddress) {
|
|
62718
|
+
try {
|
|
62719
|
+
await Promise.race([
|
|
62720
|
+
registry[op].staticCall(normalizedAddress),
|
|
62721
|
+
// The failure being diagnosed is often an unresponsive endpoint, so the diagnostic must
|
|
62722
|
+
// not inherit that hang — the user is waiting on this error message.
|
|
62723
|
+
new Promise(
|
|
62724
|
+
(_, reject) => setTimeout(
|
|
62725
|
+
() => reject(new Error("static call timed out after 5s")),
|
|
62726
|
+
STATIC_CALL_DIAGNOSTIC_TIMEOUT_MS
|
|
62727
|
+
)
|
|
62728
|
+
)
|
|
62729
|
+
]);
|
|
62730
|
+
return "static call SUCCEEDED \u2014 the contract accepts this call, so the failure was not contract logic (RPC, gas, or nonce)";
|
|
62731
|
+
} catch (diagnostic) {
|
|
62732
|
+
const code = typeof diagnostic === "object" && diagnostic !== null ? diagnostic.code : void 0;
|
|
62733
|
+
const msg = diagnostic instanceof Error ? diagnostic.message : String(diagnostic);
|
|
62734
|
+
return typeof code === "string" ? `static call reverted [${code}]: ${msg}` : `static call failed: ${msg}`;
|
|
62735
|
+
}
|
|
62736
|
+
}
|
|
62737
|
+
txFailure(op, error, context, diagnostic) {
|
|
61647
62738
|
const msg = error instanceof Error ? error.message : String(error);
|
|
62739
|
+
const detail = diagnostic ? `${msg} \u2014 ${diagnostic}` : msg;
|
|
61648
62740
|
return failure(
|
|
61649
62741
|
new SDKError({
|
|
61650
62742
|
code: `SDK_WITHDRAWAL_REGISTRY_${op.toUpperCase()}_FAILED`,
|
|
61651
|
-
message: `WithdrawalAddressRegistry.${op} failed: ${
|
|
62743
|
+
message: `WithdrawalAddressRegistry.${op} failed: ${detail}`,
|
|
61652
62744
|
category: "CONTRACT",
|
|
61653
62745
|
severity: "MEDIUM",
|
|
61654
62746
|
originalError: error instanceof Error ? error : new Error(String(error)),
|
|
61655
|
-
context: { op, context }
|
|
62747
|
+
context: { op, context, diagnostic }
|
|
61656
62748
|
})
|
|
61657
62749
|
);
|
|
61658
62750
|
}
|
|
@@ -62730,6 +63822,47 @@ function normalizePkpId2(pkpId) {
|
|
|
62730
63822
|
}
|
|
62731
63823
|
return pkpId;
|
|
62732
63824
|
}
|
|
63825
|
+
function applyLoanEventsFilter(events, opts) {
|
|
63826
|
+
const { wantsEvent, fromTimestamp, toTimestamp, fromBlock, toBlock, limit } = opts;
|
|
63827
|
+
const inBounds = (e) => {
|
|
63828
|
+
const ts = e?.timestamp;
|
|
63829
|
+
const bn = e?.blockNumber;
|
|
63830
|
+
try {
|
|
63831
|
+
if (fromTimestamp !== void 0 && ts !== void 0 && BigInt(ts) < BigInt(fromTimestamp))
|
|
63832
|
+
return false;
|
|
63833
|
+
if (toTimestamp !== void 0 && ts !== void 0 && BigInt(ts) > BigInt(toTimestamp))
|
|
63834
|
+
return false;
|
|
63835
|
+
if (fromBlock !== void 0 && bn !== void 0 && BigInt(bn) < BigInt(fromBlock))
|
|
63836
|
+
return false;
|
|
63837
|
+
if (toBlock !== void 0 && bn !== void 0 && BigInt(bn) > BigInt(toBlock))
|
|
63838
|
+
return false;
|
|
63839
|
+
} catch {
|
|
63840
|
+
return true;
|
|
63841
|
+
}
|
|
63842
|
+
return true;
|
|
63843
|
+
};
|
|
63844
|
+
const narrow = (list, kind) => wantsEvent(kind) ? (list ?? []).filter(inBounds).slice(0, limit) : [];
|
|
63845
|
+
const single = (value, kind) => value && wantsEvent(kind) && inBounds(value) ? value : void 0;
|
|
63846
|
+
const filtered = {
|
|
63847
|
+
...events,
|
|
63848
|
+
positionCreated: single(events.positionCreated, "positionCreated"),
|
|
63849
|
+
payments: narrow(events.payments, "payment"),
|
|
63850
|
+
statusUpdates: narrow(events.statusUpdates, "status"),
|
|
63851
|
+
liquidation: single(events.liquidation, "liquidation"),
|
|
63852
|
+
mints: narrow(events.mints, "mint"),
|
|
63853
|
+
withdrawals: narrow(events.withdrawals, "withdrawal"),
|
|
63854
|
+
renewals: narrow(events.renewals, "renewal"),
|
|
63855
|
+
operationFailures: narrow(events.operationFailures, "operationFailure"),
|
|
63856
|
+
mintRequests: narrow(events.mintRequests, "mintRequest"),
|
|
63857
|
+
burnRequests: narrow(events.burnRequests, "burnRequest"),
|
|
63858
|
+
collateralEvents: narrow(events.collateralEvents, "collateralEvent"),
|
|
63859
|
+
mintingFees: narrow(events.mintingFees, "mintingFee"),
|
|
63860
|
+
renewalFees: narrow(events.renewalFees, "renewalFee"),
|
|
63861
|
+
totalEvents: 0
|
|
63862
|
+
};
|
|
63863
|
+
filtered.totalEvents = (filtered.positionCreated ? 1 : 0) + (filtered.liquidation ? 1 : 0) + filtered.payments.length + filtered.statusUpdates.length + filtered.mints.length + filtered.withdrawals.length + filtered.renewals.length + filtered.operationFailures.length + filtered.mintRequests.length + filtered.burnRequests.length + filtered.collateralEvents.length + filtered.mintingFees.length + filtered.renewalFees.length;
|
|
63864
|
+
return filtered;
|
|
63865
|
+
}
|
|
62733
63866
|
function hasLoanEventsFilter(filter2) {
|
|
62734
63867
|
if (!filter2)
|
|
62735
63868
|
return false;
|
|
@@ -63886,32 +65019,24 @@ var DiamondHandsGraph = class {
|
|
|
63886
65019
|
limit = 1e3,
|
|
63887
65020
|
orderDirection = "desc"
|
|
63888
65021
|
} = filter2 || {};
|
|
65022
|
+
const wantsEvent = (kind) => !eventTypes || eventTypes.includes(kind);
|
|
65023
|
+
const hasBounds = fromTimestamp !== void 0 || toTimestamp !== void 0 || fromBlock !== void 0 || toBlock !== void 0;
|
|
65024
|
+
const pageSize = hasBounds ? THE_GRAPH_MAX_BATCH_SIZE : limit;
|
|
65025
|
+
const buildPositionWhereClause = () => `where: { position: "${positionId.toLowerCase()}" }`;
|
|
63889
65026
|
const shouldQuery = {
|
|
63890
|
-
positionCreated:
|
|
63891
|
-
payment:
|
|
63892
|
-
status:
|
|
63893
|
-
liquidation:
|
|
63894
|
-
mint:
|
|
63895
|
-
withdrawal:
|
|
63896
|
-
renewal:
|
|
63897
|
-
operationFailure:
|
|
63898
|
-
mintRequest:
|
|
63899
|
-
burnRequest:
|
|
63900
|
-
collateralEvent:
|
|
63901
|
-
mintingFee:
|
|
63902
|
-
renewalFee:
|
|
63903
|
-
};
|
|
63904
|
-
const buildPositionWhereClause = () => {
|
|
63905
|
-
const conditions = [`position: "${positionId.toLowerCase()}"`];
|
|
63906
|
-
if (fromTimestamp)
|
|
63907
|
-
conditions.push(`timestamp_gte: "${fromTimestamp}"`);
|
|
63908
|
-
if (toTimestamp)
|
|
63909
|
-
conditions.push(`timestamp_lte: "${toTimestamp}"`);
|
|
63910
|
-
if (fromBlock)
|
|
63911
|
-
conditions.push(`blockNumber_gte: "${fromBlock}"`);
|
|
63912
|
-
if (toBlock)
|
|
63913
|
-
conditions.push(`blockNumber_lte: "${toBlock}"`);
|
|
63914
|
-
return `where: { ${conditions.join(", ")} }`;
|
|
65027
|
+
positionCreated: true,
|
|
65028
|
+
payment: true,
|
|
65029
|
+
status: true,
|
|
65030
|
+
liquidation: true,
|
|
65031
|
+
mint: true,
|
|
65032
|
+
withdrawal: true,
|
|
65033
|
+
renewal: true,
|
|
65034
|
+
operationFailure: true,
|
|
65035
|
+
mintRequest: true,
|
|
65036
|
+
burnRequest: true,
|
|
65037
|
+
collateralEvent: true,
|
|
65038
|
+
mintingFee: true,
|
|
65039
|
+
renewalFee: true
|
|
63915
65040
|
};
|
|
63916
65041
|
const query = `
|
|
63917
65042
|
query GetLoanEvents($positionId: Bytes!, $limit: Int!, $orderDirection: OrderDirection!) {
|
|
@@ -64147,11 +65272,41 @@ var DiamondHandsGraph = class {
|
|
|
64147
65272
|
`;
|
|
64148
65273
|
const variables = {
|
|
64149
65274
|
positionId: positionId.toLowerCase(),
|
|
64150
|
-
limit,
|
|
65275
|
+
limit: pageSize,
|
|
64151
65276
|
orderDirection
|
|
64152
65277
|
};
|
|
64153
65278
|
const result = await this.client.execute(query, variables);
|
|
64154
|
-
|
|
65279
|
+
if (hasBounds) {
|
|
65280
|
+
const collections = [
|
|
65281
|
+
["payments", result.position?.payments],
|
|
65282
|
+
["statusUpdates", result.position?.statusUpdates],
|
|
65283
|
+
["withdrawals", result.position?.withdrawals],
|
|
65284
|
+
["renewals", result.position?.renewals],
|
|
65285
|
+
["operationFailures", result.position?.operationFailures],
|
|
65286
|
+
["mintRequests", result.position?.mintRequests],
|
|
65287
|
+
["burnRequests", result.position?.burnRequests],
|
|
65288
|
+
["mintingFees", result.position?.mintingFees],
|
|
65289
|
+
["renewalFees", result.position?.renewalFees],
|
|
65290
|
+
["mints", result.ucdmintEvents],
|
|
65291
|
+
["collateralEvents", result.collateralEvents]
|
|
65292
|
+
];
|
|
65293
|
+
const saturated = collections.filter(([, list]) => (list?.length ?? 0) >= pageSize).map(([name]) => name);
|
|
65294
|
+
if (saturated.length > 0) {
|
|
65295
|
+
log.warn(
|
|
65296
|
+
"[DiamondHandsGraph] bounded getLoanEvents page saturated \u2014 the filtered history may be incomplete",
|
|
65297
|
+
{ positionId, pageSize, saturated }
|
|
65298
|
+
);
|
|
65299
|
+
}
|
|
65300
|
+
}
|
|
65301
|
+
const assembled = this.assembleLoanEvents(positionId, result);
|
|
65302
|
+
return applyLoanEventsFilter(assembled, {
|
|
65303
|
+
wantsEvent,
|
|
65304
|
+
fromTimestamp,
|
|
65305
|
+
toTimestamp,
|
|
65306
|
+
fromBlock,
|
|
65307
|
+
toBlock,
|
|
65308
|
+
limit
|
|
65309
|
+
});
|
|
64155
65310
|
}
|
|
64156
65311
|
/**
|
|
64157
65312
|
* Map one position's raw event payload into `LoanEvents`.
|
|
@@ -69954,7 +71109,8 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
69954
71109
|
persistSession: config.sessionPersistence?.enabled,
|
|
69955
71110
|
sessionStore: config.sessionPersistence?.store,
|
|
69956
71111
|
onSignaturePrompt: config.onSessionSignaturePrompt,
|
|
69957
|
-
onSignatureResolved: config.onSessionSignatureResolved
|
|
71112
|
+
onSignatureResolved: config.onSessionSignatureResolved,
|
|
71113
|
+
onSessionRestored: config.onSessionRestored
|
|
69958
71114
|
});
|
|
69959
71115
|
}
|
|
69960
71116
|
const contractManagerResult = createContractManager({
|
|
@@ -71549,6 +72705,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
71549
72705
|
}
|
|
71550
72706
|
const tx2 = await sendEip1559Transaction({
|
|
71551
72707
|
signer,
|
|
72708
|
+
feeProvider: this.getProviderOrThrow(),
|
|
71552
72709
|
to: positionManagerAddress,
|
|
71553
72710
|
data: mintCalldata,
|
|
71554
72711
|
gasLimit: MINT_UCD_GAS_CEILING
|
|
@@ -72775,6 +73932,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
72775
73932
|
}
|
|
72776
73933
|
const tx2 = await sendEip1559Transaction({
|
|
72777
73934
|
signer: extendSigner,
|
|
73935
|
+
feeProvider: this.getProviderOrThrow(),
|
|
72778
73936
|
to: extendTo,
|
|
72779
73937
|
data: extendCalldata,
|
|
72780
73938
|
gasLimit: EXTEND_POSITION_GAS_CEILING
|
|
@@ -73709,6 +74867,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
73709
74867
|
}
|
|
73710
74868
|
const tx2 = await sendEip1559Transaction({
|
|
73711
74869
|
signer: paymentSigner,
|
|
74870
|
+
feeProvider: this.getProviderOrThrow(),
|
|
73712
74871
|
to: paymentContractAddress,
|
|
73713
74872
|
data: paymentCalldata,
|
|
73714
74873
|
gasLimit: MAKE_PAYMENT_GAS_CEILING
|
|
@@ -74474,6 +75633,7 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
74474
75633
|
});
|
|
74475
75634
|
tx2 = await sendEip1559Transaction({
|
|
74476
75635
|
signer: withdrawSigner,
|
|
75636
|
+
feeProvider: this.getProviderOrThrow(),
|
|
74477
75637
|
to: positionManagerAddress,
|
|
74478
75638
|
data: withdrawCalldata,
|
|
74479
75639
|
gasLimit: WITHDRAW_BTC_GAS_CEILING
|
|
@@ -83597,7 +84757,7 @@ mime-types/index.js:
|
|
|
83597
84757
|
*)
|
|
83598
84758
|
|
|
83599
84759
|
axios/dist/node/axios.cjs:
|
|
83600
|
-
(*! Axios v1.
|
|
84760
|
+
(*! Axios v1.20.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
83601
84761
|
|
|
83602
84762
|
safe-buffer/index.js:
|
|
83603
84763
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|