import{validation}from"../../Validation.js";import{setFormForElement}from"./FormElementMap.js";class AddFormElement{execute(e,t){var{elementName:n,elementType:r,element:m,targetForm:o}=e;let a=e["form"];if(a=o||a,validation.exists("form",a),validation.string("elementName",n,validation.never),validation.string("elementType",r,validation.never),"Header"===r)throw new Error("A form cannot contain more than one header element.");m=a.actor.addElement(n,r,m);return setFormForElement(m,a),{}}}AddFormElement.action="gcx:wf:forms::AddFormElement",AddFormElement.suite="gcx:wf:builtin";export{AddFormElement};