${this.t('Type')}
${
d.type || d.profile
? html`
${[
display(d, 'type'),
d.profile
? this.t('Profile {{profile}}', { profile: d.profile })
: '',
]
.filter(Boolean)
.join(' ยท ')}
`
: nothing
}
${renderHdFacts([
{ label: this.t('Type'), value: display(d, 'type') },
{ label: this.t('Strategy'), value: display(d, 'strategy') },
{ label: this.t('Authority'), value: display(d, 'authority') },
{ label: this.t('Profile'), value: d.profile },
])}
${
// The tiles above name the type; this paragraph explains it.
d.typeDescription && !this.hideReadings
? html`
${d.typeDescription}
`
: nothing
}
${renderHdThemes(
d.signature ? display(d, 'signature') : undefined,
d.notSelf ? display(d, 'notSelf') : undefined,
this.translator,
)}
${this.renderInterpretation(
[
{
label: this.t('Strategy'),
aside: display(d, 'strategy'),
body: d.strategyDescription,
},
{
label: this.t('Authority'),
aside: display(d, 'authority'),
body: d.authorityDescription,
},
{ label: this.t('Aura'), body: d.aura },
],
'hd-type-reading',
)}
`;
}
/**
* The profile read. Two keynote sentences, so they render open as a definition list rather than behind a disclosure: putting a single sentence behind a click costs the reader more than it saves.
*/
private renderProfile(d: CalculateProfileResponse) {
return html`
${this.t('Profile')}
${d.profile ? html`${d.profile}
` : nothing}
${renderHdFacts([
{ label: this.t('Profile'), value: d.profile },
{
label: this.t('Personality line'),
value: d.personalityLine?.toString(),
},
{ label: this.t('Design line'), value: d.designLine?.toString() },
])}
${
// The section holds nothing but the two keynote sentences, and the line
// numbers are already tiles above it, so it goes whole.
this.hideReadings
? nothing
: html`
${this.t('Lines')}
${renderHdKeynotes(
{
personality: d.personalityKeynote,
personalityLine: d.personalityLine,
design: d.designKeynote,
designLine: d.designLine,
},
this.translator,
)}
`
}
`;
}
}
/** The two responses share only `profile`, so the type field is what tells them apart. */
function isTypeShape(d: HdIdentity): d is CalculateTypeResponse {
return typeof (d as CalculateTypeResponse).type === 'string';
}
declare global {
interface HTMLElementTagNameMap {
'roxy-hd-type-card': RoxyHdTypeCard;
}
}