"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformEntityToEditor = transformEntityToEditor;
const transformEntityPermissionPoliciesToFormValues_1 = require("./transformEntityPermissionPoliciesToFormValues");
/**
 * @private
 * Transforms an IHubChannel entity pojo to an IHubChannelEditor object
 * @param entity an IHubChannel object
 * @returns an IHubChannelEditor object
 */
function transformEntityToEditor(entity, context) {
    return {
        id: entity.id,
        name: entity.name,
        blockWords: (entity.blockWords || []).join(","),
        allowAsAnonymous: entity.allowAsAnonymous,
        publicConfigs: (0, transformEntityPermissionPoliciesToFormValues_1.transformEntityPermissionPoliciesToPublicFormValues)(entity.permissions),
        orgConfigs: (0, transformEntityPermissionPoliciesToFormValues_1.transformEntityPermissionPoliciesToOrgFormValues)(entity.permissions, context.currentUser.orgId),
        groupConfigs: (0, transformEntityPermissionPoliciesToFormValues_1.transformEntityPermissionPoliciesToGroupFormValues)(entity.permissions),
        userConfigs: (0, transformEntityPermissionPoliciesToFormValues_1.transformEntityPermissionPoliciesToUserFormValues)(entity.permissions),
    };
}
//# sourceMappingURL=transformEntityToEditor.js.map