import { ConfigType } from '../config.js';
import GridData from '../grid.js';
import { State } from '../primitives.js';
import CustomIconSymbol from '../symbols/customIconSymbol.js';
import Rule from './rule.js';
class ForesightRule extends Rule {
    /**
     * **Foresight: Show hints**
     */
    constructor(count, regenInterval, startFull) {
        super();
        Object.defineProperty(this, "count", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: count
        });
        Object.defineProperty(this, "regenInterval", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: regenInterval
        });
        Object.defineProperty(this, "startFull", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: startFull
        });
        this.count = count;
        this.regenInterval = regenInterval;
        this.startFull = startFull;
    }
    get id() {
        return `foresight`;
    }
    get explanation() {
        return `*Foresight:* Show hints`;
    }
    get visibleWhenSolving() {
        return false;
    }
    get configs() {
        return ForesightRule.CONFIGS;
    }
    createExampleGrid() {
        return ForesightRule.EXAMPLE_GRID;
    }
    get searchVariants() {
        return ForesightRule.SEARCH_VARIANTS;
    }
    validateGrid(_grid) {
        return { state: State.Incomplete };
    }
    get necessaryForCompletion() {
        return false;
    }
    copyWith({ count, regenInterval, startFull, }) {
        return new ForesightRule(count ?? this.count, regenInterval ?? this.regenInterval, startFull ?? this.startFull);
    }
}
Object.defineProperty(ForesightRule, "EXAMPLE_GRID", {
    enumerable: true,
    configurable: true,
    writable: true,
    value: Object.freeze(GridData.create(['.']).addSymbol(new CustomIconSymbol('', GridData.create([]), 0, 0, 'MdRemoveRedEye')))
});
Object.defineProperty(ForesightRule, "CONFIGS", {
    enumerable: true,
    configurable: true,
    writable: true,
    value: Object.freeze([
        {
            type: ConfigType.Number,
            default: 5,
            min: 1,
            field: 'count',
            description: 'Foresight count',
            configurable: true,
        },
        {
            type: ConfigType.Number,
            default: 30,
            min: 1,
            field: 'regenInterval',
            description: 'Regen Interval (seconds)',
            configurable: true,
        },
        {
            type: ConfigType.Boolean,
            default: false,
            field: 'startFull',
            description: 'Start with full foresight',
            configurable: true,
        },
    ])
});
Object.defineProperty(ForesightRule, "SEARCH_VARIANTS", {
    enumerable: true,
    configurable: true,
    writable: true,
    value: [
        new ForesightRule(5, 30, false).searchVariant(),
    ]
});
export default ForesightRule;
export const instance = new ForesightRule(5, 30, false);
