mediacube-ui-v2 0.0.184 → 0.0.186
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/dist/index-BKmKlyQ0.js +1443 -0
- package/dist/index-D46EyQps.js +26549 -0
- package/dist/mediacube-ui-v2.js +158 -27376
- package/dist/mediacube-ui-v2.umd.cjs +8 -7
- package/dist/types/utils/sanitize.d.ts +2 -0
- package/package.json +4 -4
|
@@ -0,0 +1,1443 @@
|
|
|
1
|
+
import { g as da } from "./index-D46EyQps.js";
|
|
2
|
+
function pa(kt, ue) {
|
|
3
|
+
for (var L = 0; L < ue.length; L++) {
|
|
4
|
+
const X = ue[L];
|
|
5
|
+
if (typeof X != "string" && !Array.isArray(X)) {
|
|
6
|
+
for (const J in X)
|
|
7
|
+
if (J !== "default" && !(J in kt)) {
|
|
8
|
+
const Et = Object.getOwnPropertyDescriptor(X, J);
|
|
9
|
+
Et && Object.defineProperty(kt, J, Et.get ? Et : {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: () => X[J]
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return Object.freeze(Object.defineProperty(kt, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
}
|
|
18
|
+
var fn = { exports: {} };
|
|
19
|
+
(function(kt, ue) {
|
|
20
|
+
(function(L, X) {
|
|
21
|
+
kt.exports = X();
|
|
22
|
+
})(self, function() {
|
|
23
|
+
return (() => {
|
|
24
|
+
var L = { d: (t, e) => {
|
|
25
|
+
for (var i in e) L.o(e, i) && !L.o(t, i) && Object.defineProperty(t, i, { enumerable: !0, get: e[i] });
|
|
26
|
+
} };
|
|
27
|
+
L.g = function() {
|
|
28
|
+
if (typeof globalThis == "object") return globalThis;
|
|
29
|
+
try {
|
|
30
|
+
return this || new Function("return this")();
|
|
31
|
+
} catch {
|
|
32
|
+
if (typeof window == "object") return window;
|
|
33
|
+
}
|
|
34
|
+
}(), L.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), L.r = (t) => {
|
|
35
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
|
|
36
|
+
};
|
|
37
|
+
var X = {};
|
|
38
|
+
function J(t, e) {
|
|
39
|
+
const i = /* @__PURE__ */ Object.create(null), n = t.split(",");
|
|
40
|
+
for (let a = 0; a < n.length; a++) i[n[a]] = !0;
|
|
41
|
+
return (a) => !!i[a];
|
|
42
|
+
}
|
|
43
|
+
L.r(X), L.d(X, { Version: () => ca, default: () => la, v3Cropper: () => hn });
|
|
44
|
+
const Et = J("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");
|
|
45
|
+
function de(t) {
|
|
46
|
+
if (S(t)) {
|
|
47
|
+
const e = {};
|
|
48
|
+
for (let i = 0; i < t.length; i++) {
|
|
49
|
+
const n = t[i], a = de(ut(n) ? yn(n) : n);
|
|
50
|
+
if (a) for (const r in a) e[r] = a[r];
|
|
51
|
+
}
|
|
52
|
+
return e;
|
|
53
|
+
}
|
|
54
|
+
if (F(t)) return t;
|
|
55
|
+
}
|
|
56
|
+
const mn = /;(?![^(]*\))/g, vn = /:(.+)/;
|
|
57
|
+
function yn(t) {
|
|
58
|
+
const e = {};
|
|
59
|
+
return t.split(mn).forEach((i) => {
|
|
60
|
+
if (i) {
|
|
61
|
+
const n = i.split(vn);
|
|
62
|
+
n.length > 1 && (e[n[0].trim()] = n[1].trim());
|
|
63
|
+
}
|
|
64
|
+
}), e;
|
|
65
|
+
}
|
|
66
|
+
function pe(t) {
|
|
67
|
+
let e = "";
|
|
68
|
+
if (ut(t)) e = t;
|
|
69
|
+
else if (S(t)) for (let i = 0; i < t.length; i++) {
|
|
70
|
+
const n = pe(t[i]);
|
|
71
|
+
n && (e += n + " ");
|
|
72
|
+
}
|
|
73
|
+
else if (F(t)) for (const i in t) t[i] && (e += i + " ");
|
|
74
|
+
return e.trim();
|
|
75
|
+
}
|
|
76
|
+
const Q = {}, bn = () => {
|
|
77
|
+
}, wn = /^on[^a-z]/, xn = (t) => wn.test(t), lt = Object.assign, Mn = Object.prototype.hasOwnProperty, O = (t, e) => Mn.call(t, e), S = Array.isArray, Nt = (t) => ge(t) === "[object Map]", U = (t) => typeof t == "function", ut = (t) => typeof t == "string", fe = (t) => typeof t == "symbol", F = (t) => t !== null && typeof t == "object", Cn = Object.prototype.toString, ge = (t) => Cn.call(t), me = (t) => ut(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t, ve = (t, e) => t !== e && (t == t || e == e), ye = /* @__PURE__ */ new WeakMap(), Tt = [];
|
|
78
|
+
let dt;
|
|
79
|
+
const pt = Symbol(""), be = Symbol("");
|
|
80
|
+
function Dn(t, e = Q) {
|
|
81
|
+
(function(n) {
|
|
82
|
+
return n && n._isEffect === !0;
|
|
83
|
+
})(t) && (t = t.raw);
|
|
84
|
+
const i = function(n, a) {
|
|
85
|
+
const r = function() {
|
|
86
|
+
if (!r.active) return a.scheduler ? void 0 : n();
|
|
87
|
+
if (!Tt.includes(r)) {
|
|
88
|
+
Ge(r);
|
|
89
|
+
try {
|
|
90
|
+
return we.push(yt), yt = !0, Tt.push(r), dt = r, n();
|
|
91
|
+
} finally {
|
|
92
|
+
Tt.pop(), Je(), dt = Tt[Tt.length - 1];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return r.id = Bn++, r.allowRecurse = !!a.allowRecurse, r._isEffect = !0, r.active = !0, r.raw = n, r.deps = [], r.options = a, r;
|
|
97
|
+
}(t, e);
|
|
98
|
+
return e.lazy || i(), i;
|
|
99
|
+
}
|
|
100
|
+
function _n(t) {
|
|
101
|
+
t.active && (Ge(t), t.options.onStop && t.options.onStop(), t.active = !1);
|
|
102
|
+
}
|
|
103
|
+
let Bn = 0;
|
|
104
|
+
function Ge(t) {
|
|
105
|
+
const { deps: e } = t;
|
|
106
|
+
if (e.length) {
|
|
107
|
+
for (let i = 0; i < e.length; i++) e[i].delete(t);
|
|
108
|
+
e.length = 0;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
let yt = !0;
|
|
112
|
+
const we = [];
|
|
113
|
+
function On() {
|
|
114
|
+
we.push(yt), yt = !1;
|
|
115
|
+
}
|
|
116
|
+
function Je() {
|
|
117
|
+
const t = we.pop();
|
|
118
|
+
yt = t === void 0 || t;
|
|
119
|
+
}
|
|
120
|
+
function P(t, e, i) {
|
|
121
|
+
if (!yt || dt === void 0) return;
|
|
122
|
+
let n = ye.get(t);
|
|
123
|
+
n || ye.set(t, n = /* @__PURE__ */ new Map());
|
|
124
|
+
let a = n.get(i);
|
|
125
|
+
a || n.set(i, a = /* @__PURE__ */ new Set()), a.has(dt) || (a.add(dt), dt.deps.push(a));
|
|
126
|
+
}
|
|
127
|
+
function tt(t, e, i, n, a, r) {
|
|
128
|
+
const o = ye.get(t);
|
|
129
|
+
if (!o) return;
|
|
130
|
+
const h = /* @__PURE__ */ new Set(), c = (s) => {
|
|
131
|
+
s && s.forEach((l) => {
|
|
132
|
+
(l !== dt || l.allowRecurse) && h.add(l);
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
if (e === "clear") o.forEach(c);
|
|
136
|
+
else if (i === "length" && S(t)) o.forEach((s, l) => {
|
|
137
|
+
(l === "length" || l >= n) && c(s);
|
|
138
|
+
});
|
|
139
|
+
else switch (i !== void 0 && c(o.get(i)), e) {
|
|
140
|
+
case "add":
|
|
141
|
+
S(t) ? me(i) && c(o.get("length")) : (c(o.get(pt)), Nt(t) && c(o.get(be)));
|
|
142
|
+
break;
|
|
143
|
+
case "delete":
|
|
144
|
+
S(t) || (c(o.get(pt)), Nt(t) && c(o.get(be)));
|
|
145
|
+
break;
|
|
146
|
+
case "set":
|
|
147
|
+
Nt(t) && c(o.get(pt));
|
|
148
|
+
}
|
|
149
|
+
h.forEach((s) => {
|
|
150
|
+
s.options.scheduler ? s.options.scheduler(s) : s();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const Sn = J("__proto__,__v_isRef,__isVue"), ti = new Set(Object.getOwnPropertyNames(Symbol).map((t) => Symbol[t]).filter(fe)), kn = qt(), En = qt(!1, !0), Nn = qt(!0), Tn = qt(!0, !0), Ft = {};
|
|
154
|
+
function qt(t = !1, e = !1) {
|
|
155
|
+
return function(i, n, a) {
|
|
156
|
+
if (n === "__v_isReactive") return !t;
|
|
157
|
+
if (n === "__v_isReadonly") return t;
|
|
158
|
+
if (n === "__v_raw" && a === (t ? e ? zn : fi : e ? jn : pi).get(i)) return i;
|
|
159
|
+
const r = S(i);
|
|
160
|
+
if (!t && r && O(Ft, n)) return Reflect.get(Ft, n, a);
|
|
161
|
+
const o = Reflect.get(i, n, a);
|
|
162
|
+
return (fe(n) ? ti.has(n) : Sn(n)) ? o : (t || P(i, 0, n), e ? o : ft(o) ? r && me(n) ? o : o.value : F(o) ? t ? mi(o) : gi(o) : o);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function ei(t = !1) {
|
|
166
|
+
return function(e, i, n, a) {
|
|
167
|
+
let r = e[i];
|
|
168
|
+
if (!t && (n = B(n), r = B(r), !S(e) && ft(r) && !ft(n))) return r.value = n, !0;
|
|
169
|
+
const o = S(e) && me(i) ? Number(i) < e.length : O(e, i), h = Reflect.set(e, i, n, a);
|
|
170
|
+
return e === B(a) && (o ? ve(n, r) && tt(e, "set", i, n) : tt(e, "add", i, n)), h;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
["includes", "indexOf", "lastIndexOf"].forEach((t) => {
|
|
174
|
+
const e = Array.prototype[t];
|
|
175
|
+
Ft[t] = function(...i) {
|
|
176
|
+
const n = B(this);
|
|
177
|
+
for (let r = 0, o = this.length; r < o; r++) P(n, 0, r + "");
|
|
178
|
+
const a = e.apply(n, i);
|
|
179
|
+
return a === -1 || a === !1 ? e.apply(n, i.map(B)) : a;
|
|
180
|
+
};
|
|
181
|
+
}), ["push", "pop", "shift", "unshift", "splice"].forEach((t) => {
|
|
182
|
+
const e = Array.prototype[t];
|
|
183
|
+
Ft[t] = function(...i) {
|
|
184
|
+
On();
|
|
185
|
+
const n = e.apply(this, i);
|
|
186
|
+
return Je(), n;
|
|
187
|
+
};
|
|
188
|
+
});
|
|
189
|
+
const ii = { get: kn, set: ei(), deleteProperty: function(t, e) {
|
|
190
|
+
const i = O(t, e), n = (t[e], Reflect.deleteProperty(t, e));
|
|
191
|
+
return n && i && tt(t, "delete", e, void 0), n;
|
|
192
|
+
}, has: function(t, e) {
|
|
193
|
+
const i = Reflect.has(t, e);
|
|
194
|
+
return fe(e) && ti.has(e) || P(t, 0, e), i;
|
|
195
|
+
}, ownKeys: function(t) {
|
|
196
|
+
return P(t, 0, S(t) ? "length" : pt), Reflect.ownKeys(t);
|
|
197
|
+
} }, ni = { get: Nn, set: (t, e) => !0, deleteProperty: (t, e) => !0 }, xe = (lt({}, ii, { get: En, set: ei(!0) }), lt({}, ni, { get: Tn }), (t) => F(t) ? gi(t) : t), Me = (t) => F(t) ? mi(t) : t, Ce = (t) => t, Vt = (t) => Reflect.getPrototypeOf(t);
|
|
198
|
+
function Kt(t, e, i = !1, n = !1) {
|
|
199
|
+
const a = B(t = t.__v_raw), r = B(e);
|
|
200
|
+
e !== r && !i && P(a, 0, e), !i && P(a, 0, r);
|
|
201
|
+
const { has: o } = Vt(a), h = n ? Ce : i ? Me : xe;
|
|
202
|
+
return o.call(a, e) ? h(t.get(e)) : o.call(a, r) ? h(t.get(r)) : void 0;
|
|
203
|
+
}
|
|
204
|
+
function Qt(t, e = !1) {
|
|
205
|
+
const i = this.__v_raw, n = B(i), a = B(t);
|
|
206
|
+
return t !== a && !e && P(n, 0, t), !e && P(n, 0, a), t === a ? i.has(t) : i.has(t) || i.has(a);
|
|
207
|
+
}
|
|
208
|
+
function Zt(t, e = !1) {
|
|
209
|
+
return t = t.__v_raw, !e && P(B(t), 0, pt), Reflect.get(t, "size", t);
|
|
210
|
+
}
|
|
211
|
+
function ai(t) {
|
|
212
|
+
t = B(t);
|
|
213
|
+
const e = B(this);
|
|
214
|
+
return Vt(e).has.call(e, t) || (e.add(t), tt(e, "add", t, t)), this;
|
|
215
|
+
}
|
|
216
|
+
function ri(t, e) {
|
|
217
|
+
e = B(e);
|
|
218
|
+
const i = B(this), { has: n, get: a } = Vt(i);
|
|
219
|
+
let r = n.call(i, t);
|
|
220
|
+
r || (t = B(t), r = n.call(i, t));
|
|
221
|
+
const o = a.call(i, t);
|
|
222
|
+
return i.set(t, e), r ? ve(e, o) && tt(i, "set", t, e) : tt(i, "add", t, e), this;
|
|
223
|
+
}
|
|
224
|
+
function oi(t) {
|
|
225
|
+
const e = B(this), { has: i, get: n } = Vt(e);
|
|
226
|
+
let a = i.call(e, t);
|
|
227
|
+
a || (t = B(t), a = i.call(e, t)), n && n.call(e, t);
|
|
228
|
+
const r = e.delete(t);
|
|
229
|
+
return a && tt(e, "delete", t, void 0), r;
|
|
230
|
+
}
|
|
231
|
+
function si() {
|
|
232
|
+
const t = B(this), e = t.size !== 0, i = t.clear();
|
|
233
|
+
return e && tt(t, "clear", void 0, void 0), i;
|
|
234
|
+
}
|
|
235
|
+
function Gt(t, e) {
|
|
236
|
+
return function(i, n) {
|
|
237
|
+
const a = this, r = a.__v_raw, o = B(r), h = e ? Ce : t ? Me : xe;
|
|
238
|
+
return !t && P(o, 0, pt), r.forEach((c, s) => i.call(n, h(c), h(s), a));
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function Jt(t, e, i) {
|
|
242
|
+
return function(...n) {
|
|
243
|
+
const a = this.__v_raw, r = B(a), o = Nt(r), h = t === "entries" || t === Symbol.iterator && o, c = t === "keys" && o, s = a[t](...n), l = i ? Ce : e ? Me : xe;
|
|
244
|
+
return !e && P(r, 0, c ? be : pt), { next() {
|
|
245
|
+
const { value: u, done: d } = s.next();
|
|
246
|
+
return d ? { value: u, done: d } : { value: h ? [l(u[0]), l(u[1])] : l(u), done: d };
|
|
247
|
+
}, [Symbol.iterator]() {
|
|
248
|
+
return this;
|
|
249
|
+
} };
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function et(t) {
|
|
253
|
+
return function(...e) {
|
|
254
|
+
return t !== "delete" && this;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
const hi = { get(t) {
|
|
258
|
+
return Kt(this, t);
|
|
259
|
+
}, get size() {
|
|
260
|
+
return Zt(this);
|
|
261
|
+
}, has: Qt, add: ai, set: ri, delete: oi, clear: si, forEach: Gt(!1, !1) }, ci = { get(t) {
|
|
262
|
+
return Kt(this, t, !1, !0);
|
|
263
|
+
}, get size() {
|
|
264
|
+
return Zt(this);
|
|
265
|
+
}, has: Qt, add: ai, set: ri, delete: oi, clear: si, forEach: Gt(!1, !0) }, li = { get(t) {
|
|
266
|
+
return Kt(this, t, !0);
|
|
267
|
+
}, get size() {
|
|
268
|
+
return Zt(this, !0);
|
|
269
|
+
}, has(t) {
|
|
270
|
+
return Qt.call(this, t, !0);
|
|
271
|
+
}, add: et("add"), set: et("set"), delete: et("delete"), clear: et("clear"), forEach: Gt(!0, !1) }, ui = { get(t) {
|
|
272
|
+
return Kt(this, t, !0, !0);
|
|
273
|
+
}, get size() {
|
|
274
|
+
return Zt(this, !0);
|
|
275
|
+
}, has(t) {
|
|
276
|
+
return Qt.call(this, t, !0);
|
|
277
|
+
}, add: et("add"), set: et("set"), delete: et("delete"), clear: et("clear"), forEach: Gt(!0, !0) };
|
|
278
|
+
function di(t, e) {
|
|
279
|
+
const i = e ? t ? ui : ci : t ? li : hi;
|
|
280
|
+
return (n, a, r) => a === "__v_isReactive" ? !t : a === "__v_isReadonly" ? t : a === "__v_raw" ? n : Reflect.get(O(i, a) && a in n ? i : n, a, r);
|
|
281
|
+
}
|
|
282
|
+
["keys", "values", "entries", Symbol.iterator].forEach((t) => {
|
|
283
|
+
hi[t] = Jt(t, !1, !1), li[t] = Jt(t, !0, !1), ci[t] = Jt(t, !1, !0), ui[t] = Jt(t, !0, !0);
|
|
284
|
+
});
|
|
285
|
+
const Rn = { get: di(!1, !1) }, Wn = { get: di(!0, !1) }, pi = /* @__PURE__ */ new WeakMap(), jn = /* @__PURE__ */ new WeakMap(), fi = /* @__PURE__ */ new WeakMap(), zn = /* @__PURE__ */ new WeakMap();
|
|
286
|
+
function gi(t) {
|
|
287
|
+
return t && t.__v_isReadonly ? t : vi(t, !1, ii, Rn, pi);
|
|
288
|
+
}
|
|
289
|
+
function mi(t) {
|
|
290
|
+
return vi(t, !0, ni, Wn, fi);
|
|
291
|
+
}
|
|
292
|
+
function vi(t, e, i, n, a) {
|
|
293
|
+
if (!F(t) || t.__v_raw && (!e || !t.__v_isReactive)) return t;
|
|
294
|
+
const r = a.get(t);
|
|
295
|
+
if (r) return r;
|
|
296
|
+
const o = (h = t).__v_skip || !Object.isExtensible(h) ? 0 : function(s) {
|
|
297
|
+
switch (s) {
|
|
298
|
+
case "Object":
|
|
299
|
+
case "Array":
|
|
300
|
+
return 1;
|
|
301
|
+
case "Map":
|
|
302
|
+
case "Set":
|
|
303
|
+
case "WeakMap":
|
|
304
|
+
case "WeakSet":
|
|
305
|
+
return 2;
|
|
306
|
+
default:
|
|
307
|
+
return 0;
|
|
308
|
+
}
|
|
309
|
+
}(((s) => ge(s).slice(8, -1))(h));
|
|
310
|
+
var h;
|
|
311
|
+
if (o === 0) return t;
|
|
312
|
+
const c = new Proxy(t, o === 2 ? n : i);
|
|
313
|
+
return a.set(t, c), c;
|
|
314
|
+
}
|
|
315
|
+
function te(t) {
|
|
316
|
+
return yi(t) ? te(t.__v_raw) : !(!t || !t.__v_isReactive);
|
|
317
|
+
}
|
|
318
|
+
function yi(t) {
|
|
319
|
+
return !(!t || !t.__v_isReadonly);
|
|
320
|
+
}
|
|
321
|
+
function bi(t) {
|
|
322
|
+
return te(t) || yi(t);
|
|
323
|
+
}
|
|
324
|
+
function B(t) {
|
|
325
|
+
return t && B(t.__v_raw) || t;
|
|
326
|
+
}
|
|
327
|
+
function ft(t) {
|
|
328
|
+
return !!(t && t.__v_isRef === !0);
|
|
329
|
+
}
|
|
330
|
+
function bt(t, e, i, n) {
|
|
331
|
+
let a;
|
|
332
|
+
try {
|
|
333
|
+
a = n ? t(...n) : t();
|
|
334
|
+
} catch (r) {
|
|
335
|
+
wi(r, e, i);
|
|
336
|
+
}
|
|
337
|
+
return a;
|
|
338
|
+
}
|
|
339
|
+
function De(t, e, i, n) {
|
|
340
|
+
if (U(t)) {
|
|
341
|
+
const o = bt(t, e, i, n);
|
|
342
|
+
return o && F(a = o) && U(a.then) && U(a.catch) && o.catch((h) => {
|
|
343
|
+
wi(h, e, i);
|
|
344
|
+
}), o;
|
|
345
|
+
}
|
|
346
|
+
var a;
|
|
347
|
+
const r = [];
|
|
348
|
+
for (let o = 0; o < t.length; o++) r.push(De(t[o], e, i, n));
|
|
349
|
+
return r;
|
|
350
|
+
}
|
|
351
|
+
function wi(t, e, i, n = !0) {
|
|
352
|
+
if (e && e.vnode, e) {
|
|
353
|
+
let a = e.parent;
|
|
354
|
+
const r = e.proxy, o = i;
|
|
355
|
+
for (; a; ) {
|
|
356
|
+
const c = a.ec;
|
|
357
|
+
if (c) {
|
|
358
|
+
for (let s = 0; s < c.length; s++) if (c[s](t, r, o) === !1) return;
|
|
359
|
+
}
|
|
360
|
+
a = a.parent;
|
|
361
|
+
}
|
|
362
|
+
const h = e.appContext.config.errorHandler;
|
|
363
|
+
if (h) return void bt(h, null, 10, [t, r, o]);
|
|
364
|
+
}
|
|
365
|
+
(function(a, r, o, h = !0) {
|
|
366
|
+
console.error(a);
|
|
367
|
+
})(t, 0, 0, n);
|
|
368
|
+
}
|
|
369
|
+
let ee = !1, _e = !1;
|
|
370
|
+
const q = [];
|
|
371
|
+
let it = 0;
|
|
372
|
+
const ie = [];
|
|
373
|
+
let Rt = null, wt = 0;
|
|
374
|
+
const Wt = [];
|
|
375
|
+
let nt = null, xt = 0;
|
|
376
|
+
const xi = Promise.resolve();
|
|
377
|
+
let Be = null, Oe = null;
|
|
378
|
+
function Hn(t) {
|
|
379
|
+
const e = Be || xi;
|
|
380
|
+
return t ? e.then(this ? t.bind(this) : t) : e;
|
|
381
|
+
}
|
|
382
|
+
function Mi() {
|
|
383
|
+
ee || _e || (_e = !0, Be = xi.then(_i));
|
|
384
|
+
}
|
|
385
|
+
function Ci(t, e, i, n) {
|
|
386
|
+
S(t) ? i.push(...t) : e && e.includes(t, t.allowRecurse ? n + 1 : n) || i.push(t), Mi();
|
|
387
|
+
}
|
|
388
|
+
function Di(t, e = null) {
|
|
389
|
+
if (ie.length) {
|
|
390
|
+
for (Oe = e, Rt = [...new Set(ie)], ie.length = 0, wt = 0; wt < Rt.length; wt++) Rt[wt]();
|
|
391
|
+
Rt = null, wt = 0, Oe = null, Di(t, e);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
const Mt = (t) => t.id == null ? 1 / 0 : t.id;
|
|
395
|
+
function _i(t) {
|
|
396
|
+
_e = !1, ee = !0, Di(t), q.sort((e, i) => Mt(e) - Mt(i));
|
|
397
|
+
try {
|
|
398
|
+
for (it = 0; it < q.length; it++) {
|
|
399
|
+
const e = q[it];
|
|
400
|
+
e && bt(e, null, 14);
|
|
401
|
+
}
|
|
402
|
+
} finally {
|
|
403
|
+
it = 0, q.length = 0, function(e) {
|
|
404
|
+
if (Wt.length) {
|
|
405
|
+
const i = [...new Set(Wt)];
|
|
406
|
+
if (Wt.length = 0, nt) return void nt.push(...i);
|
|
407
|
+
for (nt = i, nt.sort((n, a) => Mt(n) - Mt(a)), xt = 0; xt < nt.length; xt++) nt[xt]();
|
|
408
|
+
nt = null, xt = 0;
|
|
409
|
+
}
|
|
410
|
+
}(), ee = !1, Be = null, (q.length || Wt.length) && _i(t);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
let An = 0;
|
|
414
|
+
const Bi = (t) => An += t;
|
|
415
|
+
let Se = null;
|
|
416
|
+
function ke(t) {
|
|
417
|
+
return U(t) && (t = t()), S(t) && (t = function(e) {
|
|
418
|
+
let i;
|
|
419
|
+
for (let n = 0; n < e.length; n++) {
|
|
420
|
+
const a = e[n];
|
|
421
|
+
if (!ne(a)) return;
|
|
422
|
+
if (a.type !== Ee || a.children === "v-if") {
|
|
423
|
+
if (i) return;
|
|
424
|
+
i = a;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return i;
|
|
428
|
+
}(t)), Ri(t);
|
|
429
|
+
}
|
|
430
|
+
const Oi = {};
|
|
431
|
+
function In(t, e, { immediate: i, deep: n, flush: a, onTrack: r, onTrigger: o } = Q, h = zi) {
|
|
432
|
+
let c, s, l = !1;
|
|
433
|
+
if (ft(t) ? (c = () => t.value, l = !!t._shallow) : te(t) ? (c = () => t, n = !0) : c = S(t) ? () => t.map((f) => ft(f) ? f.value : te(f) ? Ct(f) : U(f) ? bt(f, h, 2, [h && h.proxy]) : void 0) : U(t) ? e ? () => bt(t, h, 2, [h && h.proxy]) : () => {
|
|
434
|
+
if (!h || !h.isUnmounted) return s && s(), De(t, h, 3, [u]);
|
|
435
|
+
} : bn, e && n) {
|
|
436
|
+
const f = c;
|
|
437
|
+
c = () => Ct(f());
|
|
438
|
+
}
|
|
439
|
+
let u = (f) => {
|
|
440
|
+
s = m.options.onStop = () => {
|
|
441
|
+
bt(f, h, 4);
|
|
442
|
+
};
|
|
443
|
+
}, d = S(t) ? [] : Oi;
|
|
444
|
+
const g = () => {
|
|
445
|
+
if (m.active) if (e) {
|
|
446
|
+
const f = m();
|
|
447
|
+
(n || l || ve(f, d)) && (s && s(), De(e, h, 3, [f, d === Oi ? void 0 : d, u]), d = f);
|
|
448
|
+
} else m();
|
|
449
|
+
};
|
|
450
|
+
let v;
|
|
451
|
+
g.allowRecurse = !!e, v = a === "sync" ? g : a === "post" ? () => Si(g, h && h.suspense) : () => {
|
|
452
|
+
!h || h.isMounted ? function(f) {
|
|
453
|
+
Ci(f, Rt, ie, wt);
|
|
454
|
+
}(g) : g();
|
|
455
|
+
};
|
|
456
|
+
const m = Dn(c, { lazy: !0, onTrack: r, onTrigger: o, scheduler: v });
|
|
457
|
+
return function(f, b = zi) {
|
|
458
|
+
b && (b.effects || (b.effects = [])).push(f);
|
|
459
|
+
}(m, h), e ? i ? g() : d = m() : a === "post" ? Si(m, h && h.suspense) : m(), () => {
|
|
460
|
+
_n(m), h && ((f, b) => {
|
|
461
|
+
const D = f.indexOf(b);
|
|
462
|
+
D > -1 && f.splice(D, 1);
|
|
463
|
+
})(h.effects, m);
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
function $n(t, e, i) {
|
|
467
|
+
const n = this.proxy;
|
|
468
|
+
return In(ut(t) ? () => n[t] : t.bind(n), e.bind(n), i, this);
|
|
469
|
+
}
|
|
470
|
+
function Ct(t, e = /* @__PURE__ */ new Set()) {
|
|
471
|
+
if (!F(t) || e.has(t)) return t;
|
|
472
|
+
if (e.add(t), ft(t)) Ct(t.value, e);
|
|
473
|
+
else if (S(t)) for (let i = 0; i < t.length; i++) Ct(t[i], e);
|
|
474
|
+
else if (ge(t) === "[object Set]" || Nt(t)) t.forEach((i) => {
|
|
475
|
+
Ct(i, e);
|
|
476
|
+
});
|
|
477
|
+
else for (const i in t) Ct(t[i], e);
|
|
478
|
+
return t;
|
|
479
|
+
}
|
|
480
|
+
const Si = function(t, e) {
|
|
481
|
+
e && e.pendingBranch ? S(t) ? e.effects.push(...t) : e.effects.push(t) : Ci(t, nt, Wt, xt);
|
|
482
|
+
}, Ln = Symbol(), ki = Symbol(void 0), Ei = Symbol(void 0), Ee = Symbol(void 0);
|
|
483
|
+
function ne(t) {
|
|
484
|
+
return !!t && t.__v_isVNode === !0;
|
|
485
|
+
}
|
|
486
|
+
const Ni = "__vInternal", Ti = ({ key: t }) => t ?? null, ae = ({ ref: t }) => t != null ? ut(t) || ft(t) || U(t) ? { i: Se, r: t } : t : null, at = function(t, e = null, i = null, n = 0, a = null, r = !1) {
|
|
487
|
+
if (t && t !== Ln || (t = Ee), ne(t)) {
|
|
488
|
+
const s = re(t, e, !0);
|
|
489
|
+
return i && Ne(s, i), s;
|
|
490
|
+
}
|
|
491
|
+
if (o = t, U(o) && "__vccOpts" in o && (t = t.__vccOpts), e) {
|
|
492
|
+
(bi(e) || Ni in e) && (e = lt({}, e));
|
|
493
|
+
let { class: s, style: l } = e;
|
|
494
|
+
s && !ut(s) && (e.class = pe(s)), F(l) && (bi(l) && !S(l) && (l = lt({}, l)), e.style = de(l));
|
|
495
|
+
}
|
|
496
|
+
var o;
|
|
497
|
+
const h = ut(t) ? 1 : ((s) => s.__isSuspense)(t) ? 128 : ((s) => s.__isTeleport)(t) ? 64 : F(t) ? 4 : U(t) ? 2 : 0, c = { __v_isVNode: !0, __v_skip: !0, type: t, props: e, key: e && Ti(e), ref: e && ae(e), scopeId: null, slotScopeIds: null, children: null, component: null, suspense: null, ssContent: null, ssFallback: null, dirs: null, transition: null, el: null, anchor: null, target: null, targetAnchor: null, staticCount: 0, shapeFlag: h, patchFlag: n, dynamicProps: a, dynamicChildren: null, appContext: null };
|
|
498
|
+
if (Ne(c, i), 128 & h) {
|
|
499
|
+
const { content: s, fallback: l } = function(u) {
|
|
500
|
+
const { shapeFlag: d, children: g } = u;
|
|
501
|
+
let v, m;
|
|
502
|
+
return 32 & d ? (v = ke(g.default), m = ke(g.fallback)) : (v = ke(g), m = Ri(null)), { content: v, fallback: m };
|
|
503
|
+
}(c);
|
|
504
|
+
c.ssContent = s, c.ssFallback = l;
|
|
505
|
+
}
|
|
506
|
+
return c;
|
|
507
|
+
};
|
|
508
|
+
function re(t, e, i = !1) {
|
|
509
|
+
const { props: n, ref: a, patchFlag: r, children: o } = t, h = e ? function(...c) {
|
|
510
|
+
const s = lt({}, c[0]);
|
|
511
|
+
for (let l = 1; l < c.length; l++) {
|
|
512
|
+
const u = c[l];
|
|
513
|
+
for (const d in u) if (d === "class") s.class !== u.class && (s.class = pe([s.class, u.class]));
|
|
514
|
+
else if (d === "style") s.style = de([s.style, u.style]);
|
|
515
|
+
else if (xn(d)) {
|
|
516
|
+
const g = s[d], v = u[d];
|
|
517
|
+
g !== v && (s[d] = g ? [].concat(g, u[d]) : v);
|
|
518
|
+
} else d !== "" && (s[d] = u[d]);
|
|
519
|
+
}
|
|
520
|
+
return s;
|
|
521
|
+
}(n || {}, e) : n;
|
|
522
|
+
return { __v_isVNode: !0, __v_skip: !0, type: t.type, props: h, key: h && Ti(h), ref: e && e.ref ? i && a ? S(a) ? a.concat(ae(e)) : [a, ae(e)] : ae(e) : a, scopeId: t.scopeId, slotScopeIds: t.slotScopeIds, children: o, target: t.target, targetAnchor: t.targetAnchor, staticCount: t.staticCount, shapeFlag: t.shapeFlag, patchFlag: e && t.type !== ki ? r === -1 ? 16 : 16 | r : r, dynamicProps: t.dynamicProps, dynamicChildren: t.dynamicChildren, appContext: t.appContext, dirs: t.dirs, transition: t.transition, component: t.component, suspense: t.suspense, ssContent: t.ssContent && re(t.ssContent), ssFallback: t.ssFallback && re(t.ssFallback), el: t.el, anchor: t.anchor };
|
|
523
|
+
}
|
|
524
|
+
function Pn(t = " ", e = 0) {
|
|
525
|
+
return at(Ei, null, t, e);
|
|
526
|
+
}
|
|
527
|
+
function Ri(t) {
|
|
528
|
+
return t == null || typeof t == "boolean" ? at(Ee) : S(t) ? at(ki, null, t) : typeof t == "object" ? t.el === null ? t : re(t) : at(Ei, null, String(t));
|
|
529
|
+
}
|
|
530
|
+
function Ne(t, e) {
|
|
531
|
+
let i = 0;
|
|
532
|
+
const { shapeFlag: n } = t;
|
|
533
|
+
if (e == null) e = null;
|
|
534
|
+
else if (S(e)) i = 16;
|
|
535
|
+
else if (typeof e == "object") {
|
|
536
|
+
if (1 & n || 64 & n) {
|
|
537
|
+
const a = e.default;
|
|
538
|
+
return void (a && (a._c && Bi(1), Ne(t, a()), a._c && Bi(-1)));
|
|
539
|
+
}
|
|
540
|
+
i = 32, !e._ && !(Ni in e) && (e._ctx = Se);
|
|
541
|
+
} else U(e) ? (e = { default: e, _ctx: Se }, i = 32) : (e = String(e), 64 & n ? (i = 16, e = [Pn(e)]) : i = 8);
|
|
542
|
+
t.children = e, t.shapeFlag |= i;
|
|
543
|
+
}
|
|
544
|
+
function oe(t, e, i) {
|
|
545
|
+
const n = i.appContext.config.optionMergeStrategies, { mixins: a, extends: r } = e;
|
|
546
|
+
r && oe(t, r, i), a && a.forEach((o) => oe(t, o, i));
|
|
547
|
+
for (const o in e) n && O(n, o) ? t[o] = n[o](t[o], e[o], i.proxy, o) : t[o] = e[o];
|
|
548
|
+
}
|
|
549
|
+
const Te = (t) => t ? 4 & t.vnode.shapeFlag ? t.exposed ? t.exposed : t.proxy : Te(t.parent) : null, Wi = lt(/* @__PURE__ */ Object.create(null), { $: (t) => t, $el: (t) => t.vnode.el, $data: (t) => t.data, $props: (t) => t.props, $attrs: (t) => t.attrs, $slots: (t) => t.slots, $refs: (t) => t.refs, $parent: (t) => Te(t.parent), $root: (t) => Te(t.root), $emit: (t) => t.emit, $options: (t) => function(e) {
|
|
550
|
+
const i = e.type, { __merged: n, mixins: a, extends: r } = i;
|
|
551
|
+
if (n) return n;
|
|
552
|
+
const o = e.appContext.mixins;
|
|
553
|
+
if (!o.length && !a && !r) return i;
|
|
554
|
+
const h = {};
|
|
555
|
+
return o.forEach((c) => oe(h, c, e)), oe(h, i, e), i.__merged = h;
|
|
556
|
+
}(t), $forceUpdate: (t) => () => function(e) {
|
|
557
|
+
if (!(q.length && q.includes(e, ee && e.allowRecurse ? it + 1 : it) || e === Oe)) {
|
|
558
|
+
const i = function(n) {
|
|
559
|
+
let a = it + 1, r = q.length;
|
|
560
|
+
const o = Mt(n);
|
|
561
|
+
for (; a < r; ) {
|
|
562
|
+
const h = a + r >>> 1;
|
|
563
|
+
Mt(q[h]) < o ? a = h + 1 : r = h;
|
|
564
|
+
}
|
|
565
|
+
return a;
|
|
566
|
+
}(e);
|
|
567
|
+
i > -1 ? q.splice(i, 0, e) : q.push(e), Mi();
|
|
568
|
+
}
|
|
569
|
+
}(t.update), $nextTick: (t) => Hn.bind(t.proxy), $watch: (t) => $n.bind(t) }), ji = { get({ _: t }, e) {
|
|
570
|
+
const { ctx: i, setupState: n, data: a, props: r, accessCache: o, type: h, appContext: c } = t;
|
|
571
|
+
if (e === "__v_skip") return !0;
|
|
572
|
+
let s;
|
|
573
|
+
if (e[0] !== "$") {
|
|
574
|
+
const g = o[e];
|
|
575
|
+
if (g !== void 0) switch (g) {
|
|
576
|
+
case 0:
|
|
577
|
+
return n[e];
|
|
578
|
+
case 1:
|
|
579
|
+
return a[e];
|
|
580
|
+
case 3:
|
|
581
|
+
return i[e];
|
|
582
|
+
case 2:
|
|
583
|
+
return r[e];
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
if (n !== Q && O(n, e)) return o[e] = 0, n[e];
|
|
587
|
+
if (a !== Q && O(a, e)) return o[e] = 1, a[e];
|
|
588
|
+
if ((s = t.propsOptions[0]) && O(s, e)) return o[e] = 2, r[e];
|
|
589
|
+
if (i !== Q && O(i, e)) return o[e] = 3, i[e];
|
|
590
|
+
o[e] = 4;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
const l = Wi[e];
|
|
594
|
+
let u, d;
|
|
595
|
+
return l ? (e === "$attrs" && P(t, 0, e), l(t)) : (u = h.__cssModules) && (u = u[e]) ? u : i !== Q && O(i, e) ? (o[e] = 3, i[e]) : (d = c.config.globalProperties, O(d, e) ? d[e] : void 0);
|
|
596
|
+
}, set({ _: t }, e, i) {
|
|
597
|
+
const { data: n, setupState: a, ctx: r } = t;
|
|
598
|
+
if (a !== Q && O(a, e)) a[e] = i;
|
|
599
|
+
else if (n !== Q && O(n, e)) n[e] = i;
|
|
600
|
+
else if (O(t.props, e)) return !1;
|
|
601
|
+
return !(e[0] === "$" && e.slice(1) in t || (r[e] = i, 0));
|
|
602
|
+
}, has({ _: { data: t, setupState: e, accessCache: i, ctx: n, appContext: a, propsOptions: r } }, o) {
|
|
603
|
+
let h;
|
|
604
|
+
return i[o] !== void 0 || t !== Q && O(t, o) || e !== Q && O(e, o) || (h = r[0]) && O(h, o) || O(n, o) || O(Wi, o) || O(a.config.globalProperties, o);
|
|
605
|
+
} };
|
|
606
|
+
lt({}, ji, { get(t, e) {
|
|
607
|
+
if (e !== Symbol.unscopables) return ji.get(t, e, t);
|
|
608
|
+
}, has: (t, e) => e[0] !== "_" && !Et(e) });
|
|
609
|
+
let zi = null;
|
|
610
|
+
function Hi(t, e, i) {
|
|
611
|
+
const n = arguments.length;
|
|
612
|
+
return n === 2 ? F(e) && !S(e) ? ne(e) ? at(t, null, [e]) : at(t, e) : at(t, null, e) : (n > 3 ? i = Array.prototype.slice.call(arguments, 2) : n === 3 && ne(i) && (i = [i]), at(t, e, i));
|
|
613
|
+
}
|
|
614
|
+
var se = typeof window < "u" && window.document !== void 0, Z = se ? window : {}, Re = !(!se || !Z.document.documentElement) && "ontouchstart" in Z.document.documentElement, We = !!se && "PointerEvent" in Z, x = "cropper", je = "all", Ai = "crop", Ii = "move", $i = "zoom", gt = "e", mt = "w", Dt = "s", rt = "n", jt = "ne", zt = "nw", Ht = "se", At = "sw", ze = "".concat(x, "-crop"), Li = "".concat(x, "-disabled"), E = "".concat(x, "-hidden"), Yn = "".concat(x, "-hide"), He = "".concat(x, "-invisible"), _t = "".concat(x, "-modal"), Ae = "".concat(x, "-move"), It = "".concat(x, "Action"), he = "".concat(x, "Preview"), Pi = "crop", Yi = "move", Ie = "crop", $e = "cropend", Le = "cropmove", Pe = "cropstart", Xi = "dblclick", Ui = We ? "pointerdown" : Re ? "touchstart" : "mousedown", Fi = We ? "pointermove" : Re ? "touchmove" : "mousemove", qi = We ? "pointerup pointercancel" : Re ? "touchend touchcancel" : "mouseup", Vi = "resize", Ki = "wheel", Ye = "zoom", Xn = "image/jpeg", Un = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/, Fn = /^data:/, qn = /^data:image\/jpegbase64,/;
|
|
615
|
+
function Xe(t, e) {
|
|
616
|
+
(e == null || e > t.length) && (e = t.length);
|
|
617
|
+
for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
|
|
618
|
+
return n;
|
|
619
|
+
}
|
|
620
|
+
function Qi(t, e) {
|
|
621
|
+
var i = Object.keys(t);
|
|
622
|
+
if (Object.getOwnPropertySymbols) {
|
|
623
|
+
var n = Object.getOwnPropertySymbols(t);
|
|
624
|
+
e && (n = n.filter(function(a) {
|
|
625
|
+
return Object.getOwnPropertyDescriptor(t, a).enumerable;
|
|
626
|
+
})), i.push.apply(i, n);
|
|
627
|
+
}
|
|
628
|
+
return i;
|
|
629
|
+
}
|
|
630
|
+
function Zi(t) {
|
|
631
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
632
|
+
var i = arguments[e] != null ? arguments[e] : {};
|
|
633
|
+
e % 2 ? Qi(Object(i), !0).forEach(function(n) {
|
|
634
|
+
Vn(t, n, i[n]);
|
|
635
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : Qi(Object(i)).forEach(function(n) {
|
|
636
|
+
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(i, n));
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
return t;
|
|
640
|
+
}
|
|
641
|
+
function Vn(t, e, i) {
|
|
642
|
+
return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
|
|
643
|
+
}
|
|
644
|
+
function Gi(t) {
|
|
645
|
+
return (Gi = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
646
|
+
return typeof e;
|
|
647
|
+
} : function(e) {
|
|
648
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
649
|
+
})(t);
|
|
650
|
+
}
|
|
651
|
+
var Kn = Number.isNaN || Z.isNaN;
|
|
652
|
+
function y(t) {
|
|
653
|
+
return typeof t == "number" && !Kn(t);
|
|
654
|
+
}
|
|
655
|
+
var Ji = function(t) {
|
|
656
|
+
return t > 0 && t < 1 / 0;
|
|
657
|
+
};
|
|
658
|
+
function Ue(t) {
|
|
659
|
+
return t === void 0;
|
|
660
|
+
}
|
|
661
|
+
function vt(t) {
|
|
662
|
+
return Gi(t) === "object" && t !== null;
|
|
663
|
+
}
|
|
664
|
+
var Qn = Object.prototype.hasOwnProperty;
|
|
665
|
+
function ce(t) {
|
|
666
|
+
if (!vt(t)) return !1;
|
|
667
|
+
try {
|
|
668
|
+
var e = t.constructor, i = e.prototype;
|
|
669
|
+
return e && i && Qn.call(i, "isPrototypeOf");
|
|
670
|
+
} catch {
|
|
671
|
+
return !1;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
function ot(t) {
|
|
675
|
+
return typeof t == "function";
|
|
676
|
+
}
|
|
677
|
+
var Zn = Array.prototype.slice;
|
|
678
|
+
function tn(t) {
|
|
679
|
+
return Array.from ? Array.from(t) : Zn.call(t);
|
|
680
|
+
}
|
|
681
|
+
function N(t, e) {
|
|
682
|
+
return t && ot(e) && (Array.isArray(t) || y(t.length) ? tn(t).forEach(function(i, n) {
|
|
683
|
+
e.call(t, i, n, t);
|
|
684
|
+
}) : vt(t) && Object.keys(t).forEach(function(i) {
|
|
685
|
+
e.call(t, t[i], i, t);
|
|
686
|
+
})), t;
|
|
687
|
+
}
|
|
688
|
+
var C = Object.assign || function(t) {
|
|
689
|
+
for (var e = arguments.length, i = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++) i[n - 1] = arguments[n];
|
|
690
|
+
return vt(t) && i.length > 0 && i.forEach(function(a) {
|
|
691
|
+
vt(a) && Object.keys(a).forEach(function(r) {
|
|
692
|
+
t[r] = a[r];
|
|
693
|
+
});
|
|
694
|
+
}), t;
|
|
695
|
+
}, Gn = /\.\d*(?:0|9){12}\d*$/;
|
|
696
|
+
function Bt(t) {
|
|
697
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e11;
|
|
698
|
+
return Gn.test(t) ? Math.round(t * e) / e : t;
|
|
699
|
+
}
|
|
700
|
+
var Jn = /^width|height|left|top|marginLeft|marginTop$/;
|
|
701
|
+
function st(t, e) {
|
|
702
|
+
var i = t.style;
|
|
703
|
+
N(e, function(n, a) {
|
|
704
|
+
Jn.test(a) && y(n) && (n = "".concat(n, "px")), i[a] = n;
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
function _(t, e) {
|
|
708
|
+
if (e) if (y(t.length)) N(t, function(n) {
|
|
709
|
+
_(n, e);
|
|
710
|
+
});
|
|
711
|
+
else if (t.classList) t.classList.add(e);
|
|
712
|
+
else {
|
|
713
|
+
var i = t.className.trim();
|
|
714
|
+
i ? i.indexOf(e) < 0 && (t.className = "".concat(i, " ").concat(e)) : t.className = e;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
function A(t, e) {
|
|
718
|
+
e && (y(t.length) ? N(t, function(i) {
|
|
719
|
+
A(i, e);
|
|
720
|
+
}) : t.classList ? t.classList.remove(e) : t.className.indexOf(e) >= 0 && (t.className = t.className.replace(e, "")));
|
|
721
|
+
}
|
|
722
|
+
function Ot(t, e, i) {
|
|
723
|
+
e && (y(t.length) ? N(t, function(n) {
|
|
724
|
+
Ot(n, e, i);
|
|
725
|
+
}) : i ? _(t, e) : A(t, e));
|
|
726
|
+
}
|
|
727
|
+
var ta = /([a-z\d])([A-Z])/g;
|
|
728
|
+
function Fe(t) {
|
|
729
|
+
return t.replace(ta, "$1-$2").toLowerCase();
|
|
730
|
+
}
|
|
731
|
+
function qe(t, e) {
|
|
732
|
+
return vt(t[e]) ? t[e] : t.dataset ? t.dataset[e] : t.getAttribute("data-".concat(Fe(e)));
|
|
733
|
+
}
|
|
734
|
+
function $t(t, e, i) {
|
|
735
|
+
vt(i) ? t[e] = i : t.dataset ? t.dataset[e] = i : t.setAttribute("data-".concat(Fe(e)), i);
|
|
736
|
+
}
|
|
737
|
+
var en = /\s\s*/, nn = function() {
|
|
738
|
+
var t = !1;
|
|
739
|
+
if (se) {
|
|
740
|
+
var e = !1, i = function() {
|
|
741
|
+
}, n = Object.defineProperty({}, "once", { get: function() {
|
|
742
|
+
return t = !0, e;
|
|
743
|
+
}, set: function(a) {
|
|
744
|
+
e = a;
|
|
745
|
+
} });
|
|
746
|
+
Z.addEventListener("test", i, n), Z.removeEventListener("test", i, n);
|
|
747
|
+
}
|
|
748
|
+
return t;
|
|
749
|
+
}();
|
|
750
|
+
function V(t, e, i) {
|
|
751
|
+
var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, a = i;
|
|
752
|
+
e.trim().split(en).forEach(function(r) {
|
|
753
|
+
if (!nn) {
|
|
754
|
+
var o = t.listeners;
|
|
755
|
+
o && o[r] && o[r][i] && (a = o[r][i], delete o[r][i], Object.keys(o[r]).length === 0 && delete o[r], Object.keys(o).length === 0 && delete t.listeners);
|
|
756
|
+
}
|
|
757
|
+
t.removeEventListener(r, a, n);
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
function K(t, e, i) {
|
|
761
|
+
var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, a = i;
|
|
762
|
+
e.trim().split(en).forEach(function(r) {
|
|
763
|
+
if (n.once && !nn) {
|
|
764
|
+
var o = t.listeners, h = o === void 0 ? {} : o;
|
|
765
|
+
a = function() {
|
|
766
|
+
delete h[r][i], t.removeEventListener(r, a, n);
|
|
767
|
+
for (var c = arguments.length, s = new Array(c), l = 0; l < c; l++) s[l] = arguments[l];
|
|
768
|
+
i.apply(t, s);
|
|
769
|
+
}, h[r] || (h[r] = {}), h[r][i] && t.removeEventListener(r, h[r][i], n), h[r][i] = a, t.listeners = h;
|
|
770
|
+
}
|
|
771
|
+
t.addEventListener(r, a, n);
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
function Lt(t, e, i) {
|
|
775
|
+
var n;
|
|
776
|
+
return ot(Event) && ot(CustomEvent) ? n = new CustomEvent(e, { detail: i, bubbles: !0, cancelable: !0 }) : (n = document.createEvent("CustomEvent")).initCustomEvent(e, !0, !0, i), t.dispatchEvent(n);
|
|
777
|
+
}
|
|
778
|
+
function an(t) {
|
|
779
|
+
var e = t.getBoundingClientRect();
|
|
780
|
+
return { left: e.left + (window.pageXOffset - document.documentElement.clientLeft), top: e.top + (window.pageYOffset - document.documentElement.clientTop) };
|
|
781
|
+
}
|
|
782
|
+
var Ve = Z.location, ea = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
|
|
783
|
+
function rn(t) {
|
|
784
|
+
var e = t.match(ea);
|
|
785
|
+
return e !== null && (e[1] !== Ve.protocol || e[2] !== Ve.hostname || e[3] !== Ve.port);
|
|
786
|
+
}
|
|
787
|
+
function on(t) {
|
|
788
|
+
var e = "timestamp=".concat((/* @__PURE__ */ new Date()).getTime());
|
|
789
|
+
return t + (t.indexOf("?") === -1 ? "?" : "&") + e;
|
|
790
|
+
}
|
|
791
|
+
function Pt(t) {
|
|
792
|
+
var e = t.rotate, i = t.scaleX, n = t.scaleY, a = t.translateX, r = t.translateY, o = [];
|
|
793
|
+
y(a) && a !== 0 && o.push("translateX(".concat(a, "px)")), y(r) && r !== 0 && o.push("translateY(".concat(r, "px)")), y(e) && e !== 0 && o.push("rotate(".concat(e, "deg)")), y(i) && i !== 1 && o.push("scaleX(".concat(i, ")")), y(n) && n !== 1 && o.push("scaleY(".concat(n, ")"));
|
|
794
|
+
var h = o.length ? o.join(" ") : "none";
|
|
795
|
+
return { WebkitTransform: h, msTransform: h, transform: h };
|
|
796
|
+
}
|
|
797
|
+
function le(t, e) {
|
|
798
|
+
var i = t.pageX, n = t.pageY, a = { endX: i, endY: n };
|
|
799
|
+
return e ? a : Zi({ startX: i, startY: n }, a);
|
|
800
|
+
}
|
|
801
|
+
function ht(t) {
|
|
802
|
+
var e = t.aspectRatio, i = t.height, n = t.width, a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "contain", r = Ji(n), o = Ji(i);
|
|
803
|
+
if (r && o) {
|
|
804
|
+
var h = i * e;
|
|
805
|
+
a === "contain" && h > n || a === "cover" && h < n ? i = n / e : n = i * e;
|
|
806
|
+
} else r ? i = n / e : o && (n = i * e);
|
|
807
|
+
return { width: n, height: i };
|
|
808
|
+
}
|
|
809
|
+
function ia(t, e, i, n) {
|
|
810
|
+
var a, r = e.aspectRatio, o = e.naturalWidth, h = e.naturalHeight, c = e.rotate, s = c === void 0 ? 0 : c, l = e.scaleX, u = l === void 0 ? 1 : l, d = e.scaleY, g = d === void 0 ? 1 : d, v = i.aspectRatio, m = i.naturalWidth, f = i.naturalHeight, b = n.fillColor, D = b === void 0 ? "transparent" : b, w = n.imageSmoothingEnabled, T = w === void 0 || w, p = n.imageSmoothingQuality, M = p === void 0 ? "low" : p, k = n.maxWidth, $ = k === void 0 ? 1 / 0 : k, I = n.maxHeight, j = I === void 0 ? 1 / 0 : I, G = n.minWidth, R = G === void 0 ? 0 : G, z = n.minHeight, ct = z === void 0 ? 0 : z, Y = document.createElement("canvas"), H = Y.getContext("2d"), Xt = ht({ aspectRatio: v, width: $, height: j }), Ut = ht({ aspectRatio: v, width: R, height: ct }, "cover"), Qe = Math.min(Xt.width, Math.max(Ut.width, m)), Ze = Math.min(Xt.height, Math.max(Ut.height, f)), cn = ht({ aspectRatio: r, width: $, height: j }), ln = ht({ aspectRatio: r, width: R, height: ct }, "cover"), un = Math.min(cn.width, Math.max(ln.width, o)), dn = Math.min(cn.height, Math.max(ln.height, h)), ua = [-un / 2, -dn / 2, un, dn];
|
|
811
|
+
return Y.width = Bt(Qe), Y.height = Bt(Ze), H.fillStyle = D, H.fillRect(0, 0, Qe, Ze), H.save(), H.translate(Qe / 2, Ze / 2), H.rotate(s * Math.PI / 180), H.scale(u, g), H.imageSmoothingEnabled = T, H.imageSmoothingQuality = M, H.drawImage.apply(H, [t].concat(function(W) {
|
|
812
|
+
if (Array.isArray(W)) return Xe(W);
|
|
813
|
+
}(a = ua.map(function(W) {
|
|
814
|
+
return Math.floor(Bt(W));
|
|
815
|
+
})) || function(W) {
|
|
816
|
+
if (typeof Symbol < "u" && W[Symbol.iterator] != null || W["@@iterator"] != null) return Array.from(W);
|
|
817
|
+
}(a) || function(W, pn) {
|
|
818
|
+
if (W) {
|
|
819
|
+
if (typeof W == "string") return Xe(W, pn);
|
|
820
|
+
var St = Object.prototype.toString.call(W).slice(8, -1);
|
|
821
|
+
return St === "Object" && W.constructor && (St = W.constructor.name), St === "Map" || St === "Set" ? Array.from(W) : St === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(St) ? Xe(W, pn) : void 0;
|
|
822
|
+
}
|
|
823
|
+
}(a) || function() {
|
|
824
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
825
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
826
|
+
}())), H.restore(), Y;
|
|
827
|
+
}
|
|
828
|
+
var sn = String.fromCharCode, na = /^data:.*,/;
|
|
829
|
+
const aa = { methods: { render: function() {
|
|
830
|
+
this.initCanvas(), this.initCropBox(), this.renderCanvas(), this.cropped && this.renderCropBox();
|
|
831
|
+
}, initContainer: function() {
|
|
832
|
+
var t = this.element, e = this.$props, i = this.container, n = this.cropper, a = Number(e.minContainerWidth), r = Number(e.minContainerHeight);
|
|
833
|
+
_(n, E), A(t, E);
|
|
834
|
+
var o = { width: Math.max(i.offsetWidth, a >= 0 ? a : 200), height: Math.max(i.offsetHeight, r >= 0 ? r : 100) };
|
|
835
|
+
this.containerData = o, st(n, { width: o.width, height: o.height }), _(t, E), A(n, E);
|
|
836
|
+
}, initCanvas: function() {
|
|
837
|
+
var t = this.containerData, e = this.imageData, i = this.viewMode, n = Math.abs(e.rotate) % 180 == 90, a = n ? e.naturalHeight : e.naturalWidth, r = n ? e.naturalWidth : e.naturalHeight, o = a / r, h = t.width, c = t.height;
|
|
838
|
+
t.height * o > t.width ? i === 3 ? h = t.height * o : c = t.width / o : i === 3 ? c = t.width / o : h = t.height * o;
|
|
839
|
+
var s = { aspectRatio: o, naturalWidth: a, naturalHeight: r, width: h, height: c };
|
|
840
|
+
this.canvasData = s, this.limited = i === 1 || i === 2, this.limitCanvas(!0, !0), s.width = Math.min(Math.max(s.width, s.minWidth), s.maxWidth), s.height = Math.min(Math.max(s.height, s.minHeight), s.maxHeight), s.left = (t.width - s.width) / 2, s.top = (t.height - s.height) / 2, s.oldLeft = s.left, s.oldTop = s.top, this.initialCanvasData = C({}, s);
|
|
841
|
+
}, limitCanvas: function(t, e) {
|
|
842
|
+
var i = this.$props, n = this.containerData, a = this.canvasData, r = this.cropBoxData, o = i.viewMode, h = a.aspectRatio, c = this.cropped && r;
|
|
843
|
+
if (t) {
|
|
844
|
+
var s = Number(i.minCanvasWidth) || 0, l = Number(i.minCanvasHeight) || 0;
|
|
845
|
+
o > 1 ? (s = Math.max(s, n.width), l = Math.max(l, n.height), o === 3 && (l * h > s ? s = l * h : l = s / h)) : o > 0 && (s ? s = Math.max(s, c ? r.width : 0) : l ? l = Math.max(l, c ? r.height : 0) : c && (s = r.width, (l = r.height) * h > s ? s = l * h : l = s / h));
|
|
846
|
+
var u = ht({ aspectRatio: h, width: s, height: l });
|
|
847
|
+
s = u.width, l = u.height, a.minWidth = s, a.minHeight = l, a.maxWidth = 1 / 0, a.maxHeight = 1 / 0;
|
|
848
|
+
}
|
|
849
|
+
if (e) if (o > (c ? 0 : 1)) {
|
|
850
|
+
var d = n.width - a.width, g = n.height - a.height;
|
|
851
|
+
a.minLeft = Math.min(0, d), a.minTop = Math.min(0, g), a.maxLeft = Math.max(0, d), a.maxTop = Math.max(0, g), c && this.limited && (a.minLeft = Math.min(r.left, r.left + (r.width - a.width)), a.minTop = Math.min(r.top, r.top + (r.height - a.height)), a.maxLeft = r.left, a.maxTop = r.top, o === 2 && (a.width >= n.width && (a.minLeft = Math.min(0, d), a.maxLeft = Math.max(0, d)), a.height >= n.height && (a.minTop = Math.min(0, g), a.maxTop = Math.max(0, g))));
|
|
852
|
+
} else a.minLeft = -a.width, a.minTop = -a.height, a.maxLeft = n.width, a.maxTop = n.height;
|
|
853
|
+
}, initCropBox: function() {
|
|
854
|
+
var t = this.$props, e = this.canvasData, i = t.aspectRatio || t.initialAspectRatio, n = Number(t.autoCropArea) || 0.8, a = { width: e.width, height: e.height };
|
|
855
|
+
i && (e.height * i > e.width ? a.height = a.width / i : a.width = a.height * i), this.cropBoxData = a, this.limitCropBox(!0, !0), a.width = Math.min(Math.max(a.width, a.minWidth), a.maxWidth), a.height = Math.min(Math.max(a.height, a.minHeight), a.maxHeight), a.width = Math.max(a.minWidth, a.width * n), a.height = Math.max(a.minHeight, a.height * n), a.left = e.left + (e.width - a.width) / 2, a.top = e.top + (e.height - a.height) / 2, a.oldLeft = a.left, a.oldTop = a.top, this.initialCropBoxData = C({}, a);
|
|
856
|
+
}, limitCropBox: function(t, e) {
|
|
857
|
+
var i = this.$props, n = this.containerData, a = this.canvasData, r = this.cropBoxData, o = this.limited, h = i.aspectRatio;
|
|
858
|
+
if (t) {
|
|
859
|
+
var c = Number(i.minCropBoxWidth) || 0, s = Number(i.minCropBoxHeight) || 0, l = o ? Math.min(n.width, a.width, a.width + a.left, n.width - a.left) : n.width, u = o ? Math.min(n.height, a.height, a.height + a.top, n.height - a.top) : n.height;
|
|
860
|
+
c = Math.min(c, n.width), s = Math.min(s, n.height), h && (c && s ? s * h > c ? s = c / h : c = s * h : c ? s = c / h : s && (c = s * h), u * h > l ? u = l / h : l = u * h), r.minWidth = Math.min(c, l), r.minHeight = Math.min(s, u), r.maxWidth = l, r.maxHeight = u;
|
|
861
|
+
}
|
|
862
|
+
e && (o ? (r.minLeft = Math.max(0, a.left), r.minTop = Math.max(0, a.top), r.maxLeft = Math.min(n.width, a.left + a.width) - r.width, r.maxTop = Math.min(n.height, a.top + a.height) - r.height) : (r.minLeft = 0, r.minTop = 0, r.maxLeft = n.width - r.width, r.maxTop = n.height - r.height));
|
|
863
|
+
}, renderCanvas: function(t, e) {
|
|
864
|
+
var i = this.canvasData, n = this.imageData;
|
|
865
|
+
if (e) {
|
|
866
|
+
var a = function(s) {
|
|
867
|
+
var l = s.width, u = s.height, d = s.degree;
|
|
868
|
+
if ((d = Math.abs(d) % 180) == 90) return { width: u, height: l };
|
|
869
|
+
var g = d % 90 * Math.PI / 180, v = Math.sin(g), m = Math.cos(g), f = l * m + u * v, b = l * v + u * m;
|
|
870
|
+
return d > 90 ? { width: b, height: f } : { width: f, height: b };
|
|
871
|
+
}({ width: n.naturalWidth * Math.abs(n.scaleX || 1), height: n.naturalHeight * Math.abs(n.scaleY || 1), degree: n.rotate || 0 }), r = a.width, o = a.height, h = i.width * (r / i.naturalWidth), c = i.height * (o / i.naturalHeight);
|
|
872
|
+
i.left -= (h - i.width) / 2, i.top -= (c - i.height) / 2, i.width = h, i.height = c, i.aspectRatio = r / o, i.naturalWidth = r, i.naturalHeight = o, this.limitCanvas(!0, !1);
|
|
873
|
+
}
|
|
874
|
+
(i.width > i.maxWidth || i.width < i.minWidth) && (i.left = i.oldLeft), (i.height > i.maxHeight || i.height < i.minHeight) && (i.top = i.oldTop), i.width = Math.min(Math.max(i.width, i.minWidth), i.maxWidth), i.height = Math.min(Math.max(i.height, i.minHeight), i.maxHeight), this.limitCanvas(!1, !0), i.left = Math.min(Math.max(i.left, i.minLeft), i.maxLeft), i.top = Math.min(Math.max(i.top, i.minTop), i.maxTop), i.oldLeft = i.left, i.oldTop = i.top, st(this.canvas, C({ width: i.width, height: i.height }, Pt({ translateX: i.left, translateY: i.top }))), this.renderImage(t), this.cropped && this.limited && this.limitCropBox(!0, !0);
|
|
875
|
+
}, renderImage: function(t) {
|
|
876
|
+
var e = this.canvasData, i = this.imageData, n = i.naturalWidth * (e.width / e.naturalWidth), a = i.naturalHeight * (e.height / e.naturalHeight);
|
|
877
|
+
C(i, { width: n, height: a, left: (e.width - n) / 2, top: (e.height - a) / 2 }), st(this.image, C({ width: i.width, height: i.height }, Pt(C({ translateX: i.left, translateY: i.top }, i)))), t && this.output();
|
|
878
|
+
}, renderCropBox: function() {
|
|
879
|
+
var t = this.$props, e = this.containerData, i = this.cropBoxData;
|
|
880
|
+
(i.width > i.maxWidth || i.width < i.minWidth) && (i.left = i.oldLeft), (i.height > i.maxHeight || i.height < i.minHeight) && (i.top = i.oldTop), i.width = Math.min(Math.max(i.width, i.minWidth), i.maxWidth), i.height = Math.min(Math.max(i.height, i.minHeight), i.maxHeight), this.limitCropBox(!1, !0), i.left = Math.min(Math.max(i.left, i.minLeft), i.maxLeft), i.top = Math.min(Math.max(i.top, i.minTop), i.maxTop), i.oldLeft = i.left, i.oldTop = i.top, t.movable && t.cropBoxMovable && $t(this.face, It, i.width >= e.width && i.height >= e.height ? Ii : je), st(this.cropBox, C({ width: i.width, height: i.height }, Pt({ translateX: i.left, translateY: i.top }))), this.cropped && this.limited && this.limitCanvas(!0, !0), this.disabled || this.output();
|
|
881
|
+
}, output: function() {
|
|
882
|
+
this.preview(), Lt(this.element, Ie, this.getData());
|
|
883
|
+
} } };
|
|
884
|
+
function ra(t) {
|
|
885
|
+
return function(e) {
|
|
886
|
+
if (Array.isArray(e)) return Ke(e);
|
|
887
|
+
}(t) || function(e) {
|
|
888
|
+
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
889
|
+
}(t) || function(e, i) {
|
|
890
|
+
if (e) {
|
|
891
|
+
if (typeof e == "string") return Ke(e, i);
|
|
892
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
893
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ke(e, i) : void 0;
|
|
894
|
+
}
|
|
895
|
+
}(t) || function() {
|
|
896
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
897
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
898
|
+
}();
|
|
899
|
+
}
|
|
900
|
+
function Ke(t, e) {
|
|
901
|
+
(e == null || e > t.length) && (e = t.length);
|
|
902
|
+
for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
|
|
903
|
+
return n;
|
|
904
|
+
}
|
|
905
|
+
const oa = { methods: { crop: function() {
|
|
906
|
+
return !this.ready || this.cropped || this.disabled || (this.cropped = !0, this.limitCropBox(!0, !0), this.modal && _(this.dragBox, _t), A(this.cropBox, E), this.setCropBoxData(this.initialCropBoxData)), this;
|
|
907
|
+
}, reset: function() {
|
|
908
|
+
return this.ready && !this.disabled && (this.imageData = C({}, this.initialImageData), this.canvasData = C({}, this.initialCanvasData), this.cropBoxData = C({}, this.initialCropBoxData), this.renderCanvas(), this.cropped && this.renderCropBox()), this;
|
|
909
|
+
}, clear: function() {
|
|
910
|
+
return this.cropped && !this.disabled && (C(this.cropBoxData, { left: 0, top: 0, width: 0, height: 0 }), this.cropped = !1, this.renderCropBox(), this.limitCanvas(!0, !0), this.renderCanvas(), A(this.dragBox, _t), _(this.cropBox, E)), this;
|
|
911
|
+
}, enable: function() {
|
|
912
|
+
return this.ready && this.disabled && (this.disabled = !1, A(this.cropper, Li)), this;
|
|
913
|
+
}, disable: function() {
|
|
914
|
+
return this.ready && !this.disabled && (this.disabled = !0, _(this.cropper, Li)), this;
|
|
915
|
+
}, destroy: function() {
|
|
916
|
+
var t = this.element;
|
|
917
|
+
return t.cropper ? (t.cropper = void 0, this.isImg && this.replaced && (t.src = this.originalUrl), this) : this;
|
|
918
|
+
}, move: function(t) {
|
|
919
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, i = this.canvasData, n = i.left, a = i.top;
|
|
920
|
+
return this.moveTo(Ue(t) ? t : n + Number(t), Ue(e) ? e : a + Number(e));
|
|
921
|
+
}, moveTo: function(t) {
|
|
922
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, i = this.canvasData, n = !1;
|
|
923
|
+
return t = Number(t), e = Number(e), this.ready && !this.disabled && this.movable && (y(t) && (i.left = t, n = !0), y(e) && (i.top = e, n = !0), n && this.renderCanvas(!0)), this;
|
|
924
|
+
}, zoom: function(t, e) {
|
|
925
|
+
var i = this.canvasData;
|
|
926
|
+
return t = (t = Number(t)) < 0 ? 1 / (1 - t) : 1 + t, this.zoomTo(i.width * t / i.naturalWidth, null, e);
|
|
927
|
+
}, zoomTo: function(t, e, i) {
|
|
928
|
+
var n = this.canvasData, a = n.width, r = n.height, o = n.naturalWidth, h = n.naturalHeight;
|
|
929
|
+
if ((t = Number(t)) >= 0 && this.ready && !this.disabled && this.zoomable) {
|
|
930
|
+
var c = o * t, s = h * t;
|
|
931
|
+
if (Lt(this.element, Ye, { ratio: t, oldRatio: a / o, originalEvent: i }) === !1) return this;
|
|
932
|
+
if (i) {
|
|
933
|
+
var l = this.pointers, u = an(this.cropper), d = l && Object.keys(l).length ? function(g) {
|
|
934
|
+
var v = 0, m = 0, f = 0;
|
|
935
|
+
return N(g, function(b) {
|
|
936
|
+
var D = b.startX, w = b.startY;
|
|
937
|
+
v += D, m += w, f += 1;
|
|
938
|
+
}), { pageX: v /= f, pageY: m /= f };
|
|
939
|
+
}(l) : { pageX: i.pageX, pageY: i.pageY };
|
|
940
|
+
n.left -= (c - a) * ((d.pageX - u.left - n.left) / a), n.top -= (s - r) * ((d.pageY - u.top - n.top) / r);
|
|
941
|
+
} else ce(e) && y(e.x) && y(e.y) ? (n.left -= (c - a) * ((e.x - n.left) / a), n.top -= (s - r) * ((e.y - n.top) / r)) : (n.left -= (c - a) / 2, n.top -= (s - r) / 2);
|
|
942
|
+
n.width = c, n.height = s, this.renderCanvas(!0);
|
|
943
|
+
}
|
|
944
|
+
return this;
|
|
945
|
+
}, rotate: function(t) {
|
|
946
|
+
return this.rotateTo((this.imageData.rotate || 0) + Number(t));
|
|
947
|
+
}, rotateTo: function(t) {
|
|
948
|
+
return y(t = Number(t)) && this.ready && !this.disabled && this.rotatable && (this.imageData.rotate = t % 360, this.renderCanvas(!0, !0)), this;
|
|
949
|
+
}, scaleX: function(t) {
|
|
950
|
+
var e = this.imageData.scaleY;
|
|
951
|
+
return this.scale(t, y(e) ? e : 1);
|
|
952
|
+
}, scaleY: function(t) {
|
|
953
|
+
var e = this.imageData.scaleX;
|
|
954
|
+
return this.scale(y(e) ? e : 1, t);
|
|
955
|
+
}, scale: function(t) {
|
|
956
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, i = this.imageData, n = !1;
|
|
957
|
+
return t = Number(t), e = Number(e), this.ready && !this.disabled && this.scalable && (y(t) && (i.scaleX = t, n = !0), y(e) && (i.scaleY = e, n = !0), n && this.renderCanvas(!0, !0)), this;
|
|
958
|
+
}, getData: function() {
|
|
959
|
+
var t, e = arguments.length > 0 && arguments[0] !== void 0 && arguments[0], i = this.imageData, n = this.canvasData, a = this.cropBoxData;
|
|
960
|
+
if (this.ready && this.cropped) {
|
|
961
|
+
t = { x: a.left - n.left, y: a.top - n.top, width: a.width, height: a.height };
|
|
962
|
+
var r = i.width / i.naturalWidth;
|
|
963
|
+
if (N(t, function(c, s) {
|
|
964
|
+
t[s] = c / r;
|
|
965
|
+
}), e) {
|
|
966
|
+
var o = Math.round(t.y + t.height), h = Math.round(t.x + t.width);
|
|
967
|
+
t.x = Math.round(t.x), t.y = Math.round(t.y), t.width = h - t.x, t.height = o - t.y;
|
|
968
|
+
}
|
|
969
|
+
} else t = { x: 0, y: 0, width: 0, height: 0 };
|
|
970
|
+
return this.rotatable && (t.rotate = i.rotate || 0), this.scalable && (t.scaleX = i.scaleX || 1, t.scaleY = i.scaleY || 1), t;
|
|
971
|
+
}, setData: function(t) {
|
|
972
|
+
var e = this.$props, i = this.imageData, n = this.canvasData, a = {};
|
|
973
|
+
if (this.ready && !this.disabled && ce(t)) {
|
|
974
|
+
var r = !1;
|
|
975
|
+
e.rotatable && y(t.rotate) && t.rotate !== i.rotate && (i.rotate = t.rotate, r = !0), e.scalable && (y(t.scaleX) && t.scaleX !== i.scaleX && (i.scaleX = t.scaleX, r = !0), y(t.scaleY) && t.scaleY !== i.scaleY && (i.scaleY = t.scaleY, r = !0)), r && this.renderCanvas(!0, !0);
|
|
976
|
+
var o = i.width / i.naturalWidth;
|
|
977
|
+
y(t.x) && (a.left = t.x * o + n.left), y(t.y) && (a.top = t.y * o + n.top), y(t.width) && (a.width = t.width * o), y(t.height) && (a.height = t.height * o), this.setCropBoxData(a);
|
|
978
|
+
}
|
|
979
|
+
return this;
|
|
980
|
+
}, getContainerData: function() {
|
|
981
|
+
return this.ready ? C({}, this.containerData) : {};
|
|
982
|
+
}, getImageData: function() {
|
|
983
|
+
return this.sized ? C({}, this.imageData) : {};
|
|
984
|
+
}, getCanvasData: function() {
|
|
985
|
+
var t = this.canvasData, e = {};
|
|
986
|
+
return this.ready && N(["left", "top", "width", "height", "naturalWidth", "naturalHeight"], function(i) {
|
|
987
|
+
e[i] = t[i];
|
|
988
|
+
}), e;
|
|
989
|
+
}, setCanvasData: function(t) {
|
|
990
|
+
var e = this.canvasData, i = e.aspectRatio;
|
|
991
|
+
return this.ready && !this.disabled && ce(t) && (y(t.left) && (e.left = t.left), y(t.top) && (e.top = t.top), y(t.width) ? (e.width = t.width, e.height = t.width / i) : y(t.height) && (e.height = t.height, e.width = t.height * i), this.renderCanvas(!0)), this;
|
|
992
|
+
}, getCropBoxData: function() {
|
|
993
|
+
var t, e = this.cropBoxData;
|
|
994
|
+
return this.ready && this.cropped && (t = { left: e.left, top: e.top, width: e.width, height: e.height }), t || {};
|
|
995
|
+
}, setCropBoxData: function(t) {
|
|
996
|
+
var e, i, n = this.cropBoxData, a = this.aspectRatio;
|
|
997
|
+
return this.ready && this.cropped && !this.disabled && ce(t) && (y(t.left) && (n.left = t.left), y(t.top) && (n.top = t.top), y(t.width) && t.width !== n.width && (e = !0, n.width = t.width), y(t.height) && t.height !== n.height && (i = !0, n.height = t.height), a && (e ? n.height = n.width / a : i && (n.width = n.height * a)), this.renderCropBox()), this;
|
|
998
|
+
}, getCroppedCanvas: function() {
|
|
999
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1000
|
+
if (!this.ready || !window.HTMLCanvasElement) return null;
|
|
1001
|
+
var e = this.canvasData, i = ia(this.image, this.imageData, e, t);
|
|
1002
|
+
if (!this.cropped) return i;
|
|
1003
|
+
var n = this.getData(), a = n.x, r = n.y, o = n.width, h = n.height, c = i.width / Math.floor(e.naturalWidth);
|
|
1004
|
+
c !== 1 && (a *= c, r *= c, o *= c, h *= c);
|
|
1005
|
+
var s = o / h, l = ht({ aspectRatio: s, width: t.maxWidth || 1 / 0, height: t.maxHeight || 1 / 0 }), u = ht({ aspectRatio: s, width: t.minWidth || 0, height: t.minHeight || 0 }, "cover"), d = ht({ aspectRatio: s, width: t.width || (c !== 1 ? i.width : o), height: t.height || (c !== 1 ? i.height : h) }), g = d.width, v = d.height;
|
|
1006
|
+
g = Math.min(l.width, Math.max(u.width, g)), v = Math.min(l.height, Math.max(u.height, v));
|
|
1007
|
+
var m = document.createElement("canvas"), f = m.getContext("2d");
|
|
1008
|
+
m.width = Bt(g), m.height = Bt(v), f.fillStyle = t.fillColor || "transparent", f.fillRect(0, 0, g, v);
|
|
1009
|
+
var b = t.imageSmoothingEnabled, D = b === void 0 || b, w = t.imageSmoothingQuality;
|
|
1010
|
+
f.imageSmoothingEnabled = D, w && (f.imageSmoothingQuality = w);
|
|
1011
|
+
var T, p, M, k, $, I, j = i.width, G = i.height, R = a, z = r;
|
|
1012
|
+
R <= -o || R > j ? (R = 0, T = 0, M = 0, $ = 0) : R <= 0 ? (M = -R, R = 0, $ = T = Math.min(j, o + R)) : R <= j && (M = 0, $ = T = Math.min(o, j - R)), T <= 0 || z <= -h || z > G ? (z = 0, p = 0, k = 0, I = 0) : z <= 0 ? (k = -z, z = 0, I = p = Math.min(G, h + z)) : z <= G && (k = 0, I = p = Math.min(h, G - z));
|
|
1013
|
+
var ct = [R, z, T, p];
|
|
1014
|
+
if ($ > 0 && I > 0) {
|
|
1015
|
+
var Y = g / o;
|
|
1016
|
+
ct.push(M * Y, k * Y, $ * Y, I * Y);
|
|
1017
|
+
}
|
|
1018
|
+
return f.drawImage.apply(f, [i].concat(ra(ct.map(function(H) {
|
|
1019
|
+
return Math.floor(Bt(H));
|
|
1020
|
+
})))), m;
|
|
1021
|
+
}, setAspectRatio: function(t) {
|
|
1022
|
+
var e = this.options;
|
|
1023
|
+
return this.disabled || Ue(t) || (e.aspectRatio = Math.max(0, t) || NaN, this.ready && (this.initCropBox(), this.cropped && this.renderCropBox())), this;
|
|
1024
|
+
}, setDragMode: function() {
|
|
1025
|
+
var t = this.$props, e = this.dragBox, i = this.face;
|
|
1026
|
+
if (this.ready && !this.disabled) {
|
|
1027
|
+
var n = t.dragMode === Pi, a = t.movable && t.dragMode === Yi;
|
|
1028
|
+
$t(e, It, t.dragMode), Ot(e, ze, n), Ot(e, Ae, a), t.cropBoxMovable || ($t(i, It, t.dragMode), Ot(i, ze, n), Ot(i, Ae, a));
|
|
1029
|
+
}
|
|
1030
|
+
return this;
|
|
1031
|
+
}, getCropData: function(t, e) {
|
|
1032
|
+
var i, n = { outputType: "image/jpeg" };
|
|
1033
|
+
e === void 0 ? i = t : (n = C(n, t), i = e), i(this.getCroppedCanvas(n).toDataURL(n.outputType));
|
|
1034
|
+
}, getCropBlob: function(t, e) {
|
|
1035
|
+
var i, n = { outputType: "image/jpeg" };
|
|
1036
|
+
e === void 0 ? i = t : (n = C(n, t), i = e), this.getCroppedCanvas(n).toBlob(function(a) {
|
|
1037
|
+
i(a);
|
|
1038
|
+
}, n.outputType, 1);
|
|
1039
|
+
} } }, sa = { methods: { change: function(t) {
|
|
1040
|
+
var e, i = this.$props, n = this.canvasData, a = this.containerData, r = this.cropBoxData, o = this.pointers, h = this.action, c = i.aspectRatio, s = r.left, l = r.top, u = r.width, d = r.height, g = s + u, v = l + d, m = 0, f = 0, b = a.width, D = a.height, w = !0;
|
|
1041
|
+
!c && t.shiftKey && (c = u && d ? u / d : 1), this.limited && (m = r.minLeft, f = r.minTop, b = m + Math.min(a.width, n.width, n.left + n.width), D = f + Math.min(a.height, n.height, n.top + n.height));
|
|
1042
|
+
var T = o[Object.keys(o)[0]], p = { x: T.endX - T.startX, y: T.endY - T.startY }, M = function(k) {
|
|
1043
|
+
switch (k) {
|
|
1044
|
+
case gt:
|
|
1045
|
+
g + p.x > b && (p.x = b - g);
|
|
1046
|
+
break;
|
|
1047
|
+
case mt:
|
|
1048
|
+
s + p.x < m && (p.x = m - s);
|
|
1049
|
+
break;
|
|
1050
|
+
case rt:
|
|
1051
|
+
l + p.y < f && (p.y = f - l);
|
|
1052
|
+
break;
|
|
1053
|
+
case Dt:
|
|
1054
|
+
v + p.y > D && (p.y = D - v);
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
switch (h) {
|
|
1058
|
+
case je:
|
|
1059
|
+
s += p.x, l += p.y;
|
|
1060
|
+
break;
|
|
1061
|
+
case gt:
|
|
1062
|
+
if (p.x >= 0 && (g >= b || c && (l <= f || v >= D))) {
|
|
1063
|
+
w = !1;
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
M(gt), (u += p.x) < 0 && (h = mt, s -= u = -u), c && (d = u / c, l += (r.height - d) / 2);
|
|
1067
|
+
break;
|
|
1068
|
+
case rt:
|
|
1069
|
+
if (p.y <= 0 && (l <= f || c && (s <= m || g >= b))) {
|
|
1070
|
+
w = !1;
|
|
1071
|
+
break;
|
|
1072
|
+
}
|
|
1073
|
+
M(rt), d -= p.y, l += p.y, d < 0 && (h = Dt, l -= d = -d), c && (u = d * c, s += (r.width - u) / 2);
|
|
1074
|
+
break;
|
|
1075
|
+
case mt:
|
|
1076
|
+
if (p.x <= 0 && (s <= m || c && (l <= f || v >= D))) {
|
|
1077
|
+
w = !1;
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
M(mt), u -= p.x, s += p.x, u < 0 && (h = gt, s -= u = -u), c && (d = u / c, l += (r.height - d) / 2);
|
|
1081
|
+
break;
|
|
1082
|
+
case Dt:
|
|
1083
|
+
if (p.y >= 0 && (v >= D || c && (s <= m || g >= b))) {
|
|
1084
|
+
w = !1;
|
|
1085
|
+
break;
|
|
1086
|
+
}
|
|
1087
|
+
M(Dt), (d += p.y) < 0 && (h = rt, l -= d = -d), c && (u = d * c, s += (r.width - u) / 2);
|
|
1088
|
+
break;
|
|
1089
|
+
case jt:
|
|
1090
|
+
if (c) {
|
|
1091
|
+
if (p.y <= 0 && (l <= f || g >= b)) {
|
|
1092
|
+
w = !1;
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
M(rt), d -= p.y, l += p.y, u = d * c;
|
|
1096
|
+
} else M(rt), M(gt), p.x >= 0 ? g < b ? u += p.x : p.y <= 0 && l <= f && (w = !1) : u += p.x, p.y <= 0 ? l > f && (d -= p.y, l += p.y) : (d -= p.y, l += p.y);
|
|
1097
|
+
u < 0 && d < 0 ? (h = At, l -= d = -d, s -= u = -u) : u < 0 ? (h = zt, s -= u = -u) : d < 0 && (h = Ht, l -= d = -d);
|
|
1098
|
+
break;
|
|
1099
|
+
case zt:
|
|
1100
|
+
if (c) {
|
|
1101
|
+
if (p.y <= 0 && (l <= f || s <= m)) {
|
|
1102
|
+
w = !1;
|
|
1103
|
+
break;
|
|
1104
|
+
}
|
|
1105
|
+
M(rt), d -= p.y, l += p.y, u = d * c, s += r.width - u;
|
|
1106
|
+
} else M(rt), M(mt), p.x <= 0 ? s > m ? (u -= p.x, s += p.x) : p.y <= 0 && l <= f && (w = !1) : (u -= p.x, s += p.x), p.y <= 0 ? l > f && (d -= p.y, l += p.y) : (d -= p.y, l += p.y);
|
|
1107
|
+
u < 0 && d < 0 ? (h = Ht, l -= d = -d, s -= u = -u) : u < 0 ? (h = jt, s -= u = -u) : d < 0 && (h = At, l -= d = -d);
|
|
1108
|
+
break;
|
|
1109
|
+
case At:
|
|
1110
|
+
if (c) {
|
|
1111
|
+
if (p.x <= 0 && (s <= m || v >= D)) {
|
|
1112
|
+
w = !1;
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
M(mt), u -= p.x, s += p.x, d = u / c;
|
|
1116
|
+
} else M(Dt), M(mt), p.x <= 0 ? s > m ? (u -= p.x, s += p.x) : p.y >= 0 && v >= D && (w = !1) : (u -= p.x, s += p.x), p.y >= 0 ? v < D && (d += p.y) : d += p.y;
|
|
1117
|
+
u < 0 && d < 0 ? (h = jt, l -= d = -d, s -= u = -u) : u < 0 ? (h = Ht, s -= u = -u) : d < 0 && (h = zt, l -= d = -d);
|
|
1118
|
+
break;
|
|
1119
|
+
case Ht:
|
|
1120
|
+
if (c) {
|
|
1121
|
+
if (p.x >= 0 && (g >= b || v >= D)) {
|
|
1122
|
+
w = !1;
|
|
1123
|
+
break;
|
|
1124
|
+
}
|
|
1125
|
+
M(gt), d = (u += p.x) / c;
|
|
1126
|
+
} else M(Dt), M(gt), p.x >= 0 ? g < b ? u += p.x : p.y >= 0 && v >= D && (w = !1) : u += p.x, p.y >= 0 ? v < D && (d += p.y) : d += p.y;
|
|
1127
|
+
u < 0 && d < 0 ? (h = zt, l -= d = -d, s -= u = -u) : u < 0 ? (h = At, s -= u = -u) : d < 0 && (h = jt, l -= d = -d);
|
|
1128
|
+
break;
|
|
1129
|
+
case Ii:
|
|
1130
|
+
this.move(p.x, p.y), w = !1;
|
|
1131
|
+
break;
|
|
1132
|
+
case $i:
|
|
1133
|
+
this.zoom(function(k) {
|
|
1134
|
+
var $ = Zi({}, k), I = 0;
|
|
1135
|
+
return N(k, function(j, G) {
|
|
1136
|
+
delete $[G], N($, function(R) {
|
|
1137
|
+
var z = Math.abs(j.startX - R.startX), ct = Math.abs(j.startY - R.startY), Y = Math.abs(j.endX - R.endX), H = Math.abs(j.endY - R.endY), Xt = Math.sqrt(z * z + ct * ct), Ut = (Math.sqrt(Y * Y + H * H) - Xt) / Xt;
|
|
1138
|
+
Math.abs(Ut) > Math.abs(I) && (I = Ut);
|
|
1139
|
+
});
|
|
1140
|
+
}), I;
|
|
1141
|
+
}(o), t), w = !1;
|
|
1142
|
+
break;
|
|
1143
|
+
case Ai:
|
|
1144
|
+
if (!p.x || !p.y) {
|
|
1145
|
+
w = !1;
|
|
1146
|
+
break;
|
|
1147
|
+
}
|
|
1148
|
+
e = an(this.cropper), s = T.startX - e.left, l = T.startY - e.top, u = r.minWidth, d = r.minHeight, p.x > 0 ? h = p.y > 0 ? Ht : jt : p.x < 0 && (s -= u, h = p.y > 0 ? At : zt), p.y < 0 && (l -= d), this.cropped || (A(this.cropBox, E), this.cropped = !0, this.limited && this.limitCropBox(!0, !0));
|
|
1149
|
+
}
|
|
1150
|
+
w && (r.width = u, r.height = d, r.left = s, r.top = l, this.action = h, this.renderCropBox()), N(o, function(k) {
|
|
1151
|
+
k.startX = k.endX, k.startY = k.endY;
|
|
1152
|
+
});
|
|
1153
|
+
} } }, ha = { methods: { resize: function() {
|
|
1154
|
+
if (!this.disabled) {
|
|
1155
|
+
var t, e, i = this.$props, n = this.container, a = this.containerData, r = n.offsetWidth / a.width, o = n.offsetHeight / a.height, h = Math.abs(r - 1) > Math.abs(o - 1) ? r : o;
|
|
1156
|
+
h !== 1 && (i.restore && (t = this.getCanvasData(), e = this.getCropBoxData()), this.render(), i.restore && (this.setCanvasData(N(t, function(c, s) {
|
|
1157
|
+
t[s] = c * h;
|
|
1158
|
+
})), this.setCropBoxData(N(e, function(c, s) {
|
|
1159
|
+
e[s] = c * h;
|
|
1160
|
+
}))));
|
|
1161
|
+
}
|
|
1162
|
+
}, dblclick: function() {
|
|
1163
|
+
var t, e;
|
|
1164
|
+
this.disabled || this.dragMode === "none" || this.setDragMode((t = this.dragBox, e = ze, (t.classList ? t.classList.contains(e) : t.className.indexOf(e) > -1) ? Yi : Pi));
|
|
1165
|
+
}, wheel: function(t) {
|
|
1166
|
+
var e = this, i = Number(this.wheelZoomRatio) || 0.1, n = 1;
|
|
1167
|
+
this.disabled || (t.preventDefault(), this.wheeling || (this.wheeling = !0, setTimeout(function() {
|
|
1168
|
+
e.wheeling = !1;
|
|
1169
|
+
}, 50), t.deltaY ? n = t.deltaY > 0 ? 1 : -1 : t.wheelDelta ? n = -t.wheelDelta / 120 : t.detail && (n = t.detail > 0 ? 1 : -1), this.zoom(-n * i, t)));
|
|
1170
|
+
}, cropStart: function(t) {
|
|
1171
|
+
var e = t.buttons, i = t.button;
|
|
1172
|
+
if (!(this.disabled || (t.type === "mousedown" || t.type === "pointerdown" && t.pointerType === "mouse") && (y(e) && e !== 1 || y(i) && i !== 0 || t.ctrlKey))) {
|
|
1173
|
+
var n, a = this.$props, r = this.pointers;
|
|
1174
|
+
t.changedTouches ? N(t.changedTouches, function(o) {
|
|
1175
|
+
r[o.identifier] = le(o);
|
|
1176
|
+
}) : r[t.pointerId || 0] = le(t), n = Object.keys(r).length > 1 && a.zoomable && a.zoomOnTouch ? $i : qe(t.target, It), Un.test(n) && Lt(this.element, Pe, { originalEvent: t, action: n }) !== !1 && (t.preventDefault(), this.action = n, this.cropping = !1, n === Ai && (this.cropping = !0, _(this.dragBox, _t)));
|
|
1177
|
+
}
|
|
1178
|
+
}, cropMove: function(t) {
|
|
1179
|
+
var e = this.action;
|
|
1180
|
+
if (!this.disabled && e) {
|
|
1181
|
+
var i = this.pointers;
|
|
1182
|
+
t.preventDefault(), Lt(this.element, Le, { originalEvent: t, action: e }) !== !1 && (t.changedTouches ? N(t.changedTouches, function(n) {
|
|
1183
|
+
C(i[n.identifier] || {}, le(n, !0));
|
|
1184
|
+
}) : C(i[t.pointerId || 0] || {}, le(t, !0)), this.change(t));
|
|
1185
|
+
}
|
|
1186
|
+
}, cropEnd: function(t) {
|
|
1187
|
+
if (!this.disabled) {
|
|
1188
|
+
var e = this.action, i = this.pointers;
|
|
1189
|
+
t.changedTouches ? N(t.changedTouches, function(n) {
|
|
1190
|
+
delete i[n.identifier];
|
|
1191
|
+
}) : delete i[t.pointerId || 0], e && (t.preventDefault(), Object.keys(i).length || (this.action = ""), this.cropping && (this.cropping = !1, Ot(this.dragBox, _t, this.cropped && this.modal)), Lt(this.element, $e, { originalEvent: t, action: e }));
|
|
1192
|
+
}
|
|
1193
|
+
} } }, hn = (Yt = { name: "V3Cropper", render: function() {
|
|
1194
|
+
return Hi("div", [Hi("img", { src: this.src, id: "element", style: { display: "none" } })]);
|
|
1195
|
+
}, props: { src: { type: [String, Blob, null, File], default: "" }, viewMode: { type: Number, default: 0 }, dragMode: { type: String, default: "crop" }, initialAspectRatio: { type: Number, default: NaN }, data: { type: Object, default: null }, responsive: { type: Boolean, default: !0 }, restore: { type: Boolean, default: !0 }, checkCrossOrigin: { type: Boolean, default: !0 }, modal: { type: Boolean, default: !0 }, guides: { type: Boolean, default: !0 }, center: { type: Boolean, default: !0 }, highlight: { type: Boolean, default: !0 }, background: { type: Boolean, default: !0 }, autoCrop: { type: Boolean, default: !0 }, autoCropArea: { type: Number, default: 0.8 }, movable: { type: Boolean, default: !0 }, rotatable: { type: Boolean, default: !0 }, scalable: { type: Boolean, default: !0 }, zoomable: { type: Boolean, default: !0 }, zoomOnTouch: { type: Boolean, default: !0 }, zoomOnWheel: { type: Boolean, default: !0 }, wheelZoomRatio: { type: Number, default: 0.1 }, cropBoxMovable: { type: Boolean, default: !0 }, cropBoxResizable: { type: Boolean, default: !0 }, toggleDragModeOnDblclick: { type: Boolean, default: !0 }, minContainerWidth: { type: Number, default: 200 }, minContainerHeight: { type: Number, default: 100 }, minCanvasWidth: { type: Number, default: 0 }, minCanvasHeight: { type: Number, default: 0 }, minCropBoxWidth: { type: Number, default: 0 }, minCropBoxHeight: { type: Number, default: 0 }, maxImgSize: { type: [Number, String], default: 2e3 } }, data: function() {
|
|
1196
|
+
return { element: {}, cropped: !1, disabled: !1, pointers: {}, ready: !1, reloading: !1, replaced: !1, sized: !1, sizing: !1, checkOrientation: !0, xhr: {}, limited: "", isImg: !1, originalUrl: "", crossOriginUrl: "", url: "", sizingImage: "", image: {}, imageData: {}, initialImageData: {}, container: {}, cropper: {}, canvas: {}, dragBox: {}, cropBox: {}, viewBox: {}, viewBoxImage: {}, face: {}, containerData: {}, canvasData: {}, initialCanvasData: {}, initialCropBoxData: {}, cropBoxData: {} };
|
|
1197
|
+
}, mixins: [{ methods: { initPreview: function() {
|
|
1198
|
+
var t = this.element, e = this.crossOrigin, i = this.preview, n = e ? this.crossOriginUrl : this.url, a = t.alt || "The image to preview", r = document.createElement("img");
|
|
1199
|
+
if (e && (r.crossOrigin = e), r.src = n, r.alt = a, this.viewBox.appendChild(r), this.viewBoxImage = r, i) {
|
|
1200
|
+
var o = i;
|
|
1201
|
+
typeof i == "string" ? o = t.ownerDocument.querySelectorAll(i) : i.querySelector && (o = [i]), this.previews = o, N(o, function(h) {
|
|
1202
|
+
var c = document.createElement("img");
|
|
1203
|
+
$t(h, he, { width: h.offsetWidth, height: h.offsetHeight, html: h.innerHTML }), e && (c.crossOrigin = e), c.src = n, c.alt = a, c.style.cssText = 'display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"', h.innerHTML = "", h.appendChild(c);
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
}, resetPreview: function() {
|
|
1207
|
+
N(this.previews, function(t) {
|
|
1208
|
+
var e = qe(t, he);
|
|
1209
|
+
st(t, { width: e.width, height: e.height }), t.innerHTML = e.html, function(i, n) {
|
|
1210
|
+
if (vt(i[n])) try {
|
|
1211
|
+
delete i[n];
|
|
1212
|
+
} catch {
|
|
1213
|
+
i[n] = void 0;
|
|
1214
|
+
}
|
|
1215
|
+
else if (i.dataset) try {
|
|
1216
|
+
delete i.dataset[n];
|
|
1217
|
+
} catch {
|
|
1218
|
+
i.dataset[n] = void 0;
|
|
1219
|
+
}
|
|
1220
|
+
else i.removeAttribute("data-".concat(Fe(n)));
|
|
1221
|
+
}(t, he);
|
|
1222
|
+
});
|
|
1223
|
+
}, preview: function() {
|
|
1224
|
+
var t = this.imageData, e = this.canvasData, i = this.cropBoxData, n = i.width, a = i.height, r = t.width, o = t.height, h = i.left - e.left - t.left, c = i.top - e.top - t.top;
|
|
1225
|
+
this.cropped && !this.disabled && (st(this.viewBoxImage, C({ width: r, height: o }, Pt(C({ translateX: -h, translateY: -c }, t)))), N(this.previews, function(s) {
|
|
1226
|
+
var l = qe(s, he), u = l.width, d = l.height, g = u, v = d, m = 1;
|
|
1227
|
+
n && (v = a * (m = u / n)), a && v > d && (g = n * (m = d / a), v = d), st(s, { width: g, height: v }), st(s.getElementsByTagName("img")[0], C({ width: r * m, height: o * m }, Pt(C({ translateX: -h * m, translateY: -c * m }, t))));
|
|
1228
|
+
}));
|
|
1229
|
+
} } }, aa, oa, { methods: { bind: function() {
|
|
1230
|
+
var t = this.element, e = this.$props, i = this.cropper;
|
|
1231
|
+
K(t, Pe, this.cropstart), K(t, Le, this.cropmove), K(t, $e, this.cropend), K(t, Ie, this.cropping), K(t, Ye, this.zooming), K(i, Ui, this.onCropStart = this.cropStart.bind(this)), e.zoomable && e.zoomOnWheel && K(i, Ki, this.onWheel = this.wheel.bind(this), { passive: !1, capture: !0 }), e.toggleDragModeOnDblclick && K(i, Xi, this.onDblclick = this.dblclick.bind(this)), K(t.ownerDocument, Fi, this.onCropMove = this.cropMove.bind(this)), K(t.ownerDocument, qi, this.onCropEnd = this.cropEnd.bind(this)), e.responsive && K(window, Vi, this.onResize = this.resize.bind(this));
|
|
1232
|
+
}, unbind: function() {
|
|
1233
|
+
var t = this.element, e = this.$props, i = this.cropper;
|
|
1234
|
+
ot(e.cropstart) && V(t, Pe, e.cropstart), ot(e.cropmove) && V(t, Le, e.cropmove), ot(e.cropend) && V(t, $e, e.cropend), ot(e.crop) && V(t, Ie, e.crop), ot(e.zoom) && V(t, Ye, e.zoom), V(i, Ui, this.onCropStart), e.zoomable && e.zoomOnWheel && V(i, Ki, this.onWheel, { passive: !1, capture: !0 }), e.toggleDragModeOnDblclick && V(i, Xi, this.onDblclick), V(t.ownerDocument, Fi, this.onCropMove), V(t.ownerDocument, qi, this.onCropEnd), e.responsive && V(window, Vi, this.onResize);
|
|
1235
|
+
} } }, sa, ha, { methods: { onReady: function() {
|
|
1236
|
+
this.$emit("ready");
|
|
1237
|
+
}, cropstart: function(t) {
|
|
1238
|
+
this.$emit("cropStart", t);
|
|
1239
|
+
}, cropmove: function(t) {
|
|
1240
|
+
this.$emit("cropMove", t);
|
|
1241
|
+
}, cropend: function(t) {
|
|
1242
|
+
this.$emit("cropEnd", t);
|
|
1243
|
+
}, cropping: function(t) {
|
|
1244
|
+
this.$emit("crop", t);
|
|
1245
|
+
}, zooming: function(t) {
|
|
1246
|
+
this.$emit("zoom", t);
|
|
1247
|
+
} } }, { watch: { dragMode: function() {
|
|
1248
|
+
this.setDragMode();
|
|
1249
|
+
}, viewMode: function() {
|
|
1250
|
+
this.imageData = C({}, this.initialImageData), this.initCanvas(), this.reset();
|
|
1251
|
+
}, src: function(t) {
|
|
1252
|
+
var e = this.viewBox, i = this.canvas;
|
|
1253
|
+
e.removeChild(e.getElementsByTagName("img")[0]), i.removeChild(i.getElementsByTagName("img")[0]), t ? this.loadImage(t) : (this.clear(), this.unbind());
|
|
1254
|
+
}, modal: function(t) {
|
|
1255
|
+
t ? _(this.dragBox, _t) : A(this.dragBox, _t);
|
|
1256
|
+
}, guides: function(t) {
|
|
1257
|
+
t ? _(this.cropBox.getElementsByClassName("".concat(x, "-dashed")), E) : A(this.cropBox.getElementsByClassName("".concat(x, "-dashed")), E);
|
|
1258
|
+
}, center: function(t) {
|
|
1259
|
+
t ? _(this.cropBox.getElementsByClassName("".concat(x, "-center")), E) : A(this.cropBox.getElementsByClassName("".concat(x, "-center")), E);
|
|
1260
|
+
}, highlight: function(t) {
|
|
1261
|
+
t ? _(this.face, He) : A(this.face, He);
|
|
1262
|
+
}, background: function(t) {
|
|
1263
|
+
t ? _(this.cropper, "".concat(x, "-bg")) : A(this.cropper, "".concat(x, "-bg"));
|
|
1264
|
+
} } }, { methods: { builder: function() {
|
|
1265
|
+
var t = this.element, e = this.$props, i = t.parentNode, n = document.createElement("div");
|
|
1266
|
+
n.innerHTML = `
|
|
1267
|
+
<div class="cropper-container" touch-action="none">
|
|
1268
|
+
<div class="cropper-wrap-box">
|
|
1269
|
+
<div class="cropper-canvas">
|
|
1270
|
+
</div>
|
|
1271
|
+
</div>
|
|
1272
|
+
<div class="cropper-drag-box"></div>
|
|
1273
|
+
<div class="cropper-crop-box">
|
|
1274
|
+
<span class="cropper-view-box">
|
|
1275
|
+
</span>
|
|
1276
|
+
<span class="cropper-dashed dashed-h"></span>
|
|
1277
|
+
<span class="cropper-dashed dashed-v"></span>
|
|
1278
|
+
<span class="cropper-center"></span>
|
|
1279
|
+
<span class="cropper-face"></span>
|
|
1280
|
+
<span class="cropper-line line-e" data-cropper-action="e"></span>
|
|
1281
|
+
<span class="cropper-line line-n" data-cropper-action="n"></span>
|
|
1282
|
+
<span class="cropper-line line-w" data-cropper-action="w"></span>
|
|
1283
|
+
<span class="cropper-line line-s" data-cropper-action="s"></span>
|
|
1284
|
+
<span class="cropper-point point-e" data-cropper-action="e"></span>
|
|
1285
|
+
<span class="cropper-point point-n" data-cropper-action="n"></span>
|
|
1286
|
+
<span class="cropper-point point-w" data-cropper-action="w"></span>
|
|
1287
|
+
<span class="cropper-point point-s" data-cropper-action="s"></span>
|
|
1288
|
+
<span class="cropper-point point-ne" data-cropper-action="ne"></span>
|
|
1289
|
+
<span class="cropper-point point-nw" data-cropper-action="nw"></span>
|
|
1290
|
+
<span class="cropper-point point-sw" data-cropper-action="sw"></span>
|
|
1291
|
+
<span class="cropper-point point-se" data-cropper-action="se"></span>
|
|
1292
|
+
</div>
|
|
1293
|
+
</div>
|
|
1294
|
+
`;
|
|
1295
|
+
var a = n.querySelector(".".concat(x, "-container")), r = a.querySelector(".".concat(x, "-canvas")), o = a.querySelector(".".concat(x, "-drag-box")), h = a.querySelector(".".concat(x, "-crop-box")), c = h.querySelector(".".concat(x, "-face"));
|
|
1296
|
+
this.container = i, this.cropper = a, this.canvas = r, this.dragBox = o, this.cropBox = h, this.viewBox = a.querySelector(".".concat(x, "-view-box")), this.face = c, _(t, E), _(h, E), e.guides || _(h.getElementsByClassName("".concat(x, "-dashed")), E), e.center || _(h.getElementsByClassName("".concat(x, "-center")), E), e.background && _(a, "".concat(x, "-bg")), e.highlight || _(c, He), e.cropBoxMovable && (_(c, Ae), $t(c, It, je)), e.cropBoxResizable || (_(h.getElementsByClassName("".concat(x, "-line")), E), _(h.getElementsByClassName("".concat(x, "-point")), E)), i.insertBefore(a, t.nextSibling), this.initContainer(), this.ready = !0, this.onReady(), this.setDragMode();
|
|
1297
|
+
} } }], mounted: function() {
|
|
1298
|
+
this.element = document.getElementById("element"), this.builder(), this.loadImage();
|
|
1299
|
+
}, methods: { loadImage: function(t) {
|
|
1300
|
+
var e = this.element;
|
|
1301
|
+
e.cropper = this, this.isImg = !0;
|
|
1302
|
+
var i = t || e.getAttribute("src");
|
|
1303
|
+
this.originalUrl = i, i && this.load(i);
|
|
1304
|
+
}, load: function(t) {
|
|
1305
|
+
var e = this;
|
|
1306
|
+
if (t) {
|
|
1307
|
+
this.url = t, this.imageData = {};
|
|
1308
|
+
var i = this.element, n = this.$props;
|
|
1309
|
+
if (n.rotatable || n.scalable || (this.checkOrientation = !1), this.checkOrientation && window.ArrayBuffer) if (Fn.test(t)) qn.test(t) ? this.read((a = t.replace(na, ""), r = atob(a), o = new ArrayBuffer(r.length), N(h = new Uint8Array(o), function(l, u) {
|
|
1310
|
+
h[u] = r.charCodeAt(u);
|
|
1311
|
+
}), o)) : this.clone();
|
|
1312
|
+
else {
|
|
1313
|
+
var a, r, o, h, c = new XMLHttpRequest(), s = this.clone.bind(this);
|
|
1314
|
+
this.reloading = !0, this.xhr = c, c.onabort = s, c.onerror = s, c.ontimeout = s, c.onprogress = function() {
|
|
1315
|
+
c.getResponseHeader("content-type") !== Xn && c.abort();
|
|
1316
|
+
}, c.onload = function() {
|
|
1317
|
+
e.read(c.response);
|
|
1318
|
+
}, c.onloadend = function() {
|
|
1319
|
+
e.reloading = !1, e.xhr = null;
|
|
1320
|
+
}, this.checkCrossOrigin && rn(t) && i.crossOrigin && (t = on(t)), c.open("GET", t, !0), c.responseType = "arraybuffer", c.withCredentials = i.crossOrigin === "use-credentials", c.send();
|
|
1321
|
+
}
|
|
1322
|
+
else this.clone();
|
|
1323
|
+
}
|
|
1324
|
+
}, read: function(t) {
|
|
1325
|
+
var e = this.$props, i = this.imageData, n = function(c) {
|
|
1326
|
+
var s, l = new DataView(c);
|
|
1327
|
+
try {
|
|
1328
|
+
var u, d, g;
|
|
1329
|
+
if (l.getUint8(0) === 255 && l.getUint8(1) === 216) for (var v = l.byteLength, m = 2; m + 1 < v; ) {
|
|
1330
|
+
if (l.getUint8(m) === 255 && l.getUint8(m + 1) === 225) {
|
|
1331
|
+
d = m;
|
|
1332
|
+
break;
|
|
1333
|
+
}
|
|
1334
|
+
m += 1;
|
|
1335
|
+
}
|
|
1336
|
+
if (d) {
|
|
1337
|
+
var f = d + 10;
|
|
1338
|
+
if (function(M, k, $) {
|
|
1339
|
+
var I = "";
|
|
1340
|
+
$ += k;
|
|
1341
|
+
for (var j = k; j < $; j += 1) I += sn(M.getUint8(j));
|
|
1342
|
+
return I;
|
|
1343
|
+
}(l, d + 4, 4) === "Exif") {
|
|
1344
|
+
var b = l.getUint16(f);
|
|
1345
|
+
if (((u = b === 18761) || b === 19789) && l.getUint16(f + 2, u) === 42) {
|
|
1346
|
+
var D = l.getUint32(f + 4, u);
|
|
1347
|
+
D >= 8 && (g = f + D);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
if (g) {
|
|
1352
|
+
var w, T, p = l.getUint16(g, u);
|
|
1353
|
+
for (T = 0; T < p; T += 1) if (w = g + 12 * T + 2, l.getUint16(w, u) === 274) {
|
|
1354
|
+
w += 8, s = l.getUint16(w, u), l.setUint16(w, 1, u);
|
|
1355
|
+
break;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
} catch {
|
|
1359
|
+
s = 1;
|
|
1360
|
+
}
|
|
1361
|
+
return s;
|
|
1362
|
+
}(t), a = 0, r = 1, o = 1;
|
|
1363
|
+
if (n > 1) {
|
|
1364
|
+
this.url = function(c, s) {
|
|
1365
|
+
for (var l = [], u = new Uint8Array(c); u.length > 0; ) l.push(sn.apply(null, tn(u.subarray(0, 8192)))), u = u.subarray(8192);
|
|
1366
|
+
return "data:".concat("image/jpeg", ";base64,").concat(btoa(l.join("")));
|
|
1367
|
+
}(t);
|
|
1368
|
+
var h = function(c) {
|
|
1369
|
+
var s = 0, l = 1, u = 1;
|
|
1370
|
+
switch (c) {
|
|
1371
|
+
case 2:
|
|
1372
|
+
l = -1;
|
|
1373
|
+
break;
|
|
1374
|
+
case 3:
|
|
1375
|
+
s = -180;
|
|
1376
|
+
break;
|
|
1377
|
+
case 4:
|
|
1378
|
+
u = -1;
|
|
1379
|
+
break;
|
|
1380
|
+
case 5:
|
|
1381
|
+
s = 90, u = -1;
|
|
1382
|
+
break;
|
|
1383
|
+
case 6:
|
|
1384
|
+
s = 90;
|
|
1385
|
+
break;
|
|
1386
|
+
case 7:
|
|
1387
|
+
s = 90, l = -1;
|
|
1388
|
+
break;
|
|
1389
|
+
case 8:
|
|
1390
|
+
s = -90;
|
|
1391
|
+
}
|
|
1392
|
+
return { rotate: s, scaleX: l, scaleY: u };
|
|
1393
|
+
}(n);
|
|
1394
|
+
a = h.rotate, r = h.scaleX, o = h.scaleY;
|
|
1395
|
+
}
|
|
1396
|
+
e.rotatable && (i.rotate = a), e.scalable && (i.scaleX = r, i.scaleY = o), this.clone();
|
|
1397
|
+
}, clone: function() {
|
|
1398
|
+
var t = this.element, e = this.url, i = t.crossOrigin, n = e;
|
|
1399
|
+
this.checkCrossOrigin && rn(e) && (i || (i = "anonymous"), n = on(e)), this.crossOrigin = i, this.crossOriginUrl = n;
|
|
1400
|
+
var a = document.createElement("img");
|
|
1401
|
+
this.image = a, i && (a.crossOrigin = i), a.src = n || e, a.alt = t.alt || "The image to crop", a.onload = this.start.bind(this), a.onerror = this.stop.bind(this), _(a, Yn), t.parentNode.insertBefore(a, t.nextSibling);
|
|
1402
|
+
}, start: function() {
|
|
1403
|
+
var t = this;
|
|
1404
|
+
return new Promise(function(e) {
|
|
1405
|
+
var i = t.image;
|
|
1406
|
+
i.onload = null, i.onerror = null, t.sizing = !0;
|
|
1407
|
+
var n = Z.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Z.navigator.userAgent), a = function(h, c) {
|
|
1408
|
+
C(t.imageData, { naturalWidth: h, naturalHeight: c, aspectRatio: h / c }), t.initialImageData = C({}, t.imageData), t.sizing = !1, t.sized = !0, t.build(), e();
|
|
1409
|
+
};
|
|
1410
|
+
if (!i.naturalWidth || n) {
|
|
1411
|
+
var r = document.createElement("img"), o = document.body || document.documentElement;
|
|
1412
|
+
t.sizingImage = r, r.onload = function() {
|
|
1413
|
+
a(r.width, r.height), n || o.removeChild(r);
|
|
1414
|
+
}, r.src = i.src, n || (r.style.cssText = "left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;", o.appendChild(r));
|
|
1415
|
+
} else a(i.naturalWidth, i.naturalHeight);
|
|
1416
|
+
});
|
|
1417
|
+
}, build: function() {
|
|
1418
|
+
if (this.sized) {
|
|
1419
|
+
var t = this.$props;
|
|
1420
|
+
this.initPreview(), this.bind(), A(this.image, E), this.canvas.appendChild(this.image), this.render(), this.setDragMode(), this.autoCrop && this.crop(), this.setData(t.data);
|
|
1421
|
+
}
|
|
1422
|
+
}, stop: function() {
|
|
1423
|
+
var t = this.image;
|
|
1424
|
+
t.onload = null, t.onerror = null, t.parentNode.removeChild(t), this.image = null;
|
|
1425
|
+
}, unbuild: function() {
|
|
1426
|
+
this.ready && (this.ready = !1, this.unbind(), this.resetPreview(), this.cropper.parentNode.removeChild(this.cropper), A(this.element, E));
|
|
1427
|
+
}, uncreate: function() {
|
|
1428
|
+
this.ready ? (this.unbuild(), this.ready = !1, this.cropped = !1) : this.sizing ? (this.sizingImage.onload = null, this.sizing = !1, this.sized = !1) : this.reloading ? (this.xhr.onabort = null, this.xhr.abort()) : this.image && this.stop();
|
|
1429
|
+
} } }, U(Yt) ? { setup: Yt, name: Yt.name } : Yt);
|
|
1430
|
+
var Yt, ca = "1.1.1";
|
|
1431
|
+
const la = hn;
|
|
1432
|
+
return X;
|
|
1433
|
+
})();
|
|
1434
|
+
});
|
|
1435
|
+
})(fn);
|
|
1436
|
+
var gn = fn.exports;
|
|
1437
|
+
const fa = /* @__PURE__ */ da(gn), ma = /* @__PURE__ */ pa({
|
|
1438
|
+
__proto__: null,
|
|
1439
|
+
default: fa
|
|
1440
|
+
}, [gn]);
|
|
1441
|
+
export {
|
|
1442
|
+
ma as i
|
|
1443
|
+
};
|