import { _ as __nuxt_component_2 } from './nuxt-link-DENluCKo.mjs';
import { a as mediaURL } from './helpers-CocmU_lH.mjs';
import { withAsyncContext, mergeProps, unref, withCtx, createVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderAttr, ssrInterpolate } from 'vue/server-renderer';
import { bl as useRoute$2, b4 as useFetch, y as createError } from './server.mjs';
import { u as useTime } from './useTime-ByXQWA_w.mjs';
import '../nitro/nitro.mjs';
import 'luxon';
import '@sequelize/core';
import 'html-to-text';
import 'zod';
import 'crypto';
import 'node:fs';
import 'sharp';
import 'path';
import 'node:stream';
import 'jsdom';
import 'dompurify';
import 'mime-types';
import 'fs';
import 'fs/promises';
import 'linkify-html';
import '@peertube/http-signature';
import 'jsonld';
import 'lodash.intersection';
import 'email-templates';
import 'node:http';
import 'node:https';
import 'node:crypto';
import 'node:events';
import 'node:buffer';
import 'node:path';
import 'vue-router';
import 'dotenv';
import 'url';
import 'bcryptjs';
import 'slugify';
import 'umzug';
import 'consola';
import '@sequelize/core/decorators-legacy';
import 'util';
import 'mitt';
import 'ical.js';
import 'node:url';
import 'fast-xml-parser';
import 'perfect-debounce';
import 'v-calendar';
import 'linkifyjs';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';

const _sfc_main = {
  __name: "[id]",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const { params } = useRoute$2();
    const { when } = useTime();
    const { data: event } = ([__temp, __restore] = withAsyncContext(() => useFetch(
      `/api/event/detail/${params.id}`,
      "$HTkR7rj73d"
      /* nuxt-injected */
    )), __temp = await __temp, __restore(), __temp);
    if (!event.value) {
      throw createError({ statusCode: 404, message: "Event not found" });
    }
    return (_ctx, _push, _parent, _attrs) => {
      const _component_nuxt_link = __nuxt_component_2;
      _push(ssrRenderComponent(_component_nuxt_link, mergeProps({
        class: "embed_event",
        to: `/event/${unref(event).slug || unref(event).id}`,
        target: "_blank"
      }, _attrs), {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<img class="float-left"${ssrRenderAttr("src", ("mediaURL" in _ctx ? _ctx.mediaURL : unref(mediaURL))(unref(event), "thumb"))}${_scopeId}><div class="event-info"${_scopeId}><div class="date"${_scopeId}>${ssrInterpolate(unref(when)(unref(event)))}</div><br${_scopeId}><h4${_scopeId}>${ssrInterpolate(unref(event).title)}</h4><div class="date"${_scopeId}>${ssrInterpolate(unref(event).place.name)}</div></div>`);
          } else {
            return [
              createVNode("img", {
                class: "float-left",
                src: ("mediaURL" in _ctx ? _ctx.mediaURL : unref(mediaURL))(unref(event), "thumb")
              }, null, 8, ["src"]),
              createVNode("div", { class: "event-info" }, [
                createVNode("div", { class: "date" }, toDisplayString(unref(when)(unref(event))), 1),
                createVNode("br"),
                createVNode("h4", null, toDisplayString(unref(event).title), 1),
                createVNode("div", { class: "date" }, toDisplayString(unref(event).place.name), 1)
              ])
            ];
          }
        }),
        _: 1
      }, _parent));
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/embed/[id].vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
