/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.24/esri/copyright.txt for details. */ const t=16,n=8,o=4,e=2,r=1,c=new Float64Array(2),h=new Float64Array(2),f=-90,l=90,a=-180,u=180,s="0123456789bcdefghjkmnpqrstuvwxyz";function i(t){return t<=57?t-48:t<=104?t-88:t<=107?t-89:t<=110?t-90:t-91}function M(t){return s[t]}function g(t){return(t[0]+t[1])/2}function b(t,n,o){return t[0]=n,t[1]=o,t}function A(t,n){const o=g(t),e=n,r=!n;t[0]=r*t[0]+e*o,t[1]=r*o+e*t[1]}function m(t,n){const o=n>g(t);return A(t,o),o}function d(s,M){const m=b(c,f,l),d=b(h,a,u);for(let c=0;c>a,b=(M&t.geohashY)>>u;for(let t=s-1;t>=0;t--){const n=(r+c)/2,o=g&1<=0;t--){const n=(o+e)/2,r=b&1<n?1:0;r|=e<<29-(t+5*u),l=(1-e)*l+e*n,a=(1-e)*n+e*a}for(let t=0;t<5;t++){const o=(h+f)/2,e=n>o?1:0;c|=e<<29-(t+5*u),h=(1-e)*h+e*o,f=(1-e)*o+e*f}}t.geohashX=r,t.geohashY=c}function p(t,n,o,e,r){r%2&&(r+=1);let c=0,h=0,f=-90,l=90,a=-180,u=180;for(let s=0;sn?1:0;c|=o<<29-(t+5*s),a=(1-o)*a+o*n,u=(1-o)*n+o*u}for(let t=0;t<5;t++){const n=(f+l)/2,e=o>n?1:0;h|=e<<29-(t+5*s),f=(1-e)*f+e*n,l=(1-e)*n+e*l}}t[2*n]=c,t[2*n+1]=h}function C(t,n,o){let e="";const r=b(c,-90,90),f=b(h,-180,180);for(let c=0;c>1|(t&c)>>2:(e&c)>>1|(n&c)>>2}function k(c,h){return h?(e&c)>>1|(n&c)>>2:r&c|(o&c)>>1|(t&c)>>2}function q(c,h,f){const l=!((c.length-1)%2),a=c.substring(0,c.length-1),u=i(c.charCodeAt(c.length-1));let s=0,g=0,b=0,A=0;l?(s=8,g=4,b=r&u|(o&u)>>1|(t&u)>>2,A=(e&u)>>1|(n&u)>>2):(s=4,g=8,A=r&u|(o&u)>>1|(t&u)>>2,b=(e&u)>>1|(n&u)>>2);const m=b+h,d=A+f,w=Math.floor(m/s),x=Math.floor(d/g),y=M(F(m-w*s,d-x*g,l));return c.length>1&&(w||x)?q(a,w,x)+y:a+y}function v(t,n,o,e,r){const c=Math.abs(o-t),h=Math.abs(e-n),f=X(r),l=Y(r),a=Math.ceil(h/l),u=Math.ceil(c/f),s=C(t,n,r),i=new Array;for(let M=0;M