@nxgt/material-vue 0.23.0 → 0.23.1
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/README.md +1 -0
- package/dist/{camera-C7V5U_xH.js → camera-G80plUZO.js} +1 -1
- package/dist/{components-BSnW1NZK.js → components-D3nLHMxx.js} +4 -4
- package/dist/components.js +1 -1
- package/dist/{image-cropper-canvas-DZGLMjV6.js → image-cropper-canvas-HzYWblQm.js} +435 -428
- package/dist/lib/nuxt/module.d.ts +3 -1
- package/dist/lib/nuxt/pdf-fonts.d.ts +30 -1
- package/dist/main.js +1 -1
- package/dist/{pdf-outline-sidebar-D45RuliO.js → pdf-outline-sidebar-DycVwjfJ.js} +1 -1
- package/dist/{pdf-page-QUKMeod_.js → pdf-page-CHfDMJ_4.js} +1 -1
- package/dist/{pdf-page-list-DzfNykQj.js → pdf-page-list-Cy3Qgm2N.js} +2 -2
- package/dist/{pdf-reader-Bmj2kN0E.js → pdf-reader-D8CFeq1E.js} +4 -4
- package/dist/{pdf-sidebar-CV_Hy9vw.js → pdf-sidebar-D4BpuyNy.js} +2 -2
- package/dist/{pdf-thumbnail-sidebar-Cgk8Y79g.js → pdf-thumbnail-sidebar-Cl9o8zQp.js} +2 -2
- package/dist/{stx-player-C3g6Pcxu.js → stx-player-CpzcZSMq.js} +1 -1
- package/docs/getting-started.md +4 -1
- package/docs/guides/pdf.md +5 -2
- package/docs/roadmap.md +9 -0
- package/docs/troubleshooting.md +51 -2
- package/lib/nuxt/module.ts +23 -6
- package/lib/nuxt/pdf-fonts.ts +101 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createVNode as i, defineComponent as a, mergeProps as o,
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createVNode as i, defineComponent as a, mergeProps as o, onBeforeUnmount as s, openBlock as c, ref as l, renderList as u, renderSlot as d, resolveComponent as f, resolveDynamicComponent as p, unref as m, vShow as h, watch as g, withCtx as _, withDirectives as v, withModifiers as y } from "vue";
|
|
2
2
|
//#region ../../node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
|
|
3
|
-
function
|
|
3
|
+
function ee(e, t) {
|
|
4
4
|
var n = Object.keys(e);
|
|
5
5
|
if (Object.getOwnPropertySymbols) {
|
|
6
6
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -13,9 +13,9 @@ function y(e, t) {
|
|
|
13
13
|
function b(e) {
|
|
14
14
|
for (var t = 1; t < arguments.length; t++) {
|
|
15
15
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
16
|
-
t % 2 ?
|
|
16
|
+
t % 2 ? ee(Object(n), !0).forEach((function(t) {
|
|
17
17
|
x(e, t, n[t]);
|
|
18
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
18
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ee(Object(n)).forEach((function(t) {
|
|
19
19
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
20
20
|
}));
|
|
21
21
|
}
|
|
@@ -29,7 +29,7 @@ function x(e, t, n) {
|
|
|
29
29
|
writable: !0
|
|
30
30
|
}) : e[t] = n, e;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function te(e, t) {
|
|
33
33
|
if (e == null) return {};
|
|
34
34
|
var n, r, i = function(e, t) {
|
|
35
35
|
if (e == null) return {};
|
|
@@ -45,26 +45,26 @@ function ee(e, t) {
|
|
|
45
45
|
}
|
|
46
46
|
function S(e) {
|
|
47
47
|
return function(e) {
|
|
48
|
-
if (Array.isArray(e)) return
|
|
48
|
+
if (Array.isArray(e)) return ne(e);
|
|
49
49
|
}(e) || function(e) {
|
|
50
50
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
51
51
|
}(e) || function(e, t) {
|
|
52
52
|
if (e) {
|
|
53
|
-
if (typeof e == "string") return
|
|
53
|
+
if (typeof e == "string") return ne(e, t);
|
|
54
54
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
55
55
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
56
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
56
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ne(e, t);
|
|
57
57
|
}
|
|
58
58
|
}(e) || function() {
|
|
59
59
|
throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
60
60
|
}();
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function ne(e, t) {
|
|
63
63
|
(t == null || t > e.length) && (t = e.length);
|
|
64
64
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
65
65
|
return r;
|
|
66
66
|
}
|
|
67
|
-
var
|
|
67
|
+
var re, ie, C, w = (re = function(e) {
|
|
68
68
|
(function() {
|
|
69
69
|
var t = {}.hasOwnProperty;
|
|
70
70
|
function n() {
|
|
@@ -86,8 +86,8 @@ var ne, re, C, w = (ne = function(e) {
|
|
|
86
86
|
}
|
|
87
87
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
88
88
|
})();
|
|
89
|
-
},
|
|
90
|
-
path:
|
|
89
|
+
}, re(C = {
|
|
90
|
+
path: ie,
|
|
91
91
|
exports: {},
|
|
92
92
|
require: function(e, t) {
|
|
93
93
|
return function() {
|
|
@@ -106,7 +106,7 @@ var ne, re, C, w = (ne = function(e) {
|
|
|
106
106
|
}), "") : "");
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
|
-
function
|
|
109
|
+
function ae(e, t, n) {
|
|
110
110
|
var r, i, a, o, s;
|
|
111
111
|
function c() {
|
|
112
112
|
var l = Date.now() - o;
|
|
@@ -124,25 +124,25 @@ function ie(e, t, n) {
|
|
|
124
124
|
r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
|
|
125
125
|
}, l;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
var
|
|
127
|
+
ae.debounce = ae;
|
|
128
|
+
var oe = ae, E = function() {
|
|
129
129
|
return E = Object.assign || function(e) {
|
|
130
130
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
131
131
|
return e;
|
|
132
132
|
}, E.apply(this, arguments);
|
|
133
133
|
};
|
|
134
|
-
function
|
|
134
|
+
function se(e, t) {
|
|
135
135
|
var n, r;
|
|
136
136
|
return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
|
|
137
137
|
name: n,
|
|
138
138
|
classname: r
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function ce(e) {
|
|
142
142
|
return /^blob:/.test(e);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
return
|
|
144
|
+
function le(e) {
|
|
145
|
+
return ce(e) || function(e) {
|
|
146
146
|
return /^data:/.test(e);
|
|
147
147
|
}(e);
|
|
148
148
|
}
|
|
@@ -155,34 +155,34 @@ function O(e) {
|
|
|
155
155
|
function k(e) {
|
|
156
156
|
return typeof e == "object" && !!e;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function ue(e, t, n) {
|
|
159
159
|
var r = {};
|
|
160
160
|
return k(e) ? (Object.keys(t).forEach((function(i) {
|
|
161
|
-
O(e[i]) ? r[i] = t[i] : k(t[i]) ? k(e[i]) ? r[i] =
|
|
161
|
+
O(e[i]) ? r[i] = t[i] : k(t[i]) ? k(e[i]) ? r[i] = ue(e[i], t[i], n[i]) : r[i] = e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? r[i] = !!e[i] : r[i] = e[i];
|
|
162
162
|
})), r) : e ? t : n;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function de(e) {
|
|
165
165
|
var t = Number(e);
|
|
166
166
|
return Number.isNaN(t) ? e : t;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function fe(e) {
|
|
169
169
|
return typeof (e == "number" || function(e) {
|
|
170
170
|
return typeof e == "object" && !!e;
|
|
171
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
171
|
+
}(e) && toString.call(e) == "[object Number]") && !pe(e);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function pe(e) {
|
|
174
174
|
return e != e;
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function me(e, t) {
|
|
177
177
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
178
178
|
}
|
|
179
|
-
var
|
|
179
|
+
var A = function(e, t) {
|
|
180
180
|
e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
|
|
181
|
-
},
|
|
181
|
+
}, he = function(e, t) {
|
|
182
182
|
t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
|
|
183
|
-
},
|
|
183
|
+
}, ge = function(e) {
|
|
184
184
|
this.type = "move", this.directions = e;
|
|
185
|
-
},
|
|
185
|
+
}, _e = function() {
|
|
186
186
|
function e(e, t, n, r, i) {
|
|
187
187
|
this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
|
|
188
188
|
}
|
|
@@ -200,7 +200,7 @@ var j = function(e, t) {
|
|
|
200
200
|
top: 0
|
|
201
201
|
};
|
|
202
202
|
}, e;
|
|
203
|
-
}(),
|
|
203
|
+
}(), ve = {
|
|
204
204
|
name: "DraggableElement",
|
|
205
205
|
props: { classname: { type: String } },
|
|
206
206
|
beforeMount: function() {
|
|
@@ -271,7 +271,7 @@ var j = function(e, t) {
|
|
|
271
271
|
if (this.touches.length) {
|
|
272
272
|
if (this.touches.length === 1 && n.length === 1) {
|
|
273
273
|
var r = this.$refs.draggable;
|
|
274
|
-
this.$emit("drag", new
|
|
274
|
+
this.$emit("drag", new _e(e, r, {
|
|
275
275
|
left: n[0].clientX,
|
|
276
276
|
top: n[0].clientY
|
|
277
277
|
}, {
|
|
@@ -293,8 +293,8 @@ var j = function(e, t) {
|
|
|
293
293
|
"enter"
|
|
294
294
|
]
|
|
295
295
|
};
|
|
296
|
-
|
|
297
|
-
return
|
|
296
|
+
ve.render = function(e, t, r, i, a, o) {
|
|
297
|
+
return c(), n("div", {
|
|
298
298
|
ref: "draggable",
|
|
299
299
|
class: r.classname,
|
|
300
300
|
onTouchstart: t[1] ||= function() {
|
|
@@ -309,11 +309,11 @@ ge.render = function(e, t, r, i, a, o) {
|
|
|
309
309
|
onMouseleave: t[4] ||= function() {
|
|
310
310
|
return o.onMouseLeave && o.onMouseLeave.apply(o, arguments);
|
|
311
311
|
}
|
|
312
|
-
}, [
|
|
312
|
+
}, [d(e.$slots, "default")], 34);
|
|
313
313
|
};
|
|
314
|
-
var
|
|
314
|
+
var ye = T("vue-handler-wrapper"), be = {
|
|
315
315
|
name: "HandlerWrapper",
|
|
316
|
-
components: { DraggableElement:
|
|
316
|
+
components: { DraggableElement: ve },
|
|
317
317
|
props: {
|
|
318
318
|
horizontalPosition: { type: String },
|
|
319
319
|
verticalPosition: { type: String },
|
|
@@ -325,12 +325,12 @@ var _e = T("vue-handler-wrapper"), ve = {
|
|
|
325
325
|
computed: { classes: function() {
|
|
326
326
|
var e;
|
|
327
327
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
328
|
-
var t, n =
|
|
329
|
-
e =
|
|
330
|
-
} else e =
|
|
328
|
+
var t, n = se(this.horizontalPosition, this.verticalPosition);
|
|
329
|
+
e = ye((x(t = {}, n.classname, !0), x(t, "disabled", this.disabled), t));
|
|
330
|
+
} else e = ye({ disabled: this.disabled });
|
|
331
331
|
return {
|
|
332
332
|
root: e,
|
|
333
|
-
draggable:
|
|
333
|
+
draggable: ye("draggable")
|
|
334
334
|
};
|
|
335
335
|
} },
|
|
336
336
|
emits: [
|
|
@@ -340,10 +340,10 @@ var _e = T("vue-handler-wrapper"), ve = {
|
|
|
340
340
|
"drag-end"
|
|
341
341
|
]
|
|
342
342
|
};
|
|
343
|
-
|
|
344
|
-
var l =
|
|
345
|
-
return
|
|
346
|
-
class:
|
|
343
|
+
be.render = function(e, t, r, a, o, s) {
|
|
344
|
+
var l = f("DraggableElement");
|
|
345
|
+
return c(), n("div", { class: s.classes.root }, [i(l, {
|
|
346
|
+
class: s.classes.draggable,
|
|
347
347
|
onDrag: t[1] ||= function(t) {
|
|
348
348
|
return e.$emit("drag", t);
|
|
349
349
|
},
|
|
@@ -357,15 +357,15 @@ ve.render = function(e, t, r, a, o, c) {
|
|
|
357
357
|
return e.$emit("enter");
|
|
358
358
|
}
|
|
359
359
|
}, {
|
|
360
|
-
default:
|
|
361
|
-
return [
|
|
360
|
+
default: _((function() {
|
|
361
|
+
return [d(e.$slots, "default")];
|
|
362
362
|
})),
|
|
363
363
|
_: 3
|
|
364
364
|
}, 8, ["class"])], 2);
|
|
365
365
|
};
|
|
366
|
-
var
|
|
366
|
+
var xe = T("vue-line-wrapper"), Se = {
|
|
367
367
|
name: "LineWrapper",
|
|
368
|
-
components: { DraggableElement:
|
|
368
|
+
components: { DraggableElement: ve },
|
|
369
369
|
props: {
|
|
370
370
|
position: {
|
|
371
371
|
type: String,
|
|
@@ -378,7 +378,7 @@ var ye = T("vue-line-wrapper"), be = {
|
|
|
378
378
|
},
|
|
379
379
|
computed: { classname: function() {
|
|
380
380
|
var e;
|
|
381
|
-
return
|
|
381
|
+
return xe((x(e = {}, this.position, !0), x(e, "disabled", this.disabled), e));
|
|
382
382
|
} },
|
|
383
383
|
emits: [
|
|
384
384
|
"leave",
|
|
@@ -387,9 +387,9 @@ var ye = T("vue-line-wrapper"), be = {
|
|
|
387
387
|
"drag-end"
|
|
388
388
|
]
|
|
389
389
|
};
|
|
390
|
-
|
|
391
|
-
var
|
|
392
|
-
return
|
|
390
|
+
Se.render = function(e, t, r, i, a, o) {
|
|
391
|
+
var s = f("DraggableElement");
|
|
392
|
+
return c(), n(s, {
|
|
393
393
|
class: o.classname,
|
|
394
394
|
onDrag: t[1] ||= function(t) {
|
|
395
395
|
return e.$emit("drag", t);
|
|
@@ -404,29 +404,29 @@ be.render = function(e, t, r, i, a, o) {
|
|
|
404
404
|
return e.$emit("enter");
|
|
405
405
|
}
|
|
406
406
|
}, {
|
|
407
|
-
default:
|
|
408
|
-
return [
|
|
407
|
+
default: _((function() {
|
|
408
|
+
return [d(e.$slots, "default")];
|
|
409
409
|
})),
|
|
410
410
|
_: 3
|
|
411
411
|
}, 8, ["class"]);
|
|
412
412
|
};
|
|
413
|
-
var
|
|
413
|
+
var j = [
|
|
414
414
|
"left",
|
|
415
415
|
"right",
|
|
416
416
|
"top",
|
|
417
417
|
"bottom"
|
|
418
|
-
],
|
|
418
|
+
], Ce = ["left", "right"], we = ["top", "bottom"], Te = ["left", "top"], Ee = [
|
|
419
419
|
"fill-area",
|
|
420
420
|
"fit-area",
|
|
421
421
|
"stencil",
|
|
422
422
|
"none"
|
|
423
|
-
],
|
|
423
|
+
], De = {
|
|
424
424
|
left: 0,
|
|
425
425
|
top: 0,
|
|
426
426
|
width: 0,
|
|
427
427
|
height: 0
|
|
428
428
|
};
|
|
429
|
-
function
|
|
429
|
+
function Oe(e, t, n) {
|
|
430
430
|
return !(n ||= [
|
|
431
431
|
"width",
|
|
432
432
|
"height",
|
|
@@ -436,7 +436,7 @@ function Ee(e, t, n) {
|
|
|
436
436
|
return e[n] !== t[n];
|
|
437
437
|
}));
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function M(e) {
|
|
440
440
|
return {
|
|
441
441
|
left: e.left,
|
|
442
442
|
top: e.top,
|
|
@@ -444,31 +444,31 @@ function N(e) {
|
|
|
444
444
|
bottom: e.top + e.height
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function N(e, t) {
|
|
448
448
|
return {
|
|
449
449
|
left: e.left - t.left,
|
|
450
450
|
top: e.top - t.top
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function P(e) {
|
|
454
454
|
return {
|
|
455
455
|
left: e.left + e.width / 2,
|
|
456
456
|
top: e.top + e.height / 2
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function F(e, t) {
|
|
460
460
|
var n = {
|
|
461
461
|
left: 0,
|
|
462
462
|
top: 0,
|
|
463
463
|
right: 0,
|
|
464
464
|
bottom: 0
|
|
465
465
|
};
|
|
466
|
-
return
|
|
467
|
-
var i = t[r], a =
|
|
466
|
+
return j.forEach((function(r) {
|
|
467
|
+
var i = t[r], a = M(e)[r];
|
|
468
468
|
n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
|
|
469
469
|
})), n;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function I(e, t) {
|
|
472
472
|
return {
|
|
473
473
|
left: e.left - t.left,
|
|
474
474
|
top: e.top - t.top,
|
|
@@ -476,22 +476,22 @@ function L(e, t) {
|
|
|
476
476
|
height: e.height + t.top + t.bottom
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function L(e) {
|
|
480
480
|
return {
|
|
481
481
|
left: -e.left,
|
|
482
482
|
top: -e.top
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function R(e, t) {
|
|
486
486
|
return E(E({}, e), {
|
|
487
487
|
left: e.left + t.left,
|
|
488
488
|
top: e.top + t.top
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function z(e, t, n, r) {
|
|
492
492
|
if (t !== 1) {
|
|
493
493
|
if (n) {
|
|
494
|
-
var i =
|
|
494
|
+
var i = P(e);
|
|
495
495
|
return {
|
|
496
496
|
width: e.width * t,
|
|
497
497
|
height: e.height * t,
|
|
@@ -508,25 +508,25 @@ function B(e, t, n, r) {
|
|
|
508
508
|
}
|
|
509
509
|
return e;
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function B(e) {
|
|
512
512
|
return e.width / e.height;
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function V(e, t) {
|
|
515
515
|
return Math.min(t.right !== void 0 && t.left !== void 0 ? (t.right - t.left) / e.width : Infinity, t.bottom !== void 0 && t.top !== void 0 ? (t.bottom - t.top) / e.height : Infinity);
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function H(e, t) {
|
|
518
518
|
var n = {
|
|
519
519
|
left: 0,
|
|
520
520
|
top: 0
|
|
521
|
-
}, r =
|
|
521
|
+
}, r = F(e, t);
|
|
522
522
|
return r.left && r.left > 0 ? n.left = r.left : r.right && r.right > 0 && (n.left = -r.right), r.top && r.top > 0 ? n.top = r.top : r.bottom && r.bottom > 0 && (n.top = -r.bottom), n;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function ke(e, t) {
|
|
525
525
|
var n;
|
|
526
526
|
return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
529
|
-
var n =
|
|
528
|
+
function Ae(e, t) {
|
|
529
|
+
var n = B(e), r = B(t);
|
|
530
530
|
return t.width < Infinity && t.height < Infinity ? n > r ? {
|
|
531
531
|
width: t.width,
|
|
532
532
|
height: t.width / n
|
|
@@ -541,36 +541,36 @@ function Oe(e, t) {
|
|
|
541
541
|
height: t.height
|
|
542
542
|
} : e;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function je(e, t) {
|
|
545
545
|
var n = t * Math.PI / 180;
|
|
546
546
|
return {
|
|
547
547
|
width: Math.abs(e.width * Math.cos(n)) + Math.abs(e.height * Math.sin(n)),
|
|
548
548
|
height: Math.abs(e.width * Math.sin(n)) + Math.abs(e.height * Math.cos(n))
|
|
549
549
|
};
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function U(e, t) {
|
|
552
552
|
var n = t * Math.PI / 180;
|
|
553
553
|
return {
|
|
554
554
|
left: e.left * Math.cos(n) - e.top * Math.sin(n),
|
|
555
555
|
top: e.left * Math.sin(n) + e.top * Math.cos(n)
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
var n =
|
|
560
|
-
return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width,
|
|
558
|
+
function W(e, t) {
|
|
559
|
+
var n = F(G(e, t), t);
|
|
560
|
+
return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, V(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, V(e, t)) : 1;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function G(e, t, n) {
|
|
563
563
|
n === void 0 && (n = !1);
|
|
564
|
-
var r =
|
|
565
|
-
return
|
|
564
|
+
var r = H(e, t);
|
|
565
|
+
return R(e, n ? L(r) : r);
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Me(e) {
|
|
568
568
|
return {
|
|
569
569
|
width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : Infinity,
|
|
570
570
|
height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : Infinity
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function Ne(e, t) {
|
|
574
574
|
return E(E({}, e), {
|
|
575
575
|
minWidth: Math.min(t.width, e.minWidth),
|
|
576
576
|
minHeight: Math.min(t.height, e.minHeight),
|
|
@@ -578,25 +578,25 @@ function je(e, t) {
|
|
|
578
578
|
maxHeight: Math.min(t.height, e.maxHeight)
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function Pe(e, t, n) {
|
|
582
582
|
n === void 0 && (n = !0);
|
|
583
583
|
var r = {};
|
|
584
|
-
return
|
|
584
|
+
return j.forEach((function(i) {
|
|
585
585
|
var a = e[i], o = t[i];
|
|
586
586
|
a !== void 0 && o !== void 0 ? r[i] = i === "left" || i === "top" ? n ? Math.max(a, o) : Math.min(a, o) : n ? Math.min(a, o) : Math.max(a, o) : o === void 0 ? a !== void 0 && (r[i] = a) : r[i] = o;
|
|
587
587
|
})), r;
|
|
588
588
|
}
|
|
589
|
-
function
|
|
590
|
-
return
|
|
589
|
+
function K(e, t) {
|
|
590
|
+
return Pe(e, t, !0);
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function Fe(e) {
|
|
593
593
|
var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
|
|
594
|
-
return !!((t.correctRatio ||
|
|
594
|
+
return !!((t.correctRatio || B(t) >= n.minimum && B(t) <= n.maximum) && t.height <= i.maxHeight && t.width <= i.maxWidth && t.width && t.height && (r || t.height >= i.minHeight && t.width >= i.minWidth));
|
|
595
595
|
}
|
|
596
|
-
function
|
|
596
|
+
function Ie(e, t) {
|
|
597
597
|
return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function q(e) {
|
|
600
600
|
var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
|
|
601
601
|
minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
|
|
602
602
|
maximum: e.aspectRatio && e.aspectRatio.maximum || Infinity
|
|
@@ -606,15 +606,15 @@ function J(e) {
|
|
|
606
606
|
};
|
|
607
607
|
function o(e, a) {
|
|
608
608
|
return a === void 0 && (a = !1), e.reduce((function(e, o) {
|
|
609
|
-
return
|
|
609
|
+
return Fe({
|
|
610
610
|
size: o,
|
|
611
611
|
aspectRatio: i,
|
|
612
612
|
sizeRestrictions: r,
|
|
613
613
|
ignoreMinimum: a
|
|
614
|
-
}) && (!e ||
|
|
614
|
+
}) && (!e || Ie(o, {
|
|
615
615
|
width: t,
|
|
616
616
|
height: n
|
|
617
|
-
}) <
|
|
617
|
+
}) < Ie(e, {
|
|
618
618
|
width: t,
|
|
619
619
|
height: n
|
|
620
620
|
})) ? o : e;
|
|
@@ -631,7 +631,7 @@ function J(e) {
|
|
|
631
631
|
height: a.height,
|
|
632
632
|
correctRatio: !0
|
|
633
633
|
});
|
|
634
|
-
})),
|
|
634
|
+
})), Fe({
|
|
635
635
|
size: a,
|
|
636
636
|
aspectRatio: i,
|
|
637
637
|
sizeRestrictions: r
|
|
@@ -642,16 +642,16 @@ function J(e) {
|
|
|
642
642
|
height: c.height
|
|
643
643
|
};
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a =
|
|
647
|
-
return
|
|
645
|
+
function Le(e) {
|
|
646
|
+
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = R(n, t.directions);
|
|
647
|
+
return R(a, H(a, i));
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function Re(e) {
|
|
650
650
|
var t = e.coordinates, n = e.transform, r = e.imageSize, i = e.sizeRestrictions, a = e.positionRestrictions, o = e.aspectRatio, s = e.visibleArea, c = function(e, t) {
|
|
651
|
-
return
|
|
651
|
+
return Le({
|
|
652
652
|
coordinates: e,
|
|
653
653
|
positionRestrictions: a,
|
|
654
|
-
event: new
|
|
654
|
+
event: new ge({
|
|
655
655
|
left: t.left - e.left,
|
|
656
656
|
top: t.top - e.top
|
|
657
657
|
})
|
|
@@ -664,7 +664,7 @@ function Ie(e) {
|
|
|
664
664
|
imageSize: r,
|
|
665
665
|
visibleArea: s
|
|
666
666
|
}) : e).width) && O(t.height) || (l = function(e, t) {
|
|
667
|
-
return c(E(E(E({}, e),
|
|
667
|
+
return c(E(E(E({}, e), q({
|
|
668
668
|
width: t.width,
|
|
669
669
|
height: t.height,
|
|
670
670
|
sizeRestrictions: i,
|
|
@@ -679,35 +679,35 @@ function Ie(e) {
|
|
|
679
679
|
}(l, E(E({}, l), t))), O(t.left) && O(t.top) || (l = c(l, E(E({}, l), t)));
|
|
680
680
|
})), l;
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function ze(e) {
|
|
683
683
|
e.event;
|
|
684
684
|
var t = e.getAreaRestrictions, n = e.boundaries, r = e.coordinates, i = e.visibleArea;
|
|
685
685
|
e.aspectRatio;
|
|
686
686
|
var a = e.stencilSize, o = e.sizeRestrictions, s = e.positionRestrictions;
|
|
687
687
|
e.stencilReference;
|
|
688
688
|
var c, l, u, d = E({}, r), f = E({}, i), p = E({}, a);
|
|
689
|
-
c =
|
|
689
|
+
c = B(p), l = B(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = E(E({}, d), q({
|
|
690
690
|
sizeRestrictions: o,
|
|
691
691
|
width: d.width,
|
|
692
692
|
height: d.height,
|
|
693
693
|
aspectRatio: {
|
|
694
|
-
minimum:
|
|
695
|
-
maximum:
|
|
694
|
+
minimum: B(p),
|
|
695
|
+
maximum: B(p)
|
|
696
696
|
}
|
|
697
697
|
})));
|
|
698
|
-
var m =
|
|
698
|
+
var m = W(f = z(f, d.width * n.width / (f.width * p.width)), t({
|
|
699
699
|
visibleArea: f,
|
|
700
700
|
type: "resize"
|
|
701
701
|
}));
|
|
702
|
-
return m !== 1 && (f =
|
|
702
|
+
return m !== 1 && (f = z(f, m), d = z(d, m)), f = G(f = R(f, N(P(d), P(f))), t({
|
|
703
703
|
visibleArea: f,
|
|
704
704
|
type: "move"
|
|
705
705
|
})), {
|
|
706
|
-
coordinates: d =
|
|
706
|
+
coordinates: d = G(d, K(M(f), s)),
|
|
707
707
|
visibleArea: f
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Be(e) {
|
|
711
711
|
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea;
|
|
712
712
|
e.aspectRatio, e.stencilSize, e.sizeRestrictions;
|
|
713
713
|
var o = e.positionRestrictions;
|
|
@@ -718,32 +718,32 @@ function Re(e) {
|
|
|
718
718
|
width: 0,
|
|
719
719
|
height: 0
|
|
720
720
|
};
|
|
721
|
-
c.width, r.width,
|
|
722
|
-
var u =
|
|
721
|
+
c.width, r.width, B(r) > B(s) ? (l.height = .8 * r.height, l.width = l.height * B(s)) : (l.width = .8 * r.width, l.height = l.width * B(s));
|
|
722
|
+
var u = W(c = z(c, s.width * r.width / (c.width * l.width)), n({
|
|
723
723
|
visibleArea: c,
|
|
724
724
|
type: "resize"
|
|
725
725
|
}));
|
|
726
|
-
c =
|
|
726
|
+
c = z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = G(c = R(c, N(P(s), P(c))), n({
|
|
727
727
|
visibleArea: c,
|
|
728
728
|
type: "move"
|
|
729
|
-
})), s =
|
|
729
|
+
})), s = G(s, K(M(c), o));
|
|
730
730
|
}
|
|
731
731
|
return {
|
|
732
732
|
coordinates: s,
|
|
733
733
|
visibleArea: c
|
|
734
734
|
};
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function Ve(e) {
|
|
737
737
|
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = E({}, r), o = E({}, n);
|
|
738
738
|
if (t.type === "setCoordinates") {
|
|
739
739
|
var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
|
|
740
|
-
s > c ? a =
|
|
740
|
+
s > c ? a = z(a, Math.min(o.width / a.width, V(a, i({
|
|
741
741
|
visibleArea: a,
|
|
742
742
|
type: "resize"
|
|
743
|
-
})))) : c > s && (a =
|
|
743
|
+
})))) : c > s && (a = z(a, Math.min(o.height / a.height, V(a, i({
|
|
744
744
|
visibleArea: a,
|
|
745
745
|
type: "resize"
|
|
746
|
-
}))))), a =
|
|
746
|
+
}))))), a = G(a = R(a, L(H(o, M(a)))), i({
|
|
747
747
|
visibleArea: a,
|
|
748
748
|
type: "move"
|
|
749
749
|
}));
|
|
@@ -753,56 +753,56 @@ function ze(e) {
|
|
|
753
753
|
coordinates: o
|
|
754
754
|
};
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function He(e) {
|
|
757
757
|
var t = e.imageSize, n = e.visibleArea, r = e.coordinates, i = n || t;
|
|
758
758
|
return {
|
|
759
759
|
left: (n ? n.left : 0) + i.width / 2 - r.width / 2,
|
|
760
760
|
top: (n ? n.top : 0) + i.height / 2 - r.height / 2
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || Infinity, Math.max(r.minimum || 0,
|
|
763
|
+
function Ue(e) {
|
|
764
|
+
var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || Infinity, Math.max(r.minimum || 0, B(a))), s = a.width < a.height ? {
|
|
765
765
|
width: .8 * a.width,
|
|
766
766
|
height: .8 * a.width / o
|
|
767
767
|
} : {
|
|
768
768
|
height: .8 * a.height,
|
|
769
769
|
width: .8 * a.height * o
|
|
770
770
|
};
|
|
771
|
-
return
|
|
771
|
+
return q(E(E({}, s), {
|
|
772
772
|
aspectRatio: r,
|
|
773
773
|
sizeRestrictions: i
|
|
774
774
|
}));
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function We(e) {
|
|
777
777
|
var t, n, r = e.imageSize, i = e.visibleArea, a = e.boundaries, o = e.aspectRatio, s = e.sizeRestrictions, c = e.stencilSize, l = i || r;
|
|
778
|
-
return
|
|
778
|
+
return B(l) > B(a) ? n = (t = c.height * l.height / a.height) * B(c) : t = (n = c.width * l.width / a.width) / B(c), q({
|
|
779
779
|
width: n,
|
|
780
780
|
height: t,
|
|
781
781
|
aspectRatio: o,
|
|
782
782
|
sizeRestrictions: s
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i =
|
|
785
|
+
function Ge(e) {
|
|
786
|
+
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = B(e.boundaries);
|
|
787
787
|
if (n) {
|
|
788
788
|
var a = {
|
|
789
789
|
height: Math.max(n.height, r.height),
|
|
790
790
|
width: Math.max(n.width, r.width)
|
|
791
|
-
}, o =
|
|
792
|
-
width:
|
|
793
|
-
height:
|
|
794
|
-
},
|
|
791
|
+
}, o = Ae({
|
|
792
|
+
width: B(a) > i ? a.width : a.height * i,
|
|
793
|
+
height: B(a) > i ? a.width / i : a.height
|
|
794
|
+
}, Me(t())), s = {
|
|
795
795
|
left: n.left + n.width / 2 - o.width / 2,
|
|
796
796
|
top: n.top + n.height / 2 - o.height / 2,
|
|
797
797
|
width: o.width,
|
|
798
798
|
height: o.height
|
|
799
|
-
}, c =
|
|
799
|
+
}, c = F(n, M(E({
|
|
800
800
|
left: 0,
|
|
801
801
|
top: 0
|
|
802
802
|
}, r))), l = {};
|
|
803
|
-
return !c.left && !c.right && s.width <= r.width && (l.left = 0, l.right = r.width), !c.top && !c.bottom && s.height <= r.height && (l.top = 0, l.bottom = r.height),
|
|
803
|
+
return !c.left && !c.right && s.width <= r.width && (l.left = 0, l.right = r.width), !c.top && !c.bottom && s.height <= r.height && (l.top = 0, l.bottom = r.height), G(s, l);
|
|
804
804
|
}
|
|
805
|
-
var u =
|
|
805
|
+
var u = B(r);
|
|
806
806
|
return o = {
|
|
807
807
|
height: u > i ? r.height : r.width / i,
|
|
808
808
|
width: u > i ? r.height * i : r.width
|
|
@@ -813,28 +813,28 @@ function Ue(e) {
|
|
|
813
813
|
height: o.height
|
|
814
814
|
};
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
816
|
+
function J(e, t) {
|
|
817
|
+
return Pe(e, M(t));
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function Ke(e) {
|
|
820
820
|
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.sizeRestrictions, a = e.getAreaRestrictions, o = e.positionRestrictions, s = e.adjustStencil, c = t.scale, l = t.move, u = E({}, r), d = E({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
|
|
821
|
-
u =
|
|
821
|
+
u = R(u, {
|
|
822
822
|
left: l.left || 0,
|
|
823
823
|
top: l.top || 0
|
|
824
824
|
});
|
|
825
825
|
var h = {
|
|
826
826
|
stencil: {
|
|
827
827
|
minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
|
|
828
|
-
maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity,
|
|
828
|
+
maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity, V(d, o))
|
|
829
829
|
},
|
|
830
|
-
area: { maximum:
|
|
830
|
+
area: { maximum: V(u, a({
|
|
831
831
|
visibleArea: u,
|
|
832
832
|
type: "resize"
|
|
833
833
|
})) }
|
|
834
834
|
};
|
|
835
|
-
c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u =
|
|
835
|
+
c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u = z(u, p, c.center));
|
|
836
836
|
var g = n.left - r.left, _ = r.width + r.left - (n.width + n.left), v = n.top - r.top, y = r.height + r.top - (n.height + n.top);
|
|
837
|
-
return u =
|
|
837
|
+
return u = G(u = R(u, H(u, {
|
|
838
838
|
left: o.left === void 0 ? void 0 : o.left - g * p,
|
|
839
839
|
top: o.top === void 0 ? void 0 : o.top - v * p,
|
|
840
840
|
bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
|
|
@@ -842,51 +842,51 @@ function We(e) {
|
|
|
842
842
|
})), a({
|
|
843
843
|
visibleArea: u,
|
|
844
844
|
type: "move"
|
|
845
|
-
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d =
|
|
845
|
+
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = G(d, K(M(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = R(u = G(u = z(u, f, c.factor > 1 ? c.center : P(d)), a({
|
|
846
846
|
visibleArea: u,
|
|
847
847
|
type: "move"
|
|
848
|
-
})),
|
|
848
|
+
})), L(H(d, M(u)))))), {
|
|
849
849
|
coordinates: d,
|
|
850
850
|
visibleArea: u
|
|
851
851
|
};
|
|
852
852
|
}
|
|
853
|
-
function
|
|
854
|
-
var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = E({}, r), d = E({}, i), f =
|
|
853
|
+
function qe(e) {
|
|
854
|
+
var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = E({}, r), d = E({}, i), f = U(P(E({
|
|
855
855
|
left: 0,
|
|
856
856
|
top: 0
|
|
857
857
|
}, c)), l);
|
|
858
|
-
return (u = E(E({},
|
|
858
|
+
return (u = E(E({}, q({
|
|
859
859
|
sizeRestrictions: a,
|
|
860
860
|
aspectRatio: t,
|
|
861
861
|
width: u.width,
|
|
862
862
|
height: u.height
|
|
863
|
-
})),
|
|
863
|
+
})), U(P(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = z(d, W(d, n({
|
|
864
864
|
visibleArea: d,
|
|
865
865
|
type: "resize"
|
|
866
866
|
}))), {
|
|
867
|
-
coordinates: u =
|
|
868
|
-
visibleArea: d =
|
|
867
|
+
coordinates: u = G(u, o),
|
|
868
|
+
visibleArea: d = G(d = R(d, N(P(u), P(r))), n({
|
|
869
869
|
visibleArea: d,
|
|
870
870
|
type: "move"
|
|
871
871
|
}))
|
|
872
872
|
};
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function Je(e) {
|
|
875
875
|
var t = e.flip, n = e.previousFlip, r = e.rotate;
|
|
876
876
|
e.aspectRatio;
|
|
877
877
|
var i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c = E({}, a), l = E({}, o), u = n.horizontal !== t.horizontal, d = n.vertical !== t.vertical;
|
|
878
878
|
if (u || d) {
|
|
879
|
-
var f =
|
|
879
|
+
var f = U({
|
|
880
880
|
left: s.width / 2,
|
|
881
881
|
top: s.height / 2
|
|
882
|
-
}, -r), p =
|
|
882
|
+
}, -r), p = U(P(c), -r), m = U({
|
|
883
883
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
884
884
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
885
885
|
}, r);
|
|
886
|
-
c =
|
|
886
|
+
c = R(c, N(m, P(c))), p = U(P(l), -r), l = G(l = R(l, N(m = U({
|
|
887
887
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
888
888
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
889
|
-
}, r),
|
|
889
|
+
}, r), P(l))), i({
|
|
890
890
|
visibleArea: l,
|
|
891
891
|
type: "move"
|
|
892
892
|
}));
|
|
@@ -896,11 +896,11 @@ function Ke(e) {
|
|
|
896
896
|
visibleArea: l
|
|
897
897
|
};
|
|
898
898
|
}
|
|
899
|
-
function
|
|
900
|
-
var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = E({}, t), l =
|
|
899
|
+
function Ye(e) {
|
|
900
|
+
var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = E({}, t), l = I(n, c).width, u = I(n, c).height;
|
|
901
901
|
l < 0 && (c.left < 0 && c.right < 0 ? (c.left = -(n.width - a.minWidth) / (c.left / c.right), c.right = -(n.width - a.minWidth) / (c.right / c.left)) : c.left < 0 ? c.left = -(n.width - a.minWidth) : c.right < 0 && (c.right = -(n.width - a.minWidth))), u < 0 && (c.top < 0 && c.bottom < 0 ? (c.top = -(n.height - a.minHeight) / (c.top / c.bottom), c.bottom = -(n.height - a.minHeight) / (c.bottom / c.top)) : c.top < 0 ? c.top = -(n.height - a.minHeight) : c.bottom < 0 && (c.bottom = -(n.height - a.minHeight)));
|
|
902
|
-
var d = I(
|
|
903
|
-
s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = I(
|
|
902
|
+
var d = F(I(n, c), i);
|
|
903
|
+
s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = F(I(n, c), i));
|
|
904
904
|
var f = {
|
|
905
905
|
width: Infinity,
|
|
906
906
|
height: Infinity,
|
|
@@ -909,37 +909,37 @@ function qe(e) {
|
|
|
909
909
|
top: Infinity,
|
|
910
910
|
bottom: Infinity
|
|
911
911
|
};
|
|
912
|
-
if (
|
|
912
|
+
if (j.forEach((function(e) {
|
|
913
913
|
var t = d[e];
|
|
914
914
|
t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
|
|
915
915
|
})), o) {
|
|
916
|
-
var p = Math.min.apply(null,
|
|
916
|
+
var p = Math.min.apply(null, j.map((function(e) {
|
|
917
917
|
return f[e];
|
|
918
918
|
})));
|
|
919
|
-
p !== Infinity &&
|
|
919
|
+
p !== Infinity && j.forEach((function(e) {
|
|
920
920
|
c[e] *= p;
|
|
921
921
|
}));
|
|
922
|
-
} else
|
|
922
|
+
} else j.forEach((function(e) {
|
|
923
923
|
f[e] !== Infinity && (c[e] *= f[e]);
|
|
924
924
|
}));
|
|
925
|
-
if (l =
|
|
925
|
+
if (l = I(n, c).width, u = I(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
|
|
926
926
|
var m = Math.min(f.width, f.height);
|
|
927
|
-
m !== Infinity &&
|
|
927
|
+
m !== Infinity && j.forEach((function(e) {
|
|
928
928
|
c[e] *= m;
|
|
929
929
|
}));
|
|
930
|
-
} else f.width !== Infinity &&
|
|
930
|
+
} else f.width !== Infinity && Ce.forEach((function(e) {
|
|
931
931
|
c[e] *= f.width;
|
|
932
|
-
})), f.height !== Infinity &&
|
|
932
|
+
})), f.height !== Infinity && we.forEach((function(e) {
|
|
933
933
|
c[e] *= f.height;
|
|
934
934
|
}));
|
|
935
935
|
return c;
|
|
936
936
|
}
|
|
937
|
-
function
|
|
937
|
+
function Y(e, t, n) {
|
|
938
938
|
return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
|
|
939
939
|
}
|
|
940
|
-
var
|
|
940
|
+
var Xe = T("vue-simple-handler"), Ze = T("vue-simple-handler-wrapper"), X = {
|
|
941
941
|
name: "SimpleHandler",
|
|
942
|
-
components: { HandlerWrapper:
|
|
942
|
+
components: { HandlerWrapper: be },
|
|
943
943
|
props: {
|
|
944
944
|
defaultClass: { type: String },
|
|
945
945
|
hoverClass: { type: String },
|
|
@@ -957,8 +957,8 @@ var Je = T("vue-simple-handler"), Ye = T("vue-simple-handler-wrapper"), Z = {
|
|
|
957
957
|
computed: { classes: function() {
|
|
958
958
|
var e, t = (x(e = {}, this.horizontalPosition, !!this.horizontalPosition), x(e, this.verticalPosition, !!this.verticalPosition), x(e, `${this.horizontalPosition}-${this.verticalPosition}`, !!(this.verticalPosition && this.horizontalPosition)), x(e, "hover", this.hover), e);
|
|
959
959
|
return {
|
|
960
|
-
default: w(
|
|
961
|
-
wrapper: w(
|
|
960
|
+
default: w(Xe(t), this.defaultClass, this.hover && this.hoverClass),
|
|
961
|
+
wrapper: w(Ze(t), this.wrapperClass)
|
|
962
962
|
};
|
|
963
963
|
} },
|
|
964
964
|
methods: {
|
|
@@ -977,20 +977,20 @@ var Je = T("vue-simple-handler"), Ye = T("vue-simple-handler-wrapper"), Z = {
|
|
|
977
977
|
},
|
|
978
978
|
emits: ["drag", "drag-end"]
|
|
979
979
|
};
|
|
980
|
-
|
|
981
|
-
var l =
|
|
982
|
-
return
|
|
983
|
-
class:
|
|
980
|
+
X.render = function(e, t, r, a, o, s) {
|
|
981
|
+
var l = f("HandlerWrapper");
|
|
982
|
+
return c(), n(l, {
|
|
983
|
+
class: s.classes.wrapper,
|
|
984
984
|
"vertical-position": r.verticalPosition,
|
|
985
985
|
"horizontal-position": r.horizontalPosition,
|
|
986
986
|
disabled: r.disabled,
|
|
987
|
-
onDrag:
|
|
988
|
-
onDragEnd:
|
|
989
|
-
onEnter:
|
|
990
|
-
onLeave:
|
|
987
|
+
onDrag: s.onDrag,
|
|
988
|
+
onDragEnd: s.onDragEnd,
|
|
989
|
+
onEnter: s.onEnter,
|
|
990
|
+
onLeave: s.onLeave
|
|
991
991
|
}, {
|
|
992
|
-
default:
|
|
993
|
-
return [i("div", { class:
|
|
992
|
+
default: _((function() {
|
|
993
|
+
return [i("div", { class: s.classes.default }, null, 2)];
|
|
994
994
|
})),
|
|
995
995
|
_: 1
|
|
996
996
|
}, 8, [
|
|
@@ -1004,9 +1004,9 @@ Z.render = function(e, t, r, a, o, c) {
|
|
|
1004
1004
|
"onLeave"
|
|
1005
1005
|
]);
|
|
1006
1006
|
};
|
|
1007
|
-
var
|
|
1007
|
+
var Qe = T("vue-simple-line"), $e = T("vue-simple-line-wrapper"), Z = {
|
|
1008
1008
|
name: "SimpleLine",
|
|
1009
|
-
components: { LineWrapper:
|
|
1009
|
+
components: { LineWrapper: Se },
|
|
1010
1010
|
props: {
|
|
1011
1011
|
defaultClass: { type: String },
|
|
1012
1012
|
hoverClass: { type: String },
|
|
@@ -1022,8 +1022,8 @@ var Xe = T("vue-simple-line"), Ze = T("vue-simple-line-wrapper"), Q = {
|
|
|
1022
1022
|
},
|
|
1023
1023
|
computed: { classes: function() {
|
|
1024
1024
|
return {
|
|
1025
|
-
root: w(
|
|
1026
|
-
wrapper: w(
|
|
1025
|
+
root: w(Qe(x({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
|
|
1026
|
+
wrapper: w($e(x({}, this.position, !0)), this.wrapperClass)
|
|
1027
1027
|
};
|
|
1028
1028
|
} },
|
|
1029
1029
|
methods: {
|
|
@@ -1042,19 +1042,19 @@ var Xe = T("vue-simple-line"), Ze = T("vue-simple-line-wrapper"), Q = {
|
|
|
1042
1042
|
},
|
|
1043
1043
|
emits: ["drag", "drag-end"]
|
|
1044
1044
|
};
|
|
1045
|
-
|
|
1046
|
-
var l =
|
|
1047
|
-
return
|
|
1048
|
-
class:
|
|
1045
|
+
Z.render = function(e, t, r, a, o, s) {
|
|
1046
|
+
var l = f("LineWrapper");
|
|
1047
|
+
return c(), n(l, {
|
|
1048
|
+
class: s.classes.wrapper,
|
|
1049
1049
|
position: r.position,
|
|
1050
1050
|
disabled: r.disabled,
|
|
1051
|
-
onDrag:
|
|
1052
|
-
onDragEnd:
|
|
1053
|
-
onEnter:
|
|
1054
|
-
onLeave:
|
|
1051
|
+
onDrag: s.onDrag,
|
|
1052
|
+
onDragEnd: s.onDragEnd,
|
|
1053
|
+
onEnter: s.onEnter,
|
|
1054
|
+
onLeave: s.onLeave
|
|
1055
1055
|
}, {
|
|
1056
|
-
default:
|
|
1057
|
-
return [i("div", { class:
|
|
1056
|
+
default: _((function() {
|
|
1057
|
+
return [i("div", { class: s.classes.root }, null, 2)];
|
|
1058
1058
|
})),
|
|
1059
1059
|
_: 1
|
|
1060
1060
|
}, 8, [
|
|
@@ -1067,15 +1067,15 @@ Q.render = function(e, t, r, a, o, c) {
|
|
|
1067
1067
|
"onLeave"
|
|
1068
1068
|
]);
|
|
1069
1069
|
};
|
|
1070
|
-
var
|
|
1070
|
+
var et = T("vue-bounding-box"), tt = [
|
|
1071
1071
|
"east",
|
|
1072
1072
|
"west",
|
|
1073
1073
|
null
|
|
1074
|
-
],
|
|
1074
|
+
], nt = [
|
|
1075
1075
|
"south",
|
|
1076
1076
|
"north",
|
|
1077
1077
|
null
|
|
1078
|
-
],
|
|
1078
|
+
], rt = {
|
|
1079
1079
|
name: "BoundingBox",
|
|
1080
1080
|
props: {
|
|
1081
1081
|
width: { type: Number },
|
|
@@ -1099,7 +1099,7 @@ var Qe = T("vue-bounding-box"), $e = [
|
|
|
1099
1099
|
handlersComponent: {
|
|
1100
1100
|
type: [Object, String],
|
|
1101
1101
|
default: function() {
|
|
1102
|
-
return
|
|
1102
|
+
return X;
|
|
1103
1103
|
}
|
|
1104
1104
|
},
|
|
1105
1105
|
handlersClasses: {
|
|
@@ -1128,7 +1128,7 @@ var Qe = T("vue-bounding-box"), $e = [
|
|
|
1128
1128
|
linesComponent: {
|
|
1129
1129
|
type: [Object, String],
|
|
1130
1130
|
default: function() {
|
|
1131
|
-
return
|
|
1131
|
+
return Z;
|
|
1132
1132
|
}
|
|
1133
1133
|
},
|
|
1134
1134
|
linesClasses: {
|
|
@@ -1150,10 +1150,10 @@ var Qe = T("vue-bounding-box"), $e = [
|
|
|
1150
1150
|
},
|
|
1151
1151
|
data: function() {
|
|
1152
1152
|
var e = [];
|
|
1153
|
-
return
|
|
1154
|
-
|
|
1153
|
+
return tt.forEach((function(t) {
|
|
1154
|
+
nt.forEach((function(n) {
|
|
1155
1155
|
if (t !== n) {
|
|
1156
|
-
var r =
|
|
1156
|
+
var r = se(t, n), i = r.name, a = r.classname;
|
|
1157
1157
|
e.push({
|
|
1158
1158
|
name: i,
|
|
1159
1159
|
classname: a,
|
|
@@ -1172,7 +1172,7 @@ var Qe = T("vue-bounding-box"), $e = [
|
|
|
1172
1172
|
classes: function() {
|
|
1173
1173
|
var e = this.handlersClasses, t = this.handlersWrappersClasses, n = this.linesClasses, r = this.linesWrappersClasses;
|
|
1174
1174
|
return {
|
|
1175
|
-
root:
|
|
1175
|
+
root: et(),
|
|
1176
1176
|
handlers: e,
|
|
1177
1177
|
handlersWrappers: t,
|
|
1178
1178
|
lines: n,
|
|
@@ -1210,8 +1210,8 @@ var Qe = T("vue-bounding-box"), $e = [
|
|
|
1210
1210
|
};
|
|
1211
1211
|
if (n && r) {
|
|
1212
1212
|
var o = i.horizontalDirection, s = i.verticalDirection, c = o === "east" ? n : o === "west" ? 0 : n / 2, l = s === "south" ? r : s === "north" ? 0 : r / 2;
|
|
1213
|
-
a.wrapperClass =
|
|
1214
|
-
} else a.wrapperClass =
|
|
1213
|
+
a.wrapperClass = et("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
|
|
1214
|
+
} else a.wrapperClass = et("handler", x({}, i.classname, !0));
|
|
1215
1215
|
t.push(a);
|
|
1216
1216
|
}
|
|
1217
1217
|
})), t;
|
|
@@ -1237,7 +1237,7 @@ var Qe = T("vue-bounding-box"), $e = [
|
|
|
1237
1237
|
top: 0,
|
|
1238
1238
|
bottom: 0
|
|
1239
1239
|
};
|
|
1240
|
-
t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new
|
|
1240
|
+
t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new he(s, {
|
|
1241
1241
|
allowedDirections: {
|
|
1242
1242
|
left: t === "west" || !t,
|
|
1243
1243
|
right: t === "east" || !t,
|
|
@@ -1251,15 +1251,15 @@ var Qe = T("vue-bounding-box"), $e = [
|
|
|
1251
1251
|
},
|
|
1252
1252
|
emits: ["resize", "resize-end"]
|
|
1253
1253
|
};
|
|
1254
|
-
|
|
1255
|
-
return
|
|
1254
|
+
rt.render = function(t, r, a, o, s, l) {
|
|
1255
|
+
return c(), n("div", {
|
|
1256
1256
|
ref: "box",
|
|
1257
|
-
class:
|
|
1258
|
-
style:
|
|
1257
|
+
class: l.classes.root,
|
|
1258
|
+
style: l.style
|
|
1259
1259
|
}, [
|
|
1260
|
-
|
|
1261
|
-
i("div", null, [(
|
|
1262
|
-
return
|
|
1260
|
+
d(t.$slots, "default"),
|
|
1261
|
+
i("div", null, [(c(!0), n(e, null, u(l.lineNodes, (function(e) {
|
|
1262
|
+
return c(), n(p(e.component), {
|
|
1263
1263
|
key: e.name,
|
|
1264
1264
|
"default-class": e.class,
|
|
1265
1265
|
"hover-class": e.hoverClass,
|
|
@@ -1267,10 +1267,10 @@ tt.render = function(t, r, a, o, c, d) {
|
|
|
1267
1267
|
position: e.name,
|
|
1268
1268
|
disabled: e.disabled,
|
|
1269
1269
|
onDrag: function(t) {
|
|
1270
|
-
return
|
|
1270
|
+
return l.onHandlerDrag(t, e.horizontalDirection, e.verticalDirection);
|
|
1271
1271
|
},
|
|
1272
1272
|
onDragEnd: r[1] ||= function(e) {
|
|
1273
|
-
return
|
|
1273
|
+
return l.onEnd();
|
|
1274
1274
|
}
|
|
1275
1275
|
}, null, 8, [
|
|
1276
1276
|
"default-class",
|
|
@@ -1281,12 +1281,12 @@ tt.render = function(t, r, a, o, c, d) {
|
|
|
1281
1281
|
"onDrag"
|
|
1282
1282
|
]);
|
|
1283
1283
|
})), 128))]),
|
|
1284
|
-
(
|
|
1285
|
-
return
|
|
1284
|
+
(c(!0), n(e, null, u(l.handlerNodes, (function(e) {
|
|
1285
|
+
return c(), n("div", {
|
|
1286
1286
|
key: e.name,
|
|
1287
1287
|
style: e.wrapperStyle,
|
|
1288
1288
|
class: e.wrapperClass
|
|
1289
|
-
}, [(
|
|
1289
|
+
}, [(c(), n(p(e.component), {
|
|
1290
1290
|
"default-class": e.class,
|
|
1291
1291
|
"hover-class": e.hoverClass,
|
|
1292
1292
|
"wrapper-class": e.wrapperClass,
|
|
@@ -1294,10 +1294,10 @@ tt.render = function(t, r, a, o, c, d) {
|
|
|
1294
1294
|
"vertical-position": e.verticalDirection,
|
|
1295
1295
|
disabled: e.disabled,
|
|
1296
1296
|
onDrag: function(t) {
|
|
1297
|
-
return
|
|
1297
|
+
return l.onHandlerDrag(t, e.horizontalDirection, e.verticalDirection);
|
|
1298
1298
|
},
|
|
1299
1299
|
onDragEnd: r[2] ||= function(e) {
|
|
1300
|
-
return
|
|
1300
|
+
return l.onEnd();
|
|
1301
1301
|
}
|
|
1302
1302
|
}, null, 8, [
|
|
1303
1303
|
"default-class",
|
|
@@ -1311,7 +1311,7 @@ tt.render = function(t, r, a, o, c, d) {
|
|
|
1311
1311
|
})), 128))
|
|
1312
1312
|
], 6);
|
|
1313
1313
|
};
|
|
1314
|
-
var
|
|
1314
|
+
var it = T("vue-draggable-area"), at = {
|
|
1315
1315
|
name: "DraggableArea",
|
|
1316
1316
|
props: {
|
|
1317
1317
|
movable: {
|
|
@@ -1324,7 +1324,7 @@ var nt = T("vue-draggable-area"), rt = {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
},
|
|
1326
1326
|
computed: { classnames: function() {
|
|
1327
|
-
return { default:
|
|
1327
|
+
return { default: it() };
|
|
1328
1328
|
} },
|
|
1329
1329
|
beforeMount: function() {
|
|
1330
1330
|
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
@@ -1346,7 +1346,7 @@ var nt = T("vue-draggable-area"), rt = {
|
|
|
1346
1346
|
this.touchStarted = !1, this.processEnd();
|
|
1347
1347
|
},
|
|
1348
1348
|
onTouchMove: function(e) {
|
|
1349
|
-
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) :
|
|
1349
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : me({
|
|
1350
1350
|
x: this.touches[0].clientX,
|
|
1351
1351
|
y: this.touches[0].clientY
|
|
1352
1352
|
}, {
|
|
@@ -1388,7 +1388,7 @@ var nt = T("vue-draggable-area"), rt = {
|
|
|
1388
1388
|
var n = S(t);
|
|
1389
1389
|
if (this.touches.length) {
|
|
1390
1390
|
var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
|
|
1391
|
-
this.touches.length === 1 && n.length === 1 && this.$emit("move", new
|
|
1391
|
+
this.touches.length === 1 && n.length === 1 && this.$emit("move", new ge({
|
|
1392
1392
|
left: n[0].clientX - (i + this.anchor.x),
|
|
1393
1393
|
top: n[0].clientY - (a + this.anchor.y)
|
|
1394
1394
|
}));
|
|
@@ -1400,8 +1400,8 @@ var nt = T("vue-draggable-area"), rt = {
|
|
|
1400
1400
|
},
|
|
1401
1401
|
emits: ["move", "move-end"]
|
|
1402
1402
|
};
|
|
1403
|
-
|
|
1404
|
-
return
|
|
1403
|
+
at.render = function(e, t, r, i, a, o) {
|
|
1404
|
+
return c(), n("div", {
|
|
1405
1405
|
ref: "container",
|
|
1406
1406
|
onTouchstart: t[1] ||= function() {
|
|
1407
1407
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
@@ -1409,9 +1409,9 @@ rt.render = function(e, t, r, i, a, o) {
|
|
|
1409
1409
|
onMousedown: t[2] ||= function() {
|
|
1410
1410
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
1411
1411
|
}
|
|
1412
|
-
}, [
|
|
1412
|
+
}, [d(e.$slots, "default")], 544);
|
|
1413
1413
|
};
|
|
1414
|
-
function
|
|
1414
|
+
function ot(e) {
|
|
1415
1415
|
return {
|
|
1416
1416
|
rotate: e.rotate || 0,
|
|
1417
1417
|
flip: {
|
|
@@ -1420,7 +1420,7 @@ function it(e) {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
};
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1423
|
+
function st(e) {
|
|
1424
1424
|
return new Promise((function(t, n) {
|
|
1425
1425
|
try {
|
|
1426
1426
|
if (e) if (/^data:/i.test(e)) t(function(e) {
|
|
@@ -1452,11 +1452,11 @@ function at(e) {
|
|
|
1452
1452
|
var a, o, s;
|
|
1453
1453
|
}));
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1455
|
+
function ct(e) {
|
|
1456
1456
|
var t = e.rotate, n = e.flip, r = e.scaleX, i = e.scaleY, a = "";
|
|
1457
1457
|
return a += " rotate(" + t + "deg) ", a += " scaleX(" + r * (n.horizontal ? -1 : 1) + ") ", a += " scaleY(" + i * (n.vertical ? -1 : 1) + ") ";
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function lt(e) {
|
|
1460
1460
|
try {
|
|
1461
1461
|
var t, n = new DataView(e), r = void 0, i = void 0, a = void 0, o = void 0;
|
|
1462
1462
|
if (n.getUint8(0) === 255 && n.getUint8(1) === 216) for (var s = n.byteLength, c = 2; c + 1 < s;) {
|
|
@@ -1488,7 +1488,7 @@ function st(e) {
|
|
|
1488
1488
|
return null;
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
|
-
var
|
|
1491
|
+
var Q = T("vue-preview-result"), ut = {
|
|
1492
1492
|
name: "PreviewResult",
|
|
1493
1493
|
props: {
|
|
1494
1494
|
image: { type: Object },
|
|
@@ -1509,10 +1509,10 @@ var ct = T("vue-preview-result"), lt = {
|
|
|
1509
1509
|
computed: {
|
|
1510
1510
|
classes: function() {
|
|
1511
1511
|
return {
|
|
1512
|
-
root:
|
|
1513
|
-
wrapper:
|
|
1514
|
-
imageWrapper:
|
|
1515
|
-
image: w(
|
|
1512
|
+
root: Q(),
|
|
1513
|
+
wrapper: Q("wrapper"),
|
|
1514
|
+
imageWrapper: Q("image-wrapper"),
|
|
1515
|
+
image: w(Q("image"), this.imageClass)
|
|
1516
1516
|
};
|
|
1517
1517
|
},
|
|
1518
1518
|
wrapperStyle: function() {
|
|
@@ -1525,7 +1525,7 @@ var ct = T("vue-preview-result"), lt = {
|
|
|
1525
1525
|
return this.transitions && this.transitions.enabled && (e.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), e;
|
|
1526
1526
|
},
|
|
1527
1527
|
imageStyle: function() {
|
|
1528
|
-
var e = this.image.transforms, t =
|
|
1528
|
+
var e = this.image.transforms, t = je({
|
|
1529
1529
|
width: this.image.width,
|
|
1530
1530
|
height: this.image.height
|
|
1531
1531
|
}, e.rotate), n = {
|
|
@@ -1541,11 +1541,11 @@ var ct = T("vue-preview-result"), lt = {
|
|
|
1541
1541
|
top: (1 - e.scaleY) * this.image.height / 2
|
|
1542
1542
|
};
|
|
1543
1543
|
return n.transform = `translate(
|
|
1544
|
-
${-this.stencilCoordinates.left - e.translateX - r.left - i.left}px,${-this.stencilCoordinates.top - e.translateY - r.top - i.top}px) ` +
|
|
1544
|
+
${-this.stencilCoordinates.left - e.translateX - r.left - i.left}px,${-this.stencilCoordinates.top - e.translateY - r.top - i.top}px) ` + ct(e), this.transitions && this.transitions.enabled && (n.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), n;
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
};
|
|
1548
|
-
function
|
|
1548
|
+
function dt(e, t) {
|
|
1549
1549
|
var n = t.getBoundingClientRect(), r = n.left, i = n.top, a = {
|
|
1550
1550
|
left: 0,
|
|
1551
1551
|
top: 0
|
|
@@ -1553,7 +1553,7 @@ function ut(e, t) {
|
|
|
1553
1553
|
return e.forEach((function(t) {
|
|
1554
1554
|
a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
|
|
1555
1555
|
})), e.forEach((function(e) {
|
|
1556
|
-
o +=
|
|
1556
|
+
o += me({
|
|
1557
1557
|
x: a.left,
|
|
1558
1558
|
y: a.top
|
|
1559
1559
|
}, {
|
|
@@ -1566,19 +1566,19 @@ function ut(e, t) {
|
|
|
1566
1566
|
count: e.length
|
|
1567
1567
|
};
|
|
1568
1568
|
}
|
|
1569
|
-
|
|
1570
|
-
return
|
|
1569
|
+
ut.render = function(e, t, r, a, o, s) {
|
|
1570
|
+
return c(), n("div", { class: s.classes.root }, [i("div", {
|
|
1571
1571
|
ref: "wrapper",
|
|
1572
|
-
class:
|
|
1573
|
-
style:
|
|
1572
|
+
class: s.classes.wrapper,
|
|
1573
|
+
style: s.wrapperStyle
|
|
1574
1574
|
}, [i("img", {
|
|
1575
1575
|
ref: "image",
|
|
1576
1576
|
src: r.image.src,
|
|
1577
|
-
class:
|
|
1578
|
-
style:
|
|
1577
|
+
class: s.classes.image,
|
|
1578
|
+
style: s.imageStyle
|
|
1579
1579
|
}, null, 14, ["src"])], 6)], 2);
|
|
1580
1580
|
};
|
|
1581
|
-
var
|
|
1581
|
+
var ft = {
|
|
1582
1582
|
props: {
|
|
1583
1583
|
touchMove: {
|
|
1584
1584
|
type: Boolean,
|
|
@@ -1608,18 +1608,18 @@ var dt = {
|
|
|
1608
1608
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
1609
1609
|
},
|
|
1610
1610
|
created: function() {
|
|
1611
|
-
this.transforming = !1, this.debouncedProcessEnd =
|
|
1611
|
+
this.transforming = !1, this.debouncedProcessEnd = oe(this.processEnd), this.touches = [];
|
|
1612
1612
|
},
|
|
1613
1613
|
methods: {
|
|
1614
1614
|
processMove: function(e, t) {
|
|
1615
1615
|
if (this.touches.length) {
|
|
1616
|
-
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new
|
|
1616
|
+
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new A({
|
|
1617
1617
|
left: this.touches[0].clientX - t[0].clientX,
|
|
1618
1618
|
top: this.touches[0].clientY - t[0].clientY
|
|
1619
1619
|
}));
|
|
1620
1620
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
1621
|
-
var n =
|
|
1622
|
-
r.count === n.count && r.count > 1 && this.$emit("resize", new
|
|
1621
|
+
var n = dt(t, this.$refs.container), r = this.oldGeometricProperties;
|
|
1622
|
+
r.count === n.count && r.count > 1 && this.$emit("resize", new A({
|
|
1623
1623
|
left: r.centerMass.left - n.centerMass.left,
|
|
1624
1624
|
top: r.centerMass.top - n.centerMass.top
|
|
1625
1625
|
}, {
|
|
@@ -1644,7 +1644,7 @@ var dt = {
|
|
|
1644
1644
|
var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
|
|
1645
1645
|
this.touches = S(e.touches).filter((function(e) {
|
|
1646
1646
|
return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
|
|
1647
|
-
})), this.oldGeometricProperties =
|
|
1647
|
+
})), this.oldGeometricProperties = dt(this.touches, t);
|
|
1648
1648
|
}
|
|
1649
1649
|
},
|
|
1650
1650
|
onTouchEnd: function(e) {
|
|
@@ -1682,11 +1682,11 @@ var dt = {
|
|
|
1682
1682
|
},
|
|
1683
1683
|
onWheel: function(e) {
|
|
1684
1684
|
if (this.wheelResize && this.processEvent(e)) {
|
|
1685
|
-
var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 ||
|
|
1685
|
+
var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || pe(s) ? s : s > 0 ? 1 : -1), a = {
|
|
1686
1686
|
left: e.clientX - n,
|
|
1687
1687
|
top: e.clientY - r
|
|
1688
1688
|
};
|
|
1689
|
-
this.$emit("resize", new
|
|
1689
|
+
this.$emit("resize", new A({}, {
|
|
1690
1690
|
factor: i,
|
|
1691
1691
|
center: a
|
|
1692
1692
|
})), this.touches.length || this.debouncedProcessEnd();
|
|
@@ -1700,8 +1700,8 @@ var dt = {
|
|
|
1700
1700
|
"transform-end"
|
|
1701
1701
|
]
|
|
1702
1702
|
};
|
|
1703
|
-
|
|
1704
|
-
return
|
|
1703
|
+
ft.render = function(e, t, r, i, a, o) {
|
|
1704
|
+
return c(), n("div", {
|
|
1705
1705
|
ref: "container",
|
|
1706
1706
|
onTouchstart: t[1] ||= function() {
|
|
1707
1707
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
@@ -1712,10 +1712,10 @@ dt.render = function(e, t, r, i, a, o) {
|
|
|
1712
1712
|
onWheel: t[3] ||= function() {
|
|
1713
1713
|
return o.onWheel && o.onWheel.apply(o, arguments);
|
|
1714
1714
|
}
|
|
1715
|
-
}, [
|
|
1715
|
+
}, [d(e.$slots, "default")], 544);
|
|
1716
1716
|
};
|
|
1717
|
-
var
|
|
1718
|
-
components: { TransformableImage:
|
|
1717
|
+
var pt = {
|
|
1718
|
+
components: { TransformableImage: ft },
|
|
1719
1719
|
props: {
|
|
1720
1720
|
touchMove: {
|
|
1721
1721
|
type: Boolean,
|
|
@@ -1736,9 +1736,9 @@ var ft = {
|
|
|
1736
1736
|
},
|
|
1737
1737
|
emits: ["resize", "move"]
|
|
1738
1738
|
};
|
|
1739
|
-
|
|
1740
|
-
var
|
|
1741
|
-
return
|
|
1739
|
+
pt.render = function(e, t, r, i, a, o) {
|
|
1740
|
+
var s = f("transformable-image");
|
|
1741
|
+
return c(), n(s, {
|
|
1742
1742
|
"touch-move": r.touchMove,
|
|
1743
1743
|
"touch-resize": r.touchResize,
|
|
1744
1744
|
"mouse-move": r.mouseMove,
|
|
@@ -1750,8 +1750,8 @@ ft.render = function(e, t, r, i, a, o) {
|
|
|
1750
1750
|
return e.$emit("resize", t);
|
|
1751
1751
|
}
|
|
1752
1752
|
}, {
|
|
1753
|
-
default:
|
|
1754
|
-
return [
|
|
1753
|
+
default: _((function() {
|
|
1754
|
+
return [d(e.$slots, "default")];
|
|
1755
1755
|
})),
|
|
1756
1756
|
_: 3
|
|
1757
1757
|
}, 8, [
|
|
@@ -1761,7 +1761,7 @@ ft.render = function(e, t, r, i, a, o) {
|
|
|
1761
1761
|
"wheel-resize"
|
|
1762
1762
|
]);
|
|
1763
1763
|
};
|
|
1764
|
-
var
|
|
1764
|
+
var mt = T("vue-preview"), ht = {
|
|
1765
1765
|
props: {
|
|
1766
1766
|
coordinates: { type: Object },
|
|
1767
1767
|
transitions: { type: Object },
|
|
@@ -1791,10 +1791,10 @@ var pt = T("vue-preview"), mt = {
|
|
|
1791
1791
|
computed: {
|
|
1792
1792
|
classes: function() {
|
|
1793
1793
|
return {
|
|
1794
|
-
root:
|
|
1795
|
-
wrapper:
|
|
1796
|
-
imageWrapper:
|
|
1797
|
-
image: w(
|
|
1794
|
+
root: mt({ fill: this.fill }),
|
|
1795
|
+
wrapper: mt("wrapper"),
|
|
1796
|
+
imageWrapper: mt("image-wrapper"),
|
|
1797
|
+
image: w(mt("image"), this.imageClass)
|
|
1798
1798
|
};
|
|
1799
1799
|
},
|
|
1800
1800
|
style: function() {
|
|
@@ -1822,7 +1822,7 @@ var pt = T("vue-preview"), mt = {
|
|
|
1822
1822
|
}, this.image.transforms), {}, {
|
|
1823
1823
|
scaleX: 1 / e,
|
|
1824
1824
|
scaleY: 1 / e
|
|
1825
|
-
}), n = this.imageSize.width, r = this.imageSize.height, i =
|
|
1825
|
+
}), n = this.imageSize.width, r = this.imageSize.height, i = je({
|
|
1826
1826
|
width: n,
|
|
1827
1827
|
height: r
|
|
1828
1828
|
}, t.rotate), a = {
|
|
@@ -1841,7 +1841,7 @@ var pt = T("vue-preview"), mt = {
|
|
|
1841
1841
|
}
|
|
1842
1842
|
};
|
|
1843
1843
|
return a.transform = `translate(
|
|
1844
|
-
${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` +
|
|
1844
|
+
${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + ct(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
|
|
1845
1845
|
}
|
|
1846
1846
|
return {};
|
|
1847
1847
|
},
|
|
@@ -1885,36 +1885,36 @@ var pt = T("vue-preview"), mt = {
|
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
};
|
|
1888
|
-
|
|
1889
|
-
return
|
|
1888
|
+
ht.render = function(e, t, r, a, o, s) {
|
|
1889
|
+
return c(), n("div", {
|
|
1890
1890
|
ref: "root",
|
|
1891
|
-
class:
|
|
1892
|
-
style:
|
|
1891
|
+
class: s.classes.root,
|
|
1892
|
+
style: s.style
|
|
1893
1893
|
}, [i("div", {
|
|
1894
1894
|
ref: "wrapper",
|
|
1895
|
-
class:
|
|
1896
|
-
style:
|
|
1897
|
-
}, [
|
|
1895
|
+
class: s.classes.wrapper,
|
|
1896
|
+
style: s.wrapperStyle
|
|
1897
|
+
}, [v(i("img", {
|
|
1898
1898
|
ref: "image",
|
|
1899
1899
|
src: r.image && r.image.src,
|
|
1900
|
-
class:
|
|
1901
|
-
style:
|
|
1902
|
-
}, null, 14, ["src"]), [[
|
|
1900
|
+
class: s.classes.image,
|
|
1901
|
+
style: s.imageStyle
|
|
1902
|
+
}, null, 14, ["src"]), [[h, r.image && r.image.src]])], 6)], 6);
|
|
1903
1903
|
};
|
|
1904
|
-
var
|
|
1905
|
-
components: { Preview:
|
|
1904
|
+
var gt = {
|
|
1905
|
+
components: { Preview: ht },
|
|
1906
1906
|
inheritAttrs: !1
|
|
1907
1907
|
};
|
|
1908
|
-
|
|
1909
|
-
var l =
|
|
1910
|
-
return
|
|
1908
|
+
gt.render = function(e, t, r, i, a, s) {
|
|
1909
|
+
var l = f("preview");
|
|
1910
|
+
return c(), n(l, o(e.$attrs, { fill: !0 }), null, 16);
|
|
1911
1911
|
};
|
|
1912
|
-
var
|
|
1912
|
+
var _t = T("vue-rectangle-stencil"), vt = {
|
|
1913
1913
|
name: "RectangleStencil",
|
|
1914
1914
|
components: {
|
|
1915
|
-
StencilPreview:
|
|
1916
|
-
BoundingBox:
|
|
1917
|
-
DraggableArea:
|
|
1915
|
+
StencilPreview: gt,
|
|
1916
|
+
BoundingBox: rt,
|
|
1917
|
+
DraggableArea: at
|
|
1918
1918
|
},
|
|
1919
1919
|
props: {
|
|
1920
1920
|
image: { type: Object },
|
|
@@ -1924,14 +1924,14 @@ var gt = T("vue-rectangle-stencil"), _t = {
|
|
|
1924
1924
|
handlersComponent: {
|
|
1925
1925
|
type: [Object, String],
|
|
1926
1926
|
default: function() {
|
|
1927
|
-
return
|
|
1927
|
+
return X;
|
|
1928
1928
|
}
|
|
1929
1929
|
},
|
|
1930
1930
|
lines: { type: Object },
|
|
1931
1931
|
linesComponent: {
|
|
1932
1932
|
type: [Object, String],
|
|
1933
1933
|
default: function() {
|
|
1934
|
-
return
|
|
1934
|
+
return Z;
|
|
1935
1935
|
}
|
|
1936
1936
|
},
|
|
1937
1937
|
aspectRatio: { type: [Number, String] },
|
|
@@ -1984,13 +1984,13 @@ var gt = T("vue-rectangle-stencil"), _t = {
|
|
|
1984
1984
|
computed: {
|
|
1985
1985
|
classes: function() {
|
|
1986
1986
|
return {
|
|
1987
|
-
stencil: w(
|
|
1987
|
+
stencil: w(_t({
|
|
1988
1988
|
movable: this.movable,
|
|
1989
1989
|
moving: this.moving,
|
|
1990
1990
|
resizing: this.resizing
|
|
1991
1991
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
1992
|
-
preview: w(
|
|
1993
|
-
boundingBox: w(
|
|
1992
|
+
preview: w(_t("preview"), this.previewClass),
|
|
1993
|
+
boundingBox: w(_t("bounding-box"), this.boundingBoxClass)
|
|
1994
1994
|
};
|
|
1995
1995
|
},
|
|
1996
1996
|
style: function() {
|
|
@@ -2029,16 +2029,16 @@ var gt = T("vue-rectangle-stencil"), _t = {
|
|
|
2029
2029
|
"move-end"
|
|
2030
2030
|
]
|
|
2031
2031
|
};
|
|
2032
|
-
|
|
2033
|
-
var l =
|
|
2034
|
-
return
|
|
2035
|
-
class:
|
|
2036
|
-
style:
|
|
2037
|
-
}, [i(
|
|
2032
|
+
vt.render = function(e, t, r, a, o, s) {
|
|
2033
|
+
var l = f("stencil-preview"), u = f("draggable-area"), d = f("bounding-box");
|
|
2034
|
+
return c(), n("div", {
|
|
2035
|
+
class: s.classes.stencil,
|
|
2036
|
+
style: s.style
|
|
2037
|
+
}, [i(d, {
|
|
2038
2038
|
width: r.stencilCoordinates.width,
|
|
2039
2039
|
height: r.stencilCoordinates.height,
|
|
2040
2040
|
transitions: r.transitions,
|
|
2041
|
-
class:
|
|
2041
|
+
class: s.classes.boundingBox,
|
|
2042
2042
|
handlers: r.handlers,
|
|
2043
2043
|
"handlers-component": r.handlersComponent,
|
|
2044
2044
|
"handlers-classes": r.handlersClasses,
|
|
@@ -2048,22 +2048,22 @@ _t.render = function(e, t, r, a, o, c) {
|
|
|
2048
2048
|
"lines-classes": r.linesClasses,
|
|
2049
2049
|
"lines-wrappers-classes": r.linesWrappersClasses,
|
|
2050
2050
|
resizable: r.resizable,
|
|
2051
|
-
onResize:
|
|
2052
|
-
onResizeEnd:
|
|
2051
|
+
onResize: s.onResize,
|
|
2052
|
+
onResizeEnd: s.onResizeEnd
|
|
2053
2053
|
}, {
|
|
2054
|
-
default:
|
|
2054
|
+
default: _((function() {
|
|
2055
2055
|
return [i(u, {
|
|
2056
2056
|
movable: r.movable,
|
|
2057
|
-
onMove:
|
|
2058
|
-
onMoveEnd:
|
|
2057
|
+
onMove: s.onMove,
|
|
2058
|
+
onMoveEnd: s.onMoveEnd
|
|
2059
2059
|
}, {
|
|
2060
|
-
default:
|
|
2060
|
+
default: _((function() {
|
|
2061
2061
|
return [i(l, {
|
|
2062
2062
|
image: r.image,
|
|
2063
2063
|
coordinates: r.coordinates,
|
|
2064
2064
|
width: r.stencilCoordinates.width,
|
|
2065
2065
|
height: r.stencilCoordinates.height,
|
|
2066
|
-
class:
|
|
2066
|
+
class: s.classes.preview,
|
|
2067
2067
|
transitions: r.transitions
|
|
2068
2068
|
}, null, 8, [
|
|
2069
2069
|
"image",
|
|
@@ -2100,11 +2100,11 @@ _t.render = function(e, t, r, a, o, c) {
|
|
|
2100
2100
|
"onResizeEnd"
|
|
2101
2101
|
])], 6);
|
|
2102
2102
|
};
|
|
2103
|
-
var
|
|
2103
|
+
var yt = T("vue-circle-stencil"), bt = {
|
|
2104
2104
|
components: {
|
|
2105
|
-
StencilPreview:
|
|
2106
|
-
BoundingBox:
|
|
2107
|
-
DraggableArea:
|
|
2105
|
+
StencilPreview: gt,
|
|
2106
|
+
BoundingBox: rt,
|
|
2107
|
+
DraggableArea: at
|
|
2108
2108
|
},
|
|
2109
2109
|
props: {
|
|
2110
2110
|
image: { type: Object },
|
|
@@ -2124,7 +2124,7 @@ var vt = T("vue-circle-stencil"), yt = {
|
|
|
2124
2124
|
handlersComponent: {
|
|
2125
2125
|
type: [Object, String],
|
|
2126
2126
|
default: function() {
|
|
2127
|
-
return
|
|
2127
|
+
return X;
|
|
2128
2128
|
}
|
|
2129
2129
|
},
|
|
2130
2130
|
handlersClasses: {
|
|
@@ -2143,7 +2143,7 @@ var vt = T("vue-circle-stencil"), yt = {
|
|
|
2143
2143
|
linesComponent: {
|
|
2144
2144
|
type: [Object, String],
|
|
2145
2145
|
default: function() {
|
|
2146
|
-
return
|
|
2146
|
+
return Z;
|
|
2147
2147
|
}
|
|
2148
2148
|
},
|
|
2149
2149
|
linesClasses: {
|
|
@@ -2181,13 +2181,13 @@ var vt = T("vue-circle-stencil"), yt = {
|
|
|
2181
2181
|
computed: {
|
|
2182
2182
|
classes: function() {
|
|
2183
2183
|
return {
|
|
2184
|
-
stencil: w(
|
|
2184
|
+
stencil: w(yt({
|
|
2185
2185
|
movable: this.movable,
|
|
2186
2186
|
moving: this.moving,
|
|
2187
2187
|
resizing: this.resizing
|
|
2188
2188
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2189
|
-
preview: w(
|
|
2190
|
-
boundingBox: w(
|
|
2189
|
+
preview: w(yt("preview"), this.previewClass),
|
|
2190
|
+
boundingBox: w(yt("bounding-box"), this.boundingBoxClass)
|
|
2191
2191
|
};
|
|
2192
2192
|
},
|
|
2193
2193
|
style: function() {
|
|
@@ -2226,16 +2226,16 @@ var vt = T("vue-circle-stencil"), yt = {
|
|
|
2226
2226
|
"move-end"
|
|
2227
2227
|
]
|
|
2228
2228
|
};
|
|
2229
|
-
|
|
2230
|
-
var l =
|
|
2231
|
-
return
|
|
2232
|
-
class:
|
|
2233
|
-
style:
|
|
2234
|
-
}, [i(
|
|
2229
|
+
bt.render = function(e, t, r, a, o, s) {
|
|
2230
|
+
var l = f("stencil-preview"), u = f("draggable-area"), d = f("bounding-box");
|
|
2231
|
+
return c(), n("div", {
|
|
2232
|
+
class: s.classes.stencil,
|
|
2233
|
+
style: s.style
|
|
2234
|
+
}, [i(d, {
|
|
2235
2235
|
width: r.stencilCoordinates.width,
|
|
2236
2236
|
height: r.stencilCoordinates.height,
|
|
2237
2237
|
transitions: r.transitions,
|
|
2238
|
-
class:
|
|
2238
|
+
class: s.classes.boundingBox,
|
|
2239
2239
|
handlers: r.handlers,
|
|
2240
2240
|
"handlers-component": r.handlersComponent,
|
|
2241
2241
|
"handlers-classes": r.handlersClasses,
|
|
@@ -2245,22 +2245,22 @@ yt.render = function(e, t, r, a, o, c) {
|
|
|
2245
2245
|
"lines-classes": r.linesClasses,
|
|
2246
2246
|
"lines-wrappers-classes": r.linesWrappersClasses,
|
|
2247
2247
|
resizable: r.resizable,
|
|
2248
|
-
onResize:
|
|
2249
|
-
onResizeEnd:
|
|
2248
|
+
onResize: s.onResize,
|
|
2249
|
+
onResizeEnd: s.onResizeEnd
|
|
2250
2250
|
}, {
|
|
2251
|
-
default:
|
|
2251
|
+
default: _((function() {
|
|
2252
2252
|
return [i(u, {
|
|
2253
2253
|
movable: r.movable,
|
|
2254
|
-
onMove:
|
|
2255
|
-
onMoveEnd:
|
|
2254
|
+
onMove: s.onMove,
|
|
2255
|
+
onMoveEnd: s.onMoveEnd
|
|
2256
2256
|
}, {
|
|
2257
|
-
default:
|
|
2257
|
+
default: _((function() {
|
|
2258
2258
|
return [i(l, {
|
|
2259
2259
|
image: r.image,
|
|
2260
2260
|
coordinates: r.coordinates,
|
|
2261
2261
|
width: r.stencilCoordinates.width,
|
|
2262
2262
|
height: r.stencilCoordinates.height,
|
|
2263
|
-
class:
|
|
2263
|
+
class: s.classes.preview,
|
|
2264
2264
|
transitions: r.transitions
|
|
2265
2265
|
}, null, 8, [
|
|
2266
2266
|
"image",
|
|
@@ -2297,9 +2297,9 @@ yt.render = function(e, t, r, a, o, c) {
|
|
|
2297
2297
|
"onResizeEnd"
|
|
2298
2298
|
])], 6);
|
|
2299
2299
|
};
|
|
2300
|
-
var
|
|
2300
|
+
var xt = ["transitions"], $ = T("vue-advanced-cropper"), St = {
|
|
2301
2301
|
name: "Cropper",
|
|
2302
|
-
components: { BackgroundWrapper:
|
|
2302
|
+
components: { BackgroundWrapper: pt },
|
|
2303
2303
|
props: {
|
|
2304
2304
|
src: {
|
|
2305
2305
|
type: String,
|
|
@@ -2308,13 +2308,13 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2308
2308
|
stencilComponent: {
|
|
2309
2309
|
type: [Object, String],
|
|
2310
2310
|
default: function() {
|
|
2311
|
-
return
|
|
2311
|
+
return vt;
|
|
2312
2312
|
}
|
|
2313
2313
|
},
|
|
2314
2314
|
backgroundWrapperComponent: {
|
|
2315
2315
|
type: [Object, String],
|
|
2316
2316
|
default: function() {
|
|
2317
|
-
return
|
|
2317
|
+
return pt;
|
|
2318
2318
|
}
|
|
2319
2319
|
},
|
|
2320
2320
|
stencilProps: {
|
|
@@ -2363,7 +2363,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2363
2363
|
type: String,
|
|
2364
2364
|
default: "fit-area",
|
|
2365
2365
|
validator: function(e) {
|
|
2366
|
-
return
|
|
2366
|
+
return Ee.indexOf(e) !== -1;
|
|
2367
2367
|
}
|
|
2368
2368
|
},
|
|
2369
2369
|
roundResult: {
|
|
@@ -2406,31 +2406,31 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2406
2406
|
bottom: !0,
|
|
2407
2407
|
top: !0
|
|
2408
2408
|
};
|
|
2409
|
-
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0),
|
|
2409
|
+
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), j.forEach((function(e) {
|
|
2410
2410
|
l[e] || (c[e] = 0);
|
|
2411
2411
|
}));
|
|
2412
|
-
var u =
|
|
2412
|
+
var u = I(o, c = Ye({
|
|
2413
2413
|
coordinates: o,
|
|
2414
2414
|
directions: c,
|
|
2415
2415
|
sizeRestrictions: a,
|
|
2416
2416
|
positionRestrictions: i
|
|
2417
|
-
})).width, d =
|
|
2417
|
+
})).width, d = I(o, c).height, f = s.preserveRatio ? B(o) : ke(u / d, r);
|
|
2418
2418
|
if (f) {
|
|
2419
2419
|
var p = s.respectDirection;
|
|
2420
2420
|
if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
|
|
2421
2421
|
var m = u / f - o.height;
|
|
2422
2422
|
if (l.top && l.bottom) {
|
|
2423
2423
|
var h = c.top, g = c.bottom;
|
|
2424
|
-
c.bottom =
|
|
2424
|
+
c.bottom = Y(m, g, h), c.top = Y(m, h, g);
|
|
2425
2425
|
} else l.bottom ? c.bottom = m : l.top ? c.top = m : l.right ? c.right = 0 : l.left && (c.left = 0);
|
|
2426
2426
|
} else if (p === "height") {
|
|
2427
2427
|
var _ = o.width - d * f;
|
|
2428
2428
|
if (l.left && l.right) {
|
|
2429
2429
|
var v = c.left, y = c.right;
|
|
2430
|
-
c.left = -
|
|
2430
|
+
c.left = -Y(_, v, y), c.right = -Y(_, y, v);
|
|
2431
2431
|
} else l.left ? c.left = -_ : l.right ? c.right = -_ : l.top ? c.top = 0 : l.bottom && (c.bottom = 0);
|
|
2432
2432
|
}
|
|
2433
|
-
c =
|
|
2433
|
+
c = Ye({
|
|
2434
2434
|
directions: c,
|
|
2435
2435
|
coordinates: o,
|
|
2436
2436
|
sizeRestrictions: a,
|
|
@@ -2439,10 +2439,10 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2439
2439
|
compensate: s.compensate
|
|
2440
2440
|
});
|
|
2441
2441
|
}
|
|
2442
|
-
return u =
|
|
2442
|
+
return u = I(o, c).width, d = I(o, c).height, (f = s.preserveRatio ? B(o) : ke(u / d, r)) && Math.abs(f - u / d) > .001 && j.forEach((function(e) {
|
|
2443
2443
|
l[e] || (c[e] = 0);
|
|
2444
|
-
})),
|
|
2445
|
-
event: new
|
|
2444
|
+
})), Le({
|
|
2445
|
+
event: new ge({
|
|
2446
2446
|
left: -c.left,
|
|
2447
2447
|
top: -c.top
|
|
2448
2448
|
}),
|
|
@@ -2458,19 +2458,19 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2458
2458
|
},
|
|
2459
2459
|
moveAlgorithm: {
|
|
2460
2460
|
type: Function,
|
|
2461
|
-
default:
|
|
2461
|
+
default: Le
|
|
2462
2462
|
},
|
|
2463
2463
|
initStretcher: {
|
|
2464
2464
|
type: Function,
|
|
2465
2465
|
default: function(e) {
|
|
2466
|
-
var t = e.stretcher, n = e.imageSize, r =
|
|
2466
|
+
var t = e.stretcher, n = e.imageSize, r = B(n);
|
|
2467
2467
|
t.style.width = n.width + "px", t.style.height = t.clientWidth / r + "px", t.style.width = t.clientWidth + "px";
|
|
2468
2468
|
}
|
|
2469
2469
|
},
|
|
2470
2470
|
fitCoordinates: {
|
|
2471
2471
|
type: Function,
|
|
2472
2472
|
default: function(e) {
|
|
2473
|
-
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = E(E({}, n),
|
|
2473
|
+
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = E(E({}, n), q({
|
|
2474
2474
|
width: n.width,
|
|
2475
2475
|
height: n.height,
|
|
2476
2476
|
aspectRatio: r,
|
|
@@ -2481,19 +2481,19 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2481
2481
|
minWidth: Math.min(t.width, i.minWidth)
|
|
2482
2482
|
}
|
|
2483
2483
|
}));
|
|
2484
|
-
return o =
|
|
2484
|
+
return o = G(o = R(o, N(P(n), P(o))), K(M(t), a));
|
|
2485
2485
|
}
|
|
2486
2486
|
},
|
|
2487
2487
|
fitVisibleArea: {
|
|
2488
2488
|
type: Function,
|
|
2489
2489
|
default: function(e) {
|
|
2490
2490
|
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = E({}, t);
|
|
2491
|
-
a.height = a.width /
|
|
2492
|
-
var o =
|
|
2491
|
+
a.height = a.width / B(n), a.top += (t.height - a.height) / 2, (i.height - a.height > 0 || i.width - a.width > 0) && (a = z(a, Math.max(i.height / a.height, i.width / a.width)));
|
|
2492
|
+
var o = L(H(i, M(a = z(a, W(a, r({
|
|
2493
2493
|
visibleArea: a,
|
|
2494
2494
|
type: "resize"
|
|
2495
2495
|
}))))));
|
|
2496
|
-
return a.width < i.width && (o.left = 0), a.height < i.height && (o.top = 0), a =
|
|
2496
|
+
return a.width < i.width && (o.left = 0), a.height < i.height && (o.top = 0), a = G(a = R(a, o), r({
|
|
2497
2497
|
visibleArea: a,
|
|
2498
2498
|
type: "move"
|
|
2499
2499
|
}));
|
|
@@ -2508,7 +2508,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2508
2508
|
top: 0,
|
|
2509
2509
|
right: r.width,
|
|
2510
2510
|
bottom: r.height
|
|
2511
|
-
} : i === "fit-area" && (
|
|
2511
|
+
} : i === "fit-area" && (B(n) > B(r) ? (o = {
|
|
2512
2512
|
top: 0,
|
|
2513
2513
|
bottom: r.height
|
|
2514
2514
|
}, t && a === "move" && (t.width > r.width ? (o.left = -(t.width - r.width) / 2, o.right = r.width - o.left) : (o.left = 0, o.right = r.width))) : (o = {
|
|
@@ -2570,7 +2570,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2570
2570
|
height: 0
|
|
2571
2571
|
},
|
|
2572
2572
|
visibleArea: null,
|
|
2573
|
-
coordinates: b({},
|
|
2573
|
+
coordinates: b({}, De)
|
|
2574
2574
|
};
|
|
2575
2575
|
},
|
|
2576
2576
|
computed: {
|
|
@@ -2608,7 +2608,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2608
2608
|
return !!(this.visibleArea && this.imageLoaded);
|
|
2609
2609
|
},
|
|
2610
2610
|
settings: function() {
|
|
2611
|
-
var e =
|
|
2611
|
+
var e = ue(this.resizeImage, {
|
|
2612
2612
|
touch: !0,
|
|
2613
2613
|
wheel: { ratio: .1 },
|
|
2614
2614
|
adjustStencil: !0
|
|
@@ -2618,7 +2618,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2618
2618
|
adjustStencil: !1
|
|
2619
2619
|
});
|
|
2620
2620
|
return {
|
|
2621
|
-
moveImage:
|
|
2621
|
+
moveImage: ue(this.moveImage, {
|
|
2622
2622
|
touch: !0,
|
|
2623
2623
|
mouse: !0
|
|
2624
2624
|
}, {
|
|
@@ -2649,10 +2649,10 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2649
2649
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
2650
2650
|
var e = this.sizeRestrictionsAlgorithm({
|
|
2651
2651
|
imageSize: this.imageSize,
|
|
2652
|
-
minWidth: O(this.minWidth) ? 0 :
|
|
2653
|
-
minHeight: O(this.minHeight) ? 0 :
|
|
2654
|
-
maxWidth: O(this.maxWidth) ? Infinity :
|
|
2655
|
-
maxHeight: O(this.maxHeight) ? Infinity :
|
|
2652
|
+
minWidth: O(this.minWidth) ? 0 : de(this.minWidth),
|
|
2653
|
+
minHeight: O(this.minHeight) ? 0 : de(this.minHeight),
|
|
2654
|
+
maxWidth: O(this.maxWidth) ? Infinity : de(this.maxWidth),
|
|
2655
|
+
maxHeight: O(this.maxHeight) ? Infinity : de(this.maxHeight)
|
|
2656
2656
|
});
|
|
2657
2657
|
if (e = function(e) {
|
|
2658
2658
|
var t = e.areaRestrictions, n = e.sizeRestrictions;
|
|
@@ -2666,7 +2666,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2666
2666
|
maxHeight: n.maxHeight === void 0 ? Infinity : n.maxHeight
|
|
2667
2667
|
});
|
|
2668
2668
|
i.left !== void 0 && i.right !== void 0 && (a.maxWidth = Math.min(a.maxWidth, i.right - i.left)), i.bottom !== void 0 && i.top !== void 0 && (a.maxHeight = Math.min(a.maxHeight, i.bottom - i.top));
|
|
2669
|
-
var o =
|
|
2669
|
+
var o = Me(t), s = Ae(r, o);
|
|
2670
2670
|
return o.width < Infinity && (!a.maxWidth || a.maxWidth > s.width) && (a.maxWidth = Math.min(a.maxWidth, s.width)), o.height < Infinity && (!a.maxHeight || a.maxHeight > s.height) && (a.maxHeight = Math.min(a.maxHeight, s.height)), a.minWidth > a.maxWidth && (a.minWidth = a.maxWidth, a.widthFrozen = !0), a.minHeight > a.maxHeight && (a.minHeight = a.maxHeight, a.heightFrozen = !0), a;
|
|
2671
2671
|
}({
|
|
2672
2672
|
sizeRestrictions: e,
|
|
@@ -2681,7 +2681,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2681
2681
|
visibleArea: this.visibleArea,
|
|
2682
2682
|
stencilSize: this.getStencilSize()
|
|
2683
2683
|
}), this.visibleArea && this.stencilSize) {
|
|
2684
|
-
var t = this.getStencilSize(), n =
|
|
2684
|
+
var t = this.getStencilSize(), n = Me(this.getAreaRestrictions({
|
|
2685
2685
|
visibleArea: this.visibleArea,
|
|
2686
2686
|
type: "resize"
|
|
2687
2687
|
}));
|
|
@@ -2757,7 +2757,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2757
2757
|
height: `${e.height}px`,
|
|
2758
2758
|
left: "0px",
|
|
2759
2759
|
top: "0px",
|
|
2760
|
-
transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` +
|
|
2760
|
+
transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + ct(r)
|
|
2761
2761
|
};
|
|
2762
2762
|
return this.transitionsOptions.enabled && (i.transition = `${this.transitionsOptions.time}ms ${this.transitionsOptions.timingFunction}`), i;
|
|
2763
2763
|
}
|
|
@@ -2798,7 +2798,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2798
2798
|
}
|
|
2799
2799
|
},
|
|
2800
2800
|
created: function() {
|
|
2801
|
-
this.debouncedUpdate =
|
|
2801
|
+
this.debouncedUpdate = oe(this.update, this.debounce), this.debouncedDisableTransitions = oe(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
2802
2802
|
},
|
|
2803
2803
|
mounted: function() {
|
|
2804
2804
|
this.$refs.image.addEventListener("load", this.onSuccessLoadImage), this.$refs.image.addEventListener("error", this.onFailLoadImage), this.onChangeImage(), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
|
|
@@ -2834,7 +2834,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2834
2834
|
},
|
|
2835
2835
|
zoom: function(e, t) {
|
|
2836
2836
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
2837
|
-
this.onManipulateImage(new
|
|
2837
|
+
this.onManipulateImage(new A({}, {
|
|
2838
2838
|
factor: 1 / e,
|
|
2839
2839
|
center: t
|
|
2840
2840
|
}), {
|
|
@@ -2844,7 +2844,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2844
2844
|
},
|
|
2845
2845
|
move: function(e, t) {
|
|
2846
2846
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
2847
|
-
this.onManipulateImage(new
|
|
2847
|
+
this.onManipulateImage(new A({
|
|
2848
2848
|
left: e || 0,
|
|
2849
2849
|
top: t || 0
|
|
2850
2850
|
}), {
|
|
@@ -2886,15 +2886,15 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2886
2886
|
left: Math.round(t.left),
|
|
2887
2887
|
top: Math.round(t.top)
|
|
2888
2888
|
};
|
|
2889
|
-
return i.width > n.maxWidth ? i.width = Math.floor(t.width) : i.width < n.minWidth && (i.width = Math.ceil(t.width)), i.height > n.maxHeight ? i.height = Math.floor(t.height) : i.height < n.minHeight && (i.height = Math.ceil(t.height)),
|
|
2889
|
+
return i.width > n.maxWidth ? i.width = Math.floor(t.width) : i.width < n.minWidth && (i.width = Math.ceil(t.width)), i.height > n.maxHeight ? i.height = Math.floor(t.height) : i.height < n.minHeight && (i.height = Math.ceil(t.height)), G(i, r);
|
|
2890
2890
|
}(b(b({}, this.getPublicProperties()), {}, {
|
|
2891
|
-
positionRestrictions:
|
|
2891
|
+
positionRestrictions: J(this.positionRestrictions, this.visibleArea),
|
|
2892
2892
|
coordinates: e
|
|
2893
2893
|
})) : e;
|
|
2894
2894
|
},
|
|
2895
2895
|
processAutoZoom: function(e, t, n, r) {
|
|
2896
2896
|
var i = this.autoZoomAlgorithm;
|
|
2897
|
-
i ||= this.stencilSize ?
|
|
2897
|
+
i ||= this.stencilSize ? ze : this.autoZoom ? Be : Ve;
|
|
2898
2898
|
var a = i({
|
|
2899
2899
|
event: {
|
|
2900
2900
|
type: e,
|
|
@@ -2909,10 +2909,10 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2909
2909
|
sizeRestrictions: this.sizeRestrictions,
|
|
2910
2910
|
stencilSize: this.getStencilSize()
|
|
2911
2911
|
});
|
|
2912
|
-
return b(b({}, a), {}, { changed: !
|
|
2912
|
+
return b(b({}, a), {}, { changed: !Oe(a.visibleArea, t) || !Oe(a.coordinates, n) });
|
|
2913
2913
|
},
|
|
2914
2914
|
runAutoZoom: function(e) {
|
|
2915
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i =
|
|
2915
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = te(t, xt), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
|
|
2916
2916
|
r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
|
|
2917
2917
|
},
|
|
2918
2918
|
normalizeEvent: function(e) {
|
|
@@ -2933,13 +2933,13 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2933
2933
|
});
|
|
2934
2934
|
if (t.type === "resize") {
|
|
2935
2935
|
var i = E(E({}, t), { directions: E({}, t.directions) });
|
|
2936
|
-
return
|
|
2936
|
+
return j.forEach((function(e) {
|
|
2937
2937
|
i.directions[e] *= r;
|
|
2938
2938
|
})), i;
|
|
2939
2939
|
}
|
|
2940
2940
|
if (t.type === "move") {
|
|
2941
2941
|
var a = E(E({}, t), { directions: E({}, t.directions) });
|
|
2942
|
-
return
|
|
2942
|
+
return Te.forEach((function(e) {
|
|
2943
2943
|
a.directions[e] *= r;
|
|
2944
2944
|
})), a;
|
|
2945
2945
|
}
|
|
@@ -2952,9 +2952,9 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2952
2952
|
var r = n.rotate, i = n.flip, a = {
|
|
2953
2953
|
width: t.naturalWidth,
|
|
2954
2954
|
height: t.naturalHeight
|
|
2955
|
-
}, o =
|
|
2955
|
+
}, o = je(a, r), s = e.getContext("2d");
|
|
2956
2956
|
e.height = o.height, e.width = o.width, s.save();
|
|
2957
|
-
var c =
|
|
2957
|
+
var c = U(P(E({
|
|
2958
2958
|
left: 0,
|
|
2959
2959
|
top: 0
|
|
2960
2960
|
}, a)), r);
|
|
@@ -2973,7 +2973,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
2973
2973
|
return t = e, !Number.isNaN(parseFloat(t)) && isFinite(t);
|
|
2974
2974
|
var t;
|
|
2975
2975
|
}));
|
|
2976
|
-
}, a =
|
|
2976
|
+
}, a = q({
|
|
2977
2977
|
sizeRestrictions: {
|
|
2978
2978
|
minWidth: i([r.width, r.minWidth]) || 0,
|
|
2979
2979
|
minHeight: i([r.height, r.minHeight]) || 0,
|
|
@@ -3007,8 +3007,8 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3007
3007
|
this.$emit("change", this.getResult());
|
|
3008
3008
|
},
|
|
3009
3009
|
applyTransform: function(e) {
|
|
3010
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ?
|
|
3011
|
-
return
|
|
3010
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Ne(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? J(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
|
|
3011
|
+
return Re({
|
|
3012
3012
|
transform: e,
|
|
3013
3013
|
coordinates: this.coordinates,
|
|
3014
3014
|
imageSize: this.imageSize,
|
|
@@ -3023,7 +3023,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3023
3023
|
if (this.$refs.image) {
|
|
3024
3024
|
this.$refs.cropper, this.$refs.image;
|
|
3025
3025
|
var t = this.defaultSize;
|
|
3026
|
-
t ||= this.stencilSize ?
|
|
3026
|
+
t ||= this.stencilSize ? We : Ue;
|
|
3027
3027
|
var n = this.sizeRestrictions;
|
|
3028
3028
|
n.minWidth, n.minHeight, n.maxWidth, n.maxHeight;
|
|
3029
3029
|
var r = D(t) ? t({
|
|
@@ -3033,7 +3033,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3033
3033
|
sizeRestrictions: this.sizeRestrictions,
|
|
3034
3034
|
stencilSize: this.getStencilSize(),
|
|
3035
3035
|
visibleArea: this.visibleArea
|
|
3036
|
-
}) : t, i = this.defaultPosition ||
|
|
3036
|
+
}) : t, i = this.defaultPosition || He, a = [r, function(t) {
|
|
3037
3037
|
var n = t.coordinates;
|
|
3038
3038
|
return b({}, D(i) ? i({
|
|
3039
3039
|
coordinates: n,
|
|
@@ -3090,7 +3090,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3090
3090
|
var e = this;
|
|
3091
3091
|
return this.appliedImageTransforms = b(b({}, this.defaultImageTransforms), {}, { flip: b({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
3092
3092
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
3093
|
-
var t, n, r, i, a, o, s = e.defaultVisibleArea ||
|
|
3093
|
+
var t, n, r, i, a, o, s = e.defaultVisibleArea || Ge;
|
|
3094
3094
|
e.visibleArea = D(s) ? s({
|
|
3095
3095
|
imageSize: e.imageSize,
|
|
3096
3096
|
boundaries: e.boundaries,
|
|
@@ -3101,7 +3101,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3101
3101
|
visibleArea: e.visibleArea,
|
|
3102
3102
|
boundaries: e.boundaries,
|
|
3103
3103
|
getAreaRestrictions: e.getAreaRestrictions
|
|
3104
|
-
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = E({}, n), o =
|
|
3104
|
+
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = E({}, n), o = B(r), a.width / a.height !== o && (a.height = a.width / o), G(a, i({
|
|
3105
3105
|
visibleArea: a,
|
|
3106
3106
|
type: "move"
|
|
3107
3107
|
}))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({
|
|
@@ -3142,7 +3142,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3142
3142
|
var e, t = this;
|
|
3143
3143
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
3144
3144
|
if (function(e) {
|
|
3145
|
-
if (
|
|
3145
|
+
if (le(e)) return !1;
|
|
3146
3146
|
var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
|
|
3147
3147
|
protocol: n[1] || "",
|
|
3148
3148
|
host: n[2] || "",
|
|
@@ -3157,8 +3157,8 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3157
3157
|
}
|
|
3158
3158
|
if (this.checkOrientation) {
|
|
3159
3159
|
var r = (e = this.src, new Promise((function(t) {
|
|
3160
|
-
|
|
3161
|
-
var r =
|
|
3160
|
+
st(e).then((function(n) {
|
|
3161
|
+
var r = lt(n);
|
|
3162
3162
|
t(n ? {
|
|
3163
3163
|
source: e,
|
|
3164
3164
|
arrayBuffer: n,
|
|
@@ -3195,14 +3195,14 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3195
3195
|
},
|
|
3196
3196
|
onParseImage: function(e) {
|
|
3197
3197
|
var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
|
|
3198
|
-
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ?
|
|
3198
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? ce(n) || !le(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
|
|
3199
3199
|
for (var t = [], n = new Uint8Array(e); n.length > 0;) {
|
|
3200
3200
|
var r = n.subarray(0, 8192);
|
|
3201
3201
|
t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
|
|
3202
3202
|
}
|
|
3203
3203
|
return "data:image/jpeg;base64," + btoa(t.join(""));
|
|
3204
|
-
}(r) : this.imageAttributes.src = n, D(this.defaultTransforms) ? this.appliedImageTransforms =
|
|
3205
|
-
var t =
|
|
3204
|
+
}(r) : this.imageAttributes.src = n, D(this.defaultTransforms) ? this.appliedImageTransforms = ot(this.defaultTransforms()) : k(this.defaultTransforms) ? this.appliedImageTransforms = ot(this.defaultTransforms) : this.appliedImageTransforms = function(e) {
|
|
3205
|
+
var t = ot({});
|
|
3206
3206
|
if (e) switch (e) {
|
|
3207
3207
|
case 2:
|
|
3208
3208
|
t.flip.horizontal = !0;
|
|
@@ -3242,7 +3242,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3242
3242
|
var t = this;
|
|
3243
3243
|
this.transitionsOptions.enabled || this.awaitRender((function() {
|
|
3244
3244
|
t.coordinates = t.moveAlgorithm(b(b({}, t.getPublicProperties()), {}, {
|
|
3245
|
-
positionRestrictions:
|
|
3245
|
+
positionRestrictions: J(t.positionRestrictions, t.visibleArea),
|
|
3246
3246
|
coordinates: t.coordinates,
|
|
3247
3247
|
event: t.normalizeEvent(e)
|
|
3248
3248
|
})), t.onChange();
|
|
@@ -3253,7 +3253,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3253
3253
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
|
|
3254
3254
|
var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
|
|
3255
3255
|
t.coordinates = t.resizeAlgorithm(b(b({}, t.getPublicProperties()), {}, {
|
|
3256
|
-
positionRestrictions:
|
|
3256
|
+
positionRestrictions: J(t.positionRestrictions, t.visibleArea),
|
|
3257
3257
|
sizeRestrictions: {
|
|
3258
3258
|
maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
|
|
3259
3259
|
maxHeight: Math.min(n.maxHeight, t.visibleArea.height),
|
|
@@ -3269,7 +3269,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3269
3269
|
if (!this.transitionsOptions.enabled) {
|
|
3270
3270
|
var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
|
|
3271
3271
|
r && this.enableTransitions();
|
|
3272
|
-
var o =
|
|
3272
|
+
var o = Ke(b(b({}, this.getPublicProperties()), {}, {
|
|
3273
3273
|
event: a ? this.normalizeEvent(e) : e,
|
|
3274
3274
|
getAreaRestrictions: this.getAreaRestrictions,
|
|
3275
3275
|
imageRestriction: this.imageRestriction,
|
|
@@ -3298,8 +3298,8 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3298
3298
|
t = s.minimum, n = s.maximum;
|
|
3299
3299
|
}
|
|
3300
3300
|
if (O(t) && (t = O(i) ? a : i), O(n) && (n = O(i) ? o : i), !e && (O(t) || O(n))) {
|
|
3301
|
-
var c = this.getStencilSize(), l = c ?
|
|
3302
|
-
O(t) && (t =
|
|
3301
|
+
var c = this.getStencilSize(), l = c ? B(c) : null;
|
|
3302
|
+
O(t) && (t = fe(l) ? l : void 0), O(n) && (n = fe(l) ? l : void 0);
|
|
3303
3303
|
}
|
|
3304
3304
|
return {
|
|
3305
3305
|
minimum: t,
|
|
@@ -3317,10 +3317,10 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3317
3317
|
coefficient: this.coefficient,
|
|
3318
3318
|
coordinates: this.coordinates,
|
|
3319
3319
|
aspectRatio: this.getAspectRatio(!0)
|
|
3320
|
-
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio,
|
|
3320
|
+
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, ke(B(i = D(n) ? n({
|
|
3321
3321
|
boundaries: t,
|
|
3322
3322
|
aspectRatio: r
|
|
3323
|
-
}) : n), r) && (i =
|
|
3323
|
+
}) : n), r) && (i = q({
|
|
3324
3324
|
sizeRestrictions: {
|
|
3325
3325
|
maxWidth: t.width,
|
|
3326
3326
|
maxHeight: t.height,
|
|
@@ -3333,7 +3333,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3333
3333
|
minimum: r.minimum,
|
|
3334
3334
|
maximum: r.maximum
|
|
3335
3335
|
}
|
|
3336
|
-
})), (i.width > t.width || i.height > t.height) && (i =
|
|
3336
|
+
})), (i.width > t.width || i.height > t.height) && (i = q({
|
|
3337
3337
|
sizeRestrictions: {
|
|
3338
3338
|
maxWidth: t.width,
|
|
3339
3339
|
maxHeight: t.height,
|
|
@@ -3343,8 +3343,8 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3343
3343
|
width: i.width,
|
|
3344
3344
|
height: i.height,
|
|
3345
3345
|
aspectRatio: {
|
|
3346
|
-
minimum:
|
|
3347
|
-
maximum:
|
|
3346
|
+
minimum: B(i),
|
|
3347
|
+
maximum: B(i)
|
|
3348
3348
|
}
|
|
3349
3349
|
})), i;
|
|
3350
3350
|
var e, t, n, r, i;
|
|
@@ -3362,13 +3362,13 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3362
3362
|
};
|
|
3363
3363
|
},
|
|
3364
3364
|
defaultCoordinates: function() {
|
|
3365
|
-
return b({},
|
|
3365
|
+
return b({}, De);
|
|
3366
3366
|
},
|
|
3367
3367
|
flip: function(e, t) {
|
|
3368
3368
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3369
3369
|
if (!this.transitionsActive) {
|
|
3370
3370
|
r && this.enableTransitions();
|
|
3371
|
-
var i = b({}, this.imageTransforms.flip), a =
|
|
3371
|
+
var i = b({}, this.imageTransforms.flip), a = Je({
|
|
3372
3372
|
flip: {
|
|
3373
3373
|
horizontal: e ? !i.horizontal : i.horizontal,
|
|
3374
3374
|
vertical: t ? !i.vertical : i.vertical
|
|
@@ -3392,7 +3392,7 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3392
3392
|
n && this.enableTransitions();
|
|
3393
3393
|
var r = b({}, this.imageSize);
|
|
3394
3394
|
this.appliedImageTransforms.rotate += e;
|
|
3395
|
-
var i =
|
|
3395
|
+
var i = qe({
|
|
3396
3396
|
visibleArea: this.visibleArea,
|
|
3397
3397
|
coordinates: this.coordinates,
|
|
3398
3398
|
previousImageSize: r,
|
|
@@ -3412,17 +3412,17 @@ var bt = ["transitions"], $ = T("vue-advanced-cropper"), xt = {
|
|
|
3412
3412
|
"error",
|
|
3413
3413
|
"ready"
|
|
3414
3414
|
]
|
|
3415
|
-
},
|
|
3415
|
+
}, Ct = {
|
|
3416
3416
|
key: 0,
|
|
3417
3417
|
ref: "canvas",
|
|
3418
3418
|
style: { display: "none" }
|
|
3419
|
-
},
|
|
3419
|
+
}, wt = {
|
|
3420
3420
|
key: 1,
|
|
3421
3421
|
ref: "sourceCanvas",
|
|
3422
3422
|
style: { display: "none" }
|
|
3423
3423
|
};
|
|
3424
|
-
|
|
3425
|
-
return
|
|
3424
|
+
St.render = function(e, t, a, s, l, u) {
|
|
3425
|
+
return c(), n("div", {
|
|
3426
3426
|
ref: "cropper",
|
|
3427
3427
|
class: u.classes.cropper
|
|
3428
3428
|
}, [i("div", {
|
|
@@ -3431,7 +3431,7 @@ xt.render = function(e, t, a, c, l, u) {
|
|
|
3431
3431
|
}, null, 2), i("div", {
|
|
3432
3432
|
class: u.classes.boundaries,
|
|
3433
3433
|
style: u.boundariesStyle
|
|
3434
|
-
}, [(
|
|
3434
|
+
}, [(c(), n(p(a.backgroundWrapperComponent), {
|
|
3435
3435
|
class: u.classes.cropperWrapper,
|
|
3436
3436
|
"wheel-resize": u.settings.resizeImage.wheel,
|
|
3437
3437
|
"touch-resize": u.settings.resizeImage.touch,
|
|
@@ -3440,7 +3440,7 @@ xt.render = function(e, t, a, c, l, u) {
|
|
|
3440
3440
|
onMove: u.onManipulateImage,
|
|
3441
3441
|
onResize: u.onManipulateImage
|
|
3442
3442
|
}, {
|
|
3443
|
-
default:
|
|
3443
|
+
default: _((function() {
|
|
3444
3444
|
return [
|
|
3445
3445
|
i("div", {
|
|
3446
3446
|
class: u.classes.background,
|
|
@@ -3452,13 +3452,13 @@ xt.render = function(e, t, a, c, l, u) {
|
|
|
3452
3452
|
src: l.imageAttributes.src,
|
|
3453
3453
|
class: u.classes.image,
|
|
3454
3454
|
style: u.imageStyle,
|
|
3455
|
-
onMousedown: t[1] ||=
|
|
3455
|
+
onMousedown: t[1] ||= y((function() {}), ["prevent"])
|
|
3456
3456
|
}, null, 46, ["crossorigin", "src"])], 2),
|
|
3457
3457
|
i("div", {
|
|
3458
3458
|
class: u.classes.foreground,
|
|
3459
3459
|
style: u.boundariesStyle
|
|
3460
3460
|
}, null, 6),
|
|
3461
|
-
|
|
3461
|
+
v((c(), n(p(a.stencilComponent), o({
|
|
3462
3462
|
ref: "stencil",
|
|
3463
3463
|
image: u.image,
|
|
3464
3464
|
coordinates: l.coordinates,
|
|
@@ -3478,9 +3478,9 @@ xt.render = function(e, t, a, c, l, u) {
|
|
|
3478
3478
|
"onResizeEnd",
|
|
3479
3479
|
"onMove",
|
|
3480
3480
|
"onMoveEnd"
|
|
3481
|
-
])), [[
|
|
3482
|
-
a.canvas ? (
|
|
3483
|
-
a.canvas ? (
|
|
3481
|
+
])), [[h, l.imageLoaded]]),
|
|
3482
|
+
a.canvas ? (c(), n("canvas", Ct, null, 512)) : r("", !0),
|
|
3483
|
+
a.canvas ? (c(), n("canvas", wt, null, 512)) : r("", !0)
|
|
3484
3484
|
];
|
|
3485
3485
|
})),
|
|
3486
3486
|
_: 1
|
|
@@ -3496,7 +3496,7 @@ xt.render = function(e, t, a, c, l, u) {
|
|
|
3496
3496
|
};
|
|
3497
3497
|
//#endregion
|
|
3498
3498
|
//#region lib/components/ui/media/image-cropper/partials/image-cropper-canvas.vue
|
|
3499
|
-
var
|
|
3499
|
+
var Tt = /* @__PURE__ */ a({
|
|
3500
3500
|
__name: "image-cropper-canvas",
|
|
3501
3501
|
props: {
|
|
3502
3502
|
src: {},
|
|
@@ -3507,13 +3507,20 @@ var wt = /* @__PURE__ */ a({
|
|
|
3507
3507
|
},
|
|
3508
3508
|
emits: ["change"],
|
|
3509
3509
|
setup(e, { emit: r }) {
|
|
3510
|
-
let i = e, a = r, o =
|
|
3511
|
-
|
|
3510
|
+
let i = e, a = r, o = l(null), u = t(() => i.cropShape === "round" ? bt : vt), d = t(() => i.aspect == null ? {} : { aspectRatio: i.aspect });
|
|
3511
|
+
g(() => i.zoom, (e, t) => {
|
|
3512
3512
|
t == null || e === t || o.value?.zoom(e / t);
|
|
3513
|
-
}),
|
|
3513
|
+
}), g(() => i.rotation, (e, t) => {
|
|
3514
3514
|
o.value?.rotate(e - (t ?? 0));
|
|
3515
3515
|
});
|
|
3516
|
-
function
|
|
3516
|
+
function f(e) {
|
|
3517
|
+
e.stopImmediatePropagation();
|
|
3518
|
+
}
|
|
3519
|
+
s(() => {
|
|
3520
|
+
let e = o.value?.$el;
|
|
3521
|
+
if (e instanceof Element) for (let t of e.querySelectorAll("img")) t.addEventListener("load", f, { capture: !0 });
|
|
3522
|
+
});
|
|
3523
|
+
function p(e) {
|
|
3517
3524
|
a("change", {
|
|
3518
3525
|
area: {
|
|
3519
3526
|
x: e.coordinates.left,
|
|
@@ -3524,17 +3531,17 @@ var wt = /* @__PURE__ */ a({
|
|
|
3524
3531
|
canvas: e.canvas ?? null
|
|
3525
3532
|
});
|
|
3526
3533
|
}
|
|
3527
|
-
return (t, r) => (
|
|
3534
|
+
return (t, r) => (c(), n(m(St), {
|
|
3528
3535
|
ref_key: "cropperRef",
|
|
3529
3536
|
ref: o,
|
|
3530
3537
|
class: "image-cropper-canvas h-full w-full",
|
|
3531
3538
|
src: e.src,
|
|
3532
|
-
"stencil-component":
|
|
3533
|
-
"stencil-props":
|
|
3539
|
+
"stencil-component": u.value,
|
|
3540
|
+
"stencil-props": d.value,
|
|
3534
3541
|
debounce: 0,
|
|
3535
3542
|
"image-restriction": "stencil",
|
|
3536
3543
|
canvas: !0,
|
|
3537
|
-
onChange:
|
|
3544
|
+
onChange: p
|
|
3538
3545
|
}, null, 8, [
|
|
3539
3546
|
"src",
|
|
3540
3547
|
"stencil-component",
|
|
@@ -3543,4 +3550,4 @@ var wt = /* @__PURE__ */ a({
|
|
|
3543
3550
|
}
|
|
3544
3551
|
});
|
|
3545
3552
|
//#endregion
|
|
3546
|
-
export {
|
|
3553
|
+
export { Tt as default };
|