appshot-cli 0.1.0
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/LICENSE +21 -0
- package/README.md +381 -0
- package/bin/appshot.js +5 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +31 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +200 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/caption.d.ts +3 -0
- package/dist/commands/caption.d.ts.map +1 -0
- package/dist/commands/caption.js +118 -0
- package/dist/commands/caption.js.map +1 -0
- package/dist/commands/check.d.ts +3 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +121 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/clean.d.ts +3 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +133 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +84 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/localize.d.ts +3 -0
- package/dist/commands/localize.d.ts.map +1 -0
- package/dist/commands/localize.js +31 -0
- package/dist/commands/localize.js.map +1 -0
- package/dist/commands/presets.d.ts +3 -0
- package/dist/commands/presets.d.ts.map +1 -0
- package/dist/commands/presets.js +135 -0
- package/dist/commands/presets.js.map +1 -0
- package/dist/commands/specs.d.ts +3 -0
- package/dist/commands/specs.d.ts.map +1 -0
- package/dist/commands/specs.js +69 -0
- package/dist/commands/specs.js.map +1 -0
- package/dist/commands/validate.d.ts +3 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +183 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/core/app-store-specs.d.ts +55 -0
- package/dist/core/app-store-specs.d.ts.map +1 -0
- package/dist/core/app-store-specs.js +457 -0
- package/dist/core/app-store-specs.js.map +1 -0
- package/dist/core/compose.d.ts +30 -0
- package/dist/core/compose.d.ts.map +1 -0
- package/dist/core/compose.js +420 -0
- package/dist/core/compose.js.map +1 -0
- package/dist/core/devices.d.ts +50 -0
- package/dist/core/devices.d.ts.map +1 -0
- package/dist/core/devices.js +404 -0
- package/dist/core/devices.js.map +1 -0
- package/dist/core/files.d.ts +5 -0
- package/dist/core/files.d.ts.map +1 -0
- package/dist/core/files.js +35 -0
- package/dist/core/files.js.map +1 -0
- package/dist/core/frames-analyzer.d.ts +24 -0
- package/dist/core/frames-analyzer.d.ts.map +1 -0
- package/dist/core/frames-analyzer.js +97 -0
- package/dist/core/frames-analyzer.js.map +1 -0
- package/dist/core/frames-loader.d.ts +113 -0
- package/dist/core/frames-loader.d.ts.map +1 -0
- package/dist/core/frames-loader.js +440 -0
- package/dist/core/frames-loader.js.map +1 -0
- package/dist/core/mask-generator.d.ts +10 -0
- package/dist/core/mask-generator.d.ts.map +1 -0
- package/dist/core/mask-generator.js +99 -0
- package/dist/core/mask-generator.js.map +1 -0
- package/dist/core/render.d.ts +10 -0
- package/dist/core/render.d.ts.map +1 -0
- package/dist/core/render.js +92 -0
- package/dist/core/render.js.map +1 -0
- package/dist/core/text-renderer.d.ts +18 -0
- package/dist/core/text-renderer.d.ts.map +1 -0
- package/dist/core/text-renderer.js +148 -0
- package/dist/core/text-renderer.js.map +1 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/caption-history.d.ts +35 -0
- package/dist/utils/caption-history.d.ts.map +1 -0
- package/dist/utils/caption-history.js +233 -0
- package/dist/utils/caption-history.js.map +1 -0
- package/frames/Frames.json +308 -0
- package/frames/MacBook Air 2020.png +0 -0
- package/frames/MacBook Air 2022.png +0 -0
- package/frames/MacBook Pro 13.png +0 -0
- package/frames/MacBook Pro 2021 14.png +0 -0
- package/frames/MacBook Pro 2021 16.png +0 -0
- package/frames/Watch Series 10 42.png +0 -0
- package/frames/Watch Series 10 42_mask.png +0 -0
- package/frames/Watch Series 10 46.png +0 -0
- package/frames/Watch Series 10 46_mask.png +0 -0
- package/frames/Watch Series 4 40.png +0 -0
- package/frames/Watch Series 4 44.png +0 -0
- package/frames/Watch Series 7 41.png +0 -0
- package/frames/Watch Series 7 45.png +0 -0
- package/frames/Watch Ultra 2024.png +0 -0
- package/frames/iMac 2021.png +0 -0
- package/frames/iPad 2021 Landscape.png +0 -0
- package/frames/iPad 2021 Portrait.png +0 -0
- package/frames/iPad Air 2020 Landscape.png +0 -0
- package/frames/iPad Air 2020 Portrait.png +0 -0
- package/frames/iPad Pro 2018-2021 11 Landscape.png +0 -0
- package/frames/iPad Pro 2018-2021 11 Portrait.png +0 -0
- package/frames/iPad Pro 2018-2021 Landscape.png +0 -0
- package/frames/iPad Pro 2018-2021 Portrait.png +0 -0
- package/frames/iPad Pro 2024 11 Landscape.png +0 -0
- package/frames/iPad Pro 2024 11 Portrait.png +0 -0
- package/frames/iPad Pro 2024 13 Landscape.png +0 -0
- package/frames/iPad Pro 2024 13 Portrait.png +0 -0
- package/frames/iPad mini 2021 Landscape.png +0 -0
- package/frames/iPad mini 2021 Portrait.png +0 -0
- package/frames/iPhone 11 Landscape.png +0 -0
- package/frames/iPhone 11 Portrait.png +0 -0
- package/frames/iPhone 11 Pro Max Landscape.png +0 -0
- package/frames/iPhone 11 Pro Max Portrait.png +0 -0
- package/frames/iPhone 11 Pro Portrait.png +0 -0
- package/frames/iPhone 12-13 Pro Landscape.png +0 -0
- package/frames/iPhone 12-13 Pro Max Landscape.png +0 -0
- package/frames/iPhone 12-13 Pro Max Landscape_mask.png +0 -0
- package/frames/iPhone 12-13 Pro Max Portrait.png +0 -0
- package/frames/iPhone 12-13 Pro Max Portrait_mask.png +0 -0
- package/frames/iPhone 12-13 Pro Portrait.png +0 -0
- package/frames/iPhone 12-13 mini Landscape.png +0 -0
- package/frames/iPhone 12-13 mini Portrait.png +0 -0
- package/frames/iPhone 16 Landscape.png +0 -0
- package/frames/iPhone 16 Landscape_frame_no_island.png +0 -0
- package/frames/iPhone 16 Landscape_mask.png +0 -0
- package/frames/iPhone 16 Plus Landscape.png +0 -0
- package/frames/iPhone 16 Plus Landscape_frame_no_island.png +0 -0
- package/frames/iPhone 16 Plus Landscape_mask.png +0 -0
- package/frames/iPhone 16 Plus Portrait.png +0 -0
- package/frames/iPhone 16 Plus Portrait_frame_no_island.png +0 -0
- package/frames/iPhone 16 Plus Portrait_mask.png +0 -0
- package/frames/iPhone 16 Portrait.png +0 -0
- package/frames/iPhone 16 Portrait_frame_no_island.png +0 -0
- package/frames/iPhone 16 Portrait_mask.png +0 -0
- package/frames/iPhone 16 Pro Landscape.png +0 -0
- package/frames/iPhone 16 Pro Landscape_frame_no_island.png +0 -0
- package/frames/iPhone 16 Pro Landscape_mask.png +0 -0
- package/frames/iPhone 16 Pro Max Landscape.png +0 -0
- package/frames/iPhone 16 Pro Max Landscape_frame_no_island.png +0 -0
- package/frames/iPhone 16 Pro Max Landscape_mask.png +0 -0
- package/frames/iPhone 16 Pro Max Portrait.png +0 -0
- package/frames/iPhone 16 Pro Max Portrait_frame_no_island.png +0 -0
- package/frames/iPhone 16 Pro Max Portrait_mask.png +0 -0
- package/frames/iPhone 16 Pro Portrait.png +0 -0
- package/frames/iPhone 16 Pro Portrait_frame_no_island.png +0 -0
- package/frames/iPhone 16 Pro Portrait_mask.png +0 -0
- package/frames/iPhone 8 Plus Landscape.png +0 -0
- package/frames/iPhone 8 Plus Portrait.png +0 -0
- 2020 SE.png +0 -0
- package/frames/version.txt +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export interface FrameMetadata {
|
|
2
|
+
x: string;
|
|
3
|
+
y: string;
|
|
4
|
+
name: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface FramesData {
|
|
9
|
+
Mac?: Record<string, any>;
|
|
10
|
+
iPhone?: Record<string, any>;
|
|
11
|
+
iPad?: Record<string, any>;
|
|
12
|
+
Watch?: Record<string, any>;
|
|
13
|
+
version?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Load and parse the Frames.json metadata
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadFramesMetadata(framesDir: string): Promise<FramesData>;
|
|
19
|
+
/**
|
|
20
|
+
* Convert Frames.json structure to our frame registry format
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildFrameRegistry(framesDir: string): Promise<({
|
|
23
|
+
name: string;
|
|
24
|
+
displayName: string;
|
|
25
|
+
orientation: "portrait";
|
|
26
|
+
frameWidth: number;
|
|
27
|
+
frameHeight: number;
|
|
28
|
+
screenRect: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
deviceType: "iphone";
|
|
35
|
+
originalName: string;
|
|
36
|
+
maskPath: string | undefined;
|
|
37
|
+
} | {
|
|
38
|
+
name: string;
|
|
39
|
+
displayName: string;
|
|
40
|
+
orientation: "landscape";
|
|
41
|
+
frameWidth: number;
|
|
42
|
+
frameHeight: number;
|
|
43
|
+
screenRect: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
};
|
|
49
|
+
deviceType: "iphone";
|
|
50
|
+
originalName: string;
|
|
51
|
+
maskPath: string | undefined;
|
|
52
|
+
} | {
|
|
53
|
+
name: string;
|
|
54
|
+
displayName: string;
|
|
55
|
+
orientation: "portrait";
|
|
56
|
+
frameWidth: number;
|
|
57
|
+
frameHeight: number;
|
|
58
|
+
screenRect: {
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
};
|
|
64
|
+
deviceType: "ipad";
|
|
65
|
+
originalName: string;
|
|
66
|
+
maskPath: string | undefined;
|
|
67
|
+
} | {
|
|
68
|
+
name: string;
|
|
69
|
+
displayName: string;
|
|
70
|
+
orientation: "landscape";
|
|
71
|
+
frameWidth: number;
|
|
72
|
+
frameHeight: number;
|
|
73
|
+
screenRect: {
|
|
74
|
+
x: number;
|
|
75
|
+
y: number;
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
};
|
|
79
|
+
deviceType: "ipad";
|
|
80
|
+
originalName: string;
|
|
81
|
+
maskPath: string | undefined;
|
|
82
|
+
} | {
|
|
83
|
+
name: string;
|
|
84
|
+
displayName: string;
|
|
85
|
+
orientation: "landscape";
|
|
86
|
+
frameWidth: number;
|
|
87
|
+
frameHeight: number;
|
|
88
|
+
screenRect: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
};
|
|
94
|
+
deviceType: "mac";
|
|
95
|
+
originalName: string;
|
|
96
|
+
maskPath?: undefined;
|
|
97
|
+
} | {
|
|
98
|
+
name: string;
|
|
99
|
+
displayName: string;
|
|
100
|
+
orientation: "portrait";
|
|
101
|
+
frameWidth: number;
|
|
102
|
+
frameHeight: number;
|
|
103
|
+
screenRect: {
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
width: number;
|
|
107
|
+
height: number;
|
|
108
|
+
};
|
|
109
|
+
deviceType: "watch";
|
|
110
|
+
originalName: string;
|
|
111
|
+
maskPath?: undefined;
|
|
112
|
+
})[]>;
|
|
113
|
+
//# sourceMappingURL=frames-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames-loader.d.ts","sourceRoot":"","sources":["../../src/core/frames-loader.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAuFD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAS/E;AA+BD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyVzD"}
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import sharp from 'sharp';
|
|
4
|
+
// Device screenshot resolutions based on Apple's official specifications
|
|
5
|
+
const DEVICE_RESOLUTIONS = {
|
|
6
|
+
// iPhone 16 Series
|
|
7
|
+
'iphone 16 pro max': { portrait: { width: 1320, height: 2868 }, landscape: { width: 2868, height: 1320 } },
|
|
8
|
+
'iphone 16 pro': { portrait: { width: 1206, height: 2622 }, landscape: { width: 2622, height: 1206 } },
|
|
9
|
+
'iphone 16 plus': { portrait: { width: 1290, height: 2796 }, landscape: { width: 2796, height: 1290 } },
|
|
10
|
+
'iphone 16': { portrait: { width: 1179, height: 2556 }, landscape: { width: 2556, height: 1179 } },
|
|
11
|
+
// iPhone 15 Series
|
|
12
|
+
'iphone 15 pro max': { portrait: { width: 1290, height: 2796 }, landscape: { width: 2796, height: 1290 } },
|
|
13
|
+
'iphone 15 pro': { portrait: { width: 1179, height: 2556 }, landscape: { width: 2556, height: 1179 } },
|
|
14
|
+
'iphone 15 plus': { portrait: { width: 1290, height: 2796 }, landscape: { width: 2796, height: 1290 } },
|
|
15
|
+
'iphone 15': { portrait: { width: 1179, height: 2556 }, landscape: { width: 2556, height: 1179 } },
|
|
16
|
+
// iPhone 14 Series
|
|
17
|
+
'iphone 14 pro max': { portrait: { width: 1290, height: 2796 }, landscape: { width: 2796, height: 1290 } },
|
|
18
|
+
'iphone 14 pro': { portrait: { width: 1179, height: 2556 }, landscape: { width: 2556, height: 1179 } },
|
|
19
|
+
'iphone 14 plus': { portrait: { width: 1284, height: 2778 }, landscape: { width: 2778, height: 1284 } },
|
|
20
|
+
'iphone 14': { portrait: { width: 1170, height: 2532 }, landscape: { width: 2532, height: 1170 } },
|
|
21
|
+
// iPhone 13 Series
|
|
22
|
+
'iphone 13 pro max': { portrait: { width: 1284, height: 2778 }, landscape: { width: 2778, height: 1284 } },
|
|
23
|
+
'iphone 13 pro': { portrait: { width: 1170, height: 2532 }, landscape: { width: 2532, height: 1170 } },
|
|
24
|
+
'iphone 13': { portrait: { width: 1170, height: 2532 }, landscape: { width: 2532, height: 1170 } },
|
|
25
|
+
'iphone 13 mini': { portrait: { width: 1080, height: 2340 }, landscape: { width: 2340, height: 1080 } },
|
|
26
|
+
// iPhone 12 Series
|
|
27
|
+
'iphone 12 pro max': { portrait: { width: 1284, height: 2778 }, landscape: { width: 2778, height: 1284 } },
|
|
28
|
+
'iphone 12 pro': { portrait: { width: 1170, height: 2532 }, landscape: { width: 2532, height: 1170 } },
|
|
29
|
+
'iphone 12': { portrait: { width: 1170, height: 2532 }, landscape: { width: 2532, height: 1170 } },
|
|
30
|
+
'iphone 12 mini': { portrait: { width: 1080, height: 2340 }, landscape: { width: 2340, height: 1080 } },
|
|
31
|
+
// Grouped models (from Frames.json naming)
|
|
32
|
+
'iphone 12-13 pro max': { portrait: { width: 1284, height: 2778 }, landscape: { width: 2778, height: 1284 } },
|
|
33
|
+
'iphone 12-13 pro': { portrait: { width: 1170, height: 2532 }, landscape: { width: 2532, height: 1170 } },
|
|
34
|
+
'iphone 12-13 mini': { portrait: { width: 1080, height: 2340 }, landscape: { width: 2340, height: 1080 } },
|
|
35
|
+
// iPhone 11 Series
|
|
36
|
+
'iphone 11 pro max': { portrait: { width: 1242, height: 2688 }, landscape: { width: 2688, height: 1242 } },
|
|
37
|
+
'iphone 11 pro': { portrait: { width: 1125, height: 2436 }, landscape: { width: 2436, height: 1125 } },
|
|
38
|
+
'iphone 11': { portrait: { width: 828, height: 1792 }, landscape: { width: 1792, height: 828 } },
|
|
39
|
+
// iPhone SE/8
|
|
40
|
+
'iphone 8 and 2020 se': { portrait: { width: 750, height: 1334 } },
|
|
41
|
+
'iphone se': { portrait: { width: 750, height: 1334 } },
|
|
42
|
+
// iPad resolutions
|
|
43
|
+
'ipad pro 2018-2021': { portrait: { width: 2048, height: 2732 }, landscape: { width: 2732, height: 2048 } },
|
|
44
|
+
'ipad pro 2018-2021 11': { portrait: { width: 1668, height: 2388 }, landscape: { width: 2388, height: 1668 } },
|
|
45
|
+
'ipad pro 2024 11': { portrait: { width: 2064, height: 2752 }, landscape: { width: 2752, height: 2064 } },
|
|
46
|
+
'ipad pro 2024 13': { portrait: { width: 2064, height: 2752 }, landscape: { width: 2752, height: 2064 } },
|
|
47
|
+
'ipad air 2020': { portrait: { width: 1640, height: 2360 }, landscape: { width: 2360, height: 1640 } },
|
|
48
|
+
'ipad mini 2021': { portrait: { width: 1620, height: 2160 }, landscape: { width: 2160, height: 1620 } },
|
|
49
|
+
'ipad 2021': { portrait: { width: 1620, height: 2160 }, landscape: { width: 2160, height: 1620 } },
|
|
50
|
+
// Mac resolutions
|
|
51
|
+
'macbook pro 2021 16': { portrait: { width: 3456, height: 2234 } },
|
|
52
|
+
'macbook pro 2021 14': { portrait: { width: 3024, height: 1964 } },
|
|
53
|
+
'macbook air 2022': { portrait: { width: 2560, height: 1664 } },
|
|
54
|
+
'imac 2021': { portrait: { width: 4480, height: 2520 } },
|
|
55
|
+
// Default fallback
|
|
56
|
+
'default': { portrait: { width: 0, height: 0 } }
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Get screenshot dimensions for a specific device and orientation
|
|
60
|
+
*/
|
|
61
|
+
function getScreenshotDimensions(frameName, orientation) {
|
|
62
|
+
const normalizedName = frameName.toLowerCase();
|
|
63
|
+
// Find matching device resolution
|
|
64
|
+
for (const [key, res] of Object.entries(DEVICE_RESOLUTIONS)) {
|
|
65
|
+
if (normalizedName.includes(key)) {
|
|
66
|
+
if (orientation === 'landscape' && res.landscape) {
|
|
67
|
+
return res.landscape;
|
|
68
|
+
}
|
|
69
|
+
return res.portrait;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Return 0,0 to indicate we need to fall back to calculation
|
|
73
|
+
return { width: 0, height: 0 };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Load and parse the Frames.json metadata
|
|
77
|
+
*/
|
|
78
|
+
export async function loadFramesMetadata(framesDir) {
|
|
79
|
+
const metadataPath = path.join(framesDir, 'Frames.json');
|
|
80
|
+
try {
|
|
81
|
+
const content = await fs.readFile(metadataPath, 'utf8');
|
|
82
|
+
return JSON.parse(content);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error('Failed to load Frames.json:', error);
|
|
86
|
+
return {};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get frame dimensions from the actual PNG file
|
|
91
|
+
*/
|
|
92
|
+
async function getFrameDimensions(framePath) {
|
|
93
|
+
try {
|
|
94
|
+
const metadata = await sharp(framePath).metadata();
|
|
95
|
+
return {
|
|
96
|
+
width: metadata.width || 0,
|
|
97
|
+
height: metadata.height || 0
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Parse a frame entry with proper type checking
|
|
106
|
+
*/
|
|
107
|
+
function parseFrameEntry(entry) {
|
|
108
|
+
if (!entry || typeof entry !== 'object')
|
|
109
|
+
return null;
|
|
110
|
+
if (!entry.name || typeof entry.name !== 'string')
|
|
111
|
+
return null;
|
|
112
|
+
return {
|
|
113
|
+
name: entry.name,
|
|
114
|
+
x: entry.x || '0',
|
|
115
|
+
y: entry.y || '0'
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Convert Frames.json structure to our frame registry format
|
|
120
|
+
*/
|
|
121
|
+
export async function buildFrameRegistry(framesDir) {
|
|
122
|
+
const framesData = await loadFramesMetadata(framesDir);
|
|
123
|
+
const registry = [];
|
|
124
|
+
// Process iPhones
|
|
125
|
+
if (framesData.iPhone) {
|
|
126
|
+
for (const [_model, variants] of Object.entries(framesData.iPhone)) {
|
|
127
|
+
if (!variants || typeof variants !== 'object')
|
|
128
|
+
continue;
|
|
129
|
+
// Check for direct Portrait/Landscape
|
|
130
|
+
const processOrientation = async (orientation) => {
|
|
131
|
+
const orientationKey = orientation.toLowerCase();
|
|
132
|
+
if (variants[orientation]) {
|
|
133
|
+
const frame = parseFrameEntry(variants[orientation]);
|
|
134
|
+
if (!frame)
|
|
135
|
+
return;
|
|
136
|
+
const framePath = path.join(framesDir, `${frame.name}.png`);
|
|
137
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
138
|
+
if (dimensions) {
|
|
139
|
+
// Get the actual screenshot dimensions for this device
|
|
140
|
+
const screenshotDims = getScreenshotDimensions(frame.name, orientationKey);
|
|
141
|
+
const calculatedWidth = dimensions.width - (parseInt(frame.x) || 0) * 2;
|
|
142
|
+
const calculatedHeight = dimensions.height - (parseInt(frame.y) || 0) * 2;
|
|
143
|
+
// Use the smaller of the fixed resolution or calculated resolution
|
|
144
|
+
const screenWidth = screenshotDims.width ? Math.min(screenshotDims.width, calculatedWidth) : calculatedWidth;
|
|
145
|
+
const screenHeight = screenshotDims.height ? Math.min(screenshotDims.height, calculatedHeight) : calculatedHeight;
|
|
146
|
+
// Check if mask file exists
|
|
147
|
+
const maskPath = path.join(framesDir, `${frame.name}_mask.png`);
|
|
148
|
+
const maskExists = await fs.access(maskPath).then(() => true).catch(() => false);
|
|
149
|
+
registry.push({
|
|
150
|
+
name: frame.name.toLowerCase().replace(/ /g, '-'),
|
|
151
|
+
displayName: frame.name,
|
|
152
|
+
orientation: orientationKey,
|
|
153
|
+
frameWidth: dimensions.width,
|
|
154
|
+
frameHeight: dimensions.height,
|
|
155
|
+
screenRect: {
|
|
156
|
+
x: parseInt(frame.x) || 0,
|
|
157
|
+
y: parseInt(frame.y) || 0,
|
|
158
|
+
width: screenWidth,
|
|
159
|
+
height: screenHeight
|
|
160
|
+
},
|
|
161
|
+
deviceType: 'iphone',
|
|
162
|
+
originalName: frame.name,
|
|
163
|
+
maskPath: maskExists ? maskPath : undefined
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
// Process nested variants (like Pro, Plus, etc.)
|
|
169
|
+
for (const [_variant, orientations] of Object.entries(variants)) {
|
|
170
|
+
if (!orientations || typeof orientations !== 'object')
|
|
171
|
+
continue;
|
|
172
|
+
await processOrientation('Portrait');
|
|
173
|
+
await processOrientation('Landscape');
|
|
174
|
+
// Also check nested orientations
|
|
175
|
+
if (orientations.Portrait) {
|
|
176
|
+
const frame = parseFrameEntry(orientations.Portrait);
|
|
177
|
+
if (frame) {
|
|
178
|
+
const framePath = path.join(framesDir, `${frame.name}.png`);
|
|
179
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
180
|
+
if (dimensions) {
|
|
181
|
+
// Get the actual screenshot dimensions for this device
|
|
182
|
+
const screenshotDims = getScreenshotDimensions(frame.name, 'portrait');
|
|
183
|
+
const calculatedWidth = dimensions.width - (parseInt(frame.x) || 0) * 2;
|
|
184
|
+
const calculatedHeight = dimensions.height - (parseInt(frame.y) || 0) * 2;
|
|
185
|
+
// Use the smaller of the fixed resolution or calculated resolution
|
|
186
|
+
const screenWidth = screenshotDims.width ? Math.min(screenshotDims.width, calculatedWidth) : calculatedWidth;
|
|
187
|
+
const screenHeight = screenshotDims.height ? Math.min(screenshotDims.height, calculatedHeight) : calculatedHeight;
|
|
188
|
+
// Check if mask file exists
|
|
189
|
+
const maskPath = path.join(framesDir, `${frame.name}_mask.png`);
|
|
190
|
+
const maskExists = await fs.access(maskPath).then(() => true).catch(() => false);
|
|
191
|
+
registry.push({
|
|
192
|
+
name: frame.name.toLowerCase().replace(/ /g, '-'),
|
|
193
|
+
displayName: frame.name,
|
|
194
|
+
orientation: 'portrait',
|
|
195
|
+
frameWidth: dimensions.width,
|
|
196
|
+
frameHeight: dimensions.height,
|
|
197
|
+
screenRect: {
|
|
198
|
+
x: parseInt(frame.x) || 0,
|
|
199
|
+
y: parseInt(frame.y) || 0,
|
|
200
|
+
width: screenWidth,
|
|
201
|
+
height: screenHeight
|
|
202
|
+
},
|
|
203
|
+
deviceType: 'iphone',
|
|
204
|
+
originalName: frame.name,
|
|
205
|
+
maskPath: maskExists ? maskPath : undefined
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (orientations.Landscape) {
|
|
211
|
+
const frame = parseFrameEntry(orientations.Landscape);
|
|
212
|
+
if (frame) {
|
|
213
|
+
const framePath = path.join(framesDir, `${frame.name}.png`);
|
|
214
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
215
|
+
if (dimensions) {
|
|
216
|
+
// Get the actual screenshot dimensions for this device
|
|
217
|
+
const screenshotDims = getScreenshotDimensions(frame.name, 'landscape');
|
|
218
|
+
const calculatedWidth = dimensions.width - (parseInt(frame.x) || 0) * 2;
|
|
219
|
+
const calculatedHeight = dimensions.height - (parseInt(frame.y) || 0) * 2;
|
|
220
|
+
// Use the smaller of the fixed resolution or calculated resolution
|
|
221
|
+
const screenWidth = screenshotDims.width ? Math.min(screenshotDims.width, calculatedWidth) : calculatedWidth;
|
|
222
|
+
const screenHeight = screenshotDims.height ? Math.min(screenshotDims.height, calculatedHeight) : calculatedHeight;
|
|
223
|
+
// Check if mask file exists
|
|
224
|
+
const maskPath = path.join(framesDir, `${frame.name}_mask.png`);
|
|
225
|
+
const maskExists = await fs.access(maskPath).then(() => true).catch(() => false);
|
|
226
|
+
registry.push({
|
|
227
|
+
name: frame.name.toLowerCase().replace(/ /g, '-'),
|
|
228
|
+
displayName: frame.name,
|
|
229
|
+
orientation: 'landscape',
|
|
230
|
+
frameWidth: dimensions.width,
|
|
231
|
+
frameHeight: dimensions.height,
|
|
232
|
+
screenRect: {
|
|
233
|
+
x: parseInt(frame.x) || 0,
|
|
234
|
+
y: parseInt(frame.y) || 0,
|
|
235
|
+
width: screenWidth,
|
|
236
|
+
height: screenHeight
|
|
237
|
+
},
|
|
238
|
+
deviceType: 'iphone',
|
|
239
|
+
originalName: frame.name,
|
|
240
|
+
maskPath: maskExists ? maskPath : undefined
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// Process iPads
|
|
249
|
+
if (framesData.iPad) {
|
|
250
|
+
for (const [_model, orientations] of Object.entries(framesData.iPad)) {
|
|
251
|
+
if (!orientations || typeof orientations !== 'object')
|
|
252
|
+
continue;
|
|
253
|
+
if (orientations.Portrait) {
|
|
254
|
+
const frame = parseFrameEntry(orientations.Portrait);
|
|
255
|
+
if (frame) {
|
|
256
|
+
const framePath = path.join(framesDir, `${frame.name}.png`);
|
|
257
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
258
|
+
if (dimensions) {
|
|
259
|
+
// Get the actual screenshot dimensions for this device
|
|
260
|
+
const screenshotDims = getScreenshotDimensions(frame.name, 'portrait');
|
|
261
|
+
const calculatedWidth = dimensions.width - (parseInt(frame.x) || 0) * 2;
|
|
262
|
+
const calculatedHeight = dimensions.height - (parseInt(frame.y) || 0) * 2;
|
|
263
|
+
// Use the smaller of the fixed resolution or calculated resolution
|
|
264
|
+
const screenWidth = screenshotDims.width ? Math.min(screenshotDims.width, calculatedWidth) : calculatedWidth;
|
|
265
|
+
const screenHeight = screenshotDims.height ? Math.min(screenshotDims.height, calculatedHeight) : calculatedHeight;
|
|
266
|
+
// Check if mask file exists
|
|
267
|
+
const maskPath = path.join(framesDir, `${frame.name}_mask.png`);
|
|
268
|
+
const maskExists = await fs.access(maskPath).then(() => true).catch(() => false);
|
|
269
|
+
registry.push({
|
|
270
|
+
name: frame.name.toLowerCase().replace(/ /g, '-'),
|
|
271
|
+
displayName: frame.name,
|
|
272
|
+
orientation: 'portrait',
|
|
273
|
+
frameWidth: dimensions.width,
|
|
274
|
+
frameHeight: dimensions.height,
|
|
275
|
+
screenRect: {
|
|
276
|
+
x: parseInt(frame.x) || 0,
|
|
277
|
+
y: parseInt(frame.y) || 0,
|
|
278
|
+
width: screenWidth,
|
|
279
|
+
height: screenHeight
|
|
280
|
+
},
|
|
281
|
+
deviceType: 'ipad',
|
|
282
|
+
originalName: frame.name,
|
|
283
|
+
maskPath: maskExists ? maskPath : undefined
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (orientations.Landscape) {
|
|
289
|
+
const frame = parseFrameEntry(orientations.Landscape);
|
|
290
|
+
if (frame) {
|
|
291
|
+
const framePath = path.join(framesDir, `${frame.name}.png`);
|
|
292
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
293
|
+
if (dimensions) {
|
|
294
|
+
// Get the actual screenshot dimensions for this device
|
|
295
|
+
const screenshotDims = getScreenshotDimensions(frame.name, 'landscape');
|
|
296
|
+
const calculatedWidth = dimensions.width - (parseInt(frame.x) || 0) * 2;
|
|
297
|
+
const calculatedHeight = dimensions.height - (parseInt(frame.y) || 0) * 2;
|
|
298
|
+
// Use the smaller of the fixed resolution or calculated resolution
|
|
299
|
+
const screenWidth = screenshotDims.width ? Math.min(screenshotDims.width, calculatedWidth) : calculatedWidth;
|
|
300
|
+
const screenHeight = screenshotDims.height ? Math.min(screenshotDims.height, calculatedHeight) : calculatedHeight;
|
|
301
|
+
// Check if mask file exists
|
|
302
|
+
const maskPath = path.join(framesDir, `${frame.name}_mask.png`);
|
|
303
|
+
const maskExists = await fs.access(maskPath).then(() => true).catch(() => false);
|
|
304
|
+
registry.push({
|
|
305
|
+
name: frame.name.toLowerCase().replace(/ /g, '-'),
|
|
306
|
+
displayName: frame.name,
|
|
307
|
+
orientation: 'landscape',
|
|
308
|
+
frameWidth: dimensions.width,
|
|
309
|
+
frameHeight: dimensions.height,
|
|
310
|
+
screenRect: {
|
|
311
|
+
x: parseInt(frame.x) || 0,
|
|
312
|
+
y: parseInt(frame.y) || 0,
|
|
313
|
+
width: screenWidth,
|
|
314
|
+
height: screenHeight
|
|
315
|
+
},
|
|
316
|
+
deviceType: 'ipad',
|
|
317
|
+
originalName: frame.name,
|
|
318
|
+
maskPath: maskExists ? maskPath : undefined
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
// Process Macs
|
|
326
|
+
if (framesData.Mac) {
|
|
327
|
+
for (const [_model, frameData] of Object.entries(framesData.Mac)) {
|
|
328
|
+
if (!frameData || typeof frameData !== 'object')
|
|
329
|
+
continue;
|
|
330
|
+
const frame = parseFrameEntry(frameData);
|
|
331
|
+
if (frame) {
|
|
332
|
+
const framePath = path.join(framesDir, `${frame.name}.png`);
|
|
333
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
334
|
+
if (dimensions) {
|
|
335
|
+
registry.push({
|
|
336
|
+
name: frame.name.toLowerCase().replace(/ /g, '-'),
|
|
337
|
+
displayName: frame.name,
|
|
338
|
+
orientation: 'landscape',
|
|
339
|
+
frameWidth: dimensions.width,
|
|
340
|
+
frameHeight: dimensions.height,
|
|
341
|
+
screenRect: {
|
|
342
|
+
x: parseInt(frame.x) || 0,
|
|
343
|
+
y: parseInt(frame.y) || 0,
|
|
344
|
+
width: dimensions.width - (parseInt(frame.x) || 0) * 2,
|
|
345
|
+
height: dimensions.height - (parseInt(frame.y) || 0) * 2
|
|
346
|
+
},
|
|
347
|
+
deviceType: 'mac',
|
|
348
|
+
originalName: frame.name
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
// Handle nested Mac models like "2021 MacBook Pro" with 14" and 16" variants
|
|
354
|
+
for (const [_size, sizeData] of Object.entries(frameData)) {
|
|
355
|
+
const sizeFrame = parseFrameEntry(sizeData);
|
|
356
|
+
if (sizeFrame) {
|
|
357
|
+
const framePath = path.join(framesDir, `${sizeFrame.name}.png`);
|
|
358
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
359
|
+
if (dimensions) {
|
|
360
|
+
registry.push({
|
|
361
|
+
name: sizeFrame.name.toLowerCase().replace(/ /g, '-'),
|
|
362
|
+
displayName: sizeFrame.name,
|
|
363
|
+
orientation: 'landscape',
|
|
364
|
+
frameWidth: dimensions.width,
|
|
365
|
+
frameHeight: dimensions.height,
|
|
366
|
+
screenRect: {
|
|
367
|
+
x: parseInt(sizeFrame.x) || 0,
|
|
368
|
+
y: parseInt(sizeFrame.y) || 0,
|
|
369
|
+
width: dimensions.width - (parseInt(sizeFrame.x) || 0) * 2,
|
|
370
|
+
height: dimensions.height - (parseInt(sizeFrame.y) || 0) * 2
|
|
371
|
+
},
|
|
372
|
+
deviceType: 'mac',
|
|
373
|
+
originalName: sizeFrame.name
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
// Process Watches
|
|
382
|
+
if (framesData.Watch) {
|
|
383
|
+
for (const [_model, variants] of Object.entries(framesData.Watch)) {
|
|
384
|
+
if (!variants || typeof variants !== 'object')
|
|
385
|
+
continue;
|
|
386
|
+
const frame = parseFrameEntry(variants);
|
|
387
|
+
if (frame) {
|
|
388
|
+
// Direct watch model like Ultra
|
|
389
|
+
const framePath = path.join(framesDir, `${frame.name}.png`);
|
|
390
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
391
|
+
if (dimensions) {
|
|
392
|
+
registry.push({
|
|
393
|
+
name: frame.name.toLowerCase().replace(/ /g, '-'),
|
|
394
|
+
displayName: frame.name,
|
|
395
|
+
orientation: 'portrait',
|
|
396
|
+
frameWidth: dimensions.width,
|
|
397
|
+
frameHeight: dimensions.height,
|
|
398
|
+
screenRect: {
|
|
399
|
+
x: parseInt(frame.x) || 0,
|
|
400
|
+
y: parseInt(frame.y) || 0,
|
|
401
|
+
width: dimensions.width - (parseInt(frame.x) || 0) * 2,
|
|
402
|
+
height: dimensions.height - (parseInt(frame.y) || 0) * 2
|
|
403
|
+
},
|
|
404
|
+
deviceType: 'watch',
|
|
405
|
+
originalName: frame.name
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
// Watch with size variants
|
|
411
|
+
for (const [_size, sizeData] of Object.entries(variants)) {
|
|
412
|
+
const sizeFrame = parseFrameEntry(sizeData);
|
|
413
|
+
if (sizeFrame) {
|
|
414
|
+
const framePath = path.join(framesDir, `${sizeFrame.name}.png`);
|
|
415
|
+
const dimensions = await getFrameDimensions(framePath);
|
|
416
|
+
if (dimensions) {
|
|
417
|
+
registry.push({
|
|
418
|
+
name: sizeFrame.name.toLowerCase().replace(/ /g, '-'),
|
|
419
|
+
displayName: sizeFrame.name,
|
|
420
|
+
orientation: 'portrait',
|
|
421
|
+
frameWidth: dimensions.width,
|
|
422
|
+
frameHeight: dimensions.height,
|
|
423
|
+
screenRect: {
|
|
424
|
+
x: parseInt(sizeFrame.x) || 0,
|
|
425
|
+
y: parseInt(sizeFrame.y) || 0,
|
|
426
|
+
width: dimensions.width - (parseInt(sizeFrame.x) || 0) * 2,
|
|
427
|
+
height: dimensions.height - (parseInt(sizeFrame.y) || 0) * 2
|
|
428
|
+
},
|
|
429
|
+
deviceType: 'watch',
|
|
430
|
+
originalName: sizeFrame.name
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return registry;
|
|
439
|
+
}
|
|
440
|
+
//# sourceMappingURL=frames-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames-loader.js","sourceRoot":"","sources":["../../src/core/frames-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,yEAAyE;AACzE,MAAM,kBAAkB,GAAmH;IACzI,mBAAmB;IACnB,mBAAmB,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAC1G,eAAe,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IACtG,gBAAgB,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IACvG,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EA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,CAAC,CAAC,CAAC,IAAI,CAAC;oCAC7B,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;oCAC7B,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;oCAC1D,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;iCAC7D;gCACD,UAAU,EAAE,OAAgB;gCAC5B,YAAY,EAAE,SAAS,CAAC,IAAI;6BAC7B,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a rounded rectangle mask without using SVG
|
|
3
|
+
* This creates a mask where white pixels are visible and black pixels are transparent
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateRoundedRectMask(width: number, height: number, cornerRadius: number): Promise<Buffer>;
|
|
6
|
+
/**
|
|
7
|
+
* Apply a rounded rectangle mask to an image
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyRoundedCorners(imageBuffer: Buffer, width: number, height: number, cornerRadius: number): Promise<Buffer>;
|
|
10
|
+
//# sourceMappingURL=mask-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-generator.d.ts","sourceRoot":"","sources":["../../src/core/mask-generator.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CAuEjB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CAwBjB"}
|