import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createElementVNode, toDisplayString, createElementBlock, Fragment, renderList, normalizeClass } from "vue";
import { u as useI18n, k as useAuthService, b as useAppStore, _ as _sfc_main$1 } from "./index-8d76cfd8.mjs";
const _hoisted_1 = { class: "row justify-content-md-center" };
const _hoisted_2 = { class: "col-md-6" };
const _hoisted_3 = { class: "display-2" };
const _hoisted_4 = { class: "list-unstyled my-4" };
const _hoisted_5 = { class: "d-flex align-items-center" };
const _hoisted_6 = { class: "icon icon-sm icon-shape bg-gradient-primary text-white shadow rounded-circle" };
const _hoisted_7 = { class: "pl-2 text-lg" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Billing",
  setup(__props) {
    const { t, n } = useI18n();
    const state = ref({
      quantity: 0,
      discount: 0,
      price: 0,
      total: 0,
      usage: 0
    });
    const authService = useAuthService();
    const appStore = useAppStore();
    const definition = {
      quantity: { icon: "fas fa-key", text: "licenses" },
      usage: { icon: "fas fa-circle-check", text: "usage" },
      expire_day: { icon: "fas fa-calendar", text: "expireDay" },
      price: { icon: "fas fa-user", text: "price", currency: true },
      discount: { icon: "fas fa-tags", text: "discount", currency: true },
      total: { icon: "fas fa-money-bill-wave-alt", text: "total", currency: true }
    };
    const load = async () => {
      appStore.loading = true;
      try {
        state.value = await authService.loadLicense();
      } finally {
        appStore.loading = false;
      }
    };
    load();
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$1, {
        title: unref(t)("billing")
      }, {
        default: withCtx(() => [
          createElementVNode("div", _hoisted_1, [
            createElementVNode("div", _hoisted_2, [
              createElementVNode("div", _hoisted_3, toDisplayString(unref(n)(state.value.total - state.value.discount, "currency")), 1),
              createElementVNode("ul", _hoisted_4, [
                (openBlock(), createElementBlock(Fragment, null, renderList(definition, (value, name) => {
                  return createElementVNode("li", { key: name }, [
                    createElementVNode("div", _hoisted_5, [
                      createElementVNode("div", null, [
                        createElementVNode("div", _hoisted_6, [
                          createElementVNode("i", {
                            class: normalizeClass(value.icon)
                          }, null, 2)
                        ])
                      ]),
                      createElementVNode("div", null, [
                        createElementVNode("span", _hoisted_7, toDisplayString(unref(t)(value.text)) + ": " + toDisplayString(value.currency ? unref(n)(state.value[name], "currency") : state.value[name]), 1)
                      ])
                    ])
                  ]);
                }), 64))
              ])
            ])
          ])
        ]),
        _: 1
      }, 8, ["title"]);
    };
  }
});
const Billing_vue_vue_type_style_index_0_lang = "";
export {
  _sfc_main as default
};
