/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../chunks/_rollupPluginBabelHelpers","../../../core/maybe","../../../layers/support/fieldUtils"],(function(e,l,t,i){"use strict";function s(e){return u.apply(this,arguments)}function u(){return(u=l._asyncToGenerator((function*(e,l=e.popupTemplate){if(t.isNone(l))return[];const s=yield l.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:u}=l,{objectIdField:d,typeIdField:n,globalIdField:p,relationships:o}=e;if(s.includes("*"))return["*"];const a=u?yield i.getFeatureEditFields(e):[],r=i.fixFields(e.fieldsIndex,[...s,...a]);return n&&r.push(n),r&&d&&e.fieldsIndex.has(d)&&!r.includes(d)&&r.push(d),r&&p&&e.fieldsIndex.has(p)&&!r.includes(p)&&r.push(p),o&&o.forEach((l=>{const{keyField:t}=l;r&&t&&e.fieldsIndex.has(t)&&!r.includes(t)&&r.push(t)})),r}))).apply(this,arguments)}function d(e,l){return e.popupTemplate?e.popupTemplate:t.isSome(l)&&l.defaultPopupTemplateEnabled&&t.isSome(e.defaultPopupTemplate)?e.defaultPopupTemplate:null}e.getFetchPopupTemplate=d,e.getRequiredFields=s,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
