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webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/drop-claim-conditions-443a688e.browser.esm.js","webpack://_N_E/"],"sourcesContent":["import { utils, BigNumber, constants } from 'ethers';\nimport deepEqual from 'fast-deep-equal';\nimport { aM as resolveAddress, cw as AmountSchema, B as includesErrorMessage, d5 as isNode, cs as ContractWrapper } from './index-02e94cec.browser.esm.js';\nimport { y as transformResultToClaimCondition, z as legacyContractModelToAbstract, A as newContractModelToAbstract, C as ClaimEligibility, D as convertQuantityToBigNumber, f as fetchSnapshotEntryForAddress, E as prepareClaim, F as SnapshotFormatVersion, H as processClaimConditionInputs, I as abstractContractModelToLegacy, J as abstractContractModelToNew, K as updateExistingClaimConditions } from './signature-52783ae4.browser.esm.js';\nimport { i as isNativeToken, C as ContractEncoder } from './fetchCurrencyValue-a150f8dd.browser.esm.js';\nimport { d as detectContractFeature, h as hasFunction } from './contract-appuri-84a944c8.browser.esm.js';\nimport { f as buildTransactionFunction, T as Transaction } from './transactions-91b95b4c.browser.esm.js';\n\n/**\n * Manages claim conditions for NFT Drop contracts\n * @erc721\n * @public\n */\nclass DropClaimConditions {\n constructor(contractWrapper, metadata, storage) {\n this.storage = storage;\n this.contractWrapper = contractWrapper;\n this.metadata = metadata;\n }\n\n /** ***************************************\n * READ FUNCTIONS\n *****************************************/\n\n /**\n * Get the currently active claim condition\n *\n * @returns The claim condition metadata\n */\n async getActive(options) {\n const [cc, metadata, tokenDecimals] = await Promise.all([this.get(), this.metadata.get(), this.getTokenDecimals()]);\n return await transformResultToClaimCondition(cc, tokenDecimals, this.contractWrapper.getProvider(), metadata.merkle || {}, this.storage, options?.withAllowList || false);\n }\n async get(conditionId) {\n if (this.isLegacySinglePhaseDrop(this.contractWrapper)) {\n const contractModel = await this.contractWrapper.read(\"claimCondition\", []);\n return legacyContractModelToAbstract(contractModel);\n } else if (this.isLegacyMultiPhaseDrop(this.contractWrapper)) {\n const id = conditionId !== undefined ? conditionId : await this.contractWrapper.read(\"getActiveClaimConditionId\", []);\n const contractModel = await this.contractWrapper.read(\"getClaimConditionById\", [id]);\n return legacyContractModelToAbstract(contractModel);\n } else if (this.isNewSinglePhaseDrop(this.contractWrapper)) {\n const contractModel = await this.contractWrapper.read(\"claimCondition\", []);\n return newContractModelToAbstract(contractModel);\n } else if (this.isNewMultiphaseDrop(this.contractWrapper)) {\n const id = conditionId !== undefined ? conditionId : await this.contractWrapper.read(\"getActiveClaimConditionId\", []);\n const contractModel = await this.contractWrapper.read(\"getClaimConditionById\", [id]);\n return newContractModelToAbstract(contractModel);\n } else {\n throw new Error(\"Contract does not support claim conditions\");\n }\n }\n\n /**\n * Get all the claim conditions\n *\n * @returns The claim conditions metadata\n */\n async getAll(options) {\n if (this.isLegacyMultiPhaseDrop(this.contractWrapper) || this.isNewMultiphaseDrop(this.contractWrapper)) {\n const [currentStartId, countBn] = await this.contractWrapper.read(\"claimCondition\", []);\n const startId = currentStartId.toNumber();\n const count = countBn.toNumber();\n const conditions = [];\n for (let i = startId; i < startId + count; i++) {\n conditions.push(this.get(i));\n }\n const [metadata, decimals, ...fetchedConditions] = await Promise.all([this.metadata.get(), this.getTokenDecimals(), ...conditions]);\n return Promise.all(fetchedConditions.map(c => transformResultToClaimCondition(c, decimals, this.contractWrapper.getProvider(), metadata.merkle, this.storage, options?.withAllowList || false)));\n } else {\n return [await this.getActive(options)];\n }\n }\n\n /**\n * Can Claim\n *\n * @remarks Check if the drop can currently be claimed.\n *\n * @example\n * ```javascript\n * // Quantity of tokens to check claimability of\n * const quantity = 1;\n * const canClaim = await contract.canClaim(quantity);\n * ```\n */\n async canClaim(quantity, addressToCheck) {\n // TODO switch to use verifyClaim\n if (addressToCheck) {\n addressToCheck = await resolveAddress(addressToCheck);\n }\n return (await this.getClaimIneligibilityReasons(quantity, addressToCheck)).length === 0;\n }\n\n /**\n * For any claim conditions that a particular wallet is violating,\n * this function returns human readable information about the\n * breaks in the condition that can be used to inform the user.\n *\n * @param quantity - The desired quantity that would be claimed.\n * @param addressToCheck - The wallet address, defaults to the connected wallet.\n *\n */\n async getClaimIneligibilityReasons(quantity, addressToCheck) {\n const reasons = [];\n let activeConditionIndex;\n let claimCondition;\n if (addressToCheck === undefined) {\n try {\n addressToCheck = await this.contractWrapper.getSignerAddress();\n } catch (err) {\n console.warn(\"failed to get signer address\", err);\n }\n }\n\n // if we have been unable to get a signer address, we can't check eligibility, so return a NoWallet error reason\n if (!addressToCheck) {\n return [ClaimEligibility.NoWallet];\n }\n const [resolvedAddress, decimals] = await Promise.all([resolveAddress(addressToCheck), this.getTokenDecimals()]);\n const quantityWithDecimals = utils.parseUnits(AmountSchema.parse(quantity), decimals);\n try {\n claimCondition = await this.getActive();\n } catch (err) {\n if (includesErrorMessage(err, \"!CONDITION\") || includesErrorMessage(err, \"no active mint condition\") || includesErrorMessage(err, \"DropNoActiveCondition\")) {\n reasons.push(ClaimEligibility.NoClaimConditionSet);\n return reasons;\n }\n console.warn(\"failed to get active claim condition\", err);\n reasons.push(ClaimEligibility.Unknown);\n return reasons;\n }\n if (claimCondition.availableSupply !== \"unlimited\") {\n const supplyWithDecimals = utils.parseUnits(claimCondition.availableSupply, decimals);\n if (supplyWithDecimals.lt(quantityWithDecimals)) {\n reasons.push(ClaimEligibility.NotEnoughSupply);\n return reasons;\n }\n }\n\n // check for merkle root inclusion\n const merkleRootArray = utils.stripZeros(claimCondition.merkleRootHash);\n const hasAllowList = merkleRootArray.length > 0;\n let allowListEntry = null;\n if (hasAllowList) {\n allowListEntry = await this.getClaimerProofs(resolvedAddress);\n if (!allowListEntry && (this.isLegacySinglePhaseDrop(this.contractWrapper) || this.isLegacyMultiPhaseDrop(this.contractWrapper))) {\n // exclusive allowlist behavior\n reasons.push(ClaimEligibility.AddressNotAllowed);\n return reasons;\n }\n if (allowListEntry) {\n try {\n const claimVerification = await this.prepareClaim(quantity, false, decimals, resolvedAddress);\n let validMerkleProof;\n if (this.isLegacyMultiPhaseDrop(this.contractWrapper)) {\n activeConditionIndex = await this.contractWrapper.read(\"getActiveClaimConditionId\", []);\n // legacy verifyClaimerMerkleProofs function\n [validMerkleProof] = await this.contractWrapper.read(\"verifyClaimMerkleProof\", [activeConditionIndex, resolvedAddress, quantity, claimVerification.proofs, claimVerification.maxClaimable]);\n if (!validMerkleProof) {\n reasons.push(ClaimEligibility.AddressNotAllowed);\n return reasons;\n }\n } else if (this.isLegacySinglePhaseDrop(this.contractWrapper)) {\n [validMerkleProof] = await this.contractWrapper.read(\"verifyClaimMerkleProof\", [resolvedAddress, quantity, {\n proof: claimVerification.proofs,\n maxQuantityInAllowlist: claimVerification.maxClaimable\n }]);\n if (!validMerkleProof) {\n reasons.push(ClaimEligibility.AddressNotAllowed);\n return reasons;\n }\n } else if (this.isNewSinglePhaseDrop(this.contractWrapper)) {\n await this.contractWrapper.read(\"verifyClaim\", [resolvedAddress, quantity, claimVerification.currencyAddress, claimVerification.price, {\n proof: claimVerification.proofs,\n quantityLimitPerWallet: claimVerification.maxClaimable,\n currency: claimVerification.currencyAddressInProof,\n pricePerToken: claimVerification.priceInProof\n }]);\n } else if (this.isNewMultiphaseDrop(this.contractWrapper)) {\n activeConditionIndex = await this.contractWrapper.read(\"getActiveClaimConditionId\", []);\n await this.contractWrapper.read(\"verifyClaim\", [activeConditionIndex, resolvedAddress, quantity, claimVerification.currencyAddress, claimVerification.price, {\n proof: claimVerification.proofs,\n quantityLimitPerWallet: claimVerification.maxClaimable,\n currency: claimVerification.currencyAddressInProof,\n pricePerToken: claimVerification.priceInProof\n }]);\n }\n } catch (e) {\n console.warn(\"Merkle proof verification failed:\", \"reason\" in e ? e.reason || e.errorName : e);\n const reason = e.reason || e.errorName;\n switch (reason) {\n case \"!Qty\":\n case \"DropClaimExceedLimit\":\n reasons.push(ClaimEligibility.OverMaxClaimablePerWallet);\n break;\n case \"!PriceOrCurrency\":\n case \"DropClaimInvalidTokenPrice\":\n reasons.push(ClaimEligibility.WrongPriceOrCurrency);\n break;\n case \"!MaxSupply\":\n case \"DropClaimExceedMaxSupply\":\n reasons.push(ClaimEligibility.NotEnoughSupply);\n break;\n case \"cant claim yet\":\n case \"DropClaimNotStarted\":\n reasons.push(ClaimEligibility.ClaimPhaseNotStarted);\n break;\n default:\n {\n reasons.push(ClaimEligibility.AddressNotAllowed);\n break;\n }\n }\n return reasons;\n }\n }\n }\n if (this.isNewSinglePhaseDrop(this.contractWrapper) || this.isNewMultiphaseDrop(this.contractWrapper)) {\n let claimedSupply = BigNumber.from(0);\n let maxClaimable = convertQuantityToBigNumber(claimCondition.maxClaimablePerWallet, decimals);\n try {\n claimedSupply = await this.getSupplyClaimedByWallet(resolvedAddress);\n } catch (e) {\n // no-op\n }\n if (allowListEntry) {\n maxClaimable = convertQuantityToBigNumber(allowListEntry.maxClaimable, decimals);\n }\n if (maxClaimable.gt(0) && maxClaimable.lt(claimedSupply.add(quantityWithDecimals))) {\n reasons.push(ClaimEligibility.OverMaxClaimablePerWallet);\n return reasons;\n }\n\n // if there is no allowlist, or if there is an allowlist and the address is not in it\n // if maxClaimable is 0, we consider it as the address is not allowed\n if (!hasAllowList || hasAllowList && !allowListEntry) {\n if (maxClaimable.lte(claimedSupply) || maxClaimable.eq(0)) {\n reasons.push(ClaimEligibility.AddressNotAllowed);\n return reasons;\n }\n }\n }\n\n // check for claim timestamp between claims (ONLY FOR LEGACY)\n if (this.isLegacySinglePhaseDrop(this.contractWrapper) || this.isLegacyMultiPhaseDrop(this.contractWrapper)) {\n let [lastClaimedTimestamp, timestampForNextClaim] = [BigNumber.from(0), BigNumber.from(0)];\n if (this.isLegacyMultiPhaseDrop(this.contractWrapper)) {\n activeConditionIndex = await this.contractWrapper.read(\"getActiveClaimConditionId\", []);\n [lastClaimedTimestamp, timestampForNextClaim] = await this.contractWrapper.read(\"getClaimTimestamp\", [activeConditionIndex, resolvedAddress]);\n } else if (this.isLegacySinglePhaseDrop(this.contractWrapper)) {\n // check for claim timestamp between claims\n [lastClaimedTimestamp, timestampForNextClaim] = await this.contractWrapper.read(\"getClaimTimestamp\", [resolvedAddress]);\n }\n const now = BigNumber.from(Date.now()).div(1000);\n if (lastClaimedTimestamp.gt(0) && now.lt(timestampForNextClaim)) {\n // contract will return MaxUint256 if user has already claimed and cannot claim again\n if (timestampForNextClaim.eq(constants.MaxUint256)) {\n reasons.push(ClaimEligibility.AlreadyClaimed);\n } else {\n reasons.push(ClaimEligibility.WaitBeforeNextClaimTransaction);\n }\n return reasons;\n }\n }\n\n // if not within a browser context, check for wallet balance.\n // In browser context, let the wallet do that job\n if (claimCondition.price.gt(0) && isNode()) {\n const totalPrice = claimCondition.price.mul(BigNumber.from(quantity));\n const provider = this.contractWrapper.getProvider();\n if (isNativeToken(claimCondition.currencyAddress)) {\n const balance = await provider.getBalance(resolvedAddress);\n if (balance.lt(totalPrice)) {\n reasons.push(ClaimEligibility.NotEnoughTokens);\n }\n } else {\n const ERC20Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC20.json')).default;\n const erc20 = new ContractWrapper(provider, claimCondition.currencyAddress, ERC20Abi, {}, this.storage);\n const balance = await erc20.read(\"balanceOf\", [resolvedAddress]);\n if (balance.lt(totalPrice)) {\n reasons.push(ClaimEligibility.NotEnoughTokens);\n }\n }\n }\n return reasons;\n }\n\n /**\n * Returns allow list information and merkle proofs for the given address.\n * @param claimerAddress - the claimer address\n * @param claimConditionId - optional the claim condition id to get the proofs for\n */\n async getClaimerProofs(claimerAddress, claimConditionId) {\n const claimCondition = await this.get(claimConditionId);\n const merkleRoot = claimCondition.merkleRoot;\n const merkleRootArray = utils.stripZeros(merkleRoot);\n if (merkleRootArray.length > 0) {\n const [metadata, resolvedAddress] = await Promise.all([this.metadata.get(), resolveAddress(claimerAddress)]);\n return await fetchSnapshotEntryForAddress(resolvedAddress, merkleRoot.toString(), metadata.merkle, this.contractWrapper.getProvider(), this.storage, this.getSnapshotFormatVersion());\n } else {\n return null;\n }\n }\n\n /**\n * Get the total supply claimed by a specific wallet\n * @param walletAddress - the wallet address to check\n * @returns The total supply claimed\n */\n async getSupplyClaimedByWallet(walletAddress) {\n const resolvedAddress = await resolveAddress(walletAddress);\n if (this.isNewSinglePhaseDrop(this.contractWrapper)) {\n return await this.contractWrapper.read(\"getSupplyClaimedByWallet\", [resolvedAddress]);\n }\n if (this.isNewMultiphaseDrop(this.contractWrapper)) {\n const activeClaimConditionId = await this.contractWrapper.read(\"getActiveClaimConditionId\", []);\n return await this.contractWrapper.read(\"getSupplyClaimedByWallet\", [activeClaimConditionId, resolvedAddress]);\n }\n throw new Error(\"This contract does not support the getSupplyClaimedByWallet function\");\n }\n\n /** ***************************************\n * WRITE FUNCTIONS\n *****************************************/\n\n /**\n * Set public mint conditions\n *\n * @remarks Sets the public mint conditions that need to be fullfiled by users to claim NFTs.\n *\n * @example\n * ```javascript\n * const presaleStartTime = new Date();\n * const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);\n *\n * // Optionally specify addresses that can claim\n * const snapshots = ['0x...', '0x...']\n *\n * // Or alternatively, you can pass snapshots with the max number of NFTs each address can claim\n * // const snapshots = [{ address: '0x...', maxClaimable: 1 }, { address: '0x...', maxClaimable: 2 }]\n *\n * const claimConditions = [\n * {\n * startTime: presaleStartTime, // start the presale now\n * maxClaimableSupply: 2, // limit how many mints for this presale\n * price: 0.01, // presale price\n * snapshot: snapshots, // limit minting to only certain addresses\n * },\n * {\n * startTime: publicSaleStartTime, // 24h after presale, start public sale\n * price: 0.08, // public sale price\n * }\n * ]);\n *\n * await dropContract.claimConditions.set(claimConditions);\n * ```\n *\n * @param claimConditionInputs - The claim conditions\n * @param resetClaimEligibilityForAll - Whether to reset the state of who already claimed NFTs previously\n */\n set = /* @__PURE__ */buildTransactionFunction((() => {\n var _this = this;\n return async function (claimConditionInputs) {\n let resetClaimEligibilityForAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let claimConditionsProcessed = claimConditionInputs;\n if (_this.isLegacySinglePhaseDrop(_this.contractWrapper) || _this.isNewSinglePhaseDrop(_this.contractWrapper)) {\n resetClaimEligibilityForAll = true;\n if (claimConditionInputs.length === 0) {\n claimConditionsProcessed = [{\n startTime: new Date(0),\n currencyAddress: constants.AddressZero,\n price: 0,\n maxClaimableSupply: 0,\n maxClaimablePerWallet: 0,\n waitInSeconds: 0,\n merkleRootHash: utils.hexZeroPad([0], 32),\n snapshot: []\n }];\n } else if (claimConditionInputs.length > 1) {\n throw new Error(\"Single phase drop contract cannot have multiple claim conditions, only one is allowed\");\n }\n }\n\n // if using new snapshot format, make sure that maxClaimablePerWallet is set if allowlist is set as well\n if (_this.isNewSinglePhaseDrop(_this.contractWrapper) || _this.isNewMultiphaseDrop(_this.contractWrapper)) {\n claimConditionsProcessed.forEach(cc => {\n if (cc.snapshot && cc.snapshot.length > 0 && (cc.maxClaimablePerWallet === undefined || cc.maxClaimablePerWallet === \"unlimited\")) {\n throw new Error(\"maxClaimablePerWallet must be set to a specific value when an allowlist is set.\\n\" + \"Example: Set it to 0 to only allow addresses in the allowlist to claim the amount specified in the allowlist.\\n\" + \"contract.claimConditions.set([{ snapshot: [{ address: '0x...', maxClaimable: 1 }], maxClaimablePerWallet: 0 }])\");\n }\n if (cc.snapshot && cc.snapshot.length > 0 && cc.maxClaimablePerWallet?.toString() === \"0\" && cc.snapshot.map(s => {\n if (typeof s === \"string\") {\n return 0;\n } else {\n return Number(s.maxClaimable?.toString() || 0);\n }\n }).reduce((acc, current) => {\n return acc + current;\n }, 0) === 0) {\n throw new Error(\"maxClaimablePerWallet is set to 0, and all addresses in the allowlist have max claimable 0. This means that no one can claim.\");\n }\n });\n }\n\n // process inputs\n const {\n snapshotInfos,\n sortedConditions\n } = await processClaimConditionInputs(claimConditionsProcessed, await _this.getTokenDecimals(), _this.contractWrapper.getProvider(), _this.storage, _this.getSnapshotFormatVersion());\n const merkleInfo = {};\n snapshotInfos.forEach(s => {\n merkleInfo[s.merkleRoot] = s.snapshotUri;\n });\n const metadata = await _this.metadata.get();\n const encoded = [];\n\n // upload new merkle roots to snapshot URIs if updated\n if (!deepEqual(metadata.merkle, merkleInfo)) {\n const mergedMetadata = await _this.metadata.parseInputMetadata({\n ...metadata,\n merkle: merkleInfo\n });\n // using internal method to just upload, avoids one contract call\n const contractURI = await _this.metadata._parseAndUploadMetadata(mergedMetadata);\n\n // TODO (cc) we could write the merkle tree info on the claim condition metadata instead\n // TODO (cc) but we still need to maintain the behavior here for older contracts\n if (hasFunction(\"setContractURI\", _this.contractWrapper)) {\n const contractEncoder = new ContractEncoder(_this.contractWrapper);\n encoded.push(contractEncoder.encode(\"setContractURI\", [contractURI]));\n } else {\n throw new Error(\"Setting a merkle root requires implementing ContractMetadata in your contract to support storing a merkle root.\");\n }\n }\n const cw = _this.contractWrapper;\n const baseContractEncoder = new ContractEncoder(cw);\n if (_this.isLegacySinglePhaseDrop(cw)) {\n const contractEncoderLegacy = new ContractEncoder(cw);\n encoded.push(contractEncoderLegacy.encode(\"setClaimConditions\", [abstractContractModelToLegacy(sortedConditions[0]), resetClaimEligibilityForAll]));\n } else if (_this.isLegacyMultiPhaseDrop(cw)) {\n encoded.push(baseContractEncoder.encode(\"setClaimConditions\", [sortedConditions.map(abstractContractModelToLegacy), resetClaimEligibilityForAll]));\n } else if (_this.isNewSinglePhaseDrop(cw)) {\n encoded.push(baseContractEncoder.encode(\"setClaimConditions\", [abstractContractModelToNew(sortedConditions[0]), resetClaimEligibilityForAll]));\n } else if (_this.isNewMultiphaseDrop(cw)) {\n encoded.push(baseContractEncoder.encode(\"setClaimConditions\", [sortedConditions.map(abstractContractModelToNew), resetClaimEligibilityForAll]));\n } else {\n throw new Error(\"Contract does not support claim conditions\");\n }\n if (hasFunction(\"multicall\", _this.contractWrapper)) {\n return Transaction.fromContractWrapper({\n contractWrapper: _this.contractWrapper,\n method: \"multicall\",\n args: [encoded]\n });\n }\n throw new Error(\"Contract does not support multicall\");\n };\n })());\n\n /**\n * Update a single claim condition with new data.\n *\n * @param index - the index of the claim condition to update, as given by the index from the result of `getAll()`\n * @param claimConditionInput - the new data to update, previous data will be retained\n */\n update = /* @__PURE__ */buildTransactionFunction(async (index, claimConditionInput) => {\n const existingConditions = await this.getAll();\n const newConditionInputs = await updateExistingClaimConditions(index, claimConditionInput, existingConditions);\n return await this.set.prepare(newConditionInputs);\n });\n\n /** ***************************************\n * PRIVATE FUNCTIONS\n *****************************************/\n\n async getTokenDecimals() {\n if (detectContractFeature(this.contractWrapper, \"ERC20\")) {\n return this.contractWrapper.read(\"decimals\", []);\n } else {\n return Promise.resolve(0);\n }\n }\n\n /**\n * Returns proofs and the overrides required for the transaction.\n *\n * @returns `overrides` and `proofs` as an object.\n * @internal\n */\n async prepareClaim(quantity, checkERC20Allowance) {\n let decimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n let address = arguments.length > 3 ? arguments[3] : undefined;\n const [addressToClaim, activeClaimConditions] = await Promise.all([address ? address : this.contractWrapper.getSignerAddress(), this.getActive()]);\n return prepareClaim(addressToClaim, quantity, activeClaimConditions, async () => (await this.metadata.get()).merkle, decimals, this.contractWrapper, this.storage, checkERC20Allowance, this.getSnapshotFormatVersion());\n }\n async getClaimArguments(destinationAddress, quantity, claimVerification) {\n const resolvedAddress = await resolveAddress(destinationAddress);\n if (this.isLegacyMultiPhaseDrop(this.contractWrapper)) {\n return [resolvedAddress, quantity, claimVerification.currencyAddress, claimVerification.price, claimVerification.proofs, claimVerification.maxClaimable];\n } else if (this.isLegacySinglePhaseDrop(this.contractWrapper)) {\n return [resolvedAddress, quantity, claimVerification.currencyAddress, claimVerification.price, {\n proof: claimVerification.proofs,\n maxQuantityInAllowlist: claimVerification.maxClaimable\n }, utils.toUtf8Bytes(\"\")];\n }\n return [resolvedAddress, quantity, claimVerification.currencyAddress, claimVerification.price, {\n proof: claimVerification.proofs,\n quantityLimitPerWallet: claimVerification.maxClaimable,\n pricePerToken: claimVerification.priceInProof,\n currency: claimVerification.currencyAddressInProof\n }, utils.toUtf8Bytes(\"\")];\n }\n\n /**\n * Construct a claim transaction without executing it.\n * This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.\n * @param destinationAddress - The address to claim to\n * @param quantity - The quantity to claim\n * @param options - Options to override the claim transaction\n *\n * @deprecated Use `contract.erc721.claim.prepare(...args)` instead\n */\n async getClaimTransaction(destinationAddress, quantity, options) {\n // TODO: Transaction Sequence Pattern\n if (options?.pricePerToken) {\n throw new Error(\"Price per token is be set via claim conditions by calling `contract.erc721.claimConditions.set()`\");\n }\n const claimVerification = await this.prepareClaim(quantity, options?.checkERC20Allowance === undefined ? true : options.checkERC20Allowance, await this.getTokenDecimals());\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"claim\",\n args: await this.getClaimArguments(destinationAddress, quantity, claimVerification),\n overrides: claimVerification.overrides\n });\n }\n isNewSinglePhaseDrop(contractWrapper) {\n return detectContractFeature(contractWrapper, \"ERC721ClaimConditionsV2\") || detectContractFeature(contractWrapper, \"ERC20ClaimConditionsV2\");\n }\n isNewMultiphaseDrop(contractWrapper) {\n return detectContractFeature(contractWrapper, \"ERC721ClaimPhasesV2\") || detectContractFeature(contractWrapper, \"ERC20ClaimPhasesV2\");\n }\n isLegacySinglePhaseDrop(contractWrapper) {\n return detectContractFeature(contractWrapper, \"ERC721ClaimConditionsV1\") || detectContractFeature(contractWrapper, \"ERC20ClaimConditionsV1\");\n }\n isLegacyMultiPhaseDrop(contractWrapper) {\n return detectContractFeature(contractWrapper, \"ERC721ClaimPhasesV1\") || detectContractFeature(contractWrapper, \"ERC20ClaimPhasesV1\");\n }\n getSnapshotFormatVersion() {\n return this.isLegacyMultiPhaseDrop(this.contractWrapper) || this.isLegacySinglePhaseDrop(this.contractWrapper) ? SnapshotFormatVersion.V1 : SnapshotFormatVersion.V2;\n }\n}\n\nexport { DropClaimConditions as D };\n"],"names":["DropClaimConditions","constructor","contractWrapper","metadata","storage","getActive","options","cc","tokenDecimals","Promise","all","get","getTokenDecimals","_signature_52783ae4_browser_esm_js__WEBPACK_IMPORTED_MODULE_1__","y","getProvider","merkle","withAllowList","conditionId","isLegacySinglePhaseDrop","contractModel","read","z","isLegacyMultiPhaseDrop","id","undefined","isNewSinglePhaseDrop","A","isNewMultiphaseDrop","getAll","currentStartId","countBn","startId","toNumber","count","conditions","i","push","decimals","fetchedConditions","map","c","canClaim","quantity","addressToCheck","_index_02e94cec_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__","aM","getClaimIneligibilityReasons","length","activeConditionIndex","claimCondition","reasons","getSignerAddress","err","console","warn","C","NoWallet","resolvedAddress","quantityWithDecimals","ethers__WEBPACK_IMPORTED_MODULE_3__","parseUnits","cw","parse","B","NoClaimConditionSet","Unknown","availableSupply","supplyWithDecimals","lt","NotEnoughSupply","merkleRootArray","ethers__WEBPACK_IMPORTED_MODULE_4__","stripZeros","merkleRootHash","hasAllowList","allowListEntry","getClaimerProofs","AddressNotAllowed","validMerkleProof","claimVerification","prepareClaim","proofs","maxClaimable","proof","maxQuantityInAllowlist","currencyAddress","price","quantityLimitPerWallet","currency","currencyAddressInProof","pricePerToken","priceInProof","e","reason","errorName","OverMaxClaimablePerWallet","WrongPriceOrCurrency","ClaimPhaseNotStarted","claimedSupply","ethers__WEBPACK_IMPORTED_MODULE_5__","O$","from","D","maxClaimablePerWallet","getSupplyClaimedByWallet","gt","add","lte","eq","lastClaimedTimestamp","timestampForNextClaim","now","Date","div","ethers__WEBPACK_IMPORTED_MODULE_6__","Bz","AlreadyClaimed","WaitBeforeNextClaimTransaction","d5","totalPrice","mul","provider","_fetchCurrencyValue_a150f8dd_browser_esm_js__WEBPACK_IMPORTED_MODULE_7__","balance","getBalance","NotEnoughTokens","ERC20Abi","resolve","then","__webpack_require__","t","bind","default","erc20","cs","claimerAddress","claimConditionId","merkleRoot","f","toString","getSnapshotFormatVersion","walletAddress","activeClaimConditionId","set","_transactions_91b95b4c_browser_esm_js__WEBPACK_IMPORTED_MODULE_8__","_this","claimConditionInputs","resetClaimEligibilityForAll","arguments","claimConditionsProcessed","startTime","ethers__WEBPACK_IMPORTED_MODULE_9__","d","maxClaimableSupply","waitInSeconds","hexZeroPad","snapshot","forEach","s","Number","reduce","acc","current","snapshotInfos","sortedConditions","H","merkleInfo","snapshotUri","encoded","fast_deep_equal__WEBPACK_IMPORTED_MODULE_0___default","mergedMetadata","parseInputMetadata","contractURI","_parseAndUploadMetadata","_contract_appuri_84a944c8_browser_esm_js__WEBPACK_IMPORTED_MODULE_10__","h","contractEncoder","encode","baseContractEncoder","contractEncoderLegacy","I","J","T","fromContractWrapper","method","args","update","index","claimConditionInput","existingConditions","newConditionInputs","K","prepare","checkERC20Allowance","address","addressToClaim","activeClaimConditions","E","getClaimArguments","destinationAddress","ethers__WEBPACK_IMPORTED_MODULE_11__","Y0","getClaimTransaction","overrides","F","V1","V2"],"sourceRoot":""}