svelte-product-mockup 0.0.6 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1866 -1658
- package/package.json +43 -45
- package/src/lib/components/LayerControls.svelte +30 -1
- package/src/lib/components/sections/SvgSection.svelte +174 -0
- package/src/lib/image-transformations/index.ts +2 -1
- package/src/lib/image-transformations/svg.ts +106 -0
- package/src/lib/image-transformations/types.ts +16 -2
- package/src/lib/renderMockupCanvas.ts +120 -21
package/dist/index.js
CHANGED
|
@@ -1,158 +1,158 @@
|
|
|
1
1
|
import "svelte/internal/disclose-version";
|
|
2
2
|
import * as e from "svelte/internal/client";
|
|
3
|
-
import { onMount as Te, tick as
|
|
4
|
-
import { fade as
|
|
5
|
-
import { beforeNavigate as
|
|
6
|
-
import { browser as
|
|
7
|
-
function
|
|
8
|
-
const t = new Uint8ClampedArray(
|
|
9
|
-
for (let
|
|
10
|
-
let
|
|
11
|
-
t[
|
|
12
|
-
}
|
|
13
|
-
return new ImageData(t,
|
|
14
|
-
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
function
|
|
19
|
-
return 259 * (
|
|
20
|
-
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
3
|
+
import { onMount as Te, tick as St, onDestroy as zt, untrack as $e } from "svelte";
|
|
4
|
+
import { fade as Qe } from "svelte/transition";
|
|
5
|
+
import { beforeNavigate as It, pushState as Pt } from "$app/navigation";
|
|
6
|
+
import { browser as Ct } from "$app/environment";
|
|
7
|
+
function jt(s, n) {
|
|
8
|
+
const t = new Uint8ClampedArray(s.data), { brightness: a, contrast: r, saturation: o, hue: i, exposure: h, gamma: _, shadows: k, highlights: p, vibrance: v, temperature: f, tint: x } = n;
|
|
9
|
+
for (let y = 0; y < t.length; y += 4) {
|
|
10
|
+
let w = t[y], S = t[y + 1], I = t[y + 2];
|
|
11
|
+
t[y + 3] !== 0 && (w = Oe(w, a), S = Oe(S, a), I = Oe(I, a), w = Ze(w, r), S = Ze(S, r), I = Ze(I, r), [w, S, I] = Nt(w, S, I, o), [w, S, I] = Rt(w, S, I, i), [w, S, I] = Wt(w, S, I, h), [w, S, I] = Dt(w, S, I, _), [w, S, I] = Xt(w, S, I, k, p), [w, S, I] = Yt(w, S, I, v), [w, S, I] = Et(w, S, I, f, x), t[y] = Be(w), t[y + 1] = Be(S), t[y + 2] = Be(I));
|
|
12
|
+
}
|
|
13
|
+
return new ImageData(t, s.width, s.height);
|
|
14
|
+
}
|
|
15
|
+
function Oe(s, n) {
|
|
16
|
+
return s + n * 255;
|
|
17
|
+
}
|
|
18
|
+
function Ze(s, n) {
|
|
19
|
+
return 259 * (n * 255 + 255) / (255 * (259 - n * 255)) * (s - 128) + 128;
|
|
20
|
+
}
|
|
21
|
+
function Nt(s, n, t, a) {
|
|
22
|
+
const r = 0.299 * s + 0.587 * n + 0.114 * t, o = 1 + a;
|
|
23
23
|
return [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
r + o * (s - r),
|
|
25
|
+
r + o * (n - r),
|
|
26
|
+
r + o * (t - r)
|
|
27
27
|
];
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
1 / 3 * (1 -
|
|
33
|
-
1 / 3 * (1 -
|
|
34
|
-
1 / 3 * (1 -
|
|
35
|
-
|
|
36
|
-
1 / 3 * (1 -
|
|
37
|
-
1 / 3 * (1 -
|
|
38
|
-
1 / 3 * (1 -
|
|
39
|
-
|
|
29
|
+
function Rt(s, n, t, a) {
|
|
30
|
+
const r = a * Math.PI / 180, o = Math.cos(r), i = Math.sin(r), h = [
|
|
31
|
+
o + (1 - o) / 3,
|
|
32
|
+
1 / 3 * (1 - o) - Math.sqrt(1 / 3) * i,
|
|
33
|
+
1 / 3 * (1 - o) + Math.sqrt(1 / 3) * i,
|
|
34
|
+
1 / 3 * (1 - o) + Math.sqrt(1 / 3) * i,
|
|
35
|
+
o + 1 / 3 * (1 - o),
|
|
36
|
+
1 / 3 * (1 - o) - Math.sqrt(1 / 3) * i,
|
|
37
|
+
1 / 3 * (1 - o) - Math.sqrt(1 / 3) * i,
|
|
38
|
+
1 / 3 * (1 - o) + Math.sqrt(1 / 3) * i,
|
|
39
|
+
o + 1 / 3 * (1 - o)
|
|
40
40
|
];
|
|
41
41
|
return [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
s * h[0] + n * h[1] + t * h[2],
|
|
43
|
+
s * h[3] + n * h[4] + t * h[5],
|
|
44
|
+
s * h[6] + n * h[7] + t * h[8]
|
|
45
45
|
];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
return [
|
|
47
|
+
function Wt(s, n, t, a) {
|
|
48
|
+
const r = Math.pow(2, a);
|
|
49
|
+
return [s * r, n * r, t * r];
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
51
|
+
function Dt(s, n, t, a) {
|
|
52
|
+
const r = 1 / a;
|
|
53
53
|
return [
|
|
54
|
-
Math.pow(
|
|
55
|
-
Math.pow(
|
|
56
|
-
Math.pow(t / 255,
|
|
54
|
+
Math.pow(s / 255, r) * 255,
|
|
55
|
+
Math.pow(n / 255, r) * 255,
|
|
56
|
+
Math.pow(t / 255, r) * 255
|
|
57
57
|
];
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
let
|
|
62
|
-
return
|
|
59
|
+
function Xt(s, n, t, a, r) {
|
|
60
|
+
const o = 0.299 * s + 0.587 * n + 0.114 * t;
|
|
61
|
+
let i = 1;
|
|
62
|
+
return o < 128 ? i = 1 + a : i = 1 + r, [s * i, n * i, t * i];
|
|
63
63
|
}
|
|
64
|
-
function Yt(
|
|
65
|
-
const
|
|
66
|
-
return [
|
|
64
|
+
function Yt(s, n, t, a) {
|
|
65
|
+
const r = Math.max(s, n, t), o = Math.min(s, n, t), i = r === 0 ? 0 : (r - o) / r, h = 1 + a * (1 - i);
|
|
66
|
+
return [s * h, n * h, t * h];
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
let
|
|
70
|
-
return a > 0 ? (
|
|
68
|
+
function Et(s, n, t, a, r) {
|
|
69
|
+
let o = s, i = n, h = t;
|
|
70
|
+
return a > 0 ? (o += a * 0.1, h -= a * 0.1) : (o += a * 0.05, h -= a * 0.05), r > 0 ? (o += r * 0.1, i -= r * 0.05) : (o += r * 0.05, i -= r * 0.1), [o, i, h];
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return Math.max(0, Math.min(255,
|
|
72
|
+
function Be(s) {
|
|
73
|
+
return Math.max(0, Math.min(255, s));
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const a =
|
|
75
|
+
function Lt(s, n, t) {
|
|
76
|
+
const a = s / n;
|
|
77
77
|
switch (t.mode) {
|
|
78
78
|
case "scale":
|
|
79
|
-
const
|
|
79
|
+
const r = t.scale ?? 1;
|
|
80
80
|
return {
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
81
|
+
width: s * r,
|
|
82
|
+
height: n * r,
|
|
83
83
|
sourceX: 0,
|
|
84
84
|
sourceY: 0,
|
|
85
|
-
sourceWidth:
|
|
86
|
-
sourceHeight:
|
|
85
|
+
sourceWidth: s,
|
|
86
|
+
sourceHeight: n
|
|
87
87
|
};
|
|
88
88
|
case "px":
|
|
89
|
-
let
|
|
89
|
+
let o = t.width ?? s, i = t.height ?? n;
|
|
90
90
|
if (t.maintainAspectRatio) {
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
else if (
|
|
94
|
-
|
|
95
|
-
else if (
|
|
96
|
-
const
|
|
97
|
-
|
|
91
|
+
if (o && !i)
|
|
92
|
+
i = o / a;
|
|
93
|
+
else if (i && !o)
|
|
94
|
+
o = i * a;
|
|
95
|
+
else if (o && i) {
|
|
96
|
+
const g = Math.min(o / s, i / n);
|
|
97
|
+
o = s * g, i = n * g;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
return t.minWidth && (
|
|
101
|
-
width:
|
|
102
|
-
height:
|
|
100
|
+
return t.minWidth && (o = Math.max(o, t.minWidth)), t.maxWidth && (o = Math.min(o, t.maxWidth)), t.minHeight && (i = Math.max(i, t.minHeight)), t.maxHeight && (i = Math.min(i, t.maxHeight)), {
|
|
101
|
+
width: o,
|
|
102
|
+
height: i,
|
|
103
103
|
sourceX: 0,
|
|
104
104
|
sourceY: 0,
|
|
105
|
-
sourceWidth:
|
|
106
|
-
sourceHeight:
|
|
105
|
+
sourceWidth: s,
|
|
106
|
+
sourceHeight: n
|
|
107
107
|
};
|
|
108
108
|
case "fit":
|
|
109
|
-
const
|
|
109
|
+
const h = t.width ?? s, _ = t.height ?? n, k = Math.min(h / s, _ / n);
|
|
110
110
|
return {
|
|
111
|
-
width:
|
|
112
|
-
height:
|
|
111
|
+
width: s * k,
|
|
112
|
+
height: n * k,
|
|
113
113
|
sourceX: 0,
|
|
114
114
|
sourceY: 0,
|
|
115
|
-
sourceWidth:
|
|
116
|
-
sourceHeight:
|
|
115
|
+
sourceWidth: s,
|
|
116
|
+
sourceHeight: n
|
|
117
117
|
};
|
|
118
118
|
case "fill":
|
|
119
|
-
const
|
|
119
|
+
const p = t.width ?? s, v = t.height ?? n, f = Math.max(p / s, v / n), x = p / f, y = v / f;
|
|
120
120
|
return {
|
|
121
|
-
width:
|
|
122
|
-
height:
|
|
123
|
-
sourceX: (
|
|
124
|
-
sourceY: (
|
|
125
|
-
sourceWidth:
|
|
126
|
-
sourceHeight:
|
|
121
|
+
width: p,
|
|
122
|
+
height: v,
|
|
123
|
+
sourceX: (s - x) / 2,
|
|
124
|
+
sourceY: (n - y) / 2,
|
|
125
|
+
sourceWidth: x,
|
|
126
|
+
sourceHeight: y
|
|
127
127
|
};
|
|
128
128
|
case "cover":
|
|
129
|
-
const
|
|
129
|
+
const w = t.width ?? s, S = t.height ?? n;
|
|
130
130
|
return {
|
|
131
|
-
width:
|
|
132
|
-
height:
|
|
131
|
+
width: w,
|
|
132
|
+
height: S,
|
|
133
133
|
sourceX: 0,
|
|
134
134
|
sourceY: 0,
|
|
135
|
-
sourceWidth:
|
|
136
|
-
sourceHeight:
|
|
135
|
+
sourceWidth: s,
|
|
136
|
+
sourceHeight: n
|
|
137
137
|
};
|
|
138
138
|
case "contain":
|
|
139
|
-
const
|
|
139
|
+
const I = t.width ?? s, P = t.height ?? n, u = Math.min(I / s, P / n);
|
|
140
140
|
return {
|
|
141
|
-
width:
|
|
142
|
-
height:
|
|
141
|
+
width: s * u,
|
|
142
|
+
height: n * u,
|
|
143
143
|
sourceX: 0,
|
|
144
144
|
sourceY: 0,
|
|
145
|
-
sourceWidth:
|
|
146
|
-
sourceHeight:
|
|
145
|
+
sourceWidth: s,
|
|
146
|
+
sourceHeight: n
|
|
147
147
|
};
|
|
148
148
|
default:
|
|
149
149
|
return {
|
|
150
|
-
width:
|
|
151
|
-
height:
|
|
150
|
+
width: s,
|
|
151
|
+
height: n,
|
|
152
152
|
sourceX: 0,
|
|
153
153
|
sourceY: 0,
|
|
154
|
-
sourceWidth:
|
|
155
|
-
sourceHeight:
|
|
154
|
+
sourceWidth: s,
|
|
155
|
+
sourceHeight: n
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -160,7 +160,7 @@ const se = {
|
|
|
160
160
|
scale: 1,
|
|
161
161
|
translateX: 0,
|
|
162
162
|
translateY: 0
|
|
163
|
-
},
|
|
163
|
+
}, fe = {
|
|
164
164
|
showBounds: !1,
|
|
165
165
|
showDepthVis: !1,
|
|
166
166
|
showCrosshair: !1
|
|
@@ -181,7 +181,7 @@ const se = {
|
|
|
181
181
|
rotationX: 0,
|
|
182
182
|
rotationY: 0,
|
|
183
183
|
rotationZ: 0
|
|
184
|
-
},
|
|
184
|
+
}, et = {
|
|
185
185
|
type: "warp",
|
|
186
186
|
shape: "none",
|
|
187
187
|
enabled: !1,
|
|
@@ -191,316 +191,379 @@ const se = {
|
|
|
191
191
|
plane: { ...ae },
|
|
192
192
|
sphere: { ...ke }
|
|
193
193
|
};
|
|
194
|
-
function
|
|
195
|
-
const t = new OffscreenCanvas(
|
|
194
|
+
function Ot(s) {
|
|
195
|
+
const t = new OffscreenCanvas(s.width, s.height).getContext("2d");
|
|
196
196
|
if (!t) throw new Error("Failed to create canvas context");
|
|
197
|
-
return t.drawImage(
|
|
197
|
+
return t.drawImage(s, 0, 0), t.getImageData(0, 0, s.width, s.height);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
const a =
|
|
201
|
-
if (
|
|
199
|
+
function Zt(s, n, t) {
|
|
200
|
+
const a = s.width, r = s.height, o = s.data;
|
|
201
|
+
if (n < 0 || n >= a || t < 0 || t >= r)
|
|
202
202
|
return null;
|
|
203
|
-
const
|
|
204
|
-
const
|
|
203
|
+
const i = Math.floor(n), h = Math.floor(t), _ = Math.min(i + 1, a - 1), k = Math.min(h + 1, r - 1), p = n - i, v = t - h, f = (M, l) => {
|
|
204
|
+
const d = (l * a + M) * 4;
|
|
205
205
|
return {
|
|
206
|
-
r:
|
|
207
|
-
g:
|
|
208
|
-
b:
|
|
209
|
-
a:
|
|
206
|
+
r: o[d],
|
|
207
|
+
g: o[d + 1],
|
|
208
|
+
b: o[d + 2],
|
|
209
|
+
a: o[d + 3]
|
|
210
210
|
};
|
|
211
|
-
},
|
|
212
|
-
return { r:
|
|
213
|
-
}
|
|
214
|
-
function Ve(
|
|
215
|
-
const
|
|
216
|
-
minX: -
|
|
217
|
-
minY: -
|
|
218
|
-
maxX:
|
|
219
|
-
maxY:
|
|
220
|
-
},
|
|
221
|
-
if (
|
|
222
|
-
const
|
|
223
|
-
for (let
|
|
224
|
-
for (let
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
211
|
+
}, x = f(i, h), y = f(_, h), w = f(i, k), S = f(_, k), I = (M, l, d) => M + (l - M) * d, P = I(I(x.r, y.r, p), I(w.r, S.r, p), v), u = I(I(x.g, y.g, p), I(w.g, S.g, p), v), g = I(I(x.b, y.b, p), I(w.b, S.b, p), v), C = I(I(x.a, y.a, p), I(w.a, S.a, p), v);
|
|
212
|
+
return { r: P, g: u, b: g, a: C };
|
|
213
|
+
}
|
|
214
|
+
function Ve(s, n, t, a, r, o, i, h, _, k) {
|
|
215
|
+
const p = Ot(n), v = k?.showDepthVis ?? !1, f = k?.maxZ ?? 500, x = _ ?? {
|
|
216
|
+
minX: -r / 2,
|
|
217
|
+
minY: -o / 2,
|
|
218
|
+
maxX: r / 2,
|
|
219
|
+
maxY: o / 2
|
|
220
|
+
}, y = x.maxX - x.minX, w = x.maxY - x.minY, S = Math.floor(y * i), I = Math.floor(w * i);
|
|
221
|
+
if (S <= 0 || I <= 0) return;
|
|
222
|
+
const P = new ImageData(S, I), u = P.data;
|
|
223
|
+
for (let d = 0; d < I; d++)
|
|
224
|
+
for (let c = 0; c < S; c++) {
|
|
225
|
+
const b = x.minX + c / i, T = x.minY + d / i, m = h(b, T);
|
|
226
|
+
if (!m || m.z <= 0)
|
|
227
227
|
continue;
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
const
|
|
231
|
-
|
|
228
|
+
const R = (d * S + c) * 4;
|
|
229
|
+
if (v) {
|
|
230
|
+
const z = Math.min(1, Math.max(0, m.z / f)), N = Math.floor(z * 200 + 55);
|
|
231
|
+
u[R] = Math.floor(N * 0.3), u[R + 1] = Math.floor(N * 0.6), u[R + 2] = N, u[R + 3] = 200;
|
|
232
232
|
} else {
|
|
233
|
-
const { u:
|
|
234
|
-
|
|
233
|
+
const { u: z, v: N } = m, L = Zt(p, z, N);
|
|
234
|
+
L && (u[R] = Math.round(L.r), u[R + 1] = Math.round(L.g), u[R + 2] = Math.round(L.b), u[R + 3] = Math.round(L.a));
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
function
|
|
244
|
-
if (!("save" in
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
function oe(
|
|
249
|
-
const
|
|
250
|
-
let
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
if (
|
|
256
|
-
const
|
|
257
|
-
|
|
237
|
+
const g = new OffscreenCanvas(S, I), C = g.getContext("2d");
|
|
238
|
+
if (!C) return;
|
|
239
|
+
C.putImageData(P, 0, 0);
|
|
240
|
+
const M = t + x.minX, l = a + x.minY;
|
|
241
|
+
i !== 1 ? s.drawImage(g, M, l, y, w) : s.drawImage(g, M, l);
|
|
242
|
+
}
|
|
243
|
+
function Ae(s, n, t, a = 20) {
|
|
244
|
+
if (!("save" in s)) return;
|
|
245
|
+
const r = s;
|
|
246
|
+
r.save(), r.strokeStyle = "#00ff00", r.lineWidth = 2, r.beginPath(), r.moveTo(n - a, t), r.lineTo(n + a, t), r.stroke(), r.beginPath(), r.moveTo(n, t - a), r.lineTo(n, t + a), r.stroke(), r.fillStyle = "#00ff00", r.beginPath(), r.arc(n, t, 3, 0, Math.PI * 2), r.fill(), r.restore();
|
|
247
|
+
}
|
|
248
|
+
function oe(s, n, t, a, r, o) {
|
|
249
|
+
const i = Math.cos(a), h = Math.sin(a), _ = Math.cos(r), k = Math.sin(r), p = Math.cos(o), v = Math.sin(o);
|
|
250
|
+
let f = s, x = n, y = t;
|
|
251
|
+
if (o !== 0) {
|
|
252
|
+
const w = f, S = x;
|
|
253
|
+
f = w * p - S * v, x = w * v + S * p;
|
|
254
|
+
}
|
|
255
|
+
if (r !== 0) {
|
|
256
|
+
const w = f, S = y;
|
|
257
|
+
f = w * _ + S * k, y = -w * k + S * _;
|
|
258
258
|
}
|
|
259
259
|
if (a !== 0) {
|
|
260
|
-
const
|
|
261
|
-
|
|
260
|
+
const w = x, S = y;
|
|
261
|
+
x = w * i - S * h, y = w * h + S * i;
|
|
262
262
|
}
|
|
263
|
-
return [
|
|
263
|
+
return [f, x, y];
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
let
|
|
265
|
+
function Bt(s, n, t, a, r, o) {
|
|
266
|
+
const i = Math.cos(a), h = Math.sin(a), _ = Math.cos(r), k = Math.sin(r), p = Math.cos(o), v = Math.sin(o);
|
|
267
|
+
let f = s, x = n, y = t;
|
|
268
268
|
if (a !== 0) {
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
if (
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
if (
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
return [
|
|
281
|
-
}
|
|
282
|
-
function qt(
|
|
283
|
-
if (!("save" in
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
for (let
|
|
288
|
-
const
|
|
289
|
-
for (let
|
|
290
|
-
const
|
|
291
|
-
|
|
269
|
+
const w = x, S = y;
|
|
270
|
+
x = w * i + S * h, y = -w * h + S * i;
|
|
271
|
+
}
|
|
272
|
+
if (r !== 0) {
|
|
273
|
+
const w = f, S = y;
|
|
274
|
+
f = w * _ - S * k, y = w * k + S * _;
|
|
275
|
+
}
|
|
276
|
+
if (o !== 0) {
|
|
277
|
+
const w = f, S = x;
|
|
278
|
+
f = w * p + S * v, x = -w * v + S * p;
|
|
279
|
+
}
|
|
280
|
+
return [f, x, y];
|
|
281
|
+
}
|
|
282
|
+
function qt(s, n, t, a, r, o) {
|
|
283
|
+
if (!("save" in s)) return;
|
|
284
|
+
const i = s;
|
|
285
|
+
i.save(), i.strokeStyle = "#ff6600", i.lineWidth = 1.5, i.setLineDash([4, 6]);
|
|
286
|
+
const h = 50, _ = 3;
|
|
287
|
+
for (let k = -_; k <= _; k++) {
|
|
288
|
+
const p = k * h, v = [];
|
|
289
|
+
for (let f = -10; f <= 10; f++) {
|
|
290
|
+
const x = f * h, y = o(p, x);
|
|
291
|
+
y && v.push({ x: n + y.x, y: t + y.y });
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
-
for (let
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
if (v.length > 1) {
|
|
294
|
+
i.beginPath(), i.moveTo(v[0].x, v[0].y);
|
|
295
|
+
for (let f = 1; f < v.length; f++)
|
|
296
|
+
i.lineTo(v[f].x, v[f].y);
|
|
297
|
+
i.stroke();
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
for (let
|
|
301
|
-
const
|
|
302
|
-
for (let
|
|
303
|
-
const
|
|
304
|
-
|
|
300
|
+
for (let k = -_; k <= _; k++) {
|
|
301
|
+
const p = k * h, v = [];
|
|
302
|
+
for (let f = -10; f <= 10; f++) {
|
|
303
|
+
const x = f * h, y = o(x, p);
|
|
304
|
+
y && v.push({ x: n + y.x, y: t + y.y });
|
|
305
305
|
}
|
|
306
|
-
if (
|
|
307
|
-
|
|
308
|
-
for (let
|
|
309
|
-
|
|
310
|
-
|
|
306
|
+
if (v.length > 1) {
|
|
307
|
+
i.beginPath(), i.moveTo(v[0].x, v[0].y);
|
|
308
|
+
for (let f = 1; f < v.length; f++)
|
|
309
|
+
i.lineTo(v[f].x, v[f].y);
|
|
310
|
+
i.stroke();
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
|
|
313
|
+
i.restore();
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
if (!("save" in
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
let
|
|
321
|
-
const
|
|
322
|
-
const
|
|
315
|
+
function Ut(s, n, t, a, r, o, i, h) {
|
|
316
|
+
if (!("save" in s)) return;
|
|
317
|
+
const _ = s;
|
|
318
|
+
_.save(), _.lineWidth = 2, _.setLineDash([6, 4]);
|
|
319
|
+
const k = Math.sin(o);
|
|
320
|
+
let p = 1 / 0, v = -1 / 0;
|
|
321
|
+
const f = (d, c, b) => {
|
|
322
|
+
const T = c * k, m = h / (h + T);
|
|
323
323
|
return {
|
|
324
|
-
x:
|
|
325
|
-
y: t +
|
|
326
|
-
z:
|
|
324
|
+
x: n + d * m,
|
|
325
|
+
y: t + c * m,
|
|
326
|
+
z: b
|
|
327
327
|
};
|
|
328
|
-
},
|
|
329
|
-
const
|
|
330
|
-
if (
|
|
331
|
-
const
|
|
332
|
-
return `rgb(${
|
|
333
|
-
},
|
|
334
|
-
for (let
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
for (let
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
for (let
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const [
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
const
|
|
349
|
-
for (let
|
|
350
|
-
const
|
|
351
|
-
|
|
328
|
+
}, x = (d, c, b) => {
|
|
329
|
+
const T = b - c;
|
|
330
|
+
if (T < 1e-3) return "#ff6600";
|
|
331
|
+
const m = (d - c) / T, R = Math.round(100 + m * 155), z = Math.round(30 + m * 70), N = Math.round(0 + m * 0);
|
|
332
|
+
return `rgb(${R},${z},${N})`;
|
|
333
|
+
}, y = 32, w = [], S = [], I = [], P = [], u = o > 0.01 ? -Math.PI / 2 : 0, g = o > 0.01 ? Math.PI / 2 : Math.PI * 2, C = o < -0.01 ? -Math.PI / 2 : 0, M = o < -0.01 ? Math.PI / 2 : Math.PI * 2;
|
|
334
|
+
for (let d = 0; d <= y; d++) {
|
|
335
|
+
const c = d / y, b = u + c * (g - u), T = Math.sin(b) * a, m = Math.cos(b) * a, R = -r / 2, [z, N, L] = oe(T, R, m, o, 0, i), W = f(z, N, L);
|
|
336
|
+
w.push(W), p = Math.min(p, L), v = Math.max(v, L);
|
|
337
|
+
}
|
|
338
|
+
for (let d = 0; d <= y; d++) {
|
|
339
|
+
const c = d / y, b = C + c * (M - C), T = Math.sin(b) * a, m = Math.cos(b) * a, R = r / 2, [z, N, L] = oe(T, R, m, o, 0, i), W = f(z, N, L);
|
|
340
|
+
S.push(W), p = Math.min(p, L), v = Math.max(v, L);
|
|
341
|
+
}
|
|
342
|
+
for (let d = 0; d <= 10; d++) {
|
|
343
|
+
const c = d / 10, b = -r / 2 + c * r, [T, m, R] = oe(-a, b, 0, o, 0, i);
|
|
344
|
+
I.push(f(T, m, R)), p = Math.min(p, R), v = Math.max(v, R);
|
|
345
|
+
const [z, N, L] = oe(a, b, 0, o, 0, i);
|
|
346
|
+
P.push(f(z, N, L)), p = Math.min(p, L), v = Math.max(v, L);
|
|
347
|
+
}
|
|
348
|
+
const l = (d) => {
|
|
349
|
+
for (let c = 0; c < d.length - 1; c++) {
|
|
350
|
+
const b = d[c], T = d[c + 1], m = (b.z + T.z) / 2;
|
|
351
|
+
_.strokeStyle = x(m, p, v), _.beginPath(), _.moveTo(b.x, b.y), _.lineTo(T.x, T.y), _.stroke();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
function
|
|
357
|
-
const { diameter:
|
|
358
|
-
let
|
|
359
|
-
minX: -
|
|
360
|
-
minY: -
|
|
361
|
-
maxX:
|
|
362
|
-
maxY:
|
|
354
|
+
l(w), l(S), l(I), l(P), _.restore();
|
|
355
|
+
}
|
|
356
|
+
function Vt(s, n, t, a, r, o, i, h, _, k) {
|
|
357
|
+
const { diameter: p, perspective: v, rotationX: f, rotationZ: x } = i, y = p / 2, w = f * Math.PI / 180, S = x * Math.PI / 180, I = Math.abs(w) > 1e-3, P = v ?? 1, u = P > 0.01 ? y * (10 / P) : y * 1e3, g = h.scale, C = h.translateX, M = h.translateY;
|
|
358
|
+
let l = {
|
|
359
|
+
minX: -y,
|
|
360
|
+
minY: -o / 2,
|
|
361
|
+
maxX: y,
|
|
362
|
+
maxY: o / 2
|
|
363
363
|
};
|
|
364
|
-
if (
|
|
365
|
-
const
|
|
366
|
-
{ x: -
|
|
367
|
-
{ x:
|
|
368
|
-
{ x:
|
|
369
|
-
{ x: -
|
|
370
|
-
],
|
|
371
|
-
for (const
|
|
372
|
-
const [
|
|
373
|
-
|
|
374
|
-
const [
|
|
375
|
-
|
|
364
|
+
if (I) {
|
|
365
|
+
const b = [
|
|
366
|
+
{ x: -y, y: -o / 2 },
|
|
367
|
+
{ x: y, y: -o / 2 },
|
|
368
|
+
{ x: y, y: o / 2 },
|
|
369
|
+
{ x: -y, y: o / 2 }
|
|
370
|
+
], T = [];
|
|
371
|
+
for (const R of b) {
|
|
372
|
+
const [z, N, L] = oe(R.x, R.y, y, w, 0, S), W = u / (u + L);
|
|
373
|
+
T.push({ x: z * W, y: N * W });
|
|
374
|
+
const [E, Y, U] = oe(R.x, R.y, 0, w, 0, S), q = u / (u + U);
|
|
375
|
+
T.push({ x: E * q, y: Y * q });
|
|
376
376
|
}
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
minX: Math.min(...
|
|
380
|
-
minY: Math.min(...
|
|
381
|
-
maxX: Math.max(...
|
|
382
|
-
maxY: Math.max(...
|
|
377
|
+
const m = y * Math.abs(Math.sin(w));
|
|
378
|
+
T.length > 0 && (l = {
|
|
379
|
+
minX: Math.min(...T.map((R) => R.x)) - 2,
|
|
380
|
+
minY: Math.min(...T.map((R) => R.y)) - m - 2,
|
|
381
|
+
maxX: Math.max(...T.map((R) => R.x)) + 2,
|
|
382
|
+
maxY: Math.max(...T.map((R) => R.y)) + m + 2
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
-
const
|
|
386
|
-
const
|
|
387
|
-
if (Math.abs(
|
|
388
|
-
const
|
|
389
|
-
if (Math.abs(
|
|
390
|
-
const
|
|
385
|
+
const d = (b, T) => {
|
|
386
|
+
const m = Math.cos(S), R = Math.sin(S), z = b * m + T * R, N = -b * R + T * m, L = Math.cos(w), W = Math.sin(w), E = N * W, Y = u / (u + E), U = z / Y, q = N / Y;
|
|
387
|
+
if (Math.abs(U) > y) return null;
|
|
388
|
+
const J = Math.sqrt(y * y - U * U);
|
|
389
|
+
if (Math.abs(L) < 0.01) return null;
|
|
390
|
+
const A = (q + J * W) / L, G = A * W + J * L;
|
|
391
391
|
if (G < 0) return null;
|
|
392
|
-
const
|
|
393
|
-
return
|
|
394
|
-
},
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
function
|
|
398
|
-
const { rotationX:
|
|
399
|
-
const [
|
|
400
|
-
if (
|
|
401
|
-
const q =
|
|
402
|
-
return { x:
|
|
392
|
+
const O = Math.asin(U / y) * y / r + 0.5, D = A / o + 0.5, K = (O - 0.5 - C) / g + 0.5, H = (D - 0.5 - M) / g + 0.5;
|
|
393
|
+
return K >= 0 && K <= 1 && H >= 0 && H <= 1 ? { u: K * n.width, v: H * n.height, z: G } : null;
|
|
394
|
+
}, c = k.showDepthVis ? { showDepthVis: !0, maxZ: y } : void 0;
|
|
395
|
+
k.showBounds && Ut(s, t, a, y, o, w, S, u), Ve(s, n, t, a, r, o, _, d, l, c), k.showCrosshair && Ae(s, t, a);
|
|
396
|
+
}
|
|
397
|
+
function At(s, n, t, a, r, o, i, h, _, k) {
|
|
398
|
+
const { rotationX: p, rotationY: v, rotationZ: f, depthScale: x } = i, y = p * (Math.PI / 180), w = v * (Math.PI / 180), S = f * (Math.PI / 180), I = Math.abs(y) > 1e-3 || Math.abs(w) > 1e-3 || Math.abs(S) > 1e-3, P = h.scale, u = h.translateX, g = h.translateY, C = x * 1e-3, M = C > 1e-4 ? 1 / C : 1e4, l = (N, L) => {
|
|
399
|
+
const [W, E, Y] = oe(N, L, 0, y, w, S), U = Y + M;
|
|
400
|
+
if (U <= 0) return null;
|
|
401
|
+
const q = M / U, J = W * q, A = E * q;
|
|
402
|
+
return { x: J, y: A, z: Y };
|
|
403
403
|
};
|
|
404
|
-
let
|
|
405
|
-
if (
|
|
406
|
-
const
|
|
407
|
-
for (let
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
const q =
|
|
411
|
-
q &&
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
const G =
|
|
415
|
-
G &&
|
|
404
|
+
let d = -r / 2, c = r / 2, b = -o / 2, T = o / 2;
|
|
405
|
+
if (I) {
|
|
406
|
+
const N = [];
|
|
407
|
+
for (let W = 0; W <= 10; W++) {
|
|
408
|
+
const E = W / 10, Y = -r / 2 + E * r, U = l(Y, -o / 2);
|
|
409
|
+
U && N.push({ x: U.x, y: U.y });
|
|
410
|
+
const q = l(Y, o / 2);
|
|
411
|
+
q && N.push({ x: q.x, y: q.y });
|
|
412
|
+
const J = -o / 2 + E * o, A = l(-r / 2, J);
|
|
413
|
+
A && N.push({ x: A.x, y: A.y });
|
|
414
|
+
const G = l(r / 2, J);
|
|
415
|
+
G && N.push({ x: G.x, y: G.y });
|
|
416
416
|
}
|
|
417
|
-
if (
|
|
418
|
-
|
|
419
|
-
const
|
|
420
|
-
|
|
417
|
+
if (N.length > 0) {
|
|
418
|
+
d = Math.min(...N.map((q) => q.x)), c = Math.max(...N.map((q) => q.x)), b = Math.min(...N.map((q) => q.y)), T = Math.max(...N.map((q) => q.y));
|
|
419
|
+
const W = Math.sqrt(y * y + w * w + S * S), E = 2, Y = W * Math.max(r, o) * 0.1, U = E + Y;
|
|
420
|
+
d -= U, c += U, b -= U, T += U;
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
const
|
|
424
|
-
if (!
|
|
425
|
-
const
|
|
426
|
-
return
|
|
427
|
-
u:
|
|
428
|
-
v: ye *
|
|
423
|
+
const m = { minX: d, minY: b, maxX: c, maxY: T }, R = (N, L) => {
|
|
424
|
+
if (!I) {
|
|
425
|
+
const Ie = N / r + 0.5, We = L / o + 0.5, me = (Ie - 0.5 - u) / P + 0.5, ye = (We - 0.5 - g) / P + 0.5;
|
|
426
|
+
return me >= 0 && me <= 1 && ye >= 0 && ye <= 1 ? {
|
|
427
|
+
u: me * n.width,
|
|
428
|
+
v: ye * n.height,
|
|
429
429
|
z: 1
|
|
430
430
|
} : null;
|
|
431
431
|
}
|
|
432
|
-
const [
|
|
432
|
+
const [W, E, Y] = oe(0, 0, 1, y, w, S), U = 0, q = 0, J = 0, A = -M, G = N - q, Z = L - J, B = 0 - A, O = Math.sqrt(G * G + Z * Z + B * B), D = G / O, K = Z / O, H = B / O, de = D * W + K * E + H * Y;
|
|
433
433
|
if (Math.abs(de) < 1e-4)
|
|
434
434
|
return null;
|
|
435
|
-
const ie = -(q *
|
|
435
|
+
const ie = -(q * W + J * E + A * Y + U) / de;
|
|
436
436
|
if (ie < 0)
|
|
437
437
|
return null;
|
|
438
|
-
const he = q +
|
|
439
|
-
if (le <
|
|
438
|
+
const he = q + D * ie, ge = J + K * ie, le = A + H * ie;
|
|
439
|
+
if (le < A)
|
|
440
440
|
return null;
|
|
441
|
-
const [be, Re] =
|
|
442
|
-
return _e >= 0 && _e <= 1 &&
|
|
443
|
-
u: _e *
|
|
444
|
-
v:
|
|
445
|
-
z:
|
|
441
|
+
const [be, Re] = Bt(he, ge, le, y, w, S), Se = be / r + 0.5, ue = Re / o + 0.5, ze = le + M, _e = (Se - 0.5 - u) / P + 0.5, pe = (ue - 0.5 - g) / P + 0.5;
|
|
442
|
+
return _e >= 0 && _e <= 1 && pe >= 0 && pe <= 1 ? {
|
|
443
|
+
u: _e * n.width,
|
|
444
|
+
v: pe * n.height,
|
|
445
|
+
z: ze
|
|
446
446
|
} : null;
|
|
447
|
-
},
|
|
448
|
-
|
|
449
|
-
}
|
|
450
|
-
function
|
|
451
|
-
if (!("save" in
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
function
|
|
461
|
-
const { radius:
|
|
462
|
-
minX: -
|
|
463
|
-
minY: -
|
|
464
|
-
maxX:
|
|
465
|
-
maxY:
|
|
466
|
-
},
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
const
|
|
470
|
-
return
|
|
471
|
-
u:
|
|
472
|
-
v:
|
|
473
|
-
z:
|
|
447
|
+
}, z = k.showDepthVis ? { showDepthVis: !0, maxZ: M * 0.5 } : void 0;
|
|
448
|
+
k.showBounds && qt(s, t, a, r, o, l), Ve(s, n, t, a, r, o, _, R, m, z), k.showCrosshair && Ae(s, t, a);
|
|
449
|
+
}
|
|
450
|
+
function Ft(s, n, t, a, r) {
|
|
451
|
+
if (!("save" in s)) return;
|
|
452
|
+
const o = s;
|
|
453
|
+
if (o.save(), o.strokeStyle = "#ff6600", o.lineWidth = 2, o.setLineDash([6, 4]), o.beginPath(), o.arc(n, t, a, 0, Math.PI * 2), o.stroke(), o.beginPath(), o.moveTo(n - a, t), o.lineTo(n + a, t), o.stroke(), o.beginPath(), o.moveTo(n, t - a), o.lineTo(n, t + a), o.stroke(), o.beginPath(), o.moveTo(n - a, t - a), o.lineTo(n - a, t + a), o.stroke(), o.beginPath(), o.moveTo(n + a, t - a), o.lineTo(n + a, t + a), o.stroke(), Math.abs(r) > 1e-3) {
|
|
454
|
+
o.strokeStyle = "#ffaa00";
|
|
455
|
+
const i = Math.cos(r), h = Math.sin(r), _ = a * 0.7;
|
|
456
|
+
o.beginPath(), o.moveTo(n + i * _, t + h * _), o.lineTo(n - i * _, t - h * _), o.stroke(), o.beginPath(), o.moveTo(n - h * _, t + i * _), o.lineTo(n + h * _, t - i * _), o.stroke();
|
|
457
|
+
}
|
|
458
|
+
o.restore();
|
|
459
|
+
}
|
|
460
|
+
function Ht(s, n, t, a, r, o, i, h, _, k) {
|
|
461
|
+
const { radius: p, rotationZ: v } = i, f = v * (Math.PI / 180), x = h.scale, y = h.translateX, w = h.translateY, S = {
|
|
462
|
+
minX: -p,
|
|
463
|
+
minY: -p,
|
|
464
|
+
maxX: p,
|
|
465
|
+
maxY: p
|
|
466
|
+
}, I = (u, g) => {
|
|
467
|
+
const C = Math.sqrt(u * u + g * g);
|
|
468
|
+
if (C > p) return null;
|
|
469
|
+
const M = Math.sqrt(p * p - u * u - g * g), d = Math.asin(C / p) * p, c = Math.atan2(g, u) - f, b = d * Math.cos(c), T = d * Math.sin(c), m = b / r + 0.5, R = T / o + 0.5, z = (m - 0.5 - y) / x + 0.5, N = (R - 0.5 - w) / x + 0.5;
|
|
470
|
+
return z >= 0 && z <= 1 && N >= 0 && N <= 1 ? {
|
|
471
|
+
u: z * n.width,
|
|
472
|
+
v: N * n.height,
|
|
473
|
+
z: M
|
|
474
474
|
} : null;
|
|
475
|
-
},
|
|
476
|
-
|
|
475
|
+
}, P = k.showDepthVis ? { showDepthVis: !0, maxZ: p } : void 0;
|
|
476
|
+
k.showBounds && Ft(s, t, a, p, f), Ve(s, n, t, a, r, o, _, I, S, P), k.showCrosshair && Ae(s, t, a);
|
|
477
477
|
}
|
|
478
|
-
function
|
|
479
|
-
|
|
478
|
+
function Kt(s, n, t, a, r, o, i) {
|
|
479
|
+
s.drawImage(n, t - r / 2, a - o / 2, r, o);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
if (!
|
|
483
|
-
|
|
481
|
+
function Jt(s, n, t, a, r, o, i) {
|
|
482
|
+
if (!i.enabled || i.shape === "none") {
|
|
483
|
+
s.drawImage(n, t - r / 2, a - o / 2, r, o);
|
|
484
484
|
return;
|
|
485
485
|
}
|
|
486
|
-
const
|
|
487
|
-
switch (
|
|
486
|
+
const h = i.quality ?? 1, _ = i.image ?? se, k = i.debug ?? fe;
|
|
487
|
+
switch (i.shape) {
|
|
488
488
|
case "cylinder":
|
|
489
|
-
|
|
489
|
+
i.cylinder && Vt(s, n, t, a, r, o, i.cylinder, _, h, k);
|
|
490
490
|
break;
|
|
491
491
|
case "plane":
|
|
492
|
-
|
|
492
|
+
i.plane && At(s, n, t, a, r, o, i.plane, _, h, k);
|
|
493
493
|
break;
|
|
494
494
|
case "sphere":
|
|
495
|
-
|
|
495
|
+
i.sphere && Ht(s, n, t, a, r, o, i.sphere, _, h, k);
|
|
496
496
|
break;
|
|
497
497
|
case "custom":
|
|
498
|
-
|
|
498
|
+
i.custom && Kt(s, n, t, a, r, o, i.custom);
|
|
499
499
|
break;
|
|
500
500
|
default:
|
|
501
|
-
|
|
501
|
+
s.drawImage(n, t - r / 2, a - o / 2, r, o);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
function Gt(s) {
|
|
505
|
+
let n = s;
|
|
506
|
+
for (; n; ) {
|
|
507
|
+
const t = n.getAttribute("fill");
|
|
508
|
+
if (t) return t;
|
|
509
|
+
n = n.parentElement;
|
|
510
|
+
}
|
|
511
|
+
return null;
|
|
512
|
+
}
|
|
513
|
+
function $t(s, n) {
|
|
514
|
+
const a = new DOMParser().parseFromString(s, "image/svg+xml"), r = a.querySelector("svg");
|
|
515
|
+
return r ? (r.querySelectorAll("path, polygon, polyline, circle, ellipse, rect, line").forEach((i) => {
|
|
516
|
+
n.strokeColor !== void 0 && i.setAttribute("stroke", n.strokeColor), n.strokeWidth !== void 0 && i.setAttribute("stroke-width", n.strokeWidth.toString()), n.fillColor !== void 0 && Gt(i) !== "none" && i.setAttribute("fill", n.fillColor);
|
|
517
|
+
}), new XMLSerializer().serializeToString(a)) : s;
|
|
518
|
+
}
|
|
519
|
+
async function Qt(s) {
|
|
520
|
+
try {
|
|
521
|
+
if (s.startsWith("data:image/svg+xml")) {
|
|
522
|
+
const n = s.indexOf(",");
|
|
523
|
+
if (n === -1) return null;
|
|
524
|
+
const t = s.substring(n + 1);
|
|
525
|
+
if (s.substring(0, n).includes(";base64"))
|
|
526
|
+
try {
|
|
527
|
+
return atob(t);
|
|
528
|
+
} catch {
|
|
529
|
+
return null;
|
|
530
|
+
}
|
|
531
|
+
else
|
|
532
|
+
try {
|
|
533
|
+
return decodeURIComponent(t);
|
|
534
|
+
} catch {
|
|
535
|
+
try {
|
|
536
|
+
return atob(t);
|
|
537
|
+
} catch {
|
|
538
|
+
return null;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
} else {
|
|
542
|
+
if (s.startsWith("data:"))
|
|
543
|
+
return null;
|
|
544
|
+
{
|
|
545
|
+
const n = await fetch(s), t = n.headers.get("content-type");
|
|
546
|
+
return t && t.includes("image/svg+xml") ? await n.text() : await n.text();
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
} catch {
|
|
550
|
+
return null;
|
|
502
551
|
}
|
|
503
552
|
}
|
|
553
|
+
function en(s) {
|
|
554
|
+
const n = s.trim();
|
|
555
|
+
if (n.startsWith("<svg") || n.startsWith("<?xml"))
|
|
556
|
+
try {
|
|
557
|
+
return new DOMParser().parseFromString(s, "image/svg+xml").querySelector("svg") !== null;
|
|
558
|
+
} catch {
|
|
559
|
+
return !1;
|
|
560
|
+
}
|
|
561
|
+
return !1;
|
|
562
|
+
}
|
|
563
|
+
async function st(s) {
|
|
564
|
+
const n = await Qt(s);
|
|
565
|
+
return n ? en(n) : !1;
|
|
566
|
+
}
|
|
504
567
|
const ee = {
|
|
505
568
|
type: "restyle",
|
|
506
569
|
brightness: 0,
|
|
@@ -514,56 +577,61 @@ const ee = {
|
|
|
514
577
|
vibrance: 0,
|
|
515
578
|
temperature: 0,
|
|
516
579
|
tint: 0
|
|
517
|
-
},
|
|
580
|
+
}, ve = {
|
|
518
581
|
type: "resize",
|
|
519
582
|
mode: "scale",
|
|
520
583
|
scale: 1,
|
|
521
584
|
maintainAspectRatio: !0
|
|
585
|
+
}, Pe = {
|
|
586
|
+
type: "svg",
|
|
587
|
+
strokeWidth: 0,
|
|
588
|
+
strokeColor: "#000000",
|
|
589
|
+
fillColor: void 0
|
|
522
590
|
};
|
|
523
|
-
function
|
|
524
|
-
let t =
|
|
525
|
-
const
|
|
526
|
-
for (const
|
|
527
|
-
switch (
|
|
591
|
+
function tt(s, n) {
|
|
592
|
+
let t = s, a = s.width, r = s.height;
|
|
593
|
+
const o = tn(n);
|
|
594
|
+
for (const i of o)
|
|
595
|
+
switch (i.type) {
|
|
528
596
|
case "resize":
|
|
529
|
-
const
|
|
530
|
-
a =
|
|
597
|
+
const h = Lt(a, r, i);
|
|
598
|
+
a = h.width, r = h.height;
|
|
531
599
|
break;
|
|
532
600
|
case "restyle":
|
|
533
|
-
t =
|
|
601
|
+
t = nn(t, i);
|
|
534
602
|
break;
|
|
535
603
|
}
|
|
536
604
|
return {
|
|
537
605
|
image: t,
|
|
538
606
|
width: a,
|
|
539
|
-
height:
|
|
607
|
+
height: r
|
|
540
608
|
};
|
|
541
609
|
}
|
|
542
|
-
function
|
|
543
|
-
const
|
|
544
|
-
return
|
|
545
|
-
const
|
|
546
|
-
return
|
|
610
|
+
function tn(s) {
|
|
611
|
+
const n = ["svg", "resize", "restyle", "warp"];
|
|
612
|
+
return s.sort((t, a) => {
|
|
613
|
+
const r = n.indexOf(t.type), o = n.indexOf(a.type);
|
|
614
|
+
return r - o;
|
|
547
615
|
});
|
|
548
616
|
}
|
|
549
|
-
function
|
|
550
|
-
const t = new OffscreenCanvas(
|
|
551
|
-
if (!a) return
|
|
552
|
-
a.drawImage(
|
|
553
|
-
const
|
|
554
|
-
return a.putImageData(
|
|
617
|
+
function nn(s, n) {
|
|
618
|
+
const t = new OffscreenCanvas(s.width, s.height), a = t.getContext("2d");
|
|
619
|
+
if (!a) return s;
|
|
620
|
+
a.drawImage(s, 0, 0);
|
|
621
|
+
const r = a.getImageData(0, 0, s.width, s.height), o = jt(r, n);
|
|
622
|
+
return a.putImageData(o, 0, 0), t.transferToImageBitmap();
|
|
555
623
|
}
|
|
556
|
-
class
|
|
624
|
+
class ot {
|
|
557
625
|
latestInput = null;
|
|
558
626
|
rafPending = !1;
|
|
559
627
|
timeoutId = null;
|
|
560
628
|
onFlush;
|
|
561
629
|
TRAILING_MS = 32;
|
|
562
|
-
constructor(
|
|
563
|
-
this.onFlush =
|
|
630
|
+
constructor(n) {
|
|
631
|
+
this.onFlush = n;
|
|
564
632
|
}
|
|
565
|
-
queue(
|
|
566
|
-
this.latestInput =
|
|
633
|
+
queue(n) {
|
|
634
|
+
this.latestInput = n, this.timeoutId !== null && clearTimeout(this.timeoutId), this.rafPending || (this.rafPending = !0, requestAnimationFrame(() => {
|
|
567
635
|
this.rafPending = !1, this.flush();
|
|
568
636
|
})), this.timeoutId = setTimeout(() => {
|
|
569
637
|
this.timeoutId = null, this.flush();
|
|
@@ -572,34 +640,34 @@ class at {
|
|
|
572
640
|
flush() {
|
|
573
641
|
if (this.latestInput === null) return;
|
|
574
642
|
this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
|
|
575
|
-
const
|
|
576
|
-
this.latestInput = null, this.onFlush(
|
|
643
|
+
const n = this.latestInput;
|
|
644
|
+
this.latestInput = null, this.onFlush(n);
|
|
577
645
|
}
|
|
578
646
|
destroy() {
|
|
579
647
|
this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null), this.latestInput = null;
|
|
580
648
|
}
|
|
581
649
|
}
|
|
582
|
-
const
|
|
583
|
-
function
|
|
584
|
-
let
|
|
650
|
+
const it = '(function(){"use strict";const ot={scale:1,translateX:0,translateY:0},at={showBounds:!1,showDepthVis:!1,showCrosshair:!1};({...ot});function et(c){const n=new OffscreenCanvas(c.width,c.height).getContext("2d");if(!n)throw new Error("Failed to create canvas context");return n.drawImage(c,0,0),n.getImageData(0,0,c.width,c.height)}function ct(c,e,n){const s=c.width,o=c.height,t=c.data;if(e<0||e>=s||n<0||n>=o)return null;const a=Math.floor(e),u=Math.floor(n),r=Math.min(a+1,s-1),M=Math.min(u+1,o-1),l=e-a,m=n-u,f=(Y,z)=>{const d=(z*s+Y)*4;return{r:t[d],g:t[d+1],b:t[d+2],a:t[d+3]}},g=f(a,u),i=f(r,u),p=f(a,M),h=f(r,M),S=(Y,z,d)=>Y+(z-Y)*d,X=S(S(g.r,i.r,l),S(p.r,h.r,l),m),v=S(S(g.g,i.g,l),S(p.g,h.g,l),m),V=S(S(g.b,i.b,l),S(p.b,h.b,l),m),B=S(S(g.a,i.a,l),S(p.a,h.a,l),m);return{r:X,g:v,b:V,a:B}}function J(c,e,n,s,o,t,a,u,r,M){const l=et(e),m=M?.showDepthVis??!1,f=M?.maxZ??500,g=r??{minX:-o/2,minY:-t/2,maxX:o/2,maxY:t/2},i=g.maxX-g.minX,p=g.maxY-g.minY,h=Math.floor(i*a),S=Math.floor(p*a);if(h<=0||S<=0)return;const X=new ImageData(h,S),v=X.data;for(let d=0;d<S;d++)for(let P=0;P<h;P++){const T=g.minX+P/a,b=g.minY+d/a,I=u(T,b);if(!I||I.z<=0)continue;const y=(d*h+P)*4;if(m){const Z=Math.min(1,Math.max(0,I.z/f)),x=Math.floor(Z*200+55);v[y]=Math.floor(x*.3),v[y+1]=Math.floor(x*.6),v[y+2]=x,v[y+3]=200}else{const{u:Z,v:x}=I,w=ct(l,Z,x);w&&(v[y]=Math.round(w.r),v[y+1]=Math.round(w.g),v[y+2]=Math.round(w.b),v[y+3]=Math.round(w.a))}}const V=new OffscreenCanvas(h,S),B=V.getContext("2d");if(!B)return;B.putImageData(X,0,0);const Y=n+g.minX,z=s+g.minY;a!==1?c.drawImage(V,Y,z,i,p):c.drawImage(V,Y,z)}function K(c,e,n,s=20){if(!("save"in c))return;const o=c;o.save(),o.strokeStyle="#00ff00",o.lineWidth=2,o.beginPath(),o.moveTo(e-s,n),o.lineTo(e+s,n),o.stroke(),o.beginPath(),o.moveTo(e,n-s),o.lineTo(e,n+s),o.stroke(),o.fillStyle="#00ff00",o.beginPath(),o.arc(e,n,3,0,Math.PI*2),o.fill(),o.restore()}function U(c,e,n,s,o,t){const a=Math.cos(s),u=Math.sin(s),r=Math.cos(o),M=Math.sin(o),l=Math.cos(t),m=Math.sin(t);let f=c,g=e,i=n;if(t!==0){const p=f,h=g;f=p*l-h*m,g=p*m+h*l}if(o!==0){const p=f,h=i;f=p*r+h*M,i=-p*M+h*r}if(s!==0){const p=g,h=i;g=p*a-h*u,i=p*u+h*a}return[f,g,i]}function it(c,e,n,s,o,t){const a=Math.cos(s),u=Math.sin(s),r=Math.cos(o),M=Math.sin(o),l=Math.cos(t),m=Math.sin(t);let f=c,g=e,i=n;if(s!==0){const p=g,h=i;g=p*a+h*u,i=-p*u+h*a}if(o!==0){const p=f,h=i;f=p*r-h*M,i=p*M+h*r}if(t!==0){const p=f,h=g;f=p*l+h*m,g=-p*m+h*l}return[f,g,i]}function rt(c,e,n,s,o,t){if(!("save"in c))return;const a=c;a.save(),a.strokeStyle="#ff6600",a.lineWidth=1.5,a.setLineDash([4,6]);const u=50,r=3;for(let M=-r;M<=r;M++){const l=M*u,m=[];for(let f=-10;f<=10;f++){const g=f*u,i=t(l,g);i&&m.push({x:e+i.x,y:n+i.y})}if(m.length>1){a.beginPath(),a.moveTo(m[0].x,m[0].y);for(let f=1;f<m.length;f++)a.lineTo(m[f].x,m[f].y);a.stroke()}}for(let M=-r;M<=r;M++){const l=M*u,m=[];for(let f=-10;f<=10;f++){const g=f*u,i=t(g,l);i&&m.push({x:e+i.x,y:n+i.y})}if(m.length>1){a.beginPath(),a.moveTo(m[0].x,m[0].y);for(let f=1;f<m.length;f++)a.lineTo(m[f].x,m[f].y);a.stroke()}}a.restore()}function lt(c,e,n,s,o,t,a,u){if(!("save"in c))return;const r=c;r.save(),r.lineWidth=2,r.setLineDash([6,4]);const M=Math.sin(t);let l=1/0,m=-1/0;const f=(d,P,T)=>{const b=P*M,I=u/(u+b);return{x:e+d*I,y:n+P*I,z:T}},g=(d,P,T)=>{const b=T-P;if(b<.001)return"#ff6600";const I=(d-P)/b,y=Math.round(100+I*155),Z=Math.round(30+I*70),x=Math.round(0+I*0);return`rgb(${y},${Z},${x})`},i=32,p=[],h=[],S=[],X=[],v=t>.01?-Math.PI/2:0,V=t>.01?Math.PI/2:Math.PI*2,B=t<-.01?-Math.PI/2:0,Y=t<-.01?Math.PI/2:Math.PI*2;for(let d=0;d<=i;d++){const P=d/i,T=v+P*(V-v),b=Math.sin(T)*s,I=Math.cos(T)*s,y=-o/2,[Z,x,w]=U(b,y,I,t,0,a),k=f(Z,x,w);p.push(k),l=Math.min(l,w),m=Math.max(m,w)}for(let d=0;d<=i;d++){const P=d/i,T=B+P*(Y-B),b=Math.sin(T)*s,I=Math.cos(T)*s,y=o/2,[Z,x,w]=U(b,y,I,t,0,a),k=f(Z,x,w);h.push(k),l=Math.min(l,w),m=Math.max(m,w)}for(let d=0;d<=10;d++){const P=d/10,T=-o/2+P*o,[b,I,y]=U(-s,T,0,t,0,a);S.push(f(b,I,y)),l=Math.min(l,y),m=Math.max(m,y);const[Z,x,w]=U(s,T,0,t,0,a);X.push(f(Z,x,w)),l=Math.min(l,w),m=Math.max(m,w)}const z=d=>{for(let P=0;P<d.length-1;P++){const T=d[P],b=d[P+1],I=(T.z+b.z)/2;r.strokeStyle=g(I,l,m),r.beginPath(),r.moveTo(T.x,T.y),r.lineTo(b.x,b.y),r.stroke()}};z(p),z(h),z(S),z(X),r.restore()}function ft(c,e,n,s,o,t,a,u,r,M){const{diameter:l,perspective:m,rotationX:f,rotationZ:g}=a,i=l/2,p=f*Math.PI/180,h=g*Math.PI/180,S=Math.abs(p)>.001,X=m??1,v=X>.01?i*(10/X):i*1e3,V=u.scale,B=u.translateX,Y=u.translateY;let z={minX:-i,minY:-t/2,maxX:i,maxY:t/2};if(S){const T=[{x:-i,y:-t/2},{x:i,y:-t/2},{x:i,y:t/2},{x:-i,y:t/2}],b=[];for(const y of T){const[Z,x,w]=U(y.x,y.y,i,p,0,h),k=v/(v+w);b.push({x:Z*k,y:x*k});const[j,W,C]=U(y.x,y.y,0,p,0,h),D=v/(v+C);b.push({x:j*D,y:W*D})}const I=i*Math.abs(Math.sin(p));b.length>0&&(z={minX:Math.min(...b.map(y=>y.x))-2,minY:Math.min(...b.map(y=>y.y))-I-2,maxX:Math.max(...b.map(y=>y.x))+2,maxY:Math.max(...b.map(y=>y.y))+I+2})}const d=(T,b)=>{const I=Math.cos(h),y=Math.sin(h),Z=T*I+b*y,x=-T*y+b*I,w=Math.cos(p),k=Math.sin(p),j=x*k,W=v/(v+j),C=Z/W,D=x/W;if(Math.abs(C)>i)return null;const E=Math.sqrt(i*i-C*C);if(Math.abs(w)<.01)return null;const L=(D+E*k)/w,O=L*k+E*w;if(O<0)return null;const F=Math.asin(C/i)*i/o+.5,$=L/t+.5,q=(F-.5-B)/V+.5,A=($-.5-Y)/V+.5;return q>=0&&q<=1&&A>=0&&A<=1?{u:q*e.width,v:A*e.height,z:O}:null},P=M.showDepthVis?{showDepthVis:!0,maxZ:i}:void 0;M.showBounds&<(c,n,s,i,t,p,h,v),J(c,e,n,s,o,t,r,d,z,P),M.showCrosshair&&K(c,n,s)}function ht(c,e,n,s,o,t,a,u,r,M){const{rotationX:l,rotationY:m,rotationZ:f,depthScale:g}=a,i=l*(Math.PI/180),p=m*(Math.PI/180),h=f*(Math.PI/180),S=Math.abs(i)>.001||Math.abs(p)>.001||Math.abs(h)>.001,X=u.scale,v=u.translateX,V=u.translateY,B=g*.001,Y=B>1e-4?1/B:1e4,z=(x,w)=>{const[k,j,W]=U(x,w,0,i,p,h),C=W+Y;if(C<=0)return null;const D=Y/C,E=k*D,L=j*D;return{x:E,y:L,z:W}};let d=-o/2,P=o/2,T=-t/2,b=t/2;if(S){const x=[];for(let k=0;k<=10;k++){const j=k/10,W=-o/2+j*o,C=z(W,-t/2);C&&x.push({x:C.x,y:C.y});const D=z(W,t/2);D&&x.push({x:D.x,y:D.y});const E=-t/2+j*t,L=z(-o/2,E);L&&x.push({x:L.x,y:L.y});const O=z(o/2,E);O&&x.push({x:O.x,y:O.y})}if(x.length>0){d=Math.min(...x.map(D=>D.x)),P=Math.max(...x.map(D=>D.x)),T=Math.min(...x.map(D=>D.y)),b=Math.max(...x.map(D=>D.y));const k=Math.sqrt(i*i+p*p+h*h),j=2,W=k*Math.max(o,t)*.1,C=j+W;d-=C,P+=C,T-=C,b+=C}}const I={minX:d,minY:T,maxX:P,maxY:b},y=(x,w)=>{if(!S){const wt=x/o+.5,St=w/t+.5,tt=(wt-.5-v)/X+.5,nt=(St-.5-V)/X+.5;return tt>=0&&tt<=1&&nt>=0&&nt<=1?{u:tt*e.width,v:nt*e.height,z:1}:null}const[k,j,W]=U(0,0,1,i,p,h),C=0,D=0,E=0,L=-Y,O=x-D,R=w-E,H=0-L,F=Math.sqrt(O*O+R*R+H*H),$=O/F,q=R/F,A=H/F,st=$*k+q*j+A*W;if(Math.abs(st)<1e-4)return null;const G=-(D*k+E*j+L*W+C)/st;if(G<0)return null;const yt=D+$*G,xt=E+q*G,N=L+A*G;if(N<L)return null;const[bt,vt]=it(yt,xt,N,i,p,h),Pt=bt/o+.5,Tt=vt/t+.5,It=N+Y,Q=(Pt-.5-v)/X+.5,_=(Tt-.5-V)/X+.5;return Q>=0&&Q<=1&&_>=0&&_<=1?{u:Q*e.width,v:_*e.height,z:It}:null},Z=M.showDepthVis?{showDepthVis:!0,maxZ:Y*.5}:void 0;M.showBounds&&rt(c,n,s,o,t,z),J(c,e,n,s,o,t,r,y,I,Z),M.showCrosshair&&K(c,n,s)}function pt(c,e,n,s,o){if(!("save"in c))return;const t=c;if(t.save(),t.strokeStyle="#ff6600",t.lineWidth=2,t.setLineDash([6,4]),t.beginPath(),t.arc(e,n,s,0,Math.PI*2),t.stroke(),t.beginPath(),t.moveTo(e-s,n),t.lineTo(e+s,n),t.stroke(),t.beginPath(),t.moveTo(e,n-s),t.lineTo(e,n+s),t.stroke(),t.beginPath(),t.moveTo(e-s,n-s),t.lineTo(e-s,n+s),t.stroke(),t.beginPath(),t.moveTo(e+s,n-s),t.lineTo(e+s,n+s),t.stroke(),Math.abs(o)>.001){t.strokeStyle="#ffaa00";const a=Math.cos(o),u=Math.sin(o),r=s*.7;t.beginPath(),t.moveTo(e+a*r,n+u*r),t.lineTo(e-a*r,n-u*r),t.stroke(),t.beginPath(),t.moveTo(e-u*r,n+a*r),t.lineTo(e+u*r,n-a*r),t.stroke()}t.restore()}function mt(c,e,n,s,o,t,a,u,r,M){const{radius:l,rotationZ:m}=a,f=m*(Math.PI/180),g=u.scale,i=u.translateX,p=u.translateY,h={minX:-l,minY:-l,maxX:l,maxY:l},S=(v,V)=>{const B=Math.sqrt(v*v+V*V);if(B>l)return null;const Y=Math.sqrt(l*l-v*v-V*V),d=Math.asin(B/l)*l,P=Math.atan2(V,v)-f,T=d*Math.cos(P),b=d*Math.sin(P),I=T/o+.5,y=b/t+.5,Z=(I-.5-i)/g+.5,x=(y-.5-p)/g+.5;return Z>=0&&Z<=1&&x>=0&&x<=1?{u:Z*e.width,v:x*e.height,z:Y}:null},X=M.showDepthVis?{showDepthVis:!0,maxZ:l}:void 0;M.showBounds&&pt(c,n,s,l,f),J(c,e,n,s,o,t,r,S,h,X),M.showCrosshair&&K(c,n,s)}function ut(c,e,n,s,o,t,a){c.drawImage(e,n-o/2,s-t/2,o,t)}function dt(c,e,n,s,o,t,a){if(!a.enabled||a.shape==="none"){c.drawImage(e,n-o/2,s-t/2,o,t);return}const u=a.quality??1,r=a.image??ot,M=a.debug??at;switch(a.shape){case"cylinder":a.cylinder&&ft(c,e,n,s,o,t,a.cylinder,r,u,M);break;case"plane":a.plane&&ht(c,e,n,s,o,t,a.plane,r,u,M);break;case"sphere":a.sphere&&mt(c,e,n,s,o,t,a.sphere,r,u,M);break;case"custom":a.custom&&ut(c,e,n,s,o,t,a.custom);break;default:c.drawImage(e,n-o/2,s-t/2,o,t)}}self.onmessage=async c=>{const{type:e,payload:n}=c.data;if(e==="render"){const s=performance.now();try{const o=await Mt(n),t=performance.now()-s,a={type:"complete",payload:{id:n.id,result:o,frameTime:t}};self.postMessage(a,[o])}catch(o){const t={type:"error",payload:{id:n.id,error:o instanceof Error?o.message:String(o)}};self.postMessage(t)}}};async function Mt(c){const{canvasWidth:e,canvasHeight:n,layers:s,images:o}=c;performance.now();const t=new OffscreenCanvas(e,n),a=t.getContext("2d");if(!a)throw new Error("Failed to get 2d context");a.fillStyle="#ffffff",a.fillRect(0,0,e,n);for(let r=0;r<s.length;r++){const M=s[r],l=o[r];l&>(a,l,M)}return await createImageBitmap(t)}function gt(c,e,n){c.save(),c.globalAlpha=n.opacity;const s=n.x,o=n.y;c.translate(s,o),c.rotate(n.rotation*Math.PI/180),n.warp&&n.warp.enabled&&n.warp.shape!=="none"?dt(c,e,0,0,n.width,n.height,n.warp):c.drawImage(e,-n.width/2,-n.height/2,n.width,n.height),c.restore()}})();\n', nt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", it], { type: "text/javascript;charset=utf-8" });
|
|
651
|
+
function rn(s) {
|
|
652
|
+
let n;
|
|
585
653
|
try {
|
|
586
|
-
if (
|
|
587
|
-
const t = new Worker(
|
|
588
|
-
name:
|
|
654
|
+
if (n = nt && (self.URL || self.webkitURL).createObjectURL(nt), !n) throw "";
|
|
655
|
+
const t = new Worker(n, {
|
|
656
|
+
name: s?.name
|
|
589
657
|
});
|
|
590
658
|
return t.addEventListener("error", () => {
|
|
591
|
-
(self.URL || self.webkitURL).revokeObjectURL(
|
|
659
|
+
(self.URL || self.webkitURL).revokeObjectURL(n);
|
|
592
660
|
}), t;
|
|
593
661
|
} catch {
|
|
594
662
|
return new Worker(
|
|
595
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
663
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(it),
|
|
596
664
|
{
|
|
597
|
-
name:
|
|
665
|
+
name: s?.name
|
|
598
666
|
}
|
|
599
667
|
);
|
|
600
668
|
}
|
|
601
669
|
}
|
|
602
|
-
class
|
|
670
|
+
class an {
|
|
603
671
|
worker = null;
|
|
604
672
|
batcher;
|
|
605
673
|
pendingRequest = null;
|
|
@@ -607,1945 +675,2085 @@ class $t {
|
|
|
607
675
|
frameId = 0;
|
|
608
676
|
lastCompletedId = 0;
|
|
609
677
|
options;
|
|
610
|
-
constructor(
|
|
611
|
-
this.options =
|
|
678
|
+
constructor(n) {
|
|
679
|
+
this.options = n, this.batcher = new ot((t) => this.submitToWorker(t)), this.initWorker();
|
|
612
680
|
}
|
|
613
681
|
initWorker() {
|
|
614
682
|
try {
|
|
615
|
-
this.worker = new
|
|
616
|
-
this.handleWorkerMessage(
|
|
617
|
-
}, this.worker.onerror = (
|
|
618
|
-
console.error("Worker error:",
|
|
683
|
+
this.worker = new rn(), this.worker.onmessage = (n) => {
|
|
684
|
+
this.handleWorkerMessage(n.data);
|
|
685
|
+
}, this.worker.onerror = (n) => {
|
|
686
|
+
console.error("Worker error:", n), this.options.onError?.(`Worker error: ${n.message}`);
|
|
619
687
|
};
|
|
620
|
-
} catch (
|
|
621
|
-
console.error("Failed to create worker:",
|
|
688
|
+
} catch (n) {
|
|
689
|
+
console.error("Failed to create worker:", n), this.options.onError?.("Failed to create render worker");
|
|
622
690
|
}
|
|
623
691
|
}
|
|
624
|
-
request(
|
|
625
|
-
this.batcher.queue(
|
|
692
|
+
request(n) {
|
|
693
|
+
this.batcher.queue(n);
|
|
626
694
|
}
|
|
627
|
-
submitToWorker(
|
|
695
|
+
submitToWorker(n) {
|
|
628
696
|
const t = ++this.frameId, a = {
|
|
629
|
-
...
|
|
697
|
+
...n,
|
|
630
698
|
id: t
|
|
631
699
|
};
|
|
632
700
|
this.isWorking ? this.pendingRequest = a : this.sendToWorker(a);
|
|
633
701
|
}
|
|
634
|
-
sendToWorker(
|
|
702
|
+
sendToWorker(n) {
|
|
635
703
|
if (!this.worker) return;
|
|
636
704
|
this.isWorking = !0;
|
|
637
|
-
const t = { type: "render", payload:
|
|
705
|
+
const t = { type: "render", payload: n }, a = n.images.filter((r) => r instanceof ImageBitmap);
|
|
638
706
|
this.worker.postMessage(t, a);
|
|
639
707
|
}
|
|
640
|
-
handleWorkerMessage(
|
|
641
|
-
if (
|
|
642
|
-
console.error("Render error:",
|
|
708
|
+
handleWorkerMessage(n) {
|
|
709
|
+
if (n.type === "error") {
|
|
710
|
+
console.error("Render error:", n.payload.error), this.isWorking = !1, this.processNext();
|
|
643
711
|
return;
|
|
644
712
|
}
|
|
645
|
-
const { id: t, result: a, frameTime:
|
|
713
|
+
const { id: t, result: a, frameTime: r } = n.payload;
|
|
646
714
|
if (this.isWorking = !1, t <= this.lastCompletedId) {
|
|
647
715
|
a.close(), this.processNext();
|
|
648
716
|
return;
|
|
649
717
|
}
|
|
650
|
-
this.lastCompletedId = t, this.options.onResult(a,
|
|
718
|
+
this.lastCompletedId = t, this.options.onResult(a, r), this.processNext();
|
|
651
719
|
}
|
|
652
720
|
processNext() {
|
|
653
721
|
if (this.pendingRequest) {
|
|
654
|
-
const
|
|
655
|
-
this.pendingRequest = null, this.sendToWorker(
|
|
722
|
+
const n = this.pendingRequest;
|
|
723
|
+
this.pendingRequest = null, this.sendToWorker(n);
|
|
656
724
|
}
|
|
657
725
|
}
|
|
658
726
|
destroy() {
|
|
659
727
|
this.batcher.destroy(), this.worker && (this.worker.terminate(), this.worker = null);
|
|
660
728
|
}
|
|
661
729
|
}
|
|
662
|
-
function
|
|
663
|
-
const
|
|
730
|
+
function Ue(s, n, t = {}, a) {
|
|
731
|
+
const r = {
|
|
664
732
|
loadedImages: /* @__PURE__ */ new Map(),
|
|
665
733
|
imageBitmaps: /* @__PURE__ */ new Map(),
|
|
666
734
|
imagesLoaded: !1,
|
|
667
735
|
lastSources: "",
|
|
736
|
+
lastSvgEffectsKey: "",
|
|
668
737
|
lastRenderKey: "",
|
|
669
738
|
useWorker: !0,
|
|
670
739
|
scheduler: null,
|
|
671
740
|
ctx: null,
|
|
672
741
|
renderStartTime: null
|
|
673
742
|
};
|
|
674
|
-
|
|
675
|
-
function
|
|
676
|
-
return Object.keys(
|
|
677
|
-
...
|
|
678
|
-
layers:
|
|
679
|
-
const
|
|
680
|
-
return
|
|
681
|
-
...
|
|
682
|
-
src:
|
|
683
|
-
} :
|
|
743
|
+
r.ctx = s.getContext("2d");
|
|
744
|
+
function o(u, g) {
|
|
745
|
+
return Object.keys(g).length === 0 ? u : {
|
|
746
|
+
...u,
|
|
747
|
+
layers: u.layers.map((C) => {
|
|
748
|
+
const M = C.name || C.id, l = g[M];
|
|
749
|
+
return l ? {
|
|
750
|
+
...C,
|
|
751
|
+
src: l
|
|
752
|
+
} : C;
|
|
684
753
|
})
|
|
685
754
|
};
|
|
686
755
|
}
|
|
687
|
-
if (!
|
|
756
|
+
if (!r.ctx)
|
|
688
757
|
return () => {
|
|
689
758
|
};
|
|
690
|
-
let
|
|
691
|
-
function
|
|
692
|
-
return
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
759
|
+
let i = n, h = t;
|
|
760
|
+
function _() {
|
|
761
|
+
return o(i, h);
|
|
762
|
+
}
|
|
763
|
+
function k(u) {
|
|
764
|
+
const g = u.effects.find((C) => C.type === "svg");
|
|
765
|
+
return g ? `${u.src}::svg::${JSON.stringify(g)}` : u.src;
|
|
766
|
+
}
|
|
767
|
+
_(), r.scheduler = new an({
|
|
768
|
+
onResult: (u, g) => {
|
|
769
|
+
if (r.ctx && s)
|
|
770
|
+
if (r.ctx.drawImage(u, 0, 0, s.width, s.height), u.close(), r.renderStartTime !== null) {
|
|
771
|
+
const C = performance.now() - r.renderStartTime;
|
|
772
|
+
a?.(C), r.renderStartTime = null;
|
|
700
773
|
} else
|
|
701
|
-
a?.(
|
|
774
|
+
a?.(g);
|
|
702
775
|
},
|
|
703
|
-
onError: (
|
|
704
|
-
console.warn("Worker render failed, falling back to main thread:",
|
|
776
|
+
onError: (u) => {
|
|
777
|
+
console.warn("Worker render failed, falling back to main thread:", u), r.useWorker = !1, x();
|
|
705
778
|
}
|
|
706
779
|
});
|
|
707
|
-
function
|
|
708
|
-
if (!
|
|
709
|
-
const
|
|
710
|
-
const
|
|
711
|
-
return
|
|
780
|
+
function p() {
|
|
781
|
+
if (!s || !r.ctx) return;
|
|
782
|
+
const u = _(), g = u.layers.map((l) => l.src).join(","), C = u.layers.map((l) => {
|
|
783
|
+
const d = l.effects.find((c) => c.type === "svg");
|
|
784
|
+
return d ? JSON.stringify(d) : "none";
|
|
785
|
+
}).join("|"), M = u.layers.map((l) => {
|
|
786
|
+
const d = l.effects.find((z) => z.type === "warp"), c = l.effects.find((z) => z.type === "restyle"), b = l.effects.find((z) => z.type === "svg"), T = d ? `${d.enabled}:${d.shape}` : "none", m = c ? JSON.stringify(c) : "none", R = b ? JSON.stringify(b) : "none";
|
|
787
|
+
return `${l.id}:${l.transform.x},${l.transform.y},${l.transform.scale},${l.transform.rotation},${l.opacity},${l.visible}:${T}:${m}:${R}`;
|
|
712
788
|
}).join("|");
|
|
713
|
-
(
|
|
714
|
-
}
|
|
715
|
-
async function u
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
789
|
+
(s.width !== u.width || s.height !== u.height) && (s.width = u.width, s.height = u.height), g !== r.lastSources || C !== r.lastSvgEffectsKey ? (r.lastSources = g, r.lastSvgEffectsKey = C, r.imagesLoaded = !1, f()) : r.imagesLoaded && M !== r.lastRenderKey ? (r.lastRenderKey = M, x()) : r.imagesLoaded ? r.imagesLoaded && x() : u.layers.length > 0 && f();
|
|
790
|
+
}
|
|
791
|
+
async function v(u) {
|
|
792
|
+
const g = u.src, C = k(u);
|
|
793
|
+
if (r.loadedImages.has(C))
|
|
794
|
+
return r.loadedImages.get(C);
|
|
795
|
+
const M = u.effects.find((R) => R.type === "svg");
|
|
796
|
+
let l = g, d = null;
|
|
797
|
+
if (M)
|
|
798
|
+
if (await st(g))
|
|
799
|
+
try {
|
|
800
|
+
let z;
|
|
801
|
+
if (g.startsWith("data:image/svg+xml")) {
|
|
802
|
+
const W = g.indexOf(",");
|
|
803
|
+
if (W === -1)
|
|
804
|
+
throw new Error("Invalid data URL format");
|
|
805
|
+
const E = g.substring(W + 1);
|
|
806
|
+
g.substring(0, W).includes(";base64") ? z = atob(E) : z = decodeURIComponent(E);
|
|
807
|
+
} else
|
|
808
|
+
z = await (await fetch(g)).text();
|
|
809
|
+
const N = $t(z, M), L = new Blob([N], { type: "image/svg+xml" });
|
|
810
|
+
l = URL.createObjectURL(L), d = l;
|
|
811
|
+
} catch (z) {
|
|
812
|
+
console.warn("Failed to process SVG, using original:", z);
|
|
813
|
+
}
|
|
814
|
+
else
|
|
815
|
+
console.warn("Source detected as SVG but verification failed:", g);
|
|
816
|
+
const c = l.startsWith("data:");
|
|
817
|
+
let T = l.startsWith("/") || l.startsWith("./") || l.startsWith("../");
|
|
818
|
+
if (!c && !T && typeof window < "u")
|
|
721
819
|
try {
|
|
722
|
-
|
|
820
|
+
T = new URL(l, window.location.href).origin === window.location.origin;
|
|
723
821
|
} catch {
|
|
724
|
-
|
|
822
|
+
T = !0;
|
|
725
823
|
}
|
|
726
|
-
const
|
|
824
|
+
const m = new Image();
|
|
727
825
|
try {
|
|
728
|
-
if (await new Promise((
|
|
729
|
-
const
|
|
730
|
-
|
|
826
|
+
if (await new Promise((R, z) => {
|
|
827
|
+
const N = setTimeout(() => {
|
|
828
|
+
z(new Error("Image load timeout"));
|
|
731
829
|
}, 3e4);
|
|
732
|
-
|
|
733
|
-
clearTimeout(
|
|
734
|
-
},
|
|
735
|
-
clearTimeout(
|
|
736
|
-
},
|
|
737
|
-
}),
|
|
830
|
+
m.onload = () => {
|
|
831
|
+
clearTimeout(N), R();
|
|
832
|
+
}, m.onerror = (L) => {
|
|
833
|
+
clearTimeout(N), z(L);
|
|
834
|
+
}, m.src = l;
|
|
835
|
+
}), r.loadedImages.set(C, m), !c && !T)
|
|
738
836
|
try {
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
}),
|
|
837
|
+
const R = new Image();
|
|
838
|
+
R.crossOrigin = "anonymous", await new Promise((z, N) => {
|
|
839
|
+
R.onload = () => z(), R.onerror = () => N(new Error("CORS failed")), R.src = l;
|
|
840
|
+
}), r.loadedImages.set(C, R);
|
|
743
841
|
try {
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
} catch (
|
|
747
|
-
console.warn("Failed to create ImageBitmap:",
|
|
842
|
+
const z = await createImageBitmap(R);
|
|
843
|
+
r.imageBitmaps.set(C, z), d && URL.revokeObjectURL(d);
|
|
844
|
+
} catch (z) {
|
|
845
|
+
console.warn("Failed to create ImageBitmap:", z), d && URL.revokeObjectURL(d);
|
|
748
846
|
}
|
|
749
|
-
return
|
|
847
|
+
return R;
|
|
750
848
|
} catch {
|
|
751
|
-
console.warn(`Image loaded but CORS not available for ${
|
|
849
|
+
console.warn(`Image loaded but CORS not available for ${g}. Canvas operations may be limited.`);
|
|
752
850
|
try {
|
|
753
|
-
const
|
|
754
|
-
|
|
851
|
+
const z = await createImageBitmap(m);
|
|
852
|
+
r.imageBitmaps.set(C, z), d && URL.revokeObjectURL(d);
|
|
755
853
|
} catch {
|
|
854
|
+
d && URL.revokeObjectURL(d);
|
|
756
855
|
}
|
|
757
|
-
return
|
|
856
|
+
return m;
|
|
758
857
|
}
|
|
759
858
|
else {
|
|
760
859
|
try {
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
} catch (
|
|
764
|
-
console.warn("Failed to create ImageBitmap:", d);
|
|
860
|
+
const R = await createImageBitmap(m);
|
|
861
|
+
r.imageBitmaps.set(C, R), d && URL.revokeObjectURL(d);
|
|
862
|
+
} catch (R) {
|
|
863
|
+
console.warn("Failed to create ImageBitmap:", R), d && URL.revokeObjectURL(d);
|
|
765
864
|
}
|
|
766
|
-
return
|
|
865
|
+
return m;
|
|
767
866
|
}
|
|
768
|
-
} catch (
|
|
769
|
-
return console.error(`Failed to load image: ${
|
|
867
|
+
} catch (R) {
|
|
868
|
+
return console.error(`Failed to load image: ${g}`, R), null;
|
|
770
869
|
}
|
|
771
870
|
}
|
|
772
|
-
async function
|
|
871
|
+
async function f() {
|
|
773
872
|
performance.now();
|
|
774
|
-
const
|
|
775
|
-
if (
|
|
776
|
-
|
|
873
|
+
const u = _();
|
|
874
|
+
if (u.layers.length === 0) {
|
|
875
|
+
r.imagesLoaded = !0, r.ctx && x();
|
|
777
876
|
return;
|
|
778
877
|
}
|
|
779
|
-
|
|
878
|
+
for (const g of u.layers)
|
|
879
|
+
if (g.effects.find((M) => M.type === "svg")) {
|
|
880
|
+
for (const [M, l] of r.loadedImages.entries())
|
|
881
|
+
if (M.startsWith(g.src + "::svg::") || M === g.src) {
|
|
882
|
+
r.loadedImages.delete(M);
|
|
883
|
+
const d = r.imageBitmaps.get(M);
|
|
884
|
+
d && (d.close(), r.imageBitmaps.delete(M));
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
await Promise.all(u.layers.map((g) => v(g))), r.imagesLoaded = !0, r.ctx && s && x();
|
|
780
888
|
}
|
|
781
|
-
function
|
|
782
|
-
if (!(!
|
|
783
|
-
if (
|
|
784
|
-
|
|
889
|
+
function x() {
|
|
890
|
+
if (!(!r.ctx || !s)) {
|
|
891
|
+
if (r.useWorker && r.scheduler) {
|
|
892
|
+
y();
|
|
785
893
|
return;
|
|
786
894
|
}
|
|
787
|
-
|
|
895
|
+
r.renderStartTime = performance.now(), w();
|
|
788
896
|
}
|
|
789
897
|
}
|
|
790
|
-
async function
|
|
791
|
-
if (!
|
|
792
|
-
|
|
793
|
-
const
|
|
794
|
-
let
|
|
795
|
-
for (const
|
|
796
|
-
if (!
|
|
797
|
-
const d =
|
|
798
|
-
if (!
|
|
799
|
-
if (!
|
|
800
|
-
|
|
898
|
+
async function y() {
|
|
899
|
+
if (!r.scheduler) return;
|
|
900
|
+
r.renderStartTime = performance.now();
|
|
901
|
+
const u = _(), g = [], C = [];
|
|
902
|
+
let M = !1;
|
|
903
|
+
for (const l of u.layers) {
|
|
904
|
+
if (!l.visible) continue;
|
|
905
|
+
const d = k(l), c = r.loadedImages.get(d), b = r.imageBitmaps.get(d);
|
|
906
|
+
if (!c) continue;
|
|
907
|
+
if (!b) {
|
|
908
|
+
M = !0;
|
|
801
909
|
continue;
|
|
802
910
|
}
|
|
803
|
-
const
|
|
804
|
-
let
|
|
805
|
-
const
|
|
806
|
-
let
|
|
807
|
-
if (
|
|
808
|
-
|
|
911
|
+
const T = tt(b, l.effects), m = l.effects.find((Y) => Y.type === "warp");
|
|
912
|
+
let R = T.width, z = T.height;
|
|
913
|
+
const N = R * l.transform.scale, L = z * l.transform.scale;
|
|
914
|
+
let W;
|
|
915
|
+
if (T.image instanceof ImageBitmap)
|
|
916
|
+
W = T.image;
|
|
809
917
|
else
|
|
810
918
|
try {
|
|
811
|
-
|
|
812
|
-
} catch (
|
|
813
|
-
console.warn("Failed to create bitmap from processed image, falling back to main thread:",
|
|
919
|
+
W = await createImageBitmap(T.image);
|
|
920
|
+
} catch (Y) {
|
|
921
|
+
console.warn("Failed to create bitmap from processed image, falling back to main thread:", Y), w();
|
|
814
922
|
return;
|
|
815
923
|
}
|
|
816
|
-
let
|
|
817
|
-
if (
|
|
818
|
-
const
|
|
924
|
+
let E = null;
|
|
925
|
+
if (m) {
|
|
926
|
+
const Y = {
|
|
819
927
|
type: "warp",
|
|
820
|
-
shape:
|
|
821
|
-
enabled: !!
|
|
822
|
-
quality: Number(
|
|
928
|
+
shape: m.shape,
|
|
929
|
+
enabled: !!m.enabled,
|
|
930
|
+
quality: Number(m.quality ?? 1),
|
|
823
931
|
image: {
|
|
824
|
-
scale: Number(
|
|
825
|
-
translateX: Number(
|
|
826
|
-
translateY: Number(
|
|
932
|
+
scale: Number(m.image?.scale ?? 1),
|
|
933
|
+
translateX: Number(m.image?.translateX ?? 0),
|
|
934
|
+
translateY: Number(m.image?.translateY ?? 0)
|
|
827
935
|
}
|
|
828
936
|
};
|
|
829
|
-
|
|
830
|
-
showBounds: !!
|
|
831
|
-
showDepthVis: !!
|
|
832
|
-
showCrosshair: !!
|
|
833
|
-
}),
|
|
834
|
-
diameter: Number(
|
|
835
|
-
pitch: Number(
|
|
836
|
-
perspective: Number(
|
|
837
|
-
rotationX: Number(
|
|
838
|
-
rotationY: Number(
|
|
839
|
-
rotationZ: Number(
|
|
840
|
-
}),
|
|
841
|
-
rotationX: Number(
|
|
842
|
-
rotationY: Number(
|
|
843
|
-
rotationZ: Number(
|
|
844
|
-
depthScale: Number(
|
|
845
|
-
}),
|
|
846
|
-
radius: Number(
|
|
847
|
-
rotationX: Number(
|
|
848
|
-
rotationY: Number(
|
|
849
|
-
rotationZ: Number(
|
|
850
|
-
}),
|
|
851
|
-
formula: String(
|
|
937
|
+
m.debug && (Y.debug = {
|
|
938
|
+
showBounds: !!m.debug.showBounds,
|
|
939
|
+
showDepthVis: !!m.debug.showDepthVis,
|
|
940
|
+
showCrosshair: !!m.debug.showCrosshair
|
|
941
|
+
}), m.cylinder && (Y.cylinder = {
|
|
942
|
+
diameter: Number(m.cylinder.diameter),
|
|
943
|
+
pitch: Number(m.cylinder.pitch),
|
|
944
|
+
perspective: Number(m.cylinder.perspective),
|
|
945
|
+
rotationX: Number(m.cylinder.rotationX),
|
|
946
|
+
rotationY: Number(m.cylinder.rotationY),
|
|
947
|
+
rotationZ: Number(m.cylinder.rotationZ)
|
|
948
|
+
}), m.plane && (Y.plane = {
|
|
949
|
+
rotationX: Number(m.plane.rotationX),
|
|
950
|
+
rotationY: Number(m.plane.rotationY),
|
|
951
|
+
rotationZ: Number(m.plane.rotationZ),
|
|
952
|
+
depthScale: Number(m.plane.depthScale)
|
|
953
|
+
}), m.sphere && (Y.sphere = {
|
|
954
|
+
radius: Number(m.sphere.radius),
|
|
955
|
+
rotationX: Number(m.sphere.rotationX),
|
|
956
|
+
rotationY: Number(m.sphere.rotationY),
|
|
957
|
+
rotationZ: Number(m.sphere.rotationZ)
|
|
958
|
+
}), m.custom && (Y.custom = {
|
|
959
|
+
formula: String(m.custom.formula),
|
|
852
960
|
parameters: Object.fromEntries(
|
|
853
|
-
Object.entries(
|
|
961
|
+
Object.entries(m.custom.parameters || {}).map(([U, q]) => [U, Number(q)])
|
|
854
962
|
)
|
|
855
|
-
}),
|
|
963
|
+
}), E = Y;
|
|
856
964
|
}
|
|
857
|
-
|
|
858
|
-
id: String(
|
|
859
|
-
x: Number(
|
|
860
|
-
y: Number(
|
|
861
|
-
width: Number(
|
|
862
|
-
height: Number(
|
|
863
|
-
rotation: Number(
|
|
864
|
-
opacity: Number(
|
|
865
|
-
warp:
|
|
866
|
-
}),
|
|
965
|
+
g.push({
|
|
966
|
+
id: String(l.id),
|
|
967
|
+
x: Number(l.transform.x),
|
|
968
|
+
y: Number(l.transform.y),
|
|
969
|
+
width: Number(N),
|
|
970
|
+
height: Number(L),
|
|
971
|
+
rotation: Number(l.transform.rotation),
|
|
972
|
+
opacity: Number(l.opacity),
|
|
973
|
+
warp: E
|
|
974
|
+
}), C.push(W);
|
|
867
975
|
}
|
|
868
|
-
if (
|
|
869
|
-
|
|
976
|
+
if (M || g.length === 0) {
|
|
977
|
+
w();
|
|
870
978
|
return;
|
|
871
979
|
}
|
|
872
980
|
try {
|
|
873
|
-
const
|
|
874
|
-
|
|
981
|
+
const l = await Promise.all(
|
|
982
|
+
C.map((d) => createImageBitmap(d))
|
|
875
983
|
);
|
|
876
|
-
|
|
877
|
-
canvasWidth:
|
|
878
|
-
canvasHeight:
|
|
879
|
-
layers:
|
|
880
|
-
images:
|
|
984
|
+
r.scheduler?.request({
|
|
985
|
+
canvasWidth: u.width,
|
|
986
|
+
canvasHeight: u.height,
|
|
987
|
+
layers: g,
|
|
988
|
+
images: l
|
|
881
989
|
});
|
|
882
|
-
} catch (
|
|
883
|
-
console.warn("Failed to clone bitmaps for worker, falling back to main thread:",
|
|
990
|
+
} catch (l) {
|
|
991
|
+
console.warn("Failed to clone bitmaps for worker, falling back to main thread:", l), w();
|
|
884
992
|
}
|
|
885
993
|
}
|
|
886
|
-
function
|
|
887
|
-
if (!
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
for (const
|
|
891
|
-
if (!
|
|
994
|
+
function w() {
|
|
995
|
+
if (!r.ctx || !s) return;
|
|
996
|
+
const u = r.renderStartTime ?? performance.now(), g = _();
|
|
997
|
+
r.ctx.fillStyle = "#ffffff", r.ctx.fillRect(0, 0, g.width, g.height);
|
|
998
|
+
for (const M of g.layers) {
|
|
999
|
+
if (!M.visible) continue;
|
|
892
1000
|
performance.now();
|
|
893
|
-
const
|
|
894
|
-
if (!
|
|
895
|
-
if (!
|
|
896
|
-
console.warn("Image not fully loaded:",
|
|
1001
|
+
const l = k(M), d = r.loadedImages.get(l);
|
|
1002
|
+
if (!d) continue;
|
|
1003
|
+
if (!d.complete || d.naturalWidth === 0) {
|
|
1004
|
+
console.warn("Image not fully loaded:", M.src);
|
|
897
1005
|
continue;
|
|
898
1006
|
}
|
|
899
|
-
const
|
|
900
|
-
let
|
|
901
|
-
|
|
902
|
-
const
|
|
903
|
-
|
|
904
|
-
const
|
|
1007
|
+
const c = tt(d, M.effects), b = M.effects.find((W) => W.type === "warp");
|
|
1008
|
+
let T = c.width, m = c.height;
|
|
1009
|
+
r.ctx.save(), r.ctx.globalAlpha = M.opacity;
|
|
1010
|
+
const R = M.transform.x, z = M.transform.y;
|
|
1011
|
+
r.ctx.translate(R, z), r.ctx.rotate(M.transform.rotation * Math.PI / 180);
|
|
1012
|
+
const N = T * M.transform.scale, L = m * M.transform.scale;
|
|
905
1013
|
try {
|
|
906
|
-
|
|
907
|
-
} catch (
|
|
908
|
-
console.warn("Failed to draw image to canvas (may be CORS issue):",
|
|
1014
|
+
b && b.enabled && b.shape !== "none" ? Jt(r.ctx, c.image, 0, 0, N, L, b) : r.ctx.drawImage(c.image, -N / 2, -L / 2, N, L);
|
|
1015
|
+
} catch (W) {
|
|
1016
|
+
console.warn("Failed to draw image to canvas (may be CORS issue):", M.src, W);
|
|
909
1017
|
}
|
|
910
|
-
|
|
1018
|
+
r.ctx.restore();
|
|
911
1019
|
}
|
|
912
|
-
const
|
|
913
|
-
a?.(
|
|
1020
|
+
const C = performance.now() - u;
|
|
1021
|
+
a?.(C), r.renderStartTime !== null && (r.renderStartTime = null);
|
|
914
1022
|
}
|
|
915
|
-
|
|
916
|
-
function
|
|
917
|
-
|
|
1023
|
+
p();
|
|
1024
|
+
function S(u, g) {
|
|
1025
|
+
i = u, g !== void 0 && (h = g), p();
|
|
918
1026
|
}
|
|
919
|
-
function
|
|
920
|
-
|
|
921
|
-
for (const
|
|
922
|
-
|
|
1027
|
+
function I() {
|
|
1028
|
+
r.scheduler?.destroy();
|
|
1029
|
+
for (const u of r.imageBitmaps.values())
|
|
1030
|
+
u.close();
|
|
923
1031
|
}
|
|
924
|
-
const
|
|
925
|
-
return
|
|
1032
|
+
const P = I;
|
|
1033
|
+
return P.update = S, P;
|
|
926
1034
|
}
|
|
927
|
-
var
|
|
928
|
-
const
|
|
1035
|
+
var sn = e.from_html('<div><canvas class="canvas svelte-1xdpk2w"></canvas></div>');
|
|
1036
|
+
const on = {
|
|
929
1037
|
hash: "svelte-1xdpk2w",
|
|
930
1038
|
code: ".mockup-renderer.svelte-1xdpk2w {position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;}.canvas.svelte-1xdpk2w {display:block;max-width:100%;max-height:100%;}.mockup-renderer.contain.svelte-1xdpk2w .canvas:where(.svelte-1xdpk2w) {width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;}.mockup-renderer.cover.svelte-1xdpk2w .canvas:where(.svelte-1xdpk2w) {width:100%;height:100%;object-fit:cover;}"
|
|
931
1039
|
};
|
|
932
|
-
function
|
|
933
|
-
e.push(
|
|
934
|
-
let t = e.prop(
|
|
1040
|
+
function Sa(s, n) {
|
|
1041
|
+
e.push(n, !0), e.append_styles(s, on);
|
|
1042
|
+
let t = e.prop(n, "imageOverrides", 19, () => ({})), a = e.prop(n, "objectFit", 3, "contain"), r = e.state(null);
|
|
935
1043
|
Te(() => {
|
|
936
|
-
if (e.get(
|
|
937
|
-
return
|
|
1044
|
+
if (e.get(r))
|
|
1045
|
+
return Ue(e.get(r), n.mockup.composition, t());
|
|
938
1046
|
});
|
|
939
|
-
var
|
|
940
|
-
let
|
|
941
|
-
var
|
|
942
|
-
e.bind_this(
|
|
1047
|
+
var o = sn();
|
|
1048
|
+
let i;
|
|
1049
|
+
var h = e.child(o);
|
|
1050
|
+
e.bind_this(h, (_) => e.set(r, _), () => e.get(r)), e.reset(o), e.template_effect(() => i = e.set_class(o, 1, "mockup-renderer svelte-1xdpk2w", null, i, {
|
|
943
1051
|
contain: a() === "contain",
|
|
944
1052
|
cover: a() === "cover"
|
|
945
|
-
})), e.append(
|
|
1053
|
+
})), e.append(s, o), e.pop();
|
|
946
1054
|
}
|
|
947
|
-
const
|
|
1055
|
+
const ln = {
|
|
948
1056
|
x: 0,
|
|
949
1057
|
y: 0,
|
|
950
1058
|
scale: 1,
|
|
951
1059
|
rotation: 0
|
|
952
|
-
},
|
|
953
|
-
transform: { ...
|
|
1060
|
+
}, cn = {
|
|
1061
|
+
transform: { ...ln },
|
|
954
1062
|
opacity: 1,
|
|
955
1063
|
visible: !0,
|
|
956
1064
|
effects: []
|
|
957
|
-
},
|
|
1065
|
+
}, Ce = {
|
|
958
1066
|
zoom: 1,
|
|
959
1067
|
panX: 0,
|
|
960
1068
|
panY: 0
|
|
961
|
-
},
|
|
1069
|
+
}, lt = {
|
|
962
1070
|
width: 800,
|
|
963
1071
|
height: 600,
|
|
964
1072
|
layers: [],
|
|
965
1073
|
effects: []
|
|
966
1074
|
};
|
|
967
|
-
var
|
|
968
|
-
const
|
|
1075
|
+
var dn = e.from_html('<div class="zoomable-canvas svelte-zjsyu1" role="application" aria-label="Zoomable canvas - scroll to zoom, drag to pan"><div class="canvas-frame svelte-zjsyu1"><!></div> <div class="view-controls svelte-zjsyu1"><span class="zoom-indicator svelte-zjsyu1"> </span> <button class="reset-btn svelte-zjsyu1">Reset</button></div></div>');
|
|
1076
|
+
const un = {
|
|
969
1077
|
hash: "svelte-zjsyu1",
|
|
970
1078
|
code: ".zoomable-canvas.svelte-zjsyu1 {width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--color-bg, #f5f5f5);overflow:hidden;cursor:grab;position:relative;}.zoomable-canvas.svelte-zjsyu1:active {cursor:grabbing;}.canvas-frame.svelte-zjsyu1 {transform-origin:center center;box-shadow:0 4px 16px rgba(0, 0, 0, 0.1);}.view-controls.svelte-zjsyu1 {position:absolute;bottom:1rem;right:1rem;display:flex;align-items:center;gap:0.5rem;background:rgba(0, 0, 0, 0.7);padding:0.3rem 0.5rem;border-radius:4px;}.zoom-indicator.svelte-zjsyu1 {color:#fff;font-size:0.75rem;font-family:monospace;min-width:2.5rem;text-align:center;}.reset-btn.svelte-zjsyu1 {background:transparent;border:1px solid rgba(255, 255, 255, 0.3);color:rgba(255, 255, 255, 0.8);padding:0.2rem 0.5rem;border-radius:3px;font-size:0.75rem;cursor:pointer;transition:all 200ms;}.reset-btn.svelte-zjsyu1:hover {border-color:rgba(255, 255, 255, 0.6);color:#fff;}"
|
|
971
1079
|
};
|
|
972
|
-
function
|
|
973
|
-
e.append_styles(
|
|
974
|
-
let t = e.state(e.proxy({ ...
|
|
975
|
-
function
|
|
976
|
-
|
|
977
|
-
const
|
|
978
|
-
e.set(t, { ...e.get(t), zoom:
|
|
979
|
-
}
|
|
980
|
-
function
|
|
981
|
-
|
|
982
|
-
|
|
1080
|
+
function pn(s, n) {
|
|
1081
|
+
e.append_styles(s, un);
|
|
1082
|
+
let t = e.state(e.proxy({ ...Ce })), a = e.state(!1), r = e.state(e.proxy({ x: 0, y: 0 }));
|
|
1083
|
+
function o(P) {
|
|
1084
|
+
P.preventDefault();
|
|
1085
|
+
const u = P.deltaY > 0 ? 0.9 : 1.1, g = Math.max(0.25, Math.min(4, e.get(t).zoom * u));
|
|
1086
|
+
e.set(t, { ...e.get(t), zoom: g }, !0);
|
|
1087
|
+
}
|
|
1088
|
+
function i(P) {
|
|
1089
|
+
P.button === 0 && (e.set(a, !0), e.set(
|
|
1090
|
+
r,
|
|
983
1091
|
{
|
|
984
|
-
x:
|
|
985
|
-
y:
|
|
1092
|
+
x: P.clientX - e.get(t).panX,
|
|
1093
|
+
y: P.clientY - e.get(t).panY
|
|
986
1094
|
},
|
|
987
1095
|
!0
|
|
988
1096
|
));
|
|
989
1097
|
}
|
|
990
|
-
function
|
|
1098
|
+
function h(P) {
|
|
991
1099
|
e.get(a) && e.set(
|
|
992
1100
|
t,
|
|
993
1101
|
{
|
|
994
1102
|
...e.get(t),
|
|
995
|
-
panX:
|
|
996
|
-
panY:
|
|
1103
|
+
panX: P.clientX - e.get(r).x,
|
|
1104
|
+
panY: P.clientY - e.get(r).y
|
|
997
1105
|
},
|
|
998
1106
|
!0
|
|
999
1107
|
);
|
|
1000
1108
|
}
|
|
1001
|
-
function
|
|
1109
|
+
function _() {
|
|
1002
1110
|
e.set(a, !1);
|
|
1003
1111
|
}
|
|
1004
|
-
function
|
|
1005
|
-
e.set(t, { ...
|
|
1006
|
-
}
|
|
1007
|
-
const
|
|
1008
|
-
var
|
|
1009
|
-
|
|
1010
|
-
var
|
|
1011
|
-
e.snippet(
|
|
1012
|
-
var
|
|
1013
|
-
e.reset(
|
|
1014
|
-
var
|
|
1015
|
-
|
|
1016
|
-
(
|
|
1017
|
-
e.set_style(
|
|
1112
|
+
function k() {
|
|
1113
|
+
e.set(t, { ...Ce }, !0);
|
|
1114
|
+
}
|
|
1115
|
+
const p = e.derived(() => `transform: scale(${e.get(t).zoom}) translate(${e.get(t).panX / e.get(t).zoom}px, ${e.get(t).panY / e.get(t).zoom}px);`);
|
|
1116
|
+
var v = dn();
|
|
1117
|
+
v.__mousedown = i, v.__mousemove = h, v.__mouseup = _;
|
|
1118
|
+
var f = e.child(v), x = e.child(f);
|
|
1119
|
+
e.snippet(x, () => n.children), e.reset(f);
|
|
1120
|
+
var y = e.sibling(f, 2), w = e.child(y), S = e.child(w);
|
|
1121
|
+
e.reset(w);
|
|
1122
|
+
var I = e.sibling(w, 2);
|
|
1123
|
+
I.__click = k, e.reset(y), e.reset(v), e.template_effect(
|
|
1124
|
+
(P) => {
|
|
1125
|
+
e.set_style(f, e.get(p)), e.set_text(S, `${P ?? ""}%`);
|
|
1018
1126
|
},
|
|
1019
1127
|
[() => Math.round(e.get(t).zoom * 100)]
|
|
1020
|
-
), e.event("wheel",
|
|
1128
|
+
), e.event("wheel", v, o), e.event("mouseleave", v, _), e.append(s, v);
|
|
1021
1129
|
}
|
|
1022
1130
|
e.delegate(["mousedown", "mousemove", "mouseup", "click"]);
|
|
1023
|
-
function
|
|
1024
|
-
let
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1131
|
+
function mn(s, n, t = {}, a) {
|
|
1132
|
+
let r = n, o = t, i = null;
|
|
1133
|
+
const h = new ot((p) => {
|
|
1134
|
+
i?.update ? i.update(p.config, p.overrides) : (i?.(), i = Ue(s, p.config, p.overrides, a));
|
|
1027
1135
|
});
|
|
1028
|
-
|
|
1029
|
-
function
|
|
1030
|
-
|
|
1136
|
+
i = Ue(s, r, o, a);
|
|
1137
|
+
function _(p, v) {
|
|
1138
|
+
r = p, v !== void 0 && (o = v), h.queue({ config: r, overrides: o });
|
|
1031
1139
|
}
|
|
1032
1140
|
return {
|
|
1033
|
-
update:
|
|
1141
|
+
update: _,
|
|
1034
1142
|
cleanup: () => {
|
|
1035
|
-
|
|
1143
|
+
h.destroy(), i?.();
|
|
1036
1144
|
}
|
|
1037
1145
|
};
|
|
1038
1146
|
}
|
|
1039
|
-
var
|
|
1040
|
-
const
|
|
1147
|
+
var fn = e.from_html('<div class="render-time svelte-1p1rf8j"> </div>'), vn = e.from_html('<div><canvas class="canvas svelte-1p1rf8j"></canvas> <!></div>');
|
|
1148
|
+
const hn = {
|
|
1041
1149
|
hash: "svelte-1p1rf8j",
|
|
1042
1150
|
code: ".mockup-renderer.svelte-1p1rf8j {position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;}.canvas.svelte-1p1rf8j {display:block;max-width:100%;max-height:100%;}.mockup-renderer.contain.svelte-1p1rf8j .canvas:where(.svelte-1p1rf8j) {width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;}.mockup-renderer.cover.svelte-1p1rf8j .canvas:where(.svelte-1p1rf8j) {width:100%;height:100%;object-fit:cover;}.render-time.svelte-1p1rf8j {position:absolute;top:8px;right:8px;background:rgba(0, 0, 0, 0.7);color:white;padding:4px 8px;border-radius:4px;font-size:12px;font-family:monospace;pointer-events:none;z-index:10;}"
|
|
1043
1151
|
};
|
|
1044
|
-
function
|
|
1045
|
-
e.push(
|
|
1046
|
-
let t = e.prop(
|
|
1047
|
-
const
|
|
1048
|
-
function
|
|
1049
|
-
if (!e.get(
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
|
|
1152
|
+
function gn(s, n) {
|
|
1153
|
+
e.push(n, !0), e.append_styles(s, hn);
|
|
1154
|
+
let t = e.prop(n, "imageOverrides", 19, () => ({})), a = e.prop(n, "objectFit", 3, "contain"), r = e.prop(n, "debounceMs", 3, 100), o = e.state(null), i = e.state(null), h = e.state(0), _ = e.state(null), k = null, p = e.state(""), v = e.state(""), f = e.state(null);
|
|
1155
|
+
const x = 3;
|
|
1156
|
+
function y() {
|
|
1157
|
+
if (!e.get(i)) return;
|
|
1158
|
+
const M = JSON.stringify(n.mockup.composition), l = JSON.stringify(t());
|
|
1159
|
+
M === e.get(p) && l === e.get(v) || (e.update(h), e.set(
|
|
1160
|
+
_,
|
|
1053
1161
|
{
|
|
1054
|
-
composition:
|
|
1162
|
+
composition: n.mockup.composition,
|
|
1055
1163
|
overrides: t()
|
|
1056
1164
|
},
|
|
1057
1165
|
!0
|
|
1058
|
-
), e.get(
|
|
1059
|
-
e.get(
|
|
1060
|
-
}), e.set(
|
|
1166
|
+
), e.get(h) >= x ? (e.set(h, 0), k && (clearTimeout(k), k = null), e.get(_) && ($e(() => {
|
|
1167
|
+
e.get(i).update(e.get(_).composition, e.get(_).overrides), e.set(p, M, !0), e.set(v, l, !0);
|
|
1168
|
+
}), e.set(_, null))) : (k && clearTimeout(k), k = setTimeout(
|
|
1061
1169
|
() => {
|
|
1062
|
-
e.get(
|
|
1063
|
-
e.get(
|
|
1064
|
-
}), e.set(
|
|
1170
|
+
e.get(i) && e.get(_) && ($e(() => {
|
|
1171
|
+
e.get(i).update(e.get(_).composition, e.get(_).overrides), e.set(p, JSON.stringify(e.get(_).composition), !0), e.set(v, JSON.stringify(e.get(_).overrides), !0);
|
|
1172
|
+
}), e.set(_, null), e.set(h, 0)), k = null;
|
|
1065
1173
|
},
|
|
1066
|
-
|
|
1174
|
+
r()
|
|
1067
1175
|
)));
|
|
1068
1176
|
}
|
|
1069
|
-
Te(() => (
|
|
1070
|
-
e.get(
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
e.set(
|
|
1177
|
+
Te(() => (St().then(() => {
|
|
1178
|
+
e.get(o) && (e.set(
|
|
1179
|
+
i,
|
|
1180
|
+
mn(e.get(o), n.mockup.composition, t(), (M) => {
|
|
1181
|
+
e.set(f, M, !0);
|
|
1074
1182
|
}),
|
|
1075
1183
|
!0
|
|
1076
|
-
), e.set(
|
|
1184
|
+
), e.set(p, JSON.stringify(n.mockup.composition), !0), e.set(v, JSON.stringify(t()), !0));
|
|
1077
1185
|
}), () => {
|
|
1078
|
-
|
|
1186
|
+
k && clearTimeout(k), e.get(i)?.cleanup();
|
|
1079
1187
|
}));
|
|
1080
|
-
const
|
|
1188
|
+
const w = e.derived(() => JSON.stringify(n.mockup.composition)), S = e.derived(() => JSON.stringify(t()));
|
|
1081
1189
|
e.user_effect(() => {
|
|
1082
|
-
e.get(
|
|
1083
|
-
}),
|
|
1084
|
-
|
|
1190
|
+
e.get(w), e.get(S), e.get(i) && y();
|
|
1191
|
+
}), zt(() => {
|
|
1192
|
+
k && clearTimeout(k), e.get(i)?.cleanup();
|
|
1085
1193
|
});
|
|
1086
|
-
var
|
|
1087
|
-
let
|
|
1088
|
-
var
|
|
1089
|
-
e.bind_this(
|
|
1090
|
-
var
|
|
1194
|
+
var I = vn();
|
|
1195
|
+
let P;
|
|
1196
|
+
var u = e.child(I);
|
|
1197
|
+
e.bind_this(u, (M) => e.set(o, M), () => e.get(o));
|
|
1198
|
+
var g = e.sibling(u, 2);
|
|
1091
1199
|
{
|
|
1092
|
-
var
|
|
1093
|
-
var
|
|
1094
|
-
e.reset(
|
|
1200
|
+
var C = (M) => {
|
|
1201
|
+
var l = fn(), d = e.child(l);
|
|
1202
|
+
e.reset(l), e.template_effect((c) => e.set_text(d, `${c ?? ""}ms`), [() => e.get(f).toFixed(1)]), e.append(M, l);
|
|
1095
1203
|
};
|
|
1096
|
-
e.if(
|
|
1097
|
-
e.get(
|
|
1204
|
+
e.if(g, (M) => {
|
|
1205
|
+
e.get(f) !== null && M(C);
|
|
1098
1206
|
});
|
|
1099
1207
|
}
|
|
1100
|
-
e.reset(
|
|
1208
|
+
e.reset(I), e.template_effect(() => P = e.set_class(I, 1, "mockup-renderer svelte-1p1rf8j", null, P, {
|
|
1101
1209
|
contain: a() === "contain",
|
|
1102
1210
|
cover: a() === "cover"
|
|
1103
|
-
})), e.append(
|
|
1211
|
+
})), e.append(s, I), e.pop();
|
|
1104
1212
|
}
|
|
1105
|
-
var
|
|
1106
|
-
function
|
|
1107
|
-
let t = e.prop(
|
|
1108
|
-
var
|
|
1213
|
+
var bn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>');
|
|
1214
|
+
function _n(s, n) {
|
|
1215
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
1216
|
+
var r = bn();
|
|
1109
1217
|
e.template_effect(() => {
|
|
1110
|
-
e.set_style(
|
|
1111
|
-
}), e.append(
|
|
1218
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
1219
|
+
}), e.append(s, r);
|
|
1112
1220
|
}
|
|
1113
|
-
var
|
|
1114
|
-
function
|
|
1115
|
-
let t = e.prop(
|
|
1116
|
-
var
|
|
1221
|
+
var yn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>');
|
|
1222
|
+
function wn(s, n) {
|
|
1223
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
1224
|
+
var r = yn();
|
|
1117
1225
|
e.template_effect(() => {
|
|
1118
|
-
e.set_style(
|
|
1119
|
-
}), e.append(
|
|
1226
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
1227
|
+
}), e.append(s, r);
|
|
1120
1228
|
}
|
|
1121
|
-
var
|
|
1122
|
-
function
|
|
1123
|
-
let t = e.prop(
|
|
1124
|
-
var
|
|
1229
|
+
var xn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"></path></svg>');
|
|
1230
|
+
function Fe(s, n) {
|
|
1231
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
1232
|
+
var r = xn();
|
|
1125
1233
|
e.template_effect(() => {
|
|
1126
|
-
e.set_style(
|
|
1127
|
-
}), e.append(
|
|
1234
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
1235
|
+
}), e.append(s, r);
|
|
1128
1236
|
}
|
|
1129
|
-
var
|
|
1130
|
-
function
|
|
1131
|
-
let t = e.prop(
|
|
1132
|
-
var
|
|
1237
|
+
var kn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"></path><path d="M3 3v5h5"></path></svg>');
|
|
1238
|
+
function Mn(s, n) {
|
|
1239
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
1240
|
+
var r = kn();
|
|
1133
1241
|
e.template_effect(() => {
|
|
1134
|
-
e.set_style(
|
|
1135
|
-
}), e.append(
|
|
1242
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
1243
|
+
}), e.append(s, r);
|
|
1136
1244
|
}
|
|
1137
|
-
var
|
|
1138
|
-
const
|
|
1245
|
+
var Tn = e.from_html('<button type="button" class="reset-btn svelte-18gpljp" title="Reset to default"><!></button>'), Sn = e.from_html('<div class="control-group"><div class="control-row svelte-18gpljp"><!> <label class="control-label svelte-18gpljp"><span class="label-text svelte-18gpljp"> </span> <div class="control-content svelte-18gpljp"><!></div></label></div></div>');
|
|
1246
|
+
const zn = {
|
|
1139
1247
|
hash: "svelte-18gpljp",
|
|
1140
1248
|
code: ".control-row.svelte-18gpljp {display:flex;align-items:center;gap:0.25rem;min-width:0;max-width:100%;}.reset-btn.svelte-18gpljp {display:flex;align-items:center;justify-content:center;padding:0.25rem;background:transparent;border:none;border-radius:4px;color:var(--color-text-muted, #666);cursor:pointer;opacity:0.5;transition:opacity 0.15s, color 0.15s;}.reset-btn.svelte-18gpljp:hover {opacity:1;color:var(--color-primary, #007bff);}.control-label.svelte-18gpljp {display:flex;align-items:center;gap:0.5rem;flex:1;min-width:0;}.label-text.svelte-18gpljp {width:80px;flex-shrink:0;font-size:0.875rem;color:var(--color-text-muted, #666);}.control-content.svelte-18gpljp {flex:1;display:flex;align-items:center;gap:0.5rem;min-width:0;max-width:100%;overflow:hidden;}"
|
|
1141
1249
|
};
|
|
1142
|
-
function F(
|
|
1143
|
-
e.append_styles(
|
|
1144
|
-
var t =
|
|
1250
|
+
function F(s, n) {
|
|
1251
|
+
e.append_styles(s, zn);
|
|
1252
|
+
var t = Sn(), a = e.child(t), r = e.child(a);
|
|
1145
1253
|
{
|
|
1146
|
-
var
|
|
1147
|
-
var
|
|
1148
|
-
|
|
1149
|
-
|
|
1254
|
+
var o = (v) => {
|
|
1255
|
+
var f = Tn();
|
|
1256
|
+
f.__click = function(...y) {
|
|
1257
|
+
n.onReset?.apply(this, y);
|
|
1150
1258
|
};
|
|
1151
|
-
var
|
|
1152
|
-
|
|
1259
|
+
var x = e.child(f);
|
|
1260
|
+
Mn(x, { fontSize: "0.875rem" }), e.reset(f), e.append(v, f);
|
|
1153
1261
|
};
|
|
1154
|
-
e.if(
|
|
1155
|
-
|
|
1262
|
+
e.if(r, (v) => {
|
|
1263
|
+
n.onReset && v(o);
|
|
1156
1264
|
});
|
|
1157
1265
|
}
|
|
1158
|
-
var
|
|
1159
|
-
e.reset(
|
|
1160
|
-
var
|
|
1161
|
-
e.snippet(
|
|
1266
|
+
var i = e.sibling(r, 2), h = e.child(i), _ = e.child(h, !0);
|
|
1267
|
+
e.reset(h);
|
|
1268
|
+
var k = e.sibling(h, 2), p = e.child(k);
|
|
1269
|
+
e.snippet(p, () => n.children), e.reset(k), e.reset(i), e.reset(a), e.reset(t), e.template_effect(() => e.set_text(_, n.label)), e.append(s, t);
|
|
1162
1270
|
}
|
|
1163
1271
|
e.delegate(["click"]);
|
|
1164
|
-
var
|
|
1165
|
-
const
|
|
1272
|
+
var In = e.from_html('<input type="range" step="1" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), Pn = e.from_html('<input type="range" step="1" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), Cn = e.from_html('<input type="range" step="1" min="-360" max="360" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), jn = e.from_html('<input type="range" min="0" max="1" step="0.01" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="0.01" min="0" max="1"/>', 1), Nn = e.from_html('<details class="section svelte-efcks6" open=""><summary class="section-title svelte-efcks6">Position & Transform</summary> <div class="section-content svelte-efcks6"><details class="subsection svelte-efcks6" open=""><summary class="subsection-title svelte-efcks6">Position</summary> <div class="subsection-content svelte-efcks6"><!> <!></div></details> <details class="subsection svelte-efcks6" open=""><summary class="subsection-title svelte-efcks6">Transform</summary> <div class="subsection-content svelte-efcks6"><!> <!></div></details></div></details>');
|
|
1273
|
+
const Rn = {
|
|
1166
1274
|
hash: "svelte-efcks6",
|
|
1167
1275
|
code: `.section.svelte-efcks6 {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-efcks6 {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-efcks6::-webkit-details-marker {display:none;}.section-title.svelte-efcks6::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-efcks6 > .section-title:where(.svelte-efcks6)::before {transform:rotate(90deg);}.section-content.svelte-efcks6 {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.manual-input.svelte-efcks6 {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-efcks6 {flex:1;min-width:0;max-width:100%;}.subsection.svelte-efcks6 {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection.svelte-efcks6:first-child {margin-top:0;border-top:none;}.subsection-title.svelte-efcks6 {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-efcks6::-webkit-details-marker {display:none;}.subsection-title.svelte-efcks6::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-efcks6 > .subsection-title:where(.svelte-efcks6)::before {transform:rotate(90deg);}.subsection-content.svelte-efcks6 {padding-bottom:0.25rem;}`
|
|
1168
1276
|
};
|
|
1169
|
-
function
|
|
1170
|
-
e.push(
|
|
1171
|
-
let t = e.prop(
|
|
1172
|
-
const
|
|
1173
|
-
x: Math.round(
|
|
1174
|
-
y: Math.round(
|
|
1277
|
+
function Wn(s, n) {
|
|
1278
|
+
e.push(n, !0), e.append_styles(s, Rn);
|
|
1279
|
+
let t = e.prop(n, "transform", 7), a = e.prop(n, "opacity", 7);
|
|
1280
|
+
const r = {
|
|
1281
|
+
x: Math.round(n.canvasWidth / 2),
|
|
1282
|
+
y: Math.round(n.canvasHeight / 2),
|
|
1175
1283
|
rotation: 0,
|
|
1176
1284
|
opacity: 1
|
|
1177
1285
|
};
|
|
1178
|
-
function
|
|
1179
|
-
|
|
1286
|
+
function o(g) {
|
|
1287
|
+
n.onTransformChange({ ...t(), ...g });
|
|
1180
1288
|
}
|
|
1181
|
-
const
|
|
1182
|
-
var
|
|
1183
|
-
F(
|
|
1289
|
+
const i = -n.canvasWidth / 2, h = n.canvasWidth * 1.5, _ = -n.canvasHeight / 2, k = n.canvasHeight * 1.5;
|
|
1290
|
+
var p = Nn(), v = e.sibling(e.child(p), 2), f = e.child(v), x = e.sibling(e.child(f), 2), y = e.child(x);
|
|
1291
|
+
F(y, {
|
|
1184
1292
|
label: "Position X",
|
|
1185
|
-
onReset: () =>
|
|
1186
|
-
children: (
|
|
1187
|
-
var
|
|
1188
|
-
e.remove_input_defaults(
|
|
1189
|
-
var
|
|
1190
|
-
e.remove_input_defaults(
|
|
1191
|
-
e.set_attribute(
|
|
1192
|
-
}), e.bind_value(
|
|
1293
|
+
onReset: () => o({ x: r.x }),
|
|
1294
|
+
children: (g, C) => {
|
|
1295
|
+
var M = In(), l = e.first_child(M);
|
|
1296
|
+
e.remove_input_defaults(l), l.__input = (c) => o({ x: Number(c.currentTarget.value) });
|
|
1297
|
+
var d = e.sibling(l, 2);
|
|
1298
|
+
e.remove_input_defaults(d), d.__input = (c) => o({ x: Number(c.currentTarget.value) }), e.template_effect(() => {
|
|
1299
|
+
e.set_attribute(l, "min", i), e.set_attribute(l, "max", h);
|
|
1300
|
+
}), e.bind_value(l, () => t().x, (c) => t().x = c), e.bind_value(d, () => t().x, (c) => t().x = c), e.append(g, M);
|
|
1193
1301
|
}
|
|
1194
1302
|
});
|
|
1195
|
-
var
|
|
1196
|
-
F(
|
|
1303
|
+
var w = e.sibling(y, 2);
|
|
1304
|
+
F(w, {
|
|
1197
1305
|
label: "Position Y",
|
|
1198
|
-
onReset: () =>
|
|
1199
|
-
children: (
|
|
1200
|
-
var
|
|
1201
|
-
e.remove_input_defaults(
|
|
1202
|
-
var
|
|
1203
|
-
e.remove_input_defaults(
|
|
1204
|
-
e.set_attribute(
|
|
1205
|
-
}), e.bind_value(
|
|
1306
|
+
onReset: () => o({ y: r.y }),
|
|
1307
|
+
children: (g, C) => {
|
|
1308
|
+
var M = Pn(), l = e.first_child(M);
|
|
1309
|
+
e.remove_input_defaults(l), l.__input = (c) => o({ y: Number(c.currentTarget.value) });
|
|
1310
|
+
var d = e.sibling(l, 2);
|
|
1311
|
+
e.remove_input_defaults(d), d.__input = (c) => o({ y: Number(c.currentTarget.value) }), e.template_effect(() => {
|
|
1312
|
+
e.set_attribute(l, "min", _), e.set_attribute(l, "max", k);
|
|
1313
|
+
}), e.bind_value(l, () => t().y, (c) => t().y = c), e.bind_value(d, () => t().y, (c) => t().y = c), e.append(g, M);
|
|
1206
1314
|
}
|
|
1207
|
-
}), e.reset(
|
|
1208
|
-
var
|
|
1209
|
-
F(
|
|
1315
|
+
}), e.reset(x), e.reset(f);
|
|
1316
|
+
var S = e.sibling(f, 2), I = e.sibling(e.child(S), 2), P = e.child(I);
|
|
1317
|
+
F(P, {
|
|
1210
1318
|
label: "Rotation (°)",
|
|
1211
|
-
onReset: () =>
|
|
1212
|
-
children: (
|
|
1213
|
-
var
|
|
1214
|
-
e.remove_input_defaults(
|
|
1215
|
-
var
|
|
1216
|
-
e.remove_input_defaults(
|
|
1319
|
+
onReset: () => o({ rotation: r.rotation }),
|
|
1320
|
+
children: (g, C) => {
|
|
1321
|
+
var M = Cn(), l = e.first_child(M);
|
|
1322
|
+
e.remove_input_defaults(l), l.__input = (c) => o({ rotation: Number(c.currentTarget.value) });
|
|
1323
|
+
var d = e.sibling(l, 2);
|
|
1324
|
+
e.remove_input_defaults(d), d.__input = (c) => o({ rotation: Number(c.currentTarget.value) }), e.bind_value(l, () => t().rotation, (c) => t().rotation = c), e.bind_value(d, () => t().rotation, (c) => t().rotation = c), e.append(g, M);
|
|
1217
1325
|
}
|
|
1218
1326
|
});
|
|
1219
|
-
var
|
|
1220
|
-
F(
|
|
1327
|
+
var u = e.sibling(P, 2);
|
|
1328
|
+
F(u, {
|
|
1221
1329
|
label: "Opacity",
|
|
1222
|
-
onReset: () =>
|
|
1223
|
-
children: (
|
|
1224
|
-
var
|
|
1225
|
-
e.remove_input_defaults(
|
|
1226
|
-
var
|
|
1227
|
-
e.remove_input_defaults(
|
|
1330
|
+
onReset: () => n.onOpacityChange(r.opacity),
|
|
1331
|
+
children: (g, C) => {
|
|
1332
|
+
var M = jn(), l = e.first_child(M);
|
|
1333
|
+
e.remove_input_defaults(l), l.__input = (c) => n.onOpacityChange(Number(c.currentTarget.value));
|
|
1334
|
+
var d = e.sibling(l, 2);
|
|
1335
|
+
e.remove_input_defaults(d), d.__input = (c) => n.onOpacityChange(Number(c.currentTarget.value)), e.bind_value(l, a), e.bind_value(d, a), e.append(g, M);
|
|
1228
1336
|
}
|
|
1229
|
-
}), e.reset(
|
|
1337
|
+
}), e.reset(I), e.reset(S), e.reset(v), e.reset(p), e.append(s, p), e.pop();
|
|
1230
1338
|
}
|
|
1231
1339
|
e.delegate(["input"]);
|
|
1232
|
-
var
|
|
1233
|
-
const
|
|
1340
|
+
var Dn = e.from_html('<select class="mode-select svelte-1qmrgom"><option>Scale</option><option>Px</option></select>'), Xn = e.from_html('<input type="range" step="0.1" min="0.1" max="10" class="svelte-1qmrgom"/> <input type="number" class="manual-input svelte-1qmrgom" step="0.1" min="0.1" max="10"/>', 1), Yn = e.from_html('<input type="number" class="px-input svelte-1qmrgom" step="1" min="1" placeholder="Auto"/> <select class="constraint-select svelte-1qmrgom"><option>None</option><option>Min</option><option>Max</option></select>', 1), En = e.from_html('<input type="number" class="px-input svelte-1qmrgom" step="1" min="1" placeholder="Auto"/> <select class="constraint-select svelte-1qmrgom"><option>None</option><option>Min</option><option>Max</option></select>', 1), Ln = e.from_html('<input type="checkbox"/>'), On = e.from_html("<!> <!> <!>", 1), Zn = e.from_html('<details class="section svelte-1qmrgom" open=""><summary class="section-title svelte-1qmrgom">Sizing</summary> <div class="section-content svelte-1qmrgom"><!> <!></div></details>');
|
|
1341
|
+
const Bn = {
|
|
1234
1342
|
hash: "svelte-1qmrgom",
|
|
1235
1343
|
code: `.section.svelte-1qmrgom {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-1qmrgom {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-1qmrgom::-webkit-details-marker {display:none;}.section-title.svelte-1qmrgom::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-1qmrgom > .section-title:where(.svelte-1qmrgom)::before {transform:rotate(90deg);}.section-content.svelte-1qmrgom {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.mode-select.svelte-1qmrgom {padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;background:var(--color-surface, #fff);}.px-input.svelte-1qmrgom {width:50px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;appearance:textfield;-moz-appearance:textfield;}.px-input.svelte-1qmrgom::-webkit-outer-spin-button,
|
|
1236
1344
|
.px-input.svelte-1qmrgom::-webkit-inner-spin-button {-webkit-appearance:none;margin:0;}.constraint-select.svelte-1qmrgom {width:70px;flex-shrink:0;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}.manual-input.svelte-1qmrgom {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1qmrgom {flex:1;min-width:0;max-width:100%;}`
|
|
1237
1345
|
};
|
|
1238
|
-
function
|
|
1239
|
-
e.push(
|
|
1240
|
-
let t = e.prop(
|
|
1241
|
-
function a(
|
|
1242
|
-
|
|
1243
|
-
}
|
|
1244
|
-
var
|
|
1245
|
-
F(
|
|
1346
|
+
function qn(s, n) {
|
|
1347
|
+
e.push(n, !0), e.append_styles(s, Bn);
|
|
1348
|
+
let t = e.prop(n, "effect", 3, ve);
|
|
1349
|
+
function a(p) {
|
|
1350
|
+
n.onChange({ ...t(), ...p });
|
|
1351
|
+
}
|
|
1352
|
+
var r = Zn(), o = e.sibling(e.child(r), 2), i = e.child(o);
|
|
1353
|
+
F(i, {
|
|
1246
1354
|
label: "Mode",
|
|
1247
|
-
onReset: () => a({ mode:
|
|
1248
|
-
children: (
|
|
1249
|
-
var
|
|
1250
|
-
|
|
1251
|
-
var
|
|
1252
|
-
|
|
1253
|
-
var
|
|
1254
|
-
|
|
1255
|
-
var
|
|
1256
|
-
e.init_select(
|
|
1257
|
-
|
|
1258
|
-
}), e.append(
|
|
1355
|
+
onReset: () => a({ mode: ve.mode }),
|
|
1356
|
+
children: (p, v) => {
|
|
1357
|
+
var f = Dn();
|
|
1358
|
+
f.__change = (S) => a({ mode: S.currentTarget.value });
|
|
1359
|
+
var x = e.child(f);
|
|
1360
|
+
x.value = x.__value = "scale";
|
|
1361
|
+
var y = e.sibling(x);
|
|
1362
|
+
y.value = y.__value = "px", e.reset(f);
|
|
1363
|
+
var w;
|
|
1364
|
+
e.init_select(f), e.template_effect(() => {
|
|
1365
|
+
w !== (w = t().mode) && (f.value = (f.__value = t().mode) ?? "", e.select_option(f, t().mode));
|
|
1366
|
+
}), e.append(p, f);
|
|
1259
1367
|
}
|
|
1260
1368
|
});
|
|
1261
|
-
var
|
|
1369
|
+
var h = e.sibling(i, 2);
|
|
1262
1370
|
{
|
|
1263
|
-
var
|
|
1264
|
-
F(
|
|
1371
|
+
var _ = (p) => {
|
|
1372
|
+
F(p, {
|
|
1265
1373
|
label: "Scale",
|
|
1266
|
-
onReset: () => a({ scale:
|
|
1267
|
-
children: (
|
|
1268
|
-
var
|
|
1269
|
-
e.remove_input_defaults(
|
|
1270
|
-
var
|
|
1271
|
-
e.remove_input_defaults(
|
|
1272
|
-
e.set_value(
|
|
1273
|
-
}), e.append(
|
|
1374
|
+
onReset: () => a({ scale: ve.scale }),
|
|
1375
|
+
children: (v, f) => {
|
|
1376
|
+
var x = Xn(), y = e.first_child(x);
|
|
1377
|
+
e.remove_input_defaults(y), y.__input = (S) => a({ scale: Number(S.currentTarget.value) });
|
|
1378
|
+
var w = e.sibling(y, 2);
|
|
1379
|
+
e.remove_input_defaults(w), w.__input = (S) => a({ scale: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1380
|
+
e.set_value(y, t().scale ?? 1), e.set_value(w, t().scale ?? 1);
|
|
1381
|
+
}), e.append(v, x);
|
|
1274
1382
|
}
|
|
1275
1383
|
});
|
|
1276
|
-
},
|
|
1277
|
-
var
|
|
1278
|
-
F(
|
|
1384
|
+
}, k = (p) => {
|
|
1385
|
+
var v = On(), f = e.first_child(v);
|
|
1386
|
+
F(f, {
|
|
1279
1387
|
label: "Width",
|
|
1280
1388
|
onReset: () => a({ width: void 0, minWidth: void 0, maxWidth: void 0 }),
|
|
1281
|
-
children: (
|
|
1282
|
-
var
|
|
1283
|
-
e.remove_input_defaults(
|
|
1284
|
-
const
|
|
1285
|
-
a(
|
|
1389
|
+
children: (w, S) => {
|
|
1390
|
+
var I = Yn(), P = e.first_child(I);
|
|
1391
|
+
e.remove_input_defaults(P), P.__input = (d) => {
|
|
1392
|
+
const c = d.currentTarget.value ? Number(d.currentTarget.value) : void 0, b = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "";
|
|
1393
|
+
a(b === "min" ? { width: c, minWidth: c, maxWidth: void 0 } : b === "max" ? { width: c, maxWidth: c, minWidth: void 0 } : { width: c });
|
|
1286
1394
|
};
|
|
1287
|
-
var
|
|
1288
|
-
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1395
|
+
var u = e.sibling(P, 2);
|
|
1396
|
+
u.__change = (d) => {
|
|
1397
|
+
const c = t().width ?? t().minWidth ?? t().maxWidth;
|
|
1398
|
+
d.currentTarget.value === "min" && c !== void 0 ? a({ minWidth: c, maxWidth: void 0 }) : d.currentTarget.value === "max" && c !== void 0 ? a({ maxWidth: c, minWidth: void 0 }) : a({ minWidth: void 0, maxWidth: void 0 });
|
|
1291
1399
|
};
|
|
1292
|
-
var
|
|
1293
|
-
|
|
1294
|
-
var
|
|
1295
|
-
|
|
1296
|
-
var
|
|
1297
|
-
|
|
1298
|
-
var
|
|
1299
|
-
e.init_select(
|
|
1300
|
-
e.set_value(
|
|
1301
|
-
}), e.append(
|
|
1400
|
+
var g = e.child(u);
|
|
1401
|
+
g.value = g.__value = "";
|
|
1402
|
+
var C = e.sibling(g);
|
|
1403
|
+
C.value = C.__value = "min";
|
|
1404
|
+
var M = e.sibling(C);
|
|
1405
|
+
M.value = M.__value = "max", e.reset(u);
|
|
1406
|
+
var l;
|
|
1407
|
+
e.init_select(u), e.template_effect(() => {
|
|
1408
|
+
e.set_value(P, t().width ?? t().minWidth ?? t().maxWidth ?? ""), l !== (l = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "") && (u.value = u.__value = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "", e.select_option(u, t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : ""));
|
|
1409
|
+
}), e.append(w, I);
|
|
1302
1410
|
}
|
|
1303
1411
|
});
|
|
1304
|
-
var
|
|
1305
|
-
F(
|
|
1412
|
+
var x = e.sibling(f, 2);
|
|
1413
|
+
F(x, {
|
|
1306
1414
|
label: "Height",
|
|
1307
1415
|
onReset: () => a({
|
|
1308
1416
|
height: void 0,
|
|
1309
1417
|
minHeight: void 0,
|
|
1310
1418
|
maxHeight: void 0
|
|
1311
1419
|
}),
|
|
1312
|
-
children: (
|
|
1313
|
-
var
|
|
1314
|
-
e.remove_input_defaults(
|
|
1315
|
-
const
|
|
1316
|
-
a(
|
|
1420
|
+
children: (w, S) => {
|
|
1421
|
+
var I = En(), P = e.first_child(I);
|
|
1422
|
+
e.remove_input_defaults(P), P.__input = (d) => {
|
|
1423
|
+
const c = d.currentTarget.value ? Number(d.currentTarget.value) : void 0, b = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "";
|
|
1424
|
+
a(b === "min" ? { height: c, minHeight: c, maxHeight: void 0 } : b === "max" ? { height: c, maxHeight: c, minHeight: void 0 } : { height: c });
|
|
1317
1425
|
};
|
|
1318
|
-
var
|
|
1319
|
-
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1426
|
+
var u = e.sibling(P, 2);
|
|
1427
|
+
u.__change = (d) => {
|
|
1428
|
+
const c = t().height ?? t().minHeight ?? t().maxHeight;
|
|
1429
|
+
d.currentTarget.value === "min" && c !== void 0 ? a({ minHeight: c, maxHeight: void 0 }) : d.currentTarget.value === "max" && c !== void 0 ? a({ maxHeight: c, minHeight: void 0 }) : a({ minHeight: void 0, maxHeight: void 0 });
|
|
1322
1430
|
};
|
|
1323
|
-
var
|
|
1324
|
-
|
|
1325
|
-
var
|
|
1326
|
-
|
|
1327
|
-
var
|
|
1328
|
-
|
|
1329
|
-
var
|
|
1330
|
-
e.init_select(
|
|
1331
|
-
e.set_value(
|
|
1332
|
-
}), e.append(
|
|
1431
|
+
var g = e.child(u);
|
|
1432
|
+
g.value = g.__value = "";
|
|
1433
|
+
var C = e.sibling(g);
|
|
1434
|
+
C.value = C.__value = "min";
|
|
1435
|
+
var M = e.sibling(C);
|
|
1436
|
+
M.value = M.__value = "max", e.reset(u);
|
|
1437
|
+
var l;
|
|
1438
|
+
e.init_select(u), e.template_effect(() => {
|
|
1439
|
+
e.set_value(P, t().height ?? t().minHeight ?? t().maxHeight ?? ""), l !== (l = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "") && (u.value = u.__value = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "", e.select_option(u, t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : ""));
|
|
1440
|
+
}), e.append(w, I);
|
|
1333
1441
|
}
|
|
1334
1442
|
});
|
|
1335
|
-
var
|
|
1336
|
-
F(
|
|
1443
|
+
var y = e.sibling(x, 2);
|
|
1444
|
+
F(y, {
|
|
1337
1445
|
label: "Maintain Aspect",
|
|
1338
|
-
onReset: () => a({ maintainAspectRatio:
|
|
1339
|
-
children: (
|
|
1340
|
-
var
|
|
1341
|
-
e.remove_input_defaults(
|
|
1446
|
+
onReset: () => a({ maintainAspectRatio: ve.maintainAspectRatio }),
|
|
1447
|
+
children: (w, S) => {
|
|
1448
|
+
var I = Ln();
|
|
1449
|
+
e.remove_input_defaults(I), I.__change = (P) => a({ maintainAspectRatio: P.currentTarget.checked }), e.template_effect(() => e.set_checked(I, t().maintainAspectRatio ?? !0)), e.append(w, I);
|
|
1342
1450
|
}
|
|
1343
|
-
}), e.append(
|
|
1451
|
+
}), e.append(p, v);
|
|
1344
1452
|
};
|
|
1345
|
-
e.if(
|
|
1346
|
-
t().mode === "scale" ?
|
|
1453
|
+
e.if(h, (p) => {
|
|
1454
|
+
t().mode === "scale" ? p(_) : p(k, !1);
|
|
1347
1455
|
});
|
|
1348
1456
|
}
|
|
1349
|
-
e.reset(
|
|
1457
|
+
e.reset(o), e.reset(r), e.append(s, r), e.pop();
|
|
1350
1458
|
}
|
|
1351
1459
|
e.delegate(["change", "input"]);
|
|
1352
|
-
var
|
|
1353
|
-
const
|
|
1460
|
+
var Un = e.from_html('<span class="section-toggle svelte-1h62jm0"> </span>'), Vn = e.from_html('<div class="section-content svelte-1h62jm0"><!></div>'), An = e.from_html('<div class="section svelte-1h62jm0"><div class="section-header svelte-1h62jm0"><h3 class="section-title svelte-1h62jm0"> </h3> <!></div> <!></div>');
|
|
1461
|
+
const Fn = {
|
|
1354
1462
|
hash: "svelte-1h62jm0",
|
|
1355
1463
|
code: ".section.svelte-1h62jm0 {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-header.svelte-1h62jm0 {display:flex;align-items:center;justify-content:space-between;padding:0.75rem 0;border-bottom:1px solid var(--color-border, #eee);cursor:pointer;}.section-title.svelte-1h62jm0 {margin:0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);}.section-toggle.svelte-1h62jm0 {font-size:0.75rem;color:var(--color-text-muted, #666);}.section-content.svelte-1h62jm0 {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}"
|
|
1356
1464
|
};
|
|
1357
|
-
function
|
|
1358
|
-
e.push(
|
|
1359
|
-
let t = e.state(e.proxy(
|
|
1360
|
-
var a =
|
|
1361
|
-
|
|
1362
|
-
var
|
|
1363
|
-
e.reset(
|
|
1364
|
-
var
|
|
1465
|
+
function Hn(s, n) {
|
|
1466
|
+
e.push(n, !0), e.append_styles(s, Fn);
|
|
1467
|
+
let t = e.state(e.proxy(n.config.defaultCollapsed ?? !1));
|
|
1468
|
+
var a = An(), r = e.child(a);
|
|
1469
|
+
r.__click = () => n.config.collapsible && e.set(t, !e.get(t));
|
|
1470
|
+
var o = e.child(r), i = e.child(o, !0);
|
|
1471
|
+
e.reset(o);
|
|
1472
|
+
var h = e.sibling(o, 2);
|
|
1365
1473
|
{
|
|
1366
|
-
var
|
|
1367
|
-
var
|
|
1368
|
-
e.reset(
|
|
1474
|
+
var _ = (v) => {
|
|
1475
|
+
var f = Un(), x = e.child(f, !0);
|
|
1476
|
+
e.reset(f), e.template_effect(() => e.set_text(x, e.get(t) ? "▼" : "▲")), e.append(v, f);
|
|
1369
1477
|
};
|
|
1370
|
-
e.if(
|
|
1371
|
-
|
|
1478
|
+
e.if(h, (v) => {
|
|
1479
|
+
n.config.collapsible && v(_);
|
|
1372
1480
|
});
|
|
1373
1481
|
}
|
|
1374
|
-
e.reset(
|
|
1375
|
-
var
|
|
1482
|
+
e.reset(r);
|
|
1483
|
+
var k = e.sibling(r, 2);
|
|
1376
1484
|
{
|
|
1377
|
-
var
|
|
1378
|
-
var
|
|
1379
|
-
e.snippet(
|
|
1485
|
+
var p = (v) => {
|
|
1486
|
+
var f = Vn(), x = e.child(f);
|
|
1487
|
+
e.snippet(x, () => n.children), e.reset(f), e.append(v, f);
|
|
1380
1488
|
};
|
|
1381
|
-
e.if(
|
|
1382
|
-
e.get(t) ||
|
|
1489
|
+
e.if(k, (v) => {
|
|
1490
|
+
e.get(t) || v(p);
|
|
1383
1491
|
});
|
|
1384
1492
|
}
|
|
1385
|
-
e.reset(a), e.template_effect(() => e.set_text(
|
|
1493
|
+
e.reset(a), e.template_effect(() => e.set_text(i, n.config.title)), e.append(s, a), e.pop();
|
|
1386
1494
|
}
|
|
1387
1495
|
e.delegate(["click"]);
|
|
1388
|
-
var
|
|
1389
|
-
const
|
|
1496
|
+
var Kn = e.from_html('<input type="checkbox"/>'), Jn = e.from_html('<select class="shape-select svelte-1ani6pi"><option>None</option><option>Plane</option><option>Cylinder</option><option>Sphere</option></select>'), Gn = e.from_html('<input type="range" step="0.5" min="0.5" max="4" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.5" min="0.5" max="4"/>', 1), $n = e.from_html('<input type="range" step="0.05" min="0.1" max="5" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.05" min="0.1" max="5"/>', 1), Qn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.01" min="-1" max="1"/>', 1), er = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.01" min="-1" max="1"/>', 1), tr = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Image Position & Sizing</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!></div></details>'), nr = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), rr = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), ar = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), sr = e.from_html('<input type="range" step="0.1" min="0" max="3" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.1" min="0" max="3"/>', 1), or = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!> <!></div></details>'), ir = e.from_html('<input type="range" step="10" min="50" max="2000" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="10" min="50" max="2000"/>', 1), lr = e.from_html('<input type="range" step="0.1" min="0" max="5" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.1" min="0" max="10"/>', 1), cr = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), dr = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), ur = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!> <!></div></details>'), pr = e.from_html('<input type="range" step="10" min="50" max="1000" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="10" min="50" max="1000"/>', 1), mr = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), fr = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!></div></details>'), vr = e.from_html('<input type="checkbox"/>'), hr = e.from_html('<input type="checkbox"/>'), gr = e.from_html('<input type="checkbox"/>'), br = e.from_html('<details class="subsection svelte-1ani6pi"><summary class="subsection-title svelte-1ani6pi">Debug Visualization</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!></div></details>'), _r = e.from_html("<!> <!> <!> <!> <!> <!> <!>", 1), yr = e.from_html("<!> <!>", 1);
|
|
1497
|
+
const wr = {
|
|
1390
1498
|
hash: "svelte-1ani6pi",
|
|
1391
1499
|
code: `.shape-select.svelte-1ani6pi {padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;background:var(--color-surface, #fff);}.manual-input.svelte-1ani6pi {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1ani6pi {flex:1;min-width:0;max-width:100%;}.subsection.svelte-1ani6pi {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection-title.svelte-1ani6pi {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-1ani6pi::-webkit-details-marker {display:none;}.subsection-title.svelte-1ani6pi::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-1ani6pi > .subsection-title:where(.svelte-1ani6pi)::before {transform:rotate(90deg);}.subsection-content.svelte-1ani6pi {padding-bottom:0.25rem;}`
|
|
1392
1500
|
};
|
|
1393
|
-
function
|
|
1394
|
-
e.push(
|
|
1395
|
-
const t = e.derived(() =>
|
|
1396
|
-
function
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1399
|
-
}
|
|
1400
|
-
function
|
|
1401
|
-
|
|
1501
|
+
function xr(s, n) {
|
|
1502
|
+
e.push(n, !0), e.append_styles(s, wr);
|
|
1503
|
+
const t = e.derived(() => n.effect ?? et), a = e.derived(() => e.get(t).image ?? se), r = e.derived(() => e.get(t).debug ?? fe);
|
|
1504
|
+
function o(x) {
|
|
1505
|
+
const y = { ...e.get(t), ...x };
|
|
1506
|
+
n.onChange(y);
|
|
1507
|
+
}
|
|
1508
|
+
function i(x) {
|
|
1509
|
+
o({
|
|
1402
1510
|
image: {
|
|
1403
1511
|
...se,
|
|
1404
1512
|
...e.get(t).image,
|
|
1405
|
-
...
|
|
1513
|
+
...x
|
|
1406
1514
|
}
|
|
1407
1515
|
});
|
|
1408
1516
|
}
|
|
1409
|
-
function
|
|
1410
|
-
|
|
1411
|
-
debug: { ...
|
|
1517
|
+
function h(x) {
|
|
1518
|
+
o({
|
|
1519
|
+
debug: { ...fe, ...e.get(t).debug, ...x }
|
|
1412
1520
|
});
|
|
1413
1521
|
}
|
|
1414
|
-
function
|
|
1415
|
-
|
|
1522
|
+
function _(x) {
|
|
1523
|
+
o({
|
|
1416
1524
|
cylinder: {
|
|
1417
1525
|
...ce,
|
|
1418
1526
|
...e.get(t).cylinder,
|
|
1419
|
-
...
|
|
1527
|
+
...x
|
|
1420
1528
|
}
|
|
1421
1529
|
});
|
|
1422
1530
|
}
|
|
1423
|
-
function
|
|
1424
|
-
|
|
1425
|
-
plane: { ...ae, ...e.get(t).plane, ...
|
|
1531
|
+
function k(x) {
|
|
1532
|
+
o({
|
|
1533
|
+
plane: { ...ae, ...e.get(t).plane, ...x }
|
|
1426
1534
|
});
|
|
1427
1535
|
}
|
|
1428
|
-
function
|
|
1429
|
-
|
|
1536
|
+
function p(x) {
|
|
1537
|
+
o({
|
|
1430
1538
|
sphere: {
|
|
1431
1539
|
...ke,
|
|
1432
1540
|
...e.get(t).sphere,
|
|
1433
|
-
...
|
|
1541
|
+
...x
|
|
1434
1542
|
}
|
|
1435
1543
|
});
|
|
1436
1544
|
}
|
|
1437
|
-
function
|
|
1438
|
-
e.get(t).enabled ?
|
|
1545
|
+
function v() {
|
|
1546
|
+
e.get(t).enabled ? o({ enabled: !1 }) : o({
|
|
1439
1547
|
enabled: !0,
|
|
1440
1548
|
shape: "plane",
|
|
1441
1549
|
plane: e.get(t).plane ?? { ...ae },
|
|
1442
1550
|
image: e.get(t).image ?? { ...se }
|
|
1443
1551
|
});
|
|
1444
1552
|
}
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1553
|
+
const f = { id: "warp", title: "Warp", collapsible: !0 };
|
|
1554
|
+
Hn(s, {
|
|
1447
1555
|
get config() {
|
|
1448
|
-
return
|
|
1556
|
+
return f;
|
|
1449
1557
|
},
|
|
1450
|
-
children: (
|
|
1451
|
-
var
|
|
1452
|
-
F(
|
|
1558
|
+
children: (x, y) => {
|
|
1559
|
+
var w = yr(), S = e.first_child(w);
|
|
1560
|
+
F(S, {
|
|
1453
1561
|
label: "Enabled",
|
|
1454
|
-
children: (
|
|
1455
|
-
var
|
|
1456
|
-
e.remove_input_defaults(
|
|
1562
|
+
children: (u, g) => {
|
|
1563
|
+
var C = Kn();
|
|
1564
|
+
e.remove_input_defaults(C), C.__change = v, e.template_effect(() => e.set_checked(C, e.get(t).enabled)), e.append(u, C);
|
|
1457
1565
|
}
|
|
1458
1566
|
});
|
|
1459
|
-
var
|
|
1567
|
+
var I = e.sibling(S, 2);
|
|
1460
1568
|
{
|
|
1461
|
-
var
|
|
1462
|
-
var
|
|
1463
|
-
F(
|
|
1569
|
+
var P = (u) => {
|
|
1570
|
+
var g = _r(), C = e.first_child(g);
|
|
1571
|
+
F(C, {
|
|
1464
1572
|
label: "Shape",
|
|
1465
|
-
children: (
|
|
1466
|
-
var
|
|
1467
|
-
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1573
|
+
children: (W, E) => {
|
|
1574
|
+
var Y = Jn();
|
|
1575
|
+
Y.__change = (Z) => {
|
|
1576
|
+
const B = Z.currentTarget.value;
|
|
1577
|
+
o({ shape: B }), B === "cylinder" && !e.get(t).cylinder && o({ cylinder: { ...ce } }), B === "plane" && !e.get(t).plane && o({ plane: { ...ae } }), B === "sphere" && !e.get(t).sphere && o({ sphere: { ...ke } });
|
|
1470
1578
|
};
|
|
1471
|
-
var
|
|
1472
|
-
|
|
1473
|
-
var q = e.sibling(
|
|
1579
|
+
var U = e.child(Y);
|
|
1580
|
+
U.value = U.__value = "none";
|
|
1581
|
+
var q = e.sibling(U);
|
|
1474
1582
|
q.value = q.__value = "plane";
|
|
1475
|
-
var
|
|
1476
|
-
|
|
1477
|
-
var
|
|
1478
|
-
|
|
1583
|
+
var J = e.sibling(q);
|
|
1584
|
+
J.value = J.__value = "cylinder";
|
|
1585
|
+
var A = e.sibling(J);
|
|
1586
|
+
A.value = A.__value = "sphere", e.reset(Y);
|
|
1479
1587
|
var G;
|
|
1480
|
-
e.init_select(
|
|
1481
|
-
G !== (G = e.get(t).shape) && (
|
|
1482
|
-
}), e.append(
|
|
1588
|
+
e.init_select(Y), e.template_effect(() => {
|
|
1589
|
+
G !== (G = e.get(t).shape) && (Y.value = (Y.__value = e.get(t).shape) ?? "", e.select_option(Y, e.get(t).shape));
|
|
1590
|
+
}), e.append(W, Y);
|
|
1483
1591
|
}
|
|
1484
1592
|
});
|
|
1485
|
-
var
|
|
1486
|
-
F(
|
|
1593
|
+
var M = e.sibling(C, 2);
|
|
1594
|
+
F(M, {
|
|
1487
1595
|
label: "Quality",
|
|
1488
|
-
onReset: () =>
|
|
1489
|
-
children: (
|
|
1490
|
-
var
|
|
1491
|
-
e.remove_input_defaults(
|
|
1492
|
-
var q = e.sibling(
|
|
1493
|
-
e.remove_input_defaults(q), q.__input = (
|
|
1494
|
-
e.set_value(
|
|
1495
|
-
}), e.append(
|
|
1596
|
+
onReset: () => o({ quality: et.quality }),
|
|
1597
|
+
children: (W, E) => {
|
|
1598
|
+
var Y = Gn(), U = e.first_child(Y);
|
|
1599
|
+
e.remove_input_defaults(U), U.__input = (J) => o({ quality: Number(J.currentTarget.value) });
|
|
1600
|
+
var q = e.sibling(U, 2);
|
|
1601
|
+
e.remove_input_defaults(q), q.__input = (J) => o({ quality: Number(J.currentTarget.value) }), e.template_effect(() => {
|
|
1602
|
+
e.set_value(U, e.get(t).quality ?? 1), e.set_value(q, e.get(t).quality ?? 1);
|
|
1603
|
+
}), e.append(W, Y);
|
|
1496
1604
|
}
|
|
1497
1605
|
});
|
|
1498
|
-
var
|
|
1606
|
+
var l = e.sibling(M, 2);
|
|
1499
1607
|
{
|
|
1500
|
-
var
|
|
1501
|
-
var
|
|
1502
|
-
F(
|
|
1608
|
+
var d = (W) => {
|
|
1609
|
+
var E = tr(), Y = e.sibling(e.child(E), 2), U = e.child(Y);
|
|
1610
|
+
F(U, {
|
|
1503
1611
|
label: "Scale",
|
|
1504
|
-
onReset: () =>
|
|
1505
|
-
children: (
|
|
1506
|
-
var
|
|
1507
|
-
e.remove_input_defaults(
|
|
1508
|
-
var
|
|
1509
|
-
e.remove_input_defaults(
|
|
1510
|
-
e.set_value(
|
|
1511
|
-
}), e.append(
|
|
1612
|
+
onReset: () => i({ scale: se.scale }),
|
|
1613
|
+
children: (A, G) => {
|
|
1614
|
+
var Z = $n(), B = e.first_child(Z);
|
|
1615
|
+
e.remove_input_defaults(B), B.__input = (D) => i({ scale: Number(D.currentTarget.value) });
|
|
1616
|
+
var O = e.sibling(B, 2);
|
|
1617
|
+
e.remove_input_defaults(O), O.__input = (D) => i({ scale: Number(D.currentTarget.value) }), e.template_effect(() => {
|
|
1618
|
+
e.set_value(B, e.get(a).scale), e.set_value(O, e.get(a).scale);
|
|
1619
|
+
}), e.append(A, Z);
|
|
1512
1620
|
}
|
|
1513
1621
|
});
|
|
1514
|
-
var q = e.sibling(
|
|
1622
|
+
var q = e.sibling(U, 2);
|
|
1515
1623
|
F(q, {
|
|
1516
1624
|
label: "Translate X",
|
|
1517
|
-
onReset: () =>
|
|
1518
|
-
children: (
|
|
1519
|
-
var
|
|
1520
|
-
e.remove_input_defaults(
|
|
1521
|
-
var
|
|
1522
|
-
e.remove_input_defaults(
|
|
1523
|
-
e.set_value(
|
|
1524
|
-
}), e.append(
|
|
1625
|
+
onReset: () => i({ translateX: se.translateX }),
|
|
1626
|
+
children: (A, G) => {
|
|
1627
|
+
var Z = Qn(), B = e.first_child(Z);
|
|
1628
|
+
e.remove_input_defaults(B), B.__input = (D) => i({ translateX: Number(D.currentTarget.value) });
|
|
1629
|
+
var O = e.sibling(B, 2);
|
|
1630
|
+
e.remove_input_defaults(O), O.__input = (D) => i({ translateX: Number(D.currentTarget.value) }), e.template_effect(() => {
|
|
1631
|
+
e.set_value(B, e.get(a).translateX), e.set_value(O, e.get(a).translateX);
|
|
1632
|
+
}), e.append(A, Z);
|
|
1525
1633
|
}
|
|
1526
1634
|
});
|
|
1527
|
-
var
|
|
1528
|
-
F(
|
|
1635
|
+
var J = e.sibling(q, 2);
|
|
1636
|
+
F(J, {
|
|
1529
1637
|
label: "Translate Y",
|
|
1530
|
-
onReset: () =>
|
|
1531
|
-
children: (
|
|
1532
|
-
var
|
|
1533
|
-
e.remove_input_defaults(
|
|
1534
|
-
var
|
|
1535
|
-
e.remove_input_defaults(
|
|
1536
|
-
e.set_value(
|
|
1537
|
-
}), e.append(
|
|
1638
|
+
onReset: () => i({ translateY: se.translateY }),
|
|
1639
|
+
children: (A, G) => {
|
|
1640
|
+
var Z = er(), B = e.first_child(Z);
|
|
1641
|
+
e.remove_input_defaults(B), B.__input = (D) => i({ translateY: Number(D.currentTarget.value) });
|
|
1642
|
+
var O = e.sibling(B, 2);
|
|
1643
|
+
e.remove_input_defaults(O), O.__input = (D) => i({ translateY: Number(D.currentTarget.value) }), e.template_effect(() => {
|
|
1644
|
+
e.set_value(B, e.get(a).translateY), e.set_value(O, e.get(a).translateY);
|
|
1645
|
+
}), e.append(A, Z);
|
|
1538
1646
|
}
|
|
1539
|
-
}), e.reset(
|
|
1647
|
+
}), e.reset(Y), e.reset(E), e.append(W, E);
|
|
1540
1648
|
};
|
|
1541
|
-
e.if(
|
|
1542
|
-
e.get(t).shape !== "none" &&
|
|
1649
|
+
e.if(l, (W) => {
|
|
1650
|
+
e.get(t).shape !== "none" && W(d);
|
|
1543
1651
|
});
|
|
1544
1652
|
}
|
|
1545
|
-
var
|
|
1653
|
+
var c = e.sibling(l, 2);
|
|
1546
1654
|
{
|
|
1547
|
-
var
|
|
1548
|
-
const
|
|
1549
|
-
var
|
|
1655
|
+
var b = (W) => {
|
|
1656
|
+
const E = e.derived(() => e.get(t).plane);
|
|
1657
|
+
var Y = or(), U = e.sibling(e.child(Y), 2), q = e.child(U);
|
|
1550
1658
|
F(q, {
|
|
1551
1659
|
label: "Rotation X",
|
|
1552
|
-
onReset: () =>
|
|
1553
|
-
children: (
|
|
1554
|
-
var
|
|
1555
|
-
e.remove_input_defaults(
|
|
1556
|
-
var
|
|
1557
|
-
e.remove_input_defaults(
|
|
1558
|
-
e.set_value(
|
|
1559
|
-
}), e.append(
|
|
1660
|
+
onReset: () => k({ rotationX: ae.rotationX }),
|
|
1661
|
+
children: (Z, B) => {
|
|
1662
|
+
var O = nr(), D = e.first_child(O);
|
|
1663
|
+
e.remove_input_defaults(D), D.__input = (H) => k({ rotationX: Number(H.currentTarget.value) });
|
|
1664
|
+
var K = e.sibling(D, 2);
|
|
1665
|
+
e.remove_input_defaults(K), K.__input = (H) => k({ rotationX: Number(H.currentTarget.value) }), e.template_effect(() => {
|
|
1666
|
+
e.set_value(D, e.get(E).rotationX), e.set_value(K, e.get(E).rotationX);
|
|
1667
|
+
}), e.append(Z, O);
|
|
1560
1668
|
}
|
|
1561
1669
|
});
|
|
1562
|
-
var
|
|
1563
|
-
F(
|
|
1670
|
+
var J = e.sibling(q, 2);
|
|
1671
|
+
F(J, {
|
|
1564
1672
|
label: "Rotation Y",
|
|
1565
|
-
onReset: () =>
|
|
1566
|
-
children: (
|
|
1567
|
-
var
|
|
1568
|
-
e.remove_input_defaults(
|
|
1569
|
-
var
|
|
1570
|
-
e.remove_input_defaults(
|
|
1571
|
-
e.set_value(
|
|
1572
|
-
}), e.append(
|
|
1673
|
+
onReset: () => k({ rotationY: ae.rotationY }),
|
|
1674
|
+
children: (Z, B) => {
|
|
1675
|
+
var O = rr(), D = e.first_child(O);
|
|
1676
|
+
e.remove_input_defaults(D), D.__input = (H) => k({ rotationY: Number(H.currentTarget.value) });
|
|
1677
|
+
var K = e.sibling(D, 2);
|
|
1678
|
+
e.remove_input_defaults(K), K.__input = (H) => k({ rotationY: Number(H.currentTarget.value) }), e.template_effect(() => {
|
|
1679
|
+
e.set_value(D, e.get(E).rotationY), e.set_value(K, e.get(E).rotationY);
|
|
1680
|
+
}), e.append(Z, O);
|
|
1573
1681
|
}
|
|
1574
1682
|
});
|
|
1575
|
-
var
|
|
1576
|
-
F(
|
|
1683
|
+
var A = e.sibling(J, 2);
|
|
1684
|
+
F(A, {
|
|
1577
1685
|
label: "Rotation Z",
|
|
1578
|
-
onReset: () =>
|
|
1579
|
-
children: (
|
|
1580
|
-
var
|
|
1581
|
-
e.remove_input_defaults(
|
|
1582
|
-
var
|
|
1583
|
-
e.remove_input_defaults(
|
|
1584
|
-
e.set_value(
|
|
1585
|
-
}), e.append(
|
|
1686
|
+
onReset: () => k({ rotationZ: ae.rotationZ }),
|
|
1687
|
+
children: (Z, B) => {
|
|
1688
|
+
var O = ar(), D = e.first_child(O);
|
|
1689
|
+
e.remove_input_defaults(D), D.__input = (H) => k({ rotationZ: Number(H.currentTarget.value) });
|
|
1690
|
+
var K = e.sibling(D, 2);
|
|
1691
|
+
e.remove_input_defaults(K), K.__input = (H) => k({ rotationZ: Number(H.currentTarget.value) }), e.template_effect(() => {
|
|
1692
|
+
e.set_value(D, e.get(E).rotationZ), e.set_value(K, e.get(E).rotationZ);
|
|
1693
|
+
}), e.append(Z, O);
|
|
1586
1694
|
}
|
|
1587
1695
|
});
|
|
1588
|
-
var G = e.sibling(
|
|
1696
|
+
var G = e.sibling(A, 2);
|
|
1589
1697
|
F(G, {
|
|
1590
1698
|
label: "Perspective",
|
|
1591
|
-
onReset: () =>
|
|
1592
|
-
children: (
|
|
1593
|
-
var
|
|
1594
|
-
e.remove_input_defaults(
|
|
1595
|
-
var
|
|
1596
|
-
e.remove_input_defaults(
|
|
1597
|
-
e.set_value(
|
|
1598
|
-
}), e.append(
|
|
1699
|
+
onReset: () => k({ depthScale: ae.depthScale }),
|
|
1700
|
+
children: (Z, B) => {
|
|
1701
|
+
var O = sr(), D = e.first_child(O);
|
|
1702
|
+
e.remove_input_defaults(D), D.__input = (H) => k({ depthScale: Number(H.currentTarget.value) });
|
|
1703
|
+
var K = e.sibling(D, 2);
|
|
1704
|
+
e.remove_input_defaults(K), K.__input = (H) => k({ depthScale: Number(H.currentTarget.value) }), e.template_effect(() => {
|
|
1705
|
+
e.set_value(D, e.get(E).depthScale), e.set_value(K, e.get(E).depthScale);
|
|
1706
|
+
}), e.append(Z, O);
|
|
1599
1707
|
}
|
|
1600
|
-
}), e.reset(
|
|
1708
|
+
}), e.reset(U), e.reset(Y), e.append(W, Y);
|
|
1601
1709
|
};
|
|
1602
|
-
e.if(
|
|
1603
|
-
e.get(t).shape === "plane" && e.get(t).plane &&
|
|
1710
|
+
e.if(c, (W) => {
|
|
1711
|
+
e.get(t).shape === "plane" && e.get(t).plane && W(b);
|
|
1604
1712
|
});
|
|
1605
1713
|
}
|
|
1606
|
-
var
|
|
1714
|
+
var T = e.sibling(c, 2);
|
|
1607
1715
|
{
|
|
1608
|
-
var
|
|
1609
|
-
const
|
|
1610
|
-
var
|
|
1716
|
+
var m = (W) => {
|
|
1717
|
+
const E = e.derived(() => e.get(t).cylinder);
|
|
1718
|
+
var Y = ur(), U = e.sibling(e.child(Y), 2), q = e.child(U);
|
|
1611
1719
|
F(q, {
|
|
1612
1720
|
label: "Diameter",
|
|
1613
|
-
onReset: () =>
|
|
1614
|
-
children: (
|
|
1615
|
-
var
|
|
1616
|
-
e.remove_input_defaults(
|
|
1617
|
-
var
|
|
1618
|
-
e.remove_input_defaults(
|
|
1619
|
-
e.set_value(
|
|
1620
|
-
}), e.append(
|
|
1721
|
+
onReset: () => _({ diameter: ce.diameter }),
|
|
1722
|
+
children: (Z, B) => {
|
|
1723
|
+
var O = ir(), D = e.first_child(O);
|
|
1724
|
+
e.remove_input_defaults(D), D.__input = (H) => _({ diameter: Number(H.currentTarget.value) });
|
|
1725
|
+
var K = e.sibling(D, 2);
|
|
1726
|
+
e.remove_input_defaults(K), K.__input = (H) => _({ diameter: Number(H.currentTarget.value) }), e.template_effect(() => {
|
|
1727
|
+
e.set_value(D, e.get(E).diameter), e.set_value(K, e.get(E).diameter);
|
|
1728
|
+
}), e.append(Z, O);
|
|
1621
1729
|
}
|
|
1622
1730
|
});
|
|
1623
|
-
var
|
|
1624
|
-
F(
|
|
1731
|
+
var J = e.sibling(q, 2);
|
|
1732
|
+
F(J, {
|
|
1625
1733
|
label: "Perspective",
|
|
1626
|
-
onReset: () =>
|
|
1627
|
-
children: (
|
|
1628
|
-
var
|
|
1629
|
-
e.remove_input_defaults(
|
|
1630
|
-
var
|
|
1631
|
-
e.remove_input_defaults(
|
|
1632
|
-
e.set_value(
|
|
1633
|
-
}), e.append(
|
|
1734
|
+
onReset: () => _({ perspective: ce.perspective }),
|
|
1735
|
+
children: (Z, B) => {
|
|
1736
|
+
var O = lr(), D = e.first_child(O);
|
|
1737
|
+
e.remove_input_defaults(D), D.__input = (H) => _({ perspective: Number(H.currentTarget.value) });
|
|
1738
|
+
var K = e.sibling(D, 2);
|
|
1739
|
+
e.remove_input_defaults(K), K.__input = (H) => _({ perspective: Number(H.currentTarget.value) }), e.template_effect(() => {
|
|
1740
|
+
e.set_value(D, e.get(E).perspective ?? 1), e.set_value(K, e.get(E).perspective ?? 1);
|
|
1741
|
+
}), e.append(Z, O);
|
|
1634
1742
|
}
|
|
1635
1743
|
});
|
|
1636
|
-
var
|
|
1637
|
-
F(
|
|
1744
|
+
var A = e.sibling(J, 2);
|
|
1745
|
+
F(A, {
|
|
1638
1746
|
label: "Tilt (X)",
|
|
1639
|
-
onReset: () =>
|
|
1640
|
-
children: (
|
|
1641
|
-
var
|
|
1642
|
-
e.remove_input_defaults(
|
|
1643
|
-
var
|
|
1644
|
-
e.remove_input_defaults(
|
|
1645
|
-
e.set_value(
|
|
1646
|
-
}), e.append(
|
|
1747
|
+
onReset: () => _({ rotationX: ce.rotationX }),
|
|
1748
|
+
children: (Z, B) => {
|
|
1749
|
+
var O = cr(), D = e.first_child(O);
|
|
1750
|
+
e.remove_input_defaults(D), D.__input = (H) => _({ rotationX: Number(H.currentTarget.value) });
|
|
1751
|
+
var K = e.sibling(D, 2);
|
|
1752
|
+
e.remove_input_defaults(K), K.__input = (H) => _({ rotationX: Number(H.currentTarget.value) }), e.template_effect(() => {
|
|
1753
|
+
e.set_value(D, e.get(E).rotationX), e.set_value(K, e.get(E).rotationX);
|
|
1754
|
+
}), e.append(Z, O);
|
|
1647
1755
|
}
|
|
1648
1756
|
});
|
|
1649
|
-
var G = e.sibling(
|
|
1757
|
+
var G = e.sibling(A, 2);
|
|
1650
1758
|
F(G, {
|
|
1651
1759
|
label: "Spin (Z)",
|
|
1652
|
-
onReset: () =>
|
|
1653
|
-
children: (
|
|
1654
|
-
var
|
|
1655
|
-
e.remove_input_defaults(
|
|
1656
|
-
var
|
|
1657
|
-
e.remove_input_defaults(
|
|
1658
|
-
e.set_value(
|
|
1659
|
-
}), e.append(
|
|
1760
|
+
onReset: () => _({ rotationZ: ce.rotationZ }),
|
|
1761
|
+
children: (Z, B) => {
|
|
1762
|
+
var O = dr(), D = e.first_child(O);
|
|
1763
|
+
e.remove_input_defaults(D), D.__input = (H) => _({ rotationZ: Number(H.currentTarget.value) });
|
|
1764
|
+
var K = e.sibling(D, 2);
|
|
1765
|
+
e.remove_input_defaults(K), K.__input = (H) => _({ rotationZ: Number(H.currentTarget.value) }), e.template_effect(() => {
|
|
1766
|
+
e.set_value(D, e.get(E).rotationZ), e.set_value(K, e.get(E).rotationZ);
|
|
1767
|
+
}), e.append(Z, O);
|
|
1660
1768
|
}
|
|
1661
|
-
}), e.reset(
|
|
1769
|
+
}), e.reset(U), e.reset(Y), e.append(W, Y);
|
|
1662
1770
|
};
|
|
1663
|
-
e.if(
|
|
1664
|
-
e.get(t).shape === "cylinder" && e.get(t).cylinder &&
|
|
1771
|
+
e.if(T, (W) => {
|
|
1772
|
+
e.get(t).shape === "cylinder" && e.get(t).cylinder && W(m);
|
|
1665
1773
|
});
|
|
1666
1774
|
}
|
|
1667
|
-
var
|
|
1775
|
+
var R = e.sibling(T, 2);
|
|
1668
1776
|
{
|
|
1669
|
-
var
|
|
1670
|
-
const
|
|
1671
|
-
var
|
|
1777
|
+
var z = (W) => {
|
|
1778
|
+
const E = e.derived(() => e.get(t).sphere);
|
|
1779
|
+
var Y = fr(), U = e.sibling(e.child(Y), 2), q = e.child(U);
|
|
1672
1780
|
F(q, {
|
|
1673
1781
|
label: "Radius",
|
|
1674
|
-
onReset: () =>
|
|
1675
|
-
children: (
|
|
1676
|
-
var
|
|
1677
|
-
e.remove_input_defaults(
|
|
1678
|
-
var
|
|
1679
|
-
e.remove_input_defaults(
|
|
1680
|
-
e.set_value(
|
|
1681
|
-
}), e.append(
|
|
1782
|
+
onReset: () => p({ radius: ke.radius }),
|
|
1783
|
+
children: (A, G) => {
|
|
1784
|
+
var Z = pr(), B = e.first_child(Z);
|
|
1785
|
+
e.remove_input_defaults(B), B.__input = (D) => p({ radius: Number(D.currentTarget.value) });
|
|
1786
|
+
var O = e.sibling(B, 2);
|
|
1787
|
+
e.remove_input_defaults(O), O.__input = (D) => p({ radius: Number(D.currentTarget.value) }), e.template_effect(() => {
|
|
1788
|
+
e.set_value(B, e.get(E).radius), e.set_value(O, e.get(E).radius);
|
|
1789
|
+
}), e.append(A, Z);
|
|
1682
1790
|
}
|
|
1683
1791
|
});
|
|
1684
|
-
var
|
|
1685
|
-
F(
|
|
1792
|
+
var J = e.sibling(q, 2);
|
|
1793
|
+
F(J, {
|
|
1686
1794
|
label: "Spin (Z)",
|
|
1687
|
-
onReset: () =>
|
|
1688
|
-
children: (
|
|
1689
|
-
var
|
|
1690
|
-
e.remove_input_defaults(
|
|
1691
|
-
var
|
|
1692
|
-
e.remove_input_defaults(
|
|
1693
|
-
e.set_value(
|
|
1694
|
-
}), e.append(
|
|
1795
|
+
onReset: () => p({ rotationZ: ke.rotationZ }),
|
|
1796
|
+
children: (A, G) => {
|
|
1797
|
+
var Z = mr(), B = e.first_child(Z);
|
|
1798
|
+
e.remove_input_defaults(B), B.__input = (D) => p({ rotationZ: Number(D.currentTarget.value) });
|
|
1799
|
+
var O = e.sibling(B, 2);
|
|
1800
|
+
e.remove_input_defaults(O), O.__input = (D) => p({ rotationZ: Number(D.currentTarget.value) }), e.template_effect(() => {
|
|
1801
|
+
e.set_value(B, e.get(E).rotationZ), e.set_value(O, e.get(E).rotationZ);
|
|
1802
|
+
}), e.append(A, Z);
|
|
1695
1803
|
}
|
|
1696
|
-
}), e.reset(
|
|
1804
|
+
}), e.reset(U), e.reset(Y), e.append(W, Y);
|
|
1697
1805
|
};
|
|
1698
|
-
e.if(
|
|
1699
|
-
e.get(t).shape === "sphere" && e.get(t).sphere &&
|
|
1806
|
+
e.if(R, (W) => {
|
|
1807
|
+
e.get(t).shape === "sphere" && e.get(t).sphere && W(z);
|
|
1700
1808
|
});
|
|
1701
1809
|
}
|
|
1702
|
-
var
|
|
1810
|
+
var N = e.sibling(R, 2);
|
|
1703
1811
|
{
|
|
1704
|
-
var
|
|
1705
|
-
var
|
|
1706
|
-
F(
|
|
1812
|
+
var L = (W) => {
|
|
1813
|
+
var E = br(), Y = e.sibling(e.child(E), 2), U = e.child(Y);
|
|
1814
|
+
F(U, {
|
|
1707
1815
|
label: "Show Grid/Bounds",
|
|
1708
|
-
onReset: () =>
|
|
1709
|
-
children: (
|
|
1710
|
-
var
|
|
1711
|
-
e.remove_input_defaults(
|
|
1816
|
+
onReset: () => h({ showBounds: fe.showBounds }),
|
|
1817
|
+
children: (A, G) => {
|
|
1818
|
+
var Z = vr();
|
|
1819
|
+
e.remove_input_defaults(Z), Z.__change = (B) => h({ showBounds: B.currentTarget.checked }), e.template_effect(() => e.set_checked(Z, e.get(r).showBounds)), e.append(A, Z);
|
|
1712
1820
|
}
|
|
1713
1821
|
});
|
|
1714
|
-
var q = e.sibling(
|
|
1822
|
+
var q = e.sibling(U, 2);
|
|
1715
1823
|
F(q, {
|
|
1716
1824
|
label: "Depth Shader",
|
|
1717
|
-
onReset: () =>
|
|
1718
|
-
children: (
|
|
1719
|
-
var
|
|
1720
|
-
e.remove_input_defaults(
|
|
1825
|
+
onReset: () => h({ showDepthVis: fe.showDepthVis }),
|
|
1826
|
+
children: (A, G) => {
|
|
1827
|
+
var Z = hr();
|
|
1828
|
+
e.remove_input_defaults(Z), Z.__change = (B) => h({ showDepthVis: B.currentTarget.checked }), e.template_effect(() => e.set_checked(Z, e.get(r).showDepthVis)), e.append(A, Z);
|
|
1721
1829
|
}
|
|
1722
1830
|
});
|
|
1723
|
-
var
|
|
1724
|
-
F(
|
|
1831
|
+
var J = e.sibling(q, 2);
|
|
1832
|
+
F(J, {
|
|
1725
1833
|
label: "Crosshair",
|
|
1726
|
-
onReset: () =>
|
|
1727
|
-
children: (
|
|
1728
|
-
var
|
|
1729
|
-
e.remove_input_defaults(
|
|
1834
|
+
onReset: () => h({ showCrosshair: fe.showCrosshair }),
|
|
1835
|
+
children: (A, G) => {
|
|
1836
|
+
var Z = gr();
|
|
1837
|
+
e.remove_input_defaults(Z), Z.__change = (B) => h({ showCrosshair: B.currentTarget.checked }), e.template_effect(() => e.set_checked(Z, e.get(r).showCrosshair)), e.append(A, Z);
|
|
1730
1838
|
}
|
|
1731
|
-
}), e.reset(
|
|
1839
|
+
}), e.reset(Y), e.reset(E), e.append(W, E);
|
|
1732
1840
|
};
|
|
1733
|
-
e.if(
|
|
1734
|
-
e.get(t).shape !== "none" &&
|
|
1841
|
+
e.if(N, (W) => {
|
|
1842
|
+
e.get(t).shape !== "none" && W(L);
|
|
1735
1843
|
});
|
|
1736
1844
|
}
|
|
1737
|
-
e.append(
|
|
1845
|
+
e.append(u, g);
|
|
1738
1846
|
};
|
|
1739
|
-
e.if(
|
|
1740
|
-
e.get(t).enabled &&
|
|
1847
|
+
e.if(I, (u) => {
|
|
1848
|
+
e.get(t).enabled && u(P);
|
|
1741
1849
|
});
|
|
1742
1850
|
}
|
|
1743
|
-
e.append(
|
|
1851
|
+
e.append(x, w);
|
|
1744
1852
|
},
|
|
1745
1853
|
$$slots: { default: !0 }
|
|
1746
1854
|
}), e.pop();
|
|
1747
1855
|
}
|
|
1748
1856
|
e.delegate(["change", "input"]);
|
|
1749
|
-
var
|
|
1750
|
-
const
|
|
1857
|
+
var kr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), Mr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), Tr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), Sr = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-180" max="180"/>', 1), zr = e.from_html('<input type="range" step="0.01" min="-2" max="2" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-2" max="2"/>', 1), Ir = e.from_html('<input type="range" step="0.01" min="0.1" max="3" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="0.1" max="3"/>', 1), Pr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), Cr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), jr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), Nr = e.from_html('<input type="range" step="1" min="-100" max="100" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-100" max="100"/>', 1), Rr = e.from_html('<input type="range" step="1" min="-100" max="100" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-100" max="100"/>', 1), Wr = e.from_html('<details class="section svelte-1f6utug" open=""><summary class="section-title svelte-1f6utug">Restyle</summary> <div class="section-content svelte-1f6utug"><details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Basic Adjustments</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!> <!></div></details> <details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Exposure & Tone</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!> <!></div></details> <details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Color & White Balance</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!></div></details></div></details>');
|
|
1858
|
+
const Dr = {
|
|
1751
1859
|
hash: "svelte-1f6utug",
|
|
1752
1860
|
code: `.section.svelte-1f6utug {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-1f6utug {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-1f6utug::-webkit-details-marker {display:none;}.section-title.svelte-1f6utug::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-1f6utug > .section-title:where(.svelte-1f6utug)::before {transform:rotate(90deg);}.section-content.svelte-1f6utug {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.manual-input.svelte-1f6utug {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1f6utug {flex:1;min-width:0;max-width:100%;}.subsection.svelte-1f6utug {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection.svelte-1f6utug:first-child {margin-top:0;border-top:none;}.subsection-title.svelte-1f6utug {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-1f6utug::-webkit-details-marker {display:none;}.subsection-title.svelte-1f6utug::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-1f6utug > .subsection-title:where(.svelte-1f6utug)::before {transform:rotate(90deg);}.subsection-content.svelte-1f6utug {padding-bottom:0.25rem;}`
|
|
1753
1861
|
};
|
|
1754
|
-
function
|
|
1755
|
-
e.push(
|
|
1756
|
-
let t = e.prop(
|
|
1757
|
-
function a(
|
|
1758
|
-
|
|
1862
|
+
function Xr(s, n) {
|
|
1863
|
+
e.push(n, !0), e.append_styles(s, Dr);
|
|
1864
|
+
let t = e.prop(n, "effect", 3, ee);
|
|
1865
|
+
function a(l) {
|
|
1866
|
+
n.onChange({ ...t(), ...l });
|
|
1759
1867
|
}
|
|
1760
|
-
var
|
|
1761
|
-
F(
|
|
1868
|
+
var r = Wr(), o = e.sibling(e.child(r), 2), i = e.child(o), h = e.sibling(e.child(i), 2), _ = e.child(h);
|
|
1869
|
+
F(_, {
|
|
1762
1870
|
label: "Brightness",
|
|
1763
1871
|
onReset: () => a({ brightness: ee.brightness }),
|
|
1764
|
-
children: (
|
|
1765
|
-
var
|
|
1766
|
-
e.remove_input_defaults(
|
|
1767
|
-
var
|
|
1768
|
-
e.remove_input_defaults(
|
|
1769
|
-
e.set_value(
|
|
1770
|
-
}), e.append(
|
|
1872
|
+
children: (l, d) => {
|
|
1873
|
+
var c = kr(), b = e.first_child(c);
|
|
1874
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ brightness: Number(m.currentTarget.value) });
|
|
1875
|
+
var T = e.sibling(b, 2);
|
|
1876
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ brightness: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1877
|
+
e.set_value(b, t().brightness), e.set_value(T, t().brightness);
|
|
1878
|
+
}), e.append(l, c);
|
|
1771
1879
|
}
|
|
1772
1880
|
});
|
|
1773
|
-
var
|
|
1774
|
-
F(
|
|
1881
|
+
var k = e.sibling(_, 2);
|
|
1882
|
+
F(k, {
|
|
1775
1883
|
label: "Contrast",
|
|
1776
1884
|
onReset: () => a({ contrast: ee.contrast }),
|
|
1777
|
-
children: (
|
|
1778
|
-
var
|
|
1779
|
-
e.remove_input_defaults(
|
|
1780
|
-
var
|
|
1781
|
-
e.remove_input_defaults(
|
|
1782
|
-
e.set_value(
|
|
1783
|
-
}), e.append(
|
|
1885
|
+
children: (l, d) => {
|
|
1886
|
+
var c = Mr(), b = e.first_child(c);
|
|
1887
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ contrast: Number(m.currentTarget.value) });
|
|
1888
|
+
var T = e.sibling(b, 2);
|
|
1889
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ contrast: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1890
|
+
e.set_value(b, t().contrast), e.set_value(T, t().contrast);
|
|
1891
|
+
}), e.append(l, c);
|
|
1784
1892
|
}
|
|
1785
1893
|
});
|
|
1786
|
-
var
|
|
1787
|
-
F(
|
|
1894
|
+
var p = e.sibling(k, 2);
|
|
1895
|
+
F(p, {
|
|
1788
1896
|
label: "Saturation",
|
|
1789
1897
|
onReset: () => a({ saturation: ee.saturation }),
|
|
1790
|
-
children: (
|
|
1791
|
-
var
|
|
1792
|
-
e.remove_input_defaults(
|
|
1793
|
-
var
|
|
1794
|
-
e.remove_input_defaults(
|
|
1795
|
-
e.set_value(
|
|
1796
|
-
}), e.append(
|
|
1898
|
+
children: (l, d) => {
|
|
1899
|
+
var c = Tr(), b = e.first_child(c);
|
|
1900
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ saturation: Number(m.currentTarget.value) });
|
|
1901
|
+
var T = e.sibling(b, 2);
|
|
1902
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ saturation: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1903
|
+
e.set_value(b, t().saturation), e.set_value(T, t().saturation);
|
|
1904
|
+
}), e.append(l, c);
|
|
1797
1905
|
}
|
|
1798
1906
|
});
|
|
1799
|
-
var
|
|
1800
|
-
F(
|
|
1907
|
+
var v = e.sibling(p, 2);
|
|
1908
|
+
F(v, {
|
|
1801
1909
|
label: "Hue (°)",
|
|
1802
1910
|
onReset: () => a({ hue: ee.hue }),
|
|
1803
|
-
children: (
|
|
1804
|
-
var
|
|
1805
|
-
e.remove_input_defaults(
|
|
1806
|
-
var
|
|
1807
|
-
e.remove_input_defaults(
|
|
1808
|
-
e.set_value(
|
|
1809
|
-
}), e.append(
|
|
1911
|
+
children: (l, d) => {
|
|
1912
|
+
var c = Sr(), b = e.first_child(c);
|
|
1913
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ hue: Number(m.currentTarget.value) });
|
|
1914
|
+
var T = e.sibling(b, 2);
|
|
1915
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ hue: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1916
|
+
e.set_value(b, t().hue), e.set_value(T, t().hue);
|
|
1917
|
+
}), e.append(l, c);
|
|
1810
1918
|
}
|
|
1811
|
-
}), e.reset(
|
|
1812
|
-
var
|
|
1813
|
-
F(
|
|
1919
|
+
}), e.reset(h), e.reset(i);
|
|
1920
|
+
var f = e.sibling(i, 2), x = e.sibling(e.child(f), 2), y = e.child(x);
|
|
1921
|
+
F(y, {
|
|
1814
1922
|
label: "Exposure",
|
|
1815
1923
|
onReset: () => a({ exposure: ee.exposure }),
|
|
1816
|
-
children: (
|
|
1817
|
-
var
|
|
1818
|
-
e.remove_input_defaults(
|
|
1819
|
-
var
|
|
1820
|
-
e.remove_input_defaults(
|
|
1821
|
-
e.set_value(
|
|
1822
|
-
}), e.append(
|
|
1924
|
+
children: (l, d) => {
|
|
1925
|
+
var c = zr(), b = e.first_child(c);
|
|
1926
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ exposure: Number(m.currentTarget.value) });
|
|
1927
|
+
var T = e.sibling(b, 2);
|
|
1928
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ exposure: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1929
|
+
e.set_value(b, t().exposure), e.set_value(T, t().exposure);
|
|
1930
|
+
}), e.append(l, c);
|
|
1823
1931
|
}
|
|
1824
1932
|
});
|
|
1825
|
-
var
|
|
1826
|
-
F(
|
|
1933
|
+
var w = e.sibling(y, 2);
|
|
1934
|
+
F(w, {
|
|
1827
1935
|
label: "Gamma",
|
|
1828
1936
|
onReset: () => a({ gamma: ee.gamma }),
|
|
1829
|
-
children: (
|
|
1830
|
-
var
|
|
1831
|
-
e.remove_input_defaults(
|
|
1832
|
-
var
|
|
1833
|
-
e.remove_input_defaults(
|
|
1834
|
-
e.set_value(
|
|
1835
|
-
}), e.append(
|
|
1937
|
+
children: (l, d) => {
|
|
1938
|
+
var c = Ir(), b = e.first_child(c);
|
|
1939
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ gamma: Number(m.currentTarget.value) });
|
|
1940
|
+
var T = e.sibling(b, 2);
|
|
1941
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ gamma: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1942
|
+
e.set_value(b, t().gamma), e.set_value(T, t().gamma);
|
|
1943
|
+
}), e.append(l, c);
|
|
1836
1944
|
}
|
|
1837
1945
|
});
|
|
1838
|
-
var
|
|
1839
|
-
F(
|
|
1946
|
+
var S = e.sibling(w, 2);
|
|
1947
|
+
F(S, {
|
|
1840
1948
|
label: "Shadows",
|
|
1841
1949
|
onReset: () => a({ shadows: ee.shadows }),
|
|
1842
|
-
children: (
|
|
1843
|
-
var
|
|
1844
|
-
e.remove_input_defaults(
|
|
1845
|
-
var
|
|
1846
|
-
e.remove_input_defaults(
|
|
1847
|
-
e.set_value(
|
|
1848
|
-
}), e.append(
|
|
1950
|
+
children: (l, d) => {
|
|
1951
|
+
var c = Pr(), b = e.first_child(c);
|
|
1952
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ shadows: Number(m.currentTarget.value) });
|
|
1953
|
+
var T = e.sibling(b, 2);
|
|
1954
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ shadows: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1955
|
+
e.set_value(b, t().shadows), e.set_value(T, t().shadows);
|
|
1956
|
+
}), e.append(l, c);
|
|
1849
1957
|
}
|
|
1850
1958
|
});
|
|
1851
|
-
var
|
|
1852
|
-
F(
|
|
1959
|
+
var I = e.sibling(S, 2);
|
|
1960
|
+
F(I, {
|
|
1853
1961
|
label: "Highlights",
|
|
1854
1962
|
onReset: () => a({ highlights: ee.highlights }),
|
|
1855
|
-
children: (
|
|
1856
|
-
var
|
|
1857
|
-
e.remove_input_defaults(
|
|
1858
|
-
var
|
|
1859
|
-
e.remove_input_defaults(
|
|
1860
|
-
e.set_value(
|
|
1861
|
-
}), e.append(
|
|
1963
|
+
children: (l, d) => {
|
|
1964
|
+
var c = Cr(), b = e.first_child(c);
|
|
1965
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ highlights: Number(m.currentTarget.value) });
|
|
1966
|
+
var T = e.sibling(b, 2);
|
|
1967
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ highlights: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1968
|
+
e.set_value(b, t().highlights), e.set_value(T, t().highlights);
|
|
1969
|
+
}), e.append(l, c);
|
|
1862
1970
|
}
|
|
1863
|
-
}), e.reset(
|
|
1864
|
-
var
|
|
1865
|
-
F(
|
|
1971
|
+
}), e.reset(x), e.reset(f);
|
|
1972
|
+
var P = e.sibling(f, 2), u = e.sibling(e.child(P), 2), g = e.child(u);
|
|
1973
|
+
F(g, {
|
|
1866
1974
|
label: "Vibrance",
|
|
1867
1975
|
onReset: () => a({ vibrance: ee.vibrance }),
|
|
1868
|
-
children: (
|
|
1869
|
-
var
|
|
1870
|
-
e.remove_input_defaults(
|
|
1871
|
-
var
|
|
1872
|
-
e.remove_input_defaults(
|
|
1873
|
-
e.set_value(
|
|
1874
|
-
}), e.append(
|
|
1976
|
+
children: (l, d) => {
|
|
1977
|
+
var c = jr(), b = e.first_child(c);
|
|
1978
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ vibrance: Number(m.currentTarget.value) });
|
|
1979
|
+
var T = e.sibling(b, 2);
|
|
1980
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ vibrance: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1981
|
+
e.set_value(b, t().vibrance), e.set_value(T, t().vibrance);
|
|
1982
|
+
}), e.append(l, c);
|
|
1875
1983
|
}
|
|
1876
1984
|
});
|
|
1877
|
-
var
|
|
1878
|
-
F(
|
|
1985
|
+
var C = e.sibling(g, 2);
|
|
1986
|
+
F(C, {
|
|
1879
1987
|
label: "Temperature",
|
|
1880
1988
|
onReset: () => a({ temperature: ee.temperature }),
|
|
1881
|
-
children: (
|
|
1882
|
-
var
|
|
1883
|
-
e.remove_input_defaults(
|
|
1884
|
-
var
|
|
1885
|
-
e.remove_input_defaults(
|
|
1886
|
-
e.set_value(
|
|
1887
|
-
}), e.append(
|
|
1989
|
+
children: (l, d) => {
|
|
1990
|
+
var c = Nr(), b = e.first_child(c);
|
|
1991
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ temperature: Number(m.currentTarget.value) });
|
|
1992
|
+
var T = e.sibling(b, 2);
|
|
1993
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ temperature: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
1994
|
+
e.set_value(b, t().temperature), e.set_value(T, t().temperature);
|
|
1995
|
+
}), e.append(l, c);
|
|
1888
1996
|
}
|
|
1889
1997
|
});
|
|
1890
|
-
var
|
|
1891
|
-
F(
|
|
1998
|
+
var M = e.sibling(C, 2);
|
|
1999
|
+
F(M, {
|
|
1892
2000
|
label: "Tint",
|
|
1893
2001
|
onReset: () => a({ tint: ee.tint }),
|
|
1894
|
-
children: (
|
|
1895
|
-
var
|
|
1896
|
-
e.remove_input_defaults(
|
|
1897
|
-
var
|
|
1898
|
-
e.remove_input_defaults(
|
|
1899
|
-
e.set_value(
|
|
1900
|
-
}), e.append(
|
|
2002
|
+
children: (l, d) => {
|
|
2003
|
+
var c = Rr(), b = e.first_child(c);
|
|
2004
|
+
e.remove_input_defaults(b), b.__input = (m) => a({ tint: Number(m.currentTarget.value) });
|
|
2005
|
+
var T = e.sibling(b, 2);
|
|
2006
|
+
e.remove_input_defaults(T), T.__input = (m) => a({ tint: Number(m.currentTarget.value) }), e.template_effect(() => {
|
|
2007
|
+
e.set_value(b, t().tint), e.set_value(T, t().tint);
|
|
2008
|
+
}), e.append(l, c);
|
|
1901
2009
|
}
|
|
1902
|
-
}), e.reset(
|
|
2010
|
+
}), e.reset(u), e.reset(P), e.reset(o), e.reset(r), e.append(s, r), e.pop();
|
|
1903
2011
|
}
|
|
1904
2012
|
e.delegate(["input"]);
|
|
1905
|
-
var
|
|
1906
|
-
const
|
|
2013
|
+
var Yr = e.from_html('<input type="checkbox"/>'), Er = e.from_html('<input type="range" step="0.5" min="0" max="20" class="svelte-24jznc"/> <input type="number" class="manual-input svelte-24jznc" step="0.5" min="0" max="20"/>', 1), Lr = e.from_html('<input type="color" class="color-input svelte-24jznc"/> <input type="text" class="color-text-input svelte-24jznc" placeholder="#000000"/>', 1), Or = e.from_html('<input type="color" class="color-input svelte-24jznc"/> <input type="text" class="color-text-input svelte-24jznc" placeholder="Leave empty to keep original"/>', 1), Zr = e.from_html("<!> <!> <!>", 1), Br = e.from_html('<details class="section svelte-24jznc" open=""><summary class="section-title svelte-24jznc">SVG Editing</summary> <div class="section-content svelte-24jznc"><!> <!></div></details>');
|
|
2014
|
+
const qr = {
|
|
2015
|
+
hash: "svelte-24jznc",
|
|
2016
|
+
code: `.section.svelte-24jznc {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-24jznc {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-24jznc::-webkit-details-marker {display:none;}.section-title.svelte-24jznc::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-24jznc > .section-title:where(.svelte-24jznc)::before {transform:rotate(90deg);}.section-content.svelte-24jznc {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.manual-input.svelte-24jznc {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-24jznc {flex:1;min-width:0;max-width:100%;}.color-input.svelte-24jznc {width:50px;height:32px;padding:2px;border:1px solid var(--color-border, #ccc);border-radius:4px;cursor:pointer;}.color-text-input.svelte-24jznc {flex:1;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;font-family:monospace;}`
|
|
2017
|
+
};
|
|
2018
|
+
function Ur(s, n) {
|
|
2019
|
+
e.push(n, !0), e.append_styles(s, qr);
|
|
2020
|
+
const t = e.derived(() => n.effect ?? { ...Pe });
|
|
2021
|
+
function a(p) {
|
|
2022
|
+
const v = { ...e.get(t), ...p, type: "svg" };
|
|
2023
|
+
n.onChange(v);
|
|
2024
|
+
}
|
|
2025
|
+
function r() {
|
|
2026
|
+
n.effect ? n.onChange(void 0) : n.onChange({ ...Pe });
|
|
2027
|
+
}
|
|
2028
|
+
var o = Br(), i = e.sibling(e.child(o), 2), h = e.child(i);
|
|
2029
|
+
F(h, {
|
|
2030
|
+
label: "Enabled",
|
|
2031
|
+
children: (p, v) => {
|
|
2032
|
+
var f = Yr();
|
|
2033
|
+
e.remove_input_defaults(f), f.__change = r, e.template_effect(() => e.set_checked(f, n.effect !== void 0)), e.append(p, f);
|
|
2034
|
+
}
|
|
2035
|
+
});
|
|
2036
|
+
var _ = e.sibling(h, 2);
|
|
2037
|
+
{
|
|
2038
|
+
var k = (p) => {
|
|
2039
|
+
var v = Zr(), f = e.first_child(v);
|
|
2040
|
+
F(f, {
|
|
2041
|
+
label: "Stroke Width",
|
|
2042
|
+
onReset: () => a({ strokeWidth: Pe.strokeWidth }),
|
|
2043
|
+
children: (w, S) => {
|
|
2044
|
+
var I = Er(), P = e.first_child(I);
|
|
2045
|
+
e.remove_input_defaults(P), P.__input = (g) => a({ strokeWidth: Number(g.currentTarget.value) });
|
|
2046
|
+
var u = e.sibling(P, 2);
|
|
2047
|
+
e.remove_input_defaults(u), u.__input = (g) => a({ strokeWidth: Number(g.currentTarget.value) }), e.template_effect(() => {
|
|
2048
|
+
e.set_value(P, e.get(t).strokeWidth ?? 0), e.set_value(u, e.get(t).strokeWidth ?? 0);
|
|
2049
|
+
}), e.append(w, I);
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
2052
|
+
var x = e.sibling(f, 2);
|
|
2053
|
+
F(x, {
|
|
2054
|
+
label: "Stroke Color",
|
|
2055
|
+
onReset: () => a({ strokeColor: Pe.strokeColor }),
|
|
2056
|
+
children: (w, S) => {
|
|
2057
|
+
var I = Lr(), P = e.first_child(I);
|
|
2058
|
+
e.remove_input_defaults(P), P.__input = (g) => a({ strokeColor: g.currentTarget.value });
|
|
2059
|
+
var u = e.sibling(P, 2);
|
|
2060
|
+
e.remove_input_defaults(u), u.__input = (g) => a({ strokeColor: g.currentTarget.value }), e.template_effect(() => {
|
|
2061
|
+
e.set_value(P, e.get(t).strokeColor || "#000000"), e.set_value(u, e.get(t).strokeColor || "#000000");
|
|
2062
|
+
}), e.append(w, I);
|
|
2063
|
+
}
|
|
2064
|
+
});
|
|
2065
|
+
var y = e.sibling(x, 2);
|
|
2066
|
+
F(y, {
|
|
2067
|
+
label: "Fill Color",
|
|
2068
|
+
onReset: () => a({ fillColor: void 0 }),
|
|
2069
|
+
children: (w, S) => {
|
|
2070
|
+
var I = Or(), P = e.first_child(I);
|
|
2071
|
+
e.remove_input_defaults(P), P.__input = (g) => a({ fillColor: g.currentTarget.value || void 0 });
|
|
2072
|
+
var u = e.sibling(P, 2);
|
|
2073
|
+
e.remove_input_defaults(u), u.__input = (g) => a({ fillColor: g.currentTarget.value || void 0 }), e.template_effect(() => {
|
|
2074
|
+
e.set_value(P, e.get(t).fillColor || "#000000"), e.set_value(u, e.get(t).fillColor || "");
|
|
2075
|
+
}), e.append(w, I);
|
|
2076
|
+
}
|
|
2077
|
+
}), e.append(p, v);
|
|
2078
|
+
};
|
|
2079
|
+
e.if(_, (p) => {
|
|
2080
|
+
n.effect !== void 0 && p(k);
|
|
2081
|
+
});
|
|
2082
|
+
}
|
|
2083
|
+
e.reset(i), e.reset(o), e.append(s, o), e.pop();
|
|
2084
|
+
}
|
|
2085
|
+
e.delegate(["change", "input"]);
|
|
2086
|
+
var Vr = e.from_html('<div class="layer-name-section svelte-et76o3"><label class="form-label svelte-et76o3">Layer Name (for overrides)</label> <input type="text" class="form-input svelte-et76o3" placeholder="e.g., front, back, logo"/> <p class="form-hint svelte-et76o3">Use this name as the key when overriding images in the renderer</p></div>'), Ar = e.from_html('<div class="layer-controls svelte-et76o3"><div class="layer-header svelte-et76o3"><button class="visibility-toggle svelte-et76o3"><!></button> <span class="layer-preview svelte-et76o3"><img alt="Layer preview" class="svelte-et76o3"/></span> <button class="delete-btn svelte-et76o3" aria-label="Delete layer"><!></button></div> <!> <div class="sections svelte-et76o3"><!> <!> <!> <!> <!></div></div>');
|
|
2087
|
+
const Fr = {
|
|
1907
2088
|
hash: "svelte-et76o3",
|
|
1908
2089
|
code: ".layer-controls.svelte-et76o3 {border-radius:4px;padding-top:0.75rem;padding-bottom:0.75rem;margin-bottom:0.5rem;background:var(--color-surface, #fff);}.layer-header.svelte-et76o3 {display:flex;align-items:center;gap:0.5rem;margin-bottom:0.75rem;padding-bottom:0.75rem;border-bottom:1px solid var(--color-border, #eee);}.visibility-toggle.svelte-et76o3 {background:none;border:none;cursor:pointer;padding:0.25rem;display:flex;align-items:center;justify-content:center;color:var(--color-text, #000);}.layer-preview.svelte-et76o3 {flex:1;display:flex;align-items:center;justify-content:center;height:40px;overflow:hidden;border-radius:4px;background:#f5f5f5;}.layer-preview.svelte-et76o3 img:where(.svelte-et76o3) {max-width:100%;max-height:100%;object-fit:contain;}.delete-btn.svelte-et76o3 {background:#ef4444;color:white;border:none;border-radius:4px;width:24px;height:24px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;}.delete-btn.svelte-et76o3:hover {background:#dc2626;}.layer-name-section.svelte-et76o3 {padding:0 0.75rem;margin-bottom:0.75rem;}.layer-name-section.svelte-et76o3 .form-label:where(.svelte-et76o3) {display:block;font-size:0.75rem;font-weight:500;color:var(--color-text-muted, #666);margin-bottom:0.25rem;text-transform:uppercase;letter-spacing:0.5px;}.layer-name-section.svelte-et76o3 .form-input:where(.svelte-et76o3) {width:100%;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;font-family:inherit;}.layer-name-section.svelte-et76o3 .form-input:where(.svelte-et76o3):focus {outline:none;border-color:var(--color-primary, #3b82f6);}.form-hint.svelte-et76o3 {font-size:0.75rem;color:var(--color-text-muted, #666);margin:0.25rem 0 0 0;}.sections.svelte-et76o3 {display:flex;flex-direction:column;gap:0;overflow:hidden;min-width:0;}"
|
|
1909
2090
|
};
|
|
1910
|
-
function
|
|
1911
|
-
e.push(
|
|
1912
|
-
const t = e.derived(() =>
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
}
|
|
1921
|
-
function
|
|
1922
|
-
const
|
|
1923
|
-
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
2091
|
+
function Hr(s, n) {
|
|
2092
|
+
e.push(n, !0), e.append_styles(s, Fr);
|
|
2093
|
+
const t = e.derived(() => n.layer.effects.find((N) => N.type === "resize") ?? ve), a = e.derived(() => n.layer.effects.find((N) => N.type === "restyle") ?? ee), r = e.derived(() => n.layer.effects.find((z) => z.type === "warp")), o = e.derived(() => n.layer.effects.find((z) => z.type === "svg"));
|
|
2094
|
+
let i = e.state(null);
|
|
2095
|
+
e.user_effect(() => {
|
|
2096
|
+
e.set(i, null), st(n.layer.src).then((z) => {
|
|
2097
|
+
e.set(i, z, !0);
|
|
2098
|
+
}).catch(() => {
|
|
2099
|
+
e.set(i, !1);
|
|
2100
|
+
});
|
|
2101
|
+
});
|
|
2102
|
+
function h(z) {
|
|
2103
|
+
const N = n.layer.effects.filter((L) => L.type !== "resize");
|
|
2104
|
+
n.onEffectsChange([...N, z]);
|
|
2105
|
+
}
|
|
2106
|
+
function _(z) {
|
|
2107
|
+
const N = n.layer.effects.filter((L) => L.type !== "restyle");
|
|
2108
|
+
n.onEffectsChange([...N, z]);
|
|
2109
|
+
}
|
|
2110
|
+
function k(z) {
|
|
2111
|
+
const N = n.layer.effects.filter((L) => L.type !== "warp");
|
|
2112
|
+
z ? n.onEffectsChange([...N, z]) : n.onEffectsChange(N);
|
|
2113
|
+
}
|
|
2114
|
+
function p(z) {
|
|
2115
|
+
const N = n.layer.effects.filter((L) => L.type !== "svg");
|
|
2116
|
+
z ? n.onEffectsChange([...N, z]) : n.onEffectsChange(N);
|
|
2117
|
+
}
|
|
2118
|
+
var v = Ar(), f = e.child(v), x = e.child(f);
|
|
2119
|
+
x.__click = () => n.onVisibilityChange(!n.layer.visible);
|
|
2120
|
+
var y = e.child(x);
|
|
1928
2121
|
{
|
|
1929
|
-
var
|
|
1930
|
-
|
|
1931
|
-
},
|
|
1932
|
-
|
|
2122
|
+
var w = (z) => {
|
|
2123
|
+
_n(z, {});
|
|
2124
|
+
}, S = (z) => {
|
|
2125
|
+
wn(z, {});
|
|
1933
2126
|
};
|
|
1934
|
-
e.if(
|
|
1935
|
-
|
|
2127
|
+
e.if(y, (z) => {
|
|
2128
|
+
n.layer.visible ? z(w) : z(S, !1);
|
|
1936
2129
|
});
|
|
1937
2130
|
}
|
|
1938
|
-
e.reset(
|
|
1939
|
-
var
|
|
1940
|
-
e.reset(
|
|
1941
|
-
var
|
|
1942
|
-
|
|
1943
|
-
|
|
2131
|
+
e.reset(x);
|
|
2132
|
+
var I = e.sibling(x, 2), P = e.child(I);
|
|
2133
|
+
e.reset(I);
|
|
2134
|
+
var u = e.sibling(I, 2);
|
|
2135
|
+
u.__click = function(...z) {
|
|
2136
|
+
n.onDelete?.apply(this, z);
|
|
1944
2137
|
};
|
|
1945
|
-
var
|
|
1946
|
-
|
|
1947
|
-
var
|
|
2138
|
+
var g = e.child(u);
|
|
2139
|
+
Fe(g, {}), e.reset(u), e.reset(f);
|
|
2140
|
+
var C = e.sibling(f, 2);
|
|
1948
2141
|
{
|
|
1949
|
-
var
|
|
1950
|
-
var
|
|
1951
|
-
e.remove_input_defaults(
|
|
1952
|
-
e.set_attribute(
|
|
1953
|
-
}), e.append(
|
|
2142
|
+
var M = (z) => {
|
|
2143
|
+
var N = Vr(), L = e.child(N), W = e.sibling(L, 2);
|
|
2144
|
+
e.remove_input_defaults(W), W.__input = (E) => n.onNameChange(E.currentTarget.value), e.next(2), e.reset(N), e.template_effect(() => {
|
|
2145
|
+
e.set_attribute(L, "for", `layer-name-${n.layer.id ?? ""}`), e.set_attribute(W, "id", `layer-name-${n.layer.id ?? ""}`), e.set_value(W, n.layer.name || "");
|
|
2146
|
+
}), e.append(z, N);
|
|
2147
|
+
};
|
|
2148
|
+
e.if(C, (z) => {
|
|
2149
|
+
n.onNameChange && z(M);
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
var l = e.sibling(C, 2), d = e.child(l);
|
|
2153
|
+
{
|
|
2154
|
+
var c = (z) => {
|
|
2155
|
+
Ur(z, {
|
|
2156
|
+
get effect() {
|
|
2157
|
+
return e.get(o);
|
|
2158
|
+
},
|
|
2159
|
+
onChange: p
|
|
2160
|
+
});
|
|
1954
2161
|
};
|
|
1955
|
-
e.if(
|
|
1956
|
-
|
|
2162
|
+
e.if(d, (z) => {
|
|
2163
|
+
e.get(i) === !0 && z(c);
|
|
1957
2164
|
});
|
|
1958
2165
|
}
|
|
1959
|
-
var
|
|
1960
|
-
|
|
2166
|
+
var b = e.sibling(d, 2);
|
|
2167
|
+
qn(b, {
|
|
1961
2168
|
get effect() {
|
|
1962
2169
|
return e.get(t);
|
|
1963
2170
|
},
|
|
1964
|
-
onChange:
|
|
2171
|
+
onChange: h
|
|
1965
2172
|
});
|
|
1966
|
-
var
|
|
1967
|
-
|
|
2173
|
+
var T = e.sibling(b, 2);
|
|
2174
|
+
Xr(T, {
|
|
1968
2175
|
get effect() {
|
|
1969
2176
|
return e.get(a);
|
|
1970
2177
|
},
|
|
1971
|
-
onChange:
|
|
2178
|
+
onChange: _
|
|
1972
2179
|
});
|
|
1973
|
-
var
|
|
1974
|
-
|
|
2180
|
+
var m = e.sibling(T, 2);
|
|
2181
|
+
Wn(m, {
|
|
1975
2182
|
get transform() {
|
|
1976
|
-
return
|
|
2183
|
+
return n.layer.transform;
|
|
1977
2184
|
},
|
|
1978
2185
|
get opacity() {
|
|
1979
|
-
return
|
|
2186
|
+
return n.layer.opacity;
|
|
1980
2187
|
},
|
|
1981
2188
|
get canvasWidth() {
|
|
1982
|
-
return
|
|
2189
|
+
return n.canvasWidth;
|
|
1983
2190
|
},
|
|
1984
2191
|
get canvasHeight() {
|
|
1985
|
-
return
|
|
2192
|
+
return n.canvasHeight;
|
|
1986
2193
|
},
|
|
1987
2194
|
get onTransformChange() {
|
|
1988
|
-
return
|
|
2195
|
+
return n.onTransformChange;
|
|
1989
2196
|
},
|
|
1990
2197
|
get onOpacityChange() {
|
|
1991
|
-
return
|
|
2198
|
+
return n.onOpacityChange;
|
|
1992
2199
|
},
|
|
1993
2200
|
get layerId() {
|
|
1994
|
-
return
|
|
2201
|
+
return n.layer.id;
|
|
1995
2202
|
}
|
|
1996
2203
|
});
|
|
1997
|
-
var
|
|
1998
|
-
|
|
2204
|
+
var R = e.sibling(m, 2);
|
|
2205
|
+
xr(R, {
|
|
1999
2206
|
get effect() {
|
|
2000
|
-
return e.get(
|
|
2207
|
+
return e.get(r);
|
|
2001
2208
|
},
|
|
2002
|
-
onChange:
|
|
2003
|
-
}), e.reset(
|
|
2004
|
-
e.set_attribute(
|
|
2005
|
-
}), e.append(
|
|
2209
|
+
onChange: k
|
|
2210
|
+
}), e.reset(l), e.reset(v), e.template_effect(() => {
|
|
2211
|
+
e.set_attribute(x, "aria-label", n.layer.visible ? "Hide layer" : "Show layer"), e.set_attribute(P, "src", n.layer.src);
|
|
2212
|
+
}), e.append(s, v), e.pop();
|
|
2006
2213
|
}
|
|
2007
2214
|
e.delegate(["click", "input"]);
|
|
2008
|
-
var
|
|
2009
|
-
const
|
|
2215
|
+
var Kr = e.from_html('<button type="button" class="modal-backdrop svelte-ta60gp" aria-label="Close modal"></button> <div><!></div>', 1);
|
|
2216
|
+
const Jr = {
|
|
2010
2217
|
hash: "svelte-ta60gp",
|
|
2011
2218
|
code: ".modal-backdrop.svelte-ta60gp {position:fixed;inset:0;z-index:10000;background:var(--color-overlay-darker);backdrop-filter:blur(4px);border:none;padding:0;margin:0;cursor:pointer;border-radius:unset;}.modal-backdrop.svelte-ta60gp:hover {background:var(--color-overlay-darker) !important;}.modal-content.svelte-ta60gp {position:fixed;top:0;left:0;right:0;height:100dvh;z-index:10001;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);}.modal-content.ios-safari.svelte-ta60gp {height:100dvh;overflow-y:auto;}.modal-content.svelte-ta60gp > * {pointer-events:auto;margin:0 auto;}"
|
|
2012
2219
|
};
|
|
2013
|
-
function
|
|
2014
|
-
e.push(
|
|
2220
|
+
function Gr(s, n) {
|
|
2221
|
+
e.push(n, !0), e.append_styles(s, Jr);
|
|
2015
2222
|
let t = !1, a = !1;
|
|
2016
|
-
const
|
|
2017
|
-
function
|
|
2018
|
-
|
|
2223
|
+
const r = Ct && /iPhone|iPad|iPod/.test(navigator.userAgent) && !("MSStream" in window);
|
|
2224
|
+
function o(x) {
|
|
2225
|
+
x.key === "Escape" && (x.preventDefault(), h());
|
|
2019
2226
|
}
|
|
2020
|
-
function
|
|
2021
|
-
t && (t = !1,
|
|
2227
|
+
function i() {
|
|
2228
|
+
t && (t = !1, n.onclose());
|
|
2022
2229
|
}
|
|
2023
|
-
function
|
|
2024
|
-
t && (t = !1, history.back()),
|
|
2230
|
+
function h() {
|
|
2231
|
+
t && (t = !1, history.back()), n.onclose();
|
|
2025
2232
|
}
|
|
2026
|
-
|
|
2233
|
+
It(() => {
|
|
2027
2234
|
a = !0;
|
|
2028
|
-
}), Te(() => (
|
|
2029
|
-
|
|
2235
|
+
}), Te(() => (r || (document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden"), Pt("", { modal: !0 }), t = !0, () => {
|
|
2236
|
+
r || (document.documentElement.style.overflow = "", document.body.style.overflow = ""), t && !a && history.back();
|
|
2030
2237
|
}));
|
|
2031
|
-
var
|
|
2032
|
-
e.event("keydown", e.window,
|
|
2033
|
-
var
|
|
2034
|
-
|
|
2035
|
-
var
|
|
2036
|
-
let
|
|
2037
|
-
var
|
|
2038
|
-
e.snippet(
|
|
2238
|
+
var _ = Kr();
|
|
2239
|
+
e.event("keydown", e.window, o), e.event("popstate", e.window, i);
|
|
2240
|
+
var k = e.first_child(_);
|
|
2241
|
+
k.__click = h;
|
|
2242
|
+
var p = e.sibling(k, 2);
|
|
2243
|
+
let v;
|
|
2244
|
+
var f = e.child(p);
|
|
2245
|
+
e.snippet(f, () => n.children), e.reset(p), e.template_effect(() => v = e.set_class(p, 1, "modal-content svelte-ta60gp", null, v, { "ios-safari": r })), e.transition(7, k, () => Qe, () => ({ duration: 100 })), e.transition(7, p, () => Qe, () => ({ duration: 100 })), e.append(s, _), e.pop();
|
|
2039
2246
|
}
|
|
2040
2247
|
e.delegate(["click"]);
|
|
2041
|
-
var
|
|
2042
|
-
function Me(
|
|
2043
|
-
let t = e.prop(
|
|
2044
|
-
var
|
|
2248
|
+
var $r = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M12 5v14M5 12h14"></path></svg>');
|
|
2249
|
+
function Me(s, n) {
|
|
2250
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
2251
|
+
var r = $r();
|
|
2045
2252
|
e.template_effect(() => {
|
|
2046
|
-
e.set_style(
|
|
2047
|
-
}), e.append(
|
|
2253
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
2254
|
+
}), e.append(s, r);
|
|
2048
2255
|
}
|
|
2049
|
-
const
|
|
2050
|
-
function
|
|
2256
|
+
const je = "product-mockups", ct = "product-mockups-current";
|
|
2257
|
+
function Qr(s, n = je) {
|
|
2051
2258
|
try {
|
|
2052
|
-
const t = Ne(), a = t.findIndex((
|
|
2053
|
-
return a >= 0 ? t[a] = { ...
|
|
2259
|
+
const t = Ne(), a = t.findIndex((r) => r.id === s.id);
|
|
2260
|
+
return a >= 0 ? t[a] = { ...s, updatedAt: Date.now() } : t.push({ ...s, updatedAt: Date.now() }), localStorage.setItem(n, JSON.stringify(t)), !0;
|
|
2054
2261
|
} catch (t) {
|
|
2055
2262
|
return console.error("Failed to save mockup:", t), !1;
|
|
2056
2263
|
}
|
|
2057
2264
|
}
|
|
2058
|
-
function Ne(
|
|
2265
|
+
function Ne(s = je) {
|
|
2059
2266
|
try {
|
|
2060
|
-
const
|
|
2061
|
-
return
|
|
2062
|
-
const
|
|
2267
|
+
const n = localStorage.getItem(s);
|
|
2268
|
+
return n ? JSON.parse(n).map((a) => {
|
|
2269
|
+
const r = a.composition ?? a.canvas ?? { ...lt };
|
|
2063
2270
|
return {
|
|
2064
2271
|
...a,
|
|
2065
|
-
view: a.view ?? { ...
|
|
2272
|
+
view: a.view ?? { ...Ce },
|
|
2066
2273
|
composition: {
|
|
2067
|
-
...
|
|
2068
|
-
effects:
|
|
2069
|
-
layers:
|
|
2070
|
-
...
|
|
2071
|
-
effects:
|
|
2274
|
+
...r,
|
|
2275
|
+
effects: r.effects ?? [],
|
|
2276
|
+
layers: r.layers?.map((o) => ({
|
|
2277
|
+
...o,
|
|
2278
|
+
effects: o.effects ?? []
|
|
2072
2279
|
})) ?? []
|
|
2073
2280
|
}
|
|
2074
2281
|
};
|
|
2075
2282
|
}) : [];
|
|
2076
|
-
} catch (
|
|
2077
|
-
return console.error("Failed to load mockups:",
|
|
2283
|
+
} catch (n) {
|
|
2284
|
+
return console.error("Failed to load mockups:", n), [];
|
|
2078
2285
|
}
|
|
2079
2286
|
}
|
|
2080
|
-
function
|
|
2081
|
-
return Ne(
|
|
2287
|
+
function ea(s, n = je) {
|
|
2288
|
+
return Ne(n).find((a) => a.id === s) ?? null;
|
|
2082
2289
|
}
|
|
2083
|
-
function
|
|
2290
|
+
function ta(s, n = je) {
|
|
2084
2291
|
try {
|
|
2085
|
-
const a = Ne(
|
|
2086
|
-
return localStorage.setItem(
|
|
2292
|
+
const a = Ne(n).filter((r) => r.id !== s);
|
|
2293
|
+
return localStorage.setItem(n, JSON.stringify(a)), !0;
|
|
2087
2294
|
} catch (t) {
|
|
2088
2295
|
return console.error("Failed to delete mockup:", t), !1;
|
|
2089
2296
|
}
|
|
2090
2297
|
}
|
|
2091
|
-
function
|
|
2298
|
+
function qe(s, n = ct) {
|
|
2092
2299
|
try {
|
|
2093
|
-
|
|
2300
|
+
s ? localStorage.setItem(n, s) : localStorage.removeItem(n);
|
|
2094
2301
|
} catch (t) {
|
|
2095
2302
|
console.error("Failed to save current mockup ID:", t);
|
|
2096
2303
|
}
|
|
2097
2304
|
}
|
|
2098
|
-
function
|
|
2305
|
+
function na(s = ct) {
|
|
2099
2306
|
try {
|
|
2100
|
-
return localStorage.getItem(
|
|
2307
|
+
return localStorage.getItem(s);
|
|
2101
2308
|
} catch {
|
|
2102
2309
|
return null;
|
|
2103
2310
|
}
|
|
2104
2311
|
}
|
|
2105
|
-
function
|
|
2312
|
+
function rt(s = "Untitled Mockup") {
|
|
2106
2313
|
return {
|
|
2107
2314
|
id: crypto.randomUUID(),
|
|
2108
|
-
name:
|
|
2109
|
-
composition: { ...
|
|
2110
|
-
view: { ...
|
|
2315
|
+
name: s,
|
|
2316
|
+
composition: { ...lt },
|
|
2317
|
+
view: { ...Ce },
|
|
2111
2318
|
createdAt: Date.now(),
|
|
2112
2319
|
updatedAt: Date.now()
|
|
2113
2320
|
};
|
|
2114
2321
|
}
|
|
2115
|
-
var
|
|
2116
|
-
const
|
|
2322
|
+
var ra = e.from_html('<div class="empty-state svelte-33nadc"><p class="svelte-33nadc">No mockups yet. Create your first mockup to get started!</p> <button class="new-mockup-btn primary svelte-33nadc" type="button"><!> Create Mockup</button></div>'), aa = e.from_html('<div role="button" tabindex="0"><div class="mockup-card-header svelte-33nadc"><h3 class="mockup-card-title svelte-33nadc"> </h3> <div class="mockup-card-actions svelte-33nadc"><button class="copy-btn svelte-33nadc" type="button" aria-label="Copy config">Copy Config</button> <button class="delete-btn svelte-33nadc" type="button" aria-label="Delete mockup"><!></button></div></div> <div class="mockup-card-info svelte-33nadc"><div class="mockup-card-stat svelte-33nadc"><span class="stat-label svelte-33nadc">Layers:</span> <span class="stat-value svelte-33nadc"> </span></div> <div class="mockup-card-stat svelte-33nadc"><span class="stat-label svelte-33nadc">Size:</span> <span class="stat-value svelte-33nadc"> </span></div></div> <div class="mockup-card-footer svelte-33nadc"><div class="mockup-card-date svelte-33nadc"><span class="date-label svelte-33nadc">Updated:</span> <span class="date-value svelte-33nadc"> </span></div></div></div>'), sa = e.from_html('<div class="mockup-grid svelte-33nadc"></div>'), oa = e.from_html('<div class="mockup-list-container svelte-33nadc"><div class="mockup-list-header svelte-33nadc"><h2 class="svelte-33nadc">All Mockups</h2> <button class="new-mockup-btn svelte-33nadc" type="button"><!> New Mockup</button></div> <!></div>');
|
|
2323
|
+
const ia = {
|
|
2117
2324
|
hash: "svelte-33nadc",
|
|
2118
2325
|
code: ".mockup-list-container.svelte-33nadc {background:var(--color-surface, #fff);border-radius:8px;padding:2rem;max-width:900px;width:100%;margin:2rem auto;max-height:calc(100dvh - 4rem);overflow-y:auto;box-shadow:0 10px 40px rgba(0, 0, 0, 0.2);}.mockup-list-header.svelte-33nadc {display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem;gap:1rem;}.mockup-list-header.svelte-33nadc h2:where(.svelte-33nadc) {font-size:1.5rem;font-weight:600;color:var(--color-text, #111);margin:0;}.new-mockup-btn.svelte-33nadc {display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:6px;cursor:pointer;font-size:0.875rem;font-weight:500;transition:background 200ms;}.new-mockup-btn.svelte-33nadc:hover {background:var(--color-primary-dark, #2563eb);}.new-mockup-btn.primary.svelte-33nadc {margin-top:1rem;}.empty-state.svelte-33nadc {text-align:center;padding:4rem 2rem;color:var(--color-text-muted, #666);}.empty-state.svelte-33nadc p:where(.svelte-33nadc) {font-size:1rem;margin-bottom:1.5rem;}.mockup-grid.svelte-33nadc {display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:1rem;}.mockup-card.svelte-33nadc {background:var(--color-surface-alt, #f5f5f5);border:2px solid var(--color-border, #ccc);border-radius:8px;padding:1rem;cursor:pointer;transition:all 200ms;display:flex;flex-direction:column;gap:0.75rem;}.mockup-card.svelte-33nadc:hover {border-color:var(--color-primary, #3b82f6);background:var(--color-surface, #fff);transform:translateY(-2px);box-shadow:0 4px 12px rgba(0, 0, 0, 0.1);}.mockup-card.current.svelte-33nadc {border-color:var(--color-primary, #3b82f6);background:var(--color-primary-light, #eff6ff);}.mockup-card-header.svelte-33nadc {display:flex;align-items:flex-start;justify-content:space-between;gap:0.5rem;}.mockup-card-title.svelte-33nadc {font-size:1rem;font-weight:600;color:var(--color-text, #111);margin:0;flex:1;word-break:break-word;}.mockup-card-actions.svelte-33nadc {display:flex;align-items:center;gap:0.5rem;flex-shrink:0;}.copy-btn.svelte-33nadc {background:transparent;border:1px solid var(--color-primary, #3b82f6);color:var(--color-primary, #3b82f6);cursor:pointer;padding:0.25rem 0.5rem;border-radius:4px;font-size:0.75rem;transition:all 200ms;display:flex;align-items:center;justify-content:center;}.copy-btn.svelte-33nadc:hover {background:var(--color-primary, #3b82f6);color:white;}.delete-btn.svelte-33nadc {background:transparent;border:none;color:var(--color-text-muted, #666);cursor:pointer;padding:0.25rem;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all 200ms;flex-shrink:0;}.delete-btn.svelte-33nadc:hover {background:#ef4444;color:white;}.mockup-card-info.svelte-33nadc {display:flex;gap:1rem;font-size:0.875rem;}.mockup-card-stat.svelte-33nadc {display:flex;flex-direction:column;gap:0.25rem;}.stat-label.svelte-33nadc {color:var(--color-text-muted, #666);font-size:0.75rem;text-transform:uppercase;}.stat-value.svelte-33nadc {color:var(--color-text, #111);font-weight:500;}.mockup-card-footer.svelte-33nadc {margin-top:auto;padding-top:0.75rem;border-top:1px solid var(--color-border, #ccc);}.mockup-card-date.svelte-33nadc {display:flex;flex-direction:column;gap:0.25rem;font-size:0.75rem;}.date-label.svelte-33nadc {color:var(--color-text-muted, #666);text-transform:uppercase;}.date-value.svelte-33nadc {color:var(--color-text, #111);}"
|
|
2119
2326
|
};
|
|
2120
|
-
function
|
|
2121
|
-
e.push(
|
|
2122
|
-
let t = e.prop(
|
|
2123
|
-
function
|
|
2327
|
+
function la(s, n) {
|
|
2328
|
+
e.push(n, !0), e.append_styles(s, ia);
|
|
2329
|
+
let t = e.prop(n, "storageKey", 3, "product-mockups"), a = e.state(e.proxy([]));
|
|
2330
|
+
function r() {
|
|
2124
2331
|
e.set(a, Ne(t()), !0);
|
|
2125
2332
|
}
|
|
2126
2333
|
Te(() => {
|
|
2127
|
-
|
|
2334
|
+
r();
|
|
2128
2335
|
});
|
|
2129
|
-
function
|
|
2130
|
-
|
|
2336
|
+
function o(p) {
|
|
2337
|
+
n.onSelect(p), n.onclose();
|
|
2131
2338
|
}
|
|
2132
|
-
function
|
|
2133
|
-
|
|
2339
|
+
function i() {
|
|
2340
|
+
n.onNew(), n.onclose();
|
|
2134
2341
|
}
|
|
2135
|
-
function
|
|
2136
|
-
|
|
2342
|
+
function h(p, v) {
|
|
2343
|
+
p.stopPropagation(), confirm("Are you sure you want to delete this mockup?") && (ta(v, t()), r());
|
|
2137
2344
|
}
|
|
2138
|
-
async function
|
|
2139
|
-
|
|
2345
|
+
async function _(p, v) {
|
|
2346
|
+
p.stopPropagation();
|
|
2140
2347
|
try {
|
|
2141
|
-
const
|
|
2142
|
-
await navigator.clipboard.writeText(
|
|
2143
|
-
} catch (
|
|
2144
|
-
console.error("Failed to copy config:",
|
|
2348
|
+
const f = JSON.stringify(v, null, 2);
|
|
2349
|
+
await navigator.clipboard.writeText(f);
|
|
2350
|
+
} catch (f) {
|
|
2351
|
+
console.error("Failed to copy config:", f);
|
|
2145
2352
|
}
|
|
2146
2353
|
}
|
|
2147
|
-
function
|
|
2148
|
-
const
|
|
2149
|
-
return
|
|
2354
|
+
function k(p) {
|
|
2355
|
+
const v = new Date(p);
|
|
2356
|
+
return v.toLocaleDateString() + " " + v.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
2150
2357
|
}
|
|
2151
|
-
|
|
2358
|
+
Gr(s, {
|
|
2152
2359
|
get onclose() {
|
|
2153
|
-
return
|
|
2360
|
+
return n.onclose;
|
|
2154
2361
|
},
|
|
2155
|
-
children: (
|
|
2156
|
-
var
|
|
2157
|
-
|
|
2158
|
-
var
|
|
2159
|
-
Me(
|
|
2160
|
-
var
|
|
2362
|
+
children: (p, v) => {
|
|
2363
|
+
var f = oa(), x = e.child(f), y = e.sibling(e.child(x), 2);
|
|
2364
|
+
y.__click = i;
|
|
2365
|
+
var w = e.child(y);
|
|
2366
|
+
Me(w, {}), e.next(), e.reset(y), e.reset(x);
|
|
2367
|
+
var S = e.sibling(x, 2);
|
|
2161
2368
|
{
|
|
2162
|
-
var
|
|
2163
|
-
var
|
|
2164
|
-
|
|
2165
|
-
var
|
|
2166
|
-
Me(
|
|
2167
|
-
},
|
|
2168
|
-
var
|
|
2169
|
-
e.each(
|
|
2170
|
-
var
|
|
2171
|
-
let
|
|
2172
|
-
|
|
2173
|
-
var
|
|
2174
|
-
e.reset(
|
|
2175
|
-
var
|
|
2176
|
-
|
|
2177
|
-
var
|
|
2178
|
-
|
|
2179
|
-
var
|
|
2180
|
-
|
|
2181
|
-
var
|
|
2182
|
-
e.reset(
|
|
2183
|
-
var
|
|
2184
|
-
e.reset(q), e.reset(
|
|
2185
|
-
var
|
|
2186
|
-
e.reset(
|
|
2187
|
-
(
|
|
2188
|
-
|
|
2369
|
+
var I = (u) => {
|
|
2370
|
+
var g = ra(), C = e.sibling(e.child(g), 2);
|
|
2371
|
+
C.__click = i;
|
|
2372
|
+
var M = e.child(C);
|
|
2373
|
+
Me(M, {}), e.next(), e.reset(C), e.reset(g), e.append(u, g);
|
|
2374
|
+
}, P = (u) => {
|
|
2375
|
+
var g = sa();
|
|
2376
|
+
e.each(g, 21, () => e.get(a), (C) => C.id, (C, M) => {
|
|
2377
|
+
var l = aa();
|
|
2378
|
+
let d;
|
|
2379
|
+
l.__click = () => o(e.get(M)), l.__keydown = (O) => O.key === "Enter" && o(e.get(M));
|
|
2380
|
+
var c = e.child(l), b = e.child(c), T = e.child(b, !0);
|
|
2381
|
+
e.reset(b);
|
|
2382
|
+
var m = e.sibling(b, 2), R = e.child(m);
|
|
2383
|
+
R.__click = (O) => _(O, e.get(M));
|
|
2384
|
+
var z = e.sibling(R, 2);
|
|
2385
|
+
z.__click = (O) => h(O, e.get(M).id);
|
|
2386
|
+
var N = e.child(z);
|
|
2387
|
+
Fe(N, {}), e.reset(z), e.reset(m), e.reset(c);
|
|
2388
|
+
var L = e.sibling(c, 2), W = e.child(L), E = e.sibling(e.child(W), 2), Y = e.child(E, !0);
|
|
2389
|
+
e.reset(E), e.reset(W);
|
|
2390
|
+
var U = e.sibling(W, 2), q = e.sibling(e.child(U), 2), J = e.child(q);
|
|
2391
|
+
e.reset(q), e.reset(U), e.reset(L);
|
|
2392
|
+
var A = e.sibling(L, 2), G = e.child(A), Z = e.sibling(e.child(G), 2), B = e.child(Z, !0);
|
|
2393
|
+
e.reset(Z), e.reset(G), e.reset(A), e.reset(l), e.template_effect(
|
|
2394
|
+
(O) => {
|
|
2395
|
+
d = e.set_class(l, 1, "mockup-card svelte-33nadc", null, d, { current: e.get(M).id === n.currentMockupId }), e.set_text(T, e.get(M).name), e.set_text(Y, e.get(M).composition.layers.length), e.set_text(J, `${e.get(M).composition.width ?? ""} × ${e.get(M).composition.height ?? ""}`), e.set_text(B, O);
|
|
2189
2396
|
},
|
|
2190
|
-
[() =>
|
|
2191
|
-
), e.append(
|
|
2192
|
-
}), e.reset(
|
|
2397
|
+
[() => k(e.get(M).updatedAt)]
|
|
2398
|
+
), e.append(C, l);
|
|
2399
|
+
}), e.reset(g), e.append(u, g);
|
|
2193
2400
|
};
|
|
2194
|
-
e.if(
|
|
2195
|
-
e.get(a).length === 0 ?
|
|
2401
|
+
e.if(S, (u) => {
|
|
2402
|
+
e.get(a).length === 0 ? u(I) : u(P, !1);
|
|
2196
2403
|
});
|
|
2197
2404
|
}
|
|
2198
|
-
e.reset(
|
|
2405
|
+
e.reset(f), e.append(p, f);
|
|
2199
2406
|
},
|
|
2200
2407
|
$$slots: { default: !0 }
|
|
2201
2408
|
}), e.pop();
|
|
2202
2409
|
}
|
|
2203
2410
|
e.delegate(["click", "keydown"]);
|
|
2204
|
-
var
|
|
2205
|
-
function
|
|
2206
|
-
let t = e.prop(
|
|
2207
|
-
var
|
|
2411
|
+
var ca = e.from_svg('<svg width=".4em" height="1em" viewBox="8 2 8 20" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"></path></svg>');
|
|
2412
|
+
function at(s, n) {
|
|
2413
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
2414
|
+
var r = ca();
|
|
2208
2415
|
e.template_effect(() => {
|
|
2209
|
-
e.set_style(
|
|
2210
|
-
}), e.append(
|
|
2416
|
+
e.set_style(r, `font-size: ${t() ?? ""}; ${(n.rotate && `rotate: ${n.rotate};`) ?? ""}`), e.set_attribute(r, "stroke", a());
|
|
2417
|
+
}), e.append(s, r);
|
|
2211
2418
|
}
|
|
2212
|
-
const
|
|
2213
|
-
var
|
|
2214
|
-
const
|
|
2419
|
+
const da = "product-mockups", ua = "product-mockups-current";
|
|
2420
|
+
var pa = e.from_html('<header class="header-logos svelte-w47swm"><!></header>'), ma = e.from_html('<div class="url-input-group svelte-w47swm"><input type="url" placeholder="https://example.com/image.jpg" class="svelte-w47swm"/> <button type="button" class="svelte-w47swm">Add</button></div>'), fa = e.from_html('<div class="no-layers svelte-w47swm">No layers yet. Add an image to get started.</div>'), va = e.from_html('<code class="layer-key-badge svelte-w47swm"> </code>'), ha = e.from_html('<div role="button" tabindex="0"><div class="layer-item-preview svelte-w47swm"><img alt="Layer preview" class="svelte-w47swm"/></div> <div class="layer-item-info svelte-w47swm"><span class="layer-item-name svelte-w47swm"> <!></span> <div class="layer-item-actions svelte-w47swm"><button class="layer-order-btn svelte-w47swm" aria-label="Move up"><!></button> <button class="layer-order-btn svelte-w47swm" aria-label="Move down"><!></button> <button class="layer-delete-btn svelte-w47swm" aria-label="Delete layer"><!></button></div></div></div>'), ga = e.from_html('<div class="layers-list svelte-w47swm"></div>'), ba = e.from_html('<div class="canvas-header svelte-w47swm"><!></div>'), _a = e.from_html('<div class="processor-container svelte-w47swm"><sidebar class="svelte-w47swm"><!> <div class="editor-items svelte-w47swm"><div class="editor-section svelte-w47swm"><div class="mockup-name-header svelte-w47swm"><div class="mockup-title-group svelte-w47swm"><h3 class="mockup-name-title svelte-w47swm">Mockup</h3></div> <div class="mockup-buttons-group svelte-w47swm"><button class="new-mockup-btn svelte-w47swm" type="button"><!> New Mockup</button> <button class="view-all-btn svelte-w47swm" type="button">View All</button></div></div> <label class="form-label svelte-w47swm">Mockup Name</label> <div class="name-input-group svelte-w47swm"><input type="text" class="form-input name-input svelte-w47swm" placeholder="Mockup name..."/> <button class="copy-config-btn svelte-w47swm" type="button">Copy Config</button></div></div> <div class="editor-section svelte-w47swm"><div class="sidebar-title-2 svelte-w47swm">Canvas Setup</div> <div class="canvas-size-controls svelte-w47swm"><div class="form-input-group svelte-w47swm"><label class="form-label svelte-w47swm">Width</label> <input type="number" class="form-input svelte-w47swm" min="100" max="5000"/></div> <div class="form-input-group svelte-w47swm"><label class="form-label svelte-w47swm">Height</label> <input type="number" class="form-input svelte-w47swm" min="100" max="5000"/></div></div></div> <div class="editor-section svelte-w47swm"><div class="layers-header svelte-w47swm"><div class="layers-title svelte-w47swm"> </div> <div class="add-layer-buttons svelte-w47swm"><button class="add-layer-btn secondary svelte-w47swm" type="button"><!> </button> <label class="add-layer-btn svelte-w47swm"><!> File <input type="file" accept="image/*" style="display: none;"/></label></div></div> <!> <!></div> <!></div></sidebar> <div class="output-canvas svelte-w47swm"><!> <!></div> <!></div>');
|
|
2421
|
+
const ya = {
|
|
2215
2422
|
hash: "svelte-w47swm",
|
|
2216
2423
|
code: `.form-label.svelte-w47swm {display:block;font-size:0.75rem;font-weight:500;color:var(--color-text-muted, #666);margin-bottom:0.375rem;}.form-input.svelte-w47swm {width:100%;padding-top:0.5rem;padding-bottom:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;margin-bottom:1rem;}.form-input-group.svelte-w47swm .form-input:where(.svelte-w47swm) {margin-bottom:0;}.form-input.svelte-w47swm:focus {outline:none;border-color:var(--color-primary, #3b82f6);}.form-input-group.svelte-w47swm {display:flex;flex-direction:column;gap:0.25rem;}.processor-container.svelte-w47swm {display:flex;height:100%;overflow:hidden;}sidebar.svelte-w47swm {min-width:360px;flex-shrink:0;background:var(--color-surface, #fff);border-right:1px solid var(--color-border, #ccc);display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding-left:1rem;}.header-logos.svelte-w47swm {display:flex;gap:1rem;font-size:1.5rem;padding:0.5rem;padding-right:1rem;border-bottom:1px solid var(--color-border, #ccc);align-items:center;flex-wrap:wrap;}.editor-items.svelte-w47swm {flex:1;overflow-y:auto;padding:0;padding-right:0.5rem;display:flex;flex-direction:column;}.editor-section.svelte-w47swm {border-bottom:1px solid var(--color-border, #ccc);padding:0.25rem 0 0.75rem 0;}.output-canvas.svelte-w47swm {flex:1;display:flex;min-width:0;background:var(--color-bg, #f5f5f5);overflow:hidden;position:relative;flex-shrink:0;}.canvas-header.svelte-w47swm {display:none;}.sidebar-title-2.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);padding:0.75rem 0 0.25rem 0;margin-bottom:0.5rem;}.layers-header.svelte-w47swm {display:flex;align-items:center;justify-content:space-between;gap:0.5rem;margin-bottom:0.5rem;}.layers-title.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);flex:1;}.add-layer-buttons.svelte-w47swm {display:flex;gap:0.25rem;}.add-layer-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;display:flex;align-items:center;gap:0.375rem;}.add-layer-btn.svelte-w47swm:hover {background:var(--color-primary-dark, #2563eb);}.add-layer-btn.secondary.svelte-w47swm {background:transparent;color:var(--color-text, #111);border:1px solid var(--color-border, #ccc);}.add-layer-btn.secondary.svelte-w47swm:hover {background:var(--color-bg, #f5f5f5);}.url-input-group.svelte-w47swm {display:flex;gap:0.5rem;margin-top:0.5rem;padding:0.75rem;background:var(--color-surface-alt, #f5f5f5);border-radius:4px;}.url-input-group.svelte-w47swm input:where(.svelte-w47swm) {flex:1;padding-top:0.375rem;padding-bottom:0.375rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}.url-input-group.svelte-w47swm button:where(.svelte-w47swm) {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;}.url-input-group.svelte-w47swm button:where(.svelte-w47swm):hover {background:var(--color-primary-dark, #2563eb);}.canvas-size-controls.svelte-w47swm {display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;margin-bottom:1rem;margin-top:0;}.form-input-group.svelte-w47swm {display:flex;flex-direction:column;}.no-layers.svelte-w47swm {padding:1rem;text-align:center;color:var(--color-text-muted, #666);font-size:0.875rem;}.layers-list.svelte-w47swm {display:flex;flex-direction:column;gap:0.5rem;}.layer-item.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;padding:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;cursor:pointer;transition:all 200ms;background:var(--color-surface, #fff);}.layer-item.svelte-w47swm:hover {border-color:var(--color-primary, #3b82f6);background:var(--color-surface-alt, #f5f5f5);}.layer-item.selected.svelte-w47swm {border-color:var(--color-primary, #3b82f6);background:var(--color-primary-light, #eff6ff);}.layer-item-preview.svelte-w47swm {width:40px;height:40px;flex-shrink:0;border-radius:4px;overflow:hidden;background:#f5f5f5;display:flex;align-items:center;justify-content:center;}.layer-item-preview.svelte-w47swm img:where(.svelte-w47swm) {width:100%;height:100%;object-fit:cover;}.layer-item-info.svelte-w47swm {flex:1;display:flex;align-items:center;justify-content:space-between;gap:0.5rem;}.layer-item-name.svelte-w47swm {font-size:0.875rem;color:var(--color-text, #111);display:flex;flex-direction:column;gap:0.25rem;}.layer-key-badge.svelte-w47swm {font-size:0.7rem;font-family:monospace;background:var(--color-primary-light, #eff6ff);color:var(--color-primary, #3b82f6);padding:0.125rem 0.375rem;border-radius:3px;font-weight:500;}.layer-item-actions.svelte-w47swm {display:flex;gap:0.25rem;align-items:center;}.layer-order-btn.svelte-w47swm {background:transparent;border:1px solid var(--color-border, #ccc);border-radius:3px;width:24px;height:24px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all 200ms;color:var(--color-text, #000);padding:0;}.layer-order-btn.svelte-w47swm:hover:not(:disabled) {background:var(--color-primary, #3b82f6);border-color:var(--color-primary, #3b82f6);color:white;}.layer-order-btn.svelte-w47swm:disabled {opacity:0.3;cursor:not-allowed;}.layer-delete-btn.svelte-w47swm {background:#ef4444;color:white;border:none;border-radius:3px;display:flex;align-items:center;justify-content:center;padding:0;width:24px;height:24px;cursor:pointer;font-size:1rem;line-height:1;transition:background 200ms;}.layer-delete-btn.svelte-w47swm:hover {background:#dc2626;}.mockup-name-header.svelte-w47swm {display:flex;align-items:center;justify-content:space-between;margin-bottom:0.5rem;}.mockup-title-group.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;}.mockup-buttons-group.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;}.new-mockup-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;display:flex;align-items:center;gap:0.375rem;}.new-mockup-btn.svelte-w47swm:hover {background:var(--color-primary-dark, #2563eb);}.mockup-name-title.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);margin:0;}.view-all-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:transparent;color:var(--color-primary, #3b82f6);border:1px solid var(--color-primary, #3b82f6);border-radius:4px;cursor:pointer;font-size:0.875rem;transition:all 200ms;}.view-all-btn.svelte-w47swm:hover {background:var(--color-primary, #3b82f6);color:white;}.form-label.svelte-w47swm {display:block;font-size:0.875rem;font-weight:500;color:var(--color-text, #111);margin-bottom:0.25rem;}.form-input.svelte-w47swm {width:100%;padding:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;margin-bottom:0.75rem;}.name-input-group.svelte-w47swm {display:flex;gap:0.5rem;align-items:stretch;}.name-input.svelte-w47swm {flex:1;margin-bottom:0;min-width:0;}.copy-config-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:transparent;color:var(--color-primary, #3b82f6);border:1px solid var(--color-primary, #3b82f6);border-radius:4px;cursor:pointer;font-size:0.875rem;transition:all 200ms;white-space:nowrap;flex-shrink:0;}.copy-config-btn.svelte-w47swm:hover {background:var(--color-primary, #3b82f6);color:white;}.no-layers.svelte-w47swm {text-align:center;color:var(--color-text-muted, #666);font-size:0.875rem;padding:2rem;}
|
|
2217
2424
|
|
|
2218
2425
|
@media (max-width: 768px) {.processor-container.svelte-w47swm {flex-direction:column;height:100%;}sidebar.svelte-w47swm {min-width:unset;width:100%;border-right:none;border-top:1px solid var(--color-border, #ccc);order:2;flex-shrink:1;overflow-y:auto;}sidebar.svelte-w47swm .header-logos:where(.svelte-w47swm) {display:none;}.output-canvas.svelte-w47swm {order:1;flex:0 0 50vh;height:50vh;min-height:50vh;}.canvas-header.svelte-w47swm {display:flex;position:absolute;top:0;left:0;right:0;z-index:10;gap:1rem;font-size:1.5rem;padding:0.5rem 1rem;align-items:center;flex-wrap:wrap;}
|
|
2219
2426
|
}`
|
|
2220
2427
|
};
|
|
2221
|
-
function
|
|
2222
|
-
e.push(
|
|
2223
|
-
let t = e.prop(
|
|
2224
|
-
e.derived(() => e.get(
|
|
2225
|
-
function
|
|
2226
|
-
const
|
|
2428
|
+
function za(s, n) {
|
|
2429
|
+
e.push(n, !0), e.append_styles(s, ya);
|
|
2430
|
+
let t = e.prop(n, "storageKey", 3, da), a = e.prop(n, "currentMockupKey", 3, ua), r = e.state(e.proxy(rt())), o = e.state(""), i = e.state(null), h = e.state(""), _ = e.state(!1), k = e.state(!1), p = null;
|
|
2431
|
+
e.derived(() => e.get(i) ? e.get(r).composition.layers.find((j) => j.id === e.get(i)) ?? null : null);
|
|
2432
|
+
function v(j) {
|
|
2433
|
+
const X = {
|
|
2227
2434
|
id: crypto.randomUUID(),
|
|
2228
|
-
src:
|
|
2229
|
-
...
|
|
2230
|
-
effects: [{ ...
|
|
2435
|
+
src: j,
|
|
2436
|
+
...cn,
|
|
2437
|
+
effects: [{ ...ve }],
|
|
2231
2438
|
transform: {
|
|
2232
|
-
x: e.get(
|
|
2233
|
-
y: e.get(
|
|
2439
|
+
x: e.get(r).composition.width / 2,
|
|
2440
|
+
y: e.get(r).composition.height / 2,
|
|
2234
2441
|
scale: 1,
|
|
2235
2442
|
rotation: 0
|
|
2236
2443
|
}
|
|
2237
2444
|
};
|
|
2238
|
-
e.get(
|
|
2445
|
+
e.get(r).composition.layers.push(X), e.set(i, X.id, !0), d();
|
|
2239
2446
|
}
|
|
2240
|
-
function
|
|
2241
|
-
const
|
|
2242
|
-
|
|
2447
|
+
function f() {
|
|
2448
|
+
const j = e.get(h).trim();
|
|
2449
|
+
j && (v(j), e.set(h, ""), e.set(_, !1));
|
|
2243
2450
|
}
|
|
2244
|
-
function
|
|
2245
|
-
const
|
|
2246
|
-
if (
|
|
2451
|
+
function x(j) {
|
|
2452
|
+
const X = j.currentTarget, V = X.files?.[0];
|
|
2453
|
+
if (V) {
|
|
2247
2454
|
const $ = new FileReader();
|
|
2248
2455
|
$.onload = (ne) => {
|
|
2249
2456
|
const Q = ne.target?.result;
|
|
2250
|
-
typeof Q == "string" &&
|
|
2251
|
-
}, $.readAsDataURL(
|
|
2457
|
+
typeof Q == "string" && v(Q);
|
|
2458
|
+
}, $.readAsDataURL(V);
|
|
2252
2459
|
}
|
|
2253
|
-
|
|
2460
|
+
X.value = "";
|
|
2254
2461
|
}
|
|
2255
|
-
function
|
|
2256
|
-
e.set(
|
|
2462
|
+
function y(j) {
|
|
2463
|
+
e.set(i, j, !0);
|
|
2257
2464
|
}
|
|
2258
|
-
function
|
|
2259
|
-
const
|
|
2260
|
-
|
|
2465
|
+
function w(j, X) {
|
|
2466
|
+
const V = e.get(r).composition.layers.find(($) => $.id === j);
|
|
2467
|
+
V && (V.transform = X, d());
|
|
2261
2468
|
}
|
|
2262
|
-
function
|
|
2263
|
-
const
|
|
2264
|
-
|
|
2469
|
+
function S(j, X) {
|
|
2470
|
+
const V = e.get(r).composition.layers.find(($) => $.id === j);
|
|
2471
|
+
V && (V.opacity = X, d());
|
|
2265
2472
|
}
|
|
2266
|
-
function
|
|
2267
|
-
const
|
|
2268
|
-
|
|
2473
|
+
function I(j, X) {
|
|
2474
|
+
const V = e.get(r).composition.layers.find(($) => $.id === j);
|
|
2475
|
+
V && (V.visible = X, d());
|
|
2269
2476
|
}
|
|
2270
|
-
function
|
|
2271
|
-
const
|
|
2272
|
-
|
|
2477
|
+
function P(j, X) {
|
|
2478
|
+
const V = e.get(r).composition.layers.find(($) => $.id === j);
|
|
2479
|
+
V && (V.effects = X, d());
|
|
2273
2480
|
}
|
|
2274
|
-
function
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2481
|
+
function u(j, X) {
|
|
2482
|
+
const V = e.get(r).composition.layers.find(($) => $.id === j);
|
|
2483
|
+
V && (V.name = X.trim() || void 0, d());
|
|
2277
2484
|
}
|
|
2278
|
-
function
|
|
2279
|
-
e.get(
|
|
2485
|
+
function g(j) {
|
|
2486
|
+
e.get(r).composition.layers = e.get(r).composition.layers.filter((X) => X.id !== j), e.get(i) === j && e.set(i, null), d();
|
|
2280
2487
|
}
|
|
2281
|
-
function
|
|
2282
|
-
const
|
|
2283
|
-
if (
|
|
2284
|
-
const
|
|
2285
|
-
[
|
|
2488
|
+
function C(j) {
|
|
2489
|
+
const X = e.get(r).composition.layers.findIndex((V) => V.id === j);
|
|
2490
|
+
if (X > 0) {
|
|
2491
|
+
const V = [...e.get(r).composition.layers];
|
|
2492
|
+
[V[X - 1], V[X]] = [V[X], V[X - 1]], e.get(r).composition.layers = V, d();
|
|
2286
2493
|
}
|
|
2287
2494
|
}
|
|
2288
|
-
function
|
|
2289
|
-
const
|
|
2290
|
-
if (
|
|
2291
|
-
const
|
|
2292
|
-
[
|
|
2495
|
+
function M(j) {
|
|
2496
|
+
const X = e.get(r).composition.layers.findIndex((V) => V.id === j);
|
|
2497
|
+
if (X >= 0 && X < e.get(r).composition.layers.length - 1) {
|
|
2498
|
+
const V = [...e.get(r).composition.layers];
|
|
2499
|
+
[V[X], V[X + 1]] = [V[X + 1], V[X]], e.get(r).composition.layers = V, d();
|
|
2293
2500
|
}
|
|
2294
2501
|
}
|
|
2295
|
-
function
|
|
2296
|
-
e.get(
|
|
2502
|
+
function l(j, X) {
|
|
2503
|
+
e.get(r).composition.width = j, e.get(r).composition.height = X, d();
|
|
2297
2504
|
}
|
|
2298
|
-
function
|
|
2299
|
-
|
|
2505
|
+
function d() {
|
|
2506
|
+
p && clearTimeout(p), p = setTimeout(
|
|
2300
2507
|
() => {
|
|
2301
|
-
|
|
2508
|
+
c();
|
|
2302
2509
|
},
|
|
2303
2510
|
500
|
|
2304
2511
|
);
|
|
2305
2512
|
}
|
|
2306
|
-
function i() {
|
|
2307
|
-
e.get(n).name = e.get(s) || "Untitled Mockup", e.get(n).updatedAt = Date.now(), Br(e.get(n), t()), Ee(e.get(n).id, a());
|
|
2308
|
-
}
|
|
2309
2513
|
function c() {
|
|
2310
|
-
|
|
2311
|
-
const C = nt();
|
|
2312
|
-
e.set(n, C, !0), e.set(s, C.name, !0), Ee(null, a());
|
|
2514
|
+
e.get(r).name = e.get(o) || "Untitled Mockup", e.get(r).updatedAt = Date.now(), Qr(e.get(r), t()), qe(e.get(r).id, a());
|
|
2313
2515
|
}
|
|
2314
|
-
function
|
|
2315
|
-
|
|
2516
|
+
function b() {
|
|
2517
|
+
c();
|
|
2518
|
+
const j = rt();
|
|
2519
|
+
e.set(r, j, !0), e.set(o, j.name, !0), qe(null, a());
|
|
2316
2520
|
}
|
|
2317
|
-
function
|
|
2318
|
-
c(), e.set(
|
|
2521
|
+
function T(j) {
|
|
2522
|
+
c(), e.set(r, j, !0), e.set(o, j.name, !0), qe(j.id, a()), e.set(k, !1);
|
|
2523
|
+
}
|
|
2524
|
+
function m() {
|
|
2525
|
+
b(), e.set(k, !1);
|
|
2319
2526
|
}
|
|
2320
|
-
async function
|
|
2527
|
+
async function R() {
|
|
2321
2528
|
try {
|
|
2322
|
-
const
|
|
2323
|
-
await navigator.clipboard.writeText(
|
|
2324
|
-
} catch (
|
|
2325
|
-
console.error("Failed to copy config:",
|
|
2529
|
+
const j = JSON.stringify(e.get(r), null, 2);
|
|
2530
|
+
await navigator.clipboard.writeText(j);
|
|
2531
|
+
} catch (j) {
|
|
2532
|
+
console.error("Failed to copy config:", j);
|
|
2326
2533
|
}
|
|
2327
2534
|
}
|
|
2328
2535
|
Te(() => {
|
|
2329
|
-
const
|
|
2330
|
-
if (
|
|
2331
|
-
const
|
|
2332
|
-
|
|
2536
|
+
const j = na(a());
|
|
2537
|
+
if (j) {
|
|
2538
|
+
const X = ea(j, t());
|
|
2539
|
+
X && (e.set(r, X, !0), e.set(o, X.name, !0));
|
|
2333
2540
|
}
|
|
2334
2541
|
return () => {
|
|
2335
|
-
|
|
2542
|
+
p && clearTimeout(p), c();
|
|
2336
2543
|
};
|
|
2337
2544
|
});
|
|
2338
|
-
var
|
|
2545
|
+
var z = _a(), N = e.child(z), L = e.child(N);
|
|
2339
2546
|
{
|
|
2340
|
-
var
|
|
2341
|
-
var
|
|
2342
|
-
e.snippet(
|
|
2547
|
+
var W = (j) => {
|
|
2548
|
+
var X = pa(), V = e.child(X);
|
|
2549
|
+
e.snippet(V, () => n.children), e.reset(X), e.append(j, X);
|
|
2343
2550
|
};
|
|
2344
|
-
e.if(
|
|
2345
|
-
|
|
2551
|
+
e.if(L, (j) => {
|
|
2552
|
+
n.children && j(W);
|
|
2346
2553
|
});
|
|
2347
2554
|
}
|
|
2348
|
-
var
|
|
2349
|
-
|
|
2350
|
-
var
|
|
2351
|
-
Me(
|
|
2352
|
-
var G = e.sibling(
|
|
2353
|
-
G.__click = () => e.set(
|
|
2354
|
-
var
|
|
2355
|
-
e.remove_input_defaults(
|
|
2356
|
-
|
|
2555
|
+
var E = e.sibling(L, 2), Y = e.child(E), U = e.child(Y), q = e.sibling(e.child(U), 2), J = e.child(q);
|
|
2556
|
+
J.__click = b;
|
|
2557
|
+
var A = e.child(J);
|
|
2558
|
+
Me(A, {}), e.next(), e.reset(J);
|
|
2559
|
+
var G = e.sibling(J, 2);
|
|
2560
|
+
G.__click = () => e.set(k, !0), e.reset(q), e.reset(U);
|
|
2561
|
+
var Z = e.sibling(U, 4), B = e.child(Z);
|
|
2562
|
+
e.remove_input_defaults(B), B.__input = () => {
|
|
2563
|
+
d();
|
|
2357
2564
|
};
|
|
2358
|
-
var
|
|
2359
|
-
|
|
2360
|
-
var
|
|
2361
|
-
e.remove_input_defaults(de), de.__input = (
|
|
2362
|
-
var ie = e.sibling(
|
|
2363
|
-
e.remove_input_defaults(he), he.__input = (
|
|
2364
|
-
var ge = e.sibling(
|
|
2565
|
+
var O = e.sibling(B, 2);
|
|
2566
|
+
O.__click = R, e.reset(Z), e.reset(Y);
|
|
2567
|
+
var D = e.sibling(Y, 2), K = e.sibling(e.child(D), 2), H = e.child(K), de = e.sibling(e.child(H), 2);
|
|
2568
|
+
e.remove_input_defaults(de), de.__input = (j) => l(Number(j.currentTarget.value), e.get(r).composition.height), e.reset(H);
|
|
2569
|
+
var ie = e.sibling(H, 2), he = e.sibling(e.child(ie), 2);
|
|
2570
|
+
e.remove_input_defaults(he), he.__input = (j) => l(e.get(r).composition.width, Number(j.currentTarget.value)), e.reset(ie), e.reset(K), e.reset(D);
|
|
2571
|
+
var ge = e.sibling(D, 2), le = e.child(ge), be = e.child(le), Re = e.child(be);
|
|
2365
2572
|
e.reset(be);
|
|
2366
2573
|
var Se = e.sibling(be, 2), ue = e.child(Se);
|
|
2367
|
-
ue.__click = () => e.set(
|
|
2368
|
-
var
|
|
2369
|
-
Me(Ie, {});
|
|
2370
|
-
var _e = e.sibling(Ie);
|
|
2371
|
-
e.reset(ue);
|
|
2372
|
-
var me = e.sibling(ue, 2), ze = e.child(me);
|
|
2574
|
+
ue.__click = () => e.set(_, !e.get(_));
|
|
2575
|
+
var ze = e.child(ue);
|
|
2373
2576
|
Me(ze, {});
|
|
2374
|
-
var
|
|
2375
|
-
|
|
2376
|
-
var pe = e.sibling(
|
|
2577
|
+
var _e = e.sibling(ze);
|
|
2578
|
+
e.reset(ue);
|
|
2579
|
+
var pe = e.sibling(ue, 2), Ie = e.child(pe);
|
|
2580
|
+
Me(Ie, {});
|
|
2581
|
+
var We = e.sibling(Ie, 2);
|
|
2582
|
+
We.__change = x, e.reset(pe), e.reset(Se), e.reset(le);
|
|
2583
|
+
var me = e.sibling(le, 2);
|
|
2377
2584
|
{
|
|
2378
|
-
var ye = (
|
|
2379
|
-
var
|
|
2380
|
-
e.remove_input_defaults(
|
|
2381
|
-
var $ = e.sibling(
|
|
2382
|
-
$.__click =
|
|
2585
|
+
var ye = (j) => {
|
|
2586
|
+
var X = ma(), V = e.child(X);
|
|
2587
|
+
e.remove_input_defaults(V), V.__keydown = (ne) => ne.key === "Enter" && f();
|
|
2588
|
+
var $ = e.sibling(V, 2);
|
|
2589
|
+
$.__click = f, e.reset(X), e.bind_value(V, () => e.get(h), (ne) => e.set(h, ne)), e.append(j, X);
|
|
2383
2590
|
};
|
|
2384
|
-
e.if(
|
|
2385
|
-
e.get(
|
|
2591
|
+
e.if(me, (j) => {
|
|
2592
|
+
e.get(_) && j(ye);
|
|
2386
2593
|
});
|
|
2387
2594
|
}
|
|
2388
|
-
var
|
|
2595
|
+
var dt = e.sibling(me, 2);
|
|
2389
2596
|
{
|
|
2390
|
-
var
|
|
2391
|
-
var
|
|
2392
|
-
e.append(
|
|
2393
|
-
},
|
|
2394
|
-
var
|
|
2395
|
-
e.each(
|
|
2396
|
-
var Q =
|
|
2597
|
+
var ut = (j) => {
|
|
2598
|
+
var X = fa();
|
|
2599
|
+
e.append(j, X);
|
|
2600
|
+
}, pt = (j) => {
|
|
2601
|
+
var X = ga();
|
|
2602
|
+
e.each(X, 23, () => e.get(r).composition.layers, (V) => V.id, (V, $, ne) => {
|
|
2603
|
+
var Q = ha();
|
|
2397
2604
|
let te;
|
|
2398
|
-
Q.__click = () =>
|
|
2399
|
-
var
|
|
2400
|
-
e.reset(
|
|
2401
|
-
var
|
|
2605
|
+
Q.__click = () => y(e.get($).id), Q.__keydown = (re) => re.key === "Enter" && y(e.get($).id);
|
|
2606
|
+
var Xe = e.child(Q), _t = e.child(Xe);
|
|
2607
|
+
e.reset(Xe);
|
|
2608
|
+
var Ke = e.sibling(Xe, 2), Ye = e.child(Ke), Je = e.child(Ye), yt = e.sibling(Je);
|
|
2402
2609
|
{
|
|
2403
|
-
var
|
|
2404
|
-
var
|
|
2405
|
-
e.reset(
|
|
2610
|
+
var wt = (re) => {
|
|
2611
|
+
var Le = va(), Tt = e.child(Le, !0);
|
|
2612
|
+
e.reset(Le), e.template_effect(() => e.set_text(Tt, e.get($).name)), e.append(re, Le);
|
|
2406
2613
|
};
|
|
2407
|
-
e.if(
|
|
2408
|
-
e.get($).name && re(
|
|
2614
|
+
e.if(yt, (re) => {
|
|
2615
|
+
e.get($).name && re(wt);
|
|
2409
2616
|
});
|
|
2410
2617
|
}
|
|
2411
|
-
e.reset(
|
|
2412
|
-
var
|
|
2618
|
+
e.reset(Ye);
|
|
2619
|
+
var Ge = e.sibling(Ye, 2), we = e.child(Ge);
|
|
2413
2620
|
we.__click = (re) => {
|
|
2414
|
-
re.stopPropagation(),
|
|
2621
|
+
re.stopPropagation(), C(e.get($).id);
|
|
2415
2622
|
};
|
|
2416
|
-
var
|
|
2417
|
-
|
|
2623
|
+
var xt = e.child(we);
|
|
2624
|
+
at(xt, { rotate: "-90deg" }), e.reset(we);
|
|
2418
2625
|
var xe = e.sibling(we, 2);
|
|
2419
2626
|
xe.__click = (re) => {
|
|
2420
|
-
re.stopPropagation(),
|
|
2627
|
+
re.stopPropagation(), M(e.get($).id);
|
|
2421
2628
|
};
|
|
2422
|
-
var
|
|
2423
|
-
|
|
2424
|
-
var
|
|
2425
|
-
|
|
2426
|
-
re.stopPropagation(),
|
|
2629
|
+
var kt = e.child(xe);
|
|
2630
|
+
at(kt, { rotate: "90deg" }), e.reset(xe);
|
|
2631
|
+
var Ee = e.sibling(xe, 2);
|
|
2632
|
+
Ee.__click = (re) => {
|
|
2633
|
+
re.stopPropagation(), g(e.get($).id);
|
|
2427
2634
|
};
|
|
2428
|
-
var
|
|
2429
|
-
|
|
2430
|
-
te = e.set_class(Q, 1, "layer-item svelte-w47swm", null, te, { selected: e.get(
|
|
2431
|
-
}), e.append(
|
|
2432
|
-
}), e.reset(
|
|
2635
|
+
var Mt = e.child(Ee);
|
|
2636
|
+
Fe(Mt, {}), e.reset(Ee), e.reset(Ge), e.reset(Ke), e.reset(Q), e.template_effect(() => {
|
|
2637
|
+
te = e.set_class(Q, 1, "layer-item svelte-w47swm", null, te, { selected: e.get(i) === e.get($).id }), e.set_attribute(_t, "src", e.get($).src), e.set_text(Je, `${(e.get($).name || `Layer ${e.get(ne) + 1}`) ?? ""} `), we.disabled = e.get(ne) === 0, xe.disabled = e.get(ne) === e.get(r).composition.layers.length - 1;
|
|
2638
|
+
}), e.append(V, Q);
|
|
2639
|
+
}), e.reset(X), e.append(j, X);
|
|
2433
2640
|
};
|
|
2434
|
-
e.if(
|
|
2435
|
-
e.get(
|
|
2641
|
+
e.if(dt, (j) => {
|
|
2642
|
+
e.get(r).composition.layers.length === 0 ? j(ut) : j(pt, !1);
|
|
2436
2643
|
});
|
|
2437
2644
|
}
|
|
2438
2645
|
e.reset(ge);
|
|
2439
|
-
var
|
|
2646
|
+
var mt = e.sibling(ge, 2);
|
|
2440
2647
|
{
|
|
2441
|
-
var
|
|
2442
|
-
const
|
|
2443
|
-
var
|
|
2648
|
+
var ft = (j) => {
|
|
2649
|
+
const X = e.derived(() => e.get(r).composition.layers.find((Q) => Q.id === e.get(i)));
|
|
2650
|
+
var V = e.comment(), $ = e.first_child(V);
|
|
2444
2651
|
{
|
|
2445
2652
|
var ne = (Q) => {
|
|
2446
|
-
|
|
2653
|
+
Hr(Q, {
|
|
2447
2654
|
get layer() {
|
|
2448
|
-
return e.get(
|
|
2655
|
+
return e.get(X);
|
|
2449
2656
|
},
|
|
2450
2657
|
get canvasWidth() {
|
|
2451
|
-
return e.get(
|
|
2658
|
+
return e.get(r).composition.width;
|
|
2452
2659
|
},
|
|
2453
2660
|
get canvasHeight() {
|
|
2454
|
-
return e.get(
|
|
2661
|
+
return e.get(r).composition.height;
|
|
2455
2662
|
},
|
|
2456
|
-
onTransformChange: (te) =>
|
|
2457
|
-
onOpacityChange: (te) =>
|
|
2458
|
-
onVisibilityChange: (te) =>
|
|
2459
|
-
onEffectsChange: (te) =>
|
|
2460
|
-
onNameChange: (te) =>
|
|
2461
|
-
onDelete: () =>
|
|
2663
|
+
onTransformChange: (te) => w(e.get(X).id, te),
|
|
2664
|
+
onOpacityChange: (te) => S(e.get(X).id, te),
|
|
2665
|
+
onVisibilityChange: (te) => I(e.get(X).id, te),
|
|
2666
|
+
onEffectsChange: (te) => P(e.get(X).id, te),
|
|
2667
|
+
onNameChange: (te) => u(e.get(X).id, te),
|
|
2668
|
+
onDelete: () => g(e.get(X).id)
|
|
2462
2669
|
});
|
|
2463
2670
|
};
|
|
2464
2671
|
e.if($, (Q) => {
|
|
2465
|
-
e.get(
|
|
2672
|
+
e.get(X) && Q(ne);
|
|
2466
2673
|
});
|
|
2467
2674
|
}
|
|
2468
|
-
e.append(
|
|
2675
|
+
e.append(j, V);
|
|
2469
2676
|
};
|
|
2470
|
-
e.if(
|
|
2471
|
-
e.get(
|
|
2677
|
+
e.if(mt, (j) => {
|
|
2678
|
+
e.get(i) && j(ft);
|
|
2472
2679
|
});
|
|
2473
2680
|
}
|
|
2474
|
-
e.reset(
|
|
2475
|
-
var
|
|
2681
|
+
e.reset(E), e.reset(N);
|
|
2682
|
+
var De = e.sibling(N, 2), He = e.child(De);
|
|
2476
2683
|
{
|
|
2477
|
-
var
|
|
2478
|
-
var
|
|
2479
|
-
e.snippet(
|
|
2684
|
+
var vt = (j) => {
|
|
2685
|
+
var X = ba(), V = e.child(X);
|
|
2686
|
+
e.snippet(V, () => n.children), e.reset(X), e.append(j, X);
|
|
2480
2687
|
};
|
|
2481
|
-
e.if(He, (
|
|
2482
|
-
|
|
2688
|
+
e.if(He, (j) => {
|
|
2689
|
+
n.children && j(vt);
|
|
2483
2690
|
});
|
|
2484
2691
|
}
|
|
2485
|
-
var
|
|
2486
|
-
|
|
2487
|
-
children: (
|
|
2488
|
-
|
|
2692
|
+
var ht = e.sibling(He, 2);
|
|
2693
|
+
pn(ht, {
|
|
2694
|
+
children: (j, X) => {
|
|
2695
|
+
gn(j, {
|
|
2489
2696
|
get mockup() {
|
|
2490
|
-
return e.get(
|
|
2697
|
+
return e.get(r);
|
|
2491
2698
|
}
|
|
2492
2699
|
});
|
|
2493
2700
|
}
|
|
2494
|
-
}), e.reset(
|
|
2495
|
-
var
|
|
2701
|
+
}), e.reset(De);
|
|
2702
|
+
var gt = e.sibling(De, 2);
|
|
2496
2703
|
{
|
|
2497
|
-
var
|
|
2498
|
-
|
|
2499
|
-
onclose: () => e.set(
|
|
2500
|
-
onSelect:
|
|
2501
|
-
onNew:
|
|
2704
|
+
var bt = (j) => {
|
|
2705
|
+
la(j, {
|
|
2706
|
+
onclose: () => e.set(k, !1),
|
|
2707
|
+
onSelect: T,
|
|
2708
|
+
onNew: m,
|
|
2502
2709
|
get currentMockupId() {
|
|
2503
|
-
return e.get(
|
|
2710
|
+
return e.get(r).id;
|
|
2504
2711
|
},
|
|
2505
2712
|
get storageKey() {
|
|
2506
2713
|
return t();
|
|
2507
2714
|
}
|
|
2508
2715
|
});
|
|
2509
2716
|
};
|
|
2510
|
-
e.if(
|
|
2511
|
-
e.get(
|
|
2717
|
+
e.if(gt, (j) => {
|
|
2718
|
+
e.get(k) && j(bt);
|
|
2512
2719
|
});
|
|
2513
2720
|
}
|
|
2514
|
-
e.reset(
|
|
2515
|
-
e.set_value(de, e.get(
|
|
2516
|
-
}), e.bind_value(
|
|
2721
|
+
e.reset(z), e.template_effect(() => {
|
|
2722
|
+
e.set_value(de, e.get(r).composition.width), e.set_value(he, e.get(r).composition.height), e.set_text(Re, `Layers (${e.get(r).composition.layers.length ?? ""})`), e.set_text(_e, ` ${e.get(_) ? "Cancel" : "URL"}`);
|
|
2723
|
+
}), e.bind_value(B, () => e.get(o), (j) => e.set(o, j)), e.append(s, z), e.pop();
|
|
2517
2724
|
}
|
|
2518
2725
|
e.delegate(["click", "input", "change", "keydown"]);
|
|
2519
2726
|
export {
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2727
|
+
ua as CURRENT_MOCKUP_KEY,
|
|
2728
|
+
ot as InputBatcher,
|
|
2729
|
+
Hr as LayerControls,
|
|
2730
|
+
za as MockupEditor,
|
|
2731
|
+
gn as MockupEditorRenderer,
|
|
2732
|
+
la as MockupListModal,
|
|
2733
|
+
Sa as MockupRenderer,
|
|
2734
|
+
an as RenderScheduler,
|
|
2735
|
+
da as STORAGE_KEY,
|
|
2736
|
+
pn as ZoomableCanvas,
|
|
2737
|
+
rt as createNewMockup,
|
|
2738
|
+
lt as defaultComposition,
|
|
2532
2739
|
ce as defaultCylinderWarp,
|
|
2533
2740
|
se as defaultImageOnSurface,
|
|
2534
|
-
|
|
2741
|
+
cn as defaultLayer,
|
|
2535
2742
|
ae as defaultPlaneWarp,
|
|
2536
|
-
|
|
2743
|
+
ve as defaultResizeEffect,
|
|
2537
2744
|
ee as defaultRestyleEffect,
|
|
2538
2745
|
ke as defaultSphereWarp,
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2746
|
+
Pe as defaultSvgEffect,
|
|
2747
|
+
ln as defaultTransform,
|
|
2748
|
+
Ce as defaultView,
|
|
2749
|
+
fe as defaultWarpDebug,
|
|
2750
|
+
et as defaultWarpEffect,
|
|
2751
|
+
ta as deleteMockup,
|
|
2544
2752
|
Ne as loadAllMockups,
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2753
|
+
na as loadCurrentMockupId,
|
|
2754
|
+
ea as loadMockup,
|
|
2755
|
+
Ue as renderMockupCanvas,
|
|
2756
|
+
mn as renderMockupCanvasEditor,
|
|
2757
|
+
qe as saveCurrentMockupId,
|
|
2758
|
+
Qr as saveMockup
|
|
2551
2759
|
};
|