"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPolicyResponseCode = getPolicyResponseCode;
// TODO: Determine how to keep this in sycn with the PolicyResponse type
// Crappy tool https://jsbin.com/gojelov/edit?js,console,output
const policyResponseCodes = [
    { response: "granted", code: "PC100" },
    { response: "org-member", code: "PC101" },
    { response: "not-org-member", code: "PC102" },
    { response: "group-member", code: "PC103" },
    { response: "not-group-member", code: "PC104" },
    { response: "not-group-admin", code: "PC105" },
    { response: "is-user", code: "PC106" },
    { response: "not-owner", code: "PC107" },
    { response: "not-licensed", code: "PC108" },
    { response: "not-licensed-available", code: "PC109" },
    { response: "not-available", code: "PC110" },
    { response: "not-granted", code: "PC111" },
    { response: "no-edit-access", code: "PC112" },
    { response: "edit-access", code: "PC113" },
    { response: "invalid-permission", code: "PC114" },
    { response: "privilege-required", code: "PC115" },
    { response: "service-offline", code: "PC116" },
    { response: "service-maintenance", code: "PC117" },
    { response: "entity-required", code: "PC118" },
    { response: "not-authenticated", code: "PC119" },
    { response: "not-alpha-org", code: "PC120" },
    { response: "property-missing", code: "PC121" },
    { response: "property-not-array", code: "PC122" },
    { response: "array-contains-invalid-value", code: "PC123" },
    { response: "array-missing-required-value", code: "PC124" },
    { response: "property-mismatch", code: "PC125" },
    { response: "user-not-group-member", code: "PC126" },
    { response: "user-not-group-manager", code: "PC127" },
    { response: "user-not-group-owner", code: "PC128" },
    { response: "assertion-property-not-found", code: "PC129" },
    { response: "assertion-failed", code: "PC130" },
    { response: "assertion-requires-numeric-values", code: "PC131" },
    { response: "property-match", code: "PC132" },
    { response: "not-beta-org", code: "PC133" },
    { response: "not-in-environment", code: "PC134" },
    { response: "feature-disabled", code: "PC135" },
    { response: "feature-enabled", code: "PC136" },
    { response: "no-policy-exists", code: "PC137" },
    { response: "disabled-by-feature-flag", code: "PC138" },
    { response: "release-date-not-reached", code: "PC139" },
    { response: "retire-date-passed", code: "PC140" },
    { response: "platform-version-not-met", code: "PC141" },
    { response: "disabled-by-entity-flag", code: "PC142" },
];
/**
 * Get a code that can be used for i18n or other purposes, based on the PolicyResponse
 * @param response
 * @returns
 */
function getPolicyResponseCode(response) {
    const entry = policyResponseCodes.find((x) => x.response === response);
    return (entry === null || entry === void 0 ? void 0 : entry.code) || "PC000";
}
//# sourceMappingURL=getPolicyResponseCode.js.map