/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{ensureOneOfType as e}from"../../../../../core/accessorSupport/ensureType.js";import t from"../AudioInput.js";import p from"../DocumentInput.js";import n from"../ImageInput.js";import r from"../Input.js";import o from"../SignatureInput.js";import a from"../VideoInput.js";function u(e){return{nestableTypes:{base:r,key:"type",typeMap:{audio:t,document:p,image:n,signature:o,video:a}},allTypes:{base:r,key:"type",typeMap:{attachment:e,audio:t,document:p,image:n,signature:o,video:a}}}}function s(t,p,n){return t?t.map(t=>e(n?p.nestableTypes:p.allTypes,t)):null}function i(e,t,p){if(!e)return null;const n=p?t.nestableTypes.typeMap:t.allTypes.typeMap;return e.filter(e=>n[e.type]).map(e=>n[e.type].fromJSON(e))}function m(e,t,p){if(!e)return null;const n=p?t.nestableTypes.typeMap:t.allTypes.typeMap;return e.filter(e=>n[e.type]).map(e=>e.toJSON())}export{u as buildTypeMaps,s as ensureType,i as fromJSON,m as toJSON};
