import { getErrorMessage as e } from "../../helpers/error.js";
import t from "../PlIcon24/PlIcon24.js";
import "../PlMaskIcon24/index.js";
import './pl-progress-cell.css';/* empty css                 */
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, toDisplayString as p, unref as m } from "vue";
var h = {
	key: 0,
	class: "progress-cell__infinity-loader"
}, g = { class: "progress-cell__body" }, _ = { class: "progress-cell__stage text-s" }, v = { class: "progress-cell__percentage text-s d-flex align-center justify-end" }, y = /* @__PURE__ */ l({
	__name: "PlProgressCell",
	props: {
		stage: { default: "not_started" },
		step: { default: "" },
		progressString: { default: "" },
		progress: { default: void 0 },
		error: { default: void 0 }
	},
	setup(l) {
		let y = l, b = r(() => y.stage !== "not_started"), x = r(() => y.stage === "done" ? 100 : Math.min(100, y.progress || 0)), S = r(() => y.progress === void 0 && y.stage !== "done" && y.stage !== "not_started" && !y.error);
		return (r, C) => (f(), o("div", { class: u({
			"progress-cell": !0,
			"progress-cell__white-bg": b.value,
			error: l.error,
			"not-started": y.stage === "not_started"
		}) }, [
			S.value ? (f(), o("div", h, [...C[0] ||= [s("div", { class: "progress-cell__infinity-gradient" }, null, -1)]])) : a("", !0),
			!S.value && !l.error ? (f(), o("div", {
				key: 1,
				class: "progress-cell__indicator",
				style: d({ width: x.value + "%" })
			}, null, 4)) : a("", !0),
			s("div", g, [s("div", _, p(l.error ? m(e)(l.error) : l.step), 1), s("div", v, [l.error ? (f(), i(m(t), {
				key: 0,
				name: "error"
			})) : a("", !0), l.error ? a("", !0) : (f(), o(n, { key: 1 }, [c(p(l.progressString), 1)], 64))])])
		], 2));
	}
});
export { y as default };

//# sourceMappingURL=PlProgressCell.vue2.js.map