export function addOutFields(t,e){if(t.outFields?.includes("*")||!e?.length)return;const i=new Set((t.outFields??[]).concat(...e));t.outFields=[...i]}export function getGlobalIdField(t){return t.fields.find((t=>"global-id"===t.type))?.name}export function isGlobalIdUsed(t,e){if(!t.capabilities.editing.supportsGlobalId)return!1;const i=getGlobalIdField(t);return!!i&&(e.addFeatures?.some((t=>!!t.attributes[i]))&&e.addFeatures?.every((t=>!!t.attributes[i])))}export function getReturnServiceEditsOption(t){if(!/^https:\/\/[a-z\d-]+(\.maps[^.]*)?\.arcgis\.com/i.test(t.url)&&!/\/hosted\//i.test(t.url))return"original-and-current-features"}