import { defineComponent, computed, defineAsyncComponent, unref, withCtx, createVNode, toDisplayString, ref, withAsyncContext, watch, mergeProps, createTextVNode, useAttrs, useSSRContext } from 'vue';
import { d as useI18n, e as useSeoMeta, f as __nuxt_component_0, A as useRouter, s as useHead, _ as __nuxt_component_0$1$1, g as _sfc_main$d, t as pictureProps, v as useImage, w as useBaseImage, x as getFileExtension, y as baseImageProps, h as useNuxtApp } from './server.mjs';
import _sfc_main$6 from './MainButton-ul6epHgF.mjs';
import __nuxt_component_0$1 from './GlobalLoader-CBULtKs6.mjs';
import __nuxt_component_1 from './HorizontalTabsWithContent-BjNCIRTE.mjs';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList, ssrRenderClass, ssrRenderAttr } from 'vue/server-renderer';
import _sfc_main$7 from './EmptyState-CWK2sm1Q.mjs';
import { _ as _sfc_main$8 } from './Skeleton-CRkCoUmX.mjs';
import _sfc_main$9 from './SectionHeadline-0zkilFRp.mjs';
import { _ as __nuxt_component_1$1 } from './VideoButton-B4IDmAbs.mjs';
import { _ as __nuxt_component_3 } from './SubscribeSection-D6lSAdXw.mjs';
import { u as useCategorysQuery, a as useCategoryQuery } from './projects-xPpvD22W.mjs';
import { useRoute, useRouter as useRouter$1 } from 'vue-router';
import { u as useFetchedPagesState } from './states-DsTfWW88.mjs';
import { a as useInfiniteScroll } from './index-Cce4iXMN.mjs';
import { u as useApi } from './useApi-Dv-cyvzn.mjs';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'nitropack/dist/runtime/plugin';
import 'packrup';
import 'consola';
import 'node:fs';
import 'node:url';
import '@iconify/utils';
import 'node:crypto';
import 'ipx';
import 'node:path';
import 'pinia';
import '@pinia/colada';
import '@unhead/schema-org/vue';
import 'deep-pick-omit';
import '@iconify/vue';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';
import './index-m9AqQ9dr.mjs';
import 'reka-ui';
import './utils-H80jjgLf.mjs';
import 'clsx';
import 'tailwind-merge';
import 'class-variance-authority';
import './TabsTrigger-Dzpk3vN1.mjs';
import './index-B_IDLhd1.mjs';
import './ArrowLeftIcon-Dfw2cv7V.mjs';
import './useUtmPayload-DlQ2OH8k.mjs';
import 'vee-validate';
import 'zod';
import '@vee-validate/zod';
import 'axios';
import 'vue-sonner';

const _sfc_main$5 = /* @__PURE__ */ defineComponent({
  __name: "NuxtPicture",
  __ssrInlineRender: true,
  props: pictureProps,
  emits: ["load", "error"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const attrs = useAttrs();
    const isServer = true;
    const $img = useImage();
    const { attrs: baseAttrs, options: baseOptions, modifiers: baseModifiers } = useBaseImage(props);
    const originalFormat = computed(() => getFileExtension(props.src));
    const isTransparent = computed(() => ["png", "webp", "gif", "svg"].includes(originalFormat.value));
    const legacyFormat = computed(() => {
      if (props.legacyFormat) {
        return props.legacyFormat;
      }
      return isTransparent.value ? "png" : "jpeg";
    });
    const sources = computed(() => {
      var _a, _b;
      const formats = ((_a = props.format) == null ? void 0 : _a.split(",")) || (originalFormat.value === "svg" ? ["svg"] : ((_b = $img.options.format) == null ? void 0 : _b.length) ? [...$img.options.format] : ["webp"]);
      if (formats[0] === "svg") {
        return [{ src: props.src }];
      }
      if (!formats.includes(legacyFormat.value)) {
        formats.push(legacyFormat.value);
      } else {
        formats.splice(formats.indexOf(legacyFormat.value), 1);
        formats.push(legacyFormat.value);
      }
      return formats.map((format) => {
        const { srcset, sizes, src } = $img.getSizes(props.src, {
          ...baseOptions.value,
          sizes: props.sizes || $img.options.screens,
          densities: props.densities,
          modifiers: { ...baseModifiers.value, format }
        });
        return { src, type: `image/${format}`, sizes, srcset };
      });
    });
    const lastSource = computed(() => sources.value[sources.value.length - 1]);
    if (props.preload) {
      useHead({ link: () => {
        var _a, _b, _c;
        const firstSource = sources.value[0];
        if (!firstSource) {
          return [];
        }
        const link = {
          rel: "preload",
          as: "image",
          imagesrcset: firstSource.srcset,
          nonce: props.nonce,
          ...typeof props.preload !== "boolean" && ((_a = props.preload) == null ? void 0 : _a.fetchPriority) ? { fetchpriority: props.preload.fetchPriority } : {}
        };
        if ((_c = (_b = sources.value) == null ? void 0 : _b[0]) == null ? void 0 : _c.sizes) {
          link.imagesizes = sources.value[0].sizes;
        }
        return [link];
      } });
    }
    const imgAttrs = computed(() => {
      const result = { ...props.imgAttrs, "data-nuxt-pic": "" };
      for (const key in attrs) {
        if (key in baseImageProps && !(key in result)) {
          result[key] = attrs[key];
        }
      }
      return result;
    });
    const imgEl = ref();
    const nuxtApp = useNuxtApp();
    nuxtApp.isHydrating;
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<picture${ssrRenderAttrs(_attrs)}><!--[-->`);
      ssrRenderList(sources.value.slice(0, -1), (source) => {
        _push(`<source${ssrRenderAttr("type", source.type)}${ssrRenderAttr("sizes", source.sizes)}${ssrRenderAttr("srcset", source.srcset)}>`);
      });
      _push(`<!--]-->`);
      if (lastSource.value) {
        _push(`<img${ssrRenderAttrs(mergeProps({
          ref_key: "imgEl",
          ref: imgEl
        }, {
          ...unref(baseAttrs),
          ...unref(isServer) ? { onerror: "this.setAttribute('data-error', 1)" } : {},
          ...imgAttrs.value
        }, {
          src: lastSource.value.src,
          sizes: lastSource.value.sizes,
          srcset: lastSource.value.srcset
        }))}>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</picture>`);
    };
  }
});
const _sfc_setup$5 = _sfc_main$5.setup;
_sfc_main$5.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/@nuxt/image/dist/runtime/components/NuxtPicture.vue");
  return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
};
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  __name: "ProjectSection",
  __ssrInlineRender: true,
  props: {
    projectInfo: {},
    sectionBg: {}
  },
  setup(__props) {
    ref(null);
    const showOverlay = ref(true);
    const youtubeIframeUrl = ref("");
    const isVideoType = computed(() => __props.projectInfo.card_display_type === "video");
    const isImageType = computed(() => __props.projectInfo.card_display_type === "image");
    const hasVideo = computed(() => !!__props.projectInfo.video);
    const isYoutubeVideo = computed(() => isYoutube(__props.projectInfo.video));
    const normalizedShortDescription = computed(() => {
      var _a;
      const s = (_a = __props.projectInfo.short_description) != null ? _a : "";
      return s.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
    });
    const youtubeUtils = {
      // Extract YouTube video ID from URL
      getId: (url) => {
        var _a;
        if (!url || typeof url !== "string") return null;
        const regex = /(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/;
        const match = url.match(regex);
        return (_a = match == null ? void 0 : match[1]) != null ? _a : null;
      },
      // Check if URL is a YouTube video
      isYoutubeUrl: (url) => {
        return !!youtubeUtils.getId(url);
      },
      // Get YouTube thumbnail URL
      getThumbnail: (url) => {
        const id = youtubeUtils.getId(url);
        return id ? `https://img.youtube.com/vi/${id}/maxresdefault.jpg` : "/default-thumb.jpg";
      },
      // Get YouTube embed URL with options
      getEmbedUrl: (url, autoplay = false) => {
        const id = youtubeUtils.getId(url);
        if (!id) return "";
        const params = new URLSearchParams({
          mute: "1",
          rel: "0",
          modestbranding: "1",
          ...autoplay && { autoplay: "1" }
        });
        return `https://www.youtube.com/embed/${id}?${params.toString()}`;
      }
    };
    const isYoutube = (url) => youtubeUtils.isYoutubeUrl(url);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_SectionHeadline = _sfc_main$9;
      const _component_ClientOnly = __nuxt_component_0$1$1;
      const _component_NuxtImg = _sfc_main$d;
      const _component_SvgVideoButton = __nuxt_component_1$1;
      const _component_NuxtPicture = _sfc_main$5;
      const _component_NuxtLinkLocale = __nuxt_component_0;
      _push(`<section${ssrRenderAttrs(mergeProps({
        class: ["py-narrow-section", _ctx.sectionBg]
      }, _attrs))}><div class="container mx-auto px-4">`);
      _push(ssrRenderComponent(_component_SectionHeadline, {
        title: _ctx.projectInfo.title
      }, null, _parent));
      _push(`<div class="flex flex-col items-center gap-[40px]">`);
      if (unref(isVideoType)) {
        _push(`<div class="mx-auto aspect-video w-full rounded-xl xl:w-[950px]"><div class="relative h-full w-full">`);
        if (unref(isYoutubeVideo)) {
          _push(`<div class="h-full w-full overflow-hidden rounded-2xl">`);
          if (unref(showOverlay)) {
            _push(`<!--[-->`);
            _push(ssrRenderComponent(_component_ClientOnly, null, {}, _parent));
            _push(`<div class="absolute inset-0 flex cursor-pointer items-center justify-center rounded-2xl bg-[rgba(0,0,0,0.5)]">`);
            _push(ssrRenderComponent(_component_SvgVideoButton, { class: "h-[40px] w-[40px]" }, null, _parent));
            _push(`</div><!--]-->`);
          } else if (unref(youtubeIframeUrl)) {
            _push(`<iframe class="h-full w-full rounded-2xl object-contain"${ssrRenderAttr("src", unref(youtubeIframeUrl))} frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`);
          } else {
            _push(`<!---->`);
          }
          _push(`</div>`);
        } else if (unref(hasVideo)) {
          _push(`<!--[--><video${ssrRenderAttr("src", _ctx.projectInfo.video || void 0)} class="h-full w-full rounded-2xl object-cover" controls muted loop></video>`);
          if (unref(showOverlay)) {
            _push(`<div class="absolute inset-0 flex items-center justify-center rounded-2xl bg-[rgba(0,0,0,0.5)]">`);
            _push(ssrRenderComponent(_component_SvgVideoButton, { class: "h-[40px] w-[40px]" }, null, _parent));
            _push(`</div>`);
          } else {
            _push(`<!---->`);
          }
          _push(`<!--]-->`);
        } else {
          _push(`<div class="flex h-full w-full items-center justify-center rounded-2xl bg-gray-100"><p class="text-gray-500">${ssrInterpolate(_ctx.$t("errors.noVideoAvailable", "No video available"))}</p></div>`);
        }
        _push(`</div></div>`);
      } else if (unref(isImageType)) {
        _push(`<div class="mx-auto flex w-full items-center justify-center gap-12 xl:w-[865px]">`);
        _push(ssrRenderComponent(_component_NuxtPicture, {
          src: _ctx.projectInfo.website_image,
          alt: _ctx.projectInfo.title,
          width: 862,
          height: 572,
          preset: "default"
        }, {
          fallback: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(ssrRenderComponent(_component_NuxtImg, {
                src: _ctx.projectInfo.application_image,
                alt: _ctx.projectInfo.title,
                preset: "default",
                class: "mx-auto h-full w-full rounded-xl object-cover"
              }, null, _parent2, _scopeId));
            } else {
              return [
                createVNode(_component_NuxtImg, {
                  src: _ctx.projectInfo.application_image,
                  alt: _ctx.projectInfo.title,
                  preset: "default",
                  class: "mx-auto h-full w-full rounded-xl object-cover"
                }, null, 8, ["src", "alt"])
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<div class="description flex w-full flex-col gap-5 px-8 text-center xl:w-[950px]"><p class="whitespace-pre-line">${ssrInterpolate(unref(normalizedShortDescription))}</p>`);
      _push(ssrRenderComponent(_component_NuxtLinkLocale, {
        class: "ws-gradient-border mx-auto w-fit px-4 py-2",
        to: {
          name: "our-projects-slug",
          params: {
            slug: _ctx.projectInfo.slug
          }
        }
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${ssrInterpolate(_ctx.$t("projectsButtons.learnMore"))}`);
          } else {
            return [
              createTextVNode(toDisplayString(_ctx.$t("projectsButtons.learnMore")), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div></div></div></section>`);
    };
  }
});
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("components/projects/ProjectSection.vue");
  return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
};
const baseUrl = "https://webstdy.com";
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  __name: "AllProjects",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const route = useRoute();
    useRouter$1();
    const initialPage = Number(route.query.page) || 1;
    ref(null);
    const allProjects = ref([]);
    const currentPage = ref(initialPage);
    const isLoadingMore = ref(false);
    const hasMorePages = ref(true);
    const hasInitiallyLoaded = ref(false);
    useFetchedPagesState();
    const { locale, t } = useI18n();
    const {
      data: initialData,
      isLoading,
      isPending,
      refetch
    } = useCategorysQuery(initialPage);
    if (initialPage > 1) {
      [__temp, __restore] = withAsyncContext(() => refetch()), await __temp, __restore();
    }
    watch(
      initialData,
      (newData) => {
        var _a;
        if ((_a = newData == null ? void 0 : newData.data) == null ? void 0 : _a.projects) {
          const { data: projects, last_page, current_page } = newData.data.projects;
          allProjects.value = projects;
          currentPage.value = current_page;
          hasMorePages.value = current_page < last_page;
          hasInitiallyLoaded.value = true;
        }
      },
      { immediate: true }
    );
    const seoTitle = computed(() => {
      return currentPage.value > 1 ? `${t("projectsSeo.title")} ${t("projectsSeo.page")} ${currentPage.value}` : t("projectsSeo.title");
    });
    const seoDescription = computed(() => {
      return currentPage.value > 1 ? `${t("projectsSeo.description")} ${t("projectsSeo.page")} ${currentPage.value}` : t("projectsSeo.description");
    });
    useHead(() => {
      const pageParam = currentPage.value > 1 ? `?page=${currentPage.value}` : "";
      const canonicalHref = `${baseUrl}${locale.value === "en" ? "/en" : ""}/our-projects${pageParam}`;
      const linkTags = [{ rel: "canonical", href: canonicalHref }];
      if (currentPage.value > 1) {
        linkTags.push({
          rel: "prev",
          href: currentPage.value === 2 ? `${baseUrl}${locale.value === "en" ? "/en" : ""}/our-projects` : `${baseUrl}${locale.value === "en" ? "/en" : ""}/our-projects?page=${currentPage.value - 1}`
        });
      }
      if (hasMorePages.value) {
        linkTags.push({
          rel: "next",
          href: `${baseUrl}${locale.value === "en" ? "/en" : ""}/our-projects?page=${currentPage.value + 1}`
        });
      }
      return {
        title: seoTitle.value,
        meta: [
          { name: "description", content: seoDescription.value },
          { property: "og:title", content: seoTitle.value },
          { property: "og:description", content: seoDescription.value },
          { property: "og:url", content: canonicalHref }
        ],
        link: linkTags
      };
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_EmptyState = _sfc_main$7;
      const _component_Skeleton = _sfc_main$8;
      const _component_ProjectsProjectSection = _sfc_main$4;
      const _component_ClientOnly = __nuxt_component_0$1$1;
      const _component_NuxtLinkLocale = __nuxt_component_0;
      const _component_SubscribeSection = __nuxt_component_3;
      if (unref(hasInitiallyLoaded) && !unref(isLoading) && !unref(allProjects).length) {
        _push(`<section${ssrRenderAttrs(mergeProps({ class: "py-narrow-section" }, _attrs))}><div class="container mx-auto px-4">`);
        _push(ssrRenderComponent(_component_EmptyState, { class: "mx-auto" }, null, _parent));
        _push(`</div></section>`);
      } else if (unref(allProjects).length || unref(isLoading)) {
        _push(`<section${ssrRenderAttrs(mergeProps({ id: "allProjects" }, _attrs))}>`);
        if (unref(isLoading) || unref(isPending)) {
          _push(`<div class="py-narrow-section"><div class="container mx-auto px-4"><div class="flex flex-col items-center gap-[30px]">`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-8 w-1/3 rounded" }, null, _parent));
          _push(ssrRenderComponent(_component_Skeleton, { class: "h-[350px] w-full rounded-xl sm:h-[572px] xl:w-[950px]" }, null, _parent));
          _push(`<div class="flex w-full flex-col gap-4 px-8 xl:w-[950px]">`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-4 w-3/4 rounded" }, null, _parent));
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-4 w-1/2 rounded" }, null, _parent));
          _push(`</div>`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-10 w-28 rounded-md" }, null, _parent));
          _push(`</div></div></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`<!--[-->`);
        ssrRenderList(unref(allProjects), (project, index) => {
          _push(`<div>`);
          _push(ssrRenderComponent(_component_ProjectsProjectSection, {
            "project-info": project,
            "section-bg": index % 2 === 0 ? "bg-gradient-odd" : "bg-gradient-even"
          }, null, _parent));
          _push(`</div>`);
        });
        _push(`<!--]-->`);
        if (unref(isLoadingMore)) {
          _push(`<div class="${ssrRenderClass([
            unref(allProjects).length % 2 === 0 ? "bg-gradient-odd" : "bg-gradient-even",
            "py-section"
          ])}"><div class="container mx-auto px-4"><div class="flex items-center justify-center pb-4"><div class="max-w-60">`);
          _push(ssrRenderComponent(_component_ClientOnly, null, {}, _parent));
          _push(`</div></div><div class="flex flex-col items-center gap-[30px]">`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-8 w-1/3 rounded" }, null, _parent));
          _push(ssrRenderComponent(_component_Skeleton, { class: "h-[350px] w-full rounded-xl sm:h-[572px] xl:w-[950px]" }, null, _parent));
          _push(`<div class="flex w-full flex-col gap-4 px-8 xl:w-[950px]">`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-4 w-3/4 rounded" }, null, _parent));
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-4 w-1/2 rounded" }, null, _parent));
          _push(`</div>`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-10 w-28 rounded-md" }, null, _parent));
          _push(`</div></div></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`<section class="${ssrRenderClass([
          unref(allProjects).length % 2 === 0 ? "bg-gradient-odd" : "bg-gradient-even",
          "py-section px-4"
        ])}"><nav class="pagination invisible flex justify-center gap-4">`);
        if (unref(currentPage) == 2) {
          _push(ssrRenderComponent(_component_NuxtLinkLocale, { to: `/our-projects` }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(` Previous `);
              } else {
                return [
                  createTextVNode(" Previous ")
                ];
              }
            }),
            _: 1
          }, _parent));
        } else if (unref(currentPage) > 2) {
          _push(ssrRenderComponent(_component_NuxtLinkLocale, {
            to: `/our-projects?page=${unref(currentPage) - 1}`
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(` Previous `);
              } else {
                return [
                  createTextVNode(" Previous ")
                ];
              }
            }),
            _: 1
          }, _parent));
        } else {
          _push(`<!---->`);
        }
        if (unref(hasMorePages)) {
          _push(ssrRenderComponent(_component_NuxtLinkLocale, {
            to: `/our-projects?page=${unref(currentPage) + 1}`
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(` Next `);
              } else {
                return [
                  createTextVNode(" Next ")
                ];
              }
            }),
            _: 1
          }, _parent));
        } else {
          _push(`<!---->`);
        }
        _push(`</nav>`);
        _push(ssrRenderComponent(_component_SubscribeSection, null, null, _parent));
        _push(`</section></section>`);
      } else {
        _push(`<!---->`);
      }
    };
  }
});
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("components/projects/AllProjects.vue");
  return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "ProjectsFilter",
  __ssrInlineRender: true,
  props: {
    serviceId: {}
  },
  setup(__props) {
    const props = __props;
    const scrollTarget = ref(null);
    const filteredProjects = ref([]);
    const currentPage = ref(1);
    const isLoadingMore = ref(false);
    const hasMorePages = ref(true);
    const hasInitiallyLoaded = ref(false);
    const {
      data: initialData,
      isLoading,
      isPending
    } = useCategoryQuery(props.serviceId.toString(), 1);
    watch(
      initialData,
      (newData) => {
        if (newData == null ? void 0 : newData.data.projects) {
          const { data: projects, last_page, current_page } = newData.data.projects;
          filteredProjects.value = projects;
          currentPage.value = current_page;
          hasMorePages.value = current_page < last_page;
          hasInitiallyLoaded.value = true;
        }
      },
      { immediate: true }
    );
    const loadMore = async () => {
      var _a;
      if (isLoadingMore.value || !hasMorePages.value) return;
      const nextPage = currentPage.value + 1;
      isLoadingMore.value = true;
      try {
        const { get } = useApi();
        const response = await get(`projects`, {
          params: {
            page: nextPage,
            ...props.serviceId ? { service_id: props.serviceId } : {}
          }
        });
        const projectsData = (_a = response.data) == null ? void 0 : _a.data.projects;
        if ((projectsData == null ? void 0 : projectsData.data) && projectsData.data.length > 0) {
          filteredProjects.value.push(...projectsData.data);
          currentPage.value = projectsData.current_page;
          hasMorePages.value = projectsData.current_page < projectsData.last_page;
        } else {
          hasMorePages.value = false;
        }
      } catch (error) {
        console.error("Error loading more projects:", error);
        hasMorePages.value = false;
      } finally {
        isLoadingMore.value = false;
      }
    };
    useInfiniteScroll(scrollTarget, loadMore, {
      distance: 300,
      canLoadMore: () => hasMorePages.value && !isLoadingMore.value
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_EmptyState = _sfc_main$7;
      const _component_Skeleton = _sfc_main$8;
      const _component_ProjectsProjectSection = _sfc_main$4;
      const _component_SubscribeSection = __nuxt_component_3;
      if (unref(hasInitiallyLoaded) && !unref(isLoading) && !unref(filteredProjects).length) {
        _push(`<section${ssrRenderAttrs(mergeProps({ class: "py-narrow-section" }, _attrs))}><div class="container mx-auto px-4">`);
        _push(ssrRenderComponent(_component_EmptyState, { class: "mx-auto" }, null, _parent));
        _push(`</div></section>`);
      } else if (unref(filteredProjects).length || unref(isLoading)) {
        _push(`<section${ssrRenderAttrs(mergeProps({ id: "filteredProjects" }, _attrs))}>`);
        if (unref(isLoading) || unref(isPending)) {
          _push(`<div class="py-narrow-section"><div class="container mx-auto px-4"><div class="flex flex-col items-center gap-[30px]">`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-8 w-1/3 rounded" }, null, _parent));
          _push(ssrRenderComponent(_component_Skeleton, { class: "h-[350px] w-full rounded-xl sm:h-[572px] xl:w-[950px]" }, null, _parent));
          _push(`<div class="flex w-full flex-col gap-4 px-8 xl:w-[950px]">`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-4 w-3/4 rounded" }, null, _parent));
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-4 w-1/2 rounded" }, null, _parent));
          _push(`</div>`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-10 w-28 rounded-md" }, null, _parent));
          _push(`</div></div></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`<!--[-->`);
        ssrRenderList(unref(filteredProjects), (project, index) => {
          _push(`<div>`);
          _push(ssrRenderComponent(_component_ProjectsProjectSection, {
            "project-info": project,
            "section-bg": index % 2 === 0 ? "bg-gradient-odd" : "bg-gradient-even"
          }, null, _parent));
          _push(`</div>`);
        });
        _push(`<!--]-->`);
        if (unref(isLoadingMore)) {
          _push(`<div class="${ssrRenderClass([
            unref(filteredProjects).length % 2 === 0 ? "bg-gradient-odd" : "bg-gradient-even",
            "py-section"
          ])}"><div class="container mx-auto px-4"><div class="flex flex-col items-center gap-[30px]">`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-8 w-1/3 rounded" }, null, _parent));
          _push(ssrRenderComponent(_component_Skeleton, { class: "h-[350px] w-full rounded-xl sm:h-[572px] xl:w-[950px]" }, null, _parent));
          _push(`<div class="flex w-full flex-col gap-4 px-8 xl:w-[950px]">`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-4 w-3/4 rounded" }, null, _parent));
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-4 w-1/2 rounded" }, null, _parent));
          _push(`</div>`);
          _push(ssrRenderComponent(_component_Skeleton, { class: "mx-auto h-10 w-28 rounded-md" }, null, _parent));
          _push(`</div></div></div>`);
        } else {
          _push(`<!---->`);
        }
        _push(`<section class="${ssrRenderClass([
          unref(filteredProjects).length % 2 === 0 ? "bg-gradient-odd" : "bg-gradient-even",
          "py-section px-4"
        ])}">`);
        _push(ssrRenderComponent(_component_SubscribeSection, null, null, _parent));
        _push(`</section></section>`);
      } else {
        _push(`<!---->`);
      }
    };
  }
});
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("components/projects/ProjectsFilter.vue");
  return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "DisplayProjects",
  __ssrInlineRender: true,
  setup(__props) {
    const { t } = useI18n();
    const router = useRouter();
    const { data: queryResult, isLoading, isPending, error } = useCategorysQuery(1);
    const services = computed(() => {
      var _a, _b;
      return ((_b = (_a = queryResult.value) == null ? void 0 : _a.data) == null ? void 0 : _b.services) || [];
    });
    const servicesReady = computed(() => {
      var _a, _b;
      return !isLoading.value && !isPending.value && ((_b = (_a = queryResult.value) == null ? void 0 : _a.data) == null ? void 0 : _b.services);
    });
    const tapsData = computed(() => {
      if (!servicesReady.value) {
        return [];
      }
      return [
        {
          value: "all-projects",
          title: t("projectsButtons.allProjectTap"),
          component: _sfc_main$3
        },
        ...services.value.map((service) => ({
          value: service.key,
          title: service.title,
          component: _sfc_main$2,
          props: {
            serviceId: service.id
          }
        }))
      ];
    });
    const handleTabChange = (newValue) => {
      if (newValue) {
        router.replace({ query: {} });
      }
    };
    return (_ctx, _push, _parent, _attrs) => {
      const _component_GlobalLoader = __nuxt_component_0$1;
      const _component_HorizontalTabsWithContent = __nuxt_component_1;
      _push(`<!--[-->`);
      if (unref(isPending)) {
        _push(ssrRenderComponent(_component_GlobalLoader, null, null, _parent));
      } else {
        _push(`<!---->`);
      }
      _push(`<div>`);
      if (unref(servicesReady) && unref(tapsData).length > 0) {
        _push(ssrRenderComponent(_component_HorizontalTabsWithContent, {
          "tabs-data": unref(tapsData),
          "centered-content": false,
          "onUpdate:modelValue": handleTabChange
        }, null, _parent));
      } else if (unref(error)) {
        _push(`<div class="py-8 text-center text-red-500">${ssrInterpolate(_ctx.$t("errors.failedToLoadServices"))}</div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</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/projects/DisplayProjects.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const __nuxt_component_0_lazy = defineAsyncComponent(() => import('./InternalHeaderSection-DIj5MLKD.mjs').then((c) => c.default || c));
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  __ssrInlineRender: true,
  setup(__props) {
    const { t } = useI18n();
    useSeoMeta({
      title: computed(() => t("projectsSeo.title")),
      description: computed(() => t("projectsSeo.description")),
      ogTitle: computed(() => t("projectsSeo.ogTitle")),
      ogDescription: computed(() => t("projectsSeo.ogDescription")),
      keywords: computed(() => t("projectsSeo.keywords"))
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_LazyInternalHeaderSection = __nuxt_component_0_lazy;
      const _component_NuxtLinkLocale = __nuxt_component_0;
      const _component_MainButton = _sfc_main$6;
      const _component_ProjectsDisplayProjects = _sfc_main$1;
      _push(`<main${ssrRenderAttrs(_attrs)}>`);
      _push(ssrRenderComponent(_component_LazyInternalHeaderSection, {
        "video-url": "/videos/our-projects.mp4",
        pages: [{ name: unref(t)("ourProjects") }]
      }, {
        title: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<h1${_scopeId}>${ssrInterpolate(_ctx.$t("ourProjectsHero.title"))}</h1>`);
          } else {
            return [
              createVNode("h1", null, toDisplayString(_ctx.$t("ourProjectsHero.title")), 1)
            ];
          }
        }),
        button: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_NuxtLinkLocale, { to: "/contact" }, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_MainButton, {
                    contnet: _ctx.$t("ourProjectsHero.button")
                  }, null, _parent3, _scopeId2));
                } else {
                  return [
                    createVNode(_component_MainButton, {
                      contnet: _ctx.$t("ourProjectsHero.button")
                    }, null, 8, ["contnet"])
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_NuxtLinkLocale, { to: "/contact" }, {
                default: withCtx(() => [
                  createVNode(_component_MainButton, {
                    contnet: _ctx.$t("ourProjectsHero.button")
                  }, null, 8, ["contnet"])
                ]),
                _: 1
              })
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`<section id="projects" class="pt-section bg-gradient-odd">`);
      _push(ssrRenderComponent(_component_ProjectsDisplayProjects, null, null, _parent));
      _push(`</section></main>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/our-projects/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

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