var xt = Object.defineProperty, St = Object.defineProperties; var $t = Object.getOwnPropertyDescriptors; var Le = Object.getOwnPropertySymbols; var wt = Object.prototype.hasOwnProperty, Tt = Object.prototype.propertyIsEnumerable; var ke = (e, t, o) => t in e ? xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, pe = (e, t) => { for (var o in t || (t = {})) wt.call(t, o) && ke(e, o, t[o]); if (Le) for (var o of Le(t)) Tt.call(t, o) && ke(e, o, t[o]); return e; }, Oe = (e, t) => St(e, $t(t)); import { defineComponent as ee, ref as T, computed as Q, createVNode as a, Transition as Je, withDirectives as Ze, vShow as et, nextTick as tt, shallowRef as L, watch as j, onBeforeUnmount as ot, watchEffect as nt, Fragment as Ae, render as _e, unref as Ie, isRef as lt, toRefs as Bt, customRef as Pt, getCurrentScope as Ft, onScopeDispose as Ot, useAttrs as Mt, resolveComponent as we, openBlock as D, createBlock as ne, mergeProps as At, withCtx as N, createElementVNode as de, createElementBlock as le, renderList as We, createCommentVNode as Z, renderSlot as Ve, normalizeStyle as Ht, resolveDynamicComponent as zt, createTextVNode as ue, toDisplayString as ae } from "vue"; import It from "./ModalHeader.js"; import { d3 as Nt, cy as at, P as E, _ as P, bb as it, d as f, cL as Rt, c as ye, o as rt, i as Be, d4 as Et, K as je, d5 as Dt, bR as Lt, g as kt, m as _t, bD as Wt, r as Vt, cJ as jt, cP as Gt, b4 as Ne, u as Kt, br as st, a4 as Te, bV as Xt, B as He, d6 as Yt, e as ge, d7 as Ut, a as Qt, bf as qt, be as Jt, bg as Zt, d8 as eo, d9 as to, da as oo, d1 as no, db as lo, dc as ao, b6 as io, n as ro, aB as so } from "./index2.js"; import { A as Ge } from "./ActionButton.js"; import { T as co, _ as uo } from "./index13.js"; import { _ as fo, S as mo } from "./index12.js"; import { S as vo } from "./index9.js"; const po = new at("antFadeIn", { "0%": { opacity: 0 }, "100%": { opacity: 1 } }), go = new at("antFadeOut", { "0%": { opacity: 1 }, "100%": { opacity: 0 } }), yo = function(e) { let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; const { antCls: o } = e, n = `${o}-fade`, l = t ? "&" : ""; return [Nt(n, po, go, e.motionDurationMid, t), { [` ${l}${n}-enter, ${l}${n}-appear `]: { opacity: 0, animationTimingFunction: "linear" }, [`${l}${n}-leave`]: { animationTimingFunction: "linear" } }]; }; function Re() { return { keyboard: { type: Boolean, default: void 0 }, mask: { type: Boolean, default: void 0 }, afterClose: Function, closable: { type: Boolean, default: void 0 }, maskClosable: { type: Boolean, default: void 0 }, visible: { type: Boolean, default: void 0 }, destroyOnClose: { type: Boolean, default: void 0 }, mousePosition: E.shape({ x: Number, y: Number }).loose, title: E.any, footer: E.any, transitionName: String, maskTransitionName: String, animation: E.any, maskAnimation: E.any, wrapStyle: { type: Object, default: void 0 }, bodyStyle: { type: Object, default: void 0 }, maskStyle: { type: Object, default: void 0 }, prefixCls: String, wrapClassName: String, rootClassName: String, width: [String, Number], height: [String, Number], zIndex: Number, bodyProps: E.any, maskProps: E.any, wrapProps: E.any, getContainer: E.any, dialogStyle: { type: Object, default: void 0 }, dialogClass: String, closeIcon: E.any, forceRender: { type: Boolean, default: void 0 }, getOpenCount: Function, // https://github.com/ant-design/ant-design/issues/19771 // https://github.com/react-component/dialog/issues/95 focusTriggerAfterClose: { type: Boolean, default: void 0 }, onClose: Function, modalRender: Function }; } function Ke(e, t, o) { let n = t; return !n && o && (n = `${e}-${o}`), n; } let Xe = -1; function Co() { return Xe += 1, Xe; } function Ye(e, t) { let o = e[`page${t ? "Y" : "X"}Offset`]; const n = `scroll${t ? "Top" : "Left"}`; if (typeof o != "number") { const l = e.document; o = l.documentElement[n], typeof o != "number" && (o = l.body[n]); } return o; } function bo(e) { const t = e.getBoundingClientRect(), o = { left: t.left, top: t.top }, n = e.ownerDocument, l = n.defaultView || n.parentWindow; return o.left += Ye(l), o.top += Ye(l, !0), o; } const ho = { width: 0, height: 0, overflow: "hidden", outline: "none" }, xo = { outline: "none" }, So = ee({ compatConfig: { MODE: 3 }, name: "DialogContent", inheritAttrs: !1, props: f(f({}, Re()), { motionName: String, ariaId: String, onVisibleChanged: Function, onMousedown: Function, onMouseup: Function }), setup(e, t) { let { expose: o, slots: n, attrs: l } = t; const i = T(), p = T(), m = T(); o({ focus: () => { var s; (s = i.value) === null || s === void 0 || s.focus({ preventScroll: !0 }); }, changeActive: (s) => { const { activeElement: r } = document; s && r === p.value ? i.value.focus({ preventScroll: !0 }) : !s && r === i.value && p.value.focus({ preventScroll: !0 }); } }); const S = T(), v = Q(() => { const { width: s, height: r } = e, g = {}; return s !== void 0 && (g.width = typeof s == "number" ? `${s}px` : s), r !== void 0 && (g.height = typeof r == "number" ? `${r}px` : r), S.value && (g.transformOrigin = S.value), g; }), d = () => { tt(() => { if (m.value) { const s = bo(m.value); S.value = e.mousePosition ? `${e.mousePosition.x - s.left}px ${e.mousePosition.y - s.top}px` : ""; } }); }, u = (s) => { e.onVisibleChanged(s); }; return () => { var s, r, g, x; const { prefixCls: $, footer: c = (s = n.footer) === null || s === void 0 ? void 0 : s.call(n), title: h = (r = n.title) === null || r === void 0 ? void 0 : r.call(n), ariaId: y, closable: B, closeIcon: O = (g = n.closeIcon) === null || g === void 0 ? void 0 : g.call(n), onClose: A, bodyStyle: z, bodyProps: C, onMousedown: F, onMouseup: M, visible: w, modalRender: H = n.modalRender, destroyOnClose: X, motionName: G } = e; let Y; c && (Y = a("div", { class: `${$}-footer` }, [c])); let k; h && (k = a("div", { class: `${$}-header` }, [a("div", { class: `${$}-title`, id: y }, [h])])); let I; B && (I = a("button", { type: "button", onClick: A, "aria-label": "Close", class: `${$}-close` }, [O || a("span", { class: `${$}-close-x` }, null)])); const W = a("div", { class: `${$}-content` }, [I, k, a("div", P({ class: `${$}-body`, style: z }, C), [(x = n.default) === null || x === void 0 ? void 0 : x.call(n)]), Y]), me = it(G); return a(Je, P(P({}, me), {}, { onBeforeEnter: d, onAfterEnter: () => u(!0), onAfterLeave: () => u(!1) }), { default: () => [w || !X ? Ze(a("div", P(P({}, l), {}, { ref: m, key: "dialog-element", role: "document", style: [v.value, l.style], class: [$, l.class], onMousedown: F, onMouseup: M }), [a("div", { tabindex: 0, ref: i, style: xo }, [H ? H({ originVNode: W }) : W]), a("div", { tabindex: 0, ref: p, style: ho }, null)]), [[et, w]]) : null] }); }; } }), $o = ee({ compatConfig: { MODE: 3 }, name: "DialogMask", props: { prefixCls: String, visible: Boolean, motionName: String, maskProps: Object }, setup(e, t) { return () => { const { prefixCls: o, visible: n, maskProps: l, motionName: i } = e, p = it(i); return a(Je, p, { default: () => [Ze(a("div", P({ class: `${o}-mask` }, l), null), [[et, n]])] }); }; } }), Ue = ee({ compatConfig: { MODE: 3 }, name: "VcDialog", inheritAttrs: !1, props: Be(f(f({}, Re()), { getOpenCount: Function, scrollLocker: Object }), { mask: !0, visible: !1, keyboard: !0, closable: !0, maskClosable: !0, destroyOnClose: !1, prefixCls: "rc-dialog", getOpenCount: () => null, focusTriggerAfterClose: !0 }), setup(e, t) { let { attrs: o, slots: n } = t; const l = L(), i = L(), p = L(), m = L(e.visible), S = L(`vcDialogTitle${Co()}`), v = (c) => { var h, y; if (c) Et(i.value, document.activeElement) || (l.value = document.activeElement, (h = p.value) === null || h === void 0 || h.focus()); else { const B = m.value; if (m.value = !1, e.mask && l.value && e.focusTriggerAfterClose) { try { l.value.focus({ preventScroll: !0 }); } catch (O) { } l.value = null; } B && ((y = e.afterClose) === null || y === void 0 || y.call(e)); } }, d = (c) => { var h; (h = e.onClose) === null || h === void 0 || h.call(e, c); }, u = L(!1), s = L(), r = () => { clearTimeout(s.value), u.value = !0; }, g = () => { s.value = setTimeout(() => { u.value = !1; }); }, x = (c) => { if (!e.maskClosable) return null; u.value ? u.value = !1 : i.value === c.target && d(c); }, $ = (c) => { if (e.keyboard && c.keyCode === je.ESC) { c.stopPropagation(), d(c); return; } e.visible && c.keyCode === je.TAB && p.value.changeActive(!c.shiftKey); }; return j(() => e.visible, () => { e.visible && (m.value = !0); }, { flush: "post" }), ot(() => { var c; clearTimeout(s.value), (c = e.scrollLocker) === null || c === void 0 || c.unLock(); }), nt(() => { var c, h; (c = e.scrollLocker) === null || c === void 0 || c.unLock(), m.value && ((h = e.scrollLocker) === null || h === void 0 || h.lock()); }), () => { const { prefixCls: c, mask: h, visible: y, maskTransitionName: B, maskAnimation: O, zIndex: A, wrapClassName: z, rootClassName: C, wrapStyle: F, closable: M, maskProps: w, maskStyle: H, transitionName: X, animation: G, wrapProps: Y, title: k = n.title } = e, { style: I, class: W } = o; return a("div", P({ class: [`${c}-root`, C] }, Rt(e, { data: !0 })), [a($o, { prefixCls: c, visible: h && y, motionName: Ke(c, B, O), style: f({ zIndex: A }, H), maskProps: w }, null), a("div", P({ tabIndex: -1, onKeydown: $, class: ye(`${c}-wrap`, z), ref: i, onClick: x, role: "dialog", "aria-labelledby": k ? S.value : null, style: f(f({ zIndex: A }, F), { display: m.value ? null : "none" }) }, Y), [a(So, P(P({}, rt(e, ["scrollLocker"])), {}, { style: I, class: W, onMousedown: r, onMouseup: g, ref: p, closable: M, ariaId: S.value, prefixCls: c, visible: y, onClose: d, onVisibleChanged: v, motionName: Ke(c, X, G) }), n)])]); }; } }), wo = Re(), To = ee({ compatConfig: { MODE: 3 }, name: "DialogWrap", inheritAttrs: !1, props: Be(wo, { visible: !1 }), setup(e, t) { let { attrs: o, slots: n } = t; const l = T(e.visible); return Dt({}, { inTriggerContext: !1 }), j(() => e.visible, () => { e.visible && (l.value = !0); }, { flush: "post" }), () => { const { visible: i, getContainer: p, forceRender: m, destroyOnClose: S = !1, afterClose: v } = e; let d = f(f(f({}, e), o), { ref: "_component", key: "dialog" }); return p === !1 ? a(Ue, P(P({}, d), {}, { getOpenCount: () => 2 }), n) : !m && S && !l.value ? null : a(Lt, { autoLock: !0, visible: i, forceRender: m, getContainer: p }, { default: (u) => (d = f(f(f({}, d), u), { afterClose: () => { v == null || v(), l.value = !1; } }), a(Ue, d, n)) }); }; } }); function Qe(e) { return { position: e, top: 0, insetInlineEnd: 0, bottom: 0, insetInlineStart: 0 }; } const Bo = (e) => { const { componentCls: t } = e; return [{ [`${t}-root`]: { [`${t}${e.antCls}-zoom-enter, ${t}${e.antCls}-zoom-appear`]: { // reset scale avoid mousePosition bug transform: "none", opacity: 0, animationDuration: e.motionDurationSlow, // https://github.com/ant-design/ant-design/issues/11777 userSelect: "none" }, [`${t}${e.antCls}-zoom-leave ${t}-content`]: { pointerEvents: "none" }, [`${t}-mask`]: f(f({}, Qe("fixed")), { zIndex: e.zIndexPopupBase, height: "100%", backgroundColor: e.colorBgMask, [`${t}-hidden`]: { display: "none" } }), [`${t}-wrap`]: f(f({}, Qe("fixed")), { overflow: "auto", outline: 0, WebkitOverflowScrolling: "touch" }) } }, { [`${t}-root`]: yo(e) }]; }, Po = (e) => { const { componentCls: t } = e; return [ // ======================== Root ========================= { [`${t}-root`]: { [`${t}-wrap`]: { zIndex: e.zIndexPopupBase, position: "fixed", inset: 0, overflow: "auto", outline: 0, WebkitOverflowScrolling: "touch" }, [`${t}-wrap-rtl`]: { direction: "rtl" }, [`${t}-centered`]: { textAlign: "center", "&::before": { display: "inline-block", width: 0, height: "100%", verticalAlign: "middle", content: '""' }, [t]: { top: 0, display: "inline-block", paddingBottom: 0, textAlign: "start", verticalAlign: "middle" } }, [`@media (max-width: ${e.screenSMMax})`]: { [t]: { maxWidth: "calc(100vw - 16px)", margin: `${e.marginXS} auto` }, [`${t}-centered`]: { [t]: { flex: 1 } } } } }, // ======================== Modal ======================== { [t]: f(f({}, Vt(e)), { pointerEvents: "none", position: "relative", top: 100, width: "auto", maxWidth: `calc(100vw - ${e.margin * 2}px)`, margin: "0 auto", paddingBottom: e.paddingLG, [`${t}-title`]: { margin: 0, color: e.modalHeadingColor, fontWeight: e.fontWeightStrong, fontSize: e.modalHeaderTitleFontSize, lineHeight: e.modalHeaderTitleLineHeight, wordWrap: "break-word" }, [`${t}-content`]: { position: "relative", backgroundColor: e.modalContentBg, backgroundClip: "padding-box", border: 0, borderRadius: e.borderRadiusLG, boxShadow: e.boxShadowSecondary, pointerEvents: "auto", padding: `${e.paddingMD}px ${e.paddingContentHorizontalLG}px` }, [`${t}-close`]: f({ position: "absolute", top: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2, insetInlineEnd: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2, zIndex: e.zIndexPopupBase + 10, padding: 0, color: e.modalCloseColor, fontWeight: e.fontWeightStrong, lineHeight: 1, textDecoration: "none", background: "transparent", borderRadius: e.borderRadiusSM, width: e.modalConfirmIconSize, height: e.modalConfirmIconSize, border: 0, outline: 0, cursor: "pointer", transition: `color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`, "&-x": { display: "block", fontSize: e.fontSizeLG, fontStyle: "normal", lineHeight: `${e.modalCloseBtnSize}px`, textAlign: "center", textTransform: "none", textRendering: "auto" }, "&:hover": { color: e.modalIconHoverColor, backgroundColor: e.wireframe ? "transparent" : e.colorFillContent, textDecoration: "none" }, "&:active": { backgroundColor: e.wireframe ? "transparent" : e.colorFillContentHover } }, jt(e)), [`${t}-header`]: { color: e.colorText, background: e.modalHeaderBg, borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`, marginBottom: e.marginXS }, [`${t}-body`]: { fontSize: e.fontSize, lineHeight: e.lineHeight, wordWrap: "break-word" }, [`${t}-footer`]: { textAlign: "end", background: e.modalFooterBg, marginTop: e.marginSM, [`${e.antCls}-btn + ${e.antCls}-btn:not(${e.antCls}-dropdown-trigger)`]: { marginBottom: 0, marginInlineStart: e.marginXS } }, [`${t}-open`]: { overflow: "hidden" } }) }, // ======================== Pure ========================= { [`${t}-pure-panel`]: { top: "auto", padding: 0, display: "flex", flexDirection: "column", [`${t}-content, ${t}-body, ${t}-confirm-body-wrapper`]: { display: "flex", flexDirection: "column", flex: "auto" }, [`${t}-confirm-body`]: { marginBottom: "auto" } } } ]; }, Fo = (e) => { const { componentCls: t } = e, o = `${t}-confirm`; return { [o]: { "&-rtl": { direction: "rtl" }, [`${e.antCls}-modal-header`]: { display: "none" }, [`${o}-body-wrapper`]: f({}, Gt()), [`${o}-body`]: { display: "flex", flexWrap: "wrap", alignItems: "center", [`${o}-title`]: { flex: "0 0 100%", display: "block", // create BFC to avoid // https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png overflow: "hidden", color: e.colorTextHeading, fontWeight: e.fontWeightStrong, fontSize: e.modalHeaderTitleFontSize, lineHeight: e.modalHeaderTitleLineHeight, [`+ ${o}-content`]: { marginBlockStart: e.marginXS, flexBasis: "100%", maxWidth: `calc(100% - ${e.modalConfirmIconSize + e.marginSM}px)` } }, [`${o}-content`]: { color: e.colorText, fontSize: e.fontSize }, [`> ${e.iconCls}`]: { flex: "none", marginInlineEnd: e.marginSM, fontSize: e.modalConfirmIconSize, [`+ ${o}-title`]: { flex: 1 }, // `content` after `icon` should set marginLeft [`+ ${o}-title + ${o}-content`]: { marginInlineStart: e.modalConfirmIconSize + e.marginSM } } }, [`${o}-btns`]: { textAlign: "end", marginTop: e.marginSM, [`${e.antCls}-btn + ${e.antCls}-btn`]: { marginBottom: 0, marginInlineStart: e.marginXS } } }, [`${o}-error ${o}-body > ${e.iconCls}`]: { color: e.colorError }, [`${o}-warning ${o}-body > ${e.iconCls}, ${o}-confirm ${o}-body > ${e.iconCls}`]: { color: e.colorWarning }, [`${o}-info ${o}-body > ${e.iconCls}`]: { color: e.colorInfo }, [`${o}-success ${o}-body > ${e.iconCls}`]: { color: e.colorSuccess }, // https://github.com/ant-design/ant-design/issues/37329 [`${t}-zoom-leave ${t}-btns`]: { pointerEvents: "none" } }; }, Oo = (e) => { const { componentCls: t } = e; return { [`${t}-root`]: { [`${t}-wrap-rtl`]: { direction: "rtl", [`${t}-confirm-body`]: { direction: "rtl" } } } }; }, Mo = (e) => { const { componentCls: t, antCls: o } = e, n = `${t}-confirm`; return { [t]: { [`${t}-content`]: { padding: 0 }, [`${t}-header`]: { padding: e.modalHeaderPadding, borderBottom: `${e.modalHeaderBorderWidth}px ${e.modalHeaderBorderStyle} ${e.modalHeaderBorderColorSplit}`, marginBottom: 0 }, [`${t}-body`]: { padding: e.modalBodyPadding }, [`${t}-footer`]: { padding: `${e.modalFooterPaddingVertical}px ${e.modalFooterPaddingHorizontal}px`, borderTop: `${e.modalFooterBorderWidth}px ${e.modalFooterBorderStyle} ${e.modalFooterBorderColorSplit}`, borderRadius: `0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`, marginTop: 0 } }, [n]: { [`${o}-modal-body`]: { padding: `${e.padding * 2}px ${e.padding * 2}px ${e.paddingLG}px` }, [`${n}-body`]: { [`> ${e.iconCls}`]: { marginInlineEnd: e.margin, // `content` after `icon` should set marginLeft [`+ ${n}-title + ${n}-content`]: { marginInlineStart: e.modalConfirmIconSize + e.margin } } }, [`${n}-btns`]: { marginTop: e.marginLG } } }; }, Ao = kt("Modal", (e) => { const t = e.padding, o = e.fontSizeHeading5, n = e.lineHeightHeading5, l = _t(e, { modalBodyPadding: e.paddingLG, modalHeaderBg: e.colorBgElevated, modalHeaderPadding: `${t}px ${e.paddingLG}px`, modalHeaderBorderWidth: e.lineWidth, modalHeaderBorderStyle: e.lineType, modalHeaderTitleLineHeight: n, modalHeaderTitleFontSize: o, modalHeaderBorderColorSplit: e.colorSplit, modalHeaderCloseSize: n * o + t * 2, modalContentBg: e.colorBgElevated, modalHeadingColor: e.colorTextHeading, modalCloseColor: e.colorTextDescription, modalFooterBg: "transparent", modalFooterBorderColorSplit: e.colorSplit, modalFooterBorderStyle: e.lineType, modalFooterPaddingVertical: e.paddingXS, modalFooterPaddingHorizontal: e.padding, modalFooterBorderWidth: e.lineWidth, modalConfirmTitleFontSize: e.fontSizeLG, modalIconHoverColor: e.colorIconHover, modalConfirmIconSize: e.fontSize * e.lineHeight, modalCloseBtnSize: e.controlHeightLG * 0.55 }); return [Po(l), Fo(l), Oo(l), Bo(l), e.wireframe && Mo(l), Wt(l, "zoom")]; }); var Ho = function(e, t) { var o = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, n = Object.getOwnPropertySymbols(e); l < n.length; l++) t.indexOf(n[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[l]) && (o[n[l]] = e[n[l]]); return o; }; let ze; const zo = (e) => { ze = { x: e.pageX, y: e.pageY }, setTimeout(() => ze = null, 100); }; Ut() && Qt(document.documentElement, "click", zo, !0); const Io = () => ({ prefixCls: String, /** @deprecated Please use `open` instead. */ visible: { type: Boolean, default: void 0 }, open: { type: Boolean, default: void 0 }, confirmLoading: { type: Boolean, default: void 0 }, title: E.any, closable: { type: Boolean, default: void 0 }, closeIcon: E.any, onOk: Function, onCancel: Function, "onUpdate:visible": Function, "onUpdate:open": Function, onChange: Function, afterClose: Function, centered: { type: Boolean, default: void 0 }, width: [String, Number], footer: E.any, okText: E.any, okType: String, cancelText: E.any, icon: E.any, maskClosable: { type: Boolean, default: void 0 }, forceRender: { type: Boolean, default: void 0 }, okButtonProps: ge(), cancelButtonProps: ge(), destroyOnClose: { type: Boolean, default: void 0 }, wrapClassName: String, maskTransitionName: String, transitionName: String, getContainer: { type: [String, Function, Boolean, Object], default: void 0 }, zIndex: Number, bodyStyle: ge(), maskStyle: ge(), mask: { type: Boolean, default: void 0 }, keyboard: { type: Boolean, default: void 0 }, wrapProps: Object, focusTriggerAfterClose: { type: Boolean, default: void 0 }, modalRender: Function, mousePosition: ge() }), _ = ee({ compatConfig: { MODE: 3 }, name: "AModal", inheritAttrs: !1, props: Be(Io(), { width: 520, confirmLoading: !1, okType: "primary" }), setup(e, t) { let { emit: o, slots: n, attrs: l } = t; const [i] = Ne("Modal"), { prefixCls: p, rootPrefixCls: m, direction: S, getPopupContainer: v } = Kt("modal", e), [d, u] = Ao(p); st(e.visible === void 0, "Modal", "`visible` will be removed in next major version, please use `open` instead."); const s = (x) => { o("update:visible", !1), o("update:open", !1), o("cancel", x), o("change", !1); }, r = (x) => { o("ok", x); }, g = () => { var x, $; const { okText: c = (x = n.okText) === null || x === void 0 ? void 0 : x.call(n), okType: h, cancelText: y = ($ = n.cancelText) === null || $ === void 0 ? void 0 : $.call(n), confirmLoading: B } = e; return a(Ae, null, [a(He, P({ onClick: s }, e.cancelButtonProps), { default: () => [y || i.value.cancelText] }), a(He, P(P({}, Yt(h)), {}, { loading: B, onClick: r }, e.okButtonProps), { default: () => [c || i.value.okText] })]); }; return () => { var x, $; const { prefixCls: c, visible: h, open: y, wrapClassName: B, centered: O, getContainer: A, closeIcon: z = (x = n.closeIcon) === null || x === void 0 ? void 0 : x.call(n), focusTriggerAfterClose: C = !0 } = e, F = Ho(e, ["prefixCls", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose"]), M = ye(B, { [`${p.value}-centered`]: !!O, [`${p.value}-wrap-rtl`]: S.value === "rtl" }); return d(a(To, P(P(P({}, F), l), {}, { rootClassName: u.value, class: ye(u.value, l.class), getContainer: A || (v == null ? void 0 : v.value), prefixCls: p.value, wrapClassName: M, visible: y != null ? y : h, onClose: s, focusTriggerAfterClose: C, transitionName: Te(m.value, "zoom", e.transitionName), maskTransitionName: Te(m.value, "fade", e.maskTransitionName), mousePosition: ($ = F.mousePosition) !== null && $ !== void 0 ? $ : ze }), f(f({}, n), { footer: n.footer || g, closeIcon: () => a("span", { class: `${p.value}-close-x` }, [z || a(Xt, { class: `${p.value}-close-icon` }, null)]) }))); }; } }); function fe(e) { return typeof e == "function" ? e() : e; } const ct = ee({ name: "ConfirmDialog", inheritAttrs: !1, props: ["icon", "onCancel", "onOk", "close", "closable", "zIndex", "afterClose", "visible", "open", "keyboard", "centered", "getContainer", "maskStyle", "okButtonProps", "cancelButtonProps", "okType", "prefixCls", "okCancel", "width", "mask", "maskClosable", "okText", "cancelText", "autoFocusButton", "transitionName", "maskTransitionName", "type", "title", "content", "direction", "rootPrefixCls", "bodyStyle", "closeIcon", "modalRender", "focusTriggerAfterClose", "wrapClassName", "confirmPrefixCls", "footer"], setup(e, t) { let { attrs: o } = t; const [n] = Ne("Modal"); return process.env.NODE_ENV !== "production" && st(e.visible === void 0, "Modal", "`visible` is deprecated, please use `open` instead."), () => { const { icon: l, onCancel: i, onOk: p, close: m, okText: S, closable: v = !1, zIndex: d, afterClose: u, keyboard: s, centered: r, getContainer: g, maskStyle: x, okButtonProps: $, cancelButtonProps: c, okCancel: h, width: y = 416, mask: B = !0, maskClosable: O = !1, type: A, open: z, title: C, content: F, direction: M, closeIcon: w, modalRender: H, focusTriggerAfterClose: X, rootPrefixCls: G, bodyStyle: Y, wrapClassName: k, footer: I } = e; let W = l; if (!l && l !== null) switch (A) { case "info": W = a(eo, null, null); break; case "success": W = a(Zt, null, null); break; case "error": W = a(Jt, null, null); break; default: W = a(qt, null, null); } const me = e.okType || "primary", U = e.prefixCls || "ant-modal", te = `${U}-confirm`, Pe = o.style || {}, re = h != null ? h : A === "confirm", be = e.autoFocusButton === null ? !1 : e.autoFocusButton || "ok", se = `${U}-confirm`, Fe = ye(se, `${se}-${e.type}`, { [`${se}-rtl`]: M === "rtl" }, o.class), ve = n.value, he = re && a(Ge, { actionFn: i, close: m, autofocus: be === "cancel", buttonProps: c, prefixCls: `${G}-btn` }, { default: () => [fe(e.cancelText) || ve.cancelText] }); return a(_, { prefixCls: U, class: Fe, wrapClassName: ye({ [`${se}-centered`]: !!r }, k), onCancel: (b) => m == null ? void 0 : m({ triggerCancel: !0 }, b), open: z, title: "", footer: "", transitionName: Te(G, "zoom", e.transitionName), maskTransitionName: Te(G, "fade", e.maskTransitionName), mask: B, maskClosable: O, maskStyle: x, style: Pe, bodyStyle: Y, width: y, zIndex: d, afterClose: u, keyboard: s, centered: r, getContainer: g, closable: v, closeIcon: w, modalRender: H, focusTriggerAfterClose: X }, { default: () => [a("div", { class: `${te}-body-wrapper` }, [a("div", { class: `${te}-body` }, [fe(W), C === void 0 ? null : a("span", { class: `${te}-title` }, [fe(C)]), a("div", { class: `${te}-content` }, [fe(F)])]), I !== void 0 ? fe(I) : a("div", { class: `${te}-btns` }, [he, a(Ge, { type: me, actionFn: p, close: m, autofocus: be === "ok", buttonProps: $, prefixCls: `${G}-btn` }, { default: () => [fe(S) || (re ? ve.okText : ve.justOkText)] })])])] }); }; } }), ie = [], Ce = (e) => { const t = document.createDocumentFragment(); let o = f(f({}, rt(e, ["parentContext", "appContext"])), { close: i, open: !0 }), n = null; function l() { n && (_e(null, t), n = null); for (var v = arguments.length, d = new Array(v), u = 0; u < v; u++) d[u] = arguments[u]; const s = d.some((r) => r && r.triggerCancel); e.onCancel && s && e.onCancel(() => { }, ...d.slice(1)); for (let r = 0; r < ie.length; r++) if (ie[r] === i) { ie.splice(r, 1); break; } } function i() { for (var v = arguments.length, d = new Array(v), u = 0; u < v; u++) d[u] = arguments[u]; o = f(f({}, o), { open: !1, afterClose: () => { typeof e.afterClose == "function" && e.afterClose(), l.apply(this, d); } }), o.visible && delete o.visible, p(o); } function p(v) { typeof v == "function" ? o = v(o) : o = f(f({}, o), v), n && to(n, o, t); } const m = (v) => { const d = oo, u = d.prefixCls, s = v.prefixCls || `${u}-modal`, r = d.iconPrefixCls, g = lo(); return a(no, P(P({}, d), {}, { prefixCls: u }), { default: () => [a(ct, P(P({}, v), {}, { rootPrefixCls: u, prefixCls: s, iconPrefixCls: r, locale: g, cancelText: v.cancelText || g.cancelText }), null)] }); }; function S(v) { const d = a(m, f({}, v)); return d.appContext = e.parentContext || e.appContext || d.appContext, _e(d, t), d; } return n = S(o), ie.push(i), { destroy: i, update: p }; }; function dt(e) { return f(f({}, e), { type: "warning" }); } function ut(e) { return f(f({}, e), { type: "info" }); } function ft(e) { return f(f({}, e), { type: "success" }); } function mt(e) { return f(f({}, e), { type: "error" }); } function vt(e) { return f(f({}, e), { type: "confirm" }); } const No = () => ({ config: Object, afterClose: Function, destroyAction: Function, open: Boolean }), Ro = ee({ name: "HookModal", inheritAttrs: !1, props: Be(No(), { config: { width: 520, okType: "primary" } }), setup(e, t) { let { expose: o } = t; var n; const l = Q(() => e.open), i = Q(() => e.config), { direction: p, getPrefixCls: m } = ao(), S = m("modal"), v = m(), d = () => { var g, x; e == null || e.afterClose(), (x = (g = i.value).afterClose) === null || x === void 0 || x.call(g); }, u = function() { e.destroyAction(...arguments); }; o({ destroy: u }); const s = (n = i.value.okCancel) !== null && n !== void 0 ? n : i.value.type === "confirm", [r] = Ne("Modal", io.Modal); return () => a(ct, P(P({ prefixCls: S, rootPrefixCls: v }, i.value), {}, { close: u, open: l.value, afterClose: d, okText: i.value.okText || (s ? r == null ? void 0 : r.value.okText : r == null ? void 0 : r.value.justOkText), direction: i.value.direction || p.value, cancelText: i.value.cancelText || (r == null ? void 0 : r.value.cancelText) }), null); } }); let qe = 0; const Eo = ee({ name: "ElementsHolder", inheritAttrs: !1, setup(e, t) { let { expose: o } = t; const n = L([]); return o({ addModal: (i) => (n.value.push(i), n.value = n.value.slice(), () => { n.value = n.value.filter((p) => p !== i); }) }), () => n.value.map((i) => i()); } }); function Do() { const e = L(null), t = L([]); j(t, () => { t.value.length && ([...t.value].forEach((p) => { p(); }), t.value = []); }, { immediate: !0 }); const o = (i) => function(m) { var S; qe += 1; const v = L(!0), d = L(null), u = L(Ie(m)), s = L({}); j(() => m, (y) => { $(f(f({}, lt(y) ? y.value : y), s.value)); }); const r = function() { v.value = !1; for (var y = arguments.length, B = new Array(y), O = 0; O < y; O++) B[O] = arguments[O]; const A = B.some((z) => z && z.triggerCancel); u.value.onCancel && A && u.value.onCancel(() => { }, ...B.slice(1)); }; let g; const x = () => a(Ro, { key: `modal-${qe}`, config: i(u.value), ref: d, open: v.value, destroyAction: r, afterClose: () => { g == null || g(); } }, null); g = (S = e.value) === null || S === void 0 ? void 0 : S.addModal(x), g && ie.push(g); const $ = (y) => { u.value = f(f({}, u.value), y); }; return { destroy: () => { d.value ? r() : t.value = [...t.value, r]; }, update: (y) => { s.value = y, d.value ? $(y) : t.value = [...t.value, () => $(y)]; } }; }, n = Q(() => ({ info: o(ut), success: o(ft), error: o(mt), warning: o(dt), confirm: o(vt) })), l = Symbol("modalHolderKey"); return [n.value, () => a(Eo, { key: l, ref: e }, null)]; } function pt(e) { return Ce(dt(e)); } _.useModal = Do; _.info = function(t) { return Ce(ut(t)); }; _.success = function(t) { return Ce(ft(t)); }; _.error = function(t) { return Ce(mt(t)); }; _.warning = pt; _.warn = pt; _.confirm = function(t) { return Ce(vt(t)); }; _.destroyAll = function() { for (; ie.length; ) { const t = ie.pop(); t && t(); } }; _.install = function(e) { return e.component(_.name, _), e; }; function Lo(e) { return Ft() ? (Ot(e), !0) : !1; } function R(e) { return typeof e == "function" ? e() : Ie(e); } const gt = typeof window != "undefined" && typeof document != "undefined"; typeof WorkerGlobalScope != "undefined" && globalThis instanceof WorkerGlobalScope; const ko = Object.prototype.toString, _o = (e) => ko.call(e) === "[object Object]", Wo = () => { }; function Vo(e, t = {}) { if (!lt(e)) return Bt(e); const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {}; for (const n in e.value) o[n] = Pt(() => ({ get() { return e.value[n]; }, set(l) { var i; if ((i = R(t.replaceRef)) != null ? i : !0) if (Array.isArray(e.value)) { const m = [...e.value]; m[n] = l, e.value = m; } else { const m = Oe(pe({}, e.value), { [n]: l }); Object.setPrototypeOf(m, Object.getPrototypeOf(e.value)), e.value = m; } else e.value[n] = l; } })); return o; } const yt = gt ? window : void 0; function jo(e) { var t; const o = R(e); return (t = o == null ? void 0 : o.$el) != null ? t : o; } function Me(...e) { let t, o, n, l; if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([o, n, l] = e, t = yt) : [t, o, n, l] = e, !t) return Wo; Array.isArray(o) || (o = [o]), Array.isArray(n) || (n = [n]); const i = [], p = () => { i.forEach((d) => d()), i.length = 0; }, m = (d, u, s, r) => (d.addEventListener(u, s, r), () => d.removeEventListener(u, s, r)), S = j( () => [jo(t), R(l)], ([d, u]) => { if (p(), !d) return; const s = _o(u) ? pe({}, u) : u; i.push( ...o.flatMap((r) => n.map((g) => m(d, r, g, s))) ); }, { immediate: !0, flush: "post" } ), v = () => { S(), p(); }; return Lo(v), v; } function Go(e, t = {}) { var o, n; const { pointerTypes: l, preventDefault: i, stopPropagation: p, exact: m, onMove: S, onEnd: v, onStart: d, initialValue: u, axis: s = "both", draggingElement: r = yt, containerElement: g, handle: x = e, buttons: $ = [0] } = t, c = T( (o = R(u)) != null ? o : { x: 0, y: 0 } ), h = T(), y = (C) => l ? l.includes(C.pointerType) : !0, B = (C) => { R(i) && C.preventDefault(), R(p) && C.stopPropagation(); }, O = (C) => { var F; if (!R($).includes(C.button) || R(t.disabled) || !y(C) || R(m) && C.target !== R(e)) return; const M = R(g), w = (F = M == null ? void 0 : M.getBoundingClientRect) == null ? void 0 : F.call(M), H = R(e).getBoundingClientRect(), X = { x: C.clientX - (M ? H.left - w.left + M.scrollLeft : H.left), y: C.clientY - (M ? H.top - w.top + M.scrollTop : H.top) }; (d == null ? void 0 : d(X, C)) !== !1 && (h.value = X, B(C)); }, A = (C) => { if (R(t.disabled) || !y(C) || !h.value) return; const F = R(g), M = R(e).getBoundingClientRect(); let { x: w, y: H } = c.value; (s === "x" || s === "both") && (w = C.clientX - h.value.x, F && (w = Math.min(Math.max(0, w), F.scrollWidth - M.width))), (s === "y" || s === "both") && (H = C.clientY - h.value.y, F && (H = Math.min(Math.max(0, H), F.scrollHeight - M.height))), c.value = { x: w, y: H }, S == null || S(c.value, C), B(C); }, z = (C) => { R(t.disabled) || !y(C) || h.value && (h.value = void 0, v == null || v(c.value, C), B(C)); }; if (gt) { const C = { capture: (n = t.capture) != null ? n : !0 }; Me(x, "pointerdown", O, C), Me(r, "pointermove", A, C), Me(r, "pointerup", z, C); } return Oe(pe({}, Vo(c)), { position: c, isDragging: Q(() => !!h.value), style: Q( () => `left:${c.value.x}px;top:${c.value.y}px;` ) }); } const Ko = { class: "modalHeader" }, Xo = { key: 0, class: "tabs-wrap" }, Yo = { key: 1, class: "step-wrap", ref: "stepRef" }, Uo = { class: "modal-body-container" }, Qo = /* @__PURE__ */ Object.assign({ name: "SModal" }, { __name: "SModal", props: { loading: { type: Boolean, default: !1 }, centered: { type: Boolean, default: !0 }, maskClosable: { type: Boolean, default: !0 }, mask: { type: Boolean, default: !0 }, topStyle: { type: String, default: "" }, closable: { type: Boolean, default: !0 }, destroyOnClose: { type: Boolean, default: !1 }, keyboardOpen: { type: Boolean, default: !0 }, title: { type: String, default: "" }, value: { type: Boolean, default: !1 }, width: { type: [String, Number], default: "60vw" }, boxHeight: { type: [String, Number], default: 60 }, bodyStyle: { type: Object, default() { return { overflowX: "hidden", overflowY: "auto" }; } }, showFullScreen: { type: Boolean, default: !0 }, tabs: { type: Array, default: () => [] }, tabKey: { type: Object, default: () => ({ label: "label", value: "value" }) }, steps: { type: Array, default: () => [] }, stepDefaultActive: { type: Number, default: 0 }, stepValid: { type: Function, default: void 0 }, saveBtnText: { type: String, default: window.$l("保存") } }, emits: [ "update:value", "handCancel", "afterClose", "tabsChange", "stepCallback", "handSave" ], setup(e, { emit: t }) { const o = e, n = t, l = Mt(), i = T(null), p = T(), { x: m, y: S, isDragging: v } = Go(i), d = T(0), u = T(0), s = T(!1), r = T(0), g = T(0), x = T(0), $ = T(0), c = T({ left: 0, right: 0, top: 0, bottom: 0 }), h = T(null), y = T(null), B = T(o.width), O = T(), A = T(o.value), z = T(8), C = Q(() => o.tabKey && o.tabKey.value || "value"), F = T(""); j(() => o.tabs, () => { const b = o.tabs || []; if (!b.length) { F.value = ""; return; } const V = C.value; b.some((K) => K && K[V] === F.value) || (F.value = b[0][V]); }, { immediate: !0, deep: !0 }); const w = T(0), H = Q(() => w.value === o.steps.length - 1), X = Q(() => ({ transform: `translate(${r.value}px, ${g.value}px)` })), G = T(pe({}, o.bodyStyle)); let Y = -1, k = null, I = null; const W = (b) => { p.value = b, i.value = O.value ? null : b; }, me = () => { const b = h.value; if (!b) return; const V = i.value, K = y.value, q = b.scrollHeight || b.clientHeight; if (!q) return; const xe = (V == null ? void 0 : V.clientHeight) || 0, Se = (K == null ? void 0 : K.clientHeight) || 0, $e = document.body.offsetHeight, J = q + xe + Se + 85 >= $e ? $e - xe - Se - 82 : q; J <= 0 || J === Y || (Y = J, G.value = Object.assign({ height: `${J}px` }, o.bodyStyle)); }, U = () => { tt(() => { k || (k = requestAnimationFrame(() => { k = null, me(); })); }); }, te = () => { B.value = "100vw", O.value = "s-full-modal", i.value = null, r.value = 0, g.value = 0; }, Pe = () => { B.value = o.width, O.value = "", i.value = p.value; }, re = () => { n("update:value", !1), n("handCancel"); }, be = () => { O.value = "", i.value = p.value, B.value = o.width, n("afterClose"); }, se = (b) => { F.value = b, n("tabsChange", b); }; function Fe() { w.value--, n("stepCallback", "prev", w.value); } function ve() { if (!window.$utils.isFunction(o.stepValid)) { w.value++, n("stepCallback", "next", w.value); return; } o.stepValid(w.value).then((b) => { b && (w.value++, n("stepCallback", "next", w.value)); }); } function he() { n("handSave", "save"); } return nt(() => { s.value && (r.value = x.value + Math.min(Math.max(c.value.left, m.value), c.value.right) - d.value, g.value = $.value + Math.min(Math.max(c.value.top, S.value), c.value.bottom) - u.value); }), j([m, S], () => { var b, V; if (!s.value) { d.value = m.value, u.value = S.value; const K = document.body.getBoundingClientRect(), q = (V = (b = i.value) == null ? void 0 : b.getBoundingClientRect()) != null ? V : { width: 0, height: 0 }; c.value.right = K.width - q.width, c.value.bottom = K.height - q.height, x.value = r.value, $.value = g.value; } s.value = !0; }), j(v, () => { v.value || (s.value = !1); }), j(h, (b) => { I && (I.disconnect(), I = null), b && typeof ResizeObserver != "undefined" && (I = new ResizeObserver(() => U()), I.observe(b)), U(); }), j( () => o.value, (b) => { b ? (A.value = !0, U()) : A.value = !1; }, { deep: !0 } ), j( () => A.value, (b) => { b && U(); } ), j( () => o.value, () => { o.value && U(); }, { immediate: !0 } ), ot(() => { I && (I.disconnect(), I = null), k && (cancelAnimationFrame(k), k = null); }), (b, V) => { const K = uo, q = co, xe = mo, Se = fo, $e = so, J = vo, Ee = we("poweroff-outlined"), ce = He, De = we("save-outlined"), Ct = we("arrow-left-outlined"), bt = we("arrow-right-outlined"), ht = _; return D(), ne(ht, At({ open: A.value, "body-style": G.value, width: B.value, centered: e.centered, onCancel: re, afterClose: be, destroyOnClose: e.destroyOnClose, keyboard: e.keyboardOpen, style: e.topStyle, maskClosable: e.maskClosable, mask: e.mask, "wrap-class-name": "s-modal " + O.value }, Ie(l)), { title: N(() => [ de("div", Ko, [ de("div", { ref: W, class: "draggableTitle" }, ae(e.title), 513), a(It, { width: B.value, showFullScreen: e.showFullScreen, onFullScreen: te, onReduction: Pe }, null, 8, ["width", "showFullScreen"]) ]) ]), footer: N(() => [ V[0] || (V[0] = de("div", { class: "footer-top-border" }, null, -1)), b.$slots.footer ? (D(), le("div", { key: 0, ref_key: "footerSlot", ref: y }, [ a(J, { size: z.value }, { default: N(() => [ Ve(b.$slots, "footer", {}, void 0, !0) ]), _: 3 }, 8, ["size"]) ], 512)) : Z("", !0), !b.$slots.footer && (!e.steps || !e.steps.length) ? (D(), le("div", { key: 1, ref_key: "footerSlot", ref: y }, [ a(J, { size: z.value }, { default: N(() => [ a(ce, { onClick: re }, { default: N(() => [ a(Ee), ue(ae(b.$l("关闭")), 1) ]), _: 1 }), a(ce, { type: "primary", onClick: he }, { default: N(() => [ a(De), ue(" " + ae(b.$l(e.saveBtnText)), 1) ]), _: 1 }) ]), _: 1 }, 8, ["size"]) ], 512)) : Z("", !0), e.steps && e.steps.length > 0 ? (D(), le("div", { key: 2, ref_key: "footerSlot", ref: y }, [ a(J, { size: z.value }, { default: N(() => [ a(ce, { onClick: re }, { default: N(() => [ a(Ee), ue(ae(b.$l("关闭")), 1) ]), _: 1 }), e.steps.length ? (D(), ne(ce, { key: 0, disabled: w.value === e.stepDefaultActive, onClick: Fe }, { default: N(() => [ a(Ct), ue(ae(b.$l("上一步")), 1) ]), _: 1 }, 8, ["disabled"])) : Z("", !0), e.steps.length ? (D(), ne(ce, { key: 1, type: "primary", disabled: w.value === e.steps.length - 1, onClick: ve }, { default: N(() => [ a(bt), ue(ae(b.$l("下一步")), 1) ]), _: 1 }, 8, ["disabled"])) : Z("", !0), H.value ? (D(), ne(ce, { key: 2, style: { "margin-right": "8px" }, type: "primary", onClick: he }, { default: N(() => [ a(De), ue(" " + ae(b.$l(e.saveBtnText)), 1) ]), _: 1 })) : Z("", !0) ]), _: 1 }, 8, ["size"]) ], 512)) : Z("", !0) ]), modalRender: N(({ originVNode: oe }) => [ de("div", { style: Ht(X.value) }, [ (D(), ne(zt(oe))) ], 4) ]), default: N(() => [ a($e, { spinning: e.loading }, { default: N(() => [ de("div", { ref_key: "bodySlot", ref: h }, [ e.tabs && e.tabs.length > 0 ? (D(), le("div", Xo, [ a(q, { "active-key": F.value, onChange: se }, { default: N(() => [ (D(!0), le(Ae, null, We(e.tabs, (oe) => (D(), ne(K, { tab: oe[e.tabKey.label], key: oe[C.value] }, null, 8, ["tab"]))), 128)) ]), _: 1 }, 8, ["active-key"]) ])) : Z("", !0), e.steps && e.steps.length ? (D(), le("div", Yo, [ a(Se, { current: w.value, type: "navigation", size: "small" }, { default: N(() => [ (D(!0), le(Ae, null, We(e.steps, (oe) => (D(), ne(xe, { title: oe, key: oe, disabled: !0 }, null, 8, ["title"]))), 128)) ]), _: 1 }, 8, ["current"]) ], 512)) : Z("", !0), de("div", Uo, [ Ve(b.$slots, "default", {}, void 0, !0) ]) ], 512) ]), _: 3 }, 8, ["spinning"]) ]), _: 3 }, 16, ["open", "body-style", "width", "centered", "destroyOnClose", "keyboard", "style", "maskClosable", "mask", "wrap-class-name"]); }; } }), an = /* @__PURE__ */ ro(Qo, [["__scopeId", "data-v-3acd33ae"]]); export { an as default };