import { _ as __nuxt_component_0 } from './AlamiyaNewSection-1njN8O2m.mjs';
import { _ as _sfc_main$2 } from './AboutCards-Dt9tMbfm.mjs';
import { u as useI18n, c as useHead, m as useToast, P as POSITION, F as Form, n as __nuxt_component_1, o as _sfc_main$9, p as _sfc_main$7, f as useRuntimeConfig } from './server.mjs';
import { useSSRContext, ref, mergeProps, unref, withCtx, createVNode, toDisplayString } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderClass, ssrInterpolate, ssrIncludeBooleanAttr } from 'vue/server-renderer';
import * as yup from 'yup';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import 'ipx';
import 'node:path';
import './GeneralCallToAction-BNzByXfE.mjs';
import './useAPIFetch-Bdd4OwYk.mjs';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'vue-social-sharing';
import 'axios';
import '@headlessui/vue';

const _sfc_main$1 = {
  __name: "GeneralAbout",
  __ssrInlineRender: true,
  props: {
    items: {
      required: false
    },
    options: {
      required: false
    },
    id: {
      required: false
    },
    name: {
      required: false
    },
    placeholder: {
      required: false
    }
  },
  setup(__props) {
    const toast = useToast();
    const config = useRuntimeConfig();
    const i18n = useI18n();
    const schema = yup.object({
      full_name: yup.string().required(i18n.t("FORMS.Validation.name")),
      email: yup.string().email(i18n.t("FORMS.Validation.validEmail")).required(i18n.t("FORMS.Validation.email")),
      phone: yup.string().required(i18n.t("FORMS.Validation.phone")),
      subject: yup.string().required(i18n.t("FORMS.Validation.subject")),
      // budget: yup.object().required(i18n.t("FORMS.Validation.budget")),
      message: yup.string().required(i18n.t("FORMS.Validation.message"))
    });
    const phone_code = ref(null);
    const btnLoading = ref(false);
    function onSubmit(e, actions) {
      btnLoading.value = true;
      const SUBMITDATA = new FormData();
      SUBMITDATA.append(`email`, e.email);
      SUBMITDATA.append("name", e.full_name);
      SUBMITDATA.append("phone", e.phone);
      SUBMITDATA.append("content", e.message);
      SUBMITDATA.append("phone_code", phone_code.value.phone_code);
      SUBMITDATA.append("subject", e.subject);
      $fetch("contact", {
        method: "POST",
        body: SUBMITDATA,
        baseURL: config.public.baseURL,
        headers: {
          "Accept-Language": i18n.locale.value
        }
      }).then((res) => {
        btnLoading.value = false;
        actions.resetForm();
        toast.success(res.message, {
          timeout: 2e3,
          position: i18n.locale.value == "en" ? POSITION.BOTTOM_RIGHT : POSITION.BOTTOM_LEFT
        });
      }).catch((err) => {
        btnLoading.value = false;
        toast.error(err.response._data.message, {
          timeout: 2e3,
          position: i18n.locale.value == "en" ? POSITION.BOTTOM_RIGHT : POSITION.BOTTOM_LEFT
        });
      });
    }
    function getPhoneCode(e, s) {
      phone_code.value = e;
    }
    ref([]);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_VeeForm = Form;
      const _component_inputs_base = __nuxt_component_1;
      const _component_inputs_phone = _sfc_main$9;
      const _component_inputs_textarea = _sfc_main$7;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "container min-h-fit pb-11" }, _attrs))}><div class="${ssrRenderClass([_ctx.$i18n.locale, "form_wrapper"])}"><div class="lg:pe-20 space-y-5 lg:ps-9 z-10"><h2 class="text-4xl lg:text-5xl lg:leading-[3.5rem] lg:mt-20 2xl:text-7 font-bold">${ssrInterpolate(_ctx.$t("TITLES.readyToGetStarted"))}</h2><p class="mb-5">${ssrInterpolate(_ctx.$t("TITLES.letBuildBestDigitalSolutionsForYourBusinessNow"))}</p></div>`);
      _push(ssrRenderComponent(_component_VeeForm, {
        as: "div",
        onSubmit,
        "validation-schema": unref(schema),
        class: "bg-white bg-opacity-10 z-10 space-y-2 border border-opacity-10 border-white shadow-md rounded-[25px] px-8 pt-6 pb-8 mb-4"
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<form${_scopeId}>`);
            _push2(ssrRenderComponent(_component_inputs_base, {
              id: "full_name",
              name: "full_name",
              placeholder: _ctx.$t("FORMS.Placeholders.fullName")
            }, null, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_inputs_base, {
              id: "email_address",
              name: "email",
              type: "email",
              placeholder: _ctx.$t("FORMS.Placeholders.yourEmail")
            }, null, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_inputs_phone, {
              onCode_change: ($event) => getPhoneCode($event),
              placeholder: _ctx.$t("FORMS.Placeholders.yourPhone")
            }, null, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_inputs_base, {
              id: "subject",
              name: "subject",
              type: "text",
              placeholder: _ctx.$t("FORMS.Placeholders.subject")
            }, null, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_inputs_textarea, {
              rows: "4",
              id: "message",
              name: "message",
              placeholder: _ctx.$t("FORMS.Placeholders.TypeYourMessageHere")
            }, null, _parent2, _scopeId));
            _push2(`<div class="flex items-center justify-between"${_scopeId}><button${ssrIncludeBooleanAttr(unref(btnLoading)) ? " disabled" : ""} class="bg-blue-500 border border-white rounded-[25px] px-[30px] py-3 hover:bg-blue-700 text-white focus:outline-none focus:shadow-outline hover:bg-white hover:text-[#184aad] m-auto" type="submit"${_scopeId}>${ssrInterpolate(_ctx.$t("BUTTONS.sendRequest"))}</button></div></form>`);
          } else {
            return [
              createVNode("form", null, [
                createVNode(_component_inputs_base, {
                  id: "full_name",
                  name: "full_name",
                  placeholder: _ctx.$t("FORMS.Placeholders.fullName")
                }, null, 8, ["placeholder"]),
                createVNode(_component_inputs_base, {
                  id: "email_address",
                  name: "email",
                  type: "email",
                  placeholder: _ctx.$t("FORMS.Placeholders.yourEmail")
                }, null, 8, ["placeholder"]),
                createVNode(_component_inputs_phone, {
                  onCode_change: ($event) => getPhoneCode($event),
                  placeholder: _ctx.$t("FORMS.Placeholders.yourPhone")
                }, null, 8, ["onCode_change", "placeholder"]),
                createVNode(_component_inputs_base, {
                  id: "subject",
                  name: "subject",
                  type: "text",
                  placeholder: _ctx.$t("FORMS.Placeholders.subject")
                }, null, 8, ["placeholder"]),
                createVNode(_component_inputs_textarea, {
                  rows: "4",
                  id: "message",
                  name: "message",
                  placeholder: _ctx.$t("FORMS.Placeholders.TypeYourMessageHere")
                }, null, 8, ["placeholder"]),
                createVNode("div", { class: "flex items-center justify-between" }, [
                  createVNode("button", {
                    disabled: unref(btnLoading),
                    class: "bg-blue-500 border border-white rounded-[25px] px-[30px] py-3 hover:bg-blue-700 text-white focus:outline-none focus:shadow-outline hover:bg-white hover:text-[#184aad] m-auto",
                    type: "submit"
                  }, toDisplayString(_ctx.$t("BUTTONS.sendRequest")), 9, ["disabled"])
                ])
              ])
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</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("components/general/GeneralAbout.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = {
  __name: "index",
  __ssrInlineRender: true,
  setup(__props) {
    const { t } = useI18n();
    useHead({
      title: t("NAV.contact")
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_alamiya_new_section = __nuxt_component_0;
      const _component_about_cards = _sfc_main$2;
      const _component_general_about = _sfc_main$1;
      _push(`<div${ssrRenderAttrs(_attrs)}>`);
      _push(ssrRenderComponent(_component_alamiya_new_section, { class: "mt-11" }, null, _parent));
      _push(ssrRenderComponent(_component_about_cards, null, null, _parent));
      _push(ssrRenderComponent(_component_general_about, null, null, _parent));
      _push(`</div>`);
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/contact-us/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=index-CXLUx2O1.mjs.map
