import { _ as _sfc_main$5 } from './index-C9kUGn43.mjs';
import { e as useMaghaleStore, b as useRuntimeConfig, g as useRoute, a as useNuxtApp, _ as __nuxt_component_0 } from './server.mjs';
import { withAsyncContext, mergeProps, ref, reactive, resolveComponent, unref, withCtx, createBlock, openBlock, createVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderAttr, ssrIncludeBooleanAttr } from 'vue/server-renderer';
import axios from 'axios';
import { _ as _sfc_main$2, a as _sfc_main$3 } from './tiles-BSfcgfjL.mjs';
import { _ as _sfc_main$4 } from './tiles-Wv8aXLwm.mjs';
import './FirstTitle-jarWvN-b.mjs';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';
import 'pinia';
import 'vue-router';
import 'deep-pick-omit';
import 'sweetalert2';
import './second-title-B9UcHZfY.mjs';
import './statistics-90Di9IHE.mjs';

const _sfc_main$1 = {
  __name: "details",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const store = useMaghaleStore();
    const { $toPersianNumbers } = useNuxtApp();
    const toPersianNumbers = $toPersianNumbers;
    const id = useRoute().params.id;
    const likeColor = ref("none");
    const dislikeColor = ref("none");
    const markColor = ref("none");
    const instanceData = reactive({});
    if (store.isAuthenticated) {
      [__temp, __restore] = withAsyncContext(() => axios.get(useRuntimeConfig().public.BaseUrl + "fields/get_field_by_user/" + id).then((r) => {
        instanceData.data = r.data;
        if (r.data.activity.liked_by_me) {
          likeColor.value = "white";
        } else if (r.data.activity.disliked_by_me) {
          dislikeColor.value = "white";
        }
        if (r.data.activity.marked_by_me) {
          markColor.value = "white";
        }
      })), await __temp, __restore();
    } else {
      [__temp, __restore] = withAsyncContext(() => axios.get(useRuntimeConfig().public.BaseUrl + "fields/get_field/" + id).then((r) => {
        instanceData.data = r.data;
      })), await __temp, __restore();
    }
    const instance = instanceData.data;
    const activity = instance.activity;
    return (_ctx, _push, _parent, _attrs) => {
      const _component_Activity = _sfc_main$5;
      const _component_NuxtLink = __nuxt_component_0;
      const _component_MaghaleCircleProgress = resolveComponent("MaghaleCircleProgress");
      const _component_UserStatistics = resolveComponent("UserStatistics");
      _push(`<div${ssrRenderAttrs(_attrs)}>`);
      _push(ssrRenderComponent(_component_Activity, null, null, _parent));
      _push(`<p class="mt-4 text-xs text-left font-normal text-zinc-500 dark:text-zinc-400">${ssrInterpolate(unref(toPersianNumbers)(unref(activity).persian_date))}</p><div dir="ltr" class="flex justify-between"><div dir="ltr" class="flex mt-6 text-sm leading-none tracking-tight text-zinc-900 dark:text-white"><div class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M4.26 10.147a60.438 60.438 0 0 0-.491 6.347A48.62 48.62 0 0 1 12 20.904a48.62 48.62 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.636 50.636 0 0 0-2.658-.813A59.906 59.906 0 0 1 12 3.493a59.903 59.903 0 0 1 10.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.717 50.717 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5"></path></svg><p class="ml-1">${ssrInterpolate(unref(toPersianNumbers)(unref(instance).course_count))}</p></div><div class="flex items-center ml-2"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"></path></svg><p class="ml-1">${ssrInterpolate(unref(toPersianNumbers)(unref(instance).hashtag_count))}</p></div><div class="flex items-center ml-2"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z"></path></svg><p class="ml-1">${ssrInterpolate(unref(toPersianNumbers)(unref(activity).comment_count))}</p></div><div class="flex items-center ml-2"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"></path></svg><p class="ml-1">${ssrInterpolate(unref(toPersianNumbers)(unref(activity).user_count))}</p></div><div class="flex items-center ml-2"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"></path></svg><p class="ml-1">${ssrInterpolate(unref(toPersianNumbers)(unref(activity).seen_count))}</p></div><button${ssrIncludeBooleanAttr(unref(activity).liked_by_me) ? " disabled" : ""} class="flex items-center ml-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"${ssrRenderAttr("fill", unref(likeColor))} class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z"></path></svg><p class="ml-1">${ssrInterpolate(unref(toPersianNumbers)(unref(activity).likes_count))}</p></button><button${ssrIncludeBooleanAttr(unref(activity).disliked_by_me) ? " disabled" : ""} class="flex items-center ml-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"${ssrRenderAttr("fill", unref(dislikeColor))} class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M7.498 15.25H4.372c-1.026 0-1.945-.694-2.054-1.715a12.137 12.137 0 0 1-.068-1.285c0-2.848.992-5.464 2.649-7.521C5.287 4.247 5.886 4 6.504 4h4.016a4.5 4.5 0 0 1 1.423.23l3.114 1.04a4.5 4.5 0 0 0 1.423.23h1.294M7.498 15.25c.618 0 .991.724.725 1.282A7.471 7.471 0 0 0 7.5 19.75 2.25 2.25 0 0 0 9.75 22a.75.75 0 0 0 .75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 0 0 2.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384m-10.253 1.5H9.7m8.075-9.75c.01.05.027.1.05.148.593 1.2.925 2.55.925 3.977 0 1.487-.36 2.89-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398-.306.774-1.086 1.227-1.918 1.227h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 0 0 .303-.54"></path></svg><p class="ml-1">${ssrInterpolate(unref(toPersianNumbers)(unref(activity).dislikes_count))}</p></button><button class="flex items-center ml-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"${ssrRenderAttr("fill", unref(markColor))} class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0Z"></path></svg></button><div class="items-center ml-2">`);
      _push(ssrRenderComponent(_component_NuxtLink, {
        to: ("useRuntimeConfig" in _ctx ? _ctx.useRuntimeConfig : unref(useRuntimeConfig))().public.router.FieldEdit + unref(id),
        class: ""
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"${_scopeId}><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"${_scopeId}></path></svg>`);
          } else {
            return [
              (openBlock(), createBlock("svg", {
                xmlns: "http://www.w3.org/2000/svg",
                fill: "none",
                viewBox: "0 0 24 24",
                "stroke-width": "1.5",
                stroke: "currentColor",
                class: "size-4"
              }, [
                createVNode("path", {
                  "stroke-linecap": "round",
                  "stroke-linejoin": "round",
                  d: "m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"
                })
              ]))
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div></div>`);
      _push(ssrRenderComponent(_component_MaghaleCircleProgress, {
        progress: unref(toPersianNumbers)(unref(instance).progress)
      }, null, _parent));
      _push(`</div>`);
      _push(ssrRenderComponent(_component_UserStatistics, {
        statistics: unref(instance).user_statistics
      }, null, _parent));
      _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/article/details.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = {
  __name: "index",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const store = useMaghaleStore();
    const activity = ([__temp, __restore] = withAsyncContext(() => $fetch(useRuntimeConfig().public.BaseUrl + "articles/get_activity/" + useRoute().params.id)), __temp = await __temp, __restore(), __temp);
    store.setActivityTitle(activity);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_ArticleDetails = _sfc_main$1;
      const _component_HandoutTiles = _sfc_main$2;
      const _component_LinkTiles = _sfc_main$3;
      const _component_CommentTiles = _sfc_main$4;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "" }, _attrs))}>`);
      _push(ssrRenderComponent(_component_ArticleDetails, null, null, _parent));
      _push(ssrRenderComponent(_component_HandoutTiles, null, null, _parent));
      _push(ssrRenderComponent(_component_LinkTiles, null, null, _parent));
      _push(ssrRenderComponent(_component_CommentTiles, 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/articles/[id]/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

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