
import '../../../../base/common/errors.js';
import { localize, localize2 } from '../../../../nls.js';
import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
import { URI } from '../../../../base/common/uri.js';
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
import { Codicon } from '../../../../base/common/codicons.js';

const PROFILE_URL_AUTHORITY = "profile";
function toUserDataProfileUri(path, productService) {
    return ( URI.from({
        scheme: productService.urlProtocol,
        authority: PROFILE_URL_AUTHORITY,
        path: path.startsWith("/") ? path : `/${path}`
    }));
}
const PROFILE_URL_AUTHORITY_PREFIX = "profile-";
function isProfileURL(uri) {
    return uri.authority === PROFILE_URL_AUTHORITY || ( new RegExp(`^${PROFILE_URL_AUTHORITY_PREFIX}`)).test(uri.authority);
}
const defaultUserDataProfileIcon = registerIcon("defaultProfile-icon", Codicon.settings, ( localize(16576, "Icon for Default Profile.")));
const PROFILES_TITLE = ( localize2(16577, "Profiles"));
const PROFILES_CATEGORY = {
    ...PROFILES_TITLE
};
const PROFILE_EXTENSION = "code-profile";
const PROFILE_FILTER = [{
    name: ( localize(16578, "Profile")),
    extensions: [PROFILE_EXTENSION]
}];
const CURRENT_PROFILE_CONTEXT = ( new RawContextKey("currentProfile", ""));
const IS_CURRENT_PROFILE_TRANSIENT_CONTEXT = ( new RawContextKey("isCurrentProfileTransient", false));
const HAS_PROFILES_CONTEXT = ( new RawContextKey("hasProfiles", false));

export { CURRENT_PROFILE_CONTEXT, HAS_PROFILES_CONTEXT, IS_CURRENT_PROFILE_TRANSIENT_CONTEXT, PROFILES_CATEGORY, PROFILES_TITLE, PROFILE_EXTENSION, PROFILE_FILTER, PROFILE_URL_AUTHORITY, PROFILE_URL_AUTHORITY_PREFIX, defaultUserDataProfileIcon, isProfileURL, toUserDataProfileUri };
