@roxyapi/ui 0.19.3 → 0.20.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.
Files changed (126) hide show
  1. package/AGENTS.md +10 -7
  2. package/README.md +9 -6
  3. package/components-catalog.json +166 -114
  4. package/dist/cdn/components/arudha-padas.js +313 -0
  5. package/dist/cdn/components/arudha-padas.js.map +7 -0
  6. package/dist/cdn/components/chara-karakas.js +313 -0
  7. package/dist/cdn/components/chara-karakas.js.map +7 -0
  8. package/dist/cdn/components/dasha-timeline.js +4 -4
  9. package/dist/cdn/components/dasha-timeline.js.map +4 -4
  10. package/dist/cdn/components/endpoint-form.js +1 -1
  11. package/dist/cdn/components/endpoint-form.js.map +1 -1
  12. package/dist/cdn/components/kp-chart.js +4 -4
  13. package/dist/cdn/components/kp-chart.js.map +4 -4
  14. package/dist/cdn/components/kp-ruling-planets.js +3 -3
  15. package/dist/cdn/components/kp-ruling-planets.js.map +4 -4
  16. package/dist/cdn/components/reference-card.js +3 -3
  17. package/dist/cdn/components/reference-card.js.map +2 -2
  18. package/dist/cdn/components/synastry-chart.js +3 -3
  19. package/dist/cdn/components/synastry-chart.js.map +2 -2
  20. package/dist/cdn/components/upagraha-table.js +313 -0
  21. package/dist/cdn/components/upagraha-table.js.map +7 -0
  22. package/dist/cdn/components/vedic-planets-table.js +2 -2
  23. package/dist/cdn/components/vedic-planets-table.js.map +2 -2
  24. package/dist/cdn/components/yoga-list.js +4 -4
  25. package/dist/cdn/components/yoga-list.js.map +3 -3
  26. package/dist/cdn/roxy-ui.js +78 -78
  27. package/dist/cdn/roxy-ui.js.map +4 -4
  28. package/dist/cdn/widgets.js +1 -1
  29. package/dist/components/arudha-padas.d.ts +22 -0
  30. package/dist/components/arudha-padas.d.ts.map +1 -0
  31. package/dist/components/arudha-padas.js +2 -0
  32. package/dist/components/arudha-padas.js.map +7 -0
  33. package/dist/components/chara-karakas.d.ts +22 -0
  34. package/dist/components/chara-karakas.d.ts.map +1 -0
  35. package/dist/components/chara-karakas.js +2 -0
  36. package/dist/components/chara-karakas.js.map +7 -0
  37. package/dist/components/dasha-timeline.d.ts +18 -13
  38. package/dist/components/dasha-timeline.d.ts.map +1 -1
  39. package/dist/components/dasha-timeline.js +1 -1
  40. package/dist/components/dasha-timeline.js.map +4 -4
  41. package/dist/components/endpoint-form.js +1 -1
  42. package/dist/components/endpoint-form.js.map +1 -1
  43. package/dist/components/kp-chart.d.ts +7 -0
  44. package/dist/components/kp-chart.d.ts.map +1 -1
  45. package/dist/components/kp-chart.js +1 -1
  46. package/dist/components/kp-chart.js.map +4 -4
  47. package/dist/components/kp-ruling-planets.d.ts +6 -0
  48. package/dist/components/kp-ruling-planets.d.ts.map +1 -1
  49. package/dist/components/kp-ruling-planets.js +1 -1
  50. package/dist/components/kp-ruling-planets.js.map +4 -4
  51. package/dist/components/reference-card.d.ts +2 -2
  52. package/dist/components/reference-card.d.ts.map +1 -1
  53. package/dist/components/reference-card.js +1 -1
  54. package/dist/components/reference-card.js.map +2 -2
  55. package/dist/components/synastry-chart.d.ts +3 -13
  56. package/dist/components/synastry-chart.d.ts.map +1 -1
  57. package/dist/components/synastry-chart.js +2 -2
  58. package/dist/components/synastry-chart.js.map +2 -2
  59. package/dist/components/upagraha-table.d.ts +22 -0
  60. package/dist/components/upagraha-table.d.ts.map +1 -0
  61. package/dist/components/upagraha-table.js +2 -0
  62. package/dist/components/upagraha-table.js.map +7 -0
  63. package/dist/components/vedic-planets-table.d.ts +10 -1
  64. package/dist/components/vedic-planets-table.d.ts.map +1 -1
  65. package/dist/components/vedic-planets-table.js +1 -1
  66. package/dist/components/vedic-planets-table.js.map +2 -2
  67. package/dist/components/yoga-list.d.ts +13 -2
  68. package/dist/components/yoga-list.d.ts.map +1 -1
  69. package/dist/components/yoga-list.js +1 -1
  70. package/dist/components/yoga-list.js.map +3 -3
  71. package/dist/generated/endpoint-bindings.d.ts.map +1 -1
  72. package/dist/index.cjs +43 -43
  73. package/dist/index.cjs.map +4 -4
  74. package/dist/index.d.ts +3 -0
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +41 -41
  77. package/dist/index.js.map +4 -4
  78. package/dist/manifest.d.ts.map +1 -1
  79. package/dist/manifest.json +3 -0
  80. package/dist/schemas/get--astrology-horoscope-sign-daily.json +1 -1
  81. package/dist/schemas/get--astrology-horoscope-sign-monthly.json +1 -1
  82. package/dist/schemas/get--astrology-horoscope-sign-weekly.json +1 -1
  83. package/dist/schemas/get--astrology-moon-phase-current.json +1 -1
  84. package/dist/schemas/get--vedic-astrology-avasthas-id.json +1 -0
  85. package/dist/schemas/get--vedic-astrology-avasthas.json +1 -0
  86. package/dist/schemas/get--vedic-astrology-kp-ayanamsa.json +1 -1
  87. package/dist/schemas/get--vedic-astrology-yoga-id.json +1 -1
  88. package/dist/schemas/post--vedic-astrology-arudha.json +1 -0
  89. package/dist/schemas/post--vedic-astrology-birth-chart.json +1 -1
  90. package/dist/schemas/post--vedic-astrology-chara-karakas.json +1 -0
  91. package/dist/schemas/post--vedic-astrology-dasha-current.json +1 -1
  92. package/dist/schemas/post--vedic-astrology-dasha-major.json +1 -1
  93. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha-sookshma.json +1 -0
  94. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha.json +1 -1
  95. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha.json +1 -1
  96. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha.json +1 -1
  97. package/dist/schemas/post--vedic-astrology-kp-chart.json +1 -1
  98. package/dist/schemas/post--vedic-astrology-kp-cusps.json +1 -1
  99. package/dist/schemas/post--vedic-astrology-kp-ruling-planets-interval.json +1 -1
  100. package/dist/schemas/post--vedic-astrology-kp-ruling-planets.json +1 -1
  101. package/dist/schemas/post--vedic-astrology-panchang-detailed.json +1 -1
  102. package/dist/types/index.d.ts +1 -1
  103. package/dist/types/index.d.ts.map +1 -1
  104. package/dist/types/types.gen.d.ts +3203 -843
  105. package/dist/types/types.gen.d.ts.map +1 -1
  106. package/dist/utils/house-themes.d.ts +19 -0
  107. package/dist/utils/house-themes.d.ts.map +1 -0
  108. package/dist/version.d.ts +1 -1
  109. package/package.json +1 -1
  110. package/src/components/arudha-padas.ts +230 -0
  111. package/src/components/chara-karakas.ts +241 -0
  112. package/src/components/dasha-timeline.ts +129 -28
  113. package/src/components/kp-chart.ts +40 -5
  114. package/src/components/kp-ruling-planets.ts +29 -6
  115. package/src/components/reference-card.ts +3 -1
  116. package/src/components/synastry-chart.ts +15 -22
  117. package/src/components/upagraha-table.ts +182 -0
  118. package/src/components/vedic-planets-table.ts +34 -4
  119. package/src/components/yoga-list.ts +144 -20
  120. package/src/generated/endpoint-bindings.ts +13 -0
  121. package/src/index.ts +3 -0
  122. package/src/manifest.ts +48 -7
  123. package/src/types/index.ts +1 -1
  124. package/src/types/types.gen.ts +3181 -791
  125. package/src/utils/house-themes.ts +36 -0
  126. package/src/version.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/synastry-chart.ts", "../../src/tokens/index.ts", "../../src/utils/base-element.ts", "../../src/utils/base-styles.ts", "../../src/utils/key-guard.ts", "../../src/utils/fetch-controller.ts", "../../src/utils/markup-data.ts", "../../src/utils/degree.ts", "../../src/utils/disclosure.ts", "../../src/utils/string.ts", "../../src/utils/format.ts", "../../src/utils/interp-accordion.ts"],
4
- "sourcesContent": ["import { css, html, nothing, svg } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { PLANET_GLYPH, SIGN_GLYPH, SIGNS_ORDER } from '../tokens/index.js';\nimport type {\n\tCalculateSynastryResponse,\n\tNatalChartResponse,\n} from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { longitudeToSignPosition, polarToCartesian } from '../utils/degree.js';\nimport { chevron, disclosureStyles } from '../utils/disclosure.js';\nimport {\n\tASPECT_CLASS,\n\tformatAspectName,\n\tformatNumber,\n\tnormalizeAspect,\n} from '../utils/format.js';\nimport { interpAccordionStyles } from '../utils/interp-accordion.js';\nimport { capitalize } from '../utils/string.js';\n\ntype PlanetEntry = NatalChartResponse['planets'][number];\ntype InterAspect = CalculateSynastryResponse['interAspects'][number];\ntype SynastrySummary = CalculateSynastryResponse['summary'];\ntype SynastryPerson = CalculateSynastryResponse['person1'];\n\n/** How many inter-aspects get a full reading before the rest fall back to the catalog table. A synastry can return 90+ contacts; a practitioner works the tightest ones. */\nconst READING_COUNT = 12;\n\n// Drawing the dual wheel requires per-person planet longitudes alongside\n// the synastry response. Callers can merge planet arrays from\n// /astrology/natal-chart into `person1.planets` and `person2.planets`\n// before passing the payload in; without them, the component falls back\n// to the inter-aspects table and a status note instead of an empty wheel.\ntype SynastryWithPlanets = CalculateSynastryResponse & {\n\tperson1?: { planets?: PlanetEntry[] };\n\tperson2?: { planets?: PlanetEntry[] };\n};\n\nconst SIZE = 360;\nconst CENTER = SIZE / 2;\nconst OUTER_R = 170;\nconst SIGN_R = 154;\nconst P1_R = 124;\nconst P2_R = 96;\n\n/**\n * Dual-wheel synastry chart with inter-aspects table. Pass `data` from\n * /astrology/synastry.\n */\n@customElement('roxy-synastry-chart')\nexport class RoxySynastryChart extends RoxyDataElement<SynastryWithPlanets> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tdisclosureStyles,\n\t\tinterpAccordionStyles,\n\t\tcss`.wrap{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);grid-template-columns:minmax(0,1fr);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.score{font-variant-numeric:tabular-nums;font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-ink,#b45309);font-size:var(--roxy-text-xl,1.5rem)}svg{width:100%;max-width:var(--roxy-chart-max-width,560px);aspect-ratio:1;height:auto;margin:0 auto;display:block}.wheel-line{fill:none;stroke:var(--roxy-border,#e4e4e7)}.sign{fill:var(--roxy-secondary,#475569);font-size:14px}.p1{fill:var(--roxy-accent,#f59e0b);font-size:13px;font-weight:600}.p2{fill:var(--roxy-info,#0284c7);font-size:13px;font-weight:600}.person-tag{opacity:.85;font-size:7px;font-weight:700}.planet-deg{fill:var(--roxy-muted,#71717a);font-size:7px;font-family:var(--roxy-font-sans)}.planet-deg .retro{fill:var(--roxy-danger,#dc2626)}.asc-tick{stroke:var(--roxy-accent-ink,#b45309);stroke-width:1px;opacity:.75}.asc-label{fill:var(--roxy-accent-ink,#b45309);font-size:9px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.04em}.aspect{stroke-width:.8px;fill:none;opacity:.5}.aspect-trine,.aspect-sextile{stroke:var(--roxy-success,#16a34a)}.aspect-square,.aspect-opposition{stroke:var(--roxy-danger,#dc2626)}.aspect-conjunction{stroke:var(--roxy-accent-ink,#b45309)}.aspect-other{stroke:var(--roxy-muted,#71717a);opacity:.35}.legend-row{gap:var(--roxy-space-md,1rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);margin-top:calc(var(--roxy-space-xs,.25rem) * -1);flex-wrap:wrap;display:flex}.legend-row .swatch{vertical-align:middle;border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}.summary{color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);margin:0}.people{gap:var(--roxy-space-sm,.5rem);grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));display:grid}.person{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);gap:.3rem;display:grid}.person-name{font-weight:var(--roxy-weight-bold,600);font-size:var(--roxy-text-sm,.875rem);align-items:center;gap:.4rem;display:flex}.person-dot{border-radius:50%;flex-shrink:0;width:8px;height:8px}.person-dot.p1{background:var(--roxy-accent,#f59e0b)}.person-dot.p2{background:var(--roxy-info,#0284c7)}.big-three{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a);flex-wrap:wrap;gap:.25rem .75rem;display:flex}.big-three span{align-items:baseline;gap:.25rem;display:inline-flex}.big-three .lbl{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem)}.summary-pills{gap:var(--roxy-space-xs,.25rem);flex-wrap:wrap;display:flex}.pill{border-radius:var(--roxy-radius-full,9999px);font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent);color:var(--roxy-fg,#0a0a0a);padding:2px 8px}.pill--success{background:color-mix(in srgb, var(--roxy-success,#16a34a) 12%, transparent);color:var(--roxy-success-fg,#166534)}.pill--danger{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);color:var(--roxy-danger-fg,#991b1b)}.glyph{font-size:1.1em;line-height:1}.static-head{align-items:center;gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);flex-wrap:wrap;font-weight:500;display:flex}.asp-name{font-weight:var(--roxy-weight-bold,600);text-transform:capitalize}.asp-name.harmonious{color:var(--roxy-success-fg,#166534)}.asp-name.challenging{color:var(--roxy-danger-fg,#991b1b)}.interp-keywords{flex-wrap:wrap;gap:.25rem;display:flex}.interp-keywords .kw{border-radius:var(--roxy-radius-full,9999px);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-xs,.75rem);padding:1px 8px}.context{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;font-weight:var(--roxy-weight-bold,600)}.catalog>summary{cursor:pointer;font-weight:var(--roxy-weight-bold,600);font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a);align-items:center;gap:.5rem;display:flex}.scroll{min-width:0;margin-top:var(--roxy-space-sm,.5rem);overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:left}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}td.orb{font-variant-numeric:tabular-nums;color:var(--roxy-muted,#71717a)}.lists{gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));display:grid}.lists h3{margin:0 0 var(--roxy-space-xs,.25rem) 0;font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.lists ul{padding-left:var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);margin:0}.missing-planets{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 8%, transparent);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);line-height:1.5}.missing-planets code{font-family:var(--roxy-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);background:color-mix(in srgb, var(--roxy-fg,#0a0a0a) 6%, transparent);border-radius:4px;padding:0 4px;font-size:.95em}`,\n\t];\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No synastry data</div>`;\n\t}\n\n\tprotected renderData(d: SynastryWithPlanets) {\n\t\tconst { person1, person2, compatibilityScore, analysis } = d;\n\t\tconst interAspects = d.interAspects ?? [];\n\t\tconst p1Planets = person1?.planets ?? [];\n\t\tconst p2Planets = person2?.planets ?? [];\n\n\t\tconst score =\n\t\t\ttypeof compatibilityScore === 'number'\n\t\t\t\t? Math.round(compatibilityScore)\n\t\t\t\t: undefined;\n\t\tconst summaryText = analysis?.overall;\n\t\tconst strengths = analysis?.strengths ?? [];\n\t\tconst challenges = analysis?.challenges ?? [];\n\n\t\t// /astrology/synastry returns chart highlights (Sun, Moon, Ascendant) but\n\t\t// not full planet positions, so the dual wheel cannot be drawn from a bare\n\t\t// synastry response. Say so instead of rendering a blank wheel; every other\n\t\t// block still renders, so a caller who passes the bare response gets the\n\t\t// full reading minus the drawing.\n\t\tconst hasPlanets = p1Planets.length > 0 && p2Planets.length > 0;\n\t\t// The tightest contacts carry the reading. Sort a copy: `data` is the\n\t\t// caller's object.\n\t\tconst ranked = [...interAspects].sort(\n\t\t\t(a, b) => (b.strength ?? 0) - (a.strength ?? 0),\n\t\t);\n\t\tconst lead = ranked.slice(0, READING_COUNT);\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Synastry compatibility chart\"><div class=\"head\"><h2 class=\"title\">Synastry</h2>${\n\t\t\t\t\ttypeof score === 'number'\n\t\t\t\t\t\t? html`<span class=\"score\" aria-label=\"${`Score ${score} of 100`}\">${score} / 100</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div>${this.renderPeople(person1, person2)} ${\n\t\t\t\thasPlanets\n\t\t\t\t\t? html`<svg viewBox=\"0 0 ${SIZE} ${SIZE}\" role=\"img\" aria-label=\"Dual chart wheel comparing two natal charts\"><title>Synastry dual wheel</title><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${OUTER_R}\" stroke-width=\"1.5\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${P2_R + 14}\" stroke-width=\"0.8\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${P2_R - 14}\" stroke-width=\"0.6\"/>${this.renderSpokes()} ${this.renderSigns()} ${this.renderInterAspectLines(p1Planets, p2Planets, interAspects)} ${this.renderRing(p1Planets, P1_R, 'p1', 1)} ${this.renderRing(p2Planets, P2_R, 'p2', 2)} ${this.renderAscendants(d)}</svg><div class=\"legend-row\"><span><span class=\"swatch\" style=\"background:var(--roxy-accent)\"></span>Person 1</span> <span><span class=\"swatch\" style=\"background:var(--roxy-info)\"></span>Person 2</span> <span><span class=\"swatch\" style=\"background:var(--roxy-success)\"></span>harmonious</span> <span><span class=\"swatch\" style=\"background:var(--roxy-danger)\"></span>challenging</span></div>`\n\t\t\t\t\t: html`<div class=\"missing-planets\" role=\"status\">Synastry response missing planet positions. Pass <code>data</code> with <code>person1.planets</code> and <code>person2.planets</code> arrays from the natal-chart endpoint, or use the <code>&lt;roxy-data></code> fallback.</div>`\n\t\t\t} ${this.renderSummaryPills(d.summary)} ${summaryText ? html`<p class=\"summary\">${summaryText}</p>` : nothing} ${\n\t\t\t\tlead.length > 0\n\t\t\t\t\t? html`<section class=\"block\"><h3>Inter-aspects</h3>${lead.map((a, i) => this.renderAspectCard(a, i))}</section>`\n\t\t\t\t\t: nothing\n\t\t\t} ${ranked.length > lead.length ? this.renderCatalog(ranked) : nothing} ${\n\t\t\t\tstrengths.length > 0 || challenges.length > 0\n\t\t\t\t\t? html`<div class=\"lists\">${\n\t\t\t\t\t\t\tstrengths.length\n\t\t\t\t\t\t\t\t? html`<div><h3>Strengths</h3><ul>${strengths.map((s) => html`<li>${s}</li>`)}</ul></div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t} ${\n\t\t\t\t\t\t\tchallenges.length\n\t\t\t\t\t\t\t\t? html`<div><h3>Challenges</h3><ul>${challenges.map((s) => html`<li>${s}</li>`)}</ul></div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}</div>`\n\t\t\t\t\t: nothing\n\t\t\t}</div>`;\n\t}\n\n\t/** Chart highlights for both people: the Sun, Moon, and Ascendant a reader checks before any aspect. Colour-dotted to match each person ring on the wheel. */\n\tprivate renderPeople(\n\t\tp1: SynastryPerson | undefined,\n\t\tp2: SynastryPerson | undefined,\n\t) {\n\t\tconst card = (p: SynastryPerson | undefined, index: 1 | 2) => {\n\t\t\tif (!p) return nothing;\n\t\t\tconst big: Array<[string, string]> = [\n\t\t\t\t['Sun', p.sunSign ?? ''],\n\t\t\t\t['Moon', p.moonSign ?? ''],\n\t\t\t\t[\n\t\t\t\t\t'Asc',\n\t\t\t\t\tp.ascendant\n\t\t\t\t\t\t? `${p.ascendant.sign} ${formatNumber(p.ascendant.degree, 0)}\u00B0`\n\t\t\t\t\t\t: '',\n\t\t\t\t],\n\t\t\t];\n\t\t\tconst shown = big.filter(([, value]) => value);\n\t\t\tif (shown.length === 0) return nothing;\n\t\t\treturn html`<div class=\"person\"><span class=\"person-name\"><span class=\"person-dot p${index}\" aria-hidden=\"true\"></span> ${p.name || `Person ${index}`}</span><div class=\"big-three\">${shown.map(\n\t\t\t\t\t\t([label, value]) => html`<span><span class=\"lbl\">${label}</span> <span aria-hidden=\"true\">${SIGN_GLYPH[capitalize(value.split(' ')[0] ?? '')] ?? ''}</span> ${value}</span>`,\n\t\t\t\t\t)}</div></div>`;\n\t\t};\n\t\tconst cards = [card(p1, 1), card(p2, 2)].filter((c) => c !== nothing);\n\t\tif (cards.length === 0) return nothing;\n\t\treturn html`<div class=\"people\">${cards}</div>`;\n\t}\n\n\t/** Contact balance for the pair. `byType` is a map, so its pairs are rendered, never the object. */\n\tprivate renderSummaryPills(s: SynastrySummary | undefined) {\n\t\tif (!s || typeof s !== 'object') return nothing;\n\t\tconst byType = Object.entries(s.byType ?? {}).sort((a, b) => b[1] - a[1]);\n\t\tif (typeof s.total !== 'number' && byType.length === 0) return nothing;\n\t\treturn html`<div class=\"summary-pills\" role=\"region\" aria-label=\"Inter-aspect summary\">${typeof s.total === 'number' ? html`<span class=\"pill\">Total: ${s.total}</span>` : nothing} <span class=\"pill pill--success\">Harmonious: ${s.harmonious}</span> <span class=\"pill pill--danger\">Challenging: ${s.challenging}</span> <span class=\"pill\">Neutral: ${s.neutral}</span> ${byType.map(\n\t\t\t\t([type, count]) =>\n\t\t\t\t\thtml`<span class=\"pill\">${formatAspectName({ type })}: ${count}</span>`,\n\t\t\t)}</div>`;\n\t}\n\n\t/**\n\t * One inter-chart contact as a reading. The header is the scannable line (both bodies, the aspect coloured by nature, orb and strength); the body leads with `meaning.relationshipContext`, which is the whole point of a synastry aspect: not what a trine means, but what THIS trine does to THESE two people.\n\t */\n\tprivate renderAspectCard(a: InterAspect, index: number) {\n\t\tconst g1 = PLANET_GLYPH[capitalize(a.planet1)] ?? '';\n\t\tconst g2 = PLANET_GLYPH[capitalize(a.planet2)] ?? '';\n\t\tconst nature = (a.interpretation ?? 'neutral').toLowerCase();\n\t\tconst meaning = a.meaning;\n\t\tconst lead = html`<span class=\"interp-lead\"><span aria-hidden=\"true\" class=\"glyph\">${g1}</span>${a.planet1} <span class=\"asp-name ${nature}\">${formatAspectName(a)}</span> <span aria-hidden=\"true\" class=\"glyph\">${g2}</span>${a.planet2}</span>`;\n\t\tconst aside = html`<span class=\"interp-aside\"><small>orb ${formatNumber(a.orb, 2)}\u00B0 \u00B7 str ${formatNumber(a.strength, 0)}</small></span>`;\n\t\tif (!meaning?.relationshipContext && !meaning?.description?.short) {\n\t\t\treturn html`<div class=\"interp-card\"><div class=\"static-head\">${lead}${aside}</div></div>`;\n\t\t}\n\t\treturn html`<details class=\"interp-card\" name=\"synastry-aspects\" ?open=\"${index === 0}\"><summary>${lead}${chevron()}${aside}</summary><div class=\"interp-body\">${\n\t\t\t\t\tmeaning.relationshipContext\n\t\t\t\t\t\t? html`<p><span class=\"context\">In this pairing</span> ${meaning.relationshipContext}</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t} ${meaning.description?.short ? html`<p>${meaning.description.short}</p>` : nothing} ${\n\t\t\t\t\tmeaning.keywords?.length\n\t\t\t\t\t\t? html`<div class=\"interp-keywords\">${meaning.keywords.map((k) => html`<span class=\"kw\">${k}</span>`)}</div>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div></details>`;\n\t}\n\n\t/** Every remaining contact, so nothing the endpoint returned is dropped. */\n\tprivate renderCatalog(ranked: InterAspect[]) {\n\t\treturn html`<details class=\"catalog\"><summary>${chevron()} All ${ranked.length} inter-aspects</summary><div class=\"scroll\">${this.renderAspects(ranked)}</div></details>`;\n\t}\n\n\tprivate toAngle(longitude: number): number {\n\t\treturn 180 - longitude;\n\t}\n\n\tprivate renderSpokes() {\n\t\treturn Array.from({ length: 12 }, (_, i) => {\n\t\t\tconst angle = this.toAngle(i * 30);\n\t\t\tconst start = polarToCartesian(CENTER, CENTER, P2_R - 14, angle);\n\t\t\tconst end = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\treturn svg`<line class=\"wheel-line\" x1=${start.x} y1=${start.y} x2=${end.x} y2=${end.y} stroke-width=\"0.6\" />`;\n\t\t});\n\t}\n\n\tprivate renderSigns() {\n\t\treturn SIGNS_ORDER.map((s, i) => {\n\t\t\tconst angle = this.toAngle(i * 30 + 15);\n\t\t\tconst pos = polarToCartesian(CENTER, CENTER, SIGN_R, angle);\n\t\t\treturn svg`<text class=\"sign\" x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${SIGN_GLYPH[s]}</text>`;\n\t\t});\n\t}\n\n\tprivate renderRing(\n\t\tplanets: PlanetEntry[],\n\t\tradius: number,\n\t\tcls: string,\n\t\tpersonIndex: 1 | 2,\n\t) {\n\t\treturn planets.map((p) => {\n\t\t\tif (!Number.isFinite(p.longitude)) return nothing;\n\t\t\tconst angle = this.toAngle(p.longitude);\n\t\t\tconst pos = polarToCartesian(CENTER, CENTER, radius, angle);\n\t\t\t// Degree label sits one tier inward from the glyph so the two\n\t\t\t// concentric rings never blur their numbers into the aspect lines.\n\t\t\tconst degOffset = personIndex === 1 ? -12 : -10;\n\t\t\tconst degPos = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tradius + degOffset,\n\t\t\t\tangle,\n\t\t\t);\n\t\t\tconst glyph = PLANET_GLYPH[capitalize(p.name)] ?? p.name.slice(0, 2);\n\t\t\tconst sp = longitudeToSignPosition(p.longitude);\n\t\t\tconst retro = p.isRetrograde === true;\n\t\t\tconst degLabel = `${sp.degree}\u00B0${String(sp.minute).padStart(2, '0')}'`;\n\t\t\tconst tooltip = `${p.name}${retro ? ' retrograde' : ''} - ${degLabel} ${sp.sign}`;\n\t\t\treturn svg`<g>\n\t\t\t\t<text class=${cls} x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\"><title>${tooltip}</title>${glyph}<tspan class=\"person-tag\" dy=\"-0.55em\" dx=\"0.15em\">${personIndex}</tspan></text>\n\t\t\t\t<text class=\"planet-deg\" x=${degPos.x} y=${degPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${sp.degree}\u00B0${retro ? svg`<tspan class=\"retro\"> \u211E</tspan>` : nothing}</text>\n\t\t\t</g>`;\n\t\t});\n\t}\n\n\t/**\n\t * Ascendant markers for both people. Drawn as small spokes at the inner\n\t * rim with the label outside, so the two rising signs are immediately\n\t * scannable on the wheel without depending on tooltips.\n\t */\n\tprivate renderAscendants(data: SynastryWithPlanets) {\n\t\tconst items: ReturnType<typeof svg>[] = [];\n\t\tconst make = (\n\t\t\tasc: { sign: string; degree: number } | undefined,\n\t\t\tpersonIndex: 1 | 2,\n\t\t) => {\n\t\t\tif (!asc) return;\n\t\t\tconst signIdx = SIGNS_ORDER.findIndex(\n\t\t\t\t(s) => s.toLowerCase() === asc.sign.toLowerCase(),\n\t\t\t);\n\t\t\tif (signIdx === -1) return;\n\t\t\tconst longitude = signIdx * 30 + asc.degree;\n\t\t\tconst angle = this.toAngle(longitude);\n\t\t\tconst innerR = personIndex === 1 ? P1_R + 14 : P2_R + 14;\n\t\t\tconst tickPos = polarToCartesian(CENTER, CENTER, innerR, angle);\n\t\t\tconst labelPos = polarToCartesian(CENTER, CENTER, OUTER_R + 14, angle);\n\t\t\titems.push(svg`<g>\n\t\t\t\t<line class=\"asc-tick\" x1=${tickPos.x} y1=${tickPos.y} x2=${labelPos.x} y2=${labelPos.y} />\n\t\t\t\t<text class=\"asc-label\" x=${labelPos.x} y=${labelPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">Asc${personIndex}</text>\n\t\t\t</g>`);\n\t\t};\n\t\tmake(data.person1?.ascendant, 1);\n\t\tmake(data.person2?.ascendant, 2);\n\t\treturn items;\n\t}\n\n\tprivate renderInterAspectLines(\n\t\tp1: PlanetEntry[],\n\t\tp2: PlanetEntry[],\n\t\taspects: InterAspect[],\n\t) {\n\t\tconst longitudeOf = (\n\t\t\tlist: PlanetEntry[],\n\t\t\tname: string,\n\t\t): number | undefined => {\n\t\t\tconst target = capitalize(name);\n\t\t\tfor (const p of list) {\n\t\t\t\tif (capitalize(p.name) !== target) continue;\n\t\t\t\tif (typeof p.longitude === 'number') return p.longitude;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t};\n\t\treturn aspects.map((a) => {\n\t\t\tconst l1 = longitudeOf(p1, a.planet1);\n\t\t\tconst l2 = longitudeOf(p2, a.planet2);\n\t\t\tif (l1 === undefined || l2 === undefined) return nothing;\n\t\t\tconst out = polarToCartesian(CENTER, CENTER, P1_R - 12, this.toAngle(l1));\n\t\t\tconst inn = polarToCartesian(CENTER, CENTER, P2_R + 8, this.toAngle(l2));\n\t\t\tconst aspectName = normalizeAspect(a);\n\t\t\tconst cls = ASPECT_CLASS[aspectName] ?? 'aspect-other';\n\t\t\tconst orbLabel = formatNumber(a.orb, 1);\n\t\t\treturn svg`<line class=${`aspect ${cls}`} x1=${out.x} y1=${out.y} x2=${inn.x} y2=${inn.y}><title>${a.planet1} ${aspectName} ${a.planet2}${orbLabel ? ` (orb ${orbLabel}\u00B0)` : ''}</title></line>`;\n\t\t});\n\t}\n\n\tprivate renderAspects(aspects: InterAspect[]) {\n\t\treturn html`<table><caption class=\"roxy-sr-only\">Inter-chart aspects: the planet from chart 1, the planet from chart 2, the aspect between them, the orb in degrees and the strength.</caption><thead><tr><th scope=\"col\">Planet 1</th><th scope=\"col\">Planet 2</th><th scope=\"col\">Aspect</th><th scope=\"col\">Orb</th><th scope=\"col\">Strength</th></tr></thead><tbody>${aspects.map(\n\t\t\t\t\t(a) => html`<tr><td>${a.planet1}</td><td>${a.planet2}</td><td>${formatAspectName(a)}</td><td class=\"orb\">${formatNumber(a.orb, 1)}</td><td>${formatNumber(a.strength, 0)}</td></tr>`,\n\t\t\t\t)}</tbody></table>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-synastry-chart': RoxySynastryChart;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\n/**\n * Glyph per aspect, keyed by the hyphen-free canonical name.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. An earlier revision used `\u22BB` XOR for quincunx and `\u22BC` NAND for semisextile, which are the two characters Unicode lists as cross-references FROM the real glyphs, and it had them the wrong way round: charts rendered a 150 degree quincunx with the 30 degree semisextile symbol and vice versa. An astrologer reads the glyph, not the tooltip.\n */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\tsemisquare: '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.js';\nimport { MarkupDataController } from './markup-data.js';\n\n/**\n * Shared base for every data-driven Roxy component. Consolidates the things every component used to repeat by hand and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.\n *\n * @remarks\n * Two render modes, one component, which is the whole drop-in contract:\n *\n * - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `<script type=\"application/json\" class=\"roxy-data\">`. {@link MarkupDataController} hydrates `data` from it on connect. No key reaches the browser. This is the path the WordPress plugin drives, and it is unchanged by the base class.\n * - Uncontrolled: no data is injected, but a `data-endpoint` and a `pk_` `publishable-key` are set. The component renders its own `<roxy-endpoint-form>` (an internal detail, never placed by the consumer), and on submit fetches through {@link FetchController}, which refuses any non-publishable key. The result populates `data` and the component renders it.\n *\n * The JavaScript `data` property always wins over markup, so a host that assigns `el.data = \u2026` after upgrade is authoritative.\n *\n * Self-fetch needs `<roxy-endpoint-form>` (and `<roxy-location-search>`) registered. The CDN bundle and the full `@roxyapi/ui` entry register everything; per-component ESM consumers that want self-fetch import the form component too.\n *\n * @example\n * ```ts\n * @customElement('roxy-dream-card')\n * export class RoxyDreamCard extends RoxyDataElement<GetDreamSymbolResponse> {\n * static styles = [baseStyles, css`.card { \u2026 }`];\n * protected renderData(d: GetDreamSymbolResponse) {\n * return html`<article class=\"card\">\u2026</article>`;\n * }\n * protected renderEmpty() {\n * return html`<div class=\"roxy-empty\" role=\"status\">No dream symbol</div>`;\n * }\n * }\n * ```\n */\nexport abstract class RoxyDataElement<T = unknown> extends LitElement {\n\tstatic styles: CSSResultGroup = [baseStyles];\n\n\t/** Typed RoxyAPI response. Assigned in JavaScript, hydrated from the roxy-data island, or set by a self-fetch. */\n\t@property({ attribute: false })\n\tdata: T | null = null;\n\n\t/** Endpoint path for self-fetch, e.g. \"astrology/natal-chart\" or \"dreams/symbols/{id}\". Empty disables self-fetch (controlled mode only). */\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = '';\n\n\t/** HTTP method for self-fetch. */\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\t@property({ type: String, attribute: 'base-url' })\n\tbaseUrl?: string;\n\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl?: string;\n\n\t/** Consumer backend route that proxies the request (holds the secret key). When set, self-fetch POSTs the request here instead of calling RoxyAPI directly, so no key reaches the browser. The server-rendered (WordPress) path. */\n\t@property({ type: String, attribute: 'submit-url' })\n\tsubmitUrl?: string;\n\n\t/** Persist the last self-fetch form values in sessionStorage (keyed by endpoint) and prefill the form on reload. */\n\t@property({ type: Boolean })\n\tremember = false;\n\n\t/** Override the self-fetch form's submit-button label. Empty derives one from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel?: string;\n\n\t/** Render a small \"Spiritual data by RoxyAPI\" credit under a self-fetch or auto-mount result. Off by default; any value except \"off\"/\"false\" enables it. The one-tag widgets script turns it on unless data-attribution=\"off\". Never shown in controlled mode. */\n\t@property({ type: String })\n\tattribution?: string;\n\n\t/** True while an uncontrolled self-fetch is in flight. Public so {@link FetchController} can drive it. */\n\t@state()\n\tloading = false;\n\n\t/** Message from a failed self-fetch, or null. Public so {@link FetchController} can drive it. */\n\t@state()\n\terror: string | null = null;\n\n\t/**\n\t * True once a self-fetch (not a consumer-assigned or island-hydrated `data`) produced the current result. It gates the interactive result affordances, so controlled mode never shows an Edit control or a sticky picker.\n\t */\n\t@state()\n\tprivate selfFetched = false;\n\n\t/** True when the visitor asked to edit a self-fetch result, so the form is restored over the result. */\n\t@state()\n\tprivate editing = false;\n\n\t/** True when the last self-fetch form was a single-enum picker, so it stays visible above the result and a change refetches. */\n\t@state()\n\tprivate sticky = false;\n\n\t/** Last submitted form values (nested per group), kept in memory to restore the form on Edit and to prefill the sticky picker. */\n\tprivate lastValues?: Record<string, unknown>;\n\n\tprivate fetcher: FetchController<T>;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Controlled mode: hydrate `data` from a direct-child roxy-data island when\n\t\t// no JS property was assigned. Keyless; the server already fetched.\n\t\tnew MarkupDataController<T>(this);\n\t\tthis.fetcher = new FetchController<T>(this);\n\t}\n\n\tprotected willUpdate(changed: PropertyValues): void {\n\t\tif (changed.has('publishableKey')) {\n\t\t\tthis.fetcher.publishableKey = this.publishableKey;\n\t\t}\n\t\tif (changed.has('baseUrl') && this.baseUrl) {\n\t\t\tthis.fetcher.baseUrl = this.baseUrl;\n\t\t}\n\t\tif (changed.has('submitUrl')) {\n\t\t\tthis.fetcher.submitUrl = this.submitUrl;\n\t\t}\n\t}\n\n\trender(): unknown {\n\t\tif (this.loading) return this.renderLoading();\n\t\tif (this.error != null) return this.renderError(this.error);\n\t\tif (this.data != null) {\n\t\t\t// Controlled mode (consumer-assigned or island-hydrated data) renders the\n\t\t\t// result alone, byte-identical to before: no picker, no Edit. The one\n\t\t\t// exception is the widgets auto-mount attrs-complete path, which assigns\n\t\t\t// data directly AND sets `attribution`; a real controlled consumer never\n\t\t\t// sets the attribute, so this stays byte-identical for them.\n\t\t\tif (!this.selfFetched) {\n\t\t\t\treturn this.showAttribution()\n\t\t\t\t\t? html`${this.renderData(this.data)}${this.renderAttribution()}`\n\t\t\t\t\t: this.renderData(this.data);\n\t\t\t}\n\t\t\tif (this.editing) return this.renderForm();\n\t\t\treturn this.renderResult(this.data);\n\t\t}\n\t\treturn this.renderNoData();\n\t}\n\n\t/** Render the populated response. The single method every component implements. */\n\tprotected abstract renderData(data: T): unknown;\n\n\t/**\n\t * A self-fetch result plus its re-query affordance. A single-enum form keeps its picker above the result so a new selection refetches (a sign switch is a new reading); any other form gets a compact Edit control that restores the form with the previous values.\n\t */\n\tprotected renderResult(data: T): unknown {\n\t\tconst body = this.sticky\n\t\t\t? html`${this.renderForm()}${this.renderData(data)}`\n\t\t\t: html`<div class=\"roxy-edit-bar\"><button type=\"button\" class=\"roxy-edit\" @click=\"${this.onEdit}\">Edit query</button></div>${this.renderData(data)}`;\n\t\treturn this.showAttribution()\n\t\t\t? html`${body}${this.renderAttribution()}`\n\t\t\t: body;\n\t}\n\n\tprivate onEdit = () => {\n\t\tthis.editing = true;\n\t};\n\n\t/** True when the attribution credit renders: the attribute is present and not explicitly disabled. */\n\tprivate showAttribution(): boolean {\n\t\treturn (\n\t\t\tthis.attribution != null &&\n\t\t\tthis.attribution !== 'off' &&\n\t\t\tthis.attribution !== 'false'\n\t\t);\n\t}\n\n\t/** Small muted credit under a self-fetch or auto-mount result. Reached only from the result path, so controlled mode never renders it. */\n\tprotected renderAttribution(): unknown {\n\t\treturn html`<div class=\"roxy-attribution\"><a href=\"https://roxyapi.com/?utm_source=widget&utm_medium=embed\" target=\"_blank\" rel=\"noopener\">Spiritual data by RoxyAPI</a></div>`;\n\t}\n\n\t/** The data-absent branch: the self-fetch form when an endpoint is set, otherwise the empty state. */\n\tprotected renderNoData(): unknown {\n\t\treturn this.endpoint ? this.renderForm() : this.renderEmpty();\n\t}\n\n\t/** Internal self-fetch form. Reuses the introspecting `<roxy-endpoint-form>`; the consumer never places it. */\n\tprotected renderForm(): unknown {\n\t\treturn html`<roxy-endpoint-form data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" publishable-key=\"${ifDefined(this.publishableKey)}\" submit-label=\"${ifDefined(this.submitLabel)}\" lang=\"${ifDefined(this.effectiveLang())}\" .initialValues=\"${this.formInitialValues()}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\n\t}\n\n\t/** Prefill source for the form: the last submission (Edit / sticky refetch) wins over remembered storage. */\n\tprivate formInitialValues(): Record<string, unknown> | undefined {\n\t\treturn (\n\t\t\tthis.lastValues ?? (this.remember ? this.readRemembered() : undefined)\n\t\t);\n\t}\n\n\t/** Site-owner language from the element `lang` attribute (native accessor), routed to the API query on submit. */\n\tprivate effectiveLang(): string | undefined {\n\t\treturn this.lang || undefined;\n\t}\n\n\tprivate onFormSubmit = (e: Event) => {\n\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\tvalues: Record<string, unknown>;\n\t\t\tqueryKeys?: string[];\n\t\t\tsticky?: boolean;\n\t\t};\n\t\tthis.lastValues = detail.values;\n\t\tthis.sticky = !!detail.sticky;\n\t\tthis.selfFetched = true;\n\t\tthis.editing = false;\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(\n\t\t\t\tthis.endpoint,\n\t\t\t\tthis.method,\n\t\t\t\tdetail.values,\n\t\t\t\tdetail.queryKeys ?? [],\n\t\t\t),\n\t\t);\n\t};\n\n\t/** sessionStorage key for this component's remembered form values, scoped by endpoint. */\n\tprivate rememberKey(): string {\n\t\treturn `roxy-ui:form:${this.endpoint}`;\n\t}\n\n\tprivate readRemembered(): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\tconst raw = sessionStorage.getItem(this.rememberKey());\n\t\t\treturn raw ? (JSON.parse(raw) as Record<string, unknown>) : undefined;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate writeRemembered(values: Record<string, unknown>): void {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.rememberKey(), JSON.stringify(values));\n\t\t} catch {\n\t\t\t// Private mode / disabled storage: remembering is best-effort, never fatal.\n\t\t}\n\t}\n\n\t/** Terminal empty state. Subclasses override for a domain-specific message. */\n\tprotected renderEmpty(): unknown {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No data</div>`;\n\t}\n\n\t/** Loading placeholder shown during a self-fetch. */\n\tprotected renderLoading(): unknown {\n\t\treturn html`<div class=\"roxy-skeleton\" style=\"height:8rem\" role=\"status\" aria-label=\"Loading\"></div>`;\n\t}\n\n\t/** Error state shown when a self-fetch fails. Keeps the form in view so the request can be retried. */\n\tprotected renderError(message: string): unknown {\n\t\tconst banner = html`<div class=\"roxy-error\" role=\"alert\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\n * The one place the \"publishable key only\" rule lives. Every client-side fetch boundary ({@link ../components/location-search.ts}, {@link ./fetch-controller.ts}) calls through here so a secret or legacy unprefixed key is refused identically: no network call, the same visible message, the same `roxy-validation-error` event. Centralising it is what stops the two paths drifting, which is exactly how `<roxy-location-search>` used to warn-then-fetch a secret key while the controller fail-closed.\n */\n\n/** Canonical refusal message. Both fetch boundaries surface this exact wording. */\nexport const KEY_REFUSED_MESSAGE =\n\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\n/** True when the key is a browser-safe `pk_` publishable key. */\nexport function isPublishableKey(key: string | undefined | null): boolean {\n\treturn !!key && key.startsWith('pk_');\n}\n\n/**\n * The fail-closed condition: a key is PRESENT and is NOT a `pk_` key. An absent key is not refused, so a keyless public call (a form-slotted city search with no key set) still proceeds; only a real secret/legacy token in the browser is stopped.\n */\nexport function keyIsRefused(key: string | undefined | null): boolean {\n\treturn !!key && !key.startsWith('pk_');\n}\n\n/**\n * Announce a refused key: dispatch the shared `roxy-validation-error` (bubbling, composed) and, when `warn` is set, log it once for the developer. The caller sets its own visible error state and skips the fetch; this only handles the parts both boundaries share.\n */\nexport function dispatchKeyRefusal(\n\thost: EventTarget,\n\topts: { warn?: boolean } = {},\n): void {\n\tif (opts.warn) console.warn(KEY_REFUSED_MESSAGE);\n\thost.dispatchEvent(\n\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\tdetail: { reason: 'possible-secret-key', message: KEY_REFUSED_MESSAGE },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t}),\n\t);\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport {\n\tdispatchKeyRefusal,\n\tKEY_REFUSED_MESSAGE,\n\tkeyIsRefused,\n} from './key-guard.js';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so the form mixin can attach a controller without the component wiring state by hand.\n *\n * @remarks\n * Intersected with `HTMLElement` because the controller dispatches events on the host. Lit's `ReactiveControllerHost` is the update-lifecycle contract only (`addController`, `requestUpdate`, `updateComplete`) and carries no DOM surface, even though every real host is a `LitElement` and therefore an `HTMLElement`. Declaring the DOM half is what the controller actually needs; it used to reach it through a `this.host as unknown as EventTarget` double cast instead, which asserted a capability the type never promised.\n */\ntype FetchHost<T> = ReactiveControllerHost &\n\tHTMLElement & {\n\t\tdata: T | null;\n\t\tloading: boolean;\n\t\terror: string | null;\n\t};\n\n/** Default RoxyAPI v2 origin. A component overrides it per instance via its `base-url` attribute. */\nconst DEFAULT_BASE_URL = 'https://roxyapi.com/api/v2';\n\n/** A single request the controller issues on the component's behalf. */\nexport interface RoxyRequest {\n\t/** Path under the API base, e.g. \"/dreams/symbols/water\" or \"/astrology/natal-chart\". */\n\tpath: string;\n\tmethod?: 'GET' | 'POST';\n\t/** JSON body for POST endpoints. */\n\tbody?: unknown;\n\t/** Query string parameters; nullish values are dropped. */\n\tquery?: Record<string, string | number | undefined>;\n}\n\n/**\n * Client-side fetch for uncontrolled (self-fetching) components: drives `host.data` / `host.loading` / `host.error` and cancels a stale request when a newer one starts or the host disconnects.\n *\n * @remarks\n * Security boundary. The only credential this ever sends is a `pk_` publishable key, which carries a server-side origin allowlist. A secret (`sk_`) or legacy unprefixed key is refused before any network call and surfaced as an error, so a server secret cannot leak into a browser request. This centralizes the guard that originated in `<roxy-location-search>` so every self-fetching component enforces it identically.\n *\n * Controlled-mode components never construct this. When a server injects the response as a `<script class=\"roxy-data\">` island, there is no key and no fetch, which is the path server-rendered consumers (WordPress, JSX SSR, static HTML) rely on.\n */\nexport class FetchController<T = unknown> implements ReactiveController {\n\tprivate readonly host: FetchHost<T>;\n\tprivate abort?: AbortController;\n\n\t/** Browser-safe publishable key. Set by the host from its `publishable-key` attribute. */\n\tpublishableKey?: string;\n\t/** API origin, overridable for self-hosted or proxied deployments. */\n\tbaseUrl = DEFAULT_BASE_URL;\n\t/**\n\t * Consumer backend route that holds the secret key. When set, the request is POSTed here as `{ path, method, body, query }` instead of called against RoxyAPI directly, so no key (publishable or secret) is sent from the browser. This is the canonical path for server-rendered hosts (WordPress); the backend proxies the request with its own `sk_` key and returns the JSON response.\n\t */\n\tsubmitUrl?: string;\n\n\tconstructor(host: FetchHost<T>) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostDisconnected() {\n\t\tthis.abort?.abort();\n\t\tthis.abort = undefined;\n\t}\n\n\t/**\n\t * Issue the request and resolve once `host.data` (success) or `host.error`\n\t * (failure) is set. A no-op return when a non-publishable key is present:\n\t * the error is already surfaced and nothing is sent.\n\t */\n\tasync run(req: RoxyRequest): Promise<void> {\n\t\t// submit-url proxy: no key leaves the browser; the consumer's backend holds it.\n\t\tif (!this.submitUrl && this.secretKeyRefused()) return;\n\t\tthis.abort?.abort();\n\t\tconst controller = new AbortController();\n\t\tthis.abort = controller;\n\t\tthis.host.loading = true;\n\t\tthis.host.error = null;\n\t\ttry {\n\t\t\tconst res = this.submitUrl\n\t\t\t\t? await fetch(this.submitUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: JSON.stringify(req),\n\t\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\t})\n\t\t\t\t: await this.callApi(req, controller.signal);\n\t\t\tif (!res.ok) throw new Error(await this.readError(res));\n\t\t\tconst json = (await res.json()) as T;\n\t\t\tif (controller.signal.aborted) return;\n\t\t\tthis.host.data = json;\n\t\t} catch (err) {\n\t\t\tif ((err as { name?: string })?.name === 'AbortError') return;\n\t\t\tthis.host.error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (this.abort === controller) this.abort = undefined;\n\t\t\tif (!controller.signal.aborted) this.host.loading = false;\n\t\t}\n\t}\n\n\t/** Direct call against RoxyAPI with the publishable key (the no-backend path). */\n\tprivate callApi(req: RoxyRequest, signal: AbortSignal): Promise<Response> {\n\t\tconst url = new URL(`${this.baseUrl}${req.path}`);\n\t\tfor (const [k, v] of Object.entries(req.query ?? {})) {\n\t\t\tif (v != null) url.searchParams.set(k, String(v));\n\t\t}\n\t\tconst headers: Record<string, string> = { Accept: 'application/json' };\n\t\tif (this.publishableKey) headers['X-API-Key'] = this.publishableKey;\n\t\tif (req.body != null) headers['Content-Type'] = 'application/json';\n\t\treturn fetch(url, {\n\t\t\tmethod: req.method ?? 'GET',\n\t\t\theaders,\n\t\t\tbody: req.body != null ? JSON.stringify(req.body) : undefined,\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/** True when a key is set and it is not a browser-safe `pk_` publishable key. Surfaces the error and refuses to send, via the shared {@link keyIsRefused} guard so every fetch boundary fail-closes identically. */\n\tprivate secretKeyRefused(): boolean {\n\t\tif (!keyIsRefused(this.publishableKey)) return false;\n\t\tthis.host.error = KEY_REFUSED_MESSAGE;\n\t\tdispatchKeyRefusal(this.host);\n\t\treturn true;\n\t}\n\n\t/** Surface the `{ error, code }` message the API returns on failure, falling back to the status code. */\n\tprivate async readError(res: Response): Promise<string> {\n\t\ttry {\n\t\t\tconst body = (await res.json()) as { error?: string };\n\t\t\tif (body?.error) return body.error;\n\t\t} catch {\n\t\t\t// Non-JSON error body: fall through to the status line.\n\t\t}\n\t\treturn `Request failed (${res.status})`;\n\t}\n}\n\n/**\n * Translate flat form values into a {@link RoxyRequest} for an endpoint. The `{name}` segments in the endpoint template are substituted from the values and removed; the rest become the JSON body for POST or query parameters for GET. This is the spec-light request builder the base element uses to turn a `<roxy-endpoint-form>` submission into a self-fetch, so a component needs no per-endpoint glue.\n *\n * @param queryKeys - Names the spec declares as `in: query` for this operation, which `<roxy-endpoint-form>` reports on its `roxy-submit` event. A POST operation can still take query parameters (every localized endpoint takes `?lang=`), and sending one in the JSON body silently drops it, so those names are routed to the query string on POST as well as GET.\n */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\n\tqueryKeys: readonly string[] = [],\n): RoxyRequest {\n\tconst rest: Record<string, unknown> = { ...values };\n\tconst path = `/${endpoint.replace(/^\\//, '')}`.replace(\n\t\t/\\{([^}]+)\\}/g,\n\t\t(_match, name: string) => {\n\t\t\tconst v = rest[name];\n\t\t\tdelete rest[name];\n\t\t\treturn encodeURIComponent(String(v ?? ''));\n\t\t},\n\t);\n\tconst inQuery = new Set(queryKeys);\n\tconst query: Record<string, string | number | undefined> = {};\n\tconst body: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(rest)) {\n\t\tif (v === undefined || v === '') continue;\n\t\tif (method === 'GET' || inQuery.has(k)) query[k] = v as string | number;\n\t\telse body[k] = v;\n\t}\n\treturn { path, method, query, body: method === 'POST' ? body : undefined };\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * Serialize a RoxyAPI response for embedding inside an inline `<script type=\"application/json\" class=\"roxy-data\">`. This is the safe writer counterpart to {@link MarkupDataController}, the reader: server-rendered and cached consumers (WordPress, JSX SSR, static HTML) emit the script with this, and the component hydrates `data` from it on connect.\n *\n * @remarks\n * Use this instead of a bare `JSON.stringify`. A raw stringify of a response that contains the literal text `</script>` (common in long interpretation prose) closes the script element early, corrupting the page and creating an HTML-injection vector. This escapes the script-unsafe characters to their `\\uXXXX` JSON escapes, which `JSON.parse` restores to the original characters, so the value the component receives is identical to the response you passed.\n *\n * `<` is the load-bearing escape (it defeats `</script>` and `<!--`). `>` and `&` are escaped for defence in depth, and U+2028 / U+2029 because they are valid in JSON yet are line terminators in a `<script>` context and break some parsers. The escapes introduce only `\\uXXXX` sequences, so the replacements never feed each other and order is irrelevant.\n *\n * Pass the unwrapped RoxyAPI response, the same shape you would assign to `element.data`. Do not pass the SDK envelope (`{ data, error, request, response }`).\n *\n * @example\n * ```ts\n * import { serializeRoxyData } from '@roxyapi/ui';\n *\n * const { data } = await roxy.dreams.getDreamSymbol({ path: { id: 'water' } });\n * const html = `<roxy-dream-card><script type=\"application/json\" class=\"roxy-data\">${serializeRoxyData(data)}</script></roxy-dream-card>`;\n * ```\n */\nexport function serializeRoxyData(data: unknown): string {\n\treturn JSON.stringify(data)\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n\n/**\n * Build the complete `<script type=\"application/json\" class=\"roxy-data\">\u2026</script>` element a server nests inside a `roxy-*` component for the no-JavaScript hydration path. The payload is escaped via {@link serializeRoxyData}, so it is safe to drop straight into HTML output.\n *\n * @remarks\n * The element carries both `type=\"application/json\"` and `class=\"roxy-data\"` because {@link MarkupDataController} reads only a direct-child script that has both. Emit one of these inside the target component; the JavaScript `data` property still wins if it is later assigned.\n *\n * @example\n * ```ts\n * import { roxyDataScript } from '@roxyapi/ui';\n *\n * const { data } = await roxy.crystals.getCrystal({ path: { id: 'amethyst' } });\n * const html = `<roxy-crystal-grid>${roxyDataScript(data)}</roxy-crystal-grid>`;\n * ```\n */\nexport function roxyDataScript(data: unknown): string {\n\treturn `<script type=\"application/json\" class=\"${ROXY_DATA_CLASS}\">${serializeRoxyData(data)}</script>`;\n}\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n", "/**\n * Math helpers for converting raw ecliptic longitude decimals into the\n * sign / degree / minute / second triplet used across chart components.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\n\nexport interface SignPosition {\n\tsign: string;\n\tsignIndex: number;\n\tdegree: number;\n\tminute: number;\n\tsecond: number;\n}\n\n/**\n * Wrap longitude into [0, 360) so negative or out-of-range values still\n * resolve to a real sign. Robust to wonky upstream data.\n */\nexport function normalizeLongitude(lon: number): number {\n\tconst wrapped = lon % 360;\n\treturn wrapped < 0 ? wrapped + 360 : wrapped;\n}\n\n/**\n * Convert decimal ecliptic longitude (0-360) into sign/degree/minute/second.\n * Used by every chart wheel and aspect table.\n */\nexport function longitudeToSignPosition(longitude: number): SignPosition {\n\tconst lon = normalizeLongitude(longitude);\n\tconst signIndex = Math.floor(lon / 30) % 12;\n\tconst within = lon % 30;\n\tconst degree = Math.floor(within);\n\tconst minuteFloat = (within - degree) * 60;\n\tconst minute = Math.floor(minuteFloat);\n\tconst second = Math.round((minuteFloat - minute) * 60);\n\treturn {\n\t\tsign: SIGNS_ORDER[signIndex] ?? 'Aries',\n\t\tsignIndex,\n\t\tdegree,\n\t\tminute,\n\t\tsecond,\n\t};\n}\n\n/** Compact display string like \"12\u00B0 Leo 34'\". Used in chart labels. */\nexport function formatSignPosition(longitude: number): string {\n\tconst { sign, degree, minute } = longitudeToSignPosition(longitude);\n\treturn `${degree}\u00B0 ${sign} ${String(minute).padStart(2, '0')}'`;\n}\n\n/** Format a within-sign decimal degree (0-30) as degree-and-minute, e.g. 17.99 to \"17\u00B059'\". The reference-grade form astrologers read when the sign is already known (asteroids, lots, directed points, fixed stars). */\nexport function formatDegreeInSign(deg: number): string {\n\tlet d = Math.floor(deg);\n\tlet m = Math.round((deg - d) * 60);\n\tif (m === 60) {\n\t\tm = 0;\n\t\td += 1;\n\t}\n\treturn `${d}\u00B0${String(m).padStart(2, '0')}'`;\n}\n\n/**\n * The point diametrically opposite a longitude (e.g. Descendant from\n * Ascendant, IC from MC). Exact derivation, always 180 degrees away.\n */\nexport function oppositePoint(longitude: number): number {\n\treturn normalizeLongitude(longitude + 180);\n}\n\n/**\n * Midpoint of the forward arc from `start` to `end` (both ecliptic\n * longitudes). Handles the 360/0 wrap, so a house spanning 350 to 20 degrees\n * yields a midpoint of 5, not 185. Used to place house numbers between two\n * cusps regardless of how unequal the house is.\n */\nexport function arcMidpoint(start: number, end: number): number {\n\tconst s = normalizeLongitude(start);\n\tlet span = normalizeLongitude(end) - s;\n\tif (span < 0) span += 360;\n\treturn normalizeLongitude(s + span / 2);\n}\n\n/** Polar to cartesian for SVG wheel positioning. Angle in degrees, 0 at 3 o'clock. */\nexport function polarToCartesian(\n\tcx: number,\n\tcy: number,\n\tradius: number,\n\tangleDeg: number,\n): { x: number; y: number } {\n\tconst angleRad = (angleDeg * Math.PI) / 180;\n\treturn {\n\t\tx: cx + radius * Math.cos(angleRad),\n\t\ty: cy + radius * Math.sin(angleRad),\n\t};\n}\n", "import type { TemplateResult } from 'lit';\nimport { css, html } from 'lit';\n\n/**\n * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the\n * browser default triangle with a thin chevron that rotates when the host\n * `<details>` opens. Render it inside the `<summary>` and pair with\n * {@link disclosureStyles}.\n */\nexport function chevron(): TemplateResult {\n\treturn html`<svg class=\"roxy-chevron\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\"><path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>`;\n}\n\n/**\n * Shared `<details>` accordion styling: hides the native disclosure triangle\n * and rotates the {@link chevron} 180 degrees when the accordion is open.\n * Import into any component that renders disclosure accordions so the chevron\n * looks and behaves identically.\n */\nexport const disclosureStyles = css`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n */\n\nimport { capitalize, humanize } from './string.js';\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst BARE_TIME = /^\\d{2}:\\d{2}(:\\d{2})?$/;\n/** An ISO datetime with NO timezone designator: a wall clock, not an instant. */\nconst NAIVE_DATETIME = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?$/;\n\n/**\n * Resolve an API timestamp to a Date plus the timezone it must be RENDERED in.\n *\n * @remarks\n * The API returns chart times naive (`2026-07-13T04:36:00`): that is 04:36 in the CHART's timezone, not UTC and not the viewer's. A wall clock must read the same for every viewer on earth, so hora at sunrise says 04:36 in Tokyo and in Chicago alike.\n *\n * Handing a naive string to `new Date()` makes the runtime interpret it in the VIEWER's zone, which is a silent corruption whenever that wall clock lands in the viewer's DST gap. In America/New_York `2026-03-08T02:30:00` does not exist, so the clock jumps and it renders as `3:30 AM`. Pinning the wall clock to UTC, which has no DST and therefore no gap, preserves the digits exactly while Intl still applies the viewer's locale conventions.\n *\n * An offset-bearing timestamp (`...Z`, `...+05:30`) IS a real instant, so it keeps the normal behaviour and converts to the viewer's local time.\n */\nexport function resolveDisplayDate(input: string): {\n\td: Date;\n\ttimeZone?: string;\n} {\n\tconst naive = BARE_TIME.test(input)\n\t\t? `1970-01-01T${input}`\n\t\t: NAIVE_DATETIME.test(input)\n\t\t\t? input\n\t\t\t: null;\n\treturn naive\n\t\t? { d: new Date(`${naive}Z`), timeZone: 'UTC' }\n\t\t: { d: new Date(input) };\n}\n\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (DATE_ONLY.test(input)) return '';\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(undefined, {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\thour12: true,\n\t\ttimeZone,\n\t});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatTimeRange(\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(t.start);\n\tconst end = formatTime(t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\n/** Two dates as one label: `Jan 1, 2026 - Jan 7, 2026`. Falls back to whichever end parses when the other is absent. */\nexport function formatDateRange(start: unknown, end: unknown): string {\n\tconst a = formatDate(start);\n\tconst b = formatDate(end);\n\tif (a && b) return `${a} - ${b}`;\n\treturn a || b;\n}\n\n/**\n * Format a number, dropping trailing zeros in the FRACTIONAL part only: `2.50` becomes `2.5`, `2.0` becomes `2`, and `100` stays `100`.\n *\n * @remarks\n * The old implementation ran `.replace(/\\.?0+$/, '')` against the whole string, which happily ate zeros off the INTEGER when there was no decimal point. At `dp = 0` that meant `100` rendered as `1`, `90` as `9`, `20` as `2`, and `0` as the empty string. It shipped: a 100 percent tight stellium displayed as \"1% tight\", and an aspect of strength 100 as \"str 1\". Guard on the decimal point, and never strip from the integer side.\n *\n * @example\n * ```ts\n * formatNumber(100, 0); // '100'\n * formatNumber(2.5, 1); // '2.5'\n * formatNumber(2, 1); // '2'\n * formatNumber(0, 0); // '0'\n * ```\n */\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\tconst fixed = value.toFixed(dp);\n\treturn fixed.includes('.') ? fixed.replace(/\\.?0+$/, '') : fixed;\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated canonical name (`SEMI_SEXTILE` and `SEMI SEXTILE` both become `semi-sextile`). Accepts any aspect-shaped object so both natal and synastry inter-aspect entries can share this.\n *\n * @remarks\n * Spaces are folded as well as underscores because the endpoints do not agree on the separator: aspects returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`. Handling only the underscore left the space form failing every {@link ASPECT_CLASS} and `ASPECT_SYMBOL` lookup, so the same aspect rendered hyphenated and correctly coloured in one component and space-separated in the neutral fallback colour in another.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '')\n\t\t.toLowerCase()\n\t\t.trim()\n\t\t.replace(/[\\s_]+/g, '-');\n}\n\n/**\n * Display label for an aspect: `SEMI_SEXTILE` -> `Semi-sextile`.\n *\n * The raw value is an API enum and the table column it lands in is read by practitioners, not parsers. {@link normalizeAspect} stays the lookup key for classes and glyphs; this is the human-facing form.\n */\nexport function formatAspectName(a: { type?: string }): string {\n\treturn capitalize(normalizeAspect(a));\n}\n\n/**\n * Display label for an ayanamsa identifier. `kp-newcomb` -> `KP Newcomb`.\n *\n * The raw values are API enums. KP is an initialism and must stay uppercase, which {@link humanize} alone cannot know, so the three known frames are mapped explicitly and anything else degrades to a humanized slug rather than rendering the enum.\n */\nconst AYANAMSA_LABEL: Record<string, string> = {\n\t'kp-newcomb': 'KP Newcomb',\n\t'kp-old': 'KP Old',\n\tlahiri: 'Lahiri',\n};\n\nexport function formatAyanamsa(type: unknown, degrees?: unknown): string {\n\tconst label =\n\t\ttypeof type === 'string' ? (AYANAMSA_LABEL[type] ?? humanize(type)) : '';\n\tconst deg =\n\t\ttypeof degrees === 'number' ? `${formatNumber(degrees, 2)}\\u00b0` : '';\n\tif (label && deg) return `${label} (${deg})`;\n\treturn label || deg;\n}\n\n/**\n * Date plus time in one label: `Jan 15, 1990, 2:30 PM`.\n *\n * @remarks\n * Components were concatenating a raw date and a raw time (`1990-01-15 \\u00b7 14:30:00`) while siblings rendered the same instant through {@link formatDate}. One helper keeps every card reading the same way.\n *\n * Birth details arrive as two fields rather than one timestamp, so `time` may be passed separately; it is merged into a naive datetime, which {@link formatDate} and {@link formatTime} pin to UTC so the wall clock renders identically for every viewer.\n *\n * @example\n * ```ts\n * formatDateTime('1990-01-15T14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('1990-01-15', '14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('1990-01-15'); // 'Jan 15, 1990'\n * ```\n */\nexport function formatDateTime(input: unknown, time?: unknown): string {\n\tconst merged =\n\t\ttypeof input === 'string' &&\n\t\tDATE_ONLY.test(input) &&\n\t\ttypeof time === 'string' &&\n\t\tBARE_TIME.test(time)\n\t\t\t? `${input}T${time}`\n\t\t\t: input;\n\tconst date = formatDate(merged);\n\tconst clock = formatTime(merged);\n\tif (date && clock) return `${date}, ${clock}`;\n\treturn date || clock;\n}\n", "/**\n * The interpretation accordion: the one way this library shows a label, a short value, and a body of prose behind a disclosure.\n *\n * @remarks\n * Exclusive by construction (`<details name>`), so a card grows by at most one open section and never becomes a wall of text. Callers pass their own group `name` so two accordions on one page do not fight over which section is open.\n *\n * This lives here rather than in a component because the same accordion is the right shape wherever an endpoint returns a labelled reading: the Human Design bodygraph and type card use it for strategy, authority, and aura; `roxy-hexagram` uses it for the changing lines. The CSS was copy-pasted into six components before 2026-07 and had already drifted (`.interp-body` had five distinct definitions), which is the drift this exists to stop. Migrate the remaining copies to it when they are next touched.\n */\n\nimport { css, html, nothing } from 'lit';\nimport { chevron } from './disclosure.js';\n\n/** One row: the label, the short value shown as the aside, and the interpretation body. `extra` renders under the body for a section that carries more than prose. */\nexport interface InterpSection {\n\tlabel: string;\n\taside?: string;\n\tbody: string;\n\textra?: unknown;\n}\n\nexport const interpAccordionStyles = css`.block{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.block h3{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.interp-card{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);margin-bottom:var(--roxy-space-xs,.25rem)}.interp-card summary{cursor:pointer;color:var(--roxy-fg,#0a0a0a);align-items:center;gap:var(--roxy-space-sm,.5rem);font-weight:500;font-size:var(--roxy-text-sm,.875rem);display:flex}.interp-card summary:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:var(--roxy-radius-sm,4px)}.interp-lead{flex-wrap:wrap;flex:auto;order:1;align-items:baseline;gap:.4rem;min-width:0;display:inline-flex}.interp-aside{flex-shrink:0;order:2;align-items:center;gap:.5rem;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted,#71717a);white-space:nowrap;font-weight:400}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-sm,.5rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);overflow-wrap:anywhere;line-height:1.6;display:grid}.interp-body p{margin:0}`;\n\n/**\n * Render the accordion. Sections with no body are dropped, so a caller can pass the full set and let a narrower response render only what it carries. `name` groups the `<details>` exclusively, so opening one closes the last.\n */\nexport function renderInterpAccordion(\n\tsections: InterpSection[],\n\tname: string,\n\theading = 'Reading',\n) {\n\tconst shown = sections.filter((s) => Boolean(s.body));\n\tif (shown.length === 0) return nothing;\n\n\treturn html`<section class=\"block\"><h3>${heading}</h3>${shown.map(\n\t\t\t(s, i) => html`<details class=\"interp-card\" name=\"${name}\" ?open=\"${i === 0}\"><summary><span class=\"interp-lead\">${s.label}</span> ${chevron()} ${s.aside ? html`<span class=\"interp-aside\"><small>${s.aside}</small></span>` : nothing}</summary><div class=\"interp-body\"><p>${s.body}</p>${s.extra ?? nothing}</div></details>`,\n\t\t)}</section>`;\n}\n"],
5
- "mappings": "0MAAA,OAAS,OAAAA,GAAK,QAAAC,EAAM,WAAAC,EAAS,OAAAC,MAAW,MACxC,OAAS,iBAAAC,OAAqB,oBCKvB,IAAMC,EAAuC,CACnD,IAAK,SACL,KAAM,SACN,QAAS,SACT,MAAO,SACP,MAAO,SACP,KAAM,SACN,QAAS,SACT,OAAQ,SACR,OAAQ,SACR,QAAS,SACT,MAAO,SACP,KAAM,SACN,KAAM,SACN,UAAW,MACX,MAAO,KACP,UAAW,SACX,UAAW,SACX,aAAc,SACd,aAAc,SACd,OAAQ,SACR,OAAQ,SACR,oBAAqB,QACtB,EAmBO,IAAMC,EAAqC,CACjD,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,IAAK,SACL,MAAO,SACP,MAAO,SACP,QAAS,SACT,YAAa,SACb,UAAW,SACX,SAAU,SACV,OAAQ,QACT,EAiBO,IAAMC,EAAc,CAC1B,QACA,SACA,SACA,SACA,MACA,QACA,QACA,UACA,cACA,YACA,WACA,QACD,EC3FA,OAEC,QAAAC,EACA,cAAAC,OAEM,MACP,OAAS,YAAAC,EAAU,SAAAC,MAAa,oBAChC,OAAS,aAAAC,MAAiB,+BCP1B,OAAS,OAAAC,OAAW,MAMb,IAAMC,EAAaD,87FCDnB,IAAME,EACZ,mIAUM,SAASC,EAAaC,EAAyC,CACrE,MAAO,CAAC,CAACA,GAAO,CAACA,EAAI,WAAW,KAAK,CACtC,CAKO,SAASC,EACfC,EACAC,EAA2B,CAAC,EACrB,CACHA,EAAK,MAAM,QAAQ,KAAKC,CAAmB,EAC/CF,EAAK,cACJ,IAAI,YAAY,wBAAyB,CACxC,OAAQ,CAAE,OAAQ,sBAAuB,QAASE,CAAoB,EACtE,QAAS,GACT,SAAU,EACX,CAAC,CACF,CACD,CCdA,IAAMC,GAAmB,6BAqBZC,EAAN,KAAiE,CAavE,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} from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { PLANET_GLYPH, SIGN_GLYPH, SIGNS_ORDER } from '../tokens/index.js';\nimport type { CalculateSynastryResponse } from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { longitudeToSignPosition, polarToCartesian } from '../utils/degree.js';\nimport { chevron, disclosureStyles } from '../utils/disclosure.js';\nimport {\n\tASPECT_CLASS,\n\tformatAspectName,\n\tformatNumber,\n\tnormalizeAspect,\n} from '../utils/format.js';\nimport { interpAccordionStyles } from '../utils/interp-accordion.js';\nimport { capitalize } from '../utils/string.js';\n\n/**\n * A planet as the synastry response now returns it.\n *\n * @remarks\n * Was `NatalChartResponse['planets'][number]`, because `/astrology/synastry` did not return positions and a caller had to merge two natal responses in by hand. The endpoint returns them as of 2026-07-26, so the wheel is drawable from ONE call. The synastry shape is the plotting subset (no `interpretation`, `speed` or `latitude`); the wheel only ever read `name`, `longitude` and `isRetrograde`, so nothing is lost.\n */\ntype PlanetEntry = CalculateSynastryResponse['person1']['planets'][number];\ntype InterAspect = CalculateSynastryResponse['interAspects'][number];\ntype SynastrySummary = CalculateSynastryResponse['summary'];\ntype SynastryPerson = CalculateSynastryResponse['person1'];\n\n/** How many inter-aspects get a full reading before the rest fall back to the catalog table. A synastry can return 90+ contacts; a practitioner works the tightest ones. */\nconst READING_COUNT = 12;\n\nconst SIZE = 360;\nconst CENTER = SIZE / 2;\nconst OUTER_R = 170;\nconst SIGN_R = 154;\nconst P1_R = 124;\nconst P2_R = 96;\n\n/**\n * Dual-wheel synastry chart with inter-aspects table. Pass `data` from\n * /astrology/synastry.\n */\n@customElement('roxy-synastry-chart')\nexport class RoxySynastryChart extends RoxyDataElement<CalculateSynastryResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tdisclosureStyles,\n\t\tinterpAccordionStyles,\n\t\tcss`.wrap{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);grid-template-columns:minmax(0,1fr);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.score{font-variant-numeric:tabular-nums;font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-ink,#b45309);font-size:var(--roxy-text-xl,1.5rem)}svg{width:100%;max-width:var(--roxy-chart-max-width,560px);aspect-ratio:1;height:auto;margin:0 auto;display:block}.wheel-line{fill:none;stroke:var(--roxy-border,#e4e4e7)}.sign{fill:var(--roxy-secondary,#475569);font-size:14px}.p1{fill:var(--roxy-accent,#f59e0b);font-size:13px;font-weight:600}.p2{fill:var(--roxy-info,#0284c7);font-size:13px;font-weight:600}.person-tag{opacity:.85;font-size:7px;font-weight:700}.planet-deg{fill:var(--roxy-muted,#71717a);font-size:7px;font-family:var(--roxy-font-sans)}.planet-deg .retro{fill:var(--roxy-danger,#dc2626)}.asc-tick{stroke:var(--roxy-accent-ink,#b45309);stroke-width:1px;opacity:.75}.asc-label{fill:var(--roxy-accent-ink,#b45309);font-size:9px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.04em}.aspect{stroke-width:.8px;fill:none;opacity:.5}.aspect-trine,.aspect-sextile{stroke:var(--roxy-success,#16a34a)}.aspect-square,.aspect-opposition{stroke:var(--roxy-danger,#dc2626)}.aspect-conjunction{stroke:var(--roxy-accent-ink,#b45309)}.aspect-other{stroke:var(--roxy-muted,#71717a);opacity:.35}.legend-row{gap:var(--roxy-space-md,1rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);margin-top:calc(var(--roxy-space-xs,.25rem) * -1);flex-wrap:wrap;display:flex}.legend-row .swatch{vertical-align:middle;border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}.summary{color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);margin:0}.people{gap:var(--roxy-space-sm,.5rem);grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));display:grid}.person{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);gap:.3rem;display:grid}.person-name{font-weight:var(--roxy-weight-bold,600);font-size:var(--roxy-text-sm,.875rem);align-items:center;gap:.4rem;display:flex}.person-dot{border-radius:50%;flex-shrink:0;width:8px;height:8px}.person-dot.p1{background:var(--roxy-accent,#f59e0b)}.person-dot.p2{background:var(--roxy-info,#0284c7)}.big-three{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a);flex-wrap:wrap;gap:.25rem .75rem;display:flex}.big-three span{align-items:baseline;gap:.25rem;display:inline-flex}.big-three .lbl{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem)}.summary-pills{gap:var(--roxy-space-xs,.25rem);flex-wrap:wrap;display:flex}.pill{border-radius:var(--roxy-radius-full,9999px);font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent);color:var(--roxy-fg,#0a0a0a);padding:2px 8px}.pill--success{background:color-mix(in srgb, var(--roxy-success,#16a34a) 12%, transparent);color:var(--roxy-success-fg,#166534)}.pill--danger{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);color:var(--roxy-danger-fg,#991b1b)}.glyph{font-size:1.1em;line-height:1}.static-head{align-items:center;gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);flex-wrap:wrap;font-weight:500;display:flex}.asp-name{font-weight:var(--roxy-weight-bold,600);text-transform:capitalize}.asp-name.harmonious{color:var(--roxy-success-fg,#166534)}.asp-name.challenging{color:var(--roxy-danger-fg,#991b1b)}.interp-keywords{flex-wrap:wrap;gap:.25rem;display:flex}.interp-keywords .kw{border-radius:var(--roxy-radius-full,9999px);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-xs,.75rem);padding:1px 8px}.context{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;font-weight:var(--roxy-weight-bold,600)}.catalog>summary{cursor:pointer;font-weight:var(--roxy-weight-bold,600);font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a);align-items:center;gap:.5rem;display:flex}.scroll{min-width:0;margin-top:var(--roxy-space-sm,.5rem);overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:left}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}td.orb{font-variant-numeric:tabular-nums;color:var(--roxy-muted,#71717a)}.lists{gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));display:grid}.lists h3{margin:0 0 var(--roxy-space-xs,.25rem) 0;font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.lists ul{padding-left:var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);margin:0}.missing-planets{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 8%, transparent);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);line-height:1.5}.missing-planets code{font-family:var(--roxy-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);background:color-mix(in srgb, var(--roxy-fg,#0a0a0a) 6%, transparent);border-radius:4px;padding:0 4px;font-size:.95em}`,\n\t];\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No synastry data</div>`;\n\t}\n\n\tprotected renderData(d: CalculateSynastryResponse) {\n\t\tconst { person1, person2, compatibilityScore, analysis } = d;\n\t\tconst interAspects = d.interAspects ?? [];\n\t\tconst p1Planets = person1?.planets ?? [];\n\t\tconst p2Planets = person2?.planets ?? [];\n\n\t\tconst score =\n\t\t\ttypeof compatibilityScore === 'number'\n\t\t\t\t? Math.round(compatibilityScore)\n\t\t\t\t: undefined;\n\t\tconst summaryText = analysis?.overall;\n\t\tconst strengths = analysis?.strengths ?? [];\n\t\tconst challenges = analysis?.challenges ?? [];\n\n\t\t// /astrology/synastry returns chart highlights (Sun, Moon, Ascendant) but\n\t\t// not full planet positions, so the dual wheel cannot be drawn from a bare\n\t\t// synastry response. Say so instead of rendering a blank wheel; every other\n\t\t// block still renders, so a caller who passes the bare response gets the\n\t\t// full reading minus the drawing.\n\t\tconst hasPlanets = p1Planets.length > 0 && p2Planets.length > 0;\n\t\t// The tightest contacts carry the reading. Sort a copy: `data` is the\n\t\t// caller's object.\n\t\tconst ranked = [...interAspects].sort(\n\t\t\t(a, b) => (b.strength ?? 0) - (a.strength ?? 0),\n\t\t);\n\t\tconst lead = ranked.slice(0, READING_COUNT);\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Synastry compatibility chart\"><div class=\"head\"><h2 class=\"title\">Synastry</h2>${\n\t\t\t\t\ttypeof score === 'number'\n\t\t\t\t\t\t? html`<span class=\"score\" aria-label=\"${`Score ${score} of 100`}\">${score} / 100</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div>${this.renderPeople(person1, person2)} ${\n\t\t\t\thasPlanets\n\t\t\t\t\t? html`<svg viewBox=\"0 0 ${SIZE} ${SIZE}\" role=\"img\" aria-label=\"Dual chart wheel comparing two natal charts\"><title>Synastry dual wheel</title><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${OUTER_R}\" stroke-width=\"1.5\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${P2_R + 14}\" stroke-width=\"0.8\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${P2_R - 14}\" stroke-width=\"0.6\"/>${this.renderSpokes()} ${this.renderSigns()} ${this.renderInterAspectLines(p1Planets, p2Planets, interAspects)} ${this.renderRing(p1Planets, P1_R, 'p1', 1)} ${this.renderRing(p2Planets, P2_R, 'p2', 2)} ${this.renderAscendants(d)}</svg><div class=\"legend-row\"><span><span class=\"swatch\" style=\"background:var(--roxy-accent)\"></span>Person 1</span> <span><span class=\"swatch\" style=\"background:var(--roxy-info)\"></span>Person 2</span> <span><span class=\"swatch\" style=\"background:var(--roxy-success)\"></span>harmonious</span> <span><span class=\"swatch\" style=\"background:var(--roxy-danger)\"></span>challenging</span></div>`\n\t\t\t\t\t: html`<div class=\"missing-planets\" role=\"status\">Synastry response missing planet positions. A current <code>/astrology/synastry</code> response carries <code>person1.planets</code> and <code>person2.planets</code>; the inter-aspect readings below still work without them.</div>`\n\t\t\t} ${this.renderSummaryPills(d.summary)} ${summaryText ? html`<p class=\"summary\">${summaryText}</p>` : nothing} ${\n\t\t\t\tlead.length > 0\n\t\t\t\t\t? html`<section class=\"block\"><h3>Inter-aspects</h3>${lead.map((a, i) => this.renderAspectCard(a, i))}</section>`\n\t\t\t\t\t: nothing\n\t\t\t} ${ranked.length > lead.length ? this.renderCatalog(ranked) : nothing} ${\n\t\t\t\tstrengths.length > 0 || challenges.length > 0\n\t\t\t\t\t? html`<div class=\"lists\">${\n\t\t\t\t\t\t\tstrengths.length\n\t\t\t\t\t\t\t\t? html`<div><h3>Strengths</h3><ul>${strengths.map((s) => html`<li>${s}</li>`)}</ul></div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t} ${\n\t\t\t\t\t\t\tchallenges.length\n\t\t\t\t\t\t\t\t? html`<div><h3>Challenges</h3><ul>${challenges.map((s) => html`<li>${s}</li>`)}</ul></div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}</div>`\n\t\t\t\t\t: nothing\n\t\t\t}</div>`;\n\t}\n\n\t/** Chart highlights for both people: the Sun, Moon, and Ascendant a reader checks before any aspect. Colour-dotted to match each person ring on the wheel. */\n\tprivate renderPeople(\n\t\tp1: SynastryPerson | undefined,\n\t\tp2: SynastryPerson | undefined,\n\t) {\n\t\tconst card = (p: SynastryPerson | undefined, index: 1 | 2) => {\n\t\t\tif (!p) return nothing;\n\t\t\tconst big: Array<[string, string]> = [\n\t\t\t\t['Sun', p.sunSign ?? ''],\n\t\t\t\t['Moon', p.moonSign ?? ''],\n\t\t\t\t[\n\t\t\t\t\t'Asc',\n\t\t\t\t\tp.ascendant\n\t\t\t\t\t\t? `${p.ascendant.sign} ${formatNumber(p.ascendant.degree, 0)}\u00B0`\n\t\t\t\t\t\t: '',\n\t\t\t\t],\n\t\t\t];\n\t\t\tconst shown = big.filter(([, value]) => value);\n\t\t\tif (shown.length === 0) return nothing;\n\t\t\treturn html`<div class=\"person\"><span class=\"person-name\"><span class=\"person-dot p${index}\" aria-hidden=\"true\"></span> ${p.name || `Person ${index}`}</span><div class=\"big-three\">${shown.map(\n\t\t\t\t\t\t([label, value]) => html`<span><span class=\"lbl\">${label}</span> <span aria-hidden=\"true\">${SIGN_GLYPH[capitalize(value.split(' ')[0] ?? '')] ?? ''}</span> ${value}</span>`,\n\t\t\t\t\t)}</div></div>`;\n\t\t};\n\t\tconst cards = [card(p1, 1), card(p2, 2)].filter((c) => c !== nothing);\n\t\tif (cards.length === 0) return nothing;\n\t\treturn html`<div class=\"people\">${cards}</div>`;\n\t}\n\n\t/** Contact balance for the pair. `byType` is a map, so its pairs are rendered, never the object. */\n\tprivate renderSummaryPills(s: SynastrySummary | undefined) {\n\t\tif (!s || typeof s !== 'object') return nothing;\n\t\tconst byType = Object.entries(s.byType ?? {}).sort((a, b) => b[1] - a[1]);\n\t\tif (typeof s.total !== 'number' && byType.length === 0) return nothing;\n\t\treturn html`<div class=\"summary-pills\" role=\"region\" aria-label=\"Inter-aspect summary\">${typeof s.total === 'number' ? html`<span class=\"pill\">Total: ${s.total}</span>` : nothing} <span class=\"pill pill--success\">Harmonious: ${s.harmonious}</span> <span class=\"pill pill--danger\">Challenging: ${s.challenging}</span> <span class=\"pill\">Neutral: ${s.neutral}</span> ${byType.map(\n\t\t\t\t([type, count]) =>\n\t\t\t\t\thtml`<span class=\"pill\">${formatAspectName({ type })}: ${count}</span>`,\n\t\t\t)}</div>`;\n\t}\n\n\t/**\n\t * One inter-chart contact as a reading. The header is the scannable line (both bodies, the aspect coloured by nature, orb and strength); the body leads with `meaning.relationshipContext`, which is the whole point of a synastry aspect: not what a trine means, but what THIS trine does to THESE two people.\n\t */\n\tprivate renderAspectCard(a: InterAspect, index: number) {\n\t\tconst g1 = PLANET_GLYPH[capitalize(a.planet1)] ?? '';\n\t\tconst g2 = PLANET_GLYPH[capitalize(a.planet2)] ?? '';\n\t\tconst nature = (a.interpretation ?? 'neutral').toLowerCase();\n\t\tconst meaning = a.meaning;\n\t\tconst lead = html`<span class=\"interp-lead\"><span aria-hidden=\"true\" class=\"glyph\">${g1}</span>${a.planet1} <span class=\"asp-name ${nature}\">${formatAspectName(a)}</span> <span aria-hidden=\"true\" class=\"glyph\">${g2}</span>${a.planet2}</span>`;\n\t\tconst aside = html`<span class=\"interp-aside\"><small>orb ${formatNumber(a.orb, 2)}\u00B0 \u00B7 str ${formatNumber(a.strength, 0)}</small></span>`;\n\t\tif (!meaning?.relationshipContext && !meaning?.description?.short) {\n\t\t\treturn html`<div class=\"interp-card\"><div class=\"static-head\">${lead}${aside}</div></div>`;\n\t\t}\n\t\treturn html`<details class=\"interp-card\" name=\"synastry-aspects\" ?open=\"${index === 0}\"><summary>${lead}${chevron()}${aside}</summary><div class=\"interp-body\">${\n\t\t\t\t\tmeaning.relationshipContext\n\t\t\t\t\t\t? html`<p><span class=\"context\">In this pairing</span> ${meaning.relationshipContext}</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t} ${meaning.description?.short ? html`<p>${meaning.description.short}</p>` : nothing} ${\n\t\t\t\t\tmeaning.keywords?.length\n\t\t\t\t\t\t? html`<div class=\"interp-keywords\">${meaning.keywords.map((k) => html`<span class=\"kw\">${k}</span>`)}</div>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div></details>`;\n\t}\n\n\t/** Every remaining contact, so nothing the endpoint returned is dropped. */\n\tprivate renderCatalog(ranked: InterAspect[]) {\n\t\treturn html`<details class=\"catalog\"><summary>${chevron()} All ${ranked.length} inter-aspects</summary><div class=\"scroll\">${this.renderAspects(ranked)}</div></details>`;\n\t}\n\n\tprivate toAngle(longitude: number): number {\n\t\treturn 180 - longitude;\n\t}\n\n\tprivate renderSpokes() {\n\t\treturn Array.from({ length: 12 }, (_, i) => {\n\t\t\tconst angle = this.toAngle(i * 30);\n\t\t\tconst start = polarToCartesian(CENTER, CENTER, P2_R - 14, angle);\n\t\t\tconst end = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\treturn svg`<line class=\"wheel-line\" x1=${start.x} y1=${start.y} x2=${end.x} y2=${end.y} stroke-width=\"0.6\" />`;\n\t\t});\n\t}\n\n\tprivate renderSigns() {\n\t\treturn SIGNS_ORDER.map((s, i) => {\n\t\t\tconst angle = this.toAngle(i * 30 + 15);\n\t\t\tconst pos = polarToCartesian(CENTER, CENTER, SIGN_R, angle);\n\t\t\treturn svg`<text class=\"sign\" x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${SIGN_GLYPH[s]}</text>`;\n\t\t});\n\t}\n\n\tprivate renderRing(\n\t\tplanets: PlanetEntry[],\n\t\tradius: number,\n\t\tcls: string,\n\t\tpersonIndex: 1 | 2,\n\t) {\n\t\treturn planets.map((p) => {\n\t\t\tif (!Number.isFinite(p.longitude)) return nothing;\n\t\t\tconst angle = this.toAngle(p.longitude);\n\t\t\tconst pos = polarToCartesian(CENTER, CENTER, radius, angle);\n\t\t\t// Degree label sits one tier inward from the glyph so the two\n\t\t\t// concentric rings never blur their numbers into the aspect lines.\n\t\t\tconst degOffset = personIndex === 1 ? -12 : -10;\n\t\t\tconst degPos = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tradius + degOffset,\n\t\t\t\tangle,\n\t\t\t);\n\t\t\tconst glyph = PLANET_GLYPH[capitalize(p.name)] ?? p.name.slice(0, 2);\n\t\t\tconst sp = longitudeToSignPosition(p.longitude);\n\t\t\tconst retro = p.isRetrograde === true;\n\t\t\tconst degLabel = `${sp.degree}\u00B0${String(sp.minute).padStart(2, '0')}'`;\n\t\t\tconst tooltip = `${p.name}${retro ? ' retrograde' : ''} - ${degLabel} ${sp.sign}`;\n\t\t\treturn svg`<g>\n\t\t\t\t<text class=${cls} x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\"><title>${tooltip}</title>${glyph}<tspan class=\"person-tag\" dy=\"-0.55em\" dx=\"0.15em\">${personIndex}</tspan></text>\n\t\t\t\t<text class=\"planet-deg\" x=${degPos.x} y=${degPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${sp.degree}\u00B0${retro ? svg`<tspan class=\"retro\"> \u211E</tspan>` : nothing}</text>\n\t\t\t</g>`;\n\t\t});\n\t}\n\n\t/**\n\t * Ascendant markers for both people. Drawn as small spokes at the inner\n\t * rim with the label outside, so the two rising signs are immediately\n\t * scannable on the wheel without depending on tooltips.\n\t */\n\tprivate renderAscendants(data: CalculateSynastryResponse) {\n\t\tconst items: ReturnType<typeof svg>[] = [];\n\t\tconst make = (\n\t\t\tasc: { sign: string; degree: number } | undefined,\n\t\t\tpersonIndex: 1 | 2,\n\t\t) => {\n\t\t\tif (!asc) return;\n\t\t\tconst signIdx = SIGNS_ORDER.findIndex(\n\t\t\t\t(s) => s.toLowerCase() === asc.sign.toLowerCase(),\n\t\t\t);\n\t\t\tif (signIdx === -1) return;\n\t\t\tconst longitude = signIdx * 30 + asc.degree;\n\t\t\tconst angle = this.toAngle(longitude);\n\t\t\tconst innerR = personIndex === 1 ? P1_R + 14 : P2_R + 14;\n\t\t\tconst tickPos = polarToCartesian(CENTER, CENTER, innerR, angle);\n\t\t\tconst labelPos = polarToCartesian(CENTER, CENTER, OUTER_R + 14, angle);\n\t\t\titems.push(svg`<g>\n\t\t\t\t<line class=\"asc-tick\" x1=${tickPos.x} y1=${tickPos.y} x2=${labelPos.x} y2=${labelPos.y} />\n\t\t\t\t<text class=\"asc-label\" x=${labelPos.x} y=${labelPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">Asc${personIndex}</text>\n\t\t\t</g>`);\n\t\t};\n\t\tmake(data.person1?.ascendant, 1);\n\t\tmake(data.person2?.ascendant, 2);\n\t\treturn items;\n\t}\n\n\tprivate renderInterAspectLines(\n\t\tp1: PlanetEntry[],\n\t\tp2: PlanetEntry[],\n\t\taspects: InterAspect[],\n\t) {\n\t\tconst longitudeOf = (\n\t\t\tlist: PlanetEntry[],\n\t\t\tname: string,\n\t\t): number | undefined => {\n\t\t\tconst target = capitalize(name);\n\t\t\tfor (const p of list) {\n\t\t\t\tif (capitalize(p.name) !== target) continue;\n\t\t\t\tif (typeof p.longitude === 'number') return p.longitude;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t};\n\t\treturn aspects.map((a) => {\n\t\t\tconst l1 = longitudeOf(p1, a.planet1);\n\t\t\tconst l2 = longitudeOf(p2, a.planet2);\n\t\t\tif (l1 === undefined || l2 === undefined) return nothing;\n\t\t\tconst out = polarToCartesian(CENTER, CENTER, P1_R - 12, this.toAngle(l1));\n\t\t\tconst inn = polarToCartesian(CENTER, CENTER, P2_R + 8, this.toAngle(l2));\n\t\t\tconst aspectName = normalizeAspect(a);\n\t\t\tconst cls = ASPECT_CLASS[aspectName] ?? 'aspect-other';\n\t\t\tconst orbLabel = formatNumber(a.orb, 1);\n\t\t\treturn svg`<line class=${`aspect ${cls}`} x1=${out.x} y1=${out.y} x2=${inn.x} y2=${inn.y}><title>${a.planet1} ${aspectName} ${a.planet2}${orbLabel ? ` (orb ${orbLabel}\u00B0)` : ''}</title></line>`;\n\t\t});\n\t}\n\n\tprivate renderAspects(aspects: InterAspect[]) {\n\t\treturn html`<table><caption class=\"roxy-sr-only\">Inter-chart aspects: the planet from chart 1, the planet from chart 2, the aspect between them, the orb in degrees and the strength.</caption><thead><tr><th scope=\"col\">Planet 1</th><th scope=\"col\">Planet 2</th><th scope=\"col\">Aspect</th><th scope=\"col\">Orb</th><th scope=\"col\">Strength</th></tr></thead><tbody>${aspects.map(\n\t\t\t\t\t(a) => html`<tr><td>${a.planet1}</td><td>${a.planet2}</td><td>${formatAspectName(a)}</td><td class=\"orb\">${formatNumber(a.orb, 1)}</td><td>${formatNumber(a.strength, 0)}</td></tr>`,\n\t\t\t\t)}</tbody></table>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-synastry-chart': RoxySynastryChart;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\n/**\n * Glyph per aspect, keyed by the hyphen-free canonical name.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. An earlier revision used `\u22BB` XOR for quincunx and `\u22BC` NAND for semisextile, which are the two characters Unicode lists as cross-references FROM the real glyphs, and it had them the wrong way round: charts rendered a 150 degree quincunx with the 30 degree semisextile symbol and vice versa. An astrologer reads the glyph, not the tooltip.\n */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\tsemisquare: '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.js';\nimport { MarkupDataController } from './markup-data.js';\n\n/**\n * Shared base for every data-driven Roxy component. Consolidates the things every component used to repeat by hand and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.\n *\n * @remarks\n * Two render modes, one component, which is the whole drop-in contract:\n *\n * - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `<script type=\"application/json\" class=\"roxy-data\">`. {@link MarkupDataController} hydrates `data` from it on connect. No key reaches the browser. This is the path the WordPress plugin drives, and it is unchanged by the base class.\n * - Uncontrolled: no data is injected, but a `data-endpoint` and a `pk_` `publishable-key` are set. The component renders its own `<roxy-endpoint-form>` (an internal detail, never placed by the consumer), and on submit fetches through {@link FetchController}, which refuses any non-publishable key. The result populates `data` and the component renders it.\n *\n * The JavaScript `data` property always wins over markup, so a host that assigns `el.data = \u2026` after upgrade is authoritative.\n *\n * Self-fetch needs `<roxy-endpoint-form>` (and `<roxy-location-search>`) registered. The CDN bundle and the full `@roxyapi/ui` entry register everything; per-component ESM consumers that want self-fetch import the form component too.\n *\n * @example\n * ```ts\n * @customElement('roxy-dream-card')\n * export class RoxyDreamCard extends RoxyDataElement<GetDreamSymbolResponse> {\n * static styles = [baseStyles, css`.card { \u2026 }`];\n * protected renderData(d: GetDreamSymbolResponse) {\n * return html`<article class=\"card\">\u2026</article>`;\n * }\n * protected renderEmpty() {\n * return html`<div class=\"roxy-empty\" role=\"status\">No dream symbol</div>`;\n * }\n * }\n * ```\n */\nexport abstract class RoxyDataElement<T = unknown> extends LitElement {\n\tstatic styles: CSSResultGroup = [baseStyles];\n\n\t/** Typed RoxyAPI response. Assigned in JavaScript, hydrated from the roxy-data island, or set by a self-fetch. */\n\t@property({ attribute: false })\n\tdata: T | null = null;\n\n\t/** Endpoint path for self-fetch, e.g. \"astrology/natal-chart\" or \"dreams/symbols/{id}\". Empty disables self-fetch (controlled mode only). */\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = '';\n\n\t/** HTTP method for self-fetch. */\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\t@property({ type: String, attribute: 'base-url' })\n\tbaseUrl?: string;\n\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl?: string;\n\n\t/** Consumer backend route that proxies the request (holds the secret key). When set, self-fetch POSTs the request here instead of calling RoxyAPI directly, so no key reaches the browser. The server-rendered (WordPress) path. */\n\t@property({ type: String, attribute: 'submit-url' })\n\tsubmitUrl?: string;\n\n\t/** Persist the last self-fetch form values in sessionStorage (keyed by endpoint) and prefill the form on reload. */\n\t@property({ type: Boolean })\n\tremember = false;\n\n\t/** Override the self-fetch form's submit-button label. Empty derives one from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel?: string;\n\n\t/** Render a small \"Spiritual data by RoxyAPI\" credit under a self-fetch or auto-mount result. Off by default; any value except \"off\"/\"false\" enables it. The one-tag widgets script turns it on unless data-attribution=\"off\". Never shown in controlled mode. */\n\t@property({ type: String })\n\tattribution?: string;\n\n\t/** True while an uncontrolled self-fetch is in flight. Public so {@link FetchController} can drive it. */\n\t@state()\n\tloading = false;\n\n\t/** Message from a failed self-fetch, or null. Public so {@link FetchController} can drive it. */\n\t@state()\n\terror: string | null = null;\n\n\t/**\n\t * True once a self-fetch (not a consumer-assigned or island-hydrated `data`) produced the current result. It gates the interactive result affordances, so controlled mode never shows an Edit control or a sticky picker.\n\t */\n\t@state()\n\tprivate selfFetched = false;\n\n\t/** True when the visitor asked to edit a self-fetch result, so the form is restored over the result. */\n\t@state()\n\tprivate editing = false;\n\n\t/** True when the last self-fetch form was a single-enum picker, so it stays visible above the result and a change refetches. */\n\t@state()\n\tprivate sticky = false;\n\n\t/** Last submitted form values (nested per group), kept in memory to restore the form on Edit and to prefill the sticky picker. */\n\tprivate lastValues?: Record<string, unknown>;\n\n\tprivate fetcher: FetchController<T>;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Controlled mode: hydrate `data` from a direct-child roxy-data island when\n\t\t// no JS property was assigned. Keyless; the server already fetched.\n\t\tnew MarkupDataController<T>(this);\n\t\tthis.fetcher = new FetchController<T>(this);\n\t}\n\n\tprotected willUpdate(changed: PropertyValues): void {\n\t\tif (changed.has('publishableKey')) {\n\t\t\tthis.fetcher.publishableKey = this.publishableKey;\n\t\t}\n\t\tif (changed.has('baseUrl') && this.baseUrl) {\n\t\t\tthis.fetcher.baseUrl = this.baseUrl;\n\t\t}\n\t\tif (changed.has('submitUrl')) {\n\t\t\tthis.fetcher.submitUrl = this.submitUrl;\n\t\t}\n\t}\n\n\trender(): unknown {\n\t\tif (this.loading) return this.renderLoading();\n\t\tif (this.error != null) return this.renderError(this.error);\n\t\tif (this.data != null) {\n\t\t\t// Controlled mode (consumer-assigned or island-hydrated data) renders the\n\t\t\t// result alone, byte-identical to before: no picker, no Edit. The one\n\t\t\t// exception is the widgets auto-mount attrs-complete path, which assigns\n\t\t\t// data directly AND sets `attribution`; a real controlled consumer never\n\t\t\t// sets the attribute, so this stays byte-identical for them.\n\t\t\tif (!this.selfFetched) {\n\t\t\t\treturn this.showAttribution()\n\t\t\t\t\t? html`${this.renderData(this.data)}${this.renderAttribution()}`\n\t\t\t\t\t: this.renderData(this.data);\n\t\t\t}\n\t\t\tif (this.editing) return this.renderForm();\n\t\t\treturn this.renderResult(this.data);\n\t\t}\n\t\treturn this.renderNoData();\n\t}\n\n\t/** Render the populated response. The single method every component implements. */\n\tprotected abstract renderData(data: T): unknown;\n\n\t/**\n\t * A self-fetch result plus its re-query affordance. A single-enum form keeps its picker above the result so a new selection refetches (a sign switch is a new reading); any other form gets a compact Edit control that restores the form with the previous values.\n\t */\n\tprotected renderResult(data: T): unknown {\n\t\tconst body = this.sticky\n\t\t\t? html`${this.renderForm()}${this.renderData(data)}`\n\t\t\t: html`<div class=\"roxy-edit-bar\"><button type=\"button\" class=\"roxy-edit\" @click=\"${this.onEdit}\">Edit query</button></div>${this.renderData(data)}`;\n\t\treturn this.showAttribution()\n\t\t\t? html`${body}${this.renderAttribution()}`\n\t\t\t: body;\n\t}\n\n\tprivate onEdit = () => {\n\t\tthis.editing = true;\n\t};\n\n\t/** True when the attribution credit renders: the attribute is present and not explicitly disabled. */\n\tprivate showAttribution(): boolean {\n\t\treturn (\n\t\t\tthis.attribution != null &&\n\t\t\tthis.attribution !== 'off' &&\n\t\t\tthis.attribution !== 'false'\n\t\t);\n\t}\n\n\t/** Small muted credit under a self-fetch or auto-mount result. Reached only from the result path, so controlled mode never renders it. */\n\tprotected renderAttribution(): unknown {\n\t\treturn html`<div class=\"roxy-attribution\"><a href=\"https://roxyapi.com/?utm_source=widget&utm_medium=embed\" target=\"_blank\" rel=\"noopener\">Spiritual data by RoxyAPI</a></div>`;\n\t}\n\n\t/** The data-absent branch: the self-fetch form when an endpoint is set, otherwise the empty state. */\n\tprotected renderNoData(): unknown {\n\t\treturn this.endpoint ? this.renderForm() : this.renderEmpty();\n\t}\n\n\t/** Internal self-fetch form. Reuses the introspecting `<roxy-endpoint-form>`; the consumer never places it. */\n\tprotected renderForm(): unknown {\n\t\treturn html`<roxy-endpoint-form data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" publishable-key=\"${ifDefined(this.publishableKey)}\" submit-label=\"${ifDefined(this.submitLabel)}\" lang=\"${ifDefined(this.effectiveLang())}\" .initialValues=\"${this.formInitialValues()}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\n\t}\n\n\t/** Prefill source for the form: the last submission (Edit / sticky refetch) wins over remembered storage. */\n\tprivate formInitialValues(): Record<string, unknown> | undefined {\n\t\treturn (\n\t\t\tthis.lastValues ?? (this.remember ? this.readRemembered() : undefined)\n\t\t);\n\t}\n\n\t/** Site-owner language from the element `lang` attribute (native accessor), routed to the API query on submit. */\n\tprivate effectiveLang(): string | undefined {\n\t\treturn this.lang || undefined;\n\t}\n\n\tprivate onFormSubmit = (e: Event) => {\n\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\tvalues: Record<string, unknown>;\n\t\t\tqueryKeys?: string[];\n\t\t\tsticky?: boolean;\n\t\t};\n\t\tthis.lastValues = detail.values;\n\t\tthis.sticky = !!detail.sticky;\n\t\tthis.selfFetched = true;\n\t\tthis.editing = false;\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(\n\t\t\t\tthis.endpoint,\n\t\t\t\tthis.method,\n\t\t\t\tdetail.values,\n\t\t\t\tdetail.queryKeys ?? [],\n\t\t\t),\n\t\t);\n\t};\n\n\t/** sessionStorage key for this component's remembered form values, scoped by endpoint. */\n\tprivate rememberKey(): string {\n\t\treturn `roxy-ui:form:${this.endpoint}`;\n\t}\n\n\tprivate readRemembered(): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\tconst raw = sessionStorage.getItem(this.rememberKey());\n\t\t\treturn raw ? (JSON.parse(raw) as Record<string, unknown>) : undefined;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate writeRemembered(values: Record<string, unknown>): void {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.rememberKey(), JSON.stringify(values));\n\t\t} catch {\n\t\t\t// Private mode / disabled storage: remembering is best-effort, never fatal.\n\t\t}\n\t}\n\n\t/** Terminal empty state. Subclasses override for a domain-specific message. */\n\tprotected renderEmpty(): unknown {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No data</div>`;\n\t}\n\n\t/** Loading placeholder shown during a self-fetch. */\n\tprotected renderLoading(): unknown {\n\t\treturn html`<div class=\"roxy-skeleton\" style=\"height:8rem\" role=\"status\" aria-label=\"Loading\"></div>`;\n\t}\n\n\t/** Error state shown when a self-fetch fails. Keeps the form in view so the request can be retried. */\n\tprotected renderError(message: string): unknown {\n\t\tconst banner = html`<div class=\"roxy-error\" role=\"alert\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\n * The one place the \"publishable key only\" rule lives. Every client-side fetch boundary ({@link ../components/location-search.ts}, {@link ./fetch-controller.ts}) calls through here so a secret or legacy unprefixed key is refused identically: no network call, the same visible message, the same `roxy-validation-error` event. Centralising it is what stops the two paths drifting, which is exactly how `<roxy-location-search>` used to warn-then-fetch a secret key while the controller fail-closed.\n */\n\n/** Canonical refusal message. Both fetch boundaries surface this exact wording. */\nexport const KEY_REFUSED_MESSAGE =\n\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\n/** True when the key is a browser-safe `pk_` publishable key. */\nexport function isPublishableKey(key: string | undefined | null): boolean {\n\treturn !!key && key.startsWith('pk_');\n}\n\n/**\n * The fail-closed condition: a key is PRESENT and is NOT a `pk_` key. An absent key is not refused, so a keyless public call (a form-slotted city search with no key set) still proceeds; only a real secret/legacy token in the browser is stopped.\n */\nexport function keyIsRefused(key: string | undefined | null): boolean {\n\treturn !!key && !key.startsWith('pk_');\n}\n\n/**\n * Announce a refused key: dispatch the shared `roxy-validation-error` (bubbling, composed) and, when `warn` is set, log it once for the developer. The caller sets its own visible error state and skips the fetch; this only handles the parts both boundaries share.\n */\nexport function dispatchKeyRefusal(\n\thost: EventTarget,\n\topts: { warn?: boolean } = {},\n): void {\n\tif (opts.warn) console.warn(KEY_REFUSED_MESSAGE);\n\thost.dispatchEvent(\n\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\tdetail: { reason: 'possible-secret-key', message: KEY_REFUSED_MESSAGE },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t}),\n\t);\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport {\n\tdispatchKeyRefusal,\n\tKEY_REFUSED_MESSAGE,\n\tkeyIsRefused,\n} from './key-guard.js';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so the form mixin can attach a controller without the component wiring state by hand.\n *\n * @remarks\n * Intersected with `HTMLElement` because the controller dispatches events on the host. Lit's `ReactiveControllerHost` is the update-lifecycle contract only (`addController`, `requestUpdate`, `updateComplete`) and carries no DOM surface, even though every real host is a `LitElement` and therefore an `HTMLElement`. Declaring the DOM half is what the controller actually needs; it used to reach it through a `this.host as unknown as EventTarget` double cast instead, which asserted a capability the type never promised.\n */\ntype FetchHost<T> = ReactiveControllerHost &\n\tHTMLElement & {\n\t\tdata: T | null;\n\t\tloading: boolean;\n\t\terror: string | null;\n\t};\n\n/** Default RoxyAPI v2 origin. A component overrides it per instance via its `base-url` attribute. */\nconst DEFAULT_BASE_URL = 'https://roxyapi.com/api/v2';\n\n/** A single request the controller issues on the component's behalf. */\nexport interface RoxyRequest {\n\t/** Path under the API base, e.g. \"/dreams/symbols/water\" or \"/astrology/natal-chart\". */\n\tpath: string;\n\tmethod?: 'GET' | 'POST';\n\t/** JSON body for POST endpoints. */\n\tbody?: unknown;\n\t/** Query string parameters; nullish values are dropped. */\n\tquery?: Record<string, string | number | undefined>;\n}\n\n/**\n * Client-side fetch for uncontrolled (self-fetching) components: drives `host.data` / `host.loading` / `host.error` and cancels a stale request when a newer one starts or the host disconnects.\n *\n * @remarks\n * Security boundary. The only credential this ever sends is a `pk_` publishable key, which carries a server-side origin allowlist. A secret (`sk_`) or legacy unprefixed key is refused before any network call and surfaced as an error, so a server secret cannot leak into a browser request. This centralizes the guard that originated in `<roxy-location-search>` so every self-fetching component enforces it identically.\n *\n * Controlled-mode components never construct this. When a server injects the response as a `<script class=\"roxy-data\">` island, there is no key and no fetch, which is the path server-rendered consumers (WordPress, JSX SSR, static HTML) rely on.\n */\nexport class FetchController<T = unknown> implements ReactiveController {\n\tprivate readonly host: FetchHost<T>;\n\tprivate abort?: AbortController;\n\n\t/** Browser-safe publishable key. Set by the host from its `publishable-key` attribute. */\n\tpublishableKey?: string;\n\t/** API origin, overridable for self-hosted or proxied deployments. */\n\tbaseUrl = DEFAULT_BASE_URL;\n\t/**\n\t * Consumer backend route that holds the secret key. When set, the request is POSTed here as `{ path, method, body, query }` instead of called against RoxyAPI directly, so no key (publishable or secret) is sent from the browser. This is the canonical path for server-rendered hosts (WordPress); the backend proxies the request with its own `sk_` key and returns the JSON response.\n\t */\n\tsubmitUrl?: string;\n\n\tconstructor(host: FetchHost<T>) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostDisconnected() {\n\t\tthis.abort?.abort();\n\t\tthis.abort = undefined;\n\t}\n\n\t/**\n\t * Issue the request and resolve once `host.data` (success) or `host.error`\n\t * (failure) is set. A no-op return when a non-publishable key is present:\n\t * the error is already surfaced and nothing is sent.\n\t */\n\tasync run(req: RoxyRequest): Promise<void> {\n\t\t// submit-url proxy: no key leaves the browser; the consumer's backend holds it.\n\t\tif (!this.submitUrl && this.secretKeyRefused()) return;\n\t\tthis.abort?.abort();\n\t\tconst controller = new AbortController();\n\t\tthis.abort = controller;\n\t\tthis.host.loading = true;\n\t\tthis.host.error = null;\n\t\ttry {\n\t\t\tconst res = this.submitUrl\n\t\t\t\t? await fetch(this.submitUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: JSON.stringify(req),\n\t\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\t})\n\t\t\t\t: await this.callApi(req, controller.signal);\n\t\t\tif (!res.ok) throw new Error(await this.readError(res));\n\t\t\tconst json = (await res.json()) as T;\n\t\t\tif (controller.signal.aborted) return;\n\t\t\tthis.host.data = json;\n\t\t} catch (err) {\n\t\t\tif ((err as { name?: string })?.name === 'AbortError') return;\n\t\t\tthis.host.error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (this.abort === controller) this.abort = undefined;\n\t\t\tif (!controller.signal.aborted) this.host.loading = false;\n\t\t}\n\t}\n\n\t/** Direct call against RoxyAPI with the publishable key (the no-backend path). */\n\tprivate callApi(req: RoxyRequest, signal: AbortSignal): Promise<Response> {\n\t\tconst url = new URL(`${this.baseUrl}${req.path}`);\n\t\tfor (const [k, v] of Object.entries(req.query ?? {})) {\n\t\t\tif (v != null) url.searchParams.set(k, String(v));\n\t\t}\n\t\tconst headers: Record<string, string> = { Accept: 'application/json' };\n\t\tif (this.publishableKey) headers['X-API-Key'] = this.publishableKey;\n\t\tif (req.body != null) headers['Content-Type'] = 'application/json';\n\t\treturn fetch(url, {\n\t\t\tmethod: req.method ?? 'GET',\n\t\t\theaders,\n\t\t\tbody: req.body != null ? JSON.stringify(req.body) : undefined,\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/** True when a key is set and it is not a browser-safe `pk_` publishable key. Surfaces the error and refuses to send, via the shared {@link keyIsRefused} guard so every fetch boundary fail-closes identically. */\n\tprivate secretKeyRefused(): boolean {\n\t\tif (!keyIsRefused(this.publishableKey)) return false;\n\t\tthis.host.error = KEY_REFUSED_MESSAGE;\n\t\tdispatchKeyRefusal(this.host);\n\t\treturn true;\n\t}\n\n\t/** Surface the `{ error, code }` message the API returns on failure, falling back to the status code. */\n\tprivate async readError(res: Response): Promise<string> {\n\t\ttry {\n\t\t\tconst body = (await res.json()) as { error?: string };\n\t\t\tif (body?.error) return body.error;\n\t\t} catch {\n\t\t\t// Non-JSON error body: fall through to the status line.\n\t\t}\n\t\treturn `Request failed (${res.status})`;\n\t}\n}\n\n/**\n * Translate flat form values into a {@link RoxyRequest} for an endpoint. The `{name}` segments in the endpoint template are substituted from the values and removed; the rest become the JSON body for POST or query parameters for GET. This is the spec-light request builder the base element uses to turn a `<roxy-endpoint-form>` submission into a self-fetch, so a component needs no per-endpoint glue.\n *\n * @param queryKeys - Names the spec declares as `in: query` for this operation, which `<roxy-endpoint-form>` reports on its `roxy-submit` event. A POST operation can still take query parameters (every localized endpoint takes `?lang=`), and sending one in the JSON body silently drops it, so those names are routed to the query string on POST as well as GET.\n */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\n\tqueryKeys: readonly string[] = [],\n): RoxyRequest {\n\tconst rest: Record<string, unknown> = { ...values };\n\tconst path = `/${endpoint.replace(/^\\//, '')}`.replace(\n\t\t/\\{([^}]+)\\}/g,\n\t\t(_match, name: string) => {\n\t\t\tconst v = rest[name];\n\t\t\tdelete rest[name];\n\t\t\treturn encodeURIComponent(String(v ?? ''));\n\t\t},\n\t);\n\tconst inQuery = new Set(queryKeys);\n\tconst query: Record<string, string | number | undefined> = {};\n\tconst body: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(rest)) {\n\t\tif (v === undefined || v === '') continue;\n\t\tif (method === 'GET' || inQuery.has(k)) query[k] = v as string | number;\n\t\telse body[k] = v;\n\t}\n\treturn { path, method, query, body: method === 'POST' ? body : undefined };\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * Serialize a RoxyAPI response for embedding inside an inline `<script type=\"application/json\" class=\"roxy-data\">`. This is the safe writer counterpart to {@link MarkupDataController}, the reader: server-rendered and cached consumers (WordPress, JSX SSR, static HTML) emit the script with this, and the component hydrates `data` from it on connect.\n *\n * @remarks\n * Use this instead of a bare `JSON.stringify`. A raw stringify of a response that contains the literal text `</script>` (common in long interpretation prose) closes the script element early, corrupting the page and creating an HTML-injection vector. This escapes the script-unsafe characters to their `\\uXXXX` JSON escapes, which `JSON.parse` restores to the original characters, so the value the component receives is identical to the response you passed.\n *\n * `<` is the load-bearing escape (it defeats `</script>` and `<!--`). `>` and `&` are escaped for defence in depth, and U+2028 / U+2029 because they are valid in JSON yet are line terminators in a `<script>` context and break some parsers. The escapes introduce only `\\uXXXX` sequences, so the replacements never feed each other and order is irrelevant.\n *\n * Pass the unwrapped RoxyAPI response, the same shape you would assign to `element.data`. Do not pass the SDK envelope (`{ data, error, request, response }`).\n *\n * @example\n * ```ts\n * import { serializeRoxyData } from '@roxyapi/ui';\n *\n * const { data } = await roxy.dreams.getDreamSymbol({ path: { id: 'water' } });\n * const html = `<roxy-dream-card><script type=\"application/json\" class=\"roxy-data\">${serializeRoxyData(data)}</script></roxy-dream-card>`;\n * ```\n */\nexport function serializeRoxyData(data: unknown): string {\n\treturn JSON.stringify(data)\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n\n/**\n * Build the complete `<script type=\"application/json\" class=\"roxy-data\">\u2026</script>` element a server nests inside a `roxy-*` component for the no-JavaScript hydration path. The payload is escaped via {@link serializeRoxyData}, so it is safe to drop straight into HTML output.\n *\n * @remarks\n * The element carries both `type=\"application/json\"` and `class=\"roxy-data\"` because {@link MarkupDataController} reads only a direct-child script that has both. Emit one of these inside the target component; the JavaScript `data` property still wins if it is later assigned.\n *\n * @example\n * ```ts\n * import { roxyDataScript } from '@roxyapi/ui';\n *\n * const { data } = await roxy.crystals.getCrystal({ path: { id: 'amethyst' } });\n * const html = `<roxy-crystal-grid>${roxyDataScript(data)}</roxy-crystal-grid>`;\n * ```\n */\nexport function roxyDataScript(data: unknown): string {\n\treturn `<script type=\"application/json\" class=\"${ROXY_DATA_CLASS}\">${serializeRoxyData(data)}</script>`;\n}\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n", "/**\n * Math helpers for converting raw ecliptic longitude decimals into the\n * sign / degree / minute / second triplet used across chart components.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\n\nexport interface SignPosition {\n\tsign: string;\n\tsignIndex: number;\n\tdegree: number;\n\tminute: number;\n\tsecond: number;\n}\n\n/**\n * Wrap longitude into [0, 360) so negative or out-of-range values still\n * resolve to a real sign. Robust to wonky upstream data.\n */\nexport function normalizeLongitude(lon: number): number {\n\tconst wrapped = lon % 360;\n\treturn wrapped < 0 ? wrapped + 360 : wrapped;\n}\n\n/**\n * Convert decimal ecliptic longitude (0-360) into sign/degree/minute/second.\n * Used by every chart wheel and aspect table.\n */\nexport function longitudeToSignPosition(longitude: number): SignPosition {\n\tconst lon = normalizeLongitude(longitude);\n\tconst signIndex = Math.floor(lon / 30) % 12;\n\tconst within = lon % 30;\n\tconst degree = Math.floor(within);\n\tconst minuteFloat = (within - degree) * 60;\n\tconst minute = Math.floor(minuteFloat);\n\tconst second = Math.round((minuteFloat - minute) * 60);\n\treturn {\n\t\tsign: SIGNS_ORDER[signIndex] ?? 'Aries',\n\t\tsignIndex,\n\t\tdegree,\n\t\tminute,\n\t\tsecond,\n\t};\n}\n\n/** Compact display string like \"12\u00B0 Leo 34'\". Used in chart labels. */\nexport function formatSignPosition(longitude: number): string {\n\tconst { sign, degree, minute } = longitudeToSignPosition(longitude);\n\treturn `${degree}\u00B0 ${sign} ${String(minute).padStart(2, '0')}'`;\n}\n\n/** Format a within-sign decimal degree (0-30) as degree-and-minute, e.g. 17.99 to \"17\u00B059'\". The reference-grade form astrologers read when the sign is already known (asteroids, lots, directed points, fixed stars). */\nexport function formatDegreeInSign(deg: number): string {\n\tlet d = Math.floor(deg);\n\tlet m = Math.round((deg - d) * 60);\n\tif (m === 60) {\n\t\tm = 0;\n\t\td += 1;\n\t}\n\treturn `${d}\u00B0${String(m).padStart(2, '0')}'`;\n}\n\n/**\n * The point diametrically opposite a longitude (e.g. Descendant from\n * Ascendant, IC from MC). Exact derivation, always 180 degrees away.\n */\nexport function oppositePoint(longitude: number): number {\n\treturn normalizeLongitude(longitude + 180);\n}\n\n/**\n * Midpoint of the forward arc from `start` to `end` (both ecliptic\n * longitudes). Handles the 360/0 wrap, so a house spanning 350 to 20 degrees\n * yields a midpoint of 5, not 185. Used to place house numbers between two\n * cusps regardless of how unequal the house is.\n */\nexport function arcMidpoint(start: number, end: number): number {\n\tconst s = normalizeLongitude(start);\n\tlet span = normalizeLongitude(end) - s;\n\tif (span < 0) span += 360;\n\treturn normalizeLongitude(s + span / 2);\n}\n\n/** Polar to cartesian for SVG wheel positioning. Angle in degrees, 0 at 3 o'clock. */\nexport function polarToCartesian(\n\tcx: number,\n\tcy: number,\n\tradius: number,\n\tangleDeg: number,\n): { x: number; y: number } {\n\tconst angleRad = (angleDeg * Math.PI) / 180;\n\treturn {\n\t\tx: cx + radius * Math.cos(angleRad),\n\t\ty: cy + radius * Math.sin(angleRad),\n\t};\n}\n", "import type { TemplateResult } from 'lit';\nimport { css, html } from 'lit';\n\n/**\n * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the\n * browser default triangle with a thin chevron that rotates when the host\n * `<details>` opens. Render it inside the `<summary>` and pair with\n * {@link disclosureStyles}.\n */\nexport function chevron(): TemplateResult {\n\treturn html`<svg class=\"roxy-chevron\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\"><path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>`;\n}\n\n/**\n * Shared `<details>` accordion styling: hides the native disclosure triangle\n * and rotates the {@link chevron} 180 degrees when the accordion is open.\n * Import into any component that renders disclosure accordions so the chevron\n * looks and behaves identically.\n */\nexport const disclosureStyles = css`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n */\n\nimport { capitalize, humanize } from './string.js';\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst BARE_TIME = /^\\d{2}:\\d{2}(:\\d{2})?$/;\n/** An ISO datetime with NO timezone designator: a wall clock, not an instant. */\nconst NAIVE_DATETIME = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?$/;\n\n/**\n * Resolve an API timestamp to a Date plus the timezone it must be RENDERED in.\n *\n * @remarks\n * The API returns chart times naive (`2026-07-13T04:36:00`): that is 04:36 in the CHART's timezone, not UTC and not the viewer's. A wall clock must read the same for every viewer on earth, so hora at sunrise says 04:36 in Tokyo and in Chicago alike.\n *\n * Handing a naive string to `new Date()` makes the runtime interpret it in the VIEWER's zone, which is a silent corruption whenever that wall clock lands in the viewer's DST gap. In America/New_York `2026-03-08T02:30:00` does not exist, so the clock jumps and it renders as `3:30 AM`. Pinning the wall clock to UTC, which has no DST and therefore no gap, preserves the digits exactly while Intl still applies the viewer's locale conventions.\n *\n * An offset-bearing timestamp (`...Z`, `...+05:30`) IS a real instant, so it keeps the normal behaviour and converts to the viewer's local time.\n */\nexport function resolveDisplayDate(input: string): {\n\td: Date;\n\ttimeZone?: string;\n} {\n\tconst naive = BARE_TIME.test(input)\n\t\t? `1970-01-01T${input}`\n\t\t: NAIVE_DATETIME.test(input)\n\t\t\t? input\n\t\t\t: null;\n\treturn naive\n\t\t? { d: new Date(`${naive}Z`), timeZone: 'UTC' }\n\t\t: { d: new Date(input) };\n}\n\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (DATE_ONLY.test(input)) return '';\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(undefined, {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\thour12: true,\n\t\ttimeZone,\n\t});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatTimeRange(\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(t.start);\n\tconst end = formatTime(t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\n/** Two dates as one label: `Jan 1, 2026 - Jan 7, 2026`. Falls back to whichever end parses when the other is absent. */\nexport function formatDateRange(start: unknown, end: unknown): string {\n\tconst a = formatDate(start);\n\tconst b = formatDate(end);\n\tif (a && b) return `${a} - ${b}`;\n\treturn a || b;\n}\n\n/**\n * Format a number, dropping trailing zeros in the FRACTIONAL part only: `2.50` becomes `2.5`, `2.0` becomes `2`, and `100` stays `100`.\n *\n * @remarks\n * The old implementation ran `.replace(/\\.?0+$/, '')` against the whole string, which happily ate zeros off the INTEGER when there was no decimal point. At `dp = 0` that meant `100` rendered as `1`, `90` as `9`, `20` as `2`, and `0` as the empty string. It shipped: a 100 percent tight stellium displayed as \"1% tight\", and an aspect of strength 100 as \"str 1\". Guard on the decimal point, and never strip from the integer side.\n *\n * @example\n * ```ts\n * formatNumber(100, 0); // '100'\n * formatNumber(2.5, 1); // '2.5'\n * formatNumber(2, 1); // '2'\n * formatNumber(0, 0); // '0'\n * ```\n */\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\tconst fixed = value.toFixed(dp);\n\treturn fixed.includes('.') ? fixed.replace(/\\.?0+$/, '') : fixed;\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated canonical name (`SEMI_SEXTILE` and `SEMI SEXTILE` both become `semi-sextile`). Accepts any aspect-shaped object so both natal and synastry inter-aspect entries can share this.\n *\n * @remarks\n * Spaces are folded as well as underscores because the endpoints do not agree on the separator: aspects returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`. Handling only the underscore left the space form failing every {@link ASPECT_CLASS} and `ASPECT_SYMBOL` lookup, so the same aspect rendered hyphenated and correctly coloured in one component and space-separated in the neutral fallback colour in another.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '')\n\t\t.toLowerCase()\n\t\t.trim()\n\t\t.replace(/[\\s_]+/g, '-');\n}\n\n/**\n * Display label for an aspect: `SEMI_SEXTILE` -> `Semi-sextile`.\n *\n * The raw value is an API enum and the table column it lands in is read by practitioners, not parsers. {@link normalizeAspect} stays the lookup key for classes and glyphs; this is the human-facing form.\n */\nexport function formatAspectName(a: { type?: string }): string {\n\treturn capitalize(normalizeAspect(a));\n}\n\n/**\n * Display label for an ayanamsa identifier. `kp-newcomb` -> `KP Newcomb`.\n *\n * The raw values are API enums. KP is an initialism and must stay uppercase, which {@link humanize} alone cannot know, so the three known frames are mapped explicitly and anything else degrades to a humanized slug rather than rendering the enum.\n */\nconst AYANAMSA_LABEL: Record<string, string> = {\n\t'kp-newcomb': 'KP Newcomb',\n\t'kp-old': 'KP Old',\n\tlahiri: 'Lahiri',\n};\n\nexport function formatAyanamsa(type: unknown, degrees?: unknown): string {\n\tconst label =\n\t\ttypeof type === 'string' ? (AYANAMSA_LABEL[type] ?? humanize(type)) : '';\n\tconst deg =\n\t\ttypeof degrees === 'number' ? `${formatNumber(degrees, 2)}\\u00b0` : '';\n\tif (label && deg) return `${label} (${deg})`;\n\treturn label || deg;\n}\n\n/**\n * Date plus time in one label: `Jan 15, 1990, 2:30 PM`.\n *\n * @remarks\n * Components were concatenating a raw date and a raw time (`1990-01-15 \\u00b7 14:30:00`) while siblings rendered the same instant through {@link formatDate}. One helper keeps every card reading the same way.\n *\n * Birth details arrive as two fields rather than one timestamp, so `time` may be passed separately; it is merged into a naive datetime, which {@link formatDate} and {@link formatTime} pin to UTC so the wall clock renders identically for every viewer.\n *\n * @example\n * ```ts\n * formatDateTime('1990-01-15T14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('1990-01-15', '14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('1990-01-15'); // 'Jan 15, 1990'\n * ```\n */\nexport function formatDateTime(input: unknown, time?: unknown): string {\n\tconst merged =\n\t\ttypeof input === 'string' &&\n\t\tDATE_ONLY.test(input) &&\n\t\ttypeof time === 'string' &&\n\t\tBARE_TIME.test(time)\n\t\t\t? `${input}T${time}`\n\t\t\t: input;\n\tconst date = formatDate(merged);\n\tconst clock = formatTime(merged);\n\tif (date && clock) return `${date}, ${clock}`;\n\treturn date || clock;\n}\n", "/**\n * The interpretation accordion: the one way this library shows a label, a short value, and a body of prose behind a disclosure.\n *\n * @remarks\n * Exclusive by construction (`<details name>`), so a card grows by at most one open section and never becomes a wall of text. Callers pass their own group `name` so two accordions on one page do not fight over which section is open.\n *\n * This lives here rather than in a component because the same accordion is the right shape wherever an endpoint returns a labelled reading: the Human Design bodygraph and type card use it for strategy, authority, and aura; `roxy-hexagram` uses it for the changing lines. The CSS was copy-pasted into six components before 2026-07 and had already drifted (`.interp-body` had five distinct definitions), which is the drift this exists to stop. Migrate the remaining copies to it when they are next touched.\n */\n\nimport { css, html, nothing } from 'lit';\nimport { chevron } from './disclosure.js';\n\n/** One row: the label, the short value shown as the aside, and the interpretation body. `extra` renders under the body for a section that carries more than prose. */\nexport interface InterpSection {\n\tlabel: string;\n\taside?: string;\n\tbody: string;\n\textra?: unknown;\n}\n\nexport const interpAccordionStyles = css`.block{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.block h3{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.interp-card{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);margin-bottom:var(--roxy-space-xs,.25rem)}.interp-card summary{cursor:pointer;color:var(--roxy-fg,#0a0a0a);align-items:center;gap:var(--roxy-space-sm,.5rem);font-weight:500;font-size:var(--roxy-text-sm,.875rem);display:flex}.interp-card summary:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:var(--roxy-radius-sm,4px)}.interp-lead{flex-wrap:wrap;flex:auto;order:1;align-items:baseline;gap:.4rem;min-width:0;display:inline-flex}.interp-aside{flex-shrink:0;order:2;align-items:center;gap:.5rem;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted,#71717a);white-space:nowrap;font-weight:400}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-sm,.5rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);overflow-wrap:anywhere;line-height:1.6;display:grid}.interp-body p{margin:0}`;\n\n/**\n * Render the accordion. Sections with no body are dropped, so a caller can pass the full set and let a narrower response render only what it carries. `name` groups the `<details>` exclusively, so opening one closes the last.\n */\nexport function renderInterpAccordion(\n\tsections: InterpSection[],\n\tname: string,\n\theading = 'Reading',\n) {\n\tconst shown = sections.filter((s) => Boolean(s.body));\n\tif (shown.length === 0) return nothing;\n\n\treturn html`<section class=\"block\"><h3>${heading}</h3>${shown.map(\n\t\t\t(s, i) => html`<details class=\"interp-card\" name=\"${name}\" ?open=\"${i === 0}\"><summary><span class=\"interp-lead\">${s.label}</span> ${chevron()} ${s.aside ? html`<span class=\"interp-aside\"><small>${s.aside}</small></span>` : nothing}</summary><div class=\"interp-body\"><p>${s.body}</p>${s.extra ?? nothing}</div></details>`,\n\t\t)}</section>`;\n}\n"],
5
+ "mappings": "0MAAA,OAAS,OAAAA,GAAK,QAAAC,EAAM,WAAAC,EAAS,OAAAC,MAAW,MACxC,OAAS,iBAAAC,OAAqB,oBCKvB,IAAMC,EAAuC,CACnD,IAAK,SACL,KAAM,SACN,QAAS,SACT,MAAO,SACP,MAAO,SACP,KAAM,SACN,QAAS,SACT,OAAQ,SACR,OAAQ,SACR,QAAS,SACT,MAAO,SACP,KAAM,SACN,KAAM,SACN,UAAW,MACX,MAAO,KACP,UAAW,SACX,UAAW,SACX,aAAc,SACd,aAAc,SACd,OAAQ,SACR,OAAQ,SACR,oBAAqB,QACtB,EAmBO,IAAMC,EAAqC,CACjD,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,IAAK,SACL,MAAO,SACP,MAAO,SACP,QAAS,SACT,YAAa,SACb,UAAW,SACX,SAAU,SACV,OAAQ,QACT,EAiBO,IAAMC,EAAc,CAC1B,QACA,SACA,SACA,SACA,MACA,QACA,QACA,UACA,cACA,YACA,WACA,QACD,EC3FA,OAEC,QAAAC,EACA,cAAAC,OAEM,MACP,OAAS,YAAAC,EAAU,SAAAC,MAAa,oBAChC,OAAS,aAAAC,MAAiB,+BCP1B,OAAS,OAAAC,OAAW,MAMb,IAAMC,EAAaD,87FCDnB,IAAME,EACZ,mIAUM,SAASC,EAAaC,EAAyC,CACrE,MAAO,CAAC,CAACA,GAAO,CAACA,EAAI,WAAW,KAAK,CACtC,CAKO,SAASC,EACfC,EACAC,EAA2B,C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EAAaZ,EAAE,IAAK,CAAC,CAAC,YAAYY,EAAaZ,EAAE,SAAU,CAAC,CAAC,YACzK,CAAC,kBACJ,CACD,EA3PajB,EACL,OAAS,CACfyF,EACAC,EACAC,EACAC,+yLACD,EANY5F,EAAN6F,EAAA,CADNC,GAAc,qBAAqB,GACvB9F",
6
6
  "names": ["css", "html", "nothing", "svg", "customElement", "PLANET_GLYPH", "SIGN_GLYPH", "SIGNS_ORDER", "html", "LitElement", "property", "state", "ifDefined", "css", "baseStyles", "KEY_REFUSED_MESSAGE", "keyIsRefused", "key", "dispatchKeyRefusal", "host", "opts", "KEY_REFUSED_MESSAGE", "DEFAULT_BASE_URL", "FetchController", "host", "req", "controller", "res", "json", "err", "signal", "url", "k", "v", "headers", "keyIsRefused", "KEY_REFUSED_MESSAGE", "dispatchKeyRefusal", "body", "buildRequest", "endpoint", "method", "values", "queryKeys", "rest", "path", "_match", "name", "inQuery", "query", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "ROXY_DATA_CLASS", "text", "RoxyDataElement", "LitElement", "e", "detail", "buildRequest", "MarkupDataController", "FetchController", "baseStyles", "changed", "html", "data", "body", "ifDefined", "raw", "values", "message", "banner", "__decorateClass", "property", "state", "normalizeLongitude", "lon", "wrapped", "longitudeToSignPosition", "longitude", "signIndex", "within", "degree", "minuteFloat", "minute", "second", "SIGNS_ORDER", "polarToCartesian", "cx", "cy", "radius", "angleDeg", "angleRad", "css", "html", "chevron", "disclosureStyles", "capitalize", "s", "formatNumber", "value", "dp", "fixed", "ASPECT_CLASS", "normalizeAspect", "formatAspectName", "capitalize", "css", "html", "nothing", "interpAccordionStyles", "css", "READING_COUNT", "SIZE", "CENTER", "OUTER_R", "SIGN_R", "P1_R", "P2_R", "RoxySynastryChart", "RoxyDataElement", "html", "d", "person1", "person2", "compatibilityScore", "analysis", "interAspects", "p1Planets", "p2Planets", "score", "summaryText", "strengths", "challenges", "hasPlanets", "ranked", "a", "b", "lead", "nothing", "i", "s", "p1", "p2", "card", "p", "index", "shown", "formatNumber", "value", "label", "SIGN_GLYPH", "capitalize", "cards", "c", "byType", "type", "count", "formatAspectName", "g1", "PLANET_GLYPH", "g2", "nature", "meaning", "aside", "chevron", "k", "longitude", "_", "angle", "start", "polarToCartesian", "end", "svg", "SIGNS_ORDER", "pos", "planets", "radius", "cls", "personIndex", "degPos", "glyph", "sp", "longitudeToSignPosition", "retro", "degLabel", "tooltip", "data", "items", "make", "asc", "signIdx", "innerR", "tickPos", "labelPos", "aspects", "longitudeOf", "list", "name", "target", "l1", "l2", "out", "inn", "aspectName", "normalizeAspect", "ASPECT_CLASS", "orbLabel", "baseStyles", "disclosureStyles", "interpAccordionStyles", "css", "__decorateClass", "customElement"]
7
7
  }
@@ -0,0 +1,22 @@
1
+ import type { UpagrahaResponse } from '../types/index.js';
2
+ import { RoxyDataElement } from '../utils/base-element.js';
3
+ /**
4
+ * Upagraha positions. Renders /vedic-astrology/upagraha: the eleven upagrahas (shadowy sub-planets) in the two groups the tradition separates them into, each with its sidereal longitude, rashi, degree in sign, and nakshatra with pada.
5
+ *
6
+ * @remarks
7
+ * Gulika and Mandi are rendered as the two SEPARATE points they are. Several implementations treat the names as synonyms and print one row; the two are computed from different moments of the Saturn segment and sit a few degrees apart, which is exactly the difference a practitioner is checking when they open this table.
8
+ *
9
+ * Row order is the response order and is not re-sorted: the API returns each group in its classical derivation order, which is the order the positions are computed and taught in.
10
+ */
11
+ export declare class RoxyUpagrahaTable extends RoxyDataElement<UpagrahaResponse> {
12
+ static styles: import("lit").CSSResult[];
13
+ protected renderEmpty(): import("lit").TemplateResult<1>;
14
+ protected renderData(d: UpagrahaResponse): import("lit").TemplateResult<1>;
15
+ private renderGroup;
16
+ }
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'roxy-upagraha-table': RoxyUpagrahaTable;
20
+ }
21
+ }
22
+ //# sourceMappingURL=upagraha-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upagraha-table.d.ts","sourceRoot":"","sources":["../../src/components/upagraha-table.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAwB3D;;;;;;;GAOG;AACH,qBACa,iBAAkB,SAAQ,eAAe,CAAC,gBAAgB,CAAC;IACvE,MAAM,CAAC,MAAM,4BA4EX;IAEF,SAAS,CAAC,WAAW;IAIrB,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,gBAAgB;IAYxC,OAAO,CAAC,WAAW;CA2CnB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,qBAAqB,EAAE,iBAAiB,CAAC;KACzC;CACD"}
@@ -0,0 +1,2 @@
1
+ var N=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var s=(n,e,r,t)=>{for(var o=t>1?void 0:t?U(e,r):e,u=n.length-1,a;u>=0;u--)(a=n[u])&&(o=(t?a(e,r,o):a(o))||o);return t&&o&&N(e,r,o),o};import{css as F,html as h,nothing as q}from"lit";import{customElement as D}from"lit/decorators.js";var k={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};var R=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"];import{html as d,LitElement as K}from"lit";import{property as l,state as p}from"lit/decorators.js";import{ifDefined as w}from"lit/directives/if-defined.js";import{css as M}from"lit";var b=M`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var y="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.";function $(n){return!!n&&!n.startsWith("pk_")}function T(n,e={}){e.warn&&console.warn(y),n.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key",message:y},bubbles:!0,composed:!0}))}var _="https://roxyapi.com/api/v2",x=class{constructor(e){this.baseUrl=_;this.host=e,e.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(e){if(!this.submitUrl&&this.secretKeyRefused())return;this.abort?.abort();let r=new AbortController;this.abort=r,this.host.loading=!0,this.host.error=null;try{let t=this.submitUrl?await fetch(this.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:r.signal}):await this.callApi(e,r.signal);if(!t.ok)throw new Error(await this.readError(t));let o=await t.json();if(r.signal.aborted)return;this.host.data=o}catch(t){if(t?.name==="AbortError")return;this.host.error=t instanceof Error?t.message:String(t)}finally{this.abort===r&&(this.abort=void 0),r.signal.aborted||(this.host.loading=!1)}}callApi(e,r){let t=new URL(`${this.baseUrl}${e.path}`);for(let[u,a]of Object.entries(e.query??{}))a!=null&&t.searchParams.set(u,String(a));let o={Accept:"application/json"};return this.publishableKey&&(o["X-API-Key"]=this.publishableKey),e.body!=null&&(o["Content-Type"]="application/json"),fetch(t,{method:e.method??"GET",headers:o,body:e.body!=null?JSON.stringify(e.body):void 0,signal:r})}secretKeyRefused(){return $(this.publishableKey)?(this.host.error=y,T(this.host),!0):!1}async readError(e){try{let r=await e.json();if(r?.error)return r.error}catch{}return`Request failed (${e.status})`}};function A(n,e,r,t=[]){let o={...r},u=`/${n.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(g,c)=>{let C=o[c];return delete o[c],encodeURIComponent(String(C??""))}),a=new Set(t),f={},S={};for(let[g,c]of Object.entries(o))c===void 0||c===""||(e==="GET"||a.has(g)?f[g]=c:S[g]=c);return{path:u,method:e,query:f,body:e==="POST"?S:void 0}}var G="roxy-data";function I(n){return n.nodeName==="SCRIPT"&&n.getAttribute("type")==="application/json"}var v=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(I(e)&&e.classList.contains(G))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var i=class extends K{constructor(){super();this.data=null;this.endpoint="";this.method="POST";this.remember=!1;this.loading=!1;this.error=null;this.selfFetched=!1;this.editing=!1;this.sticky=!1;this.onEdit=()=>{this.editing=!0};this.onFormSubmit=r=>{let t=r.detail;this.lastValues=t.values,this.sticky=!!t.sticky,this.selfFetched=!0,this.editing=!1,this.remember&&this.writeRemembered(t.values),this.fetcher.run(A(this.endpoint,this.method,t.values,t.queryKeys??[]))};new v(this),this.fetcher=new x(this)}static{this.styles=[b]}willUpdate(r){r.has("publishableKey")&&(this.fetcher.publishableKey=this.publishableKey),r.has("baseUrl")&&this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),r.has("submitUrl")&&(this.fetcher.submitUrl=this.submitUrl)}render(){return this.loading?this.renderLoading():this.error!=null?this.renderError(this.error):this.data!=null?this.selfFetched?this.editing?this.renderForm():this.renderResult(this.data):this.showAttribution()?d`${this.renderData(this.data)}${this.renderAttribution()}`:this.renderData(this.data):this.renderNoData()}renderResult(r){let t=this.sticky?d`${this.renderForm()}${this.renderData(r)}`:d`<div class="roxy-edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">Edit query</button></div>${this.renderData(r)}`;return this.showAttribution()?d`${t}${this.renderAttribution()}`:t}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return d`<div class="roxy-attribution"><a href="https://roxyapi.com/?utm_source=widget&utm_medium=embed" target="_blank" rel="noopener">Spiritual data by RoxyAPI</a></div>`}renderNoData(){return this.endpoint?this.renderForm():this.renderEmpty()}renderForm(){return d`<roxy-endpoint-form data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${w(this.specUrl)}" publishable-key="${w(this.publishableKey)}" submit-label="${w(this.submitLabel)}" lang="${w(this.effectiveLang())}" .initialValues="${this.formInitialValues()}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}formInitialValues(){return this.lastValues??(this.remember?this.readRemembered():void 0)}effectiveLang(){return this.lang||void 0}rememberKey(){return`roxy-ui:form:${this.endpoint}`}readRemembered(){try{let r=sessionStorage.getItem(this.rememberKey());return r?JSON.parse(r):void 0}catch{return}}writeRemembered(r){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(r))}catch{}}renderEmpty(){return d`<div class="roxy-empty" role="status">No data</div>`}renderLoading(){return d`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="Loading"></div>`}renderError(r){let t=d`<div class="roxy-error" role="alert">${r}</div>`;return this.endpoint?d`${t}${this.renderForm()}`:t}};s([l({attribute:!1})],i.prototype,"data",2),s([l({type:String,attribute:"data-endpoint"})],i.prototype,"endpoint",2),s([l({type:String})],i.prototype,"method",2),s([l({type:String,attribute:"publishable-key"})],i.prototype,"publishableKey",2),s([l({type:String,attribute:"base-url"})],i.prototype,"baseUrl",2),s([l({type:String,attribute:"spec-url"})],i.prototype,"specUrl",2),s([l({type:String,attribute:"submit-url"})],i.prototype,"submitUrl",2),s([l({type:Boolean})],i.prototype,"remember",2),s([l({type:String,attribute:"submit-label"})],i.prototype,"submitLabel",2),s([l({type:String})],i.prototype,"attribution",2),s([p()],i.prototype,"loading",2),s([p()],i.prototype,"error",2),s([p()],i.prototype,"selfFetched",2),s([p()],i.prototype,"editing",2),s([p()],i.prototype,"sticky",2);function O(n){let e=n%360;return e<0?e+360:e}function z(n){let e=O(n),r=Math.floor(e/30)%12,t=e%30,o=Math.floor(t),u=(t-o)*60,a=Math.floor(u),f=Math.round((u-a)*60);return{sign:R[r]??"Aries",signIndex:r,degree:o,minute:a,second:f}}function L(n){let{sign:e,degree:r,minute:t}=z(n);return`${r}\xB0 ${e} ${String(t).padStart(2,"0")}'`}function P(n){return n?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():""}function E(n,e=1){if(typeof n!="number"||!Number.isFinite(n))return"";let r=n.toFixed(e);return r.includes(".")?r.replace(/\.?0+$/,""):r}var H=[{key:"timeBased",title:"Time based",note:"From the eightfold division of the day or night, so these depend on the birth time, the place and the weekday."},{key:"sunBased",title:"Sun based",note:"The Dhuma group, derived by fixed arc from the Sun. Dhuma is the Sun plus 133 degrees 20 minutes, and each of the rest follows from the one before it."}],m=class extends i{renderEmpty(){return h`<div class="roxy-empty" role="status">No upagraha data</div>`}renderData(e){let r=H.filter(t=>e[t.key]?.length);return r.length?h`<div class="wrap" aria-label="Upagraha positions"><header class="head"><h2 class="title">Upagrahas</h2></header>${r.map(t=>this.renderGroup(t,e[t.key]))}</div>`:this.renderEmpty()}renderGroup(e,r){return h`<section><div class="group-head"><h3 class="group-title">${e.title}</h3><p class="group-note">${e.note}</p></div><div class="scroll" tabindex="0"><table role="table"><caption class="roxy-sr-only">${e.title} upagrahas: each sub-planet with its rashi, degree in sign, sidereal longitude, and nakshatra with pada.</caption><thead><tr><th scope="col">Upagraha</th><th scope="col">Rashi</th><th scope="col">Degree</th><th scope="col">Longitude</th><th scope="col">Nakshatra</th><th scope="col">Pada</th></tr></thead><tbody>${r.map(t=>{let o=k[P(t.rashi??"")]??"";return h`<tr><td class="name">${t.name}</td><td>${o?h`<span class="glyph">${o}</span>`:q}${t.rashi??""}</td><td class="num">${typeof t.longitude=="number"?L(t.longitude):""}</td><td class="num">${E(t.longitude,2)}</td><td>${t.nakshatra??""}</td><td class="num">${t.nakshatraPada??""}</td></tr>`})}</tbody></table></div></section>`}};m.styles=[b,F`.wrap{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);background:var(--roxy-surface,#fff);box-shadow:var(--roxy-shadow-sm);overflow:hidden}.head{padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7)}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.group-head{padding:var(--roxy-space-md,1rem) var(--roxy-space-md,1rem) 0;gap:var(--roxy-space-xs,.25rem);display:grid}.group-title{font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);margin:0}.group-note{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);line-height:var(--roxy-leading-normal,1.5);margin:0}.scroll{min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem);min-width:520px}thead{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 20%, transparent)}th,td{padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);text-align:left;white-space:nowrap}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.04em}tbody tr{border-top:1px solid var(--roxy-border,#e4e4e7)}td.name{font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a)}.glyph{color:var(--roxy-muted,#71717a);margin-right:.4em}.num{font-variant-numeric:tabular-nums}`],m=s([D("roxy-upagraha-table")],m);export{m as RoxyUpagrahaTable};
2
+ //# sourceMappingURL=upagraha-table.js.map