"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Timer = exports.MessageQueue = exports.DataStream = exports.Source = exports.Connector_LabelsEntry = exports.Connector = exports.connector_StatusToJSON = exports.connector_StatusFromJSON = exports.Connector_Status = exports.protobufPackage = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const minimal_1 = __importDefault(require("protobufjs/minimal"));
const duration_1 = require("../../../../../google/protobuf/duration");
const timestamp_1 = require("../../../../../google/protobuf/timestamp");
exports.protobufPackage = 'yandex.cloud.serverless.eventrouter.v1';
/** Status of the connector. */
var Connector_Status;
(function (Connector_Status) {
    Connector_Status[Connector_Status["STATUS_UNSPECIFIED"] = 0] = "STATUS_UNSPECIFIED";
    Connector_Status[Connector_Status["RUNNING"] = 1] = "RUNNING";
    /** STOPPED - disabled by user */
    Connector_Status[Connector_Status["STOPPED"] = 2] = "STOPPED";
    /** RESOURCE_NOT_FOUND - source does not exist */
    Connector_Status[Connector_Status["RESOURCE_NOT_FOUND"] = 3] = "RESOURCE_NOT_FOUND";
    /** PERMISSION_DENIED - service account does not have read permission on source */
    Connector_Status[Connector_Status["PERMISSION_DENIED"] = 4] = "PERMISSION_DENIED";
    /** SUBJECT_NOT_FOUND - service account not found */
    Connector_Status[Connector_Status["SUBJECT_NOT_FOUND"] = 5] = "SUBJECT_NOT_FOUND";
    /** DELETING - deletion in progress */
    Connector_Status[Connector_Status["DELETING"] = 7] = "DELETING";
    /** CREATING - creation in progress */
    Connector_Status[Connector_Status["CREATING"] = 8] = "CREATING";
    Connector_Status[Connector_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(Connector_Status = exports.Connector_Status || (exports.Connector_Status = {}));
function connector_StatusFromJSON(object) {
    switch (object) {
        case 0:
        case 'STATUS_UNSPECIFIED':
            return Connector_Status.STATUS_UNSPECIFIED;
        case 1:
        case 'RUNNING':
            return Connector_Status.RUNNING;
        case 2:
        case 'STOPPED':
            return Connector_Status.STOPPED;
        case 3:
        case 'RESOURCE_NOT_FOUND':
            return Connector_Status.RESOURCE_NOT_FOUND;
        case 4:
        case 'PERMISSION_DENIED':
            return Connector_Status.PERMISSION_DENIED;
        case 5:
        case 'SUBJECT_NOT_FOUND':
            return Connector_Status.SUBJECT_NOT_FOUND;
        case 7:
        case 'DELETING':
            return Connector_Status.DELETING;
        case 8:
        case 'CREATING':
            return Connector_Status.CREATING;
        case -1:
        case 'UNRECOGNIZED':
        default:
            return Connector_Status.UNRECOGNIZED;
    }
}
exports.connector_StatusFromJSON = connector_StatusFromJSON;
function connector_StatusToJSON(object) {
    switch (object) {
        case Connector_Status.STATUS_UNSPECIFIED:
            return 'STATUS_UNSPECIFIED';
        case Connector_Status.RUNNING:
            return 'RUNNING';
        case Connector_Status.STOPPED:
            return 'STOPPED';
        case Connector_Status.RESOURCE_NOT_FOUND:
            return 'RESOURCE_NOT_FOUND';
        case Connector_Status.PERMISSION_DENIED:
            return 'PERMISSION_DENIED';
        case Connector_Status.SUBJECT_NOT_FOUND:
            return 'SUBJECT_NOT_FOUND';
        case Connector_Status.DELETING:
            return 'DELETING';
        case Connector_Status.CREATING:
            return 'CREATING';
        default:
            return 'UNKNOWN';
    }
}
exports.connector_StatusToJSON = connector_StatusToJSON;
const baseConnector = {
    id: '',
    busId: '',
    folderId: '',
    cloudId: '',
    name: '',
    description: '',
    deletionProtection: false,
    status: 0,
};
exports.Connector = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.id !== '') {
            writer.uint32(10).string(message.id);
        }
        if (message.busId !== '') {
            writer.uint32(18).string(message.busId);
        }
        if (message.folderId !== '') {
            writer.uint32(26).string(message.folderId);
        }
        if (message.cloudId !== '') {
            writer.uint32(34).string(message.cloudId);
        }
        if (message.createdAt !== undefined) {
            timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(42).fork()).ldelim();
        }
        if (message.name !== '') {
            writer.uint32(50).string(message.name);
        }
        if (message.description !== '') {
            writer.uint32(58).string(message.description);
        }
        Object.entries(message.labels).forEach(([key, value]) => {
            exports.Connector_LabelsEntry.encode({ key: key, value }, writer.uint32(66).fork()).ldelim();
        });
        if (message.source !== undefined) {
            exports.Source.encode(message.source, writer.uint32(74).fork()).ldelim();
        }
        if (message.deletionProtection === true) {
            writer.uint32(80).bool(message.deletionProtection);
        }
        if (message.status !== 0) {
            writer.uint32(88).int32(message.status);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseConnector);
        message.labels = {};
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.id = reader.string();
                    break;
                case 2:
                    message.busId = reader.string();
                    break;
                case 3:
                    message.folderId = reader.string();
                    break;
                case 4:
                    message.cloudId = reader.string();
                    break;
                case 5:
                    message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
                    break;
                case 6:
                    message.name = reader.string();
                    break;
                case 7:
                    message.description = reader.string();
                    break;
                case 8:
                    const entry8 = exports.Connector_LabelsEntry.decode(reader, reader.uint32());
                    if (entry8.value !== undefined) {
                        message.labels[entry8.key] = entry8.value;
                    }
                    break;
                case 9:
                    message.source = exports.Source.decode(reader, reader.uint32());
                    break;
                case 10:
                    message.deletionProtection = reader.bool();
                    break;
                case 11:
                    message.status = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseConnector);
        message.id = object.id !== undefined && object.id !== null ? String(object.id) : '';
        message.busId =
            object.busId !== undefined && object.busId !== null ? String(object.busId) : '';
        message.folderId =
            object.folderId !== undefined && object.folderId !== null
                ? String(object.folderId)
                : '';
        message.cloudId =
            object.cloudId !== undefined && object.cloudId !== null ? String(object.cloudId) : '';
        message.createdAt =
            object.createdAt !== undefined && object.createdAt !== null
                ? fromJsonTimestamp(object.createdAt)
                : undefined;
        message.name = object.name !== undefined && object.name !== null ? String(object.name) : '';
        message.description =
            object.description !== undefined && object.description !== null
                ? String(object.description)
                : '';
        message.labels = Object.entries((_a = object.labels) !== null && _a !== void 0 ? _a : {}).reduce((acc, [key, value]) => {
            acc[key] = String(value);
            return acc;
        }, {});
        message.source =
            object.source !== undefined && object.source !== null
                ? exports.Source.fromJSON(object.source)
                : undefined;
        message.deletionProtection =
            object.deletionProtection !== undefined && object.deletionProtection !== null
                ? Boolean(object.deletionProtection)
                : false;
        message.status =
            object.status !== undefined && object.status !== null
                ? connector_StatusFromJSON(object.status)
                : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.id !== undefined && (obj.id = message.id);
        message.busId !== undefined && (obj.busId = message.busId);
        message.folderId !== undefined && (obj.folderId = message.folderId);
        message.cloudId !== undefined && (obj.cloudId = message.cloudId);
        message.createdAt !== undefined && (obj.createdAt = message.createdAt.toISOString());
        message.name !== undefined && (obj.name = message.name);
        message.description !== undefined && (obj.description = message.description);
        obj.labels = {};
        if (message.labels) {
            Object.entries(message.labels).forEach(([k, v]) => {
                obj.labels[k] = v;
            });
        }
        message.source !== undefined &&
            (obj.source = message.source ? exports.Source.toJSON(message.source) : undefined);
        message.deletionProtection !== undefined &&
            (obj.deletionProtection = message.deletionProtection);
        message.status !== undefined && (obj.status = connector_StatusToJSON(message.status));
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
        const message = Object.assign({}, baseConnector);
        message.id = (_a = object.id) !== null && _a !== void 0 ? _a : '';
        message.busId = (_b = object.busId) !== null && _b !== void 0 ? _b : '';
        message.folderId = (_c = object.folderId) !== null && _c !== void 0 ? _c : '';
        message.cloudId = (_d = object.cloudId) !== null && _d !== void 0 ? _d : '';
        message.createdAt = (_e = object.createdAt) !== null && _e !== void 0 ? _e : undefined;
        message.name = (_f = object.name) !== null && _f !== void 0 ? _f : '';
        message.description = (_g = object.description) !== null && _g !== void 0 ? _g : '';
        message.labels = Object.entries((_h = object.labels) !== null && _h !== void 0 ? _h : {}).reduce((acc, [key, value]) => {
            if (value !== undefined) {
                acc[key] = String(value);
            }
            return acc;
        }, {});
        message.source =
            object.source !== undefined && object.source !== null
                ? exports.Source.fromPartial(object.source)
                : undefined;
        message.deletionProtection = (_j = object.deletionProtection) !== null && _j !== void 0 ? _j : false;
        message.status = (_k = object.status) !== null && _k !== void 0 ? _k : 0;
        return message;
    },
};
const baseConnector_LabelsEntry = { key: '', value: '' };
exports.Connector_LabelsEntry = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.key !== '') {
            writer.uint32(10).string(message.key);
        }
        if (message.value !== '') {
            writer.uint32(18).string(message.value);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseConnector_LabelsEntry);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.key = reader.string();
                    break;
                case 2:
                    message.value = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseConnector_LabelsEntry);
        message.key = object.key !== undefined && object.key !== null ? String(object.key) : '';
        message.value =
            object.value !== undefined && object.value !== null ? String(object.value) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.key !== undefined && (obj.key = message.key);
        message.value !== undefined && (obj.value = message.value);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseConnector_LabelsEntry);
        message.key = (_a = object.key) !== null && _a !== void 0 ? _a : '';
        message.value = (_b = object.value) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
const baseSource = {};
exports.Source = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.dataStream !== undefined) {
            exports.DataStream.encode(message.dataStream, writer.uint32(10).fork()).ldelim();
        }
        if (message.messageQueue !== undefined) {
            exports.MessageQueue.encode(message.messageQueue, writer.uint32(18).fork()).ldelim();
        }
        if (message.timer !== undefined) {
            exports.Timer.encode(message.timer, writer.uint32(26).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseSource);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.dataStream = exports.DataStream.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.messageQueue = exports.MessageQueue.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.timer = exports.Timer.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseSource);
        message.dataStream =
            object.dataStream !== undefined && object.dataStream !== null
                ? exports.DataStream.fromJSON(object.dataStream)
                : undefined;
        message.messageQueue =
            object.messageQueue !== undefined && object.messageQueue !== null
                ? exports.MessageQueue.fromJSON(object.messageQueue)
                : undefined;
        message.timer =
            object.timer !== undefined && object.timer !== null
                ? exports.Timer.fromJSON(object.timer)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.dataStream !== undefined &&
            (obj.dataStream = message.dataStream
                ? exports.DataStream.toJSON(message.dataStream)
                : undefined);
        message.messageQueue !== undefined &&
            (obj.messageQueue = message.messageQueue
                ? exports.MessageQueue.toJSON(message.messageQueue)
                : undefined);
        message.timer !== undefined &&
            (obj.timer = message.timer ? exports.Timer.toJSON(message.timer) : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = Object.assign({}, baseSource);
        message.dataStream =
            object.dataStream !== undefined && object.dataStream !== null
                ? exports.DataStream.fromPartial(object.dataStream)
                : undefined;
        message.messageQueue =
            object.messageQueue !== undefined && object.messageQueue !== null
                ? exports.MessageQueue.fromPartial(object.messageQueue)
                : undefined;
        message.timer =
            object.timer !== undefined && object.timer !== null
                ? exports.Timer.fromPartial(object.timer)
                : undefined;
        return message;
    },
};
const baseDataStream = { database: '', streamName: '', consumer: '', serviceAccountId: '' };
exports.DataStream = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.database !== '') {
            writer.uint32(10).string(message.database);
        }
        if (message.streamName !== '') {
            writer.uint32(18).string(message.streamName);
        }
        if (message.consumer !== '') {
            writer.uint32(26).string(message.consumer);
        }
        if (message.serviceAccountId !== '') {
            writer.uint32(34).string(message.serviceAccountId);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseDataStream);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.database = reader.string();
                    break;
                case 2:
                    message.streamName = reader.string();
                    break;
                case 3:
                    message.consumer = reader.string();
                    break;
                case 4:
                    message.serviceAccountId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDataStream);
        message.database =
            object.database !== undefined && object.database !== null
                ? String(object.database)
                : '';
        message.streamName =
            object.streamName !== undefined && object.streamName !== null
                ? String(object.streamName)
                : '';
        message.consumer =
            object.consumer !== undefined && object.consumer !== null
                ? String(object.consumer)
                : '';
        message.serviceAccountId =
            object.serviceAccountId !== undefined && object.serviceAccountId !== null
                ? String(object.serviceAccountId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.database !== undefined && (obj.database = message.database);
        message.streamName !== undefined && (obj.streamName = message.streamName);
        message.consumer !== undefined && (obj.consumer = message.consumer);
        message.serviceAccountId !== undefined && (obj.serviceAccountId = message.serviceAccountId);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = Object.assign({}, baseDataStream);
        message.database = (_a = object.database) !== null && _a !== void 0 ? _a : '';
        message.streamName = (_b = object.streamName) !== null && _b !== void 0 ? _b : '';
        message.consumer = (_c = object.consumer) !== null && _c !== void 0 ? _c : '';
        message.serviceAccountId = (_d = object.serviceAccountId) !== null && _d !== void 0 ? _d : '';
        return message;
    },
};
const baseMessageQueue = { queueArn: '', serviceAccountId: '', batchSize: 0 };
exports.MessageQueue = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.queueArn !== '') {
            writer.uint32(10).string(message.queueArn);
        }
        if (message.serviceAccountId !== '') {
            writer.uint32(18).string(message.serviceAccountId);
        }
        if (message.visibilityTimeout !== undefined) {
            duration_1.Duration.encode(message.visibilityTimeout, writer.uint32(26).fork()).ldelim();
        }
        if (message.batchSize !== 0) {
            writer.uint32(32).int64(message.batchSize);
        }
        if (message.pollingTimeout !== undefined) {
            duration_1.Duration.encode(message.pollingTimeout, writer.uint32(42).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseMessageQueue);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.queueArn = reader.string();
                    break;
                case 2:
                    message.serviceAccountId = reader.string();
                    break;
                case 3:
                    message.visibilityTimeout = duration_1.Duration.decode(reader, reader.uint32());
                    break;
                case 4:
                    message.batchSize = longToNumber(reader.int64());
                    break;
                case 5:
                    message.pollingTimeout = duration_1.Duration.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseMessageQueue);
        message.queueArn =
            object.queueArn !== undefined && object.queueArn !== null
                ? String(object.queueArn)
                : '';
        message.serviceAccountId =
            object.serviceAccountId !== undefined && object.serviceAccountId !== null
                ? String(object.serviceAccountId)
                : '';
        message.visibilityTimeout =
            object.visibilityTimeout !== undefined && object.visibilityTimeout !== null
                ? duration_1.Duration.fromJSON(object.visibilityTimeout)
                : undefined;
        message.batchSize =
            object.batchSize !== undefined && object.batchSize !== null
                ? Number(object.batchSize)
                : 0;
        message.pollingTimeout =
            object.pollingTimeout !== undefined && object.pollingTimeout !== null
                ? duration_1.Duration.fromJSON(object.pollingTimeout)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.queueArn !== undefined && (obj.queueArn = message.queueArn);
        message.serviceAccountId !== undefined && (obj.serviceAccountId = message.serviceAccountId);
        message.visibilityTimeout !== undefined &&
            (obj.visibilityTimeout = message.visibilityTimeout
                ? duration_1.Duration.toJSON(message.visibilityTimeout)
                : undefined);
        message.batchSize !== undefined && (obj.batchSize = Math.round(message.batchSize));
        message.pollingTimeout !== undefined &&
            (obj.pollingTimeout = message.pollingTimeout
                ? duration_1.Duration.toJSON(message.pollingTimeout)
                : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = Object.assign({}, baseMessageQueue);
        message.queueArn = (_a = object.queueArn) !== null && _a !== void 0 ? _a : '';
        message.serviceAccountId = (_b = object.serviceAccountId) !== null && _b !== void 0 ? _b : '';
        message.visibilityTimeout =
            object.visibilityTimeout !== undefined && object.visibilityTimeout !== null
                ? duration_1.Duration.fromPartial(object.visibilityTimeout)
                : undefined;
        message.batchSize = (_c = object.batchSize) !== null && _c !== void 0 ? _c : 0;
        message.pollingTimeout =
            object.pollingTimeout !== undefined && object.pollingTimeout !== null
                ? duration_1.Duration.fromPartial(object.pollingTimeout)
                : undefined;
        return message;
    },
};
const baseTimer = { cronExpression: '', timeZone: '', payload: '' };
exports.Timer = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.cronExpression !== '') {
            writer.uint32(10).string(message.cronExpression);
        }
        if (message.timeZone !== '') {
            writer.uint32(18).string(message.timeZone);
        }
        if (message.payload !== '') {
            writer.uint32(34).string(message.payload);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseTimer);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.cronExpression = reader.string();
                    break;
                case 2:
                    message.timeZone = reader.string();
                    break;
                case 4:
                    message.payload = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseTimer);
        message.cronExpression =
            object.cronExpression !== undefined && object.cronExpression !== null
                ? String(object.cronExpression)
                : '';
        message.timeZone =
            object.timeZone !== undefined && object.timeZone !== null
                ? String(object.timeZone)
                : '';
        message.payload =
            object.payload !== undefined && object.payload !== null ? String(object.payload) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.cronExpression !== undefined && (obj.cronExpression = message.cronExpression);
        message.timeZone !== undefined && (obj.timeZone = message.timeZone);
        message.payload !== undefined && (obj.payload = message.payload);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = Object.assign({}, baseTimer);
        message.cronExpression = (_a = object.cronExpression) !== null && _a !== void 0 ? _a : '';
        message.timeZone = (_b = object.timeZone) !== null && _b !== void 0 ? _b : '';
        message.payload = (_c = object.payload) !== null && _c !== void 0 ? _c : '';
        return message;
    },
};
var globalThis = (() => {
    if (typeof globalThis !== 'undefined')
        return globalThis;
    if (typeof self !== 'undefined')
        return self;
    if (typeof window !== 'undefined')
        return window;
    if (typeof global !== 'undefined')
        return global;
    throw 'Unable to locate global object';
})();
function toTimestamp(date) {
    const seconds = date.getTime() / 1000;
    const nanos = (date.getTime() % 1000) * 1000000;
    return { seconds, nanos };
}
function fromTimestamp(t) {
    let millis = t.seconds * 1000;
    millis += t.nanos / 1000000;
    return new Date(millis);
}
function fromJsonTimestamp(o) {
    if (o instanceof Date) {
        return o;
    }
    else if (typeof o === 'string') {
        return new Date(o);
    }
    else {
        return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
    }
}
function longToNumber(long) {
    if (long.gt(Number.MAX_SAFE_INTEGER)) {
        throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
    }
    return long.toNumber();
}
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
