@botlings/core 0.0.0-stage → 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Will Cunningham (WillsLab)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,16 @@
1
- # Temporary Holding Version
1
+ # @botlings/core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Zero-dependency 3D SVG Botlings engine, WCAG palettes, spherical eye projection, gaze physics, versioned `v1:` DNA codec, and lazy-loaded accessory pack registry.
4
+
5
+ See the main repository at [github.com/willslab-ai/botlings](https://github.com/willslab-ai/botlings) and live playground at [botlings.willslab.ai](https://botlings.willslab.ai).
6
+
7
+ ```ts
8
+ import { botlingFromSeed, renderBotlingSvg } from '@botlings/core'
9
+
10
+ const config = botlingFromSeed('my-research-agent')
11
+ const svg = renderBotlingSvg(config, { size: 128 })
12
+ ```
13
+
14
+ ## License
15
+
16
+ MIT © Will Cunningham (WillsLab)
@@ -0,0 +1,10 @@
1
+ import type { BotlingAccessoryPalette, BotlingConfig, BotlingPalette } from './types.js';
2
+ export interface RenderedAccessoryParts {
3
+ back: string;
4
+ flair: string;
5
+ glasses: string;
6
+ topper: string;
7
+ neck: string;
8
+ }
9
+ export declare function renderAccessoryParts(cfg: BotlingConfig, uid: string, p: BotlingPalette, acc: BotlingAccessoryPalette): RenderedAccessoryParts;
10
+ //# sourceMappingURL=accessories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessories.d.ts","sourceRoot":"","sources":["../src/accessories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,uBAAuB,EACvB,aAAa,EACb,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb;AAMD,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,aAAa,EAClB,GAAG,EAAE,MAAM,EACX,CAAC,EAAE,cAAc,EACjB,GAAG,EAAE,uBAAuB,GAC3B,sBAAsB,CAoSxB"}
package/dist/dna.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { type BotlingConfig } from './types.js';
2
+ /** Strictly whitelist and normalize any untrusted partial BotlingConfig object. */
3
+ export declare function sanitizeBotlingConfig(input?: Partial<BotlingConfig> | null): BotlingConfig;
4
+ export declare function isBotlingDna(value: string | null | undefined): boolean;
5
+ export declare function encodeBotlingDna(cfg: Partial<BotlingConfig>, opts?: {
6
+ versionPrefix?: boolean;
7
+ }): string;
8
+ /** Strict whitelist parser for Botling DNA (`v1:...`, `botling:...`, or bare `variant:finish:...`). */
9
+ export declare function parseBotlingDna(raw: string | null | undefined): BotlingConfig | null;
10
+ /** Deterministic Botling generator from any seed (agent name, username, repo slug). */
11
+ export declare function botlingFromSeed(seed: string): BotlingConfig;
12
+ export declare function resolveBotlingInput(input: string | Partial<BotlingConfig>): BotlingConfig;
13
+ //# sourceMappingURL=dna.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dna.d.ts","sourceRoot":"","sources":["../src/dna.ts"],"names":[],"mappings":"AAIA,OAAO,EAcL,KAAK,aAAa,EAKnB,MAAM,YAAY,CAAA;AAoBnB,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,GAAG,aAAa,CAsC1F;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAKtE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE,IAAI,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAiC5G;AAED,uGAAuG;AACvG,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAsFpF;AAED,uFAAuF;AACvF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CA0B3D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAKzF"}
package/dist/gaze.d.ts ADDED
@@ -0,0 +1,40 @@
1
+ export interface GazeAim {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export interface PointerTargetInput {
6
+ dx: number;
7
+ dy: number;
8
+ radius: number;
9
+ prevX: number;
10
+ prevY: number;
11
+ dtMs: number;
12
+ gain?: number;
13
+ }
14
+ export interface PointerStepResult {
15
+ snapped: boolean;
16
+ tx: number;
17
+ ty: number;
18
+ x: number;
19
+ y: number;
20
+ }
21
+ export declare function hashSeed(name: string): number;
22
+ export declare function botPhaseOffset(seed: string): number;
23
+ export declare function stepPointerGaze(input: PointerTargetInput): PointerStepResult;
24
+ /** Compute normalized gaze vector from a Botling bounding box toward any target point/rect. */
25
+ export declare function computeLookAtAim(from: {
26
+ cx: number;
27
+ cy: number;
28
+ radius: number;
29
+ }, target: {
30
+ x: number;
31
+ y: number;
32
+ }): GazeAim;
33
+ export declare function blinkOpenness(t: number, phaseOffset: number, period?: number): number;
34
+ export declare function idleAmbientAim(t: number, phaseOffset: number): GazeAim;
35
+ export type IdleMicroKind = 'wink' | 'curious' | 'happy' | 'sleepy';
36
+ export declare function idleMicroEmotion(t: number, phaseOffset: number): {
37
+ kind: IdleMicroKind;
38
+ strength: number;
39
+ } | null;
40
+ //# sourceMappingURL=gaze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gaze.d.ts","sourceRoot":"","sources":["../src/gaze.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAMD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO7C;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,CAqB5E;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAChD,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B,OAAO,CAST;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAM,GAAG,MAAM,CAMlF;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAQtE;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEnE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CASjH"}
@@ -0,0 +1,29 @@
1
+ import { type BotlingVariant, type VariantMetrics } from './types.js';
2
+ export type FacePoint = [number, number];
3
+ export declare const BOTLING_CX = 22;
4
+ export declare const BOTLING_CY = 21;
5
+ export declare function clamp(value: number, min: number, max: number): number;
6
+ export declare function smoothstep(t: number): number;
7
+ export declare function nearestStepIndex(value: number, steps: readonly number[]): number;
8
+ export declare function botlingEyeScale(eyeSize?: number): {
9
+ w: number;
10
+ h: number;
11
+ sep: number;
12
+ };
13
+ export declare const VARIANT_METRICS: Record<BotlingVariant, VariantMetrics>;
14
+ export declare function variantMetrics(variant: BotlingVariant): VariantMetrics;
15
+ export declare function sampleBotlingRing(variant: BotlingVariant, steps?: number): FacePoint[];
16
+ export declare function projectBotlingRing(pts: FacePoint[], turn: number, tilt: number, roll: number): FacePoint[];
17
+ export declare function pointsToSvgPath(pts: FacePoint[]): string;
18
+ export interface ProjectedEye {
19
+ cx: number;
20
+ cy: number;
21
+ sx: number;
22
+ sy: number;
23
+ tiltDeg: number;
24
+ }
25
+ export declare function projectBotlingEye(side: -1 | 1, variant: BotlingVariant, aimX: number, aimY: number, eyeSize?: number): ProjectedEye;
26
+ export declare function scaleAround(cx: number, cy: number, scale: number): string;
27
+ export declare function starEyePath(cx: number, cy: number, rx: number, ry: number): string;
28
+ export declare function happyArcPath(cx: number, cy: number, w: number, h: number): string;
29
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../src/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAA;AAEnB,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAExC,eAAO,MAAM,UAAU,KAAK,CAAA;AAC5B,eAAO,MAAM,UAAU,KAAK,CAAA;AAE5B,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAWhF;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,MAAiC,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAOjH;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,cAAc,EAAE,cAAc,CAalE,CAAA;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAEtE;AAYD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,SAAK,GAAG,SAAS,EAAE,CA0GlF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAgB1G;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,CAOxD;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;CAChB;AAMD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,EACZ,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAiC,GACzC,YAAY,CA8Cd;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIzE;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CASlF;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAIjF"}
@@ -0,0 +1,10 @@
1
+ export * from './types.js';
2
+ export * from './geometry.js';
3
+ export * from './palette.js';
4
+ export * from './gaze.js';
5
+ export * from './packs.js';
6
+ export * from './dna.js';
7
+ export * from './accessories.js';
8
+ export * from './render.js';
9
+ export * from './runtime.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ var Re=["pebble","orb","squircle","pill","cloud","clover","star","gem","drop","hex","dome","wedge"],Po={pebble:"Pebble",orb:"Orb",squircle:"Squircle",pill:"Pill",cloud:"Cloud",clover:"Clover",star:"Star",gem:"Gem",drop:"Drop",hex:"Hex",dome:"Dome",wedge:"Wedge"},mt=["clay","gloss"],ge=[.78,1,1.24,1.48,1.72,1.98,2.22],Io=["XS","S","M","L","XL","2XL","Max"],je=ge[0],no=3,me=ge[no],kt=ge[ge.length-1],N=[.6,.8,1,1.2,1.4,1.6,1.8],_o=N[0],so=2,j=N[so],Yo=N[N.length-1],Ue=["pill","round","almond","happy","anime","star"],Ro={pill:"Pill",round:"Round",almond:"Cool",happy:"Happy",anime:"Anime",star:"Star"},xe={pill:{w:1,h:1,rxRatio:.5},round:{w:1.18,h:.84,rxRatio:.5},almond:{w:1.22,h:.68,rxRatio:.46},happy:{w:1.12,h:.92,rxRatio:.5},anime:{w:1.24,h:1.12,rxRatio:.48},star:{w:1.24,h:1.08,rxRatio:.5}},bt=["auto","none","happy","wink","curious","sleepy"],We=["idle","think","work","happy","alert","wink","curious","sleepy","none"],pt=["tuft","quiff","curly","mohawk","bob","pigtails","ponytail","bow-hair","updo"],ao=["beanie","beret","cowboy","cap","crown","tophat","wizard","cat-ears","sprout","halo"],Ke=[...pt,...ao],No={"":"None",tuft:"Tuft",quiff:"Quiff",curly:"Curly",mohawk:"Mohawk",bob:"Bob",pigtails:"Pigtails",ponytail:"Ponytail","bow-hair":"Hair Bow",updo:"Updo",beanie:"Beanie",beret:"Beret",cowboy:"Cowboy",cap:"Cap",crown:"Crown",tophat:"Top Hat",wizard:"Wizard","cat-ears":"Cat Ears",sprout:"Sprout",halo:"Halo"},Je=["round","shades","cat","visor","monocle"],Go={"":"None",round:"Round",shades:"Shades",cat:"Cat-Eye",visor:"Visor",monocle:"Monocle"},et=["bowtie","scarf","tie","headphones","bandana","pearls","star-necklace"],Oo={"":"None",bowtie:"Bowtie",scarf:"Scarf",tie:"Tie",headphones:"Headphones",bandana:"Bandana",pearls:"Pearls","star-necklace":"Star Charm"},tt=["freckles","blush","earrings","sparkle","mustache","beard","goatee","long-beard","sideburns"],vo={"":"None",freckles:"Freckles",blush:"Blush",earrings:"Earrings",sparkle:"Sparkle",mustache:"Mustache",beard:"Beard",goatee:"Goatee","long-beard":"Long Beard",sideburns:"Sideburns"},Qo=["Mochi","Pip","Bloop","Noodle","Kip","Waffle","Sprout","Gizmo","Cosmo","Biscuit","Tofu","Pixel","Luma","Fig","Ollie","Puff","Zuzu","Clover","Milo","Poppy","Nibbles","Bean","Pebble","Bramble","Tango","Juniper","Sable","Ziggy","Puddles","Vesper"],pe={variant:"pebble",finish:"clay",color:"#8b5cf6",eyeSize:me,eyeShape:"pill",feeling:"auto",topper:"",topperColor:"auto",topperScale:j,glasses:"",glassesColor:"auto",glassesScale:j,neck:"",neckColor:"auto",neckScale:j,flair:"",flairColor:"auto",flairScale:j};var Qe=22,Ze=21;function b(i,r,n){return Math.min(n,Math.max(r,i))}function Be(i){let r=b(i,0,1);return r*r*(3-2*r)}function Le(i,r){let n=0,o=1/0;for(let a=0;a<r.length;a++){let $=Math.abs(r[a]-i);$<o&&(o=$,n=a)}return n}function Ee(i=me){let r=b(Number.isFinite(i)?i:me,je,kt);if(r<=1){let n=(r-je)/(1-je);return{w:r,h:.75+.25*n,sep:.96+.04*n}}return{w:r,h:1+(r-1)*.94,sep:1+(r-1)*.24}}var lo={pebble:{eyeSep:4.9,eyeY:19.6,eyeW:3.3,eyeH:5.5,faceRx:12.2,faceRy:11.4,crownY:5.4,crownScale:1,chinY:36.2,sideRx:16.8,earY:20.4},orb:{eyeSep:5,eyeY:19.8,eyeW:3.3,eyeH:5.6,faceRx:12.6,faceRy:12.4,crownY:4.8,crownScale:1,chinY:36.8,sideRx:16.8,earY:20.6},squircle:{eyeSep:5.2,eyeY:19.8,eyeW:3.3,eyeH:5.5,faceRx:13,faceRy:12.6,crownY:4.8,crownScale:1.1,chinY:36.8,sideRx:16.9,earY:20.5},pill:{eyeSep:5.6,eyeY:20.6,eyeW:3.2,eyeH:5.1,faceRx:13.6,faceRy:9.8,crownY:8.6,crownScale:1.12,chinY:33.4,sideRx:17.6,earY:21},cloud:{eyeSep:4.8,eyeY:22.8,eyeW:3.1,eyeH:4.9,faceRx:12.2,faceRy:9.2,crownY:10.6,crownScale:.94,chinY:32.6,sideRx:16,earY:23},clover:{eyeSep:4.6,eyeY:20.4,eyeW:3.2,eyeH:5.2,faceRx:11.4,faceRy:11.2,crownY:5.6,crownScale:.88,chinY:36.4,sideRx:16.6,earY:21},star:{eyeSep:4.4,eyeY:20.6,eyeW:3.1,eyeH:5,faceRx:10.8,faceRy:10.6,crownY:6.4,crownScale:.84,chinY:34.4,sideRx:15.6,earY:21},gem:{eyeSep:4.6,eyeY:20.6,eyeW:3.1,eyeH:5,faceRx:11.2,faceRy:11.2,crownY:6.6,crownScale:.86,chinY:36,sideRx:16.2,earY:21},drop:{eyeSep:4.4,eyeY:23.6,eyeW:3.1,eyeH:5,faceRx:10.8,faceRy:10.2,crownY:9.2,crownScale:.8,chinY:37.2,sideRx:14.8,earY:24.8},hex:{eyeSep:4.9,eyeY:20.2,eyeW:3.2,eyeH:5.3,faceRx:12,faceRy:11.8,crownY:5.6,crownScale:.96,chinY:36.4,sideRx:16,earY:20.8},dome:{eyeSep:4.8,eyeY:21.4,eyeW:3.2,eyeH:5.3,faceRx:11.8,faceRy:11.4,crownY:6.2,crownScale:.96,chinY:35.8,sideRx:15.6,earY:22},wedge:{eyeSep:4.4,eyeY:23.4,eyeW:3,eyeH:4.8,faceRx:10.4,faceRy:9.6,crownY:9,crownScale:.82,chinY:35,sideRx:15.2,earY:24.4}};function Te(i){return lo[i]}function ot(i,r,n,o,a){let $=1-a;return[$*$*$*i[0]+3*$*$*a*r[0]+3*$*a*a*n[0]+a*a*a*o[0],$*$*$*i[1]+3*$*$*a*r[1]+3*$*a*a*n[1]+a*a*a*o[1]]}var St=new Map;function it(i,r=60){let n=`${i}:${r}`,o=St.get(n);if(o)return o;let a;if(i==="cloud"){let $=[[[11.5,32.5],[4.8,32.5],[3.6,23.2],[9.2,19.6]],[[9.2,19.6],[8.8,11.4],[19.4,7.6],[25.6,12.6]],[[25.6,12.6],[33.2,10.8],[39.6,17.6],[37.4,24.8]],[[37.4,24.8],[39,29.8],[35.6,32.5],[31.5,32.5]],[[31.5,32.5],[25.5,32.9],[17.5,32.9],[11.5,32.5]]];a=[];let d=Math.max(8,Math.round(r/$.length));for(let[l,s,f,u]of $)for(let h=0;h<d;h++)a.push(ot(l,s,f,u,h/d))}else if(i==="drop"){a=[];let $=Math.max(10,Math.floor(r/3));for(let d=0;d<$;d++)a.push(ot([22,4.2],[22,4.2],[7.2,19.5],[7.2,26.5],d/$));for(let d=0;d<=$;d++){let l=d/$*Math.PI;a.push([22-14.8*Math.cos(l),26.5+11.8*Math.sin(l)])}for(let d=1;d<=$;d++)a.push(ot([36.8,26.5],[36.8,19.5],[22,4.2],[22,4.2],d/$))}else if(i==="dome"){a=[];let $=Math.max(24,Math.floor(r*.65)),d=Math.max(12,r-$);for(let f=0;f<$;f++){let u=Math.PI+f/$*Math.PI;a.push([Qe+15.6*Math.cos(u),24.5+18.8*Math.sin(u)])}let l=[[[37.6,24.5],[37.6,33.8],[34.4,36.4],[28,36.4]],[[28,36.4],[24,36.6],[20,36.6],[16,36.4]],[[16,36.4],[9.6,36.4],[6.4,33.8],[6.4,24.5]]],s=Math.max(4,Math.floor(d/3));for(let[f,u,h,x]of l)for(let g=0;g<s;g++)a.push(ot(f,u,h,x,g/s))}else{a=[];for(let $=0;$<r;$++){let d=$/r*Math.PI*2-Math.PI/2,l=Math.cos(d),s=Math.sin(d),f=16.8,u=16.8,h=Ze;switch(i){case"orb":f=u=16.9;break;case"pebble":{f=17.1*(1+.065*Math.sin(2*d+.45)+.042*Math.cos(3*d-.35)),u=16.1*(1-.03*Math.cos(2*d)+.025*Math.sin(d));break}case"squircle":{f=u=16.8/(Math.pow(Math.abs(l)**4.4+Math.abs(s)**4.4,.22727272727272727)||1);break}case"pill":{f=u=17.8/(Math.pow(Math.abs(l)**7.5+Math.abs(s/.72)**7.5,.13333333333333333)||1);break}case"clover":f=u=14.8+2.75*Math.cos(4*d);break;case"star":f=u=14.3+3.35*Math.cos(5*d);break;case"gem":{f=u=16.6/(Math.pow(Math.abs(l)**1.68+Math.abs(s)**1.68,.5952380952380952)||1);break}case"hex":{let x=Math.PI/3;f=u=16.2*(.35+.65*(Math.cos(x/2)/Math.cos(d-x*Math.round(d/x))));break}case"wedge":{let g=(d+Math.PI/2+Math.PI*2)%(Math.PI*2)/(Math.PI*2/3)%1,m=13.8/Math.max(.47,Math.cos((g-.5)*1.82));f=u=.28*15.5+.72*m,h=23;break}}a.push([Qe+f*l,h+u*s])}}return St.set(n,a),a}function wt(i,r,n,o){let a=o*Math.PI/180,$=Math.cos(a),d=Math.sin(a),l=.86+.14*Math.abs(Math.cos(r*Math.PI/180)),s=.9+.1*Math.abs(Math.cos(n*Math.PI/180)),f=Math.sin(r*Math.PI/180)*.9,u=Math.sin(n*Math.PI/180)*.7;return i.map(([h,x])=>{let g=h-Qe,m=x-Ze,y=g*$-m*d,S=g*d+m*$;return[Qe+y*l+f,Ze+S*s+u]})}function rt(i){if(!i.length)return"";let r=`M${i[0][0].toFixed(2)} ${i[0][1].toFixed(2)}`;for(let n=1;n<i.length;n++)r+=`L${i[n][0].toFixed(2)} ${i[n][1].toFixed(2)}`;return`${r}Z`}var $o=.56,co=.44,ve=.92;function Ne(i,r,n,o,a=me){let $=Te(r),d=Ee(a).sep,l=i*$.eyeSep*d,s=$.eyeY-Ze,f=b(l/$.faceRx,-.82,.82),u=b(s/$.faceRy,-.82,.82),h=Math.sqrt(Math.max(.05,1-f*f-u*u)),x=b(n,-1,1)*$o,g=b(o,-1,1)*co,m=Math.cos(x),y=Math.sin(x),S=f*m+h*y,E=h*m-f*y,I=Math.cos(g),G=Math.sin(g),C=u*I+E*G,_=E*I-u*G,w=Math.hypot(S,C),T=_<=0||w>ve?ve/Math.max(w,1e-4):1,V=S*T,Q=C*T,re=_<=0||w>ve?Math.sqrt(1-ve*ve):_,A=Math.sqrt(Math.max(.15,1-f*f)),B=Math.sqrt(Math.max(.12,1-V*V)),oe=b(B/A,.48,1),O=Math.sqrt(Math.max(.2,1-u*u)),v=Math.sqrt(Math.max(.18,1-Q*Q)),Z=b(v/O,.62,1),fe=b((re-1)*V*Q*18,-7,7);return{cx:Qe+V*$.faceRx,cy:Ze+Q*$.faceRy,sx:oe,sy:Z,tiltDeg:fe}}function ae(i,r,n){return Math.abs(n-1)<.005?"":`translate(${i.toFixed(2)} ${r.toFixed(2)}) scale(${n.toFixed(2)}) translate(${(-i).toFixed(2)} ${(-r).toFixed(2)})`}function ke(i,r,n,o){let $=[];for(let d=0;d<8;d++){let l=d*Math.PI/4-Math.PI/2,s=d%2===0?1:.38;$.push(`${(i+Math.cos(l)*n*s).toFixed(2)} ${(r+Math.sin(l)*o*s).toFixed(2)}`)}return`M${$[0]}L${$.slice(1).join("L")}Z`}function be(i,r,n,o){let a=n*.56,$=o*.44;return`M${(i-a).toFixed(2)} ${(r+$*.35).toFixed(2)} Q${i.toFixed(2)} ${(r-$*1.15).toFixed(2)} ${(i+a).toFixed(2)} ${(r+$*.35).toFixed(2)}`}var st=[{name:"Violet",hex:"#8b5cf6"},{name:"Indigo",hex:"#6366f1"},{name:"Sky",hex:"#38bdf8"},{name:"Cyan",hex:"#06b6d4"},{name:"Teal",hex:"#14b8a6"},{name:"Emerald",hex:"#10b981"},{name:"Lime",hex:"#84cc16"},{name:"Amber",hex:"#f59e0b"},{name:"Orange",hex:"#f97316"},{name:"Coral",hex:"#fb7185"},{name:"Rose",hex:"#f43f5e"},{name:"Fuchsia",hex:"#d946ef"},{name:"Cobalt",hex:"#3b82f6"},{name:"Gold",hex:"#eab308"},{name:"Terracotta",hex:"#c26546"},{name:"Slate",hex:"#475569"},{name:"Obsidian",hex:"#1f2430"},{name:"Pearl",hex:"#e7ecf3"}],nt=[{id:"raven",name:"Raven",hex:"#1f2330"},{id:"espresso",name:"Espresso",hex:"#543322"},{id:"auburn",name:"Auburn",hex:"#b84621"},{id:"crimson",name:"Crimson",hex:"#e11d48"},{id:"gold",name:"Gold",hex:"#eab308"},{id:"emerald",name:"Emerald",hex:"#10b981"},{id:"cyan",name:"Cyan",hex:"#0ea5e9"},{id:"violet",name:"Violet",hex:"#8b5cf6"},{id:"rose",name:"Rose",hex:"#ec4899"},{id:"silver",name:"Silver",hex:"#cbd5e1"}],Ct=new Map(nt.map(i=>[i.id,i.hex])),Bt=new Map(nt.map(i=>[i.hex.toLowerCase(),i.id])),xo=new Map(st.map(i=>[i.hex.toLowerCase(),i.name]));function Se(i){if(!i||typeof i!="string")return null;let r=i.trim().toLowerCase().replace(/^#/,"");return/^[0-9a-f]{3}$/.test(r)&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]),/^[0-9a-f]{6}$/.test(r)?`#${r}`:null}function ie({r:i,g:r,b:n}){let o=a=>b(Math.round(a),0,255).toString(16).padStart(2,"0");return`#${o(i)}${o(r)}${o(n)}`}function ee({h:i,s:r,l:n}){let o=(i%360+360)%360,a=(1-Math.abs(2*n-1))*r,$=a*(1-Math.abs(o/60%2-1)),d=n-a/2,l=0,s=0,f=0;return o<60?[l,s,f]=[a,$,0]:o<120?[l,s,f]=[$,a,0]:o<180?[l,s,f]=[0,a,$]:o<240?[l,s,f]=[0,$,a]:o<300?[l,s,f]=[$,0,a]:[l,s,f]=[a,0,$],{r:Math.round((l+d)*255),g:Math.round((s+d)*255),b:Math.round((f+d)*255)}}function at({r:i,g:r,b:n}){let o=i/255,a=r/255,$=n/255,d=Math.max(o,a,$),l=Math.min(o,a,$),s=d-l,f=(d+l)/2;if(s<1e-6)return{h:0,s:0,l:f};let u=s/(1-Math.abs(2*f-1)),h=0;return d===o?h=60*((a-$)/s%6):d===a?h=60*(($-o)/s+2):h=60*((o-a)/s+4),{h:(h+360)%360,s:u,l:f}}function De(i){let r=Se(i);if(r)return{r:parseInt(r.slice(1,3),16),g:parseInt(r.slice(3,5),16),b:parseInt(r.slice(5,7),16)};let n=(i||"").trim(),o=n.match(/^hsla?\(\s*([-\d.]+)(?:deg)?[\s,]+([\d.]+)%[\s,]+([\d.]+)%/i);if(o)return ee({h:parseFloat(o[1]),s:b(parseFloat(o[2])/100,0,1),l:b(parseFloat(o[3])/100,0,1)});let a=n.match(/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i);return a?{r:b(parseFloat(a[1]),0,255),g:b(parseFloat(a[2]),0,255),b:b(parseFloat(a[3]),0,255)}:{r:139,g:92,b:246}}function ft({r:i,g:r,b:n}){let o=a=>{let $=a/255;return $<=.04045?$/12.92:(($+.055)/1.055)**2.4};return .2126*o(i)+.7152*o(r)+.0722*o(n)}function Mt(i,r){return(Math.max(i,r)+.05)/(Math.min(i,r)+.05)}var po=ft({r:20,g:23,b:32}),ho=ft({r:244,g:247,b:251});function Ft(i){let r=ft(De(i));return r<.11||Mt(r,ho)>Mt(r,po)*1.45}function ze(i){if(!(!i||i==="auto"))return Ct.get(i)??Se(i)??void 0}function he(i){if(!i||i==="auto")return"auto";if(Ct.has(i))return i;let r=Se(i);return r?Bt.get(r)??r.slice(1):"auto"}function Xo(i){let r=Se(i);return r&&xo.get(r)||(r?r.toUpperCase():"Violet")}function qo(i){if(!i||i==="auto")return"Auto";let r=nt.find(o=>o.id===i);if(r)return r.name;let n=Se(i);if(n){let o=Bt.get(n);return o?nt.find(a=>a.id===o)?.name??n.toUpperCase():n.toUpperCase()}return"Auto"}function He(i){let{h:r,s:n,l:o}=at(De(i));return{lit:ie(ee({h:r,s:b(n*.9,0,1),l:b(o+.18,.22,.95)})),mid:i,shadow:ie(ee({h:r,s:b(n*1.05,0,1),l:b(o-.18,.04,.62)})),stripe:ie(ee({h:(r+34)%360,s:b(Math.max(n,.35),0,.85),l:b(o+.26,.52,.92)}))}}function Lt(i,r="clay"){let n=De(i),{h:o,s:a,l:$}=at(n),d=Ft(i),l=(h,x)=>{let g=(h-o+540)%360-180;return(o+g*x+360)%360},s=a>.08?l(52,.08):o,f=a>.08?l(242,.14):o,u=r==="gloss";return{highlight:ie(ee({h:s,s:b(a*.75,0,1),l:b($+(u?.36:.26),.48,.97)})),lit:ie(ee({h:s,s:b(a*.96,0,1),l:b($+(u?.18:.14),.28,.92)})),mid:ie(ee({h:o,s:b(a*1.04,0,1),l:b($,.14,.86)})),shadow:ie(ee({h:f,s:b(a*1.08,0,1),l:b($-(u?.24:.2),.06,.62)})),deepShadow:ie(ee({h:f,s:b(a*.95,0,1),l:b($-.3,.04,.48)})),rim:ie(ee({h:(o+18)%360,s:b(a*.65,0,1),l:b($+.22,.42,.94)})),eyeFill:d?"#f4f7fb":"#141720",eyeRecess:d?"rgba(255,255,255,0.22)":"rgba(255,255,255,0.28)",eyeSheen:d?"rgba(20,23,32,0.34)":"rgba(255,255,255,0.88)",edgeStroke:d?"rgba(255,255,255,0.18)":"rgba(15,18,28,0.15)",groundShadow:`rgba(${Math.round(n.r*.22)},${Math.round(n.g*.22)},${Math.round(n.b*.28)},0.26)`,specularOpacity:u?.68:.34,rimOpacity:u?.42:.28,isDarkBody:d}}function ht(i){return pt.includes(i)}function jo(i,r,n){let o=De(r),{h:a,s:$}=at(o),d=Ft(r),l=$<.12?350:(a+155)%360,s=ie(ee({h:l,s:.78,l:.5})),f=d?"#e6c370":"#3d271c";return i==="topper"?ht(n.topper)?f:n.topper==="crown"||n.topper==="halo"?"#f59e0b":n.topper==="cowboy"?"#8b4f24":n.topper==="tophat"?"#232938":n.topper==="wizard"?"#3b2d75":n.topper==="sprout"?"#22c55e":n.topper==="cat-ears"?r:s:i==="glasses"?n.glasses==="round"?"#1e2432":n.glasses==="shades"?"#0e1118":n.glasses==="visor"?"#38bdf8":n.glasses==="monocle"?"#f59e0b":s:i==="neck"?n.neck==="headphones"?"#1f2430":n.neck==="pearls"?"#f4f6fa":n.neck==="star-necklace"?"#f59e0b":s:i==="flair"?n.flair==="sparkle"?"#fde047":n.flair==="earrings"?"#f59e0b":n.flair==="blush"?"#fb7185":n.flair==="freckles"?d?"#f5d7af":"#8a4424":(ht(n.topper)?ze(n.topperColor):void 0)??f:s}function Et(i,r){let n=De(i),{h:o,s:a}=at(n),$=Ft(i),d=a<.12?350:(o+155)%360,l=ie(ee({h:d,s:.78,l:.5})),s=$?"#e6c370":"#3d271c",f=ze(r.topperColor),u=ze(r.glassesColor),h=ze(r.neckColor),x=ze(r.flairColor),g=ht(r.topper)?f:void 0,m=He(f??s),y=He(f??l),S=He(u??l),E=He(h??l),I=He(x??g??s);return{hairLit:m.lit,hairMid:m.mid,hairShadow:m.shadow,hatLit:y.lit,hatMid:y.mid,hatShadow:y.shadow,hatStripe:y.stripe,hasCustomTopperColor:!!f,glassesLit:S.lit,glassesMid:S.mid,glassesShadow:S.shadow,hasCustomGlassesColor:!!u,neckLit:E.lit,neckMid:E.mid,neckShadow:E.shadow,neckStripe:E.stripe,hasCustomNeckColor:!!h,flairLit:I.lit,flairMid:I.mid,flairShadow:I.shadow,hasCustomFlairColor:!!x,innerEar:"rgba(255,138,174,0.56)",freckle:x?I.mid:$?"rgba(245,215,175,0.68)":"rgba(138,68,36,0.65)",goldLit:"#fde047",goldShadow:"#ca8a04"}}var fo=85,Fo=1.55,Tt=.55;function Ae(i){let r=2166136261;for(let n=0;n<i.length;n++)r^=i.charCodeAt(n),r=Math.imul(r,16777619);return r>>>0}function Ko(i){return Ae(i||"botling")%1e3/100}function At(i){let r=Math.hypot(i.dx,i.dy),n=Math.max(8,i.radius),o=Be(r/(n*Tt)),a=.35+.65*Be(r/Math.max(n*3.2,64)),$=b(i.gain??1,0,1)*o*a,d=r>1e-4?i.dx/r*$:0,l=r>1e-4?i.dy/r*$:0,f=Math.hypot(d-i.prevX,l-i.prevY)>Fo,u=f?1:1-Math.exp(-Math.max(1,i.dtMs)/fo);return{x:i.prevX+(d-i.prevX)*u,y:i.prevY+(l-i.prevY)*u,tx:d,ty:l,snapped:f}}function Pt(i,r){let n=r.x-i.cx,o=r.y-i.cy,a=Math.hypot(n,o),$=Math.max(8,i.radius),d=Be(a/($*Tt)),l=.35+.65*Be(a/Math.max($*3.2,64)),s=d*l;return a>1e-4?{x:n/a*s,y:o/a*s}:{x:0,y:0}}function It(i,r,n=4.3){let o=((i+r*1.7)%n+n)%n,a=.16;if(o>=a)return 1;let $=o/a;return .08+.92*(.5+.5*Math.cos($*Math.PI*2))}function _t(i,r){let n=i+r*2.3,o=Math.sin(n*.42)*.5+Math.sin(n*.19+1.4)*.5,a=Math.sin(n*.31+.8)*.35;return{x:b(o*.48,-.55,.55),y:b(a*.38,-.35,.35)}}function Yt(i,r){let n=9.8+r%3.5,o=i+r*2.1,a=(o%n+n)%n;if(a>=1.65)return null;let $=["wink","curious","happy","sleepy"],d=$[Math.abs(Math.floor(o/n))%$.length],l=Math.sin(a/1.65*Math.PI);return{kind:d,strength:l*l}}var Rt=/^[a-z0-9][a-z0-9-]{0,31}$/,Nt=/^@([a-z0-9][a-z0-9-]{0,31})\/([a-z0-9][a-z0-9-]{0,31})$/,Pe=new Map;function Gt(i){return Nt.test(i)}function uo(i){let r=Nt.exec(i);return r?{packId:r[1],itemId:r[2]}:null}function yo(i,r){return`@${i}/${r}`}function ei(i){if(!Rt.test(i.id))throw new Error(`Invalid Botlings pack id "${i.id}". Use lowercase alphanumeric + hyphens.`);for(let r of i.items)if(!Rt.test(r.id))throw new Error(`Invalid item id "${r.id}" in pack "${i.id}".`);Pe.set(i.id,i)}function ti(i){return Pe.delete(i)}function oi(){Pe.clear()}function ii(i){return Pe.get(i)}function ri(){return Array.from(Pe.values())}function Ie(i,r){let n=uo(r);if(!n)return;let o=Pe.get(n.packId);if(o)return o.items.find(a=>a.slot===i&&a.id===n.itemId)}function ni(i){let r=[];for(let n of Pe.values())for(let o of n.items)o.slot===i&&r.push({token:yo(n.id,o.id),pack:n,item:o});return r}var ut=new Set(Re),Ot=new Set(mt),vt=new Set(Ue),Qt=new Set(bt),Zt=new Set(Ke),Ht=new Set(Je),zt=new Set(et),Dt=new Set(tt);function we(i,r){return typeof i=="string"&&(r.has(i)||Gt(i))}function Ve(i,r,n){let o=typeof i=="number"?i:Number(i);return Number.isFinite(o)?r[Le(o,r)]:n}function Xe(i){let r=i&&typeof i=="object"?i:{},n=typeof r.variant=="string"&&ut.has(r.variant)?r.variant:pe.variant,o=r.finish==="gloss"?"gloss":"clay",a=(typeof r.color=="string"?Se(r.color):null)??pe.color,$=Ve(r.eyeSize,ge,me),d=typeof r.eyeShape=="string"&&vt.has(r.eyeShape)?r.eyeShape:pe.eyeShape,l=typeof r.feeling=="string"&&Qt.has(r.feeling)?r.feeling:pe.feeling;return{variant:n,finish:o,color:a,eyeSize:$,eyeShape:d,feeling:l,topper:we(r.topper,Zt)?r.topper:"",topperColor:typeof r.topperColor=="string"?he(r.topperColor):"auto",topperScale:Ve(r.topperScale,N,j),glasses:we(r.glasses,Ht)?r.glasses:"",glassesColor:typeof r.glassesColor=="string"?he(r.glassesColor):"auto",glassesScale:Ve(r.glassesScale,N,j),neck:we(r.neck,zt)?r.neck:"",neckColor:typeof r.neckColor=="string"?he(r.neckColor):"auto",neckScale:Ve(r.neckScale,N,j),flair:we(r.flair,Dt)?r.flair:"",flairColor:typeof r.flairColor=="string"?he(r.flairColor):"auto",flairScale:Ve(r.flairScale,N,j)}}function xi(i){if(!i||typeof i!="string")return!1;let n=i.trim().replace(/^(?:v1:|botling:)/,"").split(":");return n.length>=2&&ut.has(n[0])&&Ot.has(n[1])}function Vt(i,r={}){let n=Xe(i),o=[];return n.eyeSize!==me&&o.push(`e=${n.eyeSize}`),n.eyeShape!=="pill"&&o.push(`es=${n.eyeShape}`),n.feeling!=="auto"&&o.push(`em=${n.feeling}`),n.topper&&(o.push(`t=${n.topper}`),n.topperColor!=="auto"&&o.push(`tc=${n.topperColor}`),n.topperScale!==j&&o.push(`ts=${n.topperScale}`)),n.glasses&&(o.push(`g=${n.glasses}`),n.glassesColor!=="auto"&&o.push(`gc=${n.glassesColor}`),n.glassesScale!==j&&o.push(`gs=${n.glassesScale}`)),n.neck&&(o.push(`n=${n.neck}`),n.neckColor!=="auto"&&o.push(`nc=${n.neckColor}`),n.neckScale!==j&&o.push(`ns=${n.neckScale}`)),n.flair&&(o.push(`f=${n.flair}`),n.flairColor!=="auto"&&o.push(`fc=${n.flairColor}`),n.flairScale!==j&&o.push(`fs=${n.flairScale}`)),o.push(`c=${n.color.slice(1)}`),`${r.versionPrefix!==!1?"v1:":""}${n.variant}:${n.finish}:${o.join(",")}`}function go(i){if(!i||typeof i!="string")return null;let n=i.trim().replace(/^(?:v1:|botling:)/,"").split(":");if(n.length<2||!ut.has(n[0])||!Ot.has(n[1]))return null;let o={...pe,variant:n[0],finish:n[1]==="gloss"?"gloss":"clay"},a=n[2]??"";if(a)for(let $ of a.split(",")){let d=$.indexOf("=");if(d<=0)continue;let l=$.slice(0,d),s=$.slice(d+1);if(s)switch(l){case"e":{let f=Number(s);Number.isFinite(f)&&(o.eyeSize=ge[Le(f,ge)]);break}case"es":vt.has(s)&&(o.eyeShape=s);break;case"em":Qt.has(s)&&(o.feeling=s);break;case"c":{let f=Se(s);f&&(o.color=f);break}case"t":we(s,Zt)&&(o.topper=s);break;case"tc":o.topperColor=he(s);break;case"ts":{let f=Number(s);Number.isFinite(f)&&(o.topperScale=N[Le(f,N)]);break}case"g":we(s,Ht)&&(o.glasses=s);break;case"gc":o.glassesColor=he(s);break;case"gs":{let f=Number(s);Number.isFinite(f)&&(o.glassesScale=N[Le(f,N)]);break}case"n":we(s,zt)&&(o.neck=s);break;case"nc":o.neckColor=he(s);break;case"ns":{let f=Number(s);Number.isFinite(f)&&(o.neckScale=N[Le(f,N)]);break}case"f":we(s,Dt)&&(o.flair=s);break;case"fc":o.flairColor=he(s);break;case"fs":{let f=Number(s);Number.isFinite(f)&&(o.flairScale=N[Le(f,N)]);break}}}return o}function mo(i){let r=(i||"botling").trim().toLowerCase(),n=Ae(r),o=Ae(`${r}:style`),a=Ae(`${r}:gear`),$=Re[n%Re.length],d=st[(n>>>4)%(st.length-1)].hex,l=(o&3)===0?"gloss":"clay",s=Ue[(o>>>2)%Ue.length],f=(a&7)<5?Ke[(a>>>3)%Ke.length]:"",u=(a>>>8)%3===0?Je[(a>>>10)%Je.length]:"",h=(a>>>14)%3===0?et[(a>>>16)%et.length]:"",x=(a>>>20)%4===0?tt[(a>>>22)%tt.length]:"";return{...pe,variant:$,finish:l,color:d,eyeShape:s,topper:f,glasses:u,neck:h,flair:x}}function Xt(i){return typeof i=="string"?go(i)??mo(i):Xe(i)}function te(i,r){return i&&r?`<g transform="${r}">${i}</g>`:i}function qt(i,r,n,o){let a=Te(i.variant),$=a.crownScale,d=a.crownY,l=a.sideRx,s=a.chinY,f=Ee(i.eyeSize),u=a.eyeSep*f.sep,h=a.eyeY,x=Math.min(u*.92,Math.max(3.6,Math.min(6.4,a.eyeH*f.h*.58))),g=22-u,m=22+u,y=Math.min(s-2.4,h+a.eyeH*f.h*.56+1.8),S={metrics:a,eyeSep:u,eyeY:h,lensR:x,cheekY:y,uid:r},E=i.topperScale||1,I=i.glassesScale||1,G=i.neckScale||1,C=i.flairScale||1,_=ae(22,d+2,E),w=ae(22,h,I),T=ae(22,i.neck==="headphones"?a.earY:s,G),V=i.flair==="beard"||i.flair==="goatee"||i.flair==="long-beard"?s-1.5:y+1,Q=ae(22,V,C),re=ae(22+l+1.2,d+5.3,C),A=`url(#hr-${r})`,B=`url(#ht-${r})`,oe=`url(#gl-${r})`,O=`url(#nk-${r})`,v=`url(#fl-${r})`,Z=`url(#gd-${r})`,fe=`url(#lt-${r})`,le=`url(#ln-${r})`,$e=`url(#pr-${r})`,t=c=>(22+c*$).toFixed(2),e=c=>(d+c).toFixed(2),U="",X="",Me="",Ce="";if(i.neck==="headphones"){let c=o.hasCustomNeckColor?o.neckShadow:"#242936",p=o.hasCustomNeckColor?o.neckLit:"#94a3b8";U=`<path d="M${(22-l-1.2).toFixed(1)} ${(a.earY-1).toFixed(1)} C${(22-l-2).toFixed(1)} ${(d-7.4).toFixed(1)} ${(22+l+2).toFixed(1)} ${(d-7.4).toFixed(1)} ${(22+l+1.2).toFixed(1)} ${(a.earY-1).toFixed(1)}" fill="none" stroke="${c}" stroke-linecap="round" stroke-width="3.5"/><path d="M${(22-l*.55).toFixed(1)} ${(d-4.1).toFixed(1)} Q22 ${(d-6.8).toFixed(1)} ${(22+l*.55).toFixed(1)} ${(d-4.1).toFixed(1)}" fill="none" opacity="0.7" stroke="${p}" stroke-linecap="round" stroke-width="1.15"/>`}if(i.topper==="bob"&&(X+=`<path d="M22 ${(d-4.2).toFixed(1)} C${(22-l*.86).toFixed(1)} ${(d-4.2).toFixed(1)} ${(22-l-2.6).toFixed(1)} ${(d+4.4).toFixed(1)} ${(22-l-2.5).toFixed(1)} ${(a.earY+3).toFixed(1)} C${(22-l-2.3).toFixed(1)} ${(s-3.2).toFixed(1)} ${(22-l+.8).toFixed(1)} ${(s+.4).toFixed(1)} ${(22-l+4.4).toFixed(1)} ${(s-.8).toFixed(1)} L${(22+l-4.4).toFixed(1)} ${(s-.8).toFixed(1)} C${(22+l-.8).toFixed(1)} ${(s+.4).toFixed(1)} ${(22+l+2.3).toFixed(1)} ${(s-3.2).toFixed(1)} ${(22+l+2.5).toFixed(1)} ${(a.earY+3).toFixed(1)} C${(22+l+2.6).toFixed(1)} ${(d+4.4).toFixed(1)} ${(22+l*.86).toFixed(1)} ${(d-4.2).toFixed(1)} 22 ${(d-4.2).toFixed(1)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-linejoin="round" stroke-width="0.6"/>`),i.topper==="pigtails"&&(X+=`<path d="M${(22-l*.72).toFixed(1)} ${(d+2.6).toFixed(1)} C${(22-l-5.4).toFixed(1)} ${(d+.8).toFixed(1)} ${(22-l-7.6).toFixed(1)} ${(a.earY+3.6).toFixed(1)} ${(22-l-4.4).toFixed(1)} ${(a.earY+8.6).toFixed(1)} C${(22-l-2.4).toFixed(1)} ${(a.earY+10.2).toFixed(1)} ${(22-l+.6).toFixed(1)} ${(a.earY+7.2).toFixed(1)} ${(22-l-.2).toFixed(1)} ${(a.earY+3.6).toFixed(1)} C${(22-l*.7).toFixed(1)} ${(d+6.4).toFixed(1)} ${(22-l*.62).toFixed(1)} ${(d+5).toFixed(1)} ${(22-l*.72).toFixed(1)} ${(d+2.6).toFixed(1)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${(22+l*.72).toFixed(1)} ${(d+2.6).toFixed(1)} C${(22+l+5.4).toFixed(1)} ${(d+.8).toFixed(1)} ${(22+l+7.6).toFixed(1)} ${(a.earY+3.6).toFixed(1)} ${(22+l+4.4).toFixed(1)} ${(a.earY+8.6).toFixed(1)} C${(22+l+2.4).toFixed(1)} ${(a.earY+10.2).toFixed(1)} ${(22+l-.6).toFixed(1)} ${(a.earY+7.2).toFixed(1)} ${(22+l+.2).toFixed(1)} ${(a.earY+3.6).toFixed(1)} C${(22+l*.7).toFixed(1)} ${(d+6.4).toFixed(1)} ${(22+l*.62).toFixed(1)} ${(d+5).toFixed(1)} ${(22+l*.72).toFixed(1)} ${(d+2.6).toFixed(1)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><ellipse cx="${(22-l*.84).toFixed(1)}" cy="${(d+3.6).toFixed(1)}" rx="2.3" ry="1.5" fill="${B}" stroke="${o.hatShadow}" stroke-width="0.4" transform="rotate(-25 ${(22-l*.84).toFixed(1)} ${(d+3.6).toFixed(1)})"/><ellipse cx="${(22+l*.84).toFixed(1)}" cy="${(d+3.6).toFixed(1)}" rx="2.3" ry="1.5" fill="${B}" stroke="${o.hatShadow}" stroke-width="0.4" transform="rotate(25 ${(22+l*.84).toFixed(1)} ${(d+3.6).toFixed(1)})"/>`),i.topper==="ponytail"&&(X+=`<path d="M${(22+6.4*$).toFixed(1)} ${(d+.4).toFixed(1)} C${(22+15.6*$).toFixed(1)} ${(d-5.2).toFixed(1)} ${(22+l+7.6).toFixed(1)} ${(d+5.6).toFixed(1)} ${(22+l+3.8).toFixed(1)} ${(a.earY+8.6).toFixed(1)} C${(22+l+1.2).toFixed(1)} ${(a.earY+9.4).toFixed(1)} ${(22+l+.2).toFixed(1)} ${(a.earY+4.8).toFixed(1)} ${(22+l+1.4).toFixed(1)} ${(a.earY+.2).toFixed(1)} C${(22+10.6*$).toFixed(1)} ${(d+1.6).toFixed(1)} ${(22+8.4*$).toFixed(1)} ${(d+2.6).toFixed(1)} ${(22+6.4*$).toFixed(1)} ${(d+2.8).toFixed(1)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><ellipse cx="${(22+7.8*$).toFixed(1)}" cy="${(d+1).toFixed(1)}" rx="2.5" ry="1.6" fill="${B}" stroke="${o.hatShadow}" stroke-width="0.4" transform="rotate(30 ${(22+7.8*$).toFixed(1)} ${(d+1).toFixed(1)})"/>`),i.topper==="bow-hair"&&(X+=`<path d="M22 ${(d-3.6).toFixed(1)} C${(22-l*.92).toFixed(1)} ${(d-3.6).toFixed(1)} ${(22-l-2.2).toFixed(1)} ${(d+4.2).toFixed(1)} ${(22-l-1.8).toFixed(1)} ${(a.earY+4.4).toFixed(1)} C${(22-l-1).toFixed(1)} ${(a.earY+8.2).toFixed(1)} ${(22-l+3.2).toFixed(1)} ${(a.earY+7.6).toFixed(1)} ${(22-l+5).toFixed(1)} ${(a.earY+4.8).toFixed(1)} L${(22+l-5).toFixed(1)} ${(a.earY+4.8).toFixed(1)} C${(22+l-3.2).toFixed(1)} ${(a.earY+7.6).toFixed(1)} ${(22+l+1).toFixed(1)} ${(a.earY+8.2).toFixed(1)} ${(22+l+1.8).toFixed(1)} ${(a.earY+4.4).toFixed(1)} C${(22+l+2.2).toFixed(1)} ${(d+4.2).toFixed(1)} ${(22+l*.92).toFixed(1)} ${(d-3.6).toFixed(1)} 22 ${(d-3.6).toFixed(1)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-linejoin="round" stroke-width="0.58"/>`),i.topper==="updo"&&(X+=`<path d="M22 ${(d-3.2).toFixed(1)} C${(22-l*.84).toFixed(1)} ${(d-3).toFixed(1)} ${(22-l-.9).toFixed(1)} ${(d+3.8).toFixed(1)} ${(22-l+.6).toFixed(1)} ${(d+8.4).toFixed(1)} L${(22+l-.6).toFixed(1)} ${(d+8.4).toFixed(1)} C${(22+l+.9).toFixed(1)} ${(d+3.8).toFixed(1)} ${(22+l*.84).toFixed(1)} ${(d-3).toFixed(1)} 22 ${(d-3.2).toFixed(1)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/>`),i.topper==="cat-ears"){let c=o.hasCustomTopperColor?o.hatMid:n.mid,p=o.hasCustomTopperColor?o.hatShadow:n.shadow;X+=`<path d="M${(22-10.8*$).toFixed(1)} ${(d+5.8).toFixed(1)} L${(22-12*$).toFixed(1)} ${(d-5.2).toFixed(1)} Q${(22-11.8*$).toFixed(1)} ${(d-6.8).toFixed(1)} ${(22-10.2*$).toFixed(1)} ${(d-5.8).toFixed(1)} L${(22-2.8*$).toFixed(1)} ${(d+.8).toFixed(1)} Z" fill="${c}" stroke="${n.edgeStroke}" stroke-width="0.75"/><path d="M${(22-9.8*$).toFixed(1)} ${(d+3.4).toFixed(1)} L${(22-10.5*$).toFixed(1)} ${(d-3.2).toFixed(1)} L${(22-5*$).toFixed(1)} ${(d+1).toFixed(1)} Z" fill="${o.innerEar}"/><path d="M${(22+10.8*$).toFixed(1)} ${(d+5.8).toFixed(1)} L${(22+12*$).toFixed(1)} ${(d-5.2).toFixed(1)} Q${(22+11.8*$).toFixed(1)} ${(d-6.8).toFixed(1)} ${(22+10.2*$).toFixed(1)} ${(d-5.8).toFixed(1)} L${(22+2.8*$).toFixed(1)} ${(d+.8).toFixed(1)} Z" fill="${p}" stroke="${n.edgeStroke}" stroke-width="0.75"/><path d="M${(22+9.8*$).toFixed(1)} ${(d+3.4).toFixed(1)} L${(22+10.5*$).toFixed(1)} ${(d-3.2).toFixed(1)} L${(22+5*$).toFixed(1)} ${(d+1).toFixed(1)} Z" fill="${o.innerEar}"/>`}let M="",Y=!1;if(i.flair==="freckles")M=`<g fill="${o.freckle}" opacity="${o.hasCustomFlairColor?.78:1}"><circle cx="${(22-u-3.2).toFixed(2)}" cy="${(y-.3).toFixed(2)}" r="0.95"/><circle cx="${(22-u-1.1).toFixed(2)}" cy="${(y+.7).toFixed(2)}" r="0.85"/><circle cx="${(22-u-4.1).toFixed(2)}" cy="${(y+1.4).toFixed(2)}" r="0.78"/><circle cx="${(22+u+3.2).toFixed(2)}" cy="${(y-.3).toFixed(2)}" r="0.95"/><circle cx="${(22+u+1.1).toFixed(2)}" cy="${(y+.7).toFixed(2)}" r="0.85"/><circle cx="${(22+u+4.1).toFixed(2)}" cy="${(y+1.4).toFixed(2)}" r="0.78"/></g>`;else if(i.flair==="blush"){let c=o.hasCustomFlairColor?o.flairMid:"#fb7185",p=o.hasCustomFlairColor?o.flairLit:"#ffe4e6",F=22-u-2.6,k=22+u+2.6,P=y+.2;M=`<g opacity="0.62"><ellipse cx="${F.toFixed(2)}" cy="${P.toFixed(2)}" rx="3.0" ry="1.65" fill="${c}"/><ellipse cx="${k.toFixed(2)}" cy="${P.toFixed(2)}" rx="3.0" ry="1.65" fill="${c}"/></g><g stroke="${p}" stroke-linecap="round" stroke-width="0.65" opacity="0.55"><line x1="${(F-1).toFixed(2)}" y1="${(P+.4).toFixed(2)}" x2="${(F-.2).toFixed(2)}" y2="${(P-.5).toFixed(2)}"/><line x1="${(F+.4).toFixed(2)}" y1="${(P+.5).toFixed(2)}" x2="${(F+1.2).toFixed(2)}" y2="${(P-.4).toFixed(2)}"/><line x1="${(k-1.2).toFixed(2)}" y1="${(P+.4).toFixed(2)}" x2="${(k-.4).toFixed(2)}" y2="${(P-.5).toFixed(2)}"/><line x1="${(k+.2).toFixed(2)}" y1="${(P+.5).toFixed(2)}" x2="${(k+1).toFixed(2)}" y2="${(P-.4).toFixed(2)}"/></g>`}else if(i.flair==="earrings"){let c=22-l-.4,p=22+l+.4,F=a.earY+1.6,k=ae(c,F,C),P=ae(p,F,C),z=o.hasCustomFlairColor?o.flairMid:"#f59e0b",R=o.hasCustomFlairColor?o.flairShadow:"#b45309",W=o.hasCustomFlairColor?v:$e,q=D=>`<circle cx="${D.toFixed(2)}" cy="${(F-.8).toFixed(2)}" r="1.15" fill="${z}" stroke="${R}" stroke-width="0.45"/><circle cx="${D.toFixed(2)}" cy="${(F+1.2).toFixed(2)}" r="1.45" fill="none" stroke="${z}" stroke-width="0.85"/><path d="M${D.toFixed(2)} ${(F+1.8).toFixed(2)} C${(D-1.8).toFixed(2)} ${(F+3.6).toFixed(2)} ${(D-1.6).toFixed(2)} ${(F+5.8).toFixed(2)} ${D.toFixed(2)} ${(F+6).toFixed(2)} C${(D+1.6).toFixed(2)} ${(F+5.8).toFixed(2)} ${(D+1.8).toFixed(2)} ${(F+3.6).toFixed(2)} ${D.toFixed(2)} ${(F+1.8).toFixed(2)} Z" fill="${W}" stroke="${R}" stroke-width="0.45"/><circle cx="${(D-.45).toFixed(2)}" cy="${(F+3.8).toFixed(2)}" r="0.45" fill="#fff" opacity="0.85"/>`;M=te(q(c),k)+te(q(p),P),Y=!0}else if(i.flair==="mustache")M=`<path d="M22 ${(y+.6).toFixed(2)} C20.2 ${(y-2).toFixed(2)} 16 ${(y-1.4).toFixed(2)} 14 ${(y+1).toFixed(2)} C12.8 ${(y+2.2).toFixed(2)} 11.4 ${(y+1.2).toFixed(2)} 11.8 ${(y-.4).toFixed(2)} C10.8 ${(y+1.6).toFixed(2)} 12.2 ${(y+4).toFixed(2)} 14.8 ${(y+3.4).toFixed(2)} C17.8 ${(y+2.8).toFixed(2)} 20.6 ${(y+2.6).toFixed(2)} 22 ${(y+1.8).toFixed(2)} Z" fill="${v}" stroke="${o.flairShadow}" stroke-width="0.5"/><path d="M22 ${(y+.6).toFixed(2)} C23.8 ${(y-2).toFixed(2)} 28 ${(y-1.4).toFixed(2)} 30 ${(y+1).toFixed(2)} C31.2 ${(y+2.2).toFixed(2)} 32.6 ${(y+1.2).toFixed(2)} 32.2 ${(y-.4).toFixed(2)} C33.2 ${(y+1.6).toFixed(2)} 31.8 ${(y+4).toFixed(2)} 29.2 ${(y+3.4).toFixed(2)} C26.2 ${(y+2.8).toFixed(2)} 23.4 ${(y+2.6).toFixed(2)} 22 ${(y+1.8).toFixed(2)} Z" fill="${v}" stroke="${o.flairShadow}" stroke-width="0.5"/><path d="M15.8 ${(y+.6).toFixed(2)} Q18.4 ${(y-.6).toFixed(2)} 20.6 ${(y+.6).toFixed(2)} M23.4 ${(y+.6).toFixed(2)} Q25.6 ${(y-.6).toFixed(2)} 28.2 ${(y+.6).toFixed(2)}" fill="none" opacity="0.45" stroke="${o.flairLit}" stroke-linecap="round" stroke-width="0.75"/>`;else if(i.flair==="beard"){let c=l*.78,p=Math.min(s-5.4,Math.max(y-.4,h+3.8)),F=s+2.5;M=`<path d="M${(22-c).toFixed(2)} ${p.toFixed(2)} C${(22-c*1.04).toFixed(2)} ${(p+5.4).toFixed(2)} ${(22-c*.64).toFixed(2)} ${(F+.5).toFixed(2)} 22 ${(F+.9).toFixed(2)} C${(22+c*.64).toFixed(2)} ${(F+.5).toFixed(2)} ${(22+c*1.04).toFixed(2)} ${(p+5.4).toFixed(2)} ${(22+c).toFixed(2)} ${p.toFixed(2)} C${(22+c*.72).toFixed(2)} ${(p+3.1).toFixed(2)} ${(22+c*.38).toFixed(2)} ${(p+3.2).toFixed(2)} ${(22+c*.16).toFixed(2)} ${(p+1.4).toFixed(2)} Q22 ${(p+.6).toFixed(2)} ${(22-c*.16).toFixed(2)} ${(p+1.4).toFixed(2)} C${(22-c*.38).toFixed(2)} ${(p+3.2).toFixed(2)} ${(22-c*.72).toFixed(2)} ${(p+3.1).toFixed(2)} ${(22-c).toFixed(2)} ${p.toFixed(2)} Z" fill="${v}" stroke="${o.flairShadow}" stroke-linejoin="round" stroke-width="0.55"/><path d="M${(22-c*.58).toFixed(2)} ${(p+4.2).toFixed(2)} Q${(22-c*.26).toFixed(2)} ${(F-1.6).toFixed(2)} 22 ${(F-1.1).toFixed(2)}" fill="none" opacity="0.42" stroke="${o.flairLit}" stroke-linecap="round" stroke-width="0.95"/><path d="M19.4 ${(p+4.2).toFixed(2)} Q22 ${(p+5.6).toFixed(2)} 24.6 ${(p+4.2).toFixed(2)}" fill="none" opacity="0.52" stroke="${o.flairShadow}" stroke-linecap="round" stroke-width="1.05"/>`}else if(i.flair==="goatee"){let c=Math.min(s-4.4,Math.max(y+.6,h+4.2));M=`<path d="M22 ${(c+.2).toFixed(2)} C20.1 ${(c-1.1).toFixed(2)} 17.6 ${(c-.4).toFixed(2)} 16.9 ${(c+1.1).toFixed(2)} C18.3 ${(c+1.7).toFixed(2)} 20.5 ${(c+1.3).toFixed(2)} 22 ${(c+.9).toFixed(2)} C23.5 ${(c+1.3).toFixed(2)} 25.7 ${(c+1.7).toFixed(2)} 27.1 ${(c+1.1).toFixed(2)} C26.4 ${(c-.4).toFixed(2)} 23.9 ${(c-1.1).toFixed(2)} 22 ${(c+.2).toFixed(2)} Z" fill="${v}" stroke="${o.flairShadow}" stroke-linejoin="round" stroke-width="0.48"/><path d="M17.5 ${(s-2.2).toFixed(2)} Q22 ${(s-.3).toFixed(2)} 26.5 ${(s-2.2).toFixed(2)} C26.8 ${(s+1.1).toFixed(2)} 24.7 ${(s+3.2).toFixed(2)} 22 ${(s+3.6).toFixed(2)} C19.3 ${(s+3.2).toFixed(2)} 17.2 ${(s+1.1).toFixed(2)} 17.5 ${(s-2.2).toFixed(2)} Z" fill="${v}" stroke="${o.flairShadow}" stroke-linejoin="round" stroke-width="0.52"/><path d="M19.6 ${(s-.3).toFixed(2)} Q21.6 ${(s+1.8).toFixed(2)} 22.8 ${(s+1.6).toFixed(2)}" fill="none" opacity="0.46" stroke="${o.flairLit}" stroke-linecap="round" stroke-width="0.85"/>`}else if(i.flair==="long-beard"){let c=l*.74,p=Math.min(s-5,Math.max(y-.2,h+3.8)),F=s+8.2;M=`<path d="M${(22-c).toFixed(2)} ${p.toFixed(2)} C${(22-c*1.08).toFixed(2)} ${(s-.6).toFixed(2)} ${(22-c*.74).toFixed(2)} ${(s+4.8).toFixed(2)} 19.6 ${(s+7).toFixed(2)} Q21.5 ${(F+.5).toFixed(2)} 22.9 ${F.toFixed(2)} C25.2 ${(s+6.8).toFixed(2)} ${(22+c*.76).toFixed(2)} ${(s+4.6).toFixed(2)} ${(22+c*1.06).toFixed(2)} ${(s-.6).toFixed(2)} C${(22+c*1.04).toFixed(2)} ${(p+2.4).toFixed(2)} ${(22+c).toFixed(2)} ${(p+.5).toFixed(2)} ${(22+c).toFixed(2)} ${p.toFixed(2)} C${(22+c*.68).toFixed(2)} ${(p+2.9).toFixed(2)} ${(22+c*.32).toFixed(2)} ${(p+2.8).toFixed(2)} 22 ${(p+1.2).toFixed(2)} C${(22-c*.32).toFixed(2)} ${(p+2.8).toFixed(2)} ${(22-c*.68).toFixed(2)} ${(p+2.9).toFixed(2)} ${(22-c).toFixed(2)} ${p.toFixed(2)} Z" fill="${v}" stroke="${o.flairShadow}" stroke-linejoin="round" stroke-width="0.55"/><path d="M${(22-c*.44).toFixed(2)} ${(p+3.8).toFixed(2)} Q${(22-c*.36).toFixed(2)} ${(s+2.4).toFixed(2)} 20.6 ${(s+5.6).toFixed(2)} M${(22+c*.36).toFixed(2)} ${(p+4.2).toFixed(2)} Q${(22+c*.26).toFixed(2)} ${(s+2.6).toFixed(2)} 23.4 ${(s+5.4).toFixed(2)}" fill="none" opacity="0.42" stroke="${o.flairLit}" stroke-linecap="round" stroke-width="0.9"/><path d="M18.6 ${(p+3.4).toFixed(2)} Q22 ${(p+5.2).toFixed(2)} 25.4 ${(p+3.4).toFixed(2)}" fill="none" opacity="0.45" stroke="${o.flairShadow}" stroke-linecap="round" stroke-width="1.0"/>`}else if(i.flair==="sideburns"){let c=22-l*.96,p=22+l*.96,F=Math.max(d+4.2,a.earY-5.2),k=Math.min(s-1,a.earY+7.6),P=ae(c+2.2,a.earY+1,C),z=ae(p-2.2,a.earY+1,C),R=`<path d="M${(c-.8).toFixed(2)} ${F.toFixed(2)} C${(c-1.9).toFixed(2)} ${(a.earY+1).toFixed(2)} ${(c-1.4).toFixed(2)} ${(k-1.4).toFixed(2)} ${(c+.2).toFixed(2)} ${(k+.3).toFixed(2)} Q${(c+3.2).toFixed(2)} ${(k+2.1).toFixed(2)} ${(c+7).toFixed(2)} ${(k-1).toFixed(2)} C${(c+5.4).toFixed(2)} ${(k-3.8).toFixed(2)} ${(c+3.8).toFixed(2)} ${(a.earY-.8).toFixed(2)} ${(c+4).toFixed(2)} ${(F-.8).toFixed(2)} Q${(c+1.4).toFixed(2)} ${(F-1.9).toFixed(2)} ${(c-.8).toFixed(2)} ${F.toFixed(2)} Z" fill="${v}" stroke="${o.flairShadow}" stroke-linejoin="round" stroke-width="0.55"/><path d="M${(c+1.1).toFixed(2)} ${(F+1.2).toFixed(2)} Q${(c+1).toFixed(2)} ${(a.earY+2.4).toFixed(2)} ${(c+4).toFixed(2)} ${(k-1.2).toFixed(2)}" fill="none" opacity="0.55" stroke="${o.flairLit}" stroke-linecap="round" stroke-width="0.95"/>`,W=`<path d="M${(p+.8).toFixed(2)} ${F.toFixed(2)} C${(p+1.9).toFixed(2)} ${(a.earY+1).toFixed(2)} ${(p+1.4).toFixed(2)} ${(k-1.4).toFixed(2)} ${(p-.2).toFixed(2)} ${(k+.3).toFixed(2)} Q${(p-3.2).toFixed(2)} ${(k+2.1).toFixed(2)} ${(p-7).toFixed(2)} ${(k-1).toFixed(2)} C${(p-5.4).toFixed(2)} ${(k-3.8).toFixed(2)} ${(p-3.8).toFixed(2)} ${(a.earY-.8).toFixed(2)} ${(p-4).toFixed(2)} ${(F-.8).toFixed(2)} Q${(p-1.4).toFixed(2)} ${(F-1.9).toFixed(2)} ${(p+.8).toFixed(2)} ${F.toFixed(2)} Z" fill="${v}" stroke="${o.flairShadow}" stroke-linejoin="round" stroke-width="0.55"/><path d="M${(p-1.1).toFixed(2)} ${(F+1.2).toFixed(2)} Q${(p-1).toFixed(2)} ${(a.earY+2.4).toFixed(2)} ${(p-4).toFixed(2)} ${(k-1.2).toFixed(2)}" fill="none" opacity="0.55" stroke="${o.flairLit}" stroke-linecap="round" stroke-width="0.95"/>`;M=te(R,P)+te(W,z),Y=!0}else if(i.flair==="sparkle"){let c=o.hasCustomFlairColor?o.flairLit:o.goldLit,p=o.hasCustomFlairColor?o.flairShadow:o.goldShadow;M=`<g fill="${c}" stroke="${p}" stroke-width="0.35"><path d="M${(22+l+1.2).toFixed(1)} ${(d+2).toFixed(1)} L${(22+l+2.1).toFixed(1)} ${(d+4.4).toFixed(1)} L${(22+l+4.5).toFixed(1)} ${(d+5.3).toFixed(1)} L${(22+l+2.1).toFixed(1)} ${(d+6.2).toFixed(1)} L${(22+l+1.2).toFixed(1)} ${(d+8.6).toFixed(1)} L${(22+l+.3).toFixed(1)} ${(d+6.2).toFixed(1)} L${(22+l-2.1).toFixed(1)} ${(d+5.3).toFixed(1)} L${(22+l+.3).toFixed(1)} ${(d+4.4).toFixed(1)} Z"/><circle cx="${(22+l-1.8).toFixed(1)}" cy="${(d+1.6).toFixed(1)}" r="0.95" stroke="none"/></g>`}else if(i.flair){let c=Ie("flair",i.flair);if(c){let p=c.draw(S,n,o);p.back&&(Me+=p.back),p.front&&(M=p.front)}}let ne="",Fe=o.hasCustomGlassesColor?o.glassesMid:"#1e2432",se=o.hasCustomGlassesColor?o.glassesMid:"#0e1118",ce=o.hasCustomGlassesColor?o.glassesLit:"#cbd5e1";if(i.glasses==="round")ne=`<circle cx="${g.toFixed(2)}" cy="${h.toFixed(2)}" r="${x.toFixed(2)}" fill="rgba(255,255,255,0.16)" stroke="${Fe}" stroke-width="1.25"/><circle cx="${m.toFixed(2)}" cy="${h.toFixed(2)}" r="${x.toFixed(2)}" fill="rgba(255,255,255,0.16)" stroke="${Fe}" stroke-width="1.25"/><path d="M${(g+x-.2).toFixed(2)} ${h.toFixed(2)} Q22 ${(h-1.3).toFixed(2)} ${(m-x+.2).toFixed(2)} ${h.toFixed(2)}" fill="none" stroke="${Fe}" stroke-width="1.15"/>`;else if(i.glasses==="shades")ne=`<path d="M${(g-x*1.28).toFixed(2)} ${(h-x*.86).toFixed(2)} Q${g.toFixed(2)} ${(h-x*.98).toFixed(2)} ${(g+x*1.12).toFixed(2)} ${(h-x*.72).toFixed(2)} C${(g+x*1.06).toFixed(2)} ${(h+x*.72).toFixed(2)} ${(g+x*.52).toFixed(2)} ${(h+x*.96).toFixed(2)} ${(g-x*.1).toFixed(2)} ${(h+x*.92).toFixed(2)} C${(g-x*.78).toFixed(2)} ${(h+x*.88).toFixed(2)} ${(g-x*1.16).toFixed(2)} ${(h+x*.42).toFixed(2)} ${(g-x*1.28).toFixed(2)} ${(h-x*.86).toFixed(2)} Z" fill="${le}" stroke="${se}" stroke-linejoin="round" stroke-width="1.35"/><path d="M${(m+x*1.28).toFixed(2)} ${(h-x*.86).toFixed(2)} Q${m.toFixed(2)} ${(h-x*.98).toFixed(2)} ${(m-x*1.12).toFixed(2)} ${(h-x*.72).toFixed(2)} C${(m-x*1.06).toFixed(2)} ${(h+x*.72).toFixed(2)} ${(m-x*.52).toFixed(2)} ${(h+x*.96).toFixed(2)} ${(m+x*.1).toFixed(2)} ${(h+x*.92).toFixed(2)} C${(m+x*.78).toFixed(2)} ${(h+x*.88).toFixed(2)} ${(m+x*1.16).toFixed(2)} ${(h+x*.42).toFixed(2)} ${(m+x*1.28).toFixed(2)} ${(h-x*.86).toFixed(2)} Z" fill="${le}" stroke="${se}" stroke-linejoin="round" stroke-width="1.35"/><path d="M${(g+x*.96).toFixed(2)} ${(h-x*.66).toFixed(2)} Q22 ${(h-x*.92).toFixed(2)} ${(m-x*.96).toFixed(2)} ${(h-x*.66).toFixed(2)}" fill="none" stroke="${se}" stroke-linecap="round" stroke-width="1.85"/><ellipse cx="${(g-x*1.08).toFixed(2)}" cy="${(h-x*.68).toFixed(2)}" rx="0.62" ry="0.34" fill="${ce}"/><ellipse cx="${(m+x*1.08).toFixed(2)}" cy="${(h-x*.68).toFixed(2)}" rx="0.62" ry="0.34" fill="${ce}"/>`;else if(i.glasses==="cat")ne=`<path d="M${(g-x*1.35).toFixed(2)} ${(h-x*.85).toFixed(2)} Q${(g-x*.1).toFixed(2)} ${(h-x*.92).toFixed(2)} ${(g+x*.95).toFixed(2)} ${(h-x*.15).toFixed(2)} Q${(g+x*.72).toFixed(2)} ${(h+x*.98).toFixed(2)} ${(g-x*.25).toFixed(2)} ${(h+x*.9).toFixed(2)} Q${(g-x*1.15).toFixed(2)} ${(h+x*.5).toFixed(2)} ${(g-x*1.35).toFixed(2)} ${(h-x*.85).toFixed(2)} Z" fill="rgba(255,255,255,0.16)" stroke="${oe}" stroke-width="1.35"/><path d="M${(m+x*1.35).toFixed(2)} ${(h-x*.85).toFixed(2)} Q${(m+x*.1).toFixed(2)} ${(h-x*.92).toFixed(2)} ${(m-x*.95).toFixed(2)} ${(h-x*.15).toFixed(2)} Q${(m-x*.72).toFixed(2)} ${(h+x*.98).toFixed(2)} ${(m+x*.25).toFixed(2)} ${(h+x*.9).toFixed(2)} Q${(m+x*1.15).toFixed(2)} ${(h+x*.5).toFixed(2)} ${(m+x*1.35).toFixed(2)} ${(h-x*.85).toFixed(2)} Z" fill="rgba(255,255,255,0.16)" stroke="${oe}" stroke-width="1.35"/><path d="M${(g+x*.9).toFixed(2)} ${(h-x*.15).toFixed(2)} Q22 ${(h-x*.45).toFixed(2)} ${(m-x*.9).toFixed(2)} ${(h-x*.15).toFixed(2)}" fill="none" stroke="${oe}" stroke-width="1.2"/>`;else if(i.glasses==="visor"){let c=o.hasCustomGlassesColor?o.glassesMid:"#38bdf8",p=o.hasCustomGlassesColor?o.glassesLit:"#e0f2fe";ne=`<rect x="${(22-(u+x*1.15)).toFixed(2)}" y="${(h-x*.82).toFixed(2)}" width="${((u+x*1.15)*2).toFixed(2)}" height="${(x*1.65).toFixed(2)}" rx="${(x*.82).toFixed(2)}" fill="${o.hasCustomGlassesColor?o.glassesMid:"rgba(14,165,233,0.34)"}" fill-opacity="${o.hasCustomGlassesColor?.36:1}" stroke="${c}" stroke-width="1.15"/><line x1="${(22-u*.9).toFixed(2)}" x2="${(22+u*.65).toFixed(2)}" y1="${(h-x*.34).toFixed(2)}" y2="${(h-x*.34).toFixed(2)}" stroke="${p}" opacity="0.72" stroke-linecap="round" stroke-width="1.1"/>`}else if(i.glasses==="monocle"){let c=o.hasCustomGlassesColor?oe:Z,p=o.hasCustomGlassesColor?o.glassesShadow:o.goldShadow;ne=`<circle cx="${m.toFixed(2)}" cy="${h.toFixed(2)}" r="${(x*1.02).toFixed(2)}" fill="rgba(255,255,255,0.16)" stroke="${c}" stroke-width="1.35"/><path d="M${(m+x*.92).toFixed(2)} ${(h+x*.38).toFixed(2)} Q${(m+x*1.45).toFixed(2)} ${(h+4.8).toFixed(2)} ${(m+x*.65).toFixed(2)} ${(h+8.6).toFixed(2)}" fill="none" stroke="${p}" stroke-dasharray="1.1 1.1" stroke-linecap="round" stroke-width="0.95"/>`}else if(i.glasses){let c=Ie("glasses",i.glasses);if(c){let p=c.draw(S,n,o);p.back&&(Ce+=p.back),p.front&&(ne=p.front)}}let L="";if(i.topper==="tuft")L=`<path d="M${t(-11.8)} ${e(6.8)} Q${t(0)} ${e(2.6)} ${t(11.8)} ${e(6.6)}" fill="none" opacity="0.2" stroke="#000" stroke-linecap="round" stroke-width="1.8"/><path d="M${t(-13.4)} ${e(7.6)} C${t(-14.2)} ${e(.4)} ${t(-8.4)} ${e(-5.6)} ${t(-1.6)} ${e(-4.8)} C${t(-2.2)} ${e(-7.6)} ${t(2.4)} ${e(-8.6)} ${t(4.4)} ${e(-5.2)} C${t(7.6)} ${e(-7.4)} ${t(11.6)} ${e(-4.2)} ${t(10.6)} ${e(-.8)} C${t(13.8)} ${e(1)} ${t(14.4)} ${e(4.8)} ${t(12.8)} ${e(7.6)} C${t(10.4)} ${e(4.2)} ${t(8.2)} ${e(3.6)} ${t(6.6)} ${e(6.2)} C${t(4.8)} ${e(3.2)} ${t(2.4)} ${e(2.8)} ${t(.6)} ${e(6)} C${t(-1.4)} ${e(3)} ${t(-4.2)} ${e(3.2)} ${t(-5.8)} ${e(6)} C${t(-7.8)} ${e(3.4)} ${t(-10.8)} ${e(4.6)} ${t(-13.4)} ${e(7.6)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${t(-7.8)} ${e(.2)} Q${t(-1.2)} ${e(-4.2)} ${t(6.2)} ${e(-1.8)}" fill="none" opacity="0.5" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.35"/>`;else if(i.topper==="quiff")L=`<path d="M${t(-12.2)} ${e(7.4)} Q${t(-1)} ${e(2.4)} ${t(11.6)} ${e(6.2)}" fill="none" opacity="0.2" stroke="#000" stroke-linecap="round" stroke-width="1.8"/><path d="M${t(-13.2)} ${e(8)} C${t(-14.6)} ${e(1.6)} ${t(-11.4)} ${e(-5.6)} ${t(-3.6)} ${e(-7.4)} C${t(4.2)} ${e(-9.2)} ${t(12.8)} ${e(-6.8)} ${t(14.4)} ${e(-1.2)} C${t(15.2)} ${e(1.8)} ${t(13.6)} ${e(5)} ${t(10.8)} ${e(5.8)} C${t(8.4)} ${e(2)} ${t(1.6)} ${e(1.4)} ${t(-4.6)} ${e(3.8)} C${t(-8.4)} ${e(5.2)} ${t(-11.2)} ${e(7.8)} ${t(-13.2)} ${e(8)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${t(-8.8)} ${e(.6)} C${t(-3.2)} ${e(-5.6)} ${t(5.2)} ${e(-6.4)} ${t(11.2)} ${e(-2.4)}" fill="none" opacity="0.55" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.55"/><path d="M${t(-4.2)} ${e(2.2)} Q${t(4.4)} ${e(-1.4)} ${t(11.6)} ${e(2.4)}" fill="none" opacity="0.35" stroke="${o.hairShadow}" stroke-linecap="round" stroke-width="1.1"/>`;else if(i.topper==="curly"){let c=Math.min(1.06,$);L=`<g fill="${o.hairShadow}"><circle cx="${t(-11.6)}" cy="${e(4.6)}" r="${(4.2*c).toFixed(2)}"/><circle cx="${t(11.6)}" cy="${e(4.6)}" r="${(4.2*c).toFixed(2)}"/><circle cx="${t(-8.2)}" cy="${e(-2.4)}" r="${(4.6*c).toFixed(2)}"/><circle cx="${t(8.2)}" cy="${e(-2.4)}" r="${(4.6*c).toFixed(2)}"/></g><g fill="${A}" stroke="${o.hairShadow}" stroke-width="0.45"><circle cx="${t(-10.2)}" cy="${e(2.2)}" r="${(4.4*c).toFixed(2)}"/><circle cx="${t(10.2)}" cy="${e(2.2)}" r="${(4.4*c).toFixed(2)}"/><circle cx="${t(-5.4)}" cy="${e(-.2)}" r="${(4.9*c).toFixed(2)}"/><circle cx="${t(5.4)}" cy="${e(-.2)}" r="${(4.9*c).toFixed(2)}"/><circle cx="${t(-4.8)}" cy="${e(-4)}" r="${(4.5*c).toFixed(2)}"/><circle cx="${t(4.8)}" cy="${e(-4)}" r="${(4.5*c).toFixed(2)}"/><circle cx="22" cy="${e(-4.8)}" r="${(5*c).toFixed(2)}"/><circle cx="22" cy="${e(.2)}" r="${(4.6*c).toFixed(2)}"/></g><g fill="none" opacity="0.5" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.1"><path d="M${t(-7.4)} ${e(-4.8)} A2.6 2.6 0 0 1 ${t(-3.6)} ${e(-5.4)}"/><path d="M${t(-1.4)} ${e(-6.4)} A2.8 2.8 0 0 1 ${t(2.4)} ${e(-6.2)}"/><path d="M${t(4.2)} ${e(-1.6)} A2.4 2.4 0 0 1 ${t(7.2)} ${e(-1)}"/></g>`}else if(i.topper==="mohawk")L=`<path d="M${t(-4.6)} ${e(3.8)} C${t(-5.2)} ${e(-1.4)} ${t(-7.2)} ${e(-5.2)} ${t(-4.8)} ${e(-7.4)} C${t(-2.8)} ${e(-6.2)} ${t(-2.2)} ${e(-5.6)} ${t(-1.2)} ${e(-4.8)} C${t(-1.8)} ${e(-8.6)} ${t(.6)} ${e(-10.2)} ${t(2.4)} ${e(-9.4)} C${t(1.8)} ${e(-6.8)} ${t(2.6)} ${e(-5.8)} ${t(3.8)} ${e(-5)} C${t(5.2)} ${e(-7.6)} ${t(8)} ${e(-7.2)} ${t(7.4)} ${e(-3.6)} C${t(6.6)} ${e(-.2)} ${t(5.6)} ${e(2)} ${t(4.6)} ${e(3.8)} Q${t(0)} ${e(1.6)} ${t(-4.6)} ${e(3.8)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${t(1.2)} ${e(-8)} Q${t(.2)} ${e(-3)} ${t(.4)} ${e(1.4)}" fill="none" opacity="0.55" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.3"/>`;else if(i.topper==="bob")L=`<path d="M${t(-12.6)} ${e(7.4)} Q${t(0)} ${e(2.4)} ${t(12.6)} ${e(7.4)}" fill="none" opacity="0.22" stroke="#000" stroke-linecap="round" stroke-width="1.7"/><path d="M${t(-14)} ${e(8.8)} C${t(-14.6)} ${e(-.6)} ${t(-8.4)} ${e(-4.8)} ${t(0)} ${e(-4.6)} C${t(8.4)} ${e(-4.8)} ${t(14.6)} ${e(-.6)} ${t(14)} ${e(8.8)} C${t(10.8)} ${e(4.6)} ${t(6.2)} ${e(2.2)} ${t(2)} ${e(4.2)} C${t(1)} ${e(2)} ${t(-.8)} ${e(1.8)} ${t(-1.8)} ${e(4.4)} C${t(-6.2)} ${e(2.2)} ${t(-10.8)} ${e(4.6)} ${t(-14)} ${e(8.8)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${t(-8.8)} ${e(-.4)} Q${t(-2.4)} ${e(-3.2)} ${t(5.2)} ${e(-1.2)}" fill="none" opacity="0.55" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.45"/>`;else if(i.topper==="pigtails")L=`<path d="M${t(-11.4)} ${e(6.6)} Q${t(0)} ${e(2.6)} ${t(11.4)} ${e(6.6)}" fill="none" opacity="0.2" stroke="#000" stroke-linecap="round" stroke-width="1.6"/><path d="M${t(-12.6)} ${e(7.4)} C${t(-13.2)} ${e(-.8)} ${t(-7.2)} ${e(-4.6)} ${t(0)} ${e(-4.2)} C${t(7.2)} ${e(-4.6)} ${t(13.2)} ${e(-.8)} ${t(12.6)} ${e(7.4)} C${t(9.2)} ${e(3.6)} ${t(4.2)} ${e(2)} ${t(.6)} ${e(4.8)} C${t(0)} ${e(3)} ${t(-.6)} ${e(3)} ${t(-1.2)} ${e(4.8)} C${t(-4.4)} ${e(2)} ${t(-9.2)} ${e(3.6)} ${t(-12.6)} ${e(7.4)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${t(-6.8)} ${e(-.8)} Q${t(0)} ${e(-3)} ${t(6.8)} ${e(-.8)}" fill="none" opacity="0.5" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.3"/>`;else if(i.topper==="ponytail")L=`<path d="M${t(-11.4)} ${e(6.8)} Q${t(0)} ${e(2.2)} ${t(11.6)} ${e(6.2)}" fill="none" opacity="0.2" stroke="#000" stroke-linecap="round" stroke-width="1.6"/><path d="M${t(-12.4)} ${e(7.6)} C${t(-13.2)} ${e(-.6)} ${t(-6.6)} ${e(-4.8)} ${t(2.4)} ${e(-4.2)} C${t(9.2)} ${e(-3.6)} ${t(13.4)} ${e(.4)} ${t(12.6)} ${e(7)} C${t(8.8)} ${e(3)} ${t(2.2)} ${e(1.4)} ${t(-3.8)} ${e(4.8)} C${t(-7.4)} ${e(6.8)} ${t(-10.6)} ${e(7.6)} ${t(-12.4)} ${e(7.6)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${t(-6)} ${e(-.8)} Q${t(1.6)} ${e(-3.2)} ${t(8)} ${e(-.4)}" fill="none" opacity="0.52" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.35"/>`;else if(i.topper==="bow-hair"){let c=o.hasCustomTopperColor?"#f43f5e":B,p=o.hasCustomTopperColor?"#9f1239":o.hatShadow,F=22+4.8*$,k=d-2.6;L=`<path d="M${t(-13.4)} ${e(8)} C${t(-14.2)} ${e(.8)} ${t(-8.8)} ${e(-4.4)} ${t(0)} ${e(-4.4)} C${t(8.8)} ${e(-4.4)} ${t(14.2)} ${e(.8)} ${t(13.4)} ${e(8)} C${t(9.4)} ${e(4)} ${t(4.8)} ${e(2.2)} ${t(-1.2)} ${e(4.2)} C${t(-5.8)} ${e(5.8)} ${t(-10.2)} ${e(5.6)} ${t(-13.4)} ${e(8)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${t(-8.4)} ${e(.6)} Q${t(-1.4)} ${e(-2.8)} ${t(6.8)} ${e(-.4)}" fill="none" opacity="0.48" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.25"/><g transform="rotate(16 ${F.toFixed(2)} ${k.toFixed(2)})"><path d="M${(F-1).toFixed(2)} ${(k+.8).toFixed(2)} L${(F-4.4).toFixed(2)} ${(k+5.2).toFixed(2)} L${(F-1.8).toFixed(2)} ${(k+4.6).toFixed(2)} Z M${(F+1).toFixed(2)} ${(k+.8).toFixed(2)} L${(F+4.4).toFixed(2)} ${(k+5.2).toFixed(2)} L${(F+1.8).toFixed(2)} ${(k+4.6).toFixed(2)} Z" fill="${c}" stroke="${p}" stroke-linejoin="round" stroke-width="0.45"/><path d="M${F.toFixed(2)} ${k.toFixed(2)} C${(F-2.8).toFixed(2)} ${(k-4.2).toFixed(2)} ${(F-8.6).toFixed(2)} ${(k-3).toFixed(2)} ${(F-7.8).toFixed(2)} ${(k+.8).toFixed(2)} C${(F-7.2).toFixed(2)} ${(k+3.6).toFixed(2)} ${(F-2.2).toFixed(2)} ${(k+2.8).toFixed(2)} ${F.toFixed(2)} ${(k+.8).toFixed(2)} Z" fill="${c}" stroke="${p}" stroke-width="0.55"/><path d="M${F.toFixed(2)} ${k.toFixed(2)} C${(F+2.8).toFixed(2)} ${(k-4.2).toFixed(2)} ${(F+8.6).toFixed(2)} ${(k-3).toFixed(2)} ${(F+7.8).toFixed(2)} ${(k+.8).toFixed(2)} C${(F+7.2).toFixed(2)} ${(k+3.6).toFixed(2)} ${(F+2.2).toFixed(2)} ${(k+2.8).toFixed(2)} ${F.toFixed(2)} ${(k+.8).toFixed(2)} Z" fill="${c}" stroke="${p}" stroke-width="0.55"/><circle cx="${F.toFixed(2)}" cy="${(k+.3).toFixed(2)}" r="1.95" fill="${c}" stroke="${p}" stroke-width="0.55"/><path d="M${(F-5.4).toFixed(2)} ${(k-.9).toFixed(2)} Q${(F-3.2).toFixed(2)} ${(k-1.6).toFixed(2)} ${(F-1.8).toFixed(2)} ${(k-.4).toFixed(2)} M${(F+1.8).toFixed(2)} ${(k-.4).toFixed(2)} Q${(F+3.2).toFixed(2)} ${(k-1.6).toFixed(2)} ${(F+5.4).toFixed(2)} ${(k-.9).toFixed(2)}" fill="none" opacity="0.55" stroke="#fff" stroke-linecap="round" stroke-width="0.75"/></g>`}else if(i.topper==="updo"){let c=o.hasCustomTopperColor?"#f43f5e":B,p=o.hasCustomTopperColor?"#9f1239":o.hatShadow;L=`<ellipse cx="22" cy="${e(-6.8)}" rx="${(6.5*$).toFixed(2)}" ry="5.4" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.58"/><path d="M${t(-3.4)} ${e(-8.6)} Q22 ${e(-10.8)} ${t(3.6)} ${e(-8)}" fill="none" opacity="0.52" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.25"/><path d="M${t(-5.4)} ${e(-2.4)} Q22 ${e(-.8)} ${t(5.4)} ${e(-2.4)}" fill="none" stroke="${c}" stroke-linecap="round" stroke-width="2.1"/><path d="M${t(-5.4)} ${e(-2.4)} Q22 ${e(-.8)} ${t(5.4)} ${e(-2.4)}" fill="none" opacity="0.35" stroke="${p}" stroke-linecap="round" stroke-width="0.65"/><circle cx="${t(4.8)}" cy="${e(-2.8)}" r="1.15" fill="${Z}" stroke="#92400e" stroke-width="0.35"/><path d="M${t(-13.2)} ${e(7.8)} C${t(-13.8)} ${e(.8)} ${t(-8.4)} ${e(-3.6)} 22 ${e(-3)} C${t(8.4)} ${e(-3.6)} ${t(13.8)} ${e(.8)} ${t(13.2)} ${e(7.8)} C${t(9.4)} ${e(3.8)} ${t(4.4)} ${e(2.2)} 22 ${e(1.4)} C${t(-4.4)} ${e(2.2)} ${t(-9.4)} ${e(3.8)} ${t(-13.2)} ${e(7.8)} Z" fill="${A}" stroke="${o.hairShadow}" stroke-width="0.55"/><path d="M${t(-8.8)} ${e(1.2)} Q${t(-4.2)} ${e(-1.8)} ${t(-.8)} ${e(-.6)} M${t(.8)} ${e(-.6)} Q${t(4.2)} ${e(-1.8)} ${t(8.8)} ${e(1.2)}" fill="none" opacity="0.48" stroke="${o.hairLit}" stroke-linecap="round" stroke-width="1.1"/>`}else if(i.topper==="beanie")L=`<circle cx="22" cy="${e(-7.4)}" r="2.8" fill="${o.hatStripe}" stroke="${o.hatShadow}" stroke-width="0.5"/><path d="M${t(-12.2)} ${e(4.2)} C${t(-11.8)} ${e(-4.6)} ${t(-5.2)} ${e(-7.4)} ${t(0)} ${e(-7.4)} C${t(5.2)} ${e(-7.4)} ${t(11.8)} ${e(-4.6)} ${t(12.2)} ${e(4.2)} Z" fill="${B}" stroke="${o.hatShadow}" stroke-width="0.55"/><rect x="${(22-12.9*$).toFixed(2)}" y="${(d+1.8).toFixed(2)}" width="${(25.8*$).toFixed(2)}" height="3.6" rx="1.7" fill="${o.hatShadow}"/>`;else if(i.topper==="beret")L=`<g transform="rotate(-9 22 ${e(1)})"><path d="M${t(-1.2)} ${e(-6.8)} Q${t(-2)} ${e(-9.2)} ${t(-.2)} ${e(-9.4)}" fill="none" stroke="${o.hatShadow}" stroke-linecap="round" stroke-width="1.6"/><path d="M${t(-13.8)} ${e(2.2)} C${t(-16.2)} ${e(-4.2)} ${t(-7.4)} ${e(-8.2)} ${t(2.2)} ${e(-7.6)} C${t(11.4)} ${e(-7)} ${t(16.6)} ${e(-2.4)} ${t(13.8)} ${e(3.2)} Q${t(0)} ${e(4.4)} ${t(-13.8)} ${e(2.2)} Z" fill="${B}" stroke="${o.hatShadow}" stroke-width="0.6"/><path d="M${t(-11.4)} ${e(2.4)} Q${t(0)} ${e(4.6)} ${t(11.4)} ${e(2.8)}" fill="none" stroke="${o.hatShadow}" stroke-linecap="round" stroke-width="2"/><path d="M${t(-8.4)} ${e(-3.4)} Q${t(-.6)} ${e(-6.2)} ${t(7.4)} ${e(-3.8)}" fill="none" opacity="0.42" stroke="${o.hatLit}" stroke-linecap="round" stroke-width="1.45"/></g>`;else if(i.topper==="cowboy"){let c=o.hasCustomTopperColor?B:fe,p=o.hasCustomTopperColor?o.hatShadow:"#3b200d";L=`<path d="M${t(-18.2)} ${e(-.8)} C${t(-16.4)} ${e(4.6)} ${t(-7.6)} ${e(5.4)} ${t(0)} ${e(4.8)} C${t(7.6)} ${e(5.4)} ${t(16.4)} ${e(4.6)} ${t(18.2)} ${e(-.8)} C${t(15.2)} ${e(2)} ${t(8.2)} ${e(2.6)} ${t(0)} ${e(2.2)} C${t(-8.2)} ${e(2.6)} ${t(-15.2)} ${e(2)} ${t(-18.2)} ${e(-.8)} Z" fill="${c}" stroke="${p}" stroke-width="0.6"/><path d="M${t(-10.2)} ${e(2.4)} C${t(-10.4)} ${e(-3.2)} ${t(-8.4)} ${e(-8.6)} ${t(-4.4)} ${e(-8.8)} C${t(-1.8)} ${e(-8.8)} ${t(-1.2)} ${e(-6.8)} ${t(0)} ${e(-6.8)} C${t(1.2)} ${e(-6.8)} ${t(1.8)} ${e(-8.8)} ${t(4.4)} ${e(-8.8)} C${t(8.4)} ${e(-8.6)} ${t(10.4)} ${e(-3.2)} ${t(10.2)} ${e(2.4)} Q${t(0)} ${e(3.8)} ${t(-10.2)} ${e(2.4)} Z" fill="${c}" stroke="${p}" stroke-width="0.6"/><path d="M${t(-10.1)} ${e(.4)} Q${t(0)} ${e(2.2)} ${t(10.1)} ${e(.4)} L${t(10.2)} ${e(2.4)} Q${t(0)} ${e(4)} ${t(-10.2)} ${e(2.4)} Z" fill="#2b190d"/><rect x="20.6" y="${(d+.9).toFixed(2)}" width="2.8" height="2.1" rx="0.45" fill="${Z}"/>`}else if(i.topper==="cap")L=`<circle cx="22" cy="${e(-7.4)}" r="1.3" fill="${o.hatShadow}"/><path d="M${t(-12.6)} ${e(3.4)} C${t(-12.4)} ${e(-4.8)} ${t(-5.8)} ${e(-7.4)} ${t(0)} ${e(-7.4)} C${t(5.8)} ${e(-7.4)} ${t(12.4)} ${e(-4.8)} ${t(12.6)} ${e(3.4)} Z" fill="${B}" stroke="${o.hatShadow}" stroke-width="0.55"/><path d="M${t(-12.4)} ${e(2.6)} Q${t(0)} ${e(.6)} ${t(14.8)} ${e(3.6)} C${t(16.6)} ${e(4.4)} ${t(15.6)} ${e(6.4)} ${t(11.6)} ${e(6.2)} Q${t(-1)} ${e(4.2)} ${t(-12.4)} ${e(4.2)} Z" fill="${o.hatShadow}" stroke="${o.hatLit}" stroke-width="0.35"/>`;else if(i.topper==="crown"){let c=o.hasCustomTopperColor?B:Z,p=o.hasCustomTopperColor?o.hatShadow:"#92400e",F=o.hasCustomTopperColor?o.hatShadow:"#d97706";L=`<path d="M${t(-10.2)} ${e(2.8)} L${t(-11.4)} ${e(-6.8)} L${t(-5)} ${e(-1.8)} L${t(0)} ${e(-9.2)} L${t(5)} ${e(-1.8)} L${t(11.4)} ${e(-6.8)} L${t(10.2)} ${e(2.8)} Q${t(0)} ${e(4.6)} ${t(-10.2)} ${e(2.8)} Z" fill="${c}" stroke="${p}" stroke-width="0.65"/><path d="M${t(-10.2)} ${e(1)} Q${t(0)} ${e(2.8)} ${t(10.2)} ${e(1)} L${t(10.2)} ${e(2.8)} Q${t(0)} ${e(4.6)} ${t(-10.2)} ${e(2.8)} Z" fill="${F}" opacity="0.55"/><circle cx="22" cy="${e(-9.4)}" r="1.25" fill="#fef08a" stroke="${p}" stroke-width="0.4"/><circle cx="${t(-11.4)}" cy="${e(-7)}" r="1.1" fill="#fef08a" stroke="${p}" stroke-width="0.4"/><circle cx="${t(11.4)}" cy="${e(-7)}" r="1.1" fill="#fef08a" stroke="${p}" stroke-width="0.4"/><circle cx="22" cy="${e(-.2)}" r="1.45" fill="#ef4444"/><circle cx="${t(-5.8)}" cy="${e(.6)}" r="1.15" fill="#38bdf8"/><circle cx="${t(5.8)}" cy="${e(.6)}" r="1.15" fill="#38bdf8"/>`}else if(i.topper==="tophat"){let c=o.hasCustomTopperColor?o.hatShadow:"#171b24",p=o.hasCustomTopperColor?B:"#232938",F=o.hasCustomTopperColor?o.hatStripe:B;L=`<g transform="rotate(-6 22 ${e(1.2)})"><ellipse cx="22" cy="${e(2.2)}" rx="${(13.8*$).toFixed(2)}" ry="2.8" fill="${c}" stroke="rgba(255,255,255,0.22)" stroke-width="0.55"/><path d="M${t(-8.4)} ${e(1.8)} L${t(-9.8)} ${e(-10.6)} Q${t(0)} ${e(-12.2)} ${t(9.8)} ${e(-10.6)} L${t(8.4)} ${e(1.8)} Q${t(0)} ${e(3.4)} ${t(-8.4)} ${e(1.8)} Z" fill="${p}" stroke="rgba(255,255,255,0.18)" stroke-width="0.55"/><path d="M${t(-8.7)} ${e(-1.2)} Q${t(0)} ${e(.6)} ${t(8.7)} ${e(-1.2)} L${t(8.4)} ${e(1.6)} Q${t(0)} ${e(3.2)} ${t(-8.4)} ${e(1.6)} Z" fill="${F}"/><rect x="20.6" y="${(d-.1).toFixed(2)}" width="2.8" height="2.2" rx="0.45" fill="${Z}"/><path d="M${t(-5.2)} ${e(-9.8)} L${t(-4.6)} ${e(-1.8)}" opacity="0.34" stroke="#fff" stroke-linecap="round" stroke-width="1.45"/></g>`}else if(i.topper==="wizard"){let c=o.hasCustomTopperColor?o.hatShadow:"#2e235c",p=o.hasCustomTopperColor?B:"#3b2d75",F=o.hasCustomTopperColor?o.hatLit:"#5b4ba3";L=`<ellipse cx="22" cy="${e(2.2)}" rx="${(16.2*$).toFixed(2)}" ry="3.1" fill="${c}" stroke="${F}" stroke-width="0.6"/><path d="M${t(-10.2)} ${e(1.8)} C${t(-9)} ${e(-5)} ${t(-3.6)} ${e(-10.8)} ${t(4.8)} ${e(-12.2)} C${t(9.4)} ${e(-12.8)} ${t(11.6)} ${e(-9.4)} ${t(8.6)} ${e(-8.6)} C${t(5.4)} ${e(-8.4)} ${t(7.4)} ${e(-3.2)} ${t(10.2)} ${e(1.8)} Q${t(0)} ${e(3.8)} ${t(-10.2)} ${e(1.8)} Z" fill="${p}" stroke="${F}" stroke-width="0.6"/><path d="M${t(-9.8)} ${e(-.2)} Q${t(0)} ${e(1.8)} ${t(9.8)} ${e(-.2)} L${t(10.2)} ${e(1.8)} Q${t(0)} ${e(3.6)} ${t(-10.2)} ${e(1.8)} Z" fill="${o.hasCustomTopperColor?o.hatStripe:B}"/><path d="M22 ${e(-6.2)} L22.8 ${e(-4.2)} L24.8 ${e(-3.4)} L22.8 ${e(-2.6)} L22 ${e(-.6)} L21.2 ${e(-2.6)} L19.2 ${e(-3.4)} L21.2 ${e(-4.2)} Z" fill="${Z}"/>`}else if(i.topper==="sprout"){let c=o.hasCustomTopperColor?o.hatShadow:"#15803d",p=o.hasCustomTopperColor?o.hatLit:"#4ade80",F=o.hasCustomTopperColor?o.hatMid:"#22c55e";L=`<path d="M22 ${e(1.8)} Q21.8 ${e(-3.4)} 23 ${e(-6)}" fill="none" stroke="${c}" stroke-linecap="round" stroke-width="1.6"/><path d="M22.2 ${e(-4)} C17.8 ${e(-8.8)} 13 ${e(-6.2)} 16 ${e(-2.8)} C18 ${e(-1.6)} 20.6 ${e(-2.4)} 22.2 ${e(-4)} Z" fill="${p}" stroke="${c}" stroke-width="0.55"/><path d="M22.8 ${e(-4.8)} C27.2 ${e(-9.4)} 31.8 ${e(-6.2)} 28.4 ${e(-3)} C26.4 ${e(-2)} 24 ${e(-3)} 22.8 ${e(-4.8)} Z" fill="${F}" stroke="${c}" stroke-width="0.55"/>`}else if(i.topper==="halo"){let c=o.hasCustomTopperColor?o.hatLit:"#fde047",p=o.hasCustomTopperColor?B:Z;L=`<ellipse cx="22" cy="${e(-5.2)}" rx="${(10.2*$).toFixed(2)}" ry="2.8" fill="none" opacity="0.35" stroke="${c}" stroke-width="3.6"/><ellipse cx="22" cy="${e(-5.2)}" rx="${(10.2*$).toFixed(2)}" ry="2.8" fill="none" stroke="${p}" stroke-width="1.7"/>`}else if(i.topper&&i.topper!=="cat-ears"){let c=Ie("topper",i.topper);if(c){let p=c.draw(S,n,o);p.back&&(X+=p.back),p.front&&(L=p.front)}}let H="";if(i.neck==="bowtie")H=`<path d="M22 ${s.toFixed(1)} L14 ${(s-3.5).toFixed(1)} Q13 ${s.toFixed(1)} 14 ${(s+3.5).toFixed(1)} Z" fill="${O}" stroke="${o.neckShadow}" stroke-width="0.55"/><path d="M22 ${s.toFixed(1)} L30 ${(s-3.5).toFixed(1)} Q31 ${s.toFixed(1)} 30 ${(s+3.5).toFixed(1)} Z" fill="${O}" stroke="${o.neckShadow}" stroke-width="0.55"/><rect x="20.3" y="${(s-1.8).toFixed(1)}" width="3.4" height="3.6" rx="1.3" fill="${o.neckShadow}"/>`;else if(i.neck==="scarf")H=`<path d="M${(22-l*.68).toFixed(1)} ${(s-3.4).toFixed(1)} Q22 ${(s+.8).toFixed(1)} ${(22+l*.68).toFixed(1)} ${(s-3.4).toFixed(1)} Q${(22+l*.72).toFixed(1)} ${(s+.6).toFixed(1)} ${(22+l*.56).toFixed(1)} ${(s+2).toFixed(1)} Q22 ${(s+4.4).toFixed(1)} ${(22-l*.56).toFixed(1)} ${(s+2).toFixed(1)} Q${(22-l*.72).toFixed(1)} ${(s+.6).toFixed(1)} ${(22-l*.68).toFixed(1)} ${(s-3.4).toFixed(1)} Z" fill="${O}" stroke="${o.neckShadow}" stroke-width="0.55"/><path d="M25 ${(s+.8).toFixed(1)} L29.8 ${(s+.2).toFixed(1)} L31.2 ${(s+7.2).toFixed(1)} Q28.2 ${(s+7.8).toFixed(1)} 25.8 ${(s+6.8).toFixed(1)} Z" fill="${O}" stroke="${o.neckShadow}" stroke-width="0.55"/><line x1="26.2" x2="30.3" y1="${(s+4.6).toFixed(1)}" y2="${(s+4.4).toFixed(1)}" stroke="${o.neckStripe}" stroke-linecap="round" stroke-width="1.15"/>`;else if(i.neck==="tie")H=`<path d="M16 ${(s-2.6).toFixed(1)} L21.6 ${(s-.6).toFixed(1)} L18.2 ${(s+1.6).toFixed(1)} Z" fill="#f1f5f9" stroke="#94a3b8" stroke-width="0.45"/><path d="M28 ${(s-2.6).toFixed(1)} L22.4 ${(s-.6).toFixed(1)} L25.8 ${(s+1.6).toFixed(1)} Z" fill="#f1f5f9" stroke="#94a3b8" stroke-width="0.45"/><path d="M20.4 ${(s+.4).toFixed(1)} L23.6 ${(s+.4).toFixed(1)} L25.4 ${(s+9.2).toFixed(1)} L22 ${(s+12.2).toFixed(1)} L18.6 ${(s+9.2).toFixed(1)} Z" fill="${O}" stroke="${o.neckShadow}" stroke-width="0.55"/><line x1="20.2" x2="24.1" y1="${(s+4.2).toFixed(1)}" y2="${(s+3).toFixed(1)}" opacity="0.62" stroke="${o.neckStripe}" stroke-linecap="round" stroke-width="0.95"/><line x1="19.5" x2="24.6" y1="${(s+7.4).toFixed(1)}" y2="${(s+6).toFixed(1)}" opacity="0.62" stroke="${o.neckStripe}" stroke-linecap="round" stroke-width="0.95"/><path d="M19.8 ${(s-1.4).toFixed(1)} L24.2 ${(s-1.4).toFixed(1)} L23.3 ${(s+1.4).toFixed(1)} L20.7 ${(s+1.4).toFixed(1)} Z" fill="${o.neckShadow}"/>`;else if(i.neck==="headphones"){let c=o.hasCustomNeckColor?O:"#1f2430",p=o.hasCustomNeckColor?o.neckLit:"#94a3b8",F=o.hasCustomNeckColor?o.neckShadow:"#475569";H=`<rect x="${(22-l-3.8).toFixed(1)}" y="${(a.earY-5.7).toFixed(1)}" width="5.2" height="11.4" rx="3.1" fill="${c}" stroke="${p}" stroke-width="1.1"/><rect x="${(22-l-2.6).toFixed(1)}" y="${(a.earY-2.8).toFixed(1)}" width="2" height="5.6" rx="1.4" fill="${F}"/><rect x="${(22-l-.4).toFixed(1)}" y="${(a.earY-4.3).toFixed(1)}" width="2" height="8.6" rx="1.6" fill="#334155"/><rect x="${(22+l-1.4).toFixed(1)}" y="${(a.earY-5.7).toFixed(1)}" width="5.2" height="11.4" rx="3.1" fill="${c}" stroke="${p}" stroke-width="1.1"/><rect x="${(22+l+.6).toFixed(1)}" y="${(a.earY-2.8).toFixed(1)}" width="2" height="5.6" rx="1.4" fill="${F}"/><rect x="${(22+l-1.6).toFixed(1)}" y="${(a.earY-4.3).toFixed(1)}" width="2" height="8.6" rx="1.6" fill="#334155"/>`}else if(i.neck==="bandana")H=`<path d="M${(22-l*.62).toFixed(1)} ${(s-2.8).toFixed(1)} Q22 ${(s+.4).toFixed(1)} ${(22+l*.62).toFixed(1)} ${(s-2.8).toFixed(1)} L22 ${(s+6.4).toFixed(1)} Z" fill="${O}" stroke="${o.neckShadow}" stroke-width="0.55"/><circle cx="22" cy="${(s+1.6).toFixed(1)}" r="0.85" fill="${o.neckStripe}" opacity="0.82"/><circle cx="19.3" cy="${(s+.6).toFixed(1)}" r="0.65" fill="${o.neckStripe}" opacity="0.82"/><circle cx="24.7" cy="${(s+.6).toFixed(1)}" r="0.65" fill="${o.neckStripe}" opacity="0.82"/>`;else if(i.neck==="pearls"){let c=o.hasCustomNeckColor?O:$e,p=o.hasCustomNeckColor?o.neckShadow:"#94a3b8",F=l*.62,P=[[-1,1.42],[-.68,1.62],[-.35,1.82],[0,2.02],[.35,1.82],[.68,1.62],[1,1.42]].map(([z,R])=>{let W=22+z*F,q=s-2.2+(1-z*z)*3.5;return`<circle cx="${W.toFixed(2)}" cy="${q.toFixed(2)}" r="${R.toFixed(2)}" fill="${c}" stroke="${p}" stroke-width="0.45"/><circle cx="${(W-R*.32).toFixed(2)}" cy="${(q-R*.34).toFixed(2)}" r="${(R*.28).toFixed(2)}" fill="#fff" opacity="0.9"/>`}).join("");H=`<path d="M${(22-F).toFixed(2)} ${(s-2.2).toFixed(2)} Q22 ${(s+4.6).toFixed(2)} ${(22+F).toFixed(2)} ${(s-2.2).toFixed(2)}" fill="none" stroke="${p}" stroke-width="0.6" opacity="0.55"/>${P}`}else if(i.neck==="star-necklace"){let c=o.hasCustomNeckColor?o.neckMid:"#f59e0b",p=o.hasCustomNeckColor?O:Z,F=o.hasCustomNeckColor?o.neckShadow:"#92400e",k=l*.58,P=s+4.3,z=[];for(let R=0;R<10;R++){let W=R*Math.PI/5-Math.PI/2,q=R%2===0?3.65:1.65;z.push(`${(22+Math.cos(W)*q).toFixed(2)} ${(P+Math.sin(W)*q).toFixed(2)}`)}H=`<path d="M${(22-k).toFixed(2)} ${(s-2.4).toFixed(2)} Q22 ${(s+4.8).toFixed(2)} ${(22+k).toFixed(2)} ${(s-2.4).toFixed(2)}" fill="none" stroke="${c}" stroke-linecap="round" stroke-width="1.15"/><circle cx="22" cy="${(s+1.3).toFixed(2)}" r="0.85" fill="none" stroke="${c}" stroke-width="0.7"/><path d="M${z[0]}L${z.slice(1).join("L")}Z" fill="${p}" stroke="${F}" stroke-linejoin="round" stroke-width="0.5"/><circle cx="21.1" cy="${(P-.9).toFixed(2)}" r="0.62" fill="#fff" opacity="0.88"/>`}else if(i.neck){let c=Ie("neck",i.neck);if(c){let p=c.draw(S,n,o);p.back&&(U+=p.back),p.front&&(H=p.front)}}return{back:te(U,T)+te(X,_)+te(Ce,w)+te(Me,i.flair==="sparkle"?re:Q),flair:Y?M:te(M,i.flair==="sparkle"?re:Q),glasses:te(ne,w),topper:te(L,_),neck:te(H,T)}}var ko=new Set(We),bo=/^[A-Za-z][A-Za-z0-9_-]{0,47}$/,So=/^-?\d+(?:\.\d+)?(?:\s+-?\d+(?:\.\d+)?){3}$/,wo="-8 -16 60 68";function Mo(i,r){if(typeof i=="string"){let n=i.trim().replace(/[^A-Za-z0-9_-]/g,"");if(bo.test(n))return n;if(n.length>0)return`b${n.slice(0,46)}`}return`b${Ae(r).toString(36)}`}function jt(i,r=wo){if(typeof i=="string"){let n=i.trim().replace(/\s+/g," ");if(So.test(n))return n}return r}function Co(i){return i.replace(/[&"'<>]/g,r=>r==="&"?"&amp;":r==='"'?"&quot;":r==="'"?"&#39;":r==="<"?"&lt;":"&gt;")}function Bo(i,r={}){let n=Xt(i),o=typeof r.size=="number"?r.size:Number(r.size),a=Number.isFinite(o)?Math.round(b(o,8,2048)):128,$=jt(r.viewBox),d=r.animated!==!1&&r.mode!=="readme",l=r.mode==="readme",s=r.mutedBody===!0,f=r.hideEyes===!0,u=typeof r.lightX=="number"&&Number.isFinite(r.lightX)?b(r.lightX,-1,1):-.35,h=typeof r.lightY=="number"&&Number.isFinite(r.lightY)?b(r.lightY,-1,1):-.45,x=`${Vt(n)}|${$}|${u.toFixed(2)}|${h.toFixed(2)}|${s?1:0}|${l?1:0}`,g=Mo(r.idPrefix,x),m=Lt(n.color,n.finish),y=Et(n.color,n),S=Te(n.variant),E=Ee(n.eyeSize),I=xe[n.eyeShape]??xe.pill,G=rt(it(n.variant)),C=Ne(-1,n.variant,0,0,n.eyeSize),_=Ne(1,n.variant,0,0,n.eyeSize),w=S.eyeW*E.w*I.w,T=S.eyeH*E.h*I.h,V=Math.min(w,T)*I.rxRatio,Q=qt(n,g,m,y),re=n.eyeShape==="happy",A=n.eyeShape==="star",B=n.eyeShape==="anime",oe=typeof r.mood=="string"&&ko.has(r.mood)?r.mood:n.feeling==="auto"?"idle":n.feeling,O=typeof r.phase=="number"&&Number.isFinite(r.phase)?r.phase:.4,v=(50+u*32).toFixed(1),Z=(50+h*32).toFixed(1),fe=(50+u*42).toFixed(1),le=(50+h*42).toFixed(1),$e=(22+u*14).toFixed(2),t=(21+h*16).toFixed(2),e=s?'aria-hidden="true"':`role="img" aria-label="${Co(typeof r.ariaLabel=="string"&&r.ariaLabel.trim()?r.ariaLabel.trim():"Botling avatar")}"`,U=d?`data-bot="1" data-v="${n.variant}" data-es="${n.eyeSize}" data-esh="${n.eyeShape}" data-mood="${oe}" data-phase="${O.toFixed(2)}" data-spx="${$e}" data-spy="${t}"`:"",X=l?`<style>.bf-${g}{animation:bf-f-${g} 3.2s ease-in-out infinite}.be-${g}{transform-origin:22px ${S.eyeY.toFixed(1)}px;animation:bf-b-${g} 4.4s ease-in-out infinite}@keyframes bf-f-${g}{0%,100%{transform:translateY(0)}50%{transform:translateY(-1.2px)}}@keyframes bf-b-${g}{0%,92%,100%{transform:scaleY(1)}96%{transform:scaleY(0.1)}}</style>`:"",Me=s?`<path d="${G}" fill="rgba(148,155,176,0.16)" stroke="rgba(148,155,176,0.34)" stroke-width="0.9"/>`:`<g data-layer="body"><path data-b="1" d="${G}" fill="url(#bf-${g})" stroke="${m.edgeStroke}" stroke-width="0.65"/><g clip-path="url(#cp-${g})" pointer-events="none"><ellipse data-sp="1" cx="${$e}" cy="${t}" rx="10.2" ry="6.2" fill="url(#bs-${g})" transform="rotate(-16 ${$e} ${t})"/><path data-rm="1" d="${G}" fill="none" stroke="url(#br-${g})" stroke-width="2.1"/></g></g>`,Ce=f?"":`<g data-layer="eyes"${l?` class="be-${g}"`:""}><g data-eye="1" opacity="${re||A?0:1}"><rect data-rl="1" x="${(C.cx-w/2).toFixed(2)}" y="${(C.cy-T/2+.4).toFixed(2)}" width="${w.toFixed(2)}" height="${T.toFixed(2)}" rx="${V.toFixed(2)}" fill="${m.eyeRecess}"/><rect data-rr="1" x="${(_.cx-w/2).toFixed(2)}" y="${(_.cy-T/2+.4).toFixed(2)}" width="${w.toFixed(2)}" height="${T.toFixed(2)}" rx="${V.toFixed(2)}" fill="${m.eyeRecess}"/><rect data-el="1" x="${(C.cx-w/2).toFixed(2)}" y="${(C.cy-T/2).toFixed(2)}" width="${w.toFixed(2)}" height="${T.toFixed(2)}" rx="${V.toFixed(2)}" fill="${m.eyeFill}"/><rect data-er="1" x="${(_.cx-w/2).toFixed(2)}" y="${(_.cy-T/2).toFixed(2)}" width="${w.toFixed(2)}" height="${T.toFixed(2)}" rx="${V.toFixed(2)}" fill="${m.eyeFill}"/><circle data-hl="1" cx="${(C.cx-w*.2).toFixed(2)}" cy="${(C.cy-T*.24).toFixed(2)}" r="${Math.max(.65,w*(B?.24:.18)).toFixed(2)}" fill="${m.eyeSheen}"/><circle data-hr="1" cx="${(_.cx-w*.2).toFixed(2)}" cy="${(_.cy-T*.24).toFixed(2)}" r="${Math.max(.65,w*(B?.24:.18)).toFixed(2)}" fill="${m.eyeSheen}"/><circle data-hl2="1" cx="${(C.cx+w*.22).toFixed(2)}" cy="${(C.cy+T*.2).toFixed(2)}" r="${Math.max(.42,w*.12).toFixed(2)}" fill="${m.eyeSheen}" opacity="${B?.82:0}"/><circle data-hr2="1" cx="${(_.cx+w*.22).toFixed(2)}" cy="${(_.cy+T*.2).toFixed(2)}" r="${Math.max(.42,w*.12).toFixed(2)}" fill="${m.eyeSheen}" opacity="${B?.82:0}"/></g><g data-arc="1" fill="none" stroke="${m.eyeFill}" stroke-linecap="round" stroke-width="${Math.max(1.5,w*.34).toFixed(2)}"><path data-arcl="1" d="${be(C.cx,C.cy,w,T)}" opacity="${re?1:0}"/><path data-arcr="1" d="${be(_.cx,_.cy,w,T)}" opacity="${re?1:0}"/></g><g data-star="1" fill="${m.eyeFill}" opacity="${A?1:0}"><path data-starl="1" d="${ke(C.cx,C.cy,w*.66,T*.62)}"/><path data-starr="1" d="${ke(_.cx,_.cy,w*.66,T*.62)}"/></g></g>`;return`<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="${$}" ${e}${U?` ${U}`:""}>${X}<defs><radialGradient id="bf-${g}" cx="${v}%" cy="${Z}%" fx="${fe}%" fy="${le}%" r="74%"><stop offset="0%" stop-color="${m.highlight}"/><stop offset="24%" stop-color="${m.lit}"/><stop offset="62%" stop-color="${m.mid}"/><stop offset="89%" stop-color="${m.shadow}"/><stop offset="100%" stop-color="${m.deepShadow}"/></radialGradient><radialGradient id="bs-${g}" cx="34%" cy="23%" r="48%"><stop offset="0%" stop-color="#fff" stop-opacity="${m.specularOpacity}"/><stop offset="46%" stop-color="#fff" stop-opacity="${(m.specularOpacity*.24).toFixed(3)}"/><stop offset="100%" stop-color="#fff" stop-opacity="0"/></radialGradient><linearGradient id="br-${g}" x1="16%" y1="10%" x2="84%" y2="94%"><stop offset="0%" stop-color="#fff" stop-opacity="0.34"/><stop offset="48%" stop-color="#fff" stop-opacity="0"/><stop offset="100%" stop-color="${m.rim}" stop-opacity="${m.rimOpacity}"/></linearGradient><radialGradient id="hr-${g}" cx="36%" cy="24%" r="76%"><stop offset="0%" stop-color="${y.hairLit}"/><stop offset="52%" stop-color="${y.hairMid}"/><stop offset="100%" stop-color="${y.hairShadow}"/></radialGradient><linearGradient id="ht-${g}" x1="14%" y1="8%" x2="86%" y2="92%"><stop offset="0%" stop-color="${y.hatLit}"/><stop offset="54%" stop-color="${y.hatMid}"/><stop offset="100%" stop-color="${y.hatShadow}"/></linearGradient><linearGradient id="gl-${g}" x1="14%" y1="8%" x2="86%" y2="92%"><stop offset="0%" stop-color="${y.glassesLit}"/><stop offset="54%" stop-color="${y.glassesMid}"/><stop offset="100%" stop-color="${y.glassesShadow}"/></linearGradient><linearGradient id="nk-${g}" x1="14%" y1="8%" x2="86%" y2="92%"><stop offset="0%" stop-color="${y.neckLit}"/><stop offset="54%" stop-color="${y.neckMid}"/><stop offset="100%" stop-color="${y.neckShadow}"/></linearGradient><radialGradient id="fl-${g}" cx="36%" cy="24%" r="76%"><stop offset="0%" stop-color="${y.flairLit}"/><stop offset="52%" stop-color="${y.flairMid}"/><stop offset="100%" stop-color="${y.flairShadow}"/></radialGradient><linearGradient id="gd-${g}" x1="15%" y1="5%" x2="85%" y2="95%"><stop offset="0%" stop-color="#fef08a"/><stop offset="55%" stop-color="#f59e0b"/><stop offset="100%" stop-color="#b45309"/></linearGradient><radialGradient id="pr-${g}" cx="32%" cy="28%" r="72%"><stop offset="0%" stop-color="#ffffff"/><stop offset="52%" stop-color="#f1f5f9"/><stop offset="100%" stop-color="#cbd5e1"/></radialGradient><linearGradient id="lt-${g}" x1="15%" y1="5%" x2="85%" y2="95%"><stop offset="0%" stop-color="#c98448"/><stop offset="55%" stop-color="#8b4f24"/><stop offset="100%" stop-color="#522b10"/></linearGradient><linearGradient id="ln-${g}" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" stop-color="#334155"/><stop offset="52%" stop-color="#141821"/><stop offset="100%" stop-color="#090c12"/></linearGradient><clipPath id="cp-${g}"><path data-clip="1" d="${G}"/></clipPath></defs>${s?"":`<ellipse data-layer="shadow" data-sh="1" cx="22" cy="40.6" rx="13" ry="2.2" fill="${m.groundShadow}"/>`}<g data-h="1"${l?` class="bf-${g}"`:""}><g data-layer="back">${Q.back}</g>${Me}<g data-face="1"><g data-layer="flair">${Q.flair}</g>${Ce}<g data-layer="glasses">${Q.glasses}</g></g><g data-layer="topper">${Q.topper}</g><g data-layer="neck">${Q.neck}</g></g>${d?`<g data-dots="1"><circle data-dot="0" cx="18.4" cy="43.8" r="1.15" fill="${n.color}" opacity="0"/><circle data-dot="1" cx="22" cy="43.8" r="1.15" fill="${n.color}" opacity="0"/><circle data-dot="2" cx="25.6" cy="43.8" r="1.15" fill="${n.color}" opacity="0"/></g>`:""}</svg>`}function wi(i){let r=xe[i]??xe.pill,n=4.6*r.w,o=7.4*r.h,a=Math.min(n,o)*r.rxRatio,$="";if(i==="happy")$=`<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2.1"><path d="${be(11,14.5,n*1.05,o*.95)}"/><path d="${be(25,14.5,n*1.05,o*.95)}"/></g>`;else if(i==="star")$=`<g fill="currentColor"><path d="${ke(11,14,n*.65,o*.62)}"/><path d="${ke(25,14,n*.65,o*.62)}"/></g>`;else{let d=i==="anime";$=`<g fill="currentColor"><rect x="${(11-n/2).toFixed(2)}" y="${(14-o/2).toFixed(2)}" width="${n.toFixed(2)}" height="${o.toFixed(2)}" rx="${a.toFixed(2)}"/><rect x="${(25-n/2).toFixed(2)}" y="${(14-o/2).toFixed(2)}" width="${n.toFixed(2)}" height="${o.toFixed(2)}" rx="${a.toFixed(2)}"/><circle cx="${(11-n*.2).toFixed(2)}" cy="${(14-o*.24).toFixed(2)}" r="${(n*(d?.23:.17)).toFixed(2)}" fill="var(--popover, #181b24)" opacity="0.88"/><circle cx="${(25-n*.2).toFixed(2)}" cy="${(14-o*.24).toFixed(2)}" r="${(n*(d?.23:.17)).toFixed(2)}" fill="var(--popover, #181b24)" opacity="0.88"/>${d?`<circle cx="${(11+n*.22).toFixed(2)}" cy="${(14+o*.22).toFixed(2)}" r="${(n*.12).toFixed(2)}" fill="var(--popover, #181b24)" opacity="0.78"/><circle cx="${(25+n*.22).toFixed(2)}" cy="${(14+o*.22).toFixed(2)}" r="${(n*.12).toFixed(2)}" fill="var(--popover, #181b24)" opacity="0.78"/>`:""}</g>`}return`<svg xmlns="http://www.w3.org/2000/svg" width="34" height="26" viewBox="0 0 36 28">${$}</svg>`}function Mi(i,r,n={},o=32,a){let $=Xe(n),d=Xe({...pe,variant:"orb",finish:"clay",color:$.color,eyeSize:1,eyeShape:"pill",feeling:"none",topperColor:$.topperColor,glassesColor:$.glassesColor,neckColor:$.neckColor,flairColor:$.flairColor,[i]:r}),l=Ie(i,r),s="0 0 44 44";return l?.thumbViewBox?s=jt(l.thumbViewBox,"0 0 44 44"):i==="topper"?s=r==="bob"||r==="pigtails"||r==="ponytail"||r==="bow-hair"?"-3 -10 50 48":"2 -13 40 32":i==="glasses"?s="5 8 34 24":i==="neck"?s=r==="headphones"?"-2 -6 48 44":"2 22 40 30":i==="flair"&&(s=r==="sparkle"?"14 -2 32 28":r==="long-beard"?"2 16 40 32":r==="sideburns"||r==="earrings"?"-2 10 48 30":r==="beard"||r==="goatee"?"4 16 36 27":"4 14 36 26"),Bo(d,{size:o,viewBox:s,animated:!1,mutedBody:!0,hideEyes:!0,idPrefix:a??`th-${i}-${r}`})}var Lo=new Set(Re),Eo=new Set(We);function Ut(i,r,n){let o=i.dataset.v,a=o&&Lo.has(o)?o:"pebble",$=Number(i.dataset.es),d=Number.isFinite($)&&$>0?$:1.48,l=i.dataset.esh,s=l&&l in xe?l:"pill",f=i.dataset.mood,u=f&&Eo.has(f)?f:"idle",h=Number(i.dataset.phase),x=Number.isFinite(h)?h:.4,g=Te(a),m=Ee(d),y=xe[s]??xe.pill,S=u,E=1;if(r.asleep)S="sleepy",E=1;else if(u==="none")S="none",E=0;else if(u==="idle"){let K=Yt(n,x);K&&(S=K.kind,E=K.strength)}let I=r.shy?-.78:r.ax,G=r.shy?-.32:r.ay,C=r.shy?.1:r.asleep?.12:r.blink,_=S==="alert"?Math.sin(n*13.5)*.45:0,w=S==="curious"?7.2*E:0,T=S==="sleepy"?.8*E:0,V=Math.sin(n*1.9+x)*.48+T,Q=b(I*14,-14,14),re=b(G*11,-11,11),A=b(I*-3.2+w+(r.shy?-6:0),-9.5,9.5),B=rt(wt(it(a),Q,re,A)),oe=i.querySelector("[data-b]");oe&&oe.setAttribute("d",B);let O=i.querySelector("[data-clip]");O&&O.setAttribute("d",B);let v=i.querySelector("[data-rm]");v&&v.setAttribute("d",B);let Z=i.querySelector("[data-h]");Z&&Z.setAttribute("transform",`translate(${(I*1.2+_).toFixed(2)} ${(G*.9+V).toFixed(2)})`);let fe=i.querySelector("[data-face]");fe&&fe.setAttribute("transform",`translate(${(I*1.45).toFixed(2)} ${(G*1.05).toFixed(2)})`);let le=i.querySelector("[data-sp]");if(le){let K=Number(i.dataset.spx),ue=Number(i.dataset.spy),Ye=((Number.isFinite(K)?K:17.1)-I*1.9).toFixed(2),ye=((Number.isFinite(ue)?ue:13.8)-G*1.4).toFixed(2);le.setAttribute("cx",Ye),le.setAttribute("cy",ye),le.setAttribute("transform",`rotate(-16 ${Ye} ${ye})`)}let $e=i.querySelector("[data-sh]");$e&&$e.setAttribute("rx",(13-V*.45).toFixed(2));let t=!r.shy&&!r.asleep&&(s==="happy"||S==="happy"&&E>.42),e=!r.shy&&!r.asleep&&S==="wink"&&E>.38,U=!r.shy&&!r.asleep&&s==="star"&&!t,X=S==="sleepy"?1-.44*E:1,Me=S==="alert"?1.15:1,Ce=S==="curious"?1+.12*E:1,M=Ne(-1,a,I,G,d),Y=Ne(1,a,I,G,d),ne=g.eyeW*m.w*y.w*Me,Fe=g.eyeH*m.h*y.h*Me,se=ne*M.sx,ce=ne*Y.sx*Ce,L=Math.max(.75,Fe*M.sy*C*X),H=Math.max(.75,Fe*Y.sy*C*X*Ce),c=(K,ue,Ye,ye,Oe,xt)=>{let J=i.querySelector(K);J&&(J.setAttribute("x",(ue-ye/2).toFixed(2)),J.setAttribute("y",(Ye-Oe/2).toFixed(2)),J.setAttribute("width",ye.toFixed(2)),J.setAttribute("height",Oe.toFixed(2)),J.setAttribute("rx",(Math.min(ye,Oe)*y.rxRatio).toFixed(2)),J.setAttribute("opacity",String(xt)))},p=t||U?0:1,F=t||U||e?0:1,k=i.querySelector("[data-eye]");k&&k.setAttribute("opacity",t||U?"0":"1"),c("[data-rl]",M.cx,M.cy+.35,se,L,p),c("[data-rr]",Y.cx,Y.cy+.35,ce,H,F),c("[data-el]",M.cx,M.cy,se,L,p),c("[data-er]",Y.cx,Y.cy,ce,H,F);let P=p&&C>.45?1:0,z=F&&C>.45?1:0,R=(K,ue,Ye,ye,Oe,xt)=>{let J=i.querySelector(K);J&&(J.setAttribute("cx",(ue-ye*.2).toFixed(2)),J.setAttribute("cy",(Ye-Oe*.24).toFixed(2)),J.setAttribute("opacity",String(xt)))};R("[data-hl]",M.cx,M.cy,se,L,P),R("[data-hr]",Y.cx,Y.cy,ce,H,z);let W=s==="anime",q=i.querySelector("[data-hl2]"),D=i.querySelector("[data-hr2]");q&&(q.setAttribute("cx",(M.cx+se*.22).toFixed(2)),q.setAttribute("cy",(M.cy+L*.2).toFixed(2)),q.setAttribute("opacity",W&&P?"0.82":"0")),D&&(D.setAttribute("cx",(Y.cx+ce*.22).toFixed(2)),D.setAttribute("cy",(Y.cy+H*.2).toFixed(2)),D.setAttribute("opacity",W&&z?"0.82":"0"));let $t=i.querySelector("[data-arcl]"),ct=i.querySelector("[data-arcr]");$t&&($t.setAttribute("d",be(M.cx,M.cy,se,Fe*M.sy)),$t.setAttribute("opacity",t?"1":"0")),ct&&(ct.setAttribute("d",be(Y.cx,Y.cy,ce,Fe*Y.sy)),ct.setAttribute("opacity",t||e?"1":"0"));let gt=i.querySelector("[data-star]");gt&&(gt.setAttribute("opacity",U?"1":"0"),U&&(i.querySelector("[data-starl]")?.setAttribute("d",ke(M.cx,M.cy,se*.66,Math.max(1.2,L*.62))),i.querySelector("[data-starr]")?.setAttribute("d",ke(Y.cx,Y.cy,ce*.66,Math.max(1.2,H*.62)))));let io=u==="think"||u==="work",ro=u==="work"?5.6:3.6;i.querySelectorAll("[data-dot]").forEach((K,ue)=>{K.setAttribute("opacity",io?(.26+.74*(.5+.5*Math.sin(n*ro-ue*1.1))).toFixed(2):"0")})}var Ge=new Set,de=[],yt=!1,Wt=0,_e=0,dt=0,lt=!1,qe=!1,Kt=0;function To(){return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}function Jt(){!lt||typeof window>"u"||(window.removeEventListener("pointermove",eo),document.removeEventListener("visibilitychange",to),lt=!1,yt=!1,de.length=0)}function eo(i){let r=performance.now();for(yt=!0,Wt=r,de.push({t:r,x:i.clientX,y:i.clientY});de.length>48&&r-de[0].t>1200;)de.shift()}function to(){let i=qe;qe=document.hidden,i&&!qe&&(Kt=performance.now()+550)}function Ao(i){if(!de.length)return null;for(let r=de.length-1;r>=0;r--)if(de[r].t<=i)return de[r];return de[0]}function oo(i){let r=dt?Math.min(60,Math.max(1,i-dt)):16;dt=i;let n=i/1e3,o=yt?1-Be((i-Wt-2400)/1600):0;for(let a of Ge){let{svg:$,state:d,opts:l}=a;if(!$.isConnected){Ge.delete(a);continue}let s=$.dataset.mood||"idle",f=Number($.dataset.phase)||.4,u=$.getBoundingClientRect(),h=_t(n,f),x=h.x,g=h.y,m=l.getLookTarget?.()??null;if(m&&u.width>0){let S=Pt({cx:u.left+u.width/2,cy:u.top+u.height/2,radius:u.width/2},m);x=S.x,g=S.y}else if(s==="think")x=Math.sin(n*1.25+f)*.34,g=-.32+Math.sin(n*.8)*.08;else if(s==="work")x=Math.sin(n*2.4+f)*.36,g=.14+Math.sin(n*1.6)*.08;else if(s==="sleepy")x=Math.sin(n*.35+f)*.12,g=.22;else if(l.interactive!==!1&&o>.01&&u.width>0){let S=Ao(i-(l.waveDelayMs??0));if(S){let E=At({dx:S.x-(u.left+u.width/2),dy:S.y-(u.top+u.height/2),radius:u.width/2,prevX:d.ax,prevY:d.ay,dtMs:r,gain:o});x=h.x*(1-o)+E.tx,g=h.y*(1-o)+E.ty}}let y=1-Math.exp(-r/85);d.ax+=(x-d.ax)*y,d.ay+=(g-d.ay)*y,d.blink=It(n,f),d.shy=l.getShy?.()??!1,d.asleep=!!(l.sleepOnTabBlur&&(qe||i<Kt)),Ut($,d,n)}Ge.size>0?_e=requestAnimationFrame(oo):(_e=0,Jt())}function Ti(i,r={}){if(typeof window>"u")return()=>{};if(To())return Ut(i,{ax:0,ay:0,blink:1,shy:r.getShy?.()??!1},0),()=>{};lt||(qe=typeof document<"u"?document.hidden:!1,window.addEventListener("pointermove",eo,{passive:!0}),document.addEventListener("visibilitychange",to),lt=!0);let n={svg:i,state:{ax:0,ay:0,blink:1},opts:r};return Ge.add(n),_e||(dt=performance.now(),_e=requestAnimationFrame(oo)),()=>{Ge.delete(n),Ge.size===0&&(_e&&(cancelAnimationFrame(_e),_e=0),Jt())}}export{st as BODY_PRESETS,Qe as BOTLING_CX,Ze as BOTLING_CY,bt as BOTLING_EMOTION_MODES,Ue as BOTLING_EYE_SHAPES,xe as BOTLING_EYE_SHAPE_ASPECT,Ro as BOTLING_EYE_SHAPE_LABELS,me as BOTLING_EYE_SIZE_DEFAULT,no as BOTLING_EYE_SIZE_DEFAULT_IDX,kt as BOTLING_EYE_SIZE_MAX,je as BOTLING_EYE_SIZE_MIN,ge as BOTLING_EYE_SIZE_STEPS,Io as BOTLING_EYE_SIZE_TAGS,mt as BOTLING_FINISHES,tt as BOTLING_FLAIRS,vo as BOTLING_FLAIR_LABELS,Je as BOTLING_GLASSES,Go as BOTLING_GLASSES_LABELS,pt as BOTLING_HAIR_TOPPERS,ao as BOTLING_HAT_TOPPERS,j as BOTLING_ITEM_SCALE_DEFAULT,so as BOTLING_ITEM_SCALE_DEFAULT_IDX,Yo as BOTLING_ITEM_SCALE_MAX,_o as BOTLING_ITEM_SCALE_MIN,N as BOTLING_ITEM_SCALE_STEPS,We as BOTLING_MOODS,et as BOTLING_NECKS,Oo as BOTLING_NECK_LABELS,Ke as BOTLING_TOPPERS,No as BOTLING_TOPPER_LABELS,Re as BOTLING_VARIANTS,Po as BOTLING_VARIANT_LABELS,Qo as CUTE_BOTLING_NAMES,pe as DEFAULT_BOTLING_CONFIG,nt as ITEM_PRESETS,lo as VARIANT_METRICS,Ut as applyBotlingPose,jo as autoColorForSlot,It as blinkOpenness,Ko as botPhaseOffset,Ee as botlingEyeScale,mo as botlingFromSeed,Et as buildAccessoryPalette,Lt as buildBotlingPalette,He as buildShadeRamp,he as canonicalItemColor,b as clamp,oi as clearPacks,Pt as computeLookAtAim,Mt as contrastRatio,Vt as encodeBotlingDna,yo as formatPackToken,ii as getPack,ni as getPackItemsForSlot,be as happyArcPath,Ae as hashSeed,ee as hslToRgb,_t as idleAmbientAim,Yt as idleMicroEmotion,xi as isBotlingDna,ht as isHairTopper,Gt as isPackToken,ze as itemColorHex,Xo as labelForBodyColor,qo as labelForItemColor,ri as listPacks,Ti as mountBotlingSvg,Le as nearestStepIndex,Ft as needsLightEyes,Se as normalizeHex,go as parseBotlingDna,De as parseCssColor,uo as parsePackToken,rt as pointsToSvgPath,Ne as projectBotlingEye,wt as projectBotlingRing,ei as registerPack,ft as relativeLuminance,qt as renderAccessoryParts,Mi as renderAccessoryThumbSvg,Bo as renderBotlingSvg,wi as renderEyeGlyphSvg,Xt as resolveBotlingInput,Ie as resolvePackItem,ie as rgbToHex,at as rgbToHsl,it as sampleBotlingRing,Xe as sanitizeBotlingConfig,ae as scaleAround,Be as smoothstep,ke as starEyePath,At as stepPointerGaze,ti as unregisterPack,Te as variantMetrics};
2
+ //# sourceMappingURL=index.js.map