UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines • 17.3 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8991],{5503:(e,t,i)=>{i.d(t,{A:()=>T});var s,n=i(90237),r=i(98291),a=i(65529),o=i(36563),l=i(4718),h=i(93687);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(s||(s={}));var c,u=i(11932),f=i(56507),m=i(62788),d=i(10107),_=i(7695),g=i(40608),p=i(95488),v=i(12195);class b{constructor(e,t,i,s,n){this.target=e,this.added=t,this.removed=i,this.start=s,this.deleteCount=n}}const E=new h.A(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function y(e){e&&"object"==typeof e&&"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}function A(e){return e?e instanceof I?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function C(e){if(e?.length)return e[0]}function M(e,t,i,s){const n=Math.min(e.length-i,t.length-s);let r=0;for(;r<n&&e[i+r]===t[s+r];)r++;return r}function w(e,t,i,s){t&&t.forEach(((t,n,r)=>{e.push(t),w(e,i.call(s,t,n,r),i,s)}))}const x=new Set,V=new Set,O=new Set,D=new Map;let z=0,I=class extends a.A.EventedAccessor{static{c=this}static{this.ofType=e=>{if(!e)return c;if(D.has(e))return D.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const i in e.typeMap){const s=e.typeMap[i].prototype.declaredClass;t?t+=` | ${s}`:t=s}let i=class extends c{};return(0,n._)([(0,_.u)({Type:e,ensureType:"function"==typeof e?(0,f.dp)(e):(0,f.aq)(e)})],i.prototype,"itemType",void 0),i=(0,n._)([(0,g.$)(`esri.core.Collection<${t}>`)],i),D.set(e,i),i}}static isCollection(e){return null!=e&&e instanceof c}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new p.I,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:z++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof c?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return(0,m.gc)(this._observable),this._items}set items(e){this._emitBeforeChanges(s.ADD)||(this._splice(0,this.length,A(e)),this._emitAfterChanges(s.ADD))}hasEventListener(e){return!this.destroyed&&("change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e))}on(e,t){if(this.destroyed)return(0,o.hA)();if("change"===e){const e=this._chgListeners,i={removed:!1,callback:t};return e.push(i),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),(0,o.hA)((()=>{i.removed=!0,e.splice(e.indexOf(i),1)}))}return this._emitter.on(e,t)}once(e,t){const i="deref"in t?()=>t.deref():()=>t,s=this.on(e,(e=>{i()?.call(null,e),s.remove()}));return s}add(e,t){if((0,m.gc)(this._observable),this._emitBeforeChanges(s.ADD))return this;const i=this.getNextIndex(t??null);return this._splice(i,0,[e]),this._emitAfterChanges(s.ADD),this}addMany(e,t=this._items.length){if((0,m.gc)(this._observable),!e?.length)return this;if(this._emitBeforeChanges(s.ADD))return this;const i=this.getNextIndex(t);return this._splice(i,0,A(e)),this._emitAfterChanges(s.ADD),this}at(e){if((0,m.gc)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,m.gc)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(s.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,m.gc)(this._observable),this._createNewInstance({items:this._items.map(l.o8)})}concat(...e){(0,m.gc)(this._observable);const t=e.map(A);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,m.gc)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const i=this._splice(0,this.length),n=i.length;for(let s=0;s<n;s++)e.call(t,i[s],s,i);this._emitAfterChanges(s.REMOVE)}destroyAll(){this.drain(y)}destroyMany(e){const t=this.removeMany(e);return t.forEach(y),t}every(e,t){return(0,m.gc)(this._observable),this._items.every(e,t)}filter(e,t){(0,m.gc)(this._observable);const i=2===arguments.length?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:i})}find(e,t){return(0,m.gc)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,m.gc)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,m.gc)(this._observable);const i=[];return w(i,this,e,t),new c(i)}forEach(e,t){return(0,m.gc)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,m.gc)(this._observable),this._items[e]}getNextIndex(e){(0,m.gc)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,m.gc)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,m.gc)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,m.gc)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,m.gc)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,m.gc)(this._observable);const i=this._items.map(e,t);return new c({items:i})}reorder(e,t=this.length-1){(0,m.gc)(this._observable);const i=this.indexOf(e);if(-1!==i){if(t<0?t=0:t>=this.length&&(t=this.length-1),i!==t){if(this._emitBeforeChanges(s.MOVE))return e;this._splice(i,1),this._splice(t,0,[e]),this._emitAfterChanges(s.MOVE)}return e}}pop(){if((0,m.gc)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const e=C(this._splice(this.length-1,1));return this._emitAfterChanges(s.REMOVE),e}push(...e){return(0,m.gc)(this._observable),this._emitBeforeChanges(s.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(s.ADD)),this.length}reduce(e,t){(0,m.gc)(this._observable);const i=this._items;return 2===arguments.length?i.reduce(e,t):i.reduce(e)}reduceRight(e,t){(0,m.gc)(this._observable);const i=this._items;return 2===arguments.length?i.reduceRight(e,t):i.reduceRight(e)}remove(e){return(0,m.gc)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,m.gc)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(s.REMOVE))return;const t=C(this._splice(e,1));return this._emitAfterChanges(s.REMOVE),t}removeMany(e){if((0,m.gc)(this._observable),!e?.length||this._emitBeforeChanges(s.REMOVE))return[];const t=e instanceof c?e.toArray():e,i=this._items,n=[],r=t.length;for(let e=0;e<r;e++){const s=t[e],r=i.indexOf(s);if(r>-1){const s=1+M(t,i,e+1,r+1),a=this._splice(r,s);a&&a.length>0&&n.push.apply(n,a),e+=s-1}}return this._emitAfterChanges(s.REMOVE),n}reverse(){if((0,m.gc)(this._observable),this._emitBeforeChanges(s.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(s.MOVE),this}shift(){if((0,m.gc)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const e=C(this._splice(0,1));return this._emitAfterChanges(s.REMOVE),e}slice(e=0,t=this.length){return(0,m.gc)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,m.gc)(this._observable),this._items.some(e,t)}sort(e){if((0,m.gc)(this._observable),!this.length||this._emitBeforeChanges(s.MOVE)||!this._requiresSort(e))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(s.MOVE),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){const t=this.length-1;for(let i=0;i<t;i++)if(e(this.items[i],this.items[i+1])>0)return!0;return!1}splice(e,t,...i){(0,m.gc)(this._observable),1===arguments.length&&(t=this.length),t??=0;const n=(t?s.REMOVE:0)|(i.length?s.ADD:0);if(this._emitBeforeChanges(n))return[];const r=this._splice(e,t,i)||[];return this._emitAfterChanges(n),r}toArray(){return(0,m.gc)(this._observable),this._items.slice()}toJSON(e){return(0,m.gc)(this._observable),this.toArray().map((t=>(0,v.W)(t)?t.toJSON(e):t))}toLocaleString(){return(0,m.gc)(this._observable),this._items.toLocaleString()}toString(){return(0,m.gc)(this._observable),this._items.toString()}unshift(...e){return(0,m.gc)(this._observable),!e.length||this._emitBeforeChanges(s.ADD)||(this._splice(0,0,e),this._emitAfterChanges(s.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,i){const s=this._items,n=this.itemType;let r,a;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=(0,u._)((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(a=s.splice(e,t),this.hasEventListener("before-remove")){const t=E.acquire();t.target=this,t.cancellable=!0;for(let i=0,n=a.length;i<n;i++)r=a[i],t.reset(r),this.emit("before-remove",t),t.defaultPrevented&&(a.splice(i,1),s.splice(e,0,r),e+=1,i-=1,n-=1);E.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=E.acquire();e.target=this,e.cancellable=!1;const t=a.length;for(let i=0;i<t;i++)e.reset(a[i]),this.emit("after-remove",e);E.release(e)}}if(i?.length){if(n){const e=[];for(const t of i){const i=n.ensureType(t);null==i&&null!=t||e.push(i)}i=e}const t=this.hasEventListener("before-add"),r=this.hasEventListener("after-add"),a=e===this.length;if(t||r){const n=E.acquire();n.target=this,n.cancellable=!0;const o=E.acquire();o.target=this,o.cancellable=!1;for(const l of i)t?(n.reset(l),this.emit("before-add",n),n.defaultPrevented||(a?s.push(l):s.splice(e++,0,l),this._set("length",s.length),r&&(o.reset(l),this.emit("after-add",o)))):(a?s.push(l):s.splice(e++,0,l),this._set("length",s.length),o.reset(l),this.emit("after-add",o));E.release(o),E.release(n)}else{if(a)for(const e of i)s.push(e);else s.splice(e,0,...i);this._set("length",s.length)}}if((i?.length||a?.length)&&this._notifyChangeEvent(i,a),this.hasEventListener("after-splice")){const s=new b(this,i,a,e,t);this.emit("after-splice",s)}return a}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const i=E.acquire();i.target=this,i.cancellable=!0,i.type=e,this.emit("before-changes",i),t=i.defaultPrevented,E.release(i)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=E.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),E.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;x.clear(),V.clear(),O.clear();for(const{added:t,removed:i}of e){if(t)if(0===O.size&&0===V.size)for(const e of t)x.add(e);else for(const e of t)V.has(e)?(O.add(e),V.delete(e)):O.has(e)||x.add(e);if(i)if(0===O.size&&0===x.size)for(const e of i)V.add(e);else for(const e of i)x.has(e)?x.delete(e):(O.delete(e),V.add(e))}const i=r.A.acquire();x.forEach((e=>{i.push(e)}));const s=r.A.acquire();V.forEach((e=>{s.push(e)}));const n=this._items,a=t.items,o=r.A.acquire();if(O.forEach((e=>{a.indexOf(e)!==n.indexOf(e)&&o.push(e)})),t.listeners&&(i.length||s.length||o.length)){const e={target:this,added:i,removed:s,moved:o},n=t.listeners.length;for(let i=0;i<n;i++){const s=t.listeners[i];s.removed||s.callback.call(this,e)}}r.A.release(i),r.A.release(s),r.A.release(o)}x.clear(),V.clear(),O.clear()}};(0,n._)([(0,d.MZ)()],I.prototype,"_updating",void 0),(0,n._)([(0,d.MZ)()],I.prototype,"length",void 0),(0,n._)([(0,d.MZ)()],I.prototype,"items",null),(0,n._)([(0,d.MZ)({readOnly:!0})],I.prototype,"updating",null),I=c=(0,n._)([(0,g.$)("esri.core.Collection")],I);const T=I},7695:(e,t,i)=>{function s(e){return(t,i)=>{t[i]=e}}i.d(t,{u:()=>s})},33009:(e,t,i)=>{i.r(t),i.d(t,{classBreaks:()=>o,heatmapStatistics:()=>h,histogram:()=>l,summaryStatistics:()=>r,uniqueValues:()=>a});var s=i(87445),n=i(1873);async function r(e){const{attribute:t,features:i}=e,{normalizationType:r,normalizationField:a,minValue:o,maxValue:l,fieldType:h,outStatisticTypes:c}=t,u=await(0,s.Jc)({field:t.field,valueExpression:t.valueExpression,normalizationType:r,normalizationField:a,normalizationTotal:t.normalizationTotal,viewInfoParams:t.viewInfoParams,timeZone:t.timeZone,fieldInfos:t.fieldInfos},i),f=(0,n.Vb)({normalizationType:r,normalizationField:a,minValue:o,maxValue:l}),m={value:.5,fieldType:h},d="esriFieldTypeString"===h?(0,n.z9)({values:u,supportsNullCount:f,percentileParams:m,outStatisticTypes:c}):(0,n.G_)({values:u,minValue:o,maxValue:l,useSampleStdDev:!r,supportsNullCount:f,percentileParams:m,outStatisticTypes:c});return(0,n.oZ)(d,c,"esriFieldTypeDate"===h)}async function a(e){const{attribute:t,features:i}=e,r=await(0,s.Jc)({field:t.field,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,valueExpression:t.valueExpression,viewInfoParams:t.viewInfoParams,timeZone:t.timeZone,fieldInfos:t.fieldInfos},i,!1),a=(0,n.b3)(r);return(0,n.lv)(a,t.domains,t.returnAllCodedValues,t.fieldDelimiter)}async function o(e){const{attribute:t,features:i}=e,{field:r,normalizationType:a,normalizationField:o,normalizationTotal:l,classificationMethod:h}=t,c=await(0,s.Jc)({field:r,valueExpression:t.valueExpression,normalizationType:a,normalizationField:o,normalizationTotal:l,viewInfoParams:t.viewInfoParams,timeZone:t.timeZone,fieldInfos:t.fieldInfos},i),u=(0,n.Rw)(c,{field:r,normalizationType:a,normalizationField:o,normalizationTotal:l,classificationMethod:h,standardDeviationInterval:t.standardDeviationInterval,numClasses:t.numClasses,minValue:t.minValue,maxValue:t.maxValue});return(0,n.jM)(u,h)}async function l(e){const{attribute:t,features:i}=e,{field:r,normalizationType:a,normalizationField:o,normalizationTotal:l,classificationMethod:h}=t,c=await(0,s.Jc)({field:r,valueExpression:t.valueExpression,normalizationType:a,normalizationField:o,normalizationTotal:l,viewInfoParams:t.viewInfoParams,timeZone:t.timeZone,fieldInfos:t.fieldInfos},i);return(0,n.$y)(c,{field:r,normalizationType:a,normalizationField:o,normalizationTotal:l,classificationMethod:h,standardDeviationInterval:t.standardDeviationInterval,numBins:t.numBins,minValue:t.minValue,maxValue:t.maxValue})}async function h(e){const{attribute:t,features:i}=e,{field:n,radius:r,transform:a,spatialReference:o}=t,l=t.size??[0,0],h=(0,s.$r)(i??[],a,o,l);return(0,s.gV)(h,r??void 0,n,l[0],l[1])}},65529:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(90237),n=i(69622),r=i(36563),a=i(40608);class o{constructor(){this._emitter=new o.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this._target=e,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(e,t){let i=this._listenersMap?.get(e);if(!i)return!1;const s=this._target||this;let n=!1;for(const e of i.slice()){const i="deref"in e?e.deref():e;i?i?.call(s,t):n=!0}return n&&(i=i.filter((e=>!("deref"in e)||null!=e.deref())),this._listenersMap.set(e,i)),i.length>0}on(e,t){if(Array.isArray(e)){const i=e.map((e=>this.on(e,t)));return(0,r.vE)(i)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const i=this._listenersMap.get(e)||[];return i.push(t),this._listenersMap.set(e,i),(0,r.hA)((()=>{const i=this._listenersMap?.get(e),s=i?.indexOf(t)??-1;s>=0&&i.splice(s,1)}))}once(e,t){const i=this.on(e,(e=>{i.remove();const s="deref"in t?t.deref():t;s?.call(null,e)}));return i}hasEventListener(e){const t=this._listenersMap?.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let i=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return i=(0,s._)([(0,a.$)("esri.core.Evented")],i),i};let i=class extends n.A{constructor(){super(...arguments),this._emitter=new o.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};i=(0,s._)([(0,a.$)("esri.core.Evented.EventedAccessor")],i),e.EventedAccessor=i}(o||(o={}));const l=o},90629:(e,t,i)=>{i.d(t,{Lz:()=>a,PN:()=>o,cr:()=>l,tc:()=>h});const s=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,n="screenUtils.toPt: input not recognized!",r=96;function a(e){return e?e/72*r:0}function o(e){return e?72*e/r:0}function l(e){if("string"==typeof e){const t=e.match(s);if(t){const i=Number(t[1]),s=t[3]&&t[3].toLowerCase(),n="-"===e.charAt(0),r="px"===s?o(i):i;return n?-r:r}return console.warn(n),null}return e}function h(e=0,t=0){return{x:e,y:t}}}}]);