zan-layer 1.0.3 → 1.0.6

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