zan-layer 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/zan-layer.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as M, computed as I, openBlock as d, createElementBlock as m, normalizeStyle as V, createCommentVNode as p, h as He, renderSlot as ee, createVNode as te, unref as x, withModifiers as re, normalizeClass as N, createElementVNode as B, toDisplayString as P, ref as b, watch as j, onMounted as ye, nextTick as D, Fragment as R, renderList as Ee, shallowRef as lt, withDirectives as ke, vModelText as at, vModelDynamic as ot, useSlots as st, onUnmounted as it, createBlock as A, Teleport as ut, Transition as rt, withCtx as ce, render as Z, isVNode as Se } from "vue";
2
- const ct = /* @__PURE__ */ M({
1
+ import { defineComponent as A, computed as $, openBlock as d, createElementBlock as v, normalizeStyle as N, createCommentVNode as h, h as Me, renderSlot as ee, createVNode as te, unref as z, withModifiers as de, normalizeClass as P, createElementVNode as B, toDisplayString as T, ref as g, watch as J, onMounted as he, nextTick as D, Fragment as W, renderList as De, shallowRef as rt, withDirectives as Se, vModelText as ut, vModelDynamic as ct, useSlots as dt, onUnmounted as ft, createBlock as M, Teleport as mt, Transition as vt, withCtx as fe, render as Z, isVNode as Ie } from "vue";
2
+ const yt = /* @__PURE__ */ A({
3
3
  name: "Shade",
4
4
  __name: "Shade",
5
5
  props: {
@@ -12,7 +12,7 @@ const ct = /* @__PURE__ */ M({
12
12
  },
13
13
  emits: ["shadeClick"],
14
14
  setup(e, { emit: n }) {
15
- const l = e, t = n, a = I(() => [
15
+ const l = e, t = n, o = $(() => [
16
16
  {
17
17
  opacity: l.opacity,
18
18
  position: l.teleportDisabled || l.teleport != "body" ? "absolute" : "fixed",
@@ -22,30 +22,30 @@ const ct = /* @__PURE__ */ M({
22
22
  ]), i = () => {
23
23
  t("shadeClick");
24
24
  };
25
- return (c, o) => e.visible ? (d(), m("div", {
25
+ return (u, a) => e.visible ? (d(), v("div", {
26
26
  key: 0,
27
27
  class: "zan-layer-shade",
28
- style: V(a.value),
28
+ style: N(o.value),
29
29
  onClick: i
30
- }, null, 4)) : p("", !0);
30
+ }, null, 4)) : h("", !0);
31
31
  }
32
- }), dt = ["src"], ft = /* @__PURE__ */ M({
32
+ }), pt = ["src"], ht = /* @__PURE__ */ A({
33
33
  name: "Iframe",
34
34
  __name: "Iframe",
35
35
  props: {
36
36
  src: {}
37
37
  },
38
38
  setup(e) {
39
- const n = e, l = I(() => n.src);
40
- return (t, a) => (d(), m("iframe", {
39
+ const n = e, l = $(() => n.src);
40
+ return (t, o) => (d(), v("iframe", {
41
41
  scrolling: "auto",
42
42
  class: "zan-layer-iframe",
43
43
  allowtransparency: "true",
44
44
  frameborder: "0",
45
45
  src: l.value
46
- }, null, 8, dt));
46
+ }, null, 8, pt));
47
47
  }
48
- }), oe = M({
48
+ }), ie = A({
49
49
  name: "ZanRender",
50
50
  props: {
51
51
  render: {
@@ -57,25 +57,29 @@ const ct = /* @__PURE__ */ M({
57
57
  return () => e.render();
58
58
  }
59
59
  }), ne = function(e) {
60
- return typeof e == "function" ? e() : typeof e == "string" ? He("span", e) : e;
60
+ return typeof e == "function" ? e() : typeof e == "string" ? Me("span", e) : e;
61
61
  };
62
- function Me() {
62
+ function Pe() {
63
63
  const e = [], n = "0123456789abcdef";
64
64
  for (let t = 0; t < 36; t++)
65
65
  e[t] = n.substr(Math.floor(Math.random() * 16), 1);
66
66
  return e[14] = "4", e[19] = n.substr(e[19] & 3 | 8, 1), e[8] = e[13] = e[18] = e[23] = "-", e.join("").replaceAll("-", "");
67
67
  }
68
- function mt(e, n, l) {
69
- return e != "drawer" && e != 4 ? vt(n) : Ae(l, n);
68
+ function gt(e, n, l) {
69
+ return e != "drawer" && e != 4 ? xt(n) : Ne(l, n);
70
70
  }
71
- function vt(e) {
72
- return e === void 0 || e === "auto" ? [] : typeof e == "string" ? [e] : e[1] && e[1] === "auto" ? e[0] && e[0] === "auto" ? [] : [e[0]] : e[0] && e[0] === "auto" ? e[1] && e[1] != "auto" ? [void 0, e[1]] : [] : [...e];
71
+ function xt(e) {
72
+ return e == null || e === "auto" ? [] : typeof e == "string" ? [e] : e[1] && e[1] === "auto" ? e[0] && e[0] === "auto" ? [] : [e[0]] : e[0] && e[0] === "auto" ? e[1] && e[1] != "auto" ? [void 0, e[1]] : [] : [...e];
73
73
  }
74
- function Ae(e, n = "30%") {
75
- return n instanceof Array ? n : (n === "auto" && (n = "30%"), e === "l" || e === "r" || e === "lt" || e === "lb" || e === "rt" || e === "rb" ? [n, "100%"] : e === "t" || e === "b" || e === "tr" || e === "tl" || e === "br" || e === "bl" ? ["100%", n] : [n, "100%"]);
74
+ function Ne(e, n = "30%") {
75
+ return n == null && (n = "30%"), n instanceof Array ? n : (n === "auto" && (n = "30%"), e === "l" || e === "r" || e === "lt" || e === "lb" || e === "rt" || e === "rb" ? [n, "100%"] : e === "t" || e === "b" || e === "tr" || e === "tl" || e === "br" || e === "bl" ? ["100%", n] : [n, "100%"]);
76
76
  }
77
- function de(e = "auto", n, l) {
78
- const t = [
77
+ function $e(e) {
78
+ return e == null || e === "" ? "0px" : e;
79
+ }
80
+ function me(e = "auto", n, l) {
81
+ e == null && (e = "auto");
82
+ const t = Array.isArray(n) ? n : [], o = $e(t[0]), i = $e(t[1]), u = [
79
83
  "t",
80
84
  "r",
81
85
  "b",
@@ -89,117 +93,117 @@ function de(e = "auto", n, l) {
89
93
  "rb",
90
94
  "br"
91
95
  ], a = [];
92
- return e === "auto" && l == 4 && (e = "r"), typeof e == "string" ? t.indexOf(e) > -1 ? (e === "t" && (a[0] = "0px", a[1] = "calc(50% - " + n[0] + "/2)"), e === "l" && (a[0] = "calc(50% - " + n[1] + "/2)", a[1] = "0px"), e === "b" && (a[0] = "calc(100% - " + n[1] + ")", a[1] = "calc(50% - " + n[0] + "/2)"), e === "r" && (a[0] = "calc(50% - " + n[1] + "/2)", a[1] = "calc(100% - " + n[0] + ")"), (e === "lt" || e === "tl") && (a[0] = "0px", a[1] = "0px"), (e === "lb" || e === "bl") && (a[0] = "calc(100% - " + n[1] + ")", a[1] = "0px"), (e === "rt" || e === "tr") && (a[0] = "0px", a[1] = "calc(100% - " + n[0] + ")"), (e === "rb" || e === "br") && (a[0] = "calc(100% - " + n[1] + ")", a[1] = "calc(100% - " + n[0] + ")")) : e == "auto" ? (a[0] = "calc(50% - " + n[1] + "/2)", a[1] = "calc(50% - " + n[0] + "/2)") : (a[0] = e, a[1] = "calc(50% - " + n[0] + "/2)") : e && e[0] !== void 0 && e[1] !== void 0 ? (a[0] = e[0], a[1] = e[1]) : (a[0] = "calc(50% - " + n[1] + "/2)", a[1] = "calc(50% - " + n[0] + "/2)"), a;
96
+ return e === "auto" && l == 4 && (e = "r"), typeof e == "string" ? u.indexOf(e) > -1 ? (e === "t" && (a[0] = "0px", a[1] = "calc(50% - " + o + "/2)"), e === "l" && (a[0] = "calc(50% - " + i + "/2)", a[1] = "0px"), e === "b" && (a[0] = "calc(100% - " + i + ")", a[1] = "calc(50% - " + o + "/2)"), e === "r" && (a[0] = "calc(50% - " + i + "/2)", a[1] = "calc(100% - " + o + ")"), (e === "lt" || e === "tl") && (a[0] = "0px", a[1] = "0px"), (e === "lb" || e === "bl") && (a[0] = "calc(100% - " + i + ")", a[1] = "0px"), (e === "rt" || e === "tr") && (a[0] = "0px", a[1] = "calc(100% - " + o + ")"), (e === "rb" || e === "br") && (a[0] = "calc(100% - " + i + ")", a[1] = "calc(100% - " + o + ")")) : e == "auto" ? (a[0] = "calc(50% - " + i + "/2)", a[1] = "calc(50% - " + o + "/2)") : (a[0] = e, a[1] = "calc(50% - " + o + "/2)") : e && e[0] !== void 0 && e[1] !== void 0 ? (a[0] = e[0], a[1] = e[1]) : (a[0] = "calc(50% - " + i + "/2)", a[1] = "calc(50% - " + o + "/2)"), a;
93
97
  }
94
- function yt(e) {
98
+ function bt(e) {
95
99
  return e === "dialog" || e == 0 ? 0 : e === "page" || e == 1 ? 1 : e === "iframe" || e == 2 ? 2 : e === "loading" || e == 3 ? 3 : e === "drawer" || e == 4 ? 4 : e === "photos" || e == 5 ? 5 : e === "notify" || e == 6 ? 6 : e === "prompt" || e == 7 ? 7 : 0;
96
100
  }
97
- function Le() {
101
+ function Be() {
98
102
  return { w: "100%", h: "100%" };
99
103
  }
100
- function $e() {
104
+ function Oe() {
101
105
  return { t: "0px", l: "0px" };
102
106
  }
103
- function Ie(e) {
104
- var t, a;
105
- const n = (t = getComputedStyle(e, null)) == null ? void 0 : t.width, l = (a = getComputedStyle(e, null)) == null ? void 0 : a.height;
107
+ function Fe(e) {
108
+ var t, o;
109
+ const n = (t = getComputedStyle(e, null)) == null ? void 0 : t.width, l = (o = getComputedStyle(e, null)) == null ? void 0 : o.height;
106
110
  return [n, l];
107
111
  }
108
- const Q = [];
112
+ const Y = [];
109
113
  function q(e, n) {
110
114
  let l = 0;
111
115
  if (n) {
112
- const t = Q.findIndex((a) => a === void 0);
113
- t === -1 ? (Q.push(e), l = Q.length - 1) : (Q[t] = e, l = t);
116
+ const t = Y.findIndex((o) => o === void 0);
117
+ t === -1 ? (Y.push(e), l = Y.length - 1) : (Y[t] = e, l = t);
114
118
  } else
115
- delete Q[Q.findIndex((t) => t == e)], l = -1;
119
+ delete Y[Y.findIndex((t) => t == e)], l = -1;
116
120
  return l;
117
121
  }
118
- function Be(e, n = !1) {
122
+ function Ee(e, n = !1) {
119
123
  const l = ["rl"], t = "zan-layer-drawer-anim zan-layer-anim";
120
124
  return e === "l" || e === "lt" || e === "lb" ? l[0] = "lr" : e === "r" || e === "rt" || e === "rb" ? l[0] = "rl" : e === "t" || e === "tr" || e === "tl" ? l[0] = "tb" : (e === "b" || e === "br" || e === "bl") && (l[0] = "bt"), n ? `${t}-${l[0]}-close` : `${t}-${l[0]}`;
121
125
  }
122
- async function Oe(e, n) {
126
+ async function He(e, n) {
123
127
  const l = new Image();
124
- return l.src = e, new Promise((a, i) => {
128
+ return l.src = e, new Promise((o, i) => {
125
129
  if (l.complete) {
126
- a(t(l));
130
+ o(t(l));
127
131
  return;
128
132
  }
129
- const c = L.load(2, { shadeOpacity: "0" });
133
+ const u = I.load(2, { shadeOpacity: "0" });
130
134
  l.onload = () => {
131
- L.close(c), a(t(l));
135
+ I.close(u), o(t(l));
132
136
  }, l.onerror = () => {
133
- L.close(c), L.msg("图片加载失败"), i(!1);
137
+ I.close(u), I.msg("图片加载失败"), i(!1);
134
138
  };
135
139
  });
136
- function t(a) {
137
- const i = [a.width, a.height], c = [window.innerWidth - 250, window.innerHeight - 250];
138
- if (i[0] > c[0] || i[1] > c[1]) {
139
- const o = [i[0] / c[0], i[1] / c[1]];
140
- o[0] > o[1] ? (i[0] = i[0] / o[0], i[1] = i[1] / o[0]) : o[0] < o[1] && (i[0] = i[0] / o[1], i[1] = i[1] / o[1]);
140
+ function t(o) {
141
+ const i = [o.width, o.height], u = [window.innerWidth - 250, window.innerHeight - 250];
142
+ if (i[0] > u[0] || i[1] > u[1]) {
143
+ const a = [i[0] / u[0], i[1] / u[1]];
144
+ a[0] > a[1] ? (i[0] = i[0] / a[0], i[1] = i[1] / a[0]) : a[0] < a[1] && (i[0] = i[0] / a[1], i[1] = i[1] / a[1]);
141
145
  }
142
146
  return [i[0] + "px", i[1] + "px"];
143
147
  }
144
148
  }
145
- function me(e, n) {
149
+ function ye(e, n) {
146
150
  const l = document.getElementsByClassName(e);
147
151
  for (let t = 0; t < l.length; t++) {
148
- const a = l[t];
149
- if (a.id === n)
150
- return a;
152
+ const o = l[t];
153
+ if (o.id === n)
154
+ return o;
151
155
  }
152
156
  }
153
- function pt(e, n, l) {
157
+ function zt(e, n, l) {
154
158
  const t = ["lt", "lb", "rt", "rb"];
155
- let a = "0", i = "0", o = 15;
159
+ let o = "0", i = "0", a = 15;
156
160
  window.NotifiyQueen = window.NotifiyQueen || [];
157
- const s = window.NotifiyQueen;
161
+ const r = window.NotifiyQueen;
158
162
  (typeof e != "string" || t.indexOf(e) === -1) && (e = "rt");
159
- const f = s.filter((u) => {
160
- if (u.offset === e)
161
- return u;
163
+ const m = r.filter((s) => {
164
+ if (s.offset === e)
165
+ return s;
162
166
  });
163
- let r = f.length > 0 ? f[f.length - 1] : null;
164
- if (r)
165
- if (r = me("zan-layer", r.id), e === "rt" || e === "lt")
166
- o += r.offsetHeight + parseFloat(r.style.top);
167
+ let f = m.length > 0 ? m[m.length - 1] : null;
168
+ if (f)
169
+ if (f = ye("zan-layer", f.id), e === "rt" || e === "lt")
170
+ a += f.offsetHeight + parseFloat(f.style.top);
167
171
  else {
168
- const u = parseFloat(r.style.top.split(" - ")[1]);
169
- o += r.offsetHeight + u;
172
+ const s = parseFloat(f.style.top.split(" - ")[1]);
173
+ a += f.offsetHeight + s;
170
174
  }
171
175
  else
172
- (e === "rb" || e === "lb") && (o += parseFloat(n[1]));
173
- return e === "rt" ? (a = o + "px", i = "calc(100% - " + (parseFloat(n[0]) + 15) + "px)") : e === "rb" ? (a = "calc(100% - " + o + "px)", i = "calc(100% - " + (parseFloat(n[0]) + 15) + "px)") : e === "lt" ? (a = o + "px", i = "15px") : e === "lb" && (a = "calc(100% - " + o + "px)", i = "15px"), s.push({
176
+ (e === "rb" || e === "lb") && (a += parseFloat(n[1]));
177
+ return e === "rt" ? (o = a + "px", i = "calc(100% - " + (parseFloat(n[0]) + 15) + "px)") : e === "rb" ? (o = "calc(100% - " + a + "px)", i = "calc(100% - " + (parseFloat(n[0]) + 15) + "px)") : e === "lt" ? (o = a + "px", i = "15px") : e === "lb" && (o = "calc(100% - " + a + "px)", i = "15px"), r.push({
174
178
  id: l,
175
179
  offset: e
176
- }), [a, i];
180
+ }), [o, i];
177
181
  }
178
- function ht(e) {
179
- const n = me("zan-layer", e);
182
+ function Ct(e) {
183
+ const n = ye("zan-layer", e);
180
184
  if (!n) return;
181
185
  const l = 15, t = n.offsetHeight;
182
186
  window.NotifiyQueen = window.NotifiyQueen || [];
183
- const a = window.NotifiyQueen, i = a.findIndex((r) => r.id === e), c = a[i].offset, o = a.filter((r) => {
184
- if (r.offset === c)
185
- return r;
186
- }), s = o.findIndex((r) => r.id === e);
187
- o.slice(s + 1).forEach((r) => {
188
- const u = me("zan-layer", r.id);
189
- if (c === "rt" || c === "lt")
190
- u.style.top = parseFloat(u.style.top) - l - t + "px";
187
+ const o = window.NotifiyQueen, i = o.findIndex((f) => f.id === e), u = o[i].offset, a = o.filter((f) => {
188
+ if (f.offset === u)
189
+ return f;
190
+ }), r = a.findIndex((f) => f.id === e);
191
+ a.slice(r + 1).forEach((f) => {
192
+ const s = ye("zan-layer", f.id);
193
+ if (u === "rt" || u === "lt")
194
+ s.style.top = parseFloat(s.style.top) - l - t + "px";
191
195
  else {
192
- const y = parseFloat(u.style.top.split(" - ")[1]) - l - t;
193
- u.style.top = "calc(100% - " + y + "px)";
196
+ const p = parseFloat(s.style.top.split(" - ")[1]) - l - t;
197
+ s.style.top = "calc(100% - " + p + "px)";
194
198
  }
195
- }), a.splice(i, 1);
199
+ }), o.splice(i, 1);
196
200
  }
197
- function gt(e) {
201
+ function wt(e) {
198
202
  const n = "zan-layer-drawer-anim zan-layer-anim";
199
203
  let l = "";
200
204
  return e === "lt" || e === "lb" ? l = "lr" : l = "rl", `${n}-${l}`;
201
205
  }
202
- const xt = /* @__PURE__ */ M({
206
+ const kt = /* @__PURE__ */ A({
203
207
  name: "Header",
204
208
  __name: "Header",
205
209
  props: {
@@ -208,19 +212,19 @@ const xt = /* @__PURE__ */ M({
208
212
  move: { type: Boolean }
209
213
  },
210
214
  setup(e) {
211
- const n = e, l = I(() => [n.move ? "cursor: move" : "", n.titleStyle]);
212
- return (t, a) => (d(), m("div", {
215
+ const n = e, l = $(() => [n.move ? "cursor: move" : "", n.titleStyle]);
216
+ return (t, o) => (d(), v("div", {
213
217
  class: "zan-layer-title",
214
- style: V(l.value)
218
+ style: N(l.value)
215
219
  }, [
216
220
  ee(t.$slots, "default", {}, () => [
217
- te(oe, {
218
- render: () => x(ne)(e.title)
221
+ te(ie, {
222
+ render: () => z(ne)(e.title)
219
223
  }, null, 8, ["render"])
220
224
  ])
221
225
  ], 4));
222
226
  }
223
- }), bt = /* @__PURE__ */ M({
227
+ }), Lt = /* @__PURE__ */ A({
224
228
  name: "Footer",
225
229
  __name: "Footer",
226
230
  props: {
@@ -228,18 +232,18 @@ const xt = /* @__PURE__ */ M({
228
232
  footerStyle: { type: [String, Boolean, null, Object, Array] }
229
233
  },
230
234
  setup(e) {
231
- return (n, l) => (d(), m("div", {
235
+ return (n, l) => (d(), v("div", {
232
236
  class: "zan-layer-footer",
233
- style: V(e.footerStyle)
237
+ style: N(e.footerStyle)
234
238
  }, [
235
239
  ee(n.$slots, "default", {}, () => [
236
- te(oe, {
237
- render: () => x(ne)(e.footer)
240
+ te(ie, {
241
+ render: () => z(ne)(e.footer)
238
242
  }, null, 8, ["render"])
239
243
  ])
240
244
  ], 4));
241
245
  }
242
- }), zt = { class: "zan-layer-setwin" }, Ct = { class: "zan-tooltip" }, wt = { class: "zan-tooltip" }, kt = /* @__PURE__ */ M({
246
+ }), St = { class: "zan-layer-setwin" }, It = { class: "zan-tooltip" }, $t = { class: "zan-tooltip" }, Bt = /* @__PURE__ */ A({
243
247
  name: "HeaderBtn",
244
248
  __name: "HeaderBtn",
245
249
  props: {
@@ -250,55 +254,55 @@ const xt = /* @__PURE__ */ M({
250
254
  },
251
255
  emits: ["onMin", "onMax", "onClose"],
252
256
  setup(e, { emit: n }) {
253
- const l = e, t = n, a = () => {
257
+ const l = e, t = n, o = () => {
254
258
  t("onMin");
255
259
  }, i = () => {
256
260
  t("onMax");
257
- }, c = () => {
261
+ }, u = () => {
258
262
  t("onClose");
259
263
  };
260
- return (o, s) => (d(), m("span", zt, [
261
- l.maxmin && !l.max ? (d(), m("i", {
264
+ return (a, r) => (d(), v("span", St, [
265
+ l.maxmin && !l.max ? (d(), v("i", {
262
266
  key: 0,
263
- class: N(["zan-icon-btn", l.min ? "zan-icon-full" : "zan-icon-min"]),
264
- onClick: re(a, ["stop"])
267
+ class: P(["zan-icon-btn", l.min ? "zan-icon-full" : "zan-icon-min"]),
268
+ onClick: de(o, ["stop"])
265
269
  }, [
266
- B("span", Ct, P(l.min ? "还原" : "最小化"), 1)
267
- ], 2)) : p("", !0),
268
- l.maxmin && !l.min ? (d(), m("i", {
270
+ B("span", It, T(l.min ? "还原" : "最小化"), 1)
271
+ ], 2)) : h("", !0),
272
+ l.maxmin && !l.min ? (d(), v("i", {
269
273
  key: 1,
270
- class: N(["zan-icon-btn", l.max ? "zan-icon-restore" : "zan-icon-max"]),
271
- onClick: re(i, ["stop"])
274
+ class: P(["zan-icon-btn", l.max ? "zan-icon-restore" : "zan-icon-max"]),
275
+ onClick: de(i, ["stop"])
272
276
  }, [
273
- B("span", wt, P(l.max ? "还原" : "最大化"), 1)
274
- ], 2)) : p("", !0),
275
- l.closeBtn ? (d(), m("i", {
277
+ B("span", $t, T(l.max ? "还原" : "最大化"), 1)
278
+ ], 2)) : h("", !0),
279
+ l.closeBtn ? (d(), v("i", {
276
280
  key: 2,
277
- class: N(["zan-icon-btn zan-icon-close-btn", `zan-layer-close${e.closeBtn}`]),
278
- onClick: re(c, ["stop"])
279
- }, [...s[0] || (s[0] = [
281
+ class: P(["zan-icon-btn zan-icon-close-btn", `zan-layer-close${e.closeBtn}`]),
282
+ onClick: de(u, ["stop"])
283
+ }, [...r[0] || (r[0] = [
280
284
  B("span", { class: "zan-tooltip" }, "关闭", -1)
281
- ])], 2)) : p("", !0)
285
+ ])], 2)) : h("", !0)
282
286
  ]));
283
287
  }
284
- }), St = (e, n) => {
288
+ }), Ot = (e, n) => {
285
289
  const l = e.__vccOpts || e;
286
- for (const [t, a] of n)
287
- l[t] = a;
290
+ for (const [t, o] of n)
291
+ l[t] = o;
288
292
  return l;
289
- }, Lt = /* @__PURE__ */ St(kt, [["__scopeId", "data-v-8d683fcb"]]), $t = { class: "zan-layer-phimg" }, It = ["src"], Bt = {
293
+ }, Ft = /* @__PURE__ */ Ot(Bt, [["__scopeId", "data-v-8d683fcb"]]), Et = { class: "zan-layer-phimg" }, Ht = ["src"], At = {
290
294
  key: 0,
291
295
  class: "zan-layer-imgsee"
292
- }, Ot = {
296
+ }, Mt = {
293
297
  key: 0,
294
298
  class: "zan-layer-imguide"
295
- }, Ft = {
299
+ }, Dt = {
296
300
  key: 0,
297
301
  class: "thumb-row"
298
- }, Ht = ["onClick"], Et = ["src"], Mt = {
302
+ }, Pt = ["onClick"], Nt = ["src"], Tt = {
299
303
  key: 1,
300
304
  class: "zan-layer-imgtit"
301
- }, At = { key: 0 }, Dt = { key: 1 }, Nt = /* @__PURE__ */ M({
305
+ }, Vt = { key: 0 }, jt = { key: 1 }, Rt = /* @__PURE__ */ A({
302
306
  name: "Photos",
303
307
  __name: "Photos",
304
308
  props: {
@@ -307,77 +311,77 @@ const xt = /* @__PURE__ */ M({
307
311
  },
308
312
  emits: ["resetCalculationPohtosArea"],
309
313
  setup(e, { emit: n }) {
310
- const l = n, t = e, a = b(t.startIndex);
311
- j(a, () => {
312
- l("resetCalculationPohtosArea", a.value);
314
+ const l = n, t = e, o = g(t.startIndex);
315
+ J(o, () => {
316
+ l("resetCalculationPohtosArea", o.value);
313
317
  });
314
- const i = (s) => {
315
- let r = a.value + s;
316
- r < 0 && (r = t.imgList.length - 1), r >= t.imgList.length && (r = 0), a.value = r;
317
- }, c = b(!1);
318
- ye(() => {
318
+ const i = (r) => {
319
+ let f = o.value + r;
320
+ f < 0 && (f = t.imgList.length - 1), f >= t.imgList.length && (f = 0), o.value = f;
321
+ }, u = g(!1);
322
+ he(() => {
319
323
  D(() => {
320
324
  setTimeout(() => {
321
- c.value = !0;
325
+ u.value = !0;
322
326
  }, 400);
323
327
  });
324
328
  });
325
- const o = I(() => {
326
- let s = !1;
327
- return t.imgList.forEach((f) => {
328
- f.thumb && (s = !0);
329
- }), s;
329
+ const a = $(() => {
330
+ let r = !1;
331
+ return t.imgList.forEach((m) => {
332
+ m.thumb && (r = !0);
333
+ }), r;
330
334
  });
331
- return (s, f) => (d(), m("div", $t, [
335
+ return (r, m) => (d(), v("div", Et, [
332
336
  B("img", {
333
- src: e.imgList[a.value].src
334
- }, null, 8, It),
335
- e.imgList.length > 0 ? (d(), m("div", Bt, [
336
- e.imgList.length > 1 ? (d(), m("span", Ot, [
337
+ src: e.imgList[o.value].src
338
+ }, null, 8, Ht),
339
+ e.imgList.length > 0 ? (d(), v("div", At, [
340
+ e.imgList.length > 1 ? (d(), v("span", Mt, [
337
341
  B("a", {
338
342
  href: "javascript:;",
339
343
  class: "zan-layer-iconext zan-layer-imgprev",
340
- onClick: f[0] || (f[0] = (r) => i(-1))
344
+ onClick: m[0] || (m[0] = (f) => i(-1))
341
345
  }, "‹"),
342
346
  B("a", {
343
347
  href: "javascript:;",
344
348
  class: "zan-layer-iconext zan-layer-imgnext",
345
- onClick: f[1] || (f[1] = (r) => i(1))
349
+ onClick: m[1] || (m[1] = (f) => i(1))
346
350
  }, "›")
347
- ])) : p("", !0),
348
- e.imgList.length > 1 || e.imgList[a.value].alt ? (d(), m("div", {
351
+ ])) : h("", !0),
352
+ e.imgList.length > 1 || e.imgList[o.value].alt ? (d(), v("div", {
349
353
  key: 1,
350
354
  class: "zan-layer-imgbar",
351
- style: V({ opacity: c.value ? 1 : 0 })
355
+ style: N({ opacity: u.value ? 1 : 0 })
352
356
  }, [
353
- o.value ? (d(), m("div", Ft, [
354
- (d(!0), m(R, null, Ee(e.imgList, (r, u) => (d(), m("div", {
357
+ a.value ? (d(), v("div", Dt, [
358
+ (d(!0), v(W, null, De(e.imgList, (f, s) => (d(), v("div", {
355
359
  class: "thumb-box",
356
- key: "thumb-box" + u,
357
- onClick: (y) => a.value = u
360
+ key: "thumb-box" + s,
361
+ onClick: (p) => o.value = s
358
362
  }, [
359
363
  B("img", {
360
- src: r.thumb
361
- }, null, 8, Et)
362
- ], 8, Ht))), 128)),
364
+ src: f.thumb
365
+ }, null, 8, Nt)
366
+ ], 8, Pt))), 128)),
363
367
  B("div", {
364
368
  class: "thumb-box-border",
365
- style: V({
366
- left: `calc(calc( calc(100% - ${100 * e.imgList.length}px) / 2) + ${a.value * 100}px)`
369
+ style: N({
370
+ left: `calc(calc( calc(100% - ${100 * e.imgList.length}px) / 2) + ${o.value * 100}px)`
367
371
  })
368
372
  }, null, 4)
369
- ])) : (d(), m("span", Mt, [
370
- e.imgList[a.value].alt ? (d(), m("span", At, P(e.imgList[a.value].alt), 1)) : p("", !0),
371
- e.imgList.length > 1 ? (d(), m("em", Dt, P(a.value + 1) + " / " + P(e.imgList.length), 1)) : p("", !0)
373
+ ])) : (d(), v("span", Tt, [
374
+ e.imgList[o.value].alt ? (d(), v("span", Vt, T(e.imgList[o.value].alt), 1)) : h("", !0),
375
+ e.imgList.length > 1 ? (d(), v("em", jt, T(o.value + 1) + " / " + T(e.imgList.length), 1)) : h("", !0)
372
376
  ]))
373
- ], 4)) : p("", !0)
374
- ])) : p("", !0)
377
+ ], 4)) : h("", !0)
378
+ ])) : h("", !0)
375
379
  ]));
376
380
  }
377
- }), Vt = { class: "title" }, Pt = {
381
+ }), _t = { class: "title" }, Wt = {
378
382
  key: 0,
379
383
  class: "content"
380
- }, Tt = ["innerHTML"], jt = /* @__PURE__ */ M({
384
+ }, Xt = ["innerHTML"], Yt = /* @__PURE__ */ A({
381
385
  name: "Notifiy",
382
386
  __name: "Notifiy",
383
387
  props: {
@@ -389,48 +393,48 @@ const xt = /* @__PURE__ */ M({
389
393
  },
390
394
  emits: ["close"],
391
395
  setup(e, { emit: n }) {
392
- const l = e, t = n, a = lt(null), i = () => {
396
+ const l = e, t = n, o = rt(null), i = () => {
393
397
  t("close");
394
398
  };
395
- function c(o, s) {
396
- let f = o.className, r = f != "" ? " " : "", u = f + r + s;
397
- o.className = u;
399
+ function u(a, r) {
400
+ let m = a.className, f = m != "" ? " " : "", s = m + f + r;
401
+ a.className = s;
398
402
  }
399
- return ye(() => {
403
+ return he(() => {
400
404
  D(() => {
401
405
  setTimeout(() => {
402
- var o, s, f, r;
403
- (s = (o = a.value) == null ? void 0 : o.parentElement) != null && s.parentElement && c(
404
- (r = (f = a.value) == null ? void 0 : f.parentElement) == null ? void 0 : r.parentElement,
406
+ var a, r, m, f;
407
+ (r = (a = o.value) == null ? void 0 : a.parentElement) != null && r.parentElement && u(
408
+ (f = (m = o.value) == null ? void 0 : m.parentElement) == null ? void 0 : f.parentElement,
405
409
  "zan-layer-notifiy-transition"
406
410
  );
407
411
  }, 300);
408
412
  });
409
- }), (o, s) => (d(), m("div", {
413
+ }), (a, r) => (d(), v("div", {
410
414
  class: "zan-layer-notifiy-wrapper",
411
415
  ref_key: "notifyRef",
412
- ref: a
416
+ ref: o
413
417
  }, [
414
- B("h2", Vt, [
415
- e.icon ? (d(), m("i", {
418
+ B("h2", _t, [
419
+ e.icon ? (d(), v("i", {
416
420
  key: 0,
417
- class: N(e.iconClass)
418
- }, null, 2)) : p("", !0),
419
- B("span", null, P(e.title), 1)
421
+ class: P(e.iconClass)
422
+ }, null, 2)) : h("", !0),
423
+ B("span", null, T(e.title), 1)
420
424
  ]),
421
- !e.isHtmlFragment && e.content ? (d(), m("div", Pt, [
422
- te(oe, {
423
- render: () => x(ne)(l.content)
425
+ !e.isHtmlFragment && e.content ? (d(), v("div", Wt, [
426
+ te(ie, {
427
+ render: () => z(ne)(l.content)
424
428
  }, null, 8, ["render"])
425
- ])) : e.isHtmlFragment && e.content ? (d(), m("div", {
429
+ ])) : e.isHtmlFragment && e.content ? (d(), v("div", {
426
430
  key: 1,
427
431
  class: "content",
428
432
  innerHTML: e.content
429
- }, null, 8, Tt)) : p("", !0),
433
+ }, null, 8, Xt)) : h("", !0),
430
434
  B("i", {
431
435
  class: "zan-icon-close",
432
436
  onClick: i
433
- }, [...s[0] || (s[0] = [
437
+ }, [...r[0] || (r[0] = [
434
438
  B("svg", {
435
439
  viewBox: "0 0 1024 1024",
436
440
  width: "16",
@@ -444,7 +448,7 @@ const xt = /* @__PURE__ */ M({
444
448
  ])])
445
449
  ], 512));
446
450
  }
447
- }), Rt = ["maxlength", "placeholder"], _t = ["type", "placeholder"], Wt = /* @__PURE__ */ M({
451
+ }), Qt = ["maxlength", "placeholder"], Gt = ["type", "placeholder"], Zt = /* @__PURE__ */ A({
448
452
  name: "Prompt",
449
453
  __name: "Prompt",
450
454
  props: {
@@ -455,7 +459,7 @@ const xt = /* @__PURE__ */ M({
455
459
  },
456
460
  emits: ["update:promptValue"],
457
461
  setup(e, { emit: n }) {
458
- const l = e, t = b(l.promptValue), a = I(() => {
462
+ const l = e, t = g(l.promptValue), o = $(() => {
459
463
  switch (typeof l.formType) {
460
464
  case "string":
461
465
  return l.formType === "textarea";
@@ -464,107 +468,111 @@ const xt = /* @__PURE__ */ M({
464
468
  default:
465
469
  return !1;
466
470
  }
467
- }), i = I(
471
+ }), i = $(
468
472
  () => l.formType == 1 || l.formType == "password"
469
473
  );
470
- return (c, o) => a.value ? ke((d(), m("textarea", {
474
+ return (u, a) => o.value ? Se((d(), v("textarea", {
471
475
  key: 0,
472
- onInput: o[0] || (o[0] = (s) => c.$emit("update:promptValue", t.value)),
473
- "onUpdate:modelValue": o[1] || (o[1] = (s) => t.value = s),
476
+ onInput: a[0] || (a[0] = (r) => u.$emit("update:promptValue", t.value)),
477
+ "onUpdate:modelValue": a[1] || (a[1] = (r) => t.value = r),
474
478
  maxlength: l.maxLength,
475
479
  placeholder: l.placeholder,
476
480
  class: "zan-textarea"
477
- }, null, 40, Rt)), [
478
- [at, t.value]
479
- ]) : ke((d(), m("input", {
481
+ }, null, 40, Qt)), [
482
+ [ut, t.value]
483
+ ]) : Se((d(), v("input", {
480
484
  key: 1,
481
- onInput: o[2] || (o[2] = (s) => c.$emit("update:promptValue", t.value)),
482
- "onUpdate:modelValue": o[3] || (o[3] = (s) => t.value = s),
485
+ onInput: a[2] || (a[2] = (r) => u.$emit("update:promptValue", t.value)),
486
+ "onUpdate:modelValue": a[3] || (a[3] = (r) => t.value = r),
483
487
  type: i.value ? "password" : "text",
484
488
  placeholder: l.placeholder,
485
489
  class: "zan-input"
486
- }, null, 40, _t)), [
487
- [ot, t.value]
490
+ }, null, 40, Gt)), [
491
+ [ct, t.value]
488
492
  ]);
489
493
  }
490
494
  });
491
- function Xt(e) {
495
+ function qt(e) {
492
496
  for (; e && e.parentNode; )
493
497
  if (e = e.parentNode, e && getComputedStyle(e).position === "relative")
494
498
  return e;
495
499
  return null;
496
500
  }
497
- const ae = (e) => {
501
+ const se = (e) => {
498
502
  document.querySelectorAll(".zan-layer iframe").forEach((l) => {
499
503
  l.style.pointerEvents = e;
500
504
  });
501
- }, Yt = function(e, n, l, t, a) {
502
- let i, c, o = 0, s = 0, f = !0;
503
- e != null && e.addEventListener("mousedown", function(r) {
504
- if ((r.composedPath && r.composedPath() || r.path)[0].className === "zan-layer-title" && r.button == 0 && e != null) {
505
- ae("none");
506
- const y = getComputedStyle(e);
507
- i = r.pageX - e.offsetLeft + parseInt(y["margin-left"]), c = r.pageY - e.offsetTop + parseInt(y["margin-right"]), o = r.clientX, s = r.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "move";
508
- const $ = function(C) {
505
+ }, Ut = function(e, n, l, t, o) {
506
+ let i, u, a = 0, r = 0, m = !0;
507
+ const f = (s) => {
508
+ const p = s.target;
509
+ return !p || p.closest("button, input, textarea, select, a") ? !1 : (s.composedPath && s.composedPath() || s.path || []).some((O) => O instanceof HTMLElement && O.classList.contains("zan-layer-title"));
510
+ };
511
+ e != null && e.addEventListener("mousedown", function(s) {
512
+ if (f(s) && s.button == 0 && e != null) {
513
+ se("none");
514
+ const p = getComputedStyle(e);
515
+ i = s.pageX - e.offsetLeft + parseInt(p["margin-left"]), u = s.pageY - e.offsetTop + parseInt(p["margin-right"]), a = s.clientX, r = s.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "move";
516
+ const L = function(S) {
509
517
  if (e != null) {
510
- (C.clientX - o != 0 || C.clientY - s != 0) && f && (f = !1, a());
511
- let h = C.pageX - i, g = C.pageY - c;
512
- const k = document.documentElement.clientWidth, S = document.documentElement.clientHeight;
518
+ (S.clientX - a != 0 || S.clientY - r != 0) && m && (m = !1, o());
519
+ let x = S.pageX - i, b = S.pageY - u;
520
+ const w = document.documentElement.clientWidth, k = document.documentElement.clientHeight;
513
521
  if (!n) {
514
- let O = k - e.offsetWidth, F = S - e.offsetHeight;
522
+ let F = w - e.offsetWidth, E = k - e.offsetHeight;
515
523
  if (e.style.position === "absolute") {
516
- const E = Xt(e);
517
- E != null && (O = E.clientWidth - e.offsetWidth, F = E.clientHeight - e.offsetHeight);
524
+ const H = qt(e);
525
+ H != null && (F = H.clientWidth - e.offsetWidth, E = H.clientHeight - e.offsetHeight);
518
526
  }
519
- h < 0 ? h = 0 : h > O && (h = O), g < 0 ? g = 0 : g > F && (g = F);
527
+ x < 0 ? x = 0 : x > F && (x = F), b < 0 ? b = 0 : b > E && (b = E);
520
528
  }
521
- e.style.top = g + "px", e.style.left = h + "px", l(e.style.left, e.style.top);
529
+ e.style.top = b + "px", e.style.left = x + "px", l(e.style.left, e.style.top);
522
530
  }
523
531
  return !1;
524
- }, H = function() {
525
- f = !0, document.body.style.userSelect = "", document.body.style.cursor = "", t(), ae("auto"), document.removeEventListener("mousemove", $), document.removeEventListener("mouseup", H);
532
+ }, O = function() {
533
+ m = !0, document.body.style.userSelect = "", document.body.style.cursor = "", t(), se("auto"), document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", O);
526
534
  };
527
- document.addEventListener("mousemove", $, { passive: !1 }), document.addEventListener("mouseup", H);
535
+ document.addEventListener("mousemove", L, { passive: !1 }), document.addEventListener("mouseup", O);
528
536
  }
529
537
  return !1;
530
538
  });
531
- }, Qt = function(e, n, l, t) {
532
- let a = 0, i = 0, c = !0;
533
- e != null && e.addEventListener("mousedown", function(o) {
534
- if ((o.composedPath && o.composedPath() || o.path)[0].className === "zan-layer-resize" && o.button == 0 && e != null) {
535
- ae("none");
536
- const f = e.getBoundingClientRect(), r = f.left, u = f.top;
537
- a = o.clientX, i = o.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "se-resize";
538
- const y = function(H) {
539
- var C;
540
- if (window.getSelection != null && ((C = window.getSelection()) == null || C.removeAllRanges()), e != null) {
541
- const h = H.clientX, g = H.clientY;
542
- (h - a != 0 || g - i != 0) && c && (c = !1, t());
543
- let k = h - r, S = g - u;
544
- k < 260 && (k = 260), S < 115 && (S = 115), e.style.width = k + "px", e.style.height = S + "px", n(e.style.width, e.style.height);
539
+ }, Kt = function(e, n, l, t) {
540
+ let o = 0, i = 0, u = !0;
541
+ e != null && e.addEventListener("mousedown", function(a) {
542
+ if ((a.composedPath && a.composedPath() || a.path)[0].className === "zan-layer-resize" && a.button == 0 && e != null) {
543
+ se("none");
544
+ const m = e.getBoundingClientRect(), f = m.left, s = m.top;
545
+ o = a.clientX, i = a.clientY, document.body.style.userSelect = "none", document.body.style.cursor = "se-resize";
546
+ const p = function(O) {
547
+ var S;
548
+ if (window.getSelection != null && ((S = window.getSelection()) == null || S.removeAllRanges()), e != null) {
549
+ const x = O.clientX, b = O.clientY;
550
+ (x - o != 0 || b - i != 0) && u && (u = !1, t());
551
+ let w = x - f, k = b - s;
552
+ w < 260 && (w = 260), k < 115 && (k = 115), e.style.width = w + "px", e.style.height = k + "px", n(e.style.width, e.style.height);
545
553
  }
546
554
  return !1;
547
555
  };
548
- document.addEventListener("mousemove", y, { passive: !1 });
549
- const $ = function() {
550
- c = !0, document.body.style.userSelect = "", document.body.style.cursor = "", l(), ae("auto"), document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", $);
556
+ document.addEventListener("mousemove", p, { passive: !1 });
557
+ const L = function() {
558
+ u = !0, document.body.style.userSelect = "", document.body.style.cursor = "", l(), se("auto"), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", L);
551
559
  };
552
- document.addEventListener("mouseup", $);
560
+ document.addEventListener("mouseup", L);
553
561
  }
554
562
  return !1;
555
563
  });
556
- }, Gt = Symbol("zIndex");
557
- let Ut = 99999;
558
- function Fe() {
559
- return ++Ut;
564
+ }, Jt = Symbol("zIndex");
565
+ let en = 99999;
566
+ function Ae() {
567
+ return ++en;
560
568
  }
561
- const Zt = ["id"], qt = {
569
+ const tn = ["id"], nn = {
562
570
  key: 1,
563
571
  class: "slot-fragment"
564
- }, Kt = ["innerHTML"], Jt = ["onClick"], en = {
572
+ }, ln = ["innerHTML"], an = ["onClick"], on = {
565
573
  key: 2,
566
574
  class: "zan-layer-resize"
567
- }, ve = /* @__PURE__ */ M({
575
+ }, pe = /* @__PURE__ */ A({
568
576
  name: "ZanLayer",
569
577
  __name: "ZanLayer",
570
578
  props: {
@@ -586,6 +594,7 @@ const Zt = ["id"], qt = {
586
594
  shadeStyle: { type: [Boolean, null, String, Object, Array] },
587
595
  shadeOpacity: { default: "0.1" },
588
596
  layerClasses: {},
597
+ contentClass: { default: "" },
589
598
  zIndex: {},
590
599
  closeBtn: { type: [Boolean, String], default: "1" },
591
600
  btn: {},
@@ -639,366 +648,373 @@ const Zt = ["id"], qt = {
639
648
  } },
640
649
  internalDestroy: {}
641
650
  },
642
- emits: ["close", "update:modelValue"],
651
+ emits: ["close", "update:modelValue", "opened"],
643
652
  setup(e, { expose: n, emit: l }) {
644
- const t = e, a = l, i = st(), c = b(!1), o = b(!1), s = b(t.id || Me()), f = b(null), r = b(), u = yt(t.type), y = b(
645
- mt(t.type, t.area, t.offset)
646
- ), $ = b(
647
- de(t.offset, y.value, u)
648
- ), H = b(99999), C = b(!1), h = b(y.value[0]), g = b(y.value[1]), k = b($.value[0]), S = b($.value[1]), O = b(""), F = b(""), E = b(""), _ = b(""), G = b(t.value);
649
- j(
653
+ const t = e, o = l, i = dt(), u = g(!1), a = g(!1), r = g(t.id || Pe()), m = g(null), f = g(), s = bt(t.type), p = g(
654
+ gt(t.type, t.area, t.offset)
655
+ ), L = g(
656
+ me(t.offset, p.value, s)
657
+ ), O = g(99999), S = g(!1), x = g(p.value[0]), b = g(p.value[1]), w = g(L.value[0]), k = g(L.value[1]), F = g(""), E = g(""), H = g(""), j = g(""), le = g(!1), Q = g(t.value);
658
+ J(
650
659
  () => t.value,
651
660
  () => {
652
- G.value = t.value;
661
+ Q.value = t.value;
653
662
  }
654
663
  );
655
- const pe = () => {
656
- H.value = t.zIndex ?? Fe();
664
+ const ge = () => {
665
+ O.value = t.zIndex ?? Ae();
657
666
  };
658
- j(
667
+ J(
659
668
  () => t.zIndex,
660
669
  () => {
661
- pe();
670
+ ge();
662
671
  },
663
672
  { immediate: !0 }
664
673
  );
665
- const he = function() {
674
+ const xe = function() {
666
675
  D(async () => {
667
- u == 4 && (y.value = Ae(t.offset, t.area)), u == 5 && (y.value = await Oe(
676
+ s == 4 && (p.value = Ne(t.offset, t.area)), s == 5 && (p.value = await He(
668
677
  t.imgList[t.startIndex].src
669
678
  ));
670
- let v = y.value;
671
- (v[0] == null || v[1] == null) && (v = Ie(f.value)), u == 6 && ($.value = pt(t.offset, v, s.value)), U(), we(), Ve();
679
+ let c = p.value;
680
+ (c[0] == null || c[1] == null) && (c = Fe(m.value)), s == 6 && (L.value = zt(t.offset, c, r.value)), oe(), Le(), je();
672
681
  });
673
- }, De = function() {
674
- o.value && ze(), c.value && xe(), O.value = "", F.value = "", E.value = "", _.value = "";
675
- }, ge = () => {
676
- E.value = k.value, _.value = S.value, O.value = h.value, F.value = g.value, h.value = Le().w, g.value = Le().h, k.value = $e().t, S.value = $e().l;
677
- }, xe = () => {
678
- c.value ? (X(), h.value = O.value, g.value = F.value, t.revert(s.value)) : (Y(), ge(), t.full(s.value)), c.value = !c.value;
682
+ }, Te = function() {
683
+ a.value && we(), u.value && ze(), F.value = "", E.value = "", H.value = "", j.value = "";
679
684
  }, be = () => {
680
- let ue = 10 + 190 * q(s.value, !0);
681
- const nt = document.documentElement.clientWidth;
682
- ue + 180 > nt && (ue = 10), O.value = h.value, F.value = g.value, E.value = k.value, _.value = S.value, g.value = "51px", h.value = "180px", k.value = "calc(100% - 51px)", S.value = ue + "px";
683
- }, ze = async () => {
684
- o.value ? (X(), q(s.value, !1), h.value = O.value, g.value = F.value, t.revert(s.value)) : (Y(), be(), t.min(s.value)), o.value = !o.value;
685
+ H.value = w.value, j.value = k.value, F.value = x.value, E.value = b.value, x.value = Be().w, b.value = Be().h, w.value = Oe().t, k.value = Oe().l;
686
+ }, ze = () => {
687
+ u.value ? (G(), x.value = F.value, b.value = E.value, t.revert(r.value)) : (X(), be(), t.full(r.value)), u.value = !u.value;
688
+ }, Ce = () => {
689
+ let ce = 10 + 190 * q(r.value, !0);
690
+ const it = document.documentElement.clientWidth;
691
+ ce + 180 > it && (ce = 10), F.value = x.value, E.value = b.value, H.value = w.value, j.value = k.value, b.value = "51px", x.value = "180px", w.value = "calc(100% - 51px)", k.value = ce + "px";
692
+ }, we = async () => {
693
+ a.value ? (G(), q(r.value, !1), x.value = F.value, b.value = E.value, t.revert(r.value)) : (X(), Ce(), t.min(r.value)), a.value = !a.value;
685
694
  };
686
- j(
695
+ J(
687
696
  () => t.modelValue,
688
- () => {
689
- C.value = t.modelValue, C.value ? (he(), pe()) : De();
697
+ (c) => {
698
+ S.value !== c && (S.value = c);
690
699
  },
691
- { deep: !0, immediate: !0 }
692
- ), j(
693
- () => C.value,
694
- () => {
695
- C.value && (t.isFunction && he(), D(() => {
696
- t.success(s.value);
697
- }));
700
+ { immediate: !0 }
701
+ ), J(
702
+ () => S.value,
703
+ (c, y) => {
704
+ if (c !== y && !(!c && y === void 0)) {
705
+ if (c) {
706
+ le.value = !1, xe(), ge(), G(), t.isFunction && xe(), D(() => {
707
+ t.success(r.value);
708
+ });
709
+ return;
710
+ }
711
+ X(), Te(), y !== void 0 && t.end(r.value);
712
+ }
698
713
  },
699
714
  { immediate: !0, flush: "post" }
700
- ), j(
701
- () => C.value,
702
- () => {
703
- C.value || t.end(s.value);
704
- }
705
715
  );
706
- const Ne = I(() => [
716
+ const Ve = $(() => [
707
717
  {
708
- "zan-layer-dialog": u === 0 || u === 7,
709
- "zan-layer-page": u === 1,
710
- "zan-layer-iframe": u === 2,
711
- "zan-layer-loading": u === 3,
712
- "zan-layer-drawer": u === 4,
713
- "zan-layer-photos": u === 5,
714
- "zan-layer-notifiy": u === 6,
718
+ "zan-layer-dialog": s === 0 || s === 7,
719
+ "zan-layer-page": s === 1,
720
+ "zan-layer-iframe": s === 2,
721
+ "zan-layer-loading": s === 3,
722
+ "zan-layer-drawer": s === 4,
723
+ "zan-layer-photos": s === 5,
724
+ "zan-layer-notifiy": s === 6,
715
725
  "zan-layer-msg": t.isMessage,
716
726
  "zan-layer-hui": t.isMessage && !t.icon
717
727
  },
718
728
  t.layerClasses
719
- ]), Ve = function() {
720
- t.move && u != 4 && D(() => {
721
- f.value && (Yt(
722
- f.value,
729
+ ]), je = function() {
730
+ t.move && s != 4 && D(() => {
731
+ m.value && (Ut(
732
+ m.value,
723
733
  t.moveOut,
724
- (v, z) => {
725
- S.value = v, k.value = z, o.value || (_.value = v, E.value = z), t.moving(s.value, { top: z, left: v });
734
+ (c, y) => {
735
+ k.value = c, w.value = y, le.value = !0, a.value || (j.value = c, H.value = y), t.moving(r.value, { top: y, left: c });
726
736
  },
727
737
  () => {
728
- const v = {
729
- left: S.value,
730
- top: k.value,
731
- isMin: o.value,
732
- isMax: c.value
733
- }, [z, w] = t.moveEnd(s.value, v) || [];
734
- w && z && (S.value = z, k.value = w);
738
+ const c = {
739
+ left: k.value,
740
+ top: w.value,
741
+ isMin: a.value,
742
+ isMax: u.value
743
+ }, [y, C] = t.moveEnd(r.value, c) || [];
744
+ C && y && (k.value = y, w.value = C);
735
745
  },
736
746
  () => {
737
- t.moveStart(s.value);
747
+ t.moveStart(r.value);
738
748
  }
739
- ), Qt(
740
- f.value,
741
- (v, z) => {
742
- g.value = z, h.value = v, F.value = z, O.value = v, t.resizing(s.value, { width: v, height: z });
749
+ ), Kt(
750
+ m.value,
751
+ (c, y) => {
752
+ b.value = y, x.value = c, E.value = y, F.value = c, t.resizing(r.value, { width: c, height: y });
743
753
  },
744
754
  () => {
745
- const v = {
746
- width: h.value,
747
- height: g.value
748
- }, [z, w] = t.resizeEnd(s.value, v) || [];
749
- z && w && (h.value = z, g.value = w);
755
+ const c = {
756
+ width: x.value,
757
+ height: b.value
758
+ }, [y, C] = t.resizeEnd(r.value, c) || [];
759
+ y && C && (x.value = y, b.value = C);
750
760
  },
751
761
  () => {
752
- t.resizeStart(s.value);
762
+ t.resizeStart(r.value);
753
763
  }
754
764
  ));
755
765
  });
756
- }, Pe = I(() => ({
766
+ }, Re = $(() => ({
757
767
  position: t.teleportDisabled || t.teleport != "body" ? "absolute" : "fixed",
758
- top: k.value,
759
- left: S.value,
760
- height: g.value,
761
- width: h.value,
768
+ top: w.value,
769
+ left: k.value,
770
+ height: b.value,
771
+ width: x.value,
762
772
  animationDuration: t.animDuration,
763
- zIndex: H.value
764
- })), Te = I(() => [
765
- u === 3 ? `zan-layer-loading${t.load}` : "",
766
- t.icon ? "zan-layer-padding" : ""
767
- ]), le = () => {
773
+ zIndex: O.value
774
+ })), _e = $(() => [
775
+ s === 3 ? `zan-layer-loading${t.load}` : "",
776
+ t.icon ? "zan-layer-padding" : "",
777
+ t.contentClass
778
+ ]), ae = () => {
768
779
  if (typeof t.beforeClose == "function") {
769
- const v = t.beforeClose(s.value);
770
- (v === void 0 || v != null && v === !0) && (t.close(s.value), a("close"), a("update:modelValue", !1), t.internalDestroy && t.internalDestroy(), o.value && q(s.value, !o.value));
780
+ const c = t.beforeClose(r.value);
781
+ (c === void 0 || c != null && c === !0) && (t.close(r.value), o("close"), o("update:modelValue", !1), t.internalDestroy && t.internalDestroy(), a.value && q(r.value, !a.value));
771
782
  }
772
- }, je = (...v) => {
773
- typeof t.yes == "function" ? t.yes(...v) : le();
774
- }, Re = () => {
775
- t.shadeClose && le();
776
- }, Ce = I(() => ["zan-icon", `zan-icon-ico${t.icon}`]), _e = I(() => u === 4 ? Be(t.offset) : u === 6 ? gt(t.offset) : `zan-layer-anim-0${t.anim}`), We = I(() => u === 4 ? Be(t.offset, !0) : t.isOutAnim ? "zan-layer-anim-close" : ""), Xe = () => {
777
- C.value = !0;
778
- }, Ye = () => {
779
- C.value = !1, u === 6 && ht(s.value);
780
- }, Qe = I(() => C.value && t.shade && !o.value), Ge = I(() => t.resize && !c.value && !o.value), Ue = I(() => t.title && u != 3 && u != 5 && u != 6), Ze = function(v) {
783
+ }, We = (...c) => {
784
+ typeof t.yes == "function" ? t.yes(...c) : ae();
785
+ }, Xe = () => {
786
+ t.shadeClose && ae();
787
+ }, ke = $(() => ["zan-icon", `zan-icon-ico${t.icon}`]), Ye = $(() => s === 4 ? Ee(t.offset) : s === 6 ? wt(t.offset) : `zan-layer-anim-0${t.anim}`), Qe = $(() => s === 4 ? Ee(t.offset, !0) : t.isOutAnim ? "zan-layer-anim-close" : ""), Ge = () => {
788
+ S.value = !0;
789
+ }, Ze = () => {
790
+ S.value = !1, s === 6 && Ct(r.value);
791
+ }, qe = $(() => S.value && t.shade && !a.value), Ue = $(() => t.resize && !u.value && !a.value), Ke = $(() => t.title && s != 3 && s != 5 && s != 6), Je = function(c) {
781
792
  D(async () => {
782
- y.value = await Oe(t.imgList[v].src), $.value = de(t.offset, y.value, u), h.value = y.value[0], g.value = y.value[1], k.value = $.value[0], S.value = $.value[1], O.value = y.value[0], F.value = y.value[1];
793
+ p.value = await He(t.imgList[c].src), L.value = me(t.offset, p.value, s), x.value = p.value[0], b.value = p.value[1], w.value = L.value[0], k.value = L.value[1], F.value = p.value[0], E.value = p.value[1];
783
794
  });
784
- }, qe = function() {
785
- t.zIndex || (H.value = Fe());
795
+ }, et = function() {
796
+ t.zIndex || (O.value = Ae());
797
+ }, tt = (c, y) => ((c == null ? void 0 : c[0]) || "") === ((y == null ? void 0 : y[0]) || "") && ((c == null ? void 0 : c[1]) || "") === ((y == null ? void 0 : y[1]) || ""), nt = () => {
798
+ o("opened");
786
799
  };
787
- ye(() => {
800
+ he(() => {
801
+ }), ft(() => {
788
802
  X();
789
- }), it(() => {
790
- Y();
791
- }), j(
792
- () => t.modelValue,
793
- () => {
794
- t.modelValue ? X() : Y();
795
- }
796
- );
797
- let W;
798
- const X = function() {
803
+ });
804
+ let R, _ = 0;
805
+ const G = function() {
799
806
  D(() => {
800
- r.value && !W && u != 6 && (W = new ResizeObserver((v) => {
801
- f.value && ($.value = de(
802
- t.offset,
803
- Ie(f.value),
804
- u
805
- ), U(!0));
806
- }), W.observe(r.value));
807
+ !S.value || !f.value || R || s == 6 || f.value && !R && s != 6 && (R = new ResizeObserver(() => {
808
+ m.value && (_ && cancelAnimationFrame(_), _ = requestAnimationFrame(() => {
809
+ if (_ = 0, !m.value)
810
+ return;
811
+ const c = me(
812
+ t.offset,
813
+ Fe(m.value),
814
+ s
815
+ );
816
+ if (tt(L.value, c) || (L.value = c), le.value && t.lastPosition)
817
+ return;
818
+ const y = t.lastPosition && H.value || c[0], C = t.lastPosition && j.value || c[1];
819
+ w.value !== y && (w.value = y), k.value !== C && (k.value = C);
820
+ }));
821
+ }), R.observe(f.value));
807
822
  });
808
- }, Y = function() {
809
- W && r.value && (W.unobserve(r.value), W = void 0);
810
- }, U = function(v = !1) {
811
- k.value = v && t.lastPosition && E.value || $.value[0], S.value = v && t.lastPosition && _.value || $.value[1];
812
- }, we = function() {
813
- h.value = y.value[0], g.value = y.value[1], O.value = y.value[0], F.value = y.value[1];
814
- }, Ke = function() {
815
- X(), q(s.value, !1), o.value = !1, c.value = !1, E.value = "", _.value = "", U(), we(), t.modelValue || a("update:modelValue", !0);
816
- }, Je = async function() {
817
- o.value && (se(), U(!0)), c.value || (await D(), Y(), ge(), c.value = !0);
818
- }, et = async function() {
819
- c.value && (se(), U(!0)), o.value || (await D(), Y(), be(), o.value = !0);
820
- }, se = () => {
821
- X(), q(s.value, !1), o.value = !1, c.value = !1, h.value = O.value, g.value = F.value;
823
+ }, X = function() {
824
+ _ && (cancelAnimationFrame(_), _ = 0), R && (R.disconnect(), R = void 0);
825
+ }, oe = function(c = !1) {
826
+ w.value = c && t.lastPosition && H.value || L.value[0], k.value = c && t.lastPosition && j.value || L.value[1];
827
+ }, Le = function() {
828
+ x.value = p.value[0], b.value = p.value[1], F.value = p.value[0], E.value = p.value[1];
829
+ }, lt = function() {
830
+ G(), q(r.value, !1), a.value = !1, u.value = !1, le.value = !1, H.value = "", j.value = "", oe(), Le(), t.modelValue || o("update:modelValue", !0);
831
+ }, at = async function() {
832
+ a.value && (re(), oe(!0)), u.value || (await D(), X(), be(), u.value = !0);
833
+ }, ot = async function() {
834
+ u.value && (re(), oe(!0)), a.value || (await D(), X(), Ce(), a.value = !0);
835
+ }, re = () => {
836
+ G(), q(r.value, !1), a.value = !1, u.value = !1, x.value = F.value, b.value = E.value;
822
837
  };
823
- return n({ reset: Ke, open: Xe, close: Ye, full: Je, min: et, revert: se }), (v, z) => (d(), A(ut, {
838
+ return n({ reset: lt, open: Ge, close: Ze, full: at, min: ot, revert: re }), (c, y) => (d(), M(mt, {
824
839
  to: e.teleport,
825
840
  disabled: e.teleportDisabled
826
841
  }, [
827
- te(ct, {
828
- index: H.value,
842
+ te(yt, {
843
+ index: O.value,
829
844
  "shade-style": e.shadeStyle,
830
- visible: Qe.value,
845
+ visible: qe.value,
831
846
  opacity: e.shadeOpacity,
832
847
  teleport: e.teleport,
833
848
  teleportDisabled: e.teleportDisabled,
834
- onShadeClick: Re
849
+ onShadeClick: Xe
835
850
  }, null, 8, ["index", "shade-style", "visible", "opacity", "teleport", "teleportDisabled"]),
836
- te(rt, {
837
- "enter-active-class": _e.value,
838
- "leave-active-class": We.value
851
+ te(vt, {
852
+ "enter-active-class": Ye.value,
853
+ "leave-active-class": Qe.value,
854
+ onAfterEnter: nt
839
855
  }, {
840
- default: ce(() => [
841
- C.value ? (d(), m("div", {
856
+ default: fe(() => [
857
+ S.value ? (d(), v("div", {
842
858
  key: 0,
843
859
  ref_key: "layerRef",
844
- ref: f,
845
- class: N(["zan-layer zan-layer-border", [Ne.value, { "zan-layer-min": o.value }]]),
846
- id: s.value,
847
- style: V(Pe.value)
860
+ ref: m,
861
+ class: P(["zan-layer zan-layer-border", [Ve.value, { "zan-layer-min": a.value }]]),
862
+ id: r.value,
863
+ style: N(Re.value)
848
864
  }, [
849
- Ue.value ? (d(), A(xt, {
865
+ Ke.value ? (d(), M(kt, {
850
866
  key: 0,
851
867
  title: e.title,
852
868
  titleStyle: e.titleStyle,
853
869
  move: e.move,
854
- onMousedown: qe
870
+ onMousedown: et
855
871
  }, {
856
- default: ce(() => [
857
- ee(v.$slots, "title")
872
+ default: fe(() => [
873
+ ee(c.$slots, "title")
858
874
  ]),
859
875
  _: 3
860
- }, 8, ["title", "titleStyle", "move"])) : p("", !0),
876
+ }, 8, ["title", "titleStyle", "move"])) : h("", !0),
861
877
  B("div", {
862
878
  ref_key: "contentRef",
863
- ref: r,
864
- class: N(["zan-layer-content", Te.value]),
865
- style: V(o.value === !0 ? "display:none" : "")
879
+ ref: f,
880
+ class: P(["zan-layer-content", _e.value]),
881
+ style: N(a.value === !0 ? "display:none" : "")
866
882
  }, [
867
- x(u) === 0 || x(u) === 1 || x(u) === 4 ? (d(), m(R, { key: 0 }, [
868
- e.icon ? (d(), m("i", {
883
+ z(s) === 0 || z(s) === 1 || z(s) === 4 ? (d(), v(W, { key: 0 }, [
884
+ e.icon ? (d(), v("i", {
869
885
  key: 0,
870
- class: N(Ce.value)
871
- }, null, 2)) : p("", !0),
872
- x(i).default ? (d(), m("div", qt, [
873
- ee(v.$slots, "default")
874
- ])) : (d(), m(R, { key: 2 }, [
875
- e.isHtmlFragment ? (d(), m("div", {
886
+ class: P(ke.value)
887
+ }, null, 2)) : h("", !0),
888
+ z(i).default ? (d(), v("div", nn, [
889
+ ee(c.$slots, "default")
890
+ ])) : (d(), v(W, { key: 2 }, [
891
+ e.isHtmlFragment ? (d(), v("div", {
876
892
  key: 0,
877
893
  class: "html-fragment",
878
- innerHTML: x(ne)(t.content)
879
- }, null, 8, Kt)) : (d(), m(R, { key: 1 }, [
880
- t.content ? (d(), A(oe, {
894
+ innerHTML: z(ne)(t.content)
895
+ }, null, 8, ln)) : (d(), v(W, { key: 1 }, [
896
+ t.content ? (d(), M(ie, {
881
897
  key: 0,
882
- render: () => x(ne)(t.content)
883
- }, null, 8, ["render"])) : p("", !0)
898
+ render: () => z(ne)(t.content)
899
+ }, null, 8, ["render"])) : h("", !0)
884
900
  ], 64))
885
901
  ], 64))
886
- ], 64)) : p("", !0),
887
- x(u) === 7 ? (d(), A(Wt, {
902
+ ], 64)) : h("", !0),
903
+ z(s) === 7 ? (d(), M(Zt, {
888
904
  key: 1,
889
- "prompt-value": G.value,
890
- "onUpdate:promptValue": z[0] || (z[0] = (w) => G.value = w),
905
+ "prompt-value": Q.value,
906
+ "onUpdate:promptValue": y[0] || (y[0] = (C) => Q.value = C),
891
907
  formType: t.formType,
892
908
  maxLength: t.maxLength,
893
909
  placeholder: t.placeholder
894
- }, null, 8, ["prompt-value", "formType", "maxLength", "placeholder"])) : p("", !0),
895
- x(u) === 2 ? (d(), A(ft, {
910
+ }, null, 8, ["prompt-value", "formType", "maxLength", "placeholder"])) : h("", !0),
911
+ z(s) === 2 ? (d(), M(ht, {
896
912
  key: 2,
897
913
  src: t.content
898
- }, null, 8, ["src"])) : p("", !0),
899
- x(u) === 5 ? (d(), A(Nt, {
914
+ }, null, 8, ["src"])) : h("", !0),
915
+ z(s) === 5 ? (d(), M(Rt, {
900
916
  key: 3,
901
917
  imgList: t.imgList,
902
918
  startIndex: t.startIndex,
903
- onResetCalculationPohtosArea: Ze
904
- }, null, 8, ["imgList", "startIndex"])) : p("", !0),
905
- x(u) === 6 ? (d(), A(jt, {
919
+ onResetCalculationPohtosArea: Je
920
+ }, null, 8, ["imgList", "startIndex"])) : h("", !0),
921
+ z(s) === 6 ? (d(), M(Yt, {
906
922
  key: 4,
907
- onClose: le,
923
+ onClose: ae,
908
924
  title: t.title,
909
925
  content: t.content,
910
926
  isHtmlFragment: t.isHtmlFragment,
911
927
  icon: t.icon,
912
- iconClass: Ce.value
913
- }, null, 8, ["title", "content", "isHtmlFragment", "icon", "iconClass"])) : p("", !0)
928
+ iconClass: ke.value
929
+ }, null, 8, ["title", "content", "isHtmlFragment", "icon", "iconClass"])) : h("", !0)
914
930
  ], 6),
915
- x(u) != 3 && x(u) != 5 && x(u) != 6 ? (d(), A(Lt, {
931
+ z(s) != 3 && z(s) != 5 && z(s) != 6 ? (d(), M(Ft, {
916
932
  key: 1,
917
933
  maxmin: e.maxmin,
918
- max: c.value,
919
- min: o.value,
934
+ max: u.value,
935
+ min: a.value,
920
936
  closeBtn: e.closeBtn,
921
- onOnMin: ze,
922
- onOnMax: xe,
923
- onOnClose: le
924
- }, null, 8, ["maxmin", "max", "min", "closeBtn"])) : p("", !0),
937
+ onOnMin: we,
938
+ onOnMax: ze,
939
+ onOnClose: ae
940
+ }, null, 8, ["maxmin", "max", "min", "closeBtn"])) : h("", !0),
925
941
  B("div", {
926
- style: V(o.value === !0 ? "display:none" : "")
942
+ style: N(a.value === !0 ? "display:none" : "")
927
943
  }, [
928
- x(i).footer || t.footer ? (d(), A(bt, {
944
+ z(i).footer || t.footer ? (d(), M(Lt, {
929
945
  key: 0,
930
946
  footer: t.footer,
931
947
  footerStyle: t.footerStyle
932
948
  }, {
933
- default: ce(() => [
934
- ee(v.$slots, "footer")
949
+ default: fe(() => [
950
+ ee(c.$slots, "footer")
935
951
  ]),
936
952
  _: 3
937
- }, 8, ["footer", "footerStyle"])) : (d(), m(R, { key: 1 }, [
938
- (e.btn && e.btn.length > 0 || x(u) === 0 || x(u) === 7) && !e.isMessage ? (d(), m("div", {
953
+ }, 8, ["footer", "footerStyle"])) : (d(), v(W, { key: 1 }, [
954
+ (e.btn && e.btn.length > 0 || z(s) === 0 || z(s) === 7) && !e.isMessage ? (d(), v("div", {
939
955
  key: 0,
940
- class: N(["zan-layer-btn", [`zan-layer-btn-${e.btnAlign}`]])
956
+ class: P(["zan-layer-btn", [`zan-layer-btn-${e.btnAlign}`]])
941
957
  }, [
942
- e.btn && e.btn.length > 0 ? (d(!0), m(R, { key: 0 }, Ee(e.btn, (w, ie) => (d(), m("a", {
943
- key: ie,
944
- style: V(w.style),
945
- class: N([
946
- w.class,
947
- `zan-layer-btn${ie}`,
948
- { "zan-layer-btn-disabled": w.disabled }
958
+ e.btn && e.btn.length > 0 ? (d(!0), v(W, { key: 0 }, De(e.btn, (C, ue) => (d(), v("a", {
959
+ key: ue,
960
+ style: N(C.style),
961
+ class: P([
962
+ C.class,
963
+ `zan-layer-btn${ue}`,
964
+ { "zan-layer-btn-disabled": C.disabled }
949
965
  ]),
950
- onClick: (tt) => !w.disabled && (x(u) === 7 ? w.callback(s.value, G.value) : w.callback(s.value))
951
- }, P(w.text), 15, Jt))), 128)) : (d(), m(R, { key: 1 }, [
952
- x(u) === 0 || x(u) === 7 ? (d(), m("a", {
966
+ onClick: (st) => !C.disabled && (z(s) === 7 ? C.callback(r.value, Q.value) : C.callback(r.value))
967
+ }, T(C.text), 15, an))), 128)) : (d(), v(W, { key: 1 }, [
968
+ z(s) === 0 || z(s) === 7 ? (d(), v("a", {
953
969
  key: 0,
954
970
  class: "zan-layer-btn0",
955
- onClick: z[1] || (z[1] = (w) => je(s.value, G.value))
956
- }, P(e.yesText), 1)) : p("", !0)
971
+ onClick: y[1] || (y[1] = (C) => We(r.value, Q.value))
972
+ }, T(e.yesText), 1)) : h("", !0)
957
973
  ], 64))
958
- ], 2)) : p("", !0)
974
+ ], 2)) : h("", !0)
959
975
  ], 64))
960
976
  ], 4),
961
- Ge.value ? (d(), m("span", en)) : p("", !0)
962
- ], 14, Zt)) : p("", !0)
977
+ Ue.value ? (d(), v("span", on)) : h("", !0)
978
+ ], 14, tn)) : h("", !0)
963
979
  ]),
964
980
  _: 3
965
981
  }, 8, ["enter-active-class", "leave-active-class"])
966
982
  ], 8, ["to", "disabled"]));
967
983
  }
968
- }), T = [], tn = (e) => {
969
- T.push(e);
970
- }, fe = (e) => {
971
- T.forEach((n, l) => {
972
- n.modalContainer.id === e && T.splice(l, 1);
984
+ }), V = [], sn = (e) => {
985
+ V.push(e);
986
+ }, ve = (e) => {
987
+ V.forEach((n, l) => {
988
+ n.modalContainer.id === e && V.splice(l, 1);
973
989
  });
974
- }, nn = () => {
975
- T.splice(0, T.length);
976
- }, K = (e) => {
990
+ }, rn = () => {
991
+ V.splice(0, V.length);
992
+ }, U = (e) => {
977
993
  let n = !1;
978
- return T.forEach((l, t) => {
994
+ return V.forEach((l, t) => {
979
995
  l.modalContainer.id == e && (n = !0);
980
996
  }), n;
981
- }, J = (e) => {
997
+ }, K = (e) => {
982
998
  let n = null;
983
- return T.forEach((l, t) => {
999
+ return V.forEach((l, t) => {
984
1000
  l.modalContainer.id === e && (n = l);
985
1001
  }), n;
986
- }, ln = (e, n) => (e && (n = Object.assign(n, e)), n), an = (e) => {
1002
+ }, un = (e, n) => (e && (n = Object.assign(n, e)), n), cn = (e) => {
987
1003
  const n = document.createElement("div");
988
1004
  return n.id = e.id, document.body.appendChild(n), n;
989
- }, on = (e) => typeof e == "function" ? Se(e()) ? { default: () => e() } : void 0 : Se(e) ? { default: () => e } : void 0, L = {
1005
+ }, dn = (e) => typeof e == "function" ? Ie(e()) ? { default: () => e() } : void 0 : Ie(e) ? { default: () => e } : void 0, I = {
990
1006
  _context: null,
991
1007
  // 打开弹窗
992
1008
  open: (e) => {
993
1009
  const n = {};
994
- return L.create(e, n);
1010
+ return I.create(e, n);
995
1011
  },
996
1012
  // 抽屉
997
1013
  drawer: (e) => {
998
1014
  const n = {
999
1015
  type: "drawer"
1000
1016
  };
1001
- return L.create(e, n);
1017
+ return I.create(e, n);
1002
1018
  },
1003
1019
  // 消息
1004
1020
  msg: (e, n = {}, l) => {
@@ -1013,7 +1029,7 @@ const Zt = ["id"], qt = {
1013
1029
  btn: void 0,
1014
1030
  time: 2e3
1015
1031
  };
1016
- return L.create(n, t, l);
1032
+ return I.create(n, t, l);
1017
1033
  },
1018
1034
  // 加载
1019
1035
  load: (e = 0, n = {}) => {
@@ -1026,7 +1042,7 @@ const Zt = ["id"], qt = {
1026
1042
  shade: !0,
1027
1043
  shadeOpacity: "0.3"
1028
1044
  };
1029
- return L.create(n, l);
1045
+ return I.create(n, l);
1030
1046
  },
1031
1047
  // 确认
1032
1048
  confirm: (e, n = {}) => {
@@ -1035,7 +1051,7 @@ const Zt = ["id"], qt = {
1035
1051
  content: e,
1036
1052
  shadeClose: !1
1037
1053
  };
1038
- return L.create(n, l);
1054
+ return I.create(n, l);
1039
1055
  },
1040
1056
  // 通知
1041
1057
  notify: (e, n) => {
@@ -1046,7 +1062,7 @@ const Zt = ["id"], qt = {
1046
1062
  area: "auto",
1047
1063
  shade: !1
1048
1064
  };
1049
- return L.create(e, l, n);
1065
+ return I.create(e, l, n);
1050
1066
  },
1051
1067
  // 图片预览
1052
1068
  photos: (e) => {
@@ -1061,7 +1077,7 @@ const Zt = ["id"], qt = {
1061
1077
  shadeClose: !0,
1062
1078
  shadeOpacity: "0.2"
1063
1079
  };
1064
- return L.create(e, n);
1080
+ return I.create(e, n);
1065
1081
  },
1066
1082
  // 输入层
1067
1083
  prompt: (e) => {
@@ -1071,81 +1087,85 @@ const Zt = ["id"], qt = {
1071
1087
  shadeClose: !1,
1072
1088
  shadeOpacity: "0.2"
1073
1089
  };
1074
- return L.create(e, n);
1090
+ return I.create(e, n);
1075
1091
  },
1076
1092
  // 创建弹窗
1077
1093
  create: (e, n, l) => {
1078
- var o, s;
1094
+ var a, r;
1079
1095
  let t;
1080
- const a = ln(e, n);
1081
- a.hasOwnProperty("id") ? L.close(a.id) : a.id = Me();
1082
- const i = an(a), c = He(
1083
- ve,
1096
+ const o = un(e, n);
1097
+ o.hasOwnProperty("id") ? I.close(o.id) : o.id = Pe();
1098
+ const i = cn(o), u = Me(
1099
+ pe,
1084
1100
  {
1085
- ...a,
1101
+ ...o,
1086
1102
  isFunction: !0,
1087
1103
  internalDestroy() {
1088
- var f, r;
1089
- t && clearTimeout(t), (r = (f = c.component) == null ? void 0 : f.exposed) == null || r.close(), setTimeout(() => {
1104
+ var m, f;
1105
+ t && clearTimeout(t), (f = (m = u.component) == null ? void 0 : m.exposed) == null || f.close(), setTimeout(() => {
1090
1106
  Z(null, i), document.body.contains(i) && document.body.removeChild(i);
1091
- }, 500), fe(i.id);
1107
+ }, 500), ve(i.id);
1092
1108
  }
1093
1109
  },
1094
- on(a.content)
1110
+ dn(o.content)
1095
1111
  );
1096
- return c.appContext = a.appContext || L._context, Z(c, i), (s = (o = c.component) == null ? void 0 : o.exposed) == null || s.open(), n && n.time != null && n.time != 0 && (t = setTimeout(() => {
1097
- var f, r;
1098
- (r = (f = c.component) == null ? void 0 : f.exposed) == null || r.close(), l && l(i.id), setTimeout(() => {
1112
+ return u.appContext = o.appContext || I._context, Z(u, i), (r = (a = u.component) == null ? void 0 : a.exposed) == null || r.open(), n && n.time != null && n.time != 0 && (t = setTimeout(() => {
1113
+ var m, f;
1114
+ (f = (m = u.component) == null ? void 0 : m.exposed) == null || f.close(), l && l(i.id), setTimeout(() => {
1099
1115
  Z(null, i), document.body.contains(i) && document.body.removeChild(i);
1100
- }, 500), fe(i.id);
1101
- }, n.time)), tn({ modalContainer: i, modalInstance: c }), i.id;
1116
+ }, 500), ve(i.id);
1117
+ }, n.time)), sn({ modalContainer: i, modalInstance: u }), i.id;
1102
1118
  },
1103
1119
  // 关闭弹窗
1104
1120
  close: (e) => {
1105
1121
  var n, l;
1106
- if (e != null && K(e)) {
1107
- const t = J(e);
1122
+ if (e != null && U(e)) {
1123
+ const t = K(e);
1108
1124
  (l = (n = t.modalInstance.component) == null ? void 0 : n.exposed) == null || l.close(), setTimeout(() => {
1109
1125
  Z(null, t.modalContainer), document.body.contains(t.modalContainer) && document.body.removeChild(t.modalContainer);
1110
1126
  }, 500);
1111
1127
  }
1112
- fe(e);
1128
+ ve(e);
1113
1129
  },
1114
1130
  // 关闭所有弹窗
1115
1131
  closeAll: () => {
1116
- T.forEach((e) => {
1132
+ V.forEach((e) => {
1117
1133
  var n, l;
1118
1134
  (l = (n = e.modalInstance.component) == null ? void 0 : n.exposed) == null || l.close(), setTimeout(() => {
1119
1135
  Z(null, e.modalContainer), document.body.contains(e.modalContainer) && document.body.removeChild(e.modalContainer);
1120
1136
  }, 500);
1121
- }), nn();
1137
+ }), rn();
1122
1138
  },
1123
1139
  // 重置位置
1124
1140
  reset: (e) => {
1125
1141
  var n, l;
1126
- e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.reset());
1142
+ e != null && U(e) && ((l = (n = K(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.reset());
1127
1143
  },
1128
1144
  // 最小化
1129
1145
  min: (e) => {
1130
1146
  var n, l;
1131
- e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.min());
1147
+ e != null && U(e) && ((l = (n = K(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.min());
1132
1148
  },
1133
1149
  // 最大化
1134
1150
  full: (e) => {
1135
1151
  var n, l;
1136
- e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.full());
1152
+ e != null && U(e) && ((l = (n = K(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.full());
1137
1153
  },
1138
1154
  // 复原最小/最大化
1139
1155
  revert: (e) => {
1140
1156
  var n, l;
1141
- e != null && K(e) && ((l = (n = J(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.revert());
1157
+ e != null && U(e) && ((l = (n = K(e).modalInstance.component) == null ? void 0 : n.exposed) == null || l.revert());
1142
1158
  }
1143
- }, sn = (e, n) => {
1144
- L._context = e._context, e.component(ve.name, ve), e.config.globalProperties.$layer = L, n && typeof n.zIndex == "number" && e.provide(Gt, b(n.zIndex));
1145
- }, rn = { install: sn };
1159
+ }, fn = (e, n) => {
1160
+ I._context = e._context, e.component(pe.name, pe), e.config.globalProperties.$layer = I, n && typeof n.zIndex == "number" && e.provide(Jt, g(n.zIndex));
1161
+ }, vn = {
1162
+ install(e, n) {
1163
+ fn(e, n);
1164
+ }
1165
+ };
1146
1166
  export {
1147
- ve as ZanLayer,
1148
- rn as default,
1149
- L as layer,
1150
- L as zanLayer
1167
+ pe as ZanLayer,
1168
+ vn as default,
1169
+ I as layer,
1170
+ I as zanLayer
1151
1171
  };