import { n as e } from "./chunk-TYymryXo.mjs";
import { n as t, t as n } from "./selectedInfo-CT8ehCR8.mjs";
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createVNode as c, defineComponent as l, inject as u, openBlock as d, ref as f, unref as p, watch as m, withCtx as h } from "vue";
import { Form as g, FormItem as _, Input as v, Select as y, Textarea as b } from "ant-design-vue/es";
//#region src/pages/flow-create/flow-model/createComponents/flow/right-panel/components/edgeTransfer.vue?vue&type=script&setup=true&lang.tsx
var x = /* @__PURE__ */ l({
	name: "EdgeTransfer",
	__name: "edgeTransfer",
	setup(e) {
		let l = u("lf"), x = t(), S = n(), C = [
			{
				label: "普通流转路径",
				value: "normal"
			},
			{
				label: "默认流转路径",
				value: "half"
			},
			{
				label: "条件流转路径",
				value: "empty"
			}
		], w = [{
			label: "表达式",
			value: "expression"
		}, {
			label: "脚本",
			value: "scriptFormat"
		}], T = [{
			label: "内联脚本",
			value: "inline"
		}, {
			label: "外部脚本",
			value: "external"
		}], E = f({ type: "normal" });
		m(i(() => x.getElementById(S.selectId) || {}), (e) => {
			E.value = e.edgeTransfer || { type: "normal" };
		}, {
			immediate: !0,
			deep: !0
		});
		function D(e) {
			if (l.value.setProperties(S.selectId, { arrowType: e }), E.value = { type: e }, e === "half") {
				let e = l.value.getEdgeDataById(S.selectId).sourceNodeId;
				l.value.setProperties(e, { default: S.selectId }), l.value.getEdgeModels({ sourceNodeId: e }).forEach((e) => {
					e.id !== S.selectId && e.properties.arrowType === "half" && (l.value.setProperties(e.id, { arrowType: "normal" }), x.updateElement(e.id, { edgeTransfer: { type: "normal" } }));
				});
			} else {
				let e = l.value.getEdgeDataById(S.selectId).sourceNodeId;
				l.value.setProperties(e, { default: "" });
			}
		}
		return m(() => E.value, (e) => {
			x.updateElement(S.selectId, { edgeTransfer: e }), l.value.setProperties(S.selectId, {
				arrowType: e.type,
				edgeTransfer: e
			});
		}, { deep: !0 }), (e, t) => {
			let n = y, i = _, l = v, u = b, f = g;
			return d(), a(f, {
				model: p(E),
				"label-col": { style: { width: "80px" } }
			}, {
				default: h(() => [c(i, {
					label: "流转类型",
					name: "type"
				}, {
					default: h(() => [c(n, {
						value: p(E).type,
						"onUpdate:value": t[0] ||= (e) => p(E).type = e,
						style: { width: "100%" },
						placeholder: "请选择流转类型",
						options: C,
						onChange: D
					}, null, 8, ["value"])]),
					_: 1
				}), p(E).type === "empty" ? (d(), s(r, { key: 0 }, [
					p(E).type === "empty" ? (d(), a(i, {
						key: 0,
						label: "条件格式",
						name: "lType"
					}, {
						default: h(() => [c(n, {
							value: p(E).lType,
							"onUpdate:value": t[1] ||= (e) => p(E).lType = e,
							style: { width: "100%" },
							placeholder: "请选择条件格式",
							options: w
						}, null, 8, ["value"])]),
						_: 1
					})) : o("", !0),
					p(E).lType === "expression" ? (d(), a(i, {
						key: 1,
						label: "表达式",
						name: "expression"
					}, {
						default: h(() => [c(l, {
							value: p(E).expression,
							"onUpdate:value": t[2] ||= (e) => p(E).expression = e,
							maxlength: 30
						}, null, 8, ["value"])]),
						_: 1
					})) : o("", !0),
					p(E).lType === "scriptFormat" ? (d(), a(i, {
						key: 2,
						label: "脚本语言",
						name: "scriptFormat"
					}, {
						default: h(() => [c(l, {
							value: p(E).scriptFormat,
							"onUpdate:value": t[3] ||= (e) => p(E).scriptFormat = e,
							maxlength: 30
						}, null, 8, ["value"])]),
						_: 1
					})) : o("", !0),
					p(E).lType === "scriptFormat" ? (d(), a(i, {
						key: 3,
						label: "脚本类型",
						name: "scriptType"
					}, {
						default: h(() => [c(n, {
							value: p(E).scriptType,
							"onUpdate:value": t[4] ||= (e) => p(E).scriptType = e,
							style: { width: "100%" },
							placeholder: "脚本类型",
							options: T
						}, null, 8, ["value"])]),
						_: 1
					})) : o("", !0),
					p(E).scriptType === "inline" ? (d(), a(i, {
						key: 4,
						label: "脚本",
						name: "scriptContent"
					}, {
						default: h(() => [c(u, {
							value: p(E).scriptContent,
							"onUpdate:value": t[5] ||= (e) => p(E).scriptContent = e,
							placeholder: "输入脚本内容",
							"allow-clear": "",
							maxlength: 300
						}, null, 8, ["value"])]),
						_: 1
					})) : o("", !0),
					p(E).scriptType === "external" ? (d(), a(i, {
						key: 5,
						label: "资源地址",
						name: "resource"
					}, {
						default: h(() => [c(l, {
							value: p(E).resource,
							"onUpdate:value": t[6] ||= (e) => p(E).resource = e,
							maxlength: 100
						}, null, 8, ["value"])]),
						_: 1
					})) : o("", !0)
				], 64)) : o("", !0)]),
				_: 1
			}, 8, ["model"]);
		};
	}
}), S = /* @__PURE__ */ e({ default: () => C }), C = x;
//#endregion
export { S as n, C as t };
