UNPKG

epic-designer-cjh

Version:

基于vue3的设计器,可视化开发页面表单

1,555 lines (1,554 loc) 51.8 kB
import { defineComponent as Ot, ref as ze, watch as Ke, computed as Pt, h as ve, nextTick as _t } from "vue"; import { d as St, m as Ge } from "./index-7873b327.js"; import { g as Ct } from "./_commonjsHelpers-c5d32002.js"; import { i as ne } from "./interopRequireDefault-40f894e3.js"; import { r as Z } from "./_vue_commonjs-external-eb7fec7f.js"; import { r as se, a as ye, c as bt } from "./public_api-1267ff2a.js"; import { r as Mt, a as It, b as xt, c as Nt, d as Rt } from "./ZoomOutOutlined-74408144.js"; import { d as He, i as Dt, j as qt, r as $t, a as Et, e as mt, f as At, w as jt } from "./useConfigInject-d85d8c62.js"; import { r as Lt } from "./index-f96a976e.js"; import { r as gt } from "./useMergedState-8adea16c.js"; import { r as Tt, a as Vt, b as zt } from "./index-3ca619fd.js"; import { a as Gt } from "./PortalWrapper-9d2c005f.js"; import { r as Wt } from "./KeyCode-5c436a1d.js"; import { r as Ut } from "./raf-dd6c1047.js"; import { r as Oe } from "./AntdIcon-b29a156c.js"; import { r as Ft } from "./CloseOutlined-ca523fbb.js"; import { r as kt } from "./LeftOutlined-05cfb72e.js"; import { r as Zt } from "./RightOutlined-b89f2ac6.js"; import { r as wt } from "./transition-d16825f8.js"; import { r as Bt } from "./index-977e4f68.js"; import { r as Ht } from "./EyeOutlined-7595d49c.js"; import "./pickAttrs-8a877861.js"; import "./DownloadOutlined-9cd200ec.js"; import "./isEqual-b1699f9b.js"; import "./index-c3e64a00.js"; import "./isObjectLike-4c09a3af.js"; import "./omit-f0993d0d.js"; import "./_flatRest-b83a0ce4.js"; import "./isPlainObject-527734d2.js"; import "./LoadingOutlined-7a37e4f8.js"; import "./LoadingOutlined-93b8de63.js"; import "./index-5a88efc4.js"; import "./index-62ef22df.js"; import "./isVisible-f22c1e3a.js"; import "./useState-f730f903.js"; import "./compact-item-020b9c99.js"; import "./createContext-a42fe982.js"; import "./lodash-915646fb.js"; import "./index-0e1c5170.js"; import "./index-74b3b9ac.js"; import "./vnode-45aa23d5.js"; import "./ResizeObserver.es-df63660c.js"; import "./ResizeObserver.es-fc1a163b.js"; import "./firstNotUndefined-57974c1b.js"; import "./colors-8180628c.js"; import "./CheckOutlined-7bbf15ee.js"; import "./CheckOutlined-4bef68e3.js"; import "./ExclamationCircleFilled-5348250c.js"; import "./ExclamationCircleFilled-873bbaab.js"; import "./CloseCircleFilled-9cec1aca.js"; import "./CloseCircleFilled-268a9271.js"; import "./useRefs-8fb1d76b.js"; import "./collapseMotion-cf2619c2.js"; import "./index-6bd43371.js"; import "./Col-dad05aa8.js"; import "./useFlexGapSupport-f3b1c137.js"; import "./index-816021be.js"; import "./index-97ce4605.js"; import "./FormItemContext-6c3deaca.js"; import "./index-cd8ad455.js"; import "./index-95f97c1c.js"; import "./InfoCircleFilled-299f61de.js"; import "./typeof-88a201b1.js"; import "./index.esm-56aac43a.js"; import "./index-2b6651fc.js"; import "./stylis-9146bd77.js"; import "./vue-types.m-289f467a.js"; import "./vue-types.m-76c57684.js"; import "./omit-84b99e2b.js"; import "./CloseOutlined-e8461703.js"; import "./LeftOutlined-7cac937b.js"; import "./RightOutlined-c0a86bcb.js"; import "./EyeOutlined-488be415.js"; function Yt(o, e) { for (var v = 0; v < e.length; v++) { const d = e[v]; if (typeof d != "string" && !Array.isArray(d)) { for (const m in d) if (m !== "default" && !(m in o)) { const h = Object.getOwnPropertyDescriptor(d, m); h && Object.defineProperty(o, m, h.get ? h : { enumerable: !0, get: () => d[m] }); } } } return Object.freeze(Object.defineProperty(o, Symbol.toStringTag, { value: "Module" })); } var Ye = {}, We = {}, Y = {}, k = {}, et; function Xe() { if (et) return k; et = 1, Object.defineProperty(k, "__esModule", { value: !0 }), k.get = h, k.getClientSize = i, k.getDocSize = t, k.getOffset = s, k.getOuterHeight = w, k.getOuterWidth = g, k.getScroll = a, k.set = l; const o = /margin|padding|width|height|max|min|offset/, e = { left: !0, top: !0 }, v = { cssFloat: 1, styleFloat: 1, float: 1 }; function d(r) { return r.nodeType === 1 ? r.ownerDocument.defaultView.getComputedStyle(r, null) : {}; } function m(r, f, n) { if (f = f.toLowerCase(), n === "auto") { if (f === "height") return r.offsetHeight; if (f === "width") return r.offsetWidth; } return f in e || (e[f] = o.test(f)), e[f] ? parseFloat(n) || 0 : n; } function h(r, f) { const n = arguments.length, p = d(r); return f = v[f] ? "cssFloat" in r.style ? "cssFloat" : "styleFloat" : f, n === 1 ? p : m(r, f, p[f] || r.style[f]); } function l(r, f, n) { const p = arguments.length; if (f = v[f] ? "cssFloat" in r.style ? "cssFloat" : "styleFloat" : f, p === 3) return typeof n == "number" && o.test(f) && (n = `${n}px`), r.style[f] = n, n; for (const S in f) f.hasOwnProperty(S) && l(r, S, f[S]); return d(r); } function g(r) { return r === document.body ? document.documentElement.clientWidth : r.offsetWidth; } function w(r) { return r === document.body ? window.innerHeight || document.documentElement.clientHeight : r.offsetHeight; } function t() { const r = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), f = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); return { width: r, height: f }; } function i() { const r = document.documentElement.clientWidth, f = window.innerHeight || document.documentElement.clientHeight; return { width: r, height: f }; } function a() { return { scrollLeft: Math.max(document.documentElement.scrollLeft, document.body.scrollLeft), scrollTop: Math.max(document.documentElement.scrollTop, document.body.scrollTop) }; } function s(r) { const f = r.getBoundingClientRect(), n = document.documentElement; return { left: f.left + (window.pageXOffset || n.scrollLeft) - (n.clientLeft || document.body.clientLeft || 0), top: f.top + (window.pageYOffset || n.scrollTop) - (n.clientTop || document.body.clientTop || 0) }; } return k; } var le = {}, xe = {}, tt; function Xt() { if (tt) return xe; tt = 1; var o = ne; Object.defineProperty(xe, "__esModule", { value: !0 }), xe.default = m; var e = o(se()), v = o(Ut()), d = Z; function m(h) { const l = (0, d.ref)(null), g = (0, d.reactive)((0, e.default)({}, h)), w = (0, d.ref)([]), t = (i) => { l.value === null && (w.value = [], l.value = (0, v.default)(() => { let a; w.value.forEach((s) => { a = (0, e.default)((0, e.default)({}, a), s); }), (0, e.default)(g, a), l.value = null; })), w.value.push(i); }; return (0, d.onMounted)(() => { l.value && v.default.cancel(l.value); }), [g, t]; } return xe; } var Ne = {}, rt; function Qt() { if (rt) return Ne; rt = 1; var o = ne; Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.default = m; var e = o(se()), v = Xe(); function d(h, l, g, w) { const t = l + g, i = (g - w) / 2; if (g > w) { if (l > 0) return { [h]: i }; if (l < 0 && t < w) return { [h]: -i }; } else if (l < 0 || t > w) return { [h]: l < 0 ? i : -i }; return {}; } function m(h, l, g, w) { const { width: t, height: i } = (0, v.getClientSize)(); let a = null; return h <= t && l <= i ? a = { x: 0, y: 0 } : (h > t || l > i) && (a = (0, e.default)((0, e.default)({}, d("x", g, h, t)), d("y", w, l, i))), a; } return Ne; } var X = {}, nt; function Qe() { if (nt) return X; nt = 1; var o = ne; Object.defineProperty(X, "__esModule", { value: !0 }), X.imageGroupProps = X.default = X.context = void 0; var e = Z, v = o(ye()), d = Je(), m = o(ht()), h = o(gt()), l = function(s, r) { var f = {}; for (var n in s) Object.prototype.hasOwnProperty.call(s, n) && r.indexOf(n) < 0 && (f[n] = s[n]); if (s != null && typeof Object.getOwnPropertySymbols == "function") for (var p = 0, n = Object.getOwnPropertySymbols(s); p < n.length; p++) r.indexOf(n[p]) < 0 && Object.prototype.propertyIsEnumerable.call(s, n[p]) && (f[n[p]] = s[n[p]]); return f; }; const g = Symbol("previewGroupContext"), w = { provide: (s) => { (0, e.provide)(g, s); }, inject: () => (0, e.inject)(g, { isPreviewGroup: (0, e.shallowRef)(!1), previewUrls: (0, e.computed)(() => /* @__PURE__ */ new Map()), setPreviewUrls: () => { }, current: (0, e.ref)(null), setCurrent: () => { }, setShowPreview: () => { }, setMousePosition: () => { }, registerImage: null, rootClassName: "" }) }; X.context = w; const t = () => ({ previewPrefixCls: String, preview: { type: [Boolean, Object], default: !0 }, icons: { type: Object, default: () => ({}) } }); X.imageGroupProps = t; var a = (0, e.defineComponent)({ compatConfig: { MODE: 3 }, name: "PreviewGroup", inheritAttrs: !1, props: t(), setup(s, r) { let { slots: f } = r; const n = (0, e.computed)(() => { const _ = { visible: void 0, onVisibleChange: () => { }, getContainer: void 0, current: 0 }; return typeof s.preview == "object" ? (0, d.mergeDefaultValue)(s.preview, _) : _; }), p = (0, e.reactive)(/* @__PURE__ */ new Map()), S = (0, e.ref)(), u = (0, e.computed)(() => n.value.visible), c = (0, e.computed)(() => n.value.getContainer), C = (_, R) => { var x, V; (V = (x = n.value).onVisibleChange) === null || V === void 0 || V.call(x, _, R); }, [O, y] = (0, h.default)(!!u.value, { value: u, onChange: C }), b = (0, e.ref)(null), N = (0, e.computed)(() => u.value !== void 0), E = (0, e.computed)(() => Array.from(p.keys())), A = (0, e.computed)(() => E.value[n.value.current]), L = (0, e.computed)(() => new Map(Array.from(p).filter((_) => { let [, { canPreview: R }] = _; return !!R; }).map((_) => { let [R, { url: x }] = _; return [R, x]; }))), q = function(_, R) { let x = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0; p.set(_, { url: R, canPreview: x }); }, D = (_) => { S.value = _; }, T = (_) => { b.value = _; }, I = function(_, R) { let x = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0; const V = () => { p.delete(_); }; return p.set(_, { url: R, canPreview: x }), V; }, $ = (_) => { _ == null || _.stopPropagation(), y(!1), T(null); }; return (0, e.watch)(A, (_) => { D(_); }, { immediate: !0, flush: "post" }), (0, e.watchEffect)(() => { O.value && N.value && D(A.value); }, { flush: "post" }), w.provide({ isPreviewGroup: (0, e.shallowRef)(!0), previewUrls: L, setPreviewUrls: q, current: S, setCurrent: D, setShowPreview: y, setMousePosition: T, registerImage: I }), () => { const _ = l(n.value, []); return (0, e.createVNode)(e.Fragment, null, [f.default && f.default(), (0, e.createVNode)(m.default, (0, v.default)((0, v.default)({}, _), {}, { "ria-hidden": !O.value, visible: O.value, prefixCls: s.previewPrefixCls, onClose: $, mousePosition: b.value, src: L.value.get(S.value), icons: s.icons, getContainer: c.value }), null)]); }; } }); return X.default = a, X; } var ot; function ht() { if (ot) return le; ot = 1; var o = ne; Object.defineProperty(le, "__esModule", { value: !0 }), le.previewProps = le.default = void 0; var e = Z, v = o(ye()), d = o(se()), m = o(He()), h = o(Tt()), l = Vt(), g = Xe(), w = o(Gt()), t = o(Wt()), i = Dt(), a = o(Xt()), s = o(Qt()), r = Qe(); const f = { x: 0, y: 0 }, n = (0, d.default)((0, d.default)({}, (0, l.dialogPropTypes)()), { src: String, alt: String, rootClassName: String, icons: { type: Object, default: () => ({}) } }); le.previewProps = n; var S = (0, e.defineComponent)({ compatConfig: { MODE: 3 }, name: "Preview", inheritAttrs: !1, props: n, emits: ["close", "afterClose"], setup(u, c) { let { emit: C, attrs: O } = c; const { rotateLeft: y, rotateRight: b, zoomIn: N, zoomOut: E, close: A, left: L, right: q, flipX: D, flipY: T } = (0, e.reactive)(u.icons), I = (0, e.shallowRef)(1), $ = (0, e.shallowRef)(0), _ = (0, e.reactive)({ x: 1, y: 1 }), [R, x] = (0, a.default)(f), V = () => C("close"), B = (0, e.shallowRef)(), Q = (0, e.reactive)({ originX: 0, originY: 0, deltaX: 0, deltaY: 0 }), U = (0, e.shallowRef)(!1), De = r.context.inject(), { previewUrls: pe, current: Pe, isPreviewGroup: _e, setCurrent: oe } = De, F = (0, e.computed)(() => pe.value.size), J = (0, e.computed)(() => Array.from(pe.value.keys())), z = (0, e.computed)(() => J.value.indexOf(Pe.value)), qe = (0, e.computed)(() => _e.value ? pe.value.get(Pe.value) : u.src), me = (0, e.computed)(() => _e.value && F.value > 1), H = (0, e.shallowRef)({ wheelDirection: 0 }), ce = () => { I.value = 1, $.value = 0, _.x = 1, _.y = 1, x(f), C("afterClose"); }, fe = (P) => { P ? I.value += 0.5 : I.value++, x(f); }, M = (P) => { I.value > 1 && (P ? I.value -= 0.5 : I.value--), x(f); }, K = () => { $.value += 90; }, G = () => { $.value -= 90; }, ie = () => { _.x = -_.x; }, Se = () => { _.y = -_.y; }, $e = (P) => { P.preventDefault(), P.stopPropagation(), z.value > 0 && oe(J.value[z.value - 1]); }, Ce = (P) => { P.preventDefault(), P.stopPropagation(), z.value < F.value - 1 && oe(J.value[z.value + 1]); }, be = (0, m.default)({ [`${u.prefixCls}-moving`]: U.value }), ge = `${u.prefixCls}-operations-operation`, Ee = `${u.prefixCls}-operations-icon`, Ae = [{ icon: A, onClick: V, type: "close" }, { icon: N, onClick: () => fe(), type: "zoomIn" }, { icon: E, onClick: () => M(), type: "zoomOut", disabled: (0, e.computed)(() => I.value === 1) }, { icon: b, onClick: K, type: "rotateRight" }, { icon: y, onClick: G, type: "rotateLeft" }, { icon: D, onClick: ie, type: "flipX" }, { icon: T, onClick: Se, type: "flipY" }], we = () => { if (u.visible && U.value) { const P = B.value.offsetWidth * I.value, W = B.value.offsetHeight * I.value, { left: ee, top: ae } = (0, g.getOffset)(B.value), te = $.value % 180 !== 0; U.value = !1; const re = (0, s.default)(te ? W : P, te ? P : W, ee, ae); re && x((0, d.default)({}, re)); } }, je = (P) => { P.button === 0 && (P.preventDefault(), P.stopPropagation(), Q.deltaX = P.pageX - R.x, Q.deltaY = P.pageY - R.y, Q.originX = R.x, Q.originY = R.y, U.value = !0); }, Me = (P) => { u.visible && U.value && x({ x: P.pageX - Q.deltaX, y: P.pageY - Q.deltaY }); }, Le = (P) => { if (!u.visible) return; P.preventDefault(); const W = P.deltaY; H.value = { wheelDirection: W }; }, Te = (P) => { !u.visible || !me.value || (P.preventDefault(), P.keyCode === t.default.LEFT ? z.value > 0 && oe(J.value[z.value - 1]) : P.keyCode === t.default.RIGHT && z.value < F.value - 1 && oe(J.value[z.value + 1])); }, Ve = () => { u.visible && (I.value !== 1 && (I.value = 1), (R.x !== f.x || R.y !== f.y) && x(f)); }; let de = () => { }; return (0, e.onMounted)(() => { (0, e.watch)([() => u.visible, U], () => { de(); let P, W; const ee = (0, w.default)(window, "mouseup", we, !1), ae = (0, w.default)(window, "mousemove", Me, !1), te = (0, w.default)(window, "wheel", Le, { passive: !1 }), re = (0, w.default)(window, "keydown", Te, !1); try { window.top !== window.self && (P = (0, w.default)(window.top, "mouseup", we, !1), W = (0, w.default)(window.top, "mousemove", Me, !1)); } catch (he) { (0, i.warning)(!1, `[vc-image] ${he}`); } de = () => { ee.remove(), ae.remove(), te.remove(), re.remove(), P && P.remove(), W && W.remove(); }; }, { flush: "post", immediate: !0 }), (0, e.watch)([H], () => { const { wheelDirection: P } = H.value; P > 0 ? M(!0) : P < 0 && fe(!0); }); }), (0, e.onUnmounted)(() => { de(); }), () => { const { visible: P, prefixCls: W, rootClassName: ee } = u; return (0, e.createVNode)(h.default, (0, v.default)((0, v.default)({}, O), {}, { transitionName: u.transitionName, maskTransitionName: u.maskTransitionName, closable: !1, keyboard: !0, prefixCls: W, onClose: V, afterClose: ce, visible: P, wrapClassName: be, rootClassName: ee, getContainer: u.getContainer }), { default: () => [(0, e.createVNode)("div", { class: [`${u.prefixCls}-operations-wrapper`, ee] }, [(0, e.createVNode)("ul", { class: `${u.prefixCls}-operations` }, [Ae.map((ae) => { let { icon: te, onClick: re, type: he, disabled: Ie } = ae; return (0, e.createVNode)("li", { class: (0, m.default)(ge, { [`${u.prefixCls}-operations-operation-disabled`]: Ie && (Ie == null ? void 0 : Ie.value) }), onClick: re, key: he }, [(0, e.cloneVNode)(te, { class: Ee })]); })])]), (0, e.createVNode)("div", { class: `${u.prefixCls}-img-wrapper`, style: { transform: `translate3d(${R.x}px, ${R.y}px, 0)` } }, [(0, e.createVNode)("img", { onMousedown: je, onDblclick: Ve, ref: B, class: `${u.prefixCls}-img`, src: qe.value, alt: u.alt, style: { transform: `scale3d(${_.x * I.value}, ${_.y * I.value}, 1) rotate(${$.value}deg)` } }, null)]), me.value && (0, e.createVNode)("div", { class: (0, m.default)(`${u.prefixCls}-switch-left`, { [`${u.prefixCls}-switch-left-disabled`]: z.value <= 0 }), onClick: $e }, [L]), me.value && (0, e.createVNode)("div", { class: (0, m.default)(`${u.prefixCls}-switch-right`, { [`${u.prefixCls}-switch-right-disabled`]: z.value >= F.value - 1 }), onClick: Ce }, [q])] }); }; } }); return le.default = S, le; } var it; function Je() { if (it) return Y; it = 1; var o = ne; Object.defineProperty(Y, "__esModule", { value: !0 }), Y.mergeDefaultValue = Y.imageProps = Y.default = void 0; var e = Z, v = o(ye()), d = o(se()), m = o(Mt()), h = o(He()), l = o(Lt()), g = Xe(), w = o(gt()), t = o(ht()), i = s(Qe()); function a(c) { if (typeof WeakMap != "function") return null; var C = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(); return (a = function(y) { return y ? O : C; })(c); } function s(c, C) { if (!C && c && c.__esModule) return c; if (c === null || typeof c != "object" && typeof c != "function") return { default: c }; var O = a(C); if (O && O.has(c)) return O.get(c); var y = {}, b = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var N in c) if (N !== "default" && Object.prototype.hasOwnProperty.call(c, N)) { var E = b ? Object.getOwnPropertyDescriptor(c, N) : null; E && (E.get || E.set) ? Object.defineProperty(y, N, E) : y[N] = c[N]; } return y.default = c, O && O.set(c, y), y; } var r = function(c, C) { var O = {}; for (var y in c) Object.prototype.hasOwnProperty.call(c, y) && C.indexOf(y) < 0 && (O[y] = c[y]); if (c != null && typeof Object.getOwnPropertySymbols == "function") for (var b = 0, y = Object.getOwnPropertySymbols(c); b < y.length; b++) C.indexOf(y[b]) < 0 && Object.prototype.propertyIsEnumerable.call(c, y[b]) && (O[y[b]] = c[y[b]]); return O; }; const f = () => ({ src: String, wrapperClassName: String, wrapperStyle: { type: Object, default: void 0 }, rootClassName: String, prefixCls: String, previewPrefixCls: String, previewMask: { type: [Boolean, Function], default: void 0 }, placeholder: l.default.any, fallback: String, preview: { type: [Boolean, Object], default: !0 }, onClick: { type: Function }, onError: { type: Function } }); Y.imageProps = f; const n = (c, C) => { const O = (0, d.default)({}, c); return Object.keys(C).forEach((y) => { c[y] === void 0 && (O[y] = C[y]); }), O; }; Y.mergeDefaultValue = n; let p = 0; const S = (0, e.defineComponent)({ compatConfig: { MODE: 3 }, name: "VcImage", inheritAttrs: !1, props: f(), emits: ["click", "error"], setup(c, C) { let { attrs: O, slots: y, emit: b } = C; const N = (0, e.computed)(() => c.prefixCls), E = (0, e.computed)(() => `${N.value}-preview`), A = (0, e.computed)(() => { const M = { visible: void 0, onVisibleChange: () => { }, getContainer: void 0 }; return typeof c.preview == "object" ? n(c.preview, M) : M; }), L = (0, e.computed)(() => { var M; return (M = A.value.src) !== null && M !== void 0 ? M : c.src; }), q = (0, e.computed)(() => c.placeholder && c.placeholder !== !0 || y.placeholder), D = (0, e.computed)(() => A.value.visible), T = (0, e.computed)(() => A.value.getContainer), I = (0, e.computed)(() => D.value !== void 0), $ = (M, K) => { var G, ie; (ie = (G = A.value).onVisibleChange) === null || ie === void 0 || ie.call(G, M, K); }, [_, R] = (0, w.default)(!!D.value, { value: D, onChange: $ }), x = (0, e.ref)(q.value ? "loading" : "normal"); (0, e.watch)(() => c.src, () => { x.value = q.value ? "loading" : "normal"; }); const V = (0, e.ref)(null), B = (0, e.computed)(() => x.value === "error"), Q = i.context.inject(), { isPreviewGroup: U, setCurrent: De, setShowPreview: pe, setMousePosition: Pe, registerImage: _e } = Q, oe = (0, e.ref)(p++), F = (0, e.computed)(() => c.preview && !B.value), J = () => { x.value = "normal"; }, z = (M) => { x.value = "error", b("error", M); }, qe = (M) => { if (!I.value) { const { left: K, top: G } = (0, g.getOffset)(M.target); U.value ? (De(oe.value), Pe({ x: K, y: G })) : V.value = { x: K, y: G }; } U.value ? pe(!0) : R(!0), b("click", M); }, me = () => { R(!1), I.value || (V.value = null); }, H = (0, e.ref)(null); (0, e.watch)(() => H, () => { x.value === "loading" && H.value.complete && (H.value.naturalWidth || H.value.naturalHeight) && J(); }); let ce = () => { }; (0, e.onMounted)(() => { (0, e.watch)([L, F], () => { if (ce(), !U.value) return () => { }; ce = _e(oe.value, L.value, F.value), F.value || ce(); }, { flush: "post", immediate: !0 }); }), (0, e.onUnmounted)(() => { ce(); }); const fe = (M) => (0, m.default)(M) ? M + "px" : M; return () => { const { prefixCls: M, wrapperClassName: K, fallback: G, src: ie, placeholder: Se, wrapperStyle: $e, rootClassName: Ce } = c, { width: be, height: ge, crossorigin: Ee, decoding: Ae, alt: we, sizes: je, srcset: Me, usemap: Le, class: Te, style: Ve } = O, de = A.value, { icons: P, maskClassName: W } = de, ee = r(de, ["icons", "maskClassName"]), ae = (0, h.default)(M, K, Ce, { [`${M}-error`]: B.value }), te = B.value && G ? G : L.value, re = { crossorigin: Ee, decoding: Ae, alt: we, sizes: je, srcset: Me, usemap: Le, width: be, height: ge, class: (0, h.default)(`${M}-img`, { [`${M}-img-placeholder`]: Se === !0 }, Te), style: (0, d.default)({ height: fe(ge) }, Ve) }; return (0, e.createVNode)(e.Fragment, null, [(0, e.createVNode)("div", { class: ae, onClick: F.value ? qe : (he) => { b("click", he); }, style: (0, d.default)({ width: fe(be), height: fe(ge) }, $e) }, [(0, e.createVNode)("img", (0, v.default)((0, v.default)((0, v.default)({}, re), B.value && G ? { src: G } : { onLoad: J, onError: z, src: ie }), {}, { ref: H }), null), x.value === "loading" && (0, e.createVNode)("div", { "aria-hidden": "true", class: `${M}-placeholder` }, [Se || y.placeholder && y.placeholder()]), y.previewMask && F.value && (0, e.createVNode)("div", { class: [`${M}-mask`, W] }, [y.previewMask()])]), !U.value && F.value && (0, e.createVNode)(t.default, (0, v.default)((0, v.default)({}, ee), {}, { "aria-hidden": !_.value, visible: _.value, prefixCls: E.value, onClose: me, mousePosition: V.value, src: te, alt: we, getContainer: T.value, icons: P, rootClassName: Ce }), null)]); }; } }); S.PreviewGroup = i.default; var u = S; return Y.default = u, Y; } var at; function Jt() { return at || (at = 1, function(o) { Object.defineProperty(o, "__esModule", { value: !0 }); var e = {}; o.default = void 0; var v = m(Je()); Object.keys(v).forEach(function(l) { l === "default" || l === "__esModule" || Object.prototype.hasOwnProperty.call(e, l) || l in o && o[l] === v[l] || Object.defineProperty(o, l, { enumerable: !0, get: function() { return v[l]; } }); }); function d(l) { if (typeof WeakMap != "function") return null; var g = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(); return (d = function(t) { return t ? w : g; })(l); } function m(l, g) { if (!g && l && l.__esModule) return l; if (l === null || typeof l != "object" && typeof l != "function") return { default: l }; var w = d(g); if (w && w.has(l)) return w.get(l); var t = {}, i = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var a in l) if (a !== "default" && Object.prototype.hasOwnProperty.call(l, a)) { var s = i ? Object.getOwnPropertyDescriptor(l, a) : null; s && (s.get || s.set) ? Object.defineProperty(t, a, s) : t[a] = l[a]; } return t.default = l, w && w.set(l, t), t; } var h = v.default; o.default = h; }(We)), We; } var ue = {}, Ue = {}, lt; function Kt() { return lt || (lt = 1, function(o) { Object.defineProperty(o, "__esModule", { value: !0 }), o.default = void 0; var e = Z, v = m(It()), d = m(Oe()); function m(t) { return t && t.__esModule ? t : { default: t }; } function h(t) { for (var i = 1; i < arguments.length; i++) { var a = arguments[i] != null ? Object(arguments[i]) : {}, s = Object.keys(a); typeof Object.getOwnPropertySymbols == "function" && (s = s.concat(Object.getOwnPropertySymbols(a).filter(function(r) { return Object.getOwnPropertyDescriptor(a, r).enumerable; }))), s.forEach(function(r) { l(t, r, a[r]); }); } return t; } function l(t, i, a) { return i in t ? Object.defineProperty(t, i, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[i] = a, t; } var g = function(i, a) { var s = h({}, i, a.attrs); return (0, e.createVNode)(d.default, h({}, s, { icon: v.default }), null); }; g.displayName = "RotateLeftOutlined", g.inheritAttrs = !1; var w = g; o.default = w; }(Ue)), Ue; } var Fe = {}, ut; function er() { return ut || (ut = 1, function(o) { Object.defineProperty(o, "__esModule", { value: !0 }), o.default = void 0; var e = Z, v = m(xt()), d = m(Oe()); function m(t) { return t && t.__esModule ? t : { default: t }; } function h(t) { for (var i = 1; i < arguments.length; i++) { var a = arguments[i] != null ? Object(arguments[i]) : {}, s = Object.keys(a); typeof Object.getOwnPropertySymbols == "function" && (s = s.concat(Object.getOwnPropertySymbols(a).filter(function(r) { return Object.getOwnPropertyDescriptor(a, r).enumerable; }))), s.forEach(function(r) { l(t, r, a[r]); }); } return t; } function l(t, i, a) { return i in t ? Object.defineProperty(t, i, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[i] = a, t; } var g = function(i, a) { var s = h({}, i, a.attrs); return (0, e.createVNode)(d.default, h({}, s, { icon: v.default }), null); }; g.displayName = "RotateRightOutlined", g.inheritAttrs = !1; var w = g; o.default = w; }(Fe)), Fe; } var ke = {}, st; function tr() { return st || (st = 1, function(o) { Object.defineProperty(o, "__esModule", { value: !0 }), o.default = void 0; var e = Z, v = m(Nt()), d = m(Oe()); function m(t) { return t && t.__esModule ? t : { default: t }; } function h(t) { for (var i = 1; i < arguments.length; i++) { var a = arguments[i] != null ? Object(arguments[i]) : {}, s = Object.keys(a); typeof Object.getOwnPropertySymbols == "function" && (s = s.concat(Object.getOwnPropertySymbols(a).filter(function(r) { return Object.getOwnPropertyDescriptor(a, r).enumerable; }))), s.forEach(function(r) { l(t, r, a[r]); }); } return t; } function l(t, i, a) { return i in t ? Object.defineProperty(t, i, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[i] = a, t; } var g = function(i, a) { var s = h({}, i, a.attrs); return (0, e.createVNode)(d.default, h({}, s, { icon: v.default }), null); }; g.displayName = "ZoomInOutlined", g.inheritAttrs = !1; var w = g; o.default = w; }(ke)), ke; } var Ze = {}, ct; function rr() { return ct || (ct = 1, function(o) { Object.defineProperty(o, "__esModule", { value: !0 }), o.default = void 0; var e = Z, v = m(Rt()), d = m(Oe()); function m(t) { return t && t.__esModule ? t : { default: t }; } function h(t) { for (var i = 1; i < arguments.length; i++) { var a = arguments[i] != null ? Object(arguments[i]) : {}, s = Object.keys(a); typeof Object.getOwnPropertySymbols == "function" && (s = s.concat(Object.getOwnPropertySymbols(a).filter(function(r) { return Object.getOwnPropertyDescriptor(a, r).enumerable; }))), s.forEach(function(r) { l(t, r, a[r]); }); } return t; } function l(t, i, a) { return i in t ? Object.defineProperty(t, i, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[i] = a, t; } var g = function(i, a) { var s = h({}, i, a.attrs); return (0, e.createVNode)(d.default, h({}, s, { icon: v.default }), null); }; g.displayName = "ZoomOutOutlined", g.inheritAttrs = !1; var w = g; o.default = w; }(Ze)), Ze; } var Be = {}, Re = {}, ft; function nr() { if (ft) return Re; ft = 1, Object.defineProperty(Re, "__esModule", { value: !0 }); var o = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, name: "swap", theme: "outlined" }; return Re.default = o, Re; } var dt; function or() { return dt || (dt = 1, function(o) { Object.defineProperty(o, "__esModule", { value: !0 }), o.default = void 0; var e = Z, v = m(nr()), d = m(Oe()); function m(t) { return t && t.__esModule ? t : { default: t }; } function h(t) { for (var i = 1; i < arguments.length; i++) { var a = arguments[i] != null ? Object(arguments[i]) : {}, s = Object.keys(a); typeof Object.getOwnPropertySymbols == "function" && (s = s.concat(Object.getOwnPropertySymbols(a).filter(function(r) { return Object.getOwnPropertyDescriptor(a, r).enumerable; }))), s.forEach(function(r) { l(t, r, a[r]); }); } return t; } function l(t, i, a) { return i in t ? Object.defineProperty(t, i, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[i] = a, t; } var g = function(i, a) { var s = h({}, i, a.attrs); return (0, e.createVNode)(d.default, h({}, s, { icon: v.default }), null); }; g.displayName = "SwapOutlined", g.inheritAttrs = !1; var w = g; o.default = w; }(Be)), Be; } var j = {}, vt; function yt() { if (vt) return j; vt = 1; var o = ne; Object.defineProperty(j, "__esModule", { value: !0 }), j.genPreviewSwitchStyle = j.genPreviewOperationsStyle = j.genImagePreviewStyle = j.genImageMaskStyle = j.genBoxStyle = j.default = void 0; var e = o(se()); qt(); var v = bt, d = zt(), m = Bt(), h = $t(), l = Et(); const g = (n) => ({ position: n || "absolute", inset: 0 }); j.genBoxStyle = g; const w = (n) => { const { iconCls: p, motionDurationSlow: S, paddingXXS: u, marginXXS: c, prefixCls: C } = n; return { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", color: "#fff", background: new v.TinyColor("#000").setAlpha(0.5).toRgbString(), cursor: "pointer", opacity: 0, transition: `opacity ${S}`, [`.${C}-mask-info`]: (0, e.default)((0, e.default)({}, l.textEllipsis), { padding: `0 ${u}px`, [p]: { marginInlineEnd: c, svg: { verticalAlign: "baseline" } } }) }; }; j.genImageMaskStyle = w; const t = (n) => { const { previewCls: p, modalMaskBg: S, paddingSM: u, previewOperationColorDisabled: c, motionDurationSlow: C } = n, O = new v.TinyColor(S).setAlpha(0.1), y = O.clone().setAlpha(0.2); return { [`${p}-operations`]: (0, e.default)((0, e.default)({}, (0, l.resetComponent)(n)), { display: "flex", flexDirection: "row-reverse", alignItems: "center", color: n.previewOperationColor, listStyle: "none", background: O.toRgbString(), pointerEvents: "auto", "&-operation": { marginInlineStart: u, padding: u, cursor: "pointer", transition: `all ${C}`, userSelect: "none", "&:hover": { background: y.toRgbString() }, "&-disabled": { color: c, pointerEvents: "none" }, "&:last-of-type": { marginInlineStart: 0 } }, "&-progress": { position: "absolute", left: { _skip_check_: !0, value: "50%" }, transform: "translateX(-50%)" }, "&-icon": { fontSize: n.previewOperationSize } }) }; }; j.genPreviewOperationsStyle = t; const i = (n) => { const { modalMaskBg: p, iconCls: S, previewOperationColorDisabled: u, previewCls: c, zIndexPopup: C, motionDurationSlow: O } = n, y = new v.TinyColor(p).setAlpha(0.1), b = y.clone().setAlpha(0.2); return { [`${c}-switch-left, ${c}-switch-right`]: { position: "fixed", insetBlockStart: "50%", zIndex: C + 1, display: "flex", alignItems: "center", justifyContent: "center", width: n.imagePreviewSwitchSize, height: n.imagePreviewSwitchSize, marginTop: -n.imagePreviewSwitchSize / 2, color: n.previewOperationColor, background: y.toRgbString(), borderRadius: "50%", transform: "translateY(-50%)", cursor: "pointer", transition: `all ${O}`, pointerEvents: "auto", userSelect: "none", "&:hover": { background: b.toRgbString() }, "&-disabled": { "&, &:hover": { color: u, background: "transparent", cursor: "not-allowed", [`> ${S}`]: { cursor: "not-allowed" } } }, [`> ${S}`]: { fontSize: n.previewOperationSize } }, [`${c}-switch-left`]: { insetInlineStart: n.marginSM }, [`${c}-switch-right`]: { insetInlineEnd: n.marginSM } }; }; j.genPreviewSwitchStyle = i; const a = (n) => { const { motionEaseOut: p, previewCls: S, motionDurationSlow: u, componentCls: c } = n; return [ { [`${c}-preview-root`]: { [S]: { height: "100%", textAlign: "center", pointerEvents: "none" }, [`${S}-body`]: (0, e.default)((0, e.default)({}, g()), { overflow: "hidden" }), [`${S}-img`]: { maxWidth: "100%", maxHeight: "100%", verticalAlign: "middle", transform: "scale3d(1, 1, 1)", cursor: "grab", transition: `transform ${u} ${p} 0s`, userSelect: "none", pointerEvents: "auto", "&-wrapper": (0, e.default)((0, e.default)({}, g()), { transition: `transform ${u} ${p} 0s`, // https://github.com/ant-design/ant-design/issues/39913 // TailwindCSS will reset img default style. // Let's set back. display: "flex", justifyContent: "center", alignItems: "center", "&::before": { display: "inline-block", width: 1, height: "50%", marginInlineEnd: -1, content: '""' } }) }, [`${S}-moving`]: { [`${S}-preview-img`]: { cursor: "grabbing", "&-wrapper": { transitionDuration: "0s" } } } } }, // Override { [`${c}-preview-root`]: { [`${S}-wrap`]: { zIndex: n.zIndexPopup } } }, // Preview operations & switch { [`${c}-preview-operations-wrapper`]: { position: "fixed", insetBlockStart: 0, insetInlineEnd: 0, zIndex: n.zIndexPopup + 1, width: "100%" }, "&": [t(n), i(n)] } ]; }; j.genImagePreviewStyle = a; const s = (n) => { const { componentCls: p } = n; return { // ============================== image ============================== [p]: { position: "relative", display: "inline-block", [`${p}-img`]: { width: "100%", height: "auto", verticalAlign: "middle" }, [`${p}-img-placeholder`]: { backgroundColor: n.colorBgContainerDisabled, backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')", backgroundRepeat: "no-repeat", backgroundPosition: "center center", backgroundSize: "30%" }, [`${p}-mask`]: (0, e.default)({}, w(n)), [`${p}-mask:hover`]: { opacity: 1 }, [`${p}-placeholder`]: (0, e.default)({}, g()) } }; }, r = (n) => { const { previewCls: p } = n; return { [`${p}-root`]: (0, m.initZoomMotion)(n, "zoom"), "&": (0, m.initFadeMotion)(n, !0) }; }; var f = (0, h.genComponentStyleHook)("Image", (n) => { const p = `${n.componentCls}-preview`, S = (0, h.mergeToken)(n, { previewCls: p, modalMaskBg: new v.TinyColor("#000").setAlpha(0.45).toRgbString(), imagePreviewSwitchSize: n.controlHeightLG }); return [s(S), a(S), (0, d.genModalMaskStyle)((0, h.mergeToken)(S, { componentCls: p })), r(S)]; }, (n) => ({ zIndexPopup: n.zIndexPopupBase + 80, previewOperationColor: new v.TinyColor(n.colorTextLightSolid).toRgbString(), previewOperationColorDisabled: new v.TinyColor(n.colorTextLightSolid).setAlpha(0.25).toRgbString(), previewOperationSize: n.fontSizeIcon * 1.5 // FIXME: fontSizeIconLG })); return j.default = f, j; } var pt; function ir() { if (pt) return ue; pt = 1; var o = ne; Object.defineProperty(ue, "__esModule", { value: !0 }), ue.icons = ue.default = void 0; var e = Z, v = o(ye()), d = o(se()), m = o(Qe()), h = o(mt()), l = o(Kt()), g = o(er()), w = o(tr()), t = o(rr()), i = o(Ft()), a = o(kt()), s = o(Zt()), r = o(or()), f = wt(), n = o(yt()), p = At(); const S = { rotateLeft: (0, e.createVNode)(l.default, null, null), rotateRight: (0, e.createVNode)(g.default, null, null), zoomIn: (0, e.createVNode)(w.default, null, null), zoomOut: (0, e.createVNode)(t.default, null, null), close: (0, e.createVNode)(i.default, null, null), left: (0, e.createVNode)(a.default, null, null), right: (0, e.createVNode)(s.default, null, null), flipX: (0, e.createVNode)(r.default, null, null), flipY: (0, e.createVNode)(r.default, { rotate: 90 }, null) }; ue.icons = S; const u = () => ({ previewPrefixCls: String, preview: (0, p.anyType)() }); var C = (0, e.defineComponent)({ compatConfig: { MODE: 3 }, name: "AImagePreviewGroup", inheritAttrs: !1, props: u(), setup(O, y) { let { attrs: b, slots: N } = y; const { prefixCls: E, rootPrefixCls: A } = (0, h.default)("image", O), L = (0, e.computed)(() => `${E.value}-preview`), [q, D] = (0, n.default)(E), T = (0, e.computed)(() => { const { preview: I } = O; if (I === !1) return I; const $ = typeof I == "object" ? I : {}; return (0, d.default)((0, d.default)({}, $), { rootClassName: D.value, transitionName: (0, f.getTransitionName)(A.value, "zoom", $.transitionName), maskTransitionName: (0, f.getTransitionName)(A.value, "fade", $.maskTransitionName) }); }); return () => q((0, e.createVNode)(m.default, (0, v.default)((0, v.default)({}, (0, d.default)((0, d.default)({}, b), O)), {}, { preview: T.value, icons: S, previewPrefixCls: L.value }), N)); } }); return ue.default = C, ue; } (function(o) { var e = ne; Object.defineProperty(o, "__esModule", { value: !0 }), Object.defineProperty(o, "ImagePreviewGroup", { enumerable: !0, get: function() { return t.default; } }), o.default = void 0, Object.defineProperty(o, "imageProps", { enumerable: !0, get: function() { return l.imageProps; } }); var v = Z, d = e(ye()), m = e(se()), h = e(Jt()), l = Je(), g = e(jt()), w = e(mt()), t = n(ir()), i = e(Ht()), a = wt(), s = e(yt()), r = e(He()); function f(u) { if (typeof WeakMap != "function") return null; var c = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(); return (f = function(O) { return O ? C : c; })(u); } function n(u, c) { if (!c && u && u.__esModule) return u; if (u === null || typeof u != "object" && typeof u != "function") return { default: u }; var C = f(c); if (C && C.has(u)) return C.get(u); var O = {}, y = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var b in u) if (b !== "default" && Object.prototype.hasOwnProperty.call(u, b)) { var N = y ? Object.getOwnPropertyDescriptor(u, b) : null; N && (N.get || N.set) ? Object.defineProperty(O, b, N) : O[b] = u[b]; } return O.default = u, C && C.set(u, O), O; } const p = (0, v.defineComponent)({ name: "AImage", inheritAttrs: !1, props: (0, l.imageProps)(), setup(u, c) { let { slots: C, attrs: O } = c; const { prefixCls: y, rootPrefixCls: b, configProvider: N } = (0, w.default)("image", u), [E, A] = (0, s.default)(y), L = (0, v.computed)(() => { const { preview: q } = u; if (q === !1) return q; const D = typeof q == "object" ? q : {}; return (0, m.default)((0, m.default)({ icons: t.icons }, D), { transitionName: (0, a.getTransitionName)(b.value, "zoom", D.transitionName), maskTransitionName: (0, a.getTransitionName)(b.value, "fade", D.maskTransitionName) }); }); return () => { var q, D; const T = ((D = (q = N.locale) === null || q === void 0 ? void 0 : q.value) === null || D === void 0 ? void 0 : D.Image) || g.default.Image, I = () => (0, v.createVNode)("div", { class: `${y.value}-mask-info` }, [(0, v.createVNode)(i.default, null, null), T == null ? void 0 : T.preview]), { previewMask: $ = C.previewMask || I } = u; return E((0, v.createVNode)(h.default, (0, d.default)((0, d.default)({}, (0, m.default)((0, m.default)((0, m.default)({}, O), u), { prefixCls: y.value })), {}, { preview: L.value, rootClassName: (0, r.default)(u.rootClassName, A.value) }), (0, m.default)((0, m.default)({}, C), { previewMask: typeof $ == "function" ? $ : null }))); }; } }); p.PreviewGroup = t.default, p.install = function(u) { return u.component(p.name, p), u.component(p.PreviewGroup.name, p.PreviewGroup), u; }; var S = p; o.default = S; })(Ye); const ar = /* @__PURE__ */ Ct(Ye), lr = /* @__PURE__ */ Yt({ __proto__: null, default: ar }, [Ye]), xn = Ot({ props: { modelValue: { type: Array, default: () => [] } }, emits: ["update:modelValue"], setup(o, { emit: e, attrs: v }) { const d = ze([]), m = ze(""), h = ze(!1), l = (r) => { h.value = r; }; Ke(d, (r) => { e("update:modelValue", r); }), Ke( () => o.modelValue, (r) => { if (r != null && r.length > 0 && d.value != null) { if (d.value === r) return; d.value.length = 0, d.value.push(...r); } }, { deep: !0, immediate: !0 } ); function g(r) { _t(() => { d.value = r; }); } const w = (r) => {