/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{isOneOf as r}from"../ensureType.js";import{process as e}from"./serializableProperty/originAliases.js";import{create as t}from"./serializableProperty/reader.js";import{process as o}from"./serializableProperty/shorthands.js";import{create as i}from"./serializableProperty/writer.js";function s(r){const e=n(r);if(r.json.origins)for(const o in r.json.origins){const s=r.json.origins[o],n=s.types?p(s):e;t(n,s,!1),s.types&&!s.write&&r.json.write?.enabled&&(s.write={...r.json.write}),i(n,s)}t(e,r.json,!0),i(e,r.json)}function n(r){return r.json.types?a(r.json):r.type?y(r):a(r)}function p(r){return r.type?y(r):a(r)}function y(e){if(!e.type)return;let t=0,o=e.type;for(;Array.isArray(o)&&!r(o);)o=o[0],t++;return{type:o,ndimArray:t}}function a(r){if(!r.types)return;let e=0,t=r.types;for(;Array.isArray(t);)t=t[0],e++;return{types:t,ndimArray:e}}function f(r){o(r)&&(e(r),s(r))}export{f as processPrototypePropertyMetadata};
