"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = require("@storybook/react");
var React = __importStar(require("react"));
var styled_components_1 = __importDefault(require("styled-components"));
var storybook_react_router_1 = __importDefault(require("storybook-react-router"));
var index_1 = require("./index");
var StyledDiv = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  display: flex;\n  width: 600px;\n"], ["\n  display: flex;\n  width: 600px;\n"])));
var Container = function (_a) {
    var children = _a.children;
    return (React.createElement(StyledDiv, null,
        React.createElement("div", null, children)));
};
var now = Date.now() / 1000;
var oneDay = 86400;
var endTime = now + oneDay * 4.25;
var phaseLength = oneDay * 7;
var secondaryPhaseLength = phaseLength * 2;
var challengeID = "420";
var challenger = "0x0";
var rewardPool = "1000000";
var stake = "100000";
var requester = "0x01";
var appealFeePaid = "10.00 CVL";
var appealChallengeID = "1420";
var totalVotes = "100000";
var votesFor = "73000";
var votesAgainst = "27000";
var percentFor = "73";
var percentAgainst = "27";
var didChallengeSucceed = false;
var tokenBalance = 10000;
var commitVoteState = {
    salt: "9635457449074",
    numTokens: (tokenBalance * 0.67).toString(),
    voteOption: undefined,
};
function commitVoteChange(data, callback) {
    commitVoteState = __assign(__assign({}, commitVoteState), data);
    if (callback) {
        callback();
    }
}
var noop = function () {
    console.log("noop");
};
react_1.storiesOf("Registry / Listing / Listing Details Phase Card", module)
    .addDecorator(storybook_react_router_1.default())
    .add("In Application", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.InApplicationCard, { endTime: endTime, phaseLength: phaseLength, transactions: [], faqURL: "#faq" }))));
})
    .add("Resolve Application", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && React.createElement(index_1.InApplicationResolveCard, { transactions: [], faqURL: "#faq" })));
})
    .add("Under Challenge: Commit Vote", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.ChallengeCommitVoteCard, { endTime: endTime, phaseLength: phaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, tokenBalance: tokenBalance, votingTokenBalance: tokenBalance, tokenBalanceDisplay: tokenBalance + " CVL", votingTokenBalanceDisplay: tokenBalance + " CVL", salt: commitVoteState.salt, numTokens: commitVoteState.numTokens, onInputChange: commitVoteChange, onCommitMaxTokens: noop, onReviewVote: noop, transactions: [], faqURL: "#faq" }))));
})
    .add("Under Challenge: Reveal Vote - User Did Not Commit", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.ChallengeRevealVoteCard, { endTime: endTime, phaseLength: phaseLength, secondaryPhaseLength: secondaryPhaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, voteOption: commitVoteState.voteOption, salt: commitVoteState.salt, onInputChange: commitVoteChange, transactions: [], userHasCommittedVote: false, votingSmartContractFaqURL: "#voting-smart-contract-faq", faqURL: "#faq" }))));
})
    .add("Under Challenge: Reveal Vote - User Already Revealed", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.ChallengeRevealVoteCard, { endTime: endTime, phaseLength: phaseLength, secondaryPhaseLength: secondaryPhaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, voteOption: commitVoteState.voteOption, salt: commitVoteState.salt, onInputChange: commitVoteChange, transactions: [], userHasCommittedVote: true, userHasRevealedVote: true, votingSmartContractFaqURL: "#voting-smart-contract-faq", faqURL: "#faq" }))));
})
    .add("Under Challenge: Reveal Vote - User committed and has not revealed", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.ChallengeRevealVoteCard, { endTime: endTime, phaseLength: phaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, voteOption: commitVoteState.voteOption, salt: commitVoteState.salt, onInputChange: commitVoteChange, transactions: [], userHasCommittedVote: true, votingSmartContractFaqURL: "#voting-smart-contract-faq", faqURL: "#faq" }))));
})
    .add("Under Challenge: Request Appeal", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.ChallengeRequestAppealCard, { challengeID: challengeID, endTime: endTime, phaseLength: phaseLength, challenger: challenger, rewardPool: rewardPool, stake: stake, totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, transactions: [], faqURL: "#faq" }))));
})
    .add("Under Challenge: Resolve", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.ChallengeResolveCard, { challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, transactions: [], faqURL: "#faq" }))));
})
    .add("Under Appeal: Awaiting Appeal Decision", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealAwaitingDecisionCard, { endTime: endTime, phaseLength: phaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, requester: requester, appealFeePaid: appealFeePaid, totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, faqURL: "#faq" }))));
})
    .add("Under Appeal: Awaiting Appeal Decision, Civil Council Multisig", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealAwaitingDecisionCard, { endTime: endTime, phaseLength: phaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, requester: requester, appealFeePaid: appealFeePaid, totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, transactions: [], faqURL: "#faq" }))));
})
    .add("Under Appeal: Decision / Can Challenge", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealDecisionCard, { endTime: endTime, phaseLength: phaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, appealGranted: true, didChallengeSucceed: didChallengeSucceed, transactions: [], faqURL: "#faq" }))));
})
    .add("Under Appeal: Resolve", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealResolveCard, { challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, appealGranted: true, totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, transactions: [], faqURL: "#faq" }))));
})
    .add("Appeal Challenge: Commit Vote", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealChallengeCommitVoteCard, { endTime: endTime, phaseLength: phaseLength, secondaryPhaseLength: secondaryPhaseLength, tokenBalance: tokenBalance, votingTokenBalance: tokenBalance, tokenBalanceDisplay: tokenBalance + " CVL", votingTokenBalanceDisplay: tokenBalance + " CVL", salt: commitVoteState.salt, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, numTokens: commitVoteState.numTokens, onCommitMaxTokens: noop, onInputChange: commitVoteChange, transactions: [], totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, appealChallengeID: appealChallengeID, appealGranted: true, didChallengeSucceed: didChallengeSucceed, onReviewVote: noop, faqURL: "#faq" }))));
})
    .add("Appeal Challenge: Reveal Vote - User Did Not Commit", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealChallengeRevealVoteCard, { endTime: endTime, phaseLength: phaseLength, secondaryPhaseLength: secondaryPhaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, voteOption: commitVoteState.voteOption, salt: commitVoteState.salt, onInputChange: commitVoteChange, transactions: [], totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, didChallengeSucceed: didChallengeSucceed, percentAgainst: percentAgainst, appealChallengeID: appealChallengeID, appealGranted: true, votingSmartContractFaqURL: "#voting-smart-contract-faq", faqURL: "#faq" }))));
})
    .add("Appeal Challenge: Reveal Vote - User Already Revealed", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealChallengeRevealVoteCard, { endTime: endTime, phaseLength: phaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, voteOption: commitVoteState.voteOption, salt: commitVoteState.salt, onInputChange: commitVoteChange, transactions: [], totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, appealChallengeID: appealChallengeID, appealGranted: true, userHasCommittedVote: true, userHasRevealedVote: true, votingSmartContractFaqURL: "#voting-smart-contract-faq", faqURL: "#faq" }))));
})
    .add("Appeal Challenge: Reveal Vote - User committed and has not revealed", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealChallengeRevealVoteCard, { endTime: endTime, phaseLength: phaseLength, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, voteOption: commitVoteState.voteOption, salt: commitVoteState.salt, onInputChange: commitVoteChange, transactions: [], totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, appealChallengeID: appealChallengeID, appealGranted: true, userHasCommittedVote: true, userHasRevealedVote: false, votingSmartContractFaqURL: "#voting-smart-contract-faq", faqURL: "#faq" }))));
})
    .add("Appeal Challenge: Resolve", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.AppealChallengeResolveCard, { appealGranted: true, challengeID: challengeID, challenger: challenger, rewardPool: rewardPool, stake: stake, totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, appealChallengeTotalVotes: totalVotes, appealChallengeVotesFor: votesFor, appealChallengeVotesAgainst: votesAgainst, appealChallengePercentFor: percentFor, appealChallengePercentAgainst: percentAgainst, transactions: [], appealChallengeID: appealChallengeID, didAppealChallengeSucceed: didChallengeSucceed, faqURL: "#faq" }))));
})
    .add("Whitelisted", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.WhitelistedCard, { whitelistedTimestamp: now, transactions: [], faqURL: "#faq" }))));
})
    .add("Rejected", function () {
    return (React.createElement(Container, null, process.env.NODE_ENV !== "test" && (React.createElement(index_1.RejectedCard, { listingRemovedTimestamp: now, totalVotes: totalVotes, votesFor: votesFor, votesAgainst: votesAgainst, percentFor: percentFor, percentAgainst: percentAgainst, didChallengeSucceed: didChallengeSucceed, faqURL: "#faq" }))));
});
var templateObject_1;
//# sourceMappingURL=ListingDetailsPhaseCard.stories.js.map