'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var CandyMachineClient = require('./CandyMachineClient.cjs');
var programs = require('./programs.cjs');
var botTax = require('./guards/botTax.cjs');
var solPayment = require('./guards/solPayment.cjs');
var tokenPayment = require('./guards/tokenPayment.cjs');
var startDate = require('./guards/startDate.cjs');
var thirdPartySigner = require('./guards/thirdPartySigner.cjs');
var tokenGate = require('./guards/tokenGate.cjs');
var gatekeeper = require('./guards/gatekeeper.cjs');
var endDate = require('./guards/endDate.cjs');
var allowList = require('./guards/allowList.cjs');
var mintLimit = require('./guards/mintLimit.cjs');
var nftPayment = require('./guards/nftPayment.cjs');
var redeemedAmount = require('./guards/redeemedAmount.cjs');
var addressGate = require('./guards/addressGate.cjs');
var nftGate = require('./guards/nftGate.cjs');
var nftBurn = require('./guards/nftBurn.cjs');
var tokenBurn = require('./guards/tokenBurn.cjs');
var callCandyGuardRoute = require('./operations/callCandyGuardRoute.cjs');
var createCandyGuard = require('./operations/createCandyGuard.cjs');
var createCandyMachine = require('./operations/createCandyMachine.cjs');
var deleteCandyGuard = require('./operations/deleteCandyGuard.cjs');
var deleteCandyMachine = require('./operations/deleteCandyMachine.cjs');
var findCandyGuardByAddress = require('./operations/findCandyGuardByAddress.cjs');
var findCandyGuardsByAuthority = require('./operations/findCandyGuardsByAuthority.cjs');
var findCandyMachineByAddress = require('./operations/findCandyMachineByAddress.cjs');
var insertCandyMachineItems = require('./operations/insertCandyMachineItems.cjs');
var mintFromCandyMachine = require('./operations/mintFromCandyMachine.cjs');
var unwrapCandyGuard = require('./operations/unwrapCandyGuard.cjs');
var updateCandyGuard = require('./operations/updateCandyGuard.cjs');
var updateCandyMachine = require('./operations/updateCandyMachine.cjs');
var wrapCandyGuard = require('./operations/wrapCandyGuard.cjs');

/** @group Plugins */
const candyMachineModule = () => ({
  install(metaplex) {
    // Client.
    const client = new CandyMachineClient.CandyMachineClient(metaplex);
    metaplex.candyMachines = () => client;

    // Candy Machine Program.
    metaplex.programs().register(programs.candyMachineProgram);
    metaplex.programs().getCandyMachine = function (programs$1) {
      return this.get(programs.candyMachineProgram.name, programs$1);
    };

    // Candy Guard Program.
    metaplex.programs().register(programs.defaultCandyGuardProgram);
    metaplex.programs().getCandyGuard = function (programs$1) {
      return this.get(programs.defaultCandyGuardProgram.name, programs$1);
    };

    // Gateway Program.
    metaplex.programs().register(programs.gatewayProgram);
    metaplex.programs().getGateway = function (programs$1) {
      return this.get(programs.gatewayProgram.name, programs$1);
    };

    // Default Guards.
    client.guards().register(botTax.botTaxGuardManifest);
    client.guards().register(solPayment.solPaymentGuardManifest);
    client.guards().register(tokenPayment.tokenPaymentGuardManifest);
    client.guards().register(startDate.startDateGuardManifest);
    client.guards().register(thirdPartySigner.thirdPartySignerGuardManifest);
    client.guards().register(tokenGate.tokenGateGuardManifest);
    client.guards().register(gatekeeper.gatekeeperGuardManifest);
    client.guards().register(endDate.endDateGuardManifest);
    client.guards().register(allowList.allowListGuardManifest);
    client.guards().register(mintLimit.mintLimitGuardManifest);
    client.guards().register(nftPayment.nftPaymentGuardManifest);
    client.guards().register(redeemedAmount.redeemedAmountGuardManifest);
    client.guards().register(addressGate.addressGateGuardManifest);
    client.guards().register(nftGate.nftGateGuardManifest);
    client.guards().register(nftBurn.nftBurnGuardManifest);
    client.guards().register(tokenBurn.tokenBurnGuardManifest);

    // Operations.
    const op = metaplex.operations();
    op.register(callCandyGuardRoute.callCandyGuardRouteOperation, callCandyGuardRoute.callCandyGuardRouteOperationHandler);
    op.register(createCandyGuard.createCandyGuardOperation, createCandyGuard.createCandyGuardOperationHandler);
    op.register(createCandyMachine.createCandyMachineOperation, createCandyMachine.createCandyMachineOperationHandler);
    op.register(deleteCandyGuard.deleteCandyGuardOperation, deleteCandyGuard.deleteCandyGuardOperationHandler);
    op.register(deleteCandyMachine.deleteCandyMachineOperation, deleteCandyMachine.deleteCandyMachineOperationHandler);
    op.register(findCandyGuardByAddress.findCandyGuardByAddressOperation, findCandyGuardByAddress.findCandyGuardByAddressOperationHandler);
    op.register(findCandyGuardsByAuthority.findCandyGuardsByAuthorityOperation, findCandyGuardsByAuthority.findCandyGuardsByAuthorityOperationHandler);
    op.register(findCandyMachineByAddress.findCandyMachineByAddressOperation, findCandyMachineByAddress.findCandyMachineByAddressOperationHandler);
    op.register(insertCandyMachineItems.insertCandyMachineItemsOperation, insertCandyMachineItems.insertCandyMachineItemsOperationHandler);
    op.register(mintFromCandyMachine.mintFromCandyMachineOperation, mintFromCandyMachine.mintFromCandyMachineOperationHandler);
    op.register(unwrapCandyGuard.unwrapCandyGuardOperation, unwrapCandyGuard.unwrapCandyGuardOperationHandler);
    op.register(updateCandyGuard.updateCandyGuardOperation, updateCandyGuard.updateCandyGuardOperationHandler);
    op.register(updateCandyMachine.updateCandyMachineOperation, updateCandyMachine.updateCandyMachineOperationHandler);
    op.register(wrapCandyGuard.wrapCandyGuardOperation, wrapCandyGuard.wrapCandyGuardOperationHandler);
  }
});

exports.candyMachineModule = candyMachineModule;
//# sourceMappingURL=plugin.cjs.map
