var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};
import * as plugins from '../../plugins.js';
import { DcRouterDb } from '../classes.dcrouter-db.js';
const getDb = () => DcRouterDb.getInstance().getDb();
let EmailServerSettingsDoc = (() => {
    let _classDecorators = [plugins.smartdata.Collection(() => getDb())];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = plugins.smartdata.SmartDataDbDoc;
    let _settingsId_decorators;
    let _settingsId_initializers = [];
    let _settingsId_extraInitializers = [];
    let _enabled_decorators;
    let _enabled_initializers = [];
    let _enabled_extraInitializers = [];
    let _emailConfig_decorators;
    let _emailConfig_initializers = [];
    let _emailConfig_extraInitializers = [];
    let _emailPortConfig_decorators;
    let _emailPortConfig_initializers = [];
    let _emailPortConfig_extraInitializers = [];
    let _updatedAt_decorators;
    let _updatedAt_initializers = [];
    let _updatedAt_extraInitializers = [];
    let _updatedBy_decorators;
    let _updatedBy_initializers = [];
    let _updatedBy_extraInitializers = [];
    var EmailServerSettingsDoc = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _settingsId_decorators = [plugins.smartdata.unI(), plugins.smartdata.svDb()];
            _enabled_decorators = [plugins.smartdata.svDb()];
            _emailConfig_decorators = [plugins.smartdata.svDb()];
            _emailPortConfig_decorators = [plugins.smartdata.svDb()];
            _updatedAt_decorators = [plugins.smartdata.svDb()];
            _updatedBy_decorators = [plugins.smartdata.svDb()];
            __esDecorate(null, null, _settingsId_decorators, { kind: "field", name: "settingsId", static: false, private: false, access: { has: obj => "settingsId" in obj, get: obj => obj.settingsId, set: (obj, value) => { obj.settingsId = value; } }, metadata: _metadata }, _settingsId_initializers, _settingsId_extraInitializers);
            __esDecorate(null, null, _enabled_decorators, { kind: "field", name: "enabled", static: false, private: false, access: { has: obj => "enabled" in obj, get: obj => obj.enabled, set: (obj, value) => { obj.enabled = value; } }, metadata: _metadata }, _enabled_initializers, _enabled_extraInitializers);
            __esDecorate(null, null, _emailConfig_decorators, { kind: "field", name: "emailConfig", static: false, private: false, access: { has: obj => "emailConfig" in obj, get: obj => obj.emailConfig, set: (obj, value) => { obj.emailConfig = value; } }, metadata: _metadata }, _emailConfig_initializers, _emailConfig_extraInitializers);
            __esDecorate(null, null, _emailPortConfig_decorators, { kind: "field", name: "emailPortConfig", static: false, private: false, access: { has: obj => "emailPortConfig" in obj, get: obj => obj.emailPortConfig, set: (obj, value) => { obj.emailPortConfig = value; } }, metadata: _metadata }, _emailPortConfig_initializers, _emailPortConfig_extraInitializers);
            __esDecorate(null, null, _updatedAt_decorators, { kind: "field", name: "updatedAt", static: false, private: false, access: { has: obj => "updatedAt" in obj, get: obj => obj.updatedAt, set: (obj, value) => { obj.updatedAt = value; } }, metadata: _metadata }, _updatedAt_initializers, _updatedAt_extraInitializers);
            __esDecorate(null, null, _updatedBy_decorators, { kind: "field", name: "updatedBy", static: false, private: false, access: { has: obj => "updatedBy" in obj, get: obj => obj.updatedBy, set: (obj, value) => { obj.updatedBy = value; } }, metadata: _metadata }, _updatedBy_initializers, _updatedBy_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            EmailServerSettingsDoc = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
            __runInitializers(_classThis, _classExtraInitializers);
        }
        settingsId = __runInitializers(this, _settingsId_initializers, 'email-server-settings');
        enabled = (__runInitializers(this, _settingsId_extraInitializers), __runInitializers(this, _enabled_initializers, false));
        emailConfig = (__runInitializers(this, _enabled_extraInitializers), __runInitializers(this, _emailConfig_initializers, void 0));
        emailPortConfig = (__runInitializers(this, _emailConfig_extraInitializers), __runInitializers(this, _emailPortConfig_initializers, void 0));
        updatedAt = (__runInitializers(this, _emailPortConfig_extraInitializers), __runInitializers(this, _updatedAt_initializers, 0));
        updatedBy = (__runInitializers(this, _updatedAt_extraInitializers), __runInitializers(this, _updatedBy_initializers, ''));
        constructor() {
            super();
            __runInitializers(this, _updatedBy_extraInitializers);
        }
        static async load() {
            return await EmailServerSettingsDoc.getInstance({ settingsId: 'email-server-settings' });
        }
        static async findAll() {
            return await EmailServerSettingsDoc.getInstances({});
        }
    };
    return EmailServerSettingsDoc = _classThis;
})();
export { EmailServerSettingsDoc };
//# sourceMappingUR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