text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/3.38/esri/copyright.txt for details.
  //>>built
  define("esri/layers/vectorTiles/views/2d/tiling/LODInfo",["require","exports","../../../geometry/support/spatialReferenceUtils","./TileKey"],function(v,w,q,r){function n(d,a,b){d[0]=a;d[1]=b;return d}var g=new r("0/0/0/0");return function(){function d(a,b,c,e,f,h,k,l,m,p,t,u){this.level=a;this.resolution=b;this.scale=c;this.origin=e;this.first=f;this.last=h;this.size=k;this.norm=l;this.worldStart=m;this.worldEnd=p;this.worldSize=t;this.wrap=u}d.create=function(a,b,c){var e=q.getInfo(a.spatialReference),
  f=[a.origin.x,a.origin.y],h=[a.size[0]*b.resolution,a.size[1]*b.resolution],k=[-Infinity,-Infinity],l=[Infinity,Infinity],m=[Infinity,Infinity];c&&(n(k,Math.max(0,Math.floor((c.xmin-f[0])/h[0])),Math.max(0,Math.floor((f[1]-c.ymax)/h[1]))),n(l,Math.max(0,Math.floor((c.xmax-f[0])/h[0])),Math.max(0,Math.floor((f[1]-c.ymin)/h[1]))),n(m,l[0]-k[0]+1,l[1]-k[1]+1));if(a.isWrappable){a=[Math.ceil(Math.round(2*e.origin[1]/b.resolution)/a.size[0]),m[1]];e=[Math.floor((e.origin[0]-f[0])/h[0]),k[1]];c=[a[0]+e[0]-
  1,l[1]];var p=!0}else e=k,c=l,a=m,p=!1;return new d(b.level,b.resolution,b.scale,f,k,l,m,h,e,c,a,p)};d.prototype.normalizeCol=function(a){if(!this.wrap)return a;var b=this.worldSize[0];return 0>a?b-1-Math.abs((a+1)%b):a%b};d.prototype.denormalizeCol=function(a,b){return this.wrap?this.worldSize[0]*b+a:a};d.prototype.getWorldForColumn=function(a){return this.wrap?Math.floor(a/this.worldSize[0]):0};d.prototype.getFirstColumnForWorld=function(a){return a*this.worldSize[0]+this.first[0]};d.prototype.getLastColumnForWorld=
  function(a){return a*this.worldSize[0]+this.first[0]+this.size[0]-1};d.prototype.getColumnForX=function(a){return(a-this.origin[0])/this.norm[0]};d.prototype.getXForColumn=function(a){return this.origin[0]+a*this.norm[0]};d.prototype.getRowForY=function(a){return(this.origin[1]-a)/this.norm[1]};d.prototype.getYForRow=function(a){return this.origin[1]-a*this.norm[1]};d.prototype.getTileBounds=function(a,b,c){void 0===c&&(c=!1);g.set(b);var e=c?g.col:this.denormalizeCol(g.col,g.world),f=g.row;b=this.getXForColumn(e);
  c=this.getYForRow(f+1);e=this.getXForColumn(e+1);f=this.getYForRow(f);a[0]=b;a[1]=c;a[2]=e;a[3]=f;return a};d.prototype.getTileCoords=function(a,b,c){void 0===c&&(c=!1);g.set(b);b=c?g.col:this.denormalizeCol(g.col,g.world);Array.isArray(a)?n(a,this.getXForColumn(b),this.getYForRow(g.row)):(a.x=this.getXForColumn(b),a.y=this.getYForRow(g.row));return a};return d}()});