qrdx 0.0.2-beta.2 → 0.0.42

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.
Files changed (47) hide show
  1. package/dist/cli.js +4231 -0
  2. package/dist/index.js +2 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +2 -2
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/src/api.d.ts.map +1 -1
  7. package/dist/src/constants.d.ts +5 -3
  8. package/dist/src/constants.d.ts.map +1 -1
  9. package/dist/src/corner-dot.d.ts.map +1 -1
  10. package/dist/src/corner-eye.d.ts +1 -1
  11. package/dist/src/corner-eye.d.ts.map +1 -1
  12. package/dist/src/detection.d.ts.map +1 -1
  13. package/dist/src/download.d.ts +1 -1
  14. package/dist/src/download.d.ts.map +1 -1
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/utils/color.d.ts +12 -0
  17. package/dist/src/utils/color.d.ts.map +1 -0
  18. package/dist/src/utils.d.ts +1 -0
  19. package/dist/src/utils.d.ts.map +1 -1
  20. package/dist/types/color.d.ts +92 -0
  21. package/dist/types/color.d.ts.map +1 -0
  22. package/dist/types/corner-dot.d.ts +9 -2
  23. package/dist/types/corner-dot.d.ts.map +1 -1
  24. package/dist/types/corner-eye.d.ts +7 -2
  25. package/dist/types/corner-eye.d.ts.map +1 -1
  26. package/dist/types/image-pattern.d.ts +4 -3
  27. package/dist/types/image-pattern.d.ts.map +1 -1
  28. package/dist/types/index.d.ts +4 -0
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types/qr.d.ts +90 -12
  31. package/dist/types/qr.d.ts.map +1 -1
  32. package/package.json +22 -17
  33. package/src/api.tsx +7 -2
  34. package/src/constants.ts +5 -3
  35. package/src/corner-dot.tsx +83 -2
  36. package/src/corner-eye.ts +170 -23
  37. package/src/detection.ts +0 -3
  38. package/src/download.tsx +102 -2
  39. package/src/index.tsx +95 -29
  40. package/src/utils/color.ts +34 -0
  41. package/src/utils.tsx +557 -64
  42. package/types/color.ts +133 -0
  43. package/types/corner-dot.ts +8 -1
  44. package/types/corner-eye.ts +5 -0
  45. package/types/image-pattern.ts +2 -1
  46. package/types/index.ts +24 -5
  47. package/types/qr.ts +9 -8
package/dist/cli.js ADDED
@@ -0,0 +1,4231 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ var zod = require('zod');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
+ var fs = require('fs');
8
+ var path = require('path');
9
+ require('util');
10
+ var y2 = require('process');
11
+ var g = require('readline');
12
+ var stream = require('stream');
13
+ require('jsqr');
14
+ var server = require('react-dom/server');
15
+
16
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
+
18
+ function _interopNamespace(e) {
19
+ if (e && e.__esModule) return e;
20
+ var n = Object.create(null);
21
+ if (e) {
22
+ Object.keys(e).forEach(function (k) {
23
+ if (k !== 'default') {
24
+ var d = Object.getOwnPropertyDescriptor(e, k);
25
+ Object.defineProperty(n, k, d.get ? d : {
26
+ enumerable: true,
27
+ get: function () { return e[k]; }
28
+ });
29
+ }
30
+ });
31
+ }
32
+ n.default = e;
33
+ return Object.freeze(n);
34
+ }
35
+
36
+ var React__default = /*#__PURE__*/_interopDefault(React);
37
+ var y2__default = /*#__PURE__*/_interopDefault(y2);
38
+ var g__namespace = /*#__PURE__*/_interopNamespace(g);
39
+
40
+ var __create = Object.create;
41
+ var __defProp = Object.defineProperty;
42
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
43
+ var __getOwnPropNames = Object.getOwnPropertyNames;
44
+ var __getProtoOf = Object.getPrototypeOf;
45
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
46
+ var __esm = (fn, res) => function __init() {
47
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
48
+ };
49
+ var __commonJS = (cb, mod) => function __require() {
50
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
51
+ };
52
+ var __copyProps = (to, from, except, desc) => {
53
+ if (from && typeof from === "object" || typeof from === "function") {
54
+ for (let key of __getOwnPropNames(from))
55
+ if (!__hasOwnProp.call(to, key) && key !== except)
56
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
57
+ }
58
+ return to;
59
+ };
60
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
61
+ // If the importer is in node compatibility mode or this is not an ESM
62
+ // file that has been converted to a CommonJS file using a Babel-
63
+ // compatible transform (i.e. "__esModule" has not been set), then set
64
+ // "default" to the CommonJS "module.exports" for node compatibility.
65
+ __defProp(target, "default", { value: mod, enumerable: true }) ,
66
+ mod
67
+ ));
68
+
69
+ // ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
70
+ var require_src = __commonJS({
71
+ "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$1, module) {
72
+ var ESC = "\x1B";
73
+ var CSI = `${ESC}[`;
74
+ var beep = "\x07";
75
+ var cursor = {
76
+ to(x2, y3) {
77
+ if (!y3) return `${CSI}${x2 + 1}G`;
78
+ return `${CSI}${y3 + 1};${x2 + 1}H`;
79
+ },
80
+ move(x2, y3) {
81
+ let ret = "";
82
+ if (x2 < 0) ret += `${CSI}${-x2}D`;
83
+ else if (x2 > 0) ret += `${CSI}${x2}C`;
84
+ if (y3 < 0) ret += `${CSI}${-y3}A`;
85
+ else if (y3 > 0) ret += `${CSI}${y3}B`;
86
+ return ret;
87
+ },
88
+ up: (count = 1) => `${CSI}${count}A`,
89
+ down: (count = 1) => `${CSI}${count}B`,
90
+ forward: (count = 1) => `${CSI}${count}C`,
91
+ backward: (count = 1) => `${CSI}${count}D`,
92
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
93
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
94
+ left: `${CSI}G`,
95
+ hide: `${CSI}?25l`,
96
+ show: `${CSI}?25h`,
97
+ save: `${ESC}7`,
98
+ restore: `${ESC}8`
99
+ };
100
+ var scroll = {
101
+ up: (count = 1) => `${CSI}S`.repeat(count),
102
+ down: (count = 1) => `${CSI}T`.repeat(count)
103
+ };
104
+ var erase = {
105
+ screen: `${CSI}2J`,
106
+ up: (count = 1) => `${CSI}1J`.repeat(count),
107
+ down: (count = 1) => `${CSI}J`.repeat(count),
108
+ line: `${CSI}2K`,
109
+ lineEnd: `${CSI}K`,
110
+ lineStart: `${CSI}1K`,
111
+ lines(count) {
112
+ let clear = "";
113
+ for (let i = 0; i < count; i++)
114
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
115
+ if (count)
116
+ clear += cursor.left;
117
+ return clear;
118
+ }
119
+ };
120
+ module.exports = { cursor, scroll, erase, beep };
121
+ }
122
+ });
123
+
124
+ // ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
125
+ var require_picocolors = __commonJS({
126
+ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports$1, module) {
127
+ var p2 = process || {};
128
+ var argv = p2.argv || [];
129
+ var env = p2.env || {};
130
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p2.platform === "win32" || (p2.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
131
+ var formatter = (open, close, replace = open) => (input) => {
132
+ let string = "" + input, index = string.indexOf(close, open.length);
133
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
134
+ };
135
+ var replaceClose = (string, close, replace, index) => {
136
+ let result = "", cursor = 0;
137
+ do {
138
+ result += string.substring(cursor, index) + replace;
139
+ cursor = index + close.length;
140
+ index = string.indexOf(close, cursor);
141
+ } while (~index);
142
+ return result + string.substring(cursor);
143
+ };
144
+ var createColors = (enabled = isColorSupported) => {
145
+ let f = enabled ? formatter : () => String;
146
+ return {
147
+ isColorSupported: enabled,
148
+ reset: f("\x1B[0m", "\x1B[0m"),
149
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
150
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
151
+ italic: f("\x1B[3m", "\x1B[23m"),
152
+ underline: f("\x1B[4m", "\x1B[24m"),
153
+ inverse: f("\x1B[7m", "\x1B[27m"),
154
+ hidden: f("\x1B[8m", "\x1B[28m"),
155
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
156
+ black: f("\x1B[30m", "\x1B[39m"),
157
+ red: f("\x1B[31m", "\x1B[39m"),
158
+ green: f("\x1B[32m", "\x1B[39m"),
159
+ yellow: f("\x1B[33m", "\x1B[39m"),
160
+ blue: f("\x1B[34m", "\x1B[39m"),
161
+ magenta: f("\x1B[35m", "\x1B[39m"),
162
+ cyan: f("\x1B[36m", "\x1B[39m"),
163
+ white: f("\x1B[37m", "\x1B[39m"),
164
+ gray: f("\x1B[90m", "\x1B[39m"),
165
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
166
+ bgRed: f("\x1B[41m", "\x1B[49m"),
167
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
168
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
169
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
170
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
171
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
172
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
173
+ blackBright: f("\x1B[90m", "\x1B[39m"),
174
+ redBright: f("\x1B[91m", "\x1B[39m"),
175
+ greenBright: f("\x1B[92m", "\x1B[39m"),
176
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
177
+ blueBright: f("\x1B[94m", "\x1B[39m"),
178
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
179
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
180
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
181
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
182
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
183
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
184
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
185
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
186
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
187
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
188
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
189
+ };
190
+ };
191
+ module.exports = createColors();
192
+ module.exports.createColors = createColors;
193
+ }
194
+ });
195
+ function normalizeColorConfig(color, fallback = "#000000") {
196
+ if (!color) {
197
+ return { type: "solid", color: fallback };
198
+ }
199
+ if (typeof color === "string") {
200
+ return { type: "solid", color };
201
+ }
202
+ return color;
203
+ }
204
+ var solidColorSchema, gradientStopSchema, linearGradientSchema, radialGradientSchema, colorConfigSchema;
205
+ var init_color = __esm({
206
+ "types/color.ts"() {
207
+ zod.z.enum(["solid", "linear", "radial"]);
208
+ solidColorSchema = zod.z.object({
209
+ type: zod.z.literal("solid"),
210
+ color: zod.z.string()
211
+ });
212
+ gradientStopSchema = zod.z.object({
213
+ color: zod.z.string(),
214
+ offset: zod.z.number().min(0).max(100)
215
+ // percentage: 0-100
216
+ });
217
+ linearGradientSchema = zod.z.object({
218
+ type: zod.z.literal("linear"),
219
+ stops: zod.z.array(gradientStopSchema).min(2),
220
+ angle: zod.z.number().optional().default(0)
221
+ // degrees: 0 = left-to-right, 90 = top-to-bottom
222
+ });
223
+ radialGradientSchema = zod.z.object({
224
+ type: zod.z.literal("radial"),
225
+ stops: zod.z.array(gradientStopSchema).min(2)
226
+ });
227
+ colorConfigSchema = zod.z.union([
228
+ zod.z.string(),
229
+ solidColorSchema,
230
+ linearGradientSchema,
231
+ radialGradientSchema
232
+ ]);
233
+ }
234
+ });
235
+
236
+ // src/codegen.ts
237
+ var qrcodegen, codegen_default;
238
+ var init_codegen = __esm({
239
+ "src/codegen.ts"() {
240
+ ((qrcodegen2) => {
241
+ class QrCode {
242
+ /*-- Constructor (low level) and fields --*/
243
+ // Creates a new QR Code with the given version number,
244
+ // error correction level, data codeword bytes, and mask number.
245
+ // This is a low-level API that most users should not use directly.
246
+ // A mid-level API is the encodeSegments() function.
247
+ constructor(version, errorCorrectionLevel, dataCodewords, msk) {
248
+ this.version = version;
249
+ this.errorCorrectionLevel = errorCorrectionLevel;
250
+ if (version < QrCode.MIN_VERSION || version > QrCode.MAX_VERSION)
251
+ throw new RangeError("Version value out of range");
252
+ if (msk < -1 || msk > 7) throw new RangeError("Mask value out of range");
253
+ this.size = version * 4 + 17;
254
+ let row = [];
255
+ for (let i = 0; i < this.size; i++) row.push(false);
256
+ for (let i = 0; i < this.size; i++) {
257
+ this.modules.push(row.slice());
258
+ this.isFunction.push(row.slice());
259
+ }
260
+ this.drawFunctionPatterns();
261
+ const allCodewords = this.addEccAndInterleave(dataCodewords);
262
+ this.drawCodewords(allCodewords);
263
+ if (msk == -1) {
264
+ let minPenalty = 1e9;
265
+ for (let i = 0; i < 8; i++) {
266
+ this.applyMask(i);
267
+ this.drawFormatBits(i);
268
+ const penalty = this.getPenaltyScore();
269
+ if (penalty < minPenalty) {
270
+ msk = i;
271
+ minPenalty = penalty;
272
+ }
273
+ this.applyMask(i);
274
+ }
275
+ }
276
+ assert(0 <= msk && msk <= 7);
277
+ this.mask = msk;
278
+ this.applyMask(msk);
279
+ this.drawFormatBits(msk);
280
+ this.isFunction = [];
281
+ }
282
+ /*-- Static factory functions (high level) --*/
283
+ // Returns a QR Code representing the given Unicode text string at the given error correction level.
284
+ // As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
285
+ // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
286
+ // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
287
+ // ecl argument if it can be done without increasing the version.
288
+ static encodeText(text, ecl) {
289
+ const segs = qrcodegen2.QrSegment.makeSegments(text);
290
+ return QrCode.encodeSegments(segs, ecl);
291
+ }
292
+ // Returns a QR Code representing the given binary data at the given error correction level.
293
+ // This function always encodes using the binary segment mode, not any text mode. The maximum number of
294
+ // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
295
+ // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
296
+ static encodeBinary(data, ecl) {
297
+ const seg = qrcodegen2.QrSegment.makeBytes(data);
298
+ return QrCode.encodeSegments([seg], ecl);
299
+ }
300
+ /*-- Static factory functions (mid level) --*/
301
+ // Returns a QR Code representing the given segments with the given encoding parameters.
302
+ // The smallest possible QR Code version within the given range is automatically
303
+ // chosen for the output. Iff boostEcl is true, then the ECC level of the result
304
+ // may be higher than the ecl argument if it can be done without increasing the
305
+ // version. The mask number is either between 0 to 7 (inclusive) to force that
306
+ // mask, or -1 to automatically choose an appropriate mask (which may be slow).
307
+ // This function allows the user to create a custom sequence of segments that switches
308
+ // between modes (such as alphanumeric and byte) to encode text in less space.
309
+ // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
310
+ static encodeSegments(segs, ecl, minVersion = 1, maxVersion = 40, mask = -1, boostEcl = true) {
311
+ if (!(QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= QrCode.MAX_VERSION) || mask < -1 || mask > 7)
312
+ throw new RangeError("Invalid value");
313
+ let version;
314
+ let dataUsedBits;
315
+ for (version = minVersion; ; version++) {
316
+ const dataCapacityBits2 = QrCode.getNumDataCodewords(version, ecl) * 8;
317
+ const usedBits = QrSegment.getTotalBits(segs, version);
318
+ if (usedBits <= dataCapacityBits2) {
319
+ dataUsedBits = usedBits;
320
+ break;
321
+ }
322
+ if (version >= maxVersion)
323
+ throw new RangeError("Data too long");
324
+ }
325
+ for (const newEcl of [
326
+ QrCode.Ecc.MEDIUM,
327
+ QrCode.Ecc.QUARTILE,
328
+ QrCode.Ecc.HIGH
329
+ ]) {
330
+ if (boostEcl && dataUsedBits <= QrCode.getNumDataCodewords(version, newEcl) * 8)
331
+ ecl = newEcl;
332
+ }
333
+ let bb = [];
334
+ for (const seg of segs) {
335
+ appendBits(seg.mode.modeBits, 4, bb);
336
+ appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);
337
+ for (const b3 of seg.getData()) bb.push(b3);
338
+ }
339
+ assert(bb.length == dataUsedBits);
340
+ const dataCapacityBits = QrCode.getNumDataCodewords(version, ecl) * 8;
341
+ assert(bb.length <= dataCapacityBits);
342
+ appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);
343
+ appendBits(0, (8 - bb.length % 8) % 8, bb);
344
+ assert(bb.length % 8 == 0);
345
+ for (let padByte = 236; bb.length < dataCapacityBits; padByte ^= 236 ^ 17)
346
+ appendBits(padByte, 8, bb);
347
+ let dataCodewords = [];
348
+ while (dataCodewords.length * 8 < bb.length) dataCodewords.push(0);
349
+ bb.forEach(
350
+ (b3, i) => dataCodewords[i >>> 3] |= b3 << 7 - (i & 7)
351
+ );
352
+ return new QrCode(version, ecl, dataCodewords, mask);
353
+ }
354
+ /*-- Fields --*/
355
+ // The width and height of this QR Code, measured in modules, between
356
+ // 21 and 177 (inclusive). This is equal to version * 4 + 17.
357
+ size;
358
+ // The index of the mask pattern used in this QR Code, which is between 0 and 7 (inclusive).
359
+ // Even if a QR Code is created with automatic masking requested (mask = -1),
360
+ // the resulting object still has a mask value between 0 and 7.
361
+ mask;
362
+ // The modules of this QR Code (false = light, true = dark).
363
+ // Immutable after constructor finishes. Accessed through getModule().
364
+ modules = [];
365
+ // Indicates function modules that are not subjected to masking. Discarded when constructor finishes.
366
+ isFunction = [];
367
+ /*-- Accessor methods --*/
368
+ // Returns the color of the module (pixel) at the given coordinates, which is false
369
+ // for light or true for dark. The top left corner has the coordinates (x=0, y=0).
370
+ // If the given coordinates are out of bounds, then false (light) is returned.
371
+ getModule(x2, y3) {
372
+ return 0 <= x2 && x2 < this.size && 0 <= y3 && y3 < this.size && this.modules[y3][x2];
373
+ }
374
+ // Modified to expose modules for easy access
375
+ getModules() {
376
+ return this.modules;
377
+ }
378
+ /*-- Private helper methods for constructor: Drawing function modules --*/
379
+ // Reads this object's version field, and draws and marks all function modules.
380
+ drawFunctionPatterns() {
381
+ for (let i = 0; i < this.size; i++) {
382
+ this.setFunctionModule(6, i, i % 2 == 0);
383
+ this.setFunctionModule(i, 6, i % 2 == 0);
384
+ }
385
+ this.drawFinderPattern(3, 3);
386
+ this.drawFinderPattern(this.size - 4, 3);
387
+ this.drawFinderPattern(3, this.size - 4);
388
+ const alignPatPos = this.getAlignmentPatternPositions();
389
+ const numAlign = alignPatPos.length;
390
+ for (let i = 0; i < numAlign; i++) {
391
+ for (let j2 = 0; j2 < numAlign; j2++) {
392
+ if (!(i == 0 && j2 == 0 || i == 0 && j2 == numAlign - 1 || i == numAlign - 1 && j2 == 0))
393
+ this.drawAlignmentPattern(alignPatPos[i], alignPatPos[j2]);
394
+ }
395
+ }
396
+ this.drawFormatBits(0);
397
+ this.drawVersion();
398
+ }
399
+ // Draws two copies of the format bits (with its own error correction code)
400
+ // based on the given mask and this object's error correction level field.
401
+ drawFormatBits(mask) {
402
+ const data = this.errorCorrectionLevel.formatBits << 3 | mask;
403
+ let rem = data;
404
+ for (let i = 0; i < 10; i++) rem = rem << 1 ^ (rem >>> 9) * 1335;
405
+ const bits = (data << 10 | rem) ^ 21522;
406
+ assert(bits >>> 15 == 0);
407
+ for (let i = 0; i <= 5; i++)
408
+ this.setFunctionModule(8, i, getBit(bits, i));
409
+ this.setFunctionModule(8, 7, getBit(bits, 6));
410
+ this.setFunctionModule(8, 8, getBit(bits, 7));
411
+ this.setFunctionModule(7, 8, getBit(bits, 8));
412
+ for (let i = 9; i < 15; i++)
413
+ this.setFunctionModule(14 - i, 8, getBit(bits, i));
414
+ for (let i = 0; i < 8; i++)
415
+ this.setFunctionModule(this.size - 1 - i, 8, getBit(bits, i));
416
+ for (let i = 8; i < 15; i++)
417
+ this.setFunctionModule(8, this.size - 15 + i, getBit(bits, i));
418
+ this.setFunctionModule(8, this.size - 8, true);
419
+ }
420
+ // Draws two copies of the version bits (with its own error correction code),
421
+ // based on this object's version field, iff 7 <= version <= 40.
422
+ drawVersion() {
423
+ if (this.version < 7) return;
424
+ let rem = this.version;
425
+ for (let i = 0; i < 12; i++) rem = rem << 1 ^ (rem >>> 11) * 7973;
426
+ const bits = this.version << 12 | rem;
427
+ assert(bits >>> 18 == 0);
428
+ for (let i = 0; i < 18; i++) {
429
+ const color = getBit(bits, i);
430
+ const a = this.size - 11 + i % 3;
431
+ const b3 = Math.floor(i / 3);
432
+ this.setFunctionModule(a, b3, color);
433
+ this.setFunctionModule(b3, a, color);
434
+ }
435
+ }
436
+ // Draws a 9*9 finder pattern including the border separator,
437
+ // with the center module at (x, y). Modules can be out of bounds.
438
+ drawFinderPattern(x2, y3) {
439
+ for (let dy = -4; dy <= 4; dy++) {
440
+ for (let dx = -4; dx <= 4; dx++) {
441
+ const dist = Math.max(Math.abs(dx), Math.abs(dy));
442
+ const xx = x2 + dx;
443
+ const yy = y3 + dy;
444
+ if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size)
445
+ this.setFunctionModule(xx, yy, dist != 2 && dist != 4);
446
+ }
447
+ }
448
+ }
449
+ // Draws a 5*5 alignment pattern, with the center module
450
+ // at (x, y). All modules must be in bounds.
451
+ drawAlignmentPattern(x2, y3) {
452
+ for (let dy = -2; dy <= 2; dy++) {
453
+ for (let dx = -2; dx <= 2; dx++)
454
+ this.setFunctionModule(
455
+ x2 + dx,
456
+ y3 + dy,
457
+ Math.max(Math.abs(dx), Math.abs(dy)) != 1
458
+ );
459
+ }
460
+ }
461
+ // Sets the color of a module and marks it as a function module.
462
+ // Only used by the constructor. Coordinates must be in bounds.
463
+ setFunctionModule(x2, y3, isDark) {
464
+ this.modules[y3][x2] = isDark;
465
+ this.isFunction[y3][x2] = true;
466
+ }
467
+ /*-- Private helper methods for constructor: Codewords and masking --*/
468
+ // Returns a new byte string representing the given data with the appropriate error correction
469
+ // codewords appended to it, based on this object's version and error correction level.
470
+ addEccAndInterleave(data) {
471
+ const ver = this.version;
472
+ const ecl = this.errorCorrectionLevel;
473
+ if (data.length != QrCode.getNumDataCodewords(ver, ecl))
474
+ throw new RangeError("Invalid argument");
475
+ const numBlocks = QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
476
+ const blockEccLen = QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];
477
+ const rawCodewords = Math.floor(
478
+ QrCode.getNumRawDataModules(ver) / 8
479
+ );
480
+ const numShortBlocks = numBlocks - rawCodewords % numBlocks;
481
+ const shortBlockLen = Math.floor(rawCodewords / numBlocks);
482
+ let blocks = [];
483
+ const rsDiv = QrCode.reedSolomonComputeDivisor(blockEccLen);
484
+ for (let i = 0, k3 = 0; i < numBlocks; i++) {
485
+ let dat = data.slice(
486
+ k3,
487
+ k3 + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1)
488
+ );
489
+ k3 += dat.length;
490
+ const ecc = QrCode.reedSolomonComputeRemainder(dat, rsDiv);
491
+ if (i < numShortBlocks) dat.push(0);
492
+ blocks.push(dat.concat(ecc));
493
+ }
494
+ let result = [];
495
+ for (let i = 0; i < blocks[0].length; i++) {
496
+ blocks.forEach((block, j2) => {
497
+ if (i != shortBlockLen - blockEccLen || j2 >= numShortBlocks)
498
+ result.push(block[i]);
499
+ });
500
+ }
501
+ assert(result.length == rawCodewords);
502
+ return result;
503
+ }
504
+ // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
505
+ // data area of this QR Code. Function modules need to be marked off before this is called.
506
+ drawCodewords(data) {
507
+ if (data.length != Math.floor(QrCode.getNumRawDataModules(this.version) / 8))
508
+ throw new RangeError("Invalid argument");
509
+ let i = 0;
510
+ for (let right = this.size - 1; right >= 1; right -= 2) {
511
+ if (right == 6) right = 5;
512
+ for (let vert = 0; vert < this.size; vert++) {
513
+ for (let j2 = 0; j2 < 2; j2++) {
514
+ const x2 = right - j2;
515
+ const upward = (right + 1 & 2) == 0;
516
+ const y3 = upward ? this.size - 1 - vert : vert;
517
+ if (!this.isFunction[y3][x2] && i < data.length * 8) {
518
+ this.modules[y3][x2] = getBit(data[i >>> 3], 7 - (i & 7));
519
+ i++;
520
+ }
521
+ }
522
+ }
523
+ }
524
+ assert(i == data.length * 8);
525
+ }
526
+ // XORs the codeword modules in this QR Code with the given mask pattern.
527
+ // The function modules must be marked and the codeword bits must be drawn
528
+ // before masking. Due to the arithmetic of XOR, calling applyMask() with
529
+ // the same mask value a second time will undo the mask. A final well-formed
530
+ // QR Code needs exactly one (not zero, two, etc.) mask applied.
531
+ applyMask(mask) {
532
+ if (mask < 0 || mask > 7) throw new RangeError("Mask value out of range");
533
+ for (let y3 = 0; y3 < this.size; y3++) {
534
+ for (let x2 = 0; x2 < this.size; x2++) {
535
+ let invert;
536
+ switch (mask) {
537
+ case 0:
538
+ invert = (x2 + y3) % 2 == 0;
539
+ break;
540
+ case 1:
541
+ invert = y3 % 2 == 0;
542
+ break;
543
+ case 2:
544
+ invert = x2 % 3 == 0;
545
+ break;
546
+ case 3:
547
+ invert = (x2 + y3) % 3 == 0;
548
+ break;
549
+ case 4:
550
+ invert = (Math.floor(x2 / 3) + Math.floor(y3 / 2)) % 2 == 0;
551
+ break;
552
+ case 5:
553
+ invert = x2 * y3 % 2 + x2 * y3 % 3 == 0;
554
+ break;
555
+ case 6:
556
+ invert = (x2 * y3 % 2 + x2 * y3 % 3) % 2 == 0;
557
+ break;
558
+ case 7:
559
+ invert = ((x2 + y3) % 2 + x2 * y3 % 3) % 2 == 0;
560
+ break;
561
+ default:
562
+ throw new Error("Unreachable");
563
+ }
564
+ if (!this.isFunction[y3][x2] && invert)
565
+ this.modules[y3][x2] = !this.modules[y3][x2];
566
+ }
567
+ }
568
+ }
569
+ // Calculates and returns the penalty score based on state of this QR Code's current modules.
570
+ // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
571
+ getPenaltyScore() {
572
+ let result = 0;
573
+ for (let y3 = 0; y3 < this.size; y3++) {
574
+ let runColor = false;
575
+ let runX = 0;
576
+ let runHistory = [0, 0, 0, 0, 0, 0, 0];
577
+ for (let x2 = 0; x2 < this.size; x2++) {
578
+ if (this.modules[y3][x2] == runColor) {
579
+ runX++;
580
+ if (runX == 5) result += QrCode.PENALTY_N1;
581
+ else if (runX > 5) result++;
582
+ } else {
583
+ this.finderPenaltyAddHistory(runX, runHistory);
584
+ if (!runColor)
585
+ result += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;
586
+ runColor = this.modules[y3][x2];
587
+ runX = 1;
588
+ }
589
+ }
590
+ result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * QrCode.PENALTY_N3;
591
+ }
592
+ for (let x2 = 0; x2 < this.size; x2++) {
593
+ let runColor = false;
594
+ let runY = 0;
595
+ let runHistory = [0, 0, 0, 0, 0, 0, 0];
596
+ for (let y3 = 0; y3 < this.size; y3++) {
597
+ if (this.modules[y3][x2] == runColor) {
598
+ runY++;
599
+ if (runY == 5) result += QrCode.PENALTY_N1;
600
+ else if (runY > 5) result++;
601
+ } else {
602
+ this.finderPenaltyAddHistory(runY, runHistory);
603
+ if (!runColor)
604
+ result += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;
605
+ runColor = this.modules[y3][x2];
606
+ runY = 1;
607
+ }
608
+ }
609
+ result += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * QrCode.PENALTY_N3;
610
+ }
611
+ for (let y3 = 0; y3 < this.size - 1; y3++) {
612
+ for (let x2 = 0; x2 < this.size - 1; x2++) {
613
+ const color = this.modules[y3][x2];
614
+ if (color == this.modules[y3][x2 + 1] && color == this.modules[y3 + 1][x2] && color == this.modules[y3 + 1][x2 + 1])
615
+ result += QrCode.PENALTY_N2;
616
+ }
617
+ }
618
+ let dark = 0;
619
+ for (const row of this.modules)
620
+ dark = row.reduce((sum, color) => sum + (color ? 1 : 0), dark);
621
+ const total = this.size * this.size;
622
+ const k3 = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;
623
+ assert(0 <= k3 && k3 <= 9);
624
+ result += k3 * QrCode.PENALTY_N4;
625
+ assert(0 <= result && result <= 2568888);
626
+ return result;
627
+ }
628
+ /*-- Private helper functions --*/
629
+ // Returns an ascending list of positions of alignment patterns for this version number.
630
+ // Each position is in the range [0,177), and are used on both the x and y axes.
631
+ // This could be implemented as lookup table of 40 variable-length lists of integers.
632
+ getAlignmentPatternPositions() {
633
+ if (this.version == 1) return [];
634
+ else {
635
+ const numAlign = Math.floor(this.version / 7) + 2;
636
+ const step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;
637
+ let result = [6];
638
+ for (let pos = this.size - 7; result.length < numAlign; pos -= step)
639
+ result.splice(1, 0, pos);
640
+ return result;
641
+ }
642
+ }
643
+ // Returns the number of data bits that can be stored in a QR Code of the given version number, after
644
+ // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
645
+ // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
646
+ static getNumRawDataModules(ver) {
647
+ if (ver < QrCode.MIN_VERSION || ver > QrCode.MAX_VERSION)
648
+ throw new RangeError("Version number out of range");
649
+ let result = (16 * ver + 128) * ver + 64;
650
+ if (ver >= 2) {
651
+ const numAlign = Math.floor(ver / 7) + 2;
652
+ result -= (25 * numAlign - 10) * numAlign - 55;
653
+ if (ver >= 7) result -= 36;
654
+ }
655
+ assert(208 <= result && result <= 29648);
656
+ return result;
657
+ }
658
+ // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
659
+ // QR Code of the given version number and error correction level, with remainder bits discarded.
660
+ // This stateless pure function could be implemented as a (40*4)-cell lookup table.
661
+ static getNumDataCodewords(ver, ecl) {
662
+ return Math.floor(QrCode.getNumRawDataModules(ver) / 8) - QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
663
+ }
664
+ // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
665
+ // implemented as a lookup table over all possible parameter values, instead of as an algorithm.
666
+ static reedSolomonComputeDivisor(degree) {
667
+ if (degree < 1 || degree > 255)
668
+ throw new RangeError("Degree out of range");
669
+ let result = [];
670
+ for (let i = 0; i < degree - 1; i++) result.push(0);
671
+ result.push(1);
672
+ let root = 1;
673
+ for (let i = 0; i < degree; i++) {
674
+ for (let j2 = 0; j2 < result.length; j2++) {
675
+ result[j2] = QrCode.reedSolomonMultiply(result[j2], root);
676
+ if (j2 + 1 < result.length) result[j2] ^= result[j2 + 1];
677
+ }
678
+ root = QrCode.reedSolomonMultiply(root, 2);
679
+ }
680
+ return result;
681
+ }
682
+ // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
683
+ static reedSolomonComputeRemainder(data, divisor) {
684
+ let result = divisor.map((_3) => 0);
685
+ for (const b3 of data) {
686
+ const factor = b3 ^ result.shift();
687
+ result.push(0);
688
+ divisor.forEach(
689
+ (coef, i) => result[i] ^= QrCode.reedSolomonMultiply(coef, factor)
690
+ );
691
+ }
692
+ return result;
693
+ }
694
+ // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
695
+ // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
696
+ static reedSolomonMultiply(x2, y3) {
697
+ if (x2 >>> 8 != 0 || y3 >>> 8 != 0)
698
+ throw new RangeError("Byte out of range");
699
+ let z9 = 0;
700
+ for (let i = 7; i >= 0; i--) {
701
+ z9 = z9 << 1 ^ (z9 >>> 7) * 285;
702
+ z9 ^= (y3 >>> i & 1) * x2;
703
+ }
704
+ assert(z9 >>> 8 == 0);
705
+ return z9;
706
+ }
707
+ // Can only be called immediately after a light run is added, and
708
+ // returns either 0, 1, or 2. A helper function for getPenaltyScore().
709
+ finderPenaltyCountPatterns(runHistory) {
710
+ const n = runHistory[1];
711
+ assert(n <= this.size * 3);
712
+ const core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;
713
+ return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);
714
+ }
715
+ // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
716
+ finderPenaltyTerminateAndCount(currentRunColor, currentRunLength, runHistory) {
717
+ if (currentRunColor) {
718
+ this.finderPenaltyAddHistory(currentRunLength, runHistory);
719
+ currentRunLength = 0;
720
+ }
721
+ currentRunLength += this.size;
722
+ this.finderPenaltyAddHistory(currentRunLength, runHistory);
723
+ return this.finderPenaltyCountPatterns(runHistory);
724
+ }
725
+ // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
726
+ finderPenaltyAddHistory(currentRunLength, runHistory) {
727
+ if (runHistory[0] == 0) currentRunLength += this.size;
728
+ runHistory.pop();
729
+ runHistory.unshift(currentRunLength);
730
+ }
731
+ /*-- Constants and tables --*/
732
+ // The minimum version number supported in the QR Code Model 2 standard.
733
+ static MIN_VERSION = 1;
734
+ // The maximum version number supported in the QR Code Model 2 standard.
735
+ static MAX_VERSION = 40;
736
+ // For use in getPenaltyScore(), when evaluating which mask is best.
737
+ static PENALTY_N1 = 3;
738
+ static PENALTY_N2 = 3;
739
+ static PENALTY_N3 = 40;
740
+ static PENALTY_N4 = 10;
741
+ static ECC_CODEWORDS_PER_BLOCK = [
742
+ // Version: (note that index 0 is for padding, and is set to an illegal value)
743
+ //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
744
+ [
745
+ -1,
746
+ 7,
747
+ 10,
748
+ 15,
749
+ 20,
750
+ 26,
751
+ 18,
752
+ 20,
753
+ 24,
754
+ 30,
755
+ 18,
756
+ 20,
757
+ 24,
758
+ 26,
759
+ 30,
760
+ 22,
761
+ 24,
762
+ 28,
763
+ 30,
764
+ 28,
765
+ 28,
766
+ 28,
767
+ 28,
768
+ 30,
769
+ 30,
770
+ 26,
771
+ 28,
772
+ 30,
773
+ 30,
774
+ 30,
775
+ 30,
776
+ 30,
777
+ 30,
778
+ 30,
779
+ 30,
780
+ 30,
781
+ 30,
782
+ 30,
783
+ 30,
784
+ 30,
785
+ 30
786
+ ],
787
+ // Low
788
+ [
789
+ -1,
790
+ 10,
791
+ 16,
792
+ 26,
793
+ 18,
794
+ 24,
795
+ 16,
796
+ 18,
797
+ 22,
798
+ 22,
799
+ 26,
800
+ 30,
801
+ 22,
802
+ 22,
803
+ 24,
804
+ 24,
805
+ 28,
806
+ 28,
807
+ 26,
808
+ 26,
809
+ 26,
810
+ 26,
811
+ 28,
812
+ 28,
813
+ 28,
814
+ 28,
815
+ 28,
816
+ 28,
817
+ 28,
818
+ 28,
819
+ 28,
820
+ 28,
821
+ 28,
822
+ 28,
823
+ 28,
824
+ 28,
825
+ 28,
826
+ 28,
827
+ 28,
828
+ 28,
829
+ 28
830
+ ],
831
+ // Medium
832
+ [
833
+ -1,
834
+ 13,
835
+ 22,
836
+ 18,
837
+ 26,
838
+ 18,
839
+ 24,
840
+ 18,
841
+ 22,
842
+ 20,
843
+ 24,
844
+ 28,
845
+ 26,
846
+ 24,
847
+ 20,
848
+ 30,
849
+ 24,
850
+ 28,
851
+ 28,
852
+ 26,
853
+ 30,
854
+ 28,
855
+ 30,
856
+ 30,
857
+ 30,
858
+ 30,
859
+ 28,
860
+ 30,
861
+ 30,
862
+ 30,
863
+ 30,
864
+ 30,
865
+ 30,
866
+ 30,
867
+ 30,
868
+ 30,
869
+ 30,
870
+ 30,
871
+ 30,
872
+ 30,
873
+ 30
874
+ ],
875
+ // Quartile
876
+ [
877
+ -1,
878
+ 17,
879
+ 28,
880
+ 22,
881
+ 16,
882
+ 22,
883
+ 28,
884
+ 26,
885
+ 26,
886
+ 24,
887
+ 28,
888
+ 24,
889
+ 28,
890
+ 22,
891
+ 24,
892
+ 24,
893
+ 30,
894
+ 28,
895
+ 28,
896
+ 26,
897
+ 28,
898
+ 30,
899
+ 24,
900
+ 30,
901
+ 30,
902
+ 30,
903
+ 30,
904
+ 30,
905
+ 30,
906
+ 30,
907
+ 30,
908
+ 30,
909
+ 30,
910
+ 30,
911
+ 30,
912
+ 30,
913
+ 30,
914
+ 30,
915
+ 30,
916
+ 30,
917
+ 30
918
+ ]
919
+ // High
920
+ ];
921
+ static NUM_ERROR_CORRECTION_BLOCKS = [
922
+ // Version: (note that index 0 is for padding, and is set to an illegal value)
923
+ //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
924
+ [
925
+ -1,
926
+ 1,
927
+ 1,
928
+ 1,
929
+ 1,
930
+ 1,
931
+ 2,
932
+ 2,
933
+ 2,
934
+ 2,
935
+ 4,
936
+ 4,
937
+ 4,
938
+ 4,
939
+ 4,
940
+ 6,
941
+ 6,
942
+ 6,
943
+ 6,
944
+ 7,
945
+ 8,
946
+ 8,
947
+ 9,
948
+ 9,
949
+ 10,
950
+ 12,
951
+ 12,
952
+ 12,
953
+ 13,
954
+ 14,
955
+ 15,
956
+ 16,
957
+ 17,
958
+ 18,
959
+ 19,
960
+ 19,
961
+ 20,
962
+ 21,
963
+ 22,
964
+ 24,
965
+ 25
966
+ ],
967
+ // Low
968
+ [
969
+ -1,
970
+ 1,
971
+ 1,
972
+ 1,
973
+ 2,
974
+ 2,
975
+ 4,
976
+ 4,
977
+ 4,
978
+ 5,
979
+ 5,
980
+ 5,
981
+ 8,
982
+ 9,
983
+ 9,
984
+ 10,
985
+ 10,
986
+ 11,
987
+ 13,
988
+ 14,
989
+ 16,
990
+ 17,
991
+ 17,
992
+ 18,
993
+ 20,
994
+ 21,
995
+ 23,
996
+ 25,
997
+ 26,
998
+ 28,
999
+ 29,
1000
+ 31,
1001
+ 33,
1002
+ 35,
1003
+ 37,
1004
+ 38,
1005
+ 40,
1006
+ 43,
1007
+ 45,
1008
+ 47,
1009
+ 49
1010
+ ],
1011
+ // Medium
1012
+ [
1013
+ -1,
1014
+ 1,
1015
+ 1,
1016
+ 2,
1017
+ 2,
1018
+ 4,
1019
+ 4,
1020
+ 6,
1021
+ 6,
1022
+ 8,
1023
+ 8,
1024
+ 8,
1025
+ 10,
1026
+ 12,
1027
+ 16,
1028
+ 12,
1029
+ 17,
1030
+ 16,
1031
+ 18,
1032
+ 21,
1033
+ 20,
1034
+ 23,
1035
+ 23,
1036
+ 25,
1037
+ 27,
1038
+ 29,
1039
+ 34,
1040
+ 34,
1041
+ 35,
1042
+ 38,
1043
+ 40,
1044
+ 43,
1045
+ 45,
1046
+ 48,
1047
+ 51,
1048
+ 53,
1049
+ 56,
1050
+ 59,
1051
+ 62,
1052
+ 65,
1053
+ 68
1054
+ ],
1055
+ // Quartile
1056
+ [
1057
+ -1,
1058
+ 1,
1059
+ 1,
1060
+ 2,
1061
+ 4,
1062
+ 4,
1063
+ 4,
1064
+ 5,
1065
+ 6,
1066
+ 8,
1067
+ 8,
1068
+ 11,
1069
+ 11,
1070
+ 16,
1071
+ 16,
1072
+ 18,
1073
+ 16,
1074
+ 19,
1075
+ 21,
1076
+ 25,
1077
+ 25,
1078
+ 25,
1079
+ 34,
1080
+ 30,
1081
+ 32,
1082
+ 35,
1083
+ 37,
1084
+ 40,
1085
+ 42,
1086
+ 45,
1087
+ 48,
1088
+ 51,
1089
+ 54,
1090
+ 57,
1091
+ 60,
1092
+ 63,
1093
+ 66,
1094
+ 70,
1095
+ 74,
1096
+ 77,
1097
+ 81
1098
+ ]
1099
+ // High
1100
+ ];
1101
+ }
1102
+ qrcodegen2.QrCode = QrCode;
1103
+ function appendBits(val, len, bb) {
1104
+ if (len < 0 || len > 31 || val >>> len != 0)
1105
+ throw new RangeError("Value out of range");
1106
+ for (let i = len - 1; i >= 0; i--)
1107
+ bb.push(val >>> i & 1);
1108
+ }
1109
+ function getBit(x2, i) {
1110
+ return (x2 >>> i & 1) != 0;
1111
+ }
1112
+ function assert(cond) {
1113
+ if (!cond) throw new Error("Assertion error");
1114
+ }
1115
+ class QrSegment {
1116
+ /*-- Constructor (low level) and fields --*/
1117
+ // Creates a new QR Code segment with the given attributes and data.
1118
+ // The character count (numChars) must agree with the mode and the bit buffer length,
1119
+ // but the constraint isn't checked. The given bit buffer is cloned and stored.
1120
+ constructor(mode, numChars, bitData) {
1121
+ this.mode = mode;
1122
+ this.numChars = numChars;
1123
+ this.bitData = bitData;
1124
+ if (numChars < 0) throw new RangeError("Invalid argument");
1125
+ this.bitData = bitData.slice();
1126
+ }
1127
+ /*-- Static factory functions (mid level) --*/
1128
+ // Returns a segment representing the given binary data encoded in
1129
+ // byte mode. All input byte arrays are acceptable. Any text string
1130
+ // can be converted to UTF-8 bytes and encoded as a byte mode segment.
1131
+ static makeBytes(data) {
1132
+ let bb = [];
1133
+ for (const b3 of data) appendBits(b3, 8, bb);
1134
+ return new QrSegment(QrSegment.Mode.BYTE, data.length, bb);
1135
+ }
1136
+ // Returns a segment representing the given string of decimal digits encoded in numeric mode.
1137
+ static makeNumeric(digits) {
1138
+ if (!QrSegment.isNumeric(digits))
1139
+ throw new RangeError("String contains non-numeric characters");
1140
+ let bb = [];
1141
+ for (let i = 0; i < digits.length; ) {
1142
+ const n = Math.min(digits.length - i, 3);
1143
+ appendBits(parseInt(digits.substr(i, n), 10), n * 3 + 1, bb);
1144
+ i += n;
1145
+ }
1146
+ return new QrSegment(QrSegment.Mode.NUMERIC, digits.length, bb);
1147
+ }
1148
+ // Returns a segment representing the given text string encoded in alphanumeric mode.
1149
+ // The characters allowed are: 0 to 9, A to Z (uppercase only), space,
1150
+ // dollar, percent, asterisk, plus, hyphen, period, slash, colon.
1151
+ static makeAlphanumeric(text) {
1152
+ if (!QrSegment.isAlphanumeric(text))
1153
+ throw new RangeError(
1154
+ "String contains unencodable characters in alphanumeric mode"
1155
+ );
1156
+ let bb = [];
1157
+ let i;
1158
+ for (i = 0; i + 2 <= text.length; i += 2) {
1159
+ let temp = QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;
1160
+ temp += QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));
1161
+ appendBits(temp, 11, bb);
1162
+ }
1163
+ if (i < text.length)
1164
+ appendBits(
1165
+ QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)),
1166
+ 6,
1167
+ bb
1168
+ );
1169
+ return new QrSegment(QrSegment.Mode.ALPHANUMERIC, text.length, bb);
1170
+ }
1171
+ // Returns a new mutable list of zero or more segments to represent the given Unicode text string.
1172
+ // The result may use various segment modes and switch modes to optimize the length of the bit stream.
1173
+ static makeSegments(text) {
1174
+ if (text == "") return [];
1175
+ else if (QrSegment.isNumeric(text)) return [QrSegment.makeNumeric(text)];
1176
+ else if (QrSegment.isAlphanumeric(text))
1177
+ return [QrSegment.makeAlphanumeric(text)];
1178
+ else return [QrSegment.makeBytes(QrSegment.toUtf8ByteArray(text))];
1179
+ }
1180
+ // Returns a segment representing an Extended Channel Interpretation
1181
+ // (ECI) designator with the given assignment value.
1182
+ static makeEci(assignVal) {
1183
+ let bb = [];
1184
+ if (assignVal < 0)
1185
+ throw new RangeError("ECI assignment value out of range");
1186
+ else if (assignVal < 1 << 7) appendBits(assignVal, 8, bb);
1187
+ else if (assignVal < 1 << 14) {
1188
+ appendBits(2, 2, bb);
1189
+ appendBits(assignVal, 14, bb);
1190
+ } else if (assignVal < 1e6) {
1191
+ appendBits(6, 3, bb);
1192
+ appendBits(assignVal, 21, bb);
1193
+ } else throw new RangeError("ECI assignment value out of range");
1194
+ return new QrSegment(QrSegment.Mode.ECI, 0, bb);
1195
+ }
1196
+ // Tests whether the given string can be encoded as a segment in numeric mode.
1197
+ // A string is encodable iff each character is in the range 0 to 9.
1198
+ static isNumeric(text) {
1199
+ return QrSegment.NUMERIC_REGEX.test(text);
1200
+ }
1201
+ // Tests whether the given string can be encoded as a segment in alphanumeric mode.
1202
+ // A string is encodable iff each character is in the following set: 0 to 9, A to Z
1203
+ // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
1204
+ static isAlphanumeric(text) {
1205
+ return QrSegment.ALPHANUMERIC_REGEX.test(text);
1206
+ }
1207
+ /*-- Methods --*/
1208
+ // Returns a new copy of the data bits of this segment.
1209
+ getData() {
1210
+ return this.bitData.slice();
1211
+ }
1212
+ // (Package-private) Calculates and returns the number of bits needed to encode the given segments at
1213
+ // the given version. The result is infinity if a segment has too many characters to fit its length field.
1214
+ static getTotalBits(segs, version) {
1215
+ let result = 0;
1216
+ for (const seg of segs) {
1217
+ const ccbits = seg.mode.numCharCountBits(version);
1218
+ if (seg.numChars >= 1 << ccbits) return Infinity;
1219
+ result += 4 + ccbits + seg.bitData.length;
1220
+ }
1221
+ return result;
1222
+ }
1223
+ // Returns a new array of bytes representing the given string encoded in UTF-8.
1224
+ static toUtf8ByteArray(str) {
1225
+ str = encodeURI(str);
1226
+ let result = [];
1227
+ for (let i = 0; i < str.length; i++) {
1228
+ if (str.charAt(i) != "%") result.push(str.charCodeAt(i));
1229
+ else {
1230
+ result.push(parseInt(str.substr(i + 1, 2), 16));
1231
+ i += 2;
1232
+ }
1233
+ }
1234
+ return result;
1235
+ }
1236
+ /*-- Constants --*/
1237
+ // Describes precisely all strings that are encodable in numeric mode.
1238
+ static NUMERIC_REGEX = /^[0-9]*$/;
1239
+ // Describes precisely all strings that are encodable in alphanumeric mode.
1240
+ static ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/;
1241
+ // The set of all legal characters in alphanumeric mode,
1242
+ // where each character value maps to the index in the string.
1243
+ static ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
1244
+ }
1245
+ qrcodegen2.QrSegment = QrSegment;
1246
+ })(qrcodegen || (qrcodegen = {}));
1247
+ ((qrcodegen2) => {
1248
+ ((QrCode2) => {
1249
+ class Ecc {
1250
+ // The QR Code can tolerate about 30% erroneous codewords
1251
+ /*-- Constructor and fields --*/
1252
+ constructor(ordinal, formatBits) {
1253
+ this.ordinal = ordinal;
1254
+ this.formatBits = formatBits;
1255
+ }
1256
+ /*-- Constants --*/
1257
+ static LOW = new Ecc(0, 1);
1258
+ // The QR Code can tolerate about 7% erroneous codewords
1259
+ static MEDIUM = new Ecc(1, 0);
1260
+ // The QR Code can tolerate about 15% erroneous codewords
1261
+ static QUARTILE = new Ecc(2, 3);
1262
+ // The QR Code can tolerate about 25% erroneous codewords
1263
+ static HIGH = new Ecc(3, 2);
1264
+ }
1265
+ QrCode2.Ecc = Ecc;
1266
+ })(qrcodegen2.QrCode || (qrcodegen2.QrCode = {}));
1267
+ })(qrcodegen || (qrcodegen = {}));
1268
+ ((qrcodegen2) => {
1269
+ ((QrSegment2) => {
1270
+ class Mode {
1271
+ /*-- Constructor and fields --*/
1272
+ constructor(modeBits, numBitsCharCount) {
1273
+ this.modeBits = modeBits;
1274
+ this.numBitsCharCount = numBitsCharCount;
1275
+ }
1276
+ /*-- Constants --*/
1277
+ static NUMERIC = new Mode(1, [10, 12, 14]);
1278
+ static ALPHANUMERIC = new Mode(2, [9, 11, 13]);
1279
+ static BYTE = new Mode(4, [8, 16, 16]);
1280
+ static KANJI = new Mode(8, [8, 10, 12]);
1281
+ static ECI = new Mode(7, [0, 0, 0]);
1282
+ /*-- Method --*/
1283
+ // (Package-private) Returns the bit width of the character count field for a segment in
1284
+ // this mode in a QR Code at the given version number. The result is in the range [0, 16].
1285
+ numCharCountBits(ver) {
1286
+ return this.numBitsCharCount[Math.floor((ver + 7) / 17)];
1287
+ }
1288
+ }
1289
+ QrSegment2.Mode = Mode;
1290
+ })(qrcodegen2.QrSegment || (qrcodegen2.QrSegment = {}));
1291
+ })(qrcodegen || (qrcodegen = {}));
1292
+ codegen_default = qrcodegen;
1293
+ }
1294
+ });
1295
+
1296
+ // src/constants.ts
1297
+ var ERROR_LEVEL_MAP, DEFAULT_SIZE, DEFAULT_LEVEL, DEFAULT_BGCOLOR, DEFAULT_FGCOLOR, DEFAULT_MARGIN, DEFAULT_IMG_SCALE, FLAM_QR_LOGO;
1298
+ var init_constants = __esm({
1299
+ "src/constants.ts"() {
1300
+ init_codegen();
1301
+ ERROR_LEVEL_MAP = {
1302
+ L: codegen_default.QrCode.Ecc.LOW,
1303
+ M: codegen_default.QrCode.Ecc.MEDIUM,
1304
+ Q: codegen_default.QrCode.Ecc.QUARTILE,
1305
+ H: codegen_default.QrCode.Ecc.HIGH
1306
+ };
1307
+ DEFAULT_SIZE = 128;
1308
+ DEFAULT_LEVEL = "Q";
1309
+ DEFAULT_BGCOLOR = "#FFFFFF";
1310
+ DEFAULT_FGCOLOR = "#000000";
1311
+ DEFAULT_MARGIN = 4;
1312
+ DEFAULT_IMG_SCALE = 0.1;
1313
+ FLAM_QR_LOGO = "https://qrdx.dev/logo.png";
1314
+ }
1315
+ });
1316
+ function generateCornerDotPath(cx, cy, radius, pattern = "circle") {
1317
+ const size = radius * 2;
1318
+ const halfSize = radius;
1319
+ switch (pattern) {
1320
+ case "square":
1321
+ return /* @__PURE__ */ jsxRuntime.jsx(
1322
+ "rect",
1323
+ {
1324
+ height: size,
1325
+ transform: `rotate(0,${cx},${cy})`,
1326
+ width: size,
1327
+ x: cx - halfSize,
1328
+ y: cy - halfSize
1329
+ }
1330
+ );
1331
+ case "rounded":
1332
+ return /* @__PURE__ */ jsxRuntime.jsx(
1333
+ "rect",
1334
+ {
1335
+ height: size,
1336
+ rx: radius * 0.5,
1337
+ ry: radius * 0.5,
1338
+ transform: `rotate(0,${cx},${cy})`,
1339
+ width: size,
1340
+ x: cx - halfSize,
1341
+ y: cy - halfSize
1342
+ }
1343
+ );
1344
+ case "diamond":
1345
+ return /* @__PURE__ */ jsxRuntime.jsx(
1346
+ "path",
1347
+ {
1348
+ d: `M ${cx - halfSize * 0.714286} ${cy - halfSize * 0.714286}v ${size * 0.714286}h ${size * 0.714286}v -${size * 0.714286}z`,
1349
+ transform: `rotate(45,${cx},${cy})`
1350
+ }
1351
+ );
1352
+ case "message": {
1353
+ const scale = size / 30;
1354
+ const transformX = (coord) => (coord - 40) * scale + cx;
1355
+ const transformY = (coord) => (coord - 40) * scale + cy;
1356
+ const path = `M ${transformX(25)} ${transformY(35.714285714285715)}v ${8.571428571428571 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, ${10.714285714285714 * scale} ${10.714285714285714 * scale}h ${19.285714285714285 * scale}v -${19.285714285714285 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, -${10.714285714285714 * scale} -${10.714285714285714 * scale}h -${8.571428571428571 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, -${10.714285714285714 * scale} ${10.714285714285714 * scale}`;
1357
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { clipRule: "evenodd", d: path, transform: `rotate(0,${cx},${cy})` });
1358
+ }
1359
+ case "message-reverse": {
1360
+ const scale = size / 30;
1361
+ const transformX = (coord) => (coord - 40) * scale + cx;
1362
+ const transformY = (coord) => (coord - 40) * scale + cy;
1363
+ const path = `M ${transformX(25)} ${transformY(35.714285714285715)}v ${8.571428571428571 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, ${10.714285714285714 * scale} ${10.714285714285714 * scale}h ${19.285714285714285 * scale}v -${19.285714285714285 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, -${10.714285714285714 * scale} -${10.714285714285714 * scale}h -${8.571428571428571 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, -${10.714285714285714 * scale} ${10.714285714285714 * scale}`;
1364
+ return /* @__PURE__ */ jsxRuntime.jsx(
1365
+ "path",
1366
+ {
1367
+ clipRule: "evenodd",
1368
+ d: path,
1369
+ transform: `rotate(-180,${cx},${cy})`
1370
+ }
1371
+ );
1372
+ }
1373
+ case "diya": {
1374
+ const scale = size / 30;
1375
+ const transformX = (coord) => (coord - 40) * scale + cx;
1376
+ const transformY = (coord) => (coord - 40) * scale + cy;
1377
+ const path = `M ${transformX(25)} ${transformY(35.714285714285715)}v ${8.571428571428571 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, ${10.714285714285714 * scale} ${10.714285714285714 * scale}h ${19.285714285714285 * scale}v -${19.285714285714285 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, -${10.714285714285714 * scale} -${10.714285714285714 * scale}h -${8.571428571428571 * scale}H ${transformX(25)}z`;
1378
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { clipRule: "evenodd", d: path, transform: `rotate(0,${cx},${cy})` });
1379
+ }
1380
+ case "diya-reverse": {
1381
+ const scale = size / 30;
1382
+ const transformX = (coord) => (coord - 40) * scale + cx;
1383
+ const transformY = (coord) => (coord - 40) * scale + cy;
1384
+ const path = `M ${transformX(25)} ${transformY(35.714285714285715)}v ${19.285714285714285 * scale}h ${19.285714285714285 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, ${10.714285714285714 * scale} -${10.714285714285714 * scale}v -${19.285714285714285 * scale}h -${19.285714285714285 * scale}a ${10.714285714285714 * scale} ${10.714285714285714 * scale}, 0, 0, 0, -${10.714285714285714 * scale} ${10.714285714285714 * scale}z`;
1385
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { clipRule: "evenodd", d: path, transform: `rotate(0,${cx},${cy})` });
1386
+ }
1387
+ case "rounded-triangle": {
1388
+ const scale = size / 21;
1389
+ const transformX = (coord) => (coord - 40) * scale + cx;
1390
+ const transformY = (coord) => (coord - 40) * scale + cy;
1391
+ const path = `M ${transformX(33.57142857142857)} ${transformY(29.285714285714285)}h ${12.857142857142856 * scale}c ${4.285714285714286 * scale} 0 ${4.285714285714286 * scale} ${4.285714285714286 * scale} ${4.285714285714286 * scale} ${4.285714285714286 * scale}v ${12.857142857142856 * scale}c 0 ${4.285714285714286 * scale} -${4.285714285714286 * scale} ${4.285714285714286 * scale} -${4.285714285714286 * scale} ${4.285714285714286 * scale}h -${12.857142857142856 * scale}c -${4.285714285714286 * scale} 0 -${4.285714285714286 * scale} -${4.285714285714286 * scale} -${4.285714285714286 * scale} -${4.285714285714286 * scale}v -${12.857142857142856 * scale}c 0 -${4.285714285714286 * scale} ${4.285714285714286 * scale} -${4.285714285714286 * scale} ${4.285714285714286 * scale} -${4.285714285714286 * scale}z`;
1392
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { d: path, transform: `rotate(45,${cx},${cy})` });
1393
+ }
1394
+ case "star": {
1395
+ const scale = size / 27;
1396
+ const transformX = (coord) => (coord - 40) * scale + cx;
1397
+ const transformY = (coord) => (coord - 40) * scale + cy;
1398
+ const path = `M ${transformX(38.84615384615385)},${transformY(26.546153846153846)}c${0.6692307692307691 * scale},-${1.0153846153846153 * scale},${2.215384615384615 * scale},-${1.0153846153846153 * scale},${2.884615384615384 * scale},0l${4.038461538461538 * scale},${6.069230769230768 * scale}c${0.23076923076923075 * scale},${0.3461538461538461 * scale},${0.6 * scale},${0.6 * scale},${1.0153846153846153 * scale},${0.7153846153846153 * scale}l${7.223076923076922 * scale},${1.823076923076923 * scale}c${1.2 * scale},${0.3 * scale},${1.6846153846153844 * scale},${1.7076923076923076 * scale},${0.8999999999999999 * scale},${2.6538461538461533 * scale}l-${4.73076923076923 * scale},${5.584615384615384 * scale}c-${0.2769230769230769 * scale},${0.3230769230769231 * scale},-${0.41538461538461535 * scale},${0.7384615384615384 * scale},-${0.3923076923076923 * scale},${1.1307692307692307 * scale}l${0.4384615384615384 * scale},${7.199999999999999 * scale}c${0.06923076923076922 * scale},${1.2 * scale},-${1.1769230769230767 * scale},${2.0769230769230766 * scale},-${2.3307692307692305 * scale},${1.6384615384615382 * scale}l-${6.9692307692307685 * scale},-${2.6076923076923073 * scale}c-${0.3923076923076923 * scale},-${0.16153846153846155 * scale},-${0.8538461538461538 * scale},-${0.16153846153846155 * scale},-${1.2461538461538462 * scale},0l-${6.9692307692307685 * scale},${2.6076923076923073 * scale}c-${1.1538461538461537 * scale},${0.4384615384615384 * scale},-${2.4 * scale},-${0.4384615384615384 * scale},-${2.3307692307692305 * scale},-${1.6384615384615382 * scale}l${0.4384615384615384 * scale},-${7.199999999999999 * scale}c${0.023076923076923075 * scale},-${0.41538461538461535 * scale},-${0.11538461538461538 * scale},-${0.8307692307692307 * scale},-${0.3923076923076923 * scale},-${1.1307692307692307 * scale}l-${4.73076923076923 * scale},-${5.584615384615384 * scale}c-${0.7846153846153846 * scale},-${0.923076923076923 * scale},-${0.3230769230769231 * scale},-${2.3307692307692305 * scale},${0.8999999999999999 * scale},-${2.6538461538461533 * scale}l${7.223076923076922 * scale},-${1.823076923076923 * scale}c${0.41538461538461535 * scale},-${0.11538461538461538 * scale},${0.7846153846153846 * scale},-${0.3461538461538461 * scale},${1.0153846153846153 * scale},-${0.7153846153846153 * scale}l${4.038461538461538 * scale},-${6.069230769230768 * scale}z`;
1399
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { clipRule: "evenodd", d: path, transform: `rotate(0,${cx},${cy})` });
1400
+ }
1401
+ case "banner": {
1402
+ const scale = size / 28;
1403
+ const path = "M38.23456923076923 26.10373C38.75864615384615 25.677388461538463, 39.510007692307695 25.677388461538463, 40.03410769230769 26.10373L41.7757 27.520484615384614C42.09088461538461 27.776892307692307, 42.5005 27.886646153846154, 42.90166923076923 27.82219230769231L45.118300000000005 27.466046153846154C45.78536153846154 27.358853846153846, 46.43606153846153 27.734546153846154, 46.676753846153844 28.365815384615384L47.47664615384615 30.463553846153847C47.621407692307685 30.843192307692306, 47.92126923076923 31.143053846153844, 48.300999999999995 31.287815384615385L50.3986923076923 32.08770769230769C51.02984615384615 32.3284, 51.405538461538455 32.9791, 51.29846153846154 33.64616153846154L50.94238461538461 35.8627923076923C50.87776923076923 36.26396153846154, 50.98761538461538 36.67357692307692, 51.244 36.98876153846154L52.6606923076923 38.73035384615385C53.08715384615384 39.254453846153844, 53.08715384615384 40.00581538461538, 52.6606923076923 40.52989230769231L51.244 42.27148461538461C50.98761538461538 42.5866923076923, 50.87776923076923 42.99628461538461, 50.94238461538461 43.397453846153844L51.29846153846154 45.614107692307684C51.405538461538455 46.28114615384615, 51.02984615384615 46.93184615384615, 50.3986923076923 47.17256153846154L48.300999999999995 47.97243076923077C47.92126923076923 48.11730769230769, 47.621407692307685 48.41707692307692, 47.47664615384615 48.796692307692304L46.676753846153844 50.89438461538461C46.43606153846153 51.52576923076923, 45.78536153846154 51.90146153846153, 45.118300000000005 51.79415384615385L42.90166923076923 51.43807692307692C42.5005 51.37369230769231, 42.09088461538461 51.48330769230769, 41.7757 51.73969230769231L40.03410769230769 53.15661538461538C39.510007692307695 53.58284615384615, 38.75864615384615 53.58284615384615, 38.23456923076923 53.15661538461538L36.492976923076924 51.73969230769231C36.17776923076923 51.48330769230769, 35.76817692307692 51.37369230769231, 35.367007692307695 51.43807692307692L33.15035384615385 51.79415384615385C32.48331538461538 51.90146153846153, 31.832615384615384 51.52576923076923, 31.5919 50.89438461538461L30.79203076923077 48.796692307692304C30.647269230769233 48.41707692307692, 30.34740769230769 48.11730769230769, 29.96776923076923 47.97243076923077L27.87000769230769 47.17256153846154C27.23874769230769 46.93184615384615, 26.86306692307692 46.28114615384615, 26.970243076923076 45.614107692307684L27.326384615384615 43.397453846153844C27.39083846153846 42.99628461538461, 27.281093846153844 42.5866923076923, 27.02469076923077 42.27148461538461L25.607936153846154 40.52989230769231C25.181594384615384 40.00581538461538, 25.181594384615384 39.254453846153844, 25.607936153846154 38.73035384615385L27.02469076923077 36.98876153846154C27.281093846153844 36.67357692307692, 27.39083846153846 36.26396153846154, 27.326384615384615 35.8627923076923L26.970243076923076 33.64616153846154C26.86306692307692 32.9791, 27.23874769230769 32.3284, 27.87000769230769 32.08770769230769L29.96776923076923 31.287815384615385C30.34740769230769 31.143053846153844, 30.647269230769233 30.843192307692306, 30.79203076923077 30.463553846153847L31.5919 28.365815384615384C31.832615384615384 27.734546153846154, 32.48331538461538 27.358853846153846, 33.15035384615385 27.466046153846154L35.367007692307695 27.82219230769231C35.76817692307692 27.886646153846154, 36.17776923076923 27.776892307692307, 36.492976923076924 27.520484615384614L38.23456923076923 26.10373Z";
1404
+ return /* @__PURE__ */ jsxRuntime.jsx(
1405
+ "g",
1406
+ {
1407
+ transform: `translate(${cx - 40 * scale},${cy - 40 * scale}) scale(${scale})`,
1408
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { clipRule: "evenodd", d: path })
1409
+ }
1410
+ );
1411
+ }
1412
+ default:
1413
+ return /* @__PURE__ */ jsxRuntime.jsx(
1414
+ "circle",
1415
+ {
1416
+ cx,
1417
+ cy,
1418
+ r: radius,
1419
+ transform: `rotate(0,${cx},${cy})`
1420
+ }
1421
+ );
1422
+ }
1423
+ }
1424
+ var init_corner_dot = __esm({
1425
+ "src/corner-dot.tsx"() {
1426
+ }
1427
+ });
1428
+
1429
+ // src/corner-eye.ts
1430
+ function generateCornerSquarePattern(offsetX, offsetY, size) {
1431
+ const m2 = size / 7;
1432
+ const path = `M ${offsetX} ${offsetY}v ${size}h ${size}v -${size}zM ${offsetX + m2} ${offsetY + m2}h ${5 * m2}v ${5 * m2}h -${5 * m2}z`;
1433
+ return path;
1434
+ }
1435
+ function generateCornerRoundedPattern(offsetX, offsetY, size) {
1436
+ const m2 = size / 7;
1437
+ const r = m2 * 0.875;
1438
+ const r2 = m2 * 0.4375;
1439
+ const outer = `M ${offsetX + r} ${offsetY}h ${size - 2 * r}a ${r} ${r} 0 0 1 ${r} ${r}v ${size - 2 * r}a ${r} ${r} 0 0 1 ${-r} ${r}h ${-(size - 2 * r)}a ${r} ${r} 0 0 1 ${-r} ${-r}v ${-(size - 2 * r)}a ${r} ${r} 0 0 1 ${r} ${-r}z`;
1440
+ const inner = `M ${offsetX + m2 + r2} ${offsetY + m2}h ${5 * m2 - 2 * r2}a ${r2} ${r2} 0 0 1 ${r2} ${r2}v ${5 * m2 - 2 * r2}a ${r2} ${r2} 0 0 1 ${-r2} ${r2}h ${-(5 * m2 - 2 * r2)}a ${r2} ${r2} 0 0 1 ${-r2} ${-r2}v ${-(5 * m2 - 2 * r2)}a ${r2} ${r2} 0 0 1 ${r2} ${-r2}z`;
1441
+ return outer + inner;
1442
+ }
1443
+ function generateCornerCirclePattern(offsetX, offsetY, size) {
1444
+ const cx = offsetX + size / 2;
1445
+ const cy = offsetY + size / 2;
1446
+ const outerRadius = size / 2;
1447
+ const innerRadius = size * (2.5 / 7);
1448
+ const path = `M ${cx - outerRadius} ${cy}a ${outerRadius} ${outerRadius} 0 1 0 ${outerRadius * 2} 0a ${outerRadius} ${outerRadius} 0 1 0 ${-outerRadius * 2} 0zM ${cx - innerRadius} ${cy}a ${innerRadius} ${innerRadius} 0 1 1 ${innerRadius * 2} 0a ${innerRadius} ${innerRadius} 0 1 1 ${-innerRadius * 2} 0z`;
1449
+ return path;
1450
+ }
1451
+ function generateCornerGearPattern(offsetX, offsetY, size) {
1452
+ const scale = size / 74.7002;
1453
+ const transformCoord = (coord) => coord * scale + offsetX;
1454
+ const transformY = (coord) => coord * scale + offsetY;
1455
+ const path = `M${transformCoord(37.3496)} ${transformY(0)}C${transformCoord(39.2939)} ${transformY(0)} ${transformCoord(40.9948)} ${transformY(1.03842)} ${transformCoord(41.9287)} ${transformY(2.59082)}C${transformCoord(43.2293)} ${transformY(1.34013)} ${transformCoord(45.1347)} ${transformY(0.780267)} ${transformCoord(47.0098)} ${transformY(1.28027)}C${transformCoord(48.8871)} ${transformY(1.78928)} ${transformCoord(50.261)} ${transformY(3.23767)} ${transformCoord(50.7578)} ${transformY(4.98438)}C${transformCoord(52.3454)} ${transformY(4.0996)} ${transformCoord(54.3432)} ${transformY(4.047)} ${transformCoord(56.0303)} ${transformY(5.01953)}C${transformCoord(57.7094)} ${transformY(5.98752)} ${transformCoord(58.6586)} ${transformY(7.73647)} ${transformCoord(58.6924)} ${transformY(9.5459)}C${transformCoord(60.4517)} ${transformY(9.10661)} ${transformCoord(62.3883)} ${transformY(9.57215)} ${transformCoord(63.7598)} ${transformY(10.9502)}C${transformCoord(65.1282)} ${transformY(12.3253)} ${transformCoord(65.5963)} ${transformY(14.2585)} ${transformCoord(65.1641)} ${transformY(16.0127)}C${transformCoord(66.974)} ${transformY(16.044)} ${transformCoord(68.7242)} ${transformY(16.9982)} ${transformCoord(69.7002)} ${transformY(18.6797)}C${transformCoord(70.6781)} ${transformY(20.3647)} ${transformCoord(70.6241)} ${transformY(22.3635)} ${transformCoord(69.7402)} ${transformY(23.9502)}C${transformCoord(71.4776)} ${transformY(24.4496)} ${transformCoord(72.9194)} ${transformY(25.8232)} ${transformCoord(73.4199)} ${transformY(27.7002)}C${transformCoord(73.927)} ${transformY(29.5707)} ${transformCoord(73.3661)} ${transformY(31.4794)} ${transformCoord(72.1104)} ${transformY(32.7822)}C${transformCoord(73.6621)} ${transformY(33.7163)} ${transformCoord(74.7002)} ${transformY(35.4166)} ${transformCoord(74.7002)} ${transformY(37.3604)}C${transformCoord(74.7001)} ${transformY(39.307)} ${transformCoord(73.6582)} ${transformY(41.0084)} ${transformCoord(72.1025)} ${transformY(41.9414)}C${transformCoord(73.357)} ${transformY(43.245)} ${transformCoord(73.9207)} ${transformY(45.1525)} ${transformCoord(73.4199)} ${transformY(47.0303)}C${transformCoord(72.9187)} ${transformY(48.9027)} ${transformCoord(71.4782)} ${transformY(50.2735)} ${transformCoord(69.7383)} ${transformY(50.7734)}C${transformCoord(70.6201)} ${transformY(52.3601)} ${transformCoord(70.6716)} ${transformY(54.3549)} ${transformCoord(69.7002)} ${transformY(56.04)}C${transformCoord(68.7237)} ${transformY(57.7225)} ${transformCoord(66.9721)} ${transformY(58.6729)} ${transformCoord(65.1611)} ${transformY(58.7031)}C${transformCoord(65.598)} ${transformY(60.4623)} ${transformCoord(65.131)} ${transformY(62.3982)} ${transformCoord(63.7598)} ${transformY(63.7695)}C${transformCoord(62.3847)} ${transformY(65.138)} ${transformCoord(60.4515)} ${transformY(65.6061)} ${transformCoord(58.6973)} ${transformY(65.1738)}C${transformCoord(58.6635)} ${transformY(66.9833)} ${transformCoord(57.7094)} ${transformY(68.7322)} ${transformCoord(56.0303)} ${transformY(69.7002)}C${transformCoord(54.3461)} ${transformY(70.6777)} ${transformCoord(52.348)} ${transformY(70.6248)} ${transformCoord(50.7617)} ${transformY(69.7422)}C${transformCoord(50.2643)} ${transformY(71.4831)} ${transformCoord(48.8896)} ${transformY(72.9284)} ${transformCoord(47.0098)} ${transformY(73.4297)}C${transformCoord(45.1389)} ${transformY(73.9368)} ${transformCoord(43.2296)} ${transformY(73.3763)} ${transformCoord(41.9268)} ${transformY(72.1201)}C${transformCoord(40.9927)} ${transformY(73.6717)} ${transformCoord(39.2932)} ${transformY(74.71)} ${transformCoord(37.3496)} ${transformY(74.71)}C${transformCoord(35.4051)} ${transformY(74.7098)} ${transformCoord(33.7042)} ${transformY(73.6711)} ${transformCoord(32.7705)} ${transformY(72.1182)}C${transformCoord(31.4697)} ${transformY(73.3758)} ${transformCoord(29.5597)} ${transformY(73.9418)} ${transformCoord(27.6797)} ${transformY(73.4404)}V${transformY(73.4502)}C${transformCoord(25.8065)} ${transformY(72.9422)} ${transformCoord(24.434)} ${transformY(71.4985)} ${transformCoord(23.9346)} ${transformY(69.7568)}C${transformCoord(22.3504)} ${transformY(70.6301)} ${transformCoord(20.3591)} ${transformY(70.6781)} ${transformCoord(18.6797)} ${transformY(69.71)}C${transformCoord(16.9957)} ${transformY(68.7391)} ${transformCoord(16.045)} ${transformY(66.9831)} ${transformCoord(16.0166)} ${transformY(65.168)}C${transformCoord(14.2547)} ${transformY(65.6091)} ${transformCoord(12.3134)} ${transformY(65.1435)} ${transformCoord(10.9395)} ${transformY(63.7695)}C${transformCoord(9.5687)} ${transformY(62.3919)} ${transformCoord(9.10168)} ${transformY(60.454)} ${transformCoord(9.53809)} ${transformY(58.6973)}C${transformCoord(7.72791)} ${transformY(58.6641)} ${transformCoord(5.97815)} ${transformY(57.71)} ${transformCoord(5.00977)} ${transformY(56.0303)}C${transformCoord(4.03552)} ${transformY(54.3517)} ${transformCoord(4.08377)} ${transformY(52.3649)} ${transformCoord(4.95801)} ${transformY(50.7812)}C${transformCoord(3.21705)} ${transformY(50.2839)} ${transformCoord(1.77087)} ${transformY(48.9101)} ${transformCoord(1.26953)} ${transformY(47.0303)}V${transformY(47.0205)}C${transformCoord(0.762081)} ${transformY(45.1489)} ${transformCoord(1.32758)} ${transformY(43.2375)} ${transformCoord(2.58496)} ${transformY(41.9346)}C${transformCoord(1.03604)} ${transformY(41)} ${transformCoord(108484e-9)} ${transformY(39.3019)} ${transformCoord(0)} ${transformY(37.3604)}C${transformCoord(0)} ${transformY(35.4159)} ${transformCoord(1.03815)} ${transformY(33.7141)} ${transformCoord(2.59082)} ${transformY(32.7803)}C${transformCoord(1.34044)} ${transformY(31.4797)} ${transformCoord(0.780389)} ${transformY(29.575)} ${transformCoord(1.28027)} ${transformY(27.7002)}C${transformCoord(1.78258)} ${transformY(25.8232)} ${transformCoord(3.22806)} ${transformY(24.4482)} ${transformCoord(4.97363)} ${transformY(23.9512)}C${transformCoord(4.08938)} ${transformY(22.3638)} ${transformCoord(4.03743)} ${transformY(20.3664)} ${transformCoord(5.00977)} ${transformY(18.6797)}C${transformCoord(5.97815)} ${transformY(16.9999)} ${transformCoord(7.72788)} ${transformY(16.0496)} ${transformCoord(9.53809)} ${transformY(16.0166)}C${transformCoord(9.10139)} ${transformY(14.2576)} ${transformCoord(9.56846)} ${transformY(12.3214)} ${transformCoord(10.9395)} ${transformY(10.9502)}C${transformCoord(12.3171)} ${transformY(9.57911)} ${transformCoord(14.2558)} ${transformY(9.11137)} ${transformCoord(16.0127)} ${transformY(9.54785)}C${transformCoord(16.0426)} ${transformY(7.73421)} ${transformCoord(16.9969)} ${transformY(5.97989)} ${transformCoord(18.6797)} ${transformY(5.00977)}C${transformCoord(20.3596)} ${transformY(4.03474)} ${transformCoord(22.3521)} ${transformY(4.08468)} ${transformCoord(23.9365)} ${transformY(4.96094)}C${transformCoord(24.4378)} ${transformY(3.22749)} ${transformCoord(25.8059)} ${transformY(1.7898)} ${transformCoord(27.6797)} ${transformY(1.29004)}C${transformCoord(29.5511)} ${transformY(0.78264)} ${transformCoord(31.4617)} ${transformY(1.34357)} ${transformCoord(32.7646)} ${transformY(2.60059)}C${transformCoord(33.6971)} ${transformY(1.04268)} ${transformCoord(35.4013)} ${transformY(152405e-9)} ${transformCoord(37.3496)} ${transformY(0)}ZM${transformCoord(41.0615)} ${transformY(9.17578)}C${transformCoord(40.1006)} ${transformY(10.1057)} ${transformCoord(38.793)} ${transformY(10.6797)} ${transformCoord(37.3496)} ${transformY(10.6797)}C${transformCoord(35.9064)} ${transformY(10.6796)} ${transformCoord(34.5985)} ${transformY(10.1066)} ${transformCoord(33.6377)} ${transformY(9.17676)}C${transformCoord(32.9511)} ${transformY(10.3241)} ${transformCoord(31.8358)} ${transformY(11.2176)} ${transformCoord(30.4404)} ${transformY(11.5898)}C${transformCoord(29.0527)} ${transformY(11.9661)} ${transformCoord(27.6436)} ${transformY(11.7542)} ${transformCoord(26.4766)} ${transformY(11.1074)}C${transformCoord(26.1072)} ${transformY(12.3879)} ${transformCoord(25.2629)} ${transformY(13.5333)} ${transformCoord(24.0195)} ${transformY(14.25)}C${transformCoord(22.7695)} ${transformY(14.9754)} ${transformCoord(21.347)} ${transformY(15.1322)} ${transformCoord(20.0479)} ${transformY(14.8047)}C${transformCoord(20.0289)} ${transformY(16.1454)} ${transformCoord(19.5108)} ${transformY(17.4793)} ${transformCoord(18.4902)} ${transformY(18.5)}C${transformCoord(17.4696)} ${transformY(19.5158)} ${transformCoord(16.1409)} ${transformY(20.033)} ${transformCoord(14.8066)} ${transformY(20.0566)}C${transformCoord(15.1312)} ${transformY(21.3534)} ${transformCoord(14.9738)} ${transformY(22.7723)} ${transformCoord(14.25)} ${transformY(24.0195)}C${transformCoord(13.5243)} ${transformY(25.2699)} ${transformCoord(12.3701)} ${transformY(26.1148)} ${transformCoord(11.082)} ${transformY(26.4795)}C${transformCoord(11.7347)} ${transformY(27.6479)} ${transformCoord(11.9529)} ${transformY(29.062)} ${transformCoord(11.5801)} ${transformY(30.46)}C${transformCoord(11.2085)} ${transformY(31.8485)} ${transformCoord(10.3194)} ${transformY(32.9607)} ${transformCoord(9.17578)} ${transformY(33.6475)}C${transformCoord(10.106)} ${transformY(34.6084)} ${transformCoord(10.6797)} ${transformY(35.9167)} ${transformCoord(10.6797)} ${transformY(37.3604)}C${transformCoord(10.6796)} ${transformY(38.805)} ${transformCoord(10.1053)} ${transformY(40.1141)} ${transformCoord(9.17383)} ${transformY(41.0752)}C${transformCoord(10.3132)} ${transformY(41.7614)} ${transformCoord(11.1999)} ${transformY(42.871)} ${transformCoord(11.5703)} ${transformY(44.2598)}C${transformCoord(11.946)} ${transformY(45.6504)} ${transformCoord(11.7335)} ${transformY(47.0592)} ${transformCoord(11.0889)} ${transformY(48.2266)}C${transformCoord(12.377)} ${transformY(48.593)} ${transformCoord(13.5297)} ${transformY(49.441)} ${transformCoord(14.25)} ${transformY(50.6904)}C${transformCoord(14.9754)} ${transformY(51.9405)} ${transformCoord(15.1322)} ${transformY(53.3629)} ${transformCoord(14.8047)} ${transformY(54.6621)}C${transformCoord(16.142)} ${transformY(54.6835)} ${transformCoord(17.4721)} ${transformY(55.2016)} ${transformCoord(18.4902)} ${transformY(56.2197)}C${transformCoord(19.5097)} ${transformY(57.2441)} ${transformCoord(20.0278)} ${transformY(58.5787)} ${transformCoord(20.0479)} ${transformY(59.918)}C${transformCoord(21.3469)} ${transformY(59.5917)} ${transformCoord(22.7696)} ${transformY(59.7493)} ${transformCoord(24.0195)} ${transformY(60.4697)}C${transformCoord(25.2676)} ${transformY(61.1892)} ${transformCoord(26.1117)} ${transformY(62.3406)} ${transformCoord(26.4775)} ${transformY(63.627)}C${transformCoord(27.6424)} ${transformY(62.9822)} ${transformCoord(29.0498)} ${transformY(62.7688)} ${transformCoord(30.4404)} ${transformY(63.1396)}C${transformCoord(31.8284)} ${transformY(63.5112)} ${transformCoord(32.9402)} ${transformY(64.3999)} ${transformCoord(33.627)} ${transformY(65.543)}C${transformCoord(34.5887)} ${transformY(64.6072)} ${transformCoord(35.9012)} ${transformY(64.0304)} ${transformCoord(37.3496)} ${transformY(64.0303)}C${transformCoord(38.7912)} ${transformY(64.0303)} ${transformCoord(40.098)} ${transformY(64.6023)} ${transformCoord(41.0586)} ${transformY(65.5303)}C${transformCoord(41.7458)} ${transformY(64.3887)} ${transformCoord(42.8594)} ${transformY(63.5007)} ${transformCoord(44.25)} ${transformY(63.1299)}C${transformCoord(45.643)} ${transformY(62.7522)} ${transformCoord(47.057)} ${transformY(62.9676)} ${transformCoord(48.2266)} ${transformY(63.6201)}C${transformCoord(48.5931)} ${transformY(62.3323)} ${transformCoord(49.4413)} ${transformY(61.1801)} ${transformCoord(50.6904)} ${transformY(60.46)}C${transformCoord(51.9373)} ${transformY(59.7364)} ${transformCoord(53.3558)} ${transformY(59.5781)} ${transformCoord(54.6523)} ${transformY(59.9023)}C${transformCoord(54.6744)} ${transformY(58.5659)} ${transformCoord(55.1925)} ${transformY(57.2372)} ${transformCoord(56.21)} ${transformY(56.2197)}C${transformCoord(57.2339)} ${transformY(55.2007)} ${transformCoord(58.5676)} ${transformY(54.6816)} ${transformCoord(59.9062)} ${transformY(54.6611)}C${transformCoord(59.5835)} ${transformY(53.3649)} ${transformCoord(59.7414)} ${transformY(51.9468)} ${transformCoord(60.46)} ${transformY(50.7002)}C${transformCoord(61.1797)} ${transformY(49.4517)} ${transformCoord(62.3312)} ${transformY(48.6068)} ${transformCoord(63.6182)} ${transformY(48.2412)}C${transformCoord(62.9651)} ${transformY(47.0726)} ${transformCoord(62.7473)} ${transformY(45.658)} ${transformCoord(63.1201)} ${transformY(44.2598)}C${transformCoord(63.4916)} ${transformY(42.8718)} ${transformCoord(64.3794)} ${transformY(41.7591)} ${transformCoord(65.5225)} ${transformY(41.0723)}C${transformCoord(64.5929)} ${transformY(40.1115)} ${transformCoord(64.0206)} ${transformY(38.8033)} ${transformCoord(64.0205)} ${transformY(37.3604)}C${transformCoord(64.0205)} ${transformY(35.9186)} ${transformCoord(64.5915)} ${transformY(34.611)} ${transformCoord(65.5195)} ${transformY(33.6504)}C${transformCoord(64.3785)} ${transformY(32.9631)} ${transformCoord(63.4908)} ${transformY(31.8501)} ${transformCoord(63.1201)} ${transformY(30.46)}C${transformCoord(62.7421)} ${transformY(29.0656)} ${transformCoord(62.9572)} ${transformY(27.6498)} ${transformCoord(63.6113)} ${transformY(26.4795)}C${transformCoord(62.3272)} ${transformY(26.1115)} ${transformCoord(61.1784)} ${transformY(25.2657)} ${transformCoord(60.46)} ${transformY(24.0195)}C${transformCoord(59.7364)} ${transformY(22.7727)} ${transformCoord(59.5781)} ${transformY(21.3541)} ${transformCoord(59.9023)} ${transformY(20.0576)}C${transformCoord(58.5626)} ${transformY(20.038)} ${transformCoord(57.23)} ${transformY(19.52)} ${transformCoord(56.21)} ${transformY(18.5)}C${transformCoord(55.1931)} ${transformY(17.4783)} ${transformCoord(54.675)} ${transformY(16.1482)} ${transformCoord(54.6523)} ${transformY(14.8125)}C${transformCoord(53.3557)} ${transformY(15.1357)} ${transformCoord(51.9374)} ${transformY(14.9785)} ${transformCoord(50.6904)} ${transformY(14.2598)}C${transformCoord(49.4399)} ${transformY(13.5339)} ${transformCoord(48.5931)} ${transformY(12.3801)} ${transformCoord(48.2285)} ${transformY(11.0918)}C${transformCoord(47.0603)} ${transformY(11.7439)} ${transformCoord(45.6474)} ${transformY(11.9624)} ${transformCoord(44.25)} ${transformY(11.5898)}V${transformY(11.5801)}C${transformCoord(42.8613)} ${transformY(11.2085)} ${transformCoord(41.7483)} ${transformY(10.3196)} ${transformCoord(41.0615)} ${transformY(9.17578)}Z`;
1456
+ return path;
1457
+ }
1458
+ function generateCornerDiyaPattern(offsetX, offsetY, size) {
1459
+ const scale = size / 80;
1460
+ const transform = (coord, offset) => coord * scale + offset;
1461
+ const path = `M ${transform(5, offsetX)} ${transform(30, offsetY)}v ${20 * scale}a ${25 * scale} ${25 * scale}, 0, 0, 0, ${25 * scale} ${25 * scale}h ${45 * scale}v -${45 * scale}a ${25 * scale} ${25 * scale}, 0, 0, 0, -${25 * scale} -${25 * scale}h -${20 * scale}H ${transform(5, offsetX)}zM ${transform(30, offsetX)} ${transform(15, offsetY)}h ${20 * scale}a ${15 * scale} ${15 * scale}, 0, 0, 1, ${15 * scale} ${15 * scale}v ${35 * scale}h -${35 * scale}a ${15 * scale} ${15 * scale}, 0, 0, 1, -${15 * scale} -${15 * scale}v -${35 * scale}z`;
1462
+ return path;
1463
+ }
1464
+ function generateCornerExtraRoundedPattern(offsetX, offsetY, size) {
1465
+ const m2 = size / 7;
1466
+ const r = m2 * 1.5;
1467
+ const r2 = m2 * 0.75;
1468
+ const outer = `M ${offsetX + r} ${offsetY}h ${size - 2 * r}a ${r} ${r} 0 0 1 ${r} ${r}v ${size - 2 * r}a ${r} ${r} 0 0 1 ${-r} ${r}h ${-(size - 2 * r)}a ${r} ${r} 0 0 1 ${-r} ${-r}v ${-(size - 2 * r)}a ${r} ${r} 0 0 1 ${r} ${-r}z`;
1469
+ const inner = `M ${offsetX + m2 + r2} ${offsetY + m2}h ${5 * m2 - 2 * r2}a ${r2} ${r2} 0 0 1 ${r2} ${r2}v ${5 * m2 - 2 * r2}a ${r2} ${r2} 0 0 1 ${-r2} ${r2}h ${-(5 * m2 - 2 * r2)}a ${r2} ${r2} 0 0 1 ${-r2} ${-r2}v ${-(5 * m2 - 2 * r2)}a ${r2} ${r2} 0 0 1 ${r2} ${-r2}z`;
1470
+ return outer + inner;
1471
+ }
1472
+ function generateCornerMessagePattern(offsetX, offsetY, size) {
1473
+ const scale = size / 80;
1474
+ const transform = (coord, offset) => coord * scale + offset;
1475
+ const path = `M ${transform(5, offsetX)} ${transform(40, offsetY)}a ${35 * scale} ${35 * scale}, 0, 0, 0, ${35 * scale} ${35 * scale}h ${30 * scale}a ${5 * scale} ${5 * scale}, 0, 0, 0, ${5 * scale} -${5 * scale}v -${30 * scale}a ${35 * scale} ${35 * scale}, 0, 0, 0, -${35 * scale} -${35 * scale}a ${35 * scale} ${35 * scale}, 0, 0, 0, -${35 * scale} ${35 * scale}zM ${transform(40, offsetX)} ${transform(15, offsetY)}a ${25 * scale} ${25 * scale}, 0, 0, 1, ${25 * scale} ${25 * scale}v ${25 * scale}h -${25 * scale}a ${25 * scale} ${25 * scale}, 0, 0, 1, -${25 * scale} -${25 * scale}a ${25 * scale} ${25 * scale}, 0, 0, 1, ${25 * scale} -${25 * scale}z`;
1476
+ return path;
1477
+ }
1478
+ function generateCornerPointyPattern(offsetX, offsetY, size) {
1479
+ const scale = size / 80;
1480
+ const transform = (coord, offset) => coord * scale + offset;
1481
+ const path = `M ${transform(5, offsetX)} ${transform(30, offsetY)}v ${20 * scale}a ${25 * scale} ${25 * scale}, 0, 0, 0, ${25 * scale} ${25 * scale}h ${45 * scale}v -${45 * scale}a ${25 * scale} ${25 * scale}, 0, 0, 0, -${25 * scale} -${25 * scale}h -${20 * scale}a ${25 * scale} ${25 * scale}, 0, 0, 0, -${25 * scale} ${25 * scale}M ${transform(30, offsetX)} ${transform(15, offsetY)}h ${20 * scale}a ${15 * scale} ${15 * scale}, 0, 0, 1, ${15 * scale} ${15 * scale}v ${35 * scale}h -${35 * scale}a ${15 * scale} ${15 * scale}, 0, 0, 1, -${15 * scale} -${15 * scale}v -${20 * scale}a ${15 * scale} ${15 * scale}, 0, 0, 1, ${15 * scale} -${15 * scale}z`;
1482
+ return path;
1483
+ }
1484
+ function generateCornerCurlyPattern(offsetX, offsetY, size) {
1485
+ const scale = size / 70;
1486
+ const centerOffsetX = offsetX + size / 2 - 40 * scale;
1487
+ const centerOffsetY = offsetY + size / 2 - 40 * scale;
1488
+ const transform = (coord, offset) => coord * scale + offset;
1489
+ const path = `M${transform(35.19239999999999, centerOffsetX)} ${transform(5.837547376725838, centerOffsetY)}C${transform(37.69667692307692, centerOffsetX)} ${transform(3.8737070690335305, centerOffsetY)}, ${transform(41.218430769230764, centerOffsetX)} ${transform(3.8737092228796843, centerOffsetY)}, ${transform(43.722707692307694, centerOffsetX)} ${transform(5.837547376725838, centerOffsetY)}L${transform(46.62781538461539, centerOffsetX)} ${transform(8.115648915187375, centerOffsetY)}L${transform(50.23356923076923, centerOffsetX)} ${transform(7.32361506903353, centerOffsetY)}C${transform(53.342, centerOffsetX)} ${transform(6.640824299802762, centerOffsetY)}, ${transform(56.51483076923077, centerOffsetX)} ${transform(8.168784299802759, centerOffsetY)}, ${transform(57.91892307692308, centerOffsetX)} ${transform(11.024719684418145, centerOffsetY)}L${transform(59.54787692307692, centerOffsetX)} ${transform(14.337679684418145, centerOffsetY)}L${transform(63.14027692307692, centerOffsetX)} ${transform(15.188578145956608, centerOffsetY)}C${transform(66.23707692307693, centerOffsetX)} ${transform(15.922091992110452, centerOffsetY)}, ${transform(68.43270769230769, centerOffsetX)} ${transform(18.675396607495067, centerOffsetY)}, ${transform(68.45876923076924, centerOffsetX)} ${transform(21.857768915187375, centerOffsetY)}L${transform(68.48892307692307, centerOffsetX)} ${transform(25.54931045364891, centerOffsetY)}L${transform(71.35633846153846, centerOffsetX)} ${transform(27.874602761341222, centerOffsetY)}C${transform(73.82830769230769, centerOffsetX)} ${transform(29.879187376725838, centerOffsetY)}, ${transform(74.61187692307692, centerOffsetX)} ${transform(33.312418145956606, centerOffsetY)}, ${transform(73.25452307692306, centerOffsetX)} ${transform(36.19103353057199, centerOffsetY)}L${transform(71.68006153846153, centerOffsetX)} ${transform(39.530141222879685, centerOffsetY)}L${transform(73.25452307692306, centerOffsetX)} ${transform(42.86924891518738, centerOffsetY)}C${transform(74.61187692307692, centerOffsetX)} ${transform(45.747864299802764, centerOffsetY)}, ${transform(73.82830769230769, centerOffsetX)} ${transform(49.18109506903353, centerOffsetY)}, ${transform(71.35633846153846, centerOffsetX)} ${transform(51.18567968441815, centerOffsetY)}L${transform(68.48892307692307, centerOffsetX)} ${transform(53.510971992110456, centerOffsetY)}L${transform(68.45876923076924, centerOffsetX)} ${transform(57.202664299802755, centerOffsetY)}C${transform(68.43270769230769, centerOffsetX)} ${transform(60.38497199211046, centerOffsetY)}, ${transform(66.23707692307693, centerOffsetX)} ${transform(63.13823353057199, centerOffsetY)}, ${transform(63.14027692307692, centerOffsetX)} ${transform(63.871833530572, centerOffsetY)}L${transform(59.54787692307692, centerOffsetX)} ${transform(64.72260276134121, centerOffsetY)}L${transform(57.91892307692308, centerOffsetX)} ${transform(68.03564891518737, centerOffsetY)}C${transform(56.51483076923077, centerOffsetX)} ${transform(70.89164891518737, centerOffsetY)}, ${transform(53.342, centerOffsetX)} ${transform(72.41958737672583, centerOffsetY)}, ${transform(50.23356923076923, centerOffsetX)} ${transform(71.7368181459566, centerOffsetY)}L${transform(46.62781538461539, centerOffsetX)} ${transform(70.94463353057199, centerOffsetY)}L${transform(43.722707692307694, centerOffsetX)} ${transform(73.22275660749506, centerOffsetY)}C${transform(41.218430769230764, centerOffsetX)} ${transform(75.18663353057198, centerOffsetY)}, ${transform(37.69667692307692, centerOffsetX)} ${transform(75.18663353057198, centerOffsetY)}, ${transform(35.19239999999999, centerOffsetX)} ${transform(73.22275660749506, centerOffsetY)}L${transform(32.28729230769231, centerOffsetX)} ${transform(70.94463353057199, centerOffsetY)}L${transform(28.68153846153846, centerOffsetX)} ${transform(71.7368181459566, centerOffsetY)}C${transform(25.573215384615384, centerOffsetX)} ${transform(72.41958737672583, centerOffsetY)}, ${transform(22.400384615384613, centerOffsetX)} ${transform(70.89164891518737, centerOffsetY)}, ${transform(20.996141538461536, centerOffsetX)} ${transform(68.03564891518737, centerOffsetY)}L${transform(19.36720923076923, centerOffsetX)} ${transform(64.72260276134121, centerOffsetY)}L${transform(15.774852307692306, centerOffsetX)} ${transform(63.871833530572, centerOffsetY)}C${transform(12.67803076923077, centerOffsetX)} ${transform(63.13823353057199, centerOffsetY)}, ${transform(10.48237846153846, centerOffsetX)} ${transform(60.38497199211046, centerOffsetY)}, ${transform(10.45636, centerOffsetX)} ${transform(57.202664299802755, centerOffsetY)}L${transform(10.426163076923077, centerOffsetX)} ${transform(53.510971992110456, centerOffsetY)}L${transform(7.558747692307692, centerOffsetX)} ${transform(51.18567968441815, centerOffsetY)}C${transform(5.086880338461539, centerOffsetX)} ${transform(49.18109506903353, centerOffsetY)}, ${transform(4.303258769230769, centerOffsetX)} ${transform(45.747864299802764, centerOffsetY)}, ${transform(5.660599692307692, centerOffsetX)} ${transform(42.86924891518738, centerOffsetY)}L${transform(7.235153846153846, centerOffsetX)} ${transform(39.530141222879685, centerOffsetY)}L${transform(5.660599692307692, centerOffsetX)} ${transform(36.19103353057199, centerOffsetY)}C${transform(4.3032566153846155, centerOffsetX)} ${transform(33.312418145956606, centerOffsetY)}, ${transform(5.086885938461538, centerOffsetX)} ${transform(29.879187376725838, centerOffsetY)}, ${transform(7.558747692307692, centerOffsetX)} ${transform(27.874602761341222, centerOffsetY)}L${transform(10.426163076923077, centerOffsetX)} ${transform(25.54931045364891, centerOffsetY)}L${transform(10.45636, centerOffsetX)} ${transform(21.857768915187375, centerOffsetY)}C${transform(10.48237846153846, centerOffsetX)} ${transform(18.67537506903353, centerOffsetY)}, ${transform(12.678052307692308, centerOffsetX)} ${transform(15.922091992110452, centerOffsetY)}, ${transform(15.774852307692306, centerOffsetX)} ${transform(15.188578145956608, centerOffsetY)}L${transform(19.36720923076923, centerOffsetX)} ${transform(14.337679684418145, centerOffsetY)}L${transform(20.996141538461536, centerOffsetX)} ${transform(11.024719684418145, centerOffsetY)}C${transform(22.400384615384613, centerOffsetX)} ${transform(8.168784299802759, centerOffsetY)}, ${transform(25.573215384615384, centerOffsetX)} ${transform(6.640824299802762, centerOffsetY)}, ${transform(28.68153846153846, centerOffsetX)} ${transform(7.32361506903353, centerOffsetY)}L${transform(32.28729230769231, centerOffsetX)} ${transform(8.115648915187375, centerOffsetY)}L${transform(35.19239999999999, centerOffsetX)} ${transform(5.837547376725838, centerOffsetY)}M${transform(39.45766153846154, centerOffsetX)} ${transform(13.665055069033532, centerOffsetY)}L${transform(37.01498461538461, centerOffsetX)} ${transform(15.58053506903353, centerOffsetY)}C${transform(35.39098461538461, centerOffsetX)} ${transform(16.854061222879682, centerOffsetY)}, ${transform(33.282799999999995, centerOffsetX)} ${transform(17.335251992110454, centerOffsetY)}, ${transform(31.26701538461538, centerOffsetX)} ${transform(16.892464299802757, centerOffsetY)}L${transform(28.235046153846152, centerOffsetX)} ${transform(16.22649506903353, centerOffsetY)}L${transform(26.865415384615382, centerOffsetX)} ${transform(19.012107376725837, centerOffsetY)}C${transform(25.954812307692308, centerOffsetX)} ${transform(20.864178145956608, centerOffsetY)}, ${transform(24.264193846153844, centerOffsetX)} ${transform(22.212399684418145, centerOffsetY)}, ${transform(22.255926153846154, centerOffsetX)} ${transform(22.688076607495066, centerOffsetY)}L${transform(19.235393846153844, centerOffsetX)} ${transform(23.40354122287968, centerOffsetY)}L${transform(19.21, centerOffsetX)} ${transform(26.507556607495065, centerOffsetY)}C${transform(19.19313538461538, centerOffsetX)} ${transform(28.57137199211045, centerOffsetY)}, ${transform(18.25492, centerOffsetX)} ${transform(30.519525838264297, centerOffsetY)}, ${transform(16.651919999999997, centerOffsetX)} ${transform(31.81937199211045, centerOffsetY)}L${transform(14.240926153846154, centerOffsetX)} ${transform(33.774633530572, centerOffsetY)}L${transform(15.564830769230769, centerOffsetX)} ${transform(36.58238737672584, centerOffsetY)}C${transform(16.445064615384617, centerOffsetX)} ${transform(38.44891045364892, centerOffsetY)}, ${transform(16.445064615384617, centerOffsetX)} ${transform(40.611371992110456, centerOffsetY)}, ${transform(15.564830769230769, centerOffsetX)} ${transform(42.47811045364892, centerOffsetY)}L${transform(14.240926153846154, centerOffsetX)} ${transform(45.28564891518738, centerOffsetY)}L${transform(16.651919999999997, centerOffsetX)} ${transform(47.240910453648915, centerOffsetY)}L${transform(13.883236923076923, centerOffsetX)} ${transform(50.654971992110454, centerOffsetY)}L${transform(16.651919999999997, centerOffsetX)} ${transform(47.240910453648915, centerOffsetY)}C${transform(18.25492, centerOffsetX)} ${transform(48.54075660749507, centerOffsetY)}, ${transform(19.19313538461538, centerOffsetX)} ${transform(50.4891258382643, centerOffsetY)}, ${transform(19.21, centerOffsetX)} ${transform(52.5527258382643, centerOffsetY)}L${transform(19.235393846153844, centerOffsetX)} ${transform(55.65684891518738, centerOffsetY)}L${transform(22.255926153846154, centerOffsetX)} ${transform(56.37235660749507, centerOffsetY)}C${transform(24.264193846153844, centerOffsetX)} ${transform(56.847925838264295, centerOffsetY)}, ${transform(25.954812307692308, centerOffsetX)} ${transform(58.196233530571995, centerOffsetY)}, ${transform(26.865415384615382, centerOffsetX)} ${transform(60.0483258382643, centerOffsetY)}L${transform(28.235046153846152, centerOffsetX)} ${transform(62.833895069033524, centerOffsetY)}L${transform(31.26701538461538, centerOffsetX)} ${transform(62.1679258382643, centerOffsetY)}C${transform(33.282799999999995, centerOffsetX)} ${transform(61.72509506903353, centerOffsetY)}, ${transform(35.39098461538461, centerOffsetX)} ${transform(62.20626429980276, centerOffsetY)}, ${transform(37.01498461538461, centerOffsetX)} ${transform(63.47983353057199, centerOffsetY)}L${transform(39.45766153846154, centerOffsetX)} ${transform(65.39524891518737, centerOffsetY)}L${transform(41.90012307692308, centerOffsetX)} ${transform(63.47983353057199, centerOffsetY)}C${transform(43.524123076923075, centerOffsetX)} ${transform(62.20626429980276, centerOffsetY)}, ${transform(45.632307692307684, centerOffsetX)} ${transform(61.72509506903353, centerOffsetY)}, ${transform(47.6480923076923, centerOffsetX)} ${transform(62.1679258382643, centerOffsetY)}L${transform(50.68006153846154, centerOffsetX)} ${transform(62.833895069033524, centerOffsetY)}L${transform(52.049692307692304, centerOffsetX)} ${transform(60.0483258382643, centerOffsetY)}C${transform(52.960338461538456, centerOffsetX)} ${transform(58.196233530571995, centerOffsetY)}, ${transform(54.6508923076923, centerOffsetX)} ${transform(56.847925838264295, centerOffsetY)}, ${transform(56.65913846153846, centerOffsetX)} ${transform(56.37235660749507, centerOffsetY)}L${transform(59.67969230769231, centerOffsetX)} ${transform(55.65684891518738, centerOffsetY)}L${transform(59.70510769230769, centerOffsetX)} ${transform(52.5527258382643, centerOffsetY)}C${transform(59.72190769230769, centerOffsetX)} ${transform(50.4891258382643, centerOffsetY)}, ${transform(60.66012307692307, centerOffsetX)} ${transform(48.54075660749507, centerOffsetY)}, ${transform(62.263230769230766, centerOffsetX)} ${transform(47.240910453648915, centerOffsetY)}L${transform(64.67424615384616, centerOffsetX)} ${transform(45.28564891518738, centerOffsetY)}L${transform(63.35027692307692, centerOffsetX)} ${transform(42.47811045364892, centerOffsetY)}C${transform(62.47, centerOffsetX)} ${transform(40.611371992110456, centerOffsetY)}, ${transform(62.47, centerOffsetX)} ${transform(38.44891045364892, centerOffsetY)}, ${transform(63.35027692307692, centerOffsetX)} ${transform(36.58238737672584, centerOffsetY)}L${transform(64.67424615384616, centerOffsetX)} ${transform(33.774633530572, centerOffsetY)}L${transform(62.263230769230766, centerOffsetX)} ${transform(31.81958737672584, centerOffsetY)}C${transform(60.66012307692307, centerOffsetX)} ${transform(30.519525838264297, centerOffsetY)}, ${transform(59.72190769230769, centerOffsetX)} ${transform(28.57137199211045, centerOffsetY)}, ${transform(59.70510769230769, centerOffsetX)} ${transform(26.507556607495065, centerOffsetY)}L${transform(59.67969230769231, centerOffsetX)} ${transform(23.40354122287968, centerOffsetY)}L${transform(56.65913846153846, centerOffsetX)} ${transform(22.688076607495066, centerOffsetY)}C${transform(54.6508923076923, centerOffsetX)} ${transform(22.212399684418145, centerOffsetY)}, ${transform(52.960338461538456, centerOffsetX)} ${transform(20.864178145956608, centerOffsetY)}, ${transform(52.049692307692304, centerOffsetX)} ${transform(19.012128915187375, centerOffsetY)}L${transform(50.68006153846154, centerOffsetX)} ${transform(16.22649506903353, centerOffsetY)}L${transform(47.6480923076923, centerOffsetX)} ${transform(16.892464299802757, centerOffsetY)}C${transform(45.632307692307684, centerOffsetX)} ${transform(17.335251992110454, centerOffsetY)}, ${transform(43.524338461538456, centerOffsetX)} ${transform(16.85408276134122, centerOffsetY)}, ${transform(41.90012307692308, centerOffsetX)} ${transform(15.58053506903353, centerOffsetY)}L${transform(39.45766153846154, centerOffsetX)} ${transform(13.665055069033532, centerOffsetY)}Z`;
1490
+ return path;
1491
+ }
1492
+ function generateCornerSquarePath(offsetX, offsetY, size, pattern) {
1493
+ switch (pattern) {
1494
+ case "gear":
1495
+ return generateCornerGearPattern(offsetX, offsetY, size);
1496
+ case "rounded":
1497
+ return generateCornerRoundedPattern(offsetX, offsetY, size);
1498
+ case "circle":
1499
+ return generateCornerCirclePattern(offsetX, offsetY, size);
1500
+ case "diya":
1501
+ return generateCornerDiyaPattern(offsetX, offsetY, size);
1502
+ case "extra-rounded":
1503
+ return generateCornerExtraRoundedPattern(offsetX, offsetY, size);
1504
+ case "message":
1505
+ return generateCornerMessagePattern(offsetX, offsetY, size);
1506
+ case "pointy":
1507
+ return generateCornerPointyPattern(offsetX, offsetY, size);
1508
+ case "curly":
1509
+ return generateCornerCurlyPattern(offsetX, offsetY, size);
1510
+ default:
1511
+ return generateCornerSquarePattern(offsetX, offsetY, size);
1512
+ }
1513
+ }
1514
+ var init_corner_eye = __esm({
1515
+ "src/corner-eye.ts"() {
1516
+ }
1517
+ });
1518
+ var Arrow;
1519
+ var init_arrow = __esm({
1520
+ "src/template/arrow.tsx"() {
1521
+ Arrow = {
1522
+ id: "Arrow",
1523
+ name: "Arrow",
1524
+ description: "QR code with arrow",
1525
+ wrapper: (children, props) => /* @__PURE__ */ jsxRuntime.jsx(
1526
+ "svg",
1527
+ {
1528
+ height: "300",
1529
+ id: "svgQrWrapper",
1530
+ style: {
1531
+ width: "100%",
1532
+ height: "100%"
1533
+ // backgroundColor: props?.bgColor || "rgb(255, 255, 255)",
1534
+ },
1535
+ viewBox: "0 0 300 300",
1536
+ width: "300",
1537
+ xmlns: "http://www.w3.org/2000/svg",
1538
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
1539
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1540
+ "svg",
1541
+ {
1542
+ fill: "#000000",
1543
+ height: "300",
1544
+ viewBox: "0 0 300 300",
1545
+ width: "300",
1546
+ xmlns: "http://www.w3.org/2000/svg",
1547
+ children: [
1548
+ /* @__PURE__ */ jsxRuntime.jsx(
1549
+ "path",
1550
+ {
1551
+ d: "M73.57,175.23h0c.12-2.06.31-4.19.49-6.25s.48-4.13.85-6.13.79-4,1.27-5.95a30.21,30.21,0,0,1,1.94-5.28h0c.06-.18.13-.43.19-.67a3.55,3.55,0,0,0-2.8-4.19l-.18-.06a1.85,1.85,0,0,0-.54-.06c-.19,0-.31-.06-.49-.06s-.61-.06-.91-.06c-.61,0-1.21.06-1.82.06-1.21.12-2.37.25-3.52.43a62.08,62.08,0,0,0-6.8,1.45,58.45,58.45,0,0,0-6.43,2.31c-1,.42-2.07,1-3.1,1.4s-2,1.09-3,1.57a.76.76,0,0,0,.54,1.4h.07c1.09-.24,2.12-.55,3.15-.79s2.13-.48,3.16-.61A46,46,0,0,1,62,153c1.34-.06,2.73-.06,4.07-.06a62.58,62.58,0,0,0-7.23,10.43,85.58,85.58,0,0,0-6.55,15.36,107.86,107.86,0,0,0-5,32.53,104.06,104.06,0,0,0,5,32.29,90.47,90.47,0,0,0,15.54,28.52.94.94,0,0,0,1.27.19.89.89,0,0,0,.18-1.28h0a87.24,87.24,0,0,1-13.89-28.28A102.85,102.85,0,0,1,58,180.87a82.15,82.15,0,0,1,6.68-14,51.58,51.58,0,0,1,5.71-7.76c0,1.21,0,2.36.06,3.58.12,2.18.24,4.31.48,6.43s.49,4.25.85,6.37a1,1,0,0,0,.91.85A1.37,1.37,0,0,0,73.57,175.23Z",
1552
+ fill: props?.fgColor || "black",
1553
+ id: "CallToActionArrow"
1554
+ }
1555
+ ),
1556
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "none", transform: "translate(82, 95)scale(0.5)", children })
1557
+ ]
1558
+ }
1559
+ )
1560
+ }
1561
+ )
1562
+ };
1563
+ }
1564
+ });
1565
+ var defaultTemplate;
1566
+ var init_default = __esm({
1567
+ "src/template/default.tsx"() {
1568
+ defaultTemplate = {
1569
+ id: "default",
1570
+ name: "Default",
1571
+ description: "Simple QR code without decorative elements",
1572
+ wrapper: (children) => /* @__PURE__ */ jsxRuntime.jsx(
1573
+ "svg",
1574
+ {
1575
+ height: "300",
1576
+ id: "svgQrWrapper",
1577
+ style: {
1578
+ width: "100%",
1579
+ height: "100%"
1580
+ // backgroundColor: props?.bgColor || "rgb(255, 255, 255)",
1581
+ },
1582
+ viewBox: "0 0 300 300",
1583
+ width: "300",
1584
+ xmlns: "http://www.w3.org/2000/svg",
1585
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
1586
+ children: /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "none", transform: "translate(9, 9) scale(0.95)", children })
1587
+ }
1588
+ )
1589
+ };
1590
+ }
1591
+ });
1592
+ var Halloween;
1593
+ var init_halloween = __esm({
1594
+ "src/template/halloween.tsx"() {
1595
+ Halloween = {
1596
+ id: "Halloween",
1597
+ name: "Halloween",
1598
+ description: "QR code with Halloween theme",
1599
+ wrapper: (children) => /* @__PURE__ */ jsxRuntime.jsx(
1600
+ "svg",
1601
+ {
1602
+ height: "300",
1603
+ id: "svgQrWrapper",
1604
+ style: {
1605
+ width: "100%",
1606
+ height: "100%"
1607
+ },
1608
+ viewBox: "0 0 300 300",
1609
+ width: "300",
1610
+ xmlns: "http://www.w3.org/2000/svg",
1611
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
1612
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1613
+ "svg",
1614
+ {
1615
+ fill: "none",
1616
+ height: "300",
1617
+ viewBox: "0 0 300 300",
1618
+ width: "300",
1619
+ xmlns: "http://www.w3.org/2000/svg",
1620
+ children: /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(10, 10)", children: [
1621
+ /* @__PURE__ */ jsxRuntime.jsx(
1622
+ "circle",
1623
+ {
1624
+ cx: "138",
1625
+ cy: "167.682",
1626
+ fill: "white",
1627
+ r: "99.3177",
1628
+ stroke: "#F89941",
1629
+ strokeWidth: "20"
1630
+ }
1631
+ ),
1632
+ /* @__PURE__ */ jsxRuntime.jsx(
1633
+ "rect",
1634
+ {
1635
+ fill: "url(#pattern0)",
1636
+ height: "110.806",
1637
+ width: "113",
1638
+ x: "81.0001",
1639
+ y: "124.097"
1640
+ }
1641
+ ),
1642
+ /* @__PURE__ */ jsxRuntime.jsx(
1643
+ "ellipse",
1644
+ {
1645
+ cx: "167.989",
1646
+ cy: "67.8947",
1647
+ fill: "#F89941",
1648
+ rx: "35.4453",
1649
+ ry: "48.4419"
1650
+ }
1651
+ ),
1652
+ /* @__PURE__ */ jsxRuntime.jsx(
1653
+ "path",
1654
+ {
1655
+ d: "M187.937 69.0763C187.937 82.6574 184.092 94.8451 178.005 103.57C171.912 112.304 163.736 117.381 154.992 117.381C146.247 117.381 138.072 112.304 131.979 103.57C125.891 94.8451 122.047 82.6574 122.047 69.0763C122.047 55.4952 125.891 43.3075 131.979 34.5823C138.072 25.8486 146.247 20.7714 154.992 20.7714C163.736 20.7714 171.912 25.8486 178.005 34.5823C184.092 43.3075 187.937 55.4952 187.937 69.0763Z",
1656
+ fill: "#F89941",
1657
+ stroke: "#E78249",
1658
+ strokeWidth: "5"
1659
+ }
1660
+ ),
1661
+ /* @__PURE__ */ jsxRuntime.jsx(
1662
+ "ellipse",
1663
+ {
1664
+ cx: "154.072",
1665
+ cy: "69.4866",
1666
+ fill: "#F89941",
1667
+ rx: "34.0512",
1668
+ ry: "50.6615"
1669
+ }
1670
+ ),
1671
+ /* @__PURE__ */ jsxRuntime.jsx(
1672
+ "path",
1673
+ {
1674
+ d: "M171.396 69.667C171.396 82.7394 167.562 94.4717 161.488 102.874C155.412 111.279 147.235 116.2 138.451 116.2C129.666 116.2 121.489 111.279 115.413 102.874C109.34 94.4717 105.506 82.7394 105.506 69.667C105.506 56.5946 109.34 44.8624 115.413 36.4603C121.489 28.0551 129.666 23.1344 138.451 23.1344C147.235 23.1344 155.412 28.0551 161.488 36.4603C167.562 44.8624 171.396 56.5946 171.396 69.667Z",
1675
+ fill: "#F89941",
1676
+ stroke: "#E78249",
1677
+ strokeWidth: "5"
1678
+ }
1679
+ ),
1680
+ /* @__PURE__ */ jsxRuntime.jsx(
1681
+ "ellipse",
1682
+ {
1683
+ cx: "134.316",
1684
+ cy: "70.8486",
1685
+ fill: "#F89941",
1686
+ rx: "33.673",
1687
+ ry: "47.8511"
1688
+ }
1689
+ ),
1690
+ /* @__PURE__ */ jsxRuntime.jsx(
1691
+ "ellipse",
1692
+ {
1693
+ fill: "#F89941",
1694
+ rx: "35.4453",
1695
+ ry: "48.4419",
1696
+ transform: "matrix(-1 0 0 1 106.743 68.4484)"
1697
+ }
1698
+ ),
1699
+ /* @__PURE__ */ jsxRuntime.jsx(
1700
+ "path",
1701
+ {
1702
+ d: "M86.7942 69.6299C86.7942 83.2111 90.6388 95.3988 96.7262 104.124C102.819 112.858 110.995 117.935 119.739 117.935C128.484 117.935 136.659 112.858 142.753 104.124C148.84 95.3988 152.685 83.2111 152.685 69.6299C152.685 56.0488 148.84 43.8611 142.753 35.1359C136.659 26.4023 128.484 21.3251 119.739 21.3251C110.995 21.3251 102.819 26.4023 96.7262 35.1359C90.6388 43.8611 86.7942 56.0488 86.7942 69.6299Z",
1703
+ fill: "#F89941",
1704
+ stroke: "#E78249",
1705
+ strokeWidth: "5"
1706
+ }
1707
+ ),
1708
+ /* @__PURE__ */ jsxRuntime.jsx(
1709
+ "ellipse",
1710
+ {
1711
+ fill: "#F89941",
1712
+ rx: "32.9438",
1713
+ ry: "50.3847",
1714
+ transform: "matrix(-1 0 0 1 119.744 69.7634)"
1715
+ }
1716
+ ),
1717
+ /* @__PURE__ */ jsxRuntime.jsx(
1718
+ "path",
1719
+ {
1720
+ d: "M103.335 70.2207C103.335 83.293 107.169 95.0253 113.243 103.427C119.319 111.833 127.496 116.753 136.281 116.753C145.065 116.753 153.242 111.833 159.318 103.427C165.392 95.0253 169.226 83.293 169.226 70.2207C169.226 57.1483 165.392 45.416 159.318 37.014C153.242 28.6088 145.065 23.688 136.281 23.688C127.496 23.688 119.319 28.6088 113.243 37.014C107.169 45.416 103.335 57.1483 103.335 70.2207Z",
1721
+ fill: "#F89941",
1722
+ stroke: "#E78249",
1723
+ strokeWidth: "5"
1724
+ }
1725
+ ),
1726
+ /* @__PURE__ */ jsxRuntime.jsx(
1727
+ "ellipse",
1728
+ {
1729
+ fill: "#F89941",
1730
+ rx: "32.3901",
1731
+ ry: "47.6163",
1732
+ transform: "matrix(-1 0 0 1 139.677 70.8708)"
1733
+ }
1734
+ ),
1735
+ /* @__PURE__ */ jsxRuntime.jsx(
1736
+ "ellipse",
1737
+ {
1738
+ fill: "#F89941",
1739
+ rx: "33.2207",
1740
+ ry: "47.6163",
1741
+ transform: "matrix(-1 0 0 1 134.971 71.4245)"
1742
+ }
1743
+ ),
1744
+ /* @__PURE__ */ jsxRuntime.jsx(
1745
+ "path",
1746
+ {
1747
+ d: "M158.85 46.6783C165.21 42.2516 166.538 40.633 167.867 39.0144C167.867 39.0144 169.806 43.8236 169.88 46.3566C169.954 48.8897 169.712 50.1469 167.248 51.6467C164.783 53.1464 155.406 53.0446 150.083 52.9746C149.31 52.5001 150.72 52.3371 158.85 46.6783Z",
1748
+ fill: "black"
1749
+ }
1750
+ ),
1751
+ /* @__PURE__ */ jsxRuntime.jsx(
1752
+ "path",
1753
+ {
1754
+ d: "M115.765 46.5118C109.392 42.1412 108.058 40.5475 106.724 38.9538C106.724 38.9538 104.783 45.8361 104.758 46.822C104.733 47.808 104.657 50.8051 108.247 51.9995C111.837 53.194 119.234 52.7723 124.551 52.7272C125.322 52.2652 123.912 52.0991 115.765 46.5118Z",
1755
+ fill: "black"
1756
+ }
1757
+ ),
1758
+ /* @__PURE__ */ jsxRuntime.jsx(
1759
+ "path",
1760
+ {
1761
+ d: "M160 90.4999C167.156 83.1595 169.5 78.2827 171.351 72.9348C172.24 70.3672 162.909 72.0429 158 72.9348C157.276 73.0664 155.751 76.9145 155 77C154.182 77.0932 151.841 73.0759 151 73.086C149.725 73.1013 147.727 73.086 145.875 73.4285C145.345 74.3645 146.367 77.5746 145.875 78.2827C145.321 78.2827 141.796 77.2604 141.242 76.4298C140.689 74.492 140.949 73.3629 140.118 72.5323C137.555 72.9075 138.023 72.6567 135.412 73.086C134.768 73.1919 133.09 77.7212 132.441 77.8195C131.615 77.9448 128.644 74.0088 127.809 74.1138C126.747 74.2475 124.821 74.4683 123.64 74.577C123.126 74.6244 123.554 77.5019 123.177 78.2827C122.898 78.8616 119.426 77.8921 118.5 77.5C118.037 76.5024 117.844 74.5583 117 74.577C111 74.1138 109.4 73.843 103.575 70.8713C103.575 70.8713 102.5 80 111 89C119.5 98 147.127 103.706 160 90.4999Z",
1762
+ fill: "black"
1763
+ }
1764
+ ),
1765
+ /* @__PURE__ */ jsxRuntime.jsx(
1766
+ "path",
1767
+ {
1768
+ d: "M135.238 7.25181C137.192 1.73111 142.678 0.363204 145.935 0L148.377 1.81602C149.158 2.39714 149.842 2.40909 150.331 3.25657C150.331 4.22511 146.337 5.41975 142.429 6.582C137.545 8.03482 139.482 17.0534 142.429 19.2811C143.401 20.0152 143.524 19.9639 145.966 19.9639C148.029 19.9639 150.387 18.2474 151.566 17.3526C151.566 17.3526 151.861 20.2573 149.798 21.4777C147.735 22.698 143.578 21.8578 143.608 21.9658C144.493 23.9183 146.89 22.4887 148.029 23.3362C147.346 23.3362 146.556 24.2889 144.198 24.5329C142.672 24.5798 142.135 24.5329 140.956 23.9183C139.777 23.3037 139.482 22.8696 138.893 22.1395C136.83 23.3598 138.893 25.4305 138.893 25.4305C138.893 25.4305 134.472 25.8512 133.587 23.9183C133.264 23.2115 133.882 22.1395 133.587 21.9658C131.819 22.4539 130.935 23.4807 127.373 22.8696C124.312 22.3443 125.102 18.3211 124.451 17.3526C127.381 18.079 125.131 20.0392 129.327 19.9639C140.838 19.7576 132.796 14.1527 135.238 7.25181Z",
1769
+ fill: "#5D725F"
1770
+ }
1771
+ ),
1772
+ /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
1773
+ /* @__PURE__ */ jsxRuntime.jsx(
1774
+ "pattern",
1775
+ {
1776
+ height: "1",
1777
+ id: "pattern0",
1778
+ patternContentUnits: "objectBoundingBox",
1779
+ width: "1"
1780
+ }
1781
+ ),
1782
+ /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_2087_156668", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "white", height: "276", width: "276" }) })
1783
+ ] }),
1784
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "none", transform: "translate(80, 122)scale(0.38)", children })
1785
+ ] })
1786
+ }
1787
+ )
1788
+ }
1789
+ )
1790
+ };
1791
+ }
1792
+ });
1793
+ var SquareBorder;
1794
+ var init_square_border = __esm({
1795
+ "src/template/square-border.tsx"() {
1796
+ SquareBorder = {
1797
+ id: "SquareBorder",
1798
+ name: "Square Border",
1799
+ description: "QR code with square decorative border",
1800
+ wrapper: (children, props) => /* @__PURE__ */ jsxRuntime.jsx(
1801
+ "svg",
1802
+ {
1803
+ height: "300",
1804
+ id: "svgQrWrapper",
1805
+ style: {
1806
+ width: "100%",
1807
+ height: "100%"
1808
+ // backgroundColor: props?.bgColor || "rgb(255, 255, 255)",
1809
+ },
1810
+ viewBox: "0 0 300 300",
1811
+ width: "300",
1812
+ xmlns: "http://www.w3.org/2000/svg",
1813
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
1814
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1815
+ "svg",
1816
+ {
1817
+ fill: "black",
1818
+ height: "300",
1819
+ viewBox: "0 0 316 316",
1820
+ width: "300",
1821
+ xmlns: "http://www.w3.org/2000/svg",
1822
+ children: /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
1823
+ /* @__PURE__ */ jsxRuntime.jsx(
1824
+ "path",
1825
+ {
1826
+ clipRule: "evenodd",
1827
+ d: "M308 8H8v300h300V8ZM0 0v316h316V0H0Z",
1828
+ fill: props?.fgColor || "black",
1829
+ fillRule: "evenodd"
1830
+ }
1831
+ ),
1832
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "none", transform: "translate(20, 20) scale(0.92)", children })
1833
+ ] })
1834
+ }
1835
+ )
1836
+ }
1837
+ )
1838
+ };
1839
+ }
1840
+ });
1841
+ var StandardBox;
1842
+ var init_standard_box = __esm({
1843
+ "src/template/standard-box.tsx"() {
1844
+ StandardBox = {
1845
+ id: "StandardBox",
1846
+ name: "Standard Box",
1847
+ description: "QR code with standard box",
1848
+ wrapper: (children, props) => /* @__PURE__ */ jsxRuntime.jsx(
1849
+ "svg",
1850
+ {
1851
+ height: "300",
1852
+ id: "svgQrWrapper",
1853
+ style: {
1854
+ width: "100%",
1855
+ height: "100%"
1856
+ // backgroundColor: props?.bgColor || "rgb(255, 255, 255)",
1857
+ },
1858
+ viewBox: "0 0 300 300",
1859
+ width: "300",
1860
+ xmlns: "http://www.w3.org/2000/svg",
1861
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
1862
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1863
+ "svg",
1864
+ {
1865
+ fill: "#000000",
1866
+ height: "300",
1867
+ viewBox: "0 0 300 300",
1868
+ width: "300",
1869
+ xmlns: "http://www.w3.org/2000/svg",
1870
+ children: [
1871
+ /* @__PURE__ */ jsxRuntime.jsx(
1872
+ "path",
1873
+ {
1874
+ d: "M243,1.7h-186a10.25,10.25,0,0,0-10.2,10.12v186A10.13,10.13,0,0,0,57,208H243a10.13,10.13,0,0,0,10.12-10.12v-186A10.13,10.13,0,0,0,243,1.7Zm2.36,193.05a5.46,5.46,0,0,1-5.47,5.47H60.16a5.46,5.46,0,0,1-5.47-5.47V14.93a5.46,5.46,0,0,1,5.47-5.47H239.91a5.46,5.46,0,0,1,5.47,5.47Z",
1875
+ fill: props?.fgColor || "black"
1876
+ }
1877
+ ),
1878
+ /* @__PURE__ */ jsxRuntime.jsx(
1879
+ "path",
1880
+ {
1881
+ d: "M243.54,238.81H173.61a2.29,2.29,0,0,1-1.62-.67l-20.55-20.55a2.33,2.33,0,0,0-3.25,0l-20.55,20.55a2.29,2.29,0,0,1-1.62.67H56.09A9.15,9.15,0,0,0,46.93,248v41.17a9.16,9.16,0,0,0,9.16,9.16H243.61a9.09,9.09,0,0,0,9.09-9.16V248A9.16,9.16,0,0,0,243.54,238.81Z",
1882
+ fill: props?.fgColor || "black"
1883
+ }
1884
+ ),
1885
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "none", transform: "translate(60, 15)scale(0.6)", children })
1886
+ ]
1887
+ }
1888
+ )
1889
+ }
1890
+ )
1891
+ };
1892
+ }
1893
+ });
1894
+ var StrikedBox;
1895
+ var init_striked_box = __esm({
1896
+ "src/template/striked-box.tsx"() {
1897
+ StrikedBox = {
1898
+ id: "StrikedBox",
1899
+ name: "Striked Box",
1900
+ description: "QR code with striked box",
1901
+ wrapper: (children) => /* @__PURE__ */ jsxRuntime.jsx(
1902
+ "svg",
1903
+ {
1904
+ height: "300",
1905
+ id: "svgQrWrapper",
1906
+ style: {
1907
+ width: "100%",
1908
+ height: "100%"
1909
+ // backgroundColor: "rgb(255, 255, 255)",
1910
+ },
1911
+ viewBox: "0 0 300 300",
1912
+ width: "300",
1913
+ xmlns: "http://www.w3.org/2000/svg",
1914
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
1915
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1916
+ "svg",
1917
+ {
1918
+ fill: "#22071b",
1919
+ height: "300",
1920
+ viewBox: "0 0 300 300",
1921
+ width: "300",
1922
+ xmlns: "http://www.w3.org/2000/svg",
1923
+ children: [
1924
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M195.11,290.77l-7.28,4.88a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,2.4,2.4,0,0,0,1.2-.35l7.28-4.88a2.14,2.14,0,0,0-2.4-3.54Z" }),
1925
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M266.85,227.52l-7.28,4.87a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,1.86,1.86,0,0,0,1.2-.35l7.28-4.88a2.13,2.13,0,1,0-2.4-3.53Z" }),
1926
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M41,176.34l-9.11,6.08a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.14,2.14,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,176.34Z" }),
1927
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M41,269.08l-9.11,6.07a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.92,2.92,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,269.08Z" }),
1928
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M147,10.1a2.4,2.4,0,0,0,1.14-.35l7.7-5.16a2.13,2.13,0,0,0-2.4-3.53l-7.64,5.15a2.15,2.15,0,0,0-.56,3A2.19,2.19,0,0,0,147,10.1Z" }),
1929
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M275.54,54.77a2.14,2.14,0,0,0-3-.56l-17.1,11.45V31.31a10.18,10.18,0,0,0-10.18-10.18H137.22l-10.39,7a2.4,2.4,0,0,1-1.2.35,2.21,2.21,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l1.41-.92,13.64-8.76a2.1,2.1,0,1,0-2.26-3.54L122,21.2h-8.13l-10.39,7a2.37,2.37,0,0,1-1.2.35,2.19,2.19,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3L124,9.25a2.13,2.13,0,1,0-2.4-3.53l-23,15.48H58.2A10.18,10.18,0,0,0,48,31.38v28L31.34,70.46a2.09,2.09,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.58,2.58,0,0,0,1.2-.35l14.35-9.54,3.18-2.12a2.14,2.14,0,1,1,2.41,3.53l-5.52,3.67V76.9l-7,4.66a2.15,2.15,0,0,0-.56,3,2,2,0,0,0,1.77.92,2.34,2.34,0,0,0,1.2-.36l7.35-4.94A2.13,2.13,0,0,1,52.69,84l-4.46,3v65.66L25.05,168.07a2.15,2.15,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.37,2.37,0,0,0,1.2-.35l25-16.75a2,2,0,0,1,2.62.77,2.16,2.16,0,0,1-.57,3l-6.36,4.24V275a10.09,10.09,0,0,0,9.83,10.11l-5.87,4a2.15,2.15,0,0,0-.57,3,2.06,2.06,0,0,0,1.77.92,2.38,2.38,0,0,0,1.2-.36l23-15.41a2.14,2.14,0,0,1,2.41,3.54l-6.58,4.45h52l-5.58,3.75a2.14,2.14,0,0,0-.56,3,2,2,0,0,0,1.76.91,2.37,2.37,0,0,0,1.2-.35l30.54-20.28a2.15,2.15,0,0,1,3,.56,2.1,2.1,0,0,1-.57,3l-14.21,9.54H217l-4.6,3a2.16,2.16,0,0,0-.63,3,2.11,2.11,0,0,0,1.76,1,2,2,0,0,0,1.13-.36L237,277.35a2.14,2.14,0,1,1,2.33,3.6l-6.78,4.38h13a10.18,10.18,0,0,0,10.18-10.18v-91.1l-4.38,3a2.43,2.43,0,0,1-1.2.35,2.19,2.19,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l24.38-16.33a2.13,2.13,0,1,0-2.4-3.53l-15.48,10.25V91.53l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,13.71-9.19a2.14,2.14,0,0,0-2.4-3.54l-11.24,7.57V75.84l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,19.43-13.08A2.05,2.05,0,0,0,275.54,54.77ZM237,216.07h-172a5.23,5.23,0,0,1-5.23-5.24V38.94a5.22,5.22,0,0,1,5.23-5.23H237a5.22,5.22,0,0,1,5.23,5.23V210.83h.07A5.22,5.22,0,0,1,237,216.07Z" }),
1930
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M270.45,139.8l-7.28,4.88a2.15,2.15,0,0,0-.56,3,2.22,2.22,0,0,0,1.76.92,2.44,2.44,0,0,0,1.21-.36l7.28-4.87a2.14,2.14,0,0,0-2.41-3.54Z" }),
1931
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "none", transform: "translate(64, 38)scale(0.58)", children })
1932
+ ]
1933
+ }
1934
+ )
1935
+ }
1936
+ )
1937
+ };
1938
+ }
1939
+ });
1940
+
1941
+ // src/template/index.ts
1942
+ var init_template = __esm({
1943
+ "src/template/index.ts"() {
1944
+ init_arrow();
1945
+ init_default();
1946
+ init_halloween();
1947
+ init_square_border();
1948
+ init_standard_box();
1949
+ init_striked_box();
1950
+ }
1951
+ });
1952
+
1953
+ // src/templates.tsx
1954
+ var TEMPLATES, getTemplate;
1955
+ var init_templates = __esm({
1956
+ "src/templates.tsx"() {
1957
+ init_template();
1958
+ init_template();
1959
+ TEMPLATES = {
1960
+ default: defaultTemplate,
1961
+ Arrow,
1962
+ StandardBox,
1963
+ SquareBorder,
1964
+ StrikedBox,
1965
+ Halloween
1966
+ };
1967
+ getTemplate = (templateId) => TEMPLATES[templateId];
1968
+ }
1969
+ });
1970
+
1971
+ // src/utils/color.ts
1972
+ function getSolidColor(colorConfig, fallback = "#000000") {
1973
+ if (!colorConfig) {
1974
+ return fallback;
1975
+ }
1976
+ if (typeof colorConfig === "string") {
1977
+ return colorConfig;
1978
+ }
1979
+ if (colorConfig.type === "solid") {
1980
+ return colorConfig.color;
1981
+ }
1982
+ if (colorConfig.type === "linear" || colorConfig.type === "radial") {
1983
+ return colorConfig.stops[0]?.color || fallback;
1984
+ }
1985
+ return fallback;
1986
+ }
1987
+ var init_color2 = __esm({
1988
+ "src/utils/color.ts"() {
1989
+ }
1990
+ });
1991
+ function excavateModules(modules, excavation) {
1992
+ return modules.slice().map((row, y3) => {
1993
+ if (y3 < excavation.y || y3 >= excavation.y + excavation.h) {
1994
+ return row;
1995
+ }
1996
+ return row.map((cell, x2) => {
1997
+ if (x2 < excavation.x || x2 >= excavation.x + excavation.w) {
1998
+ return cell;
1999
+ }
2000
+ return false;
2001
+ });
2002
+ });
2003
+ }
2004
+ function isCornerModule(x2, y3, size) {
2005
+ if (x2 < 7 && y3 < 7) {
2006
+ return true;
2007
+ }
2008
+ if (x2 >= size - 7 && y3 < 7) {
2009
+ return true;
2010
+ }
2011
+ if (x2 < 7 && y3 >= size - 7) {
2012
+ return true;
2013
+ }
2014
+ return false;
2015
+ }
2016
+ function generateDataCircles(modules, options) {
2017
+ const { margin, pixelSize, pattern = "circle" } = options;
2018
+ const shapes = [];
2019
+ const qrSize = modules.length;
2020
+ const radius = pixelSize * 0.45;
2021
+ modules.forEach((row, y3) => {
2022
+ row.forEach((cell, x2) => {
2023
+ if (cell && !isCornerModule(x2, y3, qrSize)) {
2024
+ const cx = (x2 + 0.5 + margin) * pixelSize;
2025
+ const cy = (y3 + 0.5 + margin) * pixelSize;
2026
+ const key = `${x2}-${y3}`;
2027
+ switch (pattern) {
2028
+ case "circle":
2029
+ shapes.push(
2030
+ /* @__PURE__ */ jsxRuntime.jsx(
2031
+ "circle",
2032
+ {
2033
+ cx,
2034
+ cy,
2035
+ r: radius,
2036
+ transform: `rotate(0,${cx},${cy})`
2037
+ },
2038
+ key
2039
+ )
2040
+ );
2041
+ break;
2042
+ case "circle-large":
2043
+ {
2044
+ const largeRadius = pixelSize * 0.5;
2045
+ shapes.push(
2046
+ /* @__PURE__ */ jsxRuntime.jsx(
2047
+ "circle",
2048
+ {
2049
+ cx,
2050
+ cy,
2051
+ r: largeRadius,
2052
+ transform: `rotate(0,${cx},${cy})`
2053
+ },
2054
+ key
2055
+ )
2056
+ );
2057
+ }
2058
+ break;
2059
+ case "small-square":
2060
+ {
2061
+ const halfSize = pixelSize * 0.357143;
2062
+ shapes.push(
2063
+ /* @__PURE__ */ jsxRuntime.jsx(
2064
+ "path",
2065
+ {
2066
+ d: `M ${cx - halfSize} ${cy - halfSize}v ${pixelSize * 0.714286}h ${pixelSize * 0.714286}v -${pixelSize * 0.714286}z`,
2067
+ transform: `rotate(0,${cx},${cy})`
2068
+ },
2069
+ key
2070
+ )
2071
+ );
2072
+ }
2073
+ break;
2074
+ case "diamond":
2075
+ {
2076
+ const halfSize = pixelSize * 0.357143;
2077
+ shapes.push(
2078
+ /* @__PURE__ */ jsxRuntime.jsx(
2079
+ "path",
2080
+ {
2081
+ d: `M ${cx - halfSize} ${cy - halfSize}v ${pixelSize * 0.714286}h ${pixelSize * 0.714286}v -${pixelSize * 0.714286}z`,
2082
+ transform: `rotate(45,${cx},${cy})`
2083
+ },
2084
+ key
2085
+ )
2086
+ );
2087
+ }
2088
+ break;
2089
+ case "circle-mixed":
2090
+ {
2091
+ const randomFactor = (x2 + y3) % 3 === 0 ? 0.5 : (x2 + y3) % 2 === 0 ? 1 : 1.25;
2092
+ const variedRadius = radius * randomFactor;
2093
+ shapes.push(
2094
+ /* @__PURE__ */ jsxRuntime.jsx(
2095
+ "circle",
2096
+ {
2097
+ cx,
2098
+ cy,
2099
+ r: variedRadius,
2100
+ transform: `rotate(0,${cx},${cy})`
2101
+ },
2102
+ key
2103
+ )
2104
+ );
2105
+ }
2106
+ break;
2107
+ case "pacman":
2108
+ {
2109
+ const halfWidth = pixelSize * 0.5;
2110
+ const halfHeight = pixelSize * 0.357143;
2111
+ shapes.push(
2112
+ /* @__PURE__ */ jsxRuntime.jsx(
2113
+ "path",
2114
+ {
2115
+ d: `M ${cx - halfWidth} ${cy - halfHeight}v ${pixelSize * 0.714286}h ${halfWidth}a ${halfWidth * 0.5} ${halfWidth * 0.5}, 0, 0, 0, 0 -${pixelSize * 0.714286}h -${halfWidth}v -${pixelSize * 0.714286}z`,
2116
+ transform: `rotate(${(x2 + y3) % 2 === 0 ? 0 : 90},${cx},${cy})`
2117
+ },
2118
+ key
2119
+ )
2120
+ );
2121
+ }
2122
+ break;
2123
+ case "rounded":
2124
+ {
2125
+ const halfSize = pixelSize * 0.5;
2126
+ const cornerRadius = pixelSize * 0.2;
2127
+ shapes.push(
2128
+ /* @__PURE__ */ jsxRuntime.jsx(
2129
+ "rect",
2130
+ {
2131
+ height: pixelSize,
2132
+ rx: cornerRadius,
2133
+ ry: cornerRadius,
2134
+ transform: `rotate(0,${cx},${cy})`,
2135
+ width: pixelSize,
2136
+ x: cx - halfSize,
2137
+ y: cy - halfSize
2138
+ },
2139
+ key
2140
+ )
2141
+ );
2142
+ }
2143
+ break;
2144
+ case "square":
2145
+ {
2146
+ const halfSize = pixelSize * 0.5;
2147
+ shapes.push(
2148
+ /* @__PURE__ */ jsxRuntime.jsx(
2149
+ "rect",
2150
+ {
2151
+ height: pixelSize,
2152
+ transform: `rotate(0,${cx},${cy})`,
2153
+ width: pixelSize,
2154
+ x: cx - halfSize,
2155
+ y: cy - halfSize
2156
+ },
2157
+ key
2158
+ )
2159
+ );
2160
+ }
2161
+ break;
2162
+ case "vertical-line":
2163
+ {
2164
+ const lineHeight = pixelSize * 0.714286;
2165
+ const lineWidth = pixelSize;
2166
+ shapes.push(
2167
+ /* @__PURE__ */ jsxRuntime.jsx(
2168
+ "path",
2169
+ {
2170
+ d: `M ${cx - pixelSize * 0.5} ${cy - lineHeight * 0.5}v ${lineHeight}h ${lineWidth}v -${lineHeight}z`,
2171
+ transform: `rotate(90,${cx},${cy})`
2172
+ },
2173
+ key
2174
+ )
2175
+ );
2176
+ }
2177
+ break;
2178
+ default:
2179
+ shapes.push(
2180
+ /* @__PURE__ */ jsxRuntime.jsx(
2181
+ "circle",
2182
+ {
2183
+ cx,
2184
+ cy,
2185
+ r: radius,
2186
+ transform: `rotate(0,${cx},${cy})`
2187
+ },
2188
+ key
2189
+ )
2190
+ );
2191
+ }
2192
+ }
2193
+ });
2194
+ });
2195
+ return shapes;
2196
+ }
2197
+ function calculateGradientCoordinates(angle, size) {
2198
+ const radians = angle * Math.PI / 180;
2199
+ const centerX = size / 2;
2200
+ const centerY = size / 2;
2201
+ const length = Math.sqrt(size * size + size * size) / 2;
2202
+ const x1 = centerX - length * Math.cos(radians);
2203
+ const y1 = centerY - length * Math.sin(radians);
2204
+ const x2 = centerX + length * Math.cos(radians);
2205
+ const y22 = centerY + length * Math.sin(radians);
2206
+ return { x1, y1, x2, y2: y22 };
2207
+ }
2208
+ function generateGradientId(prefix) {
2209
+ gradientIdCounter += 1;
2210
+ return `${prefix}-${Date.now()}-${gradientIdCounter}`;
2211
+ }
2212
+ function calculateCornerGradientCoordinates(angle, cornerX, cornerY, cornerSize, cornerType) {
2213
+ let effectiveAngle = angle;
2214
+ if (angle === 0) {
2215
+ switch (cornerType) {
2216
+ case "top-left":
2217
+ effectiveAngle = 0;
2218
+ break;
2219
+ case "top-right":
2220
+ effectiveAngle = 90;
2221
+ break;
2222
+ case "bottom-left":
2223
+ effectiveAngle = 270;
2224
+ break;
2225
+ default:
2226
+ effectiveAngle = 0;
2227
+ }
2228
+ }
2229
+ const radians = effectiveAngle * Math.PI / 180;
2230
+ const centerX = cornerX + cornerSize / 2;
2231
+ const centerY = cornerY + cornerSize / 2;
2232
+ const length = Math.sqrt(cornerSize * cornerSize + cornerSize * cornerSize) / 2;
2233
+ const x1 = centerX - length * Math.cos(radians);
2234
+ const y1 = centerY - length * Math.sin(radians);
2235
+ const x2 = centerX + length * Math.cos(radians);
2236
+ const y22 = centerY + length * Math.sin(radians);
2237
+ return { x1, y1, x2, y2: y22 };
2238
+ }
2239
+ function generateCornerGradientDef(colorConfig, cornerX, cornerY, cornerSize, cornerType, idPrefix) {
2240
+ const normalized = normalizeColorConfig(colorConfig);
2241
+ if (normalized.type === "solid") {
2242
+ return null;
2243
+ }
2244
+ const id = generateGradientId(idPrefix);
2245
+ if (normalized.type === "linear") {
2246
+ const gradient = normalized;
2247
+ const angle = gradient.angle ?? 0;
2248
+ const { x1, y1, x2, y2: y22 } = calculateCornerGradientCoordinates(
2249
+ angle,
2250
+ cornerX,
2251
+ cornerY,
2252
+ cornerSize,
2253
+ cornerType
2254
+ );
2255
+ return {
2256
+ id,
2257
+ element: /* @__PURE__ */ jsxRuntime.jsx(
2258
+ "linearGradient",
2259
+ {
2260
+ gradientUnits: "userSpaceOnUse",
2261
+ id,
2262
+ x1,
2263
+ x2,
2264
+ y1,
2265
+ y2: y22,
2266
+ children: gradient.stops.map((stop, index) => /* @__PURE__ */ jsxRuntime.jsx(
2267
+ "stop",
2268
+ {
2269
+ offset: `${stop.offset}%`,
2270
+ stopColor: stop.color
2271
+ },
2272
+ `${id}-stop-${index}`
2273
+ ))
2274
+ },
2275
+ id
2276
+ )
2277
+ };
2278
+ }
2279
+ if (normalized.type === "radial") {
2280
+ const gradient = normalized;
2281
+ const centerX = cornerX + cornerSize / 2;
2282
+ const centerY = cornerY + cornerSize / 2;
2283
+ const radius = cornerSize / 2 * 0.97;
2284
+ return {
2285
+ id,
2286
+ element: /* @__PURE__ */ jsxRuntime.jsx(
2287
+ "radialGradient",
2288
+ {
2289
+ cx: centerX,
2290
+ cy: centerY,
2291
+ fx: centerX,
2292
+ fy: centerY,
2293
+ gradientUnits: "userSpaceOnUse",
2294
+ id,
2295
+ r: radius,
2296
+ children: gradient.stops.map((stop, index) => /* @__PURE__ */ jsxRuntime.jsx(
2297
+ "stop",
2298
+ {
2299
+ offset: `${stop.offset}%`,
2300
+ stopColor: stop.color
2301
+ },
2302
+ `${id}-stop-${index}`
2303
+ ))
2304
+ },
2305
+ id
2306
+ )
2307
+ };
2308
+ }
2309
+ return null;
2310
+ }
2311
+ function generateGradientDef(colorConfig, size, idPrefix) {
2312
+ const normalized = normalizeColorConfig(colorConfig);
2313
+ if (normalized.type === "solid") {
2314
+ return null;
2315
+ }
2316
+ const id = generateGradientId(idPrefix);
2317
+ if (normalized.type === "linear") {
2318
+ const gradient = normalized;
2319
+ const angle = gradient.angle ?? 0;
2320
+ const { x1, y1, x2, y2: y22 } = calculateGradientCoordinates(angle, size);
2321
+ return {
2322
+ id,
2323
+ element: /* @__PURE__ */ jsxRuntime.jsx(
2324
+ "linearGradient",
2325
+ {
2326
+ gradientUnits: "userSpaceOnUse",
2327
+ id,
2328
+ x1,
2329
+ x2,
2330
+ y1,
2331
+ y2: y22,
2332
+ children: gradient.stops.map((stop, index) => /* @__PURE__ */ jsxRuntime.jsx(
2333
+ "stop",
2334
+ {
2335
+ offset: `${stop.offset}%`,
2336
+ stopColor: stop.color
2337
+ },
2338
+ `${id}-stop-${index}`
2339
+ ))
2340
+ },
2341
+ id
2342
+ )
2343
+ };
2344
+ }
2345
+ if (normalized.type === "radial") {
2346
+ const gradient = normalized;
2347
+ const centerX = size / 2;
2348
+ const centerY = size / 2;
2349
+ const radius = size / 2 * 0.97;
2350
+ return {
2351
+ id,
2352
+ element: /* @__PURE__ */ jsxRuntime.jsx(
2353
+ "radialGradient",
2354
+ {
2355
+ cx: centerX,
2356
+ cy: centerY,
2357
+ fx: centerX,
2358
+ fy: centerY,
2359
+ gradientUnits: "userSpaceOnUse",
2360
+ id,
2361
+ r: radius,
2362
+ children: gradient.stops.map((stop, index) => /* @__PURE__ */ jsxRuntime.jsx(
2363
+ "stop",
2364
+ {
2365
+ offset: `${stop.offset}%`,
2366
+ stopColor: stop.color
2367
+ },
2368
+ `${id}-stop-${index}`
2369
+ ))
2370
+ },
2371
+ id
2372
+ )
2373
+ };
2374
+ }
2375
+ return null;
2376
+ }
2377
+ function getFillValue(colorConfig, gradientId, fallback) {
2378
+ if (gradientId) {
2379
+ return `url(#${gradientId})`;
2380
+ }
2381
+ const normalized = normalizeColorConfig(colorConfig, fallback);
2382
+ if (normalized.type === "solid") {
2383
+ return normalized.color;
2384
+ }
2385
+ return fallback;
2386
+ }
2387
+ function getImageSettings(cells, size, _margin, imageSettings) {
2388
+ if (imageSettings == null) {
2389
+ return null;
2390
+ }
2391
+ const qrCodeSize = cells.length;
2392
+ const defaultSize = Math.floor(size * DEFAULT_IMG_SCALE);
2393
+ const scale = qrCodeSize / size;
2394
+ const w2 = (imageSettings.width || defaultSize) * scale;
2395
+ const h2 = (imageSettings.height || defaultSize) * scale;
2396
+ const x2 = imageSettings.x == null ? qrCodeSize / 2 - w2 / 2 : imageSettings.x * scale;
2397
+ const y3 = imageSettings.y == null ? qrCodeSize / 2 - h2 / 2 : imageSettings.y * scale;
2398
+ let excavation = null;
2399
+ if (imageSettings.excavate) {
2400
+ const floorX = Math.floor(x2);
2401
+ const floorY = Math.floor(y3);
2402
+ const ceilW = Math.ceil(w2 + x2 - floorX);
2403
+ const ceilH = Math.ceil(h2 + y3 - floorY);
2404
+ excavation = { x: floorX, y: floorY, w: ceilW, h: ceilH };
2405
+ }
2406
+ return { x: x2, y: y3, h: h2, w: w2, excavation };
2407
+ }
2408
+ function convertImageSettingsToPixels(calculatedImageSettings, size, numCells, margin) {
2409
+ const pixelRatio = size / numCells;
2410
+ const imgWidth = calculatedImageSettings.w * pixelRatio;
2411
+ const imgHeight = calculatedImageSettings.h * pixelRatio;
2412
+ const imgLeft = (calculatedImageSettings.x + margin) * pixelRatio;
2413
+ const imgTop = (calculatedImageSettings.y + margin) * pixelRatio;
2414
+ return { imgWidth, imgHeight, imgLeft, imgTop };
2415
+ }
2416
+ function QRCodeSVG(props) {
2417
+ const {
2418
+ value,
2419
+ size = DEFAULT_SIZE,
2420
+ level = DEFAULT_LEVEL,
2421
+ bgColor = DEFAULT_BGCOLOR,
2422
+ fgColor = DEFAULT_FGCOLOR,
2423
+ eyeColor,
2424
+ dotColor,
2425
+ bodyPattern = "circle",
2426
+ cornerEyePattern = "gear",
2427
+ cornerEyeDotPattern = "circle",
2428
+ margin = DEFAULT_MARGIN,
2429
+ isOGContext = false,
2430
+ imageSettings,
2431
+ templateId,
2432
+ customTemplate,
2433
+ customProps,
2434
+ ...otherProps
2435
+ } = props;
2436
+ const shouldUseHigherErrorLevel = isOGContext && imageSettings?.excavate && (level === "L" || level === "M");
2437
+ const effectiveLevel = shouldUseHigherErrorLevel ? "Q" : level;
2438
+ let cells = codegen_default.QrCode.encodeText(
2439
+ value,
2440
+ ERROR_LEVEL_MAP[effectiveLevel]
2441
+ ).getModules();
2442
+ const numCells = cells.length + margin * 2;
2443
+ const calculatedImageSettings = getImageSettings(
2444
+ cells,
2445
+ size,
2446
+ margin,
2447
+ imageSettings
2448
+ );
2449
+ let image = null;
2450
+ if (imageSettings != null && calculatedImageSettings != null) {
2451
+ if (calculatedImageSettings.excavation != null) {
2452
+ cells = excavateModules(cells, calculatedImageSettings.excavation);
2453
+ }
2454
+ const { imgWidth, imgHeight, imgLeft, imgTop } = convertImageSettingsToPixels(
2455
+ calculatedImageSettings,
2456
+ size,
2457
+ numCells,
2458
+ margin
2459
+ );
2460
+ if (isOGContext) {
2461
+ image = /* @__PURE__ */ jsxRuntime.jsx(
2462
+ "img",
2463
+ {
2464
+ alt: "Logo",
2465
+ src: imageSettings.src,
2466
+ style: {
2467
+ position: "absolute",
2468
+ left: `${imgLeft}px`,
2469
+ top: `${imgTop}px`,
2470
+ width: `${imgWidth}px`,
2471
+ height: `${imgHeight}px`
2472
+ }
2473
+ }
2474
+ );
2475
+ } else {
2476
+ image = /* @__PURE__ */ jsxRuntime.jsx(
2477
+ "image",
2478
+ {
2479
+ height: imgHeight,
2480
+ href: imageSettings.src,
2481
+ preserveAspectRatio: "none",
2482
+ width: imgWidth,
2483
+ x: imgLeft,
2484
+ y: imgTop
2485
+ }
2486
+ );
2487
+ }
2488
+ }
2489
+ const pixelSize = size / numCells;
2490
+ const qrSize = cells.length;
2491
+ const cornerSize = 7 * pixelSize;
2492
+ const cornerDotRadius = 1.5 * pixelSize;
2493
+ const dataCircles = generateDataCircles(cells, {
2494
+ margin,
2495
+ pixelSize,
2496
+ pattern: bodyPattern
2497
+ });
2498
+ const normalizedBgColor = normalizeColorConfig(bgColor, DEFAULT_BGCOLOR);
2499
+ const normalizedFgColor = normalizeColorConfig(fgColor, DEFAULT_FGCOLOR);
2500
+ const bgColorGradient = normalizedBgColor.type === "linear" || normalizedBgColor.type === "radial" ? generateGradientDef(
2501
+ normalizedBgColor,
2502
+ size,
2503
+ "bg-color"
2504
+ ) : null;
2505
+ const fgColorGradient = normalizedFgColor.type === "linear" || normalizedFgColor.type === "radial" ? generateGradientDef(
2506
+ normalizedFgColor,
2507
+ size,
2508
+ "fg-color"
2509
+ ) : null;
2510
+ const bgFillValue = getFillValue(
2511
+ bgColor,
2512
+ // Pass original for getFillValue to handle normalization internally
2513
+ bgColorGradient?.id ?? null,
2514
+ DEFAULT_BGCOLOR
2515
+ );
2516
+ const fgFillValue = getFillValue(
2517
+ fgColor,
2518
+ // Pass original for getFillValue to handle normalization internally
2519
+ fgColorGradient?.id ?? null,
2520
+ DEFAULT_FGCOLOR
2521
+ );
2522
+ const topLeftX = margin * pixelSize;
2523
+ const topLeftY = margin * pixelSize;
2524
+ const topRightX = (qrSize - 7 + margin) * pixelSize;
2525
+ const topRightY = margin * pixelSize;
2526
+ const bottomLeftX = margin * pixelSize;
2527
+ const bottomLeftY = (qrSize - 7 + margin) * pixelSize;
2528
+ const normalizedEyeColor = normalizeColorConfig(
2529
+ eyeColor,
2530
+ getSolidColor(fgColor, DEFAULT_FGCOLOR)
2531
+ );
2532
+ const normalizedDotColor = normalizeColorConfig(
2533
+ dotColor,
2534
+ getSolidColor(fgColor, DEFAULT_FGCOLOR)
2535
+ );
2536
+ const topLeftEyeGradient = normalizedEyeColor.type === "linear" || normalizedEyeColor.type === "radial" ? generateCornerGradientDef(
2537
+ normalizedEyeColor,
2538
+ topLeftX,
2539
+ topLeftY,
2540
+ cornerSize,
2541
+ "top-left",
2542
+ "corners-square-color-0-0"
2543
+ ) : null;
2544
+ const topRightEyeGradient = normalizedEyeColor.type === "linear" || normalizedEyeColor.type === "radial" ? generateCornerGradientDef(
2545
+ normalizedEyeColor,
2546
+ topRightX,
2547
+ topRightY,
2548
+ cornerSize,
2549
+ "top-right",
2550
+ "corners-square-color-1-0"
2551
+ ) : null;
2552
+ const bottomLeftEyeGradient = normalizedEyeColor.type === "linear" || normalizedEyeColor.type === "radial" ? generateCornerGradientDef(
2553
+ normalizedEyeColor,
2554
+ bottomLeftX,
2555
+ bottomLeftY,
2556
+ cornerSize,
2557
+ "bottom-left",
2558
+ "corners-square-color-0-1"
2559
+ ) : null;
2560
+ const topLeftDotGradient = normalizedDotColor.type === "linear" || normalizedDotColor.type === "radial" ? generateCornerGradientDef(
2561
+ normalizedDotColor,
2562
+ topLeftX,
2563
+ topLeftY,
2564
+ cornerSize,
2565
+ "top-left",
2566
+ "corners-dot-color-0-0"
2567
+ ) : null;
2568
+ const topRightDotGradient = normalizedDotColor.type === "linear" || normalizedDotColor.type === "radial" ? generateCornerGradientDef(
2569
+ normalizedDotColor,
2570
+ topRightX,
2571
+ topRightY,
2572
+ cornerSize,
2573
+ "top-right",
2574
+ "corners-dot-color-1-0"
2575
+ ) : null;
2576
+ const bottomLeftDotGradient = normalizedDotColor.type === "linear" || normalizedDotColor.type === "radial" ? generateCornerGradientDef(
2577
+ normalizedDotColor,
2578
+ bottomLeftX,
2579
+ bottomLeftY,
2580
+ cornerSize,
2581
+ "bottom-left",
2582
+ "corners-dot-color-0-1"
2583
+ ) : null;
2584
+ const topLeftEyeFillValue = getFillValue(
2585
+ eyeColor,
2586
+ topLeftEyeGradient?.id ?? null,
2587
+ getSolidColor(fgColor, DEFAULT_FGCOLOR)
2588
+ );
2589
+ const topRightEyeFillValue = getFillValue(
2590
+ eyeColor,
2591
+ topRightEyeGradient?.id ?? null,
2592
+ getSolidColor(fgColor, DEFAULT_FGCOLOR)
2593
+ );
2594
+ const bottomLeftEyeFillValue = getFillValue(
2595
+ eyeColor,
2596
+ bottomLeftEyeGradient?.id ?? null,
2597
+ getSolidColor(fgColor, DEFAULT_FGCOLOR)
2598
+ );
2599
+ const topLeftDotFillValue = getFillValue(
2600
+ dotColor,
2601
+ topLeftDotGradient?.id ?? null,
2602
+ getSolidColor(fgColor, DEFAULT_FGCOLOR)
2603
+ );
2604
+ const topRightDotFillValue = getFillValue(
2605
+ dotColor,
2606
+ topRightDotGradient?.id ?? null,
2607
+ getSolidColor(fgColor, DEFAULT_FGCOLOR)
2608
+ );
2609
+ const bottomLeftDotFillValue = getFillValue(
2610
+ dotColor,
2611
+ bottomLeftDotGradient?.id ?? null,
2612
+ getSolidColor(fgColor, DEFAULT_FGCOLOR)
2613
+ );
2614
+ const topLeftEye = generateCornerSquarePath(
2615
+ topLeftX,
2616
+ topLeftY,
2617
+ cornerSize,
2618
+ cornerEyePattern
2619
+ );
2620
+ const topLeftDot = generateCornerDotPath(
2621
+ topLeftX + cornerSize / 2,
2622
+ topLeftY + cornerSize / 2,
2623
+ cornerDotRadius,
2624
+ cornerEyeDotPattern
2625
+ );
2626
+ const topRightEye = generateCornerSquarePath(
2627
+ topRightX,
2628
+ topRightY,
2629
+ cornerSize,
2630
+ cornerEyePattern
2631
+ );
2632
+ const topRightDot = generateCornerDotPath(
2633
+ topRightX + cornerSize / 2,
2634
+ topRightY + cornerSize / 2,
2635
+ cornerDotRadius,
2636
+ cornerEyeDotPattern
2637
+ );
2638
+ const bottomLeftEye = generateCornerSquarePath(
2639
+ bottomLeftX,
2640
+ bottomLeftY,
2641
+ cornerSize,
2642
+ cornerEyePattern
2643
+ );
2644
+ const bottomLeftDot = generateCornerDotPath(
2645
+ bottomLeftX + cornerSize / 2,
2646
+ bottomLeftY + cornerSize / 2,
2647
+ cornerDotRadius,
2648
+ cornerEyeDotPattern
2649
+ );
2650
+ const qrContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2651
+ /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
2652
+ bgColorGradient?.element,
2653
+ fgColorGradient?.element,
2654
+ topLeftEyeGradient?.element,
2655
+ topRightEyeGradient?.element,
2656
+ bottomLeftEyeGradient?.element,
2657
+ topLeftDotGradient?.element,
2658
+ topRightDotGradient?.element,
2659
+ bottomLeftDotGradient?.element
2660
+ ] }),
2661
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { fill: bgFillValue, height: size, width: size, x: 0, y: 0 }),
2662
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: fgFillValue, children: dataCircles }),
2663
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: topLeftEyeFillValue, children: /* @__PURE__ */ jsxRuntime.jsx(
2664
+ "path",
2665
+ {
2666
+ fillRule: "evenodd",
2667
+ d: topLeftEye,
2668
+ transform: `rotate(0,${topLeftX + cornerSize / 2},${topLeftY + cornerSize / 2})`
2669
+ }
2670
+ ) }),
2671
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: topLeftDotFillValue, children: topLeftDot }),
2672
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: topRightEyeFillValue, children: /* @__PURE__ */ jsxRuntime.jsx(
2673
+ "path",
2674
+ {
2675
+ fillRule: "evenodd",
2676
+ d: topRightEye,
2677
+ transform: `rotate(0,${topRightX + cornerSize / 2},${topRightY + cornerSize / 2})`
2678
+ }
2679
+ ) }),
2680
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: topRightDotFillValue, children: topRightDot }),
2681
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: bottomLeftEyeFillValue, children: /* @__PURE__ */ jsxRuntime.jsx(
2682
+ "path",
2683
+ {
2684
+ fillRule: "evenodd",
2685
+ d: bottomLeftEye,
2686
+ transform: `rotate(0,${bottomLeftX + cornerSize / 2},${bottomLeftY + cornerSize / 2})`
2687
+ }
2688
+ ) }),
2689
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: bottomLeftDotFillValue, children: bottomLeftDot }),
2690
+ image
2691
+ ] });
2692
+ const template = customTemplate || (templateId ? getTemplate(templateId) : void 0);
2693
+ if (template) {
2694
+ const templateSize = 300;
2695
+ const templateBgColorGradient = normalizedBgColor.type === "linear" || normalizedBgColor.type === "radial" ? generateGradientDef(
2696
+ normalizedBgColor,
2697
+ templateSize,
2698
+ "bg-color-template"
2699
+ ) : null;
2700
+ const templateBgFillValue = getFillValue(
2701
+ bgColor,
2702
+ templateBgColorGradient?.id ?? null,
2703
+ DEFAULT_BGCOLOR
2704
+ );
2705
+ const templateQrContent = /* @__PURE__ */ jsxRuntime.jsxs(
2706
+ "svg",
2707
+ {
2708
+ height: templateSize,
2709
+ viewBox: `0 0 ${templateSize} ${templateSize}`,
2710
+ width: templateSize,
2711
+ xmlns: "http://www.w3.org/2000/svg",
2712
+ children: [
2713
+ /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
2714
+ templateBgColorGradient?.element,
2715
+ fgColorGradient?.element,
2716
+ topLeftEyeGradient?.element,
2717
+ topRightEyeGradient?.element,
2718
+ bottomLeftEyeGradient?.element,
2719
+ topLeftDotGradient?.element,
2720
+ topRightDotGradient?.element,
2721
+ bottomLeftDotGradient?.element
2722
+ ] }),
2723
+ /* @__PURE__ */ jsxRuntime.jsx(
2724
+ "rect",
2725
+ {
2726
+ fill: templateBgFillValue,
2727
+ height: templateSize,
2728
+ width: templateSize,
2729
+ x: 0,
2730
+ y: 0
2731
+ }
2732
+ ),
2733
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `scale(${templateSize / size})`, children: [
2734
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: fgFillValue, children: dataCircles }),
2735
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: topLeftEyeFillValue, children: /* @__PURE__ */ jsxRuntime.jsx(
2736
+ "path",
2737
+ {
2738
+ fillRule: "evenodd",
2739
+ d: generateCornerSquarePath(
2740
+ topLeftX,
2741
+ topLeftY,
2742
+ cornerSize,
2743
+ cornerEyePattern
2744
+ ),
2745
+ transform: `rotate(0,${topLeftX + cornerSize / 2},${topLeftY + cornerSize / 2})`
2746
+ }
2747
+ ) }),
2748
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: topLeftDotFillValue, children: generateCornerDotPath(
2749
+ topLeftX + cornerSize / 2,
2750
+ topLeftY + cornerSize / 2,
2751
+ cornerDotRadius,
2752
+ cornerEyeDotPattern
2753
+ ) }),
2754
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: topRightEyeFillValue, children: /* @__PURE__ */ jsxRuntime.jsx(
2755
+ "path",
2756
+ {
2757
+ fillRule: "evenodd",
2758
+ d: generateCornerSquarePath(
2759
+ topRightX,
2760
+ topRightY,
2761
+ cornerSize,
2762
+ cornerEyePattern
2763
+ ),
2764
+ transform: `rotate(0,${topRightX + cornerSize / 2},${topRightY + cornerSize / 2})`
2765
+ }
2766
+ ) }),
2767
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: topRightDotFillValue, children: generateCornerDotPath(
2768
+ topRightX + cornerSize / 2,
2769
+ topRightY + cornerSize / 2,
2770
+ cornerDotRadius,
2771
+ cornerEyeDotPattern
2772
+ ) }),
2773
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: bottomLeftEyeFillValue, children: /* @__PURE__ */ jsxRuntime.jsx(
2774
+ "path",
2775
+ {
2776
+ fillRule: "evenodd",
2777
+ d: generateCornerSquarePath(
2778
+ bottomLeftX,
2779
+ bottomLeftY,
2780
+ cornerSize,
2781
+ cornerEyePattern
2782
+ ),
2783
+ transform: `rotate(0,${bottomLeftX + cornerSize / 2},${bottomLeftY + cornerSize / 2})`
2784
+ }
2785
+ ) }),
2786
+ /* @__PURE__ */ jsxRuntime.jsx("g", { fill: bottomLeftDotFillValue, children: generateCornerDotPath(
2787
+ bottomLeftX + cornerSize / 2,
2788
+ bottomLeftY + cornerSize / 2,
2789
+ cornerDotRadius,
2790
+ cornerEyeDotPattern
2791
+ ) }),
2792
+ image
2793
+ ] })
2794
+ ]
2795
+ }
2796
+ );
2797
+ const scaleFactor = templateSize / size;
2798
+ const scaledPixelSize = pixelSize * scaleFactor;
2799
+ const templateConfig = {
2800
+ pixelSize: scaledPixelSize,
2801
+ url: value
2802
+ };
2803
+ const wrappedSvg = template.wrapper(
2804
+ templateQrContent,
2805
+ {
2806
+ fgColor,
2807
+ bgColor,
2808
+ ...customProps || {},
2809
+ ...otherProps
2810
+ },
2811
+ templateConfig
2812
+ );
2813
+ const originalStyle = wrappedSvg?.props?.style || {};
2814
+ const newStyle = {
2815
+ ...originalStyle,
2816
+ width: void 0,
2817
+ height: void 0
2818
+ };
2819
+ return React__default.default.cloneElement(wrappedSvg, {
2820
+ width: size,
2821
+ height: size,
2822
+ style: newStyle
2823
+ });
2824
+ }
2825
+ return /* @__PURE__ */ jsxRuntime.jsx(
2826
+ "svg",
2827
+ {
2828
+ height: size,
2829
+ viewBox: `0 0 ${size} ${size}`,
2830
+ width: size,
2831
+ xmlns: "http://www.w3.org/2000/svg",
2832
+ ...otherProps,
2833
+ children: qrContent
2834
+ }
2835
+ );
2836
+ }
2837
+ var gradientIdCounter;
2838
+ var init_utils = __esm({
2839
+ "src/utils.tsx"() {
2840
+ init_color();
2841
+ init_codegen();
2842
+ init_constants();
2843
+ init_corner_dot();
2844
+ init_corner_eye();
2845
+ init_templates();
2846
+ init_color2();
2847
+ init_color2();
2848
+ gradientIdCounter = 0;
2849
+ (() => {
2850
+ try {
2851
+ new Path2D().addPath(new Path2D());
2852
+ } catch (_e) {
2853
+ return false;
2854
+ }
2855
+ return true;
2856
+ })();
2857
+ }
2858
+ });
2859
+
2860
+ // ../../node_modules/.pnpm/@clack+core@0.4.2/node_modules/@clack/core/dist/index.mjs
2861
+ var import_sisteransi = __toESM(require_src());
2862
+ var import_picocolors = __toESM(require_picocolors());
2863
+ function DD({ onlyFirst: e2 = false } = {}) {
2864
+ const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
2865
+ return new RegExp(t, e2 ? void 0 : "g");
2866
+ }
2867
+ var uD = DD();
2868
+ function P(e2) {
2869
+ if (typeof e2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e2}\``);
2870
+ return e2.replace(uD, "");
2871
+ }
2872
+ function L(e2) {
2873
+ return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
2874
+ }
2875
+ var W = { exports: {} };
2876
+ (function(e2) {
2877
+ var u2 = {};
2878
+ e2.exports = u2, u2.eastAsianWidth = function(F2) {
2879
+ var s = F2.charCodeAt(0), i = F2.length == 2 ? F2.charCodeAt(1) : 0, D2 = s;
2880
+ return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D2 = s << 10 | i, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
2881
+ }, u2.characterLength = function(F2) {
2882
+ var s = this.eastAsianWidth(F2);
2883
+ return s == "F" || s == "W" || s == "A" ? 2 : 1;
2884
+ };
2885
+ function t(F2) {
2886
+ return F2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
2887
+ }
2888
+ u2.length = function(F2) {
2889
+ for (var s = t(F2), i = 0, D2 = 0; D2 < s.length; D2++) i = i + this.characterLength(s[D2]);
2890
+ return i;
2891
+ }, u2.slice = function(F2, s, i) {
2892
+ textLen = u2.length(F2), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
2893
+ for (var D2 = "", r = 0, n = t(F2), E = 0; E < n.length; E++) {
2894
+ var a = n[E], o2 = u2.length(a);
2895
+ if (r >= s - (o2 == 2 ? 1 : 0)) if (r + o2 <= i) D2 += a;
2896
+ else break;
2897
+ r += o2;
2898
+ }
2899
+ return D2;
2900
+ };
2901
+ })(W);
2902
+ var tD = W.exports;
2903
+ var eD = L(tD);
2904
+ var FD = function() {
2905
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
2906
+ };
2907
+ var sD = L(FD);
2908
+ function p(e2, u2 = {}) {
2909
+ if (typeof e2 != "string" || e2.length === 0 || (u2 = { ambiguousIsNarrow: true, ...u2 }, e2 = P(e2), e2.length === 0)) return 0;
2910
+ e2 = e2.replace(sD(), " ");
2911
+ const t = u2.ambiguousIsNarrow ? 1 : 2;
2912
+ let F2 = 0;
2913
+ for (const s of e2) {
2914
+ const i = s.codePointAt(0);
2915
+ if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
2916
+ switch (eD.eastAsianWidth(s)) {
2917
+ case "F":
2918
+ case "W":
2919
+ F2 += 2;
2920
+ break;
2921
+ case "A":
2922
+ F2 += t;
2923
+ break;
2924
+ default:
2925
+ F2 += 1;
2926
+ }
2927
+ }
2928
+ return F2;
2929
+ }
2930
+ var w = 10;
2931
+ var N = (e2 = 0) => (u2) => `\x1B[${u2 + e2}m`;
2932
+ var I = (e2 = 0) => (u2) => `\x1B[${38 + e2};5;${u2}m`;
2933
+ var R = (e2 = 0) => (u2, t, F2) => `\x1B[${38 + e2};2;${u2};${t};${F2}m`;
2934
+ var C = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
2935
+ Object.keys(C.modifier);
2936
+ var iD = Object.keys(C.color);
2937
+ var rD = Object.keys(C.bgColor);
2938
+ [...iD, ...rD];
2939
+ function CD() {
2940
+ const e2 = /* @__PURE__ */ new Map();
2941
+ for (const [u2, t] of Object.entries(C)) {
2942
+ for (const [F2, s] of Object.entries(t)) C[F2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F2] = C[F2], e2.set(s[0], s[1]);
2943
+ Object.defineProperty(C, u2, { value: t, enumerable: false });
2944
+ }
2945
+ return Object.defineProperty(C, "codes", { value: e2, enumerable: false }), C.color.close = "\x1B[39m", C.bgColor.close = "\x1B[49m", C.color.ansi = N(), C.color.ansi256 = I(), C.color.ansi16m = R(), C.bgColor.ansi = N(w), C.bgColor.ansi256 = I(w), C.bgColor.ansi16m = R(w), Object.defineProperties(C, { rgbToAnsi256: { value: (u2, t, F2) => u2 === t && t === F2 ? u2 < 8 ? 16 : u2 > 248 ? 231 : Math.round((u2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u2 / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u2) => {
2946
+ const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u2.toString(16));
2947
+ if (!t) return [0, 0, 0];
2948
+ let [F2] = t;
2949
+ F2.length === 3 && (F2 = [...F2].map((i) => i + i).join(""));
2950
+ const s = Number.parseInt(F2, 16);
2951
+ return [s >> 16 & 255, s >> 8 & 255, s & 255];
2952
+ }, enumerable: false }, hexToAnsi256: { value: (u2) => C.rgbToAnsi256(...C.hexToRgb(u2)), enumerable: false }, ansi256ToAnsi: { value: (u2) => {
2953
+ if (u2 < 8) return 30 + u2;
2954
+ if (u2 < 16) return 90 + (u2 - 8);
2955
+ let t, F2, s;
2956
+ if (u2 >= 232) t = ((u2 - 232) * 10 + 8) / 255, F2 = t, s = t;
2957
+ else {
2958
+ u2 -= 16;
2959
+ const r = u2 % 36;
2960
+ t = Math.floor(u2 / 36) / 5, F2 = Math.floor(r / 6) / 5, s = r % 6 / 5;
2961
+ }
2962
+ const i = Math.max(t, F2, s) * 2;
2963
+ if (i === 0) return 30;
2964
+ let D2 = 30 + (Math.round(s) << 2 | Math.round(F2) << 1 | Math.round(t));
2965
+ return i === 2 && (D2 += 60), D2;
2966
+ }, enumerable: false }, rgbToAnsi: { value: (u2, t, F2) => C.ansi256ToAnsi(C.rgbToAnsi256(u2, t, F2)), enumerable: false }, hexToAnsi: { value: (u2) => C.ansi256ToAnsi(C.hexToAnsi256(u2)), enumerable: false } }), C;
2967
+ }
2968
+ var ED = CD();
2969
+ var d = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
2970
+ var oD = 39;
2971
+ var y = "\x07";
2972
+ var V = "[";
2973
+ var nD = "]";
2974
+ var G = "m";
2975
+ var _ = `${nD}8;;`;
2976
+ var z = (e2) => `${d.values().next().value}${V}${e2}${G}`;
2977
+ var K = (e2) => `${d.values().next().value}${_}${e2}${y}`;
2978
+ var aD = (e2) => e2.split(" ").map((u2) => p(u2));
2979
+ var k = (e2, u2, t) => {
2980
+ const F2 = [...u2];
2981
+ let s = false, i = false, D2 = p(P(e2[e2.length - 1]));
2982
+ for (const [r, n] of F2.entries()) {
2983
+ const E = p(n);
2984
+ if (D2 + E <= t ? e2[e2.length - 1] += n : (e2.push(n), D2 = 0), d.has(n) && (s = true, i = F2.slice(r + 1).join("").startsWith(_)), s) {
2985
+ i ? n === y && (s = false, i = false) : n === G && (s = false);
2986
+ continue;
2987
+ }
2988
+ D2 += E, D2 === t && r < F2.length - 1 && (e2.push(""), D2 = 0);
2989
+ }
2990
+ !D2 && e2[e2.length - 1].length > 0 && e2.length > 1 && (e2[e2.length - 2] += e2.pop());
2991
+ };
2992
+ var hD = (e2) => {
2993
+ const u2 = e2.split(" ");
2994
+ let t = u2.length;
2995
+ for (; t > 0 && !(p(u2[t - 1]) > 0); ) t--;
2996
+ return t === u2.length ? e2 : u2.slice(0, t).join(" ") + u2.slice(t).join("");
2997
+ };
2998
+ var lD = (e2, u2, t = {}) => {
2999
+ if (t.trim !== false && e2.trim() === "") return "";
3000
+ let F2 = "", s, i;
3001
+ const D2 = aD(e2);
3002
+ let r = [""];
3003
+ for (const [E, a] of e2.split(" ").entries()) {
3004
+ t.trim !== false && (r[r.length - 1] = r[r.length - 1].trimStart());
3005
+ let o2 = p(r[r.length - 1]);
3006
+ if (E !== 0 && (o2 >= u2 && (t.wordWrap === false || t.trim === false) && (r.push(""), o2 = 0), (o2 > 0 || t.trim === false) && (r[r.length - 1] += " ", o2++)), t.hard && D2[E] > u2) {
3007
+ const c = u2 - o2, f = 1 + Math.floor((D2[E] - c - 1) / u2);
3008
+ Math.floor((D2[E] - 1) / u2) < f && r.push(""), k(r, a, u2);
3009
+ continue;
3010
+ }
3011
+ if (o2 + D2[E] > u2 && o2 > 0 && D2[E] > 0) {
3012
+ if (t.wordWrap === false && o2 < u2) {
3013
+ k(r, a, u2);
3014
+ continue;
3015
+ }
3016
+ r.push("");
3017
+ }
3018
+ if (o2 + D2[E] > u2 && t.wordWrap === false) {
3019
+ k(r, a, u2);
3020
+ continue;
3021
+ }
3022
+ r[r.length - 1] += a;
3023
+ }
3024
+ t.trim !== false && (r = r.map((E) => hD(E)));
3025
+ const n = [...r.join(`
3026
+ `)];
3027
+ for (const [E, a] of n.entries()) {
3028
+ if (F2 += a, d.has(a)) {
3029
+ const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
3030
+ if (c.code !== void 0) {
3031
+ const f = Number.parseFloat(c.code);
3032
+ s = f === oD ? void 0 : f;
3033
+ } else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
3034
+ }
3035
+ const o2 = ED.codes.get(Number(s));
3036
+ n[E + 1] === `
3037
+ ` ? (i && (F2 += K("")), s && o2 && (F2 += z(o2))) : a === `
3038
+ ` && (s && o2 && (F2 += z(s)), i && (F2 += K(i)));
3039
+ }
3040
+ return F2;
3041
+ };
3042
+ function Y(e2, u2, t) {
3043
+ return String(e2).normalize().replace(/\r\n/g, `
3044
+ `).split(`
3045
+ `).map((F2) => lD(F2, u2, t)).join(`
3046
+ `);
3047
+ }
3048
+ var xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
3049
+ var B = { actions: new Set(xD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
3050
+ function $(e2, u2) {
3051
+ if (typeof e2 == "string") return B.aliases.get(e2) === u2;
3052
+ for (const t of e2) if (t !== void 0 && $(t, u2)) return true;
3053
+ return false;
3054
+ }
3055
+ function BD(e2, u2) {
3056
+ if (e2 === u2) return;
3057
+ const t = e2.split(`
3058
+ `), F2 = u2.split(`
3059
+ `), s = [];
3060
+ for (let i = 0; i < Math.max(t.length, F2.length); i++) t[i] !== F2[i] && s.push(i);
3061
+ return s;
3062
+ }
3063
+ var AD = globalThis.process.platform.startsWith("win");
3064
+ var S = /* @__PURE__ */ Symbol("clack:cancel");
3065
+ function pD(e2) {
3066
+ return e2 === S;
3067
+ }
3068
+ function m(e2, u2) {
3069
+ const t = e2;
3070
+ t.isTTY && t.setRawMode(u2);
3071
+ }
3072
+ function fD({ input: e2 = y2.stdin, output: u2 = y2.stdout, overwrite: t = true, hideCursor: F2 = true } = {}) {
3073
+ const s = g__namespace.createInterface({ input: e2, output: u2, prompt: "", tabSize: 1 });
3074
+ g__namespace.emitKeypressEvents(e2, s), e2.isTTY && e2.setRawMode(true);
3075
+ const i = (D2, { name: r, sequence: n }) => {
3076
+ const E = String(D2);
3077
+ if ($([E, r, n], "cancel")) {
3078
+ F2 && u2.write(import_sisteransi.cursor.show), process.exit(0);
3079
+ return;
3080
+ }
3081
+ if (!t) return;
3082
+ const a = r === "return" ? 0 : -1, o2 = r === "return" ? -1 : 0;
3083
+ g__namespace.moveCursor(u2, a, o2, () => {
3084
+ g__namespace.clearLine(u2, 1, () => {
3085
+ e2.once("keypress", i);
3086
+ });
3087
+ });
3088
+ };
3089
+ return F2 && u2.write(import_sisteransi.cursor.hide), e2.once("keypress", i), () => {
3090
+ e2.off("keypress", i), F2 && u2.write(import_sisteransi.cursor.show), e2.isTTY && !AD && e2.setRawMode(false), s.terminal = false, s.close();
3091
+ };
3092
+ }
3093
+ var gD = Object.defineProperty;
3094
+ var vD = (e2, u2, t) => u2 in e2 ? gD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
3095
+ var h = (e2, u2, t) => (vD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
3096
+ var x = class {
3097
+ constructor(u2, t = true) {
3098
+ h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
3099
+ const { input: F2 = y2.stdin, output: s = y2.stdout, render: i, signal: D2, ...r } = u2;
3100
+ this.opts = r, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D2, this.input = F2, this.output = s;
3101
+ }
3102
+ unsubscribe() {
3103
+ this._subscribers.clear();
3104
+ }
3105
+ setSubscriber(u2, t) {
3106
+ const F2 = this._subscribers.get(u2) ?? [];
3107
+ F2.push(t), this._subscribers.set(u2, F2);
3108
+ }
3109
+ on(u2, t) {
3110
+ this.setSubscriber(u2, { cb: t });
3111
+ }
3112
+ once(u2, t) {
3113
+ this.setSubscriber(u2, { cb: t, once: true });
3114
+ }
3115
+ emit(u2, ...t) {
3116
+ const F2 = this._subscribers.get(u2) ?? [], s = [];
3117
+ for (const i of F2) i.cb(...t), i.once && s.push(() => F2.splice(F2.indexOf(i), 1));
3118
+ for (const i of s) i();
3119
+ }
3120
+ prompt() {
3121
+ return new Promise((u2, t) => {
3122
+ if (this._abortSignal) {
3123
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u2(S);
3124
+ this._abortSignal.addEventListener("abort", () => {
3125
+ this.state = "cancel", this.close();
3126
+ }, { once: true });
3127
+ }
3128
+ const F2 = new stream.Writable();
3129
+ F2._write = (s, i, D2) => {
3130
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D2();
3131
+ }, this.input.pipe(F2), this.rl = g__namespace.default.createInterface({ input: this.input, output: F2, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), g__namespace.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
3132
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(this.value);
3133
+ }), this.once("cancel", () => {
3134
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(S);
3135
+ });
3136
+ });
3137
+ }
3138
+ onKeypress(u2, t) {
3139
+ if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u2 && (u2.toLowerCase() === "y" || u2.toLowerCase() === "n") && this.emit("confirm", u2.toLowerCase() === "y"), u2 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u2 && this.emit("key", u2.toLowerCase()), t?.name === "return") {
3140
+ if (!this.value && this.opts.placeholder && (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder)), this.opts.validate) {
3141
+ const F2 = this.opts.validate(this.value);
3142
+ F2 && (this.error = F2 instanceof Error ? F2.message : F2, this.state = "error", this.rl?.write(this.value));
3143
+ }
3144
+ this.state !== "error" && (this.state = "submit");
3145
+ }
3146
+ $([u2, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
3147
+ }
3148
+ close() {
3149
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
3150
+ `), m(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
3151
+ }
3152
+ restoreCursor() {
3153
+ const u2 = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
3154
+ `).length - 1;
3155
+ this.output.write(import_sisteransi.cursor.move(-999, u2 * -1));
3156
+ }
3157
+ render() {
3158
+ const u2 = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
3159
+ if (u2 !== this._prevFrame) {
3160
+ if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
3161
+ else {
3162
+ const t = BD(this._prevFrame, u2);
3163
+ if (this.restoreCursor(), t && t?.length === 1) {
3164
+ const F2 = t[0];
3165
+ this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.lines(1));
3166
+ const s = u2.split(`
3167
+ `);
3168
+ this.output.write(s[F2]), this._prevFrame = u2, this.output.write(import_sisteransi.cursor.move(0, s.length - F2 - 1));
3169
+ return;
3170
+ }
3171
+ if (t && t?.length > 1) {
3172
+ const F2 = t[0];
3173
+ this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.down());
3174
+ const s = u2.split(`
3175
+ `).slice(F2);
3176
+ this.output.write(s.join(`
3177
+ `)), this._prevFrame = u2;
3178
+ return;
3179
+ }
3180
+ this.output.write(import_sisteransi.erase.down());
3181
+ }
3182
+ this.output.write(u2), this.state === "initial" && (this.state = "active"), this._prevFrame = u2;
3183
+ }
3184
+ }
3185
+ };
3186
+ var dD = class extends x {
3187
+ get cursor() {
3188
+ return this.value ? 0 : 1;
3189
+ }
3190
+ get _value() {
3191
+ return this.cursor === 0;
3192
+ }
3193
+ constructor(u2) {
3194
+ super(u2, false), this.value = !!u2.initialValue, this.on("value", () => {
3195
+ this.value = this._value;
3196
+ }), this.on("confirm", (t) => {
3197
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
3198
+ }), this.on("cursor", () => {
3199
+ this.value = !this.value;
3200
+ });
3201
+ }
3202
+ };
3203
+ var OD = Object.defineProperty;
3204
+ var PD = (e2, u2, t) => u2 in e2 ? OD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
3205
+ var J = (e2, u2, t) => (PD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
3206
+ var LD = class extends x {
3207
+ constructor(u2) {
3208
+ super(u2, false), J(this, "options"), J(this, "cursor", 0), this.options = u2.options, this.cursor = this.options.findIndex(({ value: t }) => t === u2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
3209
+ switch (t) {
3210
+ case "left":
3211
+ case "up":
3212
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
3213
+ break;
3214
+ case "down":
3215
+ case "right":
3216
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
3217
+ break;
3218
+ }
3219
+ this.changeValue();
3220
+ });
3221
+ }
3222
+ get _value() {
3223
+ return this.options[this.cursor];
3224
+ }
3225
+ changeValue() {
3226
+ this.value = this._value.value;
3227
+ }
3228
+ };
3229
+ var RD = class extends x {
3230
+ get valueWithCursor() {
3231
+ if (this.state === "submit") return this.value;
3232
+ if (this.cursor >= this.value.length) return `${this.value}\u2588`;
3233
+ const u2 = this.value.slice(0, this.cursor), [t, ...F2] = this.value.slice(this.cursor);
3234
+ return `${u2}${import_picocolors.default.inverse(t)}${F2.join("")}`;
3235
+ }
3236
+ get cursor() {
3237
+ return this._cursor;
3238
+ }
3239
+ constructor(u2) {
3240
+ super(u2), this.on("finalize", () => {
3241
+ this.value || (this.value = u2.defaultValue);
3242
+ });
3243
+ }
3244
+ };
3245
+
3246
+ // ../../node_modules/.pnpm/@clack+prompts@0.10.1/node_modules/@clack/prompts/dist/index.mjs
3247
+ var import_picocolors2 = __toESM(require_picocolors());
3248
+ var import_sisteransi2 = __toESM(require_src());
3249
+ function ce() {
3250
+ return y2__default.default.platform !== "win32" ? y2__default.default.env.TERM !== "linux" : !!y2__default.default.env.CI || !!y2__default.default.env.WT_SESSION || !!y2__default.default.env.TERMINUS_SUBLIME || y2__default.default.env.ConEmuTask === "{cmd::Cmder}" || y2__default.default.env.TERM_PROGRAM === "Terminus-Sublime" || y2__default.default.env.TERM_PROGRAM === "vscode" || y2__default.default.env.TERM === "xterm-256color" || y2__default.default.env.TERM === "alacritty" || y2__default.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
3251
+ }
3252
+ var V2 = ce();
3253
+ var u = (t, n) => V2 ? t : n;
3254
+ var le = u("\u25C6", "*");
3255
+ var L2 = u("\u25A0", "x");
3256
+ var W2 = u("\u25B2", "x");
3257
+ var C2 = u("\u25C7", "o");
3258
+ var ue = u("\u250C", "T");
3259
+ var o = u("\u2502", "|");
3260
+ var d2 = u("\u2514", "\u2014");
3261
+ var k2 = u("\u25CF", ">");
3262
+ var P2 = u("\u25CB", " ");
3263
+ var q = u("\u25CF", "\u2022");
3264
+ var D = u("\u25C6", "*");
3265
+ var U = u("\u25B2", "!");
3266
+ var K2 = u("\u25A0", "x");
3267
+ var b2 = (t) => {
3268
+ switch (t) {
3269
+ case "initial":
3270
+ case "active":
3271
+ return import_picocolors2.default.cyan(le);
3272
+ case "cancel":
3273
+ return import_picocolors2.default.red(L2);
3274
+ case "error":
3275
+ return import_picocolors2.default.yellow(W2);
3276
+ case "submit":
3277
+ return import_picocolors2.default.green(C2);
3278
+ }
3279
+ };
3280
+ var G2 = (t) => {
3281
+ const { cursor: n, options: r, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
3282
+ let l2 = 0;
3283
+ n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
3284
+ const $2 = a < r.length && l2 > 0, g2 = a < r.length && l2 + a < r.length;
3285
+ return r.slice(l2, l2 + a).map((p2, v2, f) => {
3286
+ const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
3287
+ return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
3288
+ });
3289
+ };
3290
+ var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
3291
+ const n = `${import_picocolors2.default.gray(o)}
3292
+ ${b2(this.state)} ${t.message}
3293
+ `, r = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r;
3294
+ switch (this.state) {
3295
+ case "error":
3296
+ return `${n.trim()}
3297
+ ${import_picocolors2.default.yellow(o)} ${i}
3298
+ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
3299
+ `;
3300
+ case "submit":
3301
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
3302
+ case "cancel":
3303
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
3304
+ ${import_picocolors2.default.gray(o)}` : ""}`;
3305
+ default:
3306
+ return `${n}${import_picocolors2.default.cyan(o)} ${i}
3307
+ ${import_picocolors2.default.cyan(d2)}
3308
+ `;
3309
+ }
3310
+ } }).prompt();
3311
+ var ye = (t) => {
3312
+ const n = t.active ?? "Yes", r = t.inactive ?? "No";
3313
+ return new dD({ active: n, inactive: r, initialValue: t.initialValue ?? true, render() {
3314
+ const i = `${import_picocolors2.default.gray(o)}
3315
+ ${b2(this.state)} ${t.message}
3316
+ `, s = this.value ? n : r;
3317
+ switch (this.state) {
3318
+ case "submit":
3319
+ return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
3320
+ case "cancel":
3321
+ return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
3322
+ ${import_picocolors2.default.gray(o)}`;
3323
+ default:
3324
+ return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r)}` : `${import_picocolors2.default.green(k2)} ${r}`}
3325
+ ${import_picocolors2.default.cyan(d2)}
3326
+ `;
3327
+ }
3328
+ } }).prompt();
3329
+ };
3330
+ var ve = (t) => {
3331
+ const n = (r, i) => {
3332
+ const s = r.label ?? String(r.value);
3333
+ switch (i) {
3334
+ case "selected":
3335
+ return `${import_picocolors2.default.dim(s)}`;
3336
+ case "active":
3337
+ return `${import_picocolors2.default.green(k2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
3338
+ case "cancelled":
3339
+ return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
3340
+ default:
3341
+ return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}`;
3342
+ }
3343
+ };
3344
+ return new LD({ options: t.options, initialValue: t.initialValue, render() {
3345
+ const r = `${import_picocolors2.default.gray(o)}
3346
+ ${b2(this.state)} ${t.message}
3347
+ `;
3348
+ switch (this.state) {
3349
+ case "submit":
3350
+ return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
3351
+ case "cancel":
3352
+ return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
3353
+ ${import_picocolors2.default.gray(o)}`;
3354
+ default:
3355
+ return `${r}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
3356
+ ${import_picocolors2.default.cyan(o)} `)}
3357
+ ${import_picocolors2.default.cyan(d2)}
3358
+ `;
3359
+ }
3360
+ } }).prompt();
3361
+ };
3362
+ var xe = (t = "") => {
3363
+ process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(t)}
3364
+
3365
+ `);
3366
+ };
3367
+ var Ie = (t = "") => {
3368
+ process.stdout.write(`${import_picocolors2.default.gray(ue)} ${t}
3369
+ `);
3370
+ };
3371
+ var Se = (t = "") => {
3372
+ process.stdout.write(`${import_picocolors2.default.gray(o)}
3373
+ ${import_picocolors2.default.gray(d2)} ${t}
3374
+
3375
+ `);
3376
+ };
3377
+ var M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
3378
+ const r = [`${import_picocolors2.default.gray(o)}`];
3379
+ if (t) {
3380
+ const [i, ...s] = t.split(`
3381
+ `);
3382
+ r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
3383
+ }
3384
+ process.stdout.write(`${r.join(`
3385
+ `)}
3386
+ `);
3387
+ }, info: (t) => {
3388
+ M2.message(t, { symbol: import_picocolors2.default.blue(q) });
3389
+ }, success: (t) => {
3390
+ M2.message(t, { symbol: import_picocolors2.default.green(D) });
3391
+ }, step: (t) => {
3392
+ M2.message(t, { symbol: import_picocolors2.default.green(C2) });
3393
+ }, warn: (t) => {
3394
+ M2.message(t, { symbol: import_picocolors2.default.yellow(U) });
3395
+ }, warning: (t) => {
3396
+ M2.warn(t);
3397
+ }, error: (t) => {
3398
+ M2.message(t, { symbol: import_picocolors2.default.red(K2) });
3399
+ } };
3400
+ `${import_picocolors2.default.gray(o)} `;
3401
+ var Y2 = ({ indicator: t = "dots" } = {}) => {
3402
+ const n = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], r = V2 ? 80 : 120, i = process.env.CI === "true";
3403
+ let s, c, a = false, l2 = "", $2, g2 = performance.now();
3404
+ const p2 = (m2) => {
3405
+ const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
3406
+ a && N2(h2, m2);
3407
+ }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
3408
+ process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
3409
+ }, E = () => {
3410
+ process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
3411
+ }, B2 = () => {
3412
+ if ($2 === void 0) return;
3413
+ i && process.stdout.write(`
3414
+ `);
3415
+ const m2 = $2.split(`
3416
+ `);
3417
+ process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
3418
+ }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
3419
+ const h2 = (performance.now() - m2) / 1e3, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
3420
+ return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
3421
+ }, H = (m2 = "") => {
3422
+ a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
3423
+ `);
3424
+ let h2 = 0, w2 = 0;
3425
+ j2(), c = setInterval(() => {
3426
+ if (i && l2 === $2) return;
3427
+ B2(), $2 = l2;
3428
+ const I2 = import_picocolors2.default.magenta(n[h2]);
3429
+ if (i) process.stdout.write(`${I2} ${l2}...`);
3430
+ else if (t === "timer") process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
3431
+ else {
3432
+ const z9 = ".".repeat(Math.floor(w2)).slice(0, 3);
3433
+ process.stdout.write(`${I2} ${l2}${z9}`);
3434
+ }
3435
+ h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
3436
+ }, r);
3437
+ }, N2 = (m2 = "", h2 = 0) => {
3438
+ a = false, clearInterval(c), B2();
3439
+ const w2 = h2 === 0 ? import_picocolors2.default.green(C2) : h2 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
3440
+ l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
3441
+ `) : process.stdout.write(`${w2} ${l2}
3442
+ `), E(), s();
3443
+ };
3444
+ return { start: H, stop: N2, message: (m2 = "") => {
3445
+ l2 = R2(m2 ?? l2);
3446
+ } };
3447
+ };
3448
+
3449
+ // src/index.tsx
3450
+ init_color();
3451
+ init_codegen();
3452
+ init_constants();
3453
+ init_utils();
3454
+
3455
+ // types/index.ts
3456
+ init_color2();
3457
+ init_color();
3458
+ zod.z.object({
3459
+ x: zod.z.number(),
3460
+ y: zod.z.number(),
3461
+ w: zod.z.number(),
3462
+ h: zod.z.number()
3463
+ });
3464
+ var CORNER_EYE_DOT_PATTERNS = [
3465
+ "square",
3466
+ "rounded",
3467
+ "circle",
3468
+ "diamond",
3469
+ "message",
3470
+ "message-reverse",
3471
+ "diya",
3472
+ "diya-reverse",
3473
+ "rounded-triangle",
3474
+ "star",
3475
+ "banner"
3476
+ ];
3477
+ var cornerEyeDotPatternSchema = zod.z.enum(CORNER_EYE_DOT_PATTERNS);
3478
+ var CORNER_EYE_PATTERNS = [
3479
+ "square",
3480
+ "rounded",
3481
+ "gear",
3482
+ "circle",
3483
+ "diya",
3484
+ "extra-rounded",
3485
+ "message",
3486
+ "pointy",
3487
+ "curly"
3488
+ ];
3489
+ var cornerEyePatternSchema = zod.z.enum(CORNER_EYE_PATTERNS);
3490
+ var BODY_PATTERN = [
3491
+ "circle",
3492
+ "circle-large",
3493
+ "square",
3494
+ "diamond",
3495
+ "circle-mixed",
3496
+ "pacman",
3497
+ "rounded",
3498
+ "small-square",
3499
+ "vertical-line"
3500
+ ];
3501
+ var bodyPatternSchema = zod.z.enum(BODY_PATTERN);
3502
+
3503
+ // types/index.ts
3504
+ init_constants();
3505
+
3506
+ // types/qr.ts
3507
+ init_color();
3508
+ var imageSettingsSchema = zod.z.object({
3509
+ src: zod.z.string(),
3510
+ height: zod.z.number(),
3511
+ width: zod.z.number(),
3512
+ excavate: zod.z.boolean(),
3513
+ x: zod.z.number().optional(),
3514
+ y: zod.z.number().optional()
3515
+ });
3516
+ var errorLevelSchema = zod.z.enum(["L", "M", "Q", "H"]);
3517
+ zod.z.object({
3518
+ value: zod.z.string(),
3519
+ size: zod.z.number().optional(),
3520
+ level: errorLevelSchema.optional(),
3521
+ bgColor: colorConfigSchema.optional(),
3522
+ fgColor: colorConfigSchema.optional(),
3523
+ eyeColor: colorConfigSchema.optional(),
3524
+ dotColor: colorConfigSchema.optional(),
3525
+ bodyPattern: bodyPatternSchema.optional(),
3526
+ cornerEyePattern: cornerEyePatternSchema.optional(),
3527
+ cornerEyeDotPattern: cornerEyeDotPatternSchema.optional(),
3528
+ margin: zod.z.number().optional(),
3529
+ imageSettings: imageSettingsSchema.optional(),
3530
+ isOGContext: zod.z.boolean().optional(),
3531
+ templateId: zod.z.string().optional(),
3532
+ customProps: zod.z.record(zod.z.string(), zod.z.any()).optional()
3533
+ });
3534
+ zod.z.object({
3535
+ fgColor: zod.z.string().optional(),
3536
+ bgColor: zod.z.string().optional()
3537
+ });
3538
+ zod.z.object({
3539
+ pixelSize: zod.z.number(),
3540
+ url: zod.z.string()
3541
+ });
3542
+ zod.z.object({
3543
+ id: zod.z.string(),
3544
+ name: zod.z.string(),
3545
+ description: zod.z.string().optional()
3546
+ });
3547
+
3548
+ // src/api.tsx
3549
+ init_codegen();
3550
+ init_constants();
3551
+ init_utils();
3552
+ init_color2();
3553
+
3554
+ // src/download.tsx
3555
+ init_constants();
3556
+
3557
+ // src/qr-code.tsx
3558
+ init_constants();
3559
+
3560
+ // src/helpers.ts
3561
+ init_constants();
3562
+ function getQRData({
3563
+ value,
3564
+ size = 1024,
3565
+ fgColor,
3566
+ bgColor,
3567
+ eyeColor,
3568
+ dotColor,
3569
+ bodyPattern,
3570
+ hideLogo,
3571
+ logo,
3572
+ margin,
3573
+ cornerEyePattern,
3574
+ cornerEyeDotPattern,
3575
+ level,
3576
+ templateId
3577
+ }) {
3578
+ return {
3579
+ value: `${value}`,
3580
+ bgColor,
3581
+ fgColor,
3582
+ eyeColor,
3583
+ dotColor,
3584
+ bodyPattern,
3585
+ cornerEyePattern,
3586
+ cornerEyeDotPattern,
3587
+ level,
3588
+ templateId,
3589
+ size,
3590
+ margin,
3591
+ ...!hideLogo && {
3592
+ imageSettings: {
3593
+ src: logo || FLAM_QR_LOGO,
3594
+ height: 256,
3595
+ width: 256,
3596
+ excavate: true
3597
+ }
3598
+ }
3599
+ };
3600
+ }
3601
+
3602
+ // src/qr-code.tsx
3603
+ init_utils();
3604
+ var QRCode = React.memo(
3605
+ ({
3606
+ value,
3607
+ fgColor,
3608
+ hideLogo,
3609
+ logo,
3610
+ bgColor,
3611
+ eyeColor,
3612
+ dotColor,
3613
+ bodyPattern,
3614
+ cornerEyePattern,
3615
+ cornerEyeDotPattern,
3616
+ level,
3617
+ scale = 1,
3618
+ margin = DEFAULT_MARGIN,
3619
+ templateId,
3620
+ customTemplate,
3621
+ customProps
3622
+ }) => {
3623
+ const qrData = React.useMemo(
3624
+ () => getQRData({
3625
+ value,
3626
+ fgColor,
3627
+ hideLogo,
3628
+ bgColor,
3629
+ eyeColor,
3630
+ dotColor,
3631
+ bodyPattern,
3632
+ cornerEyePattern,
3633
+ cornerEyeDotPattern,
3634
+ level,
3635
+ templateId,
3636
+ logo,
3637
+ margin
3638
+ }),
3639
+ [
3640
+ value,
3641
+ fgColor,
3642
+ hideLogo,
3643
+ logo,
3644
+ margin,
3645
+ bgColor,
3646
+ eyeColor,
3647
+ dotColor,
3648
+ bodyPattern,
3649
+ cornerEyePattern,
3650
+ cornerEyeDotPattern,
3651
+ level,
3652
+ templateId
3653
+ ]
3654
+ );
3655
+ return /* @__PURE__ */ jsxRuntime.jsx(
3656
+ QRCodeSVG,
3657
+ {
3658
+ bgColor: qrData.bgColor,
3659
+ bodyPattern: qrData.bodyPattern,
3660
+ cornerEyeDotPattern: qrData.cornerEyeDotPattern,
3661
+ cornerEyePattern: qrData.cornerEyePattern,
3662
+ customProps,
3663
+ customTemplate,
3664
+ dotColor: qrData.dotColor,
3665
+ eyeColor: qrData.eyeColor,
3666
+ fgColor: qrData.fgColor,
3667
+ level: level || qrData.level,
3668
+ margin: qrData.margin,
3669
+ size: qrData.size / 8 * scale,
3670
+ templateId: qrData.templateId,
3671
+ value: qrData.value,
3672
+ ...qrData.imageSettings && {
3673
+ imageSettings: {
3674
+ ...qrData.imageSettings,
3675
+ height: qrData.imageSettings ? qrData.imageSettings.height / 8 * scale : 0,
3676
+ width: qrData.imageSettings ? qrData.imageSettings.width / 8 * scale : 0
3677
+ }
3678
+ }
3679
+ }
3680
+ );
3681
+ }
3682
+ );
3683
+ QRCode.displayName = "QRCode";
3684
+
3685
+ // src/index.tsx
3686
+ init_templates();
3687
+ init_utils();
3688
+ function buildSVGString(props) {
3689
+ const element = React.createElement(QRCodeSVG, {
3690
+ size: props.size ?? 512,
3691
+ ...props
3692
+ });
3693
+ return server.renderToStaticMarkup(element);
3694
+ }
3695
+ async function saveOutput(options) {
3696
+ const { outputPath, format, ...qrProps } = options;
3697
+ const svgString = buildSVGString(qrProps);
3698
+ if (format === "svg") {
3699
+ const svgContent = `<?xml version="1.0" encoding="UTF-8"?>
3700
+ ${svgString}`;
3701
+ fs.writeFileSync(outputPath, svgContent, "utf-8");
3702
+ return;
3703
+ }
3704
+ const sharp = (await import('sharp')).default;
3705
+ const svgBuffer = Buffer.from(svgString, "utf-8");
3706
+ const size = qrProps.size ?? 512;
3707
+ await sharp(svgBuffer).resize(size, size).png().toFile(outputPath);
3708
+ }
3709
+
3710
+ // ../cli/src/commands/generate.ts
3711
+ var RESET = "\x1B[0m";
3712
+ var TEXT = "\x1B[38;5;145m";
3713
+ var GREEN = "\x1B[38;5;114m";
3714
+ var DIM = "\x1B[38;5;102m";
3715
+ var IS_TTY = Boolean(process.stdin.isTTY);
3716
+ function parseFlags(args) {
3717
+ const flags = {};
3718
+ let i = 0;
3719
+ while (i < args.length) {
3720
+ const arg = args[i];
3721
+ if (!arg.startsWith("-")) {
3722
+ if (!flags.value) {
3723
+ flags.value = arg;
3724
+ }
3725
+ i++;
3726
+ continue;
3727
+ }
3728
+ const next = args[i + 1];
3729
+ switch (arg) {
3730
+ case "-o":
3731
+ case "--output":
3732
+ flags.output = next;
3733
+ i += 2;
3734
+ break;
3735
+ case "-l":
3736
+ case "--level":
3737
+ flags.level = next;
3738
+ i += 2;
3739
+ break;
3740
+ case "--body":
3741
+ flags.body = next;
3742
+ i += 2;
3743
+ break;
3744
+ case "--eye":
3745
+ flags.eye = next;
3746
+ i += 2;
3747
+ break;
3748
+ case "--dot":
3749
+ flags.dot = next;
3750
+ i += 2;
3751
+ break;
3752
+ case "--fg":
3753
+ flags.fg = next;
3754
+ i += 2;
3755
+ break;
3756
+ case "--bg":
3757
+ flags.bg = next;
3758
+ i += 2;
3759
+ break;
3760
+ case "--eye-color":
3761
+ flags.eyeColor = next;
3762
+ i += 2;
3763
+ break;
3764
+ case "--dot-color":
3765
+ flags.dotColor = next;
3766
+ i += 2;
3767
+ break;
3768
+ case "--logo":
3769
+ flags.logo = next;
3770
+ i += 2;
3771
+ break;
3772
+ case "--margin":
3773
+ flags.margin = next ? Number.parseInt(next, 10) : DEFAULT_MARGIN;
3774
+ i += 2;
3775
+ break;
3776
+ case "--size":
3777
+ flags.size = next ? Number.parseInt(next, 10) : 512;
3778
+ i += 2;
3779
+ break;
3780
+ case "--no-logo":
3781
+ flags.noLogo = true;
3782
+ i++;
3783
+ break;
3784
+ default:
3785
+ i++;
3786
+ }
3787
+ }
3788
+ return flags;
3789
+ }
3790
+ function isCancel(value) {
3791
+ return pD(value);
3792
+ }
3793
+ function handleCancel() {
3794
+ xe("Cancelled.");
3795
+ process.exit(0);
3796
+ }
3797
+ function inferFormat(outputPath) {
3798
+ const ext = path.extname(outputPath).toLowerCase();
3799
+ if (ext === ".png") {
3800
+ return "png";
3801
+ }
3802
+ return "svg";
3803
+ }
3804
+ async function runGenerate(args) {
3805
+ const flags = parseFlags(args);
3806
+ const nonInteractive = !IS_TTY;
3807
+ const hasAdvancedFlags = Boolean(
3808
+ flags.body || flags.eye || flags.dot || flags.fg || flags.bg || flags.eyeColor || flags.dotColor || flags.logo || flags.level || flags.margin !== void 0
3809
+ );
3810
+ Ie(`${TEXT}qrdx${RESET} ${DIM}\u2014 QR Code Generator${RESET}`);
3811
+ let value = flags.value;
3812
+ if (!value) {
3813
+ if (nonInteractive) {
3814
+ M2.error("No data provided. Pass a URL or text as an argument.");
3815
+ process.exit(1);
3816
+ }
3817
+ const res = await he({
3818
+ message: "URL or text to encode",
3819
+ placeholder: "https://qrdx.dev",
3820
+ validate(v2) {
3821
+ if (!v2.trim()) {
3822
+ return "Please enter a value to encode.";
3823
+ }
3824
+ }
3825
+ });
3826
+ if (isCancel(res)) {
3827
+ handleCancel();
3828
+ }
3829
+ value = res;
3830
+ }
3831
+ let outputPath = flags.output;
3832
+ const size = flags.size ?? 512;
3833
+ if (!(outputPath || nonInteractive)) {
3834
+ const pathRes = await he({
3835
+ message: "Output file (.svg or .png)",
3836
+ placeholder: "qr.svg",
3837
+ defaultValue: "qr.svg",
3838
+ validate(v2) {
3839
+ if (!v2.trim()) {
3840
+ return "Please enter an output path.";
3841
+ }
3842
+ }
3843
+ });
3844
+ if (isCancel(pathRes)) {
3845
+ handleCancel();
3846
+ }
3847
+ outputPath = pathRes || "qr.svg";
3848
+ }
3849
+ let wantAdvanced = hasAdvancedFlags;
3850
+ if (!(hasAdvancedFlags || nonInteractive)) {
3851
+ const res = await ye({
3852
+ message: "Advanced customizations?",
3853
+ initialValue: false
3854
+ });
3855
+ if (isCancel(res)) {
3856
+ handleCancel();
3857
+ }
3858
+ wantAdvanced = res;
3859
+ }
3860
+ let level = flags.level ?? "Q";
3861
+ let body = flags.body ?? "square";
3862
+ let eye = flags.eye ?? "square";
3863
+ let dot = flags.dot ?? "square";
3864
+ let fg = flags.fg ?? "#000000";
3865
+ let bg = flags.bg ?? "#ffffff";
3866
+ let eyeColor = flags.eyeColor;
3867
+ let dotColor = flags.dotColor;
3868
+ let logo = flags.logo;
3869
+ let margin = flags.margin ?? DEFAULT_MARGIN;
3870
+ if (wantAdvanced && !nonInteractive) {
3871
+ if (!flags.level) {
3872
+ const res = await ve({
3873
+ message: "Error correction level",
3874
+ options: [
3875
+ {
3876
+ value: "Q",
3877
+ label: "Q \u2013 Quartile (recommended)",
3878
+ hint: "~25% data recovery"
3879
+ },
3880
+ { value: "L", label: "L \u2013 Low", hint: "~7% data recovery" },
3881
+ { value: "M", label: "M \u2013 Medium", hint: "~15% data recovery" },
3882
+ { value: "H", label: "H \u2013 High", hint: "~30% data recovery" }
3883
+ ],
3884
+ initialValue: "Q"
3885
+ });
3886
+ if (isCancel(res)) {
3887
+ handleCancel();
3888
+ }
3889
+ level = res;
3890
+ }
3891
+ if (!flags.body) {
3892
+ const res = await ve({
3893
+ message: "Body dot pattern",
3894
+ options: BODY_PATTERN.map((b3) => ({ value: b3, label: b3 })),
3895
+ initialValue: "square"
3896
+ });
3897
+ if (isCancel(res)) {
3898
+ handleCancel();
3899
+ }
3900
+ body = res;
3901
+ }
3902
+ if (!flags.eye) {
3903
+ const res = await ve({
3904
+ message: "Corner eye pattern",
3905
+ options: CORNER_EYE_PATTERNS.map((e2) => ({ value: e2, label: e2 })),
3906
+ initialValue: "square"
3907
+ });
3908
+ if (isCancel(res)) {
3909
+ handleCancel();
3910
+ }
3911
+ eye = res;
3912
+ }
3913
+ if (!flags.dot) {
3914
+ const res = await ve({
3915
+ message: "Corner dot pattern",
3916
+ options: CORNER_EYE_DOT_PATTERNS.map((d3) => ({ value: d3, label: d3 })),
3917
+ initialValue: "square"
3918
+ });
3919
+ if (isCancel(res)) {
3920
+ handleCancel();
3921
+ }
3922
+ dot = res;
3923
+ }
3924
+ if (!flags.fg) {
3925
+ const res = await he({
3926
+ message: "Foreground color",
3927
+ placeholder: "#000000",
3928
+ defaultValue: "#000000",
3929
+ validate(v2) {
3930
+ if (v2 && !/^#[0-9a-fA-F]{3,8}$/.test(v2)) {
3931
+ return "Enter a valid hex color (e.g. #000000)";
3932
+ }
3933
+ }
3934
+ });
3935
+ if (isCancel(res)) {
3936
+ handleCancel();
3937
+ }
3938
+ fg = res || "#000000";
3939
+ }
3940
+ if (!flags.bg) {
3941
+ const res = await he({
3942
+ message: "Background color",
3943
+ placeholder: "#ffffff",
3944
+ defaultValue: "#ffffff",
3945
+ validate(v2) {
3946
+ if (v2 && !/^#[0-9a-fA-F]{3,8}$/.test(v2)) {
3947
+ return "Enter a valid hex color (e.g. #ffffff)";
3948
+ }
3949
+ }
3950
+ });
3951
+ if (isCancel(res)) {
3952
+ handleCancel();
3953
+ }
3954
+ bg = res || "#ffffff";
3955
+ }
3956
+ if (eyeColor === void 0) {
3957
+ const res = await he({
3958
+ message: `Corner eye color ${DIM}(leave blank to match foreground)${RESET}`,
3959
+ placeholder: fg,
3960
+ validate(v2) {
3961
+ if (v2 && !/^#[0-9a-fA-F]{3,8}$/.test(v2)) {
3962
+ return "Enter a valid hex color or leave blank";
3963
+ }
3964
+ }
3965
+ });
3966
+ if (isCancel(res)) {
3967
+ handleCancel();
3968
+ }
3969
+ eyeColor = res || void 0;
3970
+ }
3971
+ if (dotColor === void 0) {
3972
+ const res = await he({
3973
+ message: `Corner dot color ${DIM}(leave blank to match foreground)${RESET}`,
3974
+ placeholder: fg,
3975
+ validate(v2) {
3976
+ if (v2 && !/^#[0-9a-fA-F]{3,8}$/.test(v2)) {
3977
+ return "Enter a valid hex color or leave blank";
3978
+ }
3979
+ }
3980
+ });
3981
+ if (isCancel(res)) {
3982
+ handleCancel();
3983
+ }
3984
+ dotColor = res || void 0;
3985
+ }
3986
+ if (logo === void 0 && !flags.noLogo) {
3987
+ const addLogo = await ye({
3988
+ message: "Add a logo to the center?",
3989
+ initialValue: false
3990
+ });
3991
+ if (isCancel(addLogo)) {
3992
+ handleCancel();
3993
+ }
3994
+ if (addLogo) {
3995
+ const res = await he({
3996
+ message: "Logo URL",
3997
+ placeholder: "https://qrdx.dev/logo.png",
3998
+ validate(v2) {
3999
+ if (!v2.trim()) {
4000
+ return "Please enter a URL for the logo.";
4001
+ }
4002
+ try {
4003
+ new URL(v2);
4004
+ } catch {
4005
+ return "Please enter a valid URL.";
4006
+ }
4007
+ }
4008
+ });
4009
+ if (isCancel(res)) {
4010
+ handleCancel();
4011
+ }
4012
+ logo = res;
4013
+ }
4014
+ }
4015
+ if (flags.margin === void 0) {
4016
+ const res = await he({
4017
+ message: "Quiet zone margin (modules)",
4018
+ placeholder: String(DEFAULT_MARGIN),
4019
+ defaultValue: String(DEFAULT_MARGIN),
4020
+ validate(v2) {
4021
+ if (v2 && Number.isNaN(Number.parseInt(v2, 10))) {
4022
+ return "Enter a number";
4023
+ }
4024
+ if (v2 && Number.parseInt(v2, 10) < 0) {
4025
+ return "Must be 0 or greater";
4026
+ }
4027
+ }
4028
+ });
4029
+ if (isCancel(res)) {
4030
+ handleCancel();
4031
+ }
4032
+ margin = Number.parseInt(res || String(DEFAULT_MARGIN), 10);
4033
+ }
4034
+ }
4035
+ const spinner = Y2();
4036
+ spinner.start("Generating QR code...");
4037
+ try {
4038
+ const qrProps = {
4039
+ value,
4040
+ level,
4041
+ bodyPattern: body,
4042
+ cornerEyePattern: eye,
4043
+ cornerEyeDotPattern: dot,
4044
+ fgColor: fg,
4045
+ bgColor: bg,
4046
+ ...eyeColor ? { eyeColor } : {},
4047
+ ...dotColor ? { dotColor } : {},
4048
+ margin,
4049
+ size,
4050
+ ...logo ? {
4051
+ imageSettings: {
4052
+ src: logo,
4053
+ height: Math.round(size * 0.2),
4054
+ width: Math.round(size * 0.2),
4055
+ excavate: true
4056
+ }
4057
+ } : {}
4058
+ };
4059
+ if (outputPath) {
4060
+ const format = inferFormat(outputPath);
4061
+ await saveOutput({ ...qrProps, outputPath, format });
4062
+ spinner.stop(
4063
+ `${GREEN}\u2714${RESET} Saved to ${TEXT}${outputPath}${RESET} ${DIM}(${size}\xD7${size})${RESET}`
4064
+ );
4065
+ } else {
4066
+ spinner.stop("QR code ready");
4067
+ }
4068
+ } catch (err) {
4069
+ spinner.stop("Failed to generate QR code");
4070
+ const msg = err instanceof Error ? err.message : String(err);
4071
+ M2.error(msg);
4072
+ process.exit(1);
4073
+ }
4074
+ Se(`${DIM}Done!${RESET}`);
4075
+ }
4076
+
4077
+ // ../cli/src/index.ts
4078
+ var RESET2 = "\x1B[0m";
4079
+ var BOLD = "\x1B[1m";
4080
+ var DIM2 = "\x1B[38;5;102m";
4081
+ var TEXT2 = "\x1B[38;5;145m";
4082
+ var GRAYS = [
4083
+ "\x1B[38;5;250m",
4084
+ "\x1B[38;5;248m",
4085
+ "\x1B[38;5;245m",
4086
+ "\x1B[38;5;243m",
4087
+ "\x1B[38;5;240m",
4088
+ "\x1B[38;5;238m"
4089
+ ];
4090
+ var LOGO_LINES = [
4091
+ " \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557",
4092
+ "\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u255A\u2588\u2588\u2557\u2588\u2588\u2554\u255D",
4093
+ "\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2554\u255D ",
4094
+ "\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2588\u2588\u2557 ",
4095
+ "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2554\u255D \u2588\u2588\u2557",
4096
+ " \u255A\u2550\u2550\u2550\u2588\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"
4097
+ ];
4098
+ function getVersion() {
4099
+ try {
4100
+ const pkgPath = path.join(__dirname, "..", "package.json");
4101
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
4102
+ return pkg.version;
4103
+ } catch {
4104
+ return "0.0.1";
4105
+ }
4106
+ }
4107
+ var VERSION = getVersion();
4108
+ function showLogo() {
4109
+ console.log();
4110
+ LOGO_LINES.forEach((line, i) => {
4111
+ console.log(`${GRAYS[i] ?? GRAYS[5]}${line}${RESET2}`);
4112
+ });
4113
+ }
4114
+ function showBanner() {
4115
+ showLogo();
4116
+ console.log();
4117
+ console.log(`${DIM2}QR code generator for developers${RESET2}`);
4118
+ console.log();
4119
+ console.log(
4120
+ ` ${DIM2}$${RESET2} ${TEXT2}qrdx generate${RESET2} ${DIM2}Generate a QR code interactively${RESET2}`
4121
+ );
4122
+ console.log(
4123
+ ` ${DIM2}$${RESET2} ${TEXT2}qrdx generate${RESET2} ${DIM2}<url>${RESET2} ${DIM2}Generate from URL${RESET2}`
4124
+ );
4125
+ console.log();
4126
+ console.log(
4127
+ ` ${DIM2}$${RESET2} ${TEXT2}qrdx --help${RESET2} ${DIM2}Show all commands and options${RESET2}`
4128
+ );
4129
+ console.log(
4130
+ ` ${DIM2}$${RESET2} ${TEXT2}qrdx --version${RESET2} ${DIM2}Show version${RESET2}`
4131
+ );
4132
+ console.log();
4133
+ console.log(` ${DIM2}try:${RESET2} npx qrdx-cli generate "https://qrdx.dev"`);
4134
+ console.log();
4135
+ }
4136
+ function showHelp() {
4137
+ showLogo();
4138
+ console.log(`
4139
+ ${BOLD}Usage:${RESET2} qrdx <command> [options]
4140
+
4141
+ ${BOLD}Commands:${RESET2}
4142
+ generate, gen, g Generate a QR code (fully interactive or via flags)
4143
+
4144
+ ${BOLD}Generate Options:${RESET2}
4145
+ <data> URL or text to encode (positional)
4146
+ -o, --output Output file path (.svg or .png)
4147
+ -l, --level Error correction: L, M, Q, H ${DIM2}(default: Q)${RESET2}
4148
+ --body Body dot pattern:
4149
+ ${DIM2}square, circle, circle-large, diamond,${RESET2}
4150
+ ${DIM2}circle-mixed, pacman, rounded, small-square, vertical-line${RESET2}
4151
+ --eye Corner eye pattern:
4152
+ ${DIM2}square, rounded, gear, circle, diya,${RESET2}
4153
+ ${DIM2}extra-rounded, message, pointy, curly${RESET2}
4154
+ --dot Corner dot pattern:
4155
+ ${DIM2}square, rounded, circle, diamond, message,${RESET2}
4156
+ ${DIM2}message-reverse, diya, diya-reverse,${RESET2}
4157
+ ${DIM2}rounded-triangle, star, banner${RESET2}
4158
+ --fg Foreground color ${DIM2}(default: #000000)${RESET2}
4159
+ --bg Background color ${DIM2}(default: #ffffff)${RESET2}
4160
+ --eye-color Corner eye color ${DIM2}(default: matches --fg)${RESET2}
4161
+ --dot-color Corner dot color ${DIM2}(default: matches --fg)${RESET2}
4162
+ --logo Logo URL for center image
4163
+ --margin Quiet zone margin in modules ${DIM2}(default: 0)${RESET2}
4164
+ --size Output pixel size for SVG/PNG ${DIM2}(default: 512)${RESET2}
4165
+
4166
+ ${BOLD}Global Options:${RESET2}
4167
+ --help, -h Show this help message
4168
+ --version, -v Show version number
4169
+
4170
+ ${BOLD}Examples:${RESET2}
4171
+ ${DIM2}$${RESET2} qrdx generate
4172
+ ${DIM2}$${RESET2} qrdx generate "https://qrdx.dev"
4173
+ ${DIM2}$${RESET2} qrdx generate "https://qrdx.dev" -o qr.svg
4174
+ ${DIM2}$${RESET2} qrdx generate "https://qrdx.dev" -o qr.png --body circle --eye gear --dot star
4175
+ ${DIM2}$${RESET2} qrdx generate "https://qrdx.dev" --fg "#ff0000" --bg "#ffffff" --size 1024
4176
+ ${DIM2}$${RESET2} qrdx generate "https://qrdx.dev" --logo "https://qrdx.dev/logo.png" -o branded.svg
4177
+
4178
+ Visit ${TEXT2}https://qrdx.dev${RESET2} for more.
4179
+ `);
4180
+ }
4181
+ async function main() {
4182
+ const args = process.argv.slice(2);
4183
+ if (args.length === 0) {
4184
+ showBanner();
4185
+ return;
4186
+ }
4187
+ const command = args[0];
4188
+ const restArgs = args.slice(1);
4189
+ switch (command) {
4190
+ case "generate":
4191
+ case "gen":
4192
+ case "g":
4193
+ showLogo();
4194
+ console.log();
4195
+ await runGenerate(restArgs);
4196
+ break;
4197
+ case "--help":
4198
+ case "-h":
4199
+ case "help":
4200
+ showHelp();
4201
+ break;
4202
+ case "--version":
4203
+ case "-v":
4204
+ console.log(VERSION);
4205
+ break;
4206
+ default:
4207
+ if (command.startsWith("-")) {
4208
+ console.log(`Unknown command: ${command}`);
4209
+ console.log(`Run ${BOLD}qrdx --help${RESET2} for usage.`);
4210
+ } else {
4211
+ showLogo();
4212
+ console.log();
4213
+ await runGenerate(args);
4214
+ }
4215
+ }
4216
+ }
4217
+ main().catch((err) => {
4218
+ const msg = err instanceof Error ? err.message : String(err);
4219
+ console.error(`\x1B[38;5;203m\u2717 ${msg}${RESET2}`);
4220
+ process.exit(1);
4221
+ });
4222
+ /**
4223
+ * @license QR Code generator library (TypeScript)
4224
+ * Copyright (c) Project Nayuki.
4225
+ * SPDX-License-Identifier: MIT
4226
+ */
4227
+ /**
4228
+ * @license qrcode.react
4229
+ * Copyright (c) Paul O'Shannessy
4230
+ * SPDX-License-Identifier: ISC
4231
+ */