1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6685],{6685:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(40581),a=n(62408),s=n(53183),i=n(77732),u=n(68673),l=n(15917);class o extends s.Z{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(null===this._wset){await this._ensureLoaded();let t=await this._parent._getFilteredSet("esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new i.Z(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===u.dj.NotInFeatureSet?t:void 0===(t=this._idstates[e])?u.dj.Unknown:t}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(null===e.geometry)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":{let t=(0,u.SV)(this._relationGeom),n=(0,u.SV)(e.geometry);return(0,l.kK)(t,n)}case"esriSpatialRelIntersects":return(0,l.kK)(this._relationGeom,e.geometry);case"esriSpatialRelContains":return(0,l.r3)(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return(0,l.Nm)(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return(0,l.uh)(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return(0,l.W4)(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return(0,l.jU)(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return(0,l.LV)(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){let r=new i.Z([],e,!1,null),a=Math.min(t,e.length);await this._parent?._getFeatures(r,-1,a,n),this._checkCancelled(n);let s=[];for(let t=0;t<a;t++){let n=this._parent._featureFromCache(e[t]);s.push(await this.executeSpatialRelationTest(n))}for(let n=0;n<t;n++)!0===s[n]?this._idstates[e[n]]=u.dj.InFeatureSet:this._idstates[e[n]]=u.dj.NotInFeatureSet;return"success"}async _getFilteredSet(e,t,n,r,a){await this._ensureLoaded();let s=await this._parent._getFilteredSet("esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,n,r,a);return this._checkCancelled(a),null!==t?new i.Z(s._candidates.slice(0).concat(s._known.slice(0)),[],s._ordered,this._clonePageDefinition(s.pagesDefinition)):new i.Z(s._candidates.slice(0),s._known.slice(0),s._ordered,this._clonePageDefinition(s.pagesDefinition))}async _stat(e,t,n,r,a,s,i){if(""!==n)return{calculated:!1};let u=await this._parent._stat(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,a,s,i);return!1===u.calculated?null===a&&""===n&&null===r?this._manualStat(e,t,s,i):{calculated:!1}:u}async _canDoAggregates(e,t,n,r,a){return""===n&&null===r&&null!==this._parent&&this._parent._canDoAggregates(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,s,i,u){if(null===this._parent)throw new a.EN(a.H9.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,s,i,u)}static registerAction(){s.Z._featuresetFunctions.intersects=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelIntersects",relationGeom:e})},s.Z._featuresetFunctions.envelopeIntersects=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelEnvelopeIntersects",relationGeom:e})},s.Z._featuresetFunctions.contains=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelContains",relationGeom:e})},s.Z._featuresetFunctions.overlaps=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelOverlaps",relationGeom:e})},s.Z._featuresetFunctions.within=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelWithin",relationGeom:e})},s.Z._featuresetFunctions.touches=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelTouches",relationGeom:e})},s.Z._featuresetFunctions.crosses=function(e){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelCrosses",relationGeom:e})},s.Z._featuresetFunctions.relate=function(e,t){return null==e?new r.Z({parentfeatureset:this}):new o({parentfeatureset:this,relation:"esriSpatialRelRelation",relationGeom:e,relationString:t})}}}},40581:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(62408),a=n(53183),s=n(77732),i=n(68673);class u extends a.Z{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new s.Z([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=i.Bj.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return i.dj.NotInFeatureSet}async _getFeature(){throw new r.EN(r.H9.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new r.EN(r.H9.NeverReach)}async _getFilteredSet(){return new s.Z([],[],!1,null)}_stat(e,t,n,r,a,s,i){return this._manualStat(e,t,s,i)}async _canDoAggregates(){return!1}}},53183:function(e,t,n){n.d(t,{Z:function(){return _}});var r=n(73566),a=n(62408),s=n(61681);class i{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}nextBatch(e){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then(t=>this.nextBatch(e),t=>this.nextBatch(e));let t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((r,a)=>{this._parent._getSet(this._progress).then(i=>{let u=(0,s.s3)(i._known,"known"),l=u.length-1;if("GETPAGES"===u[u.length-1]&&(l-=1),this._lastId+e>l&&u.length>0&&"GETPAGES"===u[u.length-1])return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(n=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},e=>{t.hasset=!0,this._parent._mainSetInUse=null,a(e)});let o=(0,s.s3)(i._candidates,"candidates");if(l>=this._lastId+e||0===o.length){for(let t=0;t<e;t++){let e=t+this._lastId+1;if(e>=u.length)break;n[t]=u[e]}return this._lastId+=n.length,0===n.length&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(e=>{t.hasset=!0,this._parent._mainSetInUse=null,r(e)},e=>{t.hasset=!0,this._parent._mainSetInUse=null,a(e)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},e=>{t.hasset=!0,this._parent._mainSetInUse=null,a(e)})},e=>{t.hasset=!0,this._parent._mainSetInUse=null,a(e)})}),!1===t.hasset&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then(e=>this.next(),e=>this.next());let e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(r=>{let a=(0,s.s3)(r._known,"known");this._lastId<a.length-1?"GETPAGES"===a[this._lastId+1]?this._parent._expandPagedSet(r,this._parent._maxQueryRate(),0,0,this._progress).then(t=>(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(r,a[this._lastId],this._progress).then(n=>{e.hasset=!0,this._parent._mainSetInUse=null,t(n)},t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)})):(0,s.s3)(r._candidates,"candidates").length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)})}),!1===e.hasset&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(-1!==this._parent._totalCount)return this._parent._totalCount;let e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&"GETPAGES"===e._known[e._known.length-1])return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if("GETPAGES"===e._known[e._candidates.length-1])return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);let t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}var u=n(77732),l=n(68673),o=n(75718),c=n(78668),h=n(99559),d=n(15917),f=n(14685),p=n(28790);class _{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=l.Bj.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.typeIdField=null,this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,e&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return void 0===t?this[e]:(void 0!==this[e]&&(this[e]=t),this)}end(){return null!==this._parent&&!0===this._parent._transparent?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return null===this._loadPromise&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return!0===this._parent?.loaded||await this._parent?.load(),this._initialiseFeatureSet(),this}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new f.Z({wkid:4326}),this.geometryType=l.Qk.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(t=>(t&&t.name.toLowerCase()===e&&(n=t),!!n))),n}getFieldsIndex(){return null===this._fieldsIndex&&(this._fieldsIndex=new p.Z(this.fields)),this._fieldsIndex}_maxProcessingRate(){return null!==this._parent?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return null!==this._parent?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(null!=e&&e.aborted)throw new a.EN(a.H9.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,a){return null!==this._parent&&this._parent._canDoAggregates(e,t,n,r,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,s,i,u){if(null===this._parent)throw new a.EN(a.H9.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,s,i,u)}async _getAgregagtePhysicalPage(e,t,n){if(null===this._parent)throw new a.EN(a.H9.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}
1async databaseType(){if(this._databaseType===l.Bj.NotEvaluated){if(null!==r.Z.applicationCache){let e=r.Z.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(null!==e)return e}if(null!==this._databaseTypeProbed)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),null!==r.Z.applicationCache&&r.Z.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw null!==r.Z.applicationCache&&r.Z.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){for(let e of[{thetype:l.Bj.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:l.Bj.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:l.Bj.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}])if(!0===await this._runDatabaseProbe(e.testwhere))return e.thetype;return l.Bj.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(null!==this._parent)return this._parent._runDatabaseProbe(e);throw new a.EN(a.H9.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(void 0!==this._featureCache[e])return this._featureCache[e]}_isInFeatureSet(e){return l.dj.Unknown}_getSet(e){throw new a.EN(a.H9.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),void 0!==this._featureFromCache(t)||(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),void 0!==this._featureFromCache(t)))return this._featureFromCache(t);throw new a.EN(a.H9.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);let n=new u.Z([],e,!1,null),r=[];for(let a of(await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t),e))void 0!==this._featureFromCache(a)&&r.push(this._featureFromCache(a));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,s){throw new a.EN(a.H9.NotImplemented)}async _refineSetBlock(e,t,n){if(!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate()))return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);let r=e._candidates.length;this._refineKnowns(e,t);let a=r-e._candidates.length;if(0===e._candidates.length||a>=t)return e;if(await this._refineIfParentKnown(e,t-a,n),this._checkCancelled(n),this._refineKnowns(e,t-a),(a=r-e._candidates.length)<t&&e._candidates.length>0){let r=t-a,s=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(s,s.length>r?r:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-a),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){let t=[];for(let n=0;n<e.length;n++)this._isPhysicalFeature(e[n])&&t.push(e[n]);return t}_isPhysicalFeature(e){return null===this._parent||this._parent._isPhysicalFeature(e)}_refineKnowns(e,t){let n=0,r=null,a=[];t=this._maxQueryRate();for(let s=0;s<e._candidates.length&&"GETPAGES"!==e._candidates[s];s++){let i=!1,u=this._candidateIdTransform(e._candidates[s]);u!==e._candidates[s]&&(i=!0);let o=this._isInFeatureSet(u);if(o===l.dj.InFeatureSet)!0===i?e._known.includes(u)||(e._known.push(u),n+=1):(e._known.push(e._candidates[s]),n+=1),null===r?r={start:s,end:s}:r.end===s-1?r.end=s:(a.push(r),r={start:s,end:s});else if(o===l.dj.NotInFeatureSet)null===r?r={start:s,end:s}:r.end===s-1?r.end=s:(a.push(r),r={start:s,end:s}),n+=1;else if(o===l.dj.Unknown&&(n+=1,!0===e._ordered))break;if(n>=t)break}null!==r&&a.push(r);for(let t=a.length-1;t>=0;t--)e._candidates.splice(a[t].start,a[t].end-a[t].start+1)}_refineIfParentKnown(e,t,n){let r=new u.Z([],[],e._ordered,null);return r._candidates=e._candidates.slice(0),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(null===e.pagesDefinition)return!1;let n=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if("GETPAGES"===e._known[r])return!0;
1if(void 0===this._featureCache[e._known[r]]&&(n+=1)>=t)break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(null===e.pagesDefinition)return!1;let n=0;for(let r=0;r<e._candidates.length;r++){if("GETPAGES"===e._candidates[r])return!0;if((n+=1)>=t)break}return!1}async _expandPagedSet(e,t,n,r,s){if(null===this._parent)throw new a.EN(a.H9.NotImplemented);return this._parent._expandPagedSet(e,t,n,r,s)}async _expandPagedSetFeatureSet(e,t,n,r,a){if(e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]&&(r=1),0===r&&e._candidates.length>0&&"GETPAGES"===e._candidates[e._candidates.length-1]&&(r=2),0===r)return"finished";let s=await this._getPage(e,r,a);return n+s<t?this._expandPagedSet(e,t,n+s,0,a):"success"}async _getPage(e,t,n){let r=1===t?e._known:e._candidates;if(e.pagesDefinition.internal.set.length>e.pagesDefinition.resultOffset||!0===e.pagesDefinition.internal.fullyResolved){r.length=r.length-1;let t=0;for(let n=0;n<e.pagesDefinition.resultRecordCount&&!(e.pagesDefinition.resultOffset+n>=e.pagesDefinition.internal.set.length);n++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+n],t++;e.pagesDefinition.resultOffset+=t;let n=!1;return!0===e.pagesDefinition.internal.fullyResolved&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(n=!0),!1===n&&r.push("GETPAGES"),t}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return null===this._parent?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let a=await this._stat(e,t,"",null,null,n,r);return!1===a.calculated&&(a=await this._manualStat(e,t,n,r)),a.result}async _manualStat(e,t,n,r){switch(e.toLowerCase()){case"count":return{calculated:!0,result:await (0,o.QX)(this,r)};case"distinct":return{calculated:!0,result:await (0,o.EB)(this,t,n,r)};case"avg":case"mean":return{calculated:!0,result:await (0,o.J6)(this,t,r)};case"stdev":return{calculated:!0,result:await (0,o.m)(this,t,r)};case"variance":return{calculated:!0,result:await (0,o.CA)(this,t,r)};case"sum":return{calculated:!0,result:await (0,o.Sm)(this,t,r)};case"min":return{calculated:!0,result:await (0,o.VV)(this,t,r)};case"max":return{calculated:!0,result:await (0,o.Fp)(this,t,r)};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,a,s,i){let u=await this._parent._stat(e,t,n,r,a,s,i);return!1===u.calculated?null===a&&""===n&&null===r?this._manualStat(e,t,s,i):{calculated:!1}:u}_unionAllGeomSelf(e){let t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((e,r)=>{this._unionShapeInBatches(n,t,e,r)})}_unionAllGeom(e){return new Promise((t,n)=>{let r=this.iterator(this._defaultTracker(e));this._unionShapeInBatches([],r,t,n)})}_unionShapeInBatches(e,t,n,r){t.next().then(a=>{try{null!==a&&null!==a.geometry&&e.push(a.geometry),e.length>30||null===a&&e.length>1?(0,d.G0)(e).then(s=>{try{null===a?n(s):(e=[s],this._unionShapeInBatches(e,t,n,r))}catch(e){r(e)}},r):null===a?1===e.length?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(e){r(e)}},r)}iterator(e){return new i(this,e)}intersection(e,t=!1){return _._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return _._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return _._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return _._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return _._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return _._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return _._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return _._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return _._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return _._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return _._featuresetFunctions.relate.bind(this)(e,t)}within(e){return _._featuresetFunctions.within.bind(this)(e)}touches(e){return _._featuresetFunctions.touches.bind(this)(e)}top(e){return _._featuresetFunctions.top.bind(this)(e)}crosses(e){return _._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return _._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return _._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return _._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return _._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return _._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((r,a)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,a,0)})}_reduceImpl(e,t,n,r,a,s,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._reduceImpl(e,t,n,r,a,s,i)});e.next().then(u=>{try{if(null===u)a(n);else{let l=t(n,u,r,this);(0,c.y8)(l)?l.then(n=>{this._reduceImpl(e,t,n,r+1,a,s,i)},s):this._reduceImpl(e,t,l,r+1,a,s,i)}}catch(e){s(e)}},s)}catch(e){s(e)}}removeField(e){return _._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return _._featuresetFunctions.addField.bind(this)(e,t,n
1)}sumArea(e,t=!1,n){let r=(0,l.EI)(e);return this.reduce((e,n)=>null===n.geometry?0:t?(0,d.Y4)(n.geometry,r).then(t=>e+t):(0,d.CJ)(n.geometry,r).then(t=>e+t),0,n)}sumLength(e,t=!1,n){let r=(0,l.Lz)(e);return this.reduce((e,n)=>null===n.geometry?0:t?(0,d.kQ)(n.geometry,r).then(t=>e+t):(0,d.sz)(n.geometry,r).then(t=>e+t),0,n)}_substituteVars(e,t){if(null!==t){let n={};for(let e in t)n[e.toLowerCase()]=t[e];e.parameters=n}}async distinct(e,t=1e3,n=null,r){await this.load();let a=h.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();let r=h.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();let r=h.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();let r=h.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();let r=h.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();let r=h.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();let r=h.WhereClause.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",h.WhereClause.create("1",this.getFieldsIndex()),-1,this._defaultTracker(e))}_defaultTracker(e){return e||{aborted:!1}}forEach(e,t){return new Promise((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)})}_forEachImpl(e,t,n,r,a,s){try{if(++s>1e3)return void setTimeout(()=>{s=0,this._forEachImpl(e,t,n,r,a,s)},0);e.next().then(i=>{try{if(null===i)r(n);else{let u=t(i);null==u?this._forEachImpl(e,t,n,r,a,s):(0,c.y8)(u)?u.then(()=>{try{this._forEachImpl(e,t,n,r,a,s)}catch(e){a(e)}},a):this._forEachImpl(e,t,n,r,a,s)}}catch(e){a(e)}},a)}catch(e){a(e)}}convertToJSON(e){let t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let e=0;e<this.fields.length;e++)t.layerDefinition.fields.push((0,l.Sh)(this.fields[e]));return this.reduce((e,n)=>{let r={geometry:n.geometry&&n.geometry.toJSON(),attributes:{}};for(let e in n.attributes)r.attributes[e]=n.attributes[e];return t.featureSet.features.push(r),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,r,a){return this._parent.queryAttachments(e,t,n,r,a)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){let e=[];for(let t of this.fields)e.push((0,l.Sh)(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:void 0===l.q2[this.geometryType]?"":l.q2[this.geometryType],fields:e}}async convertToText(e,t){if("schema"===e)return await this._ensureLoaded(),JSON.stringify(this.schema());if("featureset"===e){await this._ensureLoaded();let e=[];await this.reduce((t,n)=>{let r={geometry:n.geometry?n.geometry.toJSON():null,attributes:n.attributes};return null!==r.geometry&&r.geometry.spatialReference&&delete r.geometry.spatialReference,e.push(r),1},0,t);let n=this.schema();return n.features=e,n.spatialReference=this.spatialReference.toJSON(),JSON.stringify(n)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return null!==this._parent?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return null!==this._parent?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return"keeptype"===e?.featureset?this:"none"===e?.featureset?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if("keeptype"===t?.featureset)return this;if("schema"===t?.featureset)return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if("none"===t?.featureset)return null;await this._ensureLoaded();let n=[];await this.reduce((e,r)=>{let a={geometry:r.geometry?!0===t?.keepGeometryType?r.geometry:r.geometry.toJSON():null,attributes:r.attributes};return null!==a.geometry&&a.geometry.spatialReference&&!0!==t?.keepGeometryType&&delete a.geometry.spatialReference,n.push(a),1},0,e);let r=this.schema();return r.features=n,r.spatialReference=!0===t?.keepGeometryType?this.spatialReference:this.spatialReference?.toJSON(),r}}_._featuresetFunctions={}},77732:function(e,t,n){n.d(t,{Z:function(){return r}});
1class r{constructor(e,t,n,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}},73566:function(e,t,n){n.d(t,{Z:function(){return r}});class r{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){void 0===this._databaseTypeMetaData[e]&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return"MUSTBESET"===e||void 0===this._databaseTypeMetaData[e]?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return void 0===this._layerInfo[e]?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){void 0!==this._layerInfo[e]&&delete this._layerInfo[e]}}r.applicationCache=null},62408:function(e,t,n){n.d(t,{EN:function(){return h},H9:function(){return i},eS:function(){return o},f:function(){return s}});var r,a,s,i,u=n(7182);(r=s||(s={})).InvalidFunctionParameters="InvalidFunctionParameters",r.UnsupportedSqlFunction="UnsupportedSqlFunction",r.UnsupportedOperator="UnsupportedOperator",r.UnsupportedSyntax="UnsupportedSyntax",r.UnsupportedIsRhs="UnsupportedIsRhs",r.UnsupportedIsLhs="UnsupportedIsLhs",r.MissingStatisticParameters="MissingStatisticParameters";let l={[s.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[s.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[s.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[s.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[s.UnsupportedOperator]:"Unsupported operator - {operator}",[s.UnsupportedSyntax]:"Unsupported syntax - {node}",[s.UnsupportedSqlFunction]:"Sql function not found = {function}"};class o extends Error{constructor(e,t){super((0,u.Hy)(l[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,o)}}(a=i||(i={})).NeverReach="NeverReach",a.NotImplemented="NotImplemented",a.Cancelled="Cancelled",a.InvalidStatResponse="InvalidStatResponse",a.InvalidRequest="InvalidRequest",a.RequestFailed="RequestFailed",a.MissingFeatures="MissingFeatures",a.AggregationFieldNotFound="AggregationFieldNotFound",a.DataElementsNotFound="DataElementsNotFound";let c={[i.Cancelled]:"Cancelled",[i.InvalidStatResponse]:"Invalid statistics response from service",[i.InvalidRequest]:"Invalid request",[i.RequestFailed]:"Request failed - {reason}",[i.MissingFeatures]:"Missing features",[i.AggregationFieldNotFound]:"Aggregation field not found",[i.DataElementsNotFound]:"Data elements not found on service",[i.NeverReach]:"Encountered unreachable logic",[i.NotImplemented]:"Not implemented"};
1class h extends Error{constructor(e,t){super((0,u.Hy)(c[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,h)}}},62294:function(e,t,n){n.d(t,{$e:function(){return c},DT:function(){return _},TE:function(){return I},XF:function(){return l},bB:function(){return o},fz:function(){return d},hq:function(){return y},oX:function(){return f},vR:function(){return p},y5:function(){return S},zR:function(){return u}});var r=n(68673),a=n(99559),s=n(62408),i=n(30120);function u(e,t){return h(e?.parseTree,t,e?.parameters)}function l(e,t,n){return h(e,t,n)}function o(e,t,n,s){return a.WhereClause.create(h(e.parseTree,r.Bj.Standardised,e.parameters,t,n),s)}function c(e,t,n="AND"){return a.WhereClause.create("(("+u(e,r.Bj.Standardised)+")"+n+"("+u(t,r.Bj.Standardised)+"))",e.fieldsIndex)}function h(e,t,n,r=null,a=null){let i,u,l,o;switch(e.type){case"interval":return I(h(e.value,t,n,r,a),e.qualifier,e.op);case"case-expression":{let s=" CASE ";"simple"===e.format&&(s+=h(e.operand,t,n,r,a));for(let i=0;i<e.clauses.length;i++)s+=" WHEN "+h(e.clauses[i].operand,t,n,r,a)+" THEN "+h(e.clauses[i].value,t,n,r,a);return null!==e.else&&(s+=" ELSE "+h(e.else,t,n,r,a)),s+=" END "}case"parameter":{let r=n[e.value.toLowerCase()];if("string"==typeof r)return"'"+n[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'";if(r instanceof Date)return f(r,t);if(r instanceof Array){let e=[];for(let n=0;n<r.length;n++)"string"==typeof r[n]?e.push("'"+r[n].toString().replace(/'/g,"''")+"'"):r[n]instanceof Date?e.push(f(r[n],t)):e.push(r[n].toString());return e}return r.toString()}case"expression-list":for(let s of(u=[],e.value))u.push(h(s,t,n,r,a));return u;case"unary-expression":return" ( NOT "+h(e.expr,t,n,r,a)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+h(e.left,t,n,r,a)+" AND "+h(e.right,t,n,r,a)+") ";case"OR":return" ("+h(e.left,t,n,r,a)+" OR "+h(e.right,t,n,r,a)+") ";case"IS":if("null"!==e.right.type)throw new s.eS(s.f.UnsupportedIsRhs);return" ("+h(e.left,t,n,r,a)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new s.eS(s.f.UnsupportedIsRhs);return" ("+h(e.left,t,n,r,a)+" IS NOT NULL )";case"IN":return i=[],"expression-list"===e.right.type?(i=h(e.right,t,n,r,a)," ("+h(e.left,t,n,r,a)+" IN ("+i.join(",")+")) "):(o=h(e.right,t,n,r,a))instanceof Array?" ("+h(e.left,t,n,r,a)+" IN ("+o.join(",")+")) ":" ("+h(e.left,t,n,r,a)+" IN ("+o+")) ";case"NOT IN":return i=[],"expression-list"===e.right.type?(i=h(e.right,t,n,r,a)," ("+h(e.left,t,n,r,a)+" NOT IN ("+i.join(",")+")) "):(o=h(e.right,t,n,r,a))instanceof Array?" ("+h(e.left,t,n,r,a)+" NOT IN ("+o.join(",")+")) ":" ("+h(e.left,t,n,r,a)+" NOT IN ("+o+")) ";case"BETWEEN":return l=h(e.right,t,n,r,a)," ("+h(e.left,t,n,r,a)+" BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"NOTBETWEEN":return l=h(e.right,t,n,r,a)," ("+h(e.left,t,n,r,a)+" NOT BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"LIKE":return""!==e.escape?" ("+h(e.left,t,n,r,a)+" LIKE "+h(e.right,t,n,r,a)+" ESCAPE '"+e.escape+"') ":" ("+h(e.left,t,n,r,a)+" LIKE "+h(e.right,t,n,r,a)+") ";case"NOT LIKE":return""!==e.escape?" ("+h(e.left,t,n,r,a)+" NOT LIKE "+h(e.right,t,n,r,a)+" ESCAPE '"+e.escape+"') ":" ("+h(e.left,t,n,r,a)+" NOT LIKE "+h(e.right,t,n,r,a)+") ";case"<>":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+h(e.left,t,n,r,a)+" "+e.operator+" "+h(e.right,t,n,r,a)+") "}throw new s.eS(s.f.UnsupportedOperator,{operator:e.operator});case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return f(e.value,t);case"number":return e.value.toString();case"current-time":return p("date"===e.mode,t);case"column-reference":return r&&r.toLowerCase()===e.column.toLowerCase()?"("+a+")":e.column;case"function":{let s=h(e.args,t,n,r,a);return d(e.name,s,t)}}throw new s.eS(s.f.UnsupportedSyntax,{node:e.type})}function d(e,t,n){switch(e.toLowerCase().trim()){case"abs":if(1!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"abs"});return"abs("+t[0]+")";case"ceiling":case"ceil":if(1!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"ceiling"});switch(n){case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:}return"CEILING("+t[0]+")";case"floor":if(1!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"floor"});return"FLOOR("+t[0]+")";case"log":if(1!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"log"});return"LOG("+t[0]+")";case"log10":if(1!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"log10"});return"LOG10("+t[0]+")";case"power":if(2!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"power"});return"POWER("+t[0]+","+t[1]+")";case"round":if(2===t.length)return"ROUND("+t[0]+","+t[1]+")";if(1===t.length)return"ROUND("+t[0]+")";throw new s.eS(s.f.InvalidFunctionParameters,{function:"round"});case"truncate":if(t.length<1||t.length>2)throw new s.eS(s.f.InvalidFunctionParameters,{function:"truncate"});return n===r.Bj.SqlServer?"ROUND("+t[0]+(1===t.length?"0":","+t[1])+",1)":"TRUNCATE("+t[0]+(1===t.length?")":","+t[1]+")");case"char_length":case"len":if(1!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"char_length"});switch(n){case r.Bj.SqlServer:return"LEN("+t[0]+")";case r.Bj.Oracle:return"LENGTH("+t[0]+")";default:return"CHAR_LENGTH("+t[0]+")"}case"concat":if(t.length<1)throw new s.eS(s.f.InvalidFunctionParameters,{function:"concat"});{let e="CONCAT(";for(let n=0;n<t.length;n++)0!==n&&(e+=","),e+=t[n];return e+")"}case"lower":case"lcase":if(1!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"lower"});return"LOWER("+t[0]+")";case"upper":case"ucase":if(1!==t.length)throw new s.eS(s.f.InvalidFunctionParameters,{function:"upper"});return"UPPER("+t[0]+")";case"substring":{let e="";switch(n){case r.Bj.Oracle:return e="SUBSTR("+t[0]+","+t[1],3===t.length&&(e+=","+t[2]),e+=")";case r.Bj.SqlServer:return 3===t.length?"SUBSTRING("+t[0]+","+t[1]+","+t[2]+")":"SUBSTRING("+t[0]+", "+t[1]+", LEN("+t[0]+") - "+t[1]+")";default:return e="SUBSTRING("+t[0]+" FROM "+t[1],3===t.length&&(e+=" FOR "+t[2]),e+=")"}}case"extract":return"EXTRACT("+t[0].replace(/\'/g,"")+" FROM "+t[1]+")"}throw new s.eS(s.f.InvalidFunctionParameters,{function:e})}function f(e,t){let n=e instanceof Date?i.ou.fromJSDate(e):i.ou.fromSQL(e),a=0===n.hour&&0===n.minute&&0===n.second&&0===n.millisecond;switch(t){case r.Bj.FILEGDB:case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:return a?`date '${n.toFormat("yyyy-LL-dd")}'`:`date '${n.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case r.Bj.Oracle:return a?`TO_DATE('${n.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${n.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case r.Bj.SqlServer:return`'${n.toFormat(a?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case r.Bj.PGDB:return`#${n.toFormat(a?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case r.Bj.Postgres:return`TIMESTAMP '${n.toFormat(a?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`date '${n.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}function p(e,t){switch(t){case r.Bj.FILEGDB:case r.Bj.Standardised:case r.Bj.StandardisedNoInterval:case r.Bj.Oracle:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP";case r.Bj.SqlServer:return e?"CAST(GETDATE() AS DATE)":"GETDATE()";case r.Bj.PGDB:case r.Bj.Postgres:default:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP"}}function _(e,t,n={}){let r={},a={},i={esriFieldTypeSmallInteger:"integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"double",esriFieldTypeDouble:"double",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"integer",oid:"integer",long:"integer","small-integer":"integer",integer:"integer",single:"double",double:"double",date:"date",string:"string"};for(let e of t){let t=e.type?i[e.type]:void 0;r[e.name.toLowerCase()]=void 0===t?"":t}for(let e in n){let t=i[n[e]];a[e.toLowerCase()]=void 0===t?"":t}switch(function e(t,n,r,a){let i;switch(n.type){case"interval":return"integer";case"case-expression":{let s=[];if("simple"===n.format){for(let i=0;i<n.clauses.length;i++)s.push(e(t,n.clauses[i].value,r,a));null!==n.else&&s.push(e(t,n.else,r,a))}else{for(let i=0;i<n.clauses.length;i++)s.push(e(t,n.else,r,a));null!==n.else&&s.push(e(t,n.else,r,a))}return m(s)}case"parameter":{let e=a[n.value.toLowerCase()];if(void 0===e&&r){let e=r[n.value.toLowerCase()];if(null==e)return"";if("string"==typeof e||e instanceof String)return"string";if("boolean"==typeof e)return"boolean";if(e instanceof Date)return"date";if("number"==typeof e)return e%1==0?"integer":"double"}return void 0===e?"":e}case"expression-list":{let s=[];for(let i of n.value)s.push(e(t,i,r,a));return s}case"unary-expression":return"boolean";case"binary-expression":switch(n.operator){case"AND":case"OR":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if("null"!==n.right.type)throw new s.eS(s.f.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return m([e(t,n.left,r,a),e(t,n.right,r,a)]);default:throw new s.eS(s.f.UnsupportedOperator,{operator:n.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return null===n.value?"":n.value%1==0?"integer":"double";case"date":case"timestamp":case"current-time":return"date";case"column-reference":{let e=t[n.column.toLowerCase()];return void 0===e?"":e}case"function":switch(n.name.toLowerCase()){case"position":case"extract":case"char_length":return"integer";case"round":return(i=e(t,n.args,r,a))instanceof Array?i.length>0?i[0]:"":i;case"sign":return(i=e(t,n.args,r,a))instanceof Array&&(i=m(i)),"integer"===i||"double"===i?i:"double";case"ceiling":case"floor":case"abs":{let s=e(t,n.args,r,a);return s instanceof Array?m(s):s}case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"power":case"truncate":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string"}return""}throw new s.eS(s.f.UnsupportedSyntax,{node:n.type})}(r,e.parseTree,e.parameters,a)){case"double":return"double";case"integer":return"integer";case"date":return"date";case"string":return"string"}return""}let g={boolean:1,string:2,integer:3,double:4,date:5};function m(e){if(e){let t="";for(let n of e)""!==n&&(t=""===t||g[t]<g[n]?n:t);return t}return""}function y(e,t){return function e(t,n){if(null==t)return!1;switch(t.type){case"when-clause":return e(t.operand,n)||e(t.value,n);case"case-expression":for(let r of t.clauses)if(e(r,n))return!0;return!("simple"!==t.format||!e(t.operand,n))||!(null===t.else||!e(t.else,n));case"parameter":case"null":case"boolean":case"date":case"timestamp":case"string":case"number":break;case"expression-list":for(let r of t.value)if(e(r,n))return!0;break;case"unary-expression":return e(t.expr,n);case"binary-expression":return e(t.left,n)||e(t.right,n);case"column-reference":return n.toLowerCase()===t.column.toLowerCase();case"function":return e(t.args,n)}return!1}(e.parseTree,t)}function S(e){return"column-reference"===e?.parseTree.type}function w(e){return""+e.period.toUpperCase()}function I(e,t,n){return"INTERVAL "+n+" "+e+" "+("interval-period"===t.type?w(t):w(t.start)+" TO "+w(t.end))}},75718:function(e,t,n){n.d(t,{CA:function(){return _},EB:function(){return w},Fp:function(){return f},J6:function(){return p},QX:function(){return y},Sm:function(){return m},VV:function(){return d},g3:function(){return c},m:function(){return g},tj:function(){return h}});var r=n(62408),a=n(68673),s=n(62294);function i(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}function u(e){let t=i(e),n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/e.length}function l(e){let t=i(e),n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/(e.length-1)}function o(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function c(e){switch(e.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function h(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return function(e,t){let n=[],r={},s=[];for(let i=0;i<e.length;i++){if(void 0!==e[i]&&null!==e[i]){let t=e[i];if((0,a.hj)(t)||(0,a.HD)(t))void 0===r[t]&&(n.push(t),r[t]=1);else{let e=!1;for(let n=0;n<s.length;n++)!0===(0,a.tt)(s[n],t)&&(e=!0);!1===e&&(s.push(t),n.push(t))}}if(n.length>=t&&-1!==t)break}return n}(t,n);case"avg":case"mean":return i(t);case"min":return Math.min.apply(Math,t);case"sum":return o(t);case"max":return Math.max.apply(Math,t);case"stdev":case"stddev":return Math.sqrt(u(t));case"var":case"variance":return u(t);case"count":return t.length}return 0}async function d(e,t,n){let r=await S(e,t,n,!0);return 0===r.length?null:Math.min.apply(Math,r)}async function f(e,t,n){let r=await S(e,t,n,!0);return 0===r.length?null:Math.max.apply(Math,r)}async function p(e,t,n){var r;let a="";t&&!(0,s.y5)(t)&&(a=(0,s.DT)(t,e.fields));let u=await S(e,t,n,!0);if(0===u.length)return null;let l=i(u);return null===l?l:"integer"===a?isFinite(r=+(r=l))?r-r%1||(r<0?-0:0===r?r:0):r:l}async function _(e,t,n){let r=await S(e,t,n,!0);return 0===r.length?null:l(r)}async function g(e,t,n){let r=await S(e,t,n,!0);return 0===r.length?null:Math.sqrt(l(r))}async function m(e,t,n){let r=await S(e,t,n,!0);return 0===r.length?null:o(r)}async function y(e,t){return e.iterator(t).count()}async function S(e,t,n,a=!1){let s=e.iterator(n),i=[],u={ticker:0},l=await s.next();for(;null!==l;){if(u.ticker++,n.aborted)throw new r.EN(r.H9.Cancelled);u.ticker%100==0&&(u.ticker=0,await new Promise(e=>{setTimeout(e,0)}));let e=t?.calculateValue(l);null===e?!1===a&&(i[i.length]=e):i[i.length]=e,l=await s.next()}return i}async function w(e,t,n=1e3,a=null){let s=e.iterator(a),i=[],u={},l={ticker:0},o=await s.next();for(;null!==o;){if(l.ticker++,a&&a.aborted)throw new r.EN(r.H9.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(e=>{setTimeout(e,0)}));let e=t?.calculateValue(o);if(null!=e&&void 0===u[e]&&(i.push(e),u[e]=1),i.length>=n&&-1!==n)break;o=await s.next()}return i}},15917:function(e,t,n){let r;n.d(t,{CJ:function(){return U},Cz:function(){return k},D$:function(){return A},ED:function(){return S},G0:function(){return N},Gg:function(){return F},JI:function(){return b},LV:function(){return I},Nm:function(){return w},Sp:function(){return E},TE:function(){return p},U1:function(){return C},W4:function(){return m},Y4:function(){return O},cv:function(){return x},e5:function(){return v},f3:function(){return D},fS:function(){return _},j2:function(){return L},jU:function(){return f},kK:function(){return g},kQ:function(){return G},og:function(){return T},oq:function(){return c},r3:function(){return d},rd:function(){return P},sz:function(){return B},uh:function(){return y},wf:function(){return R},z7:function(){return h}}),n(91957);var a=n(76061);n(70909);var s=n(53736);function i(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function u(e){return Array.isArray(e)?e.map(e=>(0,s.im)(e)):(0,s.im)(e)}async function l(){return r||(r=(0,a.bA)("geometryEngineWorker",{strategy:"distributed"})),r}async function o(e,t){return(await l()).invoke("executeGEOperation",{operation:e,parameters:function e(t){return t?Array.isArray(t)?t.map(e):t.toJSON?t.toJSON():t:t}(t)})}async function c(e,t){return u(await o("clip",[i(e),e,t]))}async function h(e,t){return u(await o("cut",[i(e),e,t]))}function d(e,t){return o("contains",[i(e),e,t])}function f(e,t){return o("crosses",[i(e),e,t])}function p(e,t,n){return o("distance",[i(e),e,t,n])}function _(e,t){return o("equals",[i(e),e,t])}function g(e,t){return o("intersects",[i(e),e,t])}function m(e,t){return o("touches",[i(e),e,t])}function y(e,t){return o("within",[i(e),e,t])}function S(e,t){return o("disjoint",[i(e),e,t])}function w(e,t){return o("overlaps",[i(e),e,t])}function I(e,t,n){return o("relate",[i(e),e,t,n])}function F(e){return o("isSimple",[i(e),e])}async function T(e){return u(await o("simplify",[i(e),e]))}async function b(e,t=!1){return u(await o("convexHull",[i(e),e,t]))}async function v(e,t){return u(await o("difference",[i(e),e,t]))}async f
1unction E(e,t){return u(await o("symmetricDifference",[i(e),e,t]))}async function R(e,t){return u(await o("intersect",[i(e),e,t]))}async function N(e,t=null){let n;let r=(Array.isArray(e)?n=e:((n=[]).push(e),null!=t&&n.push(t)),n);return u(await o("union",[i(r),r]))}async function x(e,t,n,r,a,s){return u(await o("offset",[i(e),e,t,n,r,a,s]))}async function D(e,t,n,r=!1){let a=[i(e),e,t,n,r];return u(await o("buffer",a))}async function P(e,t,n,r,a,s){let l=[i(e),e,t,n,r,a,s];return u(await o("geodesicBuffer",l))}async function C(e,t,n){if(null==e)throw new j;let r=e.spatialReference;if(null==(n=n??("xmin"in e?e.center:"x"in e?e:e.extent?.center)))throw new j;let a=e.constructor.fromJSON(await o("rotate",[r,e,t,n]));return a.spatialReference=r,a}async function A(e,t,n,r){return u(await o("generalize",[i(e),e,t,n,r]))}async function k(e,t,n){return u(await o("densify",[i(e),e,t,n]))}async function L(e,t,n,r=0){return u(await o("geodesicDensify",[i(e),e,t,n,r]))}function U(e,t){return o("planarArea",[i(e),e,t])}function B(e,t){return o("planarLength",[i(e),e,t])}function O(e,t,n){return o("geodesicArea",[i(e),e,t,n])}function G(e,t,n){return o("geodesicLength",[i(e),e,t,n])}class j extends Error{constructor(){super("Illegal Argument Exception")}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.