"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var core_1 = require("../..");
var index_1 = require("./index");
var PDFCheckBox = /** @class */ (function (_super) {
    tslib_1.__extends(PDFCheckBox, _super);
    function PDFCheckBox(dict) {
        var _this = _super.call(this, dict) || this;
        _this.unsetFlag(16);
        _this.unsetFlag(17);
        return _this;
    }
    PDFCheckBox.fromDict = function (dict) {
        return new PDFCheckBox(dict);
    };
    PDFCheckBox.prototype.Opt = function () {
        return this.dict.lookupMaybe(core_1.PDFName.Opt, core_1.PDFArray);
    };
    PDFCheckBox.prototype.getOptions = function () {
        var optionsArray = this.Opt();
        return optionsArray ? optionsArray.lookupElements(core_1.PDFName) : [];
    };
    PDFCheckBox.prototype.check = function () {
        this.dict.set(core_1.PDFName.V, core_1.PDFName.Yes);
    };
    PDFCheckBox.prototype.uncheck = function () {
        this.dict.set(core_1.PDFName.V, core_1.PDFName.Off);
    };
    PDFCheckBox.prototype.toggle = function () {
        var value = this.getValue();
        if (value === core_1.PDFName.Yes) {
            this.uncheck();
        }
        else {
            this.check();
        }
    };
    PDFCheckBox.prototype.setValue = function (value) {
        this.dict.set(core_1.PDFName.V, value);
    };
    return PDFCheckBox;
}(index_1.PDFAcroButton));
exports.default = PDFCheckBox;
//# sourceMappingURL=PDFCheckBox.js.map