@shiinasaku/github-card 2.0.0 → 4.2.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/dist/lib.js ADDED
@@ -0,0 +1,1347 @@
1
+ // src/utils/themes.ts
2
+ var themes = {
3
+ default: {
4
+ bg: "fill-white",
5
+ title: "fill-blue-600",
6
+ text: "fill-slate-700",
7
+ icon: "fill-blue-500",
8
+ border: "stroke-slate-200"
9
+ },
10
+ dark: {
11
+ bg: "fill-zinc-900",
12
+ title: "fill-white",
13
+ text: "fill-zinc-400",
14
+ icon: "fill-emerald-400",
15
+ border: "stroke-zinc-800"
16
+ },
17
+ radical: {
18
+ bg: "fill-slate-900",
19
+ title: "fill-pink-500",
20
+ text: "fill-cyan-300",
21
+ icon: "fill-yellow-400",
22
+ border: "stroke-slate-800"
23
+ },
24
+ merko: {
25
+ bg: "fill-neutral-950",
26
+ title: "fill-lime-400",
27
+ text: "fill-emerald-400",
28
+ icon: "fill-lime-300",
29
+ border: "stroke-neutral-800"
30
+ },
31
+ gruvbox: {
32
+ bg: "fill-stone-800",
33
+ title: "fill-amber-400",
34
+ text: "fill-stone-300",
35
+ icon: "fill-orange-500",
36
+ border: "stroke-stone-700"
37
+ },
38
+ tokyonight: {
39
+ bg: "fill-slate-900",
40
+ title: "fill-blue-400",
41
+ text: "fill-teal-400",
42
+ icon: "fill-fuchsia-400",
43
+ border: "stroke-slate-800"
44
+ },
45
+ onedark: {
46
+ bg: "fill-slate-800",
47
+ title: "fill-amber-300",
48
+ text: "fill-slate-400",
49
+ icon: "fill-green-400",
50
+ border: "stroke-slate-700"
51
+ },
52
+ cobalt: {
53
+ bg: "fill-sky-950",
54
+ title: "fill-fuchsia-400",
55
+ text: "fill-emerald-300",
56
+ icon: "fill-blue-500",
57
+ border: "stroke-sky-900"
58
+ },
59
+ synthwave: {
60
+ bg: "fill-purple-950",
61
+ title: "fill-slate-200",
62
+ text: "fill-pink-500",
63
+ icon: "fill-orange-400",
64
+ border: "stroke-purple-900"
65
+ },
66
+ highcontrast: {
67
+ bg: "fill-black",
68
+ title: "fill-yellow-300",
69
+ text: "fill-white",
70
+ icon: "fill-cyan-400",
71
+ border: "stroke-zinc-800"
72
+ },
73
+ dracula: {
74
+ bg: "fill-slate-900",
75
+ title: "fill-pink-400",
76
+ text: "fill-slate-100",
77
+ icon: "fill-purple-400",
78
+ border: "stroke-slate-700"
79
+ },
80
+ monokai: {
81
+ bg: "fill-zinc-900",
82
+ title: "fill-pink-500",
83
+ text: "fill-zinc-100",
84
+ icon: "fill-lime-400",
85
+ border: "stroke-zinc-800"
86
+ },
87
+ nord: {
88
+ bg: "fill-slate-800",
89
+ title: "fill-cyan-400",
90
+ text: "fill-slate-300",
91
+ icon: "fill-blue-400",
92
+ border: "stroke-slate-700"
93
+ },
94
+ github_dark: {
95
+ bg: "fill-slate-900",
96
+ title: "fill-blue-400",
97
+ text: "fill-slate-300",
98
+ icon: "fill-blue-500",
99
+ border: "stroke-slate-800"
100
+ },
101
+ pearl: {
102
+ bg: "fill-slate-50",
103
+ title: "fill-slate-900",
104
+ text: "fill-slate-600",
105
+ icon: "fill-blue-600",
106
+ border: "stroke-slate-200"
107
+ },
108
+ slate: {
109
+ bg: "fill-slate-950",
110
+ title: "fill-slate-200",
111
+ text: "fill-slate-400",
112
+ icon: "fill-sky-400",
113
+ border: "stroke-slate-800"
114
+ },
115
+ forest: {
116
+ bg: "fill-emerald-950",
117
+ title: "fill-emerald-200",
118
+ text: "fill-emerald-400",
119
+ icon: "fill-emerald-500",
120
+ border: "stroke-emerald-900"
121
+ },
122
+ rose: {
123
+ bg: "fill-rose-950",
124
+ title: "fill-rose-200",
125
+ text: "fill-rose-300",
126
+ icon: "fill-rose-400",
127
+ border: "stroke-rose-900"
128
+ },
129
+ sand: {
130
+ bg: "fill-orange-50",
131
+ title: "fill-amber-900",
132
+ text: "fill-amber-700",
133
+ icon: "fill-amber-600",
134
+ border: "stroke-orange-200"
135
+ },
136
+ shiina: {
137
+ title: "fill-pink-400",
138
+ text: "fill-slate-100",
139
+ icon: "fill-sky-400",
140
+ bg: "#0B0C10",
141
+ border: "stroke-slate-800"
142
+ },
143
+ aurora: {
144
+ title: "fill-emerald-300",
145
+ text: "fill-slate-100",
146
+ icon: "fill-teal-400",
147
+ bg: "#020617",
148
+ border: "stroke-emerald-900"
149
+ },
150
+ oled: {
151
+ title: "fill-rose-400",
152
+ text: "fill-zinc-400",
153
+ icon: "fill-indigo-400",
154
+ bg: "#000000",
155
+ border: "stroke-zinc-900"
156
+ }
157
+ };
158
+ function resolveColors(opts) {
159
+ const base = opts.theme && themes[opts.theme] || themes.default;
160
+ return {
161
+ bg: opts.bg_color || base.bg,
162
+ title: opts.title_color || base.title,
163
+ text: opts.text_color || base.text,
164
+ icon: opts.icon_color || base.icon,
165
+ border: opts.border_color || base.border
166
+ };
167
+ }
168
+ // src/utils/format.ts
169
+ function kFormat(num) {
170
+ const sign = num < 0 ? "-" : "";
171
+ const abs = Math.abs(num);
172
+ const trim = (v) => v.toFixed(1).replace(/\.0$/, "");
173
+ if (abs >= 999950000)
174
+ return sign + trim(abs / 1e9) + "B";
175
+ if (abs >= 999950)
176
+ return sign + trim(abs / 1e6) + "M";
177
+ if (abs >= 999.95)
178
+ return sign + trim(abs / 1000) + "k";
179
+ return sign + String(Math.round(abs));
180
+ }
181
+ function measureText(text, size, weight = 400) {
182
+ if (!text)
183
+ return 0;
184
+ const factor = size / 16;
185
+ const weightFactor = weight >= 700 ? 1.08 : weight >= 600 ? 1.04 : 1;
186
+ let width = 0;
187
+ for (const ch of text) {
188
+ const code = ch.codePointAt(0);
189
+ let w;
190
+ if (ch === " ")
191
+ w = 0.28;
192
+ else if (ch === "." || ch === "," || ch === ":" || ch === ";")
193
+ w = 0.3;
194
+ else if (ch === "i" || ch === "l" || ch === "I" || ch === "t" || ch === "j" || ch === "|")
195
+ w = 0.3;
196
+ else if (ch === "m" || ch === "w" || ch === "W" || ch === "M" || ch === "@")
197
+ w = 0.95;
198
+ else if (code >= 4352 && code <= 4607)
199
+ w = 1;
200
+ else if (code >= 19968 && code <= 40959)
201
+ w = 1;
202
+ else if (code >= 12352 && code <= 12543)
203
+ w = 1;
204
+ else if (code >= 44032 && code <= 55215)
205
+ w = 1;
206
+ else if (code > 127)
207
+ w = 0.72;
208
+ else
209
+ w = 0.58;
210
+ width += w;
211
+ }
212
+ return width * factor * weightFactor;
213
+ }
214
+ function escapeXml(str) {
215
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
216
+ }
217
+ function wrapText(input, maxLen, maxLines) {
218
+ const words = input.split(/\s+/).filter(Boolean);
219
+ const lines = [];
220
+ let current = "";
221
+ for (const word of words) {
222
+ const next = current ? `${current} ${word}` : word;
223
+ if (next.length <= maxLen) {
224
+ current = next;
225
+ continue;
226
+ }
227
+ if (current)
228
+ lines.push(current);
229
+ if (lines.length === maxLines)
230
+ break;
231
+ current = word.length > maxLen ? word.slice(0, maxLen) : word;
232
+ }
233
+ if (current && lines.length < maxLines)
234
+ lines.push(current);
235
+ const consumed = lines.join(" ").length;
236
+ if (lines.length > 0 && consumed < input.trim().length) {
237
+ const last = lines[lines.length - 1];
238
+ lines[lines.length - 1] = (last.length >= maxLen ? last.slice(0, Math.max(0, maxLen - 1)) : last) + "…";
239
+ }
240
+ return lines;
241
+ }
242
+ // src/utils/languages.ts
243
+ var langColors = {
244
+ "1C Enterprise": "#814CCC",
245
+ "2-Dimensional Array": "#38761D",
246
+ "4D": "#004289",
247
+ ABAP: "#E8274B",
248
+ "ABAP CDS": "#555e25",
249
+ "AGS Script": "#B9D9FF",
250
+ AIDL: "#34EB6B",
251
+ AL: "#3AA2B5",
252
+ AMPL: "#E6EFBB",
253
+ ANTLR: "#9DC3FF",
254
+ "API Blueprint": "#2ACCA8",
255
+ APL: "#5A8164",
256
+ "ASP.NET": "#9400ff",
257
+ ATS: "#1ac620",
258
+ ActionScript: "#882B0F",
259
+ Ada: "#02f88c",
260
+ "Adblock Filter List": "#800000",
261
+ "Adobe Font Metrics": "#fa0f00",
262
+ Agda: "#315665",
263
+ Aiken: "#640ff8",
264
+ Alloy: "#64C800",
265
+ "Alpine Abuild": "#0D597F",
266
+ "Altium Designer": "#A89663",
267
+ AngelScript: "#C7D7DC",
268
+ "Answer Set Programming": "#A9CC29",
269
+ "Ant Build System": "#A9157E",
270
+ Antlers: "#ff269e",
271
+ ApacheConf: "#d12127",
272
+ Apex: "#1797c0",
273
+ "Apollo Guidance Computer": "#0B3D91",
274
+ AppleScript: "#101F1F",
275
+ Arc: "#aa2afe",
276
+ ArkTS: "#0080ff",
277
+ AsciiDoc: "#73a0c5",
278
+ AspectJ: "#a957b0",
279
+ Assembly: "#6E4C13",
280
+ Astro: "#ff5a03",
281
+ Asymptote: "#ff0000",
282
+ Augeas: "#9CC134",
283
+ AutoHotkey: "#6594b9",
284
+ AutoIt: "#1C3552",
285
+ "Avro IDL": "#0040FF",
286
+ Awk: "#c30e9b",
287
+ B4X: "#00e4ff",
288
+ BASIC: "#ff0000",
289
+ BQN: "#2b7067",
290
+ Ballerina: "#FF5000",
291
+ Batchfile: "#C1F12E",
292
+ Beef: "#a52f4e",
293
+ Berry: "#15A13C",
294
+ BibTeX: "#778899",
295
+ Bicep: "#519aba",
296
+ Bikeshed: "#5562ac",
297
+ Bison: "#6A463F",
298
+ BitBake: "#00bce4",
299
+ Blade: "#f7523f",
300
+ BlitzBasic: "#00FFAE",
301
+ BlitzMax: "#cd6400",
302
+ Bluespec: "#12223c",
303
+ "Bluespec BH": "#12223c",
304
+ Boo: "#d4bec1",
305
+ Boogie: "#c80fa0",
306
+ Brainfuck: "#2F2530",
307
+ BrighterScript: "#66AABB",
308
+ Brightscript: "#662D91",
309
+ Browserslist: "#ffd539",
310
+ Bru: "#F4AA41",
311
+ BuildStream: "#006bff",
312
+ C: "#555555",
313
+ "C#": "#178600",
314
+ "C++": "#f34b7d",
315
+ C3: "#2563eb",
316
+ "CAP CDS": "#0092d1",
317
+ CLIPS: "#00A300",
318
+ CMake: "#DA3434",
319
+ COLLADA: "#F1A42B",
320
+ CSON: "#244776",
321
+ CSS: "#663399",
322
+ CSV: "#237346",
323
+ CUE: "#5886E1",
324
+ CWeb: "#00007a",
325
+ "Cabal Config": "#483465",
326
+ Caddyfile: "#22b638",
327
+ Cadence: "#00ef8b",
328
+ Cairo: "#ff4a48",
329
+ "Cairo Zero": "#ff4a48",
330
+ CameLIGO: "#3be133",
331
+ Cangjie: "#00868B",
332
+ "Cap'n Proto": "#c42727",
333
+ Carbon: "#222222",
334
+ Ceylon: "#dfa535",
335
+ Chapel: "#8dc63f",
336
+ ChucK: "#3f8000",
337
+ Circom: "#707575",
338
+ Cirru: "#ccccff",
339
+ Clarion: "#db901e",
340
+ Clarity: "#5546ff",
341
+ "Classic ASP": "#6a40fd",
342
+ Clean: "#3F85AF",
343
+ Click: "#E4E6F3",
344
+ Clojure: "#db5855",
345
+ "Closure Templates": "#0d948f",
346
+ "Cloud Firestore Security Rules": "#FFA000",
347
+ Clue: "#0009b5",
348
+ CodeQL: "#140f46",
349
+ CoffeeScript: "#244776",
350
+ ColdFusion: "#ed2cd6",
351
+ "ColdFusion CFC": "#ed2cd6",
352
+ "Common Lisp": "#3fb68b",
353
+ "Common Workflow Language": "#B5314C",
354
+ "Component Pascal": "#B0CE4E",
355
+ Cooklang: "#E15A29",
356
+ Crystal: "#000100",
357
+ Csound: "#1a1a1a",
358
+ "Csound Document": "#1a1a1a",
359
+ "Csound Score": "#1a1a1a",
360
+ Cuda: "#3A4E3A",
361
+ Curry: "#531242",
362
+ Cylc: "#00b3fd",
363
+ Cypher: "#34c0eb",
364
+ Cython: "#fedf5b",
365
+ D: "#ba595e",
366
+ D2: "#526ee8",
367
+ DM: "#447265",
368
+ Dafny: "#FFEC25",
369
+ "Darcs Patch": "#8eff23",
370
+ Dart: "#00B4AB",
371
+ Daslang: "#d3d3d3",
372
+ DataWeave: "#003a52",
373
+ "Debian Package Control File": "#D70751",
374
+ DenizenScript: "#FBEE96",
375
+ Dhall: "#dfafff",
376
+ "DirectX 3D File": "#aace60",
377
+ Dockerfile: "#384d54",
378
+ Dogescript: "#cca760",
379
+ Dotenv: "#e5d559",
380
+ Dune: "#89421e",
381
+ Dylan: "#6c616e",
382
+ E: "#ccce35",
383
+ ECL: "#8a1267",
384
+ ECLiPSe: "#001d9d",
385
+ EJS: "#a91e50",
386
+ EQ: "#a78649",
387
+ Earthly: "#2af0ff",
388
+ Easybuild: "#069406",
389
+ "Ecere Projects": "#913960",
390
+ Ecmarkup: "#eb8131",
391
+ Edge: "#0dffe0",
392
+ EdgeQL: "#31A7FF",
393
+ EditorConfig: "#fff1f2",
394
+ Eiffel: "#4d6977",
395
+ Elixir: "#6e4a7e",
396
+ Elm: "#60B5CC",
397
+ Elvish: "#55BB55",
398
+ "Elvish Transcript": "#55BB55",
399
+ "Emacs Lisp": "#c065db",
400
+ EmberScript: "#FFF4F3",
401
+ Erlang: "#B83998",
402
+ Euphoria: "#FF790B",
403
+ "F#": "#b845fc",
404
+ "F*": "#572e30",
405
+ "FIGlet Font": "#FFDDBB",
406
+ FIRRTL: "#2f632f",
407
+ FLUX: "#88ccff",
408
+ Factor: "#636746",
409
+ Fancy: "#7b9db4",
410
+ Fantom: "#14253c",
411
+ Faust: "#c37240",
412
+ Fennel: "#fff3d7",
413
+ "Filebench WML": "#F6B900",
414
+ Flix: "#d44a45",
415
+ Fluent: "#ffcc33",
416
+ Forth: "#341708",
417
+ Fortran: "#4d41b1",
418
+ "Fortran Free Form": "#4d41b1",
419
+ FreeBASIC: "#141AC9",
420
+ FreeMarker: "#0050b2",
421
+ Frege: "#00cafe",
422
+ Futhark: "#5f021f",
423
+ "G-code": "#D08CF2",
424
+ GAML: "#FFC766",
425
+ GAMS: "#f49a22",
426
+ GAP: "#0000cc",
427
+ "GCC Machine Description": "#FFCFAB",
428
+ GDScript: "#355570",
429
+ GDShader: "#478CBF",
430
+ GEDCOM: "#003058",
431
+ GLSL: "#5686a5",
432
+ GSC: "#FF6800",
433
+ "Game Maker Language": "#71b417",
434
+ "Gemfile.lock": "#701516",
435
+ Gemini: "#ff6900",
436
+ "Genero 4gl": "#63408e",
437
+ "Genero per": "#d8df39",
438
+ Genie: "#fb855d",
439
+ Genshi: "#951531",
440
+ "Gentoo Ebuild": "#9400ff",
441
+ "Gentoo Eclass": "#9400ff",
442
+ "Gerber Image": "#d20b00",
443
+ Gherkin: "#5B2063",
444
+ "Git Attributes": "#F44D27",
445
+ "Git Commit": "#F44D27",
446
+ "Git Config": "#F44D27",
447
+ "Git Revision List": "#F44D27",
448
+ Gleam: "#ffaff3",
449
+ "Glimmer JS": "#F5835F",
450
+ "Glimmer TS": "#3178c6",
451
+ Glyph: "#c1ac7f",
452
+ Gnuplot: "#f0a9f0",
453
+ Go: "#00ADD8",
454
+ "Go Checksums": "#00ADD8",
455
+ "Go Module": "#00ADD8",
456
+ "Go Workspace": "#00ADD8",
457
+ "Godot Resource": "#355570",
458
+ Golo: "#88562A",
459
+ Gosu: "#82937f",
460
+ Grace: "#615f8b",
461
+ Gradle: "#02303a",
462
+ "Gradle Kotlin DSL": "#02303a",
463
+ "Grammatical Framework": "#ff0000",
464
+ GraphQL: "#e10098",
465
+ "Graphviz (DOT)": "#2596be",
466
+ Groovy: "#4298b8",
467
+ "Groovy Server Pages": "#4298b8",
468
+ HAProxy: "#106da9",
469
+ HCL: "#844FBA",
470
+ HIP: "#4F3A4F",
471
+ HLSL: "#aace60",
472
+ HOCON: "#9ff8ee",
473
+ HTML: "#e34c26",
474
+ "HTML+ECR": "#2e1052",
475
+ "HTML+EEX": "#6e4a7e",
476
+ "HTML+ERB": "#701516",
477
+ "HTML+PHP": "#4f5d95",
478
+ "HTML+Razor": "#512be4",
479
+ HTTP: "#005C9C",
480
+ HXML: "#f68712",
481
+ Hack: "#878787",
482
+ Haml: "#ece2a9",
483
+ Handlebars: "#f7931e",
484
+ Harbour: "#0e60e3",
485
+ Hare: "#9d7424",
486
+ Haskell: "#5e5086",
487
+ Haxe: "#df7900",
488
+ HiveQL: "#dce200",
489
+ HolyC: "#ffefaf",
490
+ "Hosts File": "#308888",
491
+ Hurl: "#FF0288",
492
+ Hy: "#7790B2",
493
+ IDL: "#a3522f",
494
+ "IGOR Pro": "#0000cc",
495
+ INI: "#d1dbe0",
496
+ ISPC: "#2D68B1",
497
+ Idris: "#b30000",
498
+ "Ignore List": "#000000",
499
+ "ImageJ Macro": "#99AAFF",
500
+ Imba: "#16cec6",
501
+ "Inno Setup": "#264b99",
502
+ Io: "#a9188d",
503
+ Ioke: "#078193",
504
+ Isabelle: "#FEFE00",
505
+ "Isabelle ROOT": "#FEFE00",
506
+ J: "#9EEDFF",
507
+ "JAR Manifest": "#b07219",
508
+ JCL: "#d90e09",
509
+ JFlex: "#DBCA00",
510
+ JSON: "#292929",
511
+ "JSON with Comments": "#292929",
512
+ JSON5: "#267CB9",
513
+ JSONLD: "#0c479c",
514
+ JSONiq: "#40d47e",
515
+ Jai: "#ab8b4b",
516
+ Janet: "#0886a5",
517
+ Jasmin: "#d03600",
518
+ Java: "#b07219",
519
+ "Java Properties": "#2A6277",
520
+ "Java Server Pages": "#2A6277",
521
+ "Java Template Engine": "#2A6277",
522
+ JavaScript: "#f1e05a",
523
+ "JavaScript+ERB": "#f1e05a",
524
+ "Jest Snapshot": "#15c213",
525
+ "JetBrains MPS": "#21D789",
526
+ Jinja: "#a52a22",
527
+ Jison: "#56b3cb",
528
+ "Jison Lex": "#56b3cb",
529
+ Jolie: "#843179",
530
+ Jsonnet: "#0064bd",
531
+ Julia: "#a270ba",
532
+ "Julia REPL": "#a270ba",
533
+ "Jupyter Notebook": "#DA5B0B",
534
+ Just: "#384d54",
535
+ KDL: "#ffb3b3",
536
+ KRL: "#28430A",
537
+ "Kaitai Struct": "#773b37",
538
+ KakouneScript: "#6f8042",
539
+ KerboScript: "#41adf0",
540
+ "KiCad Layout": "#2f4aab",
541
+ "KiCad Legacy Layout": "#2f4aab",
542
+ "KiCad Schematic": "#2f4aab",
543
+ "KoLmafia ASH": "#B9D9B9",
544
+ Koka: "#215166",
545
+ Kotlin: "#A97BFF",
546
+ LFE: "#4C3023",
547
+ LLVM: "#185619",
548
+ LOLCODE: "#cc9900",
549
+ LSL: "#3d9970",
550
+ LabVIEW: "#fede06",
551
+ Lark: "#2980B9",
552
+ Lasso: "#999999",
553
+ Latte: "#f2a542",
554
+ Leo: "#C4FFC2",
555
+ Less: "#1d365d",
556
+ Lex: "#DBCA00",
557
+ LigoLANG: "#0e74ff",
558
+ LilyPond: "#9ccc7c",
559
+ Liquid: "#67b8de",
560
+ "Literate Agda": "#315665",
561
+ "Literate CoffeeScript": "#244776",
562
+ "Literate Haskell": "#5e5086",
563
+ "LiveCode Script": "#0c5ba5",
564
+ LiveScript: "#499886",
565
+ Logtalk: "#295b9a",
566
+ LookML: "#652B81",
567
+ Lua: "#000080",
568
+ Luau: "#00A2FF",
569
+ M3U: "#179C7D",
570
+ MATLAB: "#e16737",
571
+ MAXScript: "#00a6a6",
572
+ MDX: "#fcb32c",
573
+ MLIR: "#5EC8DB",
574
+ MQL4: "#62A8D6",
575
+ MQL5: "#4A76B8",
576
+ MTML: "#b7e1f4",
577
+ Macaulay2: "#d8ffff",
578
+ Makefile: "#427819",
579
+ Mako: "#7e858d",
580
+ Markdown: "#083fa1",
581
+ Marko: "#42bff2",
582
+ Mask: "#f97732",
583
+ Max: "#c4a79c",
584
+ Mercury: "#ff2b2b",
585
+ Mermaid: "#ff3670",
586
+ Meson: "#007800",
587
+ Metal: "#8f14e9",
588
+ MiniYAML: "#ff1111",
589
+ MiniZinc: "#06a9e6",
590
+ Mint: "#02b046",
591
+ Mirah: "#c7a938",
592
+ Modelica: "#de1d31",
593
+ "Modula-2": "#10253f",
594
+ "Modula-3": "#223388",
595
+ Mojo: "#ff4c1f",
596
+ "Monkey C": "#8D6747",
597
+ MoonBit: "#b92381",
598
+ MoonScript: "#ff4585",
599
+ Motoko: "#fbb03b",
600
+ "Motorola 68K Assembly": "#005daa",
601
+ Move: "#4a137a",
602
+ Mustache: "#724b3b",
603
+ NCL: "#28431f",
604
+ NMODL: "#00356B",
605
+ "NPM Config": "#cb3837",
606
+ NWScript: "#111522",
607
+ Nasal: "#1d2c4e",
608
+ Nearley: "#990000",
609
+ Nemerle: "#3d3c6e",
610
+ NetLinx: "#0aa0ff",
611
+ "NetLinx+ERB": "#747faa",
612
+ NetLogo: "#ff6375",
613
+ NewLisp: "#87AED7",
614
+ Nextflow: "#3ac486",
615
+ Nginx: "#009639",
616
+ Nickel: "#E0C3FC",
617
+ Nim: "#ffc200",
618
+ Nit: "#009917",
619
+ Nix: "#7e7eff",
620
+ Noir: "#2f1f49",
621
+ Nu: "#c9df40",
622
+ NumPy: "#9C8AF9",
623
+ Nunjucks: "#3d8137",
624
+ Nushell: "#4E9906",
625
+ "OASv2-json": "#85ea2d",
626
+ "OASv2-yaml": "#85ea2d",
627
+ "OASv3-json": "#85ea2d",
628
+ "OASv3-yaml": "#85ea2d",
629
+ OCaml: "#ef7a08",
630
+ "OMNeT++ MSG": "#a0e0a0",
631
+ "OMNeT++ NED": "#08607c",
632
+ ObjectScript: "#424893",
633
+ "Objective-C": "#438eff",
634
+ "Objective-C++": "#6866fb",
635
+ "Objective-J": "#ff0c5a",
636
+ Odin: "#60AFFE",
637
+ Omgrofl: "#cabbff",
638
+ Opal: "#f7ede0",
639
+ "Open Policy Agent": "#7d9199",
640
+ "OpenAPI Specification v2": "#85ea2d",
641
+ "OpenAPI Specification v3": "#85ea2d",
642
+ OpenCL: "#ed2e2d",
643
+ "OpenEdge ABL": "#5ce600",
644
+ OpenQASM: "#AA70FF",
645
+ OpenSCAD: "#e5cd45",
646
+ "Option List": "#476732",
647
+ Org: "#77aa99",
648
+ OverpassQL: "#cce2aa",
649
+ Oxygene: "#cdd0e3",
650
+ Oz: "#fab738",
651
+ P4: "#7055b5",
652
+ PDDL: "#0d00ff",
653
+ "PEG.js": "#234d6b",
654
+ PHP: "#4F5D95",
655
+ PLSQL: "#dad8d8",
656
+ PLpgSQL: "#336790",
657
+ "POV-Ray SDL": "#6bac65",
658
+ Pact: "#F7A8B8",
659
+ Pan: "#cc0000",
660
+ Papyrus: "#6600cc",
661
+ Parrot: "#f3ca0a",
662
+ Pascal: "#E3F171",
663
+ Pawn: "#dbb284",
664
+ Pep8: "#C76F5B",
665
+ Perl: "#0298c3",
666
+ PicoLisp: "#6067af",
667
+ PigLatin: "#fcd7de",
668
+ Pike: "#005390",
669
+ "Pip Requirements": "#FFD343",
670
+ Pkl: "#6b9543",
671
+ PlantUML: "#fbbd16",
672
+ PogoScript: "#d80074",
673
+ Polar: "#ae81ff",
674
+ Portugol: "#f8bd00",
675
+ PostCSS: "#dc3a0c",
676
+ PostScript: "#da291c",
677
+ PowerBuilder: "#8f0f8d",
678
+ PowerShell: "#012456",
679
+ Praat: "#c8506d",
680
+ Prisma: "#0c344b",
681
+ Processing: "#0096D8",
682
+ Procfile: "#3B2F63",
683
+ Prolog: "#74283c",
684
+ Promela: "#de0000",
685
+ "Propeller Spin": "#7fa2a7",
686
+ Pug: "#a86454",
687
+ Puppet: "#302B6D",
688
+ PureBasic: "#5a6986",
689
+ PureScript: "#1D222D",
690
+ Pyret: "#ee1e10",
691
+ Python: "#3572A5",
692
+ "Python console": "#3572A5",
693
+ "Python traceback": "#3572A5",
694
+ "Q#": "#fed659",
695
+ QML: "#44a51c",
696
+ "Qt Script": "#00b841",
697
+ Quake: "#882233",
698
+ QuakeC: "#975777",
699
+ QuickBASIC: "#008080",
700
+ R: "#198CE7",
701
+ RAML: "#77d9fb",
702
+ RBS: "#701516",
703
+ RDoc: "#701516",
704
+ REXX: "#d90e09",
705
+ RMarkdown: "#198ce7",
706
+ RON: "#a62c00",
707
+ "ROS Interface": "#22314e",
708
+ RPGLE: "#2BDE21",
709
+ RUNOFF: "#665a4e",
710
+ Racket: "#3c5caa",
711
+ Ragel: "#9d5200",
712
+ Raku: "#0000fb",
713
+ Rascal: "#fffaa0",
714
+ ReScript: "#ed5051",
715
+ Reason: "#ff5847",
716
+ ReasonLIGO: "#ff5847",
717
+ Rebol: "#358a5b",
718
+ "Record Jar": "#0673ba",
719
+ Red: "#f50000",
720
+ "Regular Expression": "#009a00",
721
+ "Ren'Py": "#ff7f7f",
722
+ Rez: "#FFDAB3",
723
+ Ring: "#2D54CB",
724
+ Riot: "#A71E49",
725
+ RobotFramework: "#00c0b5",
726
+ Roc: "#7c38f5",
727
+ "Rocq Prover": "#d0b68c",
728
+ Roff: "#ecdebe",
729
+ "Roff Manpage": "#ecdebe",
730
+ Rouge: "#cc0088",
731
+ "RouterOS Script": "#DE3941",
732
+ Ruby: "#701516",
733
+ Rust: "#dea584",
734
+ SAS: "#B34936",
735
+ SCSS: "#c6538c",
736
+ SPARQL: "#0C4597",
737
+ SQF: "#3F3F3F",
738
+ SQL: "#e38c00",
739
+ SQLPL: "#e38c00",
740
+ "SRecode Template": "#348a34",
741
+ STL: "#373b5e",
742
+ SVG: "#ff9900",
743
+ Sail: "#259dd5",
744
+ SaltStack: "#646464",
745
+ Sass: "#a53b70",
746
+ Scala: "#c22d40",
747
+ Scaml: "#bd181a",
748
+ Scenic: "#fdc700",
749
+ Scheme: "#1e4aec",
750
+ Scilab: "#ca0f21",
751
+ Self: "#0579aa",
752
+ ShaderLab: "#222c37",
753
+ Shell: "#89e051",
754
+ "ShellCheck Config": "#cecfcb",
755
+ Shen: "#120F14",
756
+ "Simple File Verification": "#C9BFED",
757
+ Singularity: "#64E6AD",
758
+ Slang: "#1fbec9",
759
+ Slash: "#007eff",
760
+ Slice: "#003fa2",
761
+ Slim: "#2b2b2b",
762
+ Slint: "#2379F4",
763
+ SmPL: "#c94949",
764
+ Smalltalk: "#596706",
765
+ Smarty: "#f0c040",
766
+ Smithy: "#c44536",
767
+ Snakemake: "#419179",
768
+ Solidity: "#AA6746",
769
+ SourcePawn: "#f69e1d",
770
+ Squirrel: "#800000",
771
+ Stan: "#b2011d",
772
+ "Standard ML": "#dc566d",
773
+ Starlark: "#76d275",
774
+ Stata: "#1a5f91",
775
+ StringTemplate: "#3fb34f",
776
+ Stylus: "#ff6347",
777
+ "SubRip Text": "#9e0101",
778
+ SugarSS: "#2fcc9f",
779
+ SuperCollider: "#46390b",
780
+ "Survex data": "#ffcc99",
781
+ Svelte: "#ff3e00",
782
+ Sway: "#00F58C",
783
+ Sweave: "#198ce7",
784
+ Swift: "#F05138",
785
+ SystemVerilog: "#DAE1C2",
786
+ "TI Program": "#A0AA87",
787
+ "TL-Verilog": "#C40023",
788
+ TLA: "#4b0079",
789
+ TOML: "#9c4221",
790
+ TSQL: "#e38c00",
791
+ TSV: "#237346",
792
+ TSX: "#3178c6",
793
+ TXL: "#0178b8",
794
+ Tact: "#48b5ff",
795
+ Talon: "#333333",
796
+ Tcl: "#e4cc98",
797
+ TeX: "#3D6117",
798
+ Teal: "#00B1BC",
799
+ Terra: "#00004c",
800
+ "Terraform Template": "#7b42bb",
801
+ TextGrid: "#c8506d",
802
+ "TextMate Properties": "#df66e4",
803
+ Textile: "#ffe7ac",
804
+ Thrift: "#D12127",
805
+ Toit: "#c2c9fb",
806
+ "Tor Config": "#59316b",
807
+ "Tree-sitter Query": "#8ea64c",
808
+ Turing: "#cf142b",
809
+ Twig: "#c1d026",
810
+ TypeScript: "#3178c6",
811
+ TypeSpec: "#4A3665",
812
+ Typst: "#239dad",
813
+ "Unified Parallel C": "#4e3617",
814
+ "Unity3D Asset": "#222c37",
815
+ Uno: "#9933cc",
816
+ UnrealScript: "#a54c4d",
817
+ "Untyped Plutus Core": "#36adbd",
818
+ UrWeb: "#ccccee",
819
+ V: "#4f87c4",
820
+ VBA: "#867db1",
821
+ VBScript: "#15dcdc",
822
+ VCL: "#148AA8",
823
+ VHDL: "#adb2cb",
824
+ Vala: "#a56de2",
825
+ "Valve Data Format": "#f26025",
826
+ "Velocity Template Language": "#507cff",
827
+ Vento: "#ff0080",
828
+ Verilog: "#b2b7f8",
829
+ "Vim Help File": "#199f4b",
830
+ "Vim Script": "#199f4b",
831
+ "Vim Snippet": "#199f4b",
832
+ "Visual Basic .NET": "#945db7",
833
+ "Visual Basic 6.0": "#2c6353",
834
+ Volt: "#1F1F1F",
835
+ Vue: "#41b883",
836
+ Vyper: "#9F4CF2",
837
+ WDL: "#42f1f4",
838
+ WGSL: "#1a5e9a",
839
+ "Web Ontology Language": "#5b70bd",
840
+ WebAssembly: "#04133b",
841
+ "WebAssembly Interface Type": "#6250e7",
842
+ Whiley: "#d5c397",
843
+ Wikitext: "#fc5757",
844
+ "Windows Registry Entries": "#52d5ff",
845
+ "Witcher Script": "#ff0000",
846
+ "Wolfram Language": "#dd1100",
847
+ Wollok: "#a23738",
848
+ "World of Warcraft Addon Data": "#f7e43f",
849
+ Wren: "#383838",
850
+ X10: "#4B6BEF",
851
+ XC: "#99DA07",
852
+ XML: "#0060ac",
853
+ "XML Property List": "#0060ac",
854
+ XQuery: "#5232e7",
855
+ XSLT: "#EB8CEB",
856
+ Xmake: "#22a079",
857
+ Xojo: "#81bd41",
858
+ Xonsh: "#285EEF",
859
+ Xtend: "#24255d",
860
+ YAML: "#cb171e",
861
+ YARA: "#220000",
862
+ YASnippet: "#32AB90",
863
+ Yacc: "#4B6C4B",
864
+ Yul: "#794932",
865
+ ZAP: "#0d665e",
866
+ ZIL: "#dc75e5",
867
+ ZenScript: "#00BCD1",
868
+ Zephir: "#118f9e",
869
+ Zig: "#ec915c",
870
+ Zimpl: "#d67711",
871
+ Zmodel: "#ff7100",
872
+ crontab: "#ead7ac",
873
+ eC: "#913960",
874
+ fish: "#4aae47",
875
+ hoon: "#00b171",
876
+ iCalendar: "#ec564c",
877
+ jq: "#c7254e",
878
+ kvlang: "#1da6e0",
879
+ "mIRC Script": "#3d57c3",
880
+ mcfunction: "#E22837",
881
+ mdsvex: "#5f9ea0",
882
+ mupad: "#244963",
883
+ nanorc: "#2d004d",
884
+ nesC: "#94B0C7",
885
+ ooc: "#b0b77e",
886
+ q: "#0040cd",
887
+ reStructuredText: "#141414",
888
+ sed: "#64b970",
889
+ templ: "#66D0DD",
890
+ vCard: "#ee2647",
891
+ wisp: "#7582D1",
892
+ xBase: "#403a40",
893
+ default: "#ccc"
894
+ };
895
+ function getLangColor(lang) {
896
+ return langColors[lang] || langColors.default;
897
+ }
898
+ // src/utils/icons.ts
899
+ var icons = {
900
+ star: `<path d="M10.92 2.868a1.25 1.25 0 0 1 2.16 0l2.795 4.798l5.428 1.176a1.25 1.25 0 0 1 .667 2.054l-3.7 4.141l.56 5.525a1.25 1.25 0 0 1-1.748 1.27L12 19.592l-5.082 2.24a1.25 1.25 0 0 1-1.748-1.27l.56-5.525l-3.7-4.14a1.25 1.25 0 0 1 .667-2.055l5.428-1.176z"/>`,
901
+ commit: `<path fill-rule="evenodd" d="M10.5 7.75a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm1.43.75a4.002 4.002 0 01-7.86 0H.75a.75.75 0 110-1.5h3.32a4.001 4.001 0 017.86 0h3.32a.75.75 0 110 1.5h-3.32z"/>`,
902
+ pr: `<path d="M4 18a2 2 0 1 0 4 0a2 2 0 1 0-4 0M4 6a2 2 0 1 0 4 0a2 2 0 1 0-4 0m12 12a2 2 0 1 0 4 0a2 2 0 1 0-4 0M6 8v8"/><path d="M11 6h5a2 2 0 0 1 2 2v8"/><path d="m14 9l-3-3l3-3"/>`,
903
+ issue: `<path d="M15.314 2a2 2 0 0 1 1.414.586l4.686 4.686A2 2 0 0 1 22 8.686v6.628a2 2 0 0 1-.586 1.414l-4.686 4.686a2 2 0 0 1-1.414.586H8.686a2 2 0 0 1-1.414-.586l-4.686-4.686A2 2 0 0 1 2 15.314V8.686a2 2 0 0 1 .586-1.414l4.686-4.686A2 2 0 0 1 8.686 2zm0 2H8.686L4 8.686v6.628L8.686 20h6.628L20 15.314V8.686zM12 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2m0-9a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V7a1 1 0 0 1 1-1"/>`,
904
+ repo: `<path d="M6 19.623c-.69-.195-1.232-.491-1.682-.941C3 17.364 3 15.242 3 11s0-6.364 1.318-7.682S7.758 2 12 2s6.364 0 7.682 1.318S21 6.758 21 11s0 6.364-1.318 7.682c-.45.45-.993.746-1.682.941"/><path d="M12 20.193c-.414 0-.748.32-1.414.958c-.647.619-.97.929-1.242.831a.5.5 0 0 1-.096-.046C9 21.779 9 21.31 9 20.376v-3.125c0-1.532 0-2.299.44-2.775C9.878 14 10.585 14 12 14s2.121 0 2.56.476s.44 1.243.44 2.775v3.125c0 .935 0 1.403-.248 1.56a.5.5 0 0 1-.096.046c-.272.098-.595-.212-1.242-.831c-.666-.639-1-.958-1.414-.958M8 10h8M8 6h4"/>`,
905
+ x: `<path d="M4 4l11.733 16h4.267l-11.733 -16l-4.267 0" /><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" />`
906
+ };
907
+ var iconMeta = {
908
+ star: { viewBox: "0 0 24 24", kind: "fill" },
909
+ commit: { viewBox: "0 0 16 16", kind: "fill" },
910
+ pr: { viewBox: "0 0 24 24", kind: "stroke", strokeWidth: "2" },
911
+ issue: { viewBox: "0 0 24 24", kind: "fill" },
912
+ repo: { viewBox: "0 0 24 24", kind: "stroke", strokeWidth: "1.5" },
913
+ x: { viewBox: "0 0 24 24", kind: "stroke", strokeWidth: "2" }
914
+ };
915
+ function icon(name, color, size = 16) {
916
+ const path = icons[name];
917
+ if (!path)
918
+ return "";
919
+ const meta = iconMeta[name];
920
+ const viewBox = meta?.viewBox ?? "0 0 16 16";
921
+ const colorStr = color.startsWith("#") ? color : `#${color}`;
922
+ const attrs = meta?.kind === "stroke" ? `fill="none" stroke="${colorStr}" stroke-width="${meta.strokeWidth ?? "1.8"}" stroke-linecap="round" stroke-linejoin="round"` : `fill="${colorStr}"`;
923
+ return `<svg width="${size}" height="${size}" viewBox="${viewBox}" ${attrs} role="img">${path}</svg>`;
924
+ }
925
+ // src/utils/font.ts
926
+ var FONT_FAMILY = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
927
+ var FONT_FACE = "";
928
+ // src/utils/colors.ts
929
+ var twColors = {
930
+ transparent: "transparent",
931
+ current: "currentColor",
932
+ white: "#ffffff",
933
+ black: "#000000",
934
+ "slate-50": "#f8fafc",
935
+ "slate-100": "#f1f5f9",
936
+ "slate-200": "#e2e8f0",
937
+ "slate-300": "#cbd5e1",
938
+ "slate-400": "#94a3b8",
939
+ "slate-500": "#64748b",
940
+ "slate-600": "#475569",
941
+ "slate-700": "#334155",
942
+ "slate-800": "#1e293b",
943
+ "slate-900": "#0f172a",
944
+ "slate-950": "#020617",
945
+ "neutral-800": "#262626",
946
+ "neutral-950": "#0a0a0a",
947
+ "zinc-100": "#f4f4f5",
948
+ "zinc-400": "#a1a1aa",
949
+ "zinc-800": "#27272a",
950
+ "zinc-900": "#18181b",
951
+ "stone-300": "#d6d3d1",
952
+ "stone-700": "#44403c",
953
+ "stone-800": "#292524",
954
+ "rose-200": "#fecdd3",
955
+ "rose-300": "#fda4af",
956
+ "rose-400": "#fb7185",
957
+ "rose-900": "#881337",
958
+ "rose-950": "#4c0519",
959
+ "pink-400": "#f472b6",
960
+ "pink-500": "#ec4899",
961
+ "fuchsia-400": "#e879f9",
962
+ "purple-400": "#c084fc",
963
+ "purple-900": "#581c87",
964
+ "purple-950": "#3b0764",
965
+ "indigo-300": "#a5b4fc",
966
+ "indigo-400": "#818cf8",
967
+ "indigo-500": "#6366f1",
968
+ "indigo-900": "#312e81",
969
+ "violet-300": "#c4b5fd",
970
+ "violet-400": "#a78bfa",
971
+ "blue-300": "#93c5fd",
972
+ "blue-400": "#60a5fa",
973
+ "blue-500": "#3b82f6",
974
+ "blue-600": "#2563eb",
975
+ "sky-400": "#38bdf8",
976
+ "sky-900": "#0c4a6e",
977
+ "sky-950": "#082f49",
978
+ "cyan-300": "#67e8f9",
979
+ "cyan-400": "#22d3ee",
980
+ "teal-400": "#2dd4bf",
981
+ "emerald-200": "#a7f3d0",
982
+ "emerald-300": "#6ee7b7",
983
+ "emerald-400": "#34d399",
984
+ "emerald-500": "#10b981",
985
+ "emerald-900": "#064e3b",
986
+ "emerald-950": "#022c22",
987
+ "green-400": "#4ade80",
988
+ "lime-300": "#bef264",
989
+ "lime-400": "#a3e635",
990
+ "yellow-300": "#fde047",
991
+ "yellow-400": "#facc15",
992
+ "amber-300": "#fcd34d",
993
+ "amber-400": "#fbbf24",
994
+ "amber-600": "#d97706",
995
+ "amber-700": "#b45309",
996
+ "amber-900": "#78350f",
997
+ "orange-50": "#fff7ed",
998
+ "orange-200": "#fed7aa",
999
+ "orange-400": "#fb923c",
1000
+ "orange-500": "#f97316"
1001
+ };
1002
+ function resolveTw(token, property) {
1003
+ const value = token.trim();
1004
+ const hex = value.startsWith("#") ? value.slice(1) : value;
1005
+ if (/^(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{4}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(hex)) {
1006
+ return `${property}="#${hex}"`;
1007
+ }
1008
+ const colorName = value.replace(/^fill-/, "").replace(/^stroke-/, "");
1009
+ return `${property}="${twColors[colorName] ?? value}"`;
1010
+ }
1011
+ // src/card.ts
1012
+ var STAT_DEFS = [
1013
+ { key: "stars", iconName: "star", label: "Stars" },
1014
+ { key: "commits", iconName: "commit", label: "Commits" },
1015
+ { key: "issues", iconName: "issue", label: "Issues" },
1016
+ { key: "repos", iconName: "repo", label: "Repos" },
1017
+ { key: "prs", iconName: "pr", label: "PRs" }
1018
+ ];
1019
+ function el(tag, attrs, children = "") {
1020
+ let a = "";
1021
+ for (const [k, v] of Object.entries(attrs)) {
1022
+ if (v === undefined || v === null || v === "")
1023
+ continue;
1024
+ a += ` ${k}="${escapeXml(String(v))}"`;
1025
+ }
1026
+ if (!children)
1027
+ return `<${tag}${a} />`;
1028
+ return `<${tag}${a}>${children}</${tag}>`;
1029
+ }
1030
+ function raw(token) {
1031
+ const m = resolveTw(token, "fill").match(/fill="([^"]+)"/);
1032
+ return m?.[1] ?? token;
1033
+ }
1034
+ function clamp(s, n) {
1035
+ return s.length <= n ? s : s.slice(0, n - 1).trimEnd() + "…";
1036
+ }
1037
+ function buildLanguageSegments(langs, totalSize, contentW) {
1038
+ const minSegmentW = 6;
1039
+ const visible = [];
1040
+ let tinySize = 0;
1041
+ for (const lang of langs) {
1042
+ const segmentW = lang.size / totalSize * contentW;
1043
+ if (segmentW < minSegmentW) {
1044
+ tinySize += lang.size;
1045
+ continue;
1046
+ }
1047
+ visible.push(lang);
1048
+ }
1049
+ if (tinySize > 0) {
1050
+ visible.push({ name: "Other", color: "#6b7280", size: tinySize });
1051
+ }
1052
+ return visible.length > 0 ? visible : langs;
1053
+ }
1054
+ function renderCard(user, stats, langs, opts = {}) {
1055
+ const hidden = new Set((opts.hide ?? []).map((k) => k.toLowerCase()));
1056
+ const c = resolveColors(opts);
1057
+ const compact = opts.compact ?? false;
1058
+ const animate = opts.animate ?? false;
1059
+ const hideBorder = opts.hide_border ?? false;
1060
+ const hideLangs = new Set((opts.hide_langs ?? []).map((k) => k.toLowerCase().trim()));
1061
+ const showLangs = new Set((opts.show_langs ?? []).map((k) => k.toLowerCase().trim()));
1062
+ const bgColor = raw(c.bg);
1063
+ const titleColor = raw(c.title);
1064
+ const textColor = raw(c.text);
1065
+ const iconColor = raw(c.icon);
1066
+ const borderColor = raw(c.border);
1067
+ const fontFamily = FONT_FAMILY;
1068
+ const displayName = user.name || user.login;
1069
+ const nameEsc = escapeXml(clamp(displayName, 28));
1070
+ const loginEsc = escapeXml(clamp(user.login, 24));
1071
+ const pronouns = !compact && user.pronouns ? escapeXml(clamp(user.pronouns, 16)) : "";
1072
+ const bioRaw = !compact && user.bio ? user.bio : "";
1073
+ const bioLines = bioRaw ? wrapText(bioRaw, 44, 2) : [];
1074
+ const twitter = !compact && user.twitter ? escapeXml(clamp(user.twitter, 22)) : "";
1075
+ const avatar = user.avatarUrl || "";
1076
+ const metaStr = pronouns ? `@${loginEsc} · ${pronouns}` : `@${loginEsc}`;
1077
+ const visible = STAT_DEFS.filter((d) => !hidden.has(d.key));
1078
+ const activeLangsList = langs.filter((l) => {
1079
+ const name = l.name.toLowerCase().trim();
1080
+ if (showLangs.size > 0 && !showLangs.has(name))
1081
+ return false;
1082
+ if (hideLangs.has(name))
1083
+ return false;
1084
+ return true;
1085
+ });
1086
+ const PX = 24;
1087
+ const PY = 22;
1088
+ const avatarSize = 60;
1089
+ const avatarR = avatarSize / 2;
1090
+ const textGap = 16;
1091
+ const nameW = measureText(displayName, 17, 700);
1092
+ const metaW = measureText(metaStr, 12.5, 500);
1093
+ const bioW = bioLines.length ? Math.max(...bioLines.map((l) => measureText(l, 11.5, 400))) : 0;
1094
+ const twitterW = twitter ? measureText(`@${twitter}`, 11.5, 500) : 0;
1095
+ const profileTextW = Math.max(nameW, metaW, bioW, twitterW);
1096
+ const profileW = PX + avatarSize + textGap + profileTextW + PX;
1097
+ const statsW = visible.length > 0 ? visible.length * 84 + PX * 2 : 0;
1098
+ const langsW = activeLangsList.length > 0 ? 300 : 0;
1099
+ const W = Math.round(Math.min(540, Math.max(340, profileW, statsW, langsW)));
1100
+ const contentW = W - PX * 2;
1101
+ const infoX = PX + avatarSize + textGap;
1102
+ const nameY = PY + 20;
1103
+ const loginY = nameY + 17;
1104
+ const bioStartY = loginY + 15;
1105
+ const twitterY = bioStartY + bioLines.length * 14 + (bioLines.length ? 4 : 0);
1106
+ let profileH = loginY + 8 - PY;
1107
+ if (bioLines.length)
1108
+ profileH = bioStartY + bioLines.length * 14 - PY;
1109
+ if (twitter)
1110
+ profileH = twitterY + 10 - PY;
1111
+ profileH = Math.max(profileH, avatarSize + 6);
1112
+ const statsY = PY + profileH + 16;
1113
+ const statW = visible.length > 0 ? contentW / visible.length : 0;
1114
+ const statsH = visible.length > 0 ? 58 : 0;
1115
+ const totalSize = activeLangsList.reduce((s, l) => s + l.size, 0) || 1;
1116
+ const sorted = [...activeLangsList].sort((a, b) => b.size - a.size);
1117
+ const visualLangs = buildLanguageSegments(sorted, totalSize, contentW);
1118
+ const barY = statsY + statsH + (statsH ? 18 : 14);
1119
+ const barH = 10;
1120
+ const maxLegend = compact ? 0 : 6;
1121
+ const legendLangs = visualLangs.slice(0, maxLegend);
1122
+ const otherSize = visualLangs.slice(maxLegend).reduce((s, l) => s + l.size, 0);
1123
+ const legendY = barY + barH + 14;
1124
+ const legendRowH = 17;
1125
+ const legendCols = 3;
1126
+ const legendColW = contentW / legendCols;
1127
+ const legendItems = legendLangs.map((l) => ({
1128
+ name: clamp(l.name, 14),
1129
+ color: l.color,
1130
+ pct: (l.size / totalSize * 100).toFixed(1)
1131
+ }));
1132
+ if (otherSize > 0 && legendItems.length > 0) {
1133
+ const existingOther = legendItems.find((item) => item.name === "Other");
1134
+ if (existingOther) {
1135
+ existingOther.pct = ((Number(existingOther.pct) / 100 * totalSize + otherSize) / totalSize * 100).toFixed(1);
1136
+ } else {
1137
+ legendItems.push({
1138
+ name: "Other",
1139
+ color: "#6b7280",
1140
+ pct: (otherSize / totalSize * 100).toFixed(1)
1141
+ });
1142
+ }
1143
+ }
1144
+ const legendRows = compact ? 0 : Math.ceil(legendItems.length / legendCols);
1145
+ const hasLangs = activeLangsList.length > 0;
1146
+ const langSectionH = hasLangs ? barH + 14 + legendRows * legendRowH + 10 : 0;
1147
+ const H = barY + (hasLangs ? langSectionH : 0) + 14 + (hasLangs ? 0 : 6);
1148
+ const parts = [];
1149
+ const svgAttrs = {
1150
+ width: W,
1151
+ height: H,
1152
+ viewBox: `0 0 ${W} ${H}`,
1153
+ fill: "none",
1154
+ xmlns: "http://www.w3.org/2000/svg",
1155
+ role: "img",
1156
+ "aria-labelledby": "cardTitle cardDesc"
1157
+ };
1158
+ let svgOpen = "<svg";
1159
+ for (const [k, v] of Object.entries(svgAttrs))
1160
+ svgOpen += ` ${k}="${escapeXml(String(v))}"`;
1161
+ parts.push(svgOpen + ">");
1162
+ parts.push(el("title", { id: "cardTitle" }, `${escapeXml(displayName)}'s GitHub Stats`));
1163
+ parts.push(el("desc", { id: "cardDesc" }, `GitHub profile card for ${escapeXml(displayName)} with ${kFormat(stats.stars)} stars, ${kFormat(stats.commits)} commits, and ${activeLangsList.length} highlighted languages.`));
1164
+ const css = [];
1165
+ css.push(`* { font-family: ${fontFamily}; text-rendering: geometricPrecision; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }`);
1166
+ css.push(`.header { font-size: 17px; font-weight: 700; fill: ${titleColor}; letter-spacing: -0.015em; }`);
1167
+ css.push(`.stat { font-size: 14px; font-weight: 600; fill: ${textColor}; }`);
1168
+ css.push(`.icon { fill: ${iconColor}; }`);
1169
+ css.push(`.lang-name { font-size: 11px; fill: ${textColor}; opacity: 0.82; }`);
1170
+ css.push(`.lang-progress { fill: ${textColor}; opacity: 0.07; }`);
1171
+ css.push(`.meta { font-size: 12.5px; font-weight: 500; fill: ${textColor}; opacity: 0.72; }`);
1172
+ css.push(`.bio { font-size: 11.5px; font-weight: 400; fill: ${textColor}; opacity: 0.68; }`);
1173
+ css.push(`.stat-label { font-size: 10px; font-weight: 700; fill: ${textColor}; opacity: 0.68; letter-spacing: 0.06em; }`);
1174
+ css.push(`.stat-value { font-size: 16px; font-weight: 700; fill: ${textColor}; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }`);
1175
+ css.push(`.twitter-text { font-size: 11.5px; font-weight: 500; fill: ${textColor}; opacity: 0.65; }`);
1176
+ if (animate) {
1177
+ css.push("@keyframes fadeInAnimation { from { opacity: 0; } to { opacity: 1; } }");
1178
+ css.push(".stagger { opacity: 0; animation: fadeInAnimation 0.3s ease-in-out forwards; }");
1179
+ }
1180
+ parts.push(el("style", {}, css.join(" ")));
1181
+ parts.push(el("defs", {}, [
1182
+ el("clipPath", { id: "av" }, el("circle", { cx: PX + avatarR, cy: PY + avatarR, r: avatarR })),
1183
+ el("radialGradient", { id: "gl", cx: "12%", cy: "15%", r: "65%" }, el("stop", { offset: "0%", "stop-color": iconColor, "stop-opacity": "0.08" }) + el("stop", { offset: "100%", "stop-color": iconColor, "stop-opacity": "0" })),
1184
+ el("radialGradient", { id: "gl2", cx: "92%", cy: "95%", r: "55%" }, el("stop", { offset: "0%", "stop-color": titleColor, "stop-opacity": "0.035" }) + el("stop", { offset: "100%", "stop-color": titleColor, "stop-opacity": "0" })),
1185
+ el("linearGradient", { id: "ring", x1: "0", y1: "0", x2: "1", y2: "1" }, el("stop", { offset: "0%", "stop-color": titleColor }) + el("stop", { offset: "100%", "stop-color": iconColor })),
1186
+ el("linearGradient", { id: "card-bg", x1: "0", y1: "0", x2: W, y2: H, gradientUnits: "userSpaceOnUse" }, el("stop", { offset: "0%", "stop-color": bgColor }) + el("stop", { offset: "82%", "stop-color": bgColor }) + el("stop", { offset: "100%", "stop-color": titleColor, "stop-opacity": "0.04" })),
1187
+ el("linearGradient", { id: "rim", x1: "0", y1: "0", x2: W, y2: "0", gradientUnits: "userSpaceOnUse" }, el("stop", { offset: "0%", "stop-color": iconColor, "stop-opacity": "0" }) + el("stop", { offset: "45%", "stop-color": iconColor, "stop-opacity": "0.28" }) + el("stop", { offset: "100%", "stop-color": iconColor, "stop-opacity": "0" }))
1188
+ ].join("")));
1189
+ parts.push(el("rect", { x: "0.5", y: "0.5", width: W - 1, height: H - 1, rx: 12, fill: "url(#card-bg)" }));
1190
+ parts.push(el("rect", { x: "0.5", y: "0.5", width: W - 1, height: H - 1, rx: 12, fill: "url(#gl)" }));
1191
+ parts.push(el("rect", { x: "0.5", y: "0.5", width: W - 1, height: H - 1, rx: 12, fill: "url(#gl2)" }));
1192
+ parts.push(el("line", {
1193
+ x1: PX,
1194
+ y1: "1.5",
1195
+ x2: W - PX,
1196
+ y2: "1.5",
1197
+ stroke: "url(#rim)",
1198
+ "stroke-width": 1
1199
+ }));
1200
+ if (!hideBorder) {
1201
+ parts.push(el("rect", {
1202
+ x: "0.5",
1203
+ y: "0.5",
1204
+ width: W - 1,
1205
+ height: H - 1,
1206
+ rx: 12,
1207
+ fill: "none",
1208
+ stroke: borderColor,
1209
+ "stroke-opacity": "0.5"
1210
+ }));
1211
+ }
1212
+ parts.push(el("g", {}, el("circle", {
1213
+ cx: PX + avatarR + 1,
1214
+ cy: PY + avatarR + 1,
1215
+ r: avatarR + 3,
1216
+ fill: titleColor,
1217
+ opacity: "0.08"
1218
+ }) + el("image", {
1219
+ href: avatar,
1220
+ x: PX,
1221
+ y: PY,
1222
+ width: avatarSize,
1223
+ height: avatarSize,
1224
+ "clip-path": "url(#av)",
1225
+ preserveAspectRatio: "xMidYMid slice"
1226
+ }) + el("circle", {
1227
+ cx: PX + avatarR,
1228
+ cy: PY + avatarR,
1229
+ r: avatarR + 1.5,
1230
+ fill: "none",
1231
+ stroke: "url(#ring)",
1232
+ "stroke-opacity": "0.55",
1233
+ "stroke-width": "1.5"
1234
+ })));
1235
+ const textParts = [];
1236
+ textParts.push(el("text", { x: infoX, y: nameY, class: "header" }, nameEsc));
1237
+ textParts.push(el("text", { x: infoX, y: loginY, class: "meta" }, metaStr));
1238
+ for (let i = 0;i < bioLines.length; i++) {
1239
+ textParts.push(el("text", { x: infoX, y: bioStartY + i * 14, class: "bio" }, escapeXml(bioLines[i].trim())));
1240
+ }
1241
+ if (twitter) {
1242
+ textParts.push(el("g", { transform: `translate(${infoX},${twitterY - 9})` }, icon("x", textColor, 11) + el("text", { x: 15, y: 9, class: "twitter-text" }, `@${twitter}`)));
1243
+ }
1244
+ parts.push(el("g", {}, textParts.join("")));
1245
+ if (visible.length > 0) {
1246
+ const statParts = [];
1247
+ for (let i = 0;i < visible.length; i++) {
1248
+ const d = visible[i];
1249
+ const val = stats[d.key];
1250
+ const cx = PX + statW * i + statW / 2;
1251
+ const iy = statsY + 4;
1252
+ const staggerClass = animate ? " stagger" : "";
1253
+ const iconSize = 15;
1254
+ const iconY = 2;
1255
+ const valueY = 37;
1256
+ const labelY = 52;
1257
+ const cellParts = [];
1258
+ cellParts.push(el("g", { transform: `translate(${-iconSize / 2},${iconY})`, class: "stat-icon" }, icon(d.iconName, iconColor, iconSize)));
1259
+ cellParts.push(el("text", { x: 0, y: valueY, class: "stat-value", "text-anchor": "middle" }, kFormat(val)));
1260
+ cellParts.push(el("text", { x: 0, y: labelY, class: "stat-label", "text-anchor": "middle" }, d.label.toUpperCase()));
1261
+ statParts.push(el("g", {
1262
+ transform: `translate(${cx},${iy})`,
1263
+ class: `stat${staggerClass}`,
1264
+ style: animate ? `animation-delay: ${(i + 3) * 150}ms` : undefined
1265
+ }, cellParts.join("")));
1266
+ if (i < visible.length - 1) {
1267
+ const dx = PX + statW * (i + 1);
1268
+ statParts.push(el("line", {
1269
+ x1: dx,
1270
+ y1: statsY + 4,
1271
+ x2: dx,
1272
+ y2: statsY + statsH - 6,
1273
+ stroke: textColor,
1274
+ "stroke-opacity": "0.12"
1275
+ }));
1276
+ }
1277
+ }
1278
+ parts.push(el("g", {}, statParts.join("")));
1279
+ }
1280
+ if (hasLangs) {
1281
+ const langParts = [];
1282
+ langParts.push(el("line", {
1283
+ x1: PX,
1284
+ y1: barY - 8,
1285
+ x2: W - PX,
1286
+ y2: barY - 8,
1287
+ stroke: textColor,
1288
+ "stroke-opacity": "0.08"
1289
+ }));
1290
+ langParts.push(el("clipPath", { id: "lang-clip" }, el("rect", {
1291
+ x: PX,
1292
+ y: barY,
1293
+ width: animate ? "0" : contentW,
1294
+ height: barH,
1295
+ rx: 5
1296
+ }, animate ? el("animate", {
1297
+ attributeName: "width",
1298
+ from: "0",
1299
+ to: contentW,
1300
+ dur: "0.6s",
1301
+ fill: "freeze"
1302
+ }) : "")));
1303
+ langParts.push(el("rect", { x: PX, y: barY, width: contentW, height: barH, rx: 5, class: "lang-progress" }));
1304
+ const barParts = [];
1305
+ let off = 0;
1306
+ for (let i = 0;i < visualLangs.length; i++) {
1307
+ const lang = visualLangs[i];
1308
+ const pct = (lang.size / totalSize * 100).toFixed(1);
1309
+ let w = i === visualLangs.length - 1 ? contentW - off : lang.size / totalSize * contentW;
1310
+ if (w < 0)
1311
+ w = 0;
1312
+ const x = PX + off;
1313
+ const tooltip = compact ? "" : el("title", {}, `${escapeXml(lang.name)} ${pct}%`);
1314
+ barParts.push(el("rect", { x, y: barY, width: w, height: barH, fill: lang.color }, tooltip));
1315
+ off += w;
1316
+ }
1317
+ langParts.push(el("g", { "clip-path": "url(#lang-clip)" }, barParts.join("")));
1318
+ for (let i = 0;i < legendItems.length; i++) {
1319
+ const item = legendItems[i];
1320
+ const col = i % legendCols;
1321
+ const row = Math.floor(i / legendCols);
1322
+ const lx = PX + col * legendColW;
1323
+ const ly = legendY + row * legendRowH;
1324
+ langParts.push(el("g", {
1325
+ class: animate ? "stagger" : undefined,
1326
+ style: animate ? `animation-delay: ${(i + 3) * 150}ms` : undefined
1327
+ }, el("circle", { cx: lx + 5, cy: ly, r: 4, fill: item.color }) + el("text", { x: lx + 14, y: ly + 4, class: "lang-name", "font-weight": "500" }, `${escapeXml(item.name)} ${item.pct}%`)));
1328
+ }
1329
+ parts.push(el("g", {}, langParts.join("")));
1330
+ }
1331
+ parts.push("</svg>");
1332
+ return parts.join("");
1333
+ }
1334
+ export {
1335
+ FONT_FACE,
1336
+ FONT_FAMILY,
1337
+ escapeXml,
1338
+ getLangColor,
1339
+ icon,
1340
+ icons,
1341
+ kFormat,
1342
+ measureText,
1343
+ renderCard,
1344
+ resolveColors,
1345
+ themes,
1346
+ wrapText
1347
+ };