zan-layer 1.0.7 → 1.0.8

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