import { buildInteractiveResultCore, } from '../../core/interactive-result/headless-core-interactive-result.js';
/**
 * Creates a core `InteractiveGeneratedAnswerInlineLink` controller instance.
 *
 * @param engine - The headless engine.
 * @param analyticsClient - The analytics client.
 * @param props - The configurable `InteractiveGeneratedAnswerInlineLink`
 * properties.
 * @returns An `InteractiveGeneratedAnswerInlineLink` controller instance.
 */
export function buildInteractiveGeneratedAnswerInlineLinkCore(engine, analyticsClient, props) {
    let wasOpened = false;
    const logAnalyticsIfNeverOpened = () => {
        if (wasOpened) {
            return;
        }
        wasOpened = true;
        engine.dispatch(analyticsClient.logGeneratedAnswerOpenInlineLink(props.options.link, props.options.answerId));
    };
    return buildInteractiveResultCore(engine, props, logAnalyticsIfNeverOpened);
}
