import { buildResultTemplatesManager } from "@coveo/headless";
import { TemplateProvider } from "../template-provider/template-provider.js";
class ResultTemplateProvider extends TemplateProvider {
    makeDefaultTemplate() {
        const content = document.createDocumentFragment();
        const linkEl = document.createElement('atomic-result-link');
        content.appendChild(linkEl);
        const linkContent = document.createDocumentFragment();
        const linkMarkup = `
      <atomic-result-link>
      ${this.gridCellLinkTarget ? `<a slot="attributes" target="${this.gridCellLinkTarget}"></a>` : ''}
      </atomic-result-link>
    `;
        const linkTemplate = document.createElement('template');
        linkTemplate.innerHTML = linkMarkup.trim();
        linkContent.appendChild(linkTemplate.content);
        return {
            content,
            linkContent,
            conditions: []
        };
    }
    constructor(props, gridCellLinkTarget){
        super(props, ()=>buildResultTemplatesManager(props.bindings.engine)), this.gridCellLinkTarget = gridCellLinkTarget;
    }
}
export { ResultTemplateProvider };
