/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../layers/support/TileInfo"],(function(e,l){"use strict";const s=1e-6;function n(e,l){if(e===l)return!0;if(!e&&null!=l)return!1;if(null!=e&&!l)return!1;if(!e.spatialReference.equals(l.spatialReference)||e.dpi!==l.dpi)return!1;const n=e.origin,o=l.origin;if(Math.abs(n.x-o.x)>=s||Math.abs(n.y-o.y)>=s)return!1;let r,t;e.lods[0].scale>l.lods[0].scale?(r=e,t=l):(t=e,r=l);for(let i=r.lods[0].scale;i>=t.lods[t.lods.length-1].scale-s;i/=2)if(Math.abs(i-t.lods[0].scale)<s)return!0;return!1}function o(e,s){if(e===s)return e;if(!e&&null!=s)return s;if(null!=e&&!s)return e;const n=e.size[0],o=e.format,r=e.dpi,t={x:e.origin.x,y:e.origin.y},i=e.spatialReference.toJSON(),a=e.lods[0].scale>s.lods[0].scale?e.lods[0]:s.lods[0],u=e.lods[e.lods.length-1].scale<=s.lods[s.lods.length-1].scale?e.lods[e.lods.length-1]:s.lods[s.lods.length-1],d=a.scale,c=a.resolution,f=u.scale,p=[];let g=d,h=c,b=0;for(;g>f;)p.push({level:b,resolution:h,scale:g}),b++,g/=2,h/=2;return new l({size:[n,n],dpi:r,format:o||"pbf",origin:t,lods:p,spatialReference:i})}e.areSchemasOverlapping=n,e.unionTileInfos=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
