import { defineComponent, ref, mergeProps, unref, withCtx, createBlock, openBlock, toDisplayString, createTextVNode, useSSRContext } from "vue";
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderAttr, ssrInterpolate, ssrRenderList, ssrIncludeBooleanAttr } from "vue/server-renderer";
import { useForm, usePage, Link } from "@inertiajs/vue3";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "FooterType2",
  __ssrInlineRender: true,
  props: {
    status: {}
  },
  setup(__props) {
    const subscribeToNewsletterForm = useForm({
      email_or_phone: null
    });
    const dark = ref(usePage().props.dark);
    if (typeof window !== "undefined") {
      $(() => {
        let config = { attributes: true, attributeFilter: ["id"] };
        let callback = function(mutationsList, observer2) {
          for (let mutation of mutationsList) {
            if (mutation.type === "attributes" && mutation.attributeName === "id") {
              if (document.body.id == "dark") dark.value = true;
              else dark.value = false;
            }
          }
        };
        let observer = new MutationObserver(callback);
        observer.observe(document.body, config);
      });
    }
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<footer${ssrRenderAttrs(mergeProps({
        class: { "page-footer page-footer--minimal": true, readonly: _ctx.status == "dev" },
        style: _ctx.$page.props.currentRouteName == "index" || _ctx.$page.props.currentRouteName == "blog.index" ? "" : "margin-top: 20px"
      }, _attrs))}><div class="container footer-support-area d-flex flex-column flex-sm-row align-items-center justify-content-between"><div class="right-section align-items-center flex-grow-1">`);
      _push(ssrRenderComponent(unref(Link), {
        class: "logo",
        href: _ctx.$page.props.appUrl
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            if (_ctx.$page.props.appLogo != null) {
              _push2(`<img${ssrRenderAttr("src", dark.value ? _ctx.$page.props.appLogoDark : _ctx.$page.props.appLogo)}${ssrRenderAttr("alt", _ctx.$page.props.appFullName)}${_scopeId}>`);
            } else {
              _push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$t("messages.word.logo"))}</span>`);
            }
          } else {
            return [
              _ctx.$page.props.appLogo != null ? (openBlock(), createBlock("img", {
                key: 0,
                src: dark.value ? _ctx.$page.props.appLogoDark : _ctx.$page.props.appLogo,
                alt: _ctx.$page.props.appFullName
              }, null, 8, ["src", "alt"])) : (openBlock(), createBlock("span", { key: 1 }, toDisplayString(_ctx.$t("messages.word.logo")), 1))
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`<span class="divider"></span><span class="support-time d-inline-block lts-05">${ssrInterpolate(_ctx.$page.props.responseTime)}</span></div><div class="left-section"><div class="d-flex align-items-center phone-number"><a${ssrRenderAttr("href", "tel:" + _ctx.$page.props.supportPhone)}>${ssrInterpolate(_ctx.$page.props.supportPhone != null ? _ctx.$page.props.supportPhone : _ctx.$t("messages.sentence.not_set"))}</a><i class="ri-customer-service-2-fill"></i></div></div></div><div class="footer-middle"><div class="container"><div class="row mb-4"><div class="col-md-8 d-sm-flex d-none align-items-center justify-content-start">`);
      if (_ctx.$page.props.menu.footer_main != null) {
        _push(`<ul class="footer-horizontal-menu"><!--[-->`);
        ssrRenderList(_ctx.$page.props.menu.footer_main.get_items, (item, index) => {
          _push(`<li>`);
          if (item.type == "internal") {
            _push(ssrRenderComponent(unref(Link), {
              href: item.link,
              prefetch: _ctx.$page.props.prefetch.status,
              "cache-for": _ctx.$page.props.prefetch.delay
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(item.name)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(item.name), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
          } else {
            _push(`<!---->`);
          }
          if (item.type == "external") {
            _push(`<a${ssrRenderAttr("href", item.link)} target="_blank">${ssrInterpolate(item.name)}</a>`);
          } else {
            _push(`<!---->`);
          }
          _push(`</li>`);
        });
        _push(`<!--]--></ul>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div><div class="col-md-4 dropdown newsletter d-flex align-items-center justify-content-end">`);
      if (_ctx.$page.props.menu.footer_main != null) {
        _push(`<!--[--><button class="btn footer-menu-navigation shadow-1 d-none" data-bs-toggle="dropdown" aria-expanded="false"><i class="ri-menu-3-line"></i></button><ul class="dropdown-menu shadow-1"><!--[-->`);
        ssrRenderList(_ctx.$page.props.menu.footer_main.get_items, (item, index) => {
          _push(`<li>`);
          if (item.type == "internal") {
            _push(ssrRenderComponent(unref(Link), {
              class: "dropdown-item lts-05",
              href: item.link,
              prefetch: _ctx.$page.props.prefetch.status,
              "cache-for": _ctx.$page.props.prefetch.delay
            }, {
              default: withCtx((_, _push2, _parent2, _scopeId) => {
                if (_push2) {
                  _push2(`${ssrInterpolate(item.name)}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(item.name), 1)
                  ];
                }
              }),
              _: 2
            }, _parent));
          } else {
            _push(`<!---->`);
          }
          if (item.type == "external") {
            _push(`<a class="dropdown-item lts-05"${ssrRenderAttr("href", item.link)} target="_blank">${ssrInterpolate(item.name)}</a>`);
          } else {
            _push(`<!---->`);
          }
          _push(`</li>`);
        });
        _push(`<!--]--></ul><!--]-->`);
      } else {
        _push(`<!---->`);
      }
      _push(`<form class="d-flex align-items-center"><input${ssrRenderAttr("value", unref(subscribeToNewsletterForm).email_or_phone)} class="form-control shadow-1" name="email_or_phone"${ssrRenderAttr("placeholder", _ctx.$t("messages.sentence.enter_your_email_or_phone") + " ...")}><button${ssrIncludeBooleanAttr(unref(subscribeToNewsletterForm).processing) ? " disabled" : ""} class="btn btn-primary shadow-1" type="submit">${ssrInterpolate(_ctx.$t("messages.word.membership"))}</button></form></div></div></div></div><div class="footer-bottom"><div class="container"><div class="d-flex align-items-center justify-content-between"><span class="copyright lts-05">${ssrInterpolate(_ctx.$t("messages.sentence.all_right_reserved", { shop: _ctx.$page.props.appName != null ? _ctx.$page.props.appName : "" }))} - توسعه توسط `);
      if (_ctx.$page.props.copyright.includes("vima")) {
        _push(`<a class="link color-secondary" href="https://vimascript.ir" target="_blank">ویما</a>`);
      } else {
        _push(`<a class="link color-secondary" href="/">${ssrInterpolate(_ctx.$page.props.appName)}</a>`);
      }
      _push(`</span><ul class="social-networks"><li>`);
      if (_ctx.$page.props.socials.instagram != null) {
        _push(`<a class="el-center"${ssrRenderAttr("href", _ctx.$page.props.socials.instagram)}><i class="ri-instagram-line"></i></a>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</li><li>`);
      if (_ctx.$page.props.socials.telegram != null) {
        _push(`<a class="el-center"${ssrRenderAttr("href", _ctx.$page.props.socials.telegram)}><i class="ri-send-plane-2-line"></i></a>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</li><li>`);
      if (_ctx.$page.props.socials.twitter != null) {
        _push(`<a class="el-center"${ssrRenderAttr("href", _ctx.$page.props.socials.twitter)}><i class="ri-twitter-x-line"></i></a>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</li><li>`);
      if (_ctx.$page.props.socials.facebook != null) {
        _push(`<a class="el-center"${ssrRenderAttr("href", _ctx.$page.props.socials.facebook)}><i class="ri-facebook-line"></i></a>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</li><li>`);
      if (_ctx.$page.props.socials.whatsapp != null) {
        _push(`<a class="el-center"${ssrRenderAttr("href", _ctx.$page.props.socials.whatsapp)}><i class="ri-whatsapp-line"></i></a>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</li><li>`);
      if (_ctx.$page.props.socials.eita != null) {
        _push(`<a class="el-center"${ssrRenderAttr("href", _ctx.$page.props.socials.eita)}><img width="15"${ssrRenderAttr("src", _ctx.$page.props.appUrl + "/img/icon/socials/eita.png")} alt="ایتا"></a>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</li><li>`);
      if (_ctx.$page.props.socials.rubika != null) {
        _push(`<a class="el-center"${ssrRenderAttr("href", _ctx.$page.props.socials.rubika)}><img width="16"${ssrRenderAttr("src", _ctx.$page.props.appUrl + "/img/icon/socials/rubika.png")} alt="روبیکا"></a>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</li></ul></div></div></div></footer>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Components/Main/UI/Footer/FooterType2.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
