import { b as buildAssetsURL } from '../_/nitro.mjs'; import { defineComponent, ref, computed, mergeProps, unref, withCtx, createTextVNode, toDisplayString, reactive, createVNode, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderList, ssrRenderComponent, ssrRenderAttr, ssrInterpolate } from 'vue/server-renderer'; import { U as UserProfilePic } from './UserProfilePic-DXA233hi.mjs'; import { _ as _sfc_main$4 } from './BasicButton-B-4QDu9v.mjs'; import { u as useRouter, a as useConfigStore, z as useElementSize } from './server.mjs'; import { u as usePrice } from './usePrice-B-5-jXKQ.mjs'; import { t as toJalali } from './useDateTime-D8RCoGwW.mjs'; import { u as useMediaStore } from './media-kxpEX2xr.mjs'; import { _ as __nuxt_component_4 } from './index-_EOUO1YE.mjs'; import { ContentLoader } from 'vue-content-loader'; const _imports_0$1 = "" + buildAssetsURL("empty_order.g7yXtwjI.svg"); const _imports_0 = "" + buildAssetsURL("delivery-box-light.Cz31HXNr.svg"); const _imports_1 = "" + buildAssetsURL("delivery-box.DZAXZSja.svg"); const _sfc_main$3 = /* @__PURE__ */ defineComponent({ __name: "box", __ssrInlineRender: true, setup(__props) { const config = useConfigStore(); return (_ctx, _push, _parent, _attrs) => { if (unref(config).isNightStore) { _push(``); } 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("assets/img/icons/box.vue"); return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0; }; const _sfc_main$2 = /* @__PURE__ */ defineComponent({ __name: "OrderCard", __ssrInlineRender: true, props: { order: {} }, setup(__props) { const router = useRouter(); const props = __props; const config = useConfigStore(); const address = computed(() => { var _a2, _b, _c; var _a; const convert = (_a = JSON.parse(props.order.address)) == null ? void 0 : _a.payload; return `${(_a2 = convert == null ? void 0 : convert.province) != null ? _a2 : ""}-${(_b = convert == null ? void 0 : convert.city) != null ? _b : ""}-${(_c = convert == null ? void 0 : convert.address) != null ? _c : ""}`; }); const userStory = (id) => { return mediaStore.users.find((x) => x.id === id); }; const mediaStore = useMediaStore(); return (_ctx, _push, _parent, _attrs) => { var _a2; var _a, _b, _c, _d; const _component_a_divider = __nuxt_component_4; _push(`
`); if (unref(config).isSeller) { _push(ssrRenderComponent(UserProfilePic, { width: "60", src: (_a = _ctx.order.user) == null ? void 0 : _a.avatar, "just-show-profile": "", showMyStory: (_c = (_b = userStory(_ctx.order.user.id)) == null ? void 0 : _b.stories) == null ? void 0 : _c.every((item) => item.storyviews.find((_item) => { var _a22; return _item.user_id === ((_a22 = _ctx.user.user) == null ? void 0 : _a22.id); })) }, null, _parent)); } else { _push(ssrRenderComponent(_sfc_main$3, { class: "w-2rem" }, null, _parent)); } _push(`
`); if (unref(config).isSeller) { _push(`
${ssrInterpolate((_a2 = (_d = _ctx.order.user) == null ? void 0 : _d.name) != null ? _a2 : "_")}
`); } else { _push(``); } _push(`
${ssrInterpolate(unref(config).useString("orderNumber"))}:${ssrInterpolate(_ctx.order.id)}
${ssrInterpolate(unref(config).useString("totalPrice"))}:${ssrInterpolate(unref(usePrice)(_ctx.order.total_price, true))}
${ssrInterpolate(unref(config).useString("date"))}:${ssrInterpolate(unref(toJalali)(_ctx.order.created_at))}
`); _push(ssrRenderComponent(_sfc_main$4, { class: "!h-7", onClick: ($event) => unref(router).push({ name: "order", params: { id: _ctx.order.id } }) }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(`${ssrInterpolate(unref(config).useString("details"))}`); } else { return [ createTextVNode(toDisplayString(unref(config).useString("details")), 1) ]; } }), _: 1 }, _parent)); _push(`
`); _push(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent)); _push(`

${ssrInterpolate(address.value)}

`); }; } }); 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/Cards/OrderCard.vue"); return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0; }; const _sfc_main$1 = /* @__PURE__ */ defineComponent({ __name: "OrderCardSkeleton", __ssrInlineRender: true, setup(__props) { const isLoaded = ref(false); const skeletonRatio = ref(null); const skeletonSize = reactive( useElementSize(skeletonRatio, { width: 0, height: 0 }, { box: "border-box" }) ); return (_ctx, _push, _parent, _attrs) => { if (isLoaded.value) { _push(``); _push(ssrRenderComponent(unref(ContentLoader), { width: skeletonSize.width, height: "80" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(``); } else { return [ createVNode("circle", { cx: "30", cy: "50", r: "30" }), createVNode("rect", { x: "80", y: "15", rx: "3", ry: "3", width: "190", height: "15" }), createVNode("rect", { x: "80", y: "40", rx: "3", ry: "3", width: "190", height: "15" }), createVNode("rect", { x: "80", y: "65", rx: "3", ry: "3", width: "190", height: "15" }), createVNode("rect", { x: skeletonSize.width - 80, y: "35", rx: "3", ry: "3", width: "80", height: "30" }, null, 8, ["x"]) ]; } }), _: 1 }, _parent)); _push(``); } else { _push(``); } }; } }); 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/Cards/OrderCardSkeleton.vue"); return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0; }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "OrdersList", __ssrInlineRender: true, setup(__props) { const router = useRouter(); const config = useConfigStore(); const loading = ref(false); ref(false); ref(0); ref(10); const orders = ref([]); computed(() => router.currentRoute.value.params.id); return (_ctx, _push, _parent, _attrs) => { var _a; _push(` 0 ? "" : "justify-center"] }, _attrs))}>`); if (!loading.value) { _push(``); if (orders.value.length !== 0) { _push(``); ssrRenderList(orders.value, (order) => { _push(ssrRenderComponent(_sfc_main$2, { order }, null, _parent)); }); _push(``); } else { _push(`

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

`); } _push(``); } else { _push(``); ssrRenderList(6, (i) => { _push(ssrRenderComponent(_sfc_main$1, { key: i }, null, _parent)); }); _push(``); } _push(``); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/statisticsList/components/OrdersList.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as _ }; //# sourceMappingURL=OrdersList-Ck2cCOmi.mjs.map