{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "monster-avatar",
  "type": "registry:ui",
  "title": "Monster Avatar",
  "description": "Animated monster characters for agents, mixed from swappable parts.",
  "categories": [
    "data-display"
  ],
  "dependencies": [],
  "registryDependencies": [
    "https://sprout.tulipfarm.ai/r/sprout-base.json"
  ],
  "files": [
    {
      "path": "registry/sprout/components/ui/monster-avatar.tsx",
      "type": "registry:ui",
      "target": "components/ui/monster-avatar.tsx",
      "content": "'use client';\n\nimport { useEffect, useRef, type CSSProperties, type HTMLAttributes } from 'react';\nimport { hash } from '@/lib/sprout/hash';\nimport {\n  bodies,\n  bodyGeometry,\n  bodyTexture,\n  colors,\n  defaultHand,\n  earParts,\n  ears,\n  eyeParts,\n  eyes,\n  hatParts,\n  hats,\n  ink,\n  itemParts,\n  items,\n  mouthParts,\n  mouths,\n  palettes,\n  patterns,\n  type MonsterBody,\n  type MonsterColor,\n  type MonsterEars,\n  type MonsterEyes,\n  type MonsterHat,\n  type MonsterItem,\n  type MonsterMouth,\n  type MonsterPattern,\n} from '@/lib/sprout/monster-avatar-parts';\nimport { presets } from '@/lib/sprout/monster-avatar-presets';\nimport { cn } from '@/lib/sprout/classes';\n\nexport type {\n  MonsterBody,\n  MonsterColor,\n  MonsterEars,\n  MonsterEyes,\n  MonsterHat,\n  MonsterItem,\n  MonsterMouth,\n  MonsterPattern,\n};\n\nexport interface MonsterAvatarConfig {\n  body: MonsterBody;\n  color: MonsterColor;\n  pattern: MonsterPattern;\n  ears: MonsterEars;\n  eyes: MonsterEyes;\n  mouth: MonsterMouth;\n  hat: MonsterHat;\n  item: MonsterItem;\n}\n\nexport const monsterAvatarParts = {\n  body: bodies,\n  color: colors,\n  pattern: patterns,\n  ears,\n  eyes,\n  mouth: mouths,\n  hat: hats,\n  item: items,\n} as const;\n\nexport const monsterAvatarPresets: readonly { name: string; config: MonsterAvatarConfig }[] = presets;\n\nconst pick = <T,>(list: readonly T[], value: number) => list[value % list.length]!;\n\nexport function monsterAvatar(agentId: string): MonsterAvatarConfig {\n  const h = hash(agentId);\n  const h2 = hash(`${agentId}:monster`);\n  return {\n    body: pick(bodies, h),\n    color: pick(colors, h >>> 4),\n    pattern: pick(patterns, h2 >>> 23),\n    ears: pick(ears, h >>> 9),\n    eyes: pick(eyes, h >>> 14),\n    mouth: pick(mouths, h >>> 19),\n    hat: h2 % 3 === 0 ? pick(hats, h2 >>> 3) : 'none',\n    item: pick(items.slice(1), h2 >>> 11),\n  };\n}\n\nconst box = { x: -4, y: -8, size: 136 };\nconst percent = (value: number, start: number) => `${Math.round(((value - start) / box.size) * 1000) / 10}%`;\nconst origin = (x: number, y: number) => `${percent(x, box.x)} ${percent(y, box.y)}`;\nconst strokes = `stroke=\"${ink}\" stroke-width=\"2.6\" stroke-linejoin=\"round\" stroke-linecap=\"round\"`;\n\ninterface Layers {\n  back: string;\n  body: string;\n  eyes: string;\n  hat: string;\n  item: string;\n  wave: string;\n  waveOrigin: string;\n  eyeOrigin: string;\n  hatOrigin: string;\n  itemOrigin: string;\n  hatSway: boolean;\n  itemMotion: string;\n}\n\nconst cache = new Map<string, Layers>();\n\nfunction layers(config: MonsterAvatarConfig): Layers {\n  const key = Object.values(config).join('/');\n  let result = cache.get(key);\n  if (result) return result;\n  const palette = palettes[config.color];\n  const body = bodyGeometry(config.body);\n  if (!palette || !(config.ears in earParts) || !(config.eyes in eyeParts) || !(config.mouth in mouthParts)) {\n    throw new Error(`Unknown monster avatar: ${key}`);\n  }\n  const hat = hatParts[config.hat];\n  const item = itemParts[config.item];\n  if (!hat || !item) throw new Error(`Unknown monster avatar: ${key}`);\n  const dy = body.top - 30;\n  const [fx, fy] = body.face;\n  const head = `transform=\"translate(${body.cx} ${dy}) scale(${body.sx} 1) translate(-64 0)\"`;\n  const face = `transform=\"translate(${fx} ${fy})\"`;\n  const holding = config.item !== 'none';\n  const [ix, iy] = body.item;\n  const paw = (x: number, y: number) =>\n    `<ellipse cx=\"${x}\" cy=\"${y}\" rx=\"5.5\" ry=\"5\" fill=\"${palette.body}\"/>` +\n    `<path d=\"M${x - 1.8} ${y + 1.6}v2.2M${x + 1.6} ${y + 1.6}v2.2\" stroke-width=\"1.5\"/>`;\n  const hand = item.hand ?? defaultHand;\n  const motion = item.motion ?? 'bob';\n\n  result = {\n    back:\n      `<g ${head}>${earParts[config.ears](palette)}</g>` + (body.wave && !holding ? body.armRight(palette.body) : ''),\n    wave: body.wave ? body.wave.art(palette.body) : '',\n    waveOrigin: body.wave ? origin(...body.wave.shoulder) : '',\n    body:\n      `<path d=\"${body.path}\" fill=\"${palette.body}\" stroke-width=\"3\"/>` +\n      body.toes +\n      bodyTexture(config.body, config.pattern, palette.shade) +\n      body.arm(palette.body) +\n      (body.wave || holding ? '' : body.armRight(palette.body)) +\n      `<g transform=\"translate(${fx} ${fy + 2})\">${mouthParts[config.mouth](palette)}</g>`,\n    eyes: `<g ${face}>${eyeParts[config.eyes](palette)}</g>`,\n    hat: `<g ${head}>${hat.art(palette)}</g>`,\n    item: holding\n      ? `<g transform=\"translate(${ix} ${iy})\">${item.art}${body.paw ? paw(hand[0], hand[1]) : ''}</g>`\n      : '',\n    eyeOrigin: origin(64 + fx, 60 + fy),\n    hatOrigin: origin(body.cx, body.top),\n    itemOrigin: motion === 'pulse' || !body.paw ? origin(ix + 20, iy + 20) : origin(ix + hand[0], iy + hand[1]),\n    hatSway: hat.sway === true,\n    itemMotion: motion,\n  };\n  cache.set(key, result);\n  return result;\n}\n\nconst svg = (content: string, attributes = '') =>\n  `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${box.x} ${box.y} ${box.size} ${box.size}\"${attributes}><g ${strokes}>${content}</g></svg>`;\n\nexport function monsterAvatarSvg(config: MonsterAvatarConfig) {\n  const l = layers(config);\n  return svg(l.back + l.wave + l.body + l.eyes + l.hat + l.item);\n}\n\nexport function monsterAvatarSrc(config: MonsterAvatarConfig) {\n  return `data:image/svg+xml,${encodeURIComponent(monsterAvatarSvg(config))}`;\n}\n\nlet observer: IntersectionObserver | undefined;\n\nfunction watch(element: Element) {\n  if (typeof IntersectionObserver === 'undefined') return () => {};\n  observer ??= new IntersectionObserver(entries => {\n    for (const entry of entries) entry.target.toggleAttribute('data-offscreen', !entry.isIntersecting);\n  });\n  observer.observe(element);\n  return () => observer?.unobserve(element);\n}\n\nexport interface MonsterAvatarProps\n  extends Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'color'>, Partial<MonsterAvatarConfig> {\n  agentId?: string | undefined;\n  config?: MonsterAvatarConfig | undefined;\n  size?: number | undefined;\n  animated?: boolean | undefined;\n  label?: string | undefined;\n}\n\nconst layerClass = 'sprout-monster-layer';\n\nexport function MonsterAvatar({\n  agentId,\n  config,\n  body,\n  color,\n  pattern,\n  ears: earsProp,\n  eyes: eyesProp,\n  mouth,\n  hat,\n  item,\n  size = 64,\n  animated = true,\n  label,\n  className,\n  style,\n  ...props\n}: MonsterAvatarProps) {\n  const ref = useRef<HTMLSpanElement>(null);\n  useEffect(() => (animated && ref.current ? watch(ref.current) : undefined), [animated]);\n\n  const base = config ?? monsterAvatar(agentId ?? 'monster');\n  const resolved: MonsterAvatarConfig = {\n    body: body ?? base.body,\n    color: color ?? base.color,\n    pattern: pattern ?? base.pattern,\n    ears: earsProp ?? base.ears,\n    eyes: eyesProp ?? base.eyes,\n    mouth: mouth ?? base.mouth,\n    hat: hat ?? base.hat,\n    item: item ?? base.item,\n  };\n  const l = layers(resolved);\n  const seed = hash(agentId ?? Object.values(resolved).join('/'));\n  const layer = (content: string, extra?: { className?: string; style?: CSSProperties; motion?: string }) =>\n    content && (\n      <svg\n        className={cn(layerClass, extra?.className)}\n        viewBox={`${box.x} ${box.y} ${box.size} ${box.size}`}\n        style={extra?.style}\n        data-motion={extra?.motion}\n        aria-hidden=\"true\"\n        dangerouslySetInnerHTML={{ __html: `<g ${strokes}>${content}</g>` }}\n      />\n    );\n\n  return (\n    <span\n      ref={ref}\n      data-slot=\"monster-avatar\"\n      data-animated={animated ? '' : undefined}\n      role={label ? 'img' : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn('sprout-monster', className)}\n      style={\n        {\n          '--sprout-monster-size': `${size}px`,\n          '--sm-delay': `-${(seed % 5000) / 1000}s`,\n          '--sm-blink': `${4 + ((seed >>> 13) % 30) / 10}s`,\n          ...style,\n        } as CSSProperties\n      }\n      {...props}\n    >\n      <span className=\"sprout-monster-figure\">\n        {layer(l.back)}\n        {layer(l.wave, { motion: 'wave', style: { transformOrigin: l.waveOrigin } })}\n        {layer(l.body)}\n        {layer(l.eyes, { className: 'sprout-monster-eyes', style: { transformOrigin: l.eyeOrigin } })}\n        {layer(l.hat, { motion: l.hatSway ? 'sway' : undefined, style: { transformOrigin: l.hatOrigin } })}\n        {layer(l.item, {\n          className: 'sprout-monster-item',\n          motion: l.itemMotion,\n          style: { transformOrigin: l.itemOrigin },\n        })}\n      </span>\n    </span>\n  );\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/hash.ts",
      "type": "registry:lib",
      "target": "lib/sprout/hash.ts",
      "content": "export function hash(value: string) {\n  let h = 0x811c9dc5;\n  for (let i = 0; i < value.length; i++) {\n    h ^= value.charCodeAt(i);\n    h = Math.imul(h, 0x01000193);\n  }\n  return h >>> 0;\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/monster-avatar-parts.ts",
      "type": "registry:lib",
      "target": "lib/sprout/monster-avatar-parts.ts",
      "content": "export const ink = '#1b1722';\n\nexport interface Palette {\n  body: string;\n  shade: string;\n  light: string;\n  accent: string;\n}\n\nexport const palettes = {\n  yellow: { body: '#ffd23f', shade: '#e9a91d', light: '#fff1b0', accent: '#ff6b8b' },\n  blue: { body: '#4aa3ff', shade: '#2c74d9', light: '#c4e2ff', accent: '#ffd23f' },\n  pink: { body: '#ff8fb8', shade: '#e0628f', light: '#ffd6e5', accent: '#4aa3ff' },\n  green: { body: '#6fd36a', shade: '#3fa64a', light: '#cff5c6', accent: '#ffd23f' },\n  purple: { body: '#a979ff', shade: '#7b4fe0', light: '#e3d5ff', accent: '#3fd6c2' },\n  teal: { body: '#3fd6c2', shade: '#1fa595', light: '#c6f7ef', accent: '#ff8fb8' },\n  red: { body: '#ff6464', shade: '#d63c45', light: '#ffcaca', accent: '#ffd23f' },\n  orange: { body: '#ff9f43', shade: '#e2761f', light: '#ffe1c0', accent: '#4aa3ff' },\n  lime: { body: '#b8e04a', shade: '#8db52a', light: '#edf9c6', accent: '#a979ff' },\n} satisfies Record<string, Palette>;\n\nexport type MonsterColor = keyof typeof palettes;\nexport const colors = Object.keys(palettes) as MonsterColor[];\n\ninterface BodySpec {\n  a: number;\n  w: number;\n  top: number;\n  b: number;\n  n: number;\n  fur?: boolean;\n  raised?: boolean;\n  seed: number;\n}\n\nconst bodySpecs = {\n  blob: { a: 34, w: 38, top: 28, b: 20, n: 2.4, seed: 3 },\n  fluffy: { a: 35, w: 39, top: 28, b: 20, n: 2.4, fur: true, seed: 11 },\n  round: { a: 40, w: 44, top: 38, b: 24, n: 2.1, seed: 5 },\n  tall: { a: 29, w: 32, top: 20, b: 17, n: 2.5, seed: 7 },\n  bell: { a: 30, w: 43, top: 28, b: 19, n: 2.2, seed: 13 },\n  square: { a: 38, w: 39, top: 30, b: 12, n: 3.6, seed: 17 },\n  cheer: { a: 34, w: 38, top: 30, b: 20, n: 2.4, raised: true, seed: 19 },\n} satisfies Record<string, BodySpec>;\n\nexport type MonsterBody = keyof typeof bodySpecs | 'anteater';\nexport const bodies = [...Object.keys(bodySpecs), 'anteater'] as MonsterBody[];\n\nexport const patterns = ['plain', 'fur', 'spots', 'stripes'] as const;\nexport type MonsterPattern = (typeof patterns)[number];\n\nconst bottom = 118;\nconst hip = 106;\nconst r1 = (value: number) => Math.round(value * 10) / 10;\n\nfunction random(seed: number) {\n  let state = seed;\n  return () => {\n    state = (Math.imul(state, 1664525) + 1013904223) >>> 0;\n    return state / 2 ** 32;\n  };\n}\n\ntype Point = [number, number];\n\nfunction spline(points: Point[]) {\n  let d = '';\n  for (let i = 1; i < points.length - 2; i++) {\n    const [p0, p1, p2, p3] = [points[i - 1]!, points[i]!, points[i + 1]!, points[i + 2]!];\n    d +=\n      `C${r1(p1[0] + (p2[0] - p0[0]) / 6)} ${r1(p1[1] + (p2[1] - p0[1]) / 6)} ` +\n      `${r1(p2[0] - (p3[0] - p1[0]) / 6)} ${r1(p2[1] - (p3[1] - p1[1]) / 6)} ${r1(p2[0])} ${r1(p2[1])}`;\n  }\n  return d;\n}\n\nexport interface BodyGeometry {\n  path: string;\n  top: number;\n  cx: number;\n  sx: number;\n  face: Point;\n  span: (y: number) => [number, number] | undefined;\n  item: Point;\n  paw: boolean;\n  wave?: { art: (fill: string) => string; shoulder: Point };\n  toes: string;\n  arm: (fill: string) => string;\n  armRight: (fill: string) => string;\n}\n\nconst toeMarks = (feet: [number, number][], count: number) =>\n  feet\n    .flatMap(([x0, x1]) => {\n      const half = Math.min((x1 - x0) / count / 2, 3.8);\n      return Array.from({ length: count }, (_, i) => [(x0 + x1) / 2 + (i - (count - 1) / 2) * half * 2, half]);\n    })\n    .map(\n      ([x, half]) =>\n        `<path d=\"M${r1(x! - half!)} ${bottom}C${r1(x! - half!)} ${bottom - 8} ${r1(x! + half!)} ${bottom - 8} ${r1(x! + half!)} ${bottom}\" fill=\"#cfe9fb\" stroke-width=\"1.8\"/>`,\n    )\n    .join('');\n\nfunction anteater(): BodyGeometry {\n  const path =\n    'M11.5 104C9 92 13 80 21 70C17 52 28 39 44 38.5C54 38 60 41.5 66 43.5C90 35 116 39 120.5 62' +\n    'C123.5 78 120.5 96 117 104C118 112 117 118 111.5 118L104.5 118C104.5 111.5 100 111.5 100 118L94.5 118' +\n    'C91 118 91 111 92 104Q79 100.5 66.5 104C67.5 112 67 118 62.5 118L57.5 118C57.5 111.5 53 111.5 53 118' +\n    'L46.5 118C42 118 42 111 42.5 104C36 98 31 88 30.5 80C26.5 88 24 97 22.5 104C22.5 110.5 11.5 110.5 11.5 104Z';\n  return {\n    path,\n    top: 38,\n    cx: 41,\n    sx: 0.55,\n    face: [-25, -2],\n    span: y => {\n      if (y < 44 || y > 104) return undefined;\n      const x = 37 * Math.sqrt(Math.max(0, 1 - ((y - 74) / 30) ** 2));\n      return [Math.max(48, 82 - x), 82 + x];\n    },\n    item: [80, 22],\n    paw: false,\n    toes:\n      toeMarks(\n        [\n          [43, 53],\n          [57, 66],\n          [92.5, 100],\n          [104.5, 116],\n        ],\n        2,\n      ) + `<ellipse cx=\"16.8\" cy=\"106\" rx=\"2.4\" ry=\"2.8\" fill=\"${ink}\" stroke=\"none\"/>`,\n    arm: () => '',\n    armRight: () => '',\n  };\n}\n\nconst geometry = new Map<MonsterBody, BodyGeometry>();\n\nexport function bodyGeometry(kind: MonsterBody): BodyGeometry {\n  let result = geometry.get(kind);\n  if (result) return result;\n  if (kind === 'anteater') {\n    result = anteater();\n    geometry.set(kind, result);\n    return result;\n  }\n  const { a, w, top, b, n, fur, raised, seed }: BodySpec = bodySpecs[kind];\n  const next = random(seed);\n  const cy = top + b;\n  const side = (y: number) => {\n    const t = (y - cy) / (hip - cy);\n    return a + (w - a) * t ** 1.4 + Math.sin(Math.PI * t) * 1.2;\n  };\n  const half = (y: number) => {\n    if (y < top || y > bottom) return 0;\n    if (y >= cy) return y > hip ? w : side(y);\n    return a * (1 - ((cy - y) / b) ** n) ** (1 / n);\n  };\n\n  const outline: Point[] = [];\n  const sideSteps = 5;\n  for (let i = 0; i <= sideSteps; i++) {\n    const y = hip - ((hip - cy) * i) / sideSteps;\n    outline.push([64 - side(y), y]);\n  }\n  const domeSteps = 14;\n  for (let i = 1; i < domeSteps; i++) {\n    const angle = Math.PI - (Math.PI * i) / domeSteps;\n    const c = Math.cos(angle);\n    const s = Math.sin(angle);\n    outline.push([64 + a * Math.sign(c) * Math.abs(c) ** (2 / n), cy - b * Math.abs(s) ** (2 / n)]);\n  }\n  for (let i = sideSteps; i >= 0; i--) {\n    const y = hip - ((hip - cy) * i) / sideSteps;\n    outline.push([64 + side(y), y]);\n  }\n  for (const point of outline.slice(1, -1)) {\n    point[0] += (next() - 0.5) * 1.2;\n    point[1] += (next() - 0.5) * 1.2;\n  }\n\n  let upper: string;\n  if (fur) {\n    const dense: Point[] = [];\n    for (let i = 0; i < outline.length - 1; i++) {\n      const [x0, y0] = outline[i]!;\n      const [x1, y1] = outline[i + 1]!;\n      for (let k = 0; k < 8; k++) dense.push([x0 + ((x1 - x0) * k) / 8, y0 + ((y1 - y0) * k) / 8]);\n    }\n    dense.push(outline.at(-1)!);\n    const lengths = [0];\n    for (let i = 1; i < dense.length; i++) {\n      lengths.push(lengths[i - 1]! + Math.hypot(dense[i]![0] - dense[i - 1]![0], dense[i]![1] - dense[i - 1]![1]));\n    }\n    const total = lengths.at(-1)!;\n    const tufts = Math.round(total / 11);\n    const at = (distance: number): Point => {\n      let i = lengths.findIndex(length => length >= distance);\n      if (i <= 0) return dense[Math.max(0, i)]!;\n      const t = (distance - lengths[i - 1]!) / (lengths[i]! - lengths[i - 1]! || 1);\n      return [\n        dense[i - 1]![0] + (dense[i]![0] - dense[i - 1]![0]) * t,\n        dense[i - 1]![1] + (dense[i]![1] - dense[i - 1]![1]) * t,\n      ];\n    };\n    upper = '';\n    for (let i = 0; i < tufts; i++) {\n      const p0 = at((total * i) / tufts);\n      const p1 = at((total * (i + 1)) / tufts);\n      const tx = p1[0] - p0[0];\n      const ty = p1[1] - p0[1];\n      const length = Math.hypot(tx, ty) || 1;\n      const nx = ty / length;\n      const ny = -tx / length;\n      const depth = 3 + next() * 1.4;\n      const tip: Point = [p0[0] + tx * 0.82 + nx * depth * 0.8, p0[1] + ty * 0.82 + ny * depth * 0.8 + 0.5];\n      upper +=\n        `Q${r1(p0[0] + tx * 0.3 + nx * depth * 1.5)} ${r1(p0[1] + ty * 0.3 + ny * depth * 1.5)} ${r1(tip[0])} ${r1(tip[1])}` +\n        `Q${r1(p0[0] + tx * 0.92 + nx * 0.4)} ${r1(p0[1] + ty * 0.92 + ny * 0.4)} ${r1(p1[0])} ${r1(p1[1])}`;\n    }\n  } else {\n    const ends: Point[] = [[outline[0]![0], hip + 8], ...outline, [outline.at(-1)![0], hip + 8]];\n    upper = spline(ends);\n  }\n\n  const gap = 5;\n  const notch = 13;\n  const path =\n    `M${r1(64 - w)} ${hip}` +\n    upper +\n    `C${r1(64 + w + 0.6)} ${hip + 6} ${r1(64 + w - 0.5)} ${bottom} ${r1(64 + w - 5)} ${bottom}` +\n    `L${64 + gap} ${bottom}V${bottom - notch + gap}A${gap} ${gap} 0 0 0 ${64 - gap} ${bottom - notch + gap}V${bottom}` +\n    `L${r1(64 - w + 5)} ${bottom}C${r1(64 - w + 0.5)} ${bottom} ${r1(64 - w - 0.6)} ${hip + 6} ${r1(64 - w)} ${hip}Z`;\n\n  const toes = toeMarks(\n    [\n      [64 - w + 1, 64 - gap],\n      [64 + gap, 64 + w - 1],\n    ],\n    3,\n  );\n\n  const shoulder = Math.min(cy + 8, 82);\n  const wrist = Math.min(shoulder + 30, 101);\n  const armPath = (sign: 1 | -1) => {\n    const x = (dx: number, y: number) => r1(64 + sign * (side(y) + dx));\n    return (\n      `M${x(-1.5, shoulder)} ${shoulder}C${x(3.5, shoulder + 8)} ${shoulder + 8} ${x(5.5, wrist - 10)} ${wrist - 10} ${x(4.5, wrist)} ${wrist}` +\n      `C${x(4, wrist + 5)} ${wrist + 5} ${x(-3, wrist + 6)} ${wrist + 6} ${x(-4.5, wrist + 2)} ${wrist + 2}` +\n      `C${x(-6, wrist - 6)} ${wrist - 6} ${x(-6, shoulder + 10)} ${shoulder + 10} ${x(-3.5, shoulder + 2)} ${shoulder + 2}`\n    );\n  };\n  const arm = (sign: 1 | -1) => (fill: string) =>\n    `<path d=\"${armPath(sign)}\" fill=\"${fill}\"/>` +\n    `<path d=\"M${r1(64 + sign * (side(wrist) + 1.5))} ${wrist + 1.5}v3M${r1(64 + sign * (side(wrist) - 1.5))} ${wrist + 2}v3\" stroke-width=\"1.5\"/>`;\n\n  const up = (sign: 1 | -1) => (fill: string) => {\n    const d =\n      `M${r1(64 + sign * (side(cy + 12) - 6))} ${cy + 12}` +\n      `Q${r1(64 + sign * (a + 16))} ${cy + 8} ${r1(64 + sign * (a + 14))} ${top - 2}`;\n    return `<path d=\"${d}\" fill=\"none\" stroke-width=\"14\"/><path d=\"${d}\" fill=\"none\" stroke=\"${fill}\" stroke-width=\"8.6\"/>`;\n  };\n\n  const head = half(top + 20);\n  result = {\n    path,\n    top,\n    cx: 64,\n    sx: r1(head / 33.5) || 1,\n    face: [0, top - 34],\n    span: y => {\n      const x = half(y);\n      return x > 0 && y < hip ? [64 - x, 64 + x] : undefined;\n    },\n    item: [76, 72],\n    paw: true,\n    toes,\n    ...(raised\n      ? { wave: { art: up(-1), shoulder: [64 - side(cy + 12) + 6, cy + 12] as Point }, arm: () => '', armRight: up(1) }\n      : { arm: arm(-1), armRight: arm(1) }),\n  };\n  geometry.set(kind, result);\n  return result;\n}\n\nconst textures = new Map<string, string>();\n\nexport function bodyTexture(kind: MonsterBody, pattern: MonsterPattern, color: string) {\n  if (pattern === 'plain') return '';\n  const key = `${kind}/${pattern}`;\n  let marks = textures.get(key);\n  if (marks === undefined) {\n    const { span, face: shift, top } = bodyGeometry(kind);\n    const next = random(kind.length * 31 + pattern.length * 7);\n    const within = (x: number, y: number, margin: number) => {\n      const edge = span(y);\n      return edge !== undefined && x > edge[0] + margin && x < edge[1] - margin;\n    };\n    const inside = (x: number, y: number, margin: number) =>\n      within(x, y, margin) && within(x, y - margin, margin) && within(x, y + margin, margin);\n    const face = (x: number, y: number) =>\n      ((x - 64 - shift[0]) / 25) ** 2 + ((y - 64 - shift[1]) / 17) ** 2 < 1 || (kind === 'anteater' && x < 50);\n    marks = '';\n    if (pattern === 'stripes') {\n      for (let y = kind === 'anteater' ? 62 : top + 58; y < (kind === 'anteater' ? 96 : hip - 2); y += 10) {\n        const edge = span(y);\n        if (!edge) continue;\n        const [x0, x1] = [edge[0] + 1.6, edge[1] - 1.6];\n        const mid = (x0 + x1) / 2;\n        marks += `<path d=\"M${r1(x0)} ${y}Q${r1((x0 + mid) / 2)} ${y + 3} ${r1(mid)} ${y}T${r1(x1)} ${y}\" fill=\"none\" stroke-width=\"4\"/>`;\n      }\n    } else {\n      const step = pattern === 'fur' ? 10.5 : 11;\n      for (let y = top + 6; y < hip; y += step) {\n        for (let x = 22; x < 120; x += step) {\n          const px = x + (next() - 0.5) * step * 0.8;\n          const py = y + (next() - 0.5) * step * 0.8;\n          if (!inside(px, py, 4) || face(px, py)) continue;\n          if (pattern === 'fur') {\n            const lean = (px - 64) / 14;\n            marks += `M${r1(px)} ${r1(py)}q${r1(lean * 0.2 - 0.7)} 2.4 ${r1(lean * 0.5)} 4.8`;\n          } else {\n            marks += `<circle cx=\"${r1(px)}\" cy=\"${r1(py)}\" r=\"${r1(1.4 + next() * 2.4)}\"/>`;\n          }\n        }\n      }\n      if (pattern === 'fur') marks = `<path d=\"${marks}\" fill=\"none\" stroke-width=\"1.7\"/>`;\n    }\n    textures.set(key, marks);\n  }\n  return pattern === 'spots'\n    ? `<g fill=\"${color}\" stroke=\"none\" opacity=\".75\">${marks}</g>`\n    : `<g stroke=\"${color}\" opacity=\"${pattern === 'fur' ? 0.9 : 0.7}\">${marks}</g>`;\n}\n\nexport type Part = (p: Palette) => string;\nconst record =\n  <V>() =>\n  <K extends string>(value: Record<K, V>) =>\n    value;\nconst mirror = (svg: string) => `${svg}<g transform=\"matrix(-1 0 0 1 128 0)\">${svg}</g>`;\n\nexport const earParts = record<Part>()({\n  none: () => '',\n  cat: p =>\n    mirror(\n      `<path d=\"M33 46C32 36 33 27 36 21C42 24 47 29 51 35\" fill=\"${p.body}\"/>` +\n        `<path d=\"M37 34C37 30 37.5 27 38.5 25C41 27 43 29 45 32\" fill=\"${p.shade}\" stroke=\"none\"/>`,\n    ),\n  horns: () => mirror(`<path d=\"M42 36C38 31 37 25 40 18C42 24 46 27 51 29\" fill=\"#f6e3c3\"/>`),\n  antennae: p =>\n    mirror(\n      `<path d=\"M52 32C51 25 48 19 44 15\" fill=\"none\" stroke-width=\"2.6\"/><circle cx=\"43\" cy=\"14\" r=\"4.6\" fill=\"${p.body}\"/>`,\n    ),\n  stalks: () =>\n    mirror(\n      `<path d=\"M52 32C51 24 49 18 46 13\" fill=\"none\" stroke-width=\"2.6\"/>` +\n        `<circle cx=\"45\" cy=\"11\" r=\"6\" fill=\"#ffe27a\"/><circle cx=\"45\" cy=\"11\" r=\"3.6\" fill=\"#fff\" stroke-width=\"1.6\"/>` +\n        `<circle cx=\"45.6\" cy=\"11.4\" r=\"1.7\" fill=\"${ink}\" stroke=\"none\"/>`,\n    ),\n  bunny: p =>\n    mirror(\n      `<path d=\"M44 38C39 26 38 12 43 6C50 5 55 20 56 34\" fill=\"${p.body}\"/>` +\n        `<path d=\"M45.5 27C43.5 20 43.5 13 45 10.5C48.5 12.5 50.5 19.5 51 27\" fill=\"${p.light}\" stroke=\"none\"/>`,\n    ),\n  bear: p =>\n    mirror(\n      `<circle cx=\"40\" cy=\"31\" r=\"7.5\" fill=\"${p.body}\"/><circle cx=\"40\" cy=\"31\" r=\"3.6\" fill=\"${p.shade}\" stroke=\"none\"/>`,\n    ),\n  tuft: p =>\n    `<path d=\"M54 32C53 23 56 17 61 13C61 19 63 22 65 26C67 20 72 16 77 15C73 21 72 27 72 32\" fill=\"${p.body}\"/>`,\n});\n\nexport type MonsterEars = keyof typeof earParts;\nexport const ears = Object.keys(earParts) as MonsterEars[];\n\nconst L = 56;\nconst R = 72;\nconst eye = (cx: number, r = 7.6, pupil = 3.3) =>\n  `<circle cx=\"${cx}\" cy=\"60\" r=\"${r}\" fill=\"#fff\" stroke-width=\"2.2\"/>` +\n  `<circle cx=\"${cx + 0.9}\" cy=\"60.8\" r=\"${pupil}\" fill=\"${ink}\" stroke=\"none\"/>`;\nconst brow = (cx: number, side: 1 | -1, y = 49) =>\n  `<path d=\"M${cx - side * 6.5} ${y + 1.6}Q${cx - side * 1.5} ${y - 2.4} ${cx + side * 4.5} ${y - 0.4}\" fill=\"none\" stroke-width=\"2\"/>`;\nconst arc = (cx: number, up: boolean) =>\n  up\n    ? `<path d=\"M${cx - 5} 62Q${cx} 55 ${cx + 5} 62\" fill=\"none\" stroke-width=\"2.8\"/>`\n    : `<path d=\"M${cx - 5} 59Q${cx} 64 ${cx + 5} 59\" fill=\"none\" stroke-width=\"2.8\"/>`;\nconst shade = (cx: number) =>\n  `<path d=\"M${cx - 8} 55H${cx + 8}V59Q${cx + 8} 66 ${cx} 66Q${cx - 8} 66 ${cx - 8} 59Z\" fill=\"${ink}\"/>` +\n  `<path d=\"M${cx - 4.5} 57.5H${cx - 1.5}\" stroke=\"#fff\" stroke-width=\"1.8\"/>`;\n\nexport const eyeParts = record<Part>()({\n  round: () => eye(L) + eye(R),\n  wide: () => eye(L - 1, 8.7, 3.9) + eye(R + 1, 8.7, 3.9) + brow(L - 1, -1, 47.6) + brow(R + 1, 1, 47.6),\n  sleepy: p =>\n    ([L, R] as const)\n      .map(\n        (cx, i) =>\n          `<circle cx=\"${cx}\" cy=\"60\" r=\"7.6\" fill=\"#fff\" stroke-width=\"2.2\"/>` +\n          `<path d=\"M${cx - 2.6} 60a3.3 3.3 0 0 0 6.6 0Z\" fill=\"${ink}\" stroke=\"none\"/>` +\n          `<path d=\"M${cx - 7.6} 60a7.6 7.6 0 0 1 15.2 0Z\" fill=\"${p.body}\" stroke-width=\"2.2\"/>` +\n          brow(cx, i ? 1 : -1),\n      )\n      .join(''),\n  content: () => arc(L, false) + arc(R, false),\n  happy: () => arc(L, true) + arc(R, true),\n  wink: () => eye(L) + arc(R, true),\n  glasses: () =>\n    eye(L, 5.6, 2.8) +\n    eye(R, 5.6, 2.8) +\n    `<g fill=\"none\" stroke-width=\"2.6\"><circle cx=\"${L}\" cy=\"60\" r=\"8\"/><circle cx=\"${R}\" cy=\"60\" r=\"8\"/><path d=\"M63 59Q64 57.5 65 59\"/></g>`,\n  shades: () => `${shade(L)}${shade(R)}<path d=\"M63 56.5H65\" stroke-width=\"2.6\"/>`,\n  cyclops: () =>\n    `<circle cx=\"64\" cy=\"59\" r=\"11\" fill=\"#fff\"/><circle cx=\"65.2\" cy=\"60\" r=\"4.8\" fill=\"${ink}\" stroke=\"none\"/>` +\n    `<path d=\"M54.5 46.6Q64 41.4 73.5 46.6\" fill=\"none\" stroke-width=\"2\"/>`,\n});\n\nexport type MonsterEyes = keyof typeof eyeParts;\nexport const eyes = Object.keys(eyeParts) as MonsterEyes[];\n\nexport const mouthParts = record<Part>()({\n  smile: () => `<path d=\"M59 71Q64 76 69 71\" fill=\"none\" stroke-width=\"2.6\"/>`,\n  grin: () =>\n    `<path d=\"M56 70Q64 85 72 70Z\" fill=\"${ink}\"/>` +\n    `<path d=\"M59.6 72L61 74.6L62.4 72.4ZM65.6 72.4L67 74.6L68.4 72Z\" fill=\"#fff\" stroke=\"none\"/>` +\n    `<path d=\"M60 77.4Q64 75 68 77.4Q66 80.6 64 80.6Q62 80.6 60 77.4Z\" fill=\"#ff7a90\" stroke=\"none\"/>`,\n  fangs: () =>\n    `<path d=\"M56 70Q64 78 72 70\" fill=\"none\" stroke-width=\"2.6\"/>` +\n    `<path d=\"M58.6 72.2L60 76L61.4 73.4ZM66.6 73.4L68 76L69.4 72.2Z\" fill=\"#fff\" stroke-width=\"1.4\"/>`,\n  o: () => `<ellipse cx=\"64\" cy=\"73\" rx=\"3\" ry=\"3.8\" fill=\"${ink}\"/>`,\n  flat: () => `<path d=\"M59.5 73H68.5\" stroke-width=\"2.6\"/>`,\n  cat: () => `<path d=\"M58 71Q61 75 64 72Q67 75 70 71\" fill=\"none\" stroke-width=\"2.6\"/>`,\n  lips: () =>\n    `<rect x=\"50.5\" y=\"68\" width=\"27\" height=\"10.6\" rx=\"5.3\" fill=\"#ff94b8\"/><path d=\"M55 73.3H73\" stroke-width=\"1.8\"/>`,\n  tongue: () =>\n    `<path d=\"M58 71Q64 76 70 71\" fill=\"none\" stroke-width=\"2.6\"/>` +\n    `<path d=\"M62 74.4Q62 80 65.4 80Q68.4 80 68 73.4\" fill=\"#ff7a90\" stroke-width=\"2\"/>`,\n});\n\nexport type MonsterMouth = keyof typeof mouthParts;\nexport const mouths = Object.keys(mouthParts) as MonsterMouth[];\n\nconst phones =\n  `<path d=\"M29 60C27 22 101 22 99 60\" fill=\"none\" stroke-width=\"9\"/>` +\n  `<path d=\"M29 60C27 22 101 22 99 60\" fill=\"none\" stroke=\"#4b4560\" stroke-width=\"4.4\"/>`;\nconst cups = (p: Palette) =>\n  [20, 93]\n    .map(\n      x =>\n        `<rect x=\"${x}\" y=\"50\" width=\"15\" height=\"24\" rx=\"7\" fill=\"#4b4560\"/>` +\n        `<rect x=\"${x + 3.5}\" y=\"55\" width=\"8\" height=\"14\" rx=\"4\" fill=\"${p.accent}\" stroke=\"none\"/>`,\n    )\n    .join('');\n\nexport interface Hat {\n  art: Part;\n  sway?: boolean;\n}\n\nexport const hatParts = record<Hat>()({\n  none: { art: () => '' },\n  headphones: { art: p => phones + cups(p) },\n  headset: {\n    art: p =>\n      phones +\n      cups(p) +\n      `<path d=\"M27 70C29 86 39 90 49 88\" fill=\"none\" stroke-width=\"3\"/><circle cx=\"50\" cy=\"88\" r=\"4\" fill=\"${ink}\"/>`,\n  },\n  'grad-cap': {\n    art: () =>\n      `<path d=\"M44 26V36Q64 44 84 36V26Z\" fill=\"#3a3446\"/><path d=\"M64 10L102 22L64 34L26 22Z\" fill=\"#3a3446\"/>` +\n      `<path d=\"M64 22L94 26V40\" fill=\"none\" stroke=\"#ffd23f\" stroke-width=\"2.5\"/>` +\n      `<circle cx=\"64\" cy=\"22\" r=\"2.6\" fill=\"#ffd23f\" stroke=\"none\"/><circle cx=\"94\" cy=\"42\" r=\"3.2\" fill=\"#ffd23f\" stroke-width=\"1.6\"/>`,\n  },\n  'hard-hat': {\n    art: () =>\n      `<path d=\"M34 40C34 14 94 14 94 40Z\" fill=\"#ffcc33\"/><path d=\"M58 18Q64 16 70 18V38H58Z\" fill=\"#ffe27a\" stroke-width=\"2.4\"/>` +\n      `<rect x=\"27\" y=\"37\" width=\"74\" height=\"8\" rx=\"4\" fill=\"#ffcc33\"/>`,\n  },\n  'chef-hat': {\n    art: () =>\n      `<g fill=\"#fff\"><circle cx=\"50\" cy=\"17\" r=\"10\"/><circle cx=\"78\" cy=\"17\" r=\"10\"/><circle cx=\"64\" cy=\"11\" r=\"12\"/></g>` +\n      `<rect x=\"44\" y=\"14\" width=\"40\" height=\"12\" fill=\"#fff\" stroke=\"none\"/><path d=\"M44 22H84V36Q64 40 44 36Z\" fill=\"#fff\"/>`,\n  },\n  cap: {\n    art: p =>\n      `<path d=\"M84 34C96 31 108 33 113 38C104 41 94 41 84 39Z\" fill=\"${p.accent}\"/>` +\n      `<path d=\"M38 38C38 14 90 14 90 38Z\" fill=\"${p.accent}\"/><path d=\"M64 16V37\" fill=\"none\" stroke-width=\"2\"/>` +\n      `<circle cx=\"64\" cy=\"15\" r=\"2.6\" fill=\"${p.accent}\"/>`,\n  },\n  'sun-hat': {\n    art: () =>\n      `<ellipse cx=\"64\" cy=\"34\" rx=\"46\" ry=\"9\" fill=\"#f2c45e\"/><path d=\"M42 34C42 10 86 10 86 34Z\" fill=\"#f2c45e\"/>` +\n      `<path d=\"M42.4 26Q64 31 85.6 26L86 32Q64 37 42 32Z\" fill=\"#e8574c\" stroke-width=\"2\"/>`,\n  },\n  beanie: {\n    art: p =>\n      `<path d=\"M36 36C36 8 92 8 92 36Z\" fill=\"${p.accent}\"/><rect x=\"33\" y=\"30\" width=\"62\" height=\"11\" rx=\"5.5\" fill=\"${p.accent}\"/>` +\n      `<path d=\"M44 32V39M54 32V39M64 32V39M74 32V39M84 32V39\" stroke-width=\"2\"/><circle cx=\"64\" cy=\"9\" r=\"6\" fill=\"#fff\"/>`,\n  },\n  crown: {\n    art: () =>\n      `<path d=\"M42 34L43 12L53 23L64 8L75 23L85 12L86 34Z\" fill=\"#ffd34d\"/>` +\n      `<circle cx=\"64\" cy=\"27\" r=\"3.2\" fill=\"#ff5c7a\" stroke-width=\"1.6\"/><circle cx=\"50\" cy=\"29\" r=\"2.2\" fill=\"#4aa3ff\" stroke-width=\"1.4\"/>` +\n      `<circle cx=\"78\" cy=\"29\" r=\"2.2\" fill=\"#4aa3ff\" stroke-width=\"1.4\"/>`,\n  },\n  party: {\n    art: p =>\n      `<g transform=\"rotate(12 64 34)\"><path d=\"M64 0L80 34Q64 39 48 34Z\" fill=\"${p.accent}\"/>` +\n      `<path d=\"M58.5 13L69.5 13M54 23L74 23\" stroke=\"#fff\" stroke-width=\"3\"/><circle cx=\"64\" cy=\"0\" r=\"4.5\" fill=\"#fff\"/></g>`,\n  },\n  wizard: {\n    art: () =>\n      `<ellipse cx=\"64\" cy=\"33\" rx=\"30\" ry=\"6\" fill=\"#5b3cc4\"/><path d=\"M60 -6L84 32Q64 38 44 32Z\" fill=\"#7b4fe0\"/>` +\n      `<path d=\"M62 12l1.4 2.8 3 .4-2.2 2 .6 3-2.8-1.5-2.8 1.5.6-3-2.2-2 3-.4Z\" fill=\"#ffd34d\" stroke-width=\"1.2\"/>`,\n  },\n  astronaut: {\n    art: () =>\n      `<circle cx=\"64\" cy=\"62\" r=\"44\" fill=\"#cfeaff\" fill-opacity=\".26\" stroke-width=\"3.4\"/>` +\n      `<path d=\"M33 48Q39 32 54 25\" fill=\"none\" stroke=\"#fff\" stroke-width=\"4\" stroke-opacity=\".85\"/>` +\n      `<rect x=\"58\" y=\"12\" width=\"12\" height=\"7\" rx=\"3\" fill=\"#e6e3ee\"/>`,\n  },\n  bow: {\n    art: () =>\n      `<path d=\"M86 30L75 22V38ZM86 30L97 22V38Z\" fill=\"#ff6b8b\"/><circle cx=\"86\" cy=\"30\" r=\"3.6\" fill=\"#ff6b8b\"/>`,\n  },\n  sprout: {\n    sway: true,\n    art: () =>\n      `<path d=\"M64 31C64 24 64 20 63 15\" fill=\"none\" stroke-width=\"3\"/>` +\n      `<path d=\"M63 18C56 18 50 13 49 6C57 6 62 11 63 18Z\" fill=\"#6fd36a\"/><path d=\"M63.5 15C68 9 75 7 81 9C79 16 71 18 63.5 15Z\" fill=\"#6fd36a\"/>`,\n  },\n  tulip: {\n    sway: true,\n    art: () =>\n      `<path d=\"M64 31C64 22 65 16 64 13\" fill=\"none\" stroke-width=\"3\"/>` +\n      `<path d=\"M64 27C58 25 54 20 54 15C60 16 63 20 64 27Z\" fill=\"#6fd36a\"/>` +\n      `<path d=\"M56 3L60 8L64 1L68 8L72 3C73.5 12 70 17 64 17C58 17 54.5 12 56 3Z\" fill=\"#ff6b8b\"/>`,\n  },\n  halo: {\n    sway: true,\n    art: () =>\n      `<ellipse cx=\"64\" cy=\"14\" rx=\"19\" ry=\"5\" fill=\"none\" stroke-width=\"7\"/>` +\n      `<ellipse cx=\"64\" cy=\"14\" rx=\"19\" ry=\"5\" fill=\"none\" stroke=\"#ffd34d\" stroke-width=\"3.6\"/>`,\n  },\n});\n\nexport type MonsterHat = keyof typeof hatParts;\nexport const hats = Object.keys(hatParts) as MonsterHat[];\n\nexport type ItemMotion = 'bob' | 'ring' | 'float' | 'pulse' | 'sway';\n\nexport interface Item {\n  art: string;\n  motion?: ItemMotion;\n  hand?: Point;\n}\n\nconst paper = '#ffffff';\nconst dark = '#3d3a4a';\nconst metal = '#c9c6d6';\n\nexport const itemParts = record<Item>()({\n  none: { art: '' },\n  laptop: {\n    art: `<rect x=\"2\" y=\"6\" width=\"34\" height=\"24\" rx=\"3\" fill=\"${dark}\"/><circle cx=\"19\" cy=\"18\" r=\"3\" fill=\"#fff\" stroke=\"none\"/><path d=\"M-1 30H39L36 35H2Z\" fill=\"${metal}\"/>`,\n  },\n  code: {\n    art:\n      `<rect x=\"1\" y=\"4\" width=\"38\" height=\"28\" rx=\"3\" fill=\"${dark}\"/><rect x=\"4\" y=\"7\" width=\"32\" height=\"22\" rx=\"1.5\" fill=\"#1f1b2a\" stroke=\"none\"/>` +\n      `<path d=\"M15 13L10 18L15 23M25 13L30 18L25 23M22 11L18 25\" fill=\"none\" stroke=\"#5ef0a8\" stroke-width=\"2.2\"/><path d=\"M-2 32H42L39 36H1Z\" fill=\"${metal}\"/>`,\n  },\n  megaphone: {\n    motion: 'ring',\n    art:\n      `<path d=\"M6 14L30 4V36L6 26Z\" fill=\"${paper}\"/><rect x=\"28\" y=\"1\" width=\"7\" height=\"38\" rx=\"3.5\" fill=\"#ff6b5e\"/>` +\n      `<rect x=\"9\" y=\"25\" width=\"6\" height=\"11\" rx=\"2\" fill=\"${dark}\"/><path d=\"M38 9L42 6M39 20H43M38 31L42 34\" fill=\"none\"/>`,\n  },\n  chart: {\n    art:\n      `<rect x=\"4\" y=\"2\" width=\"32\" height=\"36\" rx=\"3\" fill=\"${paper}\"/>` +\n      `<path d=\"M9 31L16 22L22 26L31 12M25.5 12H31V17.5\" fill=\"none\" stroke=\"#2d7ff9\" stroke-width=\"3\"/>`,\n  },\n  bars: {\n    art:\n      `<rect x=\"3\" y=\"2\" width=\"34\" height=\"36\" rx=\"3\" fill=\"${paper}\"/>` +\n      `<g stroke-width=\"2\"><rect x=\"9\" y=\"22\" width=\"5\" height=\"10\" fill=\"#2d7ff9\"/><rect x=\"17.5\" y=\"15\" width=\"5\" height=\"17\" fill=\"#2d7ff9\"/><rect x=\"26\" y=\"9\" width=\"5\" height=\"23\" fill=\"#ff6b5e\"/></g>`,\n  },\n  clipboard: {\n    art:\n      `<rect x=\"5\" y=\"4\" width=\"30\" height=\"36\" rx=\"3\" fill=\"#c98b4b\"/><rect x=\"9\" y=\"9\" width=\"22\" height=\"27\" rx=\"1\" fill=\"${paper}\" stroke-width=\"2\"/>` +\n      `<rect x=\"14\" y=\"1\" width=\"12\" height=\"7\" rx=\"2\" fill=\"#9aa0ad\"/>` +\n      `<path d=\"M12 16L14 18L17.5 13.5M20 16H28M12 24L14 26L17.5 21.5M20 24H28M12 31H28\" fill=\"none\" stroke-width=\"2\"/>`,\n  },\n  document: {\n    art:\n      `<path d=\"M5 2H27L35 10V38H5Z\" fill=\"${paper}\"/><path d=\"M27 2V10H35\" fill=\"none\"/>` +\n      `<path d=\"M10 16H30M10 22H30M10 28H24\" fill=\"none\" stroke=\"#2d7ff9\" stroke-width=\"2.4\"/>`,\n  },\n  email: {\n    art:\n      `<rect x=\"1\" y=\"8\" width=\"38\" height=\"26\" rx=\"3\" fill=\"${paper}\"/><path d=\"M2 10L20 24L38 10\" fill=\"none\"/>` +\n      `<path d=\"M20 26.5C16 23.6 15.5 20.2 18 20C19.3 20 20 21 20 21C20 21 20.7 20 22 20C24.5 20.2 24 23.6 20 26.5Z\" fill=\"#ff6b5e\" stroke=\"none\"/>`,\n  },\n  calendar: {\n    art:\n      `<rect x=\"3\" y=\"6\" width=\"34\" height=\"31\" rx=\"4\" fill=\"${paper}\"/><path d=\"M3 10A4 4 0 0 1 7 6H33A4 4 0 0 1 37 10V16H3Z\" fill=\"#ff6b5e\"/>` +\n      `<path d=\"M12 2V9M28 2V9\" fill=\"none\" stroke-width=\"3\"/>` +\n      `<g stroke=\"none\" fill=\"${ink}\"><rect x=\"8.5\" y=\"21\" width=\"5\" height=\"4\" rx=\"1\"/><rect x=\"17.5\" y=\"21\" width=\"5\" height=\"4\" rx=\"1\"/>` +\n      `<rect x=\"26.5\" y=\"21\" width=\"5\" height=\"4\" rx=\"1\"/><rect x=\"8.5\" y=\"29\" width=\"5\" height=\"4\" rx=\"1\"/><rect x=\"26.5\" y=\"29\" width=\"5\" height=\"4\" rx=\"1\"/></g>` +\n      `<rect x=\"17.5\" y=\"29\" width=\"5\" height=\"4\" rx=\"1\" fill=\"#2d7ff9\" stroke=\"none\"/>`,\n  },\n  magnifier: {\n    motion: 'sway',\n    art:\n      `<path d=\"M25 25L37 37\" stroke-width=\"8\"/><path d=\"M25 25L37 37\" stroke=\"#c98b4b\" stroke-width=\"3.4\"/>` +\n      `<circle cx=\"16\" cy=\"16\" r=\"12\" fill=\"#d8f0ff\"/><path d=\"M9 13Q11 8 16 8\" fill=\"none\" stroke=\"#fff\" stroke-width=\"2.6\"/>`,\n  },\n  book: {\n    art:\n      `<path d=\"M0 8V37C8 35 14 36 20 38C26 36 32 35 40 37V8Z\" fill=\"#2d7ff9\"/>` +\n      `<path d=\"M20 8C14 4 6 4 1 6V34C6 32 14 32 20 36C26 32 34 32 39 34V6C34 4 26 4 20 8Z\" fill=\"${paper}\"/><path d=\"M20 8V36\" fill=\"none\"/>` +\n      `<path d=\"M6 13H15M6 19H15M6 25H13M25 13H34M25 19H34M25 25H32\" fill=\"none\" stroke-width=\"2\"/>`,\n  },\n  camera: {\n    art:\n      `<path d=\"M12 11L15 5H25L28 11Z\" fill=\"${dark}\"/><rect x=\"1\" y=\"10\" width=\"38\" height=\"26\" rx=\"5\" fill=\"${dark}\"/>` +\n      `<circle cx=\"20\" cy=\"23\" r=\"9\" fill=\"#7a7590\"/><circle cx=\"20\" cy=\"23\" r=\"5\" fill=\"#1f1b2a\" stroke=\"none\"/>` +\n      `<circle cx=\"18\" cy=\"21\" r=\"1.6\" fill=\"#fff\" stroke=\"none\"/><rect x=\"30\" y=\"13\" width=\"5\" height=\"3\" rx=\"1\" fill=\"#ffd34d\" stroke=\"none\"/>`,\n  },\n  calculator: {\n    art:\n      `<rect x=\"6\" y=\"2\" width=\"28\" height=\"37\" rx=\"4\" fill=\"${dark}\"/><rect x=\"10\" y=\"6\" width=\"20\" height=\"8\" rx=\"1.5\" fill=\"#c8f0c8\" stroke-width=\"2\"/>` +\n      `<g fill=\"#fff\" stroke=\"none\"><rect x=\"10\" y=\"18\" width=\"5\" height=\"4\" rx=\"1\"/><rect x=\"17.5\" y=\"18\" width=\"5\" height=\"4\" rx=\"1\"/><rect x=\"25\" y=\"18\" width=\"5\" height=\"4\" rx=\"1\"/>` +\n      `<rect x=\"10\" y=\"25\" width=\"5\" height=\"4\" rx=\"1\"/><rect x=\"17.5\" y=\"25\" width=\"5\" height=\"4\" rx=\"1\"/><rect x=\"25\" y=\"25\" width=\"5\" height=\"4\" rx=\"1\"/>` +\n      `<rect x=\"10\" y=\"32\" width=\"5\" height=\"4\" rx=\"1\"/><rect x=\"17.5\" y=\"32\" width=\"5\" height=\"4\" rx=\"1\"/></g>` +\n      `<rect x=\"25\" y=\"32\" width=\"5\" height=\"4\" rx=\"1\" fill=\"#ff9f43\" stroke=\"none\"/>`,\n  },\n  shield: {\n    motion: 'pulse',\n    art:\n      `<path d=\"M20 2L36 8V20C36 30 28 36 20 39C12 36 4 30 4 20V8Z\" fill=\"#3ccf91\"/>` +\n      `<path d=\"M12 20L18 26L28 15\" fill=\"none\" stroke-width=\"3.6\"/>`,\n  },\n  globe: {\n    motion: 'sway',\n    art:\n      `<circle cx=\"20\" cy=\"20\" r=\"17\" fill=\"#5ab8ff\"/>` +\n      `<path d=\"M10 9C14 12 12 16 16 18C19 20 17 25 13 27C9 25 5 20 6 15Z M27 22C31 21 34 24 33 28C31 32 27 33 25 30C24 27 25 23 27 22Z\" fill=\"#3ccf91\" stroke-width=\"2\"/>` +\n      `<ellipse cx=\"20\" cy=\"20\" rx=\"7\" ry=\"17\" fill=\"none\" stroke-width=\"1.8\"/><path d=\"M3 20H37\" fill=\"none\" stroke-width=\"1.8\"/>`,\n  },\n  flask: {\n    art:\n      `<path d=\"M16 3V14L5 34Q3 38 8 38H32Q37 38 35 34L24 14V3Z\" fill=\"${paper}\"/>` +\n      `<path d=\"M8.6 27.5H31.4L34.4 33.6Q36.2 37 32 37H8Q3.8 37 5.6 33.6Z\" fill=\"#3ccf91\" stroke=\"none\"/>` +\n      `<path d=\"M16 3V14L5 34Q3 38 8 38H32Q37 38 35 34L24 14V3M13 3H27\" fill=\"none\"/>` +\n      `<circle cx=\"17\" cy=\"21\" r=\"1.8\" fill=\"#fff\"/><circle cx=\"23\" cy=\"16\" r=\"1.3\" fill=\"#fff\"/>`,\n  },\n  rocket: {\n    motion: 'float',\n    hand: [6, 30],\n    art:\n      `<g transform=\"rotate(35 20 20)\"><path d=\"M14 30Q20 44 26 30Z\" fill=\"#ffb020\"/>` +\n      `<path d=\"M12 23L5 32H12ZM28 23L35 32H28Z\" fill=\"#ff6b5e\"/><path d=\"M20 1C30 8 32 20 28 31H12C8 20 10 8 20 1Z\" fill=\"${paper}\"/>` +\n      `<circle cx=\"20\" cy=\"15\" r=\"4.5\" fill=\"#5ab8ff\"/></g>`,\n  },\n  pencil: {\n    hand: [8, 24],\n    art:\n      `<g transform=\"rotate(135 20 20)\"><rect x=\"0\" y=\"16\" width=\"6\" height=\"8\" rx=\"2\" fill=\"#ff8fa3\"/>` +\n      `<rect x=\"6\" y=\"16\" width=\"4\" height=\"8\" fill=\"${metal}\"/><rect x=\"10\" y=\"16\" width=\"22\" height=\"8\" fill=\"#ffc93c\"/>` +\n      `<path d=\"M32 16L41 20L32 24Z\" fill=\"#f6dcb4\"/><path d=\"M38 18.7L41 20L38 21.3Z\" fill=\"${ink}\"/></g>`,\n  },\n  scales: {\n    motion: 'sway',\n    hand: [16, 34],\n    art:\n      `<path d=\"M20 5V36M12 37H28M5 10H35M5 10L1 22M5 10L9 22M35 10L31 22M35 10L39 22\" fill=\"none\"/>` +\n      `<path d=\"M0 22Q5 28 10 22Z M30 22Q35 28 40 22Z\" fill=\"#ffd34d\"/><circle cx=\"20\" cy=\"5\" r=\"2.6\" fill=\"#ffd34d\"/>`,\n  },\n  bell: {\n    motion: 'ring',\n    art:\n      `<circle cx=\"20\" cy=\"33\" r=\"4\" fill=\"#ffb020\"/><path d=\"M20 4C10 4 8 14 8 22L4 30H36L32 22C32 14 30 4 20 4Z\" fill=\"#ffd34d\"/>` +\n      `<circle cx=\"20\" cy=\"4\" r=\"2.6\" fill=\"#ffd34d\"/>`,\n  },\n  heart: {\n    motion: 'pulse',\n    art:\n      `<path d=\"M20 36C6 26 2 18 4 11C6 4 15 3 20 10C25 3 34 4 36 11C38 18 34 26 20 36Z\" fill=\"#ff5c7a\"/>` +\n      `<path d=\"M9 12Q10 9 13 8.6\" fill=\"none\" stroke=\"#fff\" stroke-width=\"2.4\"/>`,\n  },\n  play: {\n    motion: 'pulse',\n    art: `<circle cx=\"20\" cy=\"20\" r=\"17\" fill=\"${dark}\"/><path d=\"M16 12L28 20L16 28Z\" fill=\"#fff\" stroke=\"none\"/>`,\n  },\n  image: {\n    art:\n      `<rect x=\"2\" y=\"5\" width=\"36\" height=\"30\" rx=\"4\" fill=\"${paper}\"/><rect x=\"6\" y=\"9\" width=\"28\" height=\"22\" rx=\"2\" fill=\"#bfe3ff\" stroke-width=\"2\"/>` +\n      `<path d=\"M7 30L16 19L22 25L27 20L33 27V30Z\" fill=\"#4a8cff\" stroke-width=\"2\"/><circle cx=\"28\" cy=\"14\" r=\"3\" fill=\"#ffd34d\" stroke=\"none\"/>`,\n  },\n  'map-pin': {\n    motion: 'float',\n    art: `<path d=\"M20 38C20 38 6 24 6 15A14 14 0 0 1 34 15C34 24 20 38 20 38Z\" fill=\"#ff6b5e\"/><circle cx=\"20\" cy=\"15\" r=\"5\" fill=\"#fff\"/>`,\n  },\n  map: {\n    art:\n      `<path d=\"M2 8L13 4L27 8L38 4V32L27 36L13 32L2 36Z\" fill=\"${paper}\"/><path d=\"M13 4V32M27 8V36\" fill=\"none\" stroke-width=\"2\"/>` +\n      `<path d=\"M6 26C10 20 16 24 20 18S30 14 34 10\" fill=\"none\" stroke=\"#ff6b5e\" stroke-width=\"2.2\" stroke-dasharray=\"3 3\"/>`,\n  },\n  plane: {\n    motion: 'float',\n    hand: [6, 30],\n    art: `<path transform=\"rotate(45 20 20)\" d=\"M20 2Q23 2 23 6V16L38 24V28L23 23V32L28 36V39L20 37L12 39V36L17 32V23L2 28V24L17 16V6Q17 2 20 2Z\" fill=\"${paper}\"/>`,\n  },\n  suitcase: {\n    art:\n      `<path d=\"M14 10V5Q14 3 16 3H24Q26 3 26 5V10\" fill=\"none\" stroke-width=\"3\"/><rect x=\"3\" y=\"10\" width=\"34\" height=\"27\" rx=\"4\" fill=\"#e2763a\"/>` +\n      `<path d=\"M12 10V37M28 10V37\" fill=\"none\" stroke=\"#a84f20\" stroke-width=\"3\"/>`,\n  },\n  bag: {\n    art: `<path d=\"M13 12V9A7 7 0 0 1 27 9V12\" fill=\"none\" stroke-width=\"3\"/><path d=\"M5 12H35L33 38H7Z\" fill=\"#e46bd3\"/>`,\n  },\n  cart: {\n    art:\n      `<path d=\"M10 12H37L33 28H13Z\" fill=\"#5ab8ff\"/><path d=\"M1 6H8L13 28H33\" fill=\"none\" stroke-width=\"3\"/>` +\n      `<circle cx=\"15\" cy=\"34\" r=\"3.2\" fill=\"${ink}\"/><circle cx=\"31\" cy=\"34\" r=\"3.2\" fill=\"${ink}\"/>`,\n  },\n  leaf: {\n    motion: 'sway',\n    art: `<path d=\"M4 36C4 16 16 4 36 4C36 24 24 36 4 36Z\" fill=\"#3ccf91\"/><path d=\"M6 34L28 12M16 24H24M16 24V16\" fill=\"none\" stroke-width=\"2\"/>`,\n  },\n  plant: {\n    motion: 'sway',\n    hand: [8, 30],\n    art:\n      `<path d=\"M20 22C12 20 8 12 10 4C18 6 22 14 20 22Z M20 22C26 16 34 14 38 16C34 24 26 24 20 22Z\" fill=\"#3ccf91\"/>` +\n      `<path d=\"M8 25H32L29 39H11Z\" fill=\"#e0784a\"/><rect x=\"6\" y=\"21\" width=\"28\" height=\"6\" rx=\"2\" fill=\"#e0784a\"/>`,\n  },\n  dumbbell: {\n    hand: [16, 22],\n    art:\n      `<rect x=\"6\" y=\"17\" width=\"28\" height=\"6\" rx=\"2\" fill=\"${metal}\"/><rect x=\"1\" y=\"9\" width=\"8\" height=\"22\" rx=\"2.5\" fill=\"${dark}\"/>` +\n      `<rect x=\"31\" y=\"9\" width=\"8\" height=\"22\" rx=\"2.5\" fill=\"${dark}\"/><rect x=\"-3\" y=\"13\" width=\"4\" height=\"14\" rx=\"1.5\" fill=\"${dark}\"/>` +\n      `<rect x=\"39\" y=\"13\" width=\"4\" height=\"14\" rx=\"1.5\" fill=\"${dark}\"/>`,\n  },\n  gamepad: {\n    art:\n      `<path d=\"M8 10H32C38 10 40 18 39 26C38 34 32 36 28 30L25 26H15L12 30C8 36 2 34 1 26C0 18 2 10 8 10Z\" fill=\"${dark}\"/>` +\n      `<path d=\"M10 17V24M6.5 20.5H13.5\" stroke=\"#fff\" stroke-width=\"2.4\"/>` +\n      `<circle cx=\"28\" cy=\"18\" r=\"2.4\" fill=\"#ff6b5e\" stroke=\"none\"/><circle cx=\"32\" cy=\"22.5\" r=\"2.4\" fill=\"#5ab8ff\" stroke=\"none\"/>`,\n  },\n  clapper: {\n    art:\n      `<rect x=\"2\" y=\"14\" width=\"36\" height=\"24\" rx=\"2\" fill=\"${dark}\"/>` +\n      `<g transform=\"rotate(-14 2 13)\"><rect x=\"2\" y=\"6\" width=\"36\" height=\"7\" fill=\"#fff\"/>` +\n      `<path d=\"M8 6L13 13M17 6L22 13M26 6L31 13\" stroke-width=\"3\"/></g><path d=\"M8 22H32M8 29H24\" fill=\"none\" stroke=\"#fff\" stroke-width=\"2\"/>`,\n  },\n  newspaper: {\n    art:\n      `<rect x=\"2\" y=\"4\" width=\"36\" height=\"32\" rx=\"2\" fill=\"${paper}\"/><rect x=\"6\" y=\"8\" width=\"28\" height=\"5\" fill=\"${ink}\" stroke=\"none\"/>` +\n      `<rect x=\"6\" y=\"16\" width=\"12\" height=\"10\" fill=\"#bfe3ff\" stroke-width=\"2\"/><path d=\"M22 17H34M22 21H34M22 25H34M6 30H34\" fill=\"none\" stroke-width=\"2\"/>`,\n  },\n  telescope: {\n    hand: [12, 26],\n    art:\n      `<path d=\"M18 24L10 39M18 24L26 39M18 24V39\" fill=\"none\"/>` +\n      `<g transform=\"rotate(-32 20 18)\"><rect x=\"2\" y=\"13\" width=\"32\" height=\"10\" rx=\"3\" fill=\"#ff8fa3\"/>` +\n      `<rect x=\"32\" y=\"11\" width=\"6\" height=\"14\" rx=\"2\" fill=\"${dark}\"/><rect x=\"-2\" y=\"15\" width=\"5\" height=\"6\" rx=\"1.5\" fill=\"${dark}\"/></g>`,\n  },\n  paw: {\n    motion: 'pulse',\n    art:\n      `<circle cx=\"20\" cy=\"20\" r=\"19\" fill=\"${paper}\"/><g fill=\"${dark}\" stroke=\"none\"><ellipse cx=\"20\" cy=\"26\" rx=\"8.5\" ry=\"7\"/>` +\n      `<circle cx=\"9\" cy=\"16\" r=\"3.6\"/><circle cx=\"16\" cy=\"10\" r=\"3.6\"/><circle cx=\"24\" cy=\"10\" r=\"3.6\"/><circle cx=\"31\" cy=\"16\" r=\"3.6\"/></g>`,\n  },\n  house: {\n    art:\n      `<path d=\"M4 20L20 6L36 20V38H4Z\" fill=\"#fff4dc\"/><path d=\"M0 21L20 2L40 21L35 21L20 8L5 21Z\" fill=\"#e2574c\"/>` +\n      `<rect x=\"16\" y=\"26\" width=\"8\" height=\"12\" fill=\"#c98b4b\"/><rect x=\"27\" y=\"22\" width=\"6\" height=\"6\" fill=\"#bfe3ff\" stroke-width=\"2\"/>`,\n  },\n  key: {\n    motion: 'sway',\n    art:\n      `<rect x=\"16\" y=\"17\" width=\"22\" height=\"5\" rx=\"1\" fill=\"#ffd34d\"/><path d=\"M30 22V28M35 22V26\" stroke-width=\"3.4\"/>` +\n      `<circle cx=\"10\" cy=\"19.5\" r=\"8.5\" fill=\"#ffd34d\"/><circle cx=\"10\" cy=\"19.5\" r=\"3\" fill=\"#fff\"/>`,\n  },\n  car: {\n    art:\n      `<path d=\"M2 28V21Q2 18 6 17L11 10Q13 8 16 8H26Q29 8 31 11L35 17Q39 18 39 22V28Z\" fill=\"#8a7cff\"/>` +\n      `<path d=\"M13 16L16 11H20V16ZM23 11H27L30 16H23Z\" fill=\"#d8f0ff\" stroke-width=\"2\"/>` +\n      `<circle cx=\"11\" cy=\"29\" r=\"5\" fill=\"${dark}\"/><circle cx=\"30\" cy=\"29\" r=\"5\" fill=\"${dark}\"/>` +\n      `<circle cx=\"11\" cy=\"29\" r=\"2\" fill=\"${metal}\" stroke=\"none\"/><circle cx=\"30\" cy=\"29\" r=\"2\" fill=\"${metal}\" stroke=\"none\"/>`,\n  },\n  target: {\n    art:\n      `<circle cx=\"20\" cy=\"20\" r=\"18\" fill=\"#fff\"/><circle cx=\"20\" cy=\"20\" r=\"12\" fill=\"#ff6b5e\"/><circle cx=\"20\" cy=\"20\" r=\"6\" fill=\"#fff\"/>` +\n      `<circle cx=\"20\" cy=\"20\" r=\"2\" fill=\"${ink}\"/><path d=\"M20 20L36 4\" fill=\"none\"/><path d=\"M33 3L39 1L37 7Z\" fill=\"#3ccf91\"/>`,\n  },\n  phone: {\n    art:\n      `<rect x=\"9\" y=\"2\" width=\"22\" height=\"36\" rx=\"5\" fill=\"${dark}\"/><rect x=\"12\" y=\"6\" width=\"16\" height=\"26\" rx=\"2\" fill=\"#8fd3ff\" stroke=\"none\"/>` +\n      `<path d=\"M15 12H25M15 17H22\" stroke=\"#fff\" stroke-width=\"2.4\"/>`,\n  },\n  chat: {\n    art:\n      `<path d=\"M4 6H36Q39 6 39 9V26Q39 29 36 29H18L10 36V29H4Q1 29 1 26V9Q1 6 4 6Z\" fill=\"${paper}\"/>` +\n      `<g fill=\"${ink}\" stroke=\"none\"><circle class=\"sm-dot\" cx=\"12\" cy=\"17.5\" r=\"2.6\"/><circle class=\"sm-dot\" cx=\"20\" cy=\"17.5\" r=\"2.6\"/>` +\n      `<circle class=\"sm-dot\" cx=\"28\" cy=\"17.5\" r=\"2.6\"/></g>`,\n  },\n  coffee: {\n    art:\n      `<path d=\"M14 8Q11 5 14 2M22 8Q19 5 22 2\" fill=\"none\" stroke=\"#9aa0ad\" stroke-width=\"2.2\" class=\"sm-steam\"/>` +\n      `<path d=\"M30 17Q38 17 38 24Q38 31 30 31\" fill=\"none\" stroke-width=\"3\"/><path d=\"M6 12H30V32Q30 38 24 38H12Q6 38 6 32Z\" fill=\"${paper}\"/>` +\n      `<path d=\"M6 18H30\" stroke=\"#c98b4b\" stroke-width=\"2\"/>`,\n  },\n  bowl: {\n    art:\n      `<path d=\"M22 2L34 16M27 1L38 13\" stroke=\"#c98b4b\" stroke-width=\"3\"/>` +\n      `<path d=\"M6 18Q10 10 16 14Q20 8 26 13Q32 10 34 18Z\" fill=\"#ffb020\"/><path d=\"M2 18H38Q36 36 20 36Q4 36 2 18Z\" fill=\"${paper}\"/>` +\n      `<path d=\"M8 25Q20 29 32 25\" fill=\"none\" stroke=\"#ff6b5e\" stroke-width=\"2\"/>`,\n  },\n  music: {\n    motion: 'float',\n    art:\n      `<path d=\"M17 31V8L33 4V27\" fill=\"none\" stroke-width=\"3\"/><path d=\"M17 8L33 4\" stroke-width=\"5\"/>` +\n      `<ellipse cx=\"12\" cy=\"32\" rx=\"6\" ry=\"5\" fill=\"${ink}\"/><ellipse cx=\"28\" cy=\"28\" rx=\"6\" ry=\"5\" fill=\"${ink}\"/>`,\n  },\n  mic: {\n    art:\n      `<path d=\"M8 18Q8 30 20 30Q32 30 32 18M20 30V38M13 38H27\" fill=\"none\"/><rect x=\"13\" y=\"2\" width=\"14\" height=\"22\" rx=\"7\" fill=\"#9aa0ad\"/>` +\n      `<path d=\"M13 9H18M13 14H18M13 19H18\" stroke-width=\"2\"/>`,\n  },\n  cloud: {\n    motion: 'float',\n    art:\n      `<path d=\"M12 30Q3 30 3 23Q3 16 11 16Q13 8 21 8Q30 8 31 17Q38 17 38 23.5Q38 30 31 30Z\" fill=\"${paper}\"/>` +\n      `<path d=\"M12 34L10 39M20 34L18 39M28 34L26 39\" fill=\"none\" stroke=\"#5ab8ff\" stroke-width=\"2.6\"/>`,\n  },\n  sun: {\n    motion: 'sway',\n    art:\n      `<path d=\"M20 2V8M20 32V38M2 20H8M32 20H38M7 7L11 11M29 29L33 33M7 33L11 29M29 11L33 7\" fill=\"none\" stroke=\"#ffb020\" stroke-width=\"3\"/>` +\n      `<circle cx=\"20\" cy=\"20\" r=\"9\" fill=\"#ffd34d\"/>`,\n  },\n  lightning: {\n    motion: 'pulse',\n    art: `<path d=\"M24 2L8 22H19L15 38L32 16H21Z\" fill=\"#ffd34d\"/>`,\n  },\n  trophy: {\n    art:\n      `<path d=\"M10 8H4Q4 18 11 18M30 8H36Q36 18 29 18\" fill=\"none\" stroke-width=\"3\"/>` +\n      `<path d=\"M10 4H30V14Q30 26 20 26Q10 26 10 14Z\" fill=\"#ffd34d\"/><path d=\"M20 26V32\" stroke-width=\"3\"/>` +\n      `<rect x=\"12\" y=\"32\" width=\"16\" height=\"6\" rx=\"1.5\" fill=\"#c98b4b\"/>`,\n  },\n  gear: {\n    motion: 'sway',\n    art:\n      `<circle cx=\"20\" cy=\"20\" r=\"14\" fill=\"none\" stroke=\"#9aa0ad\" stroke-width=\"8\" stroke-dasharray=\"5.5 5.5\"/>` +\n      `<circle cx=\"20\" cy=\"20\" r=\"11.5\" fill=\"#9aa0ad\"/><circle cx=\"20\" cy=\"20\" r=\"4.5\" fill=\"#fff\"/>`,\n  },\n  database: {\n    art:\n      `<path d=\"M4 8V32Q20 40 36 32V8\" fill=\"#8a7cff\"/><ellipse cx=\"20\" cy=\"8\" rx=\"16\" ry=\"5\" fill=\"#b3a9ff\"/>` +\n      `<path d=\"M4 16Q20 24 36 16M4 24Q20 32 36 24\" fill=\"none\"/>`,\n  },\n  gift: {\n    motion: 'ring',\n    art:\n      `<rect x=\"4\" y=\"16\" width=\"32\" height=\"22\" rx=\"2\" fill=\"#ff6b5e\"/><rect x=\"2\" y=\"10\" width=\"36\" height=\"8\" rx=\"2\" fill=\"#ff8a7e\"/>` +\n      `<rect x=\"17\" y=\"10\" width=\"6\" height=\"28\" fill=\"#ffd34d\" stroke-width=\"2\"/><path d=\"M20 10C14 2 6 6 12 10ZM20 10C26 2 34 6 28 10Z\" fill=\"#ffd34d\"/>`,\n  },\n  palette: {\n    art:\n      `<path d=\"M20 4C8 4 2 12 2 20C2 30 10 36 18 36C22 36 22 32 20 30C18 28 20 25 24 25H30C35 25 38 22 38 17C38 10 30 4 20 4Z\" fill=\"#f6dcb4\"/>` +\n      `<g stroke=\"none\"><circle cx=\"11\" cy=\"17\" r=\"3.4\" fill=\"#ff6b5e\"/><circle cx=\"18\" cy=\"10.5\" r=\"3.4\" fill=\"#ffd34d\"/>` +\n      `<circle cx=\"27.5\" cy=\"11.5\" r=\"3.4\" fill=\"#4aa3ff\"/><circle cx=\"10\" cy=\"26\" r=\"3.4\" fill=\"#3ccf91\"/></g>`,\n  },\n  bulb: {\n    motion: 'pulse',\n    art:\n      `<path d=\"M4 6L8 9M36 6L32 9M20 0V3\" fill=\"none\" stroke=\"#ffb020\" stroke-width=\"2.6\"/>` +\n      `<path d=\"M20 5A12 12 0 0 0 13 26V30H27V26A12 12 0 0 0 20 5Z\" fill=\"#ffe680\"/><rect x=\"13\" y=\"30\" width=\"14\" height=\"7\" rx=\"2\" fill=\"#9aa0ad\"/>`,\n  },\n});\n\nexport type MonsterItem = keyof typeof itemParts;\nexport const items = Object.keys(itemParts) as MonsterItem[];\n\nexport const defaultHand: Point = [3, 25];\n"
    },
    {
      "path": "registry/sprout/lib/sprout/monster-avatar-presets.ts",
      "type": "registry:lib",
      "target": "lib/sprout/monster-avatar-presets.ts",
      "content": "import type {\n  MonsterBody,\n  MonsterColor,\n  MonsterEars,\n  MonsterEyes,\n  MonsterHat,\n  MonsterItem,\n  MonsterMouth,\n  MonsterPattern,\n} from '@/lib/sprout/monster-avatar-parts';\n\ntype Row = [\n  string,\n  MonsterBody,\n  MonsterColor,\n  MonsterEars,\n  MonsterEyes,\n  MonsterMouth,\n  MonsterHat,\n  MonsterItem,\n  MonsterPattern?,\n];\n\nconst rows: Row[] = [\n  ['Marketing', 'blob', 'blue', 'cat', 'round', 'grin', 'none', 'megaphone'],\n  ['Growth', 'fluffy', 'purple', 'none', 'shades', 'smile', 'none', 'laptop'],\n  ['Sales', 'blob', 'pink', 'horns', 'round', 'smile', 'none', 'chart'],\n  ['Strategy', 'tall', 'green', 'antennae', 'sleepy', 'smile', 'none', 'target'],\n  ['Research', 'blob', 'yellow', 'cat', 'glasses', 'smile', 'none', 'document'],\n  ['Data Science', 'round', 'teal', 'antennae', 'glasses', 'flat', 'none', 'flask'],\n  ['Analytics', 'blob', 'red', 'horns', 'round', 'smile', 'none', 'bars'],\n  ['Product', 'blob', 'purple', 'none', 'round', 'smile', 'headphones', 'laptop'],\n  ['Operations', 'fluffy', 'green', 'none', 'sleepy', 'flat', 'none', 'clipboard'],\n  ['Engineering', 'blob', 'blue', 'cat', 'round', 'smile', 'hard-hat', 'gear'],\n  ['Support', 'blob', 'pink', 'horns', 'content', 'smile', 'headset', 'phone'],\n  ['Customer Success', 'tall', 'yellow', 'cat', 'round', 'smile', 'none', 'chat'],\n  ['Content', 'fluffy', 'lime', 'none', 'glasses', 'smile', 'none', 'book'],\n  ['Design', 'blob', 'orange', 'horns', 'sleepy', 'smile', 'beanie', 'palette'],\n  ['HR', 'round', 'purple', 'cat', 'content', 'smile', 'none', 'heart'],\n  ['Finance', 'blob', 'blue', 'cat', 'sleepy', 'flat', 'none', 'calculator'],\n  ['Business Intelligence', 'bell', 'pink', 'horns', 'sleepy', 'smile', 'none', 'chart'],\n  ['Project Manager', 'blob', 'green', 'none', 'sleepy', 'smile', 'cap', 'clipboard'],\n  ['Product Launch', 'blob', 'purple', 'none', 'round', 'grin', 'astronaut', 'rocket'],\n  ['Developer', 'tall', 'blue', 'cat', 'sleepy', 'flat', 'none', 'code'],\n  ['Security', 'blob', 'green', 'horns', 'sleepy', 'smile', 'none', 'shield'],\n  ['Go-to-Market', 'fluffy', 'yellow', 'horns', 'round', 'smile', 'none', 'globe'],\n  ['Localization', 'blob', 'purple', 'cat', 'round', 'cat', 'none', 'map'],\n  ['Legal', 'tall', 'red', 'horns', 'sleepy', 'flat', 'none', 'scales'],\n  ['Learning', 'blob', 'blue', 'cat', 'round', 'o', 'grad-cap', 'none'],\n  ['Education', 'round', 'green', 'none', 'content', 'smile', 'grad-cap', 'book'],\n  ['Writing', 'blob', 'pink', 'horns', 'round', 'smile', 'none', 'pencil'],\n  ['Documentation', 'fluffy', 'orange', 'cat', 'glasses', 'flat', 'none', 'document'],\n  ['Meeting', 'blob', 'teal', 'cat', 'content', 'smile', 'headset', 'calendar'],\n  ['Email', 'blob', 'purple', 'cat', 'sleepy', 'smile', 'none', 'email'],\n  ['Calendar', 'tall', 'green', 'cat', 'sleepy', 'smile', 'none', 'calendar'],\n  ['Workflow', 'square', 'blue', 'cat', 'sleepy', 'smile', 'none', 'lightning'],\n  ['Investigator', 'blob', 'pink', 'horns', 'sleepy', 'smile', 'bow', 'magnifier'],\n  ['Experiment', 'blob', 'yellow', 'cat', 'wide', 'o', 'none', 'flask'],\n  ['Reporting', 'fluffy', 'green', 'cat', 'sleepy', 'smile', 'none', 'bars'],\n  ['Notifications', 'blob', 'purple', 'cat', 'sleepy', 'flat', 'none', 'bell'],\n  ['Audio', 'blob', 'green', 'none', 'content', 'smile', 'headphones', 'music'],\n  ['Video', 'round', 'orange', 'cat', 'round', 'grin', 'none', 'play'],\n  ['Visual', 'blob', 'purple', 'cat', 'sleepy', 'smile', 'none', 'image'],\n  ['Travel', 'blob', 'blue', 'cat', 'sleepy', 'smile', 'none', 'plane'],\n  ['Maps', 'bell', 'purple', 'horns', 'content', 'smile', 'none', 'map-pin'],\n  ['Real Estate', 'blob', 'green', 'horns', 'round', 'smile', 'none', 'house'],\n  ['Commerce', 'round', 'yellow', 'cat', 'happy', 'grin', 'none', 'bag'],\n  ['Recipe', 'blob', 'blue', 'none', 'sleepy', 'smile', 'chef-hat', 'bowl'],\n  ['Sustainability', 'blob', 'green', 'cat', 'content', 'smile', 'sprout', 'leaf'],\n  ['Health', 'blob', 'orange', 'horns', 'round', 'smile', 'none', 'heart'],\n  ['Fitness', 'blob', 'blue', 'cat', 'round', 'grin', 'none', 'dumbbell'],\n  ['Weather', 'blob', 'pink', 'bunny', 'content', 'smile', 'none', 'cloud'],\n  ['Lifestyle', 'fluffy', 'lime', 'none', 'shades', 'smile', 'sun-hat', 'sun'],\n  ['Trip Planner', 'blob', 'blue', 'cat', 'round', 'smile', 'none', 'suitcase'],\n  ['Transport', 'blob', 'yellow', 'horns', 'sleepy', 'smile', 'none', 'car'],\n  ['Home', 'round', 'teal', 'cat', 'content', 'smile', 'none', 'key'],\n  ['Gardening', 'blob', 'red', 'horns', 'sleepy', 'smile', 'sprout', 'plant'],\n  ['Pet Care', 'blob', 'green', 'cat', 'sleepy', 'smile', 'none', 'paw'],\n  ['Gaming', 'blob', 'purple', 'horns', 'sleepy', 'fangs', 'none', 'gamepad'],\n  ['Entertainment', 'blob', 'blue', 'cat', 'round', 'smile', 'none', 'clapper'],\n  ['News', 'blob', 'yellow', 'cat', 'glasses', 'flat', 'none', 'newspaper'],\n  ['Astrology', 'blob', 'pink', 'horns', 'content', 'o', 'wizard', 'telescope'],\n  ['Database', 'square', 'teal', 'antennae', 'round', 'smile', 'none', 'database'],\n  ['Ideas', 'blob', 'yellow', 'tuft', 'wide', 'o', 'none', 'bulb'],\n  ['Rewards', 'round', 'orange', 'bear', 'happy', 'grin', 'crown', 'trophy'],\n  ['Celebration', 'blob', 'pink', 'bunny', 'wink', 'grin', 'party', 'gift'],\n  ['Morning Brief', 'bell', 'orange', 'tuft', 'sleepy', 'smile', 'beanie', 'coffee'],\n  ['Bud', 'blob', 'pink', 'cat', 'round', 'smile', 'tulip', 'none'],\n  ['Monitoring', 'tall', 'red', 'antennae', 'cyclops', 'fangs', 'none', 'magnifier'],\n  ['Shopping', 'square', 'lime', 'bear', 'round', 'smile', 'none', 'cart'],\n  ['Podcast', 'bell', 'teal', 'none', 'content', 'o', 'headphones', 'mic'],\n  ['Explorer', 'anteater', 'pink', 'bear', 'sleepy', 'flat', 'none', 'none', 'spots'],\n  ['Tracker', 'anteater', 'teal', 'bear', 'round', 'smile', 'none', 'map'],\n  ['Courier', 'anteater', 'orange', 'horns', 'content', 'smile', 'cap', 'gift'],\n  ['Cheerleader', 'cheer', 'green', 'none', 'round', 'fangs', 'none', 'none'],\n  ['Greeter', 'cheer', 'yellow', 'cat', 'happy', 'grin', 'none', 'chat'],\n  ['Champion', 'cheer', 'red', 'horns', 'round', 'grin', 'crown', 'trophy'],\n  ['Guardian', 'round', 'yellow', 'none', 'happy', 'smile', 'halo', 'shield'],\n];\n\nconst textures: MonsterPattern[] = ['plain', 'spots', 'plain', 'stripes', 'fur'];\n\nexport const presets = rows.map(([name, body, color, ears, eyes, mouth, hat, item, pattern], index) => ({\n  name,\n  config: {\n    body,\n    color,\n    pattern: pattern ?? (body === 'fluffy' ? 'fur' : textures[index % textures.length]!),\n    ears,\n    eyes,\n    mouth,\n    hat,\n    item,\n  },\n}));\n"
    }
  ],
  "css": {
    "@layer components": {
      ".sprout-monster": {
        "--sprout-monster-size": "4rem",
        "width": "var(--sprout-monster-size)",
        "height": "var(--sprout-monster-size)",
        "vertical-align": "middle",
        "user-select": "none",
        "flex-shrink": "0",
        "display": "inline-block",
        "position": "relative"
      },
      ".sprout-monster-figure, .sprout-monster-layer": {
        "width": "100%",
        "height": "100%",
        "position": "absolute",
        "inset": "0"
      },
      ".sprout-monster-layer": {
        "overflow": "visible"
      },
      "@media (prefers-reduced-motion: no-preference)": {
        ".sprout-monster[data-animated] .sprout-monster-figure": {
          "transform-origin": "50% 92.6%",
          "animation": "sprout-monster-breathe 3.4s ease-in-out var(--sm-delay) infinite"
        },
        ".sprout-monster[data-animated] .sprout-monster-eyes": {
          "animation": "sprout-monster-blink var(--sm-blink) linear var(--sm-delay) infinite"
        },
        ".sprout-monster[data-animated] [data-motion=\"bob\"]": {
          "animation": "sprout-monster-bob 2.8s ease-in-out var(--sm-delay) infinite"
        },
        ".sprout-monster[data-animated] [data-motion=\"sway\"]": {
          "animation": "sprout-monster-sway 3.6s ease-in-out var(--sm-delay) infinite"
        },
        ".sprout-monster[data-animated] [data-motion=\"wave\"]": {
          "animation": "sprout-monster-wave 2.4s ease-in-out var(--sm-delay) infinite"
        },
        ".sprout-monster[data-animated] [data-motion=\"float\"]": {
          "animation": "sprout-monster-float 2.6s ease-in-out var(--sm-delay) infinite"
        },
        ".sprout-monster[data-animated] [data-motion=\"pulse\"]": {
          "animation": "sprout-monster-pulse 1.8s ease-in-out var(--sm-delay) infinite"
        },
        ".sprout-monster[data-animated] [data-motion=\"ring\"]": {
          "animation": "sprout-monster-ring 3.2s ease-in-out var(--sm-delay) infinite"
        },
        ".sprout-monster[data-animated] .sm-dot": {
          "animation": "1.2s ease-in-out infinite sprout-monster-dot"
        },
        ".sprout-monster[data-animated] .sm-dot:nth-child(2)": {
          "animation-delay": ".2s"
        },
        ".sprout-monster[data-animated] .sm-dot:nth-child(3)": {
          "animation-delay": ".4s"
        },
        ".sprout-monster[data-animated] .sm-steam": {
          "animation": "2s ease-in-out infinite sprout-monster-steam"
        },
        ".sprout-monster[data-offscreen], .sprout-monster[data-offscreen] *": {
          "animation-play-state": "paused !important"
        }
      },
      "@keyframes sprout-monster-breathe": {
        "0%, 100%": {
          "transform": "scale(1)"
        },
        "50%": {
          "transform": "scale(.985, 1.03)"
        }
      },
      "@keyframes sprout-monster-blink": {
        "0%, 93%, 99%, 100%": {
          "transform": "scaleY(1)"
        },
        "96%": {
          "transform": "scaleY(.08)"
        }
      },
      "@keyframes sprout-monster-bob": {
        "0%, 100%": {
          "transform": "rotate(0) translateY(0)"
        },
        "50%": {
          "transform": "rotate(-4deg) translateY(-1.5%)"
        }
      },
      "@keyframes sprout-monster-sway": {
        "0%, 100%": {
          "transform": "rotate(-4deg)"
        },
        "50%": {
          "transform": "rotate(4deg)"
        }
      },
      "@keyframes sprout-monster-wave": {
        "0%, 50%, 100%": {
          "transform": "rotate(0)"
        },
        "12%, 37%": {
          "transform": "rotate(-10deg)"
        },
        "25%": {
          "transform": "rotate(4deg)"
        }
      },
      "@keyframes sprout-monster-float": {
        "0%, 100%": {
          "transform": "translateY(0)"
        },
        "50%": {
          "transform": "translateY(-4%)"
        }
      },
      "@keyframes sprout-monster-pulse": {
        "0%, 60%, 100%": {
          "transform": "scale(1)"
        },
        "30%": {
          "transform": "scale(1.08)"
        }
      },
      "@keyframes sprout-monster-ring": {
        "0%, 66%, 92%, 100%": {
          "transform": "rotate(0)"
        },
        "72%": {
          "transform": "rotate(-10deg)"
        },
        "78%": {
          "transform": "rotate(9deg)"
        },
        "84%": {
          "transform": "rotate(-6deg)"
        },
        "88%": {
          "transform": "rotate(3deg)"
        }
      },
      "@keyframes sprout-monster-dot": {
        "0%, 60%, 100%": {
          "opacity": ".25"
        },
        "30%": {
          "opacity": "1"
        }
      },
      "@keyframes sprout-monster-steam": {
        "0%, 100%": {
          "opacity": ".2"
        },
        "50%": {
          "opacity": "1"
        }
      }
    }
  },
  "docs": "Docs and examples: https://sprout.tulipfarm.ai/components/monster-avatar/",
  "meta": {
    "source": "packages/sprout/src/components/monster-avatar.tsx"
  }
}
