@geoscene/core 4.29.8 → 4.29.9

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.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[0],{5e4:(e,r,t)=>{t.r(r),t.d(r,{default:()=>j});var s,i=t(41948),a=t(2600),l=t(20744),n=t(79152),o=t(26496),c=t(10860),p=t(28176),u=t(1580),h=t(33392),d=(t(72052),t(9456),t(33600)),y=t(12552),f=t(18996),_=t(56156),v=t(81436),g=t(38724),m=t(54664),S=t(50864),q=t(16660),T=t(25216),b=t(28584),w=t(66576),O=t(98768),W=t(26916),R=t(3116),C=t(49664),U=t(48212),k=t(21488),P=t(80428),A=t(84632);const G=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let L=s=class extends((0,T.W)((0,R.I)((0,C.s)((0,m.k)((0,S.I)((0,w.Y)((0,O.K)((0,q.u)((0,o.U)((0,W.G)((0,g.C)((0,b.G)(v.c))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(c.CE).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&_.c.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),a=[],l={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},l);a.push(r)})),a.some((e=>Object.keys(e).length>1))&&(r.layers=a)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>(0,p.as)(e).path)):null}fetchTile(e,r,t,s={}){const{signal:i}=s,l=this.getTileUrl(e,r,t),n={responseType:"image",signal:i,query:{...this.refreshParameters}};return(0,a.c)(l,n).then((e=>e.data))}async fetchImageBitmapTile(e,r,t,i={}){const{signal:l}=i;if(this.fetchTile!==s.prototype.fetchTile){const s=await this.fetchTile(e,r,t,i);return(0,P.G)(s,e,r,t,l)}const n=this.getTileUrl(e,r,t),o={responseType:"blob",signal:l,query:{...this.refreshParameters}},{data:c}=await(0,a.c)(n,o);return(0,P.G)(c,e,r,t,l)}getTileUrl(e,r,t){const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,i=(0,p.GK)({...this.parsedUrl?.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),a=this.tileServers;return`${a&&a.length?a[r%a.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${i?"?"+i:""}`}loadAll(){return(0,n.A)(this,(e=>{e(this.allSublayers)}))}_fetchService(e){return new Promise(((r,t)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new l.c("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new l.c("tile-layer:undefined-url","layer's url is not defined");const s=(0,U.K0)(this.parsedUrl.path);if(null!=s&&"ImageServer"===s.serverType)throw new l.c("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");(0,a.c)(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)})).then((r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!(0,U.Wq)(t))return this._fetchServerVersion(t,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,r){if(!(0,U.YB)(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return(0,a.c)(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new l.c("tile-layer:version-not-available")}))}_getMapName(e){return void 0}_getDefaultAttribution(e){return null;let r;e=e.toLowerCase();for(let t=0,s=G.length;t<s;t++)if(r=G[t],r.toLowerCase().includes(e))return(0,p.WM)("//static.Grcgis.cn/attribution/"+r);return null}_getDefaultTileServers(e){if(null==e)return[];const r=-1!==e.search(/^(?:https?:)?\/\/server\.arcgisonline\.com/i),t=-1!==e.search(/^(?:https?:)?\/\/services\.arcgisonline\.com/i);return r||t?[e,e.replace(r?/server\.arcgisonline/i:/services\.arcgisonline/i,r?"services.arcgisonline":"server.arcgisonline")]:[]}get hasOverriddenFetchTile(){return!this.fetchTile[M]}};(0,i._)([(0,u.qq)({readOnly:!0})],L.prototype,"attributionDataUrl",null),(0,i._)([(0,u.qq)({type:["show","hide","hide-children"]})],L.prototype,"listMode",void 0),(0,i._)([(0,u.qq)({json:{read:!0,write:!0}})],L.prototype,"blendMode",void 0),(0,i._)([(0,u.qq)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],L.prototype,"isReference",void 0),(0,i._)([(0,u.qq)({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],L.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.qq)({type:Boolean})],L.prototype,"resampling",void 0),(0,i._)([(0,u.qq)()],L.prototype,"sourceJSON",void 0),(0,i._)([(0,u.qq)({type:_.c})],L.prototype,"spatialReference",void 0),(0,i._)([(0,d.E)("spatialReference",["spatialReference","tileInfo"])],L.prototype,"readSpatialReference",null),(0,i._)([(0,u.qq)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],L.prototype,"path",void 0),(0,i._)([(0,u.qq)({readOnly:!0})],L.prototype,"sublayers",void 0),(0,i._)([(0,f.G)("sublayers",{layers:{type:[A.c]}})],L.prototype,"writeSublayers",null),(0,i._)([(0,u.qq)({json:{read:!1,write:!1}})],L.prototype,"popupEnabled",void 0),(0,i._)([(0,u.qq)()],L.prototype,"tileServers",null),(0,i._)([(0,h.W)("tileServers")],L.prototype,"castTileServers",null),(0,i._)([(0,u.qq)({readOnly:!0,json:{read:!1}})],L.prototype,"type",void 0),(0,i._)([(0,u.qq)(k.qW)],L.prototype,"url",void 0),L=s=(0,i._)([(0,y.c)("geoscene.layers.TileLayer")],L);const M=Symbol("default-fetch-tile");L.prototype.fetchTile[M]=!0;const j=L}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[0],{5e4:(e,r,t)=>{t.r(r),t.d(r,{default:()=>j});var s,i=t(41948),a=t(2600),l=t(20744),n=t(79152),o=t(26496),c=t(10860),p=t(28176),u=t(1580),h=t(33392),d=(t(72052),t(9456),t(33600)),y=t(12552),f=t(18996),_=t(56156),v=t(81436),g=t(38724),m=t(54664),S=t(50864),q=t(16660),T=t(25216),b=t(28584),w=t(66576),O=t(98768),W=t(26916),R=t(3116),C=t(49664),U=t(48212),k=t(21488),P=t(80428),A=t(84632);const G=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let L=s=class extends((0,T.W)((0,R.I)((0,C.s)((0,m.k)((0,S.I)((0,w.Y)((0,O.K)((0,q.u)((0,o.U)((0,W.G)((0,g.C)((0,b.G)(v.c))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(c.CE).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&_.c.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),a=[],l={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},l);a.push(r)})),a.some((e=>Object.keys(e).length>1))&&(r.layers=a)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>(0,p.as)(e).path)):null}fetchTile(e,r,t,s={}){const{signal:i}=s,l=this.getTileUrl(e,r,t),n={responseType:"image",signal:i,query:{...this.refreshParameters}};return(0,a.c)(l,n).then((e=>e.data))}async fetchImageBitmapTile(e,r,t,i={}){const{signal:l}=i;if(this.fetchTile!==s.prototype.fetchTile){const s=await this.fetchTile(e,r,t,i);return(0,P.G)(s,e,r,t,l)}const n=this.getTileUrl(e,r,t),o={responseType:"blob",signal:l,query:{...this.refreshParameters}},{data:c}=await(0,a.c)(n,o);return(0,P.G)(c,e,r,t,l)}getTileUrl(e,r,t){const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,i=(0,p.GK)({...this.parsedUrl?.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),a=this.tileServers;return`${a&&a.length?a[r%a.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${i?"?"+i:""}`}loadAll(){return(0,n.A)(this,(e=>{e(this.allSublayers)}))}_fetchService(e){return new Promise(((r,t)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new l.c("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new l.c("tile-layer:undefined-url","layer's url is not defined");const s=(0,U.K0)(this.parsedUrl.path);if(null!=s&&"ImageServer"===s.serverType)throw new l.c("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");(0,a.c)(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)})).then((r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!(0,U.Wq)(t))return this._fetchServerVersion(t,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,r){if(!(0,U.YB)(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return(0,a.c)(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new l.c("tile-layer:version-not-available")}))}_getMapName(e){return void 0}_getDefaultAttribution(e){return null;let r;e=e.toLowerCase();for(let t=0,s=G.length;t<s;t++)if(r=G[t],r.toLowerCase().includes(e))return(0,p.WM)("//static.Grcgis.cn/attribution/"+r);return null}_getDefaultTileServers(e){return[];}get hasOverriddenFetchTile(){return!this.fetchTile[M]}};(0,i._)([(0,u.qq)({readOnly:!0})],L.prototype,"attributionDataUrl",null),(0,i._)([(0,u.qq)({type:["show","hide","hide-children"]})],L.prototype,"listMode",void 0),(0,i._)([(0,u.qq)({json:{read:!0,write:!0}})],L.prototype,"blendMode",void 0),(0,i._)([(0,u.qq)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],L.prototype,"isReference",void 0),(0,i._)([(0,u.qq)({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],L.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.qq)({type:Boolean})],L.prototype,"resampling",void 0),(0,i._)([(0,u.qq)()],L.prototype,"sourceJSON",void 0),(0,i._)([(0,u.qq)({type:_.c})],L.prototype,"spatialReference",void 0),(0,i._)([(0,d.E)("spatialReference",["spatialReference","tileInfo"])],L.prototype,"readSpatialReference",null),(0,i._)([(0,u.qq)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],L.prototype,"path",void 0),(0,i._)([(0,u.qq)({readOnly:!0})],L.prototype,"sublayers",void 0),(0,i._)([(0,f.G)("sublayers",{layers:{type:[A.c]}})],L.prototype,"writeSublayers",null),(0,i._)([(0,u.qq)({json:{read:!1,write:!1}})],L.prototype,"popupEnabled",void 0),(0,i._)([(0,u.qq)()],L.prototype,"tileServers",null),(0,i._)([(0,h.W)("tileServers")],L.prototype,"castTileServers",null),(0,i._)([(0,u.qq)({readOnly:!0,json:{read:!1}})],L.prototype,"type",void 0),(0,i._)([(0,u.qq)(k.qW)],L.prototype,"url",void 0),L=s=(0,i._)([(0,y.c)("geoscene.layers.TileLayer")],L);const M=Symbol("default-fetch-tile");L.prototype.fetchTile[M]=!0;const j=L}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7936],{25228:(e,t,r)=>{r.d(t,{c:()=>y});var i,s=r(41948),n=r(40504),o=r(94360),l=r(1580),a=(r(9456),r(66360),r(72052),r(33600)),u=r(12552),c=r(18996),h=r(28484);let p=i=class extends n.am{static get allTime(){return f}static get empty(){return d}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===i&&r===s}expandTo(e,t=h.OX){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.aU)(r,e,t));let s=this.end;if(s){const r=(0,o.aU)(s,e,t);s=s.getTime()===r.getTime()?r:(0,o.g1)(r,1,e,t)}return new i({start:r,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,l;if(s>=t&&s<=r?o=s:t>=s&&t<=n&&(o=t),r>=s&&r<=n?l=r:n>=t&&n<=r&&(l=n),null!=o&&null!=l&&!isNaN(o)&&!isNaN(l)){const e=new i;return e.start=o===-1/0?null:new Date(o),e.end=l===1/0?null:new Date(l),e}return i.empty}offset(e,t,r=h.OX){if(this.isEmpty||this.isAllTime)return this.clone();const s=new i,{start:n,end:l}=this;return null!=n&&(s.start=(0,o.g1)(n,e,t,r)),null!=l&&(s.end=(0,o.g1)(l,e,t,r)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,s._)([(0,l.qq)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,s._)([(0,a.E)("end")],p.prototype,"readEnd",null),(0,s._)([(0,c.G)("end")],p.prototype,"writeEnd",null),(0,s._)([(0,l.qq)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,s._)([(0,l.qq)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,s._)([(0,l.qq)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,s._)([(0,a.E)("start")],p.prototype,"readStart",null),(0,s._)([(0,c.G)("start")],p.prototype,"writeStart",null),p=i=(0,s._)([(0,u.c)("geoscene.TimeExtent")],p);const f=new p,d=new p({start:void 0,end:void 0}),y=p},22156:(e,t,r)=>{r.d(t,{MR:()=>o,qm:()=>l});var i=r(41948),s=r(12552);let n=0;const o=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return t=(0,i._)([(0,s.c)("geoscene.core.Identifiable")],t),t},l=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n++})}};return t=(0,i._)([(0,s.c)("geoscene.core.NumericIdentifiable")],t),t};let a=class extends(o(class{})){};a=(0,i._)([(0,s.c)("geoscene.core.Identifiable")],a)},11004:(e,t,r)=>{r.d(t,{o:()=>s});var i=r(74452);class s{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,r)=>{r.d(t,{ML:()=>o,kB:()=>l});var i,s,n=r(24680);(s=i||(i={}))[s.ALL=0]="ALL",s[s.SOME=1]="SOME";class o{constructor(e,t,r){this.name=e,this._storage=t,this.id=a+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,r,i=0){this._storage.put(this,e,t,r,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,r){this._storage.updateSize(this,e,t,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class l{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new n.c,this._users=new n.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const r=this._db.get(e.id+t);return r?.size??0}put(e,t,r,s,n){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,i.ALL)),s>this._maxSize)return void this._notifyRemove(t,r,s,i.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,r,0,i.ALL);const l=1+Math.max(n,-4)- -3;this._db.set(t,new u(r,s,l)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t,r,s){t=e.id+t;const n=this._db.get(t);if(n&&n.entry===r){for(this._size-=n.size,e.size-=n.size;s>this._maxSize;){const e=this._notifyRemove(t,r,s,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}n.size=s,this._size+=s,e.size+=s,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},r=new Array;this._db.forEach(((e,i)=>{const s=e.lifetime;r[s]=(r[s]||0)+e.size,this._users.forAll((r=>{const{id:s,name:n}=r;if(i.startsWith(s)){const r=t[n]||0;t[n]=r+e.size}}))}));const i={};this._users.forAll((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[r]||0;t[r]=s,i[r]=Math.round(100*e.hitRate)+"%"}else i[r]="0%"}));const s=Object.keys(t);s.sort(((e,r)=>t[r]-t[e])),s.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+i[r]));for(let t=r.length-1;t>=0;--t){const i=r[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,i){let s;return this._removeFuncs.some((n=>{if(e.startsWith(n[0])){const e=n[1](t,i,r);return"number"==typeof e&&(s=e),!0}return!1})),s}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const r=e?.id;let i=!0;for(;i;){i=!1;for(const[s,n]of this._db)if(0===n.lifetime&&(!r||s.startsWith(r))){if(this._purgeItem(s,n,e),t.size<=.9*t.maxSize)return;i||=this._db.has(s)}}for(const[i,s]of this._db)if((!r||i.startsWith(r))&&(this._purgeItem(i,s,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,r=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=s&&s>0&&(this._size+=s,r&&(r.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let a=0;class u{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}}},57896:(e,t,r)=>{r.d(t,{Eq:()=>p,KG:()=>g,_8:()=>m,_I:()=>u,aE:()=>a,du:()=>y,on:()=>h}),r(40196),r(2952);var i=r(60976),s=r(38912),n=r(70680),o=r(10860),l=r(37176);function a(e,t,r={}){return c(e,t,r,f)}function u(e,t,r={}){return c(e,t,r,d)}function c(e,t,r={},i){let s=null;const o=r.once?(e,r)=>{i(e)&&((0,n.oR)(s),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(s=(0,l.M9)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return s}function h(e,t,r,o={}){let l=null,u=null,c=null;function h(){l&&u&&(u.remove(),o.onListenerRemove?.(l),l=null,u=null)}function p(e){o.once&&o.once&&(0,n.oR)(c),r(e)}const f=a(e,((e,r)=>{h(),(0,i.sh)(e)&&(l=e,u=(0,i.on)(e,t,p),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return c=(0,s.uU)((()=>{f.remove(),h()})),c}function p(e,t){return function(e,t,r){if((0,o.wv)(r))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let l=null;function a(){l=(0,n.oR)(l)}return new Promise(((i,n)=>{l=(0,s.Ip)([(0,o.wD)(r,(()=>{a(),n((0,o.Uh)())})),c(e,(e=>{a(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,d,t)}function f(e){return!0}function d(e){return!!e}r(41168);const y={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},81436:(e,t,r)=>{r.d(t,{c:()=>v});var i=r(41948),s=(r(60708),r(2600)),n=r(20744),o=r(77860),l=r(22156),a=r(95800),u=r(66360),c=r(10860),h=r(28176),p=r(1580),f=(r(9456),r(72052),r(12552)),d=r(6220),y=r(95247),m=r(56156);let g=0,_=class extends(o.c.EventedMixin((0,l.MR)(a.c))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.c(-180,-90,180,90,m.c.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=m.c.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromGeoSceneServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(9232).then(r.bind(r,69232))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await r.e(2259).then(r.bind(r,12259));try{return await i(t)}catch(e){const r=t&&t.portalItem,i=r?.id||"unset",s=r&&r.portal&&r.portal.url||d.default.portalUrl;throw u.c.getLogger("geoscene.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,c.mA)(e)||u.c.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,h.as)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.c)(e,{query:{f:"json"},responseType:"json"})).data;throw new n.c("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,p.qq)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,i._)([(0,p.qq)({type:y.c})],_.prototype,"fullExtent",void 0),(0,i._)([(0,p.qq)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,i._)([(0,p.qq)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,i._)([(0,p.qq)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,i._)([(0,p.qq)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,i._)([(0,p.qq)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,i._)([(0,p.qq)({clonable:!1})],_.prototype,"parent",void 0),(0,i._)([(0,p.qq)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i._)([(0,p.qq)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,i._)([(0,p.qq)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,i._)([(0,p.qq)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,i._)([(0,p.qq)({type:m.c})],_.prototype,"spatialReference",void 0),(0,i._)([(0,p.qq)({type:String})],_.prototype,"title",void 0),(0,i._)([(0,p.qq)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,i._)([(0,p.qq)()],_.prototype,"url",void 0),(0,i._)([(0,p.qq)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,i._)([(0,f.c)("geoscene.layers.Layer")],_);const v=_},65632:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ue});var i=r(41948),s=r(2600),n=r(40196),o=r(20744),l=r(62088),a=r(26496),u=r(10860),c=r(28176),h=r(1580),p=(r(9456),r(66360)),f=r(33600),d=r(12552),y=r(18996),m=r(95247),g=r(56156),_=r(81436),v=r(38724),w=r(54664),S=r(16660),A=r(25216),b=r(28584),x=r(66576),q=r(98768),I=r(3116);let E=null;var R=r(72008);class U{constructor(e,t){this._spriteSource=e,this._maxTextureSize=t,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded","url"===e.type&&e.spriteFormat&&(this._spriteImageFormat=e.spriteFormat),e.pixelRatio&&(this.devicePixelRatio=e.pixelRatio),this.baseURL=e.spriteUrl}get spriteNames(){const e=[];for(const t in this._spritesData)e.push(t);return e.sort(),e}getSpriteInfo(e){return this._spritesData?this._spritesData[e]:null}async load(e){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(e),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(e){this._isRetina=this.devicePixelRatio>1.15;const{width:t,height:r,data:i,json:s}=await this._getSpriteData(this._spriteSource,e),n=Object.keys(s);if(!n||0===n.length||!i)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=s,this.width=t,this.height=r;const l=Math.max(this._maxTextureSize,4096);if(t>l||r>l){const e=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${l} pixels}`;throw p.c.getLogger("geoscene.layers.support.SpriteSource").error(e),new o.c("SpriteSource",e)}let a;for(let e=0;e<i.length;e+=4)a=i[e+3]/255,i[e]=i[e]*a,i[e+1]=i[e+1]*a,i[e+2]=i[e+2]*a;this.image=i}async _getSpriteData(e,t){if("image"===e.type){let t,r;if(this.devicePixelRatio<1.15){if(!e.spriteSource1x)throw new o.c("SpriteSource","no image data provided for low resolution sprites!");t=e.spriteSource1x.image,r=e.spriteSource1x.json}else{if(!e.spriteSource2x)throw new o.c("SpriteSource","no image data provided for high resolution sprites!");t=e.spriteSource2x.image,r=e.spriteSource2x.json}return"width"in t&&"height"in t&&"data"in t&&((0,R.uk)(t.data)||(0,R.UB)(t.data))?{width:t.width,height:t.height,data:new Uint8Array(t.data),json:r}:{...P(t),json:r}}const r=(0,c.as)(this.baseURL),i=r.query?"?"+(0,c.GK)(r.query):"",n=this._isRetina?"@2x":"",l=`${r.path}${n}.${this._spriteImageFormat}${i}`,a=`${r.path}${n}.json${i}`,[u,h]=await Promise.all([(0,s.c)(a,t),(0,s.c)(l,{responseType:"image",...t})]);return{...P(h.data),json:u.data}}}function P(e){const t=document.createElement("canvas"),r=t.getContext("2d");t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height);return{width:e.width,height:e.height,data:new Uint8Array(i.data)}}var T=r(87576),z=r(41464),C=r(60544),L=r(29120),M=r(53680);class O{constructor(e){this.url=e}destroy(){this._tileIndexPromise=null}async fetchTileIndex(){return this._tileIndexPromise||(this._tileIndexPromise=(0,s.c)(this.url).then((e=>e.data.index))),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return(0,u.wp)(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;0!==i.level;)i=new M.c(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,n,o=e,l=r.pop();if(1===o)return l;for(;r.length;)if(s=r.pop(),n=(1&s.col)+((1&s.row)<<1),o){if(0===o[n]){l=null;break}if(1===o[n]){l=s;break}l=s,o=o[n]}return l}}var k=r(70680);class F{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=(0,k.mG)(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=(0,s.c)(this._tileIndexUrl,{query:{...e?.query}}).then((e=>e.data.index))),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,n=new M.c(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,n,t).then((()=>(n.world=e.world,n))).catch((e=>{if((0,u.mA)(e))throw e;return null}))}}var $=r(86916);class j{constructor(e){this._tileUrl=e,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(e){(null==this._promise||(0,u.wv)(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const t=this._abortOptions;return t.push(e),(0,u.wD)(e,(()=>{t.every((e=>(0,u.wv)(e)))&&this._abortController.abort()})),this._promise.then((e=>(0,l.ct)(e)))}async _makeRequest(e){this._abortController=new AbortController;const{data:t}=await(0,s.c)(e,{responseType:"array-buffer",signal:this._abortController.signal});return t}}const D=new Map;function N(e,t){return(0,$.wJ)(D,e,(()=>new j(e))).getData(t).finally((()=>D.delete(e)))}class B{constructor(e,t,r){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=e,this.sourceUrl=t;const i=(0,c.as)(this.sourceUrl),s=(0,l.ct)(r),n=s.tiles;if(i)for(let e=0;e<n.length;e++){const t=(0,c.as)(n[e]);t&&((0,c.ic)(t.path)||(t.path=(0,c.kn)(i.path,t.path)),n[e]=(0,c.UP)(t.path,{...i.query,...t.query}))}this.tileServers=n;const o=r.capabilities&&r.capabilities.split(",").map((e=>e.toLowerCase().trim())),a=!0===r?.exportTilesAllowed,u=!0===o?.includes("tilemap"),h=a&&r.hasOwnProperty("maxExportTilesCount")?r.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:a,supportsTileMap:u},exportTiles:a?{maxExportTilesCount:+h}:null},this.tileInfo=T.c.fromJSON(s.tileInfo);const p=r.tileMap?(0,c.UP)((0,c.kn)(i.path,r.tileMap),i.query??{}):null;u?(this.type="vector-tile",this.tilemap=new F(new z.G({layer:{parsedUrl:i,tileInfo:this.tileInfo},minLOD:s.minLOD??this.tileInfo.lods[0].level,maxLOD:s.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),p)):p&&(this.tilemap=new O(p)),this.fullExtent=m.c.fromJSON(r.fullExtent),this.initialExtent=m.c.fromJSON(r.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(e,t){return await(this.tilemap?.dataKey(e,t))??e}requestTile(e,t,r,i){return function(e,t,r,i,s){const n=(0,c.as)(e),o=n.query;if(o)for(const[e,s]of Object.entries(o))switch(s){case"{x}":o[e]=i.toString();break;case"{y}":o[e]=r.toString();break;case"{z}":o[e]=t.toString()}const l=n.path;return N((0,c.UP)(l.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...n.query}),s)}(this.tileServers[t%this.tileServers.length],e,t,r,i)}isCompatibleWith(e){const t=this.tileInfo,r=e.tileInfo;if(!t.spatialReference.equals(r.spatialReference))return!1;if(!t.origin.equals(r.origin))return!1;if(Math.round(t.dpi)!==Math.round(r.dpi))return!1;const i=t.lods,s=r.lods,n=Math.min(i.length,s.length);for(let e=0;e<n;e++){const t=i[e],r=s[e];if(t.level!==r.level||Math.round(t.scale)!==Math.round(r.scale))return!1}return!0}}function G(...e){let t;for(const r of e)if(null!=r)if((0,c.eC)(r)){if(t){const e=t.split("://")[0];t=e+":"+r.trim()}}else t=(0,c.ic)(r)?r:(0,c.kn)(t,r);return t?(0,c.ai)(t):void 0}async function H(e,t,r,i,n){let o,l,a;if((0,u.wp)(n),"string"==typeof r){const e=(0,c.k7)(r);a=await(0,s.c)(e,{...n,responseType:"json",query:{f:"json",...n?.query}}),a.ssl&&(o&&(o=o.replace(/^http:/i,"https:")),l&&(l=l.replace(/^http:/i,"https:"))),o=e,l=e}else null!=r&&(a={data:r},o=r.jsonUrl||null,l=i);const h=a?.data;if(W(h))return e.styleUrl=o||null,async function(e,t,r,i){const s=r?(0,c.iu)(r):(0,c.Uz)();e.styleBase=s,e.style=t,t["sprite-format"]&&"webp"===t["sprite-format"].toLowerCase()&&(e.spriteFormat="webp");const n=[];if(t.sources&&t.sources.esri){const r=t.sources.esri;r.url?await H(e,"geoscene",G(s,r.url),void 0,i):n.push(H(e,"geoscene",r,s,i))}for(const r of Object.keys(t.sources))"geoscene"!==r&&"vector"===t.sources[r].type&&(t.sources[r].url?n.push(H(e,r,G(s,t.sources[r].url),void 0,i)):t.sources[r].tiles&&n.push(H(e,r,t.sources[r],s,i)));await Promise.all(n)}(e,h,l,n);if(!W(h))return e.sourceUrl?V(e,h,l,!1,t,n):(e.sourceUrl=o||null,V(e,h,l,!0,t,n));throw new Error("You must specify the URL or the JSON for a service or for a style.")}function K(e){return"object"==typeof e&&!!e&&"tilejson"in e&&null!=e.tilejson}function W(e){return!!e&&"sources"in e&&!!e.sources}async function V(e,t,r,i,s,n){const o=r?(0,c.ai)(r)+"/":(0,c.Uz)(),a=function(e){if(e.hasOwnProperty("tileInfo"))return e;const t={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100,latestWkid:3857}};let r=null;if(K(e)){const{bounds:t}=e;if(t){const e=(0,L.w7)({x:t[0],y:t[1],spatialReference:(0,l.ct)(C.UH)}),i=(0,L.w7)({x:t[2],y:t[3],spatialReference:(0,l.ct)(C.UH)});r={xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y,spatialReference:(0,l.ct)(C.QN)}}}null===r&&(r=t);let i=78271.51696400007,s=295828763.7957775;const n=[],o=e.hasOwnProperty("maxzoom")&&null!=e.maxzoom?+e.maxzoom:22;for(let e=0;e<=o;e++)n.push({level:e,scale:s,resolution:i}),i/=2,s/=2;return{capabilities:"TilesOnly",initialExtent:r,fullExtent:t,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:n,spatialReference:(0,l.ct)(C.QN)}}}(t),u=new B(s,(0,c.UP)(o,n?.query??{}),a);if(!i&&e.primarySourceName in e.sourceNameToSource){const t=e.sourceNameToSource[e.primarySourceName];if(!t.isCompatibleWith(u))return;null!=u.fullExtent&&(null!=t.fullExtent?t.fullExtent.union(u.fullExtent):t.fullExtent=u.fullExtent.clone()),t.tileInfo&&u.tileInfo&&t.tileInfo.lods.length<u.tileInfo.lods.length&&(t.tileInfo=u.tileInfo)}if(i&&(e.sourceBase=o,e.source=t,e.validatedSource=a,e.primarySourceName=s),e.sourceNameToSource[s]=u,!K(e)&&"defaultStyles"in t&&!e.style){if(null==t.defaultStyles)throw new Error;return"string"==typeof t.defaultStyles?H(e,"",G(o,t.defaultStyles,"root.json"),void 0,n):H(e,"",t.defaultStyles,G(o,"root.json"),n)}}var Q=r(58648),J=r(5604),X=r(91952),Y=r(67776),Z=r(22108);const ee=1e-6;function te(e,t){if(e===t)return!0;if(null==e&&null!=t)return!1;if(null!=e&&null==t)return!1;if(null==e||null==t)return!1;if(!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;const r=e.origin,i=t.origin;if(Math.abs(r.x-i.x)>=ee||Math.abs(r.y-i.y)>=ee)return!1;let s,n;e.lods[0].scale>t.lods[0].scale?(s=e,n=t):(n=e,s=t);for(let e=s.lods[0].scale;e>=n.lods[n.lods.length-1].scale-ee;e/=2)if(Math.abs(e-n.lods[0].scale)<ee)return!0;return!1}function re(e,t){if(e===t)return e;if(null==e&&null!=t)return t;if(null!=e&&null==t)return e;if(null==e||null==t)return null;const r=e.size[0],i=e.format,s=e.dpi,n=new Y.c({x:e.origin.x,y:e.origin.y}),o=e.spatialReference,l=e.lods[0].scale>t.lods[0].scale?e.lods[0]:t.lods[0],a=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],u=l.scale,c=l.resolution,h=a.scale,p=[];let f=u,d=c,y=0;for(;f>h;)p.push(new Z.c({level:y,resolution:d,scale:f})),y++,f/=2,d/=2;return new T.c({size:[r,r],dpi:s,format:i||"pbf",origin:n,lods:p,spatialReference:o})}var ie=r(11272);function se(e,t={}){return e.getContext("webgl2",t)||null}let ne;function oe(){return ne||(ne=function(){const e=new le,t=function(e){if("undefined"==typeof WebGL2RenderingContext)return null;const t=document.createElement("canvas");if(!t)return null;let r=se(t,{failIfMajorPerformanceCaveat:!0});if(null==r&&(r=se(t),null!=r&&(e.majorPerformanceCaveat=!0)),null==r)return r;e.available=!0,e.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const i=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);return i&&(e.supportsHighPrecisionFragment=i.precision>0),r}(e);return null==t||(e.supportsColorBufferFloat=null!==t.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==t.getExtension("EXT_color_buffer_half_float")),e}()),ne}class le{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}}let ae=class extends((0,A.W)((0,I.I)((0,w.k)((0,S.u)((0,x.Y)((0,q.K)((0,b.G)((0,v.C)((0,a.U)(_.c)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null,this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(u.CE).then((async()=>{if(!this.portalItem?.id)return;const t=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await(0,s.c)(t,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:t},(0,Q.s)(this.portalItem,"portal-item"))})).catch(u.CE).then((()=>this._loadStyle(e)));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&(0,c.as)(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?(0,c.UP)(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?(0,c.as)(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&(0,c.eC)(e)&&(e=`https:${e}`);const r=(0,J.S)(e);t.styleUrl=(0,X.e)(e,r)}get tileInfo(){const e=[];for(const t in this.sourceNameToSource)e.push(this.sourceNameToSource[t]);let t=this.primarySource?.tileInfo||new T.c;if(e.length>1)for(let r=0;r<e.length;r++)te(t,e[r].tileInfo)&&(t=re(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new z.G({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=oe().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?(0,c.UP)(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,s=new U({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await s.load(t),this._spriteSourceMap.set(e,s)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=oe().maxTextureSize,i=e.spriteUrl,s=i?(0,c.UP)(i,{...this.customParameters,token:this.apiKey}):null;if(!s&&"url"===e.type)return null;const n=new U(e,r);try{await n.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,n),s&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=s),this.emit("spriteSource-change",{spriteSource:n}),n}catch(e){(0,u.CE)(e)}return null}async loadStyle(e,t){const r=e||this.style||this.url;return this._loadingTask&&"string"==typeof r&&this.url===r||(this._loadingTask?.abort(),this._loadingTask=(0,n.kn)((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return(0,l.ct)(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return(0,l.ct)(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return(0,l.ct)(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new o.c("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await async function(e,t){const r={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[i,s]="string"==typeof e?[e,null]:[null,e.jsonUrl];return await H(r,"geoscene",e,s,t),{layerDefinition:r.validatedSource,url:i,serviceUrl:r.sourceUrl,style:r.style,styleUrl:r.styleUrl,spriteUrl:r.style.sprite&&G(r.styleBase,r.style.sprite),spriteFormat:r.spriteFormat,glyphsUrl:r.style.glyphs&&G(r.styleBase,r.style.glyphs),sourceNameToSource:r.sourceNameToSource,primarySourceName:r.primarySourceName}}(e,{...t,query:{...this.customParameters,token:this.apiKey}});"webp"===r.spriteFormat&&(await function(e){if(E)return E;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return E=new Promise((e=>{const r=new Image;r.onload=()=>{r.onload=r.onerror=null,e(r.width>0&&r.height>0)},r.onerror=()=>{r.onload=r.onerror=null,e(!1)},r.src="data:image/webp;base64,"+t.lossy})),E}()||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new ie.c(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.geoscene\.cn(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const e of r)if(e.toLowerCase().includes(i))return(0,c.k7)(`//static.Grcgis.cn/attribution/Vector${s}/${e}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"attributionDataUrl",null),(0,i._)([(0,h.qq)({type:["show","hide"]})],ae.prototype,"listMode",void 0),(0,i._)([(0,h.qq)({json:{read:!0,write:!0}})],ae.prototype,"blendMode",void 0),(0,i._)([(0,h.qq)({readOnly:!0,json:{read:!1}})],ae.prototype,"capabilities",null),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"currentStyleInfo",void 0),(0,i._)([(0,h.qq)({json:{read:!1},readOnly:!0,type:m.c})],ae.prototype,"fullExtent",null),(0,i._)([(0,h.qq)({json:{read:!1},readOnly:!0,type:m.c})],ae.prototype,"initialExtent",null),(0,i._)([(0,h.qq)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ae.prototype,"isReference",void 0),(0,i._)([(0,h.qq)({type:["VectorTileLayer"]})],ae.prototype,"operationalLayerType",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"parsedUrl",null),(0,i._)([(0,h.qq)()],ae.prototype,"style",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"serviceUrl",null),(0,i._)([(0,h.qq)({type:g.c,readOnly:!0})],ae.prototype,"spatialReference",null),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"styleRepository",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"sourceNameToSource",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"primarySource",void 0),(0,i._)([(0,h.qq)({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],ae.prototype,"styleUrl",null),(0,i._)([(0,y.G)(["portal-item","web-document"],"styleUrl")],ae.prototype,"writeStyleUrl",null),(0,i._)([(0,h.qq)({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:T.c})],ae.prototype,"tileInfo",null),(0,i._)([(0,h.qq)()],ae.prototype,"tilemapCache",void 0),(0,i._)([(0,f.E)("service","tilemapCache",["capabilities","tileInfo"])],ae.prototype,"readTilemapCache",null),(0,i._)([(0,h.qq)({json:{read:!1},readOnly:!0,value:"vector-tile"})],ae.prototype,"type",void 0),(0,i._)([(0,h.qq)({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],ae.prototype,"url",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"version",void 0),(0,i._)([(0,f.E)("version",["version","currentVersion"])],ae.prototype,"readVersion",null),(0,i._)([(0,h.qq)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ae.prototype,"path",void 0),ae=(0,i._)([(0,d.c)("geoscene.layers.VectorTileLayer")],ae);const ue=ae},24676:(e,t,r)=>{r.d(t,{gH:()=>q,GA:()=>I});var i,s,n=r(20744),o=r(58820),l=r(46988),a=r(65604),u=(r(8528),r(14644)),c={exports:{}};s=function(){function e(t,r,i,s){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,e.prototype),n.expected=r,n.found=i,n.location=s,n.name="SyntaxError",n}function t(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.prototype.format=function(e){var r="Error: "+this.message;if(this.location){var i,s=null;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){s=e[i].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,l=this.location.source+":"+o.line+":"+o.column;if(s){var a=this.location.end,u=t("",o.line.toString().length," "),c=s[n.line-1],h=(n.line===a.line?a.column:c.length+1)-n.column||1;r+="\n --\x3e "+l+"\n"+u+" |\n"+o.line+" | "+c+"\n"+u+" | "+t("",n.column-1," ")+t("",h,"^")}else r+="\n at "+l}return r},e.buildMessage=function(e,t){var r={literal:function(e){return'"'+s(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function s(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function o(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(o);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+s(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){var i,s={},n=(r=void 0!==r?r:{}).grammarSource,o={start:He},l=He,a="none",u=")",c=",",h="(",p="%",f="px",d="cm",y="mm",m="in",g="pt",_="pc",v="deg",w="rad",S="grad",A="turn",b="#",x=".",q="e",I=/^[ \t\n\r]/,E=/^[a-z\-]/,R=/^[0-9a-fA-F]/,U=/^[+\-]/,P=/^[0-9]/,T=De("none"),z=$e("none",!1),C=$e(")",!1),L=$e(",",!1),M=De("whitespace"),O=je([" ","\t","\n","\r"],!1,!1),k=De("function"),F=$e("(",!1),$=De("identifier"),j=je([["a","z"],"-"],!1,!1),D=De("percentage"),N=$e("%",!1),B=De("length"),G=$e("px",!1),H=$e("cm",!1),K=$e("mm",!1),W=$e("in",!1),V=$e("pt",!1),Q=$e("pc",!1),J=De("angle"),X=$e("deg",!1),Y=$e("rad",!1),Z=$e("grad",!1),ee=$e("turn",!1),te=De("number"),re=De("color"),ie=$e("#",!1),se=je([["0","9"],["a","f"],["A","F"]],!1,!1),ne=je(["+","-"],!1,!1),oe=je([["0","9"]],!1,!1),le=$e(".",!1),ae=$e("e",!1),ue=function(){return[]},ce=function(e,t){return{type:"function",name:e,parameters:t||[]}},he=function(e,t){return t.length>0?function(e,t,r){return[e].concat(function(e,t){return e.map((function(e){return e[3]}))}(t))}(e,t):[e]},pe=function(e){return{type:"quantity",value:e.value,unit:e.unit}},fe=function(e){return{type:"color",colorType:e.type,value:e.value}},de=function(e){return e},ye=function(){return Fe()},me=function(e){return{value:e,unit:"%"}},ge=function(e){return{value:e,unit:"px"}},_e=function(e){return{value:e,unit:"cm"}},ve=function(e){return{value:e,unit:"mm"}},we=function(e){return{value:e,unit:"in"}},Se=function(e){return{value:e,unit:"pt"}},Ae=function(e){return{value:e,unit:"pc"}},be=function(e){return{value:e,unit:"deg"}},xe=function(e){return{value:e,unit:"rad"}},qe=function(e){return{value:e,unit:"grad"}},Ie=function(e){return{value:e,unit:"turn"}},Ee=function(e){return{value:e,unit:null}},Re=function(){return{type:"hex",value:Fe()}},Ue=function(e){return{type:"function",value:e}},Pe=function(){return{type:"named",value:Fe()}},Te=function(){return parseFloat(Fe())},ze=0,Ce=0,Le=[{line:1,column:1}],Me=0,Oe=[],ke=0;if("startRule"in r){if(!(r.startRule in o))throw new Error("Can't start parsing from rule \""+r.startRule+'".');l=o[r.startRule]}function Fe(){return t.substring(Ce,ze)}function $e(e,t){return{type:"literal",text:e,ignoreCase:t}}function je(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function De(e){return{type:"other",description:e}}function Ne(e){var r,i=Le[e];if(i)return i;for(r=e-1;!Le[r];)r--;for(i={line:(i=Le[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Le[e]=i,i}function Be(e,t,r){var i=Ne(e),s=Ne(t),o={source:n,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:s.line,column:s.column}};return r&&n&&"function"==typeof n.offset&&(o.start=n.offset(o.start),o.end=n.offset(o.end)),o}function Ge(e){ze<Me||(ze>Me&&(Me=ze,Oe=[]),Oe.push(e))}function He(){var e;return(e=Ke())===s&&(e=function(){var e,t;if(e=[],(t=We())!==s)for(;t!==s;)e.push(t),t=We();else e=s;return e}()),e}function Ke(){var e,r;return ke++,e=ze,Qe(),t.substr(ze,4)===a?(r=a,ze+=4):(r=s,0===ke&&Ge(z)),r!==s?(Qe(),Ce=e,e=ue()):(ze=e,e=s),ke--,e===s&&0===ke&&Ge(T),e}function We(){var e,r,i,n;return e=ze,Qe(),(r=function(){var e,r,i;return ke++,e=ze,(r=Je())!==s?(40===t.charCodeAt(ze)?(i=h,ze++):(i=s,0===ke&&Ge(F)),i!==s?(Ce=e,e=de(r)):(ze=e,e=s)):(ze=e,e=s),ke--,e===s&&(r=s,0===ke&&Ge(k)),e}())!==s?(Qe(),(i=function(){var e,r,i,n,o,l,a,u;if(e=ze,(r=Ve())!==s){for(i=[],n=ze,o=Qe(),44===t.charCodeAt(ze)?(l=c,ze++):(l=s,0===ke&&Ge(L)),l===s&&(l=null),a=Qe(),(u=Ve())!==s?n=o=[o,l,a,u]:(ze=n,n=s);n!==s;)i.push(n),n=ze,o=Qe(),44===t.charCodeAt(ze)?(l=c,ze++):(l=s,0===ke&&Ge(L)),l===s&&(l=null),a=Qe(),(u=Ve())!==s?n=o=[o,l,a,u]:(ze=n,n=s);Ce=e,e=he(r,i)}else ze=e,e=s;return e}())===s&&(i=null),Qe(),41===t.charCodeAt(ze)?(n=u,ze++):(n=s,0===ke&&Ge(C)),n!==s?(Qe(),Ce=e,e=ce(r,i)):(ze=e,e=s)):(ze=e,e=s),e}function Ve(){var e,t;return e=ze,(t=Xe())===s&&(t=Ye())===s&&(t=Ze())===s&&(t=function(){var e,t;return ke++,e=ze,Qe(),(t=tt())!==s?(Ce=e,e=Ee(t)):(ze=e,e=s),ke--,e===s&&0===ke&&Ge(te),e}()),t!==s&&(Ce=e,t=pe(t)),(e=t)===s&&(e=ze,(t=et())!==s&&(Ce=e,t=fe(t)),e=t),e}function Qe(){var e,r;for(ke++,e=[],I.test(t.charAt(ze))?(r=t.charAt(ze),ze++):(r=s,0===ke&&Ge(O));r!==s;)e.push(r),I.test(t.charAt(ze))?(r=t.charAt(ze),ze++):(r=s,0===ke&&Ge(O));return ke--,r=s,0===ke&&Ge(M),e}function Je(){var e,r,i;if(ke++,e=ze,r=[],E.test(t.charAt(ze))?(i=t.charAt(ze),ze++):(i=s,0===ke&&Ge(j)),i!==s)for(;i!==s;)r.push(i),E.test(t.charAt(ze))?(i=t.charAt(ze),ze++):(i=s,0===ke&&Ge(j));else r=s;return r!==s&&(Ce=e,r=ye()),ke--,(e=r)===s&&(r=s,0===ke&&Ge($)),e}function Xe(){var e,r,i;return ke++,e=ze,Qe(),(r=tt())!==s?(37===t.charCodeAt(ze)?(i=p,ze++):(i=s,0===ke&&Ge(N)),i!==s?(Ce=e,e=me(r)):(ze=e,e=s)):(ze=e,e=s),ke--,e===s&&0===ke&&Ge(D),e}function Ye(){var e,r,i;return ke++,e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===f?(i=f,ze+=2):(i=s,0===ke&&Ge(G)),i!==s?(Ce=e,e=ge(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===d?(i=d,ze+=2):(i=s,0===ke&&Ge(H)),i!==s?(Ce=e,e=_e(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===y?(i=y,ze+=2):(i=s,0===ke&&Ge(K)),i!==s?(Ce=e,e=ve(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===m?(i=m,ze+=2):(i=s,0===ke&&Ge(W)),i!==s?(Ce=e,e=we(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===g?(i=g,ze+=2):(i=s,0===ke&&Ge(V)),i!==s?(Ce=e,e=Se(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===_?(i=_,ze+=2):(i=s,0===ke&&Ge(Q)),i!==s?(Ce=e,e=Ae(r)):(ze=e,e=s)):(ze=e,e=s)))))),ke--,e===s&&0===ke&&Ge(B),e}function Ze(){var e,r,i;return ke++,e=ze,(r=tt())!==s?(t.substr(ze,3)===v?(i=v,ze+=3):(i=s,0===ke&&Ge(X)),i!==s?(Ce=e,e=be(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,(r=tt())!==s?(t.substr(ze,3)===w?(i=w,ze+=3):(i=s,0===ke&&Ge(Y)),i!==s?(Ce=e,e=xe(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,(r=tt())!==s?(t.substr(ze,4)===S?(i=S,ze+=4):(i=s,0===ke&&Ge(Z)),i!==s?(Ce=e,e=qe(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,(r=tt())!==s?(t.substr(ze,4)===A?(i=A,ze+=4):(i=s,0===ke&&Ge(ee)),i!==s?(Ce=e,e=Ie(r)):(ze=e,e=s)):(ze=e,e=s)))),ke--,e===s&&(r=s,0===ke&&Ge(J)),e}function et(){var e,r,i,n;if(ke++,e=ze,35===t.charCodeAt(ze)?(r=b,ze++):(r=s,0===ke&&Ge(ie)),r!==s){if(i=[],R.test(t.charAt(ze))?(n=t.charAt(ze),ze++):(n=s,0===ke&&Ge(se)),n!==s)for(;n!==s;)i.push(n),R.test(t.charAt(ze))?(n=t.charAt(ze),ze++):(n=s,0===ke&&Ge(se));else i=s;i!==s?(Ce=e,e=Re()):(ze=e,e=s)}else ze=e,e=s;return e===s&&(e=ze,(r=We())!==s&&(Ce=e,r=Ue(r)),(e=r)===s&&(e=ze,(r=Je())!==s&&(Ce=e,r=Pe()),e=r)),ke--,e===s&&(r=s,0===ke&&Ge(re)),e}function tt(){var e,r,i,n,o,l,a;for(e=ze,U.test(t.charAt(ze))?(t.charAt(ze),ze++):0===ke&&Ge(ne),r=ze,i=[],P.test(t.charAt(ze))?(n=t.charAt(ze),ze++):(n=s,0===ke&&Ge(oe));n!==s;)i.push(n),P.test(t.charAt(ze))?(n=t.charAt(ze),ze++):(n=s,0===ke&&Ge(oe));if(46===t.charCodeAt(ze)?(n=x,ze++):(n=s,0===ke&&Ge(le)),n!==s){if(o=[],P.test(t.charAt(ze))?(l=t.charAt(ze),ze++):(l=s,0===ke&&Ge(oe)),l!==s)for(;l!==s;)o.push(l),P.test(t.charAt(ze))?(l=t.charAt(ze),ze++):(l=s,0===ke&&Ge(oe));else o=s;o!==s?r=i=[i,n,o]:(ze=r,r=s)}else ze=r,r=s;if(r===s)if(r=[],P.test(t.charAt(ze))?(i=t.charAt(ze),ze++):(i=s,0===ke&&Ge(oe)),i!==s)for(;i!==s;)r.push(i),P.test(t.charAt(ze))?(i=t.charAt(ze),ze++):(i=s,0===ke&&Ge(oe));else r=s;if(r!==s){if(i=ze,101===t.charCodeAt(ze)?(n=q,ze++):(n=s,0===ke&&Ge(ae)),n!==s){if(U.test(t.charAt(ze))?(o=t.charAt(ze),ze++):(o=s,0===ke&&Ge(ne)),o===s&&(o=null),l=[],P.test(t.charAt(ze))?(a=t.charAt(ze),ze++):(a=s,0===ke&&Ge(oe)),a!==s)for(;a!==s;)l.push(a),P.test(t.charAt(ze))?(a=t.charAt(ze),ze++):(a=s,0===ke&&Ge(oe));else l=s;l!==s?i=n=[n,o,l]:(ze=i,i=s)}else ze=i,i=s;i===s&&(i=null),Ce=e,e=Te()}else ze=e,e=s;return e}if((i=l())!==s&&ze===t.length)return i;throw i!==s&&ze<t.length&&Ge({type:"end"}),function(t,r,i){return new e(e.buildMessage(t,r),t,r,i)}(Oe,Me<t.length?t.charAt(Me):null,Me<t.length?Be(Me,Me+1):Be(Me,Me))}}},(i=c).exports&&(i.exports=s());var h=c.exports;function p(e){if(!e||0===e.length)return null;if("string"==typeof e){const t=f(e);return t&&0!==t.length?t:null}const t=e.map((e=>{if(!Number.isFinite(e.scale)||e.scale<=0)throw new n.c("effect:invalid-scale","scale must be finite and greater than 0",{stop:e});return{scale:e.scale,effects:f(e.value)}}));t.sort(((e,t)=>t.effects.length-e.effects.length));for(let e=0;e<t.length-1;e++){if(!(0,u.w1)(t[e].effects,t[e+1].effects))throw new n.c("effect:interpolation-impossible","Cannot interpolate by scale between 2 lists of mixed effects",{a:t[e].effects,b:t[e+1].effects});(0,u.A1)(t[e].effects,t[e+1].effects)}return t.sort(((e,t)=>t.scale-e.scale)),t}function f(e){let t;if(!e)return[];try{t=h.parse(e)}catch(t){throw new n.c("effect:invalid-syntax","Invalid effect syntax",{value:e,error:t})}return t.map((e=>function(e){try{switch(e.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return function(e){let t=1;return d(e.parameters,1),1===e.parameters.length&&(t=v(e.parameters[0])),new a.M7(e.name,t)}(e);case"opacity":return function(e){let t=1;return d(e.parameters,1),1===e.parameters.length&&(t=v(e.parameters[0])),new a.Ez(t)}(e);case"hue-rotate":return function(e){let t=0;return d(e.parameters,1),1===e.parameters.length&&(t=function(e){return function(e){if("quantity"!==e.type||!(0===e.value&&null===e.unit||e.unit&&null!=g[e.unit]))throw new n.c("effect:type-error",`Expected <angle>, Actual: ${y(e)}`,{term:e})}(e),e.value*g[e.unit]||0}(e.parameters[0])),new a.C8(t)}(e);case"blur":return function(e){let t=0;return d(e.parameters,1),1===e.parameters.length&&(t=w(e.parameters[0]),m(t,e.parameters[0])),new a.o1(t)}(e);case"drop-shadow":return function(e){const t=[];let r=null;for(const i of e.parameters)if("color"===i.type){if(t.length&&Object.freeze(t),r)throw new n.c("effect:type-error","Accepts only one color",{});r=S(i)}else{const e=w(i);if(Object.isFrozen(t))throw new n.c("effect:type-error","<length> parameters not consecutive",{lengths:t});t.push(e),3===t.length&&m(e,i)}if(t.length<2||t.length>3)throw new n.c("effect:type-error",`Expected <length>{2,3}, Actual: <length>{${t.length}}`,{lengths:t});return new a.of(t[0],t[1],t[2]||0,r||A("black"))}(e);case"bloom":return function(e){let t=1,r=0,i=0;return d(e.parameters,3),e.parameters[0]&&(t=v(e.parameters[0])),e.parameters[1]&&(r=w(e.parameters[1]),m(r,e.parameters[1])),e.parameters[2]&&(i=v(e.parameters[2])),new a.qC(t,r,i)}(e)}}catch(t){throw t.details.filter=e,t}throw new n.c("effect:unknown-effect",`Effect '${e.name}' is not supported`,{effect:e})}(e)))}function d(e,t){if(e.length>t)throw new n.c("effect:type-error",`Function supports up to ${t} parameters, Actual: ${e.length}`,{parameters:e})}function y(e){if("color"===e.type)return"<color>";if(e.unit){if(e.unit in _)return"<length>";if(e.unit in g)return"<angle>";if("%"===e.unit)return"<percentage>"}return"<double>"}function m(e,t){if(e<0)throw new n.c("effect:type-error",`Negative values are not allowed, Actual: ${e}`,{term:t})}const g={deg:1,grad:.9,rad:180/Math.PI,turn:360},_={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function v(e){!function(e){if("quantity"!==e.type||null!==e.unit&&"%"!==e.unit)throw new n.c("effect:type-error",`Expected <double> or <percentage>, Actual: ${y(e)}`,{term:e})}(e);const t=e.value;return m(t,e),"%"===e.unit?.01*t:t}function w(e){return function(e){if("quantity"!==e.type||!(0===e.value&&null===e.unit||e.unit&&null!=_[e.unit]))throw new n.c("effect:type-error",`Expected <length>, Actual: ${y(e)}`,{term:e})}(e),e.value*_[e.unit]||0}function S(e){switch(e.colorType){case"hex":return(0,l.yU)(e.value);case"named":return A(e.value);case"function":return function(e){if(d(e.parameters,4),b.test(e.name))return[v(e.parameters[0]),v(e.parameters[1]),v(e.parameters[2]),e.parameters[3]?v(e.parameters[3]):1];if(x.test(e.name))return(0,l.ec)(function(e){return function(e){if("quantity"!==e.type||null!==e.unit)throw new n.c("effect:type-error",`Expected <double>, Actual: ${y(e)}`,{term:e})}(e),m(e.value,e),e.value}(e.parameters[0]),v(e.parameters[1]),v(e.parameters[2]),e.parameters[3]?v(e.parameters[3]):1);throw new n.c("effect:syntax-error",`Invalid color function '${e.name}'`,{colorFunction:e})}(e.value)}}function A(e){if(!(0,l.kv)(e))throw new n.c("effect:unknown-color",`color '${e}' isn't valid`,{namedColor:e});return(0,l.uO)(e)}const b=/^rgba?/i,x=/^hsla?/i;function q(e,t,r){try{return function(e){if(!e||0===e.length)return null;if(function(e){const t=e[0];return!!t&&"scale"in t}(e)){const t=[];for(const r of e)t.push({scale:r.scale,value:E(r.value)});return t}return E(e)}(e)}catch(e){r?.messages?.push(e)}return null}function I(e,t,r,i){try{const i=function(e){const t=p(e);return t?(0,u.Ub)(t)?t.map((e=>e.toJSON())):t.map((({scale:e,effects:t})=>({scale:e,value:t.map((e=>e.toJSON()))}))):null}(e);(0,o.qQ)(r,i,t)}catch(e){i.messages&&i.messages.push(e)}}function E(e){if(!e?.length)return"";const t=[];for(const r of e){let e=[];switch(r.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":e=[R(r,"amount")];break;case"blur":e=[R(r,"radius","pt")];break;case"hue-rotate":e=[R(r,"angle","deg")];break;case"drop-shadow":e=[R(r,"xoffset","pt"),R(r,"yoffset","pt"),R(r,"blurRadius","pt"),U(r,"color")];break;case"bloom":e=[R(r,"strength"),R(r,"radius","pt"),R(r,"threshold")]}const i=`${r.type}(${e.filter(Boolean).join(" ")})`;p(i),t.push(i)}return t.join(" ")}function R(e,t,r){if(null==e[t])throw new n.c("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});return r?e[t]+r:""+e[t]}function U(e,t){if(null==e[t])throw new n.c("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});const r=e[t];return`rgba(${r[0]||0}, ${r[1]||0}, ${r[2]||0}, ${r[3]/255||0})`}},38724:(e,t,r)=>{r.d(t,{C:()=>o});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.qq)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,n.c)("geoscene.layers.mixins.APIKeyMixin")],t),t}},25216:(e,t,r)=>{r.d(t,{W:()=>a});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552)),o=r(24676);const l={read:{reader:o.gH},write:{allowNull:!0,writer:o.GA}},a=e=>{let t=class extends e{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return(0,i._)([(0,s.qq)({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],t.prototype,"blendMode",void 0),(0,i._)([(0,s.qq)({json:{read:!1,write:!1,origins:{"web-map":l,"portal-item":l}}})],t.prototype,"effect",void 0),t=(0,i._)([(0,n.c)("geoscene.layers.mixins.BlendLayer")],t),t}},28584:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,i._)([(0,s.qq)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,i._)([(0,n.c)("geoscene.layers.mixins.CustomParametersMixin")],t),t}},98768:(e,t,r)=>{r.d(t,{K:()=>A});var i=r(41948),s=r(6220),n=r(47620),o=r(2600),l=r(40196),a=r(20744),u=r(66360),c=r(70680),h=r(10860),p=r(28176),f=r(1580),d=(r(9456),r(72052),r(33600)),y=r(12552),m=r(18996),g=r(71068),_=r(54872),v=r(9764),w=r(53039),S=r(46940);const A=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.mG)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await Promise.all([r.e(8828),r.e(4132)]).then(r.bind(r,94132));return(0,h.wp)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.mA)(e)||u.c.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,h.CE)(e),!0))))}async setUserPrivileges(e,t){if(!s.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,h.CE)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=e===r.id;if(i&&r.portal.user)return(0,S.CI)(r);let s,o;if(i)s=r.portal.url;else try{s=await(0,g.mK)(this.url,t)}catch(e){(0,h.CE)(e)}if(!s||!(0,p.Cs)(s,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(n.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.CE)(e)}if(!o)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(i?await r.reload():(r=new v.default({id:e,portal:{url:s}}),await r.load(t)),r.portal.user)return(0,S.CI)(r)}catch(e){(0,h.CE)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.CE)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const r=b.credential===t?b.user:await this._fetchEditingUser(e);return b.credential=t,b.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=n.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=_.c.getDefault();if(s&&s.loaded&&(0,p.k7)(s.restUrl)===(0,p.k7)(i))return s.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,c=await(0,l.aG)((0,o.c)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?w.c.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||_.c.getDefault());return r&&i&&!(0,p.kF)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.c("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i._)([(0,f.qq)({type:v.default})],t.prototype,"portalItem",null),(0,i._)([(0,d.E)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,m.G)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,f.qq)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,f.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,f.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,f.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,i._)([(0,y.c)("geoscene.layers.mixins.PortalLayer")],t),t},b={credential:null,user:null}},3116:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===e.minScale&&r.maxScale===e.maxScale?r:e}};return(0,i._)([(0,s.qq)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),(0,i._)([(0,s.qq)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),(0,i._)([(0,s.qq)({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=(0,i._)([(0,n.c)("geoscene.layers.mixins.ScaleRangeLayer")],t),t}},58648:(e,t,r)=>{r.d(t,{a:()=>o,s:()=>n});var i=r(28176),s=r(54872);function n(e,t){return{...l(e,t),readResourcePaths:[]}}function o(e,t,r){const s=(0,i.as)(e.itemUrl);return{...l(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:s?{rootPath:s.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function l(e,t){return{origin:t,url:(0,i.as)(e.itemUrl),portal:e.portal||s.c.getDefault(),portalItem:e}}},53680:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(69752);class s{static getId(e,t,r,i){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${r}/${i}`}constructor(e,t,r,i){this.set(e,t,r,i)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,r=63&this.level;return(3&this.world)<<30|t<<22|e<<8|r}acquire(e,t,r,i){this.set(e,t,r,i)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){const t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,r,i){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,r,i,s]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(r),this.col=parseFloat(i),this.world=parseFloat(s)}else this.level=+e,this.row=+t,this.col=+r,this.world=+i||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNeighborId(e,t){return`${this.level}/${this.row+t}/${this.col+e}/${this.world}`}getChildKeys(){const e=this.level+1,t=this.row<<1,r=this.col<<1,i=this.world;return[new s(e,t,r,i),new s(e,t,r+1,i),new s(e,t+1,r,i),new s(e,t+1,r+1,i)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}s.pool=new i.c(s,null,null,25,50)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7936],{25228:(e,t,r)=>{r.d(t,{c:()=>y});var i,s=r(41948),n=r(40504),o=r(94360),l=r(1580),a=(r(9456),r(66360),r(72052),r(33600)),u=r(12552),c=r(18996),h=r(28484);let p=i=class extends n.am{static get allTime(){return f}static get empty(){return d}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===i&&r===s}expandTo(e,t=h.OX){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.aU)(r,e,t));let s=this.end;if(s){const r=(0,o.aU)(s,e,t);s=s.getTime()===r.getTime()?r:(0,o.g1)(r,1,e,t)}return new i({start:r,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,l;if(s>=t&&s<=r?o=s:t>=s&&t<=n&&(o=t),r>=s&&r<=n?l=r:n>=t&&n<=r&&(l=n),null!=o&&null!=l&&!isNaN(o)&&!isNaN(l)){const e=new i;return e.start=o===-1/0?null:new Date(o),e.end=l===1/0?null:new Date(l),e}return i.empty}offset(e,t,r=h.OX){if(this.isEmpty||this.isAllTime)return this.clone();const s=new i,{start:n,end:l}=this;return null!=n&&(s.start=(0,o.g1)(n,e,t,r)),null!=l&&(s.end=(0,o.g1)(l,e,t,r)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,s._)([(0,l.qq)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,s._)([(0,a.E)("end")],p.prototype,"readEnd",null),(0,s._)([(0,c.G)("end")],p.prototype,"writeEnd",null),(0,s._)([(0,l.qq)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,s._)([(0,l.qq)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,s._)([(0,l.qq)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,s._)([(0,a.E)("start")],p.prototype,"readStart",null),(0,s._)([(0,c.G)("start")],p.prototype,"writeStart",null),p=i=(0,s._)([(0,u.c)("geoscene.TimeExtent")],p);const f=new p,d=new p({start:void 0,end:void 0}),y=p},22156:(e,t,r)=>{r.d(t,{MR:()=>o,qm:()=>l});var i=r(41948),s=r(12552);let n=0;const o=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return t=(0,i._)([(0,s.c)("geoscene.core.Identifiable")],t),t},l=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n++})}};return t=(0,i._)([(0,s.c)("geoscene.core.NumericIdentifiable")],t),t};let a=class extends(o(class{})){};a=(0,i._)([(0,s.c)("geoscene.core.Identifiable")],a)},11004:(e,t,r)=>{r.d(t,{o:()=>s});var i=r(74452);class s{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,r)=>{r.d(t,{ML:()=>o,kB:()=>l});var i,s,n=r(24680);(s=i||(i={}))[s.ALL=0]="ALL",s[s.SOME=1]="SOME";class o{constructor(e,t,r){this.name=e,this._storage=t,this.id=a+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,r,i=0){this._storage.put(this,e,t,r,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,r){this._storage.updateSize(this,e,t,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class l{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new n.c,this._users=new n.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const r=this._db.get(e.id+t);return r?.size??0}put(e,t,r,s,n){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,i.ALL)),s>this._maxSize)return void this._notifyRemove(t,r,s,i.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,r,0,i.ALL);const l=1+Math.max(n,-4)- -3;this._db.set(t,new u(r,s,l)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t,r,s){t=e.id+t;const n=this._db.get(t);if(n&&n.entry===r){for(this._size-=n.size,e.size-=n.size;s>this._maxSize;){const e=this._notifyRemove(t,r,s,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}n.size=s,this._size+=s,e.size+=s,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},r=new Array;this._db.forEach(((e,i)=>{const s=e.lifetime;r[s]=(r[s]||0)+e.size,this._users.forAll((r=>{const{id:s,name:n}=r;if(i.startsWith(s)){const r=t[n]||0;t[n]=r+e.size}}))}));const i={};this._users.forAll((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[r]||0;t[r]=s,i[r]=Math.round(100*e.hitRate)+"%"}else i[r]="0%"}));const s=Object.keys(t);s.sort(((e,r)=>t[r]-t[e])),s.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+i[r]));for(let t=r.length-1;t>=0;--t){const i=r[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,i){let s;return this._removeFuncs.some((n=>{if(e.startsWith(n[0])){const e=n[1](t,i,r);return"number"==typeof e&&(s=e),!0}return!1})),s}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const r=e?.id;let i=!0;for(;i;){i=!1;for(const[s,n]of this._db)if(0===n.lifetime&&(!r||s.startsWith(r))){if(this._purgeItem(s,n,e),t.size<=.9*t.maxSize)return;i||=this._db.has(s)}}for(const[i,s]of this._db)if((!r||i.startsWith(r))&&(this._purgeItem(i,s,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,r=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=s&&s>0&&(this._size+=s,r&&(r.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let a=0;class u{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}}},57896:(e,t,r)=>{r.d(t,{Eq:()=>p,KG:()=>g,_8:()=>m,_I:()=>u,aE:()=>a,du:()=>y,on:()=>h}),r(40196),r(2952);var i=r(60976),s=r(38912),n=r(70680),o=r(10860),l=r(37176);function a(e,t,r={}){return c(e,t,r,f)}function u(e,t,r={}){return c(e,t,r,d)}function c(e,t,r={},i){let s=null;const o=r.once?(e,r)=>{i(e)&&((0,n.oR)(s),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(s=(0,l.M9)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return s}function h(e,t,r,o={}){let l=null,u=null,c=null;function h(){l&&u&&(u.remove(),o.onListenerRemove?.(l),l=null,u=null)}function p(e){o.once&&o.once&&(0,n.oR)(c),r(e)}const f=a(e,((e,r)=>{h(),(0,i.sh)(e)&&(l=e,u=(0,i.on)(e,t,p),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return c=(0,s.uU)((()=>{f.remove(),h()})),c}function p(e,t){return function(e,t,r){if((0,o.wv)(r))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let l=null;function a(){l=(0,n.oR)(l)}return new Promise(((i,n)=>{l=(0,s.Ip)([(0,o.wD)(r,(()=>{a(),n((0,o.Uh)())})),c(e,(e=>{a(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,d,t)}function f(e){return!0}function d(e){return!!e}r(41168);const y={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},81436:(e,t,r)=>{r.d(t,{c:()=>v});var i=r(41948),s=(r(60708),r(2600)),n=r(20744),o=r(77860),l=r(22156),a=r(95800),u=r(66360),c=r(10860),h=r(28176),p=r(1580),f=(r(9456),r(72052),r(12552)),d=r(6220),y=r(95247),m=r(56156);let g=0,_=class extends(o.c.EventedMixin((0,l.MR)(a.c))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.c(-180,-90,180,90,m.c.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=m.c.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromGeoSceneServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(9232).then(r.bind(r,69232))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await r.e(2259).then(r.bind(r,12259));try{return await i(t)}catch(e){const r=t&&t.portalItem,i=r?.id||"unset",s=r&&r.portal&&r.portal.url||d.default.portalUrl;throw u.c.getLogger("geoscene.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,c.mA)(e)||u.c.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,h.as)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.c)(e,{query:{f:"json"},responseType:"json"})).data;throw new n.c("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,p.qq)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,i._)([(0,p.qq)({type:y.c})],_.prototype,"fullExtent",void 0),(0,i._)([(0,p.qq)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,i._)([(0,p.qq)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,i._)([(0,p.qq)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,i._)([(0,p.qq)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,i._)([(0,p.qq)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,i._)([(0,p.qq)({clonable:!1})],_.prototype,"parent",void 0),(0,i._)([(0,p.qq)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i._)([(0,p.qq)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,i._)([(0,p.qq)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,i._)([(0,p.qq)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,i._)([(0,p.qq)({type:m.c})],_.prototype,"spatialReference",void 0),(0,i._)([(0,p.qq)({type:String})],_.prototype,"title",void 0),(0,i._)([(0,p.qq)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,i._)([(0,p.qq)()],_.prototype,"url",void 0),(0,i._)([(0,p.qq)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,i._)([(0,f.c)("geoscene.layers.Layer")],_);const v=_},65632:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ue});var i=r(41948),s=r(2600),n=r(40196),o=r(20744),l=r(62088),a=r(26496),u=r(10860),c=r(28176),h=r(1580),p=(r(9456),r(66360)),f=r(33600),d=r(12552),y=r(18996),m=r(95247),g=r(56156),_=r(81436),v=r(38724),w=r(54664),S=r(16660),A=r(25216),b=r(28584),x=r(66576),q=r(98768),I=r(3116);let E=null;var R=r(72008);class U{constructor(e,t){this._spriteSource=e,this._maxTextureSize=t,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded","url"===e.type&&e.spriteFormat&&(this._spriteImageFormat=e.spriteFormat),e.pixelRatio&&(this.devicePixelRatio=e.pixelRatio),this.baseURL=e.spriteUrl}get spriteNames(){const e=[];for(const t in this._spritesData)e.push(t);return e.sort(),e}getSpriteInfo(e){return this._spritesData?this._spritesData[e]:null}async load(e){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(e),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(e){this._isRetina=this.devicePixelRatio>1.15;const{width:t,height:r,data:i,json:s}=await this._getSpriteData(this._spriteSource,e),n=Object.keys(s);if(!n||0===n.length||!i)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=s,this.width=t,this.height=r;const l=Math.max(this._maxTextureSize,4096);if(t>l||r>l){const e=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${l} pixels}`;throw p.c.getLogger("geoscene.layers.support.SpriteSource").error(e),new o.c("SpriteSource",e)}let a;for(let e=0;e<i.length;e+=4)a=i[e+3]/255,i[e]=i[e]*a,i[e+1]=i[e+1]*a,i[e+2]=i[e+2]*a;this.image=i}async _getSpriteData(e,t){if("image"===e.type){let t,r;if(this.devicePixelRatio<1.15){if(!e.spriteSource1x)throw new o.c("SpriteSource","no image data provided for low resolution sprites!");t=e.spriteSource1x.image,r=e.spriteSource1x.json}else{if(!e.spriteSource2x)throw new o.c("SpriteSource","no image data provided for high resolution sprites!");t=e.spriteSource2x.image,r=e.spriteSource2x.json}return"width"in t&&"height"in t&&"data"in t&&((0,R.uk)(t.data)||(0,R.UB)(t.data))?{width:t.width,height:t.height,data:new Uint8Array(t.data),json:r}:{...P(t),json:r}}const r=(0,c.as)(this.baseURL),i=r.query?"?"+(0,c.GK)(r.query):"",n=this._isRetina?"@2x":"",l=`${r.path}${n}.${this._spriteImageFormat}${i}`,a=`${r.path}${n}.json${i}`,[u,h]=await Promise.all([(0,s.c)(a,t),(0,s.c)(l,{responseType:"image",...t})]);return{...P(h.data),json:u.data}}}function P(e){const t=document.createElement("canvas"),r=t.getContext("2d");t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height);return{width:e.width,height:e.height,data:new Uint8Array(i.data)}}var T=r(87576),z=r(41464),C=r(60544),L=r(29120),M=r(53680);class O{constructor(e){this.url=e}destroy(){this._tileIndexPromise=null}async fetchTileIndex(){return this._tileIndexPromise||(this._tileIndexPromise=(0,s.c)(this.url).then((e=>e.data.index))),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return(0,u.wp)(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;0!==i.level;)i=new M.c(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,n,o=e,l=r.pop();if(1===o)return l;for(;r.length;)if(s=r.pop(),n=(1&s.col)+((1&s.row)<<1),o){if(0===o[n]){l=null;break}if(1===o[n]){l=s;break}l=s,o=o[n]}return l}}var k=r(70680);class F{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=(0,k.mG)(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=(0,s.c)(this._tileIndexUrl,{query:{...e?.query}}).then((e=>e.data.index))),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,n=new M.c(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,n,t).then((()=>(n.world=e.world,n))).catch((e=>{if((0,u.mA)(e))throw e;return null}))}}var $=r(86916);class j{constructor(e){this._tileUrl=e,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(e){(null==this._promise||(0,u.wv)(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const t=this._abortOptions;return t.push(e),(0,u.wD)(e,(()=>{t.every((e=>(0,u.wv)(e)))&&this._abortController.abort()})),this._promise.then((e=>(0,l.ct)(e)))}async _makeRequest(e){this._abortController=new AbortController;const{data:t}=await(0,s.c)(e,{responseType:"array-buffer",signal:this._abortController.signal});return t}}const D=new Map;function N(e,t){return(0,$.wJ)(D,e,(()=>new j(e))).getData(t).finally((()=>D.delete(e)))}class B{constructor(e,t,r){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=e,this.sourceUrl=t;const i=(0,c.as)(this.sourceUrl),s=(0,l.ct)(r),n=s.tiles;if(i)for(let e=0;e<n.length;e++){const t=(0,c.as)(n[e]);t&&((0,c.ic)(t.path)||(t.path=(0,c.kn)(i.path,t.path)),n[e]=(0,c.UP)(t.path,{...i.query,...t.query}))}this.tileServers=n;const o=r.capabilities&&r.capabilities.split(",").map((e=>e.toLowerCase().trim())),a=!0===r?.exportTilesAllowed,u=!0===o?.includes("tilemap"),h=a&&r.hasOwnProperty("maxExportTilesCount")?r.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:a,supportsTileMap:u},exportTiles:a?{maxExportTilesCount:+h}:null},this.tileInfo=T.c.fromJSON(s.tileInfo);const p=r.tileMap?(0,c.UP)((0,c.kn)(i.path,r.tileMap),i.query??{}):null;u?(this.type="vector-tile",this.tilemap=new F(new z.G({layer:{parsedUrl:i,tileInfo:this.tileInfo},minLOD:s.minLOD??this.tileInfo.lods[0].level,maxLOD:s.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),p)):p&&(this.tilemap=new O(p)),this.fullExtent=m.c.fromJSON(r.fullExtent),this.initialExtent=m.c.fromJSON(r.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(e,t){return await(this.tilemap?.dataKey(e,t))??e}requestTile(e,t,r,i){return function(e,t,r,i,s){const n=(0,c.as)(e),o=n.query;if(o)for(const[e,s]of Object.entries(o))switch(s){case"{x}":o[e]=i.toString();break;case"{y}":o[e]=r.toString();break;case"{z}":o[e]=t.toString()}const l=n.path;return N((0,c.UP)(l.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...n.query}),s)}(this.tileServers[t%this.tileServers.length],e,t,r,i)}isCompatibleWith(e){const t=this.tileInfo,r=e.tileInfo;if(!t.spatialReference.equals(r.spatialReference))return!1;if(!t.origin.equals(r.origin))return!1;if(Math.round(t.dpi)!==Math.round(r.dpi))return!1;const i=t.lods,s=r.lods,n=Math.min(i.length,s.length);for(let e=0;e<n;e++){const t=i[e],r=s[e];if(t.level!==r.level||Math.round(t.scale)!==Math.round(r.scale))return!1}return!0}}function G(...e){let t;for(const r of e)if(null!=r)if((0,c.eC)(r)){if(t){const e=t.split("://")[0];t=e+":"+r.trim()}}else t=(0,c.ic)(r)?r:(0,c.kn)(t,r);return t?(0,c.ai)(t):void 0}async function H(e,t,r,i,n){let o,l,a;if((0,u.wp)(n),"string"==typeof r){const e=(0,c.k7)(r);a=await(0,s.c)(e,{...n,responseType:"json",query:{f:"json",...n?.query}}),a.ssl&&(o&&(o=o.replace(/^http:/i,"https:")),l&&(l=l.replace(/^http:/i,"https:"))),o=e,l=e}else null!=r&&(a={data:r},o=r.jsonUrl||null,l=i);const h=a?.data;if(W(h))return e.styleUrl=o||null,async function(e,t,r,i){const s=r?(0,c.iu)(r):(0,c.Uz)();e.styleBase=s,e.style=t,t["sprite-format"]&&"webp"===t["sprite-format"].toLowerCase()&&(e.spriteFormat="webp");const n=[];if(t.sources&&t.sources.esri){const r=t.sources.esri;r.url?await H(e,"geoscene",G(s,r.url),void 0,i):n.push(H(e,"geoscene",r,s,i))}for(const r of Object.keys(t.sources))"geoscene"!==r&&"vector"===t.sources[r].type&&(t.sources[r].url?n.push(H(e,r,G(s,t.sources[r].url),void 0,i)):t.sources[r].tiles&&n.push(H(e,r,t.sources[r],s,i)));await Promise.all(n)}(e,h,l,n);if(!W(h))return e.sourceUrl?V(e,h,l,!1,t,n):(e.sourceUrl=o||null,V(e,h,l,!0,t,n));throw new Error("You must specify the URL or the JSON for a service or for a style.")}function K(e){return"object"==typeof e&&!!e&&"tilejson"in e&&null!=e.tilejson}function W(e){return!!e&&"sources"in e&&!!e.sources}async function V(e,t,r,i,s,n){const o=r?(0,c.ai)(r)+"/":(0,c.Uz)(),a=function(e){if(e.hasOwnProperty("tileInfo"))return e;const t={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100,latestWkid:3857}};let r=null;if(K(e)){const{bounds:t}=e;if(t){const e=(0,L.w7)({x:t[0],y:t[1],spatialReference:(0,l.ct)(C.UH)}),i=(0,L.w7)({x:t[2],y:t[3],spatialReference:(0,l.ct)(C.UH)});r={xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y,spatialReference:(0,l.ct)(C.QN)}}}null===r&&(r=t);let i=78271.51696400007,s=295828763.7957775;const n=[],o=e.hasOwnProperty("maxzoom")&&null!=e.maxzoom?+e.maxzoom:22;for(let e=0;e<=o;e++)n.push({level:e,scale:s,resolution:i}),i/=2,s/=2;return{capabilities:"TilesOnly",initialExtent:r,fullExtent:t,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:n,spatialReference:(0,l.ct)(C.QN)}}}(t),u=new B(s,(0,c.UP)(o,n?.query??{}),a);if(!i&&e.primarySourceName in e.sourceNameToSource){const t=e.sourceNameToSource[e.primarySourceName];if(!t.isCompatibleWith(u))return;null!=u.fullExtent&&(null!=t.fullExtent?t.fullExtent.union(u.fullExtent):t.fullExtent=u.fullExtent.clone()),t.tileInfo&&u.tileInfo&&t.tileInfo.lods.length<u.tileInfo.lods.length&&(t.tileInfo=u.tileInfo)}if(i&&(e.sourceBase=o,e.source=t,e.validatedSource=a,e.primarySourceName=s),e.sourceNameToSource[s]=u,!K(e)&&"defaultStyles"in t&&!e.style){if(null==t.defaultStyles)throw new Error;return"string"==typeof t.defaultStyles?H(e,"",G(o,t.defaultStyles,"root.json"),void 0,n):H(e,"",t.defaultStyles,G(o,"root.json"),n)}}var Q=r(58648),J=r(5604),X=r(91952),Y=r(67776),Z=r(22108);const ee=1e-6;function te(e,t){if(e===t)return!0;if(null==e&&null!=t)return!1;if(null!=e&&null==t)return!1;if(null==e||null==t)return!1;if(!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;const r=e.origin,i=t.origin;if(Math.abs(r.x-i.x)>=ee||Math.abs(r.y-i.y)>=ee)return!1;let s,n;e.lods[0].scale>t.lods[0].scale?(s=e,n=t):(n=e,s=t);for(let e=s.lods[0].scale;e>=n.lods[n.lods.length-1].scale-ee;e/=2)if(Math.abs(e-n.lods[0].scale)<ee)return!0;return!1}function re(e,t){if(e===t)return e;if(null==e&&null!=t)return t;if(null!=e&&null==t)return e;if(null==e||null==t)return null;const r=e.size[0],i=e.format,s=e.dpi,n=new Y.c({x:e.origin.x,y:e.origin.y}),o=e.spatialReference,l=e.lods[0].scale>t.lods[0].scale?e.lods[0]:t.lods[0],a=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],u=l.scale,c=l.resolution,h=a.scale,p=[];let f=u,d=c,y=0;for(;f>h;)p.push(new Z.c({level:y,resolution:d,scale:f})),y++,f/=2,d/=2;return new T.c({size:[r,r],dpi:s,format:i||"pbf",origin:n,lods:p,spatialReference:o})}var ie=r(11272);function se(e,t={}){return e.getContext("webgl2",t)||null}let ne;function oe(){return ne||(ne=function(){const e=new le,t=function(e){if("undefined"==typeof WebGL2RenderingContext)return null;const t=document.createElement("canvas");if(!t)return null;let r=se(t,{failIfMajorPerformanceCaveat:!0});if(null==r&&(r=se(t),null!=r&&(e.majorPerformanceCaveat=!0)),null==r)return r;e.available=!0,e.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const i=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);return i&&(e.supportsHighPrecisionFragment=i.precision>0),r}(e);return null==t||(e.supportsColorBufferFloat=null!==t.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==t.getExtension("EXT_color_buffer_half_float")),e}()),ne}class le{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}}let ae=class extends((0,A.W)((0,I.I)((0,w.k)((0,S.u)((0,x.Y)((0,q.K)((0,b.G)((0,v.C)((0,a.U)(_.c)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null,this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(u.CE).then((async()=>{if(!this.portalItem?.id)return;const t=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await(0,s.c)(t,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:t},(0,Q.s)(this.portalItem,"portal-item"))})).catch(u.CE).then((()=>this._loadStyle(e)));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&(0,c.as)(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?(0,c.UP)(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?(0,c.as)(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&(0,c.eC)(e)&&(e=`https:${e}`);const r=(0,J.S)(e);t.styleUrl=(0,X.e)(e,r)}get tileInfo(){const e=[];for(const t in this.sourceNameToSource)e.push(this.sourceNameToSource[t]);let t=this.primarySource?.tileInfo||new T.c;if(e.length>1)for(let r=0;r<e.length;r++)te(t,e[r].tileInfo)&&(t=re(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new z.G({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=oe().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?(0,c.UP)(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,s=new U({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await s.load(t),this._spriteSourceMap.set(e,s)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=oe().maxTextureSize,i=e.spriteUrl,s=i?(0,c.UP)(i,{...this.customParameters,token:this.apiKey}):null;if(!s&&"url"===e.type)return null;const n=new U(e,r);try{await n.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,n),s&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=s),this.emit("spriteSource-change",{spriteSource:n}),n}catch(e){(0,u.CE)(e)}return null}async loadStyle(e,t){const r=e||this.style||this.url;return this._loadingTask&&"string"==typeof r&&this.url===r||(this._loadingTask?.abort(),this._loadingTask=(0,n.kn)((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return(0,l.ct)(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return(0,l.ct)(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return(0,l.ct)(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new o.c("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await async function(e,t){const r={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[i,s]="string"==typeof e?[e,null]:[null,e.jsonUrl];return await H(r,"geoscene",e,s,t),{layerDefinition:r.validatedSource,url:i,serviceUrl:r.sourceUrl,style:r.style,styleUrl:r.styleUrl,spriteUrl:r.style.sprite&&G(r.styleBase,r.style.sprite),spriteFormat:r.spriteFormat,glyphsUrl:r.style.glyphs&&G(r.styleBase,r.style.glyphs),sourceNameToSource:r.sourceNameToSource,primarySourceName:r.primarySourceName}}(e,{...t,query:{...this.customParameters,token:this.apiKey}});"webp"===r.spriteFormat&&(await function(e){if(E)return E;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return E=new Promise((e=>{const r=new Image;r.onload=()=>{r.onload=r.onerror=null,e(r.width>0&&r.height>0)},r.onerror=()=>{r.onload=r.onerror=null,e(!1)},r.src="data:image/webp;base64,"+t.lossy})),E}()||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new ie.c(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.geoscene\.cn(\/[^\/]+)?\/geoscene\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const e of r)if(e.toLowerCase().includes(i))return(0,c.k7)(`//static.Grcgis.cn/attribution/Vector${s}/${e}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"attributionDataUrl",null),(0,i._)([(0,h.qq)({type:["show","hide"]})],ae.prototype,"listMode",void 0),(0,i._)([(0,h.qq)({json:{read:!0,write:!0}})],ae.prototype,"blendMode",void 0),(0,i._)([(0,h.qq)({readOnly:!0,json:{read:!1}})],ae.prototype,"capabilities",null),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"currentStyleInfo",void 0),(0,i._)([(0,h.qq)({json:{read:!1},readOnly:!0,type:m.c})],ae.prototype,"fullExtent",null),(0,i._)([(0,h.qq)({json:{read:!1},readOnly:!0,type:m.c})],ae.prototype,"initialExtent",null),(0,i._)([(0,h.qq)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ae.prototype,"isReference",void 0),(0,i._)([(0,h.qq)({type:["VectorTileLayer"]})],ae.prototype,"operationalLayerType",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"parsedUrl",null),(0,i._)([(0,h.qq)()],ae.prototype,"style",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"serviceUrl",null),(0,i._)([(0,h.qq)({type:g.c,readOnly:!0})],ae.prototype,"spatialReference",null),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"styleRepository",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"sourceNameToSource",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"primarySource",void 0),(0,i._)([(0,h.qq)({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],ae.prototype,"styleUrl",null),(0,i._)([(0,y.G)(["portal-item","web-document"],"styleUrl")],ae.prototype,"writeStyleUrl",null),(0,i._)([(0,h.qq)({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:T.c})],ae.prototype,"tileInfo",null),(0,i._)([(0,h.qq)()],ae.prototype,"tilemapCache",void 0),(0,i._)([(0,f.E)("service","tilemapCache",["capabilities","tileInfo"])],ae.prototype,"readTilemapCache",null),(0,i._)([(0,h.qq)({json:{read:!1},readOnly:!0,value:"vector-tile"})],ae.prototype,"type",void 0),(0,i._)([(0,h.qq)({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],ae.prototype,"url",void 0),(0,i._)([(0,h.qq)({readOnly:!0})],ae.prototype,"version",void 0),(0,i._)([(0,f.E)("version",["version","currentVersion"])],ae.prototype,"readVersion",null),(0,i._)([(0,h.qq)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ae.prototype,"path",void 0),ae=(0,i._)([(0,d.c)("geoscene.layers.VectorTileLayer")],ae);const ue=ae},24676:(e,t,r)=>{r.d(t,{gH:()=>q,GA:()=>I});var i,s,n=r(20744),o=r(58820),l=r(46988),a=r(65604),u=(r(8528),r(14644)),c={exports:{}};s=function(){function e(t,r,i,s){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,e.prototype),n.expected=r,n.found=i,n.location=s,n.name="SyntaxError",n}function t(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.prototype.format=function(e){var r="Error: "+this.message;if(this.location){var i,s=null;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){s=e[i].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,l=this.location.source+":"+o.line+":"+o.column;if(s){var a=this.location.end,u=t("",o.line.toString().length," "),c=s[n.line-1],h=(n.line===a.line?a.column:c.length+1)-n.column||1;r+="\n --\x3e "+l+"\n"+u+" |\n"+o.line+" | "+c+"\n"+u+" | "+t("",n.column-1," ")+t("",h,"^")}else r+="\n at "+l}return r},e.buildMessage=function(e,t){var r={literal:function(e){return'"'+s(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function s(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function o(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(o);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+s(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){var i,s={},n=(r=void 0!==r?r:{}).grammarSource,o={start:He},l=He,a="none",u=")",c=",",h="(",p="%",f="px",d="cm",y="mm",m="in",g="pt",_="pc",v="deg",w="rad",S="grad",A="turn",b="#",x=".",q="e",I=/^[ \t\n\r]/,E=/^[a-z\-]/,R=/^[0-9a-fA-F]/,U=/^[+\-]/,P=/^[0-9]/,T=De("none"),z=$e("none",!1),C=$e(")",!1),L=$e(",",!1),M=De("whitespace"),O=je([" ","\t","\n","\r"],!1,!1),k=De("function"),F=$e("(",!1),$=De("identifier"),j=je([["a","z"],"-"],!1,!1),D=De("percentage"),N=$e("%",!1),B=De("length"),G=$e("px",!1),H=$e("cm",!1),K=$e("mm",!1),W=$e("in",!1),V=$e("pt",!1),Q=$e("pc",!1),J=De("angle"),X=$e("deg",!1),Y=$e("rad",!1),Z=$e("grad",!1),ee=$e("turn",!1),te=De("number"),re=De("color"),ie=$e("#",!1),se=je([["0","9"],["a","f"],["A","F"]],!1,!1),ne=je(["+","-"],!1,!1),oe=je([["0","9"]],!1,!1),le=$e(".",!1),ae=$e("e",!1),ue=function(){return[]},ce=function(e,t){return{type:"function",name:e,parameters:t||[]}},he=function(e,t){return t.length>0?function(e,t,r){return[e].concat(function(e,t){return e.map((function(e){return e[3]}))}(t))}(e,t):[e]},pe=function(e){return{type:"quantity",value:e.value,unit:e.unit}},fe=function(e){return{type:"color",colorType:e.type,value:e.value}},de=function(e){return e},ye=function(){return Fe()},me=function(e){return{value:e,unit:"%"}},ge=function(e){return{value:e,unit:"px"}},_e=function(e){return{value:e,unit:"cm"}},ve=function(e){return{value:e,unit:"mm"}},we=function(e){return{value:e,unit:"in"}},Se=function(e){return{value:e,unit:"pt"}},Ae=function(e){return{value:e,unit:"pc"}},be=function(e){return{value:e,unit:"deg"}},xe=function(e){return{value:e,unit:"rad"}},qe=function(e){return{value:e,unit:"grad"}},Ie=function(e){return{value:e,unit:"turn"}},Ee=function(e){return{value:e,unit:null}},Re=function(){return{type:"hex",value:Fe()}},Ue=function(e){return{type:"function",value:e}},Pe=function(){return{type:"named",value:Fe()}},Te=function(){return parseFloat(Fe())},ze=0,Ce=0,Le=[{line:1,column:1}],Me=0,Oe=[],ke=0;if("startRule"in r){if(!(r.startRule in o))throw new Error("Can't start parsing from rule \""+r.startRule+'".');l=o[r.startRule]}function Fe(){return t.substring(Ce,ze)}function $e(e,t){return{type:"literal",text:e,ignoreCase:t}}function je(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function De(e){return{type:"other",description:e}}function Ne(e){var r,i=Le[e];if(i)return i;for(r=e-1;!Le[r];)r--;for(i={line:(i=Le[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Le[e]=i,i}function Be(e,t,r){var i=Ne(e),s=Ne(t),o={source:n,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:s.line,column:s.column}};return r&&n&&"function"==typeof n.offset&&(o.start=n.offset(o.start),o.end=n.offset(o.end)),o}function Ge(e){ze<Me||(ze>Me&&(Me=ze,Oe=[]),Oe.push(e))}function He(){var e;return(e=Ke())===s&&(e=function(){var e,t;if(e=[],(t=We())!==s)for(;t!==s;)e.push(t),t=We();else e=s;return e}()),e}function Ke(){var e,r;return ke++,e=ze,Qe(),t.substr(ze,4)===a?(r=a,ze+=4):(r=s,0===ke&&Ge(z)),r!==s?(Qe(),Ce=e,e=ue()):(ze=e,e=s),ke--,e===s&&0===ke&&Ge(T),e}function We(){var e,r,i,n;return e=ze,Qe(),(r=function(){var e,r,i;return ke++,e=ze,(r=Je())!==s?(40===t.charCodeAt(ze)?(i=h,ze++):(i=s,0===ke&&Ge(F)),i!==s?(Ce=e,e=de(r)):(ze=e,e=s)):(ze=e,e=s),ke--,e===s&&(r=s,0===ke&&Ge(k)),e}())!==s?(Qe(),(i=function(){var e,r,i,n,o,l,a,u;if(e=ze,(r=Ve())!==s){for(i=[],n=ze,o=Qe(),44===t.charCodeAt(ze)?(l=c,ze++):(l=s,0===ke&&Ge(L)),l===s&&(l=null),a=Qe(),(u=Ve())!==s?n=o=[o,l,a,u]:(ze=n,n=s);n!==s;)i.push(n),n=ze,o=Qe(),44===t.charCodeAt(ze)?(l=c,ze++):(l=s,0===ke&&Ge(L)),l===s&&(l=null),a=Qe(),(u=Ve())!==s?n=o=[o,l,a,u]:(ze=n,n=s);Ce=e,e=he(r,i)}else ze=e,e=s;return e}())===s&&(i=null),Qe(),41===t.charCodeAt(ze)?(n=u,ze++):(n=s,0===ke&&Ge(C)),n!==s?(Qe(),Ce=e,e=ce(r,i)):(ze=e,e=s)):(ze=e,e=s),e}function Ve(){var e,t;return e=ze,(t=Xe())===s&&(t=Ye())===s&&(t=Ze())===s&&(t=function(){var e,t;return ke++,e=ze,Qe(),(t=tt())!==s?(Ce=e,e=Ee(t)):(ze=e,e=s),ke--,e===s&&0===ke&&Ge(te),e}()),t!==s&&(Ce=e,t=pe(t)),(e=t)===s&&(e=ze,(t=et())!==s&&(Ce=e,t=fe(t)),e=t),e}function Qe(){var e,r;for(ke++,e=[],I.test(t.charAt(ze))?(r=t.charAt(ze),ze++):(r=s,0===ke&&Ge(O));r!==s;)e.push(r),I.test(t.charAt(ze))?(r=t.charAt(ze),ze++):(r=s,0===ke&&Ge(O));return ke--,r=s,0===ke&&Ge(M),e}function Je(){var e,r,i;if(ke++,e=ze,r=[],E.test(t.charAt(ze))?(i=t.charAt(ze),ze++):(i=s,0===ke&&Ge(j)),i!==s)for(;i!==s;)r.push(i),E.test(t.charAt(ze))?(i=t.charAt(ze),ze++):(i=s,0===ke&&Ge(j));else r=s;return r!==s&&(Ce=e,r=ye()),ke--,(e=r)===s&&(r=s,0===ke&&Ge($)),e}function Xe(){var e,r,i;return ke++,e=ze,Qe(),(r=tt())!==s?(37===t.charCodeAt(ze)?(i=p,ze++):(i=s,0===ke&&Ge(N)),i!==s?(Ce=e,e=me(r)):(ze=e,e=s)):(ze=e,e=s),ke--,e===s&&0===ke&&Ge(D),e}function Ye(){var e,r,i;return ke++,e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===f?(i=f,ze+=2):(i=s,0===ke&&Ge(G)),i!==s?(Ce=e,e=ge(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===d?(i=d,ze+=2):(i=s,0===ke&&Ge(H)),i!==s?(Ce=e,e=_e(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===y?(i=y,ze+=2):(i=s,0===ke&&Ge(K)),i!==s?(Ce=e,e=ve(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===m?(i=m,ze+=2):(i=s,0===ke&&Ge(W)),i!==s?(Ce=e,e=we(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===g?(i=g,ze+=2):(i=s,0===ke&&Ge(V)),i!==s?(Ce=e,e=Se(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,Qe(),(r=tt())!==s?(t.substr(ze,2)===_?(i=_,ze+=2):(i=s,0===ke&&Ge(Q)),i!==s?(Ce=e,e=Ae(r)):(ze=e,e=s)):(ze=e,e=s)))))),ke--,e===s&&0===ke&&Ge(B),e}function Ze(){var e,r,i;return ke++,e=ze,(r=tt())!==s?(t.substr(ze,3)===v?(i=v,ze+=3):(i=s,0===ke&&Ge(X)),i!==s?(Ce=e,e=be(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,(r=tt())!==s?(t.substr(ze,3)===w?(i=w,ze+=3):(i=s,0===ke&&Ge(Y)),i!==s?(Ce=e,e=xe(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,(r=tt())!==s?(t.substr(ze,4)===S?(i=S,ze+=4):(i=s,0===ke&&Ge(Z)),i!==s?(Ce=e,e=qe(r)):(ze=e,e=s)):(ze=e,e=s),e===s&&(e=ze,(r=tt())!==s?(t.substr(ze,4)===A?(i=A,ze+=4):(i=s,0===ke&&Ge(ee)),i!==s?(Ce=e,e=Ie(r)):(ze=e,e=s)):(ze=e,e=s)))),ke--,e===s&&(r=s,0===ke&&Ge(J)),e}function et(){var e,r,i,n;if(ke++,e=ze,35===t.charCodeAt(ze)?(r=b,ze++):(r=s,0===ke&&Ge(ie)),r!==s){if(i=[],R.test(t.charAt(ze))?(n=t.charAt(ze),ze++):(n=s,0===ke&&Ge(se)),n!==s)for(;n!==s;)i.push(n),R.test(t.charAt(ze))?(n=t.charAt(ze),ze++):(n=s,0===ke&&Ge(se));else i=s;i!==s?(Ce=e,e=Re()):(ze=e,e=s)}else ze=e,e=s;return e===s&&(e=ze,(r=We())!==s&&(Ce=e,r=Ue(r)),(e=r)===s&&(e=ze,(r=Je())!==s&&(Ce=e,r=Pe()),e=r)),ke--,e===s&&(r=s,0===ke&&Ge(re)),e}function tt(){var e,r,i,n,o,l,a;for(e=ze,U.test(t.charAt(ze))?(t.charAt(ze),ze++):0===ke&&Ge(ne),r=ze,i=[],P.test(t.charAt(ze))?(n=t.charAt(ze),ze++):(n=s,0===ke&&Ge(oe));n!==s;)i.push(n),P.test(t.charAt(ze))?(n=t.charAt(ze),ze++):(n=s,0===ke&&Ge(oe));if(46===t.charCodeAt(ze)?(n=x,ze++):(n=s,0===ke&&Ge(le)),n!==s){if(o=[],P.test(t.charAt(ze))?(l=t.charAt(ze),ze++):(l=s,0===ke&&Ge(oe)),l!==s)for(;l!==s;)o.push(l),P.test(t.charAt(ze))?(l=t.charAt(ze),ze++):(l=s,0===ke&&Ge(oe));else o=s;o!==s?r=i=[i,n,o]:(ze=r,r=s)}else ze=r,r=s;if(r===s)if(r=[],P.test(t.charAt(ze))?(i=t.charAt(ze),ze++):(i=s,0===ke&&Ge(oe)),i!==s)for(;i!==s;)r.push(i),P.test(t.charAt(ze))?(i=t.charAt(ze),ze++):(i=s,0===ke&&Ge(oe));else r=s;if(r!==s){if(i=ze,101===t.charCodeAt(ze)?(n=q,ze++):(n=s,0===ke&&Ge(ae)),n!==s){if(U.test(t.charAt(ze))?(o=t.charAt(ze),ze++):(o=s,0===ke&&Ge(ne)),o===s&&(o=null),l=[],P.test(t.charAt(ze))?(a=t.charAt(ze),ze++):(a=s,0===ke&&Ge(oe)),a!==s)for(;a!==s;)l.push(a),P.test(t.charAt(ze))?(a=t.charAt(ze),ze++):(a=s,0===ke&&Ge(oe));else l=s;l!==s?i=n=[n,o,l]:(ze=i,i=s)}else ze=i,i=s;i===s&&(i=null),Ce=e,e=Te()}else ze=e,e=s;return e}if((i=l())!==s&&ze===t.length)return i;throw i!==s&&ze<t.length&&Ge({type:"end"}),function(t,r,i){return new e(e.buildMessage(t,r),t,r,i)}(Oe,Me<t.length?t.charAt(Me):null,Me<t.length?Be(Me,Me+1):Be(Me,Me))}}},(i=c).exports&&(i.exports=s());var h=c.exports;function p(e){if(!e||0===e.length)return null;if("string"==typeof e){const t=f(e);return t&&0!==t.length?t:null}const t=e.map((e=>{if(!Number.isFinite(e.scale)||e.scale<=0)throw new n.c("effect:invalid-scale","scale must be finite and greater than 0",{stop:e});return{scale:e.scale,effects:f(e.value)}}));t.sort(((e,t)=>t.effects.length-e.effects.length));for(let e=0;e<t.length-1;e++){if(!(0,u.w1)(t[e].effects,t[e+1].effects))throw new n.c("effect:interpolation-impossible","Cannot interpolate by scale between 2 lists of mixed effects",{a:t[e].effects,b:t[e+1].effects});(0,u.A1)(t[e].effects,t[e+1].effects)}return t.sort(((e,t)=>t.scale-e.scale)),t}function f(e){let t;if(!e)return[];try{t=h.parse(e)}catch(t){throw new n.c("effect:invalid-syntax","Invalid effect syntax",{value:e,error:t})}return t.map((e=>function(e){try{switch(e.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return function(e){let t=1;return d(e.parameters,1),1===e.parameters.length&&(t=v(e.parameters[0])),new a.M7(e.name,t)}(e);case"opacity":return function(e){let t=1;return d(e.parameters,1),1===e.parameters.length&&(t=v(e.parameters[0])),new a.Ez(t)}(e);case"hue-rotate":return function(e){let t=0;return d(e.parameters,1),1===e.parameters.length&&(t=function(e){return function(e){if("quantity"!==e.type||!(0===e.value&&null===e.unit||e.unit&&null!=g[e.unit]))throw new n.c("effect:type-error",`Expected <angle>, Actual: ${y(e)}`,{term:e})}(e),e.value*g[e.unit]||0}(e.parameters[0])),new a.C8(t)}(e);case"blur":return function(e){let t=0;return d(e.parameters,1),1===e.parameters.length&&(t=w(e.parameters[0]),m(t,e.parameters[0])),new a.o1(t)}(e);case"drop-shadow":return function(e){const t=[];let r=null;for(const i of e.parameters)if("color"===i.type){if(t.length&&Object.freeze(t),r)throw new n.c("effect:type-error","Accepts only one color",{});r=S(i)}else{const e=w(i);if(Object.isFrozen(t))throw new n.c("effect:type-error","<length> parameters not consecutive",{lengths:t});t.push(e),3===t.length&&m(e,i)}if(t.length<2||t.length>3)throw new n.c("effect:type-error",`Expected <length>{2,3}, Actual: <length>{${t.length}}`,{lengths:t});return new a.of(t[0],t[1],t[2]||0,r||A("black"))}(e);case"bloom":return function(e){let t=1,r=0,i=0;return d(e.parameters,3),e.parameters[0]&&(t=v(e.parameters[0])),e.parameters[1]&&(r=w(e.parameters[1]),m(r,e.parameters[1])),e.parameters[2]&&(i=v(e.parameters[2])),new a.qC(t,r,i)}(e)}}catch(t){throw t.details.filter=e,t}throw new n.c("effect:unknown-effect",`Effect '${e.name}' is not supported`,{effect:e})}(e)))}function d(e,t){if(e.length>t)throw new n.c("effect:type-error",`Function supports up to ${t} parameters, Actual: ${e.length}`,{parameters:e})}function y(e){if("color"===e.type)return"<color>";if(e.unit){if(e.unit in _)return"<length>";if(e.unit in g)return"<angle>";if("%"===e.unit)return"<percentage>"}return"<double>"}function m(e,t){if(e<0)throw new n.c("effect:type-error",`Negative values are not allowed, Actual: ${e}`,{term:t})}const g={deg:1,grad:.9,rad:180/Math.PI,turn:360},_={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function v(e){!function(e){if("quantity"!==e.type||null!==e.unit&&"%"!==e.unit)throw new n.c("effect:type-error",`Expected <double> or <percentage>, Actual: ${y(e)}`,{term:e})}(e);const t=e.value;return m(t,e),"%"===e.unit?.01*t:t}function w(e){return function(e){if("quantity"!==e.type||!(0===e.value&&null===e.unit||e.unit&&null!=_[e.unit]))throw new n.c("effect:type-error",`Expected <length>, Actual: ${y(e)}`,{term:e})}(e),e.value*_[e.unit]||0}function S(e){switch(e.colorType){case"hex":return(0,l.yU)(e.value);case"named":return A(e.value);case"function":return function(e){if(d(e.parameters,4),b.test(e.name))return[v(e.parameters[0]),v(e.parameters[1]),v(e.parameters[2]),e.parameters[3]?v(e.parameters[3]):1];if(x.test(e.name))return(0,l.ec)(function(e){return function(e){if("quantity"!==e.type||null!==e.unit)throw new n.c("effect:type-error",`Expected <double>, Actual: ${y(e)}`,{term:e})}(e),m(e.value,e),e.value}(e.parameters[0]),v(e.parameters[1]),v(e.parameters[2]),e.parameters[3]?v(e.parameters[3]):1);throw new n.c("effect:syntax-error",`Invalid color function '${e.name}'`,{colorFunction:e})}(e.value)}}function A(e){if(!(0,l.kv)(e))throw new n.c("effect:unknown-color",`color '${e}' isn't valid`,{namedColor:e});return(0,l.uO)(e)}const b=/^rgba?/i,x=/^hsla?/i;function q(e,t,r){try{return function(e){if(!e||0===e.length)return null;if(function(e){const t=e[0];return!!t&&"scale"in t}(e)){const t=[];for(const r of e)t.push({scale:r.scale,value:E(r.value)});return t}return E(e)}(e)}catch(e){r?.messages?.push(e)}return null}function I(e,t,r,i){try{const i=function(e){const t=p(e);return t?(0,u.Ub)(t)?t.map((e=>e.toJSON())):t.map((({scale:e,effects:t})=>({scale:e,value:t.map((e=>e.toJSON()))}))):null}(e);(0,o.qQ)(r,i,t)}catch(e){i.messages&&i.messages.push(e)}}function E(e){if(!e?.length)return"";const t=[];for(const r of e){let e=[];switch(r.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":e=[R(r,"amount")];break;case"blur":e=[R(r,"radius","pt")];break;case"hue-rotate":e=[R(r,"angle","deg")];break;case"drop-shadow":e=[R(r,"xoffset","pt"),R(r,"yoffset","pt"),R(r,"blurRadius","pt"),U(r,"color")];break;case"bloom":e=[R(r,"strength"),R(r,"radius","pt"),R(r,"threshold")]}const i=`${r.type}(${e.filter(Boolean).join(" ")})`;p(i),t.push(i)}return t.join(" ")}function R(e,t,r){if(null==e[t])throw new n.c("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});return r?e[t]+r:""+e[t]}function U(e,t){if(null==e[t])throw new n.c("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});const r=e[t];return`rgba(${r[0]||0}, ${r[1]||0}, ${r[2]||0}, ${r[3]/255||0})`}},38724:(e,t,r)=>{r.d(t,{C:()=>o});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.qq)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,n.c)("geoscene.layers.mixins.APIKeyMixin")],t),t}},25216:(e,t,r)=>{r.d(t,{W:()=>a});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552)),o=r(24676);const l={read:{reader:o.gH},write:{allowNull:!0,writer:o.GA}},a=e=>{let t=class extends e{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return(0,i._)([(0,s.qq)({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],t.prototype,"blendMode",void 0),(0,i._)([(0,s.qq)({json:{read:!1,write:!1,origins:{"web-map":l,"portal-item":l}}})],t.prototype,"effect",void 0),t=(0,i._)([(0,n.c)("geoscene.layers.mixins.BlendLayer")],t),t}},28584:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,i._)([(0,s.qq)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,i._)([(0,n.c)("geoscene.layers.mixins.CustomParametersMixin")],t),t}},98768:(e,t,r)=>{r.d(t,{K:()=>A});var i=r(41948),s=r(6220),n=r(47620),o=r(2600),l=r(40196),a=r(20744),u=r(66360),c=r(70680),h=r(10860),p=r(28176),f=r(1580),d=(r(9456),r(72052),r(33600)),y=r(12552),m=r(18996),g=r(71068),_=r(54872),v=r(9764),w=r(53039),S=r(46940);const A=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.mG)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await Promise.all([r.e(8828),r.e(4132)]).then(r.bind(r,94132));return(0,h.wp)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.mA)(e)||u.c.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,h.CE)(e),!0))))}async setUserPrivileges(e,t){if(!s.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,h.CE)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=e===r.id;if(i&&r.portal.user)return(0,S.CI)(r);let s,o;if(i)s=r.portal.url;else try{s=await(0,g.mK)(this.url,t)}catch(e){(0,h.CE)(e)}if(!s||!(0,p.Cs)(s,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(n.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.CE)(e)}if(!o)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(i?await r.reload():(r=new v.default({id:e,portal:{url:s}}),await r.load(t)),r.portal.user)return(0,S.CI)(r)}catch(e){(0,h.CE)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.CE)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const r=b.credential===t?b.user:await this._fetchEditingUser(e);return b.credential=t,b.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=n.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=_.c.getDefault();if(s&&s.loaded&&(0,p.k7)(s.restUrl)===(0,p.k7)(i))return s.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,c=await(0,l.aG)((0,o.c)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?w.c.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||_.c.getDefault());return r&&i&&!(0,p.kF)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.c("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i._)([(0,f.qq)({type:v.default})],t.prototype,"portalItem",null),(0,i._)([(0,d.E)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,m.G)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,f.qq)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,f.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,f.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,f.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,i._)([(0,y.c)("geoscene.layers.mixins.PortalLayer")],t),t},b={credential:null,user:null}},3116:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(41948),s=r(1580),n=(r(9456),r(66360),r(72052),r(12552));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===e.minScale&&r.maxScale===e.maxScale?r:e}};return(0,i._)([(0,s.qq)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),(0,i._)([(0,s.qq)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),(0,i._)([(0,s.qq)({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=(0,i._)([(0,n.c)("geoscene.layers.mixins.ScaleRangeLayer")],t),t}},58648:(e,t,r)=>{r.d(t,{a:()=>o,s:()=>n});var i=r(28176),s=r(54872);function n(e,t){return{...l(e,t),readResourcePaths:[]}}function o(e,t,r){const s=(0,i.as)(e.itemUrl);return{...l(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:s?{rootPath:s.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function l(e,t){return{origin:t,url:(0,i.as)(e.itemUrl),portal:e.portal||s.c.getDefault(),portalItem:e}}},53680:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(69752);class s{static getId(e,t,r,i){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${r}/${i}`}constructor(e,t,r,i){this.set(e,t,r,i)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,r=63&this.level;return(3&this.world)<<30|t<<22|e<<8|r}acquire(e,t,r,i){this.set(e,t,r,i)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){const t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,r,i){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,r,i,s]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(r),this.col=parseFloat(i),this.world=parseFloat(s)}else this.level=+e,this.row=+t,this.col=+r,this.world=+i||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNeighborId(e,t){return`${this.level}/${this.row+t}/${this.col+e}/${this.world}`}getChildKeys(){const e=this.level+1,t=this.row<<1,r=this.col<<1,i=this.world;return[new s(e,t,r,i),new s(e,t,r+1,i),new s(e,t+1,r,i),new s(e,t+1,r+1,i)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}s.pool=new i.c(s,null,null,25,50)}}]);
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.29/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import r from"../request.js";import t from"../core/Error.js";import{loadAll as s}from"../core/loadAll.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{urlToObject as a,objectToQuery as l,makeAbsolute as n}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{cast as c}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import"../core/has.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/SpatialReference.js";import y from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISMapService as g}from"./mixins/ArcGISMapService.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as b}from"./mixins/PortalLayer.js";import{RefreshableLayer as w}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as L}from"./mixins/SublayersOwner.js";import{parse as R,isHostedAgolService as U,isArcGISUrl as P}from"./support/arcgisLayerUrl.js";import{url as x}from"./support/commonProperties.js";import{createTileBitmap as A}from"./support/imageBitmapUtils.js";import M from"./support/Sublayer.js";var W;const I=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let B=W=class extends(_(O(L(v(g(T(b(S(i(w(f(j(y))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(o).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&d.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),o=[],a={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},a);o.push(r)}));o.some((e=>Object.keys(e).length>1))&&(r.layers=o)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>a(e).path)):null}fetchTile(e,t,s,i={}){const{signal:o}=i,a=this.getTileUrl(e,t,s),l={responseType:"image",signal:o,query:{...this.refreshParameters}};return r(a,l).then((e=>e.data))}async fetchImageBitmapTile(e,t,s,i={}){const{signal:o}=i;if(this.fetchTile!==W.prototype.fetchTile){const r=await this.fetchTile(e,t,s,i);return A(r,e,t,s,o)}const a=this.getTileUrl(e,t,s),l={responseType:"blob",signal:o,query:{...this.refreshParameters}},{data:n}=await r(a,l);return A(n,e,t,s,o)}getTileUrl(e,r,t){const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,i=l({...this.parsedUrl?.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),o=this.tileServers;return`${o&&o.length?o[r%o.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${i?"?"+i:""}`}loadAll(){return s(this,(e=>{e(this.allSublayers)}))}_fetchService(e){return new Promise(((s,i)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new t("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void s({data:this.sourceJSON})}if(!this.parsedUrl)throw new t("tile-layer:undefined-url","layer's url is not defined");const o=R(this.parsedUrl.path);if(null!=o&&"ImageServer"===o.serverType)throw new t("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(s,i)})).then((r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!U(t))return this._fetchServerVersion(t,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,s){if(!P(e))return Promise.reject();const i=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return r(i,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:s}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new t("tile-layer:version-not-available")}))}_getMapName(e){return void 0}_getDefaultAttribution(e){return null;let r;e=e.toLowerCase();for(let t=0,s=I.length;t<s;t++)if(r=I[t],r.toLowerCase().includes(e))return n("//static.Grcgis.cn/attribution/"+r);return null}_getDefaultTileServers(e){if(null==e)return[];const r=-1!==e.search(/^(?:https?:)?\/\/server\.arcgisonline\.com/i),t=-1!==e.search(/^(?:https?:)?\/\/services\.arcgisonline\.com/i);return r||t?[e,e.replace(r?/server\.arcgisonline/i:/services\.arcgisonline/i,r?"services.arcgisonline":"server.arcgisonline")]:[]}get hasOverriddenFetchTile(){return!this.fetchTile[C]}};e([p({readOnly:!0})],B.prototype,"attributionDataUrl",null),e([p({type:["show","hide","hide-children"]})],B.prototype,"listMode",void 0),e([p({json:{read:!0,write:!0}})],B.prototype,"blendMode",void 0),e([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),e([p({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],B.prototype,"operationalLayerType",void 0),e([p({type:Boolean})],B.prototype,"resampling",void 0),e([p()],B.prototype,"sourceJSON",void 0),e([p({type:d})],B.prototype,"spatialReference",void 0),e([u("spatialReference",["spatialReference","tileInfo"])],B.prototype,"readSpatialReference",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],B.prototype,"path",void 0),e([p({readOnly:!0})],B.prototype,"sublayers",void 0),e([h("sublayers",{layers:{type:[M]}})],B.prototype,"writeSublayers",null),e([p({json:{read:!1,write:!1}})],B.prototype,"popupEnabled",void 0),e([p()],B.prototype,"tileServers",null),e([c("tileServers")],B.prototype,"castTileServers",null),e([p({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),e([p(x)],B.prototype,"url",void 0),B=W=e([m("geoscene.layers.TileLayer")],B);const C=Symbol("default-fetch-tile");B.prototype.fetchTile[C]=!0;const N=B;export{N as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import r from"../request.js";import t from"../core/Error.js";import{loadAll as s}from"../core/loadAll.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{urlToObject as a,objectToQuery as l,makeAbsolute as n}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{cast as c}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import"../core/has.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/SpatialReference.js";import y from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISMapService as g}from"./mixins/ArcGISMapService.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as b}from"./mixins/PortalLayer.js";import{RefreshableLayer as w}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as L}from"./mixins/SublayersOwner.js";import{parse as R,isHostedAgolService as U,isArcGISUrl as P}from"./support/arcgisLayerUrl.js";import{url as x}from"./support/commonProperties.js";import{createTileBitmap as A}from"./support/imageBitmapUtils.js";import M from"./support/Sublayer.js";var W;const I=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let B=W=class extends(_(O(L(v(g(T(b(S(i(w(f(j(y))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(o).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&d.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),o=[],a={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},a);o.push(r)}));o.some((e=>Object.keys(e).length>1))&&(r.layers=o)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>a(e).path)):null}fetchTile(e,t,s,i={}){const{signal:o}=i,a=this.getTileUrl(e,t,s),l={responseType:"image",signal:o,query:{...this.refreshParameters}};return r(a,l).then((e=>e.data))}async fetchImageBitmapTile(e,t,s,i={}){const{signal:o}=i;if(this.fetchTile!==W.prototype.fetchTile){const r=await this.fetchTile(e,t,s,i);return A(r,e,t,s,o)}const a=this.getTileUrl(e,t,s),l={responseType:"blob",signal:o,query:{...this.refreshParameters}},{data:n}=await r(a,l);return A(n,e,t,s,o)}getTileUrl(e,r,t){const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,i=l({...this.parsedUrl?.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),o=this.tileServers;return`${o&&o.length?o[r%o.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${i?"?"+i:""}`}loadAll(){return s(this,(e=>{e(this.allSublayers)}))}_fetchService(e){return new Promise(((s,i)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new t("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void s({data:this.sourceJSON})}if(!this.parsedUrl)throw new t("tile-layer:undefined-url","layer's url is not defined");const o=R(this.parsedUrl.path);if(null!=o&&"ImageServer"===o.serverType)throw new t("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(s,i)})).then((r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!U(t))return this._fetchServerVersion(t,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,s){if(!P(e))return Promise.reject();const i=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return r(i,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:s}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new t("tile-layer:version-not-available")}))}_getMapName(e){return void 0}_getDefaultAttribution(e){return null;let r;e=e.toLowerCase();for(let t=0,s=I.length;t<s;t++)if(r=I[t],r.toLowerCase().includes(e))return n("//static.Grcgis.cn/attribution/"+r);return null}_getDefaultTileServers(e){return[];}get hasOverriddenFetchTile(){return!this.fetchTile[C]}};e([p({readOnly:!0})],B.prototype,"attributionDataUrl",null),e([p({type:["show","hide","hide-children"]})],B.prototype,"listMode",void 0),e([p({json:{read:!0,write:!0}})],B.prototype,"blendMode",void 0),e([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),e([p({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],B.prototype,"operationalLayerType",void 0),e([p({type:Boolean})],B.prototype,"resampling",void 0),e([p()],B.prototype,"sourceJSON",void 0),e([p({type:d})],B.prototype,"spatialReference",void 0),e([u("spatialReference",["spatialReference","tileInfo"])],B.prototype,"readSpatialReference",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],B.prototype,"path",void 0),e([p({readOnly:!0})],B.prototype,"sublayers",void 0),e([h("sublayers",{layers:{type:[M]}})],B.prototype,"writeSublayers",null),e([p({json:{read:!1,write:!1}})],B.prototype,"popupEnabled",void 0),e([p()],B.prototype,"tileServers",null),e([c("tileServers")],B.prototype,"castTileServers",null),e([p({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),e([p(x)],B.prototype,"url",void 0),B=W=e([m("geoscene.layers.TileLayer")],B);const C=Symbol("default-fetch-tile");B.prototype.fetchTile[C]=!0;const N=B;export{N as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.29/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import{createTask as r}from"../core/asyncUtils.js";import i from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as U}from"./mixins/ScaleRangeLayer.js";import{checkWebPSupport as x}from"./support/imageUtils.js";import L from"./support/SpriteSource.js";import I from"./support/TileInfo.js";import{TilemapCache as R}from"./support/TilemapCache.js";import{loadMetadata as O}from"./support/vectorTileLayerLoader.js";import{createForItemRead as P}from"../portal/support/jsonContext.js";import{parseKnownOnlineDomain as M}from"../portal/support/urlUtils.js";import{e as C}from"../chunks/persistableUrlUtils.js";import{areSchemasOverlapping as V,unionTileInfos as D}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import k from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as E}from"../views/webgl/capabilities.js";let N=class extends(_(U(v(j(b(T(w(g(s(f)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null,this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(l).then((async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},P(this.portalItem,"portal-item"))})).catch(l).then((()=>this._loadStyle(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`);const r=M(e);t.styleUrl=C(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new I;if(e.length>1)for(let r=0;r<e.length;r++)V(t,e[r].tileInfo)&&(t=D(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new R({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=E().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,o=new L({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await o.load(t),this._spriteSourceMap.set(e,o)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=E().maxTextureSize,i=e.spriteUrl,o=i?n(i,{...this.customParameters,token:this.apiKey}):null;if(!o&&"url"===e.type)return null;const s=new L(e,r);try{await s.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,s),o&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=o),this.emit("spriteSource-change",{spriteSource:s}),s}catch(a){l(a)}return null}async loadStyle(e,t){const i=e||this.style||this.url;return this._loadingTask&&"string"==typeof i&&this.url===i||(this._loadingTask?.abort(),this._loadingTask=r((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(i,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return o(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return o(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new i("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await O(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await x("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new k(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.geoscene\.cn(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const o=t[1]||"";for(const s of r)if(s.toLowerCase().includes(i))return y(`//static.Grcgis.cn/attribution/Vector${o}/${s}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],N.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],N.prototype,"listMode",void 0),e([u({json:{read:!0,write:!0}})],N.prototype,"blendMode",void 0),e([u({readOnly:!0,json:{read:!1}})],N.prototype,"capabilities",null),e([u({readOnly:!0})],N.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],N.prototype,"fullExtent",null),e([u({json:{read:!1},readOnly:!0,type:d})],N.prototype,"initialExtent",null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],N.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],N.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],N.prototype,"parsedUrl",null),e([u()],N.prototype,"style",void 0),e([u({readOnly:!0})],N.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],N.prototype,"spatialReference",null),e([u({readOnly:!0})],N.prototype,"styleRepository",void 0),e([u({readOnly:!0})],N.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],N.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],N.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],N.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:I})],N.prototype,"tileInfo",null),e([u()],N.prototype,"tilemapCache",void 0),e([c("service","tilemapCache",["capabilities","tileInfo"])],N.prototype,"readTilemapCache",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],N.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],N.prototype,"url",void 0),e([u({readOnly:!0})],N.prototype,"version",void 0),e([c("version",["version","currentVersion"])],N.prototype,"readVersion",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],N.prototype,"path",void 0),N=e([m("geoscene.layers.VectorTileLayer")],N);const A=N;export{A as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import{createTask as r}from"../core/asyncUtils.js";import i from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as U}from"./mixins/ScaleRangeLayer.js";import{checkWebPSupport as x}from"./support/imageUtils.js";import L from"./support/SpriteSource.js";import I from"./support/TileInfo.js";import{TilemapCache as R}from"./support/TilemapCache.js";import{loadMetadata as O}from"./support/vectorTileLayerLoader.js";import{createForItemRead as P}from"../portal/support/jsonContext.js";import{parseKnownOnlineDomain as M}from"../portal/support/urlUtils.js";import{e as C}from"../chunks/persistableUrlUtils.js";import{areSchemasOverlapping as V,unionTileInfos as D}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import k from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as E}from"../views/webgl/capabilities.js";let N=class extends(_(U(v(j(b(T(w(g(s(f)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null,this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(l).then((async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},P(this.portalItem,"portal-item"))})).catch(l).then((()=>this._loadStyle(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`);const r=M(e);t.styleUrl=C(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new I;if(e.length>1)for(let r=0;r<e.length;r++)V(t,e[r].tileInfo)&&(t=D(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new R({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=E().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,o=new L({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await o.load(t),this._spriteSourceMap.set(e,o)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=E().maxTextureSize,i=e.spriteUrl,o=i?n(i,{...this.customParameters,token:this.apiKey}):null;if(!o&&"url"===e.type)return null;const s=new L(e,r);try{await s.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,s),o&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=o),this.emit("spriteSource-change",{spriteSource:s}),s}catch(a){l(a)}return null}async loadStyle(e,t){const i=e||this.style||this.url;return this._loadingTask&&"string"==typeof i&&this.url===i||(this._loadingTask?.abort(),this._loadingTask=r((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(i,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return o(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return o(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new i("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await O(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await x("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new k(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.geoscene\.cn(\/[^\/]+)?\/geoscene\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const o=t[1]||"";for(const s of r)if(s.toLowerCase().includes(i))return y(`//static.Grcgis.cn/attribution/Vector${o}/${s}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],N.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],N.prototype,"listMode",void 0),e([u({json:{read:!0,write:!0}})],N.prototype,"blendMode",void 0),e([u({readOnly:!0,json:{read:!1}})],N.prototype,"capabilities",null),e([u({readOnly:!0})],N.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],N.prototype,"fullExtent",null),e([u({json:{read:!1},readOnly:!0,type:d})],N.prototype,"initialExtent",null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],N.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],N.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],N.prototype,"parsedUrl",null),e([u()],N.prototype,"style",void 0),e([u({readOnly:!0})],N.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],N.prototype,"spatialReference",null),e([u({readOnly:!0})],N.prototype,"styleRepository",void 0),e([u({readOnly:!0})],N.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],N.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],N.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],N.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:I})],N.prototype,"tileInfo",null),e([u()],N.prototype,"tilemapCache",void 0),e([c("service","tilemapCache",["capabilities","tileInfo"])],N.prototype,"readTilemapCache",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],N.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],N.prototype,"url",void 0),e([u({readOnly:!0})],N.prototype,"version",void 0),e([c("version",["version","currentVersion"])],N.prototype,"readVersion",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],N.prototype,"path",void 0),N=e([m("geoscene.layers.VectorTileLayer")],N);const A=N;export{A as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoscene/core",
3
- "version": "4.29.8",
3
+ "version": "4.29.9",
4
4
  "homepage": "https://js.geoscene.cn",
5
5
  "description": "GeoScene Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [