@arcgis/core 4.29.8 → 4.29.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{df6fbabbc74a408575fc.js → 17f517cc6986c483e61c.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8ac511280f873960d46.js → 1dc474a28d5ddac1a4b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc5ac713872766571e07.js → 31c065746e53f7518c17.js} +1 -1
- package/assets/esri/core/workers/chunks/{c556644bb0cf88770939.js → 413978b96c88d5ff01ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{8225febaf0a412f4cee4.js → 5e4465448b2728cafab0.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a8ab968ebb18480481d.js → 8699eaadd3fb6709fd94.js} +1 -1
- package/assets/esri/core/workers/chunks/{b139cf91bc148aa84419.js → 96cb79adabfbbcc3e707.js} +1 -1
- package/assets/esri/core/workers/chunks/{2433b39624a7e274cb98.js → b4c41a8244b7371e864e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b42a83db83851cb57d44.js → bed684a8d38fa7ac5eb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe74ee642bc72fe18210.js → d576aa444ad7c9289617.js} +1 -1
- package/assets/esri/core/workers/chunks/{f60e5dd0e712cf32f782.js → f2e8b75ad3b574894ade.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9c55ff1f21db198ce03.js → ff96940be6a4c8489ebb.js} +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/utils.js +5 -0
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5672,8528],{8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{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,s=1){this._storage.put(this,e,t,s,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,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=h+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),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,s,i=0){this._storage.put(this,e,t,s,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,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{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 r.c,this._users=new r.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 s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){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!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.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={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[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,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,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,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_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 s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let h=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=l,this._compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),w.prune(),S.prune(),v.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(p(e,s))for(x.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;p(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):x.push(r))}s=x.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!p(e,t))return!1;for(x.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(p(e,r)){if(t.leaf||g(e,r))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new R([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(S.clear(),v.clear();s||S.length>0;){if(s||(s=S.pop(),n=S.data[S.length-1],r=v.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),S.push(s),this._condense(S),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(S.push(s),v.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(w.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else w.pushArray(s.children);s=w.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new R(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new B([]);o.height=i;const h=Math.ceil(n/r),u=h*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,h,this._compareMinY);for(let s=n;s<=t;s+=h){const n=Math.min(s+h-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),h=m(e,o)-a;h<n?(n=h,i=a<i?a:i,s=o):h===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);S.clear();const r=this._chooseSubtree(n,this._data,t,S);for(r.children.push(e),u(r,n);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;this._adjustParentBBoxes(n,S,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),h=s.leaf?new R(o):new B(o);h.height=s.height,a(s,this._toBBox),a(h,this._toBBox),t?e.data[t-1].children.push(h):this._splitRoot(s,h)}_splitRoot(e,t){this._data=new B([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=h(e,0,o,this._toBBox),a=h(e,o,s,this._toBBox),u=_(t,a),l=d(t)+d(a);u<i?(i=u,r=o,n=l<n?l:n):u===i&&l<n&&(n=l,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:l,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=h(e,0,t,n),o=h(e,s-t,s,n);let a=f(r)+f(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=f(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=f(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){h(e,0,e.children.length,t,e)}function h(e,t,s,i,n){n||(n=new R([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function l(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function m(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function _(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function p(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const x=new n.c,w=new n.c,S=new n.c,v=new n.c({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class b extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class R extends b{constructor(e){super(),this.children=e,this.leaf=!0}}class B extends b{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>p,_8:()=>g,_I:()=>u,aE:()=>h,du:()=>_,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function h(e,t,s={}){return l(e,t,s,f)}function u(e,t,s={}){return l(e,t,s,m)}function l(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,l=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(l),s(e)}const f=h(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return l=(0,n.uU)((()=>{f.remove(),c()})),l}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function h(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{h(),r((0,o.Uh)())})),l(e,(e=>{h(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,m,t)}function f(e){return!0}function m(e){return!!e}s(41168);const _={sync:!0},g={initial:!0},p={sync:!0,initial:!0}},20480:(e,t,s)=>{s.d(t,{WW:()=>v});var i=s(6220),n=s(20744),r=s(66360),o=s(7488),a=s(48516),h=s(44048),u=s(60544),l=s(29120),c=(s(60708),s(2600)),d=s(6704),f=s(21980),m=s(28176),_=s(81976);const g=()=>r.c.getLogger("esri.geometry.support.normalizeUtils");function p(e){return"polygon"===e[0].type}function y(e){return"polyline"===e[0].type}function x(e,t,s){if(t){const t=function(e,t){if(!(e instanceof a.c||e instanceof o.c)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g().error(e),new n.c(e)}const s=(0,h.iM)(e),i=[];for(const e of s){const s=[];i.push(s),s.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],r=e[i][1],o=e[i+1][0],a=e[i+1][1],h=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),u=(a-r)/h,l=(o-n)/h,c=h/t;if(c>1){for(let e=1;e<=c-1;e++){const i=e*t,o=l*i+n,a=u*i+r;s.push([o,a])}const e=(h+Math.floor(c-1)*t)/2,i=l*e+n,o=u*e+r;s.push([i,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new o.c({rings:i,spatialReference:e.spatialReference}):new a.c({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,l.aq)(t,!0)}return s&&(e=(0,h.wb)(e,s)),e}function w(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,h.yK)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,h.yK)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,h.yK)(i,t);e=e.clone().offset(s*(-2*t),0)}else if(i<s){const t=(0,h.yK)(i,s);e=e.clone().offset(t*(-2*s),0)}}return e}function S(e,t){let s=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],r=t.geometries[i],o=(0,h.iM)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const i=t[e][0];s=i>s?i:s}s=Number(s.toFixed(9));const i=-360*(0,h.yK)(s,180);for(let s=0;s<t.length;s++){const t=r.getPoint(e,s);r.setPoint(e,s,t.clone().offset(i,0))}return!0}}))}if(n===s){if(p(e))for(const t of(0,h.iM)(r))e[n]=e[n].addRing(t);else if(y(e))for(const t of(0,h.iM)(r))e[n]=e[n].addPath(t)}else s=n,e[n]=r}return e}async function v(e,t,s){if(!Array.isArray(e))return v([e],t);t&&"string"!=typeof t&&g().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.default.geometryServiceUrl;let r,p,y,I,b,R,B,M,z=0;const C=[],F=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,p=(0,u.Nq)(r),y=r.isWebMercator,R=y?102100:4326,I=h.Hh[R].maxX,b=h.Hh[R].minX,B=h.Hh[R].plus180Line,M=h.Hh[R].minus180Line),p)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(w(t.clone(),I,b));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>w(e,I,b))),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,p);F.push(e.rings?new o.c(e):e)}else if(t.extent){const e=t.extent,s=(0,h.yK)(e.xmin,b)*(2*I);let i=0===s?t.clone():(0,h.wb)(t.clone(),s);e.offset(s,0),e.intersects(B)&&e.xmax!==I?(z=e.xmax>z?e.xmax:z,i=x(i,y),C.push(i),F.push("cut")):e.intersects(M)&&e.xmin!==b?(z=e.xmax*(2*I)>z?e.xmax*(2*I):z,i=x(i,y,360),C.push(i),F.push("cut")):F.push(i)}else F.push(t.clone());else F.push(t);else F.push(t);let E=(0,h.yK)(z,I),T=-90;const X=E,L=new a.c;for(;E>0;){const e=360*E-180;L.addPath([[e,T],[e,-1*T]]),T*=-1,E--}if(C.length>0&&X>0){const t=S(C,await async function(e,t,s,i){const n=(0,f.UX)(e),r=t[0].spatialReference,o={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,u.um)(r),target:JSON.stringify({geometryType:(0,d.Ce)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,c.c)(n.path+"/cut",o),{cutIndexes:h,geometries:l=[]}=a.data;return{cutIndexes:h,geometries:l.map((e=>{const t=(0,d.h4)(e);return t.spatialReference=r,t}))}}(n,C,L,s)),i=[],r=[];for(let s=0;s<F.length;s++){const n=F[s];if("cut"!==n)r.push(n);else{const n=t.shift(),o=e[s];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&n.rings.length>=o.rings.length?(i.push(n),r.push("simplify")):r.push(y?(0,l.w7)(n):n)}}if(!i.length)return r;const o=await async function(e,t,s){const i="string"==typeof e?(0,m.as)(e):e,n=t[0].spatialReference,r=(0,d.Ce)(t[0]),o={...s,query:{...i.query,f:"json",sr:(0,u.um)(n),geometries:JSON.stringify((0,_.y)(t))}},{data:a}=await(0,c.c)(i.path+"/simplify",o);return(0,_.Q)(a.geometries,r,n)}(n,i,s),a=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?a.push(t):a.push(y?(0,l.w7)(o.shift()):o.shift())}return a}const Y=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)Y.push(t);else{const e=C.shift();Y.push(!0===y?(0,l.w7)(e):e)}}return Y}},44048:(e,t,s)=>{s.d(t,{Hh:()=>o,iM:()=>u,wb:()=>h,yK:()=>a});var i=s(48516),n=s(56156),r=s(6704);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator}),minus180Line:new i.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.c({paths:[[[180,-180],[180,180]]],spatialReference:n.c.WGS84}),minus180Line:new i.c({paths:[[[-180,-180],[-180,180]]],spatialReference:n.c.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function h(e,t){const s=u(e);for(const e of s)for(const s of e)s[0]+=t;return e}function u(e){return(0,r.Cs)(e)?e.rings:e.paths}},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,i.c)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>m});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),h=s(83372),u=s(97088),l=s(6904),c=s(83624),d=s(51752);const f=(0,a.Su)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new l.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.C_)(null!=i?i:(0,h.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,h.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},45160:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var i=s(40196),n=s(20744),r=s(66360),o=s(10860),a=s(69504),h=s(60544),u=s(97088),l=s(9107),c=s(7684),d=s(47302),f=s(35756),m=s(49372),_=s(44808),g=s(16424),p=s(28484);const y="esri.layers.WFSLayer";class x{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:s,getFeatureOutputFormat:i,fields:r,geometryType:a,featureType:h,maxRecordCount:u,maxTotalRecordCount:f,maxPageCount:m,objectIdField:y,customParameters:x}=e,{spatialReference:S,getFeatureSpatialReference:v}=(0,_.i4)(s,h,e.spatialReference);try{await(0,c.Qv)(v,S)}catch{throw new n.c("unsupported-projection","Projection not supported",{inSpatialReference:v,outSpatialReference:S})}(0,o.wp)(t),this._customParameters=x,this._featureType=h,this._fieldsIndex=g.c.fromLayerJSON({fields:r,dateFieldsTimeReference:r.some((e=>"esriFieldTypeDate"===e.type))?{timeZoneIANA:p.Gw}:null}),this._geometryType=a,this._getFeatureUrl=s,this._getFeatureOutputFormat=i,this._getFeatureSpatialReference=v,this._maxRecordCount=u,this._maxTotalRecordCount=f,this._maxPageCount=m,this._objectIdField=y,this._spatialReference=S;let I=await this._snapshotFeatures(t);if(I.errors.length>0&&(this._supportsPagination=!1,I=await this._snapshotFeatures(t),I.errors.length>0))throw I.errors[0];return this._queryEngine=new d.U({fieldsIndex:this._fieldsIndex,geometryType:a,hasM:!1,hasZ:!1,objectIdField:y,spatialReference:S,timeInfo:null,featureStore:new l.c({geometryType:a,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(I.features),{warnings:w(I),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new n.c("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=(0,i.kn)((e=>this._snapshotFeatures({signal:e}))),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(e.features);for(const t of w(e))r.c.getLogger(y).warn(new a.c("wfs-layer:refresh-warning",t.message,t.details));e.errors?.length&&r.c.getLogger(y).warn(new a.c("wfs-layer:refresh-error","Refresh completed with errors",{errors:e.errors}))}),(()=>{this._queryEngine.featureStore.clear()})),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,s=this._maxTotalRecordCount,i=this._maxPageCount,n=this._supportsPagination?await(0,_.gp)(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let r=[];const a=[];if(null==n)try{r=await this._singleQuery(t)}catch(e){(0,o.mA)(e)||a.push(e)}else{const e=Math.min(n,s),h=function*(e,t,s){for(let i=0;i<t;i++)yield e._pageQuery(i,s)}(this,Math.max(1,Math.min(Math.ceil(e/this._maxRecordCount),i)),t);await Promise.allSettled(Array.from({length:10}).map((()=>async function(e,t,s){let i=e.next();for(;!i.done;){try{const e=await i.value;t.push(...e)}catch(e){(0,o.mA)(e)||s.push(e)}i=e.next()}}(h,r,a))))}return(0,o.wp)(t),{features:r,totalRecordCount:n,maxTotalRecordCount:s,maxPageCount:i,errors:a}}async _singleQuery(e){const t=await(0,_.Az)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const s=e*this._maxRecordCount,i=await(0,_.Az)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:s,count:this._maxRecordCount,signal:t});return this._processGeoJSON(i,{startIndex:s,signal:t})}_processGeoJSON(e,t){(0,f.ii)(e,this._getFeatureSpatialReference.wkid);const{startIndex:s,signal:i}=t;(0,o.wp)(i);const n=(0,f.MN)(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!(0,h.yK)(this._spatialReference,this._getFeatureSpatialReference))for(const e of n)null!=e.geometry&&(e.geometry=(0,u.C)((0,c.yU)((0,u.qw)(e.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let r=s??1;for(const e of n){const t={};(0,m.uo)(this._fieldsIndex,t,e.attributes,!0),e.attributes=t,null==t[this._objectIdField]&&(e.objectId=t[this._objectIdField]=r++)}return n}}function w(e){const t=[];return null!=e.totalRecordCount&&(e.features.length<e.totalRecordCount&&t.push({name:"wfs-layer:maxRecordCount-too-low",message:`Could only fetch ${e.features.length} of ${e.totalRecordCount} in ${e.maxPageCount} queries. Try increasing the value of WFSLayer.maxRecordCount.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount}}),e.totalRecordCount>e.maxTotalRecordCount&&t.push({name:"wfs-layer:large-dataset",message:`The number of ${e.totalRecordCount} features exceeds the maximum allowed of ${e.maxTotalRecordCount}.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount,maxTotalRecordCount:e.maxTotalRecordCount}})),t}},49372:(e,t,s)=>{s.d(t,{GI:()=>l,OM:()=>_,Oo:()=>g,or:()=>h,uo:()=>d});var i=s(39180),n=s(60544),r=s(564);class o{constructor(){this.code=null,this.description=null}}class a{constructor(e){this.error=new o,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function h(e){return new a(e)}class u{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function l(e){return new u(e)}const c=new Set;function d(e,t,s,i=!1){c.clear();for(const n in s){const o=e.get(n);if(!o)continue;const a=f(o,s[n]);if(c.add(o.name),o&&(i||o.editable)){const e=(0,r.YT)(o,a);if(e)return h((0,r.Ke)(e,o,a));t[o.name]=a}}for(const t of e?.requiredFields??[])if(!c.has(t.name))return h(`missing required field "${t.name}"`);return null}function f(e,t){let s=t;return(0,r.iW)(e)&&"string"==typeof t?s=parseFloat(t):(0,r.AZ)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,r.gp)(e)&&"string"==typeof t&&(s=(0,i.sn)(t)),(0,r.OJ)(s)}let m;function _(e,t){if(!e||!(0,n.U3)(t))return e;if("rings"in e||"paths"in e){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(t,e)}return e}async function g(e,t){!(0,n.U3)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==m&&(m=await Promise.all([s.e(984),s.e(2704)]).then(s.bind(s,82704))),m}()}},48212:(e,t,s)=>{s.d(t,{Ab:()=>x,Ej:()=>d,K0:()=>c,M9:()=>f,Wq:()=>_,YB:()=>l,_2:()=>p,oR:()=>g,q_:()=>m,wn:()=>y});var i=s(28176),n=s(91952);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),h=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function l(e){return!!a.test(e)}function c(e){if(null==e)return null;const t=(0,i.as)(e),s=t?.path.match(a)||t?.path.match(h);if(!s)return null;const[,n,o,u,l]=s,c=o.indexOf("/");return{title:f(-1!==c?o.slice(c+1):o),serverType:r[u.toLowerCase()],sublayer:null!=l&&""!==l?parseInt(l,10):null,url:{path:n}}}function d(e){const t=(0,i.as)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function f(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function m(e,t){const s=[];if(e){const t=c(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=f(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function _(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.ai)((0,i.kN)(e,t)):e}function p(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.kN)(t,e.logger);const s=(0,i.as)(t),n=c(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=d(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.ai)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.kn)(r.url,s,e.layerId.toString()))}function x(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},81976:(e,t,s)=>{s.d(t,{Q:()=>r,y:()=>n});var i=s(6704);function n(e){return{geometryType:(0,i.Ce)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,s){const n=(0,i.uG)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=s,t}))}},21980:(e,t,s)=>{s.d(t,{OW:()=>a,UX:()=>o,sR:()=>r}),s(6220),s(47620);var i=s(62088),n=s(28176);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,n.as)(e):(0,i.ct)(e)}function a(e,t,s){const i={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))i[n]=r.map((e=>a({item:e},t,s).item));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(s?.[n]);i[n]=t?e:JSON.stringify(e)}else i[n]=t?r:JSON.stringify(r);else i[n]=r}return i}s(20572)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5672,8528],{8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{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,s=1){this._storage.put(this,e,t,s,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,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=h+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),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,s,i=0){this._storage.put(this,e,t,s,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,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{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 r.c,this._users=new r.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 s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){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!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.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={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[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,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,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,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_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 s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let h=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=l,this._compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),w.prune(),S.prune(),v.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(p(e,s))for(x.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;p(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):x.push(r))}s=x.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!p(e,t))return!1;for(x.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(p(e,r)){if(t.leaf||g(e,r))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new R([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(S.clear(),v.clear();s||S.length>0;){if(s||(s=S.pop(),n=S.data[S.length-1],r=v.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),S.push(s),this._condense(S),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(S.push(s),v.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(w.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else w.pushArray(s.children);s=w.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new R(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new B([]);o.height=i;const h=Math.ceil(n/r),u=h*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,h,this._compareMinY);for(let s=n;s<=t;s+=h){const n=Math.min(s+h-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),h=m(e,o)-a;h<n?(n=h,i=a<i?a:i,s=o):h===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);S.clear();const r=this._chooseSubtree(n,this._data,t,S);for(r.children.push(e),u(r,n);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;this._adjustParentBBoxes(n,S,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),h=s.leaf?new R(o):new B(o);h.height=s.height,a(s,this._toBBox),a(h,this._toBBox),t?e.data[t-1].children.push(h):this._splitRoot(s,h)}_splitRoot(e,t){this._data=new B([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=h(e,0,o,this._toBBox),a=h(e,o,s,this._toBBox),u=_(t,a),l=d(t)+d(a);u<i?(i=u,r=o,n=l<n?l:n):u===i&&l<n&&(n=l,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:l,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=h(e,0,t,n),o=h(e,s-t,s,n);let a=f(r)+f(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=f(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=f(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){h(e,0,e.children.length,t,e)}function h(e,t,s,i,n){n||(n=new R([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function l(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function m(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function _(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function p(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const x=new n.c,w=new n.c,S=new n.c,v=new n.c({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class b extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class R extends b{constructor(e){super(),this.children=e,this.leaf=!0}}class B extends b{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>p,_8:()=>g,_I:()=>u,aE:()=>h,du:()=>_,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function h(e,t,s={}){return l(e,t,s,f)}function u(e,t,s={}){return l(e,t,s,m)}function l(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,l=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(l),s(e)}const f=h(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return l=(0,n.uU)((()=>{f.remove(),c()})),l}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function h(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{h(),r((0,o.Uh)())})),l(e,(e=>{h(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,m,t)}function f(e){return!0}function m(e){return!!e}s(41168);const _={sync:!0},g={initial:!0},p={sync:!0,initial:!0}},20480:(e,t,s)=>{s.d(t,{WW:()=>v});var i=s(6220),n=s(20744),r=s(66360),o=s(7488),a=s(48516),h=s(44048),u=s(60544),l=s(29120),c=(s(60708),s(2600)),d=s(6704),f=s(21980),m=s(28176),_=s(81976);const g=()=>r.c.getLogger("esri.geometry.support.normalizeUtils");function p(e){return"polygon"===e[0].type}function y(e){return"polyline"===e[0].type}function x(e,t,s){if(t){const t=function(e,t){if(!(e instanceof a.c||e instanceof o.c)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g().error(e),new n.c(e)}const s=(0,h.iM)(e),i=[];for(const e of s){const s=[];i.push(s),s.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],r=e[i][1],o=e[i+1][0],a=e[i+1][1],h=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),u=(a-r)/h,l=(o-n)/h,c=h/t;if(c>1){for(let e=1;e<=c-1;e++){const i=e*t,o=l*i+n,a=u*i+r;s.push([o,a])}const e=(h+Math.floor(c-1)*t)/2,i=l*e+n,o=u*e+r;s.push([i,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new o.c({rings:i,spatialReference:e.spatialReference}):new a.c({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,l.aq)(t,!0)}return s&&(e=(0,h.wb)(e,s)),e}function w(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,h.yK)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,h.yK)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,h.yK)(i,t);e=e.clone().offset(s*(-2*t),0)}else if(i<s){const t=(0,h.yK)(i,s);e=e.clone().offset(t*(-2*s),0)}}return e}function S(e,t){let s=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],r=t.geometries[i],o=(0,h.iM)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const i=t[e][0];s=i>s?i:s}s=Number(s.toFixed(9));const i=-360*(0,h.yK)(s,180);for(let s=0;s<t.length;s++){const t=r.getPoint(e,s);r.setPoint(e,s,t.clone().offset(i,0))}return!0}}))}if(n===s){if(p(e))for(const t of(0,h.iM)(r))e[n]=e[n].addRing(t);else if(y(e))for(const t of(0,h.iM)(r))e[n]=e[n].addPath(t)}else s=n,e[n]=r}return e}async function v(e,t,s){if(!Array.isArray(e))return v([e],t);t&&"string"!=typeof t&&g().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.default.geometryServiceUrl;let r,p,y,I,b,R,B,M,z=0;const C=[],F=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,p=(0,u.Nq)(r),y=r.isWebMercator,R=y?102100:4326,I=h.Hh[R].maxX,b=h.Hh[R].minX,B=h.Hh[R].plus180Line,M=h.Hh[R].minus180Line),p)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(w(t.clone(),I,b));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>w(e,I,b))),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,p);F.push(e.rings?new o.c(e):e)}else if(t.extent){const e=t.extent,s=(0,h.yK)(e.xmin,b)*(2*I);let i=0===s?t.clone():(0,h.wb)(t.clone(),s);e.offset(s,0),e.intersects(B)&&e.xmax!==I?(z=e.xmax>z?e.xmax:z,i=x(i,y),C.push(i),F.push("cut")):e.intersects(M)&&e.xmin!==b?(z=e.xmax*(2*I)>z?e.xmax*(2*I):z,i=x(i,y,360),C.push(i),F.push("cut")):F.push(i)}else F.push(t.clone());else F.push(t);else F.push(t);let E=(0,h.yK)(z,I),T=-90;const X=E,L=new a.c;for(;E>0;){const e=360*E-180;L.addPath([[e,T],[e,-1*T]]),T*=-1,E--}if(C.length>0&&X>0){const t=S(C,await async function(e,t,s,i){const n=(0,f.UX)(e),r=t[0].spatialReference,o={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,u.um)(r),target:JSON.stringify({geometryType:(0,d.Ce)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,c.c)(n.path+"/cut",o),{cutIndexes:h,geometries:l=[]}=a.data;return{cutIndexes:h,geometries:l.map((e=>{const t=(0,d.h4)(e);return t.spatialReference=r,t}))}}(n,C,L,s)),i=[],r=[];for(let s=0;s<F.length;s++){const n=F[s];if("cut"!==n)r.push(n);else{const n=t.shift(),o=e[s];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&n.rings.length>=o.rings.length?(i.push(n),r.push("simplify")):r.push(y?(0,l.w7)(n):n)}}if(!i.length)return r;const o=await async function(e,t,s){const i="string"==typeof e?(0,m.as)(e):e,n=t[0].spatialReference,r=(0,d.Ce)(t[0]),o={...s,query:{...i.query,f:"json",sr:(0,u.um)(n),geometries:JSON.stringify((0,_.y)(t))}},{data:a}=await(0,c.c)(i.path+"/simplify",o);return(0,_.Q)(a.geometries,r,n)}(n,i,s),a=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?a.push(t):a.push(y?(0,l.w7)(o.shift()):o.shift())}return a}const Y=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)Y.push(t);else{const e=C.shift();Y.push(!0===y?(0,l.w7)(e):e)}}return Y}},44048:(e,t,s)=>{s.d(t,{Hh:()=>o,iM:()=>u,wb:()=>h,yK:()=>a});var i=s(48516),n=s(56156),r=s(6704);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator}),minus180Line:new i.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.c({paths:[[[180,-180],[180,180]]],spatialReference:n.c.WGS84}),minus180Line:new i.c({paths:[[[-180,-180],[-180,180]]],spatialReference:n.c.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function h(e,t){const s=u(e);for(const e of s)for(const s of e)s[0]+=t;return e}function u(e){return(0,r.Cs)(e)?e.rings:e.paths}},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,i.c)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>m});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),h=s(83372),u=s(97088),l=s(6904),c=s(83624),d=s(16736);const f=(0,a.Su)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new l.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.C_)(null!=i?i:(0,h.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,h.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},45160:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var i=s(40196),n=s(20744),r=s(66360),o=s(10860),a=s(69504),h=s(60544),u=s(97088),l=s(9107),c=s(7684),d=s(47302),f=s(35756),m=s(49372),_=s(44808),g=s(16424),p=s(28484);const y="esri.layers.WFSLayer";class x{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:s,getFeatureOutputFormat:i,fields:r,geometryType:a,featureType:h,maxRecordCount:u,maxTotalRecordCount:f,maxPageCount:m,objectIdField:y,customParameters:x}=e,{spatialReference:S,getFeatureSpatialReference:v}=(0,_.i4)(s,h,e.spatialReference);try{await(0,c.Qv)(v,S)}catch{throw new n.c("unsupported-projection","Projection not supported",{inSpatialReference:v,outSpatialReference:S})}(0,o.wp)(t),this._customParameters=x,this._featureType=h,this._fieldsIndex=g.c.fromLayerJSON({fields:r,dateFieldsTimeReference:r.some((e=>"esriFieldTypeDate"===e.type))?{timeZoneIANA:p.Gw}:null}),this._geometryType=a,this._getFeatureUrl=s,this._getFeatureOutputFormat=i,this._getFeatureSpatialReference=v,this._maxRecordCount=u,this._maxTotalRecordCount=f,this._maxPageCount=m,this._objectIdField=y,this._spatialReference=S;let I=await this._snapshotFeatures(t);if(I.errors.length>0&&(this._supportsPagination=!1,I=await this._snapshotFeatures(t),I.errors.length>0))throw I.errors[0];return this._queryEngine=new d.U({fieldsIndex:this._fieldsIndex,geometryType:a,hasM:!1,hasZ:!1,objectIdField:y,spatialReference:S,timeInfo:null,featureStore:new l.c({geometryType:a,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(I.features),{warnings:w(I),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new n.c("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=(0,i.kn)((e=>this._snapshotFeatures({signal:e}))),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(e.features);for(const t of w(e))r.c.getLogger(y).warn(new a.c("wfs-layer:refresh-warning",t.message,t.details));e.errors?.length&&r.c.getLogger(y).warn(new a.c("wfs-layer:refresh-error","Refresh completed with errors",{errors:e.errors}))}),(()=>{this._queryEngine.featureStore.clear()})),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,s=this._maxTotalRecordCount,i=this._maxPageCount,n=this._supportsPagination?await(0,_.gp)(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let r=[];const a=[];if(null==n)try{r=await this._singleQuery(t)}catch(e){(0,o.mA)(e)||a.push(e)}else{const e=Math.min(n,s),h=function*(e,t,s){for(let i=0;i<t;i++)yield e._pageQuery(i,s)}(this,Math.max(1,Math.min(Math.ceil(e/this._maxRecordCount),i)),t);await Promise.allSettled(Array.from({length:10}).map((()=>async function(e,t,s){let i=e.next();for(;!i.done;){try{const e=await i.value;t.push(...e)}catch(e){(0,o.mA)(e)||s.push(e)}i=e.next()}}(h,r,a))))}return(0,o.wp)(t),{features:r,totalRecordCount:n,maxTotalRecordCount:s,maxPageCount:i,errors:a}}async _singleQuery(e){const t=await(0,_.Az)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const s=e*this._maxRecordCount,i=await(0,_.Az)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:s,count:this._maxRecordCount,signal:t});return this._processGeoJSON(i,{startIndex:s,signal:t})}_processGeoJSON(e,t){(0,f.ii)(e,this._getFeatureSpatialReference.wkid);const{startIndex:s,signal:i}=t;(0,o.wp)(i);const n=(0,f.MN)(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!(0,h.yK)(this._spatialReference,this._getFeatureSpatialReference))for(const e of n)null!=e.geometry&&(e.geometry=(0,u.C)((0,c.yU)((0,u.qw)(e.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let r=s??1;for(const e of n){const t={};(0,m.uo)(this._fieldsIndex,t,e.attributes,!0),e.attributes=t,null==t[this._objectIdField]&&(e.objectId=t[this._objectIdField]=r++)}return n}}function w(e){const t=[];return null!=e.totalRecordCount&&(e.features.length<e.totalRecordCount&&t.push({name:"wfs-layer:maxRecordCount-too-low",message:`Could only fetch ${e.features.length} of ${e.totalRecordCount} in ${e.maxPageCount} queries. Try increasing the value of WFSLayer.maxRecordCount.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount}}),e.totalRecordCount>e.maxTotalRecordCount&&t.push({name:"wfs-layer:large-dataset",message:`The number of ${e.totalRecordCount} features exceeds the maximum allowed of ${e.maxTotalRecordCount}.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount,maxTotalRecordCount:e.maxTotalRecordCount}})),t}},49372:(e,t,s)=>{s.d(t,{GI:()=>l,OM:()=>_,Oo:()=>g,or:()=>h,uo:()=>d});var i=s(39180),n=s(60544),r=s(564);class o{constructor(){this.code=null,this.description=null}}class a{constructor(e){this.error=new o,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function h(e){return new a(e)}class u{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function l(e){return new u(e)}const c=new Set;function d(e,t,s,i=!1){c.clear();for(const n in s){const o=e.get(n);if(!o)continue;const a=f(o,s[n]);if(c.add(o.name),o&&(i||o.editable)){const e=(0,r.YT)(o,a);if(e)return h((0,r.Ke)(e,o,a));t[o.name]=a}}for(const t of e?.requiredFields??[])if(!c.has(t.name))return h(`missing required field "${t.name}"`);return null}function f(e,t){let s=t;return(0,r.iW)(e)&&"string"==typeof t?s=parseFloat(t):(0,r.AZ)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,r.gp)(e)&&"string"==typeof t&&(s=(0,i.sn)(t)),(0,r.OJ)(s)}let m;function _(e,t){if(!e||!(0,n.U3)(t))return e;if("rings"in e||"paths"in e){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(t,e)}return e}async function g(e,t){!(0,n.U3)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==m&&(m=await Promise.all([s.e(984),s.e(2704)]).then(s.bind(s,82704))),m}()}},48212:(e,t,s)=>{s.d(t,{Ab:()=>x,Ej:()=>d,K0:()=>c,M9:()=>f,Wq:()=>_,YB:()=>l,_2:()=>p,oR:()=>g,q_:()=>m,wn:()=>y});var i=s(28176),n=s(91952);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),h=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function l(e){return!!a.test(e)}function c(e){if(null==e)return null;const t=(0,i.as)(e),s=t?.path.match(a)||t?.path.match(h);if(!s)return null;const[,n,o,u,l]=s,c=o.indexOf("/");return{title:f(-1!==c?o.slice(c+1):o),serverType:r[u.toLowerCase()],sublayer:null!=l&&""!==l?parseInt(l,10):null,url:{path:n}}}function d(e){const t=(0,i.as)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function f(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function m(e,t){const s=[];if(e){const t=c(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=f(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function _(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.ai)((0,i.kN)(e,t)):e}function p(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.kN)(t,e.logger);const s=(0,i.as)(t),n=c(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=d(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.ai)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.kn)(r.url,s,e.layerId.toString()))}function x(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},81976:(e,t,s)=>{s.d(t,{Q:()=>r,y:()=>n});var i=s(6704);function n(e){return{geometryType:(0,i.Ce)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,s){const n=(0,i.uG)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=s,t}))}},21980:(e,t,s)=>{s.d(t,{OW:()=>a,UX:()=>o,sR:()=>r}),s(6220),s(47620);var i=s(62088),n=s(28176);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,n.as)(e):(0,i.ct)(e)}function a(e,t,s){const i={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))i[n]=r.map((e=>a({item:e},t,s).item));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(s?.[n]);i[n]=t?e:JSON.stringify(e)}else i[n]=t?r:JSON.stringify(r);else i[n]=r}return i}s(20572)}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8828,2259],{3615:(e,a,r)=>{r.d(a,{q:()=>n});var t=r(66668);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const r=this._serviceMetadatas.get(e);if(r)return r;const n=await(0,t.S)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const t=await e.fetchData();return r.set(a,t),t}async fetchCustomParameters(e,a){const r=await this.fetchItemData(e);return r&&"object"==typeof r&&(a?a(r):r.customParameters)||null}}},50420:(e,a,r)=>{r.d(a,{S:()=>o});var t=r(47620),n=r(2600),i=r(20744),s=r(10860),l=r(48212),c=r(54872),y=r(9764);async function o(e,a){const r=(0,l.K0)(e);if(!r)throw new i.c("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const r=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.c)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.CE)(e)}return null}(e);null!=i&&(r.portal=new c.c({url:i}));try{return r.load({signal:e.signal})}catch(e){return(0,s.CE)(e),null}}(o),null==o.sceneLayerItem)return d(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const L=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new y.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.CE)(e),null}}(o);if(!L?.url)throw new i.c("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=L;const m=await d(L.url,o);return m.portalItem=L,m}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.c)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const r=(0,l.K0)(e);if(!r)throw new i.c("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const c=u(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=e=>{const r={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.c)(t,r)},L=d("anonymous").catch((()=>d("no-prompt"))),[m,f]=await Promise.all([L,c]),p=f?.layers,S=m.data&&m.data.layers;if(!Array.isArray(S))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,S.length);e++)if(p[e].id===s)return{serverUrl:t,layerId:S[e].id}}else if(null!=s&&s<S.length)return{serverUrl:t,layerId:S[s].id};throw new Error("could not find matching associated sublayer")}},58828:(e,a,r)=>{r.d(a,{e:()=>T,populateOperationalLayers:()=>o});var t=r(2952),n=(r(9456),r(3615)),i=r(83928),s=r(9764);function l(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var c=r(12259),y=r(97824);async function o(e,a,r){if(!a)return;const t=a.map((e=>async function(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&("GroupLayer"===a.layerType?await T(t,a,r):v(a)?function(e,a,r){a.itemId&&(e.portalItem=new s.default({id:a.itemId,portal:r?.portal}),e.when((()=>{const t=t=>{const n=t.layerId;G(t,e,a,n,r);const i=a.featureCollection?.layers?.[n];i&&t.read(i,r)};e.layers?.forEach(t),e.tables?.forEach(t)})))}(t,a,r.context):b(a)&&await async function(e,a,r){const t=i.q.FeatureLayer,n=await t(),s=a.featureCollection,l=s?.showLegend,c=s?.layers?.map(((t,i)=>{const s=new n;s.read(t,r);const c={...r,ignoreDefaults:!0};return G(s,e,a,i,c),null!=l&&s.read({showLegend:l},c),s}));e.layers.addMany(c??[])}(t,a,r.context)),await(0,y.M)(t,r.context),t}(await g(e,a),e,a)}(e,r))),n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const u={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},d={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},L={ArcGISFeatureLayer:"FeatureLayer"},m={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},f={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},p={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},S={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},w={...f,LinkChartLayer:"LinkChartLayer"},h={...p},I={...S};async function g(e,a){const r=a.context,t=M(r);let y=e.layerType||e.type;!y&&a?.defaultLayerType&&(y=a.defaultLayerType);const o=t[y];let u=o?i.q[o]:i.q.UnknownLayer;if(v(e)){const a=r?.portal;if(e.itemId){const r=new s.default({id:e.itemId,portal:a});await r.load();const t=(await(0,c.q)(r,new n.q)).className||"UnknownLayer";u=i.q[t]}}else"ArcGISFeatureLayer"===y?function(e){return l(e,"notes")}(e)||function(e){return l(e,"markup")}(e)?u=i.q.MapNotesLayer:function(e){return l(e,"route")}(e)?u=i.q.RouteLayer:b(e)&&(u=i.q.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?u=i.q.WMTSLayer:"WFS"===y&&"2.0.0"!==e.wfsInfo?.version&&(u=i.q.UnsupportedLayer);return u()}function b(e){return"ArcGISFeatureLayer"===e.layerType&&!v(e)&&(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function M(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":a=m;break;case"ground":a=d;break;case"tables":a=L;break;default:a=u}break;case"link-chart":switch(e.layerContainerType){case"basemap":a=I;break;case"tables":a=h;break;default:a=w}break;default:switch(e.layerContainerType){case"basemap":a=S;break;case"tables":a=p;break;default:a=f}}return a}async function T(e,a,r){const n=new t.c,i=o(n,Array.isArray(a.layers)?a.layers:[],r);try{try{if(await i,"group"===e.type)return e.layers.addMany(n),e}catch(a){e.destroy();for(const e of n)e.destroy();throw a}}catch(e){throw e}}function G(e,a,r,t,n){e.read({id:`${a.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n)}},83928:(e,a,r)=>{r.d(a,{q:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3912)]).then(r.bind(r,48388))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(8644),r.e(5928)]).then(r.bind(r,10948))).default,CatalogLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(2848),r.e(5468),r.e(572),r.e(2907)]).then(r.bind(r,20324))).default,CSVLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(1744)]).then(r.bind(r,79468))).default,DimensionLayer:async()=>(await Promise.all([r.e(5612),r.e(7832)]).then(r.bind(r,28320))).default,ElevationLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(8380)]).then(r.bind(r,47104))).default,FeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(8348)]).then(r.bind(r,672))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(6528)]).then(r.bind(r,92768))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(7988),r.e(7148),r.e(2672)]).then(r.bind(r,43984))).default,GroupLayer:async()=>(await Promise.all([r.e(5612),r.e(7456)]).then(r.bind(r,44080))).default,ImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(2848),r.e(6128),r.e(9056),r.e(3291)]).then(r.bind(r,7896))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(6128),r.e(7048),r.e(9056),r.e(5496)]).then(r.bind(r,82744))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(5612),r.e(9644),r.e(7024)]).then(r.bind(r,96584))).default,KMLLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(236),r.e(9032)]).then(r.bind(r,53688))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(5612),r.e(3536)]).then(r.bind(r,91884))).default,LinkChartLayer:async()=>(await Promise.all([r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(9512),r.e(3220),r.e(1512),r.e(6680),r.e(8080)]).then(r.bind(r,54192))).default,MapImageLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(1248),r.e(3089)]).then(r.bind(r,3089))).default,MapNotesLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(9516)]).then(r.bind(r,37784))).default,MediaLayer:async()=>(await Promise.all([r.e(5612),r.e(2364)]).then(r.bind(r,66664))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(3160),r.e(8224)]).then(r.bind(r,56288))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(1244)]).then(r.bind(r,1244))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(1740)]).then(r.bind(r,75432))).default,PointCloudLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(2296)]).then(r.bind(r,21680))).default,RouteLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(236),r.e(6352)]).then(r.bind(r,40900))).default,SceneLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(8624),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(7424),r.e(9780),r.e(8644),r.e(712)]).then(r.bind(r,3688))).default,StreamLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(3460)]).then(r.bind(r,18e3))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(6556),r.e(5368),r.e(2608)]).then(r.bind(r,8444))).default,TileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(2968),r.e(1248),r.e(0)]).then(r.bind(r,5e4))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([r.e(5612),r.e(7752)]).then(r.bind(r,71316))).default,UnknownLayer:async()=>(await r.e(6584).then(r.bind(r,56584))).default,UnsupportedLayer:async()=>(await r.e(2456).then(r.bind(r,12456))).default,VectorTileLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(3780),r.e(6055),r.e(7936)]).then(r.bind(r,65632))).default,VoxelLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(8256)]).then(r.bind(r,59496))).default,WFSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(4808),r.e(3688)]).then(r.bind(r,53440))).default,WMSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(280)]).then(r.bind(r,85024))).default,WMTSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(4832)]).then(r.bind(r,54832))).default,WebTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632)]).then(r.bind(r,32896))).default}},67632:(e,a,r)=>{r.d(a,{AX:()=>l,Ur:()=>u,cr:()=>s,eW:()=>i,k1:()=>y,mg:()=>c,oD:()=>d,qi:()=>n,wp:()=>o});var t=r(50420);function n(e){const a={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(a.layerType="OrientedImageryLayer"),a}async function i(e,a,r){if(null==e?.layers||null==e?.tables){const t=await r.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||t?.layers?.map(n),e.tables=e.tables||t?.tables?.map(n)}return e}function s(e){const{layers:a,tables:r}=e;return a?.length?a[0].id:r?.length?r[0].id:null}function l(e){if(!e)return null;const{layers:a,tables:r}=e;return a?.length?a[0]:r?.length?r[0]:null}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function y(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}function o(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}function u(e){return e?.layers?.filter((({layerType:e})=>"CatalogLayer"===e)).map((({id:e})=>e))}async function d(e,a,r){if(!e?.url)return a??{};if(a??={},!a.layers){const t=await r.fetchServiceMetadata(e.url);a.layers=t.layers?.map(n)}const{serverUrl:i,portalItem:s}=await(0,t.S)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==i)return a.tables=[],a;if(!a.tables&&s){const e=await s.fetchData();if(e?.tables)a.tables=e.tables.map(n);else{const t=await r.fetchServiceMetadata(i,{customParameters:l(e)?.customParameters});a.tables=t?.tables?.map(n)}}if(a.tables)for(const e of a.tables)e.url=`${i}/${e.id}`;return a}},12259:(e,a,r)=>{r.d(a,{fromItem:()=>u,q:()=>d});var t=r(20744),n=r(50420),i=r(3615),s=r(71068),l=r(83928),c=r(9764),y=r(67632),o=r(46940);async function u(e){!e.portalItem||e.portalItem instanceof c.default||(e={...e,portalItem:new c.default(e.portalItem)});const a=await async function(e){await e.load();const a=new i.q;return async function(e){const a=e.className,r=l.q[a];return{constructor:await r(),properties:e.properties}}(await d(e,a))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function d(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,o._S)(e,"Map Notes"),r=(0,o._S)(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if((0,o._S)(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===(0,y.mg)(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const r=await L(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const i=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),s=i.cacheType?.toLowerCase(),l=i.capabilities?.toLowerCase().includes("tilesonly");return"map"===s||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const r=await L(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await(0,n.S)(e.url,{sceneLayerItem:e}),t=await a.fetchServiceMetadata(r);return t?.tables??[]}catch{return[]}}));if("object"==typeof r){const t={};let n;if(null!=r.id?(t.layerId=r.id,n=`${e.url}/layers/${r.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(s.Wr))if(e.typeKeywords.includes(a))return{className:s.Wr[a]};const i=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,y.AX)(e)?.customParameters))});return{className:s.Wr[i?.layerType]||"SceneLayer",properties:t}}if(!1===r){const r=await a.fetchServiceMetadata(e.url);if("Voxel"===r?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new t.c("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function L(e,a,r){const{url:t,type:n}=e,i="Feature Service"===n;if(!t)return{};if(/\/\d+$/.test(t)){if(i){const r=await a.fetchServiceMetadata(t,{customParameters:await a.fetchCustomParameters(e,(e=>(0,y.AX)(e)?.customParameters))});if("Oriented Imagery Layer"===r.type)return{id:r.id,className:"OrientedImageryLayer",sourceJSON:r}}return{}}await e.load();let s=await a.fetchItemData(e);if(i){const e=await(0,y.eW)(s,t,a),r=m(e);if("object"==typeof r){const a=(0,y.k1)(e),t=(0,y.wp)(e),n=(0,y.Ur)(e);r.className=null!=r.id&&a.includes(r.id)?"SubtypeGroupLayer":null!=r.id&&t?.includes(r.id)?"OrientedImageryLayer":null!=r.id&&n?.includes(r.id)?"CatalogLayer":"FeatureLayer"}return r}if("Scene Service"===n&&(s=await(0,y.oD)(e,s,a)),(0,y.mg)(s)>0)return m(s);const l=await a.fetchServiceMetadata(t);return r&&(l.tables=await r()),m(l)}function m(e){return 1===(0,y.mg)(e)&&{id:(0,y.cr)(e)}}},97824:(e,a,r)=>{r.d(a,{M:()=>s});var t=r(40196),n=r(10860),i=r(69504);async function s(e,a,r){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(s&&"unique-value"===s.type&&s.styleOrigin){const l=await(0,t.aG)(s.populateFromStyle());if((0,n.wp)(r),!1===l.ok){const r=l.error;a?.messages&&a.messages.push(new i.c("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},66668:(e,a,r)=>{r.d(a,{S:()=>n});var t=r(2600);async function n(e,a){const{data:r}=await(0,t.c)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8828,2259],{3615:(e,a,r)=>{r.d(a,{q:()=>n});var t=r(66668);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const r=this._serviceMetadatas.get(e);if(r)return r;const n=await(0,t.S)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const t=await e.fetchData();return r.set(a,t),t}async fetchCustomParameters(e,a){const r=await this.fetchItemData(e);return r&&"object"==typeof r&&(a?a(r):r.customParameters)||null}}},50420:(e,a,r)=>{r.d(a,{S:()=>o});var t=r(47620),n=r(2600),i=r(20744),s=r(10860),l=r(48212),c=r(54872),y=r(9764);async function o(e,a){const r=(0,l.K0)(e);if(!r)throw new i.c("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const r=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.c)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.CE)(e)}return null}(e);null!=i&&(r.portal=new c.c({url:i}));try{return r.load({signal:e.signal})}catch(e){return(0,s.CE)(e),null}}(o),null==o.sceneLayerItem)return d(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const L=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new y.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.CE)(e),null}}(o);if(!L?.url)throw new i.c("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=L;const m=await d(L.url,o);return m.portalItem=L,m}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.c)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const r=(0,l.K0)(e);if(!r)throw new i.c("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const c=u(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=e=>{const r={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.c)(t,r)},L=d("anonymous").catch((()=>d("no-prompt"))),[m,f]=await Promise.all([L,c]),p=f?.layers,S=m.data&&m.data.layers;if(!Array.isArray(S))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,S.length);e++)if(p[e].id===s)return{serverUrl:t,layerId:S[e].id}}else if(null!=s&&s<S.length)return{serverUrl:t,layerId:S[s].id};throw new Error("could not find matching associated sublayer")}},58828:(e,a,r)=>{r.d(a,{e:()=>T,populateOperationalLayers:()=>o});var t=r(2952),n=(r(9456),r(3615)),i=r(83928),s=r(9764);function l(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var c=r(12259),y=r(97824);async function o(e,a,r){if(!a)return;const t=a.map((e=>async function(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&("GroupLayer"===a.layerType?await T(t,a,r):v(a)?function(e,a,r){a.itemId&&(e.portalItem=new s.default({id:a.itemId,portal:r?.portal}),e.when((()=>{const t=t=>{const n=t.layerId;G(t,e,a,n,r);const i=a.featureCollection?.layers?.[n];i&&t.read(i,r)};e.layers?.forEach(t),e.tables?.forEach(t)})))}(t,a,r.context):b(a)&&await async function(e,a,r){const t=i.q.FeatureLayer,n=await t(),s=a.featureCollection,l=s?.showLegend,c=s?.layers?.map(((t,i)=>{const s=new n;s.read(t,r);const c={...r,ignoreDefaults:!0};return G(s,e,a,i,c),null!=l&&s.read({showLegend:l},c),s}));e.layers.addMany(c??[])}(t,a,r.context)),await(0,y.M)(t,r.context),t}(await g(e,a),e,a)}(e,r))),n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const u={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},d={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},L={ArcGISFeatureLayer:"FeatureLayer"},m={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},f={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},p={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},S={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},w={...f,LinkChartLayer:"LinkChartLayer"},h={...p},I={...S};async function g(e,a){const r=a.context,t=M(r);let y=e.layerType||e.type;!y&&a?.defaultLayerType&&(y=a.defaultLayerType);const o=t[y];let u=o?i.q[o]:i.q.UnknownLayer;if(v(e)){const a=r?.portal;if(e.itemId){const r=new s.default({id:e.itemId,portal:a});await r.load();const t=(await(0,c.q)(r,new n.q)).className||"UnknownLayer";u=i.q[t]}}else"ArcGISFeatureLayer"===y?function(e){return l(e,"notes")}(e)||function(e){return l(e,"markup")}(e)?u=i.q.MapNotesLayer:function(e){return l(e,"route")}(e)?u=i.q.RouteLayer:b(e)&&(u=i.q.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?u=i.q.WMTSLayer:"WFS"===y&&"2.0.0"!==e.wfsInfo?.version&&(u=i.q.UnsupportedLayer);return u()}function b(e){return"ArcGISFeatureLayer"===e.layerType&&!v(e)&&(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function M(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":a=m;break;case"ground":a=d;break;case"tables":a=L;break;default:a=u}break;case"link-chart":switch(e.layerContainerType){case"basemap":a=I;break;case"tables":a=h;break;default:a=w}break;default:switch(e.layerContainerType){case"basemap":a=S;break;case"tables":a=p;break;default:a=f}}return a}async function T(e,a,r){const n=new t.c,i=o(n,Array.isArray(a.layers)?a.layers:[],r);try{try{if(await i,"group"===e.type)return e.layers.addMany(n),e}catch(a){e.destroy();for(const e of n)e.destroy();throw a}}catch(e){throw e}}function G(e,a,r,t,n){e.read({id:`${a.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n)}},83928:(e,a,r)=>{r.d(a,{q:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3912)]).then(r.bind(r,48388))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(8644),r.e(5928)]).then(r.bind(r,10948))).default,CatalogLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(2848),r.e(5468),r.e(572),r.e(2907)]).then(r.bind(r,20324))).default,CSVLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(1744)]).then(r.bind(r,79468))).default,DimensionLayer:async()=>(await Promise.all([r.e(5612),r.e(7832)]).then(r.bind(r,28320))).default,ElevationLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(8380)]).then(r.bind(r,47104))).default,FeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(8348)]).then(r.bind(r,672))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(6528)]).then(r.bind(r,92768))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(7988),r.e(7148),r.e(2672)]).then(r.bind(r,43984))).default,GroupLayer:async()=>(await Promise.all([r.e(5612),r.e(7456)]).then(r.bind(r,44080))).default,ImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(2848),r.e(6128),r.e(9056),r.e(3291)]).then(r.bind(r,7896))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(6128),r.e(7048),r.e(9056),r.e(5496)]).then(r.bind(r,82744))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(5612),r.e(9644),r.e(7024)]).then(r.bind(r,96584))).default,KMLLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(236),r.e(9032)]).then(r.bind(r,53688))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(5612),r.e(3536)]).then(r.bind(r,91884))).default,LinkChartLayer:async()=>(await Promise.all([r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(9512),r.e(3220),r.e(4608),r.e(6680),r.e(8080)]).then(r.bind(r,54192))).default,MapImageLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(1248),r.e(3089)]).then(r.bind(r,3089))).default,MapNotesLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(9516)]).then(r.bind(r,37784))).default,MediaLayer:async()=>(await Promise.all([r.e(5612),r.e(2364)]).then(r.bind(r,66664))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(3160),r.e(8224)]).then(r.bind(r,56288))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(1244)]).then(r.bind(r,1244))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(1740)]).then(r.bind(r,75432))).default,PointCloudLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(2296)]).then(r.bind(r,21680))).default,RouteLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(236),r.e(6352)]).then(r.bind(r,40900))).default,SceneLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(8624),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(7424),r.e(9780),r.e(8644),r.e(712)]).then(r.bind(r,3688))).default,StreamLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(3460)]).then(r.bind(r,18e3))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(6556),r.e(5368),r.e(2608)]).then(r.bind(r,8444))).default,TileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(2968),r.e(1248),r.e(0)]).then(r.bind(r,5e4))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([r.e(5612),r.e(7752)]).then(r.bind(r,71316))).default,UnknownLayer:async()=>(await r.e(6584).then(r.bind(r,56584))).default,UnsupportedLayer:async()=>(await r.e(2456).then(r.bind(r,12456))).default,VectorTileLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(3780),r.e(6055),r.e(7936)]).then(r.bind(r,65632))).default,VoxelLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(8256)]).then(r.bind(r,59496))).default,WFSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(4808),r.e(3688)]).then(r.bind(r,53440))).default,WMSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(280)]).then(r.bind(r,85024))).default,WMTSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(4832)]).then(r.bind(r,54832))).default,WebTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632)]).then(r.bind(r,32896))).default}},67632:(e,a,r)=>{r.d(a,{AX:()=>l,Ur:()=>u,cr:()=>s,eW:()=>i,k1:()=>y,mg:()=>c,oD:()=>d,qi:()=>n,wp:()=>o});var t=r(50420);function n(e){const a={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(a.layerType="OrientedImageryLayer"),a}async function i(e,a,r){if(null==e?.layers||null==e?.tables){const t=await r.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||t?.layers?.map(n),e.tables=e.tables||t?.tables?.map(n)}return e}function s(e){const{layers:a,tables:r}=e;return a?.length?a[0].id:r?.length?r[0].id:null}function l(e){if(!e)return null;const{layers:a,tables:r}=e;return a?.length?a[0]:r?.length?r[0]:null}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function y(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}function o(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}function u(e){return e?.layers?.filter((({layerType:e})=>"CatalogLayer"===e)).map((({id:e})=>e))}async function d(e,a,r){if(!e?.url)return a??{};if(a??={},!a.layers){const t=await r.fetchServiceMetadata(e.url);a.layers=t.layers?.map(n)}const{serverUrl:i,portalItem:s}=await(0,t.S)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==i)return a.tables=[],a;if(!a.tables&&s){const e=await s.fetchData();if(e?.tables)a.tables=e.tables.map(n);else{const t=await r.fetchServiceMetadata(i,{customParameters:l(e)?.customParameters});a.tables=t?.tables?.map(n)}}if(a.tables)for(const e of a.tables)e.url=`${i}/${e.id}`;return a}},12259:(e,a,r)=>{r.d(a,{fromItem:()=>u,q:()=>d});var t=r(20744),n=r(50420),i=r(3615),s=r(71068),l=r(83928),c=r(9764),y=r(67632),o=r(46940);async function u(e){!e.portalItem||e.portalItem instanceof c.default||(e={...e,portalItem:new c.default(e.portalItem)});const a=await async function(e){await e.load();const a=new i.q;return async function(e){const a=e.className,r=l.q[a];return{constructor:await r(),properties:e.properties}}(await d(e,a))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function d(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,o._S)(e,"Map Notes"),r=(0,o._S)(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if((0,o._S)(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===(0,y.mg)(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const r=await L(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const i=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),s=i.cacheType?.toLowerCase(),l=i.capabilities?.toLowerCase().includes("tilesonly");return"map"===s||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const r=await L(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await(0,n.S)(e.url,{sceneLayerItem:e}),t=await a.fetchServiceMetadata(r);return t?.tables??[]}catch{return[]}}));if("object"==typeof r){const t={};let n;if(null!=r.id?(t.layerId=r.id,n=`${e.url}/layers/${r.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(s.Wr))if(e.typeKeywords.includes(a))return{className:s.Wr[a]};const i=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,y.AX)(e)?.customParameters))});return{className:s.Wr[i?.layerType]||"SceneLayer",properties:t}}if(!1===r){const r=await a.fetchServiceMetadata(e.url);if("Voxel"===r?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new t.c("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function L(e,a,r){const{url:t,type:n}=e,i="Feature Service"===n;if(!t)return{};if(/\/\d+$/.test(t)){if(i){const r=await a.fetchServiceMetadata(t,{customParameters:await a.fetchCustomParameters(e,(e=>(0,y.AX)(e)?.customParameters))});if("Oriented Imagery Layer"===r.type)return{id:r.id,className:"OrientedImageryLayer",sourceJSON:r}}return{}}await e.load();let s=await a.fetchItemData(e);if(i){const e=await(0,y.eW)(s,t,a),r=m(e);if("object"==typeof r){const a=(0,y.k1)(e),t=(0,y.wp)(e),n=(0,y.Ur)(e);r.className=null!=r.id&&a.includes(r.id)?"SubtypeGroupLayer":null!=r.id&&t?.includes(r.id)?"OrientedImageryLayer":null!=r.id&&n?.includes(r.id)?"CatalogLayer":"FeatureLayer"}return r}if("Scene Service"===n&&(s=await(0,y.oD)(e,s,a)),(0,y.mg)(s)>0)return m(s);const l=await a.fetchServiceMetadata(t);return r&&(l.tables=await r()),m(l)}function m(e){return 1===(0,y.mg)(e)&&{id:(0,y.cr)(e)}}},97824:(e,a,r)=>{r.d(a,{M:()=>s});var t=r(40196),n=r(10860),i=r(69504);async function s(e,a,r){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(s&&"unique-value"===s.type&&s.styleOrigin){const l=await(0,t.aG)(s.populateFromStyle());if((0,n.wp)(r),!1===l.ok){const r=l.error;a?.messages&&a.messages.push(new i.c("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},66668:(e,a,r)=>{r.d(a,{S:()=>n});var t=r(2600);async function n(e,a){const{data:r}=await(0,t.c)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
|
package/interfaces.d.ts
CHANGED
|
@@ -15623,19 +15623,19 @@ declare namespace __esri {
|
|
|
15623
15623
|
*
|
|
15624
15624
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#addRecords)
|
|
15625
15625
|
*/
|
|
15626
|
-
|
|
15626
|
+
addRecords(records: IdTypePair[]): Promise<void>;
|
|
15627
15627
|
/**
|
|
15628
15628
|
* Assumes that data for all of the members defined in the inclusionModeDefinition is already loaded into local storage.
|
|
15629
15629
|
*
|
|
15630
15630
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#loadLayerAssumingLocalCache)
|
|
15631
15631
|
*/
|
|
15632
|
-
|
|
15632
|
+
loadLayerAssumingLocalCache(): void;
|
|
15633
15633
|
/**
|
|
15634
15634
|
* Removes entities or relationships from the knowledge graph layer.
|
|
15635
15635
|
*
|
|
15636
15636
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#removeRecords)
|
|
15637
15637
|
*/
|
|
15638
|
-
|
|
15638
|
+
removeRecords(records: IdTypePair[]): Promise<IdTypePair[]>;
|
|
15639
15639
|
}
|
|
15640
15640
|
|
|
15641
15641
|
interface KnowledgeGraphLayerProperties extends LayerProperties {
|
package/kernel.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.29";let t,i=r;i="4.29.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.29";let t,i=r;i="4.29.10";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,"token",e.token):s}has("host-webworker");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const a="20240321",b="9cf5a4b8555fda94595b625a40b922e012baf071";export{a as buildDate,b as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{Alignment as e}from"../../../../../../../symbols/cim/enums.js";import{applyParentTransform as i}from"../../../../../../../symbols/cim/utils.js";import{spritePadding as o,sdfTextureSize as s}from"../../../definitions.js";class h{static from(t){return"width"in t?this.fromSimpleMeshParams(t):this.fromComplexMeshParams(t)}static fromSimpleMeshParams(e){const i=new h(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:o,width:s,height:r,angle:n,
|
|
5
|
+
import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{Alignment as e}from"../../../../../../../symbols/cim/enums.js";import{applyParentTransform as i}from"../../../../../../../symbols/cim/utils.js";import{spritePadding as o,sdfTextureSize as s}from"../../../definitions.js";class h{static from(t){return"width"in t?this.fromSimpleMeshParams(t):this.fromComplexMeshParams(t)}static fromSimpleMeshParams(e){const i=new h(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:o,width:s,height:r,angle:n,alignment:a,outlineSize:c,referenceSize:l,sprite:m,overrideOutlineColor:f}=e;i.rawWidth=t(s),i.rawHeight=t(r),i.angle=n,i.alignment=a,i.outlineSize=t(c),i.referenceSize=t(l),i.overrideOutlineColor=f,i.offsetX=t(e.offsetX),i.offsetY=t(e.offsetY),"simple"!==o||m.sdf||(i.rawWidth=m.width,i.rawHeight=m.height);const d=2;return i.sizeRatio=m.sdf?d:1,i._computeSize(e,!1),i}static fromComplexMeshParams(e){const o=new h(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:s,transforms:r,size:n,scaleX:a,anchorX:c,anchorY:l,angle:m,colorLocked:f,frameHeight:d,widthRatio:u,offsetX:p,offsetY:g,outlineSize:x,referenceSize:z,scaleFactor:w,sizeRatio:S,isAbsoluteAnchorPoint:X,rotateClockwise:Y,scaleSymbolsProportionally:H,sprite:C}=e;if(r&&r.infos.length>0){const t=i(n,m,Y,p,g,r);n=t.size,m=t.rotation,p=t.offsetX,g=t.offsetY,Y=!1}w&&(n*=w,p*=w,g*=w);const M=a*(C.width/C.height);o.alignment=s,o.rawHeight=t(n),o.rawWidth=o.rawHeight*M,o.referenceSize=t(z),o.sizeRatio=S,o.angle=m,o.rotateClockwise=Y,o.anchorX=c,o.anchorY=l,o.offsetX=t(p),o.offsetY=t(g),X&&n&&(C.sdf?o.anchorX=c/(n*u):o.anchorX=c/(n*M),o.anchorY=l/n);const W=H&&d?n/d:1;return o.outlineSize=0===x||isNaN(x)?0:t(x)*W,o.scaleSymbolsProportionally=H,o.colorLocked=f,o._computeSize(e,!0),o}constructor(t,i,o,s,h,r,n){this.sprite=t,this.color=i,this.outlineColor=o,this.minPixelBuffer=s,this.placement=h,this.scaleInfo=r,this.effects=n,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.alignment=e.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(t,e){const{sprite:i,hasSizeVV:h}=t,r=!!i.sdf,{rawWidth:n,rawHeight:a,sizeRatio:c,outlineSize:l}=this,m=n*c,f=a*c;if(r&&!h){const t=e&&n>a?m:n,i=a,o=l+2*1;this.computedWidth=Math.min(t+o,m),this.computedHeight=Math.min(i+o,f)}else this.computedWidth=m,this.computedHeight=f;const d=r?s/Math.max(m,f):1,u=.5*(m-this.computedWidth)*d,p=.5*(f-this.computedHeight)*d,g=i.rect.x+o+u,x=i.rect.y+o+p,z=g+i.width-2*u,w=x+i.height-2*p;this.texXmin=Math.floor(g),this.texYmin=Math.floor(x),this.texXmax=Math.ceil(z),this.texYmax=Math.ceil(w),this.computedWidth*=(this.texXmax-this.texXmin)/(z-g),this.computedHeight*=(this.texYmax-this.texYmin)/(w-x),this.anchorX*=m/this.computedWidth,this.anchorY*=f/this.computedHeight}}export{h as ComputedMarkerParams};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import c from"../../../rest/support/PointBarrier.js";import g from"../../../rest/support/PolygonBarrier.js";import d from"../../../rest/support/PolylineBarrier.js";import u from"../../../rest/support/RouteInfo.js";import _ from"../../../rest/support/Stop.js";import{getHighlightBits as m}from"../engine/highlightReasons.js";import{LayerView2DMixin as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import c from"../../../rest/support/PointBarrier.js";import g from"../../../rest/support/PolygonBarrier.js";import d from"../../../rest/support/PolylineBarrier.js";import u from"../../../rest/support/RouteInfo.js";import _ from"../../../rest/support/Stop.js";import{getHighlightBits as m}from"../engine/highlightReasons.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import w from"./graphics/GraphicContainer.js";import y from"./graphics/GraphicsView2D.js";import k from"../../layers/LayerView.js";const j=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],M={graphic:null,property:null,oldValue:null,newValue:null};function V(t){return t instanceof p||t instanceof l||t instanceof c||t instanceof g||t instanceof d||t instanceof u||t instanceof _}function v(t){return r.isCollection(t)&&t.length&&V(t.at(0))}function G(t){return Array.isArray(t)&&t.length>0&&V(t[0])}let I=class extends(f(k)){constructor(){super(...arguments),this._graphics=new r,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new i({getCollections:()=>null==this.layer||this.destroyed?[]:[null!=this.layer.routeInfo?new r([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange((()=>this._routeItems),(t=>this._routeItemsChanged(t)),o)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,e){return this._graphicsView.hitTest(t).filter((({popupTemplate:t})=>!!t))}highlight(t){let r;r=V(t)?[this._getNetworkFeatureUid(t)]:G(t)?t.map((t=>this._getNetworkFeatureUid(t))):v(t)?t.map((t=>this._getNetworkFeatureUid(t))).toArray():[t.uid];const i=r.filter(e);return i.length?(this._addHighlight(i),s((()=>this._removeHighlight(i)))):s()}async hitTest(t,r){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(e).map((t=>this._networkGraphicMap.get(t)));if(!i.length)return null;const{layer:s}=this;return i.reverse().map((e=>({type:"route",layer:s,mapPoint:t,networkFeature:e})))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e);this._highlightIds.set(e,t+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),r=new w(t.featuresTilingScheme);this._graphicsView=new y({container:r,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return j.indexOf(e.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e)-1;0===t?this._highlightIds.delete(e):this._highlightIds.set(e,t)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map((t=>{const e=this._networkFeatureMap.get(t);return this._networkFeatureMap.delete(t),this._networkGraphicMap.delete(e),e})));for(const e of t.removed)this.removeHandles(e)}if(t.added.length){this._graphics.addMany(t.added.map((t=>{const e=this._createGraphic(t);return null==e.symbol?null:(this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),e)})).filter(e));for(const e of t.added)this.addHandles([a((()=>e.geometry),((t,r)=>{this._updateGraphic(e,"geometry",t,r)})),a((()=>e.symbol),((t,r)=>{this._updateGraphic(e,"symbol",t,r)}))],e);this._graphics.sort(((t,e)=>this._getDrawOrder(t)-this._getDrawOrder(e)))}}_updateGraphic(t,e,r,i){if(!this._networkFeatureMap.has(t)){const e=this._createGraphic(t);return this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),void this._graphics.add(e)}const s=this._networkFeatureMap.get(t);s[e]=r,M.graphic=s,M.property=e,M.oldValue=i,M.newValue=r,this._graphicsView.graphicUpdateHandler(M)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),e=m("highlight");this._graphicsView.setHighlight(t.map((t=>({objectId:t,highlightFlags:e}))))}};t([h()],I.prototype,"_graphics",void 0),t([h()],I.prototype,"_routeItems",null),I=t([n("esri.views.2d.layers.RouteLayerView2D")],I);const F=I;export{F as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{CIMSymbolHelper as e}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as a}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as i}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{noVisualVariables as l,getMaxSizeVVSize as o}from"../VisualVariablesSchema.js";function
|
|
5
|
+
import{CIMSymbolHelper as e}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as a}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as i}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{noVisualVariables as l,getMaxSizeVVSize as o}from"../VisualVariablesSchema.js";import{hasSizeVVUniform as r}from"./utils.js";function s(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function t(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,l,o]=e;return[a,i,l,255*o]}return"string"==typeof e?e:{...e,defaultValue:t(e?.defaultValue)}}async function n(a,i){const{cimResourceManager:l,cimAnalyzer:o,scaleExpression:r}=i.schemaOptions;await Promise.all(e.fetchResources(a.symbol,l,[]));const t=o.analyzeSymbolReference(a,!1),n={scaleInfo:s(a),scaleExpression:r},u=[];for(const e of t)switch(e.type){case"marker":u.push(...c(e,i,n));break;case"fill":u.push(...m(e,i,n));break;case"line":u.push(...b(e,i,n));break;case"text":u.push(...v(e,i,n))}return u}function c(e,a,o){const{uniforms:r,schemaOptions:s}=a,{store:t}=s,n=e.isOutline?{...l,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation};return u(t.ensureInstance(i.marker,{geometry:n},{zoomRange:!!o.scaleInfo}),e,r,o)}function u(e,i,l,{scaleInfo:s,scaleExpression:n}){const c=r(l);return[e.createMeshInfo({params:{size:i.size,scaleX:i.scaleX,anchorX:i.anchorPoint.x,anchorY:i.anchorPoint.y,angle:i.rotation,color:t(i.color)??[0,0,0,0],colorLocked:i.colorLocked,frameHeight:i.frameHeight,widthRatio:i.widthRatio,scaleInfo:s,offsetX:i.offsetX,offsetY:i.offsetY,outlineColor:t(i.outlineColor)??[0,0,0,0],outlineSize:i.outlineWidth,referenceSize:i.referenceSize||a.CIMVectorMarker.size,rotateClockwise:i.rotateClockwise,scaleFactor:n??1,sizeRatio:i.sizeRatio,alignment:i.alignment,isAbsoluteAnchorPoint:i.isAbsoluteAnchorPoint,scaleSymbolsProportionally:i.scaleSymbolsProportionally,sprite:i.spriteRasterizationParam,hasSizeVV:c,placement:i.markerPlacement,effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,transforms:i.transform,minPixelBuffer:o(l)}})]}function f(e,a,l){const{uniforms:o,schemaOptions:r}=a,{store:s}=r;return p(s.ensureInstance(i.fill,{geometry:{visualVariableColor:e.colorLocked?null:o.visualVariableColor,visualVariableOpacity:o.visualVariableOpacity}},{zoomRange:!!l.scaleInfo}),e,l)}function p(e,a,{scaleInfo:i}){return[e.createMeshInfo({params:{color:t(a.color)??[0,0,0,0],scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null}})]}function m(e,a,l){if(!e.spriteRasterizationParam)return f(e,a,l);const{uniforms:o,schemaOptions:r}=a,{store:s}=r;return S(s.ensureInstance(i.complexFill,{geometry:{visualVariableColor:e.colorLocked?null:o.visualVariableColor,visualVariableOpacity:o.visualVariableOpacity}},{zoomRange:!!l.scaleInfo}),e,null!=o.visualVariableColor,l)}function S(e,a,i,{scaleInfo:l}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const o=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),r=a.sampleAlphaOnly&&!o,s=a.spriteRasterizationParam;return[e.createMeshInfo({params:{color:t(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:r,scaleProportionally:"CIMHatchFill"===s.resource.type,sprite:s,scaleInfo:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null}})]}function b(e,a,o){const{uniforms:r,schemaOptions:s}=a,{store:t}=s,n=e.isOutline?{...l,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},c={geometry:n},u=!!(n.visualVariableSizeMinMaxValue||n.visualVariableSizeScaleStops||n.visualVariableSizeStops||n.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return h(t.ensureInstance(i.line,c,{zoomRange:!!o.scaleInfo}),e,u,o)}return z(t.ensureInstance(i.texturedLine,c,{zoomRange:!!o.scaleInfo}),e,u,o)}function V(e,a,{scaleInfo:i}){return{params:{color:t(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:a,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}}function h(e,a,i,l){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");return[e.createMeshInfo({params:V(a,i,l).params})]}function z(e,a,i,l){const{spriteRasterizationParam:o,scaleDash:r,sampleAlphaOnly:s}=a;if(!o)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({params:{...V(a,i,l).params,shouldScaleDash:r??!1,shouldSampleAlphaOnly:s,isSDF:"CIMPictureStroke"!==o.resource.type,sprite:o}})]}function v(e,a,l){const{uniforms:o,schemaOptions:r}=a,{store:s}=r;return y(s.ensureInstance(i.text,{geometry:{visualVariableColor:e.colorLocked?null:o.visualVariableColor,visualVariableOpacity:o.visualVariableOpacity,visualVariableRotation:o.visualVariableRotation,visualVariableSizeMinMaxValue:o.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:o.visualVariableSizeScaleStops,visualVariableSizeStops:o.visualVariableSizeStops,visualVariableSizeUnitValue:o.visualVariableSizeUnitValue}},{zoomRange:!!l.scaleInfo,referenceSymbol:!1,clipAngle:!1}),e,o,l)}function y(e,a,i,{scaleInfo:l,scaleExpression:r}){return[e.createMeshInfo({params:{boxBackgroundColor:t(a.backgroundColor),boxBorderLineColor:t(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:t(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:t(a.outlineColor)??[0,0,0,0],haloFontSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:r??1,minPixelBuffer:o(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}export{S as createComplexFillMeshInfos,u as createComplexMarkerMeshInfos,p as createComplexSimpleFillMeshInfos,h as createComplexSimpleLineMeshInfos,n as createComplexSymbolInstances,y as createComplexTextMeshInfos,z as createComplexTexturedLineMeshInfos,s as getScaleInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../../../symbols.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{generateGradient as a}from"../../../../../../../renderers/support/heatmapUtils.js";import{CIMSymbolHelper as l,slsDashToTemplateArray as i,capTypeToEnum as r}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{ExtremityPlacement as t}from"../../../../../../../symbols/cim/enums.js";import{getSDFInfo as o}from"../../../../../../../symbols/cim/SDFHelper.js";import{getAlignmentFromPlacement as s}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as n}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as u}from"../../../../../engine/webgl/definitions.js";import{Techniques as c}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{premultiplyColor as p}from"../schemaUtils.js";import{createVisualVariableUniforms as f,getMaxSizeVVSize as m,noVisualVariables as b}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as S,hasSizeVVUniform as V}from"./ComplexSymbolSchema.js";import y from"../../../../../../../symbols/SimpleFillSymbol.js";async function v(e,a){if(!e)return[];switch(e.type){case"simple-fill":return R(e,a);case"picture-fill":return k(e,a);case"simple-marker":return x(e,a);case"picture-marker":return M(e,a);case"simple-line":return U(e,a,!1);case"text":return I(e,a);case"label":return O(e,a);case"cim":return S(e.data,a);case"web-style":{const l=await e.fetchCIMSymbol();return S(l.data,a)}default:throw new Error(`symbol not supported ${e.type}`)}}async function h(e,a){const{schemaOptions:l}=a,{store:i}=l,r=new Array(u),t=new Array(u/4);for(let c=0;c<u;c++){const a=c<e.attributes.length?e.attributes[c].color:null;r[c]=[0,0,0,0],n(r[c],a)}for(let n=0;n<u/4;n++)t[n]=[0,0,0,0],t[n][0]=4*n<e.attributes.length?1:0,t[n][1]=4*n+1<e.attributes.length?1:0,t[n][2]=4*n+2<e.attributes.length?1:0,t[n][3]=4*n+3<e.attributes.length?1:0;const o={isActive:t,colors:r,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},s=i.ensureInstance(c.dotDensity,o,{}).createMeshInfo({params:{effects:null}}),p=[];if(e.backgroundColor){const l=new y({color:e.backgroundColor,outline:null}),i=await v(l,a);p.push(...i)}if(p.push(s),e.outline){const l=U(e.outline,a,!0);p.push(...l)}return p}async function z(l,i){const{store:r}=i,{radius:t,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:p,colorStops:f}=l,m=a(f);return[r.ensureInstance(c.heatmap,{radius:e(t),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!p),gradient:m,gradientHash:m.join(",")},{}).createMeshInfo({params:{effects:null}})]}function d(a,l){const{store:i}=l,r=a.outline?.width||0,t=f(a),o=i.ensureInstance(c.pieChart,{geometry:{outlineWidth:Math.round(e(r)),defaultColor:p(a.defaultColor),outlineColor:p(a.outline?.color),othersColor:p(a.othersCategory?.color),donutRatio:a.holePercentage,sectorThreshold:a.othersCategory?.threshold||0,colors:a.attributes.map((e=>p(e.color))),visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:a.attributes.length},{}).createMeshInfo({params:{size:a.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:m(t)}});return[...a.backgroundFillSymbol?R(a.backgroundFillSymbol,{schemaOptions:l,path:"",uniforms:b}):[],o]}function g(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const a=l.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!a||!a.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:a.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:o(a),overrides:[]}}async function x(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const i=l.fromSimpleMarker(e);if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");if("path"!==e.style){const e=i.symbolLayers[0];if(V(a.uniforms)){const l=m(a.uniforms,0,1);if(l>e.size){const a=l/e.size;e.size=l;const i=e.markerGraphics?.[0].symbol;(i.symbolLayers&&i.symbolLayers[0]).width*=a}}}return S({type:"CIMSymbolReference",symbol:i},a)}const o=t.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),s=g(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===s.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,p=e.size,f=p*u,b=null!=i.visualVariableColor&&("cross"===e.style||"x"===e.style);return[o.createMeshInfo({params:{type:"simple",color:n,height:p,width:f,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:p,sprite:s,overrideOutlineColor:b,hasSizeVV:V(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function M(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r,o=t.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),s=l.createPictureMarkerRasterizationParam(e);if(!s)return[];return[o.createMeshInfo({params:{type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:s,overrideOutlineColor:!1,hasSizeVV:V(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function C(e,a,l){const{uniforms:i,schemaOptions:r}=l,{store:o}=r,s=o.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),n=g(e),u=6,p=u*a.width,f=p,b=e.color?.toArray()??a.color?.toArray()??[0,0,0,0],S="cross"===e.style||"x"===e.style;let y;switch(e.placement){case"begin-end":y=t.Both;break;case"begin":y=t.JustBegin;break;case"end":y=t.JustEnd;break;default:y=t.None}const v={type:"cim-marker-placement-info",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[s.createMeshInfo({params:{type:"simple",color:b,height:f,width:p,offsetX:0,offsetY:0,angle:0,outlineColor:b,outlineSize:S?a.width:0,referenceSize:f/u,sprite:n,overrideOutlineColor:S&&null!=i.visualVariableColor,hasSizeVV:V(i),placement:v,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function I(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r;return[t.ensureInstance(c.text,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue}},{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}).createMeshInfo({params:{boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloFontSize:e.haloSize??0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:l.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:m(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function O(a,i){const{schemaOptions:r,uniforms:t}=i,{store:o}=r,n=a.symbol,{allowOverrun:u,repeatLabel:p,repeatLabelDistance:f}=a,b={maxScale:a.maxScale??0,minScale:a.minScale??0},S=o.ensureInstance(c.label,{geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}),V=a.labelPlacement,[y,v]=s(V);return[S.createMeshInfo({params:{boxBackgroundColor:n.backgroundColor?.toArray(),boxBorderLineColor:n.borderLineColor?.toArray(),boxBorderLineSize:n.borderLineSize??0,color:n.color?.toArray()??[0,0,0,0],offsetX:n.xoffset,offsetY:n.yoffset,postAngle:n.angle,fontSize:n.font.size,decoration:n.font.decoration,haloColor:n.haloColor?.toArray()??[0,0,0,0],haloFontSize:n.haloSize??0,lineWidth:n.lineWidth,lineHeightRatio:n.lineHeight,horizontalAlignment:y,verticalAlignment:v,repeatLabel:p,repeatLabelDistance:e(f),allowOverrun:u,labelPosition:a.labelPosition,scaleInfo:b,minPixelBuffer:m(t),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:n.font.toJSON(),textString:n.text,symbol:l.createCIMTextSymbolfromTextSymbol(n),primitiveName:"label-override"},useLegacyLabelEvaluationRules:null==a.labelExpressionInfo?.expression,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:a.labelExpressionInfo?.expression??a.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,isLineLabel:!1}})]}function w(e,a){const l=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:l,referenceWidth:l,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:a}}function A(e,a){const{uniforms:l,schemaOptions:i}=a,{store:r}=i,t=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[r.ensureInstance(c.patternOutlineFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:t,...w(e.outline,!!l.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null}})]}const s=[],n=r.ensureInstance(c.patternFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null}});return s.push(n),e.outline&&s.push(...U(e.outline,a,!0)),s}function L(e,a){const{uniforms:l,schemaOptions:i}=a,{store:r}=i,t=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[r.ensureInstance(c.outlineFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:t,...w(e.outline,!!l.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null}})]}const o=[];if("none"!==e.style){const e=r.ensureInstance(c.fill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:t,scaleInfo:null,effects:null}});o.push(e)}return e.outline&&o.push(...U(e.outline,a,!0)),o}function R(e,a){const{style:l}=e;return l&&"none"!==l&&"solid"!==l?A(e,a):L(e,a)}function k(e,a){const{outline:i}=e,{uniforms:r,schemaOptions:t}=a,{store:o}=t,s=[],n=l.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:p,xoffset:f,yoffset:m,xscale:b,yscale:S}=e,V={color:[255,255,255,255],sprite:n,height:p,aspectRatio:u/p,offsetX:f,offsetY:m,scaleX:b,scaleY:S,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===i?.style){return[o.ensureInstance(c.complexOutlineFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{...V,...w(i,!!r.visualVariableSizeOutlineScaleStops)}})]}const y=o.ensureInstance(c.complexFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!1});return s.push(y.createMeshInfo({params:V})),i&&s.push(...U(i,a,!0)),s}function U(e,a,l){const{color:t,style:o,width:s,cap:n,join:u}=e,{schemaOptions:p}=a,{store:f}=p,m=[],S=l?{...b,visualVariableSizeScaleStops:a.uniforms.visualVariableSizeOutlineScaleStops}:a.uniforms,y={geometry:{visualVariableColor:S.visualVariableColor,visualVariableOpacity:S.visualVariableOpacity,visualVariableSizeMinMaxValue:S.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:S.visualVariableSizeScaleStops,visualVariableSizeStops:S.visualVariableSizeStops,visualVariableSizeUnitValue:S.visualVariableSizeUnitValue}},v={color:t?.toArray()??[0,0,0,0],width:s,referenceWidth:s,capType:n,joinType:u,miterLimit:e.miterLimit,hasSizeVV:V(S),effects:null,scaleInfo:null};if(null==o||"solid"===o){const e=f.ensureInstance(c.line,y,{zoomRange:!1}).createMeshInfo({params:v});m.push(e)}else if("none"!==o){const e=f.ensureInstance(c.texturedLine,y,{zoomRange:!1}).createMeshInfo({params:{...v,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:i(o,n),capStyle:r(n)},overrides:[]}}});m.push(e)}return null!=e.marker&&m.push(...C(e.marker,e,a)),m}export{h as createDotDensityMeshSchemas,z as createHeatmapMeshSchemas,U as createLineInstance,d as createPieChartMeshSchemas,v as createSymbolMeshSchemas};
|
|
5
|
+
import"../../../../../../../symbols.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{generateGradient as a}from"../../../../../../../renderers/support/heatmapUtils.js";import{CIMSymbolHelper as l,slsDashToTemplateArray as i,capTypeToEnum as r}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{Alignment as t,ExtremityPlacement as o}from"../../../../../../../symbols/cim/enums.js";import{getSDFInfo as s}from"../../../../../../../symbols/cim/SDFHelper.js";import{getAlignmentFromPlacement as n}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as u}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as c}from"../../../../../engine/webgl/definitions.js";import{Techniques as p}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{premultiplyColor as f}from"../schemaUtils.js";import{createVisualVariableUniforms as m,getMaxSizeVVSize as b,noVisualVariables as S}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as V}from"./ComplexSymbolSchema.js";import{hasSizeVVUniform as y,hasRotationVVUniform as v}from"./utils.js";import h from"../../../../../../../symbols/SimpleFillSymbol.js";async function z(e,a){if(!e)return[];switch(e.type){case"simple-fill":return E(e,a);case"picture-fill":return P(e,a);case"simple-marker":return C(e,a);case"picture-marker":return I(e,a);case"simple-line":return U(e,a,!1);case"text":return A(e,a);case"label":return w(e,a);case"cim":return V(e.data,a);case"web-style":{const l=await e.fetchCIMSymbol();return V(l.data,a)}default:throw new Error(`symbol not supported ${e.type}`)}}async function d(e,a){const{schemaOptions:l}=a,{store:i}=l,r=new Array(c),t=new Array(c/4);for(let p=0;p<c;p++){const a=p<e.attributes.length?e.attributes[p].color:null;r[p]=[0,0,0,0],u(r[p],a)}for(let u=0;u<c/4;u++)t[u]=[0,0,0,0],t[u][0]=4*u<e.attributes.length?1:0,t[u][1]=4*u+1<e.attributes.length?1:0,t[u][2]=4*u+2<e.attributes.length?1:0,t[u][3]=4*u+3<e.attributes.length?1:0;const o={isActive:t,colors:r,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},s=i.ensureInstance(p.dotDensity,o,{}).createMeshInfo({params:{effects:null}}),n=[];if(e.backgroundColor){const l=new h({color:e.backgroundColor,outline:null}),i=await z(l,a);n.push(...i)}if(n.push(s),e.outline){const l=U(e.outline,a,!0);n.push(...l)}return n}async function g(l,i){const{store:r}=i,{radius:t,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:c,colorStops:f}=l,m=a(f);return[r.ensureInstance(p.heatmap,{radius:e(t),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!c),gradient:m,gradientHash:m.join(",")},{}).createMeshInfo({params:{effects:null}})]}function x(a,l){const{store:i}=l,r=a.outline?.width||0,t=m(a),o=i.ensureInstance(p.pieChart,{geometry:{outlineWidth:Math.round(e(r)),defaultColor:f(a.defaultColor),outlineColor:f(a.outline?.color),othersColor:f(a.othersCategory?.color),donutRatio:a.holePercentage,sectorThreshold:a.othersCategory?.threshold||0,colors:a.attributes.map((e=>f(e.color))),visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:a.attributes.length},{}).createMeshInfo({params:{size:a.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:b(t)}});return[...a.backgroundFillSymbol?E(a.backgroundFillSymbol,{schemaOptions:l,path:"",uniforms:S}):[],o]}function M(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const a=l.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!a||!a.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:a.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:s(a),overrides:[]}}async function C(e,a){const{uniforms:i,schemaOptions:r}=a,{store:o}=r;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const r=l.fromSimpleMarker(e);if(!r||!r.symbolLayers)throw new Error("Error handling marker! ");if(i.visualVariableRotation&&(r.angleAlignment="Map"),"path"!==e.style){const e=r.symbolLayers[0];if(y(a.uniforms)){const l=b(a.uniforms,0,1);if(l>e.size){const a=l/e.size;e.size=l;const i=e.markerGraphics?.[0].symbol;(i.symbolLayers&&i.symbolLayers[0]).width*=a}}}return V({type:"CIMSymbolReference",symbol:r},a)}const s=o.ensureInstance(p.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),n=M(e);let u=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===n.resource.type&&(u=[255,255,255,255]);const c="triangle"===e.style?124/116:1,f=e.size,m=f*c,S=null!=i.visualVariableColor&&("cross"===e.style||"x"===e.style);return[s.createMeshInfo({params:{type:"simple",color:u,height:f,width:m,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:v(i)?t.MAP:t.SCREEN,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:f,sprite:n,overrideOutlineColor:S,hasSizeVV:y(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:b(i)}})]}function I(e,a){const{uniforms:i,schemaOptions:r}=a,{store:o}=r,s=o.ensureInstance(p.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),n=l.createPictureMarkerRasterizationParam(e);if(!n)return[];return[s.createMeshInfo({params:{type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:v(i)?t.MAP:t.SCREEN,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:y(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:b(i)}})]}function O(e,a,l){const{uniforms:i,schemaOptions:r}=l,{store:s}=r,n=s.ensureInstance(p.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),u=M(e),c=6,f=c*a.width,m=f,S=e.color?.toArray()??a.color?.toArray()??[0,0,0,0],V="cross"===e.style||"x"===e.style;let h;switch(e.placement){case"begin-end":h=o.Both;break;case"begin":h=o.JustBegin;break;case"end":h=o.JustEnd;break;default:h=o.None}const z={type:"cim-marker-placement-info",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:h,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({params:{type:"simple",color:S,height:m,width:f,offsetX:0,offsetY:0,angle:0,alignment:v(i)?t.MAP:t.SCREEN,outlineColor:S,outlineSize:V?a.width:0,referenceSize:m/c,sprite:u,overrideOutlineColor:V&&null!=i.visualVariableColor,hasSizeVV:y(i),placement:z,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:b(i)}})]}function A(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r;return[t.ensureInstance(p.text,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue}},{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}).createMeshInfo({params:{boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloFontSize:e.haloSize??0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:l.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:b(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function w(a,i){const{schemaOptions:r,uniforms:t}=i,{store:o}=r,s=a.symbol,{allowOverrun:u,repeatLabel:c,repeatLabelDistance:f}=a,m={maxScale:a.maxScale??0,minScale:a.minScale??0},S=o.ensureInstance(p.label,{geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}),V=a.labelPlacement,[y,v]=n(V);return[S.createMeshInfo({params:{boxBackgroundColor:s.backgroundColor?.toArray(),boxBorderLineColor:s.borderLineColor?.toArray(),boxBorderLineSize:s.borderLineSize??0,color:s.color?.toArray()??[0,0,0,0],offsetX:s.xoffset,offsetY:s.yoffset,postAngle:s.angle,fontSize:s.font.size,decoration:s.font.decoration,haloColor:s.haloColor?.toArray()??[0,0,0,0],haloFontSize:s.haloSize??0,lineWidth:s.lineWidth,lineHeightRatio:s.lineHeight,horizontalAlignment:y,verticalAlignment:v,repeatLabel:c,repeatLabelDistance:e(f),allowOverrun:u,labelPosition:a.labelPosition,scaleInfo:m,minPixelBuffer:b(t),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:s.font.toJSON(),textString:s.text,symbol:l.createCIMTextSymbolfromTextSymbol(s),primitiveName:"label-override"},useLegacyLabelEvaluationRules:null==a.labelExpressionInfo?.expression,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:a.labelExpressionInfo?.expression??a.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,isLineLabel:!1}})]}function R(e,a){const l=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:l,referenceWidth:l,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:a}}function L(e,a){const{uniforms:l,schemaOptions:i}=a,{store:r}=i,t=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[r.ensureInstance(p.patternOutlineFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:t,...R(e.outline,!!l.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null}})]}const s=[],n=r.ensureInstance(p.patternFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null}});return s.push(n),e.outline&&s.push(...U(e.outline,a,!0)),s}function k(e,a){const{uniforms:l,schemaOptions:i}=a,{store:r}=i,t=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[r.ensureInstance(p.outlineFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:t,...R(e.outline,!!l.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null}})]}const o=[];if("none"!==e.style){const e=r.ensureInstance(p.fill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:t,scaleInfo:null,effects:null}});o.push(e)}return e.outline&&o.push(...U(e.outline,a,!0)),o}function E(e,a){const{style:l}=e;return l&&"none"!==l&&"solid"!==l?L(e,a):k(e,a)}function P(e,a){const{outline:i}=e,{uniforms:r,schemaOptions:t}=a,{store:o}=t,s=[],n=l.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:c,xoffset:f,yoffset:m,xscale:b,yscale:S}=e,V={color:[255,255,255,255],sprite:n,height:c,aspectRatio:u/c,offsetX:f,offsetY:m,scaleX:b,scaleY:S,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===i?.style){return[o.ensureInstance(p.complexOutlineFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{...V,...R(i,!!r.visualVariableSizeOutlineScaleStops)}})]}const y=o.ensureInstance(p.complexFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!1});return s.push(y.createMeshInfo({params:V})),i&&s.push(...U(i,a,!0)),s}function U(e,a,l){const{color:t,style:o,width:s,cap:n,join:u}=e,{schemaOptions:c}=a,{store:f}=c,m=[],b=l?{...S,visualVariableSizeScaleStops:a.uniforms.visualVariableSizeOutlineScaleStops}:a.uniforms,V={geometry:{visualVariableColor:b.visualVariableColor,visualVariableOpacity:b.visualVariableOpacity,visualVariableSizeMinMaxValue:b.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:b.visualVariableSizeScaleStops,visualVariableSizeStops:b.visualVariableSizeStops,visualVariableSizeUnitValue:b.visualVariableSizeUnitValue}},v={color:t?.toArray()??[0,0,0,0],width:s,referenceWidth:s,capType:n,joinType:u,miterLimit:e.miterLimit,hasSizeVV:y(b),effects:null,scaleInfo:null};if(null==o||"solid"===o){const e=f.ensureInstance(p.line,V,{zoomRange:!1}).createMeshInfo({params:v});m.push(e)}else if("none"!==o){const e=f.ensureInstance(p.texturedLine,V,{zoomRange:!1}).createMeshInfo({params:{...v,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:i(o,n),capStyle:r(n)},overrides:[]}}});m.push(e)}return null!=e.marker&&m.push(...O(e.marker,e,a)),m}export{d as createDotDensityMeshSchemas,g as createHeatmapMeshSchemas,U as createLineInstance,x as createPieChartMeshSchemas,z as createSymbolMeshSchemas};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
function a(a){return!!(a.visualVariableSizeMinMaxValue||a.visualVariableSizeScaleStops||a.visualVariableSizeStops||a.visualVariableSizeUnitValue||a.visualVariableSizeOutlineScaleStops)}function i(a){return!!a.visualVariableRotation}export{i as hasRotationVVUniform,a as hasSizeVVUniform};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../TimeExtent.js";import has from"../../../../../core/has.js";import t from"../../../../../geometry/SpatialReference.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../rest/support/Query.js";const a=4;function o(i,a){const{service:o}=i,s=o.orderByFields??a.objectIdField+" ASC",n=o.source,u={returnCentroid:!(null!==n&&"object"==typeof n&&"path"in n&&r(n.path))&&"esriGeometryPolygon"===a.geometryType,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(i.mutable.dataFilter.outSpatialReference),orderByFields:[s],where:i.mutable.dataFilter.definitionExpression??"1=1",outFields:i.mutable.availableFields};if("feature"===i.type){const{gdbVersion:t,historicMoment:r,timeExtent:a}=i.mutable.dataFilter;return{...u,gdbVersion:t,historicMoment:r?new Date(r):null,timeExtent:a?e.fromJSON(a):null,outFields:i.mutable.availableFields}}return u}class s{static fromSchema(e,t){return new s(o(e,t),e.mutable.dataFilter.customParameters,t.geometryType,e.service.queryMetadata.capabilities)}constructor(e,t,r,i){this._queryParams=e,this._customParameters=t,this._geometryType=r,this._capabilities=i}get pageSize(){if(null==this._capabilities)throw new Error("InternalError: Service does not support paged queries");const{query:e}=this._capabilities,t=e.supportsMaxRecordCountFactor?a:null,r=(e.maxRecordCount??8e3)*(t??1);return Math.min(8e3,r)}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const r=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(r.outFields??[])[0])return null;r.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),i=[];for(const r of e)t.
|
|
5
|
+
import e from"../../../../../TimeExtent.js";import has from"../../../../../core/has.js";import t from"../../../../../geometry/SpatialReference.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../rest/support/Query.js";const a=4;function o(i,a){const{service:o}=i,s=o.orderByFields??a.objectIdField+" ASC",n=o.source,u={returnCentroid:!(null!==n&&"object"==typeof n&&"path"in n&&r(n.path))&&"esriGeometryPolygon"===a.geometryType,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(i.mutable.dataFilter.outSpatialReference),orderByFields:[s],where:i.mutable.dataFilter.definitionExpression??"1=1",outFields:i.mutable.availableFields};if("feature"===i.type){const{gdbVersion:t,historicMoment:r,timeExtent:a}=i.mutable.dataFilter;return{...u,gdbVersion:t,historicMoment:r?new Date(r):null,timeExtent:a?e.fromJSON(a):null,outFields:i.mutable.availableFields}}return u}class s{static fromSchema(e,t){return new s(o(e,t),e.mutable.dataFilter.customParameters,t.geometryType,e.service.queryMetadata.capabilities)}constructor(e,t,r,i){this._queryParams=e,this._customParameters=t,this._geometryType=r,this._capabilities=i}get pageSize(){if(null==this._capabilities)throw new Error("InternalError: Service does not support paged queries");const{query:e}=this._capabilities,t=e.supportsMaxRecordCountFactor?a:null,r=(e.maxRecordCount??8e3)*(t??1);return Math.min(8e3,r)}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const r=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(r.outFields??[])[0])return null;r.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),i=[];for(const r of e)t.hasField(r)||i.push(r);if(0===i.length)return null;r.outFields=i}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new i({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(null==this._capabilities)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),i=r.inner;return i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._capabilities.query.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset=e.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(i.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._capabilities.query.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._capabilities.query.supportsCompactGeometry,this._capabilities.query.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=a),r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:a})}}export{s as FeatureSourceQueryInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{FeatureSetReaderJSON as o}from"../../support/FeatureSetReaderJSON.js";import{QueueProcessor as n}from"../../../../../support/QueueProcessor.js";class a extends r{constructor(e,t,r,o,a){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=o,this._eventLog=a,this._queue=new n({concurrency:16,process:async e=>{const t={signal:e.options?.signal,query:e.query.customParameters};return this._adapter.executeQuery(e.query.inner,t)}}),this._adapter=s(e,o)}async updateFields(r){this._queryInfo.updateFields(r);const s=Array.from(this._store.chunks()).map((async e=>{const r=t.fromJSON(e.queryInfo.queryJSON);if(r)try{return await this._tryUpdateFields(e.reader,r),null}catch(s){return s}})),o=(await Promise.all(s)).filter((e=>e));if(o.length)throw new e("featurelayer-query","Encountered errors when downloading fields",{errors:o})}async queryOverride({edits:e}){const t=[],r=[];for(const o of e.removed)null!=o.objectId&&-1!==o.objectId?t.push(o.objectId):r.push(o.globalId);r.length&&t.push(...this._mapGlobalIdsToObjectIds(r));const s=e.addOrModified.map((({objectId:e})=>e));let n;if(s.length){const e=this._queryInfo.createQuery({objectIds:s});n=await this._fetch(e)}else n=o.empty(this._metadata);return{reader:n,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),r=this._metadata.globalIdField;if(null==r)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=[];return this._store.forEachUnsafe((e=>{const o=e.readAttribute(r);t.has(o)&&s.push(e.getObjectId())})),s}async _fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e.inner),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e
|
|
5
|
+
import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{FeatureSetReaderJSON as o}from"../../support/FeatureSetReaderJSON.js";import{QueueProcessor as n}from"../../../../../support/QueueProcessor.js";class a extends r{constructor(e,t,r,o,a){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=o,this._eventLog=a,this._queue=new n({concurrency:16,process:async e=>{const t={signal:e.options?.signal,query:e.query.customParameters};return this._adapter.executeQuery(e.query.inner,t)}}),this._adapter=s(e,o)}async updateFields(r){this._queryInfo.updateFields(r);const s=Array.from(this._store.chunks()).map((async e=>{const r=t.fromJSON(e.queryInfo.queryJSON);if(r)try{return await this._tryUpdateFields(e.reader,r),null}catch(s){return s}})),o=(await Promise.all(s)).filter((e=>e));if(o.length)throw new e("featurelayer-query","Encountered errors when downloading fields",{errors:o})}async queryOverride({edits:e}){const t=[],r=[];for(const o of e.removed)null!=o.objectId&&-1!==o.objectId?t.push(o.objectId):r.push(o.globalId);r.length&&t.push(...this._mapGlobalIdsToObjectIds(r));const s=e.addOrModified.map((({objectId:e})=>e));let n;if(s.length){const e=this._queryInfo.createQuery({objectIds:s});n=await this._fetch(e)}else n=o.empty(this._metadata);return{reader:n,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),r=this._metadata.globalIdField;if(null==r)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=[];return this._store.forEachUnsafe((e=>{const o=e.readAttribute(r);t.has(o)&&s.push(e.getObjectId())})),s}async _fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e.inner),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e);if(!r)return;const s=await this._enqueue(r,this._options);e.joinAttributes(s)}async _enqueue(e,t){return this._eventLog.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally((()=>{this._eventLog.onEvent({type:"fetchEnd",done:0===this._queue.length})}))}}export{a as AFetchLoadStrategy};
|