<commit_before>const state = {
  machine: {},
  kits: {},
  containers: {},
};

const mutations = {
  SET_VALUES: (state, presets) => {
    state.machine = {
      box: Object.keys(presets.machine.box.releases)[0],
      memory: presets.machine.memory.value,
      timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
    };

    Object.values(presets.kits).forEach((kit) => {
      state.kits[kit.name] = {
        version: kit.version ? kit.version.releases[0] : '',
        install: kit.install.value ? Boolean(kit.install.value) : false,
      };

      if (kit.extensions) {
        state.kits[kit.name].extensions = {};
        kit.extensions.forEach((extension) => {
          state.kits[kit.name].extensions[extension.name] = {
            install: false,
            version: extension.version.releases[0],
          };
        });
      }
    });

    Object.values(presets.containers).forEach((container) => {
      state.containers[container.name] = {
        install: false,
        version: container.version.releases[0],
      };

      if (container.parameters) {
        state.containers[container.name].parameters = {};
        container.parameters.forEach((parameter) => {
          state.containers[container.name]
               .parameters[parameter.name] = parameter.value;
        });
      }
    });
  },
  UPDATE_KIT: (state, payload) => {
    console.log('payload', payload);
    state.kits[payload.name][payload.attribute] = payload.value;
    console.log('kits@values', state.kits);
  },
  UPDATE_KIT_EXTENSION: (state, payload) => {
    const kit = state.kits[payload.name];
    const extension = payload.extension;
    kit.extensions[extension.name][extension.attribute] = extension.value;
  },
  UPDATE_CONTAINER: (state, payload) => {
    console.log('payload', payload);
    state.containers[payload.name][payload.attribute] = payload.value;
  },
  UPDATE_CONTAINER_PARAMETER: (state, payload) => {
    const container = state.containers[payload.name];
    const parameter = payload.parameter;
    container.parameters[parameter.name] = parameter.value;
  },
};

const actions = {
  UPDATE_KIT: ({ commit }, payload) => {
    commit('UPDATE_KIT', payload);
  },
  UPDATE_KIT_EXTENSION: ({ commit }, payload) => {
    commit('UPDATE_KIT_EXTENSION', payload);
  },
  UPDATE_CONTAINER: ({ commit }, payload) => {
    console.log('hello');
    commit('UPDATE_CONTAINER', payload);
  },
  UPDATE_CONTAINER_PARAMETER: ({ commit }, payload) => {
    commit('UPDATE_CONTAINER_PARAMETER', payload);
  },
};

const getters = {
  values(state) {
    return state;
  },
};

export default {
  state,
  mutations,
  actions,
  getters,
};<commit_msg>Use Vue.set(map, key, value) to make values.js reactive<commit_after>import Vue from 'vue';

const state = {
  machine: {},
  kits: {},
  containers: {},
};

const mutations = {
  SET_VALUES: (state, presets) => {
    const machine = state.machine;
    const kits = state.kits;
    const containers = state.containers;

    // Use Vue.set will make nested maps reactive
    Vue.set(machine, 'box', Object.keys(presets.machine.box.releases)[0]);
    Vue.set(machine, 'memory', presets.machine.memory.value);
    Vue.set(machine, 'timezone', Intl.DateTimeFormat().resolvedOptions().timeZone);

    Object.values(presets.kits).forEach((kit) => {
      Vue.set(kits, kit.name, {});
      Vue.set(kits[kit.name], 'version', kit.version ? kit.version.releases[0] : '');
      Vue.set(kits[kit.name], 'install', kit.install.value ? Boolean(kit.install.value) : false);

      if (kit.extensions) {
        Vue.set(kits[kit.name], 'extensions', {});
        const extensions = kits[kit.name].extensions;

        kit.extensions.forEach((extension) => {
          Vue.set(extensions, extension.name, {});
          Vue.set(extensions[extension.name], 'install', false);
          Vue.set(extensions[extension.name], 'version', extension.version.releases[0]);
        });
      }
    });

    Object.values(presets.containers).forEach((container) => {
      Vue.set(containers, container.name, {});
      Vue.set(containers[container.name], 'install', false);
      Vue.set(containers[container.name], 'version', container.version.releases[0]);

      if (container.parameters) {
        Vue.set(containers[container.name], 'parameters', {});
        const parameters = containers[container.name].parameters;

        container.parameters.forEach((parameter) => {
          Vue.set(parameters, parameter.name, parameter.value);
        });
      }
    });
  },
  UPDATE_KIT: (state, payload) => {
    state.kits[payload.name][payload.attribute] = payload.value;
  },
  UPDATE_KIT_EXTENSION: (state, payload) => {
    const kit = state.kits[payload.name];
    const extension = payload.extension;
    kit.extensions[extension.name][extension.attribute] = extension.value;
  },
  UPDATE_CONTAINER: (state, payload) => {
    state.containers[payload.name][payload.attribute] = payload.value;
  },
  UPDATE_CONTAINER_PARAMETER: (state, payload) => {
    const container = state.containers[payload.name];
    const parameter = payload.parameter;
    container.parameters[parameter.name] = parameter.value;
  },
};

const actions = {
  UPDATE_KIT: ({ commit }, payload) => {
    commit('UPDATE_KIT', payload);
  },
  UPDATE_KIT_EXTENSION: ({ commit }, payload) => {
    commit('UPDATE_KIT_EXTENSION', payload);
  },
  UPDATE_CONTAINER: ({ commit }, payload) => {
    commit('UPDATE_CONTAINER', payload);
  },
  UPDATE_CONTAINER_PARAMETER: ({ commit }, payload) => {
    commit('UPDATE_CONTAINER_PARAMETER', payload);
  },
};

const getters = {
  values(state) {
    return state;
  },
};

export default {
  state,
  mutations,
  actions,
  getters,
};
{'fraction_non_alphanumeric': 0.16153307665383268, 'fraction_numerical': 0.001400070003500175, 'mean_word_length': 3.264925373134328, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1852008', 'n_tokens_mistral': 1850, 'n_tokens_neox': 1786, 'n_words': 279}