import{GenericActivityError}from"../../Errors.js";import{validation}from"../../Validation.js";import{inline,schedulePromiseCancellation,fetch}from"./tools.js";class GetFeatureLayerInfo{execute(e,r){var i=validation.string("url",e.url,validation.never),t=validation.number("timeout",e.timeout,void 0);const n={};e.dynamicLayerDefinition?n.layer=e.dynamicLayerDefinition:e.source&&(n.layer={source:e.source});t=fetch(i,n,t,r.cancellationToken.signal);return schedulePromiseCancellation(r,t),inline(t,function(e){if(!e.fields)throw new GenericActivityError('Error running the "Get Feature Layer Info" activity. The response did not include the required "fields" property.');return{layerInfo:e}})}}GetFeatureLayerInfo.action="gcx:wf:arcgis::GetFeatureLayerInfo",GetFeatureLayerInfo.suite="gcx:wf:builtin";export{GetFeatureLayerInfo};