@antontranelis/money-printer 1.0.6 → 1.0.8

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