/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{getMetersPerVerticalUnitForSR as n}from"../../../core/units.js";import{equals as e}from"../../../geometry/support/spatialReferenceUtils.js";function t(n,e,t){if(null==n.hasM||n.hasZ)for(const i of e)for(const n of i)n.length>2&&(n[2]*=t)}function i(e,t,i){if(!e&&!t||!i)return;const s=n(i);o(e,i,s),o(t,i,s)}function o(n,e,t){if(n)for(const i of n)s(i.geometry,e,t)}function s(i,o,s){if(!i?.spatialReference||e(i.spatialReference,o))return;const f=n(i.spatialReference)/s;if(1!==f)if("x"in i)null!=i.z&&(i.z*=f);else if("rings"in i)t(i,i.rings,f);else if("paths"in i)t(i,i.paths,f);else if("points"in i&&(null==i.hasM||i.hasZ))for(const n of i.points)n.length>2&&(n[2]*=f)}export{i as unapplyEditsZUnitScaling};
