import { X as find, U as map, a1 as Tag } from './MapEditView-67426f04.js';
import { observer } from 'mobx-react';
import React__default from 'react';
import { t as thumbListContext, a as i18n, C as ConditionPermissionEnum, b as prefixCls } from './index-0d47f21f.js';
import 'react-dom';
import 'react-dnd-html5-backend';
import 'classnames';
import 'perfect-scrollbar';
import 'react-virtualized';
import 'maptalks';
import 'lodash';
import 'uuid';
import 'mobx';
import 'lz-string';
import 'dayjs';
import 'react-is';
import '@loadable/component';
import 'js-beautify';
import 'axios';
import 'superstruct';
import '@tanem/react-nprogress';
import 'jquery';
import 'chroma-js';
import 'js-cookie';
import 'is-email';
import 'is-uuid';
import 'is-url';
import 'anymatch';
import 'perf-request';
import '@syncpoint/wkx';
import 'buffer';
import '@turf/turf';
import '@mapbox/polylabel';
import 'turf-multipolygon';
import 'turf-polygon';
import 'gcoord';
import 'eventemitter2';
import 'geobuf';
import 'localforage';
import 'rc-menu';
import 'ahooks';
import 'jszip';
import 'file-saver';
import 'screenfull';
import 'sql-formatter-fork';
import 'array-move';
import 'turf-multilinestring';
import 'copy-to-clipboard';
import 'maptalks.three';
import 'ajv';
import 'spark-md5';
import 'react-draggable';
import 'turf-point';
import 'decamelize';
import 'rbush';
import 'qs';
import 'maptalks.snap';
import 'react-use';
import 'react-rnd';
import 'react-beautiful-dnd';
import 'react-contextmenu';
import './orderBy-e2803ab1.js';
import 'coordtransform';
import './compact-8e87287d.js';
import './useDataValue-bfcabd04.js';
import 'ali-react-table-fork';
import './Transfer-20410a61.js';
import 'ismobilejs';

var CollaborationDetailItem = function (_a) {
    var it = _a.it;
    return (React__default.createElement("div", { className: "".concat(prefixCls, "-detail-item") },
        React__default.createElement("div", { className: "".concat(prefixCls, "-detail-item-label") }, it.label),
        React__default.createElement("div", { className: "".concat(prefixCls, "-detail-item-value") }, it.value)));
};
var CollaborationDetail = observer(function () {
    var Context = thumbListContext.getContext();
    var value = React__default.useContext(Context);
    var store = value.store;
    var appUsers = store.appUsers, displayTableData = store.displayTableData, packageItem = store.packageItem;
    var menus = React__default.useMemo(function () {
        var _a;
        var adminUser = find(appUsers, function (user) { return packageItem.userId === user.id; });
        return [
            {
                label: i18n.collaboration.dataName,
                value: packageItem.name,
            },
            {
                label: i18n.collaboration.dataType,
                value: i18n.collaboration.collaborationData,
            },
            {
                label: i18n.collaboration.initiatingUser,
                value: (_a = adminUser === null || adminUser === void 0 ? void 0 : adminUser.title) !== null && _a !== void 0 ? _a : '-',
            },
        ];
    }, [appUsers, packageItem.name, packageItem.userId]);
    var menus1 = React__default.useMemo(function () {
        return map(displayTableData, function (data) {
            var condition = data.condition, permission = data.permission;
            var tag = permission === ConditionPermissionEnum.editable
                ? i18n.collaboration.editable
                : i18n.collaboration.onlyView;
            var color = permission === ConditionPermissionEnum.editable ? 'green-900' : 'yellow-900';
            return [
                {
                    label: i18n.collaboration.condition,
                    value: condition,
                },
                {
                    label: i18n.collaboration.dataPermission,
                    value: React__default.createElement(Tag, { tag: tag, color: color }),
                },
            ];
        });
    }, [displayTableData]);
    return (React__default.createElement("div", { className: "".concat(prefixCls, "-detail") },
        React__default.createElement("div", { className: "".concat(prefixCls, "-detail-items") }, map(menus, function (it) {
            return React__default.createElement(CollaborationDetailItem, { it: it });
        })),
        map(menus1, function (arr) {
            return (React__default.createElement("div", { className: "".concat(prefixCls, "-detail-items") }, map(arr, function (it) {
                return React__default.createElement(CollaborationDetailItem, { it: it });
            })));
        })));
});
CollaborationDetail.displayName = 'CollaborationDetail';

export { CollaborationDetail as default };
