export const getMessageName = (message, activePlayersEntities, activeCharactersEntities, dmId) => {
    var _a, _b, _c, _d, _e;
    return message.entityType === 'user' && Number(message === null || message === void 0 ? void 0 : message.entityId) !== dmId
        ? (_a = activePlayersEntities[Number(message === null || message === void 0 ? void 0 : message.entityId)]) === null || _a === void 0 ? void 0 : _a.displayName
        : (_e = (_c = (_b = message === null || message === void 0 ? void 0 : message.data.context) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : (_d = activeCharactersEntities[Number(message === null || message === void 0 ? void 0 : message.entityId)]) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : 'Dungeon Master';
};
//# sourceMappingURL=getMessageName.js.map