import AdmVue from "@assets/js/adm-vue";
import initVue from "@assets/js/initVue";
import copyContent from "@assets/js/copyContent";

const vm = new AdmVue({
  components: {
    BaseCard: () =>
      import(/* webpackChunkName: "BaseCard" */ "@elements/BaseCard/index.vue"),
    BaseTabs: () =>
      import(
        /* webpackChunkName: "BaseTabs" */ "@components/BaseTabs/index.vue"
      )
  },
  data() {
    return {
      configurations: {},
      tabs: [
        { text: "Geral", active: true },
        { text: "Rastreio", active: false }
      ]
    };
  },
  computed: {
    sendData() {
      return { ...this.configurations };
    },
    melhorenvioValorExtraMask() {
      // esta com numero magico, vamos ver como fazer com o type ainda
      return this.configurations.melhorenvio_tipo_valor_extra == 1
        ? "percentage"
        : "brazilCurrency";
    }
  },
  methods: {
    copyLink() {
      copyContent(this.callback);
    },
    handleEnvironment(value) {
      if (value == "sandbox") {
        this.autentication = this.environment_test;
      } else {
        this.autentication = this.environment_production;
      }
    }
  }
});

initVue(vm);
