<script setup>
import Strassennetz from "./components/Strassennetz.vue";
import { store } from "./store.js";
</script>
<script>
/** ------------------------------------------------------
 * Container der Seite für die Auswertung der Eingabe 
 * @author DigS-Gov Projekt
 * ------------------------------------------------------
 */
export default {
  components: { Strassennetz },
  data() {
    return {
      store,
    };
  },
  mounted() {
    //   console.log("Page 2: + "+this.$route.path);
    //   console.log("Page 2: + "+ this.$route.name);

    //   if(this.$route.name=="aufloesung_a"){
    //     store.config.variante_A=true;
    //     store.config.variante_B=false;
    //     store.config.variante_C=false;
    //   }
    //    if(this.$route.name=="aufloesung_b"){
    //     store.config.variante_A=false;
    //     store.config.variante_B=true;
    //     store.config.variante_C=false;
    //   }
    //    if(this.$route.name=="aufloesung_c"){
    //     store.config.variante_A=true;
    //     store.config.variante_B=false;
    //     store.config.variante_C=true;
    //   }

    store.setValuesToUserInput();
    store.checkUserInput();

    // Send logs to server if played for the first time
    if (store.alreadyPlayedOnce == false) {
      var userInput = JSON.stringify(store.conditional_values);
      var userInputCopy = JSON.parse(userInput);
      delete userInputCopy["default"];
      var valueString = JSON.stringify(userInputCopy)
      var sectionString = "Auflösung --- Nutzereingaben: ";
      var logString = sectionString + valueString;

      // actually send logs only if session-id is present (user is part of evaluation)
      if (store.session_id === null || store.session_id === "") {
      } else {
        store.logData(logString);
      }
      store.alreadyPlayedOnce = true;
    }

    // window.scrollTo(0, 0);
  }
};
</script>

<template>
  <section id="container_strassennetz">
    <Strassennetz page2_active= true page3_active= false />
  </section>
</template>

<style scoped>
#container_strassennetz {
  /** AUSSCHALTEN DER INTERAKTIONEN/ OVERLAY
  opacity: 0.2;
  pointer-events: none;
  /** */
  margin-bottom: 2%;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
</style>
