import { html } from "lit";
import "../components/common/atomic-component-error/atomic-component-error.js";
function errorGuard() {
    return (_, propertyKey, descriptor)=>{
        if (descriptor?.value === void 0 || 'render' !== propertyKey) throw new Error('@errorGuard decorator can only be used on render method');
        const originalMethod = descriptor.value;
        descriptor.value = function() {
            if (this.error) return html`<atomic-component-error
          .error=${this.error}
          .element=${this}
        ></atomic-component-error>`;
            return originalMethod.call(this);
        };
        return descriptor;
    };
}
export { errorGuard };
