@antontranelis/money-printer 1.0.5 → 1.0.7
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.cjs +1 -1
- package/dist/index.js +443 -454
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { create as
|
|
3
|
-
import { persist as
|
|
4
|
-
import { useState as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as m, jsx as l, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { create as fe } from "zustand";
|
|
3
|
+
import { persist as be } from "zustand/middleware";
|
|
4
|
+
import { useState as E, useCallback as C, useRef as $, useEffect as G } from "react";
|
|
5
|
+
import ye from "jspdf";
|
|
6
|
+
const V = {
|
|
7
7
|
personalInfo: {
|
|
8
8
|
name: "",
|
|
9
9
|
email: "",
|
|
@@ -23,10 +23,10 @@ const G = {
|
|
|
23
23
|
currentSide: "front",
|
|
24
24
|
isEnhancing: !1,
|
|
25
25
|
isExporting: !1
|
|
26
|
-
}, y =
|
|
27
|
-
|
|
26
|
+
}, y = fe()(
|
|
27
|
+
be(
|
|
28
28
|
(e) => ({
|
|
29
|
-
...
|
|
29
|
+
...V,
|
|
30
30
|
setPersonalInfo: (t) => e((a) => ({
|
|
31
31
|
personalInfo: { ...a.personalInfo, ...t }
|
|
32
32
|
})),
|
|
@@ -72,7 +72,7 @@ const G = {
|
|
|
72
72
|
setHours: (t) => e((a) => ({
|
|
73
73
|
voucherConfig: { ...a.voucherConfig, hours: t }
|
|
74
74
|
})),
|
|
75
|
-
reset: () => e(
|
|
75
|
+
reset: () => e(V)
|
|
76
76
|
}),
|
|
77
77
|
{
|
|
78
78
|
name: "money-generator-storage",
|
|
@@ -82,7 +82,7 @@ const G = {
|
|
|
82
82
|
})
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
|
-
),
|
|
85
|
+
), we = {
|
|
86
86
|
header: {
|
|
87
87
|
title: "Money Generator",
|
|
88
88
|
subtitle: "Erstelle deinen persönlichen Zeitgutschein"
|
|
@@ -129,7 +129,7 @@ const G = {
|
|
|
129
129
|
bill: {
|
|
130
130
|
descriptionText: "Für diesen Schein erhältst du {hours} {hourLabel} meiner Zeit oder ein gleichwertiges Dankeschön"
|
|
131
131
|
}
|
|
132
|
-
},
|
|
132
|
+
}, ve = {
|
|
133
133
|
header: {
|
|
134
134
|
title: "Money Generator",
|
|
135
135
|
subtitle: "Create your personal time voucher"
|
|
@@ -176,20 +176,20 @@ const G = {
|
|
|
176
176
|
bill: {
|
|
177
177
|
descriptionText: "This voucher entitles you to {hours} {hourLabel} of my time or an equivalent thank you"
|
|
178
178
|
}
|
|
179
|
-
},
|
|
180
|
-
function
|
|
181
|
-
return
|
|
179
|
+
}, xe = { de: we, en: ve };
|
|
180
|
+
function z(e) {
|
|
181
|
+
return xe[e];
|
|
182
182
|
}
|
|
183
183
|
function J(e, t, a) {
|
|
184
184
|
if (a && a.trim())
|
|
185
185
|
return a;
|
|
186
|
-
const n =
|
|
186
|
+
const n = z(e), r = t === 1 ? n.form.voucher.hourLabel : n.form.voucher.hoursLabel;
|
|
187
187
|
return n.bill.descriptionText.replace("{hours}", t.toString()).replace("{hourLabel}", r);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
const e = y((r) => r.voucherConfig.language), t = y((r) => r.personalInfo), a = y((r) => r.setPersonalInfo), n =
|
|
191
|
-
return /* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
189
|
+
function Ve() {
|
|
190
|
+
const e = y((r) => r.voucherConfig.language), t = y((r) => r.personalInfo), a = y((r) => r.setPersonalInfo), n = z(e);
|
|
191
|
+
return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
|
|
192
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
193
193
|
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.name }) }),
|
|
194
194
|
/* @__PURE__ */ l(
|
|
195
195
|
"input",
|
|
@@ -202,7 +202,7 @@ function Oe() {
|
|
|
202
202
|
}
|
|
203
203
|
)
|
|
204
204
|
] }),
|
|
205
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
206
206
|
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.email }) }),
|
|
207
207
|
/* @__PURE__ */ l(
|
|
208
208
|
"input",
|
|
@@ -215,7 +215,7 @@ function Oe() {
|
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
217
|
] }),
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
219
219
|
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text font-medium", children: n.form.personalInfo.phone }) }),
|
|
220
220
|
/* @__PURE__ */ l(
|
|
221
221
|
"input",
|
|
@@ -230,7 +230,7 @@ function Oe() {
|
|
|
230
230
|
] })
|
|
231
231
|
] });
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const j = {}, Ie = "https://api.stability.ai/v1/generation", ke = "https://api.stability.ai/v2beta/stable-image/edit/remove-background", Q = "stability_api_key", Ne = {
|
|
234
234
|
vintage: "portrait in the style of vintage currency engraving, fine line work, crosshatching, sepia tones, detailed stippling, classic bank note portrait style",
|
|
235
235
|
engraved: "portrait as detailed intaglio engraving, currency bill style, fine parallel lines, high contrast, official government portrait",
|
|
236
236
|
currency: "portrait rendered as US dollar bill engraving, official currency portrait style, green tint, fine line engraving technique"
|
|
@@ -245,80 +245,80 @@ const K = {}, be = "https://api.stability.ai/v1/generation", ye = "https://api.s
|
|
|
245
245
|
{ width: 832, height: 1216 },
|
|
246
246
|
{ width: 896, height: 1152 }
|
|
247
247
|
];
|
|
248
|
-
function
|
|
248
|
+
function Ee(e, t) {
|
|
249
249
|
const a = e / t;
|
|
250
250
|
let n = Z[0], r = 1 / 0;
|
|
251
|
-
for (const
|
|
252
|
-
const
|
|
253
|
-
|
|
251
|
+
for (const s of Z) {
|
|
252
|
+
const d = s.width / s.height, o = Math.abs(a - d);
|
|
253
|
+
o < r && (r = o, n = s);
|
|
254
254
|
}
|
|
255
255
|
return n;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Pe(e) {
|
|
258
258
|
return new Promise((t, a) => {
|
|
259
259
|
const n = new Image();
|
|
260
260
|
n.onload = () => {
|
|
261
|
-
const r =
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
if (!
|
|
261
|
+
const r = Ee(n.width, n.height), s = document.createElement("canvas");
|
|
262
|
+
s.width = r.width, s.height = r.height;
|
|
263
|
+
const d = s.getContext("2d");
|
|
264
|
+
if (!d) {
|
|
265
265
|
a(new Error("Failed to get canvas context"));
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
const
|
|
269
|
-
let
|
|
270
|
-
|
|
268
|
+
const o = n.width / n.height, i = r.width / r.height;
|
|
269
|
+
let c = 0, u = 0, g = n.width, f = n.height;
|
|
270
|
+
o > i ? (g = n.height * i, c = (n.width - g) / 2) : (f = n.width / i, u = (n.height - f) / 2), d.drawImage(n, c, u, g, f, 0, 0, r.width, r.height), t(s.toDataURL("image/png"));
|
|
271
271
|
}, n.onerror = () => a(new Error("Failed to load image")), n.src = e;
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
function ee(e) {
|
|
275
|
-
var
|
|
276
|
-
const t = e.split(","), a = ((
|
|
277
|
-
for (let
|
|
278
|
-
|
|
279
|
-
return new Blob([
|
|
275
|
+
var d;
|
|
276
|
+
const t = e.split(","), a = ((d = t[0].match(/:(.*?);/)) == null ? void 0 : d[1]) || "image/png", n = atob(t[1]), r = n.length, s = new Uint8Array(r);
|
|
277
|
+
for (let o = 0; o < r; o++)
|
|
278
|
+
s[o] = n.charCodeAt(o);
|
|
279
|
+
return new Blob([s], { type: a });
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function q() {
|
|
282
282
|
var t;
|
|
283
|
-
const e = typeof import.meta < "u" && (
|
|
283
|
+
const e = typeof import.meta < "u" && (j == null ? void 0 : j.VITE_STABILITY_API_KEY) || typeof process < "u" && ((t = process.env) == null ? void 0 : t.NEXT_PUBLIC_STABILITY_API_KEY);
|
|
284
284
|
return e && e !== "your-api-key-here" ? e : typeof localStorage < "u" ? localStorage.getItem(Q) : null;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function Se(e) {
|
|
287
287
|
localStorage.setItem(Q, e);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
return
|
|
289
|
+
function Ce() {
|
|
290
|
+
return q() !== null;
|
|
291
291
|
}
|
|
292
|
-
async function
|
|
293
|
-
const t =
|
|
292
|
+
async function Ze(e) {
|
|
293
|
+
const t = q();
|
|
294
294
|
if (!t)
|
|
295
295
|
throw new Error("No Stability AI API key configured");
|
|
296
|
-
const { imageDataUrl: a, style: n, strength: r = 0.35 } = e,
|
|
297
|
-
|
|
298
|
-
const
|
|
296
|
+
const { imageDataUrl: a, style: n, strength: r = 0.35 } = e, s = await Pe(a), d = ee(s), o = new FormData();
|
|
297
|
+
o.append("init_image", d, "portrait.png"), o.append("init_image_mode", "IMAGE_STRENGTH"), o.append("image_strength", String(1 - r)), o.append("text_prompts[0][text]", Ne[n]), o.append("text_prompts[0][weight]", "1"), o.append("cfg_scale", "7"), o.append("samples", "1"), o.append("steps", "30");
|
|
298
|
+
const c = await fetch(`${Ie}/stable-diffusion-xl-1024-v1-0/image-to-image`, {
|
|
299
299
|
method: "POST",
|
|
300
300
|
headers: {
|
|
301
301
|
Authorization: `Bearer ${t}`,
|
|
302
302
|
Accept: "application/json"
|
|
303
303
|
},
|
|
304
|
-
body:
|
|
304
|
+
body: o
|
|
305
305
|
});
|
|
306
|
-
if (!
|
|
307
|
-
const
|
|
308
|
-
throw console.error("Stability AI error:",
|
|
306
|
+
if (!c.ok) {
|
|
307
|
+
const g = await c.text();
|
|
308
|
+
throw console.error("Stability AI error:", g), c.status === 401 ? new Error("Invalid API key") : c.status === 402 ? new Error("Insufficient credits") : c.status === 429 ? new Error("Rate limit exceeded. Please try again later.") : new Error(`API error: ${c.status}`);
|
|
309
309
|
}
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
310
|
+
const u = await c.json();
|
|
311
|
+
if (!u.artifacts || u.artifacts.length === 0)
|
|
312
312
|
throw new Error("No image generated");
|
|
313
|
-
return `data:image/png;base64,${
|
|
313
|
+
return `data:image/png;base64,${u.artifacts[0].base64}`;
|
|
314
314
|
}
|
|
315
|
-
async function
|
|
316
|
-
const t =
|
|
315
|
+
async function Ae(e) {
|
|
316
|
+
const t = q();
|
|
317
317
|
if (!t)
|
|
318
318
|
throw new Error("No Stability AI API key configured");
|
|
319
319
|
const a = ee(e), n = new FormData();
|
|
320
320
|
n.append("image", a, "image.png"), n.append("output_format", "png");
|
|
321
|
-
const r = await fetch(
|
|
321
|
+
const r = await fetch(ke, {
|
|
322
322
|
method: "POST",
|
|
323
323
|
headers: {
|
|
324
324
|
Authorization: `Bearer ${t}`,
|
|
@@ -327,63 +327,62 @@ async function Ee(e) {
|
|
|
327
327
|
body: n
|
|
328
328
|
});
|
|
329
329
|
if (!r.ok) {
|
|
330
|
-
const
|
|
331
|
-
throw console.error("Stability AI remove background error:",
|
|
330
|
+
const d = await r.text();
|
|
331
|
+
throw console.error("Stability AI remove background error:", d), r.status === 401 ? new Error("Invalid API key") : r.status === 402 ? new Error("Insufficient credits") : r.status === 429 ? new Error("Rate limit exceeded. Please try again later.") : new Error(`API error: ${r.status}`);
|
|
332
332
|
}
|
|
333
|
-
const
|
|
334
|
-
return new Promise((
|
|
335
|
-
const
|
|
336
|
-
|
|
333
|
+
const s = await r.blob();
|
|
334
|
+
return new Promise((d, o) => {
|
|
335
|
+
const i = new FileReader();
|
|
336
|
+
i.onload = () => d(i.result), i.onerror = () => o(new Error("Failed to read result")), i.readAsDataURL(s);
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
|
-
async function
|
|
339
|
+
async function Te(e) {
|
|
340
340
|
return new Promise((t, a) => {
|
|
341
341
|
const n = new Image();
|
|
342
342
|
n.onload = () => {
|
|
343
|
-
const r = document.createElement("canvas"),
|
|
344
|
-
if (!
|
|
343
|
+
const r = document.createElement("canvas"), s = r.getContext("2d");
|
|
344
|
+
if (!s) {
|
|
345
345
|
a(new Error("Failed to get canvas context"));
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
r.width = n.width, r.height = n.height,
|
|
349
|
-
const
|
|
350
|
-
for (let
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
v = Math.
|
|
356
|
-
|
|
357
|
-
s[o] = I, s[o + 1] = P, s[o + 2] = w;
|
|
348
|
+
r.width = n.width, r.height = n.height, s.drawImage(n, 0, 0);
|
|
349
|
+
const d = s.getImageData(0, 0, r.width, r.height), o = d.data;
|
|
350
|
+
for (let i = 0; i < o.length; i += 4) {
|
|
351
|
+
const c = o[i], u = o[i + 1], g = o[i + 2];
|
|
352
|
+
if (o[i + 3] === 0) continue;
|
|
353
|
+
let x = (((0.299 * c + 0.587 * u + 0.114 * g) / 255 - 0.5) * 1.15 + 0.5) * 255;
|
|
354
|
+
x = Math.max(0, Math.min(255, x));
|
|
355
|
+
const k = Math.min(255, x * 0.95 + 30), v = Math.min(255, x * 0.85 + 20), S = Math.min(255, x * 0.65 + 10);
|
|
356
|
+
o[i] = k, o[i + 1] = v, o[i + 2] = S;
|
|
358
357
|
}
|
|
359
|
-
|
|
358
|
+
s.putImageData(d, 0, 0), t(r.toDataURL("image/png"));
|
|
360
359
|
}, n.onerror = () => a(new Error("Failed to load image")), n.src = e;
|
|
361
360
|
});
|
|
362
361
|
}
|
|
363
|
-
function
|
|
364
|
-
const [e, t] =
|
|
365
|
-
|
|
366
|
-
}, []),
|
|
367
|
-
async (
|
|
368
|
-
t(!0),
|
|
362
|
+
function Le() {
|
|
363
|
+
const [e, t] = E(!1), [a, n] = E(!1), [r, s] = E(null), [d, o] = E(Ce()), i = C(() => s(null), []), c = C((f) => {
|
|
364
|
+
Se(f), o(!0), s(null);
|
|
365
|
+
}, []), u = C(
|
|
366
|
+
async (f, b = "vintage") => {
|
|
367
|
+
t(!0), s(null);
|
|
369
368
|
try {
|
|
370
|
-
return await
|
|
369
|
+
return await Te(f);
|
|
371
370
|
} catch (h) {
|
|
372
|
-
const
|
|
373
|
-
throw
|
|
371
|
+
const x = h instanceof Error ? h.message : "Enhancement failed";
|
|
372
|
+
throw s(x), h;
|
|
374
373
|
} finally {
|
|
375
374
|
t(!1);
|
|
376
375
|
}
|
|
377
376
|
},
|
|
378
377
|
[]
|
|
379
|
-
),
|
|
380
|
-
async (
|
|
381
|
-
n(!0),
|
|
378
|
+
), g = C(
|
|
379
|
+
async (f) => {
|
|
380
|
+
n(!0), s(null);
|
|
382
381
|
try {
|
|
383
|
-
return await
|
|
384
|
-
} catch (
|
|
385
|
-
const h =
|
|
386
|
-
throw
|
|
382
|
+
return await Ae(f);
|
|
383
|
+
} catch (b) {
|
|
384
|
+
const h = b instanceof Error ? b.message : "Background removal failed";
|
|
385
|
+
throw s(h), b;
|
|
387
386
|
} finally {
|
|
388
387
|
n(!1);
|
|
389
388
|
}
|
|
@@ -391,22 +390,22 @@ function Ne() {
|
|
|
391
390
|
[]
|
|
392
391
|
);
|
|
393
392
|
return {
|
|
394
|
-
enhance:
|
|
395
|
-
removeBg:
|
|
393
|
+
enhance: u,
|
|
394
|
+
removeBg: g,
|
|
396
395
|
isEnhancing: e,
|
|
397
396
|
isRemovingBg: a,
|
|
398
397
|
error: r,
|
|
399
|
-
hasKey:
|
|
400
|
-
setApiKey:
|
|
401
|
-
clearError:
|
|
398
|
+
hasKey: d,
|
|
399
|
+
setApiKey: c,
|
|
400
|
+
clearError: i
|
|
402
401
|
};
|
|
403
402
|
}
|
|
404
|
-
function
|
|
405
|
-
const n = y((
|
|
403
|
+
function De({ isOpen: e, onClose: t, onSubmit: a }) {
|
|
404
|
+
const n = y((c) => c.voucherConfig.language), [r, s] = E("");
|
|
406
405
|
if (!e) return null;
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
},
|
|
406
|
+
const d = (c) => {
|
|
407
|
+
c.preventDefault(), r.trim() && (a(r.trim()), s(""), t());
|
|
408
|
+
}, i = {
|
|
410
409
|
de: {
|
|
411
410
|
title: "Stability AI API Key",
|
|
412
411
|
description: "Um die AI-Bildverbesserung zu nutzen, benötigst du einen Stability AI API Key. Du kannst ihn auf platform.stability.ai erhalten.",
|
|
@@ -424,104 +423,104 @@ function Se({ isOpen: e, onClose: t, onSubmit: a }) {
|
|
|
424
423
|
hint: "The key is stored locally in your browser."
|
|
425
424
|
}
|
|
426
425
|
}[n];
|
|
427
|
-
return /* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */ l("h3", { className: "font-bold text-lg", children:
|
|
430
|
-
/* @__PURE__ */ l("p", { className: "py-4 text-sm opacity-80", children:
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ m("dialog", { className: "modal modal-open", children: [
|
|
427
|
+
/* @__PURE__ */ m("div", { className: "modal-box", children: [
|
|
428
|
+
/* @__PURE__ */ l("h3", { className: "font-bold text-lg", children: i.title }),
|
|
429
|
+
/* @__PURE__ */ l("p", { className: "py-4 text-sm opacity-80", children: i.description }),
|
|
430
|
+
/* @__PURE__ */ m("form", { onSubmit: d, children: [
|
|
431
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
433
432
|
/* @__PURE__ */ l(
|
|
434
433
|
"input",
|
|
435
434
|
{
|
|
436
435
|
type: "password",
|
|
437
|
-
placeholder:
|
|
436
|
+
placeholder: i.placeholder,
|
|
438
437
|
className: "input input-bordered w-full",
|
|
439
438
|
value: r,
|
|
440
|
-
onChange: (
|
|
439
|
+
onChange: (c) => s(c.target.value),
|
|
441
440
|
autoFocus: !0
|
|
442
441
|
}
|
|
443
442
|
),
|
|
444
|
-
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text-alt", children:
|
|
443
|
+
/* @__PURE__ */ l("label", { className: "label", children: /* @__PURE__ */ l("span", { className: "label-text-alt", children: i.hint }) })
|
|
445
444
|
] }),
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */ l("button", { type: "button", className: "btn btn-ghost", onClick: t, children:
|
|
448
|
-
/* @__PURE__ */ l("button", { type: "submit", className: "btn btn-primary", disabled: !r.trim(), children:
|
|
445
|
+
/* @__PURE__ */ m("div", { className: "modal-action", children: [
|
|
446
|
+
/* @__PURE__ */ l("button", { type: "button", className: "btn btn-ghost", onClick: t, children: i.cancel }),
|
|
447
|
+
/* @__PURE__ */ l("button", { type: "submit", className: "btn btn-primary", disabled: !r.trim(), children: i.submit })
|
|
449
448
|
] })
|
|
450
449
|
] })
|
|
451
450
|
] }),
|
|
452
451
|
/* @__PURE__ */ l("form", { method: "dialog", className: "modal-backdrop", children: /* @__PURE__ */ l("button", { onClick: t, children: "close" }) })
|
|
453
452
|
] });
|
|
454
453
|
}
|
|
455
|
-
function
|
|
456
|
-
const e = y((
|
|
457
|
-
async (
|
|
458
|
-
if (!
|
|
454
|
+
function Xe() {
|
|
455
|
+
const e = y((p) => p.voucherConfig.language), t = y((p) => p.portrait), a = y((p) => p.setPortrait), n = y((p) => p.setPortraitZoom), { enhance: r, removeBg: s, isEnhancing: d, isRemovingBg: o, error: i, hasKey: c, setApiKey: u } = Le(), g = z(e), f = $(null), [b, h] = E(!1), [x, k] = E(!1), [v, S] = E(null), [w, N] = E(!1), [T, L] = E(!1), H = C(
|
|
456
|
+
async (p) => {
|
|
457
|
+
if (!p.type.startsWith("image/"))
|
|
459
458
|
return;
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
var
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
const W = await s(F);
|
|
467
|
-
a(W);
|
|
468
|
-
} catch (W) {
|
|
469
|
-
console.error("Background removal failed, using original:", W), a(F);
|
|
470
|
-
}
|
|
471
|
-
else
|
|
472
|
-
a(F);
|
|
473
|
-
}, x.readAsDataURL(m);
|
|
459
|
+
const P = new FileReader();
|
|
460
|
+
P.onload = async (D) => {
|
|
461
|
+
var _;
|
|
462
|
+
const A = (_ = D.target) == null ? void 0 : _.result;
|
|
463
|
+
S(A), a(A), N(!1), L(!1);
|
|
464
|
+
}, P.readAsDataURL(p);
|
|
474
465
|
},
|
|
475
|
-
[a
|
|
476
|
-
),
|
|
477
|
-
(
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
466
|
+
[a]
|
|
467
|
+
), W = C(
|
|
468
|
+
(p) => {
|
|
469
|
+
p.preventDefault(), h(!1);
|
|
470
|
+
const P = p.dataTransfer.files[0];
|
|
471
|
+
P && H(P);
|
|
481
472
|
},
|
|
482
|
-
[
|
|
483
|
-
),
|
|
484
|
-
|
|
485
|
-
}, []),
|
|
486
|
-
|
|
487
|
-
}, []),
|
|
488
|
-
var
|
|
489
|
-
(
|
|
490
|
-
},
|
|
491
|
-
var
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
P(!0);
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
473
|
+
[H]
|
|
474
|
+
), se = C((p) => {
|
|
475
|
+
p.preventDefault(), h(!0);
|
|
476
|
+
}, []), le = C((p) => {
|
|
477
|
+
p.preventDefault(), h(!1);
|
|
478
|
+
}, []), ce = () => {
|
|
479
|
+
var p;
|
|
480
|
+
(p = f.current) == null || p.click();
|
|
481
|
+
}, de = (p) => {
|
|
482
|
+
var D;
|
|
483
|
+
const P = (D = p.target.files) == null ? void 0 : D[0];
|
|
484
|
+
P && H(P);
|
|
485
|
+
}, K = C(async (p, P, D) => {
|
|
486
|
+
let A = p;
|
|
487
|
+
if (P && c)
|
|
500
488
|
try {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
console.error("Enhancement failed:", m);
|
|
489
|
+
A = await s(A);
|
|
490
|
+
} catch (_) {
|
|
491
|
+
console.error("Background removal failed:", _);
|
|
505
492
|
}
|
|
506
|
-
|
|
507
|
-
}, le = async (m) => {
|
|
508
|
-
if (b(m), t.original)
|
|
493
|
+
if (D)
|
|
509
494
|
try {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
console.error("Enhancement failed:", x);
|
|
495
|
+
A = await r(A, "vintage");
|
|
496
|
+
} catch (_) {
|
|
497
|
+
console.error("Enhancement failed:", _);
|
|
514
498
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
499
|
+
a(A);
|
|
500
|
+
}, [c, s, r, a]), he = async () => {
|
|
501
|
+
if (!v) return;
|
|
502
|
+
if (!w && !c) {
|
|
503
|
+
k(!0);
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
const p = !w;
|
|
507
|
+
N(p), await K(v, p, T);
|
|
508
|
+
}, pe = async () => {
|
|
509
|
+
if (!v) return;
|
|
510
|
+
const p = !T;
|
|
511
|
+
L(p), await K(v, w, p);
|
|
512
|
+
}, me = async (p) => {
|
|
513
|
+
u(p), v && (N(!0), await K(v, !0, T));
|
|
514
|
+
}, ue = () => {
|
|
515
|
+
a(null), S(null), N(!1), L(!1);
|
|
516
|
+
}, ge = t.original;
|
|
517
|
+
return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
|
|
518
|
+
t.original ? /* @__PURE__ */ m("div", { className: "space-y-4", children: [
|
|
519
|
+
/* @__PURE__ */ l("div", { className: "flex justify-center", children: /* @__PURE__ */ m("div", { className: "relative", children: [
|
|
521
520
|
/* @__PURE__ */ l("div", { className: "w-32 h-32 rounded-full overflow-hidden border-4 border-currency-gold shadow-lg", children: /* @__PURE__ */ l(
|
|
522
521
|
"img",
|
|
523
522
|
{
|
|
524
|
-
src:
|
|
523
|
+
src: ge || "",
|
|
525
524
|
alt: "Portrait",
|
|
526
525
|
className: "w-full h-full object-cover",
|
|
527
526
|
style: { transform: `scale(${t.zoom})` }
|
|
@@ -531,7 +530,7 @@ function Ye() {
|
|
|
531
530
|
"button",
|
|
532
531
|
{
|
|
533
532
|
className: "btn btn-circle btn-xs btn-error absolute -top-1 -right-1",
|
|
534
|
-
onClick:
|
|
533
|
+
onClick: ue,
|
|
535
534
|
children: /* @__PURE__ */ l(
|
|
536
535
|
"svg",
|
|
537
536
|
{
|
|
@@ -554,10 +553,10 @@ function Ye() {
|
|
|
554
553
|
}
|
|
555
554
|
)
|
|
556
555
|
] }) }),
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ m("div", { className: "form-control", children: [
|
|
557
|
+
/* @__PURE__ */ m("label", { className: "label", children: [
|
|
559
558
|
/* @__PURE__ */ l("span", { className: "label-text", children: g.form.portrait.zoom }),
|
|
560
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ m("span", { className: "label-text-alt", children: [
|
|
561
560
|
Math.round(t.zoom * 100),
|
|
562
561
|
"%"
|
|
563
562
|
] })
|
|
@@ -570,85 +569,75 @@ function Ye() {
|
|
|
570
569
|
max: "2",
|
|
571
570
|
step: "0.05",
|
|
572
571
|
value: t.zoom,
|
|
573
|
-
onChange: (
|
|
572
|
+
onChange: (p) => n(parseFloat(p.target.value)),
|
|
574
573
|
className: "range range-primary range-sm"
|
|
575
574
|
}
|
|
576
575
|
)
|
|
577
576
|
] }),
|
|
578
|
-
|
|
579
|
-
/* @__PURE__ */ l(
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
{
|
|
600
|
-
strokeLinecap: "round",
|
|
601
|
-
strokeLinejoin: "round",
|
|
602
|
-
strokeWidth: 2,
|
|
603
|
-
d: "M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"
|
|
604
|
-
}
|
|
605
|
-
)
|
|
606
|
-
}
|
|
607
|
-
),
|
|
608
|
-
g.form.portrait.enhance
|
|
609
|
-
] })
|
|
610
|
-
}
|
|
611
|
-
),
|
|
612
|
-
p && /* @__PURE__ */ f("div", { className: "alert alert-warning text-sm py-2", children: [
|
|
613
|
-
/* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", className: "stroke-current shrink-0 h-5 w-5", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
|
|
614
|
-
/* @__PURE__ */ l("span", { children: p })
|
|
615
|
-
] }),
|
|
616
|
-
t.enhanced && /* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ f("label", { className: "label cursor-pointer justify-start gap-3", children: [
|
|
577
|
+
/* @__PURE__ */ m("div", { className: "flex flex-col gap-3", children: [
|
|
578
|
+
/* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ m("label", { className: "label cursor-pointer justify-start gap-3", children: [
|
|
579
|
+
/* @__PURE__ */ l(
|
|
580
|
+
"input",
|
|
581
|
+
{
|
|
582
|
+
type: "checkbox",
|
|
583
|
+
className: `toggle toggle-primary ${o ? "opacity-50" : ""}`,
|
|
584
|
+
checked: w,
|
|
585
|
+
onChange: he,
|
|
586
|
+
disabled: o
|
|
587
|
+
}
|
|
588
|
+
),
|
|
589
|
+
/* @__PURE__ */ m("span", { className: "label-text flex items-center gap-2", children: [
|
|
590
|
+
o ? /* @__PURE__ */ m(M, { children: [
|
|
591
|
+
/* @__PURE__ */ l("span", { className: "loading loading-spinner loading-xs" }),
|
|
592
|
+
e === "de" ? "Hintergrund wird entfernt..." : "Removing background..."
|
|
593
|
+
] }) : e === "de" ? "Hintergrund entfernen" : "Remove background",
|
|
594
|
+
!c && /* @__PURE__ */ l("span", { className: "badge badge-sm badge-outline", children: "API" })
|
|
595
|
+
] })
|
|
596
|
+
] }) }),
|
|
597
|
+
/* @__PURE__ */ l("div", { className: "form-control", children: /* @__PURE__ */ m("label", { className: "label cursor-pointer justify-start gap-3", children: [
|
|
617
598
|
/* @__PURE__ */ l(
|
|
618
599
|
"input",
|
|
619
600
|
{
|
|
620
601
|
type: "checkbox",
|
|
621
|
-
className:
|
|
622
|
-
checked:
|
|
623
|
-
onChange:
|
|
602
|
+
className: `toggle toggle-secondary ${d ? "opacity-50" : ""}`,
|
|
603
|
+
checked: T,
|
|
604
|
+
onChange: pe,
|
|
605
|
+
disabled: d
|
|
624
606
|
}
|
|
625
607
|
),
|
|
626
|
-
/* @__PURE__ */ l("span", { className: "label-text", children:
|
|
627
|
-
|
|
608
|
+
/* @__PURE__ */ l("span", { className: "label-text flex items-center gap-2", children: d ? /* @__PURE__ */ m(M, { children: [
|
|
609
|
+
/* @__PURE__ */ l("span", { className: "loading loading-spinner loading-xs" }),
|
|
610
|
+
e === "de" ? "Gravur-Effekt wird angewendet..." : "Applying engraving effect..."
|
|
611
|
+
] }) : e === "de" ? "Gravur-Effekt" : "Engraving effect" })
|
|
612
|
+
] }) }),
|
|
613
|
+
i && /* @__PURE__ */ m("div", { className: "alert alert-warning text-sm py-2", children: [
|
|
614
|
+
/* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", className: "stroke-current shrink-0 h-5 w-5", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
|
|
615
|
+
/* @__PURE__ */ l("span", { children: i })
|
|
616
|
+
] })
|
|
628
617
|
] })
|
|
629
|
-
] }) : /* @__PURE__ */
|
|
618
|
+
] }) : /* @__PURE__ */ m(
|
|
630
619
|
"div",
|
|
631
620
|
{
|
|
632
|
-
className: `border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${
|
|
633
|
-
onDrop:
|
|
634
|
-
onDragOver:
|
|
635
|
-
onDragLeave:
|
|
636
|
-
onClick:
|
|
621
|
+
className: `border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${o ? "border-primary bg-primary/10 pointer-events-none" : b ? "border-primary bg-primary/10" : "border-base-300 hover:border-primary hover:bg-base-200"}`,
|
|
622
|
+
onDrop: W,
|
|
623
|
+
onDragOver: se,
|
|
624
|
+
onDragLeave: le,
|
|
625
|
+
onClick: ce,
|
|
637
626
|
children: [
|
|
638
627
|
/* @__PURE__ */ l(
|
|
639
628
|
"input",
|
|
640
629
|
{
|
|
641
|
-
ref:
|
|
630
|
+
ref: f,
|
|
642
631
|
type: "file",
|
|
643
632
|
accept: "image/*",
|
|
644
633
|
className: "hidden",
|
|
645
|
-
onChange:
|
|
634
|
+
onChange: de
|
|
646
635
|
}
|
|
647
636
|
),
|
|
648
|
-
|
|
637
|
+
o ? /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2", children: [
|
|
649
638
|
/* @__PURE__ */ l("span", { className: "loading loading-spinner loading-lg text-primary" }),
|
|
650
639
|
/* @__PURE__ */ l("p", { className: "font-medium", children: e === "de" ? "Hintergrund wird entfernt..." : "Removing background..." })
|
|
651
|
-
] }) : /* @__PURE__ */
|
|
640
|
+
] }) : /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2", children: [
|
|
652
641
|
/* @__PURE__ */ l(
|
|
653
642
|
"svg",
|
|
654
643
|
{
|
|
@@ -675,60 +664,60 @@ function Ye() {
|
|
|
675
664
|
}
|
|
676
665
|
),
|
|
677
666
|
/* @__PURE__ */ l(
|
|
678
|
-
|
|
667
|
+
De,
|
|
679
668
|
{
|
|
680
|
-
isOpen:
|
|
681
|
-
onClose: () =>
|
|
682
|
-
onSubmit:
|
|
669
|
+
isOpen: x,
|
|
670
|
+
onClose: () => k(!1),
|
|
671
|
+
onSubmit: me
|
|
683
672
|
}
|
|
684
673
|
)
|
|
685
674
|
] });
|
|
686
675
|
}
|
|
687
|
-
function
|
|
676
|
+
function Je() {
|
|
688
677
|
return null;
|
|
689
678
|
}
|
|
690
|
-
const
|
|
679
|
+
const I = typeof import.meta < "u" && "/" || "/", _e = {
|
|
691
680
|
en: {
|
|
692
681
|
1: {
|
|
693
|
-
front: `${
|
|
694
|
-
back: `${
|
|
682
|
+
front: `${I}templates/front_ldpi_en.png`,
|
|
683
|
+
back: `${I}templates/back_ldpi_en.png`,
|
|
695
684
|
width: 1536,
|
|
696
685
|
height: 1024
|
|
697
686
|
},
|
|
698
687
|
5: {
|
|
699
|
-
front: `${
|
|
700
|
-
back: `${
|
|
688
|
+
front: `${I}templates/front_ldpi_en.png`,
|
|
689
|
+
back: `${I}templates/back_ldpi_en.png`,
|
|
701
690
|
width: 1536,
|
|
702
691
|
height: 1024
|
|
703
692
|
},
|
|
704
693
|
10: {
|
|
705
|
-
front: `${
|
|
706
|
-
back: `${
|
|
694
|
+
front: `${I}templates/front_ldpi_en.png`,
|
|
695
|
+
back: `${I}templates/back_ldpi_en.png`,
|
|
707
696
|
width: 1536,
|
|
708
697
|
height: 1024
|
|
709
698
|
}
|
|
710
699
|
},
|
|
711
700
|
de: {
|
|
712
701
|
1: {
|
|
713
|
-
front: `${
|
|
714
|
-
back: `${
|
|
702
|
+
front: `${I}templates/front_hdpi_de.webp`,
|
|
703
|
+
back: `${I}templates/back_hdpi_de.webp`,
|
|
715
704
|
width: 6144,
|
|
716
705
|
height: 3200
|
|
717
706
|
},
|
|
718
707
|
5: {
|
|
719
|
-
front: `${
|
|
720
|
-
back: `${
|
|
708
|
+
front: `${I}templates/front_hdpi_de.webp`,
|
|
709
|
+
back: `${I}templates/back_hdpi_de.webp`,
|
|
721
710
|
width: 6144,
|
|
722
711
|
height: 3200
|
|
723
712
|
},
|
|
724
713
|
10: {
|
|
725
|
-
front: `${
|
|
726
|
-
back: `${
|
|
714
|
+
front: `${I}templates/front_hdpi_de.webp`,
|
|
715
|
+
back: `${I}templates/back_hdpi_de.webp`,
|
|
727
716
|
width: 6144,
|
|
728
717
|
height: 3200
|
|
729
718
|
}
|
|
730
719
|
}
|
|
731
|
-
},
|
|
720
|
+
}, B = {
|
|
732
721
|
front: {
|
|
733
722
|
portrait: {
|
|
734
723
|
x: 768,
|
|
@@ -774,7 +763,7 @@ const k = typeof import.meta < "u" && "/" || "/", Ce = {
|
|
|
774
763
|
align: "center"
|
|
775
764
|
}
|
|
776
765
|
}
|
|
777
|
-
},
|
|
766
|
+
}, R = {
|
|
778
767
|
front: {
|
|
779
768
|
portrait: {
|
|
780
769
|
x: 3074,
|
|
@@ -822,13 +811,13 @@ const k = typeof import.meta < "u" && "/" || "/", Ce = {
|
|
|
822
811
|
}
|
|
823
812
|
};
|
|
824
813
|
function te(e) {
|
|
825
|
-
return e === "de" ?
|
|
814
|
+
return e === "de" ? R : B;
|
|
826
815
|
}
|
|
827
816
|
function ne(e, t) {
|
|
828
|
-
return
|
|
817
|
+
return _e[e][t];
|
|
829
818
|
}
|
|
830
819
|
const O = /* @__PURE__ */ new Map();
|
|
831
|
-
async function
|
|
820
|
+
async function Y(e) {
|
|
832
821
|
return O.has(e) ? O.get(e) : new Promise((t, a) => {
|
|
833
822
|
const n = new Image();
|
|
834
823
|
n.crossOrigin = "anonymous", n.onload = () => {
|
|
@@ -839,121 +828,121 @@ async function j(e) {
|
|
|
839
828
|
function ae(e, t, a, n) {
|
|
840
829
|
e.drawImage(t, 0, 0, a, n);
|
|
841
830
|
}
|
|
842
|
-
function
|
|
843
|
-
e.save(), e.beginPath(), e.ellipse(a, n, r,
|
|
844
|
-
const
|
|
845
|
-
let
|
|
846
|
-
|
|
847
|
-
const
|
|
848
|
-
e.drawImage(t,
|
|
831
|
+
function Be(e, t, a, n, r, s, d = 1) {
|
|
832
|
+
e.save(), e.beginPath(), e.ellipse(a, n, r, s, 0, 0, Math.PI * 2), e.closePath(), e.clip();
|
|
833
|
+
const o = t.width / t.height, i = r / s, c = r * 2, u = s * 2;
|
|
834
|
+
let g, f;
|
|
835
|
+
o > i ? (f = u, g = u * o) : (g = c, f = c / o), g *= d, f *= d;
|
|
836
|
+
const b = a - g / 2, h = n - f / 2;
|
|
837
|
+
e.drawImage(t, b, h, g, f), e.restore();
|
|
849
838
|
}
|
|
850
839
|
function re(e, t, a, n = "#2a3a2a") {
|
|
851
840
|
e.save(), e.font = `${a.fontSize}px "Times New Roman", serif`, e.textAlign = a.align || "center", e.textBaseline = "middle", e.fillStyle = n, a.maxWidth ? e.fillText(t, a.x, a.y, a.maxWidth) : e.fillText(t, a.x, a.y), e.restore();
|
|
852
841
|
}
|
|
853
|
-
function
|
|
842
|
+
function Re(e, t, a, n = "#2a3a2a") {
|
|
854
843
|
e.save(), e.font = `${a.fontSize}px "Times New Roman", serif`, e.textAlign = a.align || "center", e.textBaseline = "top", e.fillStyle = n;
|
|
855
|
-
const r = a.maxWidth || 400,
|
|
856
|
-
let
|
|
857
|
-
for (const
|
|
858
|
-
const
|
|
859
|
-
e.measureText(
|
|
844
|
+
const r = a.maxWidth || 400, s = a.lineHeight || a.fontSize * 1.4, d = t.split(" "), o = [];
|
|
845
|
+
let i = "";
|
|
846
|
+
for (const g of d) {
|
|
847
|
+
const f = i ? `${i} ${g}` : g;
|
|
848
|
+
e.measureText(f).width > r && i ? (o.push(i), i = g) : i = f;
|
|
860
849
|
}
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
let
|
|
864
|
-
for (const
|
|
865
|
-
e.fillText(
|
|
850
|
+
i && o.push(i);
|
|
851
|
+
const c = o.length * s;
|
|
852
|
+
let u = a.y - c / 2;
|
|
853
|
+
for (const g of o)
|
|
854
|
+
e.fillText(g, a.x, u), u += s;
|
|
866
855
|
e.restore();
|
|
867
856
|
}
|
|
868
|
-
function
|
|
869
|
-
e.save(), e.font = `${r.fontSize}px "Times New Roman", serif`, e.textAlign = r.align || "center", e.textBaseline = "middle", e.fillStyle =
|
|
870
|
-
const
|
|
871
|
-
let
|
|
872
|
-
for (const
|
|
873
|
-
|
|
857
|
+
function $e(e, t, a, n, r, s = "#2a3a2a") {
|
|
858
|
+
e.save(), e.font = `${r.fontSize}px "Times New Roman", serif`, e.textAlign = r.align || "center", e.textBaseline = "middle", e.fillStyle = s;
|
|
859
|
+
const d = r.lineHeight || r.fontSize * 1.8, o = [t, a, n].filter(Boolean), i = (o.length - 1) * d;
|
|
860
|
+
let c = r.y - i / 2;
|
|
861
|
+
for (const u of o)
|
|
862
|
+
u && (e.fillText(u, r.x, c), c += d);
|
|
874
863
|
e.restore();
|
|
875
864
|
}
|
|
876
|
-
async function oe(e, t, a, n, r,
|
|
877
|
-
const
|
|
878
|
-
if (!
|
|
879
|
-
e.width =
|
|
880
|
-
const
|
|
881
|
-
if (ae(
|
|
865
|
+
async function oe(e, t, a, n, r, s, d, o = 1) {
|
|
866
|
+
const i = e.getContext("2d");
|
|
867
|
+
if (!i) return;
|
|
868
|
+
e.width = s, e.height = d, i.clearRect(0, 0, s, d);
|
|
869
|
+
const c = await Y(t);
|
|
870
|
+
if (ae(i, c, s, d), a)
|
|
882
871
|
try {
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
872
|
+
const u = await Y(a);
|
|
873
|
+
Be(
|
|
874
|
+
i,
|
|
875
|
+
u,
|
|
887
876
|
r.portrait.x,
|
|
888
877
|
r.portrait.y,
|
|
889
878
|
r.portrait.radiusX,
|
|
890
879
|
r.portrait.radiusY,
|
|
891
|
-
|
|
880
|
+
o
|
|
892
881
|
);
|
|
893
|
-
} catch (
|
|
894
|
-
console.error("Failed to load portrait:",
|
|
882
|
+
} catch (u) {
|
|
883
|
+
console.error("Failed to load portrait:", u);
|
|
895
884
|
}
|
|
896
|
-
n && re(
|
|
885
|
+
n && re(i, n, r.namePlate);
|
|
897
886
|
}
|
|
898
|
-
async function ie(e, t, a, n, r,
|
|
899
|
-
const
|
|
900
|
-
if (!
|
|
901
|
-
e.width =
|
|
902
|
-
const
|
|
903
|
-
ae(
|
|
887
|
+
async function ie(e, t, a, n, r, s, d, o, i) {
|
|
888
|
+
const c = e.getContext("2d");
|
|
889
|
+
if (!c) return;
|
|
890
|
+
e.width = o, e.height = i, c.clearRect(0, 0, o, i);
|
|
891
|
+
const u = await Y(t);
|
|
892
|
+
ae(c, u, o, i), d.contactInfo && (a || n || r) && $e(c, a, n, r, d.contactInfo), d.description && s && Re(c, s, d.description), a && re(c, a, d.namePlate);
|
|
904
893
|
}
|
|
905
|
-
function
|
|
906
|
-
const e = y((w) => w.voucherConfig.language), t = y((w) => w.voucherConfig.hours), a = y((w) => w.voucherConfig.description), n = y((w) => w.personalInfo), r = y((w) => w.portrait),
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
894
|
+
function Qe() {
|
|
895
|
+
const e = y((w) => w.voucherConfig.language), t = y((w) => w.voucherConfig.hours), a = y((w) => w.voucherConfig.description), n = y((w) => w.personalInfo), r = y((w) => w.portrait), s = y((w) => w.currentSide), d = y((w) => w.flipSide), o = z(e), i = $(null), c = $(null), u = $(null), [g, f] = E(!1), b = ne(e, t), h = te(e), x = r.useEnhanced && r.enhanced ? r.enhanced : r.original, k = J(e, t, a);
|
|
896
|
+
G(() => {
|
|
897
|
+
i.current && oe(
|
|
898
|
+
i.current,
|
|
899
|
+
b.front,
|
|
900
|
+
x,
|
|
912
901
|
n.name,
|
|
913
902
|
h.front,
|
|
914
|
-
|
|
915
|
-
|
|
903
|
+
b.width,
|
|
904
|
+
b.height,
|
|
916
905
|
r.zoom
|
|
917
906
|
);
|
|
918
|
-
}, [
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
907
|
+
}, [b, x, n.name, h, r.zoom]), G(() => {
|
|
908
|
+
c.current && ie(
|
|
909
|
+
c.current,
|
|
910
|
+
b.back,
|
|
922
911
|
n.name,
|
|
923
912
|
n.email,
|
|
924
913
|
n.phone,
|
|
925
|
-
|
|
914
|
+
k,
|
|
926
915
|
h.back,
|
|
927
|
-
|
|
928
|
-
|
|
916
|
+
b.width,
|
|
917
|
+
b.height
|
|
929
918
|
);
|
|
930
|
-
}, [
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
|
|
919
|
+
}, [b, n, k, h]);
|
|
920
|
+
const v = () => {
|
|
921
|
+
f(!0), setTimeout(() => {
|
|
922
|
+
d(), f(!1);
|
|
934
923
|
}, 150);
|
|
935
|
-
},
|
|
936
|
-
return /* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
924
|
+
}, S = b.width / b.height;
|
|
925
|
+
return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
|
|
926
|
+
/* @__PURE__ */ m("div", { className: "flex justify-between items-center", children: [
|
|
927
|
+
/* @__PURE__ */ m("div", { className: "tabs tabs-boxed bg-base-200", children: [
|
|
939
928
|
/* @__PURE__ */ l(
|
|
940
929
|
"button",
|
|
941
930
|
{
|
|
942
|
-
className: `tab ${
|
|
943
|
-
onClick: () =>
|
|
944
|
-
children:
|
|
931
|
+
className: `tab ${s === "front" ? "tab-active bg-primary text-primary-content font-semibold" : ""}`,
|
|
932
|
+
onClick: () => s !== "front" && v(),
|
|
933
|
+
children: o.preview.front
|
|
945
934
|
}
|
|
946
935
|
),
|
|
947
936
|
/* @__PURE__ */ l(
|
|
948
937
|
"button",
|
|
949
938
|
{
|
|
950
|
-
className: `tab ${
|
|
951
|
-
onClick: () =>
|
|
952
|
-
children:
|
|
939
|
+
className: `tab ${s === "back" ? "tab-active bg-primary text-primary-content font-semibold" : ""}`,
|
|
940
|
+
onClick: () => s !== "back" && v(),
|
|
941
|
+
children: o.preview.back
|
|
953
942
|
}
|
|
954
943
|
)
|
|
955
944
|
] }),
|
|
956
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ m("button", { className: "btn btn-ghost btn-sm", onClick: v, children: [
|
|
957
946
|
/* @__PURE__ */ l(
|
|
958
947
|
"svg",
|
|
959
948
|
{
|
|
@@ -973,28 +962,28 @@ function Ve() {
|
|
|
973
962
|
)
|
|
974
963
|
}
|
|
975
964
|
),
|
|
976
|
-
|
|
965
|
+
o.preview.flip
|
|
977
966
|
] })
|
|
978
967
|
] }),
|
|
979
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ m(
|
|
980
969
|
"div",
|
|
981
970
|
{
|
|
982
|
-
ref:
|
|
971
|
+
ref: u,
|
|
983
972
|
className: "relative w-full overflow-hidden shadow-lg",
|
|
984
|
-
style: { aspectRatio:
|
|
973
|
+
style: { aspectRatio: S },
|
|
985
974
|
children: [
|
|
986
975
|
/* @__PURE__ */ l(
|
|
987
976
|
"canvas",
|
|
988
977
|
{
|
|
989
|
-
ref:
|
|
990
|
-
className: `absolute inset-0 w-full h-full transition-all duration-300 ${
|
|
978
|
+
ref: i,
|
|
979
|
+
className: `absolute inset-0 w-full h-full transition-all duration-300 ${s === "front" ? g ? "opacity-0 scale-95" : "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`
|
|
991
980
|
}
|
|
992
981
|
),
|
|
993
982
|
/* @__PURE__ */ l(
|
|
994
983
|
"canvas",
|
|
995
984
|
{
|
|
996
|
-
ref:
|
|
997
|
-
className: `absolute inset-0 w-full h-full transition-all duration-300 ${
|
|
985
|
+
ref: c,
|
|
986
|
+
className: `absolute inset-0 w-full h-full transition-all duration-300 ${s === "back" ? g ? "opacity-0 scale-95" : "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`
|
|
998
987
|
}
|
|
999
988
|
)
|
|
1000
989
|
]
|
|
@@ -1002,85 +991,85 @@ function Ve() {
|
|
|
1002
991
|
)
|
|
1003
992
|
] });
|
|
1004
993
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const e =
|
|
994
|
+
function et() {
|
|
995
|
+
const e = $(null), t = $(null);
|
|
1007
996
|
return { frontCanvasRef: e, backCanvasRef: t };
|
|
1008
997
|
}
|
|
1009
|
-
async function
|
|
998
|
+
async function ze(e) {
|
|
1010
999
|
const {
|
|
1011
1000
|
frontTemplateSrc: t,
|
|
1012
1001
|
backTemplateSrc: a,
|
|
1013
1002
|
templateWidth: n,
|
|
1014
1003
|
templateHeight: r,
|
|
1015
|
-
layout:
|
|
1016
|
-
portrait:
|
|
1017
|
-
portraitZoom:
|
|
1018
|
-
name:
|
|
1019
|
-
email:
|
|
1020
|
-
phone:
|
|
1021
|
-
description:
|
|
1022
|
-
} = e,
|
|
1004
|
+
layout: s,
|
|
1005
|
+
portrait: d,
|
|
1006
|
+
portraitZoom: o = 1,
|
|
1007
|
+
name: i,
|
|
1008
|
+
email: c,
|
|
1009
|
+
phone: u,
|
|
1010
|
+
description: g
|
|
1011
|
+
} = e, f = document.createElement("canvas"), b = document.createElement("canvas");
|
|
1023
1012
|
await Promise.all([
|
|
1024
|
-
oe(
|
|
1025
|
-
ie(
|
|
1013
|
+
oe(f, t, d, i, s.front, n, r, o),
|
|
1014
|
+
ie(b, a, i, c, u, g, s.back, n, r)
|
|
1026
1015
|
]);
|
|
1027
|
-
const h = new
|
|
1016
|
+
const h = new ye({
|
|
1028
1017
|
orientation: "landscape",
|
|
1029
1018
|
unit: "mm",
|
|
1030
1019
|
format: "a4"
|
|
1031
|
-
}),
|
|
1032
|
-
let w =
|
|
1033
|
-
N >
|
|
1034
|
-
const
|
|
1035
|
-
h.addImage(
|
|
1036
|
-
const
|
|
1037
|
-
return h.addImage(
|
|
1020
|
+
}), x = 297, k = 210, v = 10, S = n / r;
|
|
1021
|
+
let w = x - v * 2, N = w / S;
|
|
1022
|
+
N > k - v * 2 && (N = k - v * 2, w = N * S);
|
|
1023
|
+
const T = (x - w) / 2, L = (k - N) / 2, H = f.toDataURL("image/jpeg", 0.95);
|
|
1024
|
+
h.addImage(H, "JPEG", T, L, w, N), h.addPage();
|
|
1025
|
+
const W = b.toDataURL("image/jpeg", 0.95);
|
|
1026
|
+
return h.addImage(W, "JPEG", T, L, w, N), h.output("blob");
|
|
1038
1027
|
}
|
|
1039
|
-
function
|
|
1028
|
+
function He(e, t) {
|
|
1040
1029
|
const a = URL.createObjectURL(e), n = document.createElement("a");
|
|
1041
1030
|
n.href = a, n.download = t, document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(a);
|
|
1042
1031
|
}
|
|
1043
|
-
async function
|
|
1044
|
-
const t = await
|
|
1045
|
-
|
|
1032
|
+
async function Me(e) {
|
|
1033
|
+
const t = await ze(e);
|
|
1034
|
+
He(t, e.filename);
|
|
1046
1035
|
}
|
|
1047
|
-
function
|
|
1048
|
-
const e = y((h) => h.voucherConfig.language), t = y((h) => h.voucherConfig.hours), a = y((h) => h.voucherConfig.description), n = y((h) => h.personalInfo), r = y((h) => h.portrait),
|
|
1036
|
+
function tt() {
|
|
1037
|
+
const e = y((h) => h.voucherConfig.language), t = y((h) => h.voucherConfig.hours), a = y((h) => h.voucherConfig.description), n = y((h) => h.personalInfo), r = y((h) => h.portrait), s = y((h) => h.isExporting), d = y((h) => h.setIsExporting), o = z(e), i = ne(e, t), c = te(e), u = r.useEnhanced && r.enhanced ? r.enhanced : r.original, g = J(e, t, a), f = n.name.trim().length > 0 && n.email.trim().length > 0 && n.phone.trim().length > 0 && r.original !== null;
|
|
1049
1038
|
return /* @__PURE__ */ l(
|
|
1050
1039
|
"button",
|
|
1051
1040
|
{
|
|
1052
|
-
className: `btn btn-primary flex-1 ${
|
|
1041
|
+
className: `btn btn-primary flex-1 ${s ? "loading" : ""}`,
|
|
1053
1042
|
onClick: async () => {
|
|
1054
|
-
if (!(!
|
|
1055
|
-
|
|
1043
|
+
if (!(!f || s)) {
|
|
1044
|
+
d(!0);
|
|
1056
1045
|
try {
|
|
1057
1046
|
const h = `zeitgutschein-${t}h-${n.name.replace(/\s+/g, "-").toLowerCase()}.pdf`;
|
|
1058
|
-
await
|
|
1059
|
-
frontTemplateSrc:
|
|
1060
|
-
backTemplateSrc:
|
|
1061
|
-
templateWidth:
|
|
1062
|
-
templateHeight:
|
|
1063
|
-
layout:
|
|
1064
|
-
portrait:
|
|
1047
|
+
await Me({
|
|
1048
|
+
frontTemplateSrc: i.front,
|
|
1049
|
+
backTemplateSrc: i.back,
|
|
1050
|
+
templateWidth: i.width,
|
|
1051
|
+
templateHeight: i.height,
|
|
1052
|
+
layout: c,
|
|
1053
|
+
portrait: u,
|
|
1065
1054
|
portraitZoom: r.zoom,
|
|
1066
1055
|
name: n.name,
|
|
1067
1056
|
email: n.email,
|
|
1068
1057
|
phone: n.phone,
|
|
1069
|
-
description:
|
|
1058
|
+
description: g,
|
|
1070
1059
|
filename: h
|
|
1071
1060
|
});
|
|
1072
1061
|
} catch (h) {
|
|
1073
1062
|
console.error("PDF export failed:", h);
|
|
1074
1063
|
} finally {
|
|
1075
|
-
|
|
1064
|
+
d(!1);
|
|
1076
1065
|
}
|
|
1077
1066
|
}
|
|
1078
1067
|
},
|
|
1079
|
-
disabled: !
|
|
1080
|
-
children:
|
|
1068
|
+
disabled: !f || s,
|
|
1069
|
+
children: s ? /* @__PURE__ */ m(M, { children: [
|
|
1081
1070
|
/* @__PURE__ */ l("span", { className: "loading loading-spinner loading-sm" }),
|
|
1082
|
-
|
|
1083
|
-
] }) : /* @__PURE__ */
|
|
1071
|
+
o.export.exporting
|
|
1072
|
+
] }) : /* @__PURE__ */ m(M, { children: [
|
|
1084
1073
|
/* @__PURE__ */ l(
|
|
1085
1074
|
"svg",
|
|
1086
1075
|
{
|
|
@@ -1100,16 +1089,16 @@ function Ze() {
|
|
|
1100
1089
|
)
|
|
1101
1090
|
}
|
|
1102
1091
|
),
|
|
1103
|
-
|
|
1092
|
+
o.export.button
|
|
1104
1093
|
] })
|
|
1105
1094
|
}
|
|
1106
1095
|
);
|
|
1107
1096
|
}
|
|
1108
|
-
function
|
|
1097
|
+
function Ue() {
|
|
1109
1098
|
const e = y((n) => n.voucherConfig.language), t = y((n) => n.setLanguage), a = (n) => {
|
|
1110
1099
|
t(n);
|
|
1111
1100
|
};
|
|
1112
|
-
return /* @__PURE__ */
|
|
1101
|
+
return /* @__PURE__ */ m("div", { className: "join", children: [
|
|
1113
1102
|
/* @__PURE__ */ l(
|
|
1114
1103
|
"button",
|
|
1115
1104
|
{
|
|
@@ -1128,22 +1117,22 @@ function Re() {
|
|
|
1128
1117
|
)
|
|
1129
1118
|
] });
|
|
1130
1119
|
}
|
|
1131
|
-
function
|
|
1132
|
-
const e = y((a) => a.voucherConfig.language), t =
|
|
1133
|
-
return /* @__PURE__ */
|
|
1120
|
+
function nt() {
|
|
1121
|
+
const e = y((a) => a.voucherConfig.language), t = z(e);
|
|
1122
|
+
return /* @__PURE__ */ m("div", { className: "navbar bg-currency-green text-currency-cream shadow-lg", children: [
|
|
1134
1123
|
/* @__PURE__ */ l("div", { className: "navbar-start", children: /* @__PURE__ */ l("a", { className: "btn btn-ghost text-xl font-currency font-bold", children: t.header.title }) }),
|
|
1135
1124
|
/* @__PURE__ */ l("div", { className: "navbar-center hidden sm:flex", children: /* @__PURE__ */ l("span", { className: "text-sm opacity-80", children: t.header.subtitle }) }),
|
|
1136
|
-
/* @__PURE__ */ l("div", { className: "navbar-end", children: /* @__PURE__ */ l(
|
|
1125
|
+
/* @__PURE__ */ l("div", { className: "navbar-end", children: /* @__PURE__ */ l(Ue, {}) })
|
|
1137
1126
|
] });
|
|
1138
1127
|
}
|
|
1139
|
-
const
|
|
1128
|
+
const U = "/", Fe = {
|
|
1140
1129
|
id: "time-voucher-classic-de",
|
|
1141
1130
|
name: "Zeitgutschein Classic",
|
|
1142
1131
|
type: "time-voucher",
|
|
1143
1132
|
category: "classic",
|
|
1144
1133
|
images: {
|
|
1145
|
-
front: `${
|
|
1146
|
-
back: `${
|
|
1134
|
+
front: `${U}templates/front_hdpi_de.jpg`,
|
|
1135
|
+
back: `${U}templates/back_hdpi_de.jpg`,
|
|
1147
1136
|
width: 6144,
|
|
1148
1137
|
height: 4096
|
|
1149
1138
|
},
|
|
@@ -1190,24 +1179,24 @@ const M = "/", $e = {
|
|
|
1190
1179
|
],
|
|
1191
1180
|
layout: {
|
|
1192
1181
|
front: {
|
|
1193
|
-
portrait:
|
|
1194
|
-
name:
|
|
1182
|
+
portrait: R.front.portrait,
|
|
1183
|
+
name: R.front.namePlate
|
|
1195
1184
|
},
|
|
1196
1185
|
back: {
|
|
1197
|
-
name:
|
|
1198
|
-
contactInfo:
|
|
1199
|
-
description:
|
|
1186
|
+
name: R.back.namePlate,
|
|
1187
|
+
contactInfo: R.back.contactInfo,
|
|
1188
|
+
description: R.back.description
|
|
1200
1189
|
}
|
|
1201
1190
|
},
|
|
1202
1191
|
languages: ["de"]
|
|
1203
|
-
},
|
|
1192
|
+
}, We = {
|
|
1204
1193
|
id: "time-voucher-classic-en",
|
|
1205
1194
|
name: "Time Voucher Classic",
|
|
1206
1195
|
type: "time-voucher",
|
|
1207
1196
|
category: "classic",
|
|
1208
1197
|
images: {
|
|
1209
|
-
front: `${
|
|
1210
|
-
back: `${
|
|
1198
|
+
front: `${U}templates/front_ldpi_en.png`,
|
|
1199
|
+
back: `${U}templates/back_ldpi_en.png`,
|
|
1211
1200
|
width: 1536,
|
|
1212
1201
|
height: 1024
|
|
1213
1202
|
},
|
|
@@ -1254,20 +1243,20 @@ const M = "/", $e = {
|
|
|
1254
1243
|
],
|
|
1255
1244
|
layout: {
|
|
1256
1245
|
front: {
|
|
1257
|
-
portrait:
|
|
1258
|
-
name:
|
|
1246
|
+
portrait: B.front.portrait,
|
|
1247
|
+
name: B.front.namePlate
|
|
1259
1248
|
},
|
|
1260
1249
|
back: {
|
|
1261
|
-
name:
|
|
1262
|
-
contactInfo:
|
|
1263
|
-
description:
|
|
1250
|
+
name: B.back.namePlate,
|
|
1251
|
+
contactInfo: B.back.contactInfo,
|
|
1252
|
+
description: B.back.description
|
|
1264
1253
|
}
|
|
1265
1254
|
},
|
|
1266
1255
|
languages: ["en"]
|
|
1267
1256
|
}, X = [
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
],
|
|
1257
|
+
Fe,
|
|
1258
|
+
We
|
|
1259
|
+
], Ke = {
|
|
1271
1260
|
async listTemplates(e) {
|
|
1272
1261
|
let t = [...X];
|
|
1273
1262
|
return e != null && e.type && (t = t.filter((a) => a.type === e.type)), e != null && e.category && (t = t.filter((a) => a.category === e.category)), e != null && e.language && (t = t.filter((a) => a.languages.includes(e.language))), t;
|
|
@@ -1279,61 +1268,61 @@ const M = "/", $e = {
|
|
|
1279
1268
|
return t;
|
|
1280
1269
|
}
|
|
1281
1270
|
};
|
|
1282
|
-
function
|
|
1271
|
+
function at(e) {
|
|
1283
1272
|
return e === "de" ? "time-voucher-classic-de" : "time-voucher-classic-en";
|
|
1284
1273
|
}
|
|
1285
|
-
let
|
|
1286
|
-
function
|
|
1287
|
-
|
|
1274
|
+
let F = Ke;
|
|
1275
|
+
function rt(e) {
|
|
1276
|
+
F = e;
|
|
1288
1277
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return
|
|
1278
|
+
function ot() {
|
|
1279
|
+
return F;
|
|
1291
1280
|
}
|
|
1292
|
-
async function
|
|
1293
|
-
return
|
|
1281
|
+
async function it(e) {
|
|
1282
|
+
return F.listTemplates(e);
|
|
1294
1283
|
}
|
|
1295
|
-
async function
|
|
1296
|
-
return
|
|
1284
|
+
async function st(e) {
|
|
1285
|
+
return F.getTemplate(e);
|
|
1297
1286
|
}
|
|
1298
1287
|
export {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1288
|
+
De as ApiKeyModal,
|
|
1289
|
+
Qe as BillPreview,
|
|
1290
|
+
tt as ExportButton,
|
|
1291
|
+
nt as Header,
|
|
1292
|
+
R as LAYOUT_HDPI,
|
|
1293
|
+
B as LAYOUT_LDPI,
|
|
1294
|
+
Ue as LanguageToggle,
|
|
1295
|
+
Ve as PersonalInfoForm,
|
|
1296
|
+
Xe as PortraitUpload,
|
|
1297
|
+
_e as TEMPLATES,
|
|
1298
|
+
Je as VoucherConfig,
|
|
1299
|
+
He as downloadBlob,
|
|
1300
|
+
$e as drawContactInfo,
|
|
1301
|
+
Re as drawMultilineText,
|
|
1302
|
+
Be as drawOvalPortrait,
|
|
1314
1303
|
ae as drawTemplate,
|
|
1315
1304
|
re as drawText,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1305
|
+
Ze as enhancePortrait,
|
|
1306
|
+
Te as enhancePortraitFallback,
|
|
1307
|
+
Me as exportBillAsPDF,
|
|
1319
1308
|
J as formatDescription,
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1309
|
+
ze as generateBillPDF,
|
|
1310
|
+
q as getApiKey,
|
|
1311
|
+
at as getDefaultTemplateId,
|
|
1323
1312
|
te as getLayout,
|
|
1324
1313
|
ne as getTemplate,
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1314
|
+
st as getTemplateById,
|
|
1315
|
+
ot as getTemplateProvider,
|
|
1316
|
+
Ce as hasApiKey,
|
|
1317
|
+
it as listTemplates,
|
|
1318
|
+
Y as loadImage,
|
|
1319
|
+
Ae as removeBackground,
|
|
1331
1320
|
ie as renderBackSide,
|
|
1332
1321
|
oe as renderFrontSide,
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1322
|
+
Se as setApiKey,
|
|
1323
|
+
rt as setTemplateProvider,
|
|
1324
|
+
Ke as staticTemplateProvider,
|
|
1325
|
+
z as t,
|
|
1326
|
+
et as useBillCanvasRefs,
|
|
1338
1327
|
y as useBillStore
|
|
1339
1328
|
};
|