@roxyapi/ui 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -0
- package/README.md +1 -1
- package/THEMING.md +1 -1
- package/dist/cdn/components/ashtakavarga-grid.js +1 -1
- package/dist/cdn/components/ashtakavarga-grid.js.map +2 -2
- package/dist/cdn/components/biorhythm-chart.js +3 -3
- package/dist/cdn/components/biorhythm-chart.js.map +2 -2
- package/dist/cdn/components/choghadiya-grid.js +1 -1
- package/dist/cdn/components/choghadiya-grid.js.map +2 -2
- package/dist/cdn/components/compatibility-card.js +1 -1
- package/dist/cdn/components/compatibility-card.js.map +2 -2
- package/dist/cdn/components/dasha-timeline.js +3 -3
- package/dist/cdn/components/dasha-timeline.js.map +4 -4
- package/dist/cdn/components/divisional-chart.js +67 -1
- package/dist/cdn/components/divisional-chart.js.map +2 -2
- package/dist/cdn/components/endpoint-form.js +2 -2
- package/dist/cdn/components/endpoint-form.js.map +2 -2
- package/dist/cdn/components/guna-milan.js +1 -1
- package/dist/cdn/components/guna-milan.js.map +2 -2
- package/dist/cdn/components/hexagram.js +1 -1
- package/dist/cdn/components/hexagram.js.map +2 -2
- package/dist/cdn/components/horoscope-card.js +1 -1
- package/dist/cdn/components/horoscope-card.js.map +2 -2
- package/dist/cdn/components/kp-chart.js +1 -1
- package/dist/cdn/components/kp-chart.js.map +2 -2
- package/dist/cdn/components/kp-ruling-planets.js +1 -1
- package/dist/cdn/components/kp-ruling-planets.js.map +2 -2
- package/dist/cdn/components/location-search.js +1 -1
- package/dist/cdn/components/location-search.js.map +2 -2
- package/dist/cdn/components/nakshatra-card.js +1 -1
- package/dist/cdn/components/nakshatra-card.js.map +2 -2
- package/dist/cdn/components/natal-chart.js +12 -3
- package/dist/cdn/components/natal-chart.js.map +2 -2
- package/dist/cdn/components/numerology-card.js +2 -2
- package/dist/cdn/components/numerology-card.js.map +2 -2
- package/dist/cdn/components/panchang-table.js +3 -3
- package/dist/cdn/components/panchang-table.js.map +3 -3
- package/dist/cdn/components/shadbala-table.js +1 -1
- package/dist/cdn/components/shadbala-table.js.map +2 -2
- package/dist/cdn/components/synastry-chart.js +8 -2
- package/dist/cdn/components/synastry-chart.js.map +2 -2
- package/dist/cdn/components/transits-table.js +2 -2
- package/dist/cdn/components/transits-table.js.map +2 -2
- package/dist/cdn/components/vedic-kundli.js +67 -1
- package/dist/cdn/components/vedic-kundli.js.map +2 -2
- package/dist/cdn/components/vedic-planets-table.js +3 -3
- package/dist/cdn/components/vedic-planets-table.js.map +4 -4
- package/dist/cdn/components/yoga-list.js +2 -2
- package/dist/cdn/components/yoga-list.js.map +2 -2
- package/dist/cdn/roxy-ui.js +84 -3
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/components/ashtakavarga-grid.js +1 -1
- package/dist/components/ashtakavarga-grid.js.map +3 -3
- package/dist/components/biorhythm-chart.js +1 -1
- package/dist/components/biorhythm-chart.js.map +2 -2
- package/dist/components/choghadiya-grid.js +1 -1
- package/dist/components/choghadiya-grid.js.map +2 -2
- package/dist/components/compatibility-card.js +1 -1
- package/dist/components/compatibility-card.js.map +2 -2
- package/dist/components/dasha-timeline.d.ts.map +1 -1
- package/dist/components/dasha-timeline.js +1 -1
- package/dist/components/dasha-timeline.js.map +4 -4
- package/dist/components/divisional-chart.js +67 -1
- package/dist/components/divisional-chart.js.map +2 -2
- package/dist/components/endpoint-form.js +1 -1
- package/dist/components/endpoint-form.js.map +2 -2
- package/dist/components/guna-milan.js +1 -1
- package/dist/components/guna-milan.js.map +2 -2
- package/dist/components/hexagram.js +1 -1
- package/dist/components/hexagram.js.map +2 -2
- package/dist/components/horoscope-card.js +1 -1
- package/dist/components/horoscope-card.js.map +2 -2
- package/dist/components/kp-chart.js +1 -1
- package/dist/components/kp-chart.js.map +2 -2
- package/dist/components/kp-ruling-planets.js +1 -1
- package/dist/components/kp-ruling-planets.js.map +2 -2
- package/dist/components/location-search.js +1 -1
- package/dist/components/location-search.js.map +2 -2
- package/dist/components/nakshatra-card.js +1 -1
- package/dist/components/nakshatra-card.js.map +2 -2
- package/dist/components/natal-chart.js +10 -1
- package/dist/components/natal-chart.js.map +2 -2
- package/dist/components/numerology-card.js +1 -1
- package/dist/components/numerology-card.js.map +2 -2
- package/dist/components/panchang-table.d.ts +22 -1
- package/dist/components/panchang-table.d.ts.map +1 -1
- package/dist/components/panchang-table.js +1 -1
- package/dist/components/panchang-table.js.map +3 -3
- package/dist/components/shadbala-table.js +1 -1
- package/dist/components/shadbala-table.js.map +2 -2
- package/dist/components/synastry-chart.js +7 -1
- package/dist/components/synastry-chart.js.map +2 -2
- package/dist/components/transits-table.js +1 -1
- package/dist/components/transits-table.js.map +2 -2
- package/dist/components/vedic-kundli.js +67 -1
- package/dist/components/vedic-kundli.js.map +2 -2
- package/dist/components/vedic-planets-table.d.ts +14 -0
- package/dist/components/vedic-planets-table.d.ts.map +1 -1
- package/dist/components/vedic-planets-table.js +1 -1
- package/dist/components/vedic-planets-table.js.map +4 -4
- package/dist/components/yoga-list.js +1 -1
- package/dist/components/yoga-list.js.map +2 -2
- package/dist/index.cjs +82 -1
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +82 -1
- package/dist/index.js.map +4 -4
- package/dist/styles/tokens.css +4 -4
- package/dist/types/types.gen.d.ts +679 -40
- package/dist/types/types.gen.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/ashtakavarga-grid.ts +1 -1
- package/src/components/biorhythm-chart.ts +1 -1
- package/src/components/choghadiya-grid.ts +1 -1
- package/src/components/compatibility-card.ts +2 -2
- package/src/components/dasha-timeline.ts +10 -19
- package/src/components/endpoint-form.ts +2 -2
- package/src/components/guna-milan.ts +1 -1
- package/src/components/hexagram.ts +3 -3
- package/src/components/horoscope-card.ts +1 -1
- package/src/components/kp-chart.ts +1 -1
- package/src/components/kp-ruling-planets.ts +1 -1
- package/src/components/location-search.ts +1 -1
- package/src/components/nakshatra-card.ts +1 -1
- package/src/components/natal-chart.ts +5 -5
- package/src/components/numerology-card.ts +2 -2
- package/src/components/panchang-table.ts +112 -18
- package/src/components/shadbala-table.ts +1 -1
- package/src/components/synastry-chart.ts +4 -4
- package/src/components/transits-table.ts +1 -1
- package/src/components/vedic-planets-table.ts +221 -3
- package/src/components/yoga-list.ts +1 -1
- package/src/styles/tokens.css +4 -4
- package/src/types/types.gen.ts +680 -41
- package/src/utils/kundli-styles.ts +2 -2
- package/src/utils/tablist.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
var X=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var L=(c,l,r,a)=>{for(var t=a>1?void 0:a?Q(l,r):l,n=c.length-1,e;n>=0;n--)(e=c[n])&&(t=(a?e(l,r,t):e(t))||t);return a&&t&&X(l,r,t),t};import{css as ie,html as d,LitElement as le,nothing as u,svg as h}from"lit";import{customElement as ce,property as J,state as de}from"lit/decorators.js";var $={Sun:"\u2609",Moon:"\u263D",Mercury:"\u263F",Venus:"\u2640",Earth:"\u2641",Mars:"\u2642",Jupiter:"\u2643",Saturn:"\u2644",Uranus:"\u2645",Neptune:"\u2646",Pluto:"\u2647",Rahu:"\u260A",Ketu:"\u260B",Ascendant:"Asc",Lagna:"La",NorthNode:"\u260A",SouthNode:"\u260B","North node":"\u260A","South node":"\u260B",Chiron:"\u26B7",Lilith:"\u26B8","Black moon lilith":"\u26B8"};var j={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 k=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],ge=k.map(c=>c.toLowerCase()),R={conjunction:"\u260C",opposition:"\u260D",trine:"\u25B3",square:"\u25A1",sextile:"\u2731",quincunx:"\u22BB",semisextile:"\u22BC"};import{css as ee}from"lit";var q=ee`: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}*,:before,:after{box-sizing:border-box}@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-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;function f(c){let l=c%360;return l<0?l+360:l}function N(c){let l=f(c),r=Math.floor(l/30)%12,a=l%30,t=Math.floor(a),n=(a-t)*60,e=Math.floor(n),o=Math.round((n-e)*60);return{sign:k[r]??"Aries",signIndex:r,degree:t,minute:e,second:o}}function C(c){return f(c+180)}function B(c,l){let r=f(c),a=f(l)-r;return a<0&&(a+=360),f(r+a/2)}function m(c,l,r,a){let t=a*Math.PI/180;return{x:c+r*Math.cos(t),y:l+r*Math.sin(t)}}import{css as te,html as re}from"lit";function F(){return re`<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>`}var Y=te`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}}`;function E(c,l=1){return typeof c!="number"||!Number.isFinite(c)?"":c.toFixed(l).replace(/\.?0+$/,"")}var z={conjunction:"aspect-conjunction",sextile:"aspect-sextile",square:"aspect-square",trine:"aspect-trine",opposition:"aspect-opposition"};function I(c){return(c.type??"").toLowerCase().replace(/_/g,"-")}var ne="roxy-data";function ae(c){return c.nodeName==="SCRIPT"&&c.getAttribute("type")==="application/json"}var M=class{constructor(l){this.host=l,l.addController(this)}hostConnected(){if(this.host.data!=null)return;let l=this.read();l!==void 0&&(this.host.data=l,this.host.requestUpdate())}read(){let l=this.findInlineScript();return l?this.parse(l.textContent):void 0}findInlineScript(){for(let l of Array.from(this.host.children))if(ae(l)&&l.classList.contains(ne))return l;return null}parse(l){if(l?.trim())try{return JSON.parse(l)}catch{return}}};function y(c){return c?c.charAt(0).toUpperCase()+c.slice(1).toLowerCase():""}import{css as oe,html as U,nothing as se}from"lit";var K=oe`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-fg,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:4px}`;function V(c){let{items:l,active:r,onSelect:a,label:t,idPrefix:n,controls:e=!1}=c;return U`<div class="roxy-tablist" role="tablist" aria-label="${t}" @keydown="${s=>{if(s.key!=="ArrowRight"&&s.key!=="ArrowLeft")return;s.preventDefault();let p=l.findIndex(w=>w.id===r);if(p===-1)return;let g=s.key==="ArrowRight"?1:-1,x=l[(p+g+l.length)%l.length];if(!x)return;a(x.id);let b=s.currentTarget.getRootNode();requestAnimationFrame(()=>{b.querySelector(`#${n}-tab-${x.id}`)?.focus()})}}">${l.map(s=>U`<button type="button" class="roxy-tab" role="tab" id="${n}-tab-${s.id}" aria-selected="${r===s.id?"true":"false"}" aria-controls="${e&&r===s.id?`${n}-panel-${s.id}`:se}" tabindex="${r===s.id?"0":"-1"}" @click="${()=>a(s.id)}">${s.label}</button>`)}</div>`}var D=420,i=D/2,A=164,_=146,P=120,S=96,pe=178,me=196,v=class extends le{constructor(){super();this.data=null;this.houseSystem="placidus";this.view="wheel";new M(this)}getPlanets(){return this.data?.planets??[]}getAscendant(){return this.data?.ascendant?.longitude??0}getMidheaven(){let r=this.data?.midheaven?.longitude;return typeof r=="number"?r:null}toAngle(r){return 180+this.getAscendant()-r}render(){if(!this.data)return d`<div class="roxy-empty" role="status">No chart data</div>`;let r=this.getPlanets(),a=this.data.aspects??[],t=this.view;return d`<div class="wrap"><header><h2 class="title">Natal chart</h2>${this.data.birthDetails?d`<div class="meta">${[this.data.birthDetails.date,this.data.birthDetails.time].filter(Boolean).join(" \xB7 ")}</div>`:u}</header>${V({items:[{id:"wheel",label:"Wheel"},{id:"grid",label:"Aspect grid"}],active:t,onSelect:n=>{this.view=n},label:"Natal chart views",idPrefix:"natal",controls:!0})}<div id="natal-panel-${t}" role="tabpanel" aria-labelledby="natal-tab-${t}">${t==="wheel"?this.renderWheel(r,a):this.renderAspectGrid(r,a)}</div><div class="legend"><span>${r.length} planets</span> <span>${a.length} aspects</span> ${this.data.houseSystem?d`<span>${this.data.houseSystem} houses</span>`:u} <span><span class="legend-swatch" style="background:var(--roxy-success)"></span>harmonious</span> <span><span class="legend-swatch" style="background:var(--roxy-danger)"></span>challenging</span></div>${this.renderDetails()} ${this.renderInterpretations()}</div>`}renderWheel(r,a){return d`<svg viewBox="0 0 ${D} ${D}" role="img" aria-label="Natal chart wheel with twelve houses, planets, and aspects"><title>Natal chart wheel</title><desc>Twelve zodiac sign segments around a circular wheel. Planet glyphs are placed at their ecliptic longitudes. Aspect lines connect related planets.</desc><circle class="wheel-line" cx="${i}" cy="${i}" r="${A}" stroke-width="1.5"/><circle class="wheel-line" cx="${i}" cy="${i}" r="${_-14}" stroke-width="0.8"/><circle class="wheel-line" cx="${i}" cy="${i}" r="${P}" stroke-width="1"/><circle class="wheel-line" cx="${i}" cy="${i}" r="${S-16}" stroke-width="0.5"/>${this.renderTicks()} ${this.renderSpokes()} ${this.renderSigns()} ${this.renderHouseNumbers()} ${this.renderCuspDegrees()} ${this.renderAspects(r,a)} ${this.renderPlanets(r)} ${this.renderAngles()}</svg>`}renderAspectGrid(r,a){let t=r.map(e=>y(e.name)),n=new Map;for(let e of a){let o=[y(e.planet1),y(e.planet2)].sort().join("|");n.set(o,e)}return t.length===0?d`<p class="roxy-empty" role="status">No planets to grid</p>`:d`<div class="grid-scroll"><table class="aspect-grid" aria-label="Planet by planet aspect grid"><thead><tr><th></th>${t.slice(0,-1).map(e=>{let o=$[e]??e.slice(0,2);return d`<th scope="col" title="${e}">${o}</th>`})}</tr></thead><tbody>${t.slice(1).map((e,o)=>{let s=$[e]??e.slice(0,2);return d`<tr><th scope="row" title="${e}">${s}</th>${t.slice(0,o+1).map(p=>{let g=n.get([e,p].sort().join("|"));if(!g)return d`<td class="empty"></td>`;let x=I(g),b=R[x]??R[x.replace(/-/g,"")]??x.slice(0,3),w=z[x]??"aspect-other",T=E(g.orb,1);return d`<td class="${`cell ${w}`}" title="${`${e} ${x} ${p}${T?` (orb ${T}\xB0)`:""}`}"><span class="asp">${b}</span></td>`})} ${t.slice(o+1,-1).map(()=>d`<td class="empty"></td>`)}</tr>`})}</tbody></table></div>`}renderAngles(){let r=this.getAscendant(),a=this.getMidheaven(),t=[this.renderAngleMark(r,"ASC"),this.renderAngleMark(C(r),"DSC")];a!==null&&(t.push(this.renderAngleMark(a,"MC")),t.push(this.renderAngleMark(C(a),"IC")));let n=this.data?.partOfFortune?.longitude;typeof n=="number"&&t.push(this.renderAngleMark(f(n),"PoF"));let e=this.data?.vertex?.longitude;return typeof e=="number"&&t.push(this.renderAngleMark(f(e),"Vtx")),t}renderAngleMark(r,a){let t=this.toAngle(r),n=m(i,i,A,t),e=m(i,i,pe,t),o=m(i,i,me,t);return h`<g><line class="angle-tick" x1="${n.x}" y1="${n.y}" x2="${e.x}" y2="${e.y}"><text class="angle-marker" x="${o.x}" y="${o.y}" text-anchor="middle" dominant-baseline="central">${a}</text></g>`}renderSpokes(){let r=this.data?.houses??[];return(r.length===12?r.map(t=>t.longitude):Array.from({length:12},(t,n)=>this.getAscendant()+n*30)).map(t=>{let n=this.toAngle(t),e=m(i,i,P,n),o=m(i,i,A,n);return h`<line class="wheel-line" x1="${e.x}" y1="${e.y}" x2="${o.x}" y2="${o.y}" stroke-width="0.8">`})}renderSigns(){return k.map((r,a)=>{let t=this.toAngle(a*30+15),n=m(i,i,_,t);return h`<text class="sign-glyph" x="${n.x}" y="${n.y}" text-anchor="middle" dominant-baseline="central">${j[r]}</text>`})}renderHouseNumbers(){let r=this.data?.houses??[];if(r.length===12)return r.map((t,n)=>{let e=r[(n+1)%12],o=B(t.longitude,e?e.longitude:t.longitude+30),s=m(i,i,P-12,this.toAngle(o));return h`<text class="house-num" x="${s.x}" y="${s.y}" text-anchor="middle" dominant-baseline="central">${t.number}</text>`});let a=Math.floor(this.getAscendant()/30);return Array.from({length:12},(t,n)=>{let e=this.toAngle(n*30+15),o=m(i,i,P-12,e),s=(n-a+12)%12+1;return h`<text class="house-num" x="${o.x}" y="${o.y}" text-anchor="middle" dominant-baseline="central">${s}</text>`})}renderTicks(){let r=[];for(let a=0;a<360;a+=5){let t=this.toAngle(a),n=a%30===0,e=n?_-14:A-5,o=m(i,i,e,t),s=m(i,i,A,t);r.push(h`<line class="${n?"tick tick-major":"tick"}" x1="${o.x}" y1="${o.y}" x2="${s.x}" y2="${s.y}" stroke-width="${n?1:.5}">`)}return r}renderCuspDegrees(){let r=this.data?.houses??[];return r.length!==12?u:r.map(a=>{let t=this.toAngle(a.longitude),n=m(i,i,P+9,t),e=N(a.longitude);return h`<text class="cusp-deg" x="${n.x}" y="${n.y}" text-anchor="middle" dominant-baseline="central">${e.degree}°${String(e.minute).padStart(2,"0")}'</text>`})}renderPlanets(r){let t=r.filter(e=>Number.isFinite(e.longitude)).map(e=>({p:e,trueLon:f(e.longitude),displayLon:f(e.longitude)})).sort((e,o)=>e.trueLon-o.trueLon);for(let e=1;e<t.length;e++){let o=t[e-1],s=t[e];if(!o||!s)continue;let p=o.displayLon+7;s.displayLon<p&&(s.displayLon=p)}let n=t[t.length-1];if(n&&n.displayLon>360){let e=n.displayLon-360;for(let o of t)o.displayLon-=e}return t.map(({p:e,trueLon:o,displayLon:s})=>{let p=this.toAngle(o),g=this.toAngle(s),x=m(i,i,S,g),b=m(i,i,S-13,g),w=m(i,i,A-4,p),T=m(i,i,S+8,g),W=$[y(e.name)]??e.name.slice(0,2),G=N(e.longitude),H=e.isRetrograde===!0,O=`${G.degree}\xB0${String(G.minute).padStart(2,"0")}'`,Z=Math.abs(s-o)>.5;return h`<g>${Z?h`<line class="planet-leader" x1="${w.x}" y1="${w.y}" x2="${T.x}" y2="${T.y}">`:u}<text class="planet-glyph" x="${x.x}" y="${x.y}" text-anchor="middle" dominant-baseline="central"><title>${e.name}${H?" retrograde":""} - ${O} ${e.sign??""}</title>${W}</text><text class="planet-deg" x="${b.x}" y="${b.y}" text-anchor="middle" dominant-baseline="central">${O}${H?h`<tspan class="retro">℞</tspan>`:u}</text></g>`})}renderDetails(){let r=this.data?.summary,a=this.data?.aspectsInterpretation;if(!r&&!a)return u;let t=r?.retrogradePlanets??[];return d`<div class="details">${r?.dominantElement||r?.dominantModality?d`<div class="pill-row">${r.dominantElement?d`<span class="pill">Dominant element: ${r.dominantElement}</span>`:u} ${r.dominantModality?d`<span class="pill">Dominant modality: ${r.dominantModality}</span>`:u}</div>`:u} ${a?d`<div class="pill-row"><span class="pill pill--success">Harmonious ${a.harmonious}</span> <span class="pill pill--danger">Challenging ${a.challenging}</span> <span class="pill pill--muted">Neutral ${a.neutral}</span></div>`:u} ${t.length>0?d`<div class="pill-row">${t.map(n=>{let e=$[n]??n.slice(0,2);return d`<span class="pill pill--muted">${e} ${n} R</span>`})}</div>`:u} ${a?.summary?d`<p class="summary">${a.summary}</p>`:u} ${this.renderElementModalityGrid()}</div>`}renderElementModalityGrid(){let r=this.getPlanets();if(r.length===0)return u;let a=["Fire","Earth","Air","Water"],t=["Cardinal","Fixed","Mutable"],n=k,e={};for(let o of a)e[o]={Cardinal:[],Fixed:[],Mutable:[]};for(let o of r){let s=n.indexOf(y(o.sign??""));if(s<0)continue;let p=a[s%4],g=t[s%3],x=$[y(o.name)]??y(o.name).slice(0,2);e[p]?.[g]?.push(x)}return d`<table class="em-grid" aria-label="Element and modality distribution"><thead><tr><th></th>${t.map(o=>d`<th scope="col">${o.slice(0,3)}</th>`)}<th scope="col">Total</th></tr></thead><tbody>${a.map(o=>{let s=t.reduce((p,g)=>p+(e[o]?.[g]?.length??0),0);return d`<tr><th scope="row">${o}</th>${t.map(p=>d`<td>${(e[o]?.[p]??[]).join(" ")}</td>`)}<td class="em-total">${s}</td></tr>`})}<tr><th scope="row">Total</th>${t.map(o=>d`<td class="em-total">${a.reduce((s,p)=>s+(e[p]?.[o]?.length??0),0)}</td>`)}<td class="em-total">${r.length}</td></tr></tbody></table>`}renderInterpretations(){let r=this.getPlanets().filter(a=>a.interpretation);return r.length===0?u:d`<section class="interpretations"><h3>Planet readings</h3>${r.map((a,t)=>{let n=a.interpretation,e=$[y(a.name)]??"",o=E(a.degree??0,1);return d`<details class="interp-card" name="natal-planet-readings" ?open="${t===0}"><summary><span>${e} ${a.name}</span> <span class="interp-aside"><small>${a.sign??""} ${o}</small> ${F()}</span></summary><div class="interp-body">${n.summary?d`<p class="interp-summary">${n.summary}</p>`:u} ${n.detailed?d`<p class="interp-detail">${n.detailed}</p>`:u} ${n.keywords?.length?d`<div class="interp-keywords">${n.keywords.map(s=>d`<span class="kw">${s}</span>`)}</div>`:u}</div></details>`})}</section>`}renderAspects(r,a){let t=new Map;for(let n of r){if(typeof n.longitude!="number")continue;let e=y(n.name);e&&t.set(e,n.longitude)}return a.map(n=>{let e=t.get(y(n.planet1)),o=t.get(y(n.planet2));if(e===void 0||o===void 0)return u;let s=m(i,i,S-18,this.toAngle(e)),p=m(i,i,S-18,this.toAngle(o)),g=I(n),x=z[g]??"aspect-other",b=E(n.orb,1);return h`<line class="${`aspect ${x}`}" x1="${s.x}" y1="${s.y}" x2="${p.x}" y2="${p.y}"><title>${n.planet1} ${g||""} ${n.planet2}${b?` (orb ${b}\xB0)`:""}</title></line>`})}};v.styles=[q,K,Y,ie`.wrap{gap:var(--roxy-space-md,1rem);width:100%;display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-primary,#0f172a);margin:0}.meta{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem)}svg{aspect-ratio:1;width:100%;max-width:560px;height:auto;margin:0 auto;display:block}.wheel-line{fill:none;stroke:var(--roxy-border,#e4e4e7)}.sign-glyph{fill:var(--roxy-secondary,#475569);font-size:14px;font-family:var(--roxy-font-sans)}.planet-glyph{fill:var(--roxy-accent,#f59e0b);font-size:14px;font-weight:600;font-family:var(--roxy-font-sans)}.planet-deg{fill:var(--roxy-fg,#0a0a0a);font-size:7px;font-family:var(--roxy-font-sans)}@container (width<=480px){.sign-glyph,.planet-glyph{font-size:18px}.planet-deg{font-size:10px}.house-num{font-size:12px}}.planet-deg .retro{fill:var(--roxy-danger,#dc2626)}.planet-leader{stroke:var(--roxy-accent,#f59e0b);stroke-width:.5px;opacity:.55}.house-num{fill:var(--roxy-muted,#71717a);font-size:9px;font-family:var(--roxy-font-sans)}.cusp-deg{fill:var(--roxy-muted,#71717a);font-size:6px;font-family:var(--roxy-font-sans)}.tick{stroke:var(--roxy-border,#e4e4e7)}.tick-major{stroke:var(--roxy-secondary,#475569)}.aspect{stroke-width:.8px;fill:none;opacity:.55}.aspect-trine,.aspect-sextile{stroke:var(--roxy-success,#16a34a)}.aspect-square,.aspect-opposition{stroke:var(--roxy-danger,#dc2626)}.aspect-conjunction{stroke:var(--roxy-accent-fg,#b45309)}.aspect-other{stroke:var(--roxy-muted,#71717a);opacity:.4}.angle-marker{fill:var(--roxy-accent-fg,#b45309);font-size:10px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.04em}.angle-tick{stroke:var(--roxy-accent-fg,#b45309);stroke-width:1.5px}.legend{font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.legend-swatch{vertical-align:middle;border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}.grid-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table.aspect-grid{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem);margin:0 auto}table.aspect-grid th,table.aspect-grid td{text-align:center;border:1px solid var(--roxy-border,#e4e4e7);width:1.6rem;height:1.6rem;padding:0}table.aspect-grid th{color:var(--roxy-secondary,#475569);font-weight:var(--roxy-weight-bold,600)}table.aspect-grid td.cell{cursor:default}table.aspect-grid td.empty{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 18%, transparent)}table.aspect-grid td .asp{font-size:.95em;line-height:1}table.aspect-grid td.aspect-trine .asp,table.aspect-grid td.aspect-sextile .asp{color:var(--roxy-success,#16a34a)}table.aspect-grid td.aspect-square .asp,table.aspect-grid td.aspect-opposition .asp{color:var(--roxy-danger,#dc2626)}table.aspect-grid td.aspect-conjunction .asp{color:var(--roxy-accent-fg,#b45309)}table.aspect-grid td.aspect-other .asp{color:var(--roxy-muted,#71717a)}.details{margin-top:var(--roxy-space-md,1rem)}.pill-row{gap:var(--roxy-space-xs,.25rem);margin-bottom:var(--roxy-space-xs,.25rem);flex-wrap:wrap;display:flex}.pill{border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);background:color-mix(in srgb, var(--roxy-fg,#0f172a) 8%, transparent);color:var(--roxy-fg,#0f172a);padding:2px 8px}.pill--success{background:color-mix(in srgb, var(--roxy-success,#16a34a) 15%, transparent);color:var(--roxy-success,#16a34a)}.pill--danger{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 15%, transparent);color:var(--roxy-danger,#dc2626)}.pill--muted{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent);color:var(--roxy-fg,#0a0a0a)}.summary{color:var(--roxy-fg,#0f172a);font-size:var(--roxy-text-sm,.875rem);margin:var(--roxy-space-md,1rem) 0}.em-grid{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem);width:100%}.em-grid th,.em-grid td{border:1px solid var(--roxy-border,#e4e4e7);text-align:center;vertical-align:middle;padding:3px 5px}.em-grid th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;letter-spacing:.04em}.em-grid th[scope=row]{text-align:left}.em-grid td{color:var(--roxy-accent,#f59e0b);min-width:1.4rem;font-size:.95em;line-height:1.4}.em-grid .em-total{color:var(--roxy-fg,#0a0a0a);font-weight:var(--roxy-weight-bold,600);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 25%, transparent)}.interpretations{margin-top:var(--roxy-space-md,1rem)}.interpretations h3{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em;margin:0 0 var(--roxy-space-sm,.5rem);font-weight:600}.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,#0f172a);justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);font-weight:500;display:flex}.interp-aside{align-items:center;gap:.6em;display:inline-flex}.interp-aside small{color:var(--roxy-muted,#71717a);font-weight:400}.interp-body{margin-top:var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0f172a);font-size:var(--roxy-text-sm,.875rem)}.interp-keywords{flex-wrap:wrap;gap:.25rem;margin-top:.5rem;display:flex}.interp-keywords .kw{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-accent-fg,#b45309);font-size:var(--roxy-text-xs,.75rem);border-radius:9999px;padding:1px 8px}`],L([J({attribute:!1})],v.prototype,"data",2),L([J({type:String,attribute:"house-system",reflect:!0})],v.prototype,"houseSystem",2),L([de()],v.prototype,"view",2),v=L([ce("roxy-natal-chart")],v);export{v as RoxyNatalChart};
|
|
1
|
+
var X=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var L=(c,l,r,a)=>{for(var t=a>1?void 0:a?Q(l,r):l,n=c.length-1,e;n>=0;n--)(e=c[n])&&(t=(a?e(l,r,t):e(t))||t);return a&&t&&X(l,r,t),t};import{css as ie,html as d,LitElement as le,nothing as u,svg as h}from"lit";import{customElement as ce,property as J,state as de}from"lit/decorators.js";var $={Sun:"\u2609",Moon:"\u263D",Mercury:"\u263F",Venus:"\u2640",Earth:"\u2641",Mars:"\u2642",Jupiter:"\u2643",Saturn:"\u2644",Uranus:"\u2645",Neptune:"\u2646",Pluto:"\u2647",Rahu:"\u260A",Ketu:"\u260B",Ascendant:"Asc",Lagna:"La",NorthNode:"\u260A",SouthNode:"\u260B","North node":"\u260A","South node":"\u260B",Chiron:"\u26B7",Lilith:"\u26B8","Black moon lilith":"\u26B8"};var j={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 k=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],ge=k.map(c=>c.toLowerCase()),R={conjunction:"\u260C",opposition:"\u260D",trine:"\u25B3",square:"\u25A1",sextile:"\u2731",quincunx:"\u22BB",semisextile:"\u22BC"};import{css as ee}from"lit";var q=ee`: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}*,:before,:after{box-sizing:border-box}@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-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;function f(c){let l=c%360;return l<0?l+360:l}function N(c){let l=f(c),r=Math.floor(l/30)%12,a=l%30,t=Math.floor(a),n=(a-t)*60,e=Math.floor(n),o=Math.round((n-e)*60);return{sign:k[r]??"Aries",signIndex:r,degree:t,minute:e,second:o}}function C(c){return f(c+180)}function B(c,l){let r=f(c),a=f(l)-r;return a<0&&(a+=360),f(r+a/2)}function m(c,l,r,a){let t=a*Math.PI/180;return{x:c+r*Math.cos(t),y:l+r*Math.sin(t)}}import{css as te,html as re}from"lit";function F(){return re`<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>`}var Y=te`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}}`;function E(c,l=1){return typeof c!="number"||!Number.isFinite(c)?"":c.toFixed(l).replace(/\.?0+$/,"")}var z={conjunction:"aspect-conjunction",sextile:"aspect-sextile",square:"aspect-square",trine:"aspect-trine",opposition:"aspect-opposition"};function I(c){return(c.type??"").toLowerCase().replace(/_/g,"-")}var ne="roxy-data";function ae(c){return c.nodeName==="SCRIPT"&&c.getAttribute("type")==="application/json"}var M=class{constructor(l){this.host=l,l.addController(this)}hostConnected(){if(this.host.data!=null)return;let l=this.read();l!==void 0&&(this.host.data=l,this.host.requestUpdate())}read(){let l=this.findInlineScript();return l?this.parse(l.textContent):void 0}findInlineScript(){for(let l of Array.from(this.host.children))if(ae(l)&&l.classList.contains(ne))return l;return null}parse(l){if(l?.trim())try{return JSON.parse(l)}catch{return}}};function y(c){return c?c.charAt(0).toUpperCase()+c.slice(1).toLowerCase():""}import{css as oe,html as U,nothing as se}from"lit";var K=oe`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:4px}`;function V(c){let{items:l,active:r,onSelect:a,label:t,idPrefix:n,controls:e=!1}=c;return U`<div class="roxy-tablist" role="tablist" aria-label="${t}" @keydown="${s=>{if(s.key!=="ArrowRight"&&s.key!=="ArrowLeft")return;s.preventDefault();let p=l.findIndex(w=>w.id===r);if(p===-1)return;let g=s.key==="ArrowRight"?1:-1,x=l[(p+g+l.length)%l.length];if(!x)return;a(x.id);let b=s.currentTarget.getRootNode();requestAnimationFrame(()=>{b.querySelector(`#${n}-tab-${x.id}`)?.focus()})}}">${l.map(s=>U`<button type="button" class="roxy-tab" role="tab" id="${n}-tab-${s.id}" aria-selected="${r===s.id?"true":"false"}" aria-controls="${e&&r===s.id?`${n}-panel-${s.id}`:se}" tabindex="${r===s.id?"0":"-1"}" @click="${()=>a(s.id)}">${s.label}</button>`)}</div>`}var D=420,i=D/2,A=164,_=146,P=120,S=96,pe=178,me=196,v=class extends le{constructor(){super();this.data=null;this.houseSystem="placidus";this.view="wheel";new M(this)}getPlanets(){return this.data?.planets??[]}getAscendant(){return this.data?.ascendant?.longitude??0}getMidheaven(){let r=this.data?.midheaven?.longitude;return typeof r=="number"?r:null}toAngle(r){return 180+this.getAscendant()-r}render(){if(!this.data)return d`<div class="roxy-empty" role="status">No chart data</div>`;let r=this.getPlanets(),a=this.data.aspects??[],t=this.view;return d`<div class="wrap"><header><h2 class="title">Natal chart</h2>${this.data.birthDetails?d`<div class="meta">${[this.data.birthDetails.date,this.data.birthDetails.time].filter(Boolean).join(" \xB7 ")}</div>`:u}</header>${V({items:[{id:"wheel",label:"Wheel"},{id:"grid",label:"Aspect grid"}],active:t,onSelect:n=>{this.view=n},label:"Natal chart views",idPrefix:"natal",controls:!0})}<div id="natal-panel-${t}" role="tabpanel" aria-labelledby="natal-tab-${t}">${t==="wheel"?this.renderWheel(r,a):this.renderAspectGrid(r,a)}</div><div class="legend"><span>${r.length} planets</span> <span>${a.length} aspects</span> ${this.data.houseSystem?d`<span>${this.data.houseSystem} houses</span>`:u} <span><span class="legend-swatch" style="background:var(--roxy-success)"></span>harmonious</span> <span><span class="legend-swatch" style="background:var(--roxy-danger)"></span>challenging</span></div>${this.renderDetails()} ${this.renderInterpretations()}</div>`}renderWheel(r,a){return d`<svg viewBox="0 0 ${D} ${D}" role="img" aria-label="Natal chart wheel with twelve houses, planets, and aspects"><title>Natal chart wheel</title><desc>Twelve zodiac sign segments around a circular wheel. Planet glyphs are placed at their ecliptic longitudes. Aspect lines connect related planets.</desc><circle class="wheel-line" cx="${i}" cy="${i}" r="${A}" stroke-width="1.5"/><circle class="wheel-line" cx="${i}" cy="${i}" r="${_-14}" stroke-width="0.8"/><circle class="wheel-line" cx="${i}" cy="${i}" r="${P}" stroke-width="1"/><circle class="wheel-line" cx="${i}" cy="${i}" r="${S-16}" stroke-width="0.5"/>${this.renderTicks()} ${this.renderSpokes()} ${this.renderSigns()} ${this.renderHouseNumbers()} ${this.renderCuspDegrees()} ${this.renderAspects(r,a)} ${this.renderPlanets(r)} ${this.renderAngles()}</svg>`}renderAspectGrid(r,a){let t=r.map(e=>y(e.name)),n=new Map;for(let e of a){let o=[y(e.planet1),y(e.planet2)].sort().join("|");n.set(o,e)}return t.length===0?d`<p class="roxy-empty" role="status">No planets to grid</p>`:d`<div class="grid-scroll"><table class="aspect-grid" aria-label="Planet by planet aspect grid"><thead><tr><th></th>${t.slice(0,-1).map(e=>{let o=$[e]??e.slice(0,2);return d`<th scope="col" title="${e}">${o}</th>`})}</tr></thead><tbody>${t.slice(1).map((e,o)=>{let s=$[e]??e.slice(0,2);return d`<tr><th scope="row" title="${e}">${s}</th>${t.slice(0,o+1).map(p=>{let g=n.get([e,p].sort().join("|"));if(!g)return d`<td class="empty"></td>`;let x=I(g),b=R[x]??R[x.replace(/-/g,"")]??x.slice(0,3),w=z[x]??"aspect-other",T=E(g.orb,1);return d`<td class="${`cell ${w}`}" title="${`${e} ${x} ${p}${T?` (orb ${T}\xB0)`:""}`}"><span class="asp">${b}</span></td>`})} ${t.slice(o+1,-1).map(()=>d`<td class="empty"></td>`)}</tr>`})}</tbody></table></div>`}renderAngles(){let r=this.getAscendant(),a=this.getMidheaven(),t=[this.renderAngleMark(r,"ASC"),this.renderAngleMark(C(r),"DSC")];a!==null&&(t.push(this.renderAngleMark(a,"MC")),t.push(this.renderAngleMark(C(a),"IC")));let n=this.data?.partOfFortune?.longitude;typeof n=="number"&&t.push(this.renderAngleMark(f(n),"PoF"));let e=this.data?.vertex?.longitude;return typeof e=="number"&&t.push(this.renderAngleMark(f(e),"Vtx")),t}renderAngleMark(r,a){let t=this.toAngle(r),n=m(i,i,A,t),e=m(i,i,pe,t),o=m(i,i,me,t);return h`
|
|
2
|
+
<g>
|
|
3
|
+
<line class="angle-tick" x1=${n.x} y1=${n.y} x2=${e.x} y2=${e.y} />
|
|
4
|
+
<text class="angle-marker" x=${o.x} y=${o.y} text-anchor="middle" dominant-baseline="central">${a}</text>
|
|
5
|
+
</g>
|
|
6
|
+
`}renderSpokes(){let r=this.data?.houses??[];return(r.length===12?r.map(t=>t.longitude):Array.from({length:12},(t,n)=>this.getAscendant()+n*30)).map(t=>{let n=this.toAngle(t),e=m(i,i,P,n),o=m(i,i,A,n);return h`<line class="wheel-line" x1=${e.x} y1=${e.y} x2=${o.x} y2=${o.y} stroke-width="0.8" />`})}renderSigns(){return k.map((r,a)=>{let t=this.toAngle(a*30+15),n=m(i,i,_,t);return h`<text class="sign-glyph" x=${n.x} y=${n.y} text-anchor="middle" dominant-baseline="central">${j[r]}</text>`})}renderHouseNumbers(){let r=this.data?.houses??[];if(r.length===12)return r.map((t,n)=>{let e=r[(n+1)%12],o=B(t.longitude,e?e.longitude:t.longitude+30),s=m(i,i,P-12,this.toAngle(o));return h`<text class="house-num" x=${s.x} y=${s.y} text-anchor="middle" dominant-baseline="central">${t.number}</text>`});let a=Math.floor(this.getAscendant()/30);return Array.from({length:12},(t,n)=>{let e=this.toAngle(n*30+15),o=m(i,i,P-12,e),s=(n-a+12)%12+1;return h`<text class="house-num" x=${o.x} y=${o.y} text-anchor="middle" dominant-baseline="central">${s}</text>`})}renderTicks(){let r=[];for(let a=0;a<360;a+=5){let t=this.toAngle(a),n=a%30===0,e=n?_-14:A-5,o=m(i,i,e,t),s=m(i,i,A,t);r.push(h`<line class=${n?"tick tick-major":"tick"} x1=${o.x} y1=${o.y} x2=${s.x} y2=${s.y} stroke-width=${n?1:.5} />`)}return r}renderCuspDegrees(){let r=this.data?.houses??[];return r.length!==12?u:r.map(a=>{let t=this.toAngle(a.longitude),n=m(i,i,P+9,t),e=N(a.longitude);return h`<text class="cusp-deg" x=${n.x} y=${n.y} text-anchor="middle" dominant-baseline="central">${e.degree}°${String(e.minute).padStart(2,"0")}'</text>`})}renderPlanets(r){let t=r.filter(e=>Number.isFinite(e.longitude)).map(e=>({p:e,trueLon:f(e.longitude),displayLon:f(e.longitude)})).sort((e,o)=>e.trueLon-o.trueLon);for(let e=1;e<t.length;e++){let o=t[e-1],s=t[e];if(!o||!s)continue;let p=o.displayLon+7;s.displayLon<p&&(s.displayLon=p)}let n=t[t.length-1];if(n&&n.displayLon>360){let e=n.displayLon-360;for(let o of t)o.displayLon-=e}return t.map(({p:e,trueLon:o,displayLon:s})=>{let p=this.toAngle(o),g=this.toAngle(s),x=m(i,i,S,g),b=m(i,i,S-13,g),w=m(i,i,A-4,p),T=m(i,i,S+8,g),W=$[y(e.name)]??e.name.slice(0,2),G=N(e.longitude),H=e.isRetrograde===!0,O=`${G.degree}\xB0${String(G.minute).padStart(2,"0")}'`,Z=Math.abs(s-o)>.5;return h`<g>
|
|
7
|
+
${Z?h`<line class="planet-leader" x1=${w.x} y1=${w.y} x2=${T.x} y2=${T.y} />`:u}
|
|
8
|
+
<text class="planet-glyph" x=${x.x} y=${x.y} text-anchor="middle" dominant-baseline="central"><title>${e.name}${H?" retrograde":""} - ${O} ${e.sign??""}</title>${W}</text>
|
|
9
|
+
<text class="planet-deg" x=${b.x} y=${b.y} text-anchor="middle" dominant-baseline="central">${O}${H?h`<tspan class="retro"> ℞</tspan>`:u}</text>
|
|
10
|
+
</g>`})}renderDetails(){let r=this.data?.summary,a=this.data?.aspectsInterpretation;if(!r&&!a)return u;let t=r?.retrogradePlanets??[];return d`<div class="details">${r?.dominantElement||r?.dominantModality?d`<div class="pill-row">${r.dominantElement?d`<span class="pill">Dominant element: ${r.dominantElement}</span>`:u} ${r.dominantModality?d`<span class="pill">Dominant modality: ${r.dominantModality}</span>`:u}</div>`:u} ${a?d`<div class="pill-row"><span class="pill pill--success">Harmonious ${a.harmonious}</span> <span class="pill pill--danger">Challenging ${a.challenging}</span> <span class="pill pill--muted">Neutral ${a.neutral}</span></div>`:u} ${t.length>0?d`<div class="pill-row">${t.map(n=>{let e=$[n]??n.slice(0,2);return d`<span class="pill pill--muted">${e} ${n} R</span>`})}</div>`:u} ${a?.summary?d`<p class="summary">${a.summary}</p>`:u} ${this.renderElementModalityGrid()}</div>`}renderElementModalityGrid(){let r=this.getPlanets();if(r.length===0)return u;let a=["Fire","Earth","Air","Water"],t=["Cardinal","Fixed","Mutable"],n=k,e={};for(let o of a)e[o]={Cardinal:[],Fixed:[],Mutable:[]};for(let o of r){let s=n.indexOf(y(o.sign??""));if(s<0)continue;let p=a[s%4],g=t[s%3],x=$[y(o.name)]??y(o.name).slice(0,2);e[p]?.[g]?.push(x)}return d`<table class="em-grid" aria-label="Element and modality distribution"><thead><tr><th></th>${t.map(o=>d`<th scope="col">${o.slice(0,3)}</th>`)}<th scope="col">Total</th></tr></thead><tbody>${a.map(o=>{let s=t.reduce((p,g)=>p+(e[o]?.[g]?.length??0),0);return d`<tr><th scope="row">${o}</th>${t.map(p=>d`<td>${(e[o]?.[p]??[]).join(" ")}</td>`)}<td class="em-total">${s}</td></tr>`})}<tr><th scope="row">Total</th>${t.map(o=>d`<td class="em-total">${a.reduce((s,p)=>s+(e[p]?.[o]?.length??0),0)}</td>`)}<td class="em-total">${r.length}</td></tr></tbody></table>`}renderInterpretations(){let r=this.getPlanets().filter(a=>a.interpretation);return r.length===0?u:d`<section class="interpretations"><h3>Planet readings</h3>${r.map((a,t)=>{let n=a.interpretation,e=$[y(a.name)]??"",o=E(a.degree??0,1);return d`<details class="interp-card" name="natal-planet-readings" ?open="${t===0}"><summary><span>${e} ${a.name}</span> <span class="interp-aside"><small>${a.sign??""} ${o}</small> ${F()}</span></summary><div class="interp-body">${n.summary?d`<p class="interp-summary">${n.summary}</p>`:u} ${n.detailed?d`<p class="interp-detail">${n.detailed}</p>`:u} ${n.keywords?.length?d`<div class="interp-keywords">${n.keywords.map(s=>d`<span class="kw">${s}</span>`)}</div>`:u}</div></details>`})}</section>`}renderAspects(r,a){let t=new Map;for(let n of r){if(typeof n.longitude!="number")continue;let e=y(n.name);e&&t.set(e,n.longitude)}return a.map(n=>{let e=t.get(y(n.planet1)),o=t.get(y(n.planet2));if(e===void 0||o===void 0)return u;let s=m(i,i,S-18,this.toAngle(e)),p=m(i,i,S-18,this.toAngle(o)),g=I(n),x=z[g]??"aspect-other",b=E(n.orb,1);return h`<line class=${`aspect ${x}`} x1=${s.x} y1=${s.y} x2=${p.x} y2=${p.y}><title>${n.planet1} ${g||""} ${n.planet2}${b?` (orb ${b}\xB0)`:""}</title></line>`})}};v.styles=[q,K,Y,ie`.wrap{gap:var(--roxy-space-md,1rem);width:100%;display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-primary,#0f172a);margin:0}.meta{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem)}svg{aspect-ratio:1;width:100%;max-width:560px;height:auto;margin:0 auto;display:block}.wheel-line{fill:none;stroke:var(--roxy-border,#e4e4e7)}.sign-glyph{fill:var(--roxy-secondary,#475569);font-size:14px;font-family:var(--roxy-font-sans)}.planet-glyph{fill:var(--roxy-accent,#f59e0b);font-size:14px;font-weight:600;font-family:var(--roxy-font-sans)}.planet-deg{fill:var(--roxy-fg,#0a0a0a);font-size:7px;font-family:var(--roxy-font-sans)}@container (width<=480px){.sign-glyph,.planet-glyph{font-size:18px}.planet-deg{font-size:10px}.house-num{font-size:12px}}.planet-deg .retro{fill:var(--roxy-danger,#dc2626)}.planet-leader{stroke:var(--roxy-accent,#f59e0b);stroke-width:.5px;opacity:.55}.house-num{fill:var(--roxy-muted,#71717a);font-size:9px;font-family:var(--roxy-font-sans)}.cusp-deg{fill:var(--roxy-muted,#71717a);font-size:6px;font-family:var(--roxy-font-sans)}.tick{stroke:var(--roxy-border,#e4e4e7)}.tick-major{stroke:var(--roxy-secondary,#475569)}.aspect{stroke-width:.8px;fill:none;opacity:.55}.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:.4}.angle-marker{fill:var(--roxy-accent-ink,#b45309);font-size:10px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.04em}.angle-tick{stroke:var(--roxy-accent-ink,#b45309);stroke-width:1.5px}.legend{font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.legend-swatch{vertical-align:middle;border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}.grid-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table.aspect-grid{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem);margin:0 auto}table.aspect-grid th,table.aspect-grid td{text-align:center;border:1px solid var(--roxy-border,#e4e4e7);width:1.6rem;height:1.6rem;padding:0}table.aspect-grid th{color:var(--roxy-secondary,#475569);font-weight:var(--roxy-weight-bold,600)}table.aspect-grid td.cell{cursor:default}table.aspect-grid td.empty{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 18%, transparent)}table.aspect-grid td .asp{font-size:.95em;line-height:1}table.aspect-grid td.aspect-trine .asp,table.aspect-grid td.aspect-sextile .asp{color:var(--roxy-success,#16a34a)}table.aspect-grid td.aspect-square .asp,table.aspect-grid td.aspect-opposition .asp{color:var(--roxy-danger,#dc2626)}table.aspect-grid td.aspect-conjunction .asp{color:var(--roxy-accent-ink,#b45309)}table.aspect-grid td.aspect-other .asp{color:var(--roxy-muted,#71717a)}.details{margin-top:var(--roxy-space-md,1rem)}.pill-row{gap:var(--roxy-space-xs,.25rem);margin-bottom:var(--roxy-space-xs,.25rem);flex-wrap:wrap;display:flex}.pill{border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);background:color-mix(in srgb, var(--roxy-fg,#0f172a) 8%, transparent);color:var(--roxy-fg,#0f172a);padding:2px 8px}.pill--success{background:color-mix(in srgb, var(--roxy-success,#16a34a) 15%, transparent);color:var(--roxy-success,#16a34a)}.pill--danger{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 15%, transparent);color:var(--roxy-danger,#dc2626)}.pill--muted{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent);color:var(--roxy-fg,#0a0a0a)}.summary{color:var(--roxy-fg,#0f172a);font-size:var(--roxy-text-sm,.875rem);margin:var(--roxy-space-md,1rem) 0}.em-grid{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem);width:100%}.em-grid th,.em-grid td{border:1px solid var(--roxy-border,#e4e4e7);text-align:center;vertical-align:middle;padding:3px 5px}.em-grid th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;letter-spacing:.04em}.em-grid th[scope=row]{text-align:left}.em-grid td{color:var(--roxy-accent,#f59e0b);min-width:1.4rem;font-size:.95em;line-height:1.4}.em-grid .em-total{color:var(--roxy-fg,#0a0a0a);font-weight:var(--roxy-weight-bold,600);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 25%, transparent)}.interpretations{margin-top:var(--roxy-space-md,1rem)}.interpretations h3{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em;margin:0 0 var(--roxy-space-sm,.5rem);font-weight:600}.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,#0f172a);justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);font-weight:500;display:flex}.interp-aside{align-items:center;gap:.6em;display:inline-flex}.interp-aside small{color:var(--roxy-muted,#71717a);font-weight:400}.interp-body{margin-top:var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0f172a);font-size:var(--roxy-text-sm,.875rem)}.interp-keywords{flex-wrap:wrap;gap:.25rem;margin-top:.5rem;display:flex}.interp-keywords .kw{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-accent-ink,#b45309);font-size:var(--roxy-text-xs,.75rem);border-radius:9999px;padding:1px 8px}`],L([J({attribute:!1})],v.prototype,"data",2),L([J({type:String,attribute:"house-system",reflect:!0})],v.prototype,"houseSystem",2),L([de()],v.prototype,"view",2),v=L([ce("roxy-natal-chart")],v);export{v as RoxyNatalChart};
|
|
2
11
|
//# sourceMappingURL=natal-chart.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/natal-chart.ts", "../../src/tokens/index.ts", "../../src/utils/base-styles.ts", "../../src/utils/degree.ts", "../../src/utils/disclosure.ts", "../../src/utils/format.ts", "../../src/utils/markup-data.ts", "../../src/utils/string.ts", "../../src/utils/tablist.ts"],
|
|
4
|
-
"sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport {\n\tASPECT_SYMBOL,\n\tPLANET_GLYPH,\n\tSIGN_GLYPH,\n\tSIGNS_ORDER,\n} from '../tokens/index.js';\nimport type { NatalChartResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport {\n\tarcMidpoint,\n\tlongitudeToSignPosition,\n\tnormalizeLongitude,\n\toppositePoint,\n\tpolarToCartesian,\n} from '../utils/degree.js';\nimport { chevron, disclosureStyles } from '../utils/disclosure.js';\nimport {\n\tASPECT_CLASS,\n\tformatNumber,\n\tnormalizeAspect,\n} from '../utils/format.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\nimport { capitalize } from '../utils/string.js';\nimport { renderTablist, tablistStyles } from '../utils/tablist.js';\n\ntype PlanetEntry = NatalChartResponse['planets'][number];\ntype AspectEntry = NatalChartResponse['aspects'][number];\n\nconst SIZE = 420;\nconst CENTER = SIZE / 2;\nconst OUTER_R = 164;\nconst SIGN_R = 146;\nconst HOUSE_R = 120;\nconst PLANET_R = 96;\nconst ANGLE_TICK_R = 178;\nconst ANGLE_LABEL_R = 196;\n\n/**\n * Western natal chart wheel. Renders the 12 zodiac signs, 12 houses, planet\n * markers, and aspect lines from a /astrology/natal-chart response.\n */\n@customElement('roxy-natal-chart')\nexport class RoxyNatalChart extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\ttablistStyles,\n\t\tdisclosureStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);width:100%;display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-primary,#0f172a);margin:0}.meta{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem)}svg{aspect-ratio:1;width:100%;max-width:560px;height:auto;margin:0 auto;display:block}.wheel-line{fill:none;stroke:var(--roxy-border,#e4e4e7)}.sign-glyph{fill:var(--roxy-secondary,#475569);font-size:14px;font-family:var(--roxy-font-sans)}.planet-glyph{fill:var(--roxy-accent,#f59e0b);font-size:14px;font-weight:600;font-family:var(--roxy-font-sans)}.planet-deg{fill:var(--roxy-fg,#0a0a0a);font-size:7px;font-family:var(--roxy-font-sans)}@container (width<=480px){.sign-glyph,.planet-glyph{font-size:18px}.planet-deg{font-size:10px}.house-num{font-size:12px}}.planet-deg .retro{fill:var(--roxy-danger,#dc2626)}.planet-leader{stroke:var(--roxy-accent,#f59e0b);stroke-width:.5px;opacity:.55}.house-num{fill:var(--roxy-muted,#71717a);font-size:9px;font-family:var(--roxy-font-sans)}.cusp-deg{fill:var(--roxy-muted,#71717a);font-size:6px;font-family:var(--roxy-font-sans)}.tick{stroke:var(--roxy-border,#e4e4e7)}.tick-major{stroke:var(--roxy-secondary,#475569)}.aspect{stroke-width:.8px;fill:none;opacity:.55}.aspect-trine,.aspect-sextile{stroke:var(--roxy-success,#16a34a)}.aspect-square,.aspect-opposition{stroke:var(--roxy-danger,#dc2626)}.aspect-conjunction{stroke:var(--roxy-accent-fg,#b45309)}.aspect-other{stroke:var(--roxy-muted,#71717a);opacity:.4}.angle-marker{fill:var(--roxy-accent-fg,#b45309);font-size:10px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.04em}.angle-tick{stroke:var(--roxy-accent-fg,#b45309);stroke-width:1.5px}.legend{font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.legend-swatch{vertical-align:middle;border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}.grid-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table.aspect-grid{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem);margin:0 auto}table.aspect-grid th,table.aspect-grid td{text-align:center;border:1px solid var(--roxy-border,#e4e4e7);width:1.6rem;height:1.6rem;padding:0}table.aspect-grid th{color:var(--roxy-secondary,#475569);font-weight:var(--roxy-weight-bold,600)}table.aspect-grid td.cell{cursor:default}table.aspect-grid td.empty{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 18%, transparent)}table.aspect-grid td .asp{font-size:.95em;line-height:1}table.aspect-grid td.aspect-trine .asp,table.aspect-grid td.aspect-sextile .asp{color:var(--roxy-success,#16a34a)}table.aspect-grid td.aspect-square .asp,table.aspect-grid td.aspect-opposition .asp{color:var(--roxy-danger,#dc2626)}table.aspect-grid td.aspect-conjunction .asp{color:var(--roxy-accent-fg,#b45309)}table.aspect-grid td.aspect-other .asp{color:var(--roxy-muted,#71717a)}.details{margin-top:var(--roxy-space-md,1rem)}.pill-row{gap:var(--roxy-space-xs,.25rem);margin-bottom:var(--roxy-space-xs,.25rem);flex-wrap:wrap;display:flex}.pill{border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);background:color-mix(in srgb, var(--roxy-fg,#0f172a) 8%, transparent);color:var(--roxy-fg,#0f172a);padding:2px 8px}.pill--success{background:color-mix(in srgb, var(--roxy-success,#16a34a) 15%, transparent);color:var(--roxy-success,#16a34a)}.pill--danger{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 15%, transparent);color:var(--roxy-danger,#dc2626)}.pill--muted{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent);color:var(--roxy-fg,#0a0a0a)}.summary{color:var(--roxy-fg,#0f172a);font-size:var(--roxy-text-sm,.875rem);margin:var(--roxy-space-md,1rem) 0}.em-grid{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem);width:100%}.em-grid th,.em-grid td{border:1px solid var(--roxy-border,#e4e4e7);text-align:center;vertical-align:middle;padding:3px 5px}.em-grid th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;letter-spacing:.04em}.em-grid th[scope=row]{text-align:left}.em-grid td{color:var(--roxy-accent,#f59e0b);min-width:1.4rem;font-size:.95em;line-height:1.4}.em-grid .em-total{color:var(--roxy-fg,#0a0a0a);font-weight:var(--roxy-weight-bold,600);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 25%, transparent)}.interpretations{margin-top:var(--roxy-space-md,1rem)}.interpretations h3{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em;margin:0 0 var(--roxy-space-sm,.5rem);font-weight:600}.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,#0f172a);justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);font-weight:500;display:flex}.interp-aside{align-items:center;gap:.6em;display:inline-flex}.interp-aside small{color:var(--roxy-muted,#71717a);font-weight:400}.interp-body{margin-top:var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0f172a);font-size:var(--roxy-text-sm,.875rem)}.interp-keywords{flex-wrap:wrap;gap:.25rem;margin-top:.5rem;display:flex}.interp-keywords .kw{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-accent-fg,#b45309);font-size:var(--roxy-text-xs,.75rem);border-radius:9999px;padding:1px 8px}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: NatalChartResponse | null = null;\n\n\t@property({ type: String, attribute: 'house-system', reflect: true })\n\thouseSystem: 'placidus' | 'whole-sign' | 'equal' | 'koch' = 'placidus';\n\n\t/** Which view is showing: the wheel or the planet-by-planet aspect grid. */\n\t@state()\n\tprivate view: 'wheel' | 'grid' = 'wheel';\n\n\tprivate getPlanets(): PlanetEntry[] {\n\t\treturn this.data?.planets ?? [];\n\t}\n\n\tprivate getAscendant(): number {\n\t\treturn this.data?.ascendant?.longitude ?? 0;\n\t}\n\n\tprivate getMidheaven(): number | null {\n\t\tconst m = this.data?.midheaven?.longitude;\n\t\treturn typeof m === 'number' ? m : null;\n\t}\n\n\tprivate toAngle(lon: number): number {\n\t\treturn 180 + this.getAscendant() - lon;\n\t}\n\n\trender() {\n\t\tif (!this.data)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No chart data</div>`;\n\t\tconst planets = this.getPlanets();\n\t\tconst aspects = this.data.aspects ?? [];\n\t\tconst view = this.view;\n\n\t\treturn html`<div class=\"wrap\"><header><h2 class=\"title\">Natal chart</h2>${\n\t\t\t\t\tthis.data.birthDetails\n\t\t\t\t\t\t? html`<div class=\"meta\">${[this.data.birthDetails.date, this.data.birthDetails.time]\n\t\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t\t.join(' \u00B7 ')}</div>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</header>${renderTablist({\n\t\t\t\titems: [\n\t\t\t\t\t{ id: 'wheel', label: 'Wheel' },\n\t\t\t\t\t{ id: 'grid', label: 'Aspect grid' },\n\t\t\t\t],\n\t\t\t\tactive: view,\n\t\t\t\tonSelect: (v) => {\n\t\t\t\t\tthis.view = v;\n\t\t\t\t},\n\t\t\t\tlabel: 'Natal chart views',\n\t\t\t\tidPrefix: 'natal',\n\t\t\t\tcontrols: true,\n\t\t\t})}<div id=\"natal-panel-${view}\" role=\"tabpanel\" aria-labelledby=\"natal-tab-${view}\">${view === 'wheel' ? this.renderWheel(planets, aspects) : this.renderAspectGrid(planets, aspects)}</div><div class=\"legend\"><span>${planets.length} planets</span> <span>${aspects.length} aspects</span> ${\n\t\t\t\t\tthis.data.houseSystem\n\t\t\t\t\t\t? html`<span>${this.data.houseSystem} houses</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t} <span><span class=\"legend-swatch\" style=\"background:var(--roxy-success)\"></span>harmonious</span> <span><span class=\"legend-swatch\" style=\"background:var(--roxy-danger)\"></span>challenging</span></div>${this.renderDetails()} ${this.renderInterpretations()}</div>`;\n\t}\n\n\tprivate renderWheel(planets: PlanetEntry[], aspects: AspectEntry[]) {\n\t\treturn html`<svg viewBox=\"0 0 ${SIZE} ${SIZE}\" role=\"img\" aria-label=\"Natal chart wheel with twelve houses, planets, and aspects\"><title>Natal chart wheel</title><desc>Twelve zodiac sign segments around a circular wheel. Planet glyphs are placed at their ecliptic longitudes. Aspect lines connect related planets.</desc><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${OUTER_R}\" stroke-width=\"1.5\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${SIGN_R - 14}\" stroke-width=\"0.8\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${HOUSE_R}\" stroke-width=\"1\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${PLANET_R - 16}\" stroke-width=\"0.5\"/>${this.renderTicks()} ${this.renderSpokes()} ${this.renderSigns()} ${this.renderHouseNumbers()} ${this.renderCuspDegrees()} ${this.renderAspects(planets, aspects)} ${this.renderPlanets(planets)} ${this.renderAngles()}</svg>`;\n\t}\n\n\t/**\n\t * Planet-by-planet aspect grid: the lower-triangular matrix astrologers read\n\t * alongside the wheel. Each filled cell shows the aspect glyph colored by\n\t * nature, with the exact orb in the SVG-free `<title>` tooltip.\n\t */\n\tprivate renderAspectGrid(planets: PlanetEntry[], aspects: AspectEntry[]) {\n\t\tconst names = planets.map((p) => capitalize(p.name));\n\t\t// Lookup aspects by unordered planet pair.\n\t\tconst byPair = new Map<string, AspectEntry>();\n\t\tfor (const a of aspects) {\n\t\t\tconst k = [capitalize(a.planet1), capitalize(a.planet2)].sort().join('|');\n\t\t\tbyPair.set(k, a);\n\t\t}\n\t\tif (names.length === 0)\n\t\t\treturn html`<p class=\"roxy-empty\" role=\"status\">No planets to grid</p>`;\n\n\t\treturn html`<div class=\"grid-scroll\"><table class=\"aspect-grid\" aria-label=\"Planet by planet aspect grid\"><thead><tr><th></th>${names.slice(0, -1).map((n) => {\n\t\t\t\t\t\t\tconst g = PLANET_GLYPH[n] ?? n.slice(0, 2);\n\t\t\t\t\t\t\treturn html`<th scope=\"col\" title=\"${n}\">${g}</th>`;\n\t\t\t\t\t\t})}</tr></thead><tbody>${names.slice(1).map((rowName, ri) => {\n\t\t\t\t\t\tconst rowGlyph = PLANET_GLYPH[rowName] ?? rowName.slice(0, 2);\n\t\t\t\t\t\t// Row i (1-based) pairs with columns 0..i-1.\n\t\t\t\t\t\treturn html`<tr><th scope=\"row\" title=\"${rowName}\">${rowGlyph}</th>${names.slice(0, ri + 1).map((colName) => {\n\t\t\t\t\t\t\t\tconst a = byPair.get([rowName, colName].sort().join('|'));\n\t\t\t\t\t\t\t\tif (!a) return html`<td class=\"empty\"></td>`;\n\t\t\t\t\t\t\t\tconst name = normalizeAspect(a);\n\t\t\t\t\t\t\t\tconst sym =\n\t\t\t\t\t\t\t\t\tASPECT_SYMBOL[name] ??\n\t\t\t\t\t\t\t\t\tASPECT_SYMBOL[name.replace(/-/g, '')] ??\n\t\t\t\t\t\t\t\t\tname.slice(0, 3);\n\t\t\t\t\t\t\t\tconst cls = ASPECT_CLASS[name] ?? 'aspect-other';\n\t\t\t\t\t\t\t\tconst orb = formatNumber(a.orb, 1);\n\t\t\t\t\t\t\t\treturn html`<td class=\"${`cell ${cls}`}\" title=\"${`${rowName} ${name} ${colName}${orb ? ` (orb ${orb}\u00B0)` : ''}`}\"><span class=\"asp\">${sym}</span></td>`;\n\t\t\t\t\t\t\t})} ${names.slice(ri + 1, -1).map(() => html`<td class=\"empty\"></td>`)}</tr>`;\n\t\t\t\t\t})}</tbody></table></div>`;\n\t}\n\n\tprivate renderAngles() {\n\t\tconst asc = this.getAscendant();\n\t\tconst mc = this.getMidheaven();\n\t\t// ASC/DESC and MC/IC are exact axes; DESC and IC are the opposite points.\n\t\tconst items = [\n\t\t\tthis.renderAngleMark(asc, 'ASC'),\n\t\t\tthis.renderAngleMark(oppositePoint(asc), 'DSC'),\n\t\t];\n\t\tif (mc !== null) {\n\t\t\titems.push(this.renderAngleMark(mc, 'MC'));\n\t\t\titems.push(this.renderAngleMark(oppositePoint(mc), 'IC'));\n\t\t}\n\t\tconst pof = this.data?.partOfFortune?.longitude;\n\t\tif (typeof pof === 'number') {\n\t\t\titems.push(this.renderAngleMark(normalizeLongitude(pof), 'PoF'));\n\t\t}\n\t\tconst vertex = this.data?.vertex?.longitude;\n\t\tif (typeof vertex === 'number') {\n\t\t\titems.push(this.renderAngleMark(normalizeLongitude(vertex), 'Vtx'));\n\t\t}\n\t\treturn items;\n\t}\n\n\tprivate renderAngleMark(longitude: number, label: string) {\n\t\t// Tick AND label share the same angle so the label sits right at the\n\t\t// tip of the arrow, where a practitioner expects to find it. The label\n\t\t// halo at radius ANGLE_LABEL_R is clear of the wheel rim, so there is\n\t\t// no overlap with house dividers despite the shared angle.\n\t\tconst angle = this.toAngle(longitude);\n\t\tconst tickInner = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\tconst tickOuter = polarToCartesian(CENTER, CENTER, ANGLE_TICK_R, angle);\n\t\tconst labelPos = polarToCartesian(CENTER, CENTER, ANGLE_LABEL_R, angle);\n\t\treturn svg`<g><line class=\"angle-tick\" x1=\"${tickInner.x}\" y1=\"${tickInner.y}\" x2=\"${tickOuter.x}\" y2=\"${tickOuter.y}\"><text class=\"angle-marker\" x=\"${labelPos.x}\" y=\"${labelPos.y}\" text-anchor=\"middle\" dominant-baseline=\"central\">${label}</text></g>`;\n\t}\n\n\tprivate renderSpokes() {\n\t\t// Draw a spoke at each real house cusp longitude so Placidus / Koch\n\t\t// unequal houses render correctly. Fall back to 12 equal spokes from the\n\t\t// Ascendant only when the response carries no houses array.\n\t\tconst houses = this.data?.houses ?? [];\n\t\tconst cuspLongitudes =\n\t\t\thouses.length === 12\n\t\t\t\t? houses.map((h) => h.longitude)\n\t\t\t\t: Array.from({ length: 12 }, (_, i) => this.getAscendant() + i * 30);\n\t\treturn cuspLongitudes.map((lon) => {\n\t\t\tconst angle = this.toAngle(lon);\n\t\t\tconst start = polarToCartesian(CENTER, CENTER, HOUSE_R, 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.8\">`;\n\t\t});\n\t}\n\n\tprivate renderSigns() {\n\t\treturn SIGNS_ORDER.map((sign, 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-glyph\" x=\"${pos.x}\" y=\"${pos.y}\" text-anchor=\"middle\" dominant-baseline=\"central\">${SIGN_GLYPH[sign]}</text>`;\n\t\t});\n\t}\n\n\tprivate renderHouseNumbers() {\n\t\tconst houses = this.data?.houses ?? [];\n\t\t// Place each house number at the angular midpoint between its cusp and\n\t\t// the next, so the label sits inside the house even when houses are\n\t\t// unequal. Fall back to equal 30-degree sectors when houses are absent.\n\t\tif (houses.length === 12) {\n\t\t\treturn houses.map((house, i) => {\n\t\t\t\tconst next = houses[(i + 1) % 12];\n\t\t\t\tconst mid = arcMidpoint(\n\t\t\t\t\thouse.longitude,\n\t\t\t\t\tnext ? next.longitude : house.longitude + 30,\n\t\t\t\t);\n\t\t\t\tconst pos = polarToCartesian(\n\t\t\t\t\tCENTER,\n\t\t\t\t\tCENTER,\n\t\t\t\t\tHOUSE_R - 12,\n\t\t\t\t\tthis.toAngle(mid),\n\t\t\t\t);\n\t\t\t\treturn svg`<text class=\"house-num\" x=\"${pos.x}\" y=\"${pos.y}\" text-anchor=\"middle\" dominant-baseline=\"central\">${house.number}</text>`;\n\t\t\t});\n\t\t}\n\t\tconst ascSignIndex = Math.floor(this.getAscendant() / 30);\n\t\treturn Array.from({ length: 12 }, (_, i) => {\n\t\t\tconst angle = this.toAngle(i * 30 + 15);\n\t\t\tconst pos = polarToCartesian(CENTER, CENTER, HOUSE_R - 12, angle);\n\t\t\tconst houseNum = ((i - ascSignIndex + 12) % 12) + 1;\n\t\t\treturn svg`<text class=\"house-num\" x=\"${pos.x}\" y=\"${pos.y}\" text-anchor=\"middle\" dominant-baseline=\"central\">${houseNum}</text>`;\n\t\t});\n\t}\n\n\t/**\n\t * Degree ticks on the outer zodiac band: a short mark every 5 degrees and a\n\t * longer one on each 30-degree sign cusp, so the wheel reads like a\n\t * reference-grade chart rather than a bare ring of glyphs.\n\t */\n\tprivate renderTicks() {\n\t\tconst ticks = [];\n\t\tfor (let deg = 0; deg < 360; deg += 5) {\n\t\t\tconst angle = this.toAngle(deg);\n\t\t\tconst isMajor = deg % 30 === 0;\n\t\t\tconst inner = isMajor ? SIGN_R - 14 : OUTER_R - 5;\n\t\t\tconst a = polarToCartesian(CENTER, CENTER, inner, angle);\n\t\t\tconst b = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\tticks.push(\n\t\t\t\tsvg`<line class=\"${isMajor ? 'tick tick-major' : 'tick'}\" x1=\"${a.x}\" y1=\"${a.y}\" x2=\"${b.x}\" y2=\"${b.y}\" stroke-width=\"${isMajor ? 1 : 0.5}\">`,\n\t\t\t);\n\t\t}\n\t\treturn ticks;\n\t}\n\n\t/**\n\t * Degree-and-minute label printed next to each house cusp on the wheel, so\n\t * the exact cusp position is readable without leaving the chart.\n\t */\n\tprivate renderCuspDegrees() {\n\t\tconst houses = this.data?.houses ?? [];\n\t\tif (houses.length !== 12) return nothing;\n\t\treturn houses.map((house) => {\n\t\t\tconst angle = this.toAngle(house.longitude);\n\t\t\tconst pos = polarToCartesian(CENTER, CENTER, HOUSE_R + 9, angle);\n\t\t\tconst sp = longitudeToSignPosition(house.longitude);\n\t\t\treturn svg`<text class=\"cusp-deg\" x=\"${pos.x}\" y=\"${pos.y}\" text-anchor=\"middle\" dominant-baseline=\"central\">${sp.degree}\u00B0${String(sp.minute).padStart(2, '0')}'</text>`;\n\t\t});\n\t}\n\n\tprivate renderPlanets(planets: PlanetEntry[]) {\n\t\t// Stellium-aware angular fan-out. Conjunctions within 8\u00B0 are the norm\n\t\t// in professional natal charts (Sun-Mercury-Venus cluster, outer-planet\n\t\t// stacks). To keep every glyph legible without losing precision, sort\n\t\t// by longitude and push later members forward in angle until they\n\t\t// clear a minimum separation, then draw a thin leader line from each\n\t\t// displaced glyph back to the planet's true position on the outer\n\t\t// rim. Conventional approach used by professional Western natal\n\t\t// software; preserves both readability and astronomical accuracy.\n\t\tconst MIN_SEPARATION = 7;\n\t\ttype Placed = {\n\t\t\tp: PlanetEntry;\n\t\t\ttrueLon: number;\n\t\t\tdisplayLon: number;\n\t\t};\n\t\tconst sorted: Placed[] = planets\n\t\t\t.filter((p) => Number.isFinite(p.longitude))\n\t\t\t.map((p) => ({\n\t\t\t\tp,\n\t\t\t\ttrueLon: normalizeLongitude(p.longitude),\n\t\t\t\tdisplayLon: normalizeLongitude(p.longitude),\n\t\t\t}))\n\t\t\t.sort((a, b) => a.trueLon - b.trueLon);\n\t\t// Forward sweep: clamp each to at least prev + MIN_SEPARATION.\n\t\tfor (let i = 1; i < sorted.length; i++) {\n\t\t\tconst prev = sorted[i - 1];\n\t\t\tconst cur = sorted[i];\n\t\t\tif (!prev || !cur) continue;\n\t\t\tconst wanted = prev.displayLon + MIN_SEPARATION;\n\t\t\tif (cur.displayLon < wanted) cur.displayLon = wanted;\n\t\t}\n\t\t// If the cluster overshot 360\u00B0, slide everything back equally so the\n\t\t// stack stays anchored near the original longitudes.\n\t\tconst last = sorted[sorted.length - 1];\n\t\tif (last && last.displayLon > 360) {\n\t\t\tconst shift = last.displayLon - 360;\n\t\t\tfor (const s of sorted) s.displayLon -= shift;\n\t\t}\n\t\treturn sorted.map(({ p, trueLon, displayLon }) => {\n\t\t\tconst trueAngle = this.toAngle(trueLon);\n\t\t\tconst displayAngle = this.toAngle(displayLon);\n\t\t\tconst glyphPos = polarToCartesian(CENTER, CENTER, PLANET_R, displayAngle);\n\t\t\tconst degPos = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tPLANET_R - 13,\n\t\t\t\tdisplayAngle,\n\t\t\t);\n\t\t\tconst rimPos = polarToCartesian(CENTER, CENTER, OUTER_R - 4, trueAngle);\n\t\t\tconst leaderInner = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tPLANET_R + 8,\n\t\t\t\tdisplayAngle,\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 offset = Math.abs(displayLon - trueLon) > 0.5;\n\t\t\treturn svg`<g>${\n\t\t\t\t\toffset\n\t\t\t\t\t\t? svg`<line class=\"planet-leader\" x1=\"${rimPos.x}\" y1=\"${rimPos.y}\" x2=\"${leaderInner.x}\" y2=\"${leaderInner.y}\">`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}<text class=\"planet-glyph\" x=\"${glyphPos.x}\" y=\"${glyphPos.y}\" text-anchor=\"middle\" dominant-baseline=\"central\"><title>${p.name}${retro ? ' retrograde' : ''} - ${degLabel} ${p.sign ?? ''}</title>${glyph}</text><text class=\"planet-deg\" x=\"${degPos.x}\" y=\"${degPos.y}\" text-anchor=\"middle\" dominant-baseline=\"central\">${degLabel}${retro ? svg`<tspan class=\"retro\">\u211E</tspan>` : nothing}</text></g>`;\n\t\t});\n\t}\n\n\tprivate renderDetails() {\n\t\tconst summary = this.data?.summary;\n\t\tconst ai = this.data?.aspectsInterpretation;\n\t\tif (!summary && !ai) return nothing;\n\n\t\tconst retrogrades = summary?.retrogradePlanets ?? [];\n\n\t\treturn html`<div class=\"details\">${\n\t\t\t\tsummary?.dominantElement || summary?.dominantModality\n\t\t\t\t\t? html`<div class=\"pill-row\">${summary.dominantElement ? html`<span class=\"pill\">Dominant element: ${summary.dominantElement}</span>` : nothing} ${summary.dominantModality ? html`<span class=\"pill\">Dominant modality: ${summary.dominantModality}</span>` : nothing}</div>`\n\t\t\t\t\t: nothing\n\t\t\t} ${\n\t\t\t\tai\n\t\t\t\t\t? html`<div class=\"pill-row\"><span class=\"pill pill--success\">Harmonious ${ai.harmonious}</span> <span class=\"pill pill--danger\">Challenging ${ai.challenging}</span> <span class=\"pill pill--muted\">Neutral ${ai.neutral}</span></div>`\n\t\t\t\t\t: nothing\n\t\t\t} ${\n\t\t\t\tretrogrades.length > 0\n\t\t\t\t\t? html`<div class=\"pill-row\">${retrogrades.map((p) => {\n\t\t\t\t\t\t\tconst glyph = PLANET_GLYPH[p] ?? p.slice(0, 2);\n\t\t\t\t\t\t\treturn html`<span class=\"pill pill--muted\">${glyph} ${p} R</span>`;\n\t\t\t\t\t\t})}</div>`\n\t\t\t\t\t: nothing\n\t\t\t} ${ai?.summary ? html`<p class=\"summary\">${ai.summary}</p>` : nothing} ${this.renderElementModalityGrid()}</div>`;\n\t}\n\n\t/**\n\t * Element by modality grid: the 4x3 cross-tab astrologers read for chart\n\t * balance. Each planet is placed by its sign into one cell (Fire/Earth/Air/\n\t * Water row, Cardinal/Fixed/Mutable column). Derived purely from the planet\n\t * signs, with row, column, and grand totals.\n\t */\n\tprivate renderElementModalityGrid() {\n\t\tconst planets = this.getPlanets();\n\t\tif (planets.length === 0) return nothing;\n\t\tconst ELEMENTS = ['Fire', 'Earth', 'Air', 'Water'] as const;\n\t\tconst MODALITIES = ['Cardinal', 'Fixed', 'Mutable'] as const;\n\t\tconst order = SIGNS_ORDER as readonly string[];\n\n\t\tconst cells: Record<string, Record<string, string[]>> = {};\n\t\tfor (const el of ELEMENTS)\n\t\t\tcells[el] = { Cardinal: [], Fixed: [], Mutable: [] };\n\t\tfor (const p of planets) {\n\t\t\tconst idx = order.indexOf(capitalize(p.sign ?? ''));\n\t\t\tif (idx < 0) continue;\n\t\t\tconst el = ELEMENTS[idx % 4];\n\t\t\tconst mod = MODALITIES[idx % 3];\n\t\t\tconst glyph =\n\t\t\t\tPLANET_GLYPH[capitalize(p.name)] ?? capitalize(p.name).slice(0, 2);\n\t\t\tcells[el]?.[mod]?.push(glyph);\n\t\t}\n\n\t\treturn html`<table class=\"em-grid\" aria-label=\"Element and modality distribution\"><thead><tr><th></th>${MODALITIES.map((m) => html`<th scope=\"col\">${m.slice(0, 3)}</th>`)}<th scope=\"col\">Total</th></tr></thead><tbody>${ELEMENTS.map((el) => {\n\t\t\t\t\tconst rowTotal = MODALITIES.reduce(\n\t\t\t\t\t\t(s, m) => s + (cells[el]?.[m]?.length ?? 0),\n\t\t\t\t\t\t0,\n\t\t\t\t\t);\n\t\t\t\t\treturn html`<tr><th scope=\"row\">${el}</th>${MODALITIES.map(\n\t\t\t\t\t\t\t(m) => html`<td>${(cells[el]?.[m] ?? []).join(' ')}</td>`,\n\t\t\t\t\t\t)}<td class=\"em-total\">${rowTotal}</td></tr>`;\n\t\t\t\t})}<tr><th scope=\"row\">Total</th>${MODALITIES.map(\n\t\t\t\t\t\t(m) =>\n\t\t\t\t\t\t\thtml`<td class=\"em-total\">${ELEMENTS.reduce((s, el) => s + (cells[el]?.[m]?.length ?? 0), 0)}</td>`,\n\t\t\t\t\t)}<td class=\"em-total\">${planets.length}</td></tr></tbody></table>`;\n\t}\n\n\tprivate renderInterpretations() {\n\t\tconst planets = this.getPlanets().filter((p) => p.interpretation);\n\t\tif (planets.length === 0) return nothing;\n\t\treturn html`<section class=\"interpretations\"><h3>Planet readings</h3>${planets.map((p, idx) => {\n\t\t\t\tconst interp = p.interpretation!;\n\t\t\t\tconst glyph = PLANET_GLYPH[capitalize(p.name)] ?? '';\n\t\t\t\tconst deg = formatNumber(p.degree ?? 0, 1);\n\t\t\t\treturn html`<details class=\"interp-card\" name=\"natal-planet-readings\" ?open=\"${idx === 0}\"><summary><span>${glyph} ${p.name}</span> <span class=\"interp-aside\"><small>${p.sign ?? ''} ${deg}</small> ${chevron()}</span></summary><div class=\"interp-body\">${interp.summary ? html`<p class=\"interp-summary\">${interp.summary}</p>` : nothing} ${interp.detailed ? html`<p class=\"interp-detail\">${interp.detailed}</p>` : nothing} ${\n\t\t\t\t\t\t\tinterp.keywords?.length\n\t\t\t\t\t\t\t\t? html`<div class=\"interp-keywords\">${interp.keywords.map((k) => html`<span class=\"kw\">${k}</span>`)}</div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}</div></details>`;\n\t\t\t})}</section>`;\n\t}\n\n\tprivate renderAspects(planets: PlanetEntry[], aspects: AspectEntry[]) {\n\t\tconst planetMap = new Map<string, number>();\n\t\tfor (const p of planets) {\n\t\t\tif (typeof p.longitude !== 'number') continue;\n\t\t\tconst name = capitalize(p.name);\n\t\t\tif (name) planetMap.set(name, p.longitude);\n\t\t}\n\t\treturn aspects.map((a) => {\n\t\t\tconst l1 = planetMap.get(capitalize(a.planet1));\n\t\t\tconst l2 = planetMap.get(capitalize(a.planet2));\n\t\t\tif (l1 === undefined || l2 === undefined) return nothing;\n\t\t\tconst p1 = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tPLANET_R - 18,\n\t\t\t\tthis.toAngle(l1),\n\t\t\t);\n\t\t\tconst p2 = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tPLANET_R - 18,\n\t\t\t\tthis.toAngle(l2),\n\t\t\t);\n\t\t\tconst aspectName = normalizeAspect(a);\n\t\t\tconst aspectClass = ASPECT_CLASS[aspectName] ?? 'aspect-other';\n\t\t\tconst orbLabel = formatNumber(a.orb, 1);\n\t\t\treturn svg`<line class=\"${`aspect ${aspectClass}`}\" x1=\"${p1.x}\" y1=\"${p1.y}\" x2=\"${p2.x}\" y2=\"${p2.y}\"><title>${a.planet1} ${aspectName || ''} ${a.planet2}${orbLabel ? ` (orb ${orbLabel}\u00B0)` : ''}</title></line>`;\n\t\t});\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-natal-chart': RoxyNatalChart;\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/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\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 { 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}*,:before,:after{box-sizing:border-box}@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-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\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/**\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 * 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\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (/^\\d{4}-\\d{2}-\\d{2}$/.test(input)) return '';\n\tconst bareTime = /^\\d{2}:\\d{2}(:\\d{2})?$/.test(input);\n\tconst iso = bareTime ? `1970-01-01T${input}` : input;\n\tconst d = new Date(iso);\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});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst d = new Date(\n\t\t/^\\d{4}-\\d{2}-\\d{2}$/.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});\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\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toFixed(dp).replace(/\\.?0+$/, '');\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\n * canonical name (`SEMI_SEXTILE` \u2192 `semi-sextile`). Accepts any aspect-shaped\n * object so both natal and synastry inter-aspect entries can share this.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '').toLowerCase().replace(/_/g, '-');\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 * 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 * 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 s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n", "import type { TemplateResult } from 'lit';\nimport { css, html, nothing } from 'lit';\n\n/** A single tab in a {@link renderTablist} strip. */\nexport interface TablistItem<T extends string = string> {\n\tid: T;\n\tlabel: string;\n}\n\n/**\n * Shared styling for every horizontal tab strip in the library (natal chart\n * views, transits, kundli styles). Keeping one rule set means the tabs look\n * identical everywhere and theme through the same --roxy-* tokens.\n */\nexport const tablistStyles = css`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-fg,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:4px}`;\n\n/**\n * Render a WAI-ARIA tablist. The host component owns the active-tab state; this\n * helper draws the buttons, wires click plus Left/Right arrow navigation with a\n * roving tabindex, and moves focus to the newly selected tab. Pair with\n * {@link tablistStyles}.\n *\n * Pass `controls: true` when each tab governs a sibling\n * `<div role=\"tabpanel\" id=\"${idPrefix}-panel-${id}\">` so the buttons advertise\n * `aria-controls`. Omit it for tablists that swap a single rendered view in\n * place with no separate panel element (the kundli style switch).\n *\n * @example\n * ```ts\n * renderTablist({\n * items: [{ id: 'wheel', label: 'Wheel' }, { id: 'grid', label: 'Aspect grid' }],\n * active: this.view,\n * onSelect: (v) => { this.view = v; },\n * label: 'Natal chart views',\n * idPrefix: 'natal',\n * controls: true,\n * })\n * ```\n */\nexport function renderTablist<T extends string>(opts: {\n\titems: ReadonlyArray<TablistItem<T>>;\n\tactive: T;\n\tonSelect: (id: T) => void;\n\tlabel: string;\n\tidPrefix: string;\n\tcontrols?: boolean;\n}): TemplateResult {\n\tconst { items, active, onSelect, label, idPrefix, controls = false } = opts;\n\tconst onKeyDown = (e: KeyboardEvent) => {\n\t\tif (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft') return;\n\t\te.preventDefault();\n\t\tconst idx = items.findIndex((it) => it.id === active);\n\t\tif (idx === -1) return;\n\t\tconst delta = e.key === 'ArrowRight' ? 1 : -1;\n\t\tconst next = items[(idx + delta + items.length) % items.length];\n\t\tif (!next) return;\n\t\tonSelect(next.id);\n\t\tconst root = (e.currentTarget as HTMLElement).getRootNode() as\n\t\t\t| ShadowRoot\n\t\t\t| Document;\n\t\trequestAnimationFrame(() => {\n\t\t\troot\n\t\t\t\t.querySelector<HTMLButtonElement>(`#${idPrefix}-tab-${next.id}`)\n\t\t\t\t?.focus();\n\t\t});\n\t};\n\treturn html`<div class=\"roxy-tablist\" role=\"tablist\" aria-label=\"${label}\" @keydown=\"${onKeyDown}\">${items.map(\n\t\t\t(it) => html`<button type=\"button\" class=\"roxy-tab\" role=\"tab\" id=\"${idPrefix}-tab-${it.id}\" aria-selected=\"${active === it.id ? 'true' : 'false'}\" aria-controls=\"${\n\t\t\t\t\t// Only the active panel is rendered, so only the active tab points\n\t\t\t\t\t// at a live element; otherwise aria-controls would dangle.\n\t\t\t\t\tcontrols && active === it.id ? `${idPrefix}-panel-${it.id}` : nothing\n\t\t\t\t}\" tabindex=\"${active === it.id ? '0' : '-1'}\" @click=\"${() => onSelect(it.id)}\">${it.label}</button>`,\n\t\t)}</div>`;\n}\n"],
|
|
5
|
-
"mappings": "wMAAA,OAAS,OAAAA,GAAK,QAAAC,EAAM,cAAAC,GAAY,WAAAC,EAAS,OAAAC,MAAW,MACpD,OAAS,iBAAAC,GAAe,YAAAC,EAAU,SAAAC,OAAa,oBCKxC,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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,GAAM,CACzB,IAAMwF,EAAKD,EAAU,IAAIzF,EAAWE,EAAE,OAAO,CAAC,EACxCyF,EAAKF,EAAU,IAAIzF,EAAWE,EAAE,OAAO,CAAC,EAC9C,GAAIwF,IAAO,QAAaC,IAAO,OAAW,OAAOhG,EACjD,IAAMiG,EAAK9D,EACVnD,EACAA,EACAI,EAAW,GACX,KAAK,QAAQ2G,CAAE,CAChB,EACMG,EAAK/D,EACVnD,EACAA,EACAI,EAAW,GACX,KAAK,QAAQ4G,CAAE,CAChB,EACMG,EAAalF,EAAgBV,CAAC,EAC9B6F,EAAc/E,EAAa8E,CAAU,GAAK,eAC1CE,EAAW9E,EAAahB,EAAE,IAAK,CAAC,EACtC,OAAO+B,iBAAmB,UAAU8D,CAAW,EAAE,SAASH,EAAG,CAAC,SAASA,EAAG,CAAC,SAASC,EAAG,CAAC,SAASA,EAAG,CAAC,YAAY3F,EAAE,OAAO,IAAI4F,GAAc,EAAE,IAAI5F,EAAE,OAAO,GAAG8F,EAAW,SAASA,CAAQ,QAAO,EAAE,iBACpM,CAAC,CACF,CACD,EAlaa9G,EACL,OAAS,CACf+G,EACAC,EACAC,EACAC,q7KACD,EAWAC,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GAhBlBpH,EAiBZ,oBAGAmH,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,QAAS,EAAK,CAAC,GAnBxDpH,EAoBZ,2BAIQmH,EAAA,CADPE,GAAM,GAvBKrH,EAwBJ,oBAxBIA,EAANmH,EAAA,CADNG,GAAc,kBAAkB,GACpBtH",
|
|
4
|
+
"sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport {\n\tASPECT_SYMBOL,\n\tPLANET_GLYPH,\n\tSIGN_GLYPH,\n\tSIGNS_ORDER,\n} from '../tokens/index.js';\nimport type { NatalChartResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport {\n\tarcMidpoint,\n\tlongitudeToSignPosition,\n\tnormalizeLongitude,\n\toppositePoint,\n\tpolarToCartesian,\n} from '../utils/degree.js';\nimport { chevron, disclosureStyles } from '../utils/disclosure.js';\nimport {\n\tASPECT_CLASS,\n\tformatNumber,\n\tnormalizeAspect,\n} from '../utils/format.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\nimport { capitalize } from '../utils/string.js';\nimport { renderTablist, tablistStyles } from '../utils/tablist.js';\n\ntype PlanetEntry = NatalChartResponse['planets'][number];\ntype AspectEntry = NatalChartResponse['aspects'][number];\n\nconst SIZE = 420;\nconst CENTER = SIZE / 2;\nconst OUTER_R = 164;\nconst SIGN_R = 146;\nconst HOUSE_R = 120;\nconst PLANET_R = 96;\nconst ANGLE_TICK_R = 178;\nconst ANGLE_LABEL_R = 196;\n\n/**\n * Western natal chart wheel. Renders the 12 zodiac signs, 12 houses, planet\n * markers, and aspect lines from a /astrology/natal-chart response.\n */\n@customElement('roxy-natal-chart')\nexport class RoxyNatalChart extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\ttablistStyles,\n\t\tdisclosureStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);width:100%;display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-primary,#0f172a);margin:0}.meta{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem)}svg{aspect-ratio:1;width:100%;max-width:560px;height:auto;margin:0 auto;display:block}.wheel-line{fill:none;stroke:var(--roxy-border,#e4e4e7)}.sign-glyph{fill:var(--roxy-secondary,#475569);font-size:14px;font-family:var(--roxy-font-sans)}.planet-glyph{fill:var(--roxy-accent,#f59e0b);font-size:14px;font-weight:600;font-family:var(--roxy-font-sans)}.planet-deg{fill:var(--roxy-fg,#0a0a0a);font-size:7px;font-family:var(--roxy-font-sans)}@container (width<=480px){.sign-glyph,.planet-glyph{font-size:18px}.planet-deg{font-size:10px}.house-num{font-size:12px}}.planet-deg .retro{fill:var(--roxy-danger,#dc2626)}.planet-leader{stroke:var(--roxy-accent,#f59e0b);stroke-width:.5px;opacity:.55}.house-num{fill:var(--roxy-muted,#71717a);font-size:9px;font-family:var(--roxy-font-sans)}.cusp-deg{fill:var(--roxy-muted,#71717a);font-size:6px;font-family:var(--roxy-font-sans)}.tick{stroke:var(--roxy-border,#e4e4e7)}.tick-major{stroke:var(--roxy-secondary,#475569)}.aspect{stroke-width:.8px;fill:none;opacity:.55}.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:.4}.angle-marker{fill:var(--roxy-accent-ink,#b45309);font-size:10px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.04em}.angle-tick{stroke:var(--roxy-accent-ink,#b45309);stroke-width:1.5px}.legend{font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.legend-swatch{vertical-align:middle;border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}.grid-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table.aspect-grid{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem);margin:0 auto}table.aspect-grid th,table.aspect-grid td{text-align:center;border:1px solid var(--roxy-border,#e4e4e7);width:1.6rem;height:1.6rem;padding:0}table.aspect-grid th{color:var(--roxy-secondary,#475569);font-weight:var(--roxy-weight-bold,600)}table.aspect-grid td.cell{cursor:default}table.aspect-grid td.empty{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 18%, transparent)}table.aspect-grid td .asp{font-size:.95em;line-height:1}table.aspect-grid td.aspect-trine .asp,table.aspect-grid td.aspect-sextile .asp{color:var(--roxy-success,#16a34a)}table.aspect-grid td.aspect-square .asp,table.aspect-grid td.aspect-opposition .asp{color:var(--roxy-danger,#dc2626)}table.aspect-grid td.aspect-conjunction .asp{color:var(--roxy-accent-ink,#b45309)}table.aspect-grid td.aspect-other .asp{color:var(--roxy-muted,#71717a)}.details{margin-top:var(--roxy-space-md,1rem)}.pill-row{gap:var(--roxy-space-xs,.25rem);margin-bottom:var(--roxy-space-xs,.25rem);flex-wrap:wrap;display:flex}.pill{border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);background:color-mix(in srgb, var(--roxy-fg,#0f172a) 8%, transparent);color:var(--roxy-fg,#0f172a);padding:2px 8px}.pill--success{background:color-mix(in srgb, var(--roxy-success,#16a34a) 15%, transparent);color:var(--roxy-success,#16a34a)}.pill--danger{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 15%, transparent);color:var(--roxy-danger,#dc2626)}.pill--muted{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent);color:var(--roxy-fg,#0a0a0a)}.summary{color:var(--roxy-fg,#0f172a);font-size:var(--roxy-text-sm,.875rem);margin:var(--roxy-space-md,1rem) 0}.em-grid{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem);width:100%}.em-grid th,.em-grid td{border:1px solid var(--roxy-border,#e4e4e7);text-align:center;vertical-align:middle;padding:3px 5px}.em-grid th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;letter-spacing:.04em}.em-grid th[scope=row]{text-align:left}.em-grid td{color:var(--roxy-accent,#f59e0b);min-width:1.4rem;font-size:.95em;line-height:1.4}.em-grid .em-total{color:var(--roxy-fg,#0a0a0a);font-weight:var(--roxy-weight-bold,600);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 25%, transparent)}.interpretations{margin-top:var(--roxy-space-md,1rem)}.interpretations h3{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em;margin:0 0 var(--roxy-space-sm,.5rem);font-weight:600}.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,#0f172a);justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);font-weight:500;display:flex}.interp-aside{align-items:center;gap:.6em;display:inline-flex}.interp-aside small{color:var(--roxy-muted,#71717a);font-weight:400}.interp-body{margin-top:var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0f172a);font-size:var(--roxy-text-sm,.875rem)}.interp-keywords{flex-wrap:wrap;gap:.25rem;margin-top:.5rem;display:flex}.interp-keywords .kw{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-accent-ink,#b45309);font-size:var(--roxy-text-xs,.75rem);border-radius:9999px;padding:1px 8px}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: NatalChartResponse | null = null;\n\n\t@property({ type: String, attribute: 'house-system', reflect: true })\n\thouseSystem: 'placidus' | 'whole-sign' | 'equal' | 'koch' = 'placidus';\n\n\t/** Which view is showing: the wheel or the planet-by-planet aspect grid. */\n\t@state()\n\tprivate view: 'wheel' | 'grid' = 'wheel';\n\n\tprivate getPlanets(): PlanetEntry[] {\n\t\treturn this.data?.planets ?? [];\n\t}\n\n\tprivate getAscendant(): number {\n\t\treturn this.data?.ascendant?.longitude ?? 0;\n\t}\n\n\tprivate getMidheaven(): number | null {\n\t\tconst m = this.data?.midheaven?.longitude;\n\t\treturn typeof m === 'number' ? m : null;\n\t}\n\n\tprivate toAngle(lon: number): number {\n\t\treturn 180 + this.getAscendant() - lon;\n\t}\n\n\trender() {\n\t\tif (!this.data)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No chart data</div>`;\n\t\tconst planets = this.getPlanets();\n\t\tconst aspects = this.data.aspects ?? [];\n\t\tconst view = this.view;\n\n\t\treturn html`<div class=\"wrap\"><header><h2 class=\"title\">Natal chart</h2>${\n\t\t\t\t\tthis.data.birthDetails\n\t\t\t\t\t\t? html`<div class=\"meta\">${[this.data.birthDetails.date, this.data.birthDetails.time]\n\t\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t\t.join(' \u00B7 ')}</div>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</header>${renderTablist({\n\t\t\t\titems: [\n\t\t\t\t\t{ id: 'wheel', label: 'Wheel' },\n\t\t\t\t\t{ id: 'grid', label: 'Aspect grid' },\n\t\t\t\t],\n\t\t\t\tactive: view,\n\t\t\t\tonSelect: (v) => {\n\t\t\t\t\tthis.view = v;\n\t\t\t\t},\n\t\t\t\tlabel: 'Natal chart views',\n\t\t\t\tidPrefix: 'natal',\n\t\t\t\tcontrols: true,\n\t\t\t})}<div id=\"natal-panel-${view}\" role=\"tabpanel\" aria-labelledby=\"natal-tab-${view}\">${view === 'wheel' ? this.renderWheel(planets, aspects) : this.renderAspectGrid(planets, aspects)}</div><div class=\"legend\"><span>${planets.length} planets</span> <span>${aspects.length} aspects</span> ${\n\t\t\t\t\tthis.data.houseSystem\n\t\t\t\t\t\t? html`<span>${this.data.houseSystem} houses</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t} <span><span class=\"legend-swatch\" style=\"background:var(--roxy-success)\"></span>harmonious</span> <span><span class=\"legend-swatch\" style=\"background:var(--roxy-danger)\"></span>challenging</span></div>${this.renderDetails()} ${this.renderInterpretations()}</div>`;\n\t}\n\n\tprivate renderWheel(planets: PlanetEntry[], aspects: AspectEntry[]) {\n\t\treturn html`<svg viewBox=\"0 0 ${SIZE} ${SIZE}\" role=\"img\" aria-label=\"Natal chart wheel with twelve houses, planets, and aspects\"><title>Natal chart wheel</title><desc>Twelve zodiac sign segments around a circular wheel. Planet glyphs are placed at their ecliptic longitudes. Aspect lines connect related planets.</desc><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${OUTER_R}\" stroke-width=\"1.5\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${SIGN_R - 14}\" stroke-width=\"0.8\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${HOUSE_R}\" stroke-width=\"1\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${PLANET_R - 16}\" stroke-width=\"0.5\"/>${this.renderTicks()} ${this.renderSpokes()} ${this.renderSigns()} ${this.renderHouseNumbers()} ${this.renderCuspDegrees()} ${this.renderAspects(planets, aspects)} ${this.renderPlanets(planets)} ${this.renderAngles()}</svg>`;\n\t}\n\n\t/**\n\t * Planet-by-planet aspect grid: the lower-triangular matrix astrologers read\n\t * alongside the wheel. Each filled cell shows the aspect glyph colored by\n\t * nature, with the exact orb in the SVG-free `<title>` tooltip.\n\t */\n\tprivate renderAspectGrid(planets: PlanetEntry[], aspects: AspectEntry[]) {\n\t\tconst names = planets.map((p) => capitalize(p.name));\n\t\t// Lookup aspects by unordered planet pair.\n\t\tconst byPair = new Map<string, AspectEntry>();\n\t\tfor (const a of aspects) {\n\t\t\tconst k = [capitalize(a.planet1), capitalize(a.planet2)].sort().join('|');\n\t\t\tbyPair.set(k, a);\n\t\t}\n\t\tif (names.length === 0)\n\t\t\treturn html`<p class=\"roxy-empty\" role=\"status\">No planets to grid</p>`;\n\n\t\treturn html`<div class=\"grid-scroll\"><table class=\"aspect-grid\" aria-label=\"Planet by planet aspect grid\"><thead><tr><th></th>${names.slice(0, -1).map((n) => {\n\t\t\t\t\t\t\tconst g = PLANET_GLYPH[n] ?? n.slice(0, 2);\n\t\t\t\t\t\t\treturn html`<th scope=\"col\" title=\"${n}\">${g}</th>`;\n\t\t\t\t\t\t})}</tr></thead><tbody>${names.slice(1).map((rowName, ri) => {\n\t\t\t\t\t\tconst rowGlyph = PLANET_GLYPH[rowName] ?? rowName.slice(0, 2);\n\t\t\t\t\t\t// Row i (1-based) pairs with columns 0..i-1.\n\t\t\t\t\t\treturn html`<tr><th scope=\"row\" title=\"${rowName}\">${rowGlyph}</th>${names.slice(0, ri + 1).map((colName) => {\n\t\t\t\t\t\t\t\tconst a = byPair.get([rowName, colName].sort().join('|'));\n\t\t\t\t\t\t\t\tif (!a) return html`<td class=\"empty\"></td>`;\n\t\t\t\t\t\t\t\tconst name = normalizeAspect(a);\n\t\t\t\t\t\t\t\tconst sym =\n\t\t\t\t\t\t\t\t\tASPECT_SYMBOL[name] ??\n\t\t\t\t\t\t\t\t\tASPECT_SYMBOL[name.replace(/-/g, '')] ??\n\t\t\t\t\t\t\t\t\tname.slice(0, 3);\n\t\t\t\t\t\t\t\tconst cls = ASPECT_CLASS[name] ?? 'aspect-other';\n\t\t\t\t\t\t\t\tconst orb = formatNumber(a.orb, 1);\n\t\t\t\t\t\t\t\treturn html`<td class=\"${`cell ${cls}`}\" title=\"${`${rowName} ${name} ${colName}${orb ? ` (orb ${orb}\u00B0)` : ''}`}\"><span class=\"asp\">${sym}</span></td>`;\n\t\t\t\t\t\t\t})} ${names.slice(ri + 1, -1).map(() => html`<td class=\"empty\"></td>`)}</tr>`;\n\t\t\t\t\t})}</tbody></table></div>`;\n\t}\n\n\tprivate renderAngles() {\n\t\tconst asc = this.getAscendant();\n\t\tconst mc = this.getMidheaven();\n\t\t// ASC/DESC and MC/IC are exact axes; DESC and IC are the opposite points.\n\t\tconst items = [\n\t\t\tthis.renderAngleMark(asc, 'ASC'),\n\t\t\tthis.renderAngleMark(oppositePoint(asc), 'DSC'),\n\t\t];\n\t\tif (mc !== null) {\n\t\t\titems.push(this.renderAngleMark(mc, 'MC'));\n\t\t\titems.push(this.renderAngleMark(oppositePoint(mc), 'IC'));\n\t\t}\n\t\tconst pof = this.data?.partOfFortune?.longitude;\n\t\tif (typeof pof === 'number') {\n\t\t\titems.push(this.renderAngleMark(normalizeLongitude(pof), 'PoF'));\n\t\t}\n\t\tconst vertex = this.data?.vertex?.longitude;\n\t\tif (typeof vertex === 'number') {\n\t\t\titems.push(this.renderAngleMark(normalizeLongitude(vertex), 'Vtx'));\n\t\t}\n\t\treturn items;\n\t}\n\n\tprivate renderAngleMark(longitude: number, label: string) {\n\t\t// Tick AND label share the same angle so the label sits right at the\n\t\t// tip of the arrow, where a practitioner expects to find it. The label\n\t\t// halo at radius ANGLE_LABEL_R is clear of the wheel rim, so there is\n\t\t// no overlap with house dividers despite the shared angle.\n\t\tconst angle = this.toAngle(longitude);\n\t\tconst tickInner = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\tconst tickOuter = polarToCartesian(CENTER, CENTER, ANGLE_TICK_R, angle);\n\t\tconst labelPos = polarToCartesian(CENTER, CENTER, ANGLE_LABEL_R, angle);\n\t\treturn svg`\n\t\t\t<g>\n\t\t\t\t<line class=\"angle-tick\" x1=${tickInner.x} y1=${tickInner.y} x2=${tickOuter.x} y2=${tickOuter.y} />\n\t\t\t\t<text class=\"angle-marker\" x=${labelPos.x} y=${labelPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${label}</text>\n\t\t\t</g>\n\t\t`;\n\t}\n\n\tprivate renderSpokes() {\n\t\t// Draw a spoke at each real house cusp longitude so Placidus / Koch\n\t\t// unequal houses render correctly. Fall back to 12 equal spokes from the\n\t\t// Ascendant only when the response carries no houses array.\n\t\tconst houses = this.data?.houses ?? [];\n\t\tconst cuspLongitudes =\n\t\t\thouses.length === 12\n\t\t\t\t? houses.map((h) => h.longitude)\n\t\t\t\t: Array.from({ length: 12 }, (_, i) => this.getAscendant() + i * 30);\n\t\treturn cuspLongitudes.map((lon) => {\n\t\t\tconst angle = this.toAngle(lon);\n\t\t\tconst start = polarToCartesian(CENTER, CENTER, HOUSE_R, 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.8\" />`;\n\t\t});\n\t}\n\n\tprivate renderSigns() {\n\t\treturn SIGNS_ORDER.map((sign, 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-glyph\" x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${SIGN_GLYPH[sign]}</text>`;\n\t\t});\n\t}\n\n\tprivate renderHouseNumbers() {\n\t\tconst houses = this.data?.houses ?? [];\n\t\t// Place each house number at the angular midpoint between its cusp and\n\t\t// the next, so the label sits inside the house even when houses are\n\t\t// unequal. Fall back to equal 30-degree sectors when houses are absent.\n\t\tif (houses.length === 12) {\n\t\t\treturn houses.map((house, i) => {\n\t\t\t\tconst next = houses[(i + 1) % 12];\n\t\t\t\tconst mid = arcMidpoint(\n\t\t\t\t\thouse.longitude,\n\t\t\t\t\tnext ? next.longitude : house.longitude + 30,\n\t\t\t\t);\n\t\t\t\tconst pos = polarToCartesian(\n\t\t\t\t\tCENTER,\n\t\t\t\t\tCENTER,\n\t\t\t\t\tHOUSE_R - 12,\n\t\t\t\t\tthis.toAngle(mid),\n\t\t\t\t);\n\t\t\t\treturn svg`<text class=\"house-num\" x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${house.number}</text>`;\n\t\t\t});\n\t\t}\n\t\tconst ascSignIndex = Math.floor(this.getAscendant() / 30);\n\t\treturn Array.from({ length: 12 }, (_, i) => {\n\t\t\tconst angle = this.toAngle(i * 30 + 15);\n\t\t\tconst pos = polarToCartesian(CENTER, CENTER, HOUSE_R - 12, angle);\n\t\t\tconst houseNum = ((i - ascSignIndex + 12) % 12) + 1;\n\t\t\treturn svg`<text class=\"house-num\" x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${houseNum}</text>`;\n\t\t});\n\t}\n\n\t/**\n\t * Degree ticks on the outer zodiac band: a short mark every 5 degrees and a\n\t * longer one on each 30-degree sign cusp, so the wheel reads like a\n\t * reference-grade chart rather than a bare ring of glyphs.\n\t */\n\tprivate renderTicks() {\n\t\tconst ticks = [];\n\t\tfor (let deg = 0; deg < 360; deg += 5) {\n\t\t\tconst angle = this.toAngle(deg);\n\t\t\tconst isMajor = deg % 30 === 0;\n\t\t\tconst inner = isMajor ? SIGN_R - 14 : OUTER_R - 5;\n\t\t\tconst a = polarToCartesian(CENTER, CENTER, inner, angle);\n\t\t\tconst b = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\tticks.push(\n\t\t\t\tsvg`<line class=${isMajor ? 'tick tick-major' : 'tick'} x1=${a.x} y1=${a.y} x2=${b.x} y2=${b.y} stroke-width=${isMajor ? 1 : 0.5} />`,\n\t\t\t);\n\t\t}\n\t\treturn ticks;\n\t}\n\n\t/**\n\t * Degree-and-minute label printed next to each house cusp on the wheel, so\n\t * the exact cusp position is readable without leaving the chart.\n\t */\n\tprivate renderCuspDegrees() {\n\t\tconst houses = this.data?.houses ?? [];\n\t\tif (houses.length !== 12) return nothing;\n\t\treturn houses.map((house) => {\n\t\t\tconst angle = this.toAngle(house.longitude);\n\t\t\tconst pos = polarToCartesian(CENTER, CENTER, HOUSE_R + 9, angle);\n\t\t\tconst sp = longitudeToSignPosition(house.longitude);\n\t\t\treturn svg`<text class=\"cusp-deg\" x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${sp.degree}\u00B0${String(sp.minute).padStart(2, '0')}'</text>`;\n\t\t});\n\t}\n\n\tprivate renderPlanets(planets: PlanetEntry[]) {\n\t\t// Stellium-aware angular fan-out. Conjunctions within 8\u00B0 are the norm\n\t\t// in professional natal charts (Sun-Mercury-Venus cluster, outer-planet\n\t\t// stacks). To keep every glyph legible without losing precision, sort\n\t\t// by longitude and push later members forward in angle until they\n\t\t// clear a minimum separation, then draw a thin leader line from each\n\t\t// displaced glyph back to the planet's true position on the outer\n\t\t// rim. Conventional approach used by professional Western natal\n\t\t// software; preserves both readability and astronomical accuracy.\n\t\tconst MIN_SEPARATION = 7;\n\t\ttype Placed = {\n\t\t\tp: PlanetEntry;\n\t\t\ttrueLon: number;\n\t\t\tdisplayLon: number;\n\t\t};\n\t\tconst sorted: Placed[] = planets\n\t\t\t.filter((p) => Number.isFinite(p.longitude))\n\t\t\t.map((p) => ({\n\t\t\t\tp,\n\t\t\t\ttrueLon: normalizeLongitude(p.longitude),\n\t\t\t\tdisplayLon: normalizeLongitude(p.longitude),\n\t\t\t}))\n\t\t\t.sort((a, b) => a.trueLon - b.trueLon);\n\t\t// Forward sweep: clamp each to at least prev + MIN_SEPARATION.\n\t\tfor (let i = 1; i < sorted.length; i++) {\n\t\t\tconst prev = sorted[i - 1];\n\t\t\tconst cur = sorted[i];\n\t\t\tif (!prev || !cur) continue;\n\t\t\tconst wanted = prev.displayLon + MIN_SEPARATION;\n\t\t\tif (cur.displayLon < wanted) cur.displayLon = wanted;\n\t\t}\n\t\t// If the cluster overshot 360\u00B0, slide everything back equally so the\n\t\t// stack stays anchored near the original longitudes.\n\t\tconst last = sorted[sorted.length - 1];\n\t\tif (last && last.displayLon > 360) {\n\t\t\tconst shift = last.displayLon - 360;\n\t\t\tfor (const s of sorted) s.displayLon -= shift;\n\t\t}\n\t\treturn sorted.map(({ p, trueLon, displayLon }) => {\n\t\t\tconst trueAngle = this.toAngle(trueLon);\n\t\t\tconst displayAngle = this.toAngle(displayLon);\n\t\t\tconst glyphPos = polarToCartesian(CENTER, CENTER, PLANET_R, displayAngle);\n\t\t\tconst degPos = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tPLANET_R - 13,\n\t\t\t\tdisplayAngle,\n\t\t\t);\n\t\t\tconst rimPos = polarToCartesian(CENTER, CENTER, OUTER_R - 4, trueAngle);\n\t\t\tconst leaderInner = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tPLANET_R + 8,\n\t\t\t\tdisplayAngle,\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 offset = Math.abs(displayLon - trueLon) > 0.5;\n\t\t\treturn svg`<g>\n\t\t\t\t${\n\t\t\t\t\toffset\n\t\t\t\t\t\t? svg`<line class=\"planet-leader\" x1=${rimPos.x} y1=${rimPos.y} x2=${leaderInner.x} y2=${leaderInner.y} />`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t\t<text class=\"planet-glyph\" x=${glyphPos.x} y=${glyphPos.y} text-anchor=\"middle\" dominant-baseline=\"central\"><title>${p.name}${retro ? ' retrograde' : ''} - ${degLabel} ${p.sign ?? ''}</title>${glyph}</text>\n\t\t\t\t<text class=\"planet-deg\" x=${degPos.x} y=${degPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${degLabel}${retro ? svg`<tspan class=\"retro\"> \u211E</tspan>` : nothing}</text>\n\t\t\t</g>`;\n\t\t});\n\t}\n\n\tprivate renderDetails() {\n\t\tconst summary = this.data?.summary;\n\t\tconst ai = this.data?.aspectsInterpretation;\n\t\tif (!summary && !ai) return nothing;\n\n\t\tconst retrogrades = summary?.retrogradePlanets ?? [];\n\n\t\treturn html`<div class=\"details\">${\n\t\t\t\tsummary?.dominantElement || summary?.dominantModality\n\t\t\t\t\t? html`<div class=\"pill-row\">${summary.dominantElement ? html`<span class=\"pill\">Dominant element: ${summary.dominantElement}</span>` : nothing} ${summary.dominantModality ? html`<span class=\"pill\">Dominant modality: ${summary.dominantModality}</span>` : nothing}</div>`\n\t\t\t\t\t: nothing\n\t\t\t} ${\n\t\t\t\tai\n\t\t\t\t\t? html`<div class=\"pill-row\"><span class=\"pill pill--success\">Harmonious ${ai.harmonious}</span> <span class=\"pill pill--danger\">Challenging ${ai.challenging}</span> <span class=\"pill pill--muted\">Neutral ${ai.neutral}</span></div>`\n\t\t\t\t\t: nothing\n\t\t\t} ${\n\t\t\t\tretrogrades.length > 0\n\t\t\t\t\t? html`<div class=\"pill-row\">${retrogrades.map((p) => {\n\t\t\t\t\t\t\tconst glyph = PLANET_GLYPH[p] ?? p.slice(0, 2);\n\t\t\t\t\t\t\treturn html`<span class=\"pill pill--muted\">${glyph} ${p} R</span>`;\n\t\t\t\t\t\t})}</div>`\n\t\t\t\t\t: nothing\n\t\t\t} ${ai?.summary ? html`<p class=\"summary\">${ai.summary}</p>` : nothing} ${this.renderElementModalityGrid()}</div>`;\n\t}\n\n\t/**\n\t * Element by modality grid: the 4x3 cross-tab astrologers read for chart\n\t * balance. Each planet is placed by its sign into one cell (Fire/Earth/Air/\n\t * Water row, Cardinal/Fixed/Mutable column). Derived purely from the planet\n\t * signs, with row, column, and grand totals.\n\t */\n\tprivate renderElementModalityGrid() {\n\t\tconst planets = this.getPlanets();\n\t\tif (planets.length === 0) return nothing;\n\t\tconst ELEMENTS = ['Fire', 'Earth', 'Air', 'Water'] as const;\n\t\tconst MODALITIES = ['Cardinal', 'Fixed', 'Mutable'] as const;\n\t\tconst order = SIGNS_ORDER as readonly string[];\n\n\t\tconst cells: Record<string, Record<string, string[]>> = {};\n\t\tfor (const el of ELEMENTS)\n\t\t\tcells[el] = { Cardinal: [], Fixed: [], Mutable: [] };\n\t\tfor (const p of planets) {\n\t\t\tconst idx = order.indexOf(capitalize(p.sign ?? ''));\n\t\t\tif (idx < 0) continue;\n\t\t\tconst el = ELEMENTS[idx % 4];\n\t\t\tconst mod = MODALITIES[idx % 3];\n\t\t\tconst glyph =\n\t\t\t\tPLANET_GLYPH[capitalize(p.name)] ?? capitalize(p.name).slice(0, 2);\n\t\t\tcells[el]?.[mod]?.push(glyph);\n\t\t}\n\n\t\treturn html`<table class=\"em-grid\" aria-label=\"Element and modality distribution\"><thead><tr><th></th>${MODALITIES.map((m) => html`<th scope=\"col\">${m.slice(0, 3)}</th>`)}<th scope=\"col\">Total</th></tr></thead><tbody>${ELEMENTS.map((el) => {\n\t\t\t\t\tconst rowTotal = MODALITIES.reduce(\n\t\t\t\t\t\t(s, m) => s + (cells[el]?.[m]?.length ?? 0),\n\t\t\t\t\t\t0,\n\t\t\t\t\t);\n\t\t\t\t\treturn html`<tr><th scope=\"row\">${el}</th>${MODALITIES.map(\n\t\t\t\t\t\t\t(m) => html`<td>${(cells[el]?.[m] ?? []).join(' ')}</td>`,\n\t\t\t\t\t\t)}<td class=\"em-total\">${rowTotal}</td></tr>`;\n\t\t\t\t})}<tr><th scope=\"row\">Total</th>${MODALITIES.map(\n\t\t\t\t\t\t(m) =>\n\t\t\t\t\t\t\thtml`<td class=\"em-total\">${ELEMENTS.reduce((s, el) => s + (cells[el]?.[m]?.length ?? 0), 0)}</td>`,\n\t\t\t\t\t)}<td class=\"em-total\">${planets.length}</td></tr></tbody></table>`;\n\t}\n\n\tprivate renderInterpretations() {\n\t\tconst planets = this.getPlanets().filter((p) => p.interpretation);\n\t\tif (planets.length === 0) return nothing;\n\t\treturn html`<section class=\"interpretations\"><h3>Planet readings</h3>${planets.map((p, idx) => {\n\t\t\t\tconst interp = p.interpretation!;\n\t\t\t\tconst glyph = PLANET_GLYPH[capitalize(p.name)] ?? '';\n\t\t\t\tconst deg = formatNumber(p.degree ?? 0, 1);\n\t\t\t\treturn html`<details class=\"interp-card\" name=\"natal-planet-readings\" ?open=\"${idx === 0}\"><summary><span>${glyph} ${p.name}</span> <span class=\"interp-aside\"><small>${p.sign ?? ''} ${deg}</small> ${chevron()}</span></summary><div class=\"interp-body\">${interp.summary ? html`<p class=\"interp-summary\">${interp.summary}</p>` : nothing} ${interp.detailed ? html`<p class=\"interp-detail\">${interp.detailed}</p>` : nothing} ${\n\t\t\t\t\t\t\tinterp.keywords?.length\n\t\t\t\t\t\t\t\t? html`<div class=\"interp-keywords\">${interp.keywords.map((k) => html`<span class=\"kw\">${k}</span>`)}</div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}</div></details>`;\n\t\t\t})}</section>`;\n\t}\n\n\tprivate renderAspects(planets: PlanetEntry[], aspects: AspectEntry[]) {\n\t\tconst planetMap = new Map<string, number>();\n\t\tfor (const p of planets) {\n\t\t\tif (typeof p.longitude !== 'number') continue;\n\t\t\tconst name = capitalize(p.name);\n\t\t\tif (name) planetMap.set(name, p.longitude);\n\t\t}\n\t\treturn aspects.map((a) => {\n\t\t\tconst l1 = planetMap.get(capitalize(a.planet1));\n\t\t\tconst l2 = planetMap.get(capitalize(a.planet2));\n\t\t\tif (l1 === undefined || l2 === undefined) return nothing;\n\t\t\tconst p1 = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tPLANET_R - 18,\n\t\t\t\tthis.toAngle(l1),\n\t\t\t);\n\t\t\tconst p2 = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tPLANET_R - 18,\n\t\t\t\tthis.toAngle(l2),\n\t\t\t);\n\t\t\tconst aspectName = normalizeAspect(a);\n\t\t\tconst aspectClass = ASPECT_CLASS[aspectName] ?? 'aspect-other';\n\t\t\tconst orbLabel = formatNumber(a.orb, 1);\n\t\t\treturn svg`<line class=${`aspect ${aspectClass}`} x1=${p1.x} y1=${p1.y} x2=${p2.x} y2=${p2.y}><title>${a.planet1} ${aspectName || ''} ${a.planet2}${orbLabel ? ` (orb ${orbLabel}\u00B0)` : ''}</title></line>`;\n\t\t});\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-natal-chart': RoxyNatalChart;\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/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\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 { 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}*,:before,:after{box-sizing:border-box}@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-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\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/**\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 * 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\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (/^\\d{4}-\\d{2}-\\d{2}$/.test(input)) return '';\n\tconst bareTime = /^\\d{2}:\\d{2}(:\\d{2})?$/.test(input);\n\tconst iso = bareTime ? `1970-01-01T${input}` : input;\n\tconst d = new Date(iso);\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});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst d = new Date(\n\t\t/^\\d{4}-\\d{2}-\\d{2}$/.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});\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\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toFixed(dp).replace(/\\.?0+$/, '');\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\n * canonical name (`SEMI_SEXTILE` \u2192 `semi-sextile`). Accepts any aspect-shaped\n * object so both natal and synastry inter-aspect entries can share this.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '').toLowerCase().replace(/_/g, '-');\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 * 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 * 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 s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n", "import type { TemplateResult } from 'lit';\nimport { css, html, nothing } from 'lit';\n\n/** A single tab in a {@link renderTablist} strip. */\nexport interface TablistItem<T extends string = string> {\n\tid: T;\n\tlabel: string;\n}\n\n/**\n * Shared styling for every horizontal tab strip in the library (natal chart\n * views, transits, kundli styles). Keeping one rule set means the tabs look\n * identical everywhere and theme through the same --roxy-* tokens.\n */\nexport const tablistStyles = css`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:4px}`;\n\n/**\n * Render a WAI-ARIA tablist. The host component owns the active-tab state; this\n * helper draws the buttons, wires click plus Left/Right arrow navigation with a\n * roving tabindex, and moves focus to the newly selected tab. Pair with\n * {@link tablistStyles}.\n *\n * Pass `controls: true` when each tab governs a sibling\n * `<div role=\"tabpanel\" id=\"${idPrefix}-panel-${id}\">` so the buttons advertise\n * `aria-controls`. Omit it for tablists that swap a single rendered view in\n * place with no separate panel element (the kundli style switch).\n *\n * @example\n * ```ts\n * renderTablist({\n * items: [{ id: 'wheel', label: 'Wheel' }, { id: 'grid', label: 'Aspect grid' }],\n * active: this.view,\n * onSelect: (v) => { this.view = v; },\n * label: 'Natal chart views',\n * idPrefix: 'natal',\n * controls: true,\n * })\n * ```\n */\nexport function renderTablist<T extends string>(opts: {\n\titems: ReadonlyArray<TablistItem<T>>;\n\tactive: T;\n\tonSelect: (id: T) => void;\n\tlabel: string;\n\tidPrefix: string;\n\tcontrols?: boolean;\n}): TemplateResult {\n\tconst { items, active, onSelect, label, idPrefix, controls = false } = opts;\n\tconst onKeyDown = (e: KeyboardEvent) => {\n\t\tif (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft') return;\n\t\te.preventDefault();\n\t\tconst idx = items.findIndex((it) => it.id === active);\n\t\tif (idx === -1) return;\n\t\tconst delta = e.key === 'ArrowRight' ? 1 : -1;\n\t\tconst next = items[(idx + delta + items.length) % items.length];\n\t\tif (!next) return;\n\t\tonSelect(next.id);\n\t\tconst root = (e.currentTarget as HTMLElement).getRootNode() as\n\t\t\t| ShadowRoot\n\t\t\t| Document;\n\t\trequestAnimationFrame(() => {\n\t\t\troot\n\t\t\t\t.querySelector<HTMLButtonElement>(`#${idPrefix}-tab-${next.id}`)\n\t\t\t\t?.focus();\n\t\t});\n\t};\n\treturn html`<div class=\"roxy-tablist\" role=\"tablist\" aria-label=\"${label}\" @keydown=\"${onKeyDown}\">${items.map(\n\t\t\t(it) => html`<button type=\"button\" class=\"roxy-tab\" role=\"tab\" id=\"${idPrefix}-tab-${it.id}\" aria-selected=\"${active === it.id ? 'true' : 'false'}\" aria-controls=\"${\n\t\t\t\t\t// Only the active panel is rendered, so only the active tab points\n\t\t\t\t\t// at a live element; otherwise aria-controls would dangle.\n\t\t\t\t\tcontrols && active === it.id ? `${idPrefix}-panel-${it.id}` : nothing\n\t\t\t\t}\" tabindex=\"${active === it.id ? '0' : '-1'}\" @click=\"${() => onSelect(it.id)}\">${it.label}</button>`,\n\t\t)}</div>`;\n}\n"],
|
|
5
|
+
"mappings": "wMAAA,OAAS,OAAAA,GAAK,QAAAC,EAAM,cAAAC,GAAY,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,EAAE,IAAI5F,EAAE,OAAO,GAAG8F,EAAW,SAASA,CAAQ,QAAO,EAAE,iBAC1L,CAAC,CACF,CACD,EA3aa9G,EACL,OAAS,CACf+G,EACAC,EACAC,EACAC,07KACD,EAWAC,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GAhBlBpH,EAiBZ,oBAGAmH,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,QAAS,EAAK,CAAC,GAnBxDpH,EAoBZ,2BAIQmH,EAAA,CADPE,GAAM,GAvBKrH,EAwBJ,oBAxBIA,EAANmH,EAAA,CADNG,GAAc,kBAAkB,GACpBtH",
|
|
6
6
|
"names": ["css", "html", "LitElement", "nothing", "svg", "customElement", "property", "state", "PLANET_GLYPH", "SIGN_GLYPH", "SIGNS_ORDER", "RASHI_KEYS", "s", "ASPECT_SYMBOL", "css", "baseStyles", "normalizeLongitude", "lon", "wrapped", "longitudeToSignPosition", "longitude", "signIndex", "within", "degree", "minuteFloat", "minute", "second", "SIGNS_ORDER", "oppositePoint", "longitude", "normalizeLongitude", "arcMidpoint", "start", "end", "s", "span", "polarToCartesian", "cx", "cy", "radius", "angleDeg", "angleRad", "css", "html", "chevron", "disclosureStyles", "formatNumber", "value", "dp", "ASPECT_CLASS", "normalizeAspect", "a", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "capitalize", "s", "css", "html", "nothing", "tablistStyles", "renderTablist", "opts", "items", "active", "onSelect", "label", "idPrefix", "controls", "e", "idx", "it", "delta", "next", "root", "SIZE", "CENTER", "OUTER_R", "SIGN_R", "HOUSE_R", "PLANET_R", "ANGLE_TICK_R", "ANGLE_LABEL_R", "RoxyNatalChart", "LitElement", "MarkupDataController", "m", "lon", "html", "planets", "aspects", "view", "nothing", "renderTablist", "v", "names", "p", "capitalize", "byPair", "a", "k", "n", "g", "PLANET_GLYPH", "rowName", "ri", "rowGlyph", "colName", "name", "normalizeAspect", "sym", "ASPECT_SYMBOL", "cls", "ASPECT_CLASS", "orb", "formatNumber", "asc", "mc", "items", "oppositePoint", "pof", "normalizeLongitude", "vertex", "longitude", "label", "angle", "tickInner", "polarToCartesian", "tickOuter", "labelPos", "svg", "houses", "h", "_", "i", "start", "end", "SIGNS_ORDER", "sign", "pos", "SIGN_GLYPH", "house", "next", "mid", "arcMidpoint", "ascSignIndex", "houseNum", "ticks", "deg", "isMajor", "inner", "b", "sp", "longitudeToSignPosition", "sorted", "prev", "cur", "wanted", "last", "shift", "s", "trueLon", "displayLon", "trueAngle", "displayAngle", "glyphPos", "degPos", "rimPos", "leaderInner", "glyph", "retro", "degLabel", "offset", "summary", "ai", "retrogrades", "ELEMENTS", "MODALITIES", "order", "cells", "el", "idx", "mod", "rowTotal", "interp", "chevron", "planetMap", "l1", "l2", "p1", "p2", "aspectName", "aspectClass", "orbLabel", "baseStyles", "tablistStyles", "disclosureStyles", "css", "__decorateClass", "property", "state", "customElement"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var f=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var p=(
|
|
1
|
+
var f=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var p=(n,r,e,t)=>{for(var o=t>1?void 0:t?y(r,e):r,s=n.length-1,c;s>=0;s--)(c=n[s])&&(o=(t?c(r,e,o):c(o))||o);return t&&o&&f(r,e,o),o};import{css as b,html as a,LitElement as $,nothing as i}from"lit";import{customElement as k,property as x}from"lit/decorators.js";import{css as g}from"lit";var d=g`: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}*,:before,:after{box-sizing:border-box}@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-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var v="roxy-data";function h(n){return n.nodeName==="SCRIPT"&&n.getAttribute("type")==="application/json"}var m=class{constructor(r){this.host=r,r.addController(this)}hostConnected(){if(this.host.data!=null)return;let r=this.read();r!==void 0&&(this.host.data=r,this.host.requestUpdate())}read(){let r=this.findInlineScript();return r?this.parse(r.textContent):void 0}findInlineScript(){for(let r of Array.from(this.host.children))if(h(r)&&r.classList.contains(v))return r;return null}parse(r){if(r?.trim())try{return JSON.parse(r)}catch{return}}};function u(n){return n.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^\w/,r=>r.toUpperCase())}var l=class extends ${constructor(){super();this.data=null;this.type="life-path";new m(this)}render(){let e=this.data;if(!e)return a`<div class="roxy-empty" role="status">No numerology data</div>`;let t=C[this.type]??this.type;return"coreNumbers"in e?this.renderChart(e,t):"personalYear"in e?this.renderPersonalYear(e,t):this.renderNumberCard(e,t)}renderNumberCard(e,t){let o=e.meaning?.keywords??[];return a`<article class="card" aria-label="${t}"><div class="hero">${typeof e.number=="number"?a`<div class="numeral">${e.number}</div>`:i}<div><p class="label">${t}</p>${e.meaning?.title?a`<h2 class="title">${e.meaning.title}</h2>`:i}</div></div>${e.meaning?.description?a`<p class="meaning">${e.meaning.description}</p>`:i} ${e.calculation?a`<pre class="calc">${e.calculation}</pre>`:i} ${o.length>0?a`<div class="chips">${o.map(s=>a`<span>${s}</span>`)}</div>`:i} ${e.hasKarmicDebt&&e.karmicDebtNumber?a`<div class="karmic">Karmic debt ${e.karmicDebtNumber}. ${w(e.karmicDebtMeaning)}</div>`:i}</article>`}renderPersonalYear(e,t){return a`<article class="card" aria-label="${t}"><div class="hero">${typeof e.personalYear=="number"?a`<div class="numeral">${e.personalYear}</div>`:i}<div><p class="label">${t}</p>${e.theme?a`<h2 class="title">${e.theme}</h2>`:i}</div></div>${e.forecast?a`<p class="meaning">${e.forecast}</p>`:i} ${e.advice?a`<p>${e.advice}</p>`:i}</article>`}renderChart(e,t){let o=Object.entries(e.coreNumbers).filter(([,s])=>s!=null);return a`<article class="card" aria-label="${t}"><div><p class="label">${t}</p>${e.profile?.name?a`<h2 class="title">${e.profile.name}</h2>`:i}</div>${o.length>0?a`<div class="cores">${o.map(([s,c])=>a`<div class="item"><span>${u(s)}</span> <strong>${c.number??""}</strong></div>`)}</div>`:i}</article>`}};l.styles=[d,b`.card{background:var(--roxy-bg,#fff);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);display:grid}.hero{align-items:center;gap:var(--roxy-space-md,1rem);display:flex}.numeral{font-size:4rem;line-height:1;font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-ink,#b45309);font-variant-numeric:tabular-nums}.label{font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em;margin:0}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.meaning{color:var(--roxy-fg,#0a0a0a);margin:0}.calc{font-family:var(--roxy-font-mono);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 30%, transparent);padding:var(--roxy-space-sm,.5rem);border-radius:var(--roxy-radius-sm,4px);white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.chips{gap:var(--roxy-space-xs,.25rem);flex-wrap:wrap;display:flex}.chips span{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);border-radius:var(--roxy-radius-full,9999px);font-size:var(--roxy-text-xs,.75rem);padding:2px 8px}.cores{gap:var(--roxy-space-sm,.5rem);border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(8rem,1fr));display:grid}.cores .item{align-items:baseline;gap:var(--roxy-space-xs,.25rem);font-size:var(--roxy-text-sm,.875rem);display:flex}.cores .item span:first-child{color:var(--roxy-muted,#71717a);text-transform:capitalize}.cores .item strong{color:var(--roxy-accent-ink,#b45309);font-variant-numeric:tabular-nums;font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600)}.karmic{background:color-mix(in srgb, var(--roxy-warning,#ea580c) 12%, transparent);border:1px solid color-mix(in srgb, var(--roxy-warning,#ea580c) 32%, transparent);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);border-radius:var(--roxy-radius-md,8px);font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a)}`],p([x({attribute:!1})],l.prototype,"data",2),p([x({type:String,reflect:!0})],l.prototype,"type",2),l=p([k("roxy-numerology-card")],l);var C={"life-path":"Life Path",expression:"Expression","personal-year":"Personal Year",chart:"Numerology chart"};function w(n){return n?[n.description,n.challenge,n.resolution].filter(Boolean).join(" "):""}export{l as RoxyNumerologyCard};
|
|
2
2
|
//# sourceMappingURL=numerology-card.js.map
|