import { _ as __nuxt_component_0 } from "./SearchForm-76ddffad.js";
import { mergeProps, useSSRContext } from "vue";
import "hookable";
import { n as useRouter } from "../server.mjs";
import "destr";
import "devalue";
import "klona";
import { ssrRenderComponent } from "vue/server-renderer";
import dayjs from "dayjs";
const _sfc_main = {
  __name: "SearchRoutes",
  __ssrInlineRender: true,
  setup(__props) {
    const router = useRouter();
    const searchResult = (payload) => {
      var _a, _b;
      router.push({
        name: "resultats",
        query: {
          origin: (_a = payload.origin) == null ? void 0 : _a.id,
          destination: (_b = payload.destination) == null ? void 0 : _b.id,
          date: payload.date ? dayjs(payload.date).format("YYYY-MM-DD") : void 0
        }
      });
    };
    return (_ctx, _push, _parent, _attrs) => {
      const _component_search_form = __nuxt_component_0;
      _push(ssrRenderComponent(_component_search_form, mergeProps({ onSearch: searchResult }, _attrs), null, _parent));
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/SearchRoutes.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __nuxt_component_5 = _sfc_main;
export {
  __nuxt_component_5 as _
};
//# sourceMappingURL=SearchRoutes-e4724b49.js.map
