local achievement_group = {
  [1001] = {
    [-1] = -1,
    [-2] = {
      [-3] = -2,
      [-4] = -3
    },
    [-5] = -4,
    [-6] = -5,
    [-7] = {
      {
        -6,
        -7,
        -8
      }
    }
  },
  [1002] = {
    [-1] = -9,
    [-2] = {
      [-3] = -2,
      [-4] = -10
    },
    [-5] = -11,
    [-6] = -12,
    [-7] = {
      {
        -6,
        -7,
        -8
      }
    }
  },
  [1003] = {
    [-1] = -13,
    [-2] = {
      [-3] = -2,
      [-4] = -14
    },
    [-5] = -15,
    [-6] = -16,
    [-7] = {
      {
        -6,
        -7,
        -8
      }
    }
  },
  [1004] = {
    [-1] = -17,
    [-2] = {
      [-3] = -2,
      [-4] = -18
    },
    [-5] = -19,
    [-6] = -20,
    [-7] = {
      {
        -6,
        -7,
        -8
      }
    }
  },
  [1005] = {
    [-1] = -21,
    [-2] = {
      [-3] = -2,
      [-4] = -22
    },
    [-5] = -23,
    [-6] = -24,
    [-7] = {
      {
        -6,
        -7,
        -8
      }
    }
  },
  [1006] = {
    [-1] = -25,
    [-2] = {
      [-3] = -2,
      [-4] = -26
    },
    [-5] = -27,
    [-6] = -24,
    [-7] = {
      {
        -6,
        -7,
        -8
      }
    }
  },
  [1007] = {
    [-1] = -28,
    [-2] = {
      [-3] = -2,
      [-4] = -29
    },
    [-5] = -30,
    [-6] = -24,
    [-7] = {
      {
        -6,
        -7,
        -8
      }
    }
  }
}
local key_to_index_map = {
  id = -1,
  achiName = -2,
  group = -3,
  langKey = -4,
  achiRes = -5,
  achiPage = -6,
  reward = -7
}
local index_to_key_map = {}
for k, v in pairs(key_to_index_map) do
  index_to_key_map[v] = k
end
local value_to_index_map = {
  [1001] = -1,
  lang_achievement_group = -2,
  ["1001_1_0"] = -3,
  ["UI/Atlas/AchievementGroup/tex_achievement_icon_01.png"] = -4,
  ["UI/Atlas/AchievementGroup/tex_achievement_page_icon_xd2.png"] = -5,
  [9] = -6,
  [10044] = -7,
  [1] = -8,
  [1002] = -9,
  ["1002_1_0"] = -10,
  ["UI/Atlas/AchievementGroup/tex_achievement_icon_02.png"] = -11,
  ["UI/Atlas/AchievementGroup/tex_achievement_page_icon_tdwx2.png"] = -12,
  [1003] = -13,
  ["1003_1_0"] = -14,
  ["UI/Atlas/AchievementGroup/tex_achievement_icon_03.png"] = -15,
  ["UI/Atlas/AchievementGroup/tex_achievement_page_icon_hyl2.png"] = -16,
  [1004] = -17,
  ["1004_1_0"] = -18,
  ["UI/Atlas/AchievementGroup/tex_achievement_icon_04.png"] = -19,
  ["UI/Atlas/AchievementGroup/tex_achievement_page_icon_yjwj2.png"] = -20,
  [1005] = -21,
  ["1005_1_0"] = -22,
  ["UI/Atlas/AchievementGroup/tex_achievement_icon_05.png"] = -23,
  [""] = -24,
  [1006] = -25,
  ["1006_1_0"] = -26,
  ["UI/Atlas/AchievementGroup/tex_achievement_icon_06.png"] = -27,
  [1007] = -28,
  ["1007_1_0"] = -29,
  ["UI/Atlas/AchievementGroup/tex_achievement_icon_07.png"] = -30
}
local index_to_value_map = {}
for k, v in pairs(value_to_index_map) do
  index_to_value_map[v] = k
end

local function SetReadonlyTable(t)
  for k, v in pairs(t) do
    if type(v) == "table" then
      t[k] = SetReadonlyTable(v)
    end
  end
  local mt = {
    __data = t,
    __index_to_key_map = index_to_key_map,
    __key_to_index_map = key_to_index_map,
    __index_to_value_map = index_to_value_map,
    __index = function(t, k)
      local tmt = getmetatable(t)
      local data = tmt.__data
      local value_index
      if tmt.__key_to_index_map[k] ~= nil then
        value_index = data[tmt.__key_to_index_map[k]]
      else
        value_index = data[k]
      end
      if type(value_index) == "table" then
        return value_index
      else
        return tmt.__index_to_value_map[value_index]
      end
    end,
    __newindex = function(t, k, v)
      errorf("attempt to modify a read-only talbe!", 2)
    end,
    __pairs = function(t, k)
      return function(t, k)
        local tmt = getmetatable(t)
        local data = tmt.__data
        local nk, nv
        if tmt.__key_to_index_map[k] ~= nil then
          local iter_key = tmt.__key_to_index_map[k]
          nk, nv = next(data, iter_key)
        else
          nk, nv = next(data, k)
        end
        local key, value
        if tmt.__index_to_key_map[nk] ~= nil then
          key = tmt.__index_to_key_map[nk]
        else
          key = nk
        end
        if type(nv) == "table" then
          value = nv
        else
          value = tmt.__index_to_value_map[nv]
        end
        return key, value
      end, t, nil
    end,
    __len = function(t)
      local tmt = getmetatable(t)
      local data = tmt.__data
      return #data
    end
  }
  t = setmetatable({}, mt)
  return t
end

achievement_group = SetReadonlyTable(achievement_group)
return achievement_group
