qrdx 0.0.54 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/core.js +7 -7
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +7 -7
- package/dist/core.mjs.map +1 -1
- package/dist/element.browser.mjs +6 -67
- package/dist/element.browser.mjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/dist/qr-code-canvas.js +1 -1
- package/dist/qr-code-canvas.js.map +1 -1
- package/dist/qr-code-canvas.mjs +1 -1
- package/dist/qr-code-canvas.mjs.map +1 -1
- package/dist/schemas.js +2 -0
- package/dist/schemas.js.map +1 -0
- package/dist/schemas.mjs +2 -0
- package/dist/schemas.mjs.map +1 -0
- package/dist/src/art.d.ts +1 -1
- package/dist/src/art.d.ts.map +1 -1
- package/dist/src/engine.d.ts +2 -1
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/eps.d.ts.map +1 -1
- package/dist/src/frame-import.d.ts +1 -1
- package/dist/src/frame-import.d.ts.map +1 -1
- package/dist/src/frame-spec.d.ts +5 -4
- package/dist/src/frame-spec.d.ts.map +1 -1
- package/dist/src/frame.d.ts +1 -1
- package/dist/src/frame.d.ts.map +1 -1
- package/dist/src/frames/builtin.d.ts +1 -1
- package/dist/src/frames/builtin.d.ts.map +1 -1
- package/dist/src/qr-outline.d.ts +1 -2
- package/dist/src/qr-outline.d.ts.map +1 -1
- package/dist/src/qr-shape.d.ts +1 -1
- package/dist/src/qr-shape.d.ts.map +1 -1
- package/dist/src/silhouette.d.ts +1 -2
- package/dist/src/silhouette.d.ts.map +1 -1
- package/dist/src/template/dot-ring-layout.d.ts +26 -3
- package/dist/src/template/dot-ring-layout.d.ts.map +1 -1
- package/dist/src/template/dot-ring.d.ts +22 -4
- package/dist/src/template/dot-ring.d.ts.map +1 -1
- package/dist/src/utils.d.ts +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/types/art.d.ts +1 -18
- package/dist/types/art.d.ts.map +1 -1
- package/dist/types/color-helpers.d.ts +26 -0
- package/dist/types/color-helpers.d.ts.map +1 -0
- package/dist/types/color.d.ts +1 -24
- package/dist/types/color.d.ts.map +1 -1
- package/dist/types/constants.d.ts +97 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/corner-dot.d.ts +2 -12
- package/dist/types/corner-dot.d.ts.map +1 -1
- package/dist/types/corner-eye.d.ts +2 -11
- package/dist/types/corner-eye.d.ts.map +1 -1
- package/dist/types/frame-spec-parse.d.ts +21 -0
- package/dist/types/frame-spec-parse.d.ts.map +1 -0
- package/dist/types/frame-spec-rules.d.ts +95 -0
- package/dist/types/frame-spec-rules.d.ts.map +1 -0
- package/dist/types/frame-spec.d.ts +2 -83
- package/dist/types/frame-spec.d.ts.map +1 -1
- package/dist/types/frame.d.ts +1 -8
- package/dist/types/frame.d.ts.map +1 -1
- package/dist/types/image-pattern.d.ts +1 -1
- package/dist/types/image-pattern.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -22
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +2 -2
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/plain.d.ts +17 -0
- package/dist/types/plain.d.ts.map +1 -0
- package/dist/types/qr.d.ts +2 -46
- package/dist/types/qr.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +12 -0
- package/dist/types/schemas.d.ts.map +1 -0
- package/dist/vanilla.browser.mjs +28 -28
- package/dist/vanilla.browser.mjs.map +1 -1
- package/package.json +1 -1
- package/src/art.tsx +3 -6
- package/src/body-patterns.tsx +1 -1
- package/src/engine.ts +53 -1
- package/src/eps.ts +6 -1
- package/src/frame-import.ts +7 -6
- package/src/frame-spec.ts +17 -23
- package/src/frame.tsx +3 -2
- package/src/frames/builtin.ts +2 -5
- package/src/helpers.ts +1 -1
- package/src/qr-outline.ts +2 -2
- package/src/qr-shape.ts +2 -5
- package/src/scan-score.ts +2 -2
- package/src/silhouette.ts +2 -2
- package/src/template/dot-ring-layout.ts +281 -15
- package/src/template/dot-ring.tsx +27 -8
- package/src/utils/print-shared.ts +1 -1
- package/src/utils.tsx +6 -5
- package/types/art.ts +10 -20
- package/types/color-helpers.ts +132 -0
- package/types/color.ts +9 -122
- package/types/constants.ts +222 -0
- package/types/corner-dot.ts +8 -40
- package/types/corner-eye.ts +2 -31
- package/types/frame-spec-parse.ts +683 -0
- package/types/frame-spec-rules.ts +645 -0
- package/types/frame-spec.ts +38 -635
- package/types/frame.ts +14 -34
- package/types/image-pattern.ts +2 -26
- package/types/index.ts +6 -162
- package/types/plain.ts +117 -0
- package/types/qr.ts +29 -51
- package/types/schemas.ts +62 -0
|
@@ -1,61 +1,7 @@
|
|
|
1
1
|
/** biome-ignore-all lint/style/noMagicNumbers: spec limits */
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
/** Value of `frame.style` that draws `frame.spec`. */
|
|
6
|
-
export declare const CUSTOM_FRAME_STYLE = "custom";
|
|
7
|
-
export declare const FRAME_SPEC_LIMITS: {
|
|
8
|
-
/** Artboard sides, in spec units */
|
|
9
|
-
readonly minArtboard: 50;
|
|
10
|
-
readonly maxArtboard: 2000;
|
|
11
|
-
/** Largest absolute coordinate anywhere in a spec */
|
|
12
|
-
readonly maxCoordinate: 4000;
|
|
13
|
-
/** Decimals a number may have */
|
|
14
|
-
readonly maxDecimals: 3;
|
|
15
|
-
readonly maxShapes: 64;
|
|
16
|
-
readonly maxLabels: 8;
|
|
17
|
-
readonly maxPolygonPoints: 256;
|
|
18
|
-
/** Characters in one path's data */
|
|
19
|
-
readonly maxPathLength: 16000;
|
|
20
|
-
/** Segments across the spec: path commands (arcs count 4), polygon points, dashes */
|
|
21
|
-
readonly maxSegments: 2000;
|
|
22
|
-
/** Gradient steps on one shape */
|
|
23
|
-
readonly maxGradientSteps: 64;
|
|
24
|
-
/** Gradient work across the spec: steps × the shape's segments */
|
|
25
|
-
readonly maxGradientWork: 16000;
|
|
26
|
-
/** Size of the spec as JSON, in UTF-8 bytes */
|
|
27
|
-
readonly maxBytes: 32768;
|
|
28
|
-
/** The code must be at least this share of the artboard's shorter side */
|
|
29
|
-
readonly minQrShare: 0.5;
|
|
30
|
-
/** Light padding around the code, as a share of its size */
|
|
31
|
-
readonly minPadding: 0.04;
|
|
32
|
-
readonly defaultPadding: 0.08;
|
|
33
|
-
/** Characters in a label */
|
|
34
|
-
readonly maxTextLength: 24;
|
|
35
|
-
};
|
|
36
|
-
/** Built-in glyphs a spec can place with an `icon` shape (no images). */
|
|
37
|
-
export declare const FRAME_ICONS: readonly ["wifi", "star", "heart", "phone", "headphones", "calendar", "user", "chat", "bag", "bell", "cup", "card", "check", "info", "home", "pin", "share", "download", "clock", "snowflake", "pumpkin", "tree", "sparkle", "gift"];
|
|
38
|
-
/**
|
|
39
|
-
* Largest label font as a share of its row height, so ascenders and
|
|
40
|
-
* descenders stay inside the row (and so off the code's padding).
|
|
41
|
-
*/
|
|
42
|
-
export declare const FRAME_SPEC_LABEL_MAX_FONT = 0.95;
|
|
43
|
-
/** Most segments any built-in icon has (counted against maxSegments). */
|
|
44
|
-
export declare const FRAME_ICON_MAX_SEGMENTS = 200;
|
|
45
|
-
/**
|
|
46
|
-
* Theme colors a spec can bind to: `frame` is `frame.color`, `text` is
|
|
47
|
-
* `frame.textColor`, `accent` is `frame.secondaryColor` (the gradient end)
|
|
48
|
-
* and `background` is the code's background color.
|
|
49
|
-
*/
|
|
50
|
-
export declare const FRAME_COLOR_TOKENS: readonly ["frame", "text", "accent", "background"];
|
|
51
|
-
/**
|
|
52
|
-
* Label text as a frame may draw it: NFC, no control, invisible or
|
|
53
|
-
* bidirectional-override characters, single spaces, trimmed and at most
|
|
54
|
-
* `maxLength` characters (code points).
|
|
55
|
-
*/
|
|
56
|
-
export declare function sanitizeFrameText(text: string, maxLength?: number): string;
|
|
57
|
-
/** True when `text` uses only Latin-1 (what PDF and EPS labels can print). */
|
|
58
|
-
export declare function isLatin1Text(text: string): boolean;
|
|
3
|
+
import { FRAME_ICONS } from "./frame-spec-rules";
|
|
4
|
+
export { CUSTOM_FRAME_STYLE, FRAME_COLOR_TOKENS, FRAME_ICON_MAX_SEGMENTS, FRAME_ICONS, FRAME_SPEC_CAP_HALF, FRAME_SPEC_DEFAULT_FONT, FRAME_SPEC_KIND, FRAME_SPEC_LABEL_MAX_FONT, FRAME_SPEC_LIMITS, FRAME_SPEC_VERSION, frameSpecPadding, frameSpecQrZone, frameSpecShapeBounds, isLatin1Text, sanitizeFrameText, } from "./frame-spec-rules";
|
|
59
5
|
/** A theme token, a fixed hex color, or an opaque mix of two of them. */
|
|
60
6
|
export declare const frameSpecColorSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodEnum<{
|
|
61
7
|
text: "text";
|
|
@@ -1711,32 +1657,6 @@ export type FrameSpecShape = z.infer<typeof frameSpecShapeSchema>;
|
|
|
1711
1657
|
export type FrameSpecLabel = z.infer<typeof frameSpecLabelSchema>;
|
|
1712
1658
|
export type FrameSpecIcon = (typeof FRAME_ICONS)[number];
|
|
1713
1659
|
export type FrameSpec = z.infer<typeof frameSpecObjectSchema>;
|
|
1714
|
-
interface Box {
|
|
1715
|
-
x0: number;
|
|
1716
|
-
y0: number;
|
|
1717
|
-
x1: number;
|
|
1718
|
-
y1: number;
|
|
1719
|
-
}
|
|
1720
|
-
/** The code plus its padding: nothing may be drawn over it. */
|
|
1721
|
-
export declare function frameSpecQrZone(spec: FrameSpec): Box;
|
|
1722
|
-
/** The plate's padding around the code, in spec units. */
|
|
1723
|
-
export declare function frameSpecPadding(spec: FrameSpec): number;
|
|
1724
|
-
/** Font size of a text label with no `fontSize`, as a share of its row. */
|
|
1725
|
-
export declare const FRAME_SPEC_DEFAULT_FONT = 0.52;
|
|
1726
|
-
/**
|
|
1727
|
-
* Half the height a label's capitals fill, as a share of its font size: a
|
|
1728
|
-
* text label's letters are centered on its row, so they fill the row's
|
|
1729
|
-
* middle, this far above and below it.
|
|
1730
|
-
*/
|
|
1731
|
-
export declare const FRAME_SPEC_CAP_HALF = 0.35;
|
|
1732
|
-
/**
|
|
1733
|
-
* Bounds of a spec shape (null for path data outside the grammar) and the
|
|
1734
|
-
* segments it counts against FRAME_SPEC_LIMITS.maxSegments.
|
|
1735
|
-
*/
|
|
1736
|
-
export declare function frameSpecShapeBounds(shape: FrameSpecShape): {
|
|
1737
|
-
bounds: Box | null;
|
|
1738
|
-
segments: number;
|
|
1739
|
-
};
|
|
1740
1660
|
/**
|
|
1741
1661
|
* Zod schema for a frame spec, with every limit and cross-field check
|
|
1742
1662
|
* (FRAME_SPEC_LIMITS). Validate specs from users with this before storing
|
|
@@ -4194,5 +4114,4 @@ export declare const anyFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4194
4114
|
}, z.core.$strip>], "style">;
|
|
4195
4115
|
export type QRCustomFrame = z.infer<typeof customFrameSchema>;
|
|
4196
4116
|
export type AnyQRFrame = z.infer<typeof anyFrameSchema>;
|
|
4197
|
-
export {};
|
|
4198
4117
|
//# sourceMappingURL=frame-spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame-spec.d.ts","sourceRoot":"","sources":["../../types/frame-spec.ts"],"names":[],"mappings":"AAAA,8DAA8D;
|
|
1
|
+
{"version":3,"file":"frame-spec.d.ts","sourceRoot":"","sources":["../../types/frame-spec.ts"],"names":[],"mappings":"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"}
|
package/dist/types/frame.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export
|
|
3
|
-
/** Longest call-to-action label a frame renders. */
|
|
4
|
-
export declare const FRAME_TEXT_MAX_LENGTH = 24;
|
|
5
|
-
/** Label used when a frame has no `text`. Pass `""` to hide the label. */
|
|
6
|
-
export declare const DEFAULT_FRAME_TEXT = "Scan me";
|
|
7
|
-
/** Smallest and largest `fontScale` (label size relative to the default). */
|
|
8
|
-
export declare const FRAME_FONT_SCALE_MIN = 0.5;
|
|
9
|
-
export declare const FRAME_FONT_SCALE_MAX = 1.5;
|
|
2
|
+
export { DEFAULT_FRAME_TEXT, FRAME_FONT_SCALE_MAX, FRAME_FONT_SCALE_MIN, FRAME_STYLES, FRAME_TEXT_MAX_LENGTH, } from "./constants";
|
|
10
3
|
export declare const frameStyleSchema: z.ZodEnum<{
|
|
11
4
|
badge: "badge";
|
|
12
5
|
circle: "circle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../types/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../types/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAAuB,CAAC;AAErD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBtB,CAAC;AAGH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export
|
|
2
|
+
export { BODY_PATTERN } from "./constants";
|
|
3
3
|
export declare const bodyPatternSchema: z.ZodEnum<{
|
|
4
4
|
square: "square";
|
|
5
5
|
rounded: "rounded";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-pattern.d.ts","sourceRoot":"","sources":["../../types/image-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"image-pattern.d.ts","sourceRoot":"","sources":["../../types/image-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;EAAuB,CAAC;AAGtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export { QR_ART_MAX_SAMPLE_SIZE, QR_ART_MODES, QR_ART_VARIANTS, qrArtImageSchema, qrArtModeSchema, qrArtSchema, qrArtVariantSchema, } from "./art";
|
|
5
|
-
export type { AngularGradient, ColorConfig, ColorType, Gradient, GradientStop, ImageFit, ImagePaint, ImagePosition, LinearGradient, RadialGradient, SolidColor, } from "./color";
|
|
6
|
-
export { angularGradientSchema, colorConfigSchema, colorTypeSchema, getColorString, getNormalizedColor, gradientStopSchema, imageFitSchema, imagePaintSchema, imagePositionCss, imagePositionSchema, isGradient, isImagePaint, linearGradientSchema, normalizeColorConfig, radialGradientSchema, solidColorSchema, } from "./color";
|
|
7
|
-
export type { Excavation, Modules } from "./common";
|
|
8
|
-
export { excavationSchema } from "./common";
|
|
9
|
-
export type { CornerEyeDotPattern, PickableCornerEyeDotPattern, } from "./corner-dot";
|
|
10
|
-
export { CORNER_EYE_DOT_PATTERNS, cornerEyeDotPatternSchema, pickableCornerEyeDotPatternSchema, RETIRED_CORNER_EYE_DOT_PATTERNS, } from "./corner-dot";
|
|
11
|
-
export type { CornerEyePattern, PickableCornerEyePattern } from "./corner-eye";
|
|
12
|
-
export { CORNER_EYE_PATTERNS, cornerEyePatternSchema, pickableCornerEyePatternSchema, RETIRED_CORNER_EYE_PATTERNS, } from "./corner-eye";
|
|
13
|
-
export type { FrameStyle, QRFrame } from "./frame";
|
|
14
|
-
export { DEFAULT_FRAME_TEXT, FRAME_FONT_SCALE_MAX, FRAME_FONT_SCALE_MIN, FRAME_STYLES, FRAME_TEXT_MAX_LENGTH, frameSchema, frameStyleSchema, } from "./frame";
|
|
15
|
-
export type { AnyQRFrame, FrameSpec, FrameSpecColor, FrameSpecIcon, FrameSpecLabel, FrameSpecPaint, FrameSpecShape, QRCustomFrame, } from "./frame-spec";
|
|
16
|
-
export { anyFrameSchema, CUSTOM_FRAME_STYLE, customFrameSchema, FRAME_COLOR_TOKENS, FRAME_ICON_MAX_SEGMENTS, FRAME_ICONS, FRAME_SPEC_KIND, FRAME_SPEC_LABEL_MAX_FONT, FRAME_SPEC_LIMITS, FRAME_SPEC_VERSION, frameSpecColorSchema, frameSpecLabelSchema, frameSpecPadding, frameSpecPaintSchema, frameSpecQrZone, frameSpecSchema, frameSpecShapeSchema, getFrameSpecIssues, isLatin1Text, sanitizeFrameText, } from "./frame-spec";
|
|
17
|
-
export type { BodyPattern } from "./image-pattern";
|
|
18
|
-
export { BODY_PATTERN, bodyPatternSchema } from "./image-pattern";
|
|
19
|
-
export type { ErrorLevel, EyeColorOverride, EyeColors, EyePosition, ImageSettings, LogoOptions, LogoShape, QRCodeShape, QRProps, QRShape, QRSilhouette, QRStyle, QRSVGAttributes, QRSVGOptions, } from "./qr";
|
|
20
|
-
export { AUTO_LEVEL_LOGO_COVERAGE, EYE_POSITIONS, errorLevelSchema, eyeColorOverrideSchema, eyeColorsSchema, imageSettingsSchema, LOGO_PADDING_MAX, LOGO_SHAPES, LOGO_SIZE_DEFAULT, LOGO_SIZE_MAX, LOGO_SIZE_MIN, logoOptionsSchema, logoShapeSchema, MODULE_SCALE_MAX, MODULE_SCALE_MIN, QR_CIRCLE_QUIET_MIN, QR_SHAPES, QR_SILHOUETTE_MAX_CELLS, QR_SILHOUETTE_MIN_CELLS, QR_SILHOUETTE_MIN_SHARE, qrCodeShapeSchema, qrPropsSchema, qrShapeSchema, qrSilhouetteSchema, } from "./qr";
|
|
21
|
-
export type { BaseTemplateProps, TemplateConfig, TemplateDefinition, TemplateNode, } from "./template";
|
|
22
|
-
export { baseTemplatePropsSchema, templateConfigSchema, templateDefinitionBaseSchema, } from "./template";
|
|
1
|
+
/** biome-ignore-all lint/performance/noBarrelFile: qrdx/types without React */
|
|
2
|
+
export * from "./plain";
|
|
3
|
+
export * from "./schemas";
|
|
23
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAK/E,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use strict';var zod=require('zod');var H;(h=>{class e{constructor(t,r,n,i){this.version=t;this.errorCorrectionLevel=r;if(t<e.MIN_VERSION||t>e.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=t*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(n);if(this.drawCodewords(p),i==-1){let d=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);let x=this.getPenaltyScore();x<d&&(i=b,d=x),this.applyMask(b);}}s(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(t,r){let n=h.QrSegment.makeSegments(t);return e.encodeSegments(n,r)}static encodeBinary(t,r){let n=h.QrSegment.makeBytes(t);return e.encodeSegments([n],r)}static encodeSegments(t,r,n=1,i=40,m=-1,p=true){if(!(e.MIN_VERSION<=n&&n<=i&&i<=e.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,b;for(d=n;;d++){let l=e.getNumDataCodewords(d,r)*8,P=c.getTotalBits(t,d);if(P<=l){b=P;break}if(d>=i)throw new RangeError("Data too long")}for(let l of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&b<=e.getNumDataCodewords(d,l)*8&&(r=l);let x=[];for(let l of t){o(l.mode.modeBits,4,x),o(l.numChars,l.mode.numCharCountBits(d),x);for(let P of l.getData())x.push(P);}s(x.length==b);let E=e.getNumDataCodewords(d,r)*8;s(x.length<=E),o(0,Math.min(4,E-x.length),x),o(0,(8-x.length%8)%8,x),s(x.length%8==0);for(let l=236;x.length<E;l^=253)o(l,8,x);let S=[];for(;S.length*8<x.length;)S.push(0);return x.forEach((l,P)=>S[P>>>3]|=l<<7-(P&7)),new e(d,r,S,m)}size;mask;modules=[];isFunction=[];getModule(t,r){return 0<=t&&t<this.size&&0<=r&&r<this.size&&this.modules[r][t]}getModules(){return this.modules}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2==0),this.setFunctionModule(n,6,n%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let t=this.getAlignmentPatternPositions(),r=t.length;for(let n=0;n<r;n++)for(let i=0;i<r;i++)n==0&&i==0||n==0&&i==r-1||n==r-1&&i==0||this.drawAlignmentPattern(t[n],t[i]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(t){let r=this.errorCorrectionLevel.formatBits<<3|t,n=r;for(let m=0;m<10;m++)n=n<<1^(n>>>9)*1335;let i=(r<<10|n)^21522;s(i>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,a(i,m));this.setFunctionModule(8,7,a(i,6)),this.setFunctionModule(8,8,a(i,7)),this.setFunctionModule(7,8,a(i,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,a(i,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,a(i,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,a(i,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let t=this.version;for(let n=0;n<12;n++)t=t<<1^(t>>>11)*7973;let r=this.version<<12|t;s(r>>>18==0);for(let n=0;n<18;n++){let i=a(r,n),m=this.size-11+n%3,p=Math.floor(n/3);this.setFunctionModule(m,p,i),this.setFunctionModule(p,m,i);}}drawFinderPattern(t,r){for(let n=-4;n<=4;n++)for(let i=-4;i<=4;i++){let m=Math.max(Math.abs(i),Math.abs(n)),p=t+i,d=r+n;0<=p&&p<this.size&&0<=d&&d<this.size&&this.setFunctionModule(p,d,m!=2&&m!=4);}}drawAlignmentPattern(t,r){for(let n=-2;n<=2;n++)for(let i=-2;i<=2;i++)this.setFunctionModule(t+i,r+n,Math.max(Math.abs(i),Math.abs(n))!=1);}setFunctionModule(t,r,n){this.modules[r][t]=n,this.isFunction[r][t]=true;}addEccAndInterleave(t){let r=this.version,n=this.errorCorrectionLevel;if(t.length!=e.getNumDataCodewords(r,n))throw new RangeError("Invalid argument");let i=e.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r],m=e.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r],p=Math.floor(e.getNumRawDataModules(r)/8),d=i-p%i,b=Math.floor(p/i),x=[],E=e.reedSolomonComputeDivisor(m);for(let l=0,P=0;l<i;l++){let M=t.slice(P,P+b-m+(l<d?0:1));P+=M.length;let R=e.reedSolomonComputeRemainder(M,E);l<d&&M.push(0),x.push(M.concat(R));}let S=[];for(let l=0;l<x[0].length;l++)x.forEach((P,M)=>{(l!=b-m||M>=d)&&S.push(P[l]);});return s(S.length==p),S}drawCodewords(t){if(t.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let n=this.size-1;n>=1;n-=2){n==6&&(n=5);for(let i=0;i<this.size;i++)for(let m=0;m<2;m++){let p=n-m,b=(n+1&2)==0?this.size-1-i:i;!this.isFunction[b][p]&&r<t.length*8&&(this.modules[b][p]=a(t[r>>>3],7-(r&7)),r++);}}s(r==t.length*8);}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let r=0;r<this.size;r++)for(let n=0;n<this.size;n++){let i;switch(t){case 0:i=(n+r)%2==0;break;case 1:i=r%2==0;break;case 2:i=n%3==0;break;case 3:i=(n+r)%3==0;break;case 4:i=(Math.floor(n/3)+Math.floor(r/2))%2==0;break;case 5:i=n*r%2+n*r%3==0;break;case 6:i=(n*r%2+n*r%3)%2==0;break;case 7:i=((n+r)%2+n*r%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[r][n]&&i&&(this.modules[r][n]=!this.modules[r][n]);}}getPenaltyScore(){let t=0;for(let m=0;m<this.size;m++){let p=false,d=0,b=[0,0,0,0,0,0,0];for(let x=0;x<this.size;x++)this.modules[m][x]==p?(d++,d==5?t+=e.PENALTY_N1:d>5&&t++):(this.finderPenaltyAddHistory(d,b),p||(t+=this.finderPenaltyCountPatterns(b)*e.PENALTY_N3),p=this.modules[m][x],d=1);t+=this.finderPenaltyTerminateAndCount(p,d,b)*e.PENALTY_N3;}for(let m=0;m<this.size;m++){let p=false,d=0,b=[0,0,0,0,0,0,0];for(let x=0;x<this.size;x++)this.modules[x][m]==p?(d++,d==5?t+=e.PENALTY_N1:d>5&&t++):(this.finderPenaltyAddHistory(d,b),p||(t+=this.finderPenaltyCountPatterns(b)*e.PENALTY_N3),p=this.modules[x][m],d=1);t+=this.finderPenaltyTerminateAndCount(p,d,b)*e.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let p=0;p<this.size-1;p++){let d=this.modules[m][p];d==this.modules[m][p+1]&&d==this.modules[m+1][p]&&d==this.modules[m+1][p+1]&&(t+=e.PENALTY_N2);}let r=0;for(let m of this.modules)r=m.reduce((p,d)=>p+(d?1:0),r);let n=this.size*this.size,i=Math.ceil(Math.abs(r*20-n*10)/n)-1;return s(0<=i&&i<=9),t+=i*e.PENALTY_N4,s(0<=t&&t<=2568888),t}getAlignmentPatternPositions(){if(this.version==1)return [];{let t=Math.floor(this.version/7)+2,r=this.version==32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,n=[6];for(let i=this.size-7;n.length<t;i-=r)n.splice(1,0,i);return n}}static getNumRawDataModules(t){if(t<e.MIN_VERSION||t>e.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*t+128)*t+64;if(t>=2){let n=Math.floor(t/7)+2;r-=(25*n-10)*n-55,t>=7&&(r-=36);}return s(208<=r&&r<=29648),r}static getNumDataCodewords(t,r){return Math.floor(e.getNumRawDataModules(t)/8)-e.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t]*e.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t]}static reedSolomonComputeDivisor(t){if(t<1||t>255)throw new RangeError("Degree out of range");let r=[];for(let i=0;i<t-1;i++)r.push(0);r.push(1);let n=1;for(let i=0;i<t;i++){for(let m=0;m<r.length;m++)r[m]=e.reedSolomonMultiply(r[m],n),m+1<r.length&&(r[m]^=r[m+1]);n=e.reedSolomonMultiply(n,2);}return r}static reedSolomonComputeRemainder(t,r){let n=r.map(i=>0);for(let i of t){let m=i^n.shift();n.push(0),r.forEach((p,d)=>n[d]^=e.reedSolomonMultiply(p,m));}return n}static reedSolomonMultiply(t,r){if(t>>>8||r>>>8)throw new RangeError("Byte out of range");let n=0;for(let i=7;i>=0;i--)n=n<<1^(n>>>7)*285,n^=(r>>>i&1)*t;return s(n>>>8==0),n}finderPenaltyCountPatterns(t){let r=t[1];s(r<=this.size*3);let n=r>0&&t[2]==r&&t[3]==r*3&&t[4]==r&&t[5]==r;return (n&&t[0]>=r*4&&t[6]>=r?1:0)+(n&&t[6]>=r*4&&t[0]>=r?1:0)}finderPenaltyTerminateAndCount(t,r,n){return t&&(this.finderPenaltyAddHistory(r,n),r=0),r+=this.size,this.finderPenaltyAddHistory(r,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(t,r){r[0]==0&&(t+=this.size),r.pop(),r.unshift(t);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}h.QrCode=e;function o(f,t,r){if(t<0||t>31||f>>>t)throw new RangeError("Value out of range");for(let n=t-1;n>=0;n--)r.push(f>>>n&1);}function a(f,t){return (f>>>t&1)!=0}function s(f){if(!f)throw new Error("Assertion error")}class c{constructor(t,r,n){this.mode=t;this.numChars=r;this.bitData=n;if(r<0)throw new RangeError("Invalid argument");this.bitData=n.slice();}mode;numChars;bitData;static makeBytes(t){let r=[];for(let n of t)o(n,8,r);return new c(c.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!c.isNumeric(t))throw new RangeError("String contains non-numeric characters");let r=[];for(let n=0;n<t.length;){let i=Math.min(t.length-n,3);o(parseInt(t.substr(n,i),10),i*3+1,r),n+=i;}return new c(c.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!c.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let r=[],n;for(n=0;n+2<=t.length;n+=2){let i=c.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n))*45;i+=c.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n+1)),o(i,11,r);}return n<t.length&&o(c.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)),6,r),new c(c.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==""?[]:c.isNumeric(t)?[c.makeNumeric(t)]:c.isAlphanumeric(t)?[c.makeAlphanumeric(t)]:[c.makeBytes(c.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)o(t,8,r);else if(t<16384)o(2,2,r),o(t,14,r);else if(t<1e6)o(6,3,r),o(t,21,r);else throw new RangeError("ECI assignment value out of range");return new c(c.Mode.ECI,0,r)}static isNumeric(t){return c.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return c.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(t,r){let n=0;for(let i of t){let m=i.mode.numCharCountBits(r);if(i.numChars>=1<<m)return 1/0;n+=4+m+i.bitData.length;}return n}static toUtf8ByteArray(t){t=encodeURI(t);let r=[];for(let n=0;n<t.length;n++)t.charAt(n)!="%"?r.push(t.charCodeAt(n)):(r.push(parseInt(t.substr(n+1,2),16)),n+=2);return r}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}h.QrSegment=c;})(H||={});(o=>{(s=>{class a{constructor(h,f){this.ordinal=h;this.formatBits=f;}ordinal;formatBits;static LOW=new a(0,1);static MEDIUM=new a(1,0);static QUARTILE=new a(2,3);static HIGH=new a(3,2)}s.Ecc=a;})(o.QrCode||={});})(H||={});(o=>{(s=>{class a{constructor(h,f){this.modeBits=h;this.numBitsCharCount=f;}modeBits;numBitsCharCount;static NUMERIC=new a(1,[10,12,14]);static ALPHANUMERIC=new a(2,[9,11,13]);static BYTE=new a(4,[8,16,16]);static KANJI=new a(8,[8,10,12]);static ECI=new a(7,[0,0,0]);numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}}s.Mode=a;})(o.QrSegment||={});})(H||={});var V=H;({L:V.QrCode.Ecc.LOW,M:V.QrCode.Ecc.MEDIUM,Q:V.QrCode.Ecc.QUARTILE,H:V.QrCode.Ecc.HIGH});var wt=0;function zt(e,o="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||o:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||o:o}var Ne=["logo","halftone"],Ie=zod.z.enum(Ne),le={logo:["blend","badge"],halftone:["color","mono"]},Fe=zod.z.enum([...le.logo,...le.halftone]),X=192,Le=e=>Math.ceil(e/3)*4,Oe=zod.z.object({width:zod.z.number().int().min(1).max(X),height:zod.z.number().int().min(1).max(X),data:zod.z.string().max(Le(X*X*4))}).refine(e=>e.data.length===Le(e.width*e.height*4),{message:"Art image data does not match its width and height"}),me=zod.z.object({mode:Ie,image:Oe,intensity:zod.z.number().min(0).max(1).optional(),variant:Fe.optional(),matchEyes:zod.z.boolean().optional()});var Dt=zod.z.enum(["solid","linear","radial","angular","image"]),ve=zod.z.object({type:zod.z.literal("solid"),color:zod.z.string()}),re=zod.z.object({color:zod.z.string(),offset:zod.z.number().min(0).max(100)}),we=zod.z.object({type:zod.z.literal("linear"),stops:zod.z.array(re).min(2),angle:zod.z.number().optional().default(0)}),ze=zod.z.object({type:zod.z.literal("radial"),stops:zod.z.array(re).min(2)}),De=zod.z.object({type:zod.z.literal("angular"),stops:zod.z.array(re).min(2),angle:zod.z.number().optional().default(0)}),Be=zod.z.enum(["cover","contain","tile"]),ke=zod.z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),Ue=zod.z.object({type:zod.z.literal("image"),src:zod.z.string().min(1),fit:Be.optional().default("cover"),scale:zod.z.number().min(.1).max(4).optional().default(1),position:ke.optional().default("center"),opacity:zod.z.number().min(0).max(1).optional().default(1),underlay:zod.z.string().optional()}),k=zod.z.union([zod.z.string(),ve,we,ze,De,Ue]);function ue(e,o="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:o}}function Bt(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function kt(e){return typeof e=="object"&&e!==null&&e.type==="image"}function Ut(e,o="#000000"){let a=ue(e,o);return a.type==="solid"?a.color:a.type==="image"?a.underlay||o:a.stops[0]?.color||o}function Ge(e="center"){let[o,a]=e.split("-");return e==="center"?"center":a?`${a} ${o}`:o==="top"||o==="bottom"?`center ${o}`:`${o} center`}function Gt(e){if(!e)return "#000000";if(typeof e=="string")return e;let o=ue(e);if(o.type==="solid")return o.color;if(o.type==="image"){let c=o.fit==="tile"?`${25*(o.scale??1)}% auto`:(o.scale??1)===1?o.fit==="contain"?"contain":"cover":`${100*(o.scale??1)}% auto`,h=o.fit==="tile"?"repeat":"no-repeat";return `${`url("${o.src.replace(/"/g,"%22")}")`} ${Ge(o.position)} / ${c} ${h}, ${o.underlay??"transparent"}`}let s=[...o.stops].sort((c,h)=>c.offset-h.offset).map(c=>`${c.color} ${c.offset}%`).join(", ");return o.type==="linear"?`linear-gradient(${(o.angle??0)+90}deg, ${s})`:o.type==="angular"?`conic-gradient(from ${o.angle??0}deg, ${s})`:`radial-gradient(circle, ${s})`}var qt=zod.z.object({x:zod.z.number(),y:zod.z.number(),w:zod.z.number(),h:zod.z.number()});var pe=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],Qe=["diamond","star","banner"],de=zod.z.enum([...pe,...Qe]),Qt=zod.z.enum(pe);var fe=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],Ye=["curly"],he=zod.z.enum([...fe,...Ye]),jt=zod.z.enum(fe);var He=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],q=24,Yt="Scan me",$e=.5,K=1.5,Ve=zod.z.enum(He),oe=zod.z.object({style:Ve,text:zod.z.string().max(q).optional(),color:zod.z.string().optional(),textColor:zod.z.string().optional(),secondaryText:zod.z.string().max(q).optional(),secondaryColor:zod.z.string().optional(),fontScale:zod.z.number().min($e).max(K).optional()});var Ht={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},$t=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,ye=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Xe(e,o=Number.POSITIVE_INFINITY){if(!$t.test(e))return null;let a=[],s=0,c=()=>{for(;s<e.length&&/[\s,]/.test(e[s]);)s++;},h=()=>{c(),ye.lastIndex=s;let r=ye.exec(e);if(!r)return null;let n=r[0],i=n.indexOf(".");if(i>=0&&n.length-i-1>o)return null;s=ye.lastIndex;let m=Number(n);return Number.isFinite(m)?m:null},f=()=>{c();let r=e[s];return r==="0"||r==="1"?(s++,r==="1"?1:0):null},t=()=>(c(),s<e.length&&/[0-9.+-]/.test(e[s]));for(c();s<e.length;){let r=e[s],n=r.toUpperCase(),i=Ht[n];if(i===void 0||a.length===0&&n!=="M")return null;if(s++,i===0){a.push({command:r,values:[]}),c();continue}let m=r,p=true;for(;p||t();){let d=[];for(let b=0;b<i;b++){let x=n==="A"&&(b===3||b===4)?f():h();if(x===null)return null;d.push(x);}a.push({command:m,values:d}),n==="M"&&(m=r==="M"?"L":"l"),p=false;}c();}return a}function Ze(e){let o=0;for(let{command:a}of e)o+=a.toUpperCase()==="A"?4:1;return o}function We(e,o){let a=[c=>c[0]-o.x0,c=>o.x1-c[0],c=>c[1]-o.y0,c=>o.y1-c[1]],s=e;for(let c of a){if(s.length===0)break;let h=s;s=[];for(let f=0;f<h.length;f++){let t=h[f],r=h[(f+h.length-1)%h.length],n=c(t),i=c(r);n>=0?(i<0&&s.push(Ke(r,t,i,n)),s.push(t)):i>=0&&s.push(Ke(r,t,i,n));}}return s.length>2?s:[]}function Ke(e,o,a,s){let c=a/(a-s);return [e[0]+(o[0]-e[0])*c,e[1]+(o[1]-e[1])*c]}function Je(e){let o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=(f,t)=>{o=Math.min(o,f),a=Math.min(a,t),s=Math.max(s,f),c=Math.max(c,t);};for(let f of e)f.op==="C"?(h(f.x1,f.y1),h(f.x2,f.y2),h(f.x,f.y)):f.op!=="Z"&&h(f.x,f.y);return Number.isFinite(o)?{x0:o,y0:a,x1:s,y1:c}:null}var be=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Vt(e,o,a,s,c,h,f,t,r){if(e===t&&o===r)return [];let n=Math.abs(a),i=Math.abs(s);if(n===0||i===0)return [{op:"L",x:t,y:r}];let m=c*Math.PI/180,p=Math.cos(m),d=Math.sin(m),b=(e-t)/2,x=(o-r)/2,E=p*b+d*x,S=-d*b+p*x,l=E*E/(n*n)+S*S/(i*i);l>1&&(n*=Math.sqrt(l),i*=Math.sqrt(l));let P=n*n*i*i-n*n*S*S-i*i*E*E,M=n*n*S*S+i*i*E*E,R=(h===f?-1:1)*Math.sqrt(Math.max(0,P/M)),A=R*n*S/i,y=-R*i*E/n,T=p*A-d*y+(e+t)/2,_=d*A+p*y+(o+r)/2,F=(v,O,D,ne)=>Math.atan2(v*ne-O*D,v*D+O*ne),$=F(1,0,(E-A)/n,(S-y)/i),z=F((E-A)/n,(S-y)/i,(-E-A)/n,(-S-y)/i);!f&&z>0?z-=2*Math.PI:f&&z<0&&(z+=2*Math.PI);let j=Math.max(1,Math.ceil(Math.abs(z)/(Math.PI/2)-1e-9)),Y=z/j,te=4/3*Math.tan(Y/4),ce=(v,O)=>[T+n*p*v-i*d*O,_+n*d*v+i*p*O],_e=[];for(let v=0;v<j;v++){let O=$+v*Y,D=O+Y,[ne,Nt]=ce(Math.cos(O)-te*Math.sin(O),Math.sin(O)+te*Math.cos(O)),[It,Ft]=ce(Math.cos(D)+te*Math.sin(D),Math.sin(D)-te*Math.cos(D)),[Ot,vt]=v===j-1?[t,r]:ce(Math.cos(D),Math.sin(D));_e.push({op:"C",x1:ne,y1:Nt,x2:It,y2:Ft,x:Ot,y:vt});}return _e}function et(e){let o=[],a=0,s=0,c=0,h=0,f=0,t="",r=null,n=null,i=()=>{for(;a<e.length&&/[\s,]/.test(e[a]);)a++;},m=()=>{i(),be.lastIndex=a;let b=be.exec(e);return b?(a=be.lastIndex,Number(b[0])):null},p=()=>{i();let b=e[a];return b==="0"||b==="1"?(a++,b==="1"):null},d=b=>{let x=[];for(let E=0;E<b;E++){let S=m();if(S===null)return null;x.push(S);}return x};for(;i(),!(a>=e.length);){let b=e[a];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(b))t=b,a++;else if(!t||t==="Z"||t==="z")break;let x=t===t.toLowerCase(),E=x?s:0,S=x?c:0,l=t.toUpperCase();if(l==="Z"){o.push({op:"Z"}),s=h,c=f,r=null,n=null;continue}if(l==="A"){let A=d(3),y=p(),T=p(),_=d(2);if(!(A&&_)||y===null||T===null)break;let[F,$,z]=A,j=_[0]+E,Y=_[1]+S;o.push(...Vt(s,c,F,$,z,y,T,j,Y)),s=j,c=Y,r=null,n=null;continue}let P={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[l]??0,M=d(P);if(!M)break;let R=M;switch(l){case "M":s=R[0]+E,c=R[1]+S,h=s,f=c,o.push({op:"M",x:s,y:c}),t=x?"l":"L",r=null,n=null;break;case "L":case "H":case "V":l!=="V"&&(s=R[0]+E),l==="V"?c=R[0]+S:l==="L"&&(c=R[1]+S),o.push({op:"L",x:s,y:c}),r=null,n=null;break;case "C":case "S":{let A,y;l==="C"?(A=[R[0]+E,R[1]+S],y=R.slice(2)):(A=r?[2*s-r[0],2*c-r[1]]:[s,c],y=R);let T=[y[0]+E,y[1]+S],_=[y[2]+E,y[3]+S];o.push({op:"C",x1:A[0],y1:A[1],x2:T[0],y2:T[1],x:_[0],y:_[1]}),[s,c]=_,r=T,n=null;break}case "Q":case "T":{let A,y;l==="Q"?(A=[R[0]+E,R[1]+S],y=[R[2]+E,R[3]+S]):(A=n?[2*s-n[0],2*c-n[1]]:[s,c],y=[R[0]+E,R[1]+S]),o.push({op:"C",x1:s+2/3*(A[0]-s),y1:c+2/3*(A[1]-c),x2:y[0]+2/3*(A[0]-y[0]),y2:y[1]+2/3*(A[1]-y[1]),x:y[0],y:y[1]}),[s,c]=y,n=A,r=null;break}}}return o}var ot="qrdx.frame",it=1,at="custom",N={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:q},st=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Se=.95,ct=200,lt=["frame","text","accent","background"],Xt=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Zt=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;function mt(e,o=q){let a=e.slice(0,1e3).normalize("NFC").replace(Xt," ").replace(Zt,"").replace(/\s+/g," ").trim();return Array.from(a).slice(0,Math.max(0,o)).join("").trim()}function Kt(e){for(let o of e)if((o.codePointAt(0)??0)>255)return false;return true}var Ee=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6,L=zod.z.number().min(-N.maxCoordinate).max(N.maxCoordinate).refine(Ee,{message:`Numbers may have at most ${N.maxDecimals} decimals`}),I=L.refine(e=>e>0,{message:"Must be greater than 0"}),ie=L.refine(e=>e>=0,{message:"Must not be negative"}),W=zod.z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),tt=zod.z.union([zod.z.enum(lt),W]),ut=e=>zod.z.object({mix:zod.z.tuple([e,e]),amount:zod.z.number().min(0).max(1).refine(Ee)}).strict(),Q=zod.z.union([tt,ut(tt)]),Wt=zod.z.union([W,ut(zod.z.union([zod.z.enum(["frame","accent","background"]),W]))]),G=zod.z.union([Q,zod.z.object({gradient:zod.z.object({from:Q,to:Q,direction:zod.z.enum(["horizontal","vertical"]).optional(),steps:zod.z.int().min(2).max(N.maxGradientSteps).optional()}).strict()}).strict()]),xe={x:L,y:L,width:I,height:I},J=zod.z.object({color:Q,width:I}).strict(),Jt=zod.z.object({type:zod.z.literal("rect"),...xe,radius:ie.optional(),fill:G,hole:zod.z.object({...xe,radius:ie.optional()}).strict().optional(),stroke:J.optional()}).strict(),en=zod.z.object({type:zod.z.literal("circle"),cx:L,cy:L,r:I,hole:I.optional(),fill:G,stroke:J.optional()}).strict(),tn=zod.z.object({type:zod.z.literal("ellipse"),cx:L,cy:L,rx:I,ry:I,fill:G,stroke:J.optional()}).strict(),nn=zod.z.object({type:zod.z.literal("polygon"),points:zod.z.array(zod.z.tuple([L,L])).min(3).max(N.maxPolygonPoints),fill:G,stroke:J.optional()}).strict(),rn=zod.z.object({type:zod.z.literal("path"),d:zod.z.string().min(2).max(N.maxPathLength),fill:G,fillRule:zod.z.enum(["nonzero","evenodd"]).optional(),stroke:J.optional()}).strict(),on=zod.z.object({type:zod.z.literal("line"),x1:L,y1:L,x2:L,y2:L,width:I,cap:zod.z.enum(["butt","round"]).optional(),dash:zod.z.tuple([I,I]).optional(),fill:G}).strict(),an=zod.z.object({type:zod.z.literal("icon"),icon:zod.z.enum(st),x:L,y:L,size:I,fill:G}).strict(),pt=zod.z.discriminatedUnion("type",[Jt,en,tn,nn,rn,on,an]),dt={id:zod.z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:zod.z.enum(["primary","secondary","fixed"]),text:zod.z.string().max(200),maxLength:zod.z.int().min(1).max(q).optional(),color:Q,weight:zod.z.enum(["bold","regular"]).optional(),collapse:zod.z.object({y:L,height:I}).strict().optional()},sn=zod.z.object({type:zod.z.literal("text"),...dt,box:zod.z.object(xe).strict(),align:zod.z.enum(["start","middle","end"]).optional(),fontSize:I.optional()}).strict(),cn=zod.z.object({type:zod.z.literal("curved"),...dt,curve:zod.z.object({cx:L,cy:L,radius:I,side:zod.z.enum(["top","bottom"]),spread:zod.z.number().min(20).max(300).refine(Ee).optional()}).strict(),fontSize:I}).strict(),ft=zod.z.discriminatedUnion("type",[sn,cn]),nt=L.refine(e=>e>=N.minArtboard&&e<=N.maxArtboard,{message:`Artboard sides must be ${N.minArtboard} to ${N.maxArtboard} units`}),ln=zod.z.object({kind:zod.z.literal(ot),version:zod.z.literal(it),artboard:zod.z.object({width:nt,height:nt}).strict(),qr:zod.z.object({x:L,y:L,size:I,padding:ie.optional(),radius:ie.optional(),plate:zod.z.enum(["opaque","background","none"]).optional()}).strict(),colors:zod.z.object({frame:W,text:Wt.optional(),accent:W.optional()}).strict(),shapes:zod.z.array(pt).max(N.maxShapes),labels:zod.z.array(ft).max(N.maxLabels),bleed:zod.z.union([zod.z.literal("none"),Q]).optional()}).strict();function ae(e){let o=Ae(e);return {x0:e.qr.x-o,y0:e.qr.y-o,x1:e.qr.x+e.qr.size+o,y1:e.qr.y+e.qr.size+o}}function mn(e){return {x0:e.qr.x,y0:e.qr.y,x1:e.qr.x+e.qr.size,y1:e.qr.y+e.qr.size}}function Ae(e){return e.qr.padding??e.qr.size*N.defaultPadding}var un=.52,pn=.35;function dn(e){let o=e.fontSize??e.box.height*un;return Math.min(o*K,e.box.height*Se)}var ge=(e,o)=>Math.min(e.x1,o.x1)-Math.max(e.x0,o.x0)>1e-6&&Math.min(e.y1,o.y1)-Math.max(e.y0,o.y0)>1e-6;function rt(e){let o=ae(e),a=Math.min(e.qr.radius??0,(o.x1-o.x0)/2,(o.y1-o.y0)/2),s=[[o.x0+a,o.y0+a,Math.PI],[o.x1-a,o.y0+a,-Math.PI/2],[o.x1-a,o.y1-a,0],[o.x0+a,o.y1-a,Math.PI/2]],c=[];for(let[h,f,t]of s)for(let r=0;r<=8;r++){let n=t+Math.PI/2*(r/8);c.push([h+a*Math.cos(n),f+a*Math.sin(n)]);}return c}function fn([e,o],a,s){if(e<a.x-.01||o<a.y-.01||e>a.x+a.width+.01||o>a.y+a.height+.01)return false;let h=Math.min(s,a.width/2,a.height/2),f=Math.min(Math.max(e,a.x+h),a.x+a.width-h),t=Math.min(Math.max(o,a.y+h),a.y+a.height-h);return Math.hypot(e-f,o-t)<=h+.01}function hn(e){let o=0;return e.forEach(([a,s],c)=>{let[h,f]=e[(c+1)%e.length];o+=a*f-h*s;}),Math.abs(o)/2}function yn(e,o,a){let s=ae(o);if(!ge(a,s))return false;if("stroke"in e&&e.stroke)return true;if(e.fill==="background")return false;if(e.type==="rect"&&e.hole){let{hole:c}=e;return !rt(o).every(h=>fn(h,c,c.radius??0))}if(e.type==="circle"&&e.hole){let c=e.hole;return !rt(o).every(([h,f])=>Math.hypot(h-e.cx,f-e.cy)<=c+.01)}if(e.type==="polygon"){let c=We(e.points,s);return c.length>2&&hn(c)>1e-6}return true}function bn(e){let o=xn(e),a="stroke"in e?e.stroke:void 0;if(!(a&&o.bounds))return o;let s=e.type==="circle"||e.type==="ellipse"?a.width/2:e.type==="rect"?a.width*Math.SQRT2/2:a.width*2,{x0:c,y0:h,x1:f,y1:t}=o.bounds;return {bounds:{x0:c-s,y0:h-s,x1:f+s,y1:t+s},segments:o.segments*2}}function xn(e){switch(e.type){case "rect":return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.width,y1:e.y+e.height},segments:e.hole?18:9};case "circle":return {bounds:{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r},segments:e.hole?10:5};case "ellipse":return {bounds:{x0:e.cx-e.rx,y0:e.cy-e.ry,x1:e.cx+e.rx,y1:e.cy+e.ry},segments:5};case "polygon":{let o=e.points.map(([s])=>s),a=e.points.map(([,s])=>s);return {bounds:{x0:Math.min(...o),y0:Math.min(...a),x1:Math.max(...o),y1:Math.max(...a)},segments:e.points.length}}case "path":{let o=Xe(e.d,N.maxDecimals);return o?{bounds:Je(et(e.d)),segments:Ze(o)}:{bounds:null,segments:0}}case "line":{let o=e.width/2,a=Math.hypot(e.x2-e.x1,e.y2-e.y1),s=e.dash?Math.ceil(a/(e.dash[0]+e.dash[1])):1;return {bounds:{x0:Math.min(e.x1,e.x2)-o,y0:Math.min(e.y1,e.y2)-o,x1:Math.max(e.x1,e.x2)+o,y1:Math.max(e.y1,e.y2)+o},segments:s*(e.cap==="round"?4:5)}}default:return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.size,y1:e.y+e.size},segments:ct}}}function gn(e,o){let a=(l,P=[])=>o.addIssue({code:"custom",message:l,path:P}),s=N,c=new TextEncoder().encode(JSON.stringify(e)).length;if(c>s.maxBytes){a(`The spec is ${c} bytes; the limit is ${s.maxBytes}`);return}let{width:h,height:f}=e.artboard,t=Math.max(h,f)*.005,r={x0:-t,y0:-t,x1:h+t,y1:f+t},n=l=>l.x0>=r.x0&&l.y0>=r.y0&&l.x1<=r.x1&&l.y1<=r.y1,{qr:i}=e,m=Ae(e);i.plate!=="none"&&m<i.size*s.minPadding-1e-9&&a(`qr.padding must be at least ${s.minPadding*100}% of qr.size`,["qr","padding"]),i.size<Math.min(h,f)*s.minQrShare-1e-9&&a(`qr.size must be at least ${s.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let p=ae(e);(p.x0<-1e-9||p.y0<-1e-9||p.x1>h+1e-9||p.y1>f+1e-9)&&a("The code and its padding must sit inside the artboard",["qr"]),(i.radius??0)>(i.size+2*m)/2&&a("qr.radius is larger than half the plate",["qr","radius"]);let d=0,b=0;e.shapes.forEach((l,P)=>{let M=["shapes",P],{bounds:R,segments:A}=bn(l);if(!R){a("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...M,"d"]);return}if(n(R)||a("The shape extends outside the artboard",M),l.type==="rect"&&l.hole){let{hole:y}=l;(y.x<l.x||y.y<l.y||y.x+y.width>l.x+l.width+1e-9||y.y+y.height>l.y+l.height+1e-9)&&a("The hole must sit inside its rect",[...M,"hole"]);}l.type==="circle"&&l.hole&&l.hole>=l.r&&a("The hole must be smaller than the circle",[...M,"hole"]),"stroke"in l&&l.stroke&&l.stroke.width>Math.min(h,f)*.1+1e-9&&a("A stroke may be at most 10% of the artboard's shorter side",[...M,"stroke","width"]),i.plate==="background"&&yn(l,e,R)&&a('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',M),d+=A,typeof l.fill=="object"&&"gradient"in l.fill&&(b+=(l.fill.gradient.steps??32)*A);}),d>s.maxSegments&&a(`The shapes have ${d} segments; the limit is ${s.maxSegments}`,["shapes"]),b>s.maxGradientWork&&a("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let x=[],E=new Set,S=new Set;e.labels.forEach((l,P)=>{let M=["labels",P];E.has(l.id)&&a(`Label id "${l.id}" is used twice`,[...M,"id"]),E.add(l.id),l.slot!=="fixed"&&(S.has(l.slot)&&a(`Only one label may use the ${l.slot} slot`,[...M,"slot"]),S.add(l.slot));let R=l.maxLength??s.maxTextLength;l.text!==mt(l.text,R)&&a(`Label text must be at most ${R} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...M,"text"]);let A;if(l.type==="text"){A={x0:l.box.x,y0:l.box.y,x1:l.box.x+l.box.width,y1:l.box.y+l.box.height},l.fontSize!==void 0&&l.fontSize>l.box.height*Se+1e-9&&a("fontSize may be at most 95% of the label's row height",[...M,"fontSize"]);let y=l.box.y+l.box.height/2,T=dn(l)*pn,_={x0:A.x0,x1:A.x1,y0:y-T,y1:y+T};(ge(A,mn(e))||ge(_,p))&&a("The label overlaps the code or its padding",[...M,"box"]);}else {let{cx:y,cy:T,radius:_}=l.curve,F=l.fontSize*K*.6;A={x0:y-_-F,y0:T-_-F,x1:y+_+F,y1:T+_+F};let $=Math.hypot(Math.max(p.x0-y,0,y-p.x1),Math.max(p.y0-T,0,T-p.y1));Math.hypot(Math.max(Math.abs(p.x0-y),Math.abs(p.x1-y)),Math.max(Math.abs(p.y0-T),Math.abs(p.y1-T)))<=_-F||$>=_+F||a("The curved label crosses the code or its padding",[...M,"curve"]);}if(n(A)||a("The label extends outside the artboard",M),l.collapse){let y=l.collapse,T=y.y+y.height;(y.y<-1e-9||T>f+1e-9)&&a("The collapse band must sit inside the artboard",[...M,"collapse"]),T>p.y0+1e-6&&y.y<p.y1-1e-6&&a("The collapse band crosses the code or its padding",[...M,"collapse"]);for(let _ of x)T>_.y+1e-6&&y.y<_.y+_.height-1e-6&&a("Collapse bands may not overlap",[...M,"collapse"]);x.push(y);}});}var Me=ln.superRefine(gn);function Sn(e){let o=Me.safeParse(e);return o.success?[]:o.error.issues.map(a=>a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message)}var ht=oe.extend({style:zod.z.literal(at),spec:Me}),Ce=zod.z.discriminatedUnion("style",[oe,ht]);var yt=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],Re=zod.z.enum(yt);var bt=["square","rounded","circle"],Te=zod.z.enum(bt),xt=zod.z.object({src:zod.z.string(),height:zod.z.number(),width:zod.z.number(),excavate:zod.z.boolean(),x:zod.z.number().optional(),y:zod.z.number().optional(),padding:zod.z.number().min(0).optional(),shape:Te.optional(),plate:zod.z.string().optional()}),gt=.1,St=.3,An=.25,Et=2,Mn=zod.z.object({size:zod.z.number().min(gt).max(St).optional(),padding:zod.z.number().min(0).max(Et).optional(),x:zod.z.number().min(0).max(1).optional(),y:zod.z.number().min(0).max(1).optional(),shape:Te.optional(),plate:zod.z.string().optional()}),At=zod.z.enum(["L","M","Q","H"]),Mt=.5,Ct=1,Cn=.07,Rt=["square","circle","heart"],Pt=zod.z.enum(Rt),Rn=3,ee=64,Pe=8,Pn=.42,Tt=zod.z.object({type:zod.z.literal("silhouette"),width:zod.z.number().int().min(Pe).max(ee),height:zod.z.number().int().min(Pe).max(ee),cells:zod.z.string().max(ee*ee).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(e=>e.cells.length===e.width*e.height,{message:"Silhouette cells do not match its width and height"}),_t=zod.z.union([Pt,Tt]),Tn=["topLeft","topRight","bottomLeft"],se=zod.z.object({outer:k.optional(),inner:k.optional()}),Lt=zod.z.object({topLeft:se.optional(),topRight:se.optional(),bottomLeft:se.optional()}),_n=zod.z.object({value:zod.z.string(),size:zod.z.number().optional(),level:At.optional(),bgColor:k.optional(),fgColor:k.optional(),eyeColor:k.optional(),dotColor:k.optional(),bodyPattern:Re.optional(),cornerEyePattern:he.optional(),cornerEyeDotPattern:de.optional(),margin:zod.z.number().optional(),imageSettings:xt.optional(),isOGContext:zod.z.boolean().optional(),templateId:zod.z.string().optional(),customProps:zod.z.record(zod.z.string(),zod.z.any()).optional(),frame:Ce.optional(),art:me.optional(),eyeColors:Lt.optional(),moduleScale:zod.z.number().min(Mt).max(Ct).optional(),autoLevel:zod.z.boolean().optional(),shape:_t.optional()});var Ln=zod.z.object({fgColor:zod.z.string().optional(),bgColor:zod.z.string().optional()}),Nn=zod.z.object({pixelSize:zod.z.number(),url:zod.z.string()}),In=zod.z.object({id:zod.z.string(),name:zod.z.string(),description:zod.z.string().optional()});/**
|
|
1
|
+
'use strict';var zod=require('zod');var X;(h=>{class e{constructor(o,r,t,i){this.version=o;this.errorCorrectionLevel=r;if(o<e.MIN_VERSION||o>e.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let s=[];for(let u=0;u<this.size;u++)s.push(false);for(let u=0;u<this.size;u++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();let d=this.addEccAndInterleave(t);if(this.drawCodewords(d),i==-1){let u=1e9;for(let y=0;y<8;y++){this.applyMask(y),this.drawFormatBits(y);let b=this.getPenaltyScore();b<u&&(i=y,u=b),this.applyMask(y);}}l(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(o,r){let t=h.QrSegment.makeSegments(o);return e.encodeSegments(t,r)}static encodeBinary(o,r){let t=h.QrSegment.makeBytes(o);return e.encodeSegments([t],r)}static encodeSegments(o,r,t=1,i=40,s=-1,d=true){if(!(e.MIN_VERSION<=t&&t<=i&&i<=e.MAX_VERSION)||s<-1||s>7)throw new RangeError("Invalid value");let u,y;for(u=t;;u++){let x=e.getNumDataCodewords(u,r)*8,A=c.getTotalBits(o,u);if(A<=x){y=A;break}if(u>=i)throw new RangeError("Data too long")}for(let x of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])d&&y<=e.getNumDataCodewords(u,x)*8&&(r=x);let b=[];for(let x of o){n(x.mode.modeBits,4,b),n(x.numChars,x.mode.numCharCountBits(u),b);for(let A of x.getData())b.push(A);}l(b.length==y);let M=e.getNumDataCodewords(u,r)*8;l(b.length<=M),n(0,Math.min(4,M-b.length),b),n(0,(8-b.length%8)%8,b),l(b.length%8==0);for(let x=236;b.length<M;x^=253)n(x,8,b);let m=[];for(;m.length*8<b.length;)m.push(0);return b.forEach((x,A)=>m[A>>>3]|=x<<7-(A&7)),new e(u,r,m,s)}size;mask;modules=[];isFunction=[];getModule(o,r){return 0<=o&&o<this.size&&0<=r&&r<this.size&&this.modules[r][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let t=0;t<this.size;t++)this.setFunctionModule(6,t,t%2==0),this.setFunctionModule(t,6,t%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let o=this.getAlignmentPatternPositions(),r=o.length;for(let t=0;t<r;t++)for(let i=0;i<r;i++)t==0&&i==0||t==0&&i==r-1||t==r-1&&i==0||this.drawAlignmentPattern(o[t],o[i]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(o){let r=this.errorCorrectionLevel.formatBits<<3|o,t=r;for(let s=0;s<10;s++)t=t<<1^(t>>>9)*1335;let i=(r<<10|t)^21522;l(i>>>15==0);for(let s=0;s<=5;s++)this.setFunctionModule(8,s,a(i,s));this.setFunctionModule(8,7,a(i,6)),this.setFunctionModule(8,8,a(i,7)),this.setFunctionModule(7,8,a(i,8));for(let s=9;s<15;s++)this.setFunctionModule(14-s,8,a(i,s));for(let s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,a(i,s));for(let s=8;s<15;s++)this.setFunctionModule(8,this.size-15+s,a(i,s));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let o=this.version;for(let t=0;t<12;t++)o=o<<1^(o>>>11)*7973;let r=this.version<<12|o;l(r>>>18==0);for(let t=0;t<18;t++){let i=a(r,t),s=this.size-11+t%3,d=Math.floor(t/3);this.setFunctionModule(s,d,i),this.setFunctionModule(d,s,i);}}drawFinderPattern(o,r){for(let t=-4;t<=4;t++)for(let i=-4;i<=4;i++){let s=Math.max(Math.abs(i),Math.abs(t)),d=o+i,u=r+t;0<=d&&d<this.size&&0<=u&&u<this.size&&this.setFunctionModule(d,u,s!=2&&s!=4);}}drawAlignmentPattern(o,r){for(let t=-2;t<=2;t++)for(let i=-2;i<=2;i++)this.setFunctionModule(o+i,r+t,Math.max(Math.abs(i),Math.abs(t))!=1);}setFunctionModule(o,r,t){this.modules[r][o]=t,this.isFunction[r][o]=true;}addEccAndInterleave(o){let r=this.version,t=this.errorCorrectionLevel;if(o.length!=e.getNumDataCodewords(r,t))throw new RangeError("Invalid argument");let i=e.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][r],s=e.ECC_CODEWORDS_PER_BLOCK[t.ordinal][r],d=Math.floor(e.getNumRawDataModules(r)/8),u=i-d%i,y=Math.floor(d/i),b=[],M=e.reedSolomonComputeDivisor(s);for(let x=0,A=0;x<i;x++){let P=o.slice(A,A+y-s+(x<u?0:1));A+=P.length;let R=e.reedSolomonComputeRemainder(P,M);x<u&&P.push(0),b.push(P.concat(R));}let m=[];for(let x=0;x<b[0].length;x++)b.forEach((A,P)=>{(x!=y-s||P>=u)&&m.push(A[x]);});return l(m.length==d),m}drawCodewords(o){if(o.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let s=0;s<2;s++){let d=t-s,y=(t+1&2)==0?this.size-1-i:i;!this.isFunction[y][d]&&r<o.length*8&&(this.modules[y][d]=a(o[r>>>3],7-(r&7)),r++);}}l(r==o.length*8);}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let r=0;r<this.size;r++)for(let t=0;t<this.size;t++){let i;switch(o){case 0:i=(t+r)%2==0;break;case 1:i=r%2==0;break;case 2:i=t%3==0;break;case 3:i=(t+r)%3==0;break;case 4:i=(Math.floor(t/3)+Math.floor(r/2))%2==0;break;case 5:i=t*r%2+t*r%3==0;break;case 6:i=(t*r%2+t*r%3)%2==0;break;case 7:i=((t+r)%2+t*r%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[r][t]&&i&&(this.modules[r][t]=!this.modules[r][t]);}}getPenaltyScore(){let o=0;for(let s=0;s<this.size;s++){let d=false,u=0,y=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[s][b]==d?(u++,u==5?o+=e.PENALTY_N1:u>5&&o++):(this.finderPenaltyAddHistory(u,y),d||(o+=this.finderPenaltyCountPatterns(y)*e.PENALTY_N3),d=this.modules[s][b],u=1);o+=this.finderPenaltyTerminateAndCount(d,u,y)*e.PENALTY_N3;}for(let s=0;s<this.size;s++){let d=false,u=0,y=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[b][s]==d?(u++,u==5?o+=e.PENALTY_N1:u>5&&o++):(this.finderPenaltyAddHistory(u,y),d||(o+=this.finderPenaltyCountPatterns(y)*e.PENALTY_N3),d=this.modules[b][s],u=1);o+=this.finderPenaltyTerminateAndCount(d,u,y)*e.PENALTY_N3;}for(let s=0;s<this.size-1;s++)for(let d=0;d<this.size-1;d++){let u=this.modules[s][d];u==this.modules[s][d+1]&&u==this.modules[s+1][d]&&u==this.modules[s+1][d+1]&&(o+=e.PENALTY_N2);}let r=0;for(let s of this.modules)r=s.reduce((d,u)=>d+(u?1:0),r);let t=this.size*this.size,i=Math.ceil(Math.abs(r*20-t*10)/t)-1;return l(0<=i&&i<=9),o+=i*e.PENALTY_N4,l(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return [];{let o=Math.floor(this.version/7)+2,r=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2,t=[6];for(let i=this.size-7;t.length<o;i-=r)t.splice(1,0,i);return t}}static getNumRawDataModules(o){if(o<e.MIN_VERSION||o>e.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*o+128)*o+64;if(o>=2){let t=Math.floor(o/7)+2;r-=(25*t-10)*t-55,o>=7&&(r-=36);}return l(208<=r&&r<=29648),r}static getNumDataCodewords(o,r){return Math.floor(e.getNumRawDataModules(o)/8)-e.ECC_CODEWORDS_PER_BLOCK[r.ordinal][o]*e.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let r=[];for(let i=0;i<o-1;i++)r.push(0);r.push(1);let t=1;for(let i=0;i<o;i++){for(let s=0;s<r.length;s++)r[s]=e.reedSolomonMultiply(r[s],t),s+1<r.length&&(r[s]^=r[s+1]);t=e.reedSolomonMultiply(t,2);}return r}static reedSolomonComputeRemainder(o,r){let t=r.map(i=>0);for(let i of o){let s=i^t.shift();t.push(0),r.forEach((d,u)=>t[u]^=e.reedSolomonMultiply(d,s));}return t}static reedSolomonMultiply(o,r){if(o>>>8||r>>>8)throw new RangeError("Byte out of range");let t=0;for(let i=7;i>=0;i--)t=t<<1^(t>>>7)*285,t^=(r>>>i&1)*o;return l(t>>>8==0),t}finderPenaltyCountPatterns(o){let r=o[1];l(r<=this.size*3);let t=r>0&&o[2]==r&&o[3]==r*3&&o[4]==r&&o[5]==r;return (t&&o[0]>=r*4&&o[6]>=r?1:0)+(t&&o[6]>=r*4&&o[0]>=r?1:0)}finderPenaltyTerminateAndCount(o,r,t){return o&&(this.finderPenaltyAddHistory(r,t),r=0),r+=this.size,this.finderPenaltyAddHistory(r,t),this.finderPenaltyCountPatterns(t)}finderPenaltyAddHistory(o,r){r[0]==0&&(o+=this.size),r.pop(),r.unshift(o);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}h.QrCode=e;function n(f,o,r){if(o<0||o>31||f>>>o)throw new RangeError("Value out of range");for(let t=o-1;t>=0;t--)r.push(f>>>t&1);}function a(f,o){return (f>>>o&1)!=0}function l(f){if(!f)throw new Error("Assertion error")}class c{constructor(o,r,t){this.mode=o;this.numChars=r;this.bitData=t;if(r<0)throw new RangeError("Invalid argument");this.bitData=t.slice();}mode;numChars;bitData;static makeBytes(o){let r=[];for(let t of o)n(t,8,r);return new c(c.Mode.BYTE,o.length,r)}static makeNumeric(o){if(!c.isNumeric(o))throw new RangeError("String contains non-numeric characters");let r=[];for(let t=0;t<o.length;){let i=Math.min(o.length-t,3);n(parseInt(o.substr(t,i),10),i*3+1,r),t+=i;}return new c(c.Mode.NUMERIC,o.length,r)}static makeAlphanumeric(o){if(!c.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let r=[],t;for(t=0;t+2<=o.length;t+=2){let i=c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t))*45;i+=c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t+1)),n(i,11,r);}return t<o.length&&n(c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t)),6,r),new c(c.Mode.ALPHANUMERIC,o.length,r)}static makeSegments(o){return o==""?[]:c.isNumeric(o)?[c.makeNumeric(o)]:c.isAlphanumeric(o)?[c.makeAlphanumeric(o)]:[c.makeBytes(c.toUtf8ByteArray(o))]}static makeEci(o){let r=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)n(o,8,r);else if(o<16384)n(2,2,r),n(o,14,r);else if(o<1e6)n(6,3,r),n(o,21,r);else throw new RangeError("ECI assignment value out of range");return new c(c.Mode.ECI,0,r)}static isNumeric(o){return c.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return c.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,r){let t=0;for(let i of o){let s=i.mode.numCharCountBits(r);if(i.numChars>=1<<s)return 1/0;t+=4+s+i.bitData.length;}return t}static toUtf8ByteArray(o){o=encodeURI(o);let r=[];for(let t=0;t<o.length;t++)o.charAt(t)!="%"?r.push(o.charCodeAt(t)):(r.push(parseInt(o.substr(t+1,2),16)),t+=2);return r}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}h.QrSegment=c;})(X||={});(n=>{(l=>{class a{constructor(h,f){this.ordinal=h;this.formatBits=f;}ordinal;formatBits;static LOW=new a(0,1);static MEDIUM=new a(1,0);static QUARTILE=new a(2,3);static HIGH=new a(3,2)}l.Ecc=a;})(n.QrCode||={});})(X||={});(n=>{(l=>{class a{constructor(h,f){this.modeBits=h;this.numBitsCharCount=f;}modeBits;numBitsCharCount;static NUMERIC=new a(1,[10,12,14]);static ALPHANUMERIC=new a(2,[9,11,13]);static BYTE=new a(4,[8,16,16]);static KANJI=new a(8,[8,10,12]);static ECI=new a(7,[0,0,0]);numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}}l.Mode=a;})(n.QrSegment||={});})(X||={});var Z=X;({L:Z.QrCode.Ecc.LOW,M:Z.QrCode.Ecc.MEDIUM,Q:Z.QrCode.Ecc.QUARTILE,H:Z.QrCode.Ecc.HIGH});var zt=0;function Dt(e,n="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||n:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||n:n}function fe(e,n="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:n}}function Gt(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function Ut(e){return typeof e=="object"&&e!==null&&e.type==="image"}function Bt(e,n="#000000"){let a=fe(e,n);return a.type==="solid"?a.color:a.type==="image"?a.underlay||n:a.stops[0]?.color||n}function je(e="center"){let[n,a]=e.split("-");return e==="center"?"center":a?`${a} ${n}`:n==="top"||n==="bottom"?`center ${n}`:`${n} center`}function kt(e){if(!e)return "#000000";if(typeof e=="string")return e;let n=fe(e);if(n.type==="solid")return n.color;if(n.type==="image"){let c=n.fit==="tile"?`${25*(n.scale??1)}% auto`:(n.scale??1)===1?n.fit==="contain"?"contain":"cover":`${100*(n.scale??1)}% auto`,h=n.fit==="tile"?"repeat":"no-repeat";return `${`url("${n.src.replace(/"/g,"%22")}")`} ${je(n.position)} / ${c} ${h}, ${n.underlay??"transparent"}`}let l=[...n.stops].sort((c,h)=>c.offset-h.offset).map(c=>`${c.color} ${c.offset}%`).join(", ");return n.type==="linear"?`linear-gradient(${(n.angle??0)+90}deg, ${l})`:n.type==="angular"?`conic-gradient(from ${n.angle??0}deg, ${l})`:`radial-gradient(circle, ${l})`}var he=["logo","halftone"],re={logo:["blend","badge"],halftone:["color","mono"]},j=192,ne=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],ye=["diamond","star","banner"],ie=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],be=["curly"],Se=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],xe=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],z=24,qt="Scan me",Ee=.5,V=1.5,ge=["square","rounded","circle"],Ae=.1,Me=.3,Qt=.25,Re=2,_e=.5,Ce=1,Yt=.07,Te=["square","circle","heart"],Ht=3,$=64,ae=8,Xt=.42,jt=["topLeft","topRight","bottomLeft"];var Vt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},$t=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Pe=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Ve(e,n=Number.POSITIVE_INFINITY){if(!$t.test(e))return null;let a=[],l=0,c=()=>{for(;l<e.length&&/[\s,]/.test(e[l]);)l++;},h=()=>{c(),Pe.lastIndex=l;let r=Pe.exec(e);if(!r)return null;let t=r[0],i=t.indexOf(".");if(i>=0&&t.length-i-1>n)return null;l=Pe.lastIndex;let s=Number(t);return Number.isFinite(s)?s:null},f=()=>{c();let r=e[l];return r==="0"||r==="1"?(l++,r==="1"?1:0):null},o=()=>(c(),l<e.length&&/[0-9.+-]/.test(e[l]));for(c();l<e.length;){let r=e[l],t=r.toUpperCase(),i=Vt[t];if(i===void 0||a.length===0&&t!=="M")return null;if(l++,i===0){a.push({command:r,values:[]}),c();continue}let s=r,d=true;for(;d||o();){let u=[];for(let y=0;y<i;y++){let b=t==="A"&&(y===3||y===4)?f():h();if(b===null)return null;u.push(b);}a.push({command:s,values:u}),t==="M"&&(s=r==="M"?"L":"l"),d=false;}c();}return a}function $e(e){let n=0;for(let{command:a}of e)n+=a.toUpperCase()==="A"?4:1;return n}function Ke(e,n){let a=[c=>c[0]-n.x0,c=>n.x1-c[0],c=>c[1]-n.y0,c=>n.y1-c[1]],l=e;for(let c of a){if(l.length===0)break;let h=l;l=[];for(let f=0;f<h.length;f++){let o=h[f],r=h[(f+h.length-1)%h.length],t=c(o),i=c(r);t>=0?(i<0&&l.push(Ze(r,o,i,t)),l.push(o)):i>=0&&l.push(Ze(r,o,i,t));}}return l.length>2?l:[]}function Ze(e,n,a,l){let c=a/(a-l);return [e[0]+(n[0]-e[0])*c,e[1]+(n[1]-e[1])*c]}function We(e){let n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=(f,o)=>{n=Math.min(n,f),a=Math.min(a,o),l=Math.max(l,f),c=Math.max(c,o);};for(let f of e)f.op==="C"?(h(f.x1,f.y1),h(f.x2,f.y2),h(f.x,f.y)):f.op!=="Z"&&h(f.x,f.y);return Number.isFinite(n)?{x0:n,y0:a,x1:l,y1:c}:null}var Le=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Zt(e,n,a,l,c,h,f,o,r){if(e===o&&n===r)return [];let t=Math.abs(a),i=Math.abs(l);if(t===0||i===0)return [{op:"L",x:o,y:r}];let s=c*Math.PI/180,d=Math.cos(s),u=Math.sin(s),y=(e-o)/2,b=(n-r)/2,M=d*y+u*b,m=-u*y+d*b,x=M*M/(t*t)+m*m/(i*i);x>1&&(t*=Math.sqrt(x),i*=Math.sqrt(x));let A=t*t*i*i-t*t*m*m-i*i*M*M,P=t*t*m*m+i*i*M*M,R=(h===f?-1:1)*Math.sqrt(Math.max(0,A/P)),S=R*t*m/i,E=-R*i*M/t,T=d*S-u*E+(e+o)/2,N=u*S+d*E+(n+r)/2,Q=(F,O,w,oe)=>Math.atan2(F*oe-O*w,F*w+O*oe),ee=Q(1,0,(M-S)/t,(m-E)/i),G=Q((M-S)/t,(m-E)/i,(-M-S)/t,(-m-E)/i);!f&&G>0?G-=2*Math.PI:f&&G<0&&(G+=2*Math.PI);let Y=Math.max(1,Math.ceil(Math.abs(G)/(Math.PI/2)-1e-9)),H=G/Y,te=4/3*Math.tan(H/4),de=(F,O)=>[T+t*d*F-i*u*O,N+t*u*F+i*d*O],Xe=[];for(let F=0;F<Y;F++){let O=ee+F*H,w=O+H,[oe,It]=de(Math.cos(O)-te*Math.sin(O),Math.sin(O)+te*Math.cos(O)),[Ot,Ft]=de(Math.cos(w)+te*Math.sin(w),Math.sin(w)-te*Math.cos(w)),[vt,wt]=F===Y-1?[o,r]:de(Math.cos(w),Math.sin(w));Xe.push({op:"C",x1:oe,y1:It,x2:Ot,y2:Ft,x:vt,y:wt});}return Xe}function Je(e){let n=[],a=0,l=0,c=0,h=0,f=0,o="",r=null,t=null,i=()=>{for(;a<e.length&&/[\s,]/.test(e[a]);)a++;},s=()=>{i(),Le.lastIndex=a;let y=Le.exec(e);return y?(a=Le.lastIndex,Number(y[0])):null},d=()=>{i();let y=e[a];return y==="0"||y==="1"?(a++,y==="1"):null},u=y=>{let b=[];for(let M=0;M<y;M++){let m=s();if(m===null)return null;b.push(m);}return b};for(;i(),!(a>=e.length);){let y=e[a];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(y))o=y,a++;else if(!o||o==="Z"||o==="z")break;let b=o===o.toLowerCase(),M=b?l:0,m=b?c:0,x=o.toUpperCase();if(x==="Z"){n.push({op:"Z"}),l=h,c=f,r=null,t=null;continue}if(x==="A"){let S=u(3),E=d(),T=d(),N=u(2);if(!(S&&N)||E===null||T===null)break;let[Q,ee,G]=S,Y=N[0]+M,H=N[1]+m;n.push(...Zt(l,c,Q,ee,G,E,T,Y,H)),l=Y,c=H,r=null,t=null;continue}let A={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[x]??0,P=u(A);if(!P)break;let R=P;switch(x){case "M":l=R[0]+M,c=R[1]+m,h=l,f=c,n.push({op:"M",x:l,y:c}),o=b?"l":"L",r=null,t=null;break;case "L":case "H":case "V":x!=="V"&&(l=R[0]+M),x==="V"?c=R[0]+m:x==="L"&&(c=R[1]+m),n.push({op:"L",x:l,y:c}),r=null,t=null;break;case "C":case "S":{let S,E;x==="C"?(S=[R[0]+M,R[1]+m],E=R.slice(2)):(S=r?[2*l-r[0],2*c-r[1]]:[l,c],E=R);let T=[E[0]+M,E[1]+m],N=[E[2]+M,E[3]+m];n.push({op:"C",x1:S[0],y1:S[1],x2:T[0],y2:T[1],x:N[0],y:N[1]}),[l,c]=N,r=T,t=null;break}case "Q":case "T":{let S,E;x==="Q"?(S=[R[0]+M,R[1]+m],E=[R[2]+M,R[3]+m]):(S=t?[2*l-t[0],2*c-t[1]]:[l,c],E=[R[0]+M,R[1]+m]),n.push({op:"C",x1:l+2/3*(S[0]-l),y1:c+2/3*(S[1]-c),x2:E[0]+2/3*(S[0]-E[0]),y2:E[1]+2/3*(S[1]-E[1]),x:E[0],y:E[1]}),[l,c]=E,t=S,r=null;break}}}return n}var Ie="qrdx.frame",Oe=1,Fe="custom",L={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:z},ve=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],we=.95,tt=200,ze=["frame","text","accent","background"],Kt=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Wt=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;function ot(e,n=z){let a=e.slice(0,1e3).normalize("NFC").replace(Kt," ").replace(Wt,"").replace(/\s+/g," ").trim();return Array.from(a).slice(0,Math.max(0,n)).join("").trim()}function Jt(e){for(let n of e)if((n.codePointAt(0)??0)>255)return false;return true}var se=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function ce(e){let n=De(e);return {x0:e.qr.x-n,y0:e.qr.y-n,x1:e.qr.x+e.qr.size+n,y1:e.qr.y+e.qr.size+n}}function eo(e){return {x0:e.qr.x,y0:e.qr.y,x1:e.qr.x+e.qr.size,y1:e.qr.y+e.qr.size}}function De(e){return e.qr.padding??e.qr.size*L.defaultPadding}var to=.52,oo=.35;function ro(e){let n=e.fontSize??e.box.height*to;return Math.min(n*V,e.box.height*we)}var Ne=(e,n)=>Math.min(e.x1,n.x1)-Math.max(e.x0,n.x0)>1e-6&&Math.min(e.y1,n.y1)-Math.max(e.y0,n.y0)>1e-6;function et(e){let n=ce(e),a=Math.min(e.qr.radius??0,(n.x1-n.x0)/2,(n.y1-n.y0)/2),l=[[n.x0+a,n.y0+a,Math.PI],[n.x1-a,n.y0+a,-Math.PI/2],[n.x1-a,n.y1-a,0],[n.x0+a,n.y1-a,Math.PI/2]],c=[];for(let[h,f,o]of l)for(let r=0;r<=8;r++){let t=o+Math.PI/2*(r/8);c.push([h+a*Math.cos(t),f+a*Math.sin(t)]);}return c}function no([e,n],a,l){if(e<a.x-.01||n<a.y-.01||e>a.x+a.width+.01||n>a.y+a.height+.01)return false;let h=Math.min(l,a.width/2,a.height/2),f=Math.min(Math.max(e,a.x+h),a.x+a.width-h),o=Math.min(Math.max(n,a.y+h),a.y+a.height-h);return Math.hypot(e-f,n-o)<=h+.01}function io(e){let n=0;return e.forEach(([a,l],c)=>{let[h,f]=e[(c+1)%e.length];n+=a*f-h*l;}),Math.abs(n)/2}function ao(e,n,a){let l=ce(n);if(!Ne(a,l))return false;if("stroke"in e&&e.stroke)return true;if(e.fill==="background")return false;if(e.type==="rect"&&e.hole){let{hole:c}=e;return !et(n).every(h=>no(h,c,c.radius??0))}if(e.type==="circle"&&e.hole){let c=e.hole;return !et(n).every(([h,f])=>Math.hypot(h-e.cx,f-e.cy)<=c+.01)}if(e.type==="polygon"){let c=Ke(e.points,l);return c.length>2&&io(c)>1e-6}return true}function so(e){let n=co(e),a="stroke"in e?e.stroke:void 0;if(!(a&&n.bounds))return n;let l=e.type==="circle"||e.type==="ellipse"?a.width/2:e.type==="rect"?a.width*Math.SQRT2/2:a.width*2,{x0:c,y0:h,x1:f,y1:o}=n.bounds;return {bounds:{x0:c-l,y0:h-l,x1:f+l,y1:o+l},segments:n.segments*2}}function co(e){switch(e.type){case "rect":return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.width,y1:e.y+e.height},segments:e.hole?18:9};case "circle":return {bounds:{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r},segments:e.hole?10:5};case "ellipse":return {bounds:{x0:e.cx-e.rx,y0:e.cy-e.ry,x1:e.cx+e.rx,y1:e.cy+e.ry},segments:5};case "polygon":{let n=e.points.map(([l])=>l),a=e.points.map(([,l])=>l);return {bounds:{x0:Math.min(...n),y0:Math.min(...a),x1:Math.max(...n),y1:Math.max(...a)},segments:e.points.length}}case "path":{let n=Ve(e.d,L.maxDecimals);return n?{bounds:We(Je(e.d)),segments:$e(n)}:{bounds:null,segments:0}}case "line":{let n=e.width/2,a=Math.hypot(e.x2-e.x1,e.y2-e.y1),l=e.dash?Math.ceil(a/(e.dash[0]+e.dash[1])):1;return {bounds:{x0:Math.min(e.x1,e.x2)-n,y0:Math.min(e.y1,e.y2)-n,x1:Math.max(e.x1,e.x2)+n,y1:Math.max(e.y1,e.y2)+n},segments:l*(e.cap==="round"?4:5)}}default:return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.size,y1:e.y+e.size},segments:tt}}}function rt(e,n){let a=L,l=new TextEncoder().encode(JSON.stringify(e)).length;if(l>a.maxBytes){n(`The spec is ${l} bytes; the limit is ${a.maxBytes}`);return}let{width:c,height:h}=e.artboard,f=Math.max(c,h)*.005,o={x0:-f,y0:-f,x1:c+f,y1:h+f},r=m=>m.x0>=o.x0&&m.y0>=o.y0&&m.x1<=o.x1&&m.y1<=o.y1,{qr:t}=e,i=De(e);t.plate!=="none"&&i<t.size*a.minPadding-1e-9&&n(`qr.padding must be at least ${a.minPadding*100}% of qr.size`,["qr","padding"]),t.size<Math.min(c,h)*a.minQrShare-1e-9&&n(`qr.size must be at least ${a.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let s=ce(e);(s.x0<-1e-9||s.y0<-1e-9||s.x1>c+1e-9||s.y1>h+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(t.radius??0)>(t.size+2*i)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let d=0,u=0;e.shapes.forEach((m,x)=>{let A=["shapes",x],{bounds:P,segments:R}=so(m);if(!P){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...A,"d"]);return}if(r(P)||n("The shape extends outside the artboard",A),m.type==="rect"&&m.hole){let{hole:S}=m;(S.x<m.x||S.y<m.y||S.x+S.width>m.x+m.width+1e-9||S.y+S.height>m.y+m.height+1e-9)&&n("The hole must sit inside its rect",[...A,"hole"]);}m.type==="circle"&&m.hole&&m.hole>=m.r&&n("The hole must be smaller than the circle",[...A,"hole"]),"stroke"in m&&m.stroke&&m.stroke.width>Math.min(c,h)*.1+1e-9&&n("A stroke may be at most 10% of the artboard's shorter side",[...A,"stroke","width"]),t.plate==="background"&&ao(m,e,P)&&n('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',A),d+=R,typeof m.fill=="object"&&"gradient"in m.fill&&(u+=(m.fill.gradient.steps??32)*R);}),d>a.maxSegments&&n(`The shapes have ${d} segments; the limit is ${a.maxSegments}`,["shapes"]),u>a.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let y=[],b=new Set,M=new Set;e.labels.forEach((m,x)=>{let A=["labels",x];b.has(m.id)&&n(`Label id "${m.id}" is used twice`,[...A,"id"]),b.add(m.id),m.slot!=="fixed"&&(M.has(m.slot)&&n(`Only one label may use the ${m.slot} slot`,[...A,"slot"]),M.add(m.slot));let P=m.maxLength??a.maxTextLength;m.text!==ot(m.text,P)&&n(`Label text must be at most ${P} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...A,"text"]);let R;if(m.type==="text"){R={x0:m.box.x,y0:m.box.y,x1:m.box.x+m.box.width,y1:m.box.y+m.box.height},m.fontSize!==void 0&&m.fontSize>m.box.height*we+1e-9&&n("fontSize may be at most 95% of the label's row height",[...A,"fontSize"]);let S=m.box.y+m.box.height/2,E=ro(m)*oo,T={x0:R.x0,x1:R.x1,y0:S-E,y1:S+E};(Ne(R,eo(e))||Ne(T,s))&&n("The label overlaps the code or its padding",[...A,"box"]);}else {let{cx:S,cy:E,radius:T}=m.curve,N=m.fontSize*V*.6;R={x0:S-T-N,y0:E-T-N,x1:S+T+N,y1:E+T+N};let Q=Math.hypot(Math.max(s.x0-S,0,S-s.x1),Math.max(s.y0-E,0,E-s.y1));Math.hypot(Math.max(Math.abs(s.x0-S),Math.abs(s.x1-S)),Math.max(Math.abs(s.y0-E),Math.abs(s.y1-E)))<=T-N||Q>=T+N||n("The curved label crosses the code or its padding",[...A,"curve"]);}if(r(R)||n("The label extends outside the artboard",A),m.collapse){let S=m.collapse,E=S.y+S.height;(S.y<-1e-9||E>h+1e-9)&&n("The collapse band must sit inside the artboard",[...A,"collapse"]),E>s.y0+1e-6&&S.y<s.y1-1e-6&&n("The collapse band crosses the code or its padding",[...A,"collapse"]);for(let T of y)E>T.y+1e-6&&S.y<T.y+T.height-1e-6&&n("Collapse bands may not overlap",[...A,"collapse"]);y.push(S);}});}var it=zod.z.enum(he),at=zod.z.enum([...re.logo,...re.halftone]),nt=e=>Math.ceil(e/3)*4,st=zod.z.object({width:zod.z.number().int().min(1).max(j),height:zod.z.number().int().min(1).max(j),data:zod.z.string().max(nt(j*j*4))}).refine(e=>e.data.length===nt(e.width*e.height*4),{message:"Art image data does not match its width and height"}),Ge=zod.z.object({mode:it,image:st,intensity:zod.z.number().min(0).max(1).optional(),variant:at.optional(),matchEyes:zod.z.boolean().optional()});var lo=zod.z.enum(["solid","linear","radial","angular","image"]),ct=zod.z.object({type:zod.z.literal("solid"),color:zod.z.string()}),le=zod.z.object({color:zod.z.string(),offset:zod.z.number().min(0).max(100)}),lt=zod.z.object({type:zod.z.literal("linear"),stops:zod.z.array(le).min(2),angle:zod.z.number().optional().default(0)}),mt=zod.z.object({type:zod.z.literal("radial"),stops:zod.z.array(le).min(2)}),pt=zod.z.object({type:zod.z.literal("angular"),stops:zod.z.array(le).min(2),angle:zod.z.number().optional().default(0)}),ut=zod.z.enum(["cover","contain","tile"]),dt=zod.z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),ft=zod.z.object({type:zod.z.literal("image"),src:zod.z.string().min(1),fit:ut.optional().default("cover"),scale:zod.z.number().min(.1).max(4).optional().default(1),position:dt.optional().default("center"),opacity:zod.z.number().min(0).max(1).optional().default(1),underlay:zod.z.string().optional()}),U=zod.z.union([zod.z.string(),ct,lt,mt,pt,ft]);var mo=zod.z.object({x:zod.z.number(),y:zod.z.number(),w:zod.z.number(),h:zod.z.number()});var Ue=zod.z.enum([...ne,...ye]),po=zod.z.enum(ne);var Be=zod.z.enum([...ie,...be]),uo=zod.z.enum(ie);var bt=zod.z.enum(xe),me=zod.z.object({style:bt,text:zod.z.string().max(z).optional(),color:zod.z.string().optional(),textColor:zod.z.string().optional(),secondaryText:zod.z.string().max(z).optional(),secondaryColor:zod.z.string().optional(),fontScale:zod.z.number().min(Ee).max(V).optional()});var C=zod.z.number().min(-L.maxCoordinate).max(L.maxCoordinate).refine(se,{message:`Numbers may have at most ${L.maxDecimals} decimals`}),I=C.refine(e=>e>0,{message:"Must be greater than 0"}),pe=C.refine(e=>e>=0,{message:"Must not be negative"}),W=zod.z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),St=zod.z.union([zod.z.enum(ze),W]),Et=e=>zod.z.object({mix:zod.z.tuple([e,e]),amount:zod.z.number().min(0).max(1).refine(se)}).strict(),q=zod.z.union([St,Et(St)]),fo=zod.z.union([W,Et(zod.z.union([zod.z.enum(["frame","accent","background"]),W]))]),k=zod.z.union([q,zod.z.object({gradient:zod.z.object({from:q,to:q,direction:zod.z.enum(["horizontal","vertical"]).optional(),steps:zod.z.int().min(2).max(L.maxGradientSteps).optional()}).strict()}).strict()]),ke={x:C,y:C,width:I,height:I},J=zod.z.object({color:q,width:I}).strict(),ho=zod.z.object({type:zod.z.literal("rect"),...ke,radius:pe.optional(),fill:k,hole:zod.z.object({...ke,radius:pe.optional()}).strict().optional(),stroke:J.optional()}).strict(),yo=zod.z.object({type:zod.z.literal("circle"),cx:C,cy:C,r:I,hole:I.optional(),fill:k,stroke:J.optional()}).strict(),bo=zod.z.object({type:zod.z.literal("ellipse"),cx:C,cy:C,rx:I,ry:I,fill:k,stroke:J.optional()}).strict(),So=zod.z.object({type:zod.z.literal("polygon"),points:zod.z.array(zod.z.tuple([C,C])).min(3).max(L.maxPolygonPoints),fill:k,stroke:J.optional()}).strict(),xo=zod.z.object({type:zod.z.literal("path"),d:zod.z.string().min(2).max(L.maxPathLength),fill:k,fillRule:zod.z.enum(["nonzero","evenodd"]).optional(),stroke:J.optional()}).strict(),Eo=zod.z.object({type:zod.z.literal("line"),x1:C,y1:C,x2:C,y2:C,width:I,cap:zod.z.enum(["butt","round"]).optional(),dash:zod.z.tuple([I,I]).optional(),fill:k}).strict(),go=zod.z.object({type:zod.z.literal("icon"),icon:zod.z.enum(ve),x:C,y:C,size:I,fill:k}).strict(),gt=zod.z.discriminatedUnion("type",[ho,yo,bo,So,xo,Eo,go]),At={id:zod.z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:zod.z.enum(["primary","secondary","fixed"]),text:zod.z.string().max(200),maxLength:zod.z.int().min(1).max(z).optional(),color:q,weight:zod.z.enum(["bold","regular"]).optional(),collapse:zod.z.object({y:C,height:I}).strict().optional()},Ao=zod.z.object({type:zod.z.literal("text"),...At,box:zod.z.object(ke).strict(),align:zod.z.enum(["start","middle","end"]).optional(),fontSize:I.optional()}).strict(),Mo=zod.z.object({type:zod.z.literal("curved"),...At,curve:zod.z.object({cx:C,cy:C,radius:I,side:zod.z.enum(["top","bottom"]),spread:zod.z.number().min(20).max(300).refine(se).optional()}).strict(),fontSize:I}).strict(),Mt=zod.z.discriminatedUnion("type",[Ao,Mo]),xt=C.refine(e=>e>=L.minArtboard&&e<=L.maxArtboard,{message:`Artboard sides must be ${L.minArtboard} to ${L.maxArtboard} units`}),Ro=zod.z.object({kind:zod.z.literal(Ie),version:zod.z.literal(Oe),artboard:zod.z.object({width:xt,height:xt}).strict(),qr:zod.z.object({x:C,y:C,size:I,padding:pe.optional(),radius:pe.optional(),plate:zod.z.enum(["opaque","background","none"]).optional()}).strict(),colors:zod.z.object({frame:W,text:fo.optional(),accent:W.optional()}).strict(),shapes:zod.z.array(gt).max(L.maxShapes),labels:zod.z.array(Mt).max(L.maxLabels),bleed:zod.z.union([zod.z.literal("none"),q]).optional()}).strict(),qe=Ro.superRefine((e,n)=>rt(e,(a,l=[])=>n.addIssue({code:"custom",message:a,path:l})));function _o(e){let n=qe.safeParse(e);return n.success?[]:n.error.issues.map(a=>a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message)}var Rt=me.extend({style:zod.z.literal(Fe),spec:qe}),Qe=zod.z.discriminatedUnion("style",[me,Rt]);var Ye=zod.z.enum(Se);var He=zod.z.enum(ge),_t=zod.z.object({src:zod.z.string(),height:zod.z.number(),width:zod.z.number(),excavate:zod.z.boolean(),x:zod.z.number().optional(),y:zod.z.number().optional(),padding:zod.z.number().min(0).optional(),shape:He.optional(),plate:zod.z.string().optional()}),To=zod.z.object({size:zod.z.number().min(Ae).max(Me).optional(),padding:zod.z.number().min(0).max(Re).optional(),x:zod.z.number().min(0).max(1).optional(),y:zod.z.number().min(0).max(1).optional(),shape:He.optional(),plate:zod.z.string().optional()}),Ct=zod.z.enum(["L","M","Q","H"]),Tt=zod.z.enum(Te),Pt=zod.z.object({type:zod.z.literal("silhouette"),width:zod.z.number().int().min(ae).max($),height:zod.z.number().int().min(ae).max($),cells:zod.z.string().max($*$).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(e=>e.cells.length===e.width*e.height,{message:"Silhouette cells do not match its width and height"}),Lt=zod.z.union([Tt,Pt]),ue=zod.z.object({outer:U.optional(),inner:U.optional()}),Nt=zod.z.object({topLeft:ue.optional(),topRight:ue.optional(),bottomLeft:ue.optional()}),Po=zod.z.object({value:zod.z.string(),size:zod.z.number().optional(),level:Ct.optional(),bgColor:U.optional(),fgColor:U.optional(),eyeColor:U.optional(),dotColor:U.optional(),bodyPattern:Ye.optional(),cornerEyePattern:Be.optional(),cornerEyeDotPattern:Ue.optional(),margin:zod.z.number().optional(),imageSettings:_t.optional(),isOGContext:zod.z.boolean().optional(),templateId:zod.z.string().optional(),customProps:zod.z.record(zod.z.string(),zod.z.any()).optional(),frame:Qe.optional(),art:Ge.optional(),eyeColors:Nt.optional(),moduleScale:zod.z.number().min(_e).max(Ce).optional(),autoLevel:zod.z.boolean().optional(),shape:Lt.optional()});var Lo=zod.z.object({fgColor:zod.z.string().optional(),bgColor:zod.z.string().optional()}),No=zod.z.object({pixelSize:zod.z.number(),url:zod.z.string()}),Io=zod.z.object({id:zod.z.string(),name:zod.z.string(),description:zod.z.string().optional()});/**
|
|
2
2
|
* @license QR Code generator library (TypeScript)
|
|
3
3
|
* Copyright (c) Project Nayuki.
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/exports.AUTO_LEVEL_LOGO_COVERAGE=
|
|
5
|
+
*/exports.AUTO_LEVEL_LOGO_COVERAGE=Yt;exports.BODY_PATTERN=Se;exports.CORNER_EYE_DOT_PATTERNS=ne;exports.CORNER_EYE_PATTERNS=ie;exports.CUSTOM_FRAME_STYLE=Fe;exports.DEFAULT_FRAME_TEXT=qt;exports.DEFAULT_MARGIN=zt;exports.EYE_POSITIONS=jt;exports.FRAME_COLOR_TOKENS=ze;exports.FRAME_FONT_SCALE_MAX=V;exports.FRAME_FONT_SCALE_MIN=Ee;exports.FRAME_ICONS=ve;exports.FRAME_ICON_MAX_SEGMENTS=tt;exports.FRAME_SPEC_KIND=Ie;exports.FRAME_SPEC_LABEL_MAX_FONT=we;exports.FRAME_SPEC_LIMITS=L;exports.FRAME_SPEC_VERSION=Oe;exports.FRAME_STYLES=xe;exports.FRAME_TEXT_MAX_LENGTH=z;exports.LOGO_PADDING_MAX=Re;exports.LOGO_SHAPES=ge;exports.LOGO_SIZE_DEFAULT=Qt;exports.LOGO_SIZE_MAX=Me;exports.LOGO_SIZE_MIN=Ae;exports.MODULE_SCALE_MAX=Ce;exports.MODULE_SCALE_MIN=_e;exports.QR_ART_MAX_SAMPLE_SIZE=j;exports.QR_ART_MODES=he;exports.QR_ART_VARIANTS=re;exports.QR_CIRCLE_QUIET_MIN=Ht;exports.QR_SHAPES=Te;exports.QR_SILHOUETTE_MAX_CELLS=$;exports.QR_SILHOUETTE_MIN_CELLS=ae;exports.QR_SILHOUETTE_MIN_SHARE=Xt;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=ye;exports.RETIRED_CORNER_EYE_PATTERNS=be;exports.angularGradientSchema=pt;exports.anyFrameSchema=Qe;exports.baseTemplatePropsSchema=Lo;exports.bodyPatternSchema=Ye;exports.colorConfigSchema=U;exports.colorTypeSchema=lo;exports.cornerEyeDotPatternSchema=Ue;exports.cornerEyePatternSchema=Be;exports.customFrameSchema=Rt;exports.errorLevelSchema=Ct;exports.excavationSchema=mo;exports.eyeColorOverrideSchema=ue;exports.eyeColorsSchema=Nt;exports.frameSchema=me;exports.frameSpecColorSchema=q;exports.frameSpecLabelSchema=Mt;exports.frameSpecPadding=De;exports.frameSpecPaintSchema=k;exports.frameSpecQrZone=ce;exports.frameSpecSchema=qe;exports.frameSpecShapeSchema=gt;exports.frameStyleSchema=bt;exports.getColorString=Bt;exports.getFrameSpecIssues=_o;exports.getNormalizedColor=kt;exports.getSolidColor=Dt;exports.gradientStopSchema=le;exports.imageFitSchema=ut;exports.imagePaintSchema=ft;exports.imagePositionCss=je;exports.imagePositionSchema=dt;exports.imageSettingsSchema=_t;exports.isGradient=Gt;exports.isImagePaint=Ut;exports.isLatin1Text=Jt;exports.linearGradientSchema=lt;exports.logoOptionsSchema=To;exports.logoShapeSchema=He;exports.normalizeColorConfig=fe;exports.pickableCornerEyeDotPatternSchema=po;exports.pickableCornerEyePatternSchema=uo;exports.qrArtImageSchema=st;exports.qrArtModeSchema=it;exports.qrArtSchema=Ge;exports.qrArtVariantSchema=at;exports.qrCodeShapeSchema=Lt;exports.qrPropsSchema=Po;exports.qrShapeSchema=Tt;exports.qrSilhouetteSchema=Pt;exports.radialGradientSchema=mt;exports.sanitizeFrameText=ot;exports.solidColorSchema=ct;exports.templateConfigSchema=No;exports.templateDefinitionBaseSchema=Io;//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|