import{validation}from"../../Validation.js";import{getFormForElement}from"./FormElementMap.js";class SetCurrentFormElementItem{execute(e,t){var{matchType:a,value:m}=e;let{elementName:r,form:n}=e;switch("object"==typeof r&&(n=getFormForElement(r)),validation.exists("form",n),validation.string("matchType",a,validation.never),validation.exists("value",m),a){case"index":case"item":case"key":case"label":case"value":break;default:validation.fail("matchOn",'The `matchOn` input must be "index", "item", "key", "label" or "value".')}e=n.actor.getElementName(r,n.event);return{result:n.actor.setCurrentItem(e,m,a)}}}SetCurrentFormElementItem.action="gcx:wf:forms::SetCurrentFormElementItem",SetCurrentFormElementItem.suite="gcx:wf:builtin";export{SetCurrentFormElementItem};