import axios from "axios";
import { Marker, GoogleMap as GoogleMap$1 } from "vue3-google-map";
import { resolveComponent, mergeProps, withCtx, createVNode, createCommentVNode, useSSRContext } from "vue";
import { ssrRenderComponent, ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderClass, ssrRenderAttr, ssrRenderStyle, ssrIncludeBooleanAttr, ssrLooseEqual } from "vue/server-renderer";
import { _ as _export_sfc } from "../entries/pages.mjs";
/* empty css               */
import "@vue/server-renderer";
import "vue-router";
import "@vueuse/head";
import "vike/server";
/* empty css               */
/* empty css               */
import "pinia";
import "vue-i18n";
/*! src/components/GoogleMap.vue [vike:pluginModuleBanner] */
const _sfc_main$4 = {
  props: ["center"],
  data() {
    return {
      // locations: [
      //   { lat: -33.718234, lng: 150.363181 },
      //   { lat: -33.727111, lng: 150.371124 },
      //   { lat: -33.848588, lng: 151.209834 },
      //   { lat: -33.851702, lng: 151.216968 },
      //   { lat: -34.671264, lng: 150.863657 },
      //   { lat: -35.304724, lng: 148.662905 },
      //   { lat: -36.817685, lng: 175.699196 },
      //   { lat: -36.828611, lng: 175.790222 }
      // ]
    };
  },
  components: {
    GoogleMap: GoogleMap$1,
    GoogleMarker: Marker
  }
};
function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
  const _component_GoogleMap = resolveComponent("GoogleMap", true);
  const _component_GoogleMarker = resolveComponent("GoogleMarker");
  _push(ssrRenderComponent(_component_GoogleMap, mergeProps({
    "api-key": "",
    center: $props.center,
    zoom: 7,
    style: { "width": "100%", "height": "100%" }
  }, _attrs), {
    default: withCtx((_, _push2, _parent2, _scopeId) => {
      if (_push2) {
        _push2(ssrRenderComponent(_component_GoogleMarker, {
          options: { position: $props.center }
        }, null, _parent2, _scopeId));
        _push2(`<!-- <MarkerCluster>
      <GoogleMarker
        v-for="(location, i) in locations"
        :key="i"
        :options="{ position: location }"
      />
    </MarkerCluster> -->`);
      } else {
        return [
          createVNode(_component_GoogleMarker, {
            options: { position: $props.center }
          }, null, 8, ["options"]),
          createCommentVNode(' <MarkerCluster>\n      <GoogleMarker\n        v-for="(location, i) in locations"\n        :key="i"\n        :options="{ position: location }"\n      />\n    </MarkerCluster> ')
        ];
      }
    }),
    _: 1
    /* STABLE */
  }, _parent));
}
const _sfc_setup$4 = _sfc_main$4.setup;
_sfc_main$4.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/GoogleMap.vue");
  return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
};
const GoogleMap = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
/*! src/components/Suppliers.vue [vike:pluginModuleBanner] */
const _sfc_main$3 = {
  props: ["countries"],
  data() {
    return {
      supplierInfo: {}
    };
  },
  watch: {
    "countries"(val) {
      if (val.length > 0) {
        this.supplierInfo = val[0];
      }
    }
  },
  components: {
    GoogleMap
  }
};
function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
  const _component_google_map = resolveComponent("google-map");
  _push(`<div${ssrRenderAttrs(_attrs)}><h1 class="text-center font-bold text-legal-eagle text-3xl mb-2">${ssrInterpolate(_ctx.$t("Suppliers"))}</h1><p class="text-center text-dull font-medium sm:text-lg">${ssrInterpolate(_ctx.$t("Select any supplier and Contact with him"))}</p><div class="md:mt-14 mt-7 flex flex-wrap justify-center gap-3"><!--[-->`);
  ssrRenderList($props.countries, (supplier, index) => {
    _push(`<div><div class="${ssrRenderClass(`${$data.supplierInfo.id === supplier.id ? "bg-[#F3F8FF]" : ""} lg:w-[200px] w-auto flex items-center lg:gap-2 gap-1 py-4 px-3 lg:rounded-2xl rounded-xl shadow-[0px_4px_12px_0px_#00000040] cursor-pointer select-none`)}"><img${ssrRenderAttr("src", supplier.image)}${ssrRenderAttr("alt", `${supplier.name} Logo`)} class="lg:w-[50px] w-[30px] lg:h-[40px] h-[20px]"><p class="text-black lg:text-base text-sm">${ssrInterpolate(supplier.name)}</p></div></div>`);
  });
  _push(`<!--]--></div>`);
  if ($data.supplierInfo && $data.supplierInfo.contact_info) {
    _push(`<div class="md:mt-14 mt-7 xl:flex grid grid-cols-2 gap-x-6 gap-y-10 rounded-[20px] lg:p-14 sm:p-10 p-6 bg-no-repeat bg-cover bg-center suppliers-bg"><div class="md:col-span-1 col-span-2 text-white flex flex-col xl:gap-7 gap-5 xl:whitespace-nowrap"><p class="font-bold text-2xl">Contact Information</p><p class="text-[#C9C9C9]">${ssrInterpolate($data.supplierInfo.contact_info[0][`desc_${_ctx.$i18n.locale}`])}</p><p>${($data.supplierInfo.contact_info[0][`work_hours_${_ctx.$i18n.locale}`] ? $data.supplierInfo.contact_info[0][`work_hours_${_ctx.$i18n.locale}`].replace(/\r?\n/g, "<br>") : "") ?? ""}</p><div class="flex items-center gap-4"><!--[-->`);
    ssrRenderList($data.supplierInfo.social_media, (item, index) => {
      _push(`<div class="w-8 h-8 rounded-full bg-black flex items-center justify-center p-2 cursor-pointer hover:bg-[#12284A]"><a${ssrRenderAttr("href", item.link)} target="_blank" rel="noopener noreferrer"><img class="max-w-4 max-h-4"${ssrRenderAttr("src", item.image)}${ssrRenderAttr("alt", item.type)}></a></div>`);
    });
    _push(`<!--]--></div></div><div class="md:col-span-1 col-span-2 text-white flex flex-col xl:gap-7 gap-5"><div class="flex gap-4"><p class="material-symbols-rounded">phone_in_talk</p><p>${ssrInterpolate($data.supplierInfo.contact_info[0].phone)}</p></div><div class="flex gap-4"><p class="material-symbols-rounded">mail</p><p>${ssrInterpolate($data.supplierInfo.contact_info[0].email)}</p></div><div class="flex gap-4"><p class="material-symbols-rounded">location_on</p><p>${ssrInterpolate($data.supplierInfo.contact_info[0].address)}</p></div></div><div class="col-span-2 xl:min-w-[375px] min-w-full h-[230px]">`);
    _push(ssrRenderComponent(_component_google_map, {
      center: { lat: Number($data.supplierInfo.contact_info[0].lat), lng: Number($data.supplierInfo.contact_info[0].lng) }
    }, null, _parent));
    _push(`</div></div>`);
  } else {
    _push(`<!---->`);
  }
  _push(`</div>`);
}
const _sfc_setup$3 = _sfc_main$3.setup;
_sfc_main$3.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Suppliers.vue");
  return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
};
const Suppliers = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
/*! src/components/ContactUs.vue?vue&type=style&index=0&lang.scss [vike:pluginModuleBanner] */
/*! src/components/ContactUs.vue [vike:pluginModuleBanner] */
const _sfc_main$2 = {
  props: ["contactInfo"],
  data() {
    return {
      loading: false,
      dataObj: {
        first_name: "",
        last_name: "",
        email: "",
        phone: "",
        type: "",
        message: ""
      },
      valid: {
        first_name: true,
        last_name: true,
        email: true,
        phone: true,
        type: true,
        message: true
      }
    };
  },
  computed: {
    emailValid() {
      const regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
      return regex.test(this.dataObj.email);
    },
    phoneValid() {
      const regex = /^[0-9]{11}$/;
      return regex.test(this.dataObj.phone);
    },
    messageValid() {
      return this.dataObj.message.length >= 5;
    }
  },
  methods: {
    validateForm() {
      this.valid.first_name = this.dataObj.first_name.trim() !== "";
      this.valid.last_name = this.dataObj.last_name.trim() !== "";
      this.valid.email = this.emailValid;
      this.valid.phone = this.phoneValid;
      this.valid.type = this.dataObj.type.trim() !== "";
      this.valid.message = this.messageValid;
    },
    async sendForm() {
      this.validateForm();
      if (Object.values(this.valid).every((v) => v === true)) {
        this.loading = true;
        try {
          await axios.post("https://admin.valueerp.net/api/contact/send", this.dataObj);
          this.dataObj = {
            first_name: "",
            last_name: "",
            email: "",
            phone: "",
            type: "",
            message: ""
          };
        } catch (error) {
        } finally {
          this.loading = false;
        }
      }
    }
  }
};
function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
  _push(`<div${ssrRenderAttrs(_attrs)}><!-- Loading -->`);
  if ($data.loading) {
    _push(`<div class="fixed inset-0 h-dvh flex items-center justify-center bg-white bg-opacity-90 z-50"><div class="border-4 border-y-ambassador-blue border-x-inherit border-solid w-10 h-10 rounded-full animate-spin"></div></div>`);
  } else {
    _push(`<!---->`);
  }
  _push(`<p class="text-center font-bold text-legal-eagle text-3xl mb-2">${ssrInterpolate(_ctx.$t("Contact US"))}</p><p class="text-center text-dull font-medium sm:text-lg">${ssrInterpolate(_ctx.$t("Any question or remarks? Just write us a message!"))}</p><div class="mt-7 bg-white rounded-xl md:p-14 sm:p-10 p-6" style="${ssrRenderStyle({ "box-shadow": "0px 0px 60px 30px #00000008" })}"><div class="text-night-sky grid sm:grid-cols-2 grid-cols-1 lg:gap-8 gap-6"><div class="md:col-span-1 sm:col-span-1 col-span-2"><label for="firstName" class="block mb-2">${ssrInterpolate(_ctx.$t("First Name"))}</label><input${ssrRenderAttr("value", $data.dataObj.first_name)} id="firstName" type="text"${ssrRenderAttr("placeholder", _ctx.$t("Add First Name"))} class="text-sm w-full border border-solid border-[#F2F2F2] rounded-md outline-none py-3 px-4">`);
  if (!$data.valid.first_name) {
    _push(`<span class="text-red-500 text-xs">${ssrInterpolate(_ctx.$t("First Name is required"))}</span>`);
  } else {
    _push(`<!---->`);
  }
  _push(`</div><div class="md:col-span-1 sm:col-span-1 col-span-2"><label for="lastName" class="block mb-2">${ssrInterpolate(_ctx.$t("Last Name"))}</label><input${ssrRenderAttr("value", $data.dataObj.last_name)} id="lastName" type="text"${ssrRenderAttr("placeholder", _ctx.$t("Add Last Name"))} class="text-sm w-full border border-solid border-[#F2F2F2] rounded-md outline-none py-3 px-4">`);
  if (!$data.valid.last_name) {
    _push(`<span class="text-red-500 text-xs">${ssrInterpolate(_ctx.$t("Last Name is required"))}</span>`);
  } else {
    _push(`<!---->`);
  }
  _push(`</div><div class="md:col-span-1 sm:col-span-1 col-span-2"><label for="email" class="block mb-2">${ssrInterpolate(_ctx.$t("Email"))}</label><input${ssrRenderAttr("value", $data.dataObj.email)} id="email" type="text"${ssrRenderAttr("placeholder", _ctx.$t("Add Email"))} class="text-sm w-full border border-solid border-[#F2F2F2] rounded-md outline-none py-3 px-4">`);
  if (!$data.valid.email) {
    _push(`<span class="text-red-500 text-xs">${ssrInterpolate(_ctx.$t("Please enter a valid email"))}</span>`);
  } else {
    _push(`<!---->`);
  }
  _push(`</div><div class="md:col-span-1 sm:col-span-1 col-span-2"><label for="phone" class="block mb-2">${ssrInterpolate(_ctx.$t("Phone Number"))}</label><input${ssrRenderAttr("value", $data.dataObj.phone)} id="phone" type="text"${ssrRenderAttr("placeholder", _ctx.$t("Add Phone Number"))} class="text-sm w-full border border-solid border-[#F2F2F2] rounded-md outline-none py-3 px-4">`);
  if (!$data.valid.phone) {
    _push(`<span class="text-red-500 text-xs">${ssrInterpolate(_ctx.$t("Please enter a valid phone number"))}</span>`);
  } else {
    _push(`<!---->`);
  }
  _push(`</div><div class="col-span-2"><p class="mb-3">${ssrInterpolate(_ctx.$t("Select Subject?"))}</p><div class="grid lg:grid-cols-4 sm:grid-cols-2 grid-cols-1 gap-y-2 gap-x-4"><div class="subject ms-5 items-center"><input${ssrIncludeBooleanAttr(ssrLooseEqual($data.dataObj.type, "sales")) ? " checked" : ""} value="sales" type="radio" class="cursor-pointer" name="subject" id="sales"><label class="relative cursor-pointer text-xs text-black" for="sales">${ssrInterpolate(_ctx.$t("Sales"))}</label></div><div class="subject ms-5 items-center"><input${ssrIncludeBooleanAttr(ssrLooseEqual($data.dataObj.type, "technical_support")) ? " checked" : ""} value="technical_support" type="radio" class="cursor-pointer" name="subject" id="technicalSupport"><label class="relative cursor-pointer text-xs text-black" for="technicalSupport">${ssrInterpolate(_ctx.$t("Technical support"))}</label></div><div class="subject ms-5 items-center"><input${ssrIncludeBooleanAttr(ssrLooseEqual($data.dataObj.type, "partnerships")) ? " checked" : ""} value="partnerships" type="radio" class="cursor-pointer" name="subject" id="partnerships"><label class="relative cursor-pointer text-xs text-black" for="partnerships">${ssrInterpolate(_ctx.$t("Partnerships"))}</label></div><div class="subject ms-5 items-center"><input${ssrIncludeBooleanAttr(ssrLooseEqual($data.dataObj.type, "general_inquiry")) ? " checked" : ""} value="general_inquiry" type="radio" class="cursor-pointer" name="subject" id="generalInquiry"><label class="relative cursor-pointer text-xs text-black" for="generalInquiry">${ssrInterpolate(_ctx.$t("General Inquiry"))}</label></div></div>`);
  if (!$data.valid.type) {
    _push(`<span class="text-red-500 text-xs">${ssrInterpolate(_ctx.$t("Subject is required"))}</span>`);
  } else {
    _push(`<!---->`);
  }
  _push(`</div><div class="col-span-2"><label for="message" class="block mb-2">${ssrInterpolate(_ctx.$t("Message"))}</label><textarea name="message" id="message"${ssrRenderAttr("placeholder", _ctx.$t("Write your message"))} rows="3" class="resize-none text-sm w-full border border-solid border-[#F2F2F2] rounded-md outline-none py-3 px-4">${ssrInterpolate($data.dataObj.message)}</textarea>`);
  if (!$data.valid.message) {
    _push(`<span class="text-red-500 text-xs">${ssrInterpolate(_ctx.$t("Message must be at least 5 characters"))}</span>`);
  } else {
    _push(`<!---->`);
  }
  _push(`</div><div class="col-span-2"><button class="w-full bg-[#E84E0C] text-white rounded-lg font-medium md:text-base text-sm py-3 px-8">${ssrInterpolate(_ctx.$t("Send"))}</button></div></div></div></div>`);
}
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ContactUs.vue");
  return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const ContactUs = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
/*! src/assets/images/faq.png [vike:pluginModuleBanner] */
const _imports_0 = "/assets/static/faq.Dub-ebTj.png";
/*! src/components/FAQ.vue [vike:pluginModuleBanner] */
const _sfc_main$1 = {
  props: ["faq"],
  watch: {
    faq() {
      this.faq.forEach((item, index) => {
        item.isOpen = index === 0 ? true : false;
      });
    }
  },
  methods: {
    toggleAccordion(moduleIndex) {
      this.faq.forEach((item, index) => {
        item.isOpen = moduleIndex === index ? true : false;
      });
    }
  }
};
function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
  _push(`<div${ssrRenderAttrs(mergeProps({ class: "grid lg:grid-cols-2 grid-cols-1 items-center lg:gap-10 gap-6" }, _attrs))}><div class="text-legal-eagle col-span-1"><p class="font-bold text-3xl md:mb-4 mb-2">${ssrInterpolate(_ctx.$t("Frequently Asked Questions"))}</p><p>${ssrInterpolate(_ctx.$t("Lorem ipsum dolor sit amet consectetur adipiscing eli mattis sit phasellus mollis sit aliquam sit nullam."))}</p><div class="flex flex-col gap-4 mt-10"><!--[-->`);
  ssrRenderList($props.faq, (item, index) => {
    _push(`<div class="${ssrRenderClass(`sm:px-6 p-4 border border-solid border-[#E1E4ED] ${item.isOpen ? "rounded-2xl bg-[#F1F3F7]" : "rounded-full shadow-sm"}`)}"><div class="cursor-pointer flex items-center justify-between"><p class="sm:font-semibold font-medium sm:text-base text-sm">${ssrInterpolate(item[`question_${_ctx.$i18n.locale}`])}</p><span class="material-symbols-rounded text-xl leading-none">${ssrInterpolate(item.isOpen ? "close" : "add")}</span></div><p class="${ssrRenderClass(`sm:text-sm text-xs mt-2 ${item.isOpen ? "block" : "hidden"}`)}">${ssrInterpolate(item[`answer_${_ctx.$i18n.locale}`])}</p></div>`);
  });
  _push(`<!--]--></div></div><div class="col-span-1"><img${ssrRenderAttr("src", _imports_0)} class="sm:w-3/4 w-full m-auto" alt="Frequently asked questions"></div></div>`);
}
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/FAQ.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const FAQ = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
/*! src/views/ContactUsPage.vue [vike:pluginModuleBanner] */
const _sfc_main = {
  data() {
    return {
      faq: [],
      countries: [],
      loading: false
    };
  },
  methods: {
    async loadCountries() {
      this.loading = true;
      try {
        const response = await axios.get("https://admin.valueerp.net/api/countries");
        this.countries = response.data.data.data;
      } catch (error) {
      } finally {
        this.loading = false;
      }
    },
    async loadContactInformation() {
      this.loading = true;
      try {
        const response = await axios.get("https://admin.valueerp.net/api/ContactInformation");
        this.faq = response.data.data.faq;
      } catch (error) {
      } finally {
        this.loading = false;
      }
    }
  },
  components: {
    Suppliers,
    ContactUs,
    FAQ
  },
  async serverPrefetch() {
    await Promise.all([this.loadCountries(), this.loadContactInformation()]);
  },
  created() {
    if (typeof window !== "undefined") {
      this.loadCountries();
      this.loadContactInformation();
    }
  }
};
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
  const _component_suppliers = resolveComponent("suppliers");
  const _component_contact_us = resolveComponent("contact-us");
  const _component_FAQ = resolveComponent("FAQ");
  _push(`<div${ssrRenderAttrs(_attrs)}><!-- Loading -->`);
  if ($data.loading) {
    _push(`<div class="fixed inset-0 h-dvh flex items-center justify-center bg-white bg-opacity-90 z-50"><div class="border-4 border-y-ambassador-blue border-x-inherit border-solid w-10 h-10 rounded-full animate-spin"></div></div>`);
  } else {
    _push(`<!---->`);
  }
  _push(ssrRenderComponent(_component_suppliers, {
    countries: $data.countries,
    class: "mt-24 max-w-screen-2xl mx-auto xl:px-32 lg:px-16 md:px-12 sm:px-8 px-6"
  }, null, _parent));
  _push(ssrRenderComponent(_component_contact_us, { class: "mt-16 max-w-screen-2xl mx-auto xl:px-32 lg:px-16 md:px-12 sm:px-8 px-6" }, null, _parent));
  if ($data.faq.length > 0) {
    _push(ssrRenderComponent(_component_FAQ, {
      faq: $data.faq,
      class: "mt-16 max-w-screen-2xl mx-auto xl:px-32 lg:px-16 md:px-12 sm:px-8 px-6"
    }, null, _parent));
  } else {
    _push(`<!---->`);
  }
  _push(`</div>`);
}
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/ContactUsPage.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const ContactUsPage = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
export {
  ContactUsPage as default
};
