import { type CSSResultGroup, html, nothing, type PropertyValues } from 'lit';
import { property, state } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import type { SelfFetchEndpoint } from '../generated/endpoint-defaults.js';
import type { ChromeString } from '../i18n/chrome-strings.js';
import { apiLang } from '../i18n/lang.js';
import { RoxyLocalizedElement } from '../i18n/localized-element.js';
import { baseStyles } from './base-styles.js';
import { expandCompact } from './compact.js';
import { defaultEndpoint } from './endpoint-default.js';
import {
type ApiIssue,
apiFetch,
buildRequest,
FetchController,
type RoxyRequest,
submitContextConverter,
} from './fetch-controller.js';
import {
type InterpSection,
renderInterpAccordion,
} from './interp-accordion.js';
import { MarkupDataController } from './markup-data.js';
/**
* Shared base for every data-driven Roxy component. Carries once what every component needs, rather than per component, and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.
*
* @remarks
* Two render modes, one component, which is the whole drop-in contract:
*
* - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `