import { defineComponent, ref, watch, unref, withCtx, createTextVNode, toDisplayString, createVNode, useSSRContext } from 'vue'; import { ssrRenderAttr, ssrInterpolate, ssrRenderList, ssrRenderComponent } from 'vue/server-renderer'; import { _ as _imports_0 } from './close_light-DbrEdRZI.mjs'; import { u as useRouter$1, a as useConfigStore, t as reactiveProjectName } from './server.mjs'; import { m as mediaFilesUrl, p as previewImg } from './handle-Bvvl_htN.mjs'; import { _ as __nuxt_component_1, a as __nuxt_component_2 } from './RadioButton--E7lmHK3.mjs'; const maxFiles = 10; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "index", __ssrInlineRender: true, setup(__props) { const router = useRouter$1(); const config = useConfigStore(); ref(null); const type = ref(""); watch(mediaFilesUrl, (files) => { if (mediaFilesUrl.value.length === 0) previewImg.value = ""; else if (mediaFilesUrl.value.length === 1) previewImg.value = mediaFilesUrl.value[0]; else { previewImg.value = files[files.length - 1]; } }); const isVideo = (file) => file.includes(".mp4") || file.includes(".mov") || file.includes("video"); return (_ctx, _push, _parent, _attrs) => { const _component_a_radio_group = __nuxt_component_1; const _component_a_radio_button = __nuxt_component_2; _push(`
${ssrInterpolate(unref(config).useString("newStory"))}
${ssrInterpolate(unref(config).useString("next"))}
`); if (unref(previewImg)) { _push(``); } else if (unref(mediaFilesUrl).length === 0) { _push(`

${ssrInterpolate(unref(config).useString("tapPlusToAdd"))}

`); } else { _push(``); } _push(`
`); ssrRenderList(unref(mediaFilesUrl), (media, index) => { _push(`
`); if (isVideo(media)) { _push(``); } else { _push(``); } _push(`
`); }); _push(``); if (unref(mediaFilesUrl).length < maxFiles) { _push(`
+
`); } else { _push(``); } _push(`
`); _push(ssrRenderComponent(_component_a_radio_group, { value: type.value, "onUpdate:value": ($event) => type.value = $event, "button-style": "solid" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(ssrRenderComponent(_component_a_radio_button, { onClick: ($event) => unref(router).push({ name: "add-product-excel-inputProductExcel" }), value: "productExcel" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`${ssrInterpolate(unref(config).useString("productExcel"))}`); } else { return [ createTextVNode(toDisplayString(unref(config).useString("productExcel")), 1) ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_radio_button, { onClick: ($event) => unref(router).push({ name: "add-product-inputProduct" }), value: "product" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`${ssrInterpolate(unref(config).useString("product2"))}`); } else { return [ createTextVNode(toDisplayString(unref(config).useString("product2")), 1) ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_radio_button, { onClick: ($event) => unref(router).push({ name: "add-story-inputStory" }), value: "story" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`${ssrInterpolate(unref(config).useString("story2"))}`); } else { return [ createTextVNode(toDisplayString(unref(config).useString("story2")), 1) ]; } }), _: 1 }, _parent2, _scopeId)); } else { return [ createVNode(_component_a_radio_button, { onClick: ($event) => unref(router).push({ name: "add-product-excel-inputProductExcel" }), value: "productExcel" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(config).useString("productExcel")), 1) ]), _: 1 }, 8, ["onClick"]), createVNode(_component_a_radio_button, { onClick: ($event) => unref(router).push({ name: "add-product-inputProduct" }), value: "product" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(config).useString("product2")), 1) ]), _: 1 }, 8, ["onClick"]), createVNode(_component_a_radio_button, { onClick: ($event) => unref(router).push({ name: "add-story-inputStory" }), value: "story" }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(config).useString("story2")), 1) ]), _: 1 }, 8, ["onClick"]) ]; } }), _: 1 }, _parent)); _push(`
`); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/add/story/inputMedia/index.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as _ }; //# sourceMappingURL=index-CtLZsrmp.mjs.map