@arcgis/core 5.2.0-next.145 → 5.2.0-next.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcade/featureSetUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/2062d46f638eabfc9499.js +1 -0
- package/assets/esri/core/workers/chunks/{8ba32d3a0df4a206ef1c.js → 392bcef780df52fb4cca.js} +1 -1
- package/assets/esri/core/workers/chunks/{d201fbf3ceff946d2bd6.js → 44d5508042cacdfcac47.js} +1 -1
- package/assets/esri/core/workers/chunks/{d4926545193414cf2f16.js → 4ed8655770a3e018e366.js} +1 -1
- package/assets/esri/core/workers/chunks/{cbe6c0f32608cb504695.js → 776ae25a34352d3468bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{fccbb902fe08448f91de.js → 9c1e69ac82e2bf746191.js} +1 -1
- package/assets/esri/core/workers/chunks/{8b54589f173259c1ba55.js → b8054adc45bca069b948.js} +1 -1
- package/assets/esri/core/workers/chunks/{43fc42405167a5537039.js → f095cf98940e3f95d51e.js} +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +0 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +4 -2
- package/chunks/GlobalIlluminationBlur.glsl.js +3 -5
- package/chunks/GlobalIlluminationUpscale.glsl.js +1 -1
- package/config.js +1 -1
- package/core/colorUtils.js +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +35 -5
- package/kernel.js +1 -1
- package/layers/ParquetLayer.d.ts +9 -8
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/support/ParquetPortalItemData.d.ts +2 -0
- package/layers/support/ParquetPortalItemData.js +1 -1
- package/layers/support/PortalItemData.d.ts +21 -0
- package/layers/support/parquetUtils.d.ts +1 -1
- package/layers/support/types.d.ts +1 -1
- package/package.json +2 -2
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js +2 -2
- package/views/interactive/options/SnappingOptions.d.ts +1 -0
- package/views/interactive/options/TooltipOptions.d.ts +1 -0
- package/views/interactive/options/ViewOptions.d.ts +1 -0
- package/views/interactive/support/Units.d.ts +1 -0
- package/views/layers/ParquetLayerView.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +6 -0
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm.d.ts +2 -2
- package/assets/esri/core/workers/chunks/25e6013e2c095629b236.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1484],{66344(t,e,i){i.d(e,{q:()=>u});const r=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class s{get size(){return this._size}constructor(t=10485760,e=.3){this._maxSize=t,this._maxClientSizeRatio=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._clients=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._clients.clear(),this._db.clear()}register(t){this._clients.set(t.id.slice(0,-1),t)}deregister(t){this.clear(t),this._sizeLimits.delete(t),this._clients.delete(t.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,-1),this._checkSize()}get _maxClientSize(){return this._maxSize*this._maxClientSizeRatio}getSize(t,e){return this._db.get(t.id+e)?.size??0}put(t,e,i,s,a){e=t.id+e;let u=this._db.get(e);if(u&&(this._size-=u.size,t.size-=u.size,this._db.delete(e),u.entry!==i&&this._notifyRemove(e,u.entry,u.size,0)),s>this._maxSize)return void this._notifyRemove(e,i,s,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return r||console.warn(`Refusing to cache entry with size ${s} for key ${e}`),void this._notifyRemove(e,i,0,0);let o=1+Math.max(a,-4)- -3;this._db.set(e,new n(i,s,o)),this._size+=s,t.size+=s,this._checkSize()}updateSize(t,e){e=t.id+e;let i=this._db.get(e);if(!i)return;this._size-=i.size,t.size-=i.size;let r=i.entry.usedMemory;for(;r>this._maxSize;){let t=this._notifyRemove(e,i.entry,r,1);if(!(null!=t&&t>0))return void this._db.delete(e);r=t}i.size=r,this._size+=r,t.size+=r,this._checkSize()}pop(t,e){e=t.id+e;let i=this._db.get(e);if(i)return this._size-=i.size,t.size-=i.size,this._db.delete(e),++this._hit,i.entry;++this._miss}get(t,e){e=t.id+e;let i=this._db.get(e);if(void 0!==i)return this._db.delete(e),i.lives=i.lifetime,this._db.set(e,i),++this._hit,i.entry;++this._miss}peek(t,e){let i=this._db.get(t.id+e);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){let t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},e={},i=[];this._db.forEach((t,r)=>{let s=t.lifetime;i[s]=(i[s]||0)+t.size,this._clients.forEach(i=>{let{id:s,name:n}=i;if(r.startsWith(s)){let i=e[n]||0;e[n]=i+t.size}})});let r={};this._clients.forEach(t=>{let i=t.name;if("hitRate"in t&&"number"==typeof t.hitRate&&!isNaN(t.hitRate)&&t.hitRate>0){let s=e[i]||0;e[i]=s,r[i]=Math.round(100*t.hitRate)+"%"}else r[i]="0%"});let s=Object.keys(e);s.sort((t,i)=>e[i]-e[t]),s.forEach(i=>t[i]=Math.round(e[i]/2**20)+"MB / "+r[i]);for(let e=i.length-1;e>=0;--e){let r=i[e];r&&(t["Priority "+(e+-3-1)]=Math.round(r/this._size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._clients.forEach(t=>t.resetHitRate())}clear(t){let e=t.id;this._db.forEach((t,i)=>{i.startsWith(e)&&(this._size-=t.size,this._db.delete(i),this._notifyRemove(i,t.entry,t.size,0))}),t.size=0}clearAll(){this._db.forEach((t,e)=>this._notifyRemove(e,t.entry,t.size,0)),this._clients.forEach(t=>t.size=0),this._size=0,this._db.clear()}*values(t){for(let[e,i]of this._db)e.startsWith(t.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,e,i,r){let s=this._clients.get(t.split(a)[0])?.removeFunc,n=s?.(e,r,i);return"number"==typeof n?n:null}_checkSize(){this._sizeLimits.forEach((t,e)=>this._checkSizeLimits(t,e)),this._clients.forEach(t=>this._checkSizeLimits(this._maxClientSize,t)),this._checkSizeLimits(this.maxSize)}setMaxClientSize(t,e){null==e||e<=0?this._sizeLimits.delete(t):this._sizeLimits.set(t,e)}_checkSizeLimits(t,e){let i=e??this;if(i.size<=t)return;let r=e?.id,s=!0;for(;s;){s=!1;for(let[n,u]of this._db)if(0===u.lifetime&&(!r||n.startsWith(r))){let r=e??this._clients.get(n.split(a)[0]);if(this._purgeItem(n,u,r),i.size<=.9*t)return;s||=this._db.has(n)}}for(let[s,n]of this._db)if(!r||s.startsWith(r)){let r=e??this._clients.get(s.split(a)[0]);if(this._purgeItem(s,n,r),i.size<=.9*t)return}}_purgeItem(t,e,i){if(this._db.delete(t),e.lives<=1){this._size-=e.size,i&&(i.size-=e.size);let r=this._notifyRemove(t,e.entry,e.size,1);null!=r&&r>0&&(this._size+=r,i&&(i.size+=r),e.lives=e.lifetime,e.size=r,this._db.set(t,e))}else--e.lives,this._db.set(t,e)}}new s(0);class n{constructor(t,e,i){this.entry=t,this.size=e,this.lifetime=i,this.lives=i}}const a=":";class u{constructor(t,e){this.removeFunc=e,this.id="",this.name="",this.size=0,this._storage=new s(t,1),this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(t,e,i=1){this._storage.put(this,t,e,i,1)}pop(t){return this._storage.pop(this,t)}get(t){return this._storage.get(this,t)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}resetHitRate(){}}},9093(t,e,i){function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}i.d(e,{o8:()=>s,vt:()=>r});const n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:n,clone:s,create:r,fromValues:function(t,e,i,r,s,n,a,u,o,l,h,c,f,d,p,m){return[t,e,i,r,s,n,a,u,o,l,h,c,f,d,p,m]}},Symbol.toStringTag,{value:"Module"})),i.d(e,["zK",0,n])},35522(t,e,i){i.d(e,{$A:()=>P,Bw:()=>n,C:()=>a,Cc:()=>v,DI:()=>M,Io:()=>g,Ln:()=>y,Om:()=>S,Qr:()=>c,Re:()=>l,S8:()=>I,T9:()=>m,WQ:()=>o,Z0:()=>F,_S:()=>d,aI:()=>A,ei:()=>b,fw:()=>C,gL:()=>R,hG:()=>x,hZ:()=>u,hs:()=>_,jk:()=>p,lw:()=>h,m3:()=>w,oW:()=>E,t2:()=>O,tn:()=>f,ze:()=>z});var r=i(51850),s=i(34304);function n(t){let e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t,e,i,r){return t[0]=e,t[1]=i,t[2]=r,t}function o(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function l(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function h(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function c(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t}function f(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t}function d(t,e){return t[0]=Math.sign(e[0]),t[1]=Math.sign(e[1]),t[2]=Math.sign(e[2]),t}function p(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function m(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function _(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function y(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t}function g(t,e){let i=e[0]-t[0],r=e[1]-t[1],s=e[2]-t[2];return Math.sqrt(i*i+r*r+s*s)}function x(t,e){let i=e[0]-t[0],r=e[1]-t[1],s=e[2]-t[2];return i*i+r*r+s*s}function w(t){let e=t[0],i=t[1],r=t[2];return e*e+i*i+r*r}function z(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function I(t,e=t){let i=e[0],r=e[1],s=e[2],n=i*i+r*r+s*s;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n),t}function S(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function P(t,e,i){let r=e[0],s=e[1],n=e[2],a=i[0],u=i[1],o=i[2];return t[0]=s*o-n*u,t[1]=n*a-r*o,t[2]=r*u-s*a,t}function v(t,e,i,r){let s=e[0],n=e[1],a=e[2];return t[0]=s+r*(i[0]-s),t[1]=n+r*(i[1]-n),t[2]=a+r*(i[2]-a),t}function F(t,e,i){let r=e[0],s=e[1],n=e[2];return t[0]=i[0]*r+i[4]*s+i[8]*n+i[12],t[1]=i[1]*r+i[5]*s+i[9]*n+i[13],t[2]=i[2]*r+i[6]*s+i[10]*n+i[14],t}function b(t,e,i){let r=e[0],s=e[1],n=e[2];return t[0]=r*i[0]+s*i[3]+n*i[6],t[1]=r*i[1]+s*i[4]+n*i[7],t[2]=r*i[2]+s*i[5]+n*i[8],t}function R(t,e,i){return C(t,e,i[0],i[1],i[2],i[3])}function C(t,e,i,r,s,n){let a=e[0],u=e[1],o=e[2],l=r*o-s*u,h=s*a-i*o,c=i*u-r*a,f=r*c-s*h,d=s*l-i*c,p=i*h-r*l,m=2*n;return t[0]=a+l*m+2*f,t[1]=u+h*m+2*d,t[2]=o+c*m+2*p,t}const N=(0,r.vt)(),q=(0,r.vt)();function O(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function A(t,e){if(t===e)return!0;let i=t[0],r=t[1],n=t[2],a=e[0],u=e[1],o=e[2],l=(0,s.FD)();return Math.abs(i-a)<=l*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-u)<=l*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-o)<=l*Math.max(1,Math.abs(n),Math.abs(o))}function E(t,e,i){let r=i[0]-e[0],s=i[1]-e[1],n=i[2]-e[2],a=r*r+s*s+n*n;return a>0?(a=1/Math.sqrt(a),t[0]=r*a,t[1]=s*a,t[2]=n*a,t):(t[0]=0,t[1]=0,t[2]=0,t)}const T=l,G=h,k=c,Q=g,D=x,Z=n,B=w;Object.freeze(Object.defineProperty({__proto__:null,abs:f,add:o,angle:function(t,e){I(N,t),I(q,e);let i=S(N,q);return i>1?0:i<-1?Math.PI:Math.acos(i)},bezier:function(t,e,i,r,s,n){let a=1-n,u=a*a,o=n*n,l=u*a,h=3*n*u,c=3*o*a,f=o*n;return t[0]=e[0]*l+i[0]*h+r[0]*c+s[0]*f,t[1]=e[1]*l+i[1]*h+r[1]*c+s[1]*f,t[2]=e[2]*l+i[2]*h+r[2]*c+s[2]*f,t},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},clamp:function(t,e=0,i=1){return t[0]=Math.min(Math.max(t[0],e),i),t[1]=Math.min(Math.max(t[1],e),i),t[2]=Math.min(Math.max(t[2],e),i),t},copy:a,cross:P,crossAndNormalize:function(t,e,i){let r=e[0],s=e[1],n=e[2],a=i[0],u=i[1],o=i[2],l=s*o-n*u,h=n*a-r*o,c=r*u-s*a,f=Math.sqrt(l*l+h*h+c*c);return t[0]=l/f,t[1]=h/f,t[2]=c/f,t},direction:E,dist:Q,distance:g,div:k,divide:c,dot:S,equals:A,exactEquals:O,floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},hermite:function(t,e,i,r,s,n){let a=n*n,u=a*(2*n-3)+1,o=a*(n-2)+n,l=a*(n-1),h=a*(3-2*n);return t[0]=e[0]*u+i[0]*o+r[0]*l+s[0]*h,t[1]=e[1]*u+i[1]*o+r[1]*l+s[1]*h,t[2]=e[2]*u+i[2]*o+r[2]*l+s[2]*h,t},inverse:M,len:Z,length:n,lerp:v,max:m,min:p,mul:G,multiply:h,negate:z,normalize:I,random:function(t,e=1){let i=s.Ov,r=2*i()*Math.PI,n=2*i()-1,a=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=n*e,t},rotateX:function(t,e,i,r){let s=[],n=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],n[0]=s[0],n[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),n[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},rotateY:function(t,e,i,r){let s=[],n=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],n[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),n[1]=s[1],n[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},rotateZ:function(t,e,i,r){let s=[],n=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],n[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),n[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),n[2]=s[2],t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},scale:_,scaleAndAdd:y,scaleTo:function(t,e){return _(t,t,e/Z(t))},set:u,sign:d,sqrDist:D,sqrLen:B,squaredDistance:x,squaredLength:w,str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},sub:T,subtract:l,transformMat3:b,transformMat4:F,transformMat4Z:function(t,e){return e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]},transformQuat:R,transformQuatValues:C},Symbol.toStringTag,{value:"Module"})),i.d(e,["Il",0,Z,"jb",0,T,"lo",0,D,"uE",0,B])},69397(t,e,i){i.d(e,{Qf:()=>u,Qh:()=>n,lM:()=>s});var r=i(34275);function s(t){if(!t)return 0;let e=l;for(let i in t)t.hasOwnProperty(i)&&(e+=a(t[i],!1));return e}function n(t){if(!t)return 0;if("number"==typeof t[0])return u(t);if(Array.isArray(t))return function(t){let e=t.length;if(0===e||"number"==typeof t[0])return o(t,8);let i=h;for(let r=0;r<e;r++)i+=a(t[r]);return i}(t);let e=l;for(let i in t)t.hasOwnProperty(i)&&(e+=a(t[i]));return e}function a(t,e=!0){switch(typeof t){case"object":return e?n(t):l;case"string":return function(t){return 32+t.length}(t);case"number":return 16;case"boolean":return 4;default:return 8}}function u(...t){return t.reduce((t,e)=>t+(e?(0,r.iu)(e)?e.byteLength+c:Array.isArray(e)?o(e,16):0:0),0)}function o(t,e){return h+t.length*e}const l=32,h=16,c=145},36745(t,e,i){i.d(e,{z:()=>u});var r=i(4718),s=i(51118),n=i(60408),a=i(92722);class u{static fromOptimized(t,e,i=1){return(new o).initialize(t,e,i)}static fromJSON(t){let[e,i]=h(t),r=(0,n.Pv)(t),s=(0,n.W0)(t);return(new c).initialize(e,i,r,s,1)}static fromOptimizedCIM(t,e,i=1){return(new f).initialize(t,e,i)}static fromJSONCIM(t,e=1){let[i,r]=h(t),s=(0,n.Pv)(t),a=(0,n.W0)(t);return(new d).initialize(i,r,s,a,e)}static fromFeatureSetReader(t){let e=t.readGeometryForDisplay(),i=t.geometryType;return e&&i?this.fromOptimized(e,i):null}static fromFeatureSetReaderCIM(t){let e=t.readGeometryForDisplay(),i=t.geometryType;return e&&i?this.fromOptimizedCIM(e,i):null}static createEmptyOptimized(t,e=!1,i=!1,r=1){return(new f).initialize(new a.A([],[],e,i),t,r)}static createEmptyJSON(t,e=!1,i=!1){return(new c).initialize([],t,e,i,1)}static createEmptyOptimizedCIM(t,e=!1,i=!1,r=1){return(new f).initialize(new a.A([],[],e,i),t,r)}static createEmptyJSONCIM(t,e=!1,i=!1,r=1){return(new d).initialize([],t,e,i,r)}asJSON(){let t=(0,s.x)(this),{hasZ:e,hasM:i}=this;return"esriGeometryEnvelope"===this.geometryType?{xmin:t[0][0][0],ymin:t[0][0][1],xmax:t[0][2][0],ymax:t[0][2][1]}:"esriGeometryMultipoint"===this.geometryType?{points:t.flat(),hasZ:e,hasM:i}:"esriGeometryPoint"===this.geometryType?{x:t[0][0][0],y:t[0][0][1],z:e?t[0][0][2]:void 0,m:i?t[0][0][e?3:2]:void 0}:"esriGeometryPolygon"===this.geometryType?{rings:t,hasZ:e,hasM:i}:{paths:t,hasZ:e,hasM:i}}getCurrentRingArea(){if(this.pathSize<3)return 0;let t,e,i=0;if(this.seekPathStart(),!this.nextPoint())return 0;t=this.x,e=this.y;let r=t,s=e;for(;this.nextPoint();)i+=(t-this.x)*(e+this.y),t=this.x,e=this.y;return i+=(t-r)*(e+s),-.5*i}invertY(){this.yFactor*=-1}}class o extends u{constructor(){super(...arguments),this._end=-1}get hasZ(){return this._geometry?.hasZ}get hasM(){return this._geometry?.hasM}initialize(t,e,i){return this.geometryType=e,this._stride=t.stride,this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=i,this}reset(){this.initialize(this._geometry,this.geometryType,this.yFactor)}seekPath(t){if(t>=0&&t<this.totalSize){if(this._pathIndex<t)for(;this._pathIndex<t&&this.nextPath(););else if(this._pathIndex>t)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){let e=this._pathOffset+t*this._stride;return e>=0&&e<this._end&&(this._pointOffset=e,!0)}nextPoint(){return(this._pointOffset+=this._stride)<this._end}prevPoint(){return(this._pointOffset-=this._stride)>=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1||(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,0))}prevPath(){return!(this.pathIndex<=0||(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,0))}getCurrentPath(){let t=this._end,e=this._geometry.coords,i=this._pathOffset;return(new o).initialize(new a.A([this.pathSize],e.slice(i,t),this.hasZ,this.hasM),this.geometryType,this.yFactor)}pathLength(){let t=this._end,e=this._stride,i=this._geometry.coords,r=0;for(let s=this._pathOffset+e;s<t;s+=e){let t=i[s-e],n=i[s-e+1],a=i[s]-t,u=i[s+1]-n;r+=Math.sqrt(a*a+u*u)}return r}startPath(){this._geometry.lengths.push(0)}pushPath(t){this.startPath(),this.pushPoints(t)}pushPoint(t){for(let e=0;e<this._stride;++e)this._geometry.coords.push(t[e]);this._geometry.lengths[this.totalSize-1]++}pushXY(t,e){this._geometry.coords.push(t,e),this._geometry.lengths[this.totalSize-1]++}pushPoints(t){for(let e of t)for(let t=0;t<this._stride;++t)this._geometry.coords.push(e[t]);this._geometry.lengths[this.totalSize-1]+=t.length}pushCursor(t){let e=t.asOptimized();this._geometry.coords.push(...e.coords),this._geometry.lengths.push(...e.lengths)}asOptimized(){let t=this._geometry.clone();if(1!==this.yFactor)for(let e=1;e<t.coords.length;e+=this._stride)t.coords[e]*=this.yFactor;return"esriGeometryPoint"===this.geometryType&&(t.lengths.length=0),t}isClosed(){let t=this._geometry.coords,e=this._pathOffset,i=this._end-this._stride;for(let r=0;r<this._stride;r++)if(t[e+r]!==t[i+r])return!1;return!0}clone(){return(new o).initialize(this._geometry.clone(),this.geometryType,this.yFactor)}get totalPoints(){return this._geometry.isPoint?1:this._geometry.lengths.reduce((t,e)=>t+e)}get pathSize(){let{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){let t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}}function l(t){let e=[t.x,t.y];return t.z&&e.push(t.z),t.m&&e.push(t.m),e}function h(t){return(0,n.Bi)(t)?[t.rings,"esriGeometryPolygon"]:(0,n.Rg)(t)?[t.paths,"esriGeometryPolyline"]:(0,n.U9)(t)?[[t.points],"esriGeometryMultipoint"]:(0,n.ZC)(t)?[[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]],"esriGeometryEnvelope"]:(0,n.fT)(t)?[[[l(t)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}class c extends u{initialize(t,e,i,r,s){return this._paths=t,this.geometryType=e,this.hasZ=i,this.hasM=r,this._pathIndex=this._pointIndex=-1,this.yFactor=s,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t<this.totalSize&&(this._currentPath=this._paths[t],!0)}seekPathStart(){this._pointIndex=-1}seekPathEnd(){this._pointIndex=this._currentPath.length}seekInPath(t){return t>=0&&t<this._currentPath.length&&(this._pointIndex=t,this._currentPoint=this._currentPath[this._pointIndex],!0)}nextPoint(){return this._currentPoint=this._currentPath[++this._pointIndex],this._pointIndex<this._currentPath.length}prevPoint(){return this._currentPoint=this._currentPath[--this._pointIndex],this._pointIndex>=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex<this.totalSize}prevPath(){return this.pathIndex>0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){let t=this._currentPath.length,e=this._currentPath,i=0;for(let r=1;r<t;r++){let t=e[r-1],s=e[r],n=t[0],a=t[1],u=s[0]-n,o=s[1]-a;i+=Math.sqrt(u*u+o*o)}return i}startPath(){this._paths.push([])}getCurrentPath(){return(new c).initialize([this._currentPath],this.geometryType,this.hasZ,this.hasM,this.yFactor)}pushPath(t){this._paths.push(t)}pushPoint(t){this._paths[this.totalSize-1].push(t)}pushXY(t,e){this._paths[this.totalSize-1].push([t,e])}pushPoints(t){this._paths[this.totalSize-1].push(...t)}pushCursor(t){let e=(0,s.x)(t);for(let t of e)this.pushPath(t)}asOptimized(){let{hasZ:t,hasM:e}=this,i=new a.A([],[],t,e),{coords:r,lengths:s}=i;if("esriGeometryPoint"===this.geometryType)r.push(...this._paths[0][0]),s.length=0;else for(let i of this._paths){for(let s of i)r.push(s[0]),r.push(s[1]*this.yFactor),t&&r.push(s[2]),e&&r.push(s[this._mIndex]);s.push(i.length)}return i}isClosed(){let t=this._currentPath[0],e=this._currentPath[this._currentPath.length-1];for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}clone(){return(new c).initialize((0,r.o8)(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}get totalPoints(){return this._paths.map(t=>t.length).reduce((t,e)=>t+e)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}}class f extends o{initialize(t,e,i){return super.initialize(t,e,i),this._controlPoints||=this._controlPoints=Array(this.totalSize).fill(void 0).map(t=>new Set),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){let t=(new f).initialize(this._geometry.clone(),this.geometryType,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}}class d extends c{initialize(t,e,i,r,s){return super.initialize(t,e,i,r,s)}clone(){return(new d).initialize((0,r.o8)(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][4]=1}getControlPoint(){return 1===this._paths[this.pathIndex][this._pointIndex][4]}setControlPointAt(t){this._paths[this.pathIndex][t][4]=1}getControlPointAt(t){return 1===this._paths[this.pathIndex][t][4]}}},4197(t,e,i){i.d(e,{Vj:()=>h,cj:()=>l,jh:()=>n,l5:()=>u,yH:()=>o});var r=i(34275),s=i(9093);function n(t){return t<=1024?Array(t).fill(0):new Float64Array(t)}function a(t){return((0,r.iu)(t)?t.byteLength/8:t.length)<=1024?Array.from(t):new Float64Array(t)}function u(t,e,i){return Array.isArray(t)?t.slice(e,e+i):t.subarray(e,e+i)}function o(t,e){if(0===e.length)return a(t);if(0===t.length)return a(e);let i=n(t.length+e.length);for(let e=0;e<t.length;++e)i[e]=t[e];for(let r=0;r<e.length;++r)i[t.length+r]=e[r];return i}function l(t){return[...t]}function h(t){let e=(0,s.vt)();for(let i=0;i<16;++i)e[i]=t[i];return e}},70328(t,e,i){i.d(e,{BI:()=>F,C:()=>a,DC:()=>f,Ej:()=>x,Ie:()=>P,Jt:()=>v,Lu:()=>z,Ne:()=>M,RF:()=>c,TF:()=>y,VL:()=>p,aI:()=>R,fA:()=>u,gE:()=>l,gX:()=>g,hZ:()=>S,iT:()=>d,is:()=>b,pg:()=>w,uJ:()=>_,vI:()=>I,vY:()=>o,vt:()=>n,w1:()=>h,yr:()=>m}),i(35522);var r=i(5443),s=(i(19419),i(4197));function n(t=N){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function a(t,e){for(let i=0;i<6;i++)t[i]=e[i];return t}function u(t,e,i,r,s,a,u=n()){return u[0]=t,u[1]=e,u[2]=i,u[3]=r,u[4]=s,u[5]=a,u}function o(t,e=n()){return function(t,e,i,r=n()){return S(r,C),function(t,e,i=0,r=e.length/3){let s=t[0],n=t[1],a=t[2],u=t[3],o=t[4],l=t[5];for(let t=0;t<r;t++)s=Math.min(s,e[i+3*t]),n=Math.min(n,e[i+3*t+1]),a=Math.min(a,e[i+3*t+2]),u=Math.max(u,e[i+3*t]),o=Math.max(o,e[i+3*t+1]),l=Math.max(l,e[i+3*t+2]);t[0]=s,t[1]=n,t[2]=a,t[3]=u,t[4]=o,t[5]=l}(r,t,e,i),r}(t,0,t.length/3,e)}function l(t,e=(0,s.jh)(24)){let[i,r,n,a,u,o]=t;return e[0]=i,e[1]=r,e[2]=n,e[3]=i,e[4]=r,e[5]=o,e[6]=i,e[7]=u,e[8]=n,e[9]=i,e[10]=u,e[11]=o,e[12]=a,e[13]=r,e[14]=n,e[15]=a,e[16]=r,e[17]=o,e[18]=a,e[19]=u,e[20]=n,e[21]=a,e[22]=u,e[23]=o,e}function h(t,e){return isFinite(t[2])||isFinite(t[5])?new r.A({xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}):new r.A({xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function c(t,e,i=t){i[0]=Math.min(t[0],e[0]),i[1]=Math.min(t[1],e[1]),i[2]=Math.min(t[2],e[2]),i[3]=Math.max(t[3],e[3]),i[4]=Math.max(t[4],e[4]),i[5]=Math.max(t[5],e[5])}function f(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[3]=Math.max(t[3],e[2]),t[4]=Math.max(t[4],e[3])}function d(t,[e,i,r]){!function(t,e,i,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.min(t[2],r),t[3]=Math.max(t[3],e),t[4]=Math.max(t[4],i),t[5]=Math.max(t[5],r)}(t,e,i,r)}function p(t){return t[0]>=t[3]?0:t[3]-t[0]}function m(t){return t[1]>=t[4]?0:t[4]-t[1]}function _(t){return t[2]>=t[5]?0:t[5]-t[2]}function y(t){let e=p(t),i=_(t),r=m(t);return e*e+i*i+r*r}function g(t,e=[0,0,0]){return e[0]=t[0]+p(t)/2,e[1]=t[1]+m(t)/2,e[2]=t[2]+_(t)/2,e}function x(t,e=[0,0,0]){return e[0]=p(t),e[1]=m(t),e[2]=_(t),e}function w(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function z(t,e){return e[0]=t[3],e[1]=t[4],e[2]=t[5],e}function M(t,e,i=t){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i!==t&&(i[3]=t[3],i[4]=t[4],i[5]=t[5]),i}function I(t,e,i=t){return i[3]=e[0],i[4]=e[1],i[5]=e[2],i!==t&&(i[0]=t[0],i[1]=t[1],i[2]=t[2]),t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function P(t){return t?S(t,C):n(C)}function v(t,e){return t[0]=e[0],t[1]=e[1],t[2]=-1/0,t[3]=e[2],t[4]=e[3],t[5]=1/0,t}function F(t,e,i,r,s){return t[0]=e,t[1]=i,t[2]=-1/0,t[3]=r,t[4]=s,t[5]=1/0,t}function b(t){return 6===t.length}function R(t,e,i){if(null==t||null==e)return t===e;if(!b(t)||!b(e))return!1;if(i){for(let r=0;r<t.length;r++)if(!i(t[r],e[r]))return!1}else for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const C=[1/0,1/0,1/0,-1/0,-1/0,-1/0],N=[0,0,0,0,0,0];n(),i.d(e,["qv",0,C,"v_",0,N])},78957(t,e,i){i.d(e,{d:()=>h,R:()=>z});class r{constructor(t=s){this._data=[],this._compare=t}get size(){return this._data.length}enqueue(t){if(null==t)return;let{_data:e,_compare:i}=this;e.push(t);let r=e.length-1>>>0,s=e[r];for(;r>0;){let t=r-1>>1,n=e[t];if(!(i(n,s)<=0))break;e[t]=s,e[r]=n,r=t}}dequeue(){let{_data:t,_compare:e}=this,i=t[0],r=t.pop();if(0===t.length)return i;t[0]=r;let s,n,a=0,u=t.length,o=t[0],l=null;for(;;){let i=2*a+1,r=2*a+2;if(l=null,i<u&&(s=t[i],e(s,o)>0&&(l=i)),r<u&&(n=t[r],(null===l&&e(n,o)<=0||null!==l&&e(n,s)<=0)&&(l=r)),null===l)break;t[a]=t[l],t[l]=o,a=l}return i}}const s=(t,e)=>t<e?-1:+(t>e);var n=i(19419),a=i(537),u=i(12359),o=i(95108),l=i(12176);function h(t){if(0===t.totalSize)return null;let e=(0,a.z8)(t);if(!e)return null;let i=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*222045e-19,r=0,s=0;t.reset();for(let e=0;t.nextPath();e++){let i=t.getCurrentRingArea();i>s&&(s=i,r=e)}if(t.seekPath(r),0===t.pathSize)return null;t.seekPathStart();let o=(0,a.B$)(t);if(Math.abs(s)<=2*i*i)return[(o[0]+o[2])/2,(o[1]+o[3])/2];t.seekPathStart();let l=(0,u.w2)(t,(0,n.vt)());if(null===l)return null;if(t.totalPoints<4)return l;let h=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],p=[NaN,NaN,NaN,NaN],m=[NaN,NaN,NaN,NaN],_=!1,w=f(l,t,!0);0===w.distance&&(_=!0,h[0][0]=l[0],h[0][1]=l[1],w=f(l,t,!1)),p[0]=w.distance,m[0]=0;let z=[NaN,NaN],M=!1,I=.25,S=-1,P=NaN;do{if(P=NaN,h[1]=d(t,y(o[0],o[2],I),0,e),!isNaN(h[1][0])&&!isNaN(h[1][1])&&(w=f(h[1],t,!1),P=w.distance),!isNaN(P)&&P>i&&c(h[1],t))M=!0,p[1]=P,m[1]=g(h[1],l);else if(!isNaN(P)&&P>S&&(S=P,z[0]=h[1][0],z[1]=h[1][1]),I-=.01,I<.1){if(!(S>=0))break;M=!0,p[1]=S,h[1][0]=z[0],h[1][1]=z[1],m[1]=g(h[1],l)}}while(!M);M=!1,I=.5,S=-1;let v=.01,F=1;do{if(P=NaN,h[2]=d(t,y(o[0],o[2],I),0,e),!isNaN(h[2][0])&&!isNaN(h[2][1])&&(w=f(h[2],t,!1),P=w.distance),!isNaN(P)&&P>i&&c(h[2],t))M=!0,p[2]=P,m[2]=g(h[2],l);else if(!isNaN(P)&&P>S)S=P,z[0]=h[2][0],z[1]=h[2][1];else if(P>S&&(S=P,z[0]=h[2][0],z[1]=h[2][1]),I=.5+v*F,v+=.01,F*=-1,I<.3||I>.7){if(!(S>=0))break;M=!0,p[2]=S,h[2][0]=z[0],h[2][1]=z[1],m[2]=g(h[2],l)}}while(!M);M=!1,I=.75,S=-1;do{if(P=NaN,h[3]=d(t,y(o[0],o[2],I),0,e),!isNaN(h[3][0])&&!isNaN(h[3][1])&&(w=f(h[3],t,!1),P=w.distance),!isNaN(P)&&P>i&&c(h[3],t))M=!0,p[3]=P,m[3]=g(h[3],l);else if(P>S&&(S=P,z[0]=h[3][0],z[1]=h[3][1]),I+=.01,I>.9){if(!(S>=0))break;M=!0,p[3]=S,h[3][0]=z[0],h[3][1]=z[1],m[3]=g(h[3],l)}}while(!M);let b,R=[0,1,2,3],C=+!_;for(let t=C;t<4;t++)for(let t=C;t<3;t++){let e=m[t],i=m[t+1];x(e,i)>0&&(b=R[t],R[t]=R[t+1],R[t+1]=b,m[t]=i,m[t+1]=e)}let N=C,q=0,O=0;for(let t=C;t<4;t++){switch(t){case 0:O=2*p[R[t]];break;case 1:O=1.66666666*p[R[t]];break;case 2:O=1.33333333*p[R[t]];break;case 3:O=p[R[t]]}O>q&&(q=O,N=R[t])}return h[N]}function c(t,e){let i,r,s,n,a=0;for(e.reset();e.nextPath()&&e.nextPoint();)for(i=e.x,r=e.y;e.nextPoint();i=s,r=n)s=e.x,n=e.y,r>t[1]!=n>t[1]&&((s-i)*(t[1]-r)-(n-r)*(t[0]-i)>0?a++:a--);return 0!==a}function f(t,e,i){if(i&&c(t,e))return{coord:t,distance:0};let r=1/0,s=0,n=0,a=[0,0],u=[0,0],l=[0,0];for(e.reset();e.nextPath()&&e.nextPoint();)if(!(e.pathSize<2))for(a[0]=e.x,a[1]=e.y;e.nextPoint();a=u){u=[e.x,e.y],(0,o.gR)(l,t,a,u);let i=g(t,l);i<r&&(r=i,s=l[0],n=l[1])}return{coord:[s,n],distance:Math.sqrt(r)}}function d(t,e,i,r){let s=[e,0],a=1/0,u=1/0,o=!1,h=!1,c=[[e,r[1]-1],[e,r[3]+1]],f=[0,0],d=[0,0],_=[0,0],y=[[0,0],[0,0]],g=(0,n.vt)();for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(y[0][0]=t.x,y[0][1]=t.y;t.nextPoint();y[0][0]=y[1][0],y[0][1]=y[1][1]){if(y[1][0]=t.x,y[1][1]=t.y,null===p(g,y)||(d[0]=c[0][0],d[1]=c[0][1],_[0]=c[1][0],_[1]=c[1][1],0===m(g,d,_))||!(0,l.Ql)(c[0],c[1],y[0],y[1],f))continue;let e=f[1];a>u?e<a&&(a=e,o=!0):e<u&&(u=e,h=!0)}return o&&h?s[1]=(a+u)/2:s[0]=s[1]=NaN,s}function p(t,e){if(e.length<2)return null;t||=(0,n.vt)();let[i,r]=e[0],[s,a]=e[1];return t[0]=Math.min(i,s),t[1]=Math.min(r,a),t[2]=Math.max(i,s),t[3]=Math.max(r,a),t}function m(t,e,i){let r=_(e,t),s=_(i,t),n=t[0],a=t[1],u=t[2],o=t[3];if(r&s)return 0;if(!(r|s))return 4;let l=!!r|(s?2:0);do{let l=i[0]-e[0],h=i[1]-e[1];if(l>h)3&r?(1&r?(e[1]+=h*(n-e[0])/l,e[0]=n):(e[1]+=h*(u-e[0])/l,e[0]=u),r=_(e,t)):3&s?(1&s?(i[1]+=h*(n-i[0])/l,i[0]=n):(i[1]+=h*(u-i[0])/l,i[0]=u),s=_(i,t)):r?(4&r?(e[0]+=l*(a-e[1])/h,e[1]=a):(e[0]+=l*(o-e[1])/h,e[1]=o),r=_(e,t)):(4&s?(i[0]+=l*(a-i[1])/h,i[1]=a):(i[0]+=l*(o-i[1])/h,i[1]=o),s=_(i,t));else if(12&r?(4&r?(e[0]+=l*(a-e[1])/h,e[1]=a):(e[0]+=l*(o-e[1])/h,e[1]=o),r=_(e,t)):12&s?(4&s?(i[0]+=l*(a-i[1])/h,i[1]=a):(i[0]+=l*(o-i[1])/h,i[1]=o),s=_(i,t)):r?(1&r?(e[1]+=h*(n-e[0])/l,e[0]=n):(e[1]+=h*(u-e[0])/l,e[0]=u),r=_(e,t)):(1&s?(i[1]+=h*(n-i[0])/l,i[0]=n):(i[1]+=h*(u-i[0])/l,i[0]=u),s=_(i,t)),r&s)return 0}while(r|s);return l}function _(t,e){return+(t[0]<e[0])|(t[0]>e[2])<<1|(t[1]<e[1])<<2|(t[1]>e[3])<<3}function y(t,e,i){return t+(e-t)*i}function g(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function x(t,e){if(t<e)return-1;if(t>e)return 1;if(t===e)return 0;let i=isNaN(t),r=isNaN(e);return i<r?-1:+(i>r)}class w{constructor(t,e,i,r){this.x=t,this.y=e,this.cellSize=i,this.distancefromCellCenter=(0,o.Xf)(t,e,r),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}function z(t){if(!t.nextPath()||!t.pathSize)return null;let e=(0,a.B$)(t),i=e[2]-e[0],s=e[3]-e[1];if(0===i||0===s)return[e[0]+i/2,e[1]+s/2];let n=Math.max(Math.min(i,s)/100,1),o=new r((t,e)=>e.maxDistanceToPolygon-t.maxDistanceToPolygon),l=Math.min(i,s),h=l/2,c=0,f=0;for(c=e[0];c<e[2];c+=l)for(f=e[1];f<e[3];f+=l)o.enqueue(new w(c+h,f+h,h,t));t.reset(),t.nextPath();let d=(0,u.IK)(t);if(null===d)return null;let p,m=new w(d[0],d[1],0,t);for(;o.size>0;)p=o.dequeue(),p.distancefromCellCenter>m.distancefromCellCenter&&(m=p),!(p.maxDistanceToPolygon-m.distancefromCellCenter<=n)&&(h=p.cellSize/2,o.enqueue(new w(p.x-h,p.y-h,h,t)),o.enqueue(new w(p.x+h,p.y-h,h,t)),o.enqueue(new w(p.x-h,p.y+h,h,t)),o.enqueue(new w(p.x+h,p.y+h,h,t)));return[m.x,m.y]}},62815(t,e,i){i.d(e,{N:()=>u,d:()=>o});var r=i(86211),s=i(73941),n=i(21325),a=i(52006);function u(t,e,i){let r=o(e,i);if(1!==r)switch(t){case"point":case"esriGeometryPoint":return t=>function(t,e){null!=t?.z&&(t.z*=e)}(t,r);case"polyline":case"esriGeometryPolyline":return t=>function(t,e){if(t){if(t.curvePaths)for(let i of t.curvePaths)for(let t of i){let i=(0,a.yP)(t);i.length>2&&(i[2]*=e)}if(t.paths)for(let i of t.paths)for(let t of i)t.length>2&&(t[2]*=e)}}(t,r);case"polygon":case"esriGeometryPolygon":return t=>function(t,e){if(t){if(t.curveRings)for(let i of t.curveRings)for(let t of i){let i=(0,a.yP)(t);i.length>2&&(i[2]*=e)}if(t.rings)for(let i of t.rings)for(let t of i)t.length>2&&(t[2]*=e)}}(t,r);case"multipoint":case"esriGeometryMultipoint":return t=>function(t,e){if(t)for(let i of t.points)i.length>2&&(i[2]*=e)}(t,r);case"extent":case"esriGeometryEnvelope":return t=>function(t,e){t&&null!=t.zmin&&null!=t.zmax&&(t.zmin*=e,t.zmax*=e)}(t,r);default:return}}function o(t,e){return null==t||null==e||(0,n.aI)(t,e)||(0,s.xP)(t)||(0,s.xP)(e)?1:(0,r.G9)(t)/(0,r.G9)(e)}},6557(t,e,i){i.r(e),i.d(e,{default:()=>j});var r=i(32198),s=i(21818),n=i(49186),a=i(71511),u=i(44208),o=i(53966),l=i(17676),h=i(563),c=i(39516),f=i(86211),d=i(16930),p=i(70328),m=i(19419),_=i(21325),y=i(53929),g=i(90708),x=i(29441),w=i(75752),z=i(99352),M=i(8384),I=i(58727),S=i(95031),P=i(24460),v=i(64714),F=i(17754),b=i(20437),R=i(95466),C=i(30524),N=i(50639),q=i(42760),O=i(76248),A=(i(98623),i(30661)),E=i(28923),T=i(44320),G=i(35258),k=i(16630);const Q=new A.Z,D="__OBJECTID",Z=8e3;class B{constructor(t,e){this._files=t,this._createFileStream=e,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(t){for(await this._fill(t);this._pending.size>0;){(0,l.Te)(t),await this._fill(t);let e=await W(this._pending);if(this._pending.delete(e.read),this._resolvedCount++,null!=e.chunk)return e.chunk}return null}async _fill(t){for(this._removeDone();this._pending.size<8;){let e=this._getOrCreateNextStream(t);if(null==e)return;this._pending.add(e.read(t))}}_getOrCreateNextStream(t){let e=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<e){let e=this._files[this._fileIndex++],i=new V(e.id,this._createFileStream(e,t));return this._streams.push(i),i}return this._getNextStream()}_getNextStream(){let t=this._streams.length;for(let e=0;e<t;e++){let i=(this._streamIndex+e)%t,r=this._streams[i];if(r.canRead)return this._streamIndex=(i+1)%t,r}return null}_removeDone(){let t=this._streamIndex;for(let e=this._streams.length-1;e>=0;e--)this._streams[e].done&&(this._streams.splice(e,1),e<t&&t--);this._streamIndex=this._streams.length>0?t%this._streams.length:0}}function W(t){return Promise.race(Array.from(t,async t=>({read:t,chunk:await t})))}class V{constructor(t,e){this._fileId=t,this._stream=e,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(t){this._readCount++;try{let e=await(await this._stream).next(t);return null==e?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:e}}finally{this._readCount--}}}class j{constructor(){this._hasZ=!1,this._hasM=!1,this._queue=new h.QueueProcessor({concurrency:4,process:(t,e)=>this._executeQuery(t,e)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new a.A}async load(t){let e=t.spatialReference?d.A.fromJSON(t.spatialReference):void 0;if(e&&!e.isWGS84&&!e.isWebMercator)throw new n.A("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=t.customParameters,this._loadParameters=t,await this._updateProvider((0,S.M)(t.provider,null,()=>this._customParameters));let i,r=await this._provider.getMetadata(),s=await(0,q.nc)(r,{fields:t.fields?.map(t=>b.A.fromJSON(t)),geometryEncoding:t.geometryEncoding?(0,N.G)(t.geometryEncoding):null,geometryType:t.geometryType?(0,q.hG)(t.geometryType):null,displayOptimization:t.displayOptimization,spatialReference:e});if(this._hasZ=!!r?.hasZ,this._hasM=!!r?.hasM,!s.fields)throw new n.A("parquet:unsupported","Fields must be defined");if(s.spatialReference&&s.geometryType){if(!s.spatialReference)throw new n.A("parquet:unsupported","SpatialReference must be defined");if(!s.spatialReference.isGeographic&&!s.spatialReference.isWebMercator)throw new n.A("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");s.spatialReference.isGeographic&&!s.spatialReference.isWGS84&&(o.A.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:s.spatialReference}),s.spatialReference=d.A.WGS84),i={geometry:s.geometryEncoding?{geometryType:(0,q.sA)(s.geometryType),spatialReference:s.spatialReference.toJSON(),encoding:s.geometryEncoding.toJSON()}:null,displayOptimization:s.displayOptimization}}this.setCustomParameters(t.customParameters),this._displayOptimization=s.displayOptimization,await this._provider.updateGeometryInfo(i),this._capabilities=rt(await this._getFileStatistics(),this._hasZ,this._hasM);let a=await this._provider.getFiles();if(!a.length)return{layerDefinition:{},capabilities:rt(null,this._hasZ,this._hasM)};let u=await a[0].file;s.file=u;let{fields:l}=s;if(null==l)throw new n.A("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",l);l.push(new b.A({name:D,type:"oid",alias:D}));for(let t of l){let e=u.getColumnId(t.name);null!=e&&(this._indexMap[t.name]=e)}let h=R.A.fromLayerJSON({fields:l.map(t=>t.toJSON()),dateFieldsTimeReference:{timeZoneIANA:"UTC"}});this._fieldsIndex=h;let c=(0,q.sA)(s.geometryType??"point");return this._metadata=G.i.createFeature({fieldsIndex:h.toJSON(),geometryType:c,hasZ:this._hasZ,hasM:this._hasM,featureIdInfo:{type:"object-id",fieldName:D},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:s.spatialReference,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:"UTC"}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:c,featureIdInfo:{type:"object-id",fieldName:D},hasM:this._hasM,hasZ:this._hasZ,spatialReference:s.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=r?.extent?r.extent:await this._tryDeriveParquetFullExtent(s),{capabilities:this._capabilities,layerDefinition:{fields:s.fields?.map(t=>t.toJSON()),drawingInfo:(0,v.F0)(c),extent:this._fullExtent??void 0,geometryType:c,geometryEncoding:s.geometryEncoding?.toJSON(),displayOptimization:s.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(let{handle:t}of this._streams.values())t.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(t){this.destroy(),await this.load(t)}set remoteClient(t){this._source=t.createInvokeProxy("")}setCustomParameters(t){this._customParameters=t}getIndexMap(){return this._indexMap}async updateFileProvider(t){this._loadParameters={...this._loadParameters,provider:t};let e=(0,S.M)(t,this._provider.getGeometryInfo(),()=>this._customParameters);await this._updateProvider(e)}async getDiagnosticsSnapshot(){let t=await this._provider.getFiles();return{files:await Promise.all(t.map(t=>t.getDiagnosticsSnapshot()))}}async getColumnIndex(t){return(await this._getFileInfoById(t.fileId)).getColumnIndex(t.rowGroupIndex,t.columnIndex)}async getOffsetIndex(t){return(await this._getFileInfoById(t.fileId)).getOffsetIndex(t.rowGroupIndex,t.columnIndex)}async queryFeatures(t,e){let i=await(0,I.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(i),function(t){return!!(t.objectIds?.length||t.outStatistics||t.orderByFields?.length||t.returnDistinctValues)}(i)||(i.resultRecordCount=i.resultRecordCount?Math.min(i.resultRecordCount,Z):Z,i.resultOffset=i.resultOffset??0),i.outStatistics?this._queryStatistics(i,e):(i.returnDistinctValues&&(i.returnGeometry=void 0),(await this._enqueueQuery(i,e)).createQueryResponse())}async queryFeatureCount(t,e){let i=await(0,I.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(i),H(i)||i.returnDistinctValues||i.groupByFieldsForStatistics?.length||i.outStatistics?.length?(i.returnDistinctValues||(i.outFields=void 0),i.returnGeometry=void 0,(await this._enqueueQuery(i,e)).createQueryResponseForCount()):this._getFeatureCount()}async queryObjectIds(t,e){let i=await(0,I.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(i),H(i)?(i.resultRecordCount=i.resultRecordCount?Math.min(i.resultRecordCount,8e3):8e3,i.resultOffset=i.resultOffset??0,i.returnGeometry=void 0,i.outFields=void 0,i.returnDistinctValues=void 0,(await this._enqueueQuery(i,e)).items.map(t=>t.getObjectId())):Array.from({length:await this._getFeatureCount()},(t,e)=>e)}async queryAttributeBins(t,e={}){throw new n.A("parquet:unsupported","queryAttributeBins not supported.")}async queryExtent(t,e){let i=await(0,I.T2)(t,null,this._queryEngineParams.spatialReference);if(this._validateQuery(i),this._fullExtent&&!H(i))return{count:await this._getFeatureCount(),extent:this._fullExtent};let r=(0,s.z)(this._metadata.spatialReference);i.returnGeometry=!0,i.outFields=void 0;let n=(0,p.hZ)((0,p.vt)(),p.qv),a=(0,p.vt)(),u=await this._enqueueQuery(i,e),o=0;for(let t of u.items)t.getBounds(a)&&((0,p.RF)(n,a),o+=1);return{count:o,extent:(0,w.Wc)(n,r,i.outSR?(0,s.z)(i.outSR):r.toJSON(),r,!1)}}async queryStream(t,e){if(!e.signal)throw Error("InternalError: AbortSignal must be passed");let i=await this._getCandidateFiles(t),r=new B(i,async(e,i)=>{let r=await e.file,s=await this._createParquetDisplayQuery(r,e.id,t);return r.executeQuery(s,Z,i)}),s=this._streamIdCounter++,n=(0,l.NY)(e.signal,t=>{let e=this._streams.get(s);null!=e&&(e.handle.remove(),this._streams.delete(s))});return this._streams.set(s,{stream:r,handle:n}),s}async getStreamNext(t,e){if(!e.signal)throw Error("InternalError: AbortSignal must be passed");let i=this._streams.get(t);if(!i)return{result:null};let r=await i.stream.next(e.signal);if(null==r)return i.handle.remove(),this._streams.delete(t),{result:null};let s=r.chunk.serialize().buffer,n={fileId:r.fileId,buffer:s};return s instanceof ArrayBuffer?{result:n,transferList:[s]}:{result:n}}async getStreamNextFeatures(t,e){let{result:i}=await this.getStreamNext(t,e);if(null==i)return null;let r=(await(0,O.N)()).ParquetChunk.deserialize(new Uint8Array(i.buffer)),s=new k.s(this._metadata,this._indexMap,r,i.fileId),n=[];for(;s.next();){let t=(0,g.zv)(s.readGeometryWorldSpace(),s.geometryType,s.hasZ,s.hasM),e=s.readAttributes();n.push({attributes:e,geometry:t})}return{features:n}}async createPatch(t,e,i,r,s){if(!s.signal)throw Error("InternalError: AbortSignal must be passed");return(await(await(await this._getFileInfoById(t)).file).createChunkPatch(e,i,r,s.signal)).serialize().buffer}async _updateProvider(t){let e=this._provider;this._handles.removeAll(),this._provider=t,this._handles.add([t.events.on("rangeRead",t=>{this._source.onRangeRead(t)}),t.events.on("sourceChanged",async()=>{await this.reload(this._loadParameters),await this._source.onSourceChange()})]),await(e?.destroy())}async _getCandidateFiles(t){let e=await this._provider.getFiles(),i=await this._getSpatialFilePruning(t);if(null==i)return e;let r=e.filter(t=>this._mayIncludeFileForSpatialPruning(t,i));return"xz"===i.type?function(t,e){return t.slice().sort((t,i)=>{let r=it(t,e),s=it(i,e);return r===s?0:r<s?-1:1})}(r,i):r}async _queryStatistics(t,e){let i=await(0,I.T2)({...t},null,this._queryEngineParams.spatialReference);if(i.returnGeometry=void 0,function(t,e){return!!t.outStatistics?.length&&!H(t)&&!t.groupByFieldsForStatistics?.length&&!t.orderByFields?.length&&!t.returnDistinctValues&&!t.returnAggIds&&t.outStatistics.every(t=>function(t,e){switch(t.statisticType){case"count":return"1"===t.onStatisticField||null!=e.get(t.onStatisticField);case"min":case"max":{let i=e.get(t.onStatisticField);return null!=i&&(0,C.WA)(i)}default:return!1}}(t,e))}(i,this._fieldsIndex)){let t=await this._getStatisticsFromFiles(i);if(t)return t}return(await this._enqueueQuery(i,e)).createQueryResponse()}async _getStatisticsFromFiles(t){let e=await this._provider.getFiles(),i={},r=[];for(let s of t.outStatistics??[]){let t=X(s,e);if(!t.available)return null;i[s.outStatisticFieldName]=t.value,r.push(Y(s,this._fieldsIndex))}return{fields:r,features:[{attributes:i}]}}async _getSpatialFilePruning(t){if("tile"!==t.type&&("arcade"!==t.type||null==t.extent))return null;let e=this._displayOptimization?.index;if(null==e)return null;let i=t.outSpatialReference.wkid;if(null==e.wkid||null==i)return null;let r=e.wkid,s=await(0,O.N)();switch(e.type){case"xz":return{type:"xz",fieldName:(0,y.FG)(e.code),intersects:(n,a)=>s.queryIntersectsXZStatistics(e.fullExtent,t.extent,i,r,e.maxLevel,n,a)};case"z":return{type:"xy",xFieldName:(0,y.FG)(e.xColumn),yFieldName:(0,y.FG)(e.yColumn),intersects:(e,n,a,u)=>s.queryIntersectsXYStatistics(t.extent,i,r,e,n,a,u)}}}_mayIncludeFileForSpatialPruning(t,e){switch(e.type){case"xz":{let i=et(t,e);return"null-only"!==i?.type&&("bounds"!==i?.type||e.intersects(i.minValue,i.maxValue))}case"xy":{let i=t.statistics.statistics.get(e.xFieldName),r=t.statistics.statistics.get(e.yFieldName);return"null-only"!==i?.type&&"null-only"!==r?.type&&("bounds"!==i?.type||"bounds"!==r?.type||e.intersects(i.minValue,i.maxValue,r.minValue,r.maxValue))}}}async _tryDeriveParquetFullExtent(t){if(!t.spatialReference)return null;if(null==this._fullExtent&&"location"===t.geometryEncoding?.type){let e=await this._provider.getFiles(),{xField:i,yField:s}=t.geometryEncoding,n=(0,p.hZ)((0,p.vt)(),p.qv),a=!1;for(let t of e){let e=await t.file;for(let t of e.rowGroups()){let e={stack:[],error:void 0,hasError:!1};try{let u=(0,r.mS)(e,t.columnDescriptorForAttribute(i),!1),o=(0,r.mS)(e,t.columnDescriptorForAttribute(s),!1),l=(0,P.Hk)(u),h=(0,P.Hk)(o);if("bounds"===l?.type&&"bounds"===h?.type){let t=[l.minValue,h.minValue,l.maxValue,h.maxValue];(0,p.DC)(n,t),a=!0}t.free()}catch(t){e.error=t,e.hasError=!0}finally{(0,r.hk)(e)}}}return a?{xmin:n[0],ymin:n[1],xmax:n[3],ymax:n[4],spatialReference:t.spatialReference?.toJSON()}:null}return null}async _getFileInfoById(t){let e=await this._provider.getFiles();for(let i of e)if(i.id===t)return i;throw Error(`InternalError: File ${t} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(t){return(await this._getFileInfoById(t)).file}async _createParquetQuery(t,e,i,r,s){let n=(await(0,O.N)()).Query.new();null!=i&&n.setPreFilterStart(i),null!=r&&n.setPreFilterCount(r),null!=s&&n.setPostFilterCount(s);let a=await this._getRequiredFields(t);n.setOutFields(a),(t.geometry||t.returnGeometry)&&n.setReturnGeometry(!0),n.setReturnZ(!!t.returnZ),n.setReturnM(!!t.returnM);let u=this._tryGetGeneralizedGeometryResolution(t);null!=u&&n.setSourceResolution(u);let o=t.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=o.wkid;if(t.geometry&&((0,_.K8)(o)||(0,_.oT)(o))){let e=(0,m.C)((0,m.vt)(),m.qv);for(let i of(0,w.qo)(t.geometry))(0,m.DC)(e,i);n.setOutSpatialReference(l),n.setExtent({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]})}if(t.where){let{id:i,file:r}=e;await this._setWhereClause(n,await r,i,t.where)}return n}async _createParquetDisplayQuery(t,e,i){let r=(await(0,O.N)()).Query.new();if("tile"===i.type){r.setExtent(i.extent),r.setQuantizationTransform(i.transform);let t=this._sourceResolution(i.resolution,i.outSpatialReference);null!=t&&r.setSourceResolution(t)}else"arcade"===i.type&&null!=i.extent&&r.setExtent(i.extent);return r.setOutFields(i.outFields.filter(t=>null!=this._indexMap[t])),r.setOutSpatialReference(i.outSpatialReference.wkid),r.setReturnGeometry(i.returnGeometry),r.setReturnZ(i.returnZ),r.setReturnM(i.returnM),i.where&&await this._setWhereClause(r,t,e,i.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(t=>t.statistics.rowCount).reduce((t,e)=>t+e,0)}async _getByteLength(){return(await this._provider.getFiles()).map(t=>t.statistics.byteSize).reduce((t,e)=>t+e,0)}_validateQuery(t){if(!this._capabilities.query.supportsStatistics&&t.outStatistics)throw new n.A("parquet:unsupported","Statistics queries are not supported",{query:t});if(!this._capabilities.query.supportsOrderBy&&t.orderByFields?.length)throw new n.A("parquet:unsupported","Queries using orderBy are not supported",{query:t});if(!this._capabilities.query.supportsDistinct&&t.returnDistinctValues)throw new n.A("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:t})}async _setWhereClause(t,e,i,r){let s=this._indexMap,a=this._fieldsIndex,u={getAttribute(t,r){let n=s[r];if(null==n){if("__OBJECTID"===a.get(r)?.name){let e=t.row+t.rowGroupStart;return(0,F.xb)(i,e)}return null}let u=a.get(r);return(0,y.LC)(e,t.rowGroup,t.row,n,u.type)}},o=await(0,c.GP)(r,this._fieldsIndex);if(!o.isStandardized)throw new n.A("sql-parse-error","expression is not standardized");let l=o.fieldNames.map(t=>a.get(t)).filter(t=>t&&null!=this._indexMap[t?.name]);t.setWhere(r),t.setWhereEvaluator((t,e,i)=>o.testFeatureCompiled({rowGroup:t,row:e,rowGroupStart:i},u,null)),t.setWhereFields(l.map(t=>t.name))}async*_streamFeatures(t,e,i,r,s){let n=await this._provider.getFiles(),a=0;for(let u of n){let n=a,o=a+u.statistics.rowCount;if(a+=u.statistics.rowCount,null!=e&&e>=o)continue;let l=null==e?null:Math.max(e-n,0),h=i;if(null!=i){let t=e??0,r=t+i;h=Math.max(Math.min(r,o)-Math.max(t,n),0)}if(0===h)continue;let c=await this._createParquetQuery(t,u,l,h,r),f=await(await u.file).executeQuery(c,Z),d=async()=>{let t=await f.next(s);if(!t)return null;let e=new k.s(this._metadata,this._indexMap,t,u.id);return tt([new E.j(e,null,0,!1)],this._queryEngineParams)},p=await d();for(;null!=p;)yield p,p=await d()}}async _queryFeaturesWithQueryEnginePagination(t,e){let i=[],r=this._streamFeatures(t,null,null,null,e),s=await r.next();for(;!s.done;){let n=await s.value.executeQueryForOpaqueFeatures({...t,where:void 0},e);for(let t of n)i.push(t);s=await r.next()}return i}async _queryFeaturesWithUpfrontPagination(t,e){let i,r,s,n=t.resultOffset??0,a=t.resultRecordCount??Z;!function(t){for(let e in t){let i=e;if(J(i)&&null!==t[i])return!0}return!1}(t)?(n&&=(i=n,0),r=t.resultRecordCount):function(t){for(let e in t){let i=e;if(U(i)&&null!==t[i])return!0}return!1}(t)||(s=n+a);let u=[],o=this._streamFeatures(t,i,r,s,e),l=await o.next();for(;!l.done&&a>0;){let i=await l.value.executeQueryForOpaqueFeatures({...t,where:void 0},e);for(let t of i)if(n>0)n--;else if(u.push(t),--a<=0)return u;l=await o.next()}return u}_enqueueQuery(t,e){return this._queue.push(t,e)}async _executeQuery(t,e){if(t.objectIds?.length){let i=new Map;for(let e of t.objectIds){let t=(0,F.wY)(e),r=(0,F.gE)(e),s=i.get(t);s||(s=[],i.set(t,s)),s.push(r)}let r=[];for(let[s,n]of i.entries()){let i=await this._executeFileIdQuery(t,s,n,e);for(let t of i)r.push(t)}return new M.G(r,t,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:Q,featureIdInfo:this._queryEngineParams.featureIdInfo})}if("1=1"===t.where&&(t.where=null),t.resultOffset??=0,t.resultRecordCount??=await this._getFeatureCount(),t.resultRecordCount>2e7&&(!this._displayOptimization||!t.geometry))throw new n.A("parquet:cannot-execute-query","Unable to execute query, dataset is too large.");let i=!!t.orderByFields?.length||!!t.outStatistics?.length||!!t.returnDistinctValues,r=i?await this._queryFeaturesWithQueryEnginePagination(t,e):await this._queryFeaturesWithUpfrontPagination(t,e);return i||(t.resultOffset=0),new M.G(r,t,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:Q,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(t,e,i,r){let s=await this._getRequiredFields(t),n=(await(0,O.N)()).Query.new();n.setOutFields(s),n.setReturnGeometry(!!t.returnGeometry),n.setReturnZ(!!t.returnZ),n.setReturnM(!!t.returnM),n.setIds(new Uint32Array(i));let a=await(await this._getFile(e)).executeQuery(n,Z,r),u=await a.next(r),o=0,l=[];for(;null!=u;){let t=new k.s(this._metadata,this._indexMap,u,e),i=new E.j(t,null,o++,!1);l.push(i),u=await a.next(r)}return tt(l,this._queryEngineParams).executeQueryForOpaqueFeatures(t,r)}async _getRequiredFields(t){let e=new Set;if(t.outStatistics)for(let i of(0,x.g9)(this._fieldsIndex,t.outStatistics,t.groupByFieldsForStatistics))e.add(i);else if(t.outFields)for(let i of t.outFields)e.add(i);return(e.has("*")?this._fieldsIndex.fields.map(t=>t.name):Array.from(e)).filter(t=>null!=this._indexMap[t])}_tryGetGeneralizedGeometryResolution(t){if(!this._displayOptimization)return null;let e=t.outSR??this._queryEngineParams.spatialReference;if(!(0,_.K8)(e)&&!(0,_.oT)(e))return null;let i=t.quantizationParameters?.tolerance??t.maxAllowableOffset;return i?this._sourceResolution(i,e):null}_sourceResolution(t,e){let i=this._queryEngineParams.spatialReference,r=(0,f.GA)(e)/(0,f.GA)(i)*t;return!Number.isFinite(r)||r<=0?null:r}}function L(t){switch(t){case"fullText":case"having":case"timeExtent":case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"geometry":case"resultOffset":case"resultRecordCount":return!0;default:return!1}}function J(t){switch(t){case"fullText":case"having":case"timeExtent":case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"geometry":return!0;default:return!1}}function U(t){switch(t){case"fullText":case"having":case"timeExtent":return!0;case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"resultOffset":case"geometry":case"resultRecordCount":return!1}return!1}function H(t){for(let e in t){let i=e;if(L(i)&&null!==t[i])return!0}return!1}function Y(t,e){let i="exceedslimit"===t.statisticType?null:e.get(t.onStatisticField),r="min"!==t.statisticType&&"max"!==t.statisticType||"esriFieldTypeDate"!==i?.type?"esriFieldTypeDouble":i.type;return{name:t.outStatisticFieldName,alias:t.outStatisticFieldName,type:r}}function X(t,e){switch(t.statisticType){case"count":return function(t,e){if("count"!==t.statisticType)return{available:!1,value:null};if("1"===t.onStatisticField)return{available:!0,value:e.reduce((t,e)=>t+e.statistics.rowCount,0)};let i=0;for(let r of e){let e=r.statistics.statistics.get(t.onStatisticField);if(null==e||null==e.nullCount)return{available:!1,value:null};i+=r.statistics.rowCount-e.nullCount}return{available:!0,value:i}}(t,e);case"min":return $(t,e,Math.min);case"max":return $(t,e,Math.max);default:return{available:!1,value:null}}}function $(t,e,i){if("min"!==t.statisticType&&"max"!==t.statisticType)return{available:!1,value:null};let r=null,s="min"===t.statisticType?"minValue":"maxValue";for(let n of e){let e=n.statistics.statistics.get(t.onStatisticField);if(null==e)return{available:!1,value:null};switch(e.type){case"null-only":continue;case"unknown":return{available:!1,value:null};case"bounds":{let t=K(e[s]);if(null==t)return{available:!1,value:null};r=null==r?t:i(r,t);break}}}return{available:!0,value:r}}function K(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function tt(t,e){let i=new T.I;for(let e of t)i.insert(e);return new w.do({...e,featureStore:i})}function et(t,e){return t.statistics.statistics.get(e.fieldName)??null}function it(t,e){let i=et(t,e);return"bounds"===i?.type?i.maxValue-i.minValue:1/0}function rt(t,e,i){let r=t?.featureCount,s=!1;return null!=r&&r<(0,u.A)("parquetlayer-full-query-feature-count")&&(s=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:i,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...z.F,maxRecordCount:Z,supportsOrderBy:s,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1484],{66344(t,e,i){i.d(e,{q:()=>u});const r=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class s{get size(){return this._size}constructor(t=10485760,e=.3){this._maxSize=t,this._maxClientSizeRatio=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._clients=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._clients.clear(),this._db.clear()}register(t){this._clients.set(t.id.slice(0,-1),t)}deregister(t){this.clear(t),this._sizeLimits.delete(t),this._clients.delete(t.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,-1),this._checkSize()}get _maxClientSize(){return this._maxSize*this._maxClientSizeRatio}getSize(t,e){return this._db.get(t.id+e)?.size??0}put(t,e,i,s,a){e=t.id+e;let u=this._db.get(e);if(u&&(this._size-=u.size,t.size-=u.size,this._db.delete(e),u.entry!==i&&this._notifyRemove(e,u.entry,u.size,0)),s>this._maxSize)return void this._notifyRemove(e,i,s,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return r||console.warn(`Refusing to cache entry with size ${s} for key ${e}`),void this._notifyRemove(e,i,0,0);let o=1+Math.max(a,-4)- -3;this._db.set(e,new n(i,s,o)),this._size+=s,t.size+=s,this._checkSize()}updateSize(t,e){e=t.id+e;let i=this._db.get(e);if(!i)return;this._size-=i.size,t.size-=i.size;let r=i.entry.usedMemory;for(;r>this._maxSize;){let t=this._notifyRemove(e,i.entry,r,1);if(!(null!=t&&t>0))return void this._db.delete(e);r=t}i.size=r,this._size+=r,t.size+=r,this._checkSize()}pop(t,e){e=t.id+e;let i=this._db.get(e);if(i)return this._size-=i.size,t.size-=i.size,this._db.delete(e),++this._hit,i.entry;++this._miss}get(t,e){e=t.id+e;let i=this._db.get(e);if(void 0!==i)return this._db.delete(e),i.lives=i.lifetime,this._db.set(e,i),++this._hit,i.entry;++this._miss}peek(t,e){let i=this._db.get(t.id+e);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){let t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},e={},i=[];this._db.forEach((t,r)=>{let s=t.lifetime;i[s]=(i[s]||0)+t.size,this._clients.forEach(i=>{let{id:s,name:n}=i;if(r.startsWith(s)){let i=e[n]||0;e[n]=i+t.size}})});let r={};this._clients.forEach(t=>{let i=t.name;if("hitRate"in t&&"number"==typeof t.hitRate&&!isNaN(t.hitRate)&&t.hitRate>0){let s=e[i]||0;e[i]=s,r[i]=Math.round(100*t.hitRate)+"%"}else r[i]="0%"});let s=Object.keys(e);s.sort((t,i)=>e[i]-e[t]),s.forEach(i=>t[i]=Math.round(e[i]/2**20)+"MB / "+r[i]);for(let e=i.length-1;e>=0;--e){let r=i[e];r&&(t["Priority "+(e+-3-1)]=Math.round(r/this._size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._clients.forEach(t=>t.resetHitRate())}clear(t){let e=t.id;this._db.forEach((t,i)=>{i.startsWith(e)&&(this._size-=t.size,this._db.delete(i),this._notifyRemove(i,t.entry,t.size,0))}),t.size=0}clearAll(){this._db.forEach((t,e)=>this._notifyRemove(e,t.entry,t.size,0)),this._clients.forEach(t=>t.size=0),this._size=0,this._db.clear()}*values(t){for(let[e,i]of this._db)e.startsWith(t.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,e,i,r){let s=this._clients.get(t.split(a)[0])?.removeFunc,n=s?.(e,r,i);return"number"==typeof n?n:null}_checkSize(){this._sizeLimits.forEach((t,e)=>this._checkSizeLimits(t,e)),this._clients.forEach(t=>this._checkSizeLimits(this._maxClientSize,t)),this._checkSizeLimits(this.maxSize)}setMaxClientSize(t,e){null==e||e<=0?this._sizeLimits.delete(t):this._sizeLimits.set(t,e)}_checkSizeLimits(t,e){let i=e??this;if(i.size<=t)return;let r=e?.id,s=!0;for(;s;){s=!1;for(let[n,u]of this._db)if(0===u.lifetime&&(!r||n.startsWith(r))){let r=e??this._clients.get(n.split(a)[0]);if(this._purgeItem(n,u,r),i.size<=.9*t)return;s||=this._db.has(n)}}for(let[s,n]of this._db)if(!r||s.startsWith(r)){let r=e??this._clients.get(s.split(a)[0]);if(this._purgeItem(s,n,r),i.size<=.9*t)return}}_purgeItem(t,e,i){if(this._db.delete(t),e.lives<=1){this._size-=e.size,i&&(i.size-=e.size);let r=this._notifyRemove(t,e.entry,e.size,1);null!=r&&r>0&&(this._size+=r,i&&(i.size+=r),e.lives=e.lifetime,e.size=r,this._db.set(t,e))}else--e.lives,this._db.set(t,e)}}new s(0);class n{constructor(t,e,i){this.entry=t,this.size=e,this.lifetime=i,this.lives=i}}const a=":";class u{constructor(t,e){this.removeFunc=e,this.id="",this.name="",this.size=0,this._storage=new s(t,1),this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(t,e,i=1){this._storage.put(this,t,e,i,1)}pop(t){return this._storage.pop(this,t)}get(t){return this._storage.get(this,t)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}resetHitRate(){}}},9093(t,e,i){function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}i.d(e,{o8:()=>s,vt:()=>r});const n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:n,clone:s,create:r,fromValues:function(t,e,i,r,s,n,a,u,o,l,h,c,f,d,p,m){return[t,e,i,r,s,n,a,u,o,l,h,c,f,d,p,m]}},Symbol.toStringTag,{value:"Module"})),i.d(e,["zK",0,n])},35522(t,e,i){i.d(e,{$A:()=>P,Bw:()=>n,C:()=>a,Cc:()=>v,DI:()=>M,Io:()=>g,Ln:()=>y,Om:()=>S,Qr:()=>c,Re:()=>l,S8:()=>I,T9:()=>m,WQ:()=>o,Z0:()=>F,_S:()=>d,aI:()=>A,ei:()=>b,fw:()=>C,gL:()=>R,hG:()=>x,hZ:()=>u,hs:()=>_,jk:()=>p,lw:()=>h,m3:()=>w,oW:()=>E,t2:()=>O,tn:()=>f,ze:()=>z});var r=i(51850),s=i(34304);function n(t){let e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t,e,i,r){return t[0]=e,t[1]=i,t[2]=r,t}function o(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function l(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function h(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function c(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t}function f(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t}function d(t,e){return t[0]=Math.sign(e[0]),t[1]=Math.sign(e[1]),t[2]=Math.sign(e[2]),t}function p(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function m(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function _(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function y(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t}function g(t,e){let i=e[0]-t[0],r=e[1]-t[1],s=e[2]-t[2];return Math.sqrt(i*i+r*r+s*s)}function x(t,e){let i=e[0]-t[0],r=e[1]-t[1],s=e[2]-t[2];return i*i+r*r+s*s}function w(t){let e=t[0],i=t[1],r=t[2];return e*e+i*i+r*r}function z(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function I(t,e=t){let i=e[0],r=e[1],s=e[2],n=i*i+r*r+s*s;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n),t}function S(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function P(t,e,i){let r=e[0],s=e[1],n=e[2],a=i[0],u=i[1],o=i[2];return t[0]=s*o-n*u,t[1]=n*a-r*o,t[2]=r*u-s*a,t}function v(t,e,i,r){let s=e[0],n=e[1],a=e[2];return t[0]=s+r*(i[0]-s),t[1]=n+r*(i[1]-n),t[2]=a+r*(i[2]-a),t}function F(t,e,i){let r=e[0],s=e[1],n=e[2];return t[0]=i[0]*r+i[4]*s+i[8]*n+i[12],t[1]=i[1]*r+i[5]*s+i[9]*n+i[13],t[2]=i[2]*r+i[6]*s+i[10]*n+i[14],t}function b(t,e,i){let r=e[0],s=e[1],n=e[2];return t[0]=r*i[0]+s*i[3]+n*i[6],t[1]=r*i[1]+s*i[4]+n*i[7],t[2]=r*i[2]+s*i[5]+n*i[8],t}function R(t,e,i){return C(t,e,i[0],i[1],i[2],i[3])}function C(t,e,i,r,s,n){let a=e[0],u=e[1],o=e[2],l=r*o-s*u,h=s*a-i*o,c=i*u-r*a,f=r*c-s*h,d=s*l-i*c,p=i*h-r*l,m=2*n;return t[0]=a+l*m+2*f,t[1]=u+h*m+2*d,t[2]=o+c*m+2*p,t}const N=(0,r.vt)(),q=(0,r.vt)();function O(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function A(t,e){if(t===e)return!0;let i=t[0],r=t[1],n=t[2],a=e[0],u=e[1],o=e[2],l=(0,s.FD)();return Math.abs(i-a)<=l*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-u)<=l*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-o)<=l*Math.max(1,Math.abs(n),Math.abs(o))}function E(t,e,i){let r=i[0]-e[0],s=i[1]-e[1],n=i[2]-e[2],a=r*r+s*s+n*n;return a>0?(a=1/Math.sqrt(a),t[0]=r*a,t[1]=s*a,t[2]=n*a,t):(t[0]=0,t[1]=0,t[2]=0,t)}const T=l,G=h,k=c,Q=g,D=x,Z=n,B=w;Object.freeze(Object.defineProperty({__proto__:null,abs:f,add:o,angle:function(t,e){I(N,t),I(q,e);let i=S(N,q);return i>1?0:i<-1?Math.PI:Math.acos(i)},bezier:function(t,e,i,r,s,n){let a=1-n,u=a*a,o=n*n,l=u*a,h=3*n*u,c=3*o*a,f=o*n;return t[0]=e[0]*l+i[0]*h+r[0]*c+s[0]*f,t[1]=e[1]*l+i[1]*h+r[1]*c+s[1]*f,t[2]=e[2]*l+i[2]*h+r[2]*c+s[2]*f,t},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},clamp:function(t,e=0,i=1){return t[0]=Math.min(Math.max(t[0],e),i),t[1]=Math.min(Math.max(t[1],e),i),t[2]=Math.min(Math.max(t[2],e),i),t},copy:a,cross:P,crossAndNormalize:function(t,e,i){let r=e[0],s=e[1],n=e[2],a=i[0],u=i[1],o=i[2],l=s*o-n*u,h=n*a-r*o,c=r*u-s*a,f=Math.sqrt(l*l+h*h+c*c);return t[0]=l/f,t[1]=h/f,t[2]=c/f,t},direction:E,dist:Q,distance:g,div:k,divide:c,dot:S,equals:A,exactEquals:O,floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},hermite:function(t,e,i,r,s,n){let a=n*n,u=a*(2*n-3)+1,o=a*(n-2)+n,l=a*(n-1),h=a*(3-2*n);return t[0]=e[0]*u+i[0]*o+r[0]*l+s[0]*h,t[1]=e[1]*u+i[1]*o+r[1]*l+s[1]*h,t[2]=e[2]*u+i[2]*o+r[2]*l+s[2]*h,t},inverse:M,len:Z,length:n,lerp:v,max:m,min:p,mul:G,multiply:h,negate:z,normalize:I,random:function(t,e=1){let i=s.Ov,r=2*i()*Math.PI,n=2*i()-1,a=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=n*e,t},rotateX:function(t,e,i,r){let s=[],n=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],n[0]=s[0],n[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),n[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},rotateY:function(t,e,i,r){let s=[],n=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],n[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),n[1]=s[1],n[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},rotateZ:function(t,e,i,r){let s=[],n=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],n[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),n[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),n[2]=s[2],t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},scale:_,scaleAndAdd:y,scaleTo:function(t,e){return _(t,t,e/Z(t))},set:u,sign:d,sqrDist:D,sqrLen:B,squaredDistance:x,squaredLength:w,str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},sub:T,subtract:l,transformMat3:b,transformMat4:F,transformMat4Z:function(t,e){return e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]},transformQuat:R,transformQuatValues:C},Symbol.toStringTag,{value:"Module"})),i.d(e,["Il",0,Z,"jb",0,T,"lo",0,D,"uE",0,B])},69397(t,e,i){i.d(e,{Qf:()=>u,Qh:()=>n,lM:()=>s});var r=i(34275);function s(t){if(!t)return 0;let e=l;for(let i in t)t.hasOwnProperty(i)&&(e+=a(t[i],!1));return e}function n(t){if(!t)return 0;if("number"==typeof t[0])return u(t);if(Array.isArray(t))return function(t){let e=t.length;if(0===e||"number"==typeof t[0])return o(t,8);let i=h;for(let r=0;r<e;r++)i+=a(t[r]);return i}(t);let e=l;for(let i in t)t.hasOwnProperty(i)&&(e+=a(t[i]));return e}function a(t,e=!0){switch(typeof t){case"object":return e?n(t):l;case"string":return function(t){return 32+t.length}(t);case"number":return 16;case"boolean":return 4;default:return 8}}function u(...t){return t.reduce((t,e)=>t+(e?(0,r.iu)(e)?e.byteLength+c:Array.isArray(e)?o(e,16):0:0),0)}function o(t,e){return h+t.length*e}const l=32,h=16,c=145},36745(t,e,i){i.d(e,{z:()=>u});var r=i(4718),s=i(51118),n=i(60408),a=i(92722);class u{static fromOptimized(t,e,i=1){return(new o).initialize(t,e,i)}static fromJSON(t){let[e,i]=h(t),r=(0,n.Pv)(t),s=(0,n.W0)(t);return(new c).initialize(e,i,r,s,1)}static fromOptimizedCIM(t,e,i=1){return(new f).initialize(t,e,i)}static fromJSONCIM(t,e=1){let[i,r]=h(t),s=(0,n.Pv)(t),a=(0,n.W0)(t);return(new d).initialize(i,r,s,a,e)}static fromFeatureSetReader(t){let e=t.readGeometryForDisplay(),i=t.geometryType;return e&&i?this.fromOptimized(e,i):null}static fromFeatureSetReaderCIM(t){let e=t.readGeometryForDisplay(),i=t.geometryType;return e&&i?this.fromOptimizedCIM(e,i):null}static createEmptyOptimized(t,e=!1,i=!1,r=1){return(new f).initialize(new a.A([],[],e,i),t,r)}static createEmptyJSON(t,e=!1,i=!1){return(new c).initialize([],t,e,i,1)}static createEmptyOptimizedCIM(t,e=!1,i=!1,r=1){return(new f).initialize(new a.A([],[],e,i),t,r)}static createEmptyJSONCIM(t,e=!1,i=!1,r=1){return(new d).initialize([],t,e,i,r)}asJSON(){let t=(0,s.x)(this),{hasZ:e,hasM:i}=this;return"esriGeometryEnvelope"===this.geometryType?{xmin:t[0][0][0],ymin:t[0][0][1],xmax:t[0][2][0],ymax:t[0][2][1]}:"esriGeometryMultipoint"===this.geometryType?{points:t.flat(),hasZ:e,hasM:i}:"esriGeometryPoint"===this.geometryType?{x:t[0][0][0],y:t[0][0][1],z:e?t[0][0][2]:void 0,m:i?t[0][0][e?3:2]:void 0}:"esriGeometryPolygon"===this.geometryType?{rings:t,hasZ:e,hasM:i}:{paths:t,hasZ:e,hasM:i}}getCurrentRingArea(){if(this.pathSize<3)return 0;let t,e,i=0;if(this.seekPathStart(),!this.nextPoint())return 0;t=this.x,e=this.y;let r=t,s=e;for(;this.nextPoint();)i+=(t-this.x)*(e+this.y),t=this.x,e=this.y;return i+=(t-r)*(e+s),-.5*i}invertY(){this.yFactor*=-1}}class o extends u{constructor(){super(...arguments),this._end=-1}get hasZ(){return this._geometry?.hasZ}get hasM(){return this._geometry?.hasM}initialize(t,e,i){return this.geometryType=e,this._stride=t.stride,this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=i,this}reset(){this.initialize(this._geometry,this.geometryType,this.yFactor)}seekPath(t){if(t>=0&&t<this.totalSize){if(this._pathIndex<t)for(;this._pathIndex<t&&this.nextPath(););else if(this._pathIndex>t)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){let e=this._pathOffset+t*this._stride;return e>=0&&e<this._end&&(this._pointOffset=e,!0)}nextPoint(){return(this._pointOffset+=this._stride)<this._end}prevPoint(){return(this._pointOffset-=this._stride)>=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1||(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,0))}prevPath(){return!(this.pathIndex<=0||(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,0))}getCurrentPath(){let t=this._end,e=this._geometry.coords,i=this._pathOffset;return(new o).initialize(new a.A([this.pathSize],e.slice(i,t),this.hasZ,this.hasM),this.geometryType,this.yFactor)}pathLength(){let t=this._end,e=this._stride,i=this._geometry.coords,r=0;for(let s=this._pathOffset+e;s<t;s+=e){let t=i[s-e],n=i[s-e+1],a=i[s]-t,u=i[s+1]-n;r+=Math.sqrt(a*a+u*u)}return r}startPath(){this._geometry.lengths.push(0)}pushPath(t){this.startPath(),this.pushPoints(t)}pushPoint(t){for(let e=0;e<this._stride;++e)this._geometry.coords.push(t[e]);this._geometry.lengths[this.totalSize-1]++}pushXY(t,e){this._geometry.coords.push(t,e),this._geometry.lengths[this.totalSize-1]++}pushPoints(t){for(let e of t)for(let t=0;t<this._stride;++t)this._geometry.coords.push(e[t]);this._geometry.lengths[this.totalSize-1]+=t.length}pushCursor(t){let e=t.asOptimized();this._geometry.coords.push(...e.coords),this._geometry.lengths.push(...e.lengths)}asOptimized(){let t=this._geometry.clone();if(1!==this.yFactor)for(let e=1;e<t.coords.length;e+=this._stride)t.coords[e]*=this.yFactor;return"esriGeometryPoint"===this.geometryType&&(t.lengths.length=0),t}isClosed(){let t=this._geometry.coords,e=this._pathOffset,i=this._end-this._stride;for(let r=0;r<this._stride;r++)if(t[e+r]!==t[i+r])return!1;return!0}clone(){return(new o).initialize(this._geometry.clone(),this.geometryType,this.yFactor)}get totalPoints(){return this._geometry.isPoint?1:this._geometry.lengths.reduce((t,e)=>t+e)}get pathSize(){let{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){let t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}}function l(t){let e=[t.x,t.y];return t.z&&e.push(t.z),t.m&&e.push(t.m),e}function h(t){return(0,n.Bi)(t)?[t.rings,"esriGeometryPolygon"]:(0,n.Rg)(t)?[t.paths,"esriGeometryPolyline"]:(0,n.U9)(t)?[[t.points],"esriGeometryMultipoint"]:(0,n.ZC)(t)?[[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]],"esriGeometryEnvelope"]:(0,n.fT)(t)?[[[l(t)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}class c extends u{initialize(t,e,i,r,s){return this._paths=t,this.geometryType=e,this.hasZ=i,this.hasM=r,this._pathIndex=this._pointIndex=-1,this.yFactor=s,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t<this.totalSize&&(this._currentPath=this._paths[t],!0)}seekPathStart(){this._pointIndex=-1}seekPathEnd(){this._pointIndex=this._currentPath.length}seekInPath(t){return t>=0&&t<this._currentPath.length&&(this._pointIndex=t,this._currentPoint=this._currentPath[this._pointIndex],!0)}nextPoint(){return this._currentPoint=this._currentPath[++this._pointIndex],this._pointIndex<this._currentPath.length}prevPoint(){return this._currentPoint=this._currentPath[--this._pointIndex],this._pointIndex>=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex<this.totalSize}prevPath(){return this.pathIndex>0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){let t=this._currentPath.length,e=this._currentPath,i=0;for(let r=1;r<t;r++){let t=e[r-1],s=e[r],n=t[0],a=t[1],u=s[0]-n,o=s[1]-a;i+=Math.sqrt(u*u+o*o)}return i}startPath(){this._paths.push([])}getCurrentPath(){return(new c).initialize([this._currentPath],this.geometryType,this.hasZ,this.hasM,this.yFactor)}pushPath(t){this._paths.push(t)}pushPoint(t){this._paths[this.totalSize-1].push(t)}pushXY(t,e){this._paths[this.totalSize-1].push([t,e])}pushPoints(t){this._paths[this.totalSize-1].push(...t)}pushCursor(t){let e=(0,s.x)(t);for(let t of e)this.pushPath(t)}asOptimized(){let{hasZ:t,hasM:e}=this,i=new a.A([],[],t,e),{coords:r,lengths:s}=i;if("esriGeometryPoint"===this.geometryType)r.push(...this._paths[0][0]),s.length=0;else for(let i of this._paths){for(let s of i)r.push(s[0]),r.push(s[1]*this.yFactor),t&&r.push(s[2]),e&&r.push(s[this._mIndex]);s.push(i.length)}return i}isClosed(){let t=this._currentPath[0],e=this._currentPath[this._currentPath.length-1];for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}clone(){return(new c).initialize((0,r.o8)(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}get totalPoints(){return this._paths.map(t=>t.length).reduce((t,e)=>t+e)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}}class f extends o{initialize(t,e,i){return super.initialize(t,e,i),this._controlPoints||=this._controlPoints=Array(this.totalSize).fill(void 0).map(t=>new Set),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){let t=(new f).initialize(this._geometry.clone(),this.geometryType,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}}class d extends c{initialize(t,e,i,r,s){return super.initialize(t,e,i,r,s)}clone(){return(new d).initialize((0,r.o8)(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][4]=1}getControlPoint(){return 1===this._paths[this.pathIndex][this._pointIndex][4]}setControlPointAt(t){this._paths[this.pathIndex][t][4]=1}getControlPointAt(t){return 1===this._paths[this.pathIndex][t][4]}}},4197(t,e,i){i.d(e,{Vj:()=>h,cj:()=>l,jh:()=>n,l5:()=>u,yH:()=>o});var r=i(34275),s=i(9093);function n(t){return t<=1024?Array(t).fill(0):new Float64Array(t)}function a(t){return((0,r.iu)(t)?t.byteLength/8:t.length)<=1024?Array.from(t):new Float64Array(t)}function u(t,e,i){return Array.isArray(t)?t.slice(e,e+i):t.subarray(e,e+i)}function o(t,e){if(0===e.length)return a(t);if(0===t.length)return a(e);let i=n(t.length+e.length);for(let e=0;e<t.length;++e)i[e]=t[e];for(let r=0;r<e.length;++r)i[t.length+r]=e[r];return i}function l(t){return[...t]}function h(t){let e=(0,s.vt)();for(let i=0;i<16;++i)e[i]=t[i];return e}},70328(t,e,i){i.d(e,{BI:()=>F,C:()=>a,DC:()=>f,Ej:()=>x,Ie:()=>P,Jt:()=>v,Lu:()=>z,Ne:()=>M,RF:()=>c,TF:()=>y,VL:()=>p,aI:()=>R,fA:()=>u,gE:()=>l,gX:()=>g,hZ:()=>S,iT:()=>d,is:()=>b,pg:()=>w,uJ:()=>_,vI:()=>I,vY:()=>o,vt:()=>n,w1:()=>h,yr:()=>m}),i(35522);var r=i(5443),s=(i(19419),i(4197));function n(t=N){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function a(t,e){for(let i=0;i<6;i++)t[i]=e[i];return t}function u(t,e,i,r,s,a,u=n()){return u[0]=t,u[1]=e,u[2]=i,u[3]=r,u[4]=s,u[5]=a,u}function o(t,e=n()){return function(t,e,i,r=n()){return S(r,C),function(t,e,i=0,r=e.length/3){let s=t[0],n=t[1],a=t[2],u=t[3],o=t[4],l=t[5];for(let t=0;t<r;t++)s=Math.min(s,e[i+3*t]),n=Math.min(n,e[i+3*t+1]),a=Math.min(a,e[i+3*t+2]),u=Math.max(u,e[i+3*t]),o=Math.max(o,e[i+3*t+1]),l=Math.max(l,e[i+3*t+2]);t[0]=s,t[1]=n,t[2]=a,t[3]=u,t[4]=o,t[5]=l}(r,t,e,i),r}(t,0,t.length/3,e)}function l(t,e=(0,s.jh)(24)){let[i,r,n,a,u,o]=t;return e[0]=i,e[1]=r,e[2]=n,e[3]=i,e[4]=r,e[5]=o,e[6]=i,e[7]=u,e[8]=n,e[9]=i,e[10]=u,e[11]=o,e[12]=a,e[13]=r,e[14]=n,e[15]=a,e[16]=r,e[17]=o,e[18]=a,e[19]=u,e[20]=n,e[21]=a,e[22]=u,e[23]=o,e}function h(t,e){return isFinite(t[2])||isFinite(t[5])?new r.A({xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}):new r.A({xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function c(t,e,i=t){i[0]=Math.min(t[0],e[0]),i[1]=Math.min(t[1],e[1]),i[2]=Math.min(t[2],e[2]),i[3]=Math.max(t[3],e[3]),i[4]=Math.max(t[4],e[4]),i[5]=Math.max(t[5],e[5])}function f(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[3]=Math.max(t[3],e[2]),t[4]=Math.max(t[4],e[3])}function d(t,[e,i,r]){!function(t,e,i,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.min(t[2],r),t[3]=Math.max(t[3],e),t[4]=Math.max(t[4],i),t[5]=Math.max(t[5],r)}(t,e,i,r)}function p(t){return t[0]>=t[3]?0:t[3]-t[0]}function m(t){return t[1]>=t[4]?0:t[4]-t[1]}function _(t){return t[2]>=t[5]?0:t[5]-t[2]}function y(t){let e=p(t),i=_(t),r=m(t);return e*e+i*i+r*r}function g(t,e=[0,0,0]){return e[0]=t[0]+p(t)/2,e[1]=t[1]+m(t)/2,e[2]=t[2]+_(t)/2,e}function x(t,e=[0,0,0]){return e[0]=p(t),e[1]=m(t),e[2]=_(t),e}function w(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function z(t,e){return e[0]=t[3],e[1]=t[4],e[2]=t[5],e}function M(t,e,i=t){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i!==t&&(i[3]=t[3],i[4]=t[4],i[5]=t[5]),i}function I(t,e,i=t){return i[3]=e[0],i[4]=e[1],i[5]=e[2],i!==t&&(i[0]=t[0],i[1]=t[1],i[2]=t[2]),t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function P(t){return t?S(t,C):n(C)}function v(t,e){return t[0]=e[0],t[1]=e[1],t[2]=-1/0,t[3]=e[2],t[4]=e[3],t[5]=1/0,t}function F(t,e,i,r,s){return t[0]=e,t[1]=i,t[2]=-1/0,t[3]=r,t[4]=s,t[5]=1/0,t}function b(t){return 6===t.length}function R(t,e,i){if(null==t||null==e)return t===e;if(!b(t)||!b(e))return!1;if(i){for(let r=0;r<t.length;r++)if(!i(t[r],e[r]))return!1}else for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const C=[1/0,1/0,1/0,-1/0,-1/0,-1/0],N=[0,0,0,0,0,0];n(),i.d(e,["qv",0,C,"v_",0,N])},78957(t,e,i){i.d(e,{d:()=>h,R:()=>z});class r{constructor(t=s){this._data=[],this._compare=t}get size(){return this._data.length}enqueue(t){if(null==t)return;let{_data:e,_compare:i}=this;e.push(t);let r=e.length-1>>>0,s=e[r];for(;r>0;){let t=r-1>>1,n=e[t];if(!(i(n,s)<=0))break;e[t]=s,e[r]=n,r=t}}dequeue(){let{_data:t,_compare:e}=this,i=t[0],r=t.pop();if(0===t.length)return i;t[0]=r;let s,n,a=0,u=t.length,o=t[0],l=null;for(;;){let i=2*a+1,r=2*a+2;if(l=null,i<u&&(s=t[i],e(s,o)>0&&(l=i)),r<u&&(n=t[r],(null===l&&e(n,o)<=0||null!==l&&e(n,s)<=0)&&(l=r)),null===l)break;t[a]=t[l],t[l]=o,a=l}return i}}const s=(t,e)=>t<e?-1:+(t>e);var n=i(19419),a=i(537),u=i(12359),o=i(95108),l=i(12176);function h(t){if(0===t.totalSize)return null;let e=(0,a.z8)(t);if(!e)return null;let i=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*222045e-19,r=0,s=0;t.reset();for(let e=0;t.nextPath();e++){let i=t.getCurrentRingArea();i>s&&(s=i,r=e)}if(t.seekPath(r),0===t.pathSize)return null;t.seekPathStart();let o=(0,a.B$)(t);if(Math.abs(s)<=2*i*i)return[(o[0]+o[2])/2,(o[1]+o[3])/2];t.seekPathStart();let l=(0,u.w2)(t,(0,n.vt)());if(null===l)return null;if(t.totalPoints<4)return l;let h=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],p=[NaN,NaN,NaN,NaN],m=[NaN,NaN,NaN,NaN],_=!1,w=f(l,t,!0);0===w.distance&&(_=!0,h[0][0]=l[0],h[0][1]=l[1],w=f(l,t,!1)),p[0]=w.distance,m[0]=0;let z=[NaN,NaN],M=!1,I=.25,S=-1,P=NaN;do{if(P=NaN,h[1]=d(t,y(o[0],o[2],I),0,e),!isNaN(h[1][0])&&!isNaN(h[1][1])&&(w=f(h[1],t,!1),P=w.distance),!isNaN(P)&&P>i&&c(h[1],t))M=!0,p[1]=P,m[1]=g(h[1],l);else if(!isNaN(P)&&P>S&&(S=P,z[0]=h[1][0],z[1]=h[1][1]),I-=.01,I<.1){if(!(S>=0))break;M=!0,p[1]=S,h[1][0]=z[0],h[1][1]=z[1],m[1]=g(h[1],l)}}while(!M);M=!1,I=.5,S=-1;let v=.01,F=1;do{if(P=NaN,h[2]=d(t,y(o[0],o[2],I),0,e),!isNaN(h[2][0])&&!isNaN(h[2][1])&&(w=f(h[2],t,!1),P=w.distance),!isNaN(P)&&P>i&&c(h[2],t))M=!0,p[2]=P,m[2]=g(h[2],l);else if(!isNaN(P)&&P>S)S=P,z[0]=h[2][0],z[1]=h[2][1];else if(P>S&&(S=P,z[0]=h[2][0],z[1]=h[2][1]),I=.5+v*F,v+=.01,F*=-1,I<.3||I>.7){if(!(S>=0))break;M=!0,p[2]=S,h[2][0]=z[0],h[2][1]=z[1],m[2]=g(h[2],l)}}while(!M);M=!1,I=.75,S=-1;do{if(P=NaN,h[3]=d(t,y(o[0],o[2],I),0,e),!isNaN(h[3][0])&&!isNaN(h[3][1])&&(w=f(h[3],t,!1),P=w.distance),!isNaN(P)&&P>i&&c(h[3],t))M=!0,p[3]=P,m[3]=g(h[3],l);else if(P>S&&(S=P,z[0]=h[3][0],z[1]=h[3][1]),I+=.01,I>.9){if(!(S>=0))break;M=!0,p[3]=S,h[3][0]=z[0],h[3][1]=z[1],m[3]=g(h[3],l)}}while(!M);let b,R=[0,1,2,3],C=+!_;for(let t=C;t<4;t++)for(let t=C;t<3;t++){let e=m[t],i=m[t+1];x(e,i)>0&&(b=R[t],R[t]=R[t+1],R[t+1]=b,m[t]=i,m[t+1]=e)}let N=C,q=0,O=0;for(let t=C;t<4;t++){switch(t){case 0:O=2*p[R[t]];break;case 1:O=1.66666666*p[R[t]];break;case 2:O=1.33333333*p[R[t]];break;case 3:O=p[R[t]]}O>q&&(q=O,N=R[t])}return h[N]}function c(t,e){let i,r,s,n,a=0;for(e.reset();e.nextPath()&&e.nextPoint();)for(i=e.x,r=e.y;e.nextPoint();i=s,r=n)s=e.x,n=e.y,r>t[1]!=n>t[1]&&((s-i)*(t[1]-r)-(n-r)*(t[0]-i)>0?a++:a--);return 0!==a}function f(t,e,i){if(i&&c(t,e))return{coord:t,distance:0};let r=1/0,s=0,n=0,a=[0,0],u=[0,0],l=[0,0];for(e.reset();e.nextPath()&&e.nextPoint();)if(!(e.pathSize<2))for(a[0]=e.x,a[1]=e.y;e.nextPoint();a=u){u=[e.x,e.y],(0,o.gR)(l,t,a,u);let i=g(t,l);i<r&&(r=i,s=l[0],n=l[1])}return{coord:[s,n],distance:Math.sqrt(r)}}function d(t,e,i,r){let s=[e,0],a=1/0,u=1/0,o=!1,h=!1,c=[[e,r[1]-1],[e,r[3]+1]],f=[0,0],d=[0,0],_=[0,0],y=[[0,0],[0,0]],g=(0,n.vt)();for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(y[0][0]=t.x,y[0][1]=t.y;t.nextPoint();y[0][0]=y[1][0],y[0][1]=y[1][1]){if(y[1][0]=t.x,y[1][1]=t.y,null===p(g,y)||(d[0]=c[0][0],d[1]=c[0][1],_[0]=c[1][0],_[1]=c[1][1],0===m(g,d,_))||!(0,l.Ql)(c[0],c[1],y[0],y[1],f))continue;let e=f[1];a>u?e<a&&(a=e,o=!0):e<u&&(u=e,h=!0)}return o&&h?s[1]=(a+u)/2:s[0]=s[1]=NaN,s}function p(t,e){if(e.length<2)return null;t||=(0,n.vt)();let[i,r]=e[0],[s,a]=e[1];return t[0]=Math.min(i,s),t[1]=Math.min(r,a),t[2]=Math.max(i,s),t[3]=Math.max(r,a),t}function m(t,e,i){let r=_(e,t),s=_(i,t),n=t[0],a=t[1],u=t[2],o=t[3];if(r&s)return 0;if(!(r|s))return 4;let l=!!r|(s?2:0);do{let l=i[0]-e[0],h=i[1]-e[1];if(l>h)3&r?(1&r?(e[1]+=h*(n-e[0])/l,e[0]=n):(e[1]+=h*(u-e[0])/l,e[0]=u),r=_(e,t)):3&s?(1&s?(i[1]+=h*(n-i[0])/l,i[0]=n):(i[1]+=h*(u-i[0])/l,i[0]=u),s=_(i,t)):r?(4&r?(e[0]+=l*(a-e[1])/h,e[1]=a):(e[0]+=l*(o-e[1])/h,e[1]=o),r=_(e,t)):(4&s?(i[0]+=l*(a-i[1])/h,i[1]=a):(i[0]+=l*(o-i[1])/h,i[1]=o),s=_(i,t));else if(12&r?(4&r?(e[0]+=l*(a-e[1])/h,e[1]=a):(e[0]+=l*(o-e[1])/h,e[1]=o),r=_(e,t)):12&s?(4&s?(i[0]+=l*(a-i[1])/h,i[1]=a):(i[0]+=l*(o-i[1])/h,i[1]=o),s=_(i,t)):r?(1&r?(e[1]+=h*(n-e[0])/l,e[0]=n):(e[1]+=h*(u-e[0])/l,e[0]=u),r=_(e,t)):(1&s?(i[1]+=h*(n-i[0])/l,i[0]=n):(i[1]+=h*(u-i[0])/l,i[0]=u),s=_(i,t)),r&s)return 0}while(r|s);return l}function _(t,e){return+(t[0]<e[0])|(t[0]>e[2])<<1|(t[1]<e[1])<<2|(t[1]>e[3])<<3}function y(t,e,i){return t+(e-t)*i}function g(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function x(t,e){if(t<e)return-1;if(t>e)return 1;if(t===e)return 0;let i=isNaN(t),r=isNaN(e);return i<r?-1:+(i>r)}class w{constructor(t,e,i,r){this.x=t,this.y=e,this.cellSize=i,this.distancefromCellCenter=(0,o.Xf)(t,e,r),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}function z(t){if(!t.nextPath()||!t.pathSize)return null;let e=(0,a.B$)(t),i=e[2]-e[0],s=e[3]-e[1];if(0===i||0===s)return[e[0]+i/2,e[1]+s/2];let n=Math.max(Math.min(i,s)/100,1),o=new r((t,e)=>e.maxDistanceToPolygon-t.maxDistanceToPolygon),l=Math.min(i,s),h=l/2,c=0,f=0;for(c=e[0];c<e[2];c+=l)for(f=e[1];f<e[3];f+=l)o.enqueue(new w(c+h,f+h,h,t));t.reset(),t.nextPath();let d=(0,u.IK)(t);if(null===d)return null;let p,m=new w(d[0],d[1],0,t);for(;o.size>0;)p=o.dequeue(),p.distancefromCellCenter>m.distancefromCellCenter&&(m=p),!(p.maxDistanceToPolygon-m.distancefromCellCenter<=n)&&(h=p.cellSize/2,o.enqueue(new w(p.x-h,p.y-h,h,t)),o.enqueue(new w(p.x+h,p.y-h,h,t)),o.enqueue(new w(p.x-h,p.y+h,h,t)),o.enqueue(new w(p.x+h,p.y+h,h,t)));return[m.x,m.y]}},62815(t,e,i){i.d(e,{N:()=>u,d:()=>o});var r=i(86211),s=i(73941),n=i(21325),a=i(52006);function u(t,e,i){let r=o(e,i);if(1!==r)switch(t){case"point":case"esriGeometryPoint":return t=>function(t,e){null!=t?.z&&(t.z*=e)}(t,r);case"polyline":case"esriGeometryPolyline":return t=>function(t,e){if(t){if(t.curvePaths)for(let i of t.curvePaths)for(let t of i){let i=(0,a.yP)(t);i.length>2&&(i[2]*=e)}if(t.paths)for(let i of t.paths)for(let t of i)t.length>2&&(t[2]*=e)}}(t,r);case"polygon":case"esriGeometryPolygon":return t=>function(t,e){if(t){if(t.curveRings)for(let i of t.curveRings)for(let t of i){let i=(0,a.yP)(t);i.length>2&&(i[2]*=e)}if(t.rings)for(let i of t.rings)for(let t of i)t.length>2&&(t[2]*=e)}}(t,r);case"multipoint":case"esriGeometryMultipoint":return t=>function(t,e){if(t)for(let i of t.points)i.length>2&&(i[2]*=e)}(t,r);case"extent":case"esriGeometryEnvelope":return t=>function(t,e){t&&null!=t.zmin&&null!=t.zmax&&(t.zmin*=e,t.zmax*=e)}(t,r);default:return}}function o(t,e){return null==t||null==e||(0,n.aI)(t,e)||(0,s.xP)(t)||(0,s.xP)(e)?1:(0,r.G9)(t)/(0,r.G9)(e)}},6557(t,e,i){i.r(e),i.d(e,{default:()=>j});var r=i(32198),s=i(21818),n=i(49186),a=i(71511),u=i(44208),o=i(53966),l=i(17676),h=i(563),c=i(39516),f=i(86211),d=i(16930),p=i(70328),m=i(19419),_=i(21325),y=i(53929),g=i(90708),x=i(29441),w=i(75752),z=i(99352),M=i(8384),I=i(58727),S=i(95031),P=i(24460),v=i(64714),F=i(17754),b=i(20437),R=i(95466),C=i(30524),N=i(50639),q=i(42760),O=i(76248),A=(i(98623),i(30661)),E=i(28923),T=i(44320),G=i(35258),k=i(16630);const Q=new A.Z,D="__OBJECTID",Z=8e3;class B{constructor(t,e){this._files=t,this._createFileStream=e,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(t){for(await this._fill(t);this._pending.size>0;){(0,l.Te)(t),await this._fill(t);let e=await W(this._pending);if(this._pending.delete(e.read),this._resolvedCount++,null!=e.chunk)return e.chunk}return null}async _fill(t){for(this._removeDone();this._pending.size<8;){let e=this._getOrCreateNextStream(t);if(null==e)return;this._pending.add(e.read(t))}}_getOrCreateNextStream(t){let e=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<e){let e=this._files[this._fileIndex++],i=new V(e.id,this._createFileStream(e,t));return this._streams.push(i),i}return this._getNextStream()}_getNextStream(){let t=this._streams.length;for(let e=0;e<t;e++){let i=(this._streamIndex+e)%t,r=this._streams[i];if(r.canRead)return this._streamIndex=(i+1)%t,r}return null}_removeDone(){let t=this._streamIndex;for(let e=this._streams.length-1;e>=0;e--)this._streams[e].done&&(this._streams.splice(e,1),e<t&&t--);this._streamIndex=this._streams.length>0?t%this._streams.length:0}}function W(t){return Promise.race(Array.from(t,async t=>({read:t,chunk:await t})))}class V{constructor(t,e){this._fileId=t,this._stream=e,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(t){this._readCount++;try{let e=await(await this._stream).next(t);return null==e?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:e}}finally{this._readCount--}}}class j{constructor(){this._hasZ=!1,this._hasM=!1,this._queue=new h.QueueProcessor({concurrency:4,process:(t,e)=>this._executeQuery(t,e)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new a.A}async load(t){let e=t.spatialReference?d.A.fromJSON(t.spatialReference):void 0;if(e&&!e.isWGS84&&!e.isWebMercator)throw new n.A("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=t.customParameters,this._loadParameters=t,await this._updateProvider((0,S.M)(t.provider,null,()=>this._customParameters));let i,r=await this._provider.getMetadata(),s=await(0,q.nc)(r,{fields:t.fields?.map(t=>b.A.fromJSON(t)),geometryEncoding:t.geometryEncoding?(0,N.G)(t.geometryEncoding):null,geometryType:t.geometryType?(0,q.hG)(t.geometryType):null,displayOptimization:t.displayOptimization,spatialReference:e});if(this._hasZ=!!r?.hasZ,this._hasM=!!r?.hasM,!s.fields)throw new n.A("parquet:unsupported","Fields must be defined");if(s.spatialReference&&s.geometryType){if(!s.spatialReference)throw new n.A("parquet:unsupported","SpatialReference must be defined");if(!s.spatialReference.isGeographic&&!s.spatialReference.isWebMercator)throw new n.A("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");s.spatialReference.isGeographic&&!s.spatialReference.isWGS84&&(o.A.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:s.spatialReference}),s.spatialReference=d.A.WGS84),i={geometry:s.geometryEncoding?{geometryType:(0,q.sA)(s.geometryType),spatialReference:s.spatialReference.toJSON(),encoding:s.geometryEncoding.toJSON()}:null,displayOptimization:s.displayOptimization}}this.setCustomParameters(t.customParameters),this._displayOptimization=s.displayOptimization,await this._provider.updateGeometryInfo(i),this._capabilities=rt(await this._getFileStatistics(),this._hasZ,this._hasM);let a=await this._provider.getFiles();if(!a.length)return{layerDefinition:{},capabilities:rt(null,this._hasZ,this._hasM)};let u=await a[0].file;s.file=u;let{fields:l}=s;if(null==l)throw new n.A("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",l);l.push(new b.A({name:D,type:"oid",alias:D}));for(let t of l){let e=u.getColumnId(t.name);null!=e&&(this._indexMap[t.name]=e)}let h=R.A.fromLayerJSON({fields:l.map(t=>t.toJSON()),dateFieldsTimeReference:{timeZoneIANA:"UTC"}});this._fieldsIndex=h;let c=(0,q.sA)(s.geometryType??"point");return this._metadata=G.i.createFeature({fieldsIndex:h.toJSON(),geometryType:c,hasZ:this._hasZ,hasM:this._hasM,featureIdInfo:{type:"object-id",fieldName:D},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:s.spatialReference,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:"UTC"}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:c,featureIdInfo:{type:"object-id",fieldName:D},hasM:this._hasM,hasZ:this._hasZ,spatialReference:s.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=r?.extent?r.extent:await this._tryDeriveParquetFullExtent(s),{capabilities:this._capabilities,layerDefinition:{fields:s.fields?.map(t=>t.toJSON()),drawingInfo:(0,v.F0)(c),extent:this._fullExtent??void 0,geometryType:c,hasZ:this._hasZ,hasM:this._hasM,geometryEncoding:s.geometryEncoding?.toJSON(),displayOptimization:s.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(let{handle:t}of this._streams.values())t.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(t){this.destroy(),await this.load(t)}set remoteClient(t){this._source=t.createInvokeProxy("")}setCustomParameters(t){this._customParameters=t}getIndexMap(){return this._indexMap}async updateFileProvider(t){this._loadParameters={...this._loadParameters,provider:t};let e=(0,S.M)(t,this._provider.getGeometryInfo(),()=>this._customParameters);await this._updateProvider(e)}async getDiagnosticsSnapshot(){let t=await this._provider.getFiles();return{files:await Promise.all(t.map(t=>t.getDiagnosticsSnapshot()))}}async getColumnIndex(t){return(await this._getFileInfoById(t.fileId)).getColumnIndex(t.rowGroupIndex,t.columnIndex)}async getOffsetIndex(t){return(await this._getFileInfoById(t.fileId)).getOffsetIndex(t.rowGroupIndex,t.columnIndex)}async queryFeatures(t,e){let i=await(0,I.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(i),function(t){return!!(t.objectIds?.length||t.outStatistics||t.orderByFields?.length||t.returnDistinctValues)}(i)||(i.resultRecordCount=i.resultRecordCount?Math.min(i.resultRecordCount,Z):Z,i.resultOffset=i.resultOffset??0),i.outStatistics?this._queryStatistics(i,e):(i.returnDistinctValues&&(i.returnGeometry=void 0),(await this._enqueueQuery(i,e)).createQueryResponse())}async queryFeatureCount(t,e){let i=await(0,I.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(i),H(i)||i.returnDistinctValues||i.groupByFieldsForStatistics?.length||i.outStatistics?.length?(i.returnDistinctValues||(i.outFields=void 0),i.returnGeometry=void 0,(await this._enqueueQuery(i,e)).createQueryResponseForCount()):this._getFeatureCount()}async queryObjectIds(t,e){let i=await(0,I.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(i),H(i)?(i.resultRecordCount=i.resultRecordCount?Math.min(i.resultRecordCount,8e3):8e3,i.resultOffset=i.resultOffset??0,i.returnGeometry=void 0,i.outFields=void 0,i.returnDistinctValues=void 0,(await this._enqueueQuery(i,e)).items.map(t=>t.getObjectId())):Array.from({length:await this._getFeatureCount()},(t,e)=>e)}async queryAttributeBins(t,e={}){throw new n.A("parquet:unsupported","queryAttributeBins not supported.")}async queryExtent(t,e){let i=await(0,I.T2)(t,null,this._queryEngineParams.spatialReference);if(this._validateQuery(i),this._fullExtent&&!H(i))return{count:await this._getFeatureCount(),extent:this._fullExtent};let r=(0,s.z)(this._metadata.spatialReference);i.returnGeometry=!0,i.outFields=void 0;let n=(0,p.hZ)((0,p.vt)(),p.qv),a=(0,p.vt)(),u=await this._enqueueQuery(i,e),o=0;for(let t of u.items)t.getBounds(a)&&((0,p.RF)(n,a),o+=1);return{count:o,extent:(0,w.Wc)(n,r,i.outSR?(0,s.z)(i.outSR):r.toJSON(),r,!1)}}async queryStream(t,e){if(!e.signal)throw Error("InternalError: AbortSignal must be passed");let i=await this._getCandidateFiles(t),r=new B(i,async(e,i)=>{let r=await e.file,s=await this._createParquetDisplayQuery(r,e.id,t);return r.executeQuery(s,Z,i)}),s=this._streamIdCounter++,n=(0,l.NY)(e.signal,t=>{let e=this._streams.get(s);null!=e&&(e.handle.remove(),this._streams.delete(s))});return this._streams.set(s,{stream:r,handle:n}),s}async getStreamNext(t,e){if(!e.signal)throw Error("InternalError: AbortSignal must be passed");let i=this._streams.get(t);if(!i)return{result:null};let r=await i.stream.next(e.signal);if(null==r)return i.handle.remove(),this._streams.delete(t),{result:null};let s=r.chunk.serialize().buffer,n={fileId:r.fileId,buffer:s};return s instanceof ArrayBuffer?{result:n,transferList:[s]}:{result:n}}async getStreamNextFeatures(t,e){let{result:i}=await this.getStreamNext(t,e);if(null==i)return null;let r=(await(0,O.N)()).ParquetChunk.deserialize(new Uint8Array(i.buffer)),s=new k.s(this._metadata,this._indexMap,r,i.fileId),n=[];for(;s.next();){let t=(0,g.zv)(s.readGeometryWorldSpace(),s.geometryType,s.hasZ,s.hasM),e=s.readAttributes();n.push({attributes:e,geometry:t})}return{features:n}}async createPatch(t,e,i,r,s){if(!s.signal)throw Error("InternalError: AbortSignal must be passed");return(await(await(await this._getFileInfoById(t)).file).createChunkPatch(e,i,r,s.signal)).serialize().buffer}async _updateProvider(t){let e=this._provider;this._handles.removeAll(),this._provider=t,this._handles.add([t.events.on("rangeRead",t=>{this._source.onRangeRead(t)}),t.events.on("sourceChanged",async()=>{await this.reload(this._loadParameters),await this._source.onSourceChange()})]),await(e?.destroy())}async _getCandidateFiles(t){let e=await this._provider.getFiles(),i=await this._getSpatialFilePruning(t);if(null==i)return e;let r=e.filter(t=>this._mayIncludeFileForSpatialPruning(t,i));return"xz"===i.type?function(t,e){return t.slice().sort((t,i)=>{let r=it(t,e),s=it(i,e);return r===s?0:r<s?-1:1})}(r,i):r}async _queryStatistics(t,e){let i=await(0,I.T2)({...t},null,this._queryEngineParams.spatialReference);if(i.returnGeometry=void 0,function(t,e){return!!t.outStatistics?.length&&!H(t)&&!t.groupByFieldsForStatistics?.length&&!t.orderByFields?.length&&!t.returnDistinctValues&&!t.returnAggIds&&t.outStatistics.every(t=>function(t,e){switch(t.statisticType){case"count":return"1"===t.onStatisticField||null!=e.get(t.onStatisticField);case"min":case"max":{let i=e.get(t.onStatisticField);return null!=i&&(0,C.WA)(i)}default:return!1}}(t,e))}(i,this._fieldsIndex)){let t=await this._getStatisticsFromFiles(i);if(t)return t}return(await this._enqueueQuery(i,e)).createQueryResponse()}async _getStatisticsFromFiles(t){let e=await this._provider.getFiles(),i={},r=[];for(let s of t.outStatistics??[]){let t=X(s,e);if(!t.available)return null;i[s.outStatisticFieldName]=t.value,r.push(Y(s,this._fieldsIndex))}return{fields:r,features:[{attributes:i}]}}async _getSpatialFilePruning(t){if("tile"!==t.type&&("arcade"!==t.type||null==t.extent))return null;let e=this._displayOptimization?.index;if(null==e)return null;let i=t.outSpatialReference.wkid;if(null==e.wkid||null==i)return null;let r=e.wkid,s=await(0,O.N)();switch(e.type){case"xz":return{type:"xz",fieldName:(0,y.FG)(e.code),intersects:(n,a)=>s.queryIntersectsXZStatistics(e.fullExtent,t.extent,i,r,e.maxLevel,n,a)};case"z":return{type:"xy",xFieldName:(0,y.FG)(e.xColumn),yFieldName:(0,y.FG)(e.yColumn),intersects:(e,n,a,u)=>s.queryIntersectsXYStatistics(t.extent,i,r,e,n,a,u)}}}_mayIncludeFileForSpatialPruning(t,e){switch(e.type){case"xz":{let i=et(t,e);return"null-only"!==i?.type&&("bounds"!==i?.type||e.intersects(i.minValue,i.maxValue))}case"xy":{let i=t.statistics.statistics.get(e.xFieldName),r=t.statistics.statistics.get(e.yFieldName);return"null-only"!==i?.type&&"null-only"!==r?.type&&("bounds"!==i?.type||"bounds"!==r?.type||e.intersects(i.minValue,i.maxValue,r.minValue,r.maxValue))}}}async _tryDeriveParquetFullExtent(t){if(!t.spatialReference)return null;if(null==this._fullExtent&&"location"===t.geometryEncoding?.type){let e=await this._provider.getFiles(),{xField:i,yField:s}=t.geometryEncoding,n=(0,p.hZ)((0,p.vt)(),p.qv),a=!1;for(let t of e){let e=await t.file;for(let t of e.rowGroups()){let e={stack:[],error:void 0,hasError:!1};try{let u=(0,r.mS)(e,t.columnDescriptorForAttribute(i),!1),o=(0,r.mS)(e,t.columnDescriptorForAttribute(s),!1),l=(0,P.Hk)(u),h=(0,P.Hk)(o);if("bounds"===l?.type&&"bounds"===h?.type){let t=[l.minValue,h.minValue,l.maxValue,h.maxValue];(0,p.DC)(n,t),a=!0}t.free()}catch(t){e.error=t,e.hasError=!0}finally{(0,r.hk)(e)}}}return a?{xmin:n[0],ymin:n[1],xmax:n[3],ymax:n[4],spatialReference:t.spatialReference?.toJSON()}:null}return null}async _getFileInfoById(t){let e=await this._provider.getFiles();for(let i of e)if(i.id===t)return i;throw Error(`InternalError: File ${t} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(t){return(await this._getFileInfoById(t)).file}async _createParquetQuery(t,e,i,r,s){let n=(await(0,O.N)()).Query.new();null!=i&&n.setPreFilterStart(i),null!=r&&n.setPreFilterCount(r),null!=s&&n.setPostFilterCount(s);let a=await this._getRequiredFields(t);n.setOutFields(a),(t.geometry||t.returnGeometry)&&n.setReturnGeometry(!0),n.setReturnZ(!!t.returnZ),n.setReturnM(!!t.returnM);let u=this._tryGetGeneralizedGeometryResolution(t);null!=u&&n.setSourceResolution(u);let o=t.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=o.wkid;if(t.geometry&&((0,_.K8)(o)||(0,_.oT)(o))){let e=(0,m.C)((0,m.vt)(),m.qv);for(let i of(0,w.qo)(t.geometry))(0,m.DC)(e,i);n.setOutSpatialReference(l),n.setExtent({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]})}if(t.where){let{id:i,file:r}=e;await this._setWhereClause(n,await r,i,t.where)}return n}async _createParquetDisplayQuery(t,e,i){let r=(await(0,O.N)()).Query.new();if("tile"===i.type){r.setExtent(i.extent),r.setQuantizationTransform(i.transform);let t=this._sourceResolution(i.resolution,i.outSpatialReference);null!=t&&r.setSourceResolution(t)}else"arcade"===i.type&&null!=i.extent&&r.setExtent(i.extent);return r.setOutFields(i.outFields.filter(t=>null!=this._indexMap[t])),r.setOutSpatialReference(i.outSpatialReference.wkid),r.setReturnGeometry(i.returnGeometry),r.setReturnZ(i.returnZ),r.setReturnM(i.returnM),i.where&&await this._setWhereClause(r,t,e,i.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(t=>t.statistics.rowCount).reduce((t,e)=>t+e,0)}async _getByteLength(){return(await this._provider.getFiles()).map(t=>t.statistics.byteSize).reduce((t,e)=>t+e,0)}_validateQuery(t){if(!this._capabilities.query.supportsStatistics&&t.outStatistics)throw new n.A("parquet:unsupported","Statistics queries are not supported",{query:t});if(!this._capabilities.query.supportsOrderBy&&t.orderByFields?.length)throw new n.A("parquet:unsupported","Queries using orderBy are not supported",{query:t});if(!this._capabilities.query.supportsDistinct&&t.returnDistinctValues)throw new n.A("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:t})}async _setWhereClause(t,e,i,r){let s=this._indexMap,a=this._fieldsIndex,u={getAttribute(t,r){let n=s[r];if(null==n){if("__OBJECTID"===a.get(r)?.name){let e=t.row+t.rowGroupStart;return(0,F.xb)(i,e)}return null}let u=a.get(r);return(0,y.LC)(e,t.rowGroup,t.row,n,u.type)}},o=await(0,c.GP)(r,this._fieldsIndex);if(!o.isStandardized)throw new n.A("sql-parse-error","expression is not standardized");let l=o.fieldNames.map(t=>a.get(t)).filter(t=>t&&null!=this._indexMap[t?.name]);t.setWhere(r),t.setWhereEvaluator((t,e,i)=>o.testFeatureCompiled({rowGroup:t,row:e,rowGroupStart:i},u,null)),t.setWhereFields(l.map(t=>t.name))}async*_streamFeatures(t,e,i,r,s){let n=await this._provider.getFiles(),a=0;for(let u of n){let n=a,o=a+u.statistics.rowCount;if(a+=u.statistics.rowCount,null!=e&&e>=o)continue;let l=null==e?null:Math.max(e-n,0),h=i;if(null!=i){let t=e??0,r=t+i;h=Math.max(Math.min(r,o)-Math.max(t,n),0)}if(0===h)continue;let c=await this._createParquetQuery(t,u,l,h,r),f=await(await u.file).executeQuery(c,Z),d=async()=>{let t=await f.next(s);if(!t)return null;let e=new k.s(this._metadata,this._indexMap,t,u.id);return tt([new E.j(e,null,0,!1)],this._queryEngineParams)},p=await d();for(;null!=p;)yield p,p=await d()}}async _queryFeaturesWithQueryEnginePagination(t,e){let i=[],r=this._streamFeatures(t,null,null,null,e),s=await r.next();for(;!s.done;){let n=await s.value.executeQueryForOpaqueFeatures({...t,where:void 0},e);for(let t of n)i.push(t);s=await r.next()}return i}async _queryFeaturesWithUpfrontPagination(t,e){let i,r,s,n=t.resultOffset??0,a=t.resultRecordCount??Z;!function(t){for(let e in t){let i=e;if(J(i)&&null!==t[i])return!0}return!1}(t)?(n&&=(i=n,0),r=t.resultRecordCount):function(t){for(let e in t){let i=e;if(U(i)&&null!==t[i])return!0}return!1}(t)||(s=n+a);let u=[],o=this._streamFeatures(t,i,r,s,e),l=await o.next();for(;!l.done&&a>0;){let i=await l.value.executeQueryForOpaqueFeatures({...t,where:void 0},e);for(let t of i)if(n>0)n--;else if(u.push(t),--a<=0)return u;l=await o.next()}return u}_enqueueQuery(t,e){return this._queue.push(t,e)}async _executeQuery(t,e){if(t.objectIds?.length){let i=new Map;for(let e of t.objectIds){let t=(0,F.wY)(e),r=(0,F.gE)(e),s=i.get(t);s||(s=[],i.set(t,s)),s.push(r)}let r=[];for(let[s,n]of i.entries()){let i=await this._executeFileIdQuery(t,s,n,e);for(let t of i)r.push(t)}return new M.G(r,t,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:Q,featureIdInfo:this._queryEngineParams.featureIdInfo})}if("1=1"===t.where&&(t.where=null),t.resultOffset??=0,t.resultRecordCount??=await this._getFeatureCount(),t.resultRecordCount>2e7&&(!this._displayOptimization||!t.geometry))throw new n.A("parquet:cannot-execute-query","Unable to execute query, dataset is too large.");let i=!!t.orderByFields?.length||!!t.outStatistics?.length||!!t.returnDistinctValues,r=i?await this._queryFeaturesWithQueryEnginePagination(t,e):await this._queryFeaturesWithUpfrontPagination(t,e);return i||(t.resultOffset=0),new M.G(r,t,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:Q,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(t,e,i,r){let s=await this._getRequiredFields(t),n=(await(0,O.N)()).Query.new();n.setOutFields(s),n.setReturnGeometry(!!t.returnGeometry),n.setReturnZ(!!t.returnZ),n.setReturnM(!!t.returnM),n.setIds(new Uint32Array(i));let a=await(await this._getFile(e)).executeQuery(n,Z,r),u=await a.next(r),o=0,l=[];for(;null!=u;){let t=new k.s(this._metadata,this._indexMap,u,e),i=new E.j(t,null,o++,!1);l.push(i),u=await a.next(r)}return tt(l,this._queryEngineParams).executeQueryForOpaqueFeatures(t,r)}async _getRequiredFields(t){let e=new Set;if(t.outStatistics)for(let i of(0,x.g9)(this._fieldsIndex,t.outStatistics,t.groupByFieldsForStatistics))e.add(i);else if(t.outFields)for(let i of t.outFields)e.add(i);return(e.has("*")?this._fieldsIndex.fields.map(t=>t.name):Array.from(e)).filter(t=>null!=this._indexMap[t])}_tryGetGeneralizedGeometryResolution(t){if(!this._displayOptimization)return null;let e=t.outSR??this._queryEngineParams.spatialReference;if(!(0,_.K8)(e)&&!(0,_.oT)(e))return null;let i=t.quantizationParameters?.tolerance??t.maxAllowableOffset;return i?this._sourceResolution(i,e):null}_sourceResolution(t,e){let i=this._queryEngineParams.spatialReference,r=(0,f.GA)(e)/(0,f.GA)(i)*t;return!Number.isFinite(r)||r<=0?null:r}}function L(t){switch(t){case"fullText":case"having":case"timeExtent":case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"geometry":case"resultOffset":case"resultRecordCount":return!0;default:return!1}}function J(t){switch(t){case"fullText":case"having":case"timeExtent":case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"geometry":return!0;default:return!1}}function U(t){switch(t){case"fullText":case"having":case"timeExtent":return!0;case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"resultOffset":case"geometry":case"resultRecordCount":return!1}return!1}function H(t){for(let e in t){let i=e;if(L(i)&&null!==t[i])return!0}return!1}function Y(t,e){let i="exceedslimit"===t.statisticType?null:e.get(t.onStatisticField),r="min"!==t.statisticType&&"max"!==t.statisticType||"esriFieldTypeDate"!==i?.type?"esriFieldTypeDouble":i.type;return{name:t.outStatisticFieldName,alias:t.outStatisticFieldName,type:r}}function X(t,e){switch(t.statisticType){case"count":return function(t,e){if("count"!==t.statisticType)return{available:!1,value:null};if("1"===t.onStatisticField)return{available:!0,value:e.reduce((t,e)=>t+e.statistics.rowCount,0)};let i=0;for(let r of e){let e=r.statistics.statistics.get(t.onStatisticField);if(null==e||null==e.nullCount)return{available:!1,value:null};i+=r.statistics.rowCount-e.nullCount}return{available:!0,value:i}}(t,e);case"min":return $(t,e,Math.min);case"max":return $(t,e,Math.max);default:return{available:!1,value:null}}}function $(t,e,i){if("min"!==t.statisticType&&"max"!==t.statisticType)return{available:!1,value:null};let r=null,s="min"===t.statisticType?"minValue":"maxValue";for(let n of e){let e=n.statistics.statistics.get(t.onStatisticField);if(null==e)return{available:!1,value:null};switch(e.type){case"null-only":continue;case"unknown":return{available:!1,value:null};case"bounds":{let t=K(e[s]);if(null==t)return{available:!1,value:null};r=null==r?t:i(r,t);break}}}return{available:!0,value:r}}function K(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function tt(t,e){let i=new T.I;for(let e of t)i.insert(e);return new w.do({...e,featureStore:i})}function et(t,e){return t.statistics.statistics.get(e.fieldName)??null}function it(t,e){let i=et(t,e);return"bounds"===i?.type?i.maxValue-i.minValue:1/0}function rt(t,e,i){let r=t?.featureCount,s=!1;return null!=r&&r<(0,u.A)("parquetlayer-full-query-feature-count")&&(s=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:i,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...z.F,maxRecordCount:Z,supportsOrderBy:s,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7063],{26887(e,t,i){function r(){return[1,0,0,1,0,0]}function n(e,t,i,r,n,a){return[e,t,i,r,n,a]}i.d(t,{fA:()=>n,vt:()=>r});Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:[1,0,0,1,0,0],clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]},create:r,fromValues:n},Symbol.toStringTag,{value:"Module"}))},4144(e,t,i){i.r(t),i.d(t,{clipToSpatialReference:()=>s,execute:()=>u,executeMany:()=>p,foldInto360Range:()=>h,foldInto360RangeGeodetic:()=>c,isLoaded:()=>o,load:()=>l,normalizeGeometry:()=>d,supportsCurves:()=>f,transform:()=>g});var r=i(76061),n=i(83290);let a;function o(){return!!a&&(0,n.i)()}async function l(){if(!o()){let[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(9192)]).then(()=>i(9192)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(5756)]).then(()=>i(15756)).then(({injectPe:e})=>e),(0,n.l)()]);a=new e.OperatorProject,t(n.p)}}function s(e,t,i){return a.clipToSpatialReference(e,t,null,i)}function u(e,t){return a.execute(e,t,null)}function p(e,t){let i=a.executeMany(new r.S(e),t,null);return Array.from(i)}function h(e,t){return a.foldInto360Range(e,t)}function c(e,t,i){return a.foldInto360RangeGeodetic(e,t,i)}function d(e,t,i){return a.normalizeGeometry(e,t,i)}function f(){return a.supportsCurves()}function g(e,t,i,r,n){return a.transform(e,t,i,r,n)}},83276(e,t,i){i.r(t),i.d(t,{execute:()=>y,executeMany:()=>x,isLoaded:()=>f,load:()=>m,projectExecute:()=>_,projectExecuteMany:()=>w,projectIsLoaded:()=>d,projectLoad:()=>g,projectSupportsCurves:()=>h,supportsCurves:()=>c});var r=i(4144),n=i(85036),a=i(17499);let o,l,s,u,p,h,c;function d(){return!!o&&(0,r.isLoaded)()}function f(){return(0,n.Q)("projectOperator","isLoaded","projectIsLoaded"),d()}async function g(){if(!d()){let[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(9567),i.e(9829),i.e(1666)]).then(()=>i(78125)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(6129)]).then(()=>i(86129)),(0,r.load)()]);o=e.fromGeometry,l=e.fromSpatialReference,s=e.getSpatialReference,u=e.toGeometry,p=t.createProjectionTransformation,h=(0,r.supportsCurves)(),c=h}}function m(){return(0,n.Q)("projectOperator","load","projectLoad"),g()}function _(e,t,i){let n=s(e),h=p(l(n),l(t),i),c=u((0,r.execute)(o(e),h),t);return!i?.zConversionDisabled&&c?.hasZ&&(0,a.g)([c],n,t),c}function y(e,t,i){return(0,n.Q)("projectOperator","execute","projectExecute"),_(e,t,i)}function w(e,t,i){let n=e.map(o),h=s(e),c=p(l(h),l(t),i),d=(0,r.executeMany)(n,c).map(e=>u(e,t));return!i?.zConversionDisabled&&d&&(0,a.g)(d,h,t),d}function x(e,t,i){return(0,n.Q)("projectOperator","executeMany","projectExecuteMany"),w(e,t,i)}},17499(e,t,i){i.d(t,{g:()=>a});var r=i(60408),n=i(62815);function a(e,t,i){let a;for(let o of e)if(o&&(0,r.Pv)(o)&&!("vertexAttributes"in o)){if(!a){let e="type"in o?o.type:(0,r.$B)(o);if(a=(0,n.N)(e,t,i),!a)return}a(o)}}},62815(e,t,i){i.d(t,{N:()=>l,d:()=>s});var r=i(86211),n=i(73941),a=i(21325),o=i(52006);function l(e,t,i){let r=s(t,i);if(1!==r)switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,r);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e){if(e.curvePaths)for(let i of e.curvePaths)for(let e of i){let i=(0,o.yP)(e);i.length>2&&(i[2]*=t)}if(e.paths)for(let i of e.paths)for(let e of i)e.length>2&&(e[2]*=t)}}(e,r);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e){if(e.curveRings)for(let i of e.curveRings)for(let e of i){let i=(0,o.yP)(e);i.length>2&&(i[2]*=t)}if(e.rings)for(let i of e.rings)for(let e of i)e.length>2&&(e[2]*=t)}}(e,r);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(let i of e.points)i.length>2&&(i[2]*=t)}(e,r);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,r);default:return}}function s(e,t){return null==e||null==t||(0,a.aI)(e,t)||(0,n.xP)(e)||(0,n.xP)(t)?1:(0,r.G9)(e)/(0,r.G9)(t)}},87063(e,t,i){i.r(t),i.d(t,{default:()=>xe});var r=i(32198),n=i(49186),a=i(25728),o=i(91429),l=i(16930),s=i(21325),u=i(4146),p=i(63074),h=i(72545),c=i(25036),d=i(86738),f=i(92474),g=i(83027),m=i(17676),_=i(48163),y=i(37585),w=i(5443),x=i(39829),P=i(88411),A=i(83276);class v{constructor(e){this.ctm=e.ctm,this.spatialReference=e.toSpatialReference(),this.pairedNeatline=e.pairedNeatline,this.outerExtentMediabox=this._getExtentFromArray(e.outerExtentMediaBox),this.geoControlPoints=e.geoControlPoints,this.outerMediaBox=e.outerExtentMediaBox,this.sourceMediaBoxPolygon=this.createSourceMediaBoxPolygon(),this.sourceNeatlinePolygon=this.createSourceNeatlinePolygon()}createSourceMediaBoxPolygon(){let e=[];for(let[t,i]of this.outerMediaBox){let r=M(this.ctm,t,i);e.push([r[0],r[1]])}return new x.A({rings:[e],spatialReference:this.spatialReference})}createSourceNeatlinePolygon(){let e=[];for(let[t,i]of this.pairedNeatline){let r=M(this.ctm,t,i);e.push([r[0],r[1]])}return new x.A({rings:[e],spatialReference:this.spatialReference})}createProjectedPolygon(e,t,i){(0,m.Te)(i);let r=e;if(r.spatialReference.equals(t))return r;if(!r||!r.extent)throw new n.A("geospatial-pdf-layer:load","Could not project neatline");let a=Math.max(r.extent.width,r.extent.height)/256,o=(0,P.densifyExecute)(r,a);return(0,A.projectExecute)(o,t)}toExtent(){return this._getExtentFromArray(this.pairedNeatline)}_getExtentFromArray(e){let t=1/0,i=1/0,r=-1/0,n=-1/0;for(let a=0;a<e.length;a++){let o=M(this.ctm,e[a][0],e[a][1]);t=Math.min(t,o[0]),i=Math.min(i,o[1]),r=Math.max(r,o[0]),n=Math.max(n,o[1])}return new w.A({xmin:t,ymin:i,xmax:r,ymax:n,spatialReference:this.spatialReference})}}function M(e,t,i){let[r,n,a,o,l,s]=e,u=(0,_.vt)();return(0,y.hZ)(u,r*t+a*i+l,n*t+o*i+s),u}i(44208);var R=i(26887),C=i(48237);function T(e,t,i,r){let n=Math.min(e.length,t.length,3),a=e.slice(0,n).map((e,r)=>({sourcePoint:{x:e[0],y:e[1]},mapPoint:new d.A({x:t[r][0],y:t[r][1],spatialReference:i})}));return new C.A({controlPoints:a,width:r.xmax-r.xmin,height:r.ymax-r.ymin})}function F(e){if(!e?.transform||e.transform.length<6)throw new n.A("geospatial-pdf-layer:georefrencer","created georeferencer does not have valid transform");return e.transform}function E(e){return(0,R.fA)(e[0],-e[1],-e[3],e[4],e[2],e[5])}function S(e){return[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]}class b{constructor(e){let t=this.inputValidation(e);this._registration=t.registration,this._projection=t.projection,this._neatline=t.neatline,this.pairedNeatline=this._pairNeatline(),this.outerExtentMediaBox=S(t.mediaBox),this.geoControlPoints=this._getRegistrationPoints("geo"),this.ctm=t.ctm??this._buildCTMFromRegistration(),this.outputValidation()}inputValidation(e){let{ctm:t,registration:i,projection:r,display:a,neatline:o,mediaBox:l}=e;if(t&&6!==t.length)throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict has invalid CTM.");if(!t&&(!i||i.length<3))throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict missing CTM and minimum registration points");if(!l||4!==l.length)throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid MediaBox.");if(!o||o.length<4||o.length%2!=0)throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid amount of neatline points");return{ctm:t?(0,R.fA)(t[0],t[1],t[2],t[3],t[4],t[5]):void 0,registration:i??[],projection:r,display:a,neatline:o,mediaBox:l}}outputValidation(){if(6!==this.ctm.length)throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid CTM");if(this.pairedNeatline.length<4)throw new n.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(4!==this.outerExtentMediaBox.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Failed to generate outerextent from mediaBox.");if(!this.ctm&&this.geoControlPoints.length<2)throw new n.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints if defaulting.")}toSpatialReference(){return this._projection}_buildCTMFromRegistration(){let e=[],t=[];for(let i of this._registration)i.length<4||(e.push((0,_.fA)(i[0],i[1])),t.push((0,_.fA)(i[2],i[3])));let i=this._getSourceRect();return E(F(T(e,t,this.toSpatialReference(),i)))}_extentFromArray(e){let t=1/0,i=1/0,r=-1/0,a=-1/0;for(let n=0;n<e.length;n++){let o=e[n];t=Math.min(t,o[0]),i=Math.min(i,o[1]),r=Math.max(r,o[0]),a=Math.max(a,o[1])}if(!(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)&&Number.isFinite(a)))throw new n.A("geospatial-pdf-layer: invalid-frame","Failed to compute extent from registration.");return{xmin:t,ymin:i,xmax:r,ymax:a}}_getSourceRect(){if(4===this.outerExtentMediaBox?.length)return this._extentFromArray(this.outerExtentMediaBox);if(this._neatline.length>=6)return this._extentFromArray(this.pairedNeatline);let e=this._getRegistrationPoints("page");if(e.length>=2)return this._extentFromArray(e);throw new n.A("geospatial-pdf-layer: invalid-frame","Cannot build source rectangle from Neatline or Registration points.")}_getRegistrationPoints(e){let[t,i]="page"===e?[0,1]:[2,3];return this._registration.filter(e=>e.length>i).map(e=>[e[t],e[i]])}_pairNeatline(){let e=[];for(let t=0;t<this._neatline.length;t+=2){let i=this._neatline[t],r=this._neatline[t+1];Number.isFinite(i)&&Number.isFinite(r)&&e.push([i,r])}return 2===e.length&&(e.splice(1,0,[e[1][0],e[0][1]]),e.push([e[0][0],e[2][1]])),e}}const j={OriginLatitude:"Origin_Latitude",CentralMeridian:"Central_Meridian",ScaleFactor:"Scale_Factor",FalseEasting:"False_Easting",FalseNorthing:"False_Northing",Zone:"Zone",Hemisphere:"Hemisphere",StandardParallelOne:"Standard_Parallel_One",StandardParallelTwo:"Standard_Parallel_Two"},D=/^(?:NAD83|NORTH AMERICAN 1983|NAR(?:-[A-Z])?)$/i,L=/^(?:NAD27|NORTH AMERICAN 1927|NAS(?:-[A-Z])?)$/i,G=/^(?:WGS84|WGS 84|WGE)$/i;function N(e){let t=function(e){return function(e){let t,i=function(e){switch(e){case"Projection":case"Display":return e;default:return}}(e.Type),r=function(e){switch(e){case"TC":case"PH":case"UT":case"AC":case"LE":case"SPCS":return e;default:return}}(e.Projection_Type);if(r||(t="Projection is missing or has unsupported ProjectionType"),i||(t="Projection dictionary is missing or has invalid Type. Expected Projection or Display."),e.Datum||(t="Projection is missing a Datum"),t)throw new n.A("geospatial-pdf-layer:invalid-projection",t);return I(e,r),{kind:"projected",dictionaryType:i,projectionType:r,datum:e.Datum}}(e)}(e);if("projected"===t.kind){let{projectionType:i,datum:r}=t;return"SPCS"===i?function(e,t){let i=$(t);if(2800===e.Zone&&i&&z(i))return new l.A({wkid:32110});throw new n.A("geospatial-pdf-layer:invalid-projection",`Unsupported State Plane projection: datum ${t.name}, zone ${e.Zone}`)}(e,r):new l.A({wkt:O(e,i,r)})}}function I(e,t){let i=function(e){switch(e){case"TC":return["OriginLatitude","CentralMeridian","ScaleFactor","FalseEasting","FalseNorthing"];case"PH":return["OriginLatitude","CentralMeridian","FalseEasting","FalseNorthing"];case"UT":return["Zone","Hemisphere"];case"AC":case"LE":return["OriginLatitude","CentralMeridian","StandardParallelOne","StandardParallelTwo","FalseEasting","FalseNorthing"];case"SPCS":return["Zone"]}}(t);for(let r of i){let i=e[j[r]];if(void 0===i||""===i)throw new n.A("geospatial-pdf-layer:invalid-projection",`Projection ${t} missing required parameter ${r}.`)}}function O(e,t,i){let r=function(e,t,i){let r=function(e){let t=$(e);return t?z(t)?"NAD_1983":B(t)?"NAD_1927":Z(t)?"WGS_1984":"geospatialPDF":"geospatialPDF"}(i);switch(t){case"TC":return`${r}_GeospatialPDF_Transverse_Mercator`;case"PH":return`${r}_GeospatialPDF_Polyconic`;case"UT":return`${r}_GeospatialPDF_UTM_Zone_${e.Zone}_${e.Hemisphere}`;case"AC":return`${r}_GeospatialPDF_Albers_Equal_Area`;case"LE":return`${r}_GeospatialPDF_Lambert_Conformal_Conic`}}(e,t,i),a=function(e){switch(e){case"TC":case"UT":return"Transverse_Mercator";case"PH":return"Polyconic";case"AC":return"Albers";case"LE":return"Lambert_Conformal_Conic"}}(t),o=function(e){if("definition"===e.kind){let t=e.ellipsoid;if(!t?.semi_Major_Axis)throw new n.A("geospatial-pdf-layer:invalid-Datum","Datum definition requires semi-major axis");let i=function(e){if(null!=e.inverse_Flattening)return e.inverse_Flattening;let t=e.semi_Major_Axis,i=e.semi_Minor_Axis;if(null==t||null==i)throw new n.A("geospatial-pdf-layer:invalid-Datum","Ellipsoid definition missing InvFlattening or SemiMinorAxis.");return t===i?0:t/(t-i)}(t),r=e.name??"GeospatialPDF_Datum",a=`SPHEROID["${t.description??"GeospatialPDF_Spheroid"}",${t.semi_Major_Axis},${i}]`,o=e.to_WGS84;return`DATUM["${r}",${a}${o?`,TOWGS84[${o.dx??0},${o.dy??0},${o.dz??0},${o.rx??0},${o.ry??0},${o.rz??0},${o.sf??0}]`:""}]`}if(e.name){let t=e.name.toUpperCase();if(z(t))return'DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]]';if(B(t))return'DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]]';if(Z(t))return'DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]]'}throw new n.A("geospatial-pdf-layer:invalid-Datum","Unsupported datum "+e.name)}(i),l=function(e){let t=e.toLowerCase();return["m","meter","meters","metre","metres"].includes(t)?'UNIT["Meter",1.0]':["ft","foot","feet"].includes(t)?'UNIT["Foot",0.3048]':`UNIT["${e}",1.0]`}(e.Units??"M"),s=function(e,t){switch(t){case"TC":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Scale_Factor",${e.Scale_Factor}]`];case"PH":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`];case"AC":case"LE":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Standard_Parallel_1",${e.Standard_Parallel_One}]`,`PARAMETER["Standard_Parallel_2",${e.Standard_Parallel_Two}]`];case"UT":return function(e){if(!e.Zone)throw new n.A("geospatial-pdf-layer:invalid-projection","No zone found for projection code UT");let t=6*e.Zone-183;return['PARAMETER["False_Easting",500000]',`PARAMETER["False_Northing",${/^s/i.test(e.Hemisphere??"")?1e7:0}]`,`PARAMETER["Central_Meridian",${t}]`,'PARAMETER["Latitude_Of_Origin",0]','PARAMETER["Scale_Factor",0.9996]']}(e)}}(e,t);return`PROJCS["${r}",GEOGCS["${function(e){let t=$(e);return t?z(t)?"GCS_North_American_1983":B(t)?"GCS_North_American_1927":Z(t)?"GCS_WGS_1984":"GCS_GeospatialPDF":"GCS_GeospatialPDF"}(i)}",${o},PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["${a}"],${s.join(",\n ")},${l}]`}function $(e){return e.name?function(e){return e.trim().toUpperCase().replace(/_/g," ").replace(/\s+/g," ")}(e.name):null}function z(e){return D.test(e)}function B(e){return L.test(e)}function Z(e){return G.test(e)}class H{constructor(e){let{bbox:t,bounds:i,gpts:r,lpts:n,gcs:a,mediaBox:o}=this.inputValidation(e);this._bbox=t,this._bounds=i,this._gpts=r,this._lpts=n,this._gcs=a,this.outerExtentMediaBox=S(o),this.geoControlPoints=this._getProjectedGeoControlPoints().map(e=>[e[0],e[1]]);let l=this._getBoundsPolygonPage()??this._getPageControlPoints();this.pairedNeatline=l.map(e=>[e[0],e[1]]),this.neatLine=this.pairedNeatline.flat(),this._georeference=this._createControlPointsGeoreference();let s=F(this._georeference);this.ctm=E(s),this.outputValidation()}toSpatialReference(){return new l.A({wkt:this._gcs.WKT})}inputValidation(e){let{bbox:t,bounds:i,gpts:r,lpts:a,gcs:o,mediaBox:l}=e;if(!t||4!==t.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid BBox.");if(!l||4!==l.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid MediaBox.");if(!r||r.length<6||r.length%2!=0)throw new n.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid GPTS.");if(!a||a.length<6||a.length%2!=0)throw new n.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid LPTS.");if(a.length!==r.length)throw new n.A("geospatial-pdf-layer: invalid-frame","MeasureFrame LPTS and GPTS must be same length");if(!o?.WKT)throw new n.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid WKT.");return{bbox:t,bounds:i,gpts:r,lpts:a,gcs:{WKT:o.WKT},mediaBox:l}}outputValidation(){if(4!==this.outerExtentMediaBox.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Failed to generate outer extent from mediaBox.");if(this.geoControlPoints.length<2)throw new n.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints.");if(this.pairedNeatline.length<4)throw new n.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(!this.ctm||6!==this.ctm.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Missing or invalid Map Frame CTM")}_createControlPointsGeoreference(){let e=this._getPageControlPoints(),t=this._getProjectedGeoControlPoints(),i=this._getViewportRect();return T(e,t,this.toSpatialReference(),i)}_getBoundsPolygonLocal(){if(!this._bounds||this._bounds.length<8||this._bounds.length%2!=0)return null;let e=[];for(let t=0;t<this._bounds.length;t+=2)e.push({u:this._bounds[t],v:this._bounds[t+1]});return e}_getBoundsPolygonPage(){return this._getBoundsPolygonLocal()?.map(e=>this._localToPage(e.u,e.v))??null}_getPageControlPoints(){let e=[];for(let t=0;t<this._lpts.length;t+=2){let i=this._lpts[t],r=this._lpts[t+1];e.push(this._localToPage(i,r))}return e}_getProjectedGeoControlPoints(){let e=this.toSpatialReference(),t=[];for(let i=0;i<this._gpts.length;i+=2){let r=this._gpts[i],n=this._gpts[i+1],a=new d.A({x:n,y:r}),o=(0,A.projectExecute)(a,e);t.push((0,_.fA)(o.x,o.y))}return t}_getViewportRect(){let[e,t,i,r]=this._bbox;return{xmin:Math.min(e,i),ymin:Math.min(t,r),xmax:Math.max(e,i),ymax:Math.max(t,r)}}_localToPage(e,t){let[i,r,n,a]=this._bbox;return(0,_.fA)(i+e*(n-i),r+t*(a-r))}}function U(e){let t=re(e,"LGIDict map frame must be an object.");return{CTM:Q(t.CTM),Registration:X(t.Registration),Neatline:Q(t.Neatline),Projection:W(t.Projection),Display:W(t.Display)}}function k(e){let t=re(e,"Viewport frame must be an object."),i=function(e){if(ie(e))return{Bounds:Q(e.Bounds),GPTS:Q(e.GPTS),LPTS:Q(e.LPTS),GCS:V(e.GCS)}}(t.Measure);return{BBox:Q(t.BBox),Measure_Raw:t.Measure,Measure:i,Raw:t}}function V(e){if(ie(e))return{WKT:Y(e.WKT)}}function W(e){if(ie(e))return{Type:ee(e.Type),Units:ee(e.Units),Datum:J(e.Datum),Projection_Type:ee(e.ProjectionType),Central_Meridian:te(e.CentralMeridian),False_Easting:te(e.FalseEasting),False_Northing:te(e.FalseNorthing),Height:te(e.Height),Hemisphere:ee(e.Hemisphere),Latitude_One:te(e.LatitudeOne),Latitude_Two:te(e.LatitudeTwo),Latitude_Of_True_Scale:te(e.LatitudeOfTrueScale),Longitude_One:te(e.LongitudeOne),Longitude_Two:te(e.LongitudeTwo),Longitude_Down_From_Pole:te(e.LongitudeDownFromPole),Orientation:ee(e.Orientation),Origin_Height:te(e.OriginHeight),Origin_Latitude:te(e.OriginLatitude),Origin_Longitude:te(e.OriginLongitude),Scale_Factor:te(e.ScaleFactor),Standard_Parallel:te(e.StandardParallel),Standard_Parallel_One:te(e.StandardParallelOne),Standard_Parallel_Two:te(e.StandardParallelTwo),Zone:te(e.Zone),Description:ee(e.Description),raw:e}}function J(e){return null==e?null:"string"==typeof e?{kind:"name",name:ee(e),ellipsoid:null,to_WGS84:null,raw:e}:ie(e)?{kind:"definition",name:ee(e.Description),ellipsoid:K(e.Ellipsoid),to_WGS84:q(e.ToWGS84),raw:e}:{kind:"unknown",name:ee(e),ellipsoid:null,to_WGS84:null,raw:e}}function K(e){if(ie(e))return{semi_Major_Axis:te(e.SemiMajorAxis),inverse_Flattening:te(e.InvFlattening),semi_Minor_Axis:te(e.SemiMinorAxis),description:ee(e.Description)}}function q(e){if(ie(e))return{dx:te(e.dx)??0,dy:te(e.dy)??0,dz:te(e.dz)??0,rx:te(e.rx)??0,ry:te(e.ry)??0,rz:te(e.rz)??0,sf:te(e.sf)??0}}function Q(e){if(!Array.isArray(e))return;let t=[];for(let i of e){let e=te(i);if(void 0===e)return;t.push(e)}return t}function X(e){if(Array.isArray(e))return e.filter(e=>Array.isArray(e)).map(e=>e.map(e=>te(e)).filter(e=>void 0!==e))}function Y(e){if(null!=e)return"string"==typeof e?e:String(e)}function ee(e){let t=Y(e);if(void 0!==t)return t.trim()}function te(e){if(null==e)return;if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"!=typeof e)return;let t=e.trim();if(""===t)return;let i=Number(t);return Number.isFinite(i)?i:void 0}function ie(e){return"object"==typeof e&&!!e&&!Array.isArray(e)}function re(e,t){if(!ie(e))throw new n.A("geospatial-pdf-layer:parse",t);return e}let ne=class extends f.x_{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){let t=(0,g.h)("GeospatialPDFLayerWorker",{...e,strategy:"dedicated",registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);let{geospatialMetadata:i}=await this._workerHandler.loadPDF(e,t),r=function(e,t=0){let i={mediaBox:Q(e.MediaBox),rotate:te(e.Rotate),hasLGIDict:null!=e.LGIDict,hasVP:null!=e.VP},r=(a=t,function(e){return null==e?[]:Array.isArray(e)?e.map(e=>U(e)):[U(e)]}(e.LGIDict)[a]);var a;if(r){if(!r.Projection)throw new n.A("geospatial-pdf-layer:parse","LGIDict map frame missing Projection.");let t,a=N(r.Projection);try{t=r.Display?N(r.Display):void 0}catch{t=a}return{result:i,lgiDictFrame:new b({ctm:r.CTM,registration:r.Registration,projection:a,display:t,neatline:r.Neatline,mediaBox:Q(e.MediaBox)})}}let o=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>k(e)):[k(e)]}(e)[t]}(e.VP,t);return o?{result:i,vpFrame:new H({bbox:o.BBox,bounds:o.Measure?.Bounds,gpts:o.Measure?.GPTS,lpts:o.Measure?.LPTS,gcs:o.Measure?.GCS,mediaBox:Q(e.MediaBox)})}:{result:i}}(i,0),a=r.lgiDictFrame??r.vpFrame;if(!a)throw new n.A("geospatial-pdf-layer:load","pdf does not contain supported LGIDict or VP/Measure.");let o=new v(a);return{frame:o,sourceSpatialReference:o.spatialReference.toJSON(),fullExtent:o.toExtent()}}async render(e,t,i,r,n,a){let o={sourceExtentAsJSON:e.toJSON(),width:t,height:i,ctm:r,currentRing:n};return this._workerHandler.renderPDF(o,a)}};ne=(0,r.Cg)([(0,o.$K)("esri.layers.geospatialPDF.GeospatialPDFWorkerClient")],ne);var ae=i(49859),oe=i(14140),le=i(87186);let se=class extends ae.A{constructor(){super(...arguments),this._workerClient=new ne,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat="PDF",this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType="Raster"}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(e,t,i,r={}){let n=this._extent,a=this._ctm,o=this.getTileExtentPDF(e,t,i);return o.intersects(n)?function(e){return new oe.A({width:e.width,height:e.height,pixelType:"u8",pixels:[e.red,e.green,e.blue],mask:e.mask})}(await this._workerClient.render(o,this._tileSize,this._tileSize,a,this._neatlineRing,r)):null}async _open(e){if(!this.url)throw new n.A("geospatial-pdf-raster:open","GeospatialPDFRaster requires a url.");let t=await this._workerClient.loadPDF({url:this.url,page:this.page},e);this.frame=t.frame;let i=this.frame.outerExtentMediabox;if(!i)throw new n.A("geospatial-pdf-raster:open","Failed to compute Geospatial PDF extent.");this.neatlineExtent=t.fullExtent,this._extent=i,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];let r=function(e,t){let[i,r,a,o]=e,l=i*o-r*a;if(!Number.isFinite(l)||0===l)throw new n.A("geospatial-pdf-raster:open","Failed to derive raster dimensions from an invalid PDF CTM.");let s=10*Math.hypot(o,r)/Math.abs(l),u=10*Math.hypot(a,i)/Math.abs(l),p=Math.max(1,Math.ceil(t.width*s)),h=Math.max(1,Math.ceil(t.height*u));if(!Number.isFinite(p)||!Number.isFinite(h))throw new n.A("geospatial-pdf-raster:open","PDF CTM produced invalid raster dimensions.");return[p,h]}(this.frame.ctm,this._extent);this._width=r[0],this._height=r[1];let a={x:i.width/this._width,y:i.height/this._height},o=new le.A({width:this._width,height:this._height,pixelType:"u8",extent:i,pixelSize:a,spatialReference:i.spatialReference,bandCount:3,keyProperties:{DataType:"Processed"}});this.createRemoteDatasetStorageInfo(o,this._tileSize,this._tileSize),this._set("rasterInfo",o),this.updateTileInfo()}getTileExtentPDF(e,t,i){let r=this._extent,n=2**e,a=r.width/this._width*n,o=r.height/this._height*n,l=new d.A({x:r.xmin,y:r.ymax});return this.getTileExtent({x:a,y:o},t,i,l,r.spatialReference,[512,512])}};(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,o.MZ)({constructOnly:!0})],se.prototype,"page",void 0),(0,r.Cg)([(0,o.MZ)({readOnly:!0})],se.prototype,"tileType",void 0),se=(0,r.Cg)([(0,o.$K)("esri.layers.raster.datasets.GeospatialPDFRaster")],se);var ue=i(34930),pe=i(69540),he=i(25482),ce=i(64108),de=i(80812),fe=i(36005),ge=i(43937);let me=class extends((0,he.T)(pe.Pw)){constructor(e){super(e),this.type="portal-item"}readPortalItem(e,t,i){if(t.itemId)return new de.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}};(0,r.Cg)([(0,o.MZ)({type:["portal-item"],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],me.prototype,"type",void 0),(0,r.Cg)([(0,o.MZ)({type:de.default,json:{write:{isRequired:!0}}})],me.prototype,"portalItem",void 0),(0,r.Cg)([(0,fe.w)("portalItem",["itemId"])],me.prototype,"readPortalItem",null),(0,r.Cg)([(0,ge.K)("portalItem",{itemId:{type:String}})],me.prototype,"writePortalItem",null),me=(0,r.Cg)([(0,ce.$)("esri.layers.support.PortalItemData")],me);var _e=i(87045);let ye=class extends((0,p.dM)((0,c.j)((0,h.G)((0,a.M)(u.A))))){constructor(e){super(e),this.serviceRasterInfo=null,this._frame=null,this._objectURL=null,this.clippedToNeatline=!1,this.data=null,this.raster=null,this.spatialReference=null,this.type="geospatial-pdf"}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy(),this._objectURL&&=(URL.revokeObjectURL(this._objectURL),null)}get fullExtent(){return this.serviceRasterInfo?.extent}async fetchImageBitmapTile(){throw new n.A("geospatial-pdf-layer:fetch-image-bitmap-tile","GeospatialPDFLayer does not expose pre-rendered image tile URLs.")}async fetchPixels(e,t,i,r={}){return we(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(i),r)}async fetchTile(e,t,i,r={}){if(we(this),r.requestAsImageElement)throw new n.A("geospatial-pdf-layer:fetch-tile","GeospatialPDFLayer does not support requestAsImageElement.");await this._initJobHandler();let a=await this.raster.fetchTile(e,t,i,r);return this.clippedToNeatline&&a.pixelBlock&&this._frame&&a.srcExtent&&(a.pixelBlock=await(0,ue.$Q)(a.pixelBlock,a.srcExtent,this._frame.sourceNeatlinePolygon)),a}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;let r=(0,s.Vp)(e);return _e.A.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return we(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(we(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getDataUrl(e){let{data:t}=this;if("string"==typeof t)return t;if(t instanceof File)return this._objectURL=URL.createObjectURL(t),this._objectURL;if(t instanceof me){await t.portalItem.load({signal:e?.signal});let i=t.portalItem.url;if(!i)throw new n.A("geospatial-pdf-layer:load","Portal item does not have a valid data URL.");return i}throw new n.A("geospatialpdf-layer:missing-data","A data source must be specified.")}async _load(e){let t=await this._getDataUrl(e);await this._openRaster(t,e?.signal)}async _openRaster(e,t){let i=new se({url:e});if(await i.open({signal:t}),!i.rasterInfo)throw i.destroy(),new n.A("geospatialpdf-layer:load","cannot load resources on "+e);let{rasterInfo:r}=i;this._set("serviceRasterInfo",r),this.setAtOrigin("spatialReference",r.spatialReference,"service"),this.setAtOrigin("tileInfo",r.storageInfo.tileInfo,"service"),this._frame=i.frame,this.raster=i}};function we(e){if(!e.raster||!e.serviceRasterInfo)throw new n.A("imagery-tile","no raster")}(0,r.Cg)([(0,o.MZ)()],ye.prototype,"serviceRasterInfo",void 0),(0,r.Cg)([(0,o.MZ)({clonable:!1})],ye.prototype,"_compatibleFullExtent",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],ye.prototype,"clippedToNeatline",void 0),(0,r.Cg)([(0,o.MZ)()],ye.prototype,"data",void 0),(0,r.Cg)([(0,o.MZ)({json:{read:!1}})],ye.prototype,"fullExtent",null),(0,r.Cg)([(0,o.MZ)()],ye.prototype,"raster",void 0),(0,r.Cg)([(0,o.MZ)({readOnly:!0,type:l.A,json:{read:!1}})],ye.prototype,"spatialReference",void 0),(0,r.Cg)([(0,o.MZ)({type:_e.A,readOnly:!0})],ye.prototype,"tileInfo",void 0),(0,r.Cg)([(0,o.MZ)({readOnly:!0,value:"geospatial-pdf"})],ye.prototype,"type",void 0),ye=(0,r.Cg)([(0,o.$K)("esri.layers.GeospatialPDFLayer")],ye);const xe=ye},91806(e,t,i){i.d(t,{A:()=>s});var r,n=i(32198),a=i(25482),o=i(91429),l=i(78888);let s=class extends a.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],s.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],s.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],s.prototype,"levelValue",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],s.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],s.prototype,"resolution",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],s.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],s.prototype,"scale",void 0),s=r=(0,n.Cg)([(0,o.$K)("esri.layers.support.LOD")],s)},87045(e,t,i){i.d(t,{A:()=>w});var r,n=i(32198),a=i(66552),o=i(25482),l=i(86211),s=i(91429),u=i(78888),p=i(86738),h=i(16930),c=i(21325),d=i(28735),f=i(91806),g=i(72802),m=i(36005),_=i(43937);const y=new a.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends o.o{static{r=this}static create(e={}){let{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:a=h.A.WebMercator,numLODs:o=24}=e;if(!(0,c.fn)(a)){let e=[];if(i)for(let t=0;t<i.length;t++){let r=i[t];e.push(new f.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new p.A(0,0,a),size:[n,n],spatialReference:a})}let s=(0,c.Vp)(a),u=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:a}):s?new p.A({x:s.origin[0],y:s.origin[1],spatialReference:a}):new p.A({x:0,y:0,spatialReference:a}),d=1/(39.37*(0,l.GA)(a)*96),g=[];if(i)for(let e=0;e<i.length;e++){let t=i[e],r=t*d;g.push(new f.A({level:e,scale:t,resolution:r}))}else{let e=(0,c.EA)(a)?512/n*591657527.5917094:256/n*591657527.591555,i=Math.ceil(o/t);g.push(new f.A({level:0,scale:e,resolution:e*d}));for(let r=1;r<i;r++){let i=e/2**t,n=i*d;g.push(new f.A({level:r,scale:i,resolution:n})),e=i}}return new r({dpi:96,lods:g,origin:u,size:[n,n],spatialReference:a})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){let{spatialReference:e,origin:t}=this;if(e&&t){let i=(0,c.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0,r=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){let t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];let i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){let t=this.scales,i=t.length-1,r=0;for(;r<i;r++){let i=t[r],n=t[r+1];if(i<=e)return r;if(n===e)return r+1;if(i>e&&n<e)return r+Math.log(i/e)/Math.log(i/n)}return r}tileAt(e,t,i,r){let n,a,o=this.lodAt(e);if(!o)return null;if("number"==typeof t)n=t,a=i;else if((0,c.aI)(t.spatialReference,this.spatialReference))n=t.x,a=t.y,r=i;else{let e=(0,d.Cv)(t,this.spatialReference);if(null==e)return null;n=e.x,a=e.y,r=i}let l=o.resolution*this.size[0],s=o.resolution*this.size[1];return r??=new g.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-a)/s+.001),r.col=Math.floor((n-this.origin.x)/l+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){let t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;let r=e.level-i.level,n=i.resolution*this.size[0]/2**r,a=i.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*n,e.extent[1]=this.origin.y-(e.row+1)*a,e.extent[2]=e.extent[0]+n,e.extent[3]=e.extent[1]+a,!0}upsampleTile(e){let t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){let i=this.lodAt(t.level);if(null==i)return null;let{resolution:r}=i,n=r*this.size[0],a=r*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*a,e[2]=e[0]+n,e[3]=e[1]+a,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;let t=(512===this.size[0]&&256===e?-1:0)+ +!!this.spatialReference.isGeographic;if(this.size[0]===e&&0===t)return this;let i=[],n=this.lods.length-t;for(let e=0;e<n;e++){let r=e+t,{scale:n,resolution:a}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:n,resolution:a}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){let e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){let r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,n.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,n.Cg)([(0,s.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,n.Cg)([(0,s.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,n.Cg)([(0,s.MZ)({type:p.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,n.Cg)([(0,m.w)("origin")],w.prototype,"readOrigin",null),(0,n.Cg)([(0,s.MZ)({type:[f.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,n.Cg)([(0,s.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,n.Cg)([(0,s.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,n.Cg)([(0,m.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,n.Cg)([(0,_.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],w.prototype,"writeSize",null),(0,n.Cg)([(0,s.MZ)({type:h.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=r=(0,n.Cg)([(0,s.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,i){i.d(t,{U:()=>n});var r=i(19419);class n{constructor(e,t,i,n=(0,r.vt)()){this._level=e,this._row=t,this._col=i,this.extent=n}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new n(e.level,e.row,e.col,e.extent)}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4907],{26887(e,t,i){function r(){return[1,0,0,1,0,0]}function n(e,t,i,r,n,a){return[e,t,i,r,n,a]}i.d(t,{fA:()=>n,vt:()=>r});Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:[1,0,0,1,0,0],clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]},create:r,fromValues:n},Symbol.toStringTag,{value:"Module"}))},4144(e,t,i){i.r(t),i.d(t,{clipToSpatialReference:()=>s,execute:()=>u,executeMany:()=>p,foldInto360Range:()=>h,foldInto360RangeGeodetic:()=>c,isLoaded:()=>o,load:()=>l,normalizeGeometry:()=>d,supportsCurves:()=>f,transform:()=>g});var r=i(76061),n=i(83290);let a;function o(){return!!a&&(0,n.i)()}async function l(){if(!o()){let[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(9192)]).then(()=>i(9192)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(5756)]).then(()=>i(15756)).then(({injectPe:e})=>e),(0,n.l)()]);a=new e.OperatorProject,t(n.p)}}function s(e,t,i){return a.clipToSpatialReference(e,t,null,i)}function u(e,t){return a.execute(e,t,null)}function p(e,t){let i=a.executeMany(new r.S(e),t,null);return Array.from(i)}function h(e,t){return a.foldInto360Range(e,t)}function c(e,t,i){return a.foldInto360RangeGeodetic(e,t,i)}function d(e,t,i){return a.normalizeGeometry(e,t,i)}function f(){return a.supportsCurves()}function g(e,t,i,r,n){return a.transform(e,t,i,r,n)}},83276(e,t,i){i.r(t),i.d(t,{execute:()=>y,executeMany:()=>x,isLoaded:()=>f,load:()=>m,projectExecute:()=>_,projectExecuteMany:()=>w,projectIsLoaded:()=>d,projectLoad:()=>g,projectSupportsCurves:()=>h,supportsCurves:()=>c});var r=i(4144),n=i(85036),a=i(17499);let o,l,s,u,p,h,c;function d(){return!!o&&(0,r.isLoaded)()}function f(){return(0,n.Q)("projectOperator","isLoaded","projectIsLoaded"),d()}async function g(){if(!d()){let[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(9567),i.e(9829),i.e(1666)]).then(()=>i(78125)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(6129)]).then(()=>i(86129)),(0,r.load)()]);o=e.fromGeometry,l=e.fromSpatialReference,s=e.getSpatialReference,u=e.toGeometry,p=t.createProjectionTransformation,h=(0,r.supportsCurves)(),c=h}}function m(){return(0,n.Q)("projectOperator","load","projectLoad"),g()}function _(e,t,i){let n=s(e),h=p(l(n),l(t),i),c=u((0,r.execute)(o(e),h),t);return!i?.zConversionDisabled&&c?.hasZ&&(0,a.g)([c],n,t),c}function y(e,t,i){return(0,n.Q)("projectOperator","execute","projectExecute"),_(e,t,i)}function w(e,t,i){let n=e.map(o),h=s(e),c=p(l(h),l(t),i),d=(0,r.executeMany)(n,c).map(e=>u(e,t));return!i?.zConversionDisabled&&d&&(0,a.g)(d,h,t),d}function x(e,t,i){return(0,n.Q)("projectOperator","executeMany","projectExecuteMany"),w(e,t,i)}},17499(e,t,i){i.d(t,{g:()=>a});var r=i(60408),n=i(62815);function a(e,t,i){let a;for(let o of e)if(o&&(0,r.Pv)(o)&&!("vertexAttributes"in o)){if(!a){let e="type"in o?o.type:(0,r.$B)(o);if(a=(0,n.N)(e,t,i),!a)return}a(o)}}},62815(e,t,i){i.d(t,{N:()=>l,d:()=>s});var r=i(86211),n=i(73941),a=i(21325),o=i(52006);function l(e,t,i){let r=s(t,i);if(1!==r)switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,r);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e){if(e.curvePaths)for(let i of e.curvePaths)for(let e of i){let i=(0,o.yP)(e);i.length>2&&(i[2]*=t)}if(e.paths)for(let i of e.paths)for(let e of i)e.length>2&&(e[2]*=t)}}(e,r);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e){if(e.curveRings)for(let i of e.curveRings)for(let e of i){let i=(0,o.yP)(e);i.length>2&&(i[2]*=t)}if(e.rings)for(let i of e.rings)for(let e of i)e.length>2&&(e[2]*=t)}}(e,r);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(let i of e.points)i.length>2&&(i[2]*=t)}(e,r);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,r);default:return}}function s(e,t){return null==e||null==t||(0,a.aI)(e,t)||(0,n.xP)(e)||(0,n.xP)(t)?1:(0,r.G9)(e)/(0,r.G9)(t)}},44907(e,t,i){i.r(t),i.d(t,{default:()=>fe});var r=i(32198),n=i(49186),a=i(25728),o=i(91429),l=i(16930),s=i(21325),u=i(4146),p=i(63074),h=i(72545),c=i(25036),d=i(86738),f=i(92474),g=i(83027),m=i(17676),_=i(48163),y=i(37585),w=i(5443),x=i(39829),P=i(88411),A=i(83276);class v{constructor(e){this.ctm=e.ctm,this.spatialReference=e.toSpatialReference(),this.pairedNeatline=e.pairedNeatline,this.outerExtentMediabox=this._getExtentFromArray(e.outerExtentMediaBox),this.geoControlPoints=e.geoControlPoints,this.outerMediaBox=e.outerExtentMediaBox,this.sourceMediaBoxPolygon=this.createSourceMediaBoxPolygon(),this.sourceNeatlinePolygon=this.createSourceNeatlinePolygon()}createSourceMediaBoxPolygon(){let e=[];for(let[t,i]of this.outerMediaBox){let r=M(this.ctm,t,i);e.push([r[0],r[1]])}return new x.A({rings:[e],spatialReference:this.spatialReference})}createSourceNeatlinePolygon(){let e=[];for(let[t,i]of this.pairedNeatline){let r=M(this.ctm,t,i);e.push([r[0],r[1]])}return new x.A({rings:[e],spatialReference:this.spatialReference})}createProjectedPolygon(e,t,i){(0,m.Te)(i);let r=e;if(r.spatialReference.equals(t))return r;if(!r||!r.extent)throw new n.A("geospatial-pdf-layer:load","Could not project neatline");let a=Math.max(r.extent.width,r.extent.height)/256,o=(0,P.densifyExecute)(r,a);return(0,A.projectExecute)(o,t)}toExtent(){return this._getExtentFromArray(this.pairedNeatline)}_getExtentFromArray(e){let t=1/0,i=1/0,r=-1/0,n=-1/0;for(let a=0;a<e.length;a++){let o=M(this.ctm,e[a][0],e[a][1]);t=Math.min(t,o[0]),i=Math.min(i,o[1]),r=Math.max(r,o[0]),n=Math.max(n,o[1])}return new w.A({xmin:t,ymin:i,xmax:r,ymax:n,spatialReference:this.spatialReference})}}function M(e,t,i){let[r,n,a,o,l,s]=e,u=(0,_.vt)();return(0,y.hZ)(u,r*t+a*i+l,n*t+o*i+s),u}i(44208);var R=i(26887),C=i(48237);function T(e,t,i,r){let n=Math.min(e.length,t.length,3),a=e.slice(0,n).map((e,r)=>({sourcePoint:{x:e[0],y:e[1]},mapPoint:new d.A({x:t[r][0],y:t[r][1],spatialReference:i})}));return new C.A({controlPoints:a,width:r.xmax-r.xmin,height:r.ymax-r.ymin})}function F(e){if(!e?.transform||e.transform.length<6)throw new n.A("geospatial-pdf-layer:georefrencer","created georeferencer does not have valid transform");return e.transform}function E(e){return(0,R.fA)(e[0],-e[1],-e[3],e[4],e[2],e[5])}function S(e){return[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]}class b{constructor(e){let t=this.inputValidation(e);this._registration=t.registration,this._projection=t.projection,this._neatline=t.neatline,this.pairedNeatline=this._pairNeatline(),this.outerExtentMediaBox=S(t.mediaBox),this.geoControlPoints=this._getRegistrationPoints("geo"),this.ctm=t.ctm??this._buildCTMFromRegistration(),this.outputValidation()}inputValidation(e){let{ctm:t,registration:i,projection:r,display:a,neatline:o,mediaBox:l}=e;if(t&&6!==t.length)throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict has invalid CTM.");if(!t&&(!i||i.length<3))throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict missing CTM and minimum registration points");if(!l||4!==l.length)throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid MediaBox.");if(!o||o.length<4||o.length%2!=0)throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid amount of neatline points");return{ctm:t?(0,R.fA)(t[0],t[1],t[2],t[3],t[4],t[5]):void 0,registration:i??[],projection:r,display:a,neatline:o,mediaBox:l}}outputValidation(){if(6!==this.ctm.length)throw new n.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid CTM");if(this.pairedNeatline.length<4)throw new n.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(4!==this.outerExtentMediaBox.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Failed to generate outerextent from mediaBox.");if(!this.ctm&&this.geoControlPoints.length<2)throw new n.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints if defaulting.")}toSpatialReference(){return this._projection}_buildCTMFromRegistration(){let e=[],t=[];for(let i of this._registration)i.length<4||(e.push((0,_.fA)(i[0],i[1])),t.push((0,_.fA)(i[2],i[3])));let i=this._getSourceRect();return E(F(T(e,t,this.toSpatialReference(),i)))}_extentFromArray(e){let t=1/0,i=1/0,r=-1/0,a=-1/0;for(let n=0;n<e.length;n++){let o=e[n];t=Math.min(t,o[0]),i=Math.min(i,o[1]),r=Math.max(r,o[0]),a=Math.max(a,o[1])}if(!(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)&&Number.isFinite(a)))throw new n.A("geospatial-pdf-layer: invalid-frame","Failed to compute extent from registration.");return{xmin:t,ymin:i,xmax:r,ymax:a}}_getSourceRect(){if(4===this.outerExtentMediaBox?.length)return this._extentFromArray(this.outerExtentMediaBox);if(this._neatline.length>=6)return this._extentFromArray(this.pairedNeatline);let e=this._getRegistrationPoints("page");if(e.length>=2)return this._extentFromArray(e);throw new n.A("geospatial-pdf-layer: invalid-frame","Cannot build source rectangle from Neatline or Registration points.")}_getRegistrationPoints(e){let[t,i]="page"===e?[0,1]:[2,3];return this._registration.filter(e=>e.length>i).map(e=>[e[t],e[i]])}_pairNeatline(){let e=[];for(let t=0;t<this._neatline.length;t+=2){let i=this._neatline[t],r=this._neatline[t+1];Number.isFinite(i)&&Number.isFinite(r)&&e.push([i,r])}return 2===e.length&&(e.splice(1,0,[e[1][0],e[0][1]]),e.push([e[0][0],e[2][1]])),e}}const j={OriginLatitude:"Origin_Latitude",CentralMeridian:"Central_Meridian",ScaleFactor:"Scale_Factor",FalseEasting:"False_Easting",FalseNorthing:"False_Northing",Zone:"Zone",Hemisphere:"Hemisphere",StandardParallelOne:"Standard_Parallel_One",StandardParallelTwo:"Standard_Parallel_Two"},D=/^(?:NAD83|NORTH AMERICAN 1983|NAR(?:-[A-Z])?)$/i,L=/^(?:NAD27|NORTH AMERICAN 1927|NAS(?:-[A-Z])?)$/i,G=/^(?:WGS84|WGS 84|WGE)$/i;function N(e){let t=function(e){return function(e){let t,i=function(e){switch(e){case"Projection":case"Display":return e;default:return}}(e.Type),r=function(e){switch(e){case"TC":case"PH":case"UT":case"AC":case"LE":case"SPCS":return e;default:return}}(e.Projection_Type);if(r||(t="Projection is missing or has unsupported ProjectionType"),i||(t="Projection dictionary is missing or has invalid Type. Expected Projection or Display."),e.Datum||(t="Projection is missing a Datum"),t)throw new n.A("geospatial-pdf-layer:invalid-projection",t);return I(e,r),{kind:"projected",dictionaryType:i,projectionType:r,datum:e.Datum}}(e)}(e);if("projected"===t.kind){let{projectionType:i,datum:r}=t;return"SPCS"===i?function(e,t){let i=$(t);if(2800===e.Zone&&i&&z(i))return new l.A({wkid:32110});throw new n.A("geospatial-pdf-layer:invalid-projection",`Unsupported State Plane projection: datum ${t.name}, zone ${e.Zone}`)}(e,r):new l.A({wkt:O(e,i,r)})}}function I(e,t){let i=function(e){switch(e){case"TC":return["OriginLatitude","CentralMeridian","ScaleFactor","FalseEasting","FalseNorthing"];case"PH":return["OriginLatitude","CentralMeridian","FalseEasting","FalseNorthing"];case"UT":return["Zone","Hemisphere"];case"AC":case"LE":return["OriginLatitude","CentralMeridian","StandardParallelOne","StandardParallelTwo","FalseEasting","FalseNorthing"];case"SPCS":return["Zone"]}}(t);for(let r of i){let i=e[j[r]];if(void 0===i||""===i)throw new n.A("geospatial-pdf-layer:invalid-projection",`Projection ${t} missing required parameter ${r}.`)}}function O(e,t,i){let r=function(e,t,i){let r=function(e){let t=$(e);return t?z(t)?"NAD_1983":B(t)?"NAD_1927":Z(t)?"WGS_1984":"geospatialPDF":"geospatialPDF"}(i);switch(t){case"TC":return`${r}_GeospatialPDF_Transverse_Mercator`;case"PH":return`${r}_GeospatialPDF_Polyconic`;case"UT":return`${r}_GeospatialPDF_UTM_Zone_${e.Zone}_${e.Hemisphere}`;case"AC":return`${r}_GeospatialPDF_Albers_Equal_Area`;case"LE":return`${r}_GeospatialPDF_Lambert_Conformal_Conic`}}(e,t,i),a=function(e){switch(e){case"TC":case"UT":return"Transverse_Mercator";case"PH":return"Polyconic";case"AC":return"Albers";case"LE":return"Lambert_Conformal_Conic"}}(t),o=function(e){if("definition"===e.kind){let t=e.ellipsoid;if(!t?.semi_Major_Axis)throw new n.A("geospatial-pdf-layer:invalid-Datum","Datum definition requires semi-major axis");let i=function(e){if(null!=e.inverse_Flattening)return e.inverse_Flattening;let t=e.semi_Major_Axis,i=e.semi_Minor_Axis;if(null==t||null==i)throw new n.A("geospatial-pdf-layer:invalid-Datum","Ellipsoid definition missing InvFlattening or SemiMinorAxis.");return t===i?0:t/(t-i)}(t),r=e.name??"GeospatialPDF_Datum",a=`SPHEROID["${t.description??"GeospatialPDF_Spheroid"}",${t.semi_Major_Axis},${i}]`,o=e.to_WGS84;return`DATUM["${r}",${a}${o?`,TOWGS84[${o.dx??0},${o.dy??0},${o.dz??0},${o.rx??0},${o.ry??0},${o.rz??0},${o.sf??0}]`:""}]`}if(e.name){let t=e.name.toUpperCase();if(z(t))return'DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]]';if(B(t))return'DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]]';if(Z(t))return'DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]]'}throw new n.A("geospatial-pdf-layer:invalid-Datum","Unsupported datum "+e.name)}(i),l=function(e){let t=e.toLowerCase();return["m","meter","meters","metre","metres"].includes(t)?'UNIT["Meter",1.0]':["ft","foot","feet"].includes(t)?'UNIT["Foot",0.3048]':`UNIT["${e}",1.0]`}(e.Units??"M"),s=function(e,t){switch(t){case"TC":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Scale_Factor",${e.Scale_Factor}]`];case"PH":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`];case"AC":case"LE":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Standard_Parallel_1",${e.Standard_Parallel_One}]`,`PARAMETER["Standard_Parallel_2",${e.Standard_Parallel_Two}]`];case"UT":return function(e){if(!e.Zone)throw new n.A("geospatial-pdf-layer:invalid-projection","No zone found for projection code UT");let t=6*e.Zone-183;return['PARAMETER["False_Easting",500000]',`PARAMETER["False_Northing",${/^s/i.test(e.Hemisphere??"")?1e7:0}]`,`PARAMETER["Central_Meridian",${t}]`,'PARAMETER["Latitude_Of_Origin",0]','PARAMETER["Scale_Factor",0.9996]']}(e)}}(e,t);return`PROJCS["${r}",GEOGCS["${function(e){let t=$(e);return t?z(t)?"GCS_North_American_1983":B(t)?"GCS_North_American_1927":Z(t)?"GCS_WGS_1984":"GCS_GeospatialPDF":"GCS_GeospatialPDF"}(i)}",${o},PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["${a}"],${s.join(",\n ")},${l}]`}function $(e){return e.name?function(e){return e.trim().toUpperCase().replace(/_/g," ").replace(/\s+/g," ")}(e.name):null}function z(e){return D.test(e)}function B(e){return L.test(e)}function Z(e){return G.test(e)}class H{constructor(e){let{bbox:t,bounds:i,gpts:r,lpts:n,gcs:a,mediaBox:o}=this.inputValidation(e);this._bbox=t,this._bounds=i,this._gpts=r,this._lpts=n,this._gcs=a,this.outerExtentMediaBox=S(o),this.geoControlPoints=this._getProjectedGeoControlPoints().map(e=>[e[0],e[1]]);let l=this._getBoundsPolygonPage()??this._getPageControlPoints();this.pairedNeatline=l.map(e=>[e[0],e[1]]),this.neatLine=this.pairedNeatline.flat(),this._georeference=this._createControlPointsGeoreference();let s=F(this._georeference);this.ctm=E(s),this.outputValidation()}toSpatialReference(){return new l.A({wkt:this._gcs.WKT})}inputValidation(e){let{bbox:t,bounds:i,gpts:r,lpts:a,gcs:o,mediaBox:l}=e;if(!t||4!==t.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid BBox.");if(!l||4!==l.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid MediaBox.");if(!r||r.length<6||r.length%2!=0)throw new n.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid GPTS.");if(!a||a.length<6||a.length%2!=0)throw new n.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid LPTS.");if(a.length!==r.length)throw new n.A("geospatial-pdf-layer: invalid-frame","MeasureFrame LPTS and GPTS must be same length");if(!o?.WKT)throw new n.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid WKT.");return{bbox:t,bounds:i,gpts:r,lpts:a,gcs:{WKT:o.WKT},mediaBox:l}}outputValidation(){if(4!==this.outerExtentMediaBox.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Failed to generate outer extent from mediaBox.");if(this.geoControlPoints.length<2)throw new n.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints.");if(this.pairedNeatline.length<4)throw new n.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(!this.ctm||6!==this.ctm.length)throw new n.A("geospatial-pdf-layer:invalid-frame","Missing or invalid Map Frame CTM")}_createControlPointsGeoreference(){let e=this._getPageControlPoints(),t=this._getProjectedGeoControlPoints(),i=this._getViewportRect();return T(e,t,this.toSpatialReference(),i)}_getBoundsPolygonLocal(){if(!this._bounds||this._bounds.length<8||this._bounds.length%2!=0)return null;let e=[];for(let t=0;t<this._bounds.length;t+=2)e.push({u:this._bounds[t],v:this._bounds[t+1]});return e}_getBoundsPolygonPage(){return this._getBoundsPolygonLocal()?.map(e=>this._localToPage(e.u,e.v))??null}_getPageControlPoints(){let e=[];for(let t=0;t<this._lpts.length;t+=2){let i=this._lpts[t],r=this._lpts[t+1];e.push(this._localToPage(i,r))}return e}_getProjectedGeoControlPoints(){let e=this.toSpatialReference(),t=[];for(let i=0;i<this._gpts.length;i+=2){let r=this._gpts[i],n=this._gpts[i+1],a=new d.A({x:n,y:r}),o=(0,A.projectExecute)(a,e);t.push((0,_.fA)(o.x,o.y))}return t}_getViewportRect(){let[e,t,i,r]=this._bbox;return{xmin:Math.min(e,i),ymin:Math.min(t,r),xmax:Math.max(e,i),ymax:Math.max(t,r)}}_localToPage(e,t){let[i,r,n,a]=this._bbox;return(0,_.fA)(i+e*(n-i),r+t*(a-r))}}function U(e){let t=re(e,"LGIDict map frame must be an object.");return{CTM:Q(t.CTM),Registration:X(t.Registration),Neatline:Q(t.Neatline),Projection:W(t.Projection),Display:W(t.Display)}}function k(e){let t=re(e,"Viewport frame must be an object."),i=function(e){if(ie(e))return{Bounds:Q(e.Bounds),GPTS:Q(e.GPTS),LPTS:Q(e.LPTS),GCS:V(e.GCS)}}(t.Measure);return{BBox:Q(t.BBox),Measure_Raw:t.Measure,Measure:i,Raw:t}}function V(e){if(ie(e))return{WKT:Y(e.WKT)}}function W(e){if(ie(e))return{Type:ee(e.Type),Units:ee(e.Units),Datum:J(e.Datum),Projection_Type:ee(e.ProjectionType),Central_Meridian:te(e.CentralMeridian),False_Easting:te(e.FalseEasting),False_Northing:te(e.FalseNorthing),Height:te(e.Height),Hemisphere:ee(e.Hemisphere),Latitude_One:te(e.LatitudeOne),Latitude_Two:te(e.LatitudeTwo),Latitude_Of_True_Scale:te(e.LatitudeOfTrueScale),Longitude_One:te(e.LongitudeOne),Longitude_Two:te(e.LongitudeTwo),Longitude_Down_From_Pole:te(e.LongitudeDownFromPole),Orientation:ee(e.Orientation),Origin_Height:te(e.OriginHeight),Origin_Latitude:te(e.OriginLatitude),Origin_Longitude:te(e.OriginLongitude),Scale_Factor:te(e.ScaleFactor),Standard_Parallel:te(e.StandardParallel),Standard_Parallel_One:te(e.StandardParallelOne),Standard_Parallel_Two:te(e.StandardParallelTwo),Zone:te(e.Zone),Description:ee(e.Description),raw:e}}function J(e){return null==e?null:"string"==typeof e?{kind:"name",name:ee(e),ellipsoid:null,to_WGS84:null,raw:e}:ie(e)?{kind:"definition",name:ee(e.Description),ellipsoid:K(e.Ellipsoid),to_WGS84:q(e.ToWGS84),raw:e}:{kind:"unknown",name:ee(e),ellipsoid:null,to_WGS84:null,raw:e}}function K(e){if(ie(e))return{semi_Major_Axis:te(e.SemiMajorAxis),inverse_Flattening:te(e.InvFlattening),semi_Minor_Axis:te(e.SemiMinorAxis),description:ee(e.Description)}}function q(e){if(ie(e))return{dx:te(e.dx)??0,dy:te(e.dy)??0,dz:te(e.dz)??0,rx:te(e.rx)??0,ry:te(e.ry)??0,rz:te(e.rz)??0,sf:te(e.sf)??0}}function Q(e){if(!Array.isArray(e))return;let t=[];for(let i of e){let e=te(i);if(void 0===e)return;t.push(e)}return t}function X(e){if(Array.isArray(e))return e.filter(e=>Array.isArray(e)).map(e=>e.map(e=>te(e)).filter(e=>void 0!==e))}function Y(e){if(null!=e)return"string"==typeof e?e:String(e)}function ee(e){let t=Y(e);if(void 0!==t)return t.trim()}function te(e){if(null==e)return;if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"!=typeof e)return;let t=e.trim();if(""===t)return;let i=Number(t);return Number.isFinite(i)?i:void 0}function ie(e){return"object"==typeof e&&!!e&&!Array.isArray(e)}function re(e,t){if(!ie(e))throw new n.A("geospatial-pdf-layer:parse",t);return e}let ne=class extends f.x_{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){let t=(0,g.h)("GeospatialPDFLayerWorker",{...e,strategy:"dedicated",registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);let{geospatialMetadata:i}=await this._workerHandler.loadPDF(e,t),r=function(e,t=0){let i={mediaBox:Q(e.MediaBox),rotate:te(e.Rotate),hasLGIDict:null!=e.LGIDict,hasVP:null!=e.VP},r=(a=t,function(e){return null==e?[]:Array.isArray(e)?e.map(e=>U(e)):[U(e)]}(e.LGIDict)[a]);var a;if(r){if(!r.Projection)throw new n.A("geospatial-pdf-layer:parse","LGIDict map frame missing Projection.");let t,a=N(r.Projection);try{t=r.Display?N(r.Display):void 0}catch{t=a}return{result:i,lgiDictFrame:new b({ctm:r.CTM,registration:r.Registration,projection:a,display:t,neatline:r.Neatline,mediaBox:Q(e.MediaBox)})}}let o=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>k(e)):[k(e)]}(e)[t]}(e.VP,t);return o?{result:i,vpFrame:new H({bbox:o.BBox,bounds:o.Measure?.Bounds,gpts:o.Measure?.GPTS,lpts:o.Measure?.LPTS,gcs:o.Measure?.GCS,mediaBox:Q(e.MediaBox)})}:{result:i}}(i,0),a=r.lgiDictFrame??r.vpFrame;if(!a)throw new n.A("geospatial-pdf-layer:load","pdf does not contain supported LGIDict or VP/Measure.");let o=new v(a);return{frame:o,sourceSpatialReference:o.spatialReference.toJSON(),fullExtent:o.toExtent()}}async render(e,t,i,r,n,a){let o={sourceExtentAsJSON:e.toJSON(),width:t,height:i,ctm:r,currentRing:n};return this._workerHandler.renderPDF(o,a)}};ne=(0,r.Cg)([(0,o.$K)("esri.layers.geospatialPDF.GeospatialPDFWorkerClient")],ne);var ae=i(49859),oe=i(14140),le=i(87186);let se=class extends ae.A{constructor(){super(...arguments),this._workerClient=new ne,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat="PDF",this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType="Raster"}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(e,t,i,r={}){let n=this._extent,a=this._ctm,o=this.getTileExtentPDF(e,t,i);return o.intersects(n)?function(e){return new oe.A({width:e.width,height:e.height,pixelType:"u8",pixels:[e.red,e.green,e.blue],mask:e.mask})}(await this._workerClient.render(o,this._tileSize,this._tileSize,a,this._neatlineRing,r)):null}async _open(e){if(!this.url)throw new n.A("geospatial-pdf-raster:open","GeospatialPDFRaster requires a url.");let t=await this._workerClient.loadPDF({url:this.url,page:this.page},e);this.frame=t.frame;let i=this.frame.outerExtentMediabox;if(!i)throw new n.A("geospatial-pdf-raster:open","Failed to compute Geospatial PDF extent.");this.neatlineExtent=t.fullExtent,this._extent=i,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];let r=function(e,t){let[i,r,a,o]=e,l=i*o-r*a;if(!Number.isFinite(l)||0===l)throw new n.A("geospatial-pdf-raster:open","Failed to derive raster dimensions from an invalid PDF CTM.");let s=10*Math.hypot(o,r)/Math.abs(l),u=10*Math.hypot(a,i)/Math.abs(l),p=Math.max(1,Math.ceil(t.width*s)),h=Math.max(1,Math.ceil(t.height*u));if(!Number.isFinite(p)||!Number.isFinite(h))throw new n.A("geospatial-pdf-raster:open","PDF CTM produced invalid raster dimensions.");return[p,h]}(this.frame.ctm,this._extent);this._width=r[0],this._height=r[1];let a={x:i.width/this._width,y:i.height/this._height},o=new le.A({width:this._width,height:this._height,pixelType:"u8",extent:i,pixelSize:a,spatialReference:i.spatialReference,bandCount:3,keyProperties:{DataType:"Processed"}});this.createRemoteDatasetStorageInfo(o,this._tileSize,this._tileSize),this._set("rasterInfo",o),this.updateTileInfo()}getTileExtentPDF(e,t,i){let r=this._extent,n=2**e,a=r.width/this._width*n,o=r.height/this._height*n,l=new d.A({x:r.xmin,y:r.ymax});return this.getTileExtent({x:a,y:o},t,i,l,r.spatialReference,[512,512])}};(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,o.MZ)({constructOnly:!0})],se.prototype,"page",void 0),(0,r.Cg)([(0,o.MZ)({readOnly:!0})],se.prototype,"tileType",void 0),se=(0,r.Cg)([(0,o.$K)("esri.layers.raster.datasets.GeospatialPDFRaster")],se);var ue=i(34930),pe=i(15584),he=i(87045);let ce=class extends((0,p.dM)((0,c.j)((0,h.G)((0,a.M)(u.A))))){constructor(e){super(e),this.serviceRasterInfo=null,this._frame=null,this._objectURL=null,this.clippedToNeatline=!1,this.data=null,this.raster=null,this.spatialReference=null,this.type="geospatial-pdf"}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy(),this._objectURL&&=(URL.revokeObjectURL(this._objectURL),null)}get fullExtent(){return this.serviceRasterInfo?.extent}async fetchImageBitmapTile(){throw new n.A("geospatial-pdf-layer:fetch-image-bitmap-tile","GeospatialPDFLayer does not expose pre-rendered image tile URLs.")}async fetchPixels(e,t,i,r={}){return de(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(i),r)}async fetchTile(e,t,i,r={}){if(de(this),r.requestAsImageElement)throw new n.A("geospatial-pdf-layer:fetch-tile","GeospatialPDFLayer does not support requestAsImageElement.");await this._initJobHandler();let a=await this.raster.fetchTile(e,t,i,r);return this.clippedToNeatline&&a.pixelBlock&&this._frame&&a.srcExtent&&(a.pixelBlock=await(0,ue.$Q)(a.pixelBlock,a.srcExtent,this._frame.sourceNeatlinePolygon)),a}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;let r=(0,s.Vp)(e);return he.A.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return de(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(de(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getDataUrl(e){let{data:t}=this;if("string"==typeof t)return t;if(t instanceof File)return this._objectURL=URL.createObjectURL(t),this._objectURL;if(t instanceof pe.A){await t.portalItem.load({signal:e?.signal});let i=t.portalItem.url;if(!i)throw new n.A("geospatial-pdf-layer:load","Portal item does not have a valid data URL.");return i}throw new n.A("geospatialpdf-layer:missing-data","A data source must be specified.")}async _load(e){let t=await this._getDataUrl(e);await this._openRaster(t,e?.signal)}async _openRaster(e,t){let i=new se({url:e});if(await i.open({signal:t}),!i.rasterInfo)throw i.destroy(),new n.A("geospatialpdf-layer:load","cannot load resources on "+e);let{rasterInfo:r}=i;this._set("serviceRasterInfo",r),this.setAtOrigin("spatialReference",r.spatialReference,"service"),this.setAtOrigin("tileInfo",r.storageInfo.tileInfo,"service"),this._frame=i.frame,this.raster=i}};function de(e){if(!e.raster||!e.serviceRasterInfo)throw new n.A("imagery-tile","no raster")}(0,r.Cg)([(0,o.MZ)()],ce.prototype,"serviceRasterInfo",void 0),(0,r.Cg)([(0,o.MZ)({clonable:!1})],ce.prototype,"_compatibleFullExtent",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],ce.prototype,"clippedToNeatline",void 0),(0,r.Cg)([(0,o.MZ)()],ce.prototype,"data",void 0),(0,r.Cg)([(0,o.MZ)({json:{read:!1}})],ce.prototype,"fullExtent",null),(0,r.Cg)([(0,o.MZ)()],ce.prototype,"raster",void 0),(0,r.Cg)([(0,o.MZ)({readOnly:!0,type:l.A,json:{read:!1}})],ce.prototype,"spatialReference",void 0),(0,r.Cg)([(0,o.MZ)({type:he.A,readOnly:!0})],ce.prototype,"tileInfo",void 0),(0,r.Cg)([(0,o.MZ)({readOnly:!0,value:"geospatial-pdf"})],ce.prototype,"type",void 0),ce=(0,r.Cg)([(0,o.$K)("esri.layers.GeospatialPDFLayer")],ce);const fe=ce},91806(e,t,i){i.d(t,{A:()=>s});var r,n=i(32198),a=i(25482),o=i(91429),l=i(78888);let s=class extends a.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],s.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],s.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],s.prototype,"levelValue",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],s.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],s.prototype,"resolution",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],s.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],s.prototype,"scale",void 0),s=r=(0,n.Cg)([(0,o.$K)("esri.layers.support.LOD")],s)},15584(e,t,i){i.d(t,{A:()=>h});var r=i(32198),n=i(69540),a=i(25482),o=i(91429),l=i(64108),s=i(80812),u=i(36005),p=i(43937);let h=class extends((0,a.T)(n.Pw)){constructor(e){super(e),this.type="portal-item"}readPortalItem(e,t,i){if(t.itemId)return new s.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}};(0,r.Cg)([(0,o.MZ)({type:["portal-item"],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],h.prototype,"type",void 0),(0,r.Cg)([(0,o.MZ)({type:s.default,json:{write:{isRequired:!0}}})],h.prototype,"portalItem",void 0),(0,r.Cg)([(0,u.w)("portalItem",["itemId"])],h.prototype,"readPortalItem",null),(0,r.Cg)([(0,p.K)("portalItem",{itemId:{type:String}})],h.prototype,"writePortalItem",null),h=(0,r.Cg)([(0,l.$)("esri.layers.support.PortalItemData")],h)},87045(e,t,i){i.d(t,{A:()=>w});var r,n=i(32198),a=i(66552),o=i(25482),l=i(86211),s=i(91429),u=i(78888),p=i(86738),h=i(16930),c=i(21325),d=i(28735),f=i(91806),g=i(72802),m=i(36005),_=i(43937);const y=new a.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends o.o{static{r=this}static create(e={}){let{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:a=h.A.WebMercator,numLODs:o=24}=e;if(!(0,c.fn)(a)){let e=[];if(i)for(let t=0;t<i.length;t++){let r=i[t];e.push(new f.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new p.A(0,0,a),size:[n,n],spatialReference:a})}let s=(0,c.Vp)(a),u=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:a}):s?new p.A({x:s.origin[0],y:s.origin[1],spatialReference:a}):new p.A({x:0,y:0,spatialReference:a}),d=1/(39.37*(0,l.GA)(a)*96),g=[];if(i)for(let e=0;e<i.length;e++){let t=i[e],r=t*d;g.push(new f.A({level:e,scale:t,resolution:r}))}else{let e=(0,c.EA)(a)?512/n*591657527.5917094:256/n*591657527.591555,i=Math.ceil(o/t);g.push(new f.A({level:0,scale:e,resolution:e*d}));for(let r=1;r<i;r++){let i=e/2**t,n=i*d;g.push(new f.A({level:r,scale:i,resolution:n})),e=i}}return new r({dpi:96,lods:g,origin:u,size:[n,n],spatialReference:a})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){let{spatialReference:e,origin:t}=this;if(e&&t){let i=(0,c.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0,r=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){let t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];let i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){let t=this.scales,i=t.length-1,r=0;for(;r<i;r++){let i=t[r],n=t[r+1];if(i<=e)return r;if(n===e)return r+1;if(i>e&&n<e)return r+Math.log(i/e)/Math.log(i/n)}return r}tileAt(e,t,i,r){let n,a,o=this.lodAt(e);if(!o)return null;if("number"==typeof t)n=t,a=i;else if((0,c.aI)(t.spatialReference,this.spatialReference))n=t.x,a=t.y,r=i;else{let e=(0,d.Cv)(t,this.spatialReference);if(null==e)return null;n=e.x,a=e.y,r=i}let l=o.resolution*this.size[0],s=o.resolution*this.size[1];return r??=new g.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-a)/s+.001),r.col=Math.floor((n-this.origin.x)/l+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){let t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;let r=e.level-i.level,n=i.resolution*this.size[0]/2**r,a=i.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*n,e.extent[1]=this.origin.y-(e.row+1)*a,e.extent[2]=e.extent[0]+n,e.extent[3]=e.extent[1]+a,!0}upsampleTile(e){let t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){let i=this.lodAt(t.level);if(null==i)return null;let{resolution:r}=i,n=r*this.size[0],a=r*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*a,e[2]=e[0]+n,e[3]=e[1]+a,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;let t=(512===this.size[0]&&256===e?-1:0)+ +!!this.spatialReference.isGeographic;if(this.size[0]===e&&0===t)return this;let i=[],n=this.lods.length-t;for(let e=0;e<n;e++){let r=e+t,{scale:n,resolution:a}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:n,resolution:a}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){let e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){let r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,n.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,n.Cg)([(0,s.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,n.Cg)([(0,s.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,n.Cg)([(0,s.MZ)({type:p.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,n.Cg)([(0,m.w)("origin")],w.prototype,"readOrigin",null),(0,n.Cg)([(0,s.MZ)({type:[f.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,n.Cg)([(0,s.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,n.Cg)([(0,s.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,n.Cg)([(0,m.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,n.Cg)([(0,_.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],w.prototype,"writeSize",null),(0,n.Cg)([(0,s.MZ)({type:h.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=r=(0,n.Cg)([(0,s.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,i){i.d(t,{U:()=>n});var r=i(19419);class n{constructor(e,t,i,n=(0,r.vt)()){this._level=e,this._row=t,this._col=i,this.extent=n}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new n(e.level,e.row,e.col,e.extent)}}}}]);
|