@arcgis/core 4.29.7 → 4.29.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4984e2b79d862114d6a6.js → 1a8d56e01ddfec2257c3.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8ac511280f873960d46.js → 1dc474a28d5ddac1a4b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{3afb525a131b6841276b.js → 1e4d779a884f13762601.js} +1 -1
- package/assets/esri/core/workers/chunks/{2447a4d5886aeb0ff72a.js → 205597cd91cb7ff3d2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c50daccd84ba5545bfe.js → 22ebdec0867e44d8d58c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc5ac713872766571e07.js → 31c065746e53f7518c17.js} +1 -1
- package/assets/esri/core/workers/chunks/{da4616b02dd0c3dd3d5d.js → 321547d796a2ecd72ab4.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c3ae96ec90e9ed7dd50.js → 32be478638e9e643ea32.js} +1 -1
- package/assets/esri/core/workers/chunks/{c556644bb0cf88770939.js → 413978b96c88d5ff01ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{a61f337802ae963d7f65.js → 59f03847a9eb96e5f65c.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a98d2e026f63a581b1e.js → 5b08309b184f5d8345a0.js} +1 -1
- package/assets/esri/core/workers/chunks/{8225febaf0a412f4cee4.js → 5e4465448b2728cafab0.js} +1 -1
- package/assets/esri/core/workers/chunks/6301990e489d31596bc8.js +1 -0
- package/assets/esri/core/workers/chunks/631bda7b99a27f4453c1.js +1 -0
- package/assets/esri/core/workers/chunks/{c527692694688a5b3b07.js → 658a8ee9a4f24bc03f7f.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/99ac2a6a5be0604ee4c2.js +1 -0
- package/assets/esri/core/workers/chunks/{2433b39624a7e274cb98.js → b4c41a8244b7371e864e.js} +1 -1
- package/assets/esri/core/workers/chunks/{48db6e0bbb1a9c043193.js → b7a78246d25dc07f173d.js} +1 -1
- package/assets/esri/core/workers/chunks/{60ab18c6a04d4b2f1d4c.js → bb05528d2ca12c57a031.js} +1 -1
- package/assets/esri/core/workers/chunks/{b42a83db83851cb57d44.js → bed684a8d38fa7ac5eb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{5227f9eea6988aadad7f.js → cf0dc0ccbeaf9458de6e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f59b5ea05caca8a1a398.js → d40408be9bbcb0021d18.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/chunks/Laserlines.glsl.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/vec32.js +1 -1
- package/chunks/vec42.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +5 -5
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- 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
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/makeScheduleFunction.js +5 -0
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/global/ZoomController.js +1 -1
- package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomSphericalMomentumController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/geometryUtils/sphere.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/assets/esri/core/workers/chunks/967812e66fef41febb98.js +0 -1
- package/assets/esri/core/workers/chunks/a28b7d868346e13468bb.js +0 -1
- package/assets/esri/core/workers/chunks/ccd53b81c2688dd11584.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1512,988],{10724:(e,t,s)=>{s.d(t,{Ql:()=>h,YX:()=>d});var i,r=s(88264),n=s(75824),a=s(39452);(i||(i={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const o={[i.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class l extends Error{constructor(e,t){super((0,r.qq)(o[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,l)}}function u(e,t,s){return e<t?e-t:e>s?e-s:0}function c(e,t,s){return e<t?t:e>s?s:e}class h{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,i=0,r=0,n=0,o=0,l){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(i)||isNaN(r)||isNaN(n)||isNaN(o))return null;const m=a.CS.local(e,t).daysInMonth;let f=a.CS.fromObject({day:c(s,1,m),year:e,month:c(t,1,12),hour:c(i,0,23),minute:c(r,0,59),second:c(n,0,59),millisecond:c(o,0,999)},{zone:d(l)});return f=f.plus({months:u(t,1,12),days:u(s,1,m),hours:u(i,0,23),minutes:u(r,0,59),seconds:u(n,0,59),milliseconds:u(o,0,999)}),new h(f)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=d(t);return e.isUnknownTimeZone||s===n.qG.instance?h.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new h(e._date.setZone(s))}static dateJSToArcadeDate(e){return new h(a.CS.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=d(t);return new h(a.CS.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new h(a.CS.fromMillis(e,{zone:n.qG.instance}))}static unknownDateJSToArcadeDate(e){return new h(a.CS.fromMillis(e.getTime(),{zone:n.qG.instance}))}static epochToArcadeDate(e,t="system"){const s=d(t);return new h(a.CS.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new h(e)}clone(){return new h(this._date)}changeTimeZone(e){const t=d(e);return h.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=d(t);return e.zone===n.qG.instance||s===n.qG.instance?h.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new h(e.setZone(s))}static nowToArcadeDate(e){const t=d(e);return new h(a.CS.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new h(a.CS.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===h.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===n.qG.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new h(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new h(this._date.toUTC())}toLocal(){return new h(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=a.CS.fromISO(e,{setZone:!0});return new h(t)}}function d(e,t=!0){if(e instanceof a.C)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return n.qG.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const t=a.Kq.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}const s=a._C.create(e);if(!s.isValid){if(t)throw new l(i.TimeZoneNotRecognized);return null}return s}},98412:(e,t,s)=>{s.d(t,{ID:()=>a,Oo:()=>r,SK:()=>n,SW:()=>o,md:()=>l});var i=s(95247);function r(e){if(null==e)return null;if("number"==typeof e)return e;let t=e.toLowerCase();switch(t=t.replaceAll(/\s/g,""),t=t.replaceAll("-",""),t){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function n(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new i.c({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function a(e){if(null==e)return null;if("number"==typeof e)return e;let t=e.toLowerCase();switch(t=t.replaceAll(/\s/g,""),t=t.replaceAll("-",""),t){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function o(e){if(null==e)return null;const t=e.clone();return void 0!==e.cache._geVersion&&(t.cache._geVersion=e.cache._geVersion),t}function l(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},85304:(e,t,s)=>{s.d(t,{q:()=>l});var i,r,n,a=s(8528),o={exports:{}};i=o,r=function(){function e(s,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,l=i-r+1,u=Math.log(o),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);e(s,i,Math.max(r,Math.floor(i-l*c/o+h)),Math.min(n,Math.floor(i+(o-l)*c/o+h)),a)}var d=s[i],m=r,f=n;for(t(s,r,i),a(s[n],d)>0&&t(s,r,n);m<f;){for(t(s,m,f),m++,f--;a(s[m],d)<0;)m++;for(;a(s[f],d)>0;)f--}0===a(s[r],d)?t(s,r,f):t(s,++f,n),f<=i&&(r=f+1),i<=f&&(n=f-1)}}function t(e,t,s){var i=e[t];e[t]=e[s],e[s]=i}function s(e,t){return e<t?-1:e>t?1:0}return function(t,i,r,n,a){e(t,i,r||0,n||t.length-1,a||s)}},void 0!==(n=r())&&(i.exports=n);const l=(0,a.g)(o.exports)},52888:(e,t,s)=>{s.d(t,{O:()=>o});var i=s(62088),r=s(67432),n=s(9592);class a{constructor(e,t){this._observable=new n.n,this._value=e,this._equalityFunction=t}get value(){return(0,r.am)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=i.YT){return new a(e,t)}},85436:(e,t,s)=>{s.d(t,{K:()=>o});var i=s(10724),r=s(89960),n=s(39452);function a(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let t="";const s=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const i of e.match(s)||[])switch(i){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=i;break;default:i.length>=2&&"["===i.slice(0,1)&&"]"===i.slice(-1)?t+=`'${i.slice(1,-1)}'`:t+=`'${i}'`}return t}class o{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof o&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new o(this._year,this._month,this._day)}toDateTime(e){return n.CS.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,i.YX)(e)})}toDateTimeLuxon(e){return n.CS.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,i.YX)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=a(e)),!e)return"";const s=this.toDateTime("unknown");return i.Ql.dateTimeToArcadeDate(s).toFormat(e,{locale:(0,r.a8)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return i.Ql.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return o.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return n.CS.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=n.CS.fromMillis(e,{zone:n.Kq.utcInstance});return t.isValid?o.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=n.CS.fromSeconds(e,{zone:n.Kq.utcInstance});return t.isValid?o.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return 3!==t.length?null:new o(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const i=new o(e,t,s);return!1===i.isValid?null:i}static fromDateJS(e){return o.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return o.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const s=[];if(t)(t=a(t))&&s.push(t);else if(null===t||""===t){const t=n.CS.fromISO(e,{setZone:!0});return t.isValid?o.fromParts(t.year,t.month,t.day):null}for(const i of s){const s=n.CS.fromFormat(e,t??i);if(s.isValid)return new o(s.year,s.month,s.day)}return null}static fromNow(e="system"){const t=n.CS.fromJSDate(new Date).setZone((0,i.YX)(e));return new o(t.year,t.month,t.day)}}},62024:(e,t,s)=>{s.d(t,{C:()=>o});var i=s(98412),r=s(89960),n=s(39452);function a(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let s="";for(const i of e.match(t)||[])switch(i){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":s+=i;break;case"A":case"a":s+="a";break;default:s+=`'${i}'`}return s}class o{constructor(e,t,s,i){this._hour=e,this._minute=t,this._second=s,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof o&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new o(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,i.md)(this.hour)&&(0,i.md)(this.minute)&&(0,i.md)(this.second)&&(0,i.md)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=a(e))?n.CS.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,r.a8)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,i){const r=new o(e,t,s,i);return r.isValid()?r:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new o(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),i=Math.floor(e/36e5%24),r=Math.floor(e%1e3);return new o(i,s,t,r)}static fromDateJS(e){return new o(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new o(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const s=[];t?(t=a(t))&&s.push(t):null!==t&&""!==t||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const t of s){const s=n.CS.fromFormat(e,t);if(s.isValid)return new o(s.hour,s.minute,s.second,s.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return o.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return n.CS.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},75824:(e,t,s)=>{s.d(t,{Md:()=>n,m0:()=>a,qG:()=>r});var i=s(39452);class r{}function n(e){return e instanceof i.C?e===r.instance:"unknown"===e?.toString().toLowerCase()}function a(e){return n(e)?r.instance:e}r.instance=new i._C("Etc/UTC")},3452:(e,t,s)=>{s.d(t,{O:()=>i});const i={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,s){const i=new r(e.getPointX(t),e.getPointY(t),s),n=e.hasZ(t),a=e.hasM(t);return n&&(i.z=e.getPointZ(t)),a&&(i.m=e.getPointM(t)),i},exportPolygon:function(e,t,s){return new n(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,s){return new a(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,s){return new o(e.exportPoints(t),s,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,s){const i=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),s);if(i){const s=e.getZExtent(t);n.zmin=s.vmin,n.zmax=s.vmax}if(r){const s=e.getMExtent(t);n.mmin=s.vmin,n.mmax=s.vmax}return n}};class r{constructor(e,t,s){this.x=e,this.y=t,this.spatialReference=s,this.z=void 0,this.m=void 0}}class n{constructor(e,t,s,i){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class a{constructor(e,t,s,i){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class o{constructor(e,t,s,i){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class l{constructor(e,t,s,i,r){this.xmin=e,this.ymin=t,this.xmax=s,this.ymax=i,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},77048:(e,t,s)=>{s.d(t,{C6:()=>h,FZ:()=>f,K:()=>T,K8:()=>l,MZ:()=>o,Qv:()=>y,Su:()=>r,UN:()=>S,WK:()=>n,WO:()=>m,WU:()=>a,eC:()=>c,is:()=>p,mK:()=>d,qe:()=>u,qy:()=>g,yK:()=>_});var i=s(95247);function r(e=S){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function n(e,t,s,i,n,a,o=r()){return o[0]=e,o[1]=t,o[2]=s,o[3]=i,o[4]=n,o[5]=a,o}function a(e,t){const s=isFinite(e[2])||isFinite(e[5]);return new i.c(s?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function o(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function u(e,t,s=0,i=t.length/3){let r=e[0],n=e[1],a=e[2],o=e[3],l=e[4],u=e[5];for(let e=0;e<i;e++)r=Math.min(r,t[s+3*e]),n=Math.min(n,t[s+3*e+1]),a=Math.min(a,t[s+3*e+2]),o=Math.max(o,t[s+3*e]),l=Math.max(l,t[s+3*e+1]),u=Math.max(u,t[s+3*e+2]);e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=l,e[5]=u}function c(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function h(e,t,s=e){return s[0]=t[0],s[1]=t[1],s[2]=t[2],s!==e&&(s[3]=e[3],s[4]=e[4],s[5]=e[5]),s}function d(e,t,s=e){return s[3]=t[0],s[4]=t[1],s[5]=t[2],s!==e&&(s[0]=e[0],s[1]=e[1],s[2]=e[2]),e}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function f(e){return e?m(e,T):r(T)}function y(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function g(e,t,s,i,r){return e[0]=t,e[1]=s,e[2]=Number.NEGATIVE_INFINITY,e[3]=i,e[4]=r,e[5]=Number.POSITIVE_INFINITY,e}function p(e){return 6===e.length}function _(e,t,s){if(null==e||null==t)return e===t;if(!p(e)||!p(t))return!1;if(s){for(let i=0;i<e.length;i++)if(!s(e[i],t[i]))return!1}else for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}s(83372);const T=[1/0,1/0,1/0,-1/0,-1/0,-1/0],S=[0,0,0,0,0,0];r()},34888:(e,t,s)=>{s.d(t,{ED:()=>r,_M:()=>i});class i{constructor(e=null,t={},s,i){this.geometry=e,this.attributes=t,this.centroid=s,this.objectId=i,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new i(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}clone(){const e=this.geometry?.clone(),t=new i(e,{...this.attributes},this.centroid?.clone(),this.objectId);return t.displayId=this.displayId,t.geohashX=this.geohashX,t.geohashY=this.geohashY,t}}function r(e){return!!e.geometry?.coords?.length}},90412:(e,t,s)=>{s.d(t,{c:()=>i});class i{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new i;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},85152:(e,t,s)=>{s.d(t,{c:()=>i});class i{constructor(e=[],t=[],s=!1){this.lengths=e??[],this.coords=t??[],this.hasIndeterminateRingOrder=s}static fromRect(e){const[t,s,r,n]=e,a=r-t,o=n-s;return new i([5],[t,s,a,0,0,o,-a,0,0,-o])}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let s=0;s<this.lengths.length;s++){const i=this.lengths[s];for(let s=0;s<i;s++)e(this.coords[2*(s+t)],this.coords[2*(s+t)+1]);t+=i}}deltaDecode(){const e=this.clone(),{coords:t,lengths:s}=e;let i=0;for(const e of s){for(let s=1;s<e;s++)t[2*(i+s)]+=t[2*(i+s)-2],t[2*(i+s)+1]+=t[2*(i+s)-1];i+=e}return e}clone(e){if(0===this.lengths.length)return new i([],[this.coords[0],this.coords[1]]);const t=2*(0===this.lengths.length?1:this.lengths.reduce(((e,t)=>e+t))),s=this.coords.slice(0,t);return e?(e.set(s),new i(this.lengths,e,this.hasIndeterminateRingOrder)):new i(Array.from(this.lengths),Array.from(s),this.hasIndeterminateRingOrder)}}},47302:(e,t,s)=>{s.d(t,{U:()=>Ue});var i=s(92400),r=s(20744),n=s(40504),a=s(62088),o=s(70680),l=s(74452),u=s(10860),c=s(24296),h=s(60074),d=s(77048),m=s(83372),f=s(33008),y=s(6704),g=s(20480),p=s(60544),_=s(97088),T=s(11004),S=s(63220),I=s(36408);const x=new class{constructor(e,t){this._cache=new T.o(e),this._invalidCache=new T.o(t)}get(e,t){const s=`${t.uid}:${e}`,i=this._cache.get(s);if(i)return i;if(null!=this._invalidCache.get(s))return null;try{const i=S.WhereClause.create(e,t);return this._cache.put(s,i),i}catch(e){return this._invalidCache.put(s,e),null}}getError(e,t){const s=`${t.uid}:${e}`;return this._invalidCache.get(s)??null}}(50,500),F="unsupported-query",w=" as ",E=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),R=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),b=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...E,...R]);function N(e,t,s={}){const i=M(t,e);if(!i){const s=x.getError(t,e);throw new r.c(F,"invalid SQL expression",{expression:t,error:s})}const n=s.expressionName||"expression";if(s.validateStandardized&&!i.isStandardized)throw new r.c(F,`${n} is not standard`,{expression:t});if(s.validateAggregate&&!i.isAggregate)throw new r.c(F,`${n} does not contain a valid aggregate function`,{expression:t});return i.fieldNames}function C(e,t,s,i,n){if(!s)return!0;const a="having clause",o=N(e,s,{validateAggregate:!0,expressionName:a});D(e,t,o,{expressionName:a,query:n});const l=M(s,e),u=l?.getExpressions().every((t=>{const{aggregateType:s,field:r}=t,n=e.get(r)?.name;return i.some((t=>{const{onStatisticField:i,statisticType:r}=t,a=e.get(i)?.name;return a===n&&r.toLowerCase().trim()===s}))}));if(!u)throw new r.c(F,"expressions in having clause should also exist in outStatistics",{having:s});return!0}function M(e,t){return e?x.get(e,t):null}function A(e){return/\((.*?)\)/.test(e)?e:e.split(w)[0]}function v(e){return e.split(w)[1]}function D(e,t,s,i={}){const n=new Map;if(function(e,t,s,i,r){const n=r.includes("*")?[...s,...r.filter((e=>"*"!==e))]:r;for(const r of n)if(t.get(r))O(e,t,s,i,r);else try{const n=N(t,A(r),{validateStandardized:!0});for(const r of n)O(e,t,s,i,r)}catch(t){e.set(r,{type:"expression-error",expression:r,error:t})}}(n,e,t,i.allowedFieldTypes??b,s),n.size){const e=i.expressionName??"expression";throw new r.c(F,`${e} contains invalid or missing fields`,{errors:Array.from(n.values()),query:i.query})}}function O(e,t,s,i,r){const n=t.get(r);n?s.has(n.name)?"all"!==i&&!1===i?.has(n.type)&&e.set(r,{type:"invalid-type",fieldName:n.name,fieldType:I.M.fromJSON(n.type),allowedFieldTypes:Array.from(i,(e=>I.M.fromJSON(e)))}):e.set(r,{type:"missing-field",fieldName:n.name}):e.set(r,{type:"invalid-field",fieldName:r})}var k=s(83624),P=s(7684),G=s(13136),U=s(95788),L=s(96784),q=s(42736),Z=s(564),V=s(41664),Q=s(76160),z=s(6384);class Y{constructor(e,t,s){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=s,this.featureAdapter=t;const i=e.outFields;if(i&&!i.includes("*")){this.outFields=i;let e=0;for(const t of i){const i=A(t),r=this.fieldsIndex.get(i),n=r?null:M(i,s),a=r?r.name:v(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,s){const i=s?s.name:t;let r=null;return this._fieldDataCache.has(i)?r=this._fieldDataCache.get(i)?.clause:s||(r=M(t,this.fieldsIndex),this._fieldDataCache.set(i,{alias:i,clause:r})),s?this.featureAdapter.getAttribute(e,i):r?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,s=!0){const i=t.normalizationType,r=t.normalizationTotal,n=this.fieldsIndex.get(t.field),a=(0,Z.yM)(n)||(0,Z.Oo)(n),o=(0,Z.eM)(n);return e.map((e=>{let n=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2?(n=`${(0,Q.O6)(n)}${t.fieldDelimiter}${(0,Q.O6)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(n=`${n}${t.fieldDelimiter}${(0,Q.O6)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)):"string"==typeof n&&s&&(a?n=n?new Date(n).getTime():null:o&&(n=n?(0,V.Mr)(n):null)),i&&Number.isFinite(n)){const s="field"===i&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;n=(0,Q.m2)(n,i,s,r)}return n}))}async getExpressionValues(e,t,s,i,r){const{arcadeUtils:n}=await(0,z.uK)(),a=n.hasGeometryOperations(t);a&&await n.enableGeometryOperations();const o=n.createFunction(t),l=n.getViewInfo(s),u={fields:this.fieldsIndex.fields};return e.map((e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:u,geometry:a?{...(0,k.uo)(i.geometryType,i.hasZ,i.hasM,this.featureAdapter.getGeometry(e)),spatialReference:s?.spatialReference}:null},c=n.createExecContext(t,l,r);return n.executeFunction(o,c)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:M(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:M(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const s={};for(const i of t){const{alias:t,clause:r}=this._fieldDataCache.get(i);s[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return s}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,s=[];if(t)for(const i of t){const{alias:t}=this._fieldDataCache.get(i);s.push(e[t])}else for(const t in e)s.push(e[t]);const i=`${(t||["*"]).join(",")}=${s.join(",")}`;let r=this._returnDistinctMap.get(i)||0;return this._returnDistinctMap.set(i,++r),r>1?null:e}}function j(e,t,s){return{objectId:e,target:t,distance:s,type:"vertex"}}function B(e,t,s,i,r,n=!1){return{objectId:e,target:t,distance:s,type:"edge",start:i,end:r,draped:n}}class ${constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new Y(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of i){const{statisticType:i}=r,l="exceedslimit"!==i?r.onStatisticField:void 0;if(!a.has(l)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,n);s.push(t)}a.set(l,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:i,items:r}=u[t],n=i.join(",");s&&!e.validateItems(r,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,p.U3)(this.query.outSR)&&!(0,p.yK)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,k.C6)({spatialReference:this.query.outSR,...(0,P.yU)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,k.C6)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=K(this.hasZ,this.hasM),{point:r,mode:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=this._getPointCreator(n,this.spatialReference,t),h=new W(null,0),d=new W(null,0),m={x:0,y:0,z:0};for(const t of this.items){const n=s.getGeometry(t);if(null==n)continue;const{coords:f,lengths:y}=n;if(h.coords=f,d.coords=f,e.returnEdge){let e=0;for(let n=0;n<y.length;n++){const u=y[n];for(let n=0;n<u;n++,e+=i){const f=h;if(f.coordsIndex=e,n!==u-1){const n=d;n.coordsIndex=e+i;const u=m;H(m,r,f,n);const h=(r.x-u.x)/a,y=(r.y-u.y)/o,g=h*h+y*y;g<=1&&l.candidates.push(B(s.getObjectId(t),c(u),Math.sqrt(g),c(f),c(n)))}}}}if("none"!==e.vertexMode){const n=u?f.length-i:f.length;if("all"===e.vertexMode)for(let e=0;e<n;e+=i){const i=h;i.coordsIndex=e;const n=(r.x-i.x)/a,u=(r.y-i.y)/o,d=n*n+u*u;d<=1&&l.candidates.push(j(s.getObjectId(t),c(i),Math.sqrt(d)))}else if("ends"===e.vertexMode){const e=[0];u||e.push(f.length-i);for(const i of e){const e=h;e.coordsIndex=i;const n=(r.x-e.x)/a,u=(r.y-e.y)/o,d=n*n+u*u;d<=1&&l.candidates.push(j(s.getObjectId(t),c(e),Math.sqrt(d)))}}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s){const i=null==s||(0,p.yK)(t,s)?e=>e:e=>(0,P.yU)(e,t,s),{hasZ:r}=this;return"3d"===e?r?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:0}):({x:e,y:t})=>i({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l,timeZone:u}=e,c=this.fieldsIndex.get(t),h=(0,Z.gp)(c)||(0,Z.yM)(c)||(0,Z.Oo)(c),d=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:l,timeZone:u}),m=(0,Q.uu)({normalizationType:r,normalizationField:i,minValue:a,maxValue:o}),f={value:.5,fieldType:c?.type},y=(0,Z.AZ)(c)?(0,Q.Qv)({values:d,supportsNullCount:m,percentileParams:f}):(0,Q.hU)({values:d,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:m,percentileParams:f});return(0,Q.Oq)(y,h)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:r,scale:n,timeZone:a}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n,timeZone:a},!1),l=(0,Q.o9)(o);return(0,Q.ID)(l,i,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:h,timeZone:d}=e,m=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h,timeZone:d}),f=(0,Q.wj)(m,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,Q.cJ)(f,a)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:h,timeZone:d}=e,m=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h,timeZone:d});return(0,Q.UP)(m,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const t=i.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,Q.rZ)(n?.type,a);e.sort(((e,t)=>{const i=s(e,r,n),a=s(t,r,n);return o(i,a)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:r,objectIdField:n,spatialReference:a}=this,{outFields:o,outSR:l,quantizationParameters:u,resultRecordCount:c,resultOffset:h,returnZ:d,returnM:m}=e,f=null!=c&&t.length>(h||0)+c,y=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:y,geometryType:s,hasM:i&&m,hasZ:r&&d,objectIdFieldName:n,spatialReference:(0,k.C6)(l||a),transform:u&&(0,q.eE)(u)||null}}_createFeatures(e,t){const s=new Y(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:r}=this,{orderByFields:n,quantizationParameters:a,returnGeometry:o,returnCentroid:l,maxAllowableOffset:u,resultOffset:c,resultRecordCount:h,returnZ:d=!1,returnM:m=!1}=e,f=r&&d,y=i&&m;let g=[],p=0;const _=[...t];if(this._sortFeatures(_,n,((e,t,i)=>s.getFieldValue(e,t,i))),this.geometryType&&(o||l)){const e=(0,q.eE)(a)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(o&&!l)for(const i of _){const r=this.featureAdapter.getGeometry(i),n={attributes:s.getAttributes(i),geometry:(0,k.uo)(this.geometryType,this.hasZ,this.hasM,r,u,e,f,y)};t&&r&&!n.geometry&&(n.centroid=(0,k.AT)(this,this.featureAdapter.getCentroid(i,this),e)),g[p++]=n}else if(!o&&l)for(const t of _)g[p++]={attributes:s.getAttributes(t),centroid:(0,k.AT)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of _)g[p++]={attributes:s.getAttributes(t),centroid:(0,k.AT)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,k.uo)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),u,e,f,y)}}else for(const e of _){const t=s.getAttributes(e);t&&(g[p++]={attributes:t})}const T=c||0;if(null!=h){const e=T+h;g=g.slice(T,Math.min(g.length,e))}return g}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(const t of e.outStatistics??[])if("exceedslimit"===t.statisticType){s=null!=t.maxPointCount?t.maxPointCount:Number.POSITIVE_INFINITY,i=null!=t.maxRecordCount?t.maxRecordCount:Number.POSITIVE_INFINITY,r=null!=t.maxVertexCount?t.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>i)t=!0;else{const e=K(this.hasZ,this.hasM),s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)}),0)/e>r}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,r=new Map,n=new Map,a=new Map,o=new Y(e,this.featureAdapter,this.fieldsIndex),l=e.outStatistics,{groupByFieldsForStatistics:u,having:c,orderByFields:h,resultRecordCount:d}=e,m=u?.length,f=!!m,y=f?u[0]:null,g=f&&!this.fieldsIndex.get(y);for(const e of l??[]){const{outStatisticFieldName:l,statisticType:h}=e,d=e,p="exceedslimit"!==h?e.onStatisticField:void 0,_="percentile_disc"===h||"percentile_cont"===h,T="EnvelopeAggregate"===h||"CentroidAggregate"===h||"ConvexHullAggregate"===h,S=f&&1===m&&(p===y||g)&&"count"===h;if(f){if(!n.has(p)){const e=[];for(const t of u){const s=this._getAttributeValues(o,t,i);e.push(s)}n.set(p,this._calculateUniqueValues(e,!T&&o.returnDistinctValues))}const e=n.get(p);if(!e)continue;const t=Object.keys(e);for(const s of t){const{count:t,data:r,items:n,itemPositions:h}=e[s],m=r.join(",");if(!c||o.validateItems(n,c)){const e=a.get(m)||{attributes:{}};if(T){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:s}=await this._getAggregateGeometry(d,n);e.aggregateGeometries[s]=t}else{let s=null;if(S)s=t;else{const e=this._getAttributeValues(o,p,i),t=h.map((t=>e[t]));s=_&&"statisticParameters"in d?this._getPercentileValue(d,t):this._getStatisticValue(d,t,null,o.returnDistinctValues)}e.attributes[l]=s}let s=0;u.forEach(((t,i)=>e.attributes[this.fieldsIndex.get(t)?t:"EXPR_"+ ++s]=r[i])),a.set(m,e)}}}else if(T){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(d,this.items);t.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(o,p,i);t.attributes[l]=_&&"statisticParameters"in d?this._getPercentileValue(d,e):this._getStatisticValue(d,e,r,o.returnDistinctValues)}const I="min"!==h&&"max"!==h||!(0,Z.AZ)(this.fieldsIndex.get(p))&&!this._isAnyDateField(p)?null:this.fieldsIndex.get(p)?.type;s.push({name:l,alias:l,type:I||"esriFieldTypeDouble"})}const p=f?Array.from(a.values()):[t];return this._sortFeatures(p,h,((e,t)=>e.attributes[t])),d&&(p.length=Math.min(d,p.length)),{fields:s,features:p}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return(0,Z.gp)(t)||(0,Z.yM)(t)||(0,Z.Oo)(t)||(0,Z.eM)(t)}async _getAggregateGeometry(e,t){const{convexHull:i,union:r}=await Promise.all([s.e(984),s.e(324)]).then(s.bind(s,82704)),{statisticType:n,outStatisticFieldName:a}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map((e=>(0,k.uo)(u,c,h,o.getGeometry(e)))),m=i(l,d,!0)[0],f={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===n){const e=m?(0,L.wt)(m):(0,L.GQ)(r(l,d));f.aggregateGeometries={...e,spatialReference:l},f.outStatisticFieldName=a||"extent"}else if("CentroidAggregate"===n){const e=m?(0,U.cv)(m):(0,U.MZ)((0,L.GQ)(r(l,d)));f.aggregateGeometries={x:e[0],y:e[1],spatialReference:l},f.outStatisticFieldName=a||"centroid"}else"ConvexHullAggregate"===n&&(f.aggregateGeometries=m,f.outStatisticFieldName=a||"convexHull");return f}_getStatisticValue(e,t,s,i){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=s?.has(r)?s.get(r):(0,Z.AZ)(this.fieldsIndex.get(r))||this._isAnyDateField(r)?(0,Q.Qv)({values:t,returnDistinct:i}):(0,Q.hU)({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:r}=e,{value:n,orderBy:a}=i,o=this.fieldsIndex.get(s);return(0,Q.GE)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),r=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,r),r}_calculateUniqueValues(e,t){const s={},i=this.items,r=i.length;for(let n=0;n<r;n++){const r=i[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(t||s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e,t=!0){const s=new Y(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:i,scale:r,timeZone:n}=e;return i?s.getExpressionValues(this.items,i,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},n):s.getDataValues(this.items,(0,a.ct)(e),t)}}function H(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,a=r*r+n*n,o=(t.x-s.x)*r+(t.y-s.y)*n,l=Math.min(1,Math.max(0,o/a));e.x=s.x+r*l,e.y=s.y+n*l}function K(e,t){return e?t?4:3:t?3:2}class W{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}var J=s(3900),X=s(79596);const ee="unsupported-query";async function te(e,{fieldsIndex:t,geometryType:s,spatialReference:i,availableFields:n}){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption&&"xyFootprint"!==e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.c(ee,"Unsupported query options",{query:e});return se(t,n,e),function(e,t,s){const{outStatistics:i,groupByFieldsForStatistics:n,having:a}=s,o=n?.length,l=i?.length;if(a){if(!o||!l)throw new r.c(ee,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:s});C(e,t,a,i,s)}if(l){if(!function(e){return null!=e&&e.every((e=>"exceedslimit"!==e.statisticType))}(i))return;const a=i.map((e=>e.onStatisticField)).filter(Boolean);D(e,t,a,{expressionName:"onStatisticFields",query:s}),o&&D(e,t,n,{expressionName:"groupByFieldsForStatistics",query:s});for(const n of i){const{onStatisticField:i,statisticType:a}=n;if("percentile_disc"!==a&&"percentile_cont"!==a||!("statisticParameters"in n))e.get(i)&&"count"!==a&&"min"!==a&&"max"!==a&&D(e,t,[i],{expressionName:`outStatistics with '${a}' statistic type`,allowedFieldTypes:ie,query:s});else{const{statisticParameters:e}=n;if(!e)throw new r.c(ee,"statisticParameters should be set for percentile type",{definition:n,query:s})}}}}(t,n,e),Promise.all([(0,X.a)(e,s,i),(0,P.Qv)(i,e.outSR)]).then((()=>e))}function se(e,t,s){const{outFields:i,orderByFields:n,returnDistinctValues:a,outStatistics:o}=s,l=o?o.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(n&&n.length>0){const i=" asc",r=" desc",a=n.map((e=>{const t=e.toLowerCase();return t.includes(i)?t.split(i)[0]:t.includes(r)?t.split(r)[0]:e})).filter((e=>!l.includes(e)));D(e,t,a,{expressionName:"orderByFields",query:s})}if(i&&i.length>0)D(e,t,i,{expressionName:"outFields",query:s,allowedFieldTypes:"all"});else if(a)throw new r.c(ee,"outFields should be specified for returnDistinctValues",{query:s});!function(e,t,s,i){if(!s)return!0;const r="where clause";D(e,t,N(e,s,{validateStandardized:!0,expressionName:r}),{expressionName:r,query:i})}(e,t,s.where,s)}const ie=new Set([...E,...R]);async function re(e,t,s,i){let n=[];if(s.valueExpression){const{arcadeUtils:e}=await(0,z.uK)();n=e.extractFieldNames(s.valueExpression)}if(s.field&&n.push(s.field),s.field2&&n.push(s.field2),s.field3&&n.push(s.field3),s.normalizationField&&n.push(s.normalizationField),!n.length&&!s.valueExpression)throw new r.c(ee,"field or valueExpression is required",{params:s});D(e,t,n,{expressionName:"statistics",query:i})}var ne=s(78104),ae=s(16424),oe=s(44980),le=(s(9456),s(66360)),ue=s(44916),ce=s(24680),he=s(57896),de=s(52888),me=s(82003);const fe=Symbol("Yield");class ye{constructor(){this._tasks=new Array,this._runningTasks=(0,de.O)(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(e){if(0===this.length)return fe;for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,s){return++this._runningTasks.value,new Promise(((i,r)=>this._tasks.push(new ge(i,r,e,t,s)))).finally((()=>--this._runningTasks.value))}unshift(e,t,s){return++this._runningTasks.value,new Promise(((i,r)=>this._tasks.unshift(new ge(i,r,e,t,s)))).finally((()=>--this._runningTasks.value))}_process(e){if(0===this._tasks.length)return!1;const t=this._tasks.shift();try{const s=(0,u.wv)(t.signal);if(s&&!t.abortCallback)t.reject((0,u.Uh)());else{const i=s?t.abortCallback?.((0,u.Uh)()):t.callback(e);(0,u.eW)(i)?i.then(t.resolve,t.reject):t.resolve(i)}}catch(e){t.reject(e)}return!0}cancelAll(){const e=(0,u.Uh)();for(const t of this._tasks)if(t.abortCallback){const s=t.abortCallback(e);t.resolve(s)}else t.reject(e);this._tasks.length=0}}class ge{constructor(e,t,s,i=void 0,r=void 0){this.resolve=e,this.reject=t,this.callback=s,this.signal=i,this.abortCallback=r}}var pe=s(41948),_e=s(43780),Te=s(1580),Se=(s(72052),s(12552));let Ie=class extends _e.c{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,pe._)([(0,Te.qq)()],Ie.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,pe._)([(0,Te.qq)()],Ie.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),Ie=(0,pe._)([(0,Se.c)("esri.views.support.DebugFlags")],Ie);const xe=new Ie;var Fe,we=s(27308);!function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(Fe||(Fe={}));const Ee=new Map([[Fe.RESOURCE_CONTROLLER_IMMEDIATE,0],[Fe.RESOURCE_CONTROLLER,4],[Fe.SLIDE,0],[Fe.STREAM_DATA_LOADER,0],[Fe.ELEVATION_QUERY,0],[Fe.TERRAIN_SURFACE,1],[Fe.SURFACE_GEOMETRY_UPDATES,1],[Fe.LOD_RENDERER,2],[Fe.GRAPHICS_CORE,2],[Fe.I3S_CONTROLLER,2],[Fe.POINT_CLOUD_LAYER,2],[Fe.FEATURE_TILE_FETCHER,2],[Fe.OVERLAY,4],[Fe.STAGE,4],[Fe.GRAPHICS_DECONFLICTOR,4],[Fe.FILTER_VISIBILITY,4],[Fe.SCALE_VISIBILITY,4],[Fe.FRUSTUM_VISIBILITY,4],[Fe.CLOUDS_GENERATOR,4],[Fe.POINT_OF_INTEREST_FREQUENT,6],[Fe.POINT_OF_INTEREST_INFREQUENT,30],[Fe.LABELER,8],[Fe.FEATURE_QUERY_ENGINE,8],[Fe.FEATURE_TILE_TREE,16],[Fe.FEATURE_TILE_TREE_ACTIVE,0],[Fe.ELEVATION_ALIGNMENT,12],[Fe.ELEVATION_ALIGNMENT_SCENE,14],[Fe.TEXT_TEXTURE_ATLAS,12],[Fe.TEXTURE_UNLOAD,12],[Fe.LINE_OF_SIGHT_TOOL,16],[Fe.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[Fe.SNAPPING,0],[Fe.SHADOW_ACCUMULATOR,30]]);function Re(e){return Ee.has(e)?Ee.get(e):"number"==typeof e?e:1}const be=(0,me.w$)(6.5),Ne=(0,me.w$)(1),Ce=(0,me.w$)(30),Me=(0,me.w$)(1e3/30),Ae=(0,me.w$)(100);var ve,De;!function(e){e.Scheduler=class{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some((e=>e.needsUpdate))}constructor(){this._updating=(0,de.O)(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new ue.c("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new s,this._state=we.K.INTERACTING,this._tasks=new ce.c,this._runQueue=new ce.c,this._load=0,this._idleStateCallbacks=new ce.c,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=(0,he.aE)((()=>xe.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),he._8);for(const e of Object.keys(Fe))this.performanceInfo.tasks.set(Fe[e],new ue.c(Fe[e]));const e=this;this._test={FRAME_SAFETY_BUDGET:be,INTERACTING_BUDGET:Me,IDLE_BUDGET:Ae,get availableBudget(){return e._budget.budget},usedBudget:0,getBudget:()=>e._budget,setBudget:t=>e._budget=t,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),(0,o.oR)(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())})))}registerTask(e,s){const i=new t(this,e,s);return this._tasks.push(i),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new ue.c(e)),i}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===we.K.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const i=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){i._idleUpdatesStartFired&&(s.idleEnd(),i._state===we.K.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==we.K.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return this._state}updateBudget(e){this._test.usedBudget=0,++this._frameNumber;let t=be,s=e.frameDuration,i=Ne;switch(this.state){case we.K.IDLE:t=(0,me.w$)(0),s=(0,me.w$)(Math.max(Ae,e.frameDuration)),i=Ce;break;case we.K.INTERACTING:s=(0,me.w$)(Math.max(Me,e.frameDuration));case we.K.ANIMATING:}return s=(0,me.w$)(s-e.elapsedFrameTime-t),this.state!==we.K.IDLE&&s<Ne&&!this._forceTask?(this._forceTask=!0,!1):(s=(0,me.w$)(Math.max(s,i)),this._budget.reset(s,this.state),this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case we.K.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case we.K.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset((0,me.w$)(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return De.SCHEDULED;let t=De.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=De.READY:t!==De.READY&&(t=De.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=.9*this._load+e*(1-.9)}_schedule(){for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{0===e.basePriority&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{s.needsUpdate&&0!==s.schedulePriority&&0!==s.basePriority&&s.blockFrame!==this._frameNumber&&(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority?(s.schedulePriority=0,this._runQueue.push(s)):--s.schedulePriority)})),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===fe&&(s.blockFrame=this._frameNumber)}catch(e){le.c.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e),s.blockFrame=this._frameNumber}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,Fe.I3S_CONTROLLER,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now()-t;if(s.runtime+=i,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+i),this._debug&&i>2*this._budget.budget&&console.log("Task",s.name,"used",i,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(Fe))this._frameTaskTimes.set(Fe[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).record(e))),this.performanceInfo.total.record(e)}get test(){return this._test}};class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,t,s){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new ye,this._handles=new oe.c,this._basePriority=Re(t),this.schedulePriority=this._basePriority,this._task=(0,de.O)(null!=s?s:this._queue),this._handles.add((0,he._I)((()=>this.task.running),(t=>e.taskRunningChanged(t))))}remove(){this.processQueue(Oe),this._scheduler.removeTask(this),this.schedule=ke.schedule,this.reschedule=ke.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=Re(e);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){return this._queue.runTask(e)}}class s{constructor(){this._begin="undefined"!=typeof performance?performance.now():0,this._budget=0,this._state=we.K.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}e.Budget=s}(ve||(ve={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(De||(De={}));const Oe=(()=>{const e=new ve.Budget;return e.enabled=!1,e})(),ke=new class{remove(){}processQueue(){}schedule(e,t,s){try{if((0,u.wv)(t)){const e=(0,u.Uh)();return s?Promise.resolve(s(e)):Promise.reject(e)}return(0,u._I)(e(Oe))}catch(e){return Promise.reject(e)}}reschedule(e,t,s){return this.schedule(e,t,s)}},Pe=new l.kB(2e6);let Ge=0;class Ue{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:G.u},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",(()=>this.clearCache())),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new l.ML(Ge+++"$$",Pe)),this.fieldsIndex=(0,n.wt)(e.fieldsIndex)?e.fieldsIndex:ae.c.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map((e=>e.name))):this.availableFields=new Set(e.availableFields.map((e=>this.fieldsIndex.get(e)?.name)).filter((e=>null!=e))),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=(0,o.oR)(this._frameTask),this.clearCache(),(0,o.mG)(this._geometryQueryCache),this._changeHandle=(0,o.oR)(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=(0,u.YF)(t);try{return(await this._executeQuery(e,{},s)).createQueryResponse()}catch(t){if(t!==J.gl)throw t;return new $([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=(0,u.YF)(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(e){if(e!==J.gl)throw e;return 0}}async executeQueryForExtent(e,t){const s=(0,u.YF)(t),i=e.outSR;try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=t.size;return r?{count:r,extent:await this._getBounds(t.items,t.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(e){if(e===J.gl)return{count:0,extent:null};throw e}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){const s=(0,u.YF)(t);try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),i=t.items,r=new Set;return await this._reschedule((()=>{for(const e of i)r.add(t.featureAdapter.getObjectId(e))}),s),r}catch(e){if(e===J.gl)return new Set;throw e}}async executeQueryForSnapping(e,t){const s=(0,u.YF)(t),{point:i,distance:r,returnEdge:n,vertexMode:o}=e;if(!n&&"none"===o)return{candidates:[]};let l=(0,a.ct)(e.query);l=await this._schedule((()=>(0,J._8)(l,this.definitionExpression,this.spatialReference)),s),l=await this._reschedule((()=>te(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s);const c=!(0,p.yK)(i.spatialReference,this.spatialReference);c&&await(0,P.Qv)(i.spatialReference,this.spatialReference);const h="number"==typeof r?r:r.x,d="number"==typeof r?r:r.y,m={xmin:i.x-h,xmax:i.x+h,ymin:i.y-d,ymax:i.y+d,spatialReference:i.spatialReference},f=c?(0,P.yU)(m,this.spatialReference):m;if(!f)return{candidates:[]};const _=(await(0,g.WW)((0,y.h4)(i),null,{signal:s}))[0],T=(await(0,g.WW)((0,y.h4)(f),null,{signal:s}))[0];if(null==_||null==T)return{candidates:[]};const S=new $(await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(T.toJSON()))),s),l,this);await this._reschedule((()=>this._executeObjectIdsQuery(S)),s),await this._reschedule((()=>this._executeTimeQuery(S)),s),await this._reschedule((()=>this._executeAttributesQuery(S)),s),await this._reschedule((()=>this._executeGeometryQueryForSnapping(S,s)),s);const I=_.toJSON(),x=c?(0,P.yU)(I,this.spatialReference):I,F=c?Math.max(f.xmax-f.xmin,f.ymax-f.ymin)/2:r;return S.createSnappingResponse({...e,point:x,distance:F},i.spatialReference)}async executeQueryForLatestObservations(e,t){const s=(0,u.YF)(t);if(!this.timeInfo?.trackIdField)throw new r.c("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const t=await this._executeQuery(e,{},s);return await this._reschedule((()=>this._filterLatest(t)),s),t.createQueryResponse()}catch(t){if(t!==J.gl)throw t;return new $([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const i=(0,u.YF)(s),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=(0,u.YF)(s),{field:r,field2:n,field3:a,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:r,field2:n,field3:a,valueExpression:o},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=(0,u.YF)(s),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=(0,u.YF)(s),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=(0,u.YF)(e);this._timeExtentPromise||=(0,ne.y)(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return(0,u.wp)(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=(0,d.WO)((0,d.Su)(),d.K);await this.featureStore.forEachBounds(e,(e=>(0,d.MZ)(i,e)));const r={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:(0,k.C6)(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(r.zmin=i[2],r.zmax=i[5]);const n=(0,P.yU)(r,t,s);if(n.spatialReference=(0,k.C6)(s),n.xmax-n.xmin==0){const e=(0,c.k8)(n.spatialReference);n.xmin-=e,n.xmax+=e}if(n.ymax-n.ymin==0){const e=(0,c.k8)(n.spatialReference);n.ymin-=e,n.ymax+=e}if(this.hasZ&&null!=n.zmin&&null!=n.zmax&&n.zmax-n.zmin==0){const e=(0,c.k8)(n.spatialReference);n.zmin-=e,n.zmax+=e}return n}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then((e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async _schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(Oe)}async _reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(Oe)}async _getAllFeaturesQueryEngineResult(e){return new $(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach((t=>e.push(t)))})().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=(0,a.ct)(e),e=await this._schedule((()=>(0,J.on)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>te(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s),e={...e,...t};const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this._reschedule((()=>this._executeObjectIdsQuery(r)),s),await this._reschedule((()=>this._executeTimeQuery(r)),s),await this._reschedule((()=>this._executeAttributesQuery(r)),s),r}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,o=null==n||(0,p.yK)(n,a.spatialReference)?a:(0,P.yU)(a,n);if(!o)return null;const l=i||r,u=(0,p.U3)(s)&&!(0,p.yK)(this.spatialReference,s)&&l?async e=>this._project(e,s):e=>e,c=this.featureAdapter,h=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(o))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const s=new Set;for(const e of h)s.add(c.getObjectId(e));const i=await this._reschedule((()=>this._getAllFeatures()),t),r=await this._reschedule((async()=>{const r=await(0,X.q0)("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(i,(e=>!s.has(c.getObjectId(e))||r(c.getGeometry(e))),t);return new $(n,e,this)}),t);return u(r)}if(!h.length)return new $([],e,this);if(this._canExecuteSinglePass(o,e))return u(new $(h,e,this));const d=await(0,X.q0)("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),m=await this._runSpatialFilter(h,(e=>d(c.getGeometry(e))),t);return u(new $(m,e,this))}async _executeGeometryQuery(e,t,s){if(null!=t&&0===t.items.length)return t;e=null!=t?t.query:e;const{geometry:r,outSR:n,spatialRel:a,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!r||null==u||(0,p.yK)(u,r.spatialReference)?r:(0,P.yU)(r,u),h=o||l,d=(0,p.U3)(n)&&!(0,p.yK)(this.spatialReference,n),m=this._geometryQueryCache&&null==t?d&&h?JSON.stringify({originalFilterGeometry:r,spatialRelationship:a,outSpatialReference:n}):JSON.stringify({originalFilterGeometry:r,spatialRelationship:a}):null,f=m?this._geometryQueryCache.get(m):null;if(null!=f)return new $(f,e,this);const y=async e=>(d&&h&&await this._project(e,n),m&&this._geometryQueryCache.put(m,e.items,e.items.length+1),e);if(!c)return y(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const g=this.featureAdapter;let _=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(r))),s);if("esriSpatialRelDisjoint"===a){if(!_.length)return y(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of _)i.add(g.getObjectId(e));const r=null!=t?t.items:await this._reschedule((()=>this._getAllFeatures()),s),n=await this._reschedule((async()=>{const t=await(0,X.q0)(a,c,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(r,(e=>!i.has(g.getObjectId(e))||t(g.getGeometry(e))),s);return new $(n,e,this)}),s);return y(n)}if(null!=t){const e=new i.is;_=_.filter((s=>(0,i.IP)(t.items,s,t.items.length,e)>=0))}if(!_.length){const t=new $([],e,this);return m&&this._geometryQueryCache.put(m,t.items,1),t}if(this._canExecuteSinglePass(c,e))return y(new $(_,e,this));const T=await(0,X.q0)(a,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(_,(e=>T(g.getGeometry(e))),s);return y(new $(S,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:s}=e,{spatialRel:i}=s;if(!e?.items?.length||!s.geometry||!i)return;const r=await(0,X.q0)(i,s.geometry,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(e.items,(e=>r(e.geometry)),t);e.items=n}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const s of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(s).forEach((e=>t.add(e)));const s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,ne.k)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=M(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let i=0;const r=new Array,n=async a=>{for(;i<e.length;){const o=e[i++];t(o)&&(r.push(o),a.madeProgress()),a.done&&await this._reschedule((e=>n(e)),s)}};return this._reschedule((e=>n(e)),s).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,n=new Map,a=this.featureAdapter.getAttribute;for(const s of e.items){const e=a(s,t),i=a(s,r),o=n.get(e);(!o||i>a(o,r))&&n.set(e,s)}e.items=Array.from(n.values())}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return(0,X.aS)(e)&&("esriSpatialRelEnvelopeIntersects"===s||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===s||"esriSpatialRelContains"===s))}async _project(e,t){if(!t||(0,p.yK)(this.spatialReference,t))return e;const s=this.featureAdapter;let i;try{const e=await this._getFullExtent();i=(0,h.getTransformation)(this.spatialReference,t,e)}catch{}const r=await(0,P.eW)(e.items.map((e=>(0,k.uo)(this.geometryType,this.hasZ,this.hasM,s.getGeometry(e)))),this.spatialReference,t,i);return e.items=r.map(((t,i)=>s.cloneWithGeometry(e.items[i],(0,_.C)(t,this.hasZ,this.hasM)))),e}_getQueryBBoxes(e){if((0,X.aS)(e)){if((0,y.Ul)(e))return[(0,m.WK)(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if((0,y.Cs)(e))return e.rings.map((e=>(0,m.WK)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[(0,f.ac)((0,m.Su)(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=(0,a.ct)(e);try{e=await this._schedule((()=>(0,J.on)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>async function(e,t,{fieldsIndex:s,geometryType:i,spatialReference:n,availableFields:a}){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.c(ee,"Unsupported query options",{query:e});return se(s,a,e),Promise.all([re(s,a,t,e),(0,X.a)(e,i,n),(0,P.Qv)(n,e.outSR)]).then((()=>e))}(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s);const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),n=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(n)),s),await this._reschedule((()=>this._executeObjectIdsQuery(n)),s),await this._reschedule((()=>this._executeTimeQuery(n)),s),await this._reschedule((()=>this._executeAttributesQuery(n)),s),n}catch(t){if(t!==J.gl)throw t;return new $([],e,this)}}}},13136:(e,t,s)=>{s.d(t,{u:()=>i});const i={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},83624:(e,t,s)=>{s.d(t,{AT:()=>u,C6:()=>h,uo:()=>c});var i=s(97088),r=s(85152);const n=new r.c,a=new r.c,o=new r.c,l={esriGeometryPoint:i.a,esriGeometryPolyline:i.GE,esriGeometryPolygon:i.Y5,esriGeometryMultipoint:i.i};function u(e,t,s,r=e.hasZ,n=e.hasM){if(null==t)return null;const a=e.hasZ&&r,l=e.hasM&&n;if(s){const u=(0,i.iC)(o,t,e.hasZ,e.hasM,"esriGeometryPoint",s,r,n);return(0,i.a)(u,a,l)}return(0,i.a)(t,a,l)}function c(e,t,s,r,u,c,h=t,d=s){const m=t&&h,f=s&&d,y=null!=r?"coords"in r?r:r.geometry:null;if(null==y)return null;if(u){let r=(0,i.WY)(a,y,t,s,e,u,h,d);return c&&(r=(0,i.iC)(o,r,m,f,e,c)),l[e]?.(r,m,f)??null}if(c){const r=(0,i.iC)(o,y,t,s,e,c,h,d);return l[e]?.(r,m,f)??null}return(0,i.Sk)(n,y,t,s,h,d),l[e]?.(n,m,f)??null}function h(e){return e&&d in e?JSON.parse(JSON.stringify(e,m)):e}const d="_geVersion",m=(e,t)=>e!==d?t:void 0},51752:(e,t,s)=>{function i(e,t){return e?t?4:3:t?3:2}function r(e,t,s,r){if(!t?.lengths.length)return null;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const o=e.coords,l=[],u=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:c,coords:h}=t,d=i(s,r);let m=0;for(const e of c){const t=n(u,h,m,e,s,r);t&&l.push(t),m+=e*d}if(l.sort(((e,t)=>{let i=e[2]-t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),l.length){let e=6*l[0][2];o[0]=l[0][0]/e,o[1]=l[0][1]/e,s&&(e=6*l[0][4],o[2]=0!==e?l[0][3]/e:0),(o[0]<u[0]||o[0]>u[1]||o[1]<u[2]||o[1]>u[3]||s&&(o[2]<u[4]||o[2]>u[5]))&&(o.length=0)}if(!o.length){const e=t.lengths[0]?a(h,0,c[0],s,r):null;if(!e)return null;o[0]=e[0],o[1]=e[1],s&&e.length>2&&(o[2]=e[2])}return e}function n(e,t,s,r,n,a){const o=i(n,a);let l=s,u=s+o,c=0,h=0,d=0,m=0,f=0;for(let s=0,i=r-1;s<i;s++,l+=o,u+=o){const s=t[l],i=t[l+1],r=t[l+2],a=t[u],o=t[u+1],y=t[u+2];let g=s*o-a*i;m+=g,c+=(s+a)*g,h+=(i+o)*g,n&&(g=s*y-a*r,d+=(r+y)*g,f+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(m>0&&(m*=-1),f>0&&(f*=-1),!m)return null;const y=[c,h,.5*m];return n&&(y[3]=d,y[4]=.5*f),y}function a(e,t,s,r,n){const a=i(r,n);let h=t,d=t+a,m=0,f=0,y=0,g=0;for(let t=0,i=s-1;t<i;t++,h+=a,d+=a){const t=e[h],s=e[h+1],i=e[h+2],n=e[d],a=e[d+1],p=e[d+2],_=r?l(t,s,i,n,a,p):o(t,s,n,a);if(_)if(m+=_,r){const e=c(t,s,i,n,a,p);f+=_*e[0],y+=_*e[1],g+=_*e[2]}else{const e=u(t,s,n,a);f+=_*e[0],y+=_*e[1]}}return m>0?r?[f/m,y/m,g/m]:[f/m,y/m]:s>0?r?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function o(e,t,s,i){const r=s-e,n=i-t;return Math.sqrt(r*r+n*n)}function l(e,t,s,i,r,n){const a=i-e,o=r-t,l=n-s;return Math.sqrt(a*a+o*o+l*l)}function u(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function c(e,t,s,i,r,n){return[e+.5*(i-e),t+.5*(r-t),s+.5*(n-s)]}s.d(t,{u:()=>m});var h=s(34888),d=s(85152);const m={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new h._M(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(null==e.centroid&&(e.centroid=r(new d.c,e.geometry,t.hasZ,t.hasM)),e.centroid)}},7684:(e,t,s)=>{s.d(t,{Qv:()=>m,eW:()=>_,yU:()=>g});var i=s(92400),r=s(10860),n=s(60074),a=s(3452),o=s(60544),l=s(29120);const u=[0,0];function c(e,t){if(!t)return null;if("x"in t){const s={x:0,y:0};return[s.x,s.y]=e(t.x,t.y,u),null!=t.z&&(s.z=t.z),null!=t.m&&(s.m=t.m),s}if("xmin"in t){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(t.xmin,t.ymin,u),[s.xmax,s.ymax]=e(t.xmax,t.ymax,u),t.hasZ&&(s.zmin=t.zmin,s.zmax=t.zmax,s.hasZ=!0),t.hasM&&(s.mmin=t.mmin,s.mmax=t.mmax,s.hasM=!0),s}return"rings"in t?{rings:h(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:h(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:d(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function h(e,t){const s=[];for(const i of e)s.push(d(i,t));return s}function d(e,t){const s=[];for(const i of e){const e=t(i[0],i[1],[0,0]);s.push(e),i.length>2&&e.push(i[2]),i.length>3&&e.push(i[3])}return s}async function m(e,t){if(!e||!t)return;const s=Array.isArray(e)?e.map((e=>null!=e.geometry?e.geometry.spatialReference:null)).filter(i.G6):[e];await(0,n.initializeProjection)(s.map((e=>({source:e,dest:t}))))}const f=c.bind(null,l.S6),y=c.bind(null,l.Y7);function g(e,t,s,i){if(!e)return e;if(s||(s=t,t=e.spatialReference),!(0,o.U3)(t)||!(0,o.U3)(s)||(0,o.yK)(t,s))return e;if((0,l.Gw)(t,s)){const t=(0,o.kn)(s)?f(e):y(e);return t.spatialReference=s,t}return(0,n.projectMany)(a.O,[e],t,s,null,i)[0]}const p=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,s,i){if(!e?.length||!t||!s||(0,o.yK)(t,s))return e;const n={geometries:e,inSpatialReference:t,outSpatialReference:s,geographicTransformation:i,resolve:(0,r.qG)()};return this._jobs.push(n),this._timer??=setTimeout(this._process,10),n.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:s,outSpatialReference:i,resolve:r,geographicTransformation:u}=e;(0,l.Gw)(s,i)?(0,o.kn)(i)?r(t.map(f)):r(t.map(y)):r((0,n.projectMany)(a.O,t,s,i,u,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function _(e,t,s,i){return p.push(e,t,s,i)}},3900:(e,t,s)=>{s.d(t,{_8:()=>f,gl:()=>d,on:()=>m});var i=s(14628),r=s(24296),n=s(60074),a=s(96784),o=s(6704),l=s(20480),u=s(60544),c=s(7684);const h=new i.O({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),d=Object.freeze({});async function m(e,t,s){const{outFields:i,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(i)for(let e=0;e<i.length;e++)i[e]=i[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),f(e,t,s)}async function f(e,t,i){if(!e)return null;let{where:n}=e;if(e.where=n=n?.trim(),(!n||/^1 *= *1$/.test(n)||t&&t===n)&&(e.where=null),!e.geometry)return e;let m=await async function(e){const{distance:t,units:i}=e,n=e.geometry;if(null==t||"vertexAttributes"in n)return n;const a=n.spatialReference,o=i?h.fromJSON(i):(0,r.PE)(a),l=a&&((0,u.Eb)(a)||(0,u.kn)(a))?n:await(0,c.Qv)(a,u.UH).then((()=>(0,c.yU)(n,u.UH)));return(await async function(){return(await Promise.all([s.e(984),s.e(324)]).then(s.bind(s,82704))).geodesicBuffer}())(l.spatialReference,l,t,o)}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;m=(0,a.GQ)(m),m.spatialReference=t}if(m){await(0,c.Qv)(m.spatialReference,i),m=function(e,t){const s=e.spatialReference;return y(e,t)&&(0,o.Ul)(e)?{spatialReference:s,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(m,i);const t=(await(0,l.WW)((0,o.h4)(m)))[0];if(null==t)throw d;const s="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,r=s&&y(m,i)?{densificationStep:8*s}:void 0,n=t.toJSON(),a=(0,c.yU)(n,n.spatialReference,i,r);if(!a)throw d;a.spatialReference=i,e.geometry=a}return e}function y(e,t){if(!e)return!1;const s=e.spatialReference;return((0,o.Ul)(e)||(0,o.Cs)(e)||(0,o.cZ)(e))&&!(0,u.yK)(s,t)&&!(0,n.canProjectWithoutEngine)(s,t)}},79596:(e,t,s)=>{s.d(t,{aS:()=>I,a:()=>S,q0:()=>T});var i=s(20744),r=s(83223),n=s(41980),a=s(6704),o=s(60544);function l(e,t){return e?t?4:3:t?3:2}function u(e,t,s,i,r,n){const a=l(r,n),{coords:o,lengths:u}=i;if(!u)return!1;for(let i=0,r=0;i<u.length;i++,r+=a)if(!c(e,t,s,o[r],o[r+1]))return!1;return!0}function c(e,t,s,i,r){if(!e)return!1;const n=l(t,s),{coords:a,lengths:o}=e;let u=!1,c=0;for(const e of o)u=h(u,a,n,c,e,i,r),c+=e*n;return u}function h(e,t,s,i,r,n,a){let o=e,l=i;for(let e=i,u=i+r*s;e<u;e+=s){l=e+s,l===u&&(l=i);const r=t[e],c=t[e+1],h=t[l],d=t[l+1];(c<a&&d>=a||d<a&&c>=a)&&r+(a-c)/(d-c)*(h-r)<n&&(o=!o)}return o}var d=s(97088),m=s(85152),f=s(83624),y=s(7684);const g="unsupported-query",p={esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null},_={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}};function T(e,t,i,o,l){if((0,a.Cs)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,d.Uh)(new m.c,t,!1,!1);return Promise.resolve((t=>function(e,t,s,i){return c(e,!1,!1,i.coords[0],i.coords[1])}(e,0,0,t)))}if((0,a.Cs)(t)&&"esriGeometryMultipoint"===i){const s=(0,d.Uh)(new m.c,t,!1,!1);if("esriSpatialRelContains"===e)return Promise.resolve((e=>u(s,!1,!1,e,o,l)))}if((0,a.Ul)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return Promise.resolve((e=>(0,r.o1)(t,(0,f.uo)(i,o,l,e))));if((0,a.Ul)(t)&&"esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return Promise.resolve((e=>(0,r.k)(t,(0,f.uo)(i,o,l,e))));if((0,a.Ul)(t)&&"esriSpatialRelIntersects"===e){const e="mesh"===(h=i)?n.ac:(0,n.Qz)(h);return Promise.resolve((s=>e(t,(0,f.uo)(i,o,l,s))))}var h;return Promise.all([s.e(984),s.e(324)]).then(s.bind(s,82704)).then((s=>{const r=s[p[e]].bind(null,t.spatialReference,t);return e=>r((0,f.uo)(i,o,l,e))}))}async function S(e,t,s){const{spatialRel:r,geometry:n}=e;if(n){if(!function(e){return null!=e&&!0===_.spatialRelationship[e]}(r))throw new i.c(g,"Unsupported query spatial relationship",{query:e});if((0,o.U3)(n.spatialReference)&&(0,o.U3)(s)){if(!function(e){return null!=e&&!0===_.queryGeometry[(0,a.Ce)(e)]}(n))throw new i.c(g,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===_.layerGeometry[e]}(t))throw new i.c(g,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,y.Qv)(e.geometry?.spatialReference,e.outSR)}}}function I(e){if((0,a.Ul)(e))return!0;if((0,a.Cs)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},78104:(e,t,s)=>{async function i(e,t){if(!e)return null;const s=t.featureAdapter,{startTimeField:i,endTimeField:r}=e;let n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if(i&&r)await t.forEach((e=>{const t=s.getAttribute(e,i),o=s.getAttribute(e,r);null==t||isNaN(t)||(n=Math.min(n,t)),null==o||isNaN(o)||(a=Math.max(a,o))}));else{const e=i||r;await t.forEach((t=>{const i=s.getAttribute(t,e);null==i||isNaN(i)||(n=Math.min(n,i),a=Math.max(a,i))}))}return{start:n,end:a}}function r(e,t,s){if(!t||!e)return null;const{startTimeField:i,endTimeField:r}=e;if(!i&&!r)return null;const{start:n,end:a}=t;if(null===n&&null===a)return null;if(void 0===n&&void 0===a)return()=>!1;const o=s.getAttributeAsTimestamp?.bind(s)??s.getAttribute.bind(s);return i&&r?function(e,t,s,i,r){return null!=i&&null!=r?n=>{const a=e(n,t),o=e(n,s);return(null==a||a<=r)&&(null==o||o>=i)}:null!=i?t=>{const r=e(t,s);return null==r||r>=i}:null!=r?s=>{const i=e(s,t);return null==i||i<=r}:void 0}(o,i,r,n,a):function(e,t,s,i){return null!=s&&null!=i&&s===i?i=>e(i,t)===s:null!=s&&null!=i?r=>{const n=e(r,t);return null!=n&&n>=s&&n<=i}:null!=s?i=>{const r=e(i,t);return null!=r&&r>=s}:null!=i?s=>{const r=e(s,t);return null!=r&&r<=i}:void 0}(o,i||r,n,a)}s.d(t,{k:()=>r,y:()=>i})},97088:(e,t,s)=>{s.d(t,{C:()=>Y,C_:()=>se,G0:()=>z,GE:()=>P,Ij:()=>ie,M$:()=>D,Oo:()=>ae,Sk:()=>re,Uh:()=>L,WY:()=>X,Y5:()=>U,a:()=>F,i:()=>O,i6:()=>$,iC:()=>J,m:()=>W,mk:()=>I,od:()=>Q,qw:()=>j,uY:()=>S,ui:()=>H,w3:()=>K,ye:()=>V});var i=s(20744),r=s(66360),n=s(70680),a=s(77048),o=s(83372),l=s(6704),u=s(34888),c=s(90412),h=s(85152);function d(e,t){return e?t?4:3:t?3:2}const m=()=>r.c.getLogger("esri.layers.graphics.featureConversionUtils"),f={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryEnvelope:0},y=(e,t,s,i,r,n)=>{e[s]=r,e[s+1]=n},g=(e,t,s,i,r,n)=>{e[s]=r,e[s+1]=n,e[s+2]=t[i+2]},p=(e,t,s,i,r,n)=>{e[s]=r,e[s+1]=n,e[s+2]=t[i+3]},_=(e,t,s,i,r,n)=>{e[s]=r,e[s+1]=n,e[s+2]=t[i+2],e[s+3]=t[i+3]};function T(e,t,s,i){if(e){if(s)return t&&i?_:g;if(t&&i)return p}else if(t&&i)return g;return y}function S({scale:e,translate:t},s){return Math.round((s-t[0])/e[0])}function I({scale:e,translate:t},s){return Math.round((t[1]-s)/e[1])}function x({scale:e,translate:t},s,i){return s*e[i]+t[i]}function F(e,t,s){return e?t?s?M(e):R(e):s?N(e):w(e):null}function w(e){const t=e.coords;return{x:t[0],y:t[1]}}function E(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e}function R(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2]}}function b(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e}function N(e){const t=e.coords;return{x:t[0],y:t[1],m:t[2]}}function C(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.m,e}function M(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2],m:t[3]}}function A(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e.coords[3]=t.m,e}function v(e,t){return e&&t?A:e?b:t?C:E}function D(e,t,s=v(null!=t.z,null!=t.m)){return s(e,t)}function O(e,t,s){if(null==e)return null;const i=d(t,s),r=[];for(let t=0;t<e.coords.length;t+=i){const s=[];for(let r=0;r<i;r++)s.push(e.coords[t+r]);r.push(s)}return t?s?{points:r,hasZ:t,hasM:s}:{points:r,hasZ:t}:s?{points:r,hasM:s}:{points:r}}function k(e,t,s=d(t.hasZ,t.hasM)){e.lengths[0]=t.points.length;const i=e.coords;let r=0;for(const e of t.points)for(let t=0;t<s;t++)i[r++]=e[t];return e}function P(e,t,s){if(!e)return null;const i=d(t,s),{coords:r,lengths:n}=e,a=[];let o=0;for(const e of n){const t=[];for(let s=0;s<e;s++){const e=[];for(let t=0;t<i;t++)e.push(r[o++]);t.push(e)}a.push(t)}return t?s?{paths:a,hasZ:t,hasM:s}:{paths:a,hasZ:t}:s?{paths:a,hasM:s}:{paths:a}}function G(e,t,s=d(t.hasZ,t.hasM)){const{lengths:i,coords:r}=e;let n=0;for(const e of t.paths){for(const t of e)for(let e=0;e<s;e++)r[n++]=t[e];i.push(e.length)}return e}function U(e,t,s){if(!e)return null;const i=d(t,s),{coords:r,lengths:n}=e,a=[];let o=0;for(const e of n){const t=[];for(let s=0;s<e;s++){const e=[];for(let t=0;t<i;t++)e.push(r[o++]);t.push(e)}a.push(t)}return t?s?{rings:a,hasZ:t,hasM:s}:{rings:a,hasZ:t}:s?{rings:a,hasM:s}:{rings:a}}function L(e,t,s=t.hasZ,i=t.hasM){return function(e,t,s,i){const r=d(s,i),{lengths:n,coords:a}=e;let o=0;oe(e);for(const e of t){for(const t of e)for(let e=0;e<r;e++)a[o++]=t[e];n.push(e.length)}return e}(e,t.rings,s,i)}const q=[],Z=[];function V(e,t,s,i,r){q[0]=e;const[n]=Q(Z,q,t,s,i,r);return le(q),le(Z),n}function Q(e,t,s,r,n,a){if(le(e),!s){for(const s of t){const t=a?s.attributes[a]:void 0;e.push(new u._M(null,s.attributes,null,t))}return e}switch(s){case"esriGeometryPoint":return function(e,t,s,i,r){const n=v(s,i);for(const{geometry:s,attributes:i}of t){const t=null!=s?n(new h.c,s):null;e.push(new u._M(t,i,null,r?i[r]:void 0))}return e}(e,t,r,n,a);case"esriGeometryMultipoint":return function(e,t,s,i,r){const n=d(s,i);for(const{geometry:s,attributes:i}of t){const t=null!=s?k(new h.c,s,n):null;e.push(new u._M(t,i,null,r?i[r]:void 0))}return e}(e,t,r,n,a);case"esriGeometryPolyline":return function(e,t,s,i,r){const n=d(s,i);for(const{geometry:s,attributes:i,centroid:a}of t){const t=null!=s?G(new h.c,s,n):null,o=null!=a?D(new h.c,a):null;e.push(new u._M(t,i,o,r?i[r]:void 0))}return e}(e,t,r,n,a);case"esriGeometryPolygon":return function(e,t,s,i,r){for(const{geometry:n,centroid:a,attributes:o}of t){const t=null!=n?L(new h.c,n,s,i):null,l=r?o[r]:void 0;null!=a?e.push(new u._M(t,o,E(new h.c,a),l)):e.push(new u._M(t,o,null,l))}return e}(e,t,r,n,a);default:m().error("convertToFeatureSet:unknown-geometry",new i.c(`Unable to parse unknown geometry type '${s}'`)),le(e)}return e}function z(e,t,s,i){Z[0]=e,B(q,Z,t,s,i);const r=q[0];return le(q),le(Z),r}function Y(e,t,s){if(null==e)return null;const r=new h.c;return"hasZ"in e&&null==t&&(t=e.hasZ),"hasM"in e&&null==s&&(s=e.hasM),(0,l._x)(e)?v(null!=t?t:null!=e.z,null!=s?s:null!=e.m)(r,e):(0,l.Cs)(e)?L(r,e,t,s):(0,l.cZ)(e)?G(r,e,d(t,s)):(0,l._)(e)?k(r,e,d(t,s)):void m().error("convertFromGeometry:unknown-geometry",new i.c(`Unable to parse unknown geometry type '${e}'`))}function j(e,t,s,r){const n=e&&("coords"in e?e:e.geometry);if(null==n)return null;switch(t){case"esriGeometryPoint":{let e=w;return s&&r?e=M:s?e=R:r&&(e=N),e(n)}case"esriGeometryMultipoint":return O(n,s,r);case"esriGeometryPolyline":return P(n,s,r);case"esriGeometryPolygon":return U(n,s,r);default:return m().error("convertToGeometry:unknown-geometry",new i.c(`Unable to parse unknown geometry type '${t}'`)),null}}function B(e,t,s,r,n){if(le(e),null==s)return function(e,t){for(const s of t)e.push({attributes:s.attributes});return e}(e,t);switch(s){case"esriGeometryPoint":return function(e,t,s,i){let r=w;s&&i?r=M:s?r=R:i&&(r=N);for(const s of t){const{geometry:t,attributes:i}=s,n=null!=t?r(t):null;e.push({attributes:i,geometry:n})}return e}(e,t,r,n);case"esriGeometryMultipoint":return function(e,t,s,i){for(const{geometry:r,attributes:n}of t)e.push({attributes:n,geometry:null!=r?O(r,s,i):null});return e}(e,t,r,n);case"esriGeometryPolyline":return function(e,t,s,i){for(const{geometry:r,attributes:n}of t)e.push({attributes:n,geometry:null!=r?P(r,s,i):null});return e}(e,t,r,n);case"esriGeometryPolygon":return function(e,t,s,i){for(const{geometry:r,attributes:n,centroid:a}of t){const t=null!=r?U(r,s,i):null;if(null!=a){const s=w(a);e.push({attributes:n,centroid:s,geometry:t})}else e.push({attributes:n,geometry:t})}return e}(e,t,r,n);default:m().error("convertToFeatureSet:unknown-geometry",new i.c(`Unable to parse unknown geometry type '${s}'`))}return e}function $(e){const{objectIdFieldName:t,spatialReference:s,transform:i,fields:r,hasM:n,hasZ:a,features:o,geometryType:l,exceededTransferLimit:u,uniqueIdField:c,queryGeometry:h,queryGeometryType:d}=e,m={features:B([],o,l,a,n),fields:r,geometryType:l,objectIdFieldName:t,spatialReference:s,uniqueIdField:c,queryGeometry:j(h,d,!1,!1)};return i&&(m.transform=i),u&&(m.exceededTransferLimit=u),n&&(m.hasM=n),a&&(m.hasZ=a),m}function H(e,t){const s=new c.c,{hasM:r,hasZ:n,features:a,objectIdFieldName:o,spatialReference:l,geometryType:u,exceededTransferLimit:h,transform:d,fields:f}=e;return f&&(s.fields=f),s.geometryType=u??null,s.objectIdFieldName=o??t??null,s.spatialReference=l??null,s.objectIdFieldName?(a&&Q(s.features,a,u,n,r,s.objectIdFieldName),h&&(s.exceededTransferLimit=h),r&&(s.hasM=r),n&&(s.hasZ=n),d&&(s.transform=d),s):(m().error(new i.c("optimized-features:invalid-objectIdFieldName","objectIdFieldName is missing")),s)}function K(e){const{transform:t,features:s,hasM:i,hasZ:r}=e;if(!t)return e;for(const e of s)null!=e.geometry&&ie(e.geometry,e.geometry,i,r,t),null!=e.centroid&&ie(e.centroid,e.centroid,i,r,t);return e.transform=null,e}function W(e,t){const{geometryType:s,features:i,hasM:r,hasZ:n}=t;if(!e)return t;for(let t=0;t<i.length;t++){const a=i[t],o=a.weakClone();o.geometry=new h.c,J(o.geometry,a.geometry,r,n,s,e),a.centroid&&(o.centroid=new h.c,J(o.centroid,a.centroid,r,n,"esriGeometryPoint",e)),i[t]=o}return t.transform=e,t}function J(e,t,s,i,r,n,a=s,o=i){if(oe(e),!t?.coords.length)return null;const l=f[r],{coords:u,lengths:c}=t,h=d(s,i),m=d(s&&a,i&&o),y=T(s,i,a,o);if(!c.length)return y(e.coords,u,0,0,S(n,u[0]),I(n,u[1])),oe(e,h,0),e;let g,p,_,x,F=0,w=0,E=w;for(const t of c){if(t<l)continue;let s=0;w=E,_=g=S(n,u[F]),x=p=I(n,u[F+1]),y(e.coords,u,w,F,_,x),s++,F+=h,w+=m;for(let i=1;i<t;i++,F+=h)_=S(n,u[F]),x=I(n,u[F+1]),_===g&&x===p||(y(e.coords,u,w,F,_-g,x-p),w+=m,s++,g=_,p=x);s>=l&&(e.lengths.push(s),E=w)}return le(e.coords,E),e.coords.length?e:null}function X(e,t,s,i,r,n,a=s,o=i){if(oe(e),!t?.coords.length)return null;const l=f[r],{coords:u,lengths:c}=t,h=d(s,i),m=d(s&&a,i&&o),y=T(s,i,a,o);if(!c.length)return y(e.coords,u,0,0,u[0],u[1]),oe(e,h,0),e;let g=0;const p=n*n;for(const t of c){if(t<l){g+=t*h;continue}const s=e.coords.length/m,i=g,r=g+(t-1)*h;y(e.coords,u,e.coords.length,i,u[i],u[i+1]),te(e.coords,u,h,p,y,i,r),y(e.coords,u,e.coords.length,r,u[r],u[r+1]);const n=e.coords.length/m-s;n>=l?e.lengths.push(n):le(e.coords,s*m),g+=t*h}return e.coords.length?e:null}function ee(e,t,s,i){const r=e[t],n=e[t+1],a=e[s],o=e[s+1],l=e[i],u=e[i+1];let c=a,h=o,d=l-c,m=u-h;if(0!==d||0!==m){const e=((r-c)*d+(n-h)*m)/(d*d+m*m);e>1?(c=l,h=u):e>0&&(c+=d*e,h+=m*e)}return d=r-c,m=n-h,d*d+m*m}function te(e,t,s,i,r,n,a){let o,l=i,u=0;for(let e=n+s;e<a;e+=s)o=ee(t,e,n,a),o>l&&(u=e,l=o);l>i&&(u-n>s&&te(e,t,s,i,r,n,u),r(e,t,e.length,u,t[u],t[u+1]),a-u>s&&te(e,t,s,i,r,u,a))}function se(e,t,s,i){if(!t?.coords?.length)return null;const r=d(s,i);let n=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(t&&t.coords){const e=t.coords;for(let t=0;t<e.length;t+=r){const s=e[t],i=e[t+1];n=Math.min(n,s),u=Math.max(u,s),l=Math.min(l,i),c=Math.max(c,i)}}return(0,a.is)(e)?(0,a.qy)(e,n,l,u,c):(0,o.WK)(n,l,u,c,e),e}function ie(e,t,s,i,r){const{coords:a,lengths:o}=t,l=d(s,i);if(!a.length)return e!==t&&oe(e),e;(0,n.EN)(r);const{originPosition:u,scale:c,translate:h}=r,m=ue;m.originPosition=u;const f=m.scale;f[0]=c[0]??1,f[1]=-(c[1]??1),f[2]=c[2]??1,f[3]=c[3]??1;const y=m.translate;if(y[0]=h[0]??0,y[1]=h[1]??0,y[2]=h[2]??0,y[3]=h[3]??0,!o.length){for(let t=0;t<l;++t)e.coords[t]=x(m,a[t],t);return e!==t&&oe(e,l,0),e}let g=0;for(let t=0;t<o.length;t++){const s=o[t];e.lengths[t]=s;for(let t=0;t<l;++t)e.coords[g+t]=x(m,a[g+t],t);let i=e.coords[g],r=e.coords[g+1];g+=l;for(let t=1;t<s;t++,g+=l){i+=a[g]*f[0],r+=a[g+1]*f[1],e.coords[g]=i,e.coords[g+1]=r;for(let t=2;t<l;++t)e.coords[g+t]=x(m,a[g+t],t)}}return e!==t&&oe(e,a.length,o.length),e}function re(e,t,s,i,r,n){if(oe(e),e.lengths.push(...t.lengths),s===r&&i===n)for(let s=0;s<t.coords.length;s++)e.coords.push(t.coords[s]);else{const a=d(s,i),o=T(s,i,r,n),l=t.coords;for(let t=0;t<l.length;t+=a)o(e.coords,l,e.coords.length,t,l[t],l[t+1])}return e}function ne(e,t,s,i){let r=0,n=e[i*t],a=e[i*(t+1)];for(let o=1;o<s;o++){const s=n+e[i*(t+o)],l=a+e[i*(t+o)+1],u=(s-n)*(l+a);n=s,a=l,r+=u}return.5*r}function ae(e,t){const{coords:s,lengths:i}=e;let r=0,n=0;for(let e=0;e<i.length;e++){const a=i[e];n+=ne(s,r,a,t),r+=a}return Math.abs(n)}function oe(e,t=0,s=0){le(e.lengths,s),le(e.coords,t)}function le(e,t=0){e.length!==t&&(e.length=t)}const ue={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]}},16424:(e,t,s)=>{s.d(t,{c:()=>d});var i=s(20744),r=s(40504),n=s(66360),a=s(86916),o=s(75824),l=s(564),u=s(28484),c=s(39452);const h=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],g(e))}static fromLayerJSON(e){return new d(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const s=[];for(const e of this.fields){const t=e?.name,i=f(t);if(t&&i){const r=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(r,e),this._normalizedFieldsMap.set(i,e),s.push(`${r}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.gp)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.iW)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.Mz)(e)||(0,l.w1)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}s.sort(),this.uid=s.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.Mz)(e)||(0,l.w1)(e)||e.nullable||void 0!==(0,l.gB)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(m(e))??this._normalizedFieldsMap.get(f(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(n.c.getLogger("esri.layers.support.FieldsIndex").error(new i.c("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.Gw):y.has(t.type)?u.OI:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.OI?o.qG.instance:t===u.Gw?c.Kq.utcInstance:(0,a.wJ)(h,t,(()=>c._C.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.eM)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,r.wt)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function f(e){return(0,l.gP)(e)?.toLowerCase()??""}const y=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const s=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:r}=e,n=(i?"startField"in i?i.startField:i.startTimeField:"")??"",a=(i?"endField"in i?i.endField:i.endTimeField:"")??"",o=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,u.Mt)(e.dateFieldsTimeReference):null,l=r?function(e){return"timeZone"in e}(r)?r.timeZone??o:r.dateFieldsTimeReference?(0,u.Mt)(r.dateFieldsTimeReference):o??u.Gw:null,c=i?function(e){return"timeZone"in e}(i)?i.timeZone??o:i.timeReference?(0,u.Mt)(i.timeReference):o:null,h=new Map([[m(r?.creationDateField??""),l],[m(r?.editDateField??""),l],[m(n),c],[m(a),c]]);for(const{name:i,type:r}of e.fields)if(y.has(r))t.set(i,u.OI);else if("date"!==r&&"esriFieldTypeDate"!==r)t.set(i,null);else if(s)t.set(i,u.OI);else{const e=h.get(m(i??""))??o;t.set(i,e)}return t}},36408:(e,t,s)=>{s.d(t,{M:()=>i});const i=new(s(14628).O)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},27308:(e,t,s)=>{var i;s.d(t,{K:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4608,988],{10724:(e,t,s)=>{s.d(t,{Ql:()=>h,YX:()=>d});var i,r=s(88264),n=s(75824),a=s(39452);(i||(i={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const o={[i.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class l extends Error{constructor(e,t){super((0,r.qq)(o[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,l)}}function u(e,t,s){return e<t?e-t:e>s?e-s:0}function c(e,t,s){return e<t?t:e>s?s:e}class h{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,i=0,r=0,n=0,o=0,l){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(i)||isNaN(r)||isNaN(n)||isNaN(o))return null;const m=a.CS.local(e,t).daysInMonth;let f=a.CS.fromObject({day:c(s,1,m),year:e,month:c(t,1,12),hour:c(i,0,23),minute:c(r,0,59),second:c(n,0,59),millisecond:c(o,0,999)},{zone:d(l)});return f=f.plus({months:u(t,1,12),days:u(s,1,m),hours:u(i,0,23),minutes:u(r,0,59),seconds:u(n,0,59),milliseconds:u(o,0,999)}),new h(f)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=d(t);return e.isUnknownTimeZone||s===n.qG.instance?h.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new h(e._date.setZone(s))}static dateJSToArcadeDate(e){return new h(a.CS.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=d(t);return new h(a.CS.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new h(a.CS.fromMillis(e,{zone:n.qG.instance}))}static unknownDateJSToArcadeDate(e){return new h(a.CS.fromMillis(e.getTime(),{zone:n.qG.instance}))}static epochToArcadeDate(e,t="system"){const s=d(t);return new h(a.CS.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new h(e)}clone(){return new h(this._date)}changeTimeZone(e){const t=d(e);return h.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=d(t);return e.zone===n.qG.instance||s===n.qG.instance?h.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new h(e.setZone(s))}static nowToArcadeDate(e){const t=d(e);return new h(a.CS.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new h(a.CS.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===h.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===n.qG.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new h(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new h(this._date.toUTC())}toLocal(){return new h(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=a.CS.fromISO(e,{setZone:!0});return new h(t)}}function d(e,t=!0){if(e instanceof a.C)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return n.qG.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const t=a.Kq.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}const s=a._C.create(e);if(!s.isValid){if(t)throw new l(i.TimeZoneNotRecognized);return null}return s}},98412:(e,t,s)=>{s.d(t,{ID:()=>a,Oo:()=>r,SK:()=>n,SW:()=>o,md:()=>l});var i=s(95247);function r(e){if(null==e)return null;if("number"==typeof e)return e;let t=e.toLowerCase();switch(t=t.replaceAll(/\s/g,""),t=t.replaceAll("-",""),t){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function n(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new i.c({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function a(e){if(null==e)return null;if("number"==typeof e)return e;let t=e.toLowerCase();switch(t=t.replaceAll(/\s/g,""),t=t.replaceAll("-",""),t){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function o(e){if(null==e)return null;const t=e.clone();return void 0!==e.cache._geVersion&&(t.cache._geVersion=e.cache._geVersion),t}function l(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},85304:(e,t,s)=>{s.d(t,{q:()=>l});var i,r,n,a=s(8528),o={exports:{}};i=o,r=function(){function e(s,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,l=i-r+1,u=Math.log(o),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);e(s,i,Math.max(r,Math.floor(i-l*c/o+h)),Math.min(n,Math.floor(i+(o-l)*c/o+h)),a)}var d=s[i],m=r,f=n;for(t(s,r,i),a(s[n],d)>0&&t(s,r,n);m<f;){for(t(s,m,f),m++,f--;a(s[m],d)<0;)m++;for(;a(s[f],d)>0;)f--}0===a(s[r],d)?t(s,r,f):t(s,++f,n),f<=i&&(r=f+1),i<=f&&(n=f-1)}}function t(e,t,s){var i=e[t];e[t]=e[s],e[s]=i}function s(e,t){return e<t?-1:e>t?1:0}return function(t,i,r,n,a){e(t,i,r||0,n||t.length-1,a||s)}},void 0!==(n=r())&&(i.exports=n);const l=(0,a.g)(o.exports)},52888:(e,t,s)=>{s.d(t,{O:()=>o});var i=s(62088),r=s(67432),n=s(9592);class a{constructor(e,t){this._observable=new n.n,this._value=e,this._equalityFunction=t}get value(){return(0,r.am)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=i.YT){return new a(e,t)}},85436:(e,t,s)=>{s.d(t,{K:()=>o});var i=s(10724),r=s(89960),n=s(39452);function a(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let t="";const s=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const i of e.match(s)||[])switch(i){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=i;break;default:i.length>=2&&"["===i.slice(0,1)&&"]"===i.slice(-1)?t+=`'${i.slice(1,-1)}'`:t+=`'${i}'`}return t}class o{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof o&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new o(this._year,this._month,this._day)}toDateTime(e){return n.CS.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,i.YX)(e)})}toDateTimeLuxon(e){return n.CS.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,i.YX)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=a(e)),!e)return"";const s=this.toDateTime("unknown");return i.Ql.dateTimeToArcadeDate(s).toFormat(e,{locale:(0,r.a8)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return i.Ql.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return o.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return n.CS.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=n.CS.fromMillis(e,{zone:n.Kq.utcInstance});return t.isValid?o.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=n.CS.fromSeconds(e,{zone:n.Kq.utcInstance});return t.isValid?o.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return 3!==t.length?null:new o(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const i=new o(e,t,s);return!1===i.isValid?null:i}static fromDateJS(e){return o.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return o.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const s=[];if(t)(t=a(t))&&s.push(t);else if(null===t||""===t){const t=n.CS.fromISO(e,{setZone:!0});return t.isValid?o.fromParts(t.year,t.month,t.day):null}for(const i of s){const s=n.CS.fromFormat(e,t??i);if(s.isValid)return new o(s.year,s.month,s.day)}return null}static fromNow(e="system"){const t=n.CS.fromJSDate(new Date).setZone((0,i.YX)(e));return new o(t.year,t.month,t.day)}}},62024:(e,t,s)=>{s.d(t,{C:()=>o});var i=s(98412),r=s(89960),n=s(39452);function a(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let s="";for(const i of e.match(t)||[])switch(i){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":s+=i;break;case"A":case"a":s+="a";break;default:s+=`'${i}'`}return s}class o{constructor(e,t,s,i){this._hour=e,this._minute=t,this._second=s,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof o&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new o(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,i.md)(this.hour)&&(0,i.md)(this.minute)&&(0,i.md)(this.second)&&(0,i.md)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=a(e))?n.CS.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,r.a8)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,i){const r=new o(e,t,s,i);return r.isValid()?r:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new o(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),i=Math.floor(e/36e5%24),r=Math.floor(e%1e3);return new o(i,s,t,r)}static fromDateJS(e){return new o(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new o(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const s=[];t?(t=a(t))&&s.push(t):null!==t&&""!==t||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const t of s){const s=n.CS.fromFormat(e,t);if(s.isValid)return new o(s.hour,s.minute,s.second,s.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return o.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return n.CS.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},75824:(e,t,s)=>{s.d(t,{Md:()=>n,m0:()=>a,qG:()=>r});var i=s(39452);class r{}function n(e){return e instanceof i.C?e===r.instance:"unknown"===e?.toString().toLowerCase()}function a(e){return n(e)?r.instance:e}r.instance=new i._C("Etc/UTC")},3452:(e,t,s)=>{s.d(t,{O:()=>i});const i={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,s){const i=new r(e.getPointX(t),e.getPointY(t),s),n=e.hasZ(t),a=e.hasM(t);return n&&(i.z=e.getPointZ(t)),a&&(i.m=e.getPointM(t)),i},exportPolygon:function(e,t,s){return new n(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,s){return new a(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,s){return new o(e.exportPoints(t),s,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,s){const i=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),s);if(i){const s=e.getZExtent(t);n.zmin=s.vmin,n.zmax=s.vmax}if(r){const s=e.getMExtent(t);n.mmin=s.vmin,n.mmax=s.vmax}return n}};class r{constructor(e,t,s){this.x=e,this.y=t,this.spatialReference=s,this.z=void 0,this.m=void 0}}class n{constructor(e,t,s,i){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class a{constructor(e,t,s,i){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class o{constructor(e,t,s,i){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class l{constructor(e,t,s,i,r){this.xmin=e,this.ymin=t,this.xmax=s,this.ymax=i,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},77048:(e,t,s)=>{s.d(t,{C6:()=>h,FZ:()=>f,K:()=>T,K8:()=>l,MZ:()=>o,Qv:()=>y,Su:()=>r,UN:()=>S,WK:()=>n,WO:()=>m,WU:()=>a,eC:()=>c,is:()=>p,mK:()=>d,qe:()=>u,qy:()=>g,yK:()=>_});var i=s(95247);function r(e=S){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function n(e,t,s,i,n,a,o=r()){return o[0]=e,o[1]=t,o[2]=s,o[3]=i,o[4]=n,o[5]=a,o}function a(e,t){const s=isFinite(e[2])||isFinite(e[5]);return new i.c(s?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function o(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function u(e,t,s=0,i=t.length/3){let r=e[0],n=e[1],a=e[2],o=e[3],l=e[4],u=e[5];for(let e=0;e<i;e++)r=Math.min(r,t[s+3*e]),n=Math.min(n,t[s+3*e+1]),a=Math.min(a,t[s+3*e+2]),o=Math.max(o,t[s+3*e]),l=Math.max(l,t[s+3*e+1]),u=Math.max(u,t[s+3*e+2]);e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=l,e[5]=u}function c(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function h(e,t,s=e){return s[0]=t[0],s[1]=t[1],s[2]=t[2],s!==e&&(s[3]=e[3],s[4]=e[4],s[5]=e[5]),s}function d(e,t,s=e){return s[3]=t[0],s[4]=t[1],s[5]=t[2],s!==e&&(s[0]=e[0],s[1]=e[1],s[2]=e[2]),e}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function f(e){return e?m(e,T):r(T)}function y(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function g(e,t,s,i,r){return e[0]=t,e[1]=s,e[2]=Number.NEGATIVE_INFINITY,e[3]=i,e[4]=r,e[5]=Number.POSITIVE_INFINITY,e}function p(e){return 6===e.length}function _(e,t,s){if(null==e||null==t)return e===t;if(!p(e)||!p(t))return!1;if(s){for(let i=0;i<e.length;i++)if(!s(e[i],t[i]))return!1}else for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}s(83372);const T=[1/0,1/0,1/0,-1/0,-1/0,-1/0],S=[0,0,0,0,0,0];r()},34888:(e,t,s)=>{s.d(t,{ED:()=>r,_M:()=>i});class i{constructor(e=null,t={},s,i){this.geometry=e,this.attributes=t,this.centroid=s,this.objectId=i,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new i(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}clone(){const e=this.geometry?.clone(),t=new i(e,{...this.attributes},this.centroid?.clone(),this.objectId);return t.displayId=this.displayId,t.geohashX=this.geohashX,t.geohashY=this.geohashY,t}}function r(e){return!!e.geometry?.coords?.length}},90412:(e,t,s)=>{s.d(t,{c:()=>i});class i{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new i;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},85152:(e,t,s)=>{s.d(t,{c:()=>i});class i{constructor(e=[],t=[],s=!1){this.lengths=e??[],this.coords=t??[],this.hasIndeterminateRingOrder=s}static fromRect(e){const[t,s,r,n]=e,a=r-t,o=n-s;return new i([5],[t,s,a,0,0,o,-a,0,0,-o])}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let s=0;s<this.lengths.length;s++){const i=this.lengths[s];for(let s=0;s<i;s++)e(this.coords[2*(s+t)],this.coords[2*(s+t)+1]);t+=i}}deltaDecode(){const e=this.clone(),{coords:t,lengths:s}=e;let i=0;for(const e of s){for(let s=1;s<e;s++)t[2*(i+s)]+=t[2*(i+s)-2],t[2*(i+s)+1]+=t[2*(i+s)-1];i+=e}return e}clone(e){if(0===this.lengths.length)return new i([],[this.coords[0],this.coords[1]]);const t=2*(0===this.lengths.length?1:this.lengths.reduce(((e,t)=>e+t))),s=this.coords.slice(0,t);return e?(e.set(s),new i(this.lengths,e,this.hasIndeterminateRingOrder)):new i(Array.from(this.lengths),Array.from(s),this.hasIndeterminateRingOrder)}}},21008:(e,t,s)=>{function i(e,t){return e?t?4:3:t?3:2}function r(e,t,s,r){if(!t?.lengths.length)return null;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const o=e.coords,l=[],u=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:c,coords:h}=t,d=i(s,r);let m=0;for(const e of c){const t=n(u,h,m,e,s,r);t&&l.push(t),m+=e*d}if(l.sort(((e,t)=>{let i=e[2]-t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),l.length){let e=6*l[0][2];o[0]=l[0][0]/e,o[1]=l[0][1]/e,s&&(e=6*l[0][4],o[2]=0!==e?l[0][3]/e:0),(o[0]<u[0]||o[0]>u[1]||o[1]<u[2]||o[1]>u[3]||s&&(o[2]<u[4]||o[2]>u[5]))&&(o.length=0)}if(!o.length){const e=t.lengths[0]?a(h,0,c[0],s,r):null;if(!e)return null;o[0]=e[0],o[1]=e[1],s&&e.length>2&&(o[2]=e[2])}return e}function n(e,t,s,r,n,a){const o=i(n,a);let l=s,u=s+o,c=0,h=0,d=0,m=0,f=0;for(let s=0,i=r-1;s<i;s++,l+=o,u+=o){const s=t[l],i=t[l+1],r=t[l+2],a=t[u],o=t[u+1],y=t[u+2];let g=s*o-a*i;m+=g,c+=(s+a)*g,h+=(i+o)*g,n&&(g=s*y-a*r,d+=(r+y)*g,f+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(m>0&&(m*=-1),f>0&&(f*=-1),!m)return null;const y=[c,h,.5*m];return n&&(y[3]=d,y[4]=.5*f),y}function a(e,t,s,r,n){const a=i(r,n);let h=t,d=t+a,m=0,f=0,y=0,g=0;for(let t=0,i=s-1;t<i;t++,h+=a,d+=a){const t=e[h],s=e[h+1],i=e[h+2],n=e[d],a=e[d+1],p=e[d+2],_=r?l(t,s,i,n,a,p):o(t,s,n,a);if(_)if(m+=_,r){const e=c(t,s,i,n,a,p);f+=_*e[0],y+=_*e[1],g+=_*e[2]}else{const e=u(t,s,n,a);f+=_*e[0],y+=_*e[1]}}return m>0?r?[f/m,y/m,g/m]:[f/m,y/m]:s>0?r?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function o(e,t,s,i){const r=s-e,n=i-t;return Math.sqrt(r*r+n*n)}function l(e,t,s,i,r,n){const a=i-e,o=r-t,l=n-s;return Math.sqrt(a*a+o*o+l*l)}function u(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function c(e,t,s,i,r,n){return[e+.5*(i-e),t+.5*(r-t),s+.5*(n-s)]}s.d(t,{E:()=>r})},47302:(e,t,s)=>{s.d(t,{U:()=>Ue});var i=s(92400),r=s(20744),n=s(40504),a=s(62088),o=s(70680),l=s(74452),u=s(10860),c=s(24296),h=s(60074),d=s(77048),m=s(83372),f=s(33008),y=s(6704),g=s(20480),p=s(60544),_=s(97088),T=s(11004),S=s(63220),I=s(36408);const x=new class{constructor(e,t){this._cache=new T.o(e),this._invalidCache=new T.o(t)}get(e,t){const s=`${t.uid}:${e}`,i=this._cache.get(s);if(i)return i;if(null!=this._invalidCache.get(s))return null;try{const i=S.WhereClause.create(e,t);return this._cache.put(s,i),i}catch(e){return this._invalidCache.put(s,e),null}}getError(e,t){const s=`${t.uid}:${e}`;return this._invalidCache.get(s)??null}}(50,500),F="unsupported-query",w=" as ",E=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),R=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),b=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...E,...R]);function N(e,t,s={}){const i=M(t,e);if(!i){const s=x.getError(t,e);throw new r.c(F,"invalid SQL expression",{expression:t,error:s})}const n=s.expressionName||"expression";if(s.validateStandardized&&!i.isStandardized)throw new r.c(F,`${n} is not standard`,{expression:t});if(s.validateAggregate&&!i.isAggregate)throw new r.c(F,`${n} does not contain a valid aggregate function`,{expression:t});return i.fieldNames}function C(e,t,s,i,n){if(!s)return!0;const a="having clause",o=N(e,s,{validateAggregate:!0,expressionName:a});D(e,t,o,{expressionName:a,query:n});const l=M(s,e),u=l?.getExpressions().every((t=>{const{aggregateType:s,field:r}=t,n=e.get(r)?.name;return i.some((t=>{const{onStatisticField:i,statisticType:r}=t,a=e.get(i)?.name;return a===n&&r.toLowerCase().trim()===s}))}));if(!u)throw new r.c(F,"expressions in having clause should also exist in outStatistics",{having:s});return!0}function M(e,t){return e?x.get(e,t):null}function A(e){return/\((.*?)\)/.test(e)?e:e.split(w)[0]}function v(e){return e.split(w)[1]}function D(e,t,s,i={}){const n=new Map;if(function(e,t,s,i,r){const n=r.includes("*")?[...s,...r.filter((e=>"*"!==e))]:r;for(const r of n)if(t.get(r))O(e,t,s,i,r);else try{const n=N(t,A(r),{validateStandardized:!0});for(const r of n)O(e,t,s,i,r)}catch(t){e.set(r,{type:"expression-error",expression:r,error:t})}}(n,e,t,i.allowedFieldTypes??b,s),n.size){const e=i.expressionName??"expression";throw new r.c(F,`${e} contains invalid or missing fields`,{errors:Array.from(n.values()),query:i.query})}}function O(e,t,s,i,r){const n=t.get(r);n?s.has(n.name)?"all"!==i&&!1===i?.has(n.type)&&e.set(r,{type:"invalid-type",fieldName:n.name,fieldType:I.M.fromJSON(n.type),allowedFieldTypes:Array.from(i,(e=>I.M.fromJSON(e)))}):e.set(r,{type:"missing-field",fieldName:n.name}):e.set(r,{type:"invalid-field",fieldName:r})}var k=s(83624),P=s(7684),G=s(13136),U=s(95788),L=s(96784),q=s(42736),Z=s(564),V=s(41664),Q=s(76160),z=s(6384);class Y{constructor(e,t,s){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=s,this.featureAdapter=t;const i=e.outFields;if(i&&!i.includes("*")){this.outFields=i;let e=0;for(const t of i){const i=A(t),r=this.fieldsIndex.get(i),n=r?null:M(i,s),a=r?r.name:v(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,s){const i=s?s.name:t;let r=null;return this._fieldDataCache.has(i)?r=this._fieldDataCache.get(i)?.clause:s||(r=M(t,this.fieldsIndex),this._fieldDataCache.set(i,{alias:i,clause:r})),s?this.featureAdapter.getAttribute(e,i):r?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,s=!0){const i=t.normalizationType,r=t.normalizationTotal,n=this.fieldsIndex.get(t.field),a=(0,Z.yM)(n)||(0,Z.Oo)(n),o=(0,Z.eM)(n);return e.map((e=>{let n=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2?(n=`${(0,Q.O6)(n)}${t.fieldDelimiter}${(0,Q.O6)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(n=`${n}${t.fieldDelimiter}${(0,Q.O6)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)):"string"==typeof n&&s&&(a?n=n?new Date(n).getTime():null:o&&(n=n?(0,V.Mr)(n):null)),i&&Number.isFinite(n)){const s="field"===i&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;n=(0,Q.m2)(n,i,s,r)}return n}))}async getExpressionValues(e,t,s,i,r){const{arcadeUtils:n}=await(0,z.uK)(),a=n.hasGeometryOperations(t);a&&await n.enableGeometryOperations();const o=n.createFunction(t),l=n.getViewInfo(s),u={fields:this.fieldsIndex.fields};return e.map((e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:u,geometry:a?{...(0,k.uo)(i.geometryType,i.hasZ,i.hasM,this.featureAdapter.getGeometry(e)),spatialReference:s?.spatialReference}:null},c=n.createExecContext(t,l,r);return n.executeFunction(o,c)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:M(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:M(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const s={};for(const i of t){const{alias:t,clause:r}=this._fieldDataCache.get(i);s[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return s}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,s=[];if(t)for(const i of t){const{alias:t}=this._fieldDataCache.get(i);s.push(e[t])}else for(const t in e)s.push(e[t]);const i=`${(t||["*"]).join(",")}=${s.join(",")}`;let r=this._returnDistinctMap.get(i)||0;return this._returnDistinctMap.set(i,++r),r>1?null:e}}function j(e,t,s){return{objectId:e,target:t,distance:s,type:"vertex"}}function B(e,t,s,i,r,n=!1){return{objectId:e,target:t,distance:s,type:"edge",start:i,end:r,draped:n}}class ${constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new Y(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of i){const{statisticType:i}=r,l="exceedslimit"!==i?r.onStatisticField:void 0;if(!a.has(l)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,n);s.push(t)}a.set(l,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:i,items:r}=u[t],n=i.join(",");s&&!e.validateItems(r,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,p.U3)(this.query.outSR)&&!(0,p.yK)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,k.C6)({spatialReference:this.query.outSR,...(0,P.yU)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,k.C6)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=K(this.hasZ,this.hasM),{point:r,mode:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=this._getPointCreator(n,this.spatialReference,t),h=new W(null,0),d=new W(null,0),m={x:0,y:0,z:0};for(const t of this.items){const n=s.getGeometry(t);if(null==n)continue;const{coords:f,lengths:y}=n;if(h.coords=f,d.coords=f,e.returnEdge){let e=0;for(let n=0;n<y.length;n++){const u=y[n];for(let n=0;n<u;n++,e+=i){const f=h;if(f.coordsIndex=e,n!==u-1){const n=d;n.coordsIndex=e+i;const u=m;H(m,r,f,n);const h=(r.x-u.x)/a,y=(r.y-u.y)/o,g=h*h+y*y;g<=1&&l.candidates.push(B(s.getObjectId(t),c(u),Math.sqrt(g),c(f),c(n)))}}}}if("none"!==e.vertexMode){const n=u?f.length-i:f.length;if("all"===e.vertexMode)for(let e=0;e<n;e+=i){const i=h;i.coordsIndex=e;const n=(r.x-i.x)/a,u=(r.y-i.y)/o,d=n*n+u*u;d<=1&&l.candidates.push(j(s.getObjectId(t),c(i),Math.sqrt(d)))}else if("ends"===e.vertexMode){const e=[0];u||e.push(f.length-i);for(const i of e){const e=h;e.coordsIndex=i;const n=(r.x-e.x)/a,u=(r.y-e.y)/o,d=n*n+u*u;d<=1&&l.candidates.push(j(s.getObjectId(t),c(e),Math.sqrt(d)))}}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s){const i=null==s||(0,p.yK)(t,s)?e=>e:e=>(0,P.yU)(e,t,s),{hasZ:r}=this;return"3d"===e?r?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:0}):({x:e,y:t})=>i({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l,timeZone:u}=e,c=this.fieldsIndex.get(t),h=(0,Z.gp)(c)||(0,Z.yM)(c)||(0,Z.Oo)(c),d=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:l,timeZone:u}),m=(0,Q.uu)({normalizationType:r,normalizationField:i,minValue:a,maxValue:o}),f={value:.5,fieldType:c?.type},y=(0,Z.AZ)(c)?(0,Q.Qv)({values:d,supportsNullCount:m,percentileParams:f}):(0,Q.hU)({values:d,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:m,percentileParams:f});return(0,Q.Oq)(y,h)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:r,scale:n,timeZone:a}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n,timeZone:a},!1),l=(0,Q.o9)(o);return(0,Q.ID)(l,i,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:h,timeZone:d}=e,m=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h,timeZone:d}),f=(0,Q.wj)(m,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,Q.cJ)(f,a)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:h,timeZone:d}=e,m=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h,timeZone:d});return(0,Q.UP)(m,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const t=i.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,Q.rZ)(n?.type,a);e.sort(((e,t)=>{const i=s(e,r,n),a=s(t,r,n);return o(i,a)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:r,objectIdField:n,spatialReference:a}=this,{outFields:o,outSR:l,quantizationParameters:u,resultRecordCount:c,resultOffset:h,returnZ:d,returnM:m}=e,f=null!=c&&t.length>(h||0)+c,y=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:y,geometryType:s,hasM:i&&m,hasZ:r&&d,objectIdFieldName:n,spatialReference:(0,k.C6)(l||a),transform:u&&(0,q.eE)(u)||null}}_createFeatures(e,t){const s=new Y(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:r}=this,{orderByFields:n,quantizationParameters:a,returnGeometry:o,returnCentroid:l,maxAllowableOffset:u,resultOffset:c,resultRecordCount:h,returnZ:d=!1,returnM:m=!1}=e,f=r&&d,y=i&&m;let g=[],p=0;const _=[...t];if(this._sortFeatures(_,n,((e,t,i)=>s.getFieldValue(e,t,i))),this.geometryType&&(o||l)){const e=(0,q.eE)(a)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(o&&!l)for(const i of _){const r=this.featureAdapter.getGeometry(i),n={attributes:s.getAttributes(i),geometry:(0,k.uo)(this.geometryType,this.hasZ,this.hasM,r,u,e,f,y)};t&&r&&!n.geometry&&(n.centroid=(0,k.AT)(this,this.featureAdapter.getCentroid(i,this),e)),g[p++]=n}else if(!o&&l)for(const t of _)g[p++]={attributes:s.getAttributes(t),centroid:(0,k.AT)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of _)g[p++]={attributes:s.getAttributes(t),centroid:(0,k.AT)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,k.uo)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),u,e,f,y)}}else for(const e of _){const t=s.getAttributes(e);t&&(g[p++]={attributes:t})}const T=c||0;if(null!=h){const e=T+h;g=g.slice(T,Math.min(g.length,e))}return g}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(const t of e.outStatistics??[])if("exceedslimit"===t.statisticType){s=null!=t.maxPointCount?t.maxPointCount:Number.POSITIVE_INFINITY,i=null!=t.maxRecordCount?t.maxRecordCount:Number.POSITIVE_INFINITY,r=null!=t.maxVertexCount?t.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>i)t=!0;else{const e=K(this.hasZ,this.hasM),s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)}),0)/e>r}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,r=new Map,n=new Map,a=new Map,o=new Y(e,this.featureAdapter,this.fieldsIndex),l=e.outStatistics,{groupByFieldsForStatistics:u,having:c,orderByFields:h,resultRecordCount:d}=e,m=u?.length,f=!!m,y=f?u[0]:null,g=f&&!this.fieldsIndex.get(y);for(const e of l??[]){const{outStatisticFieldName:l,statisticType:h}=e,d=e,p="exceedslimit"!==h?e.onStatisticField:void 0,_="percentile_disc"===h||"percentile_cont"===h,T="EnvelopeAggregate"===h||"CentroidAggregate"===h||"ConvexHullAggregate"===h,S=f&&1===m&&(p===y||g)&&"count"===h;if(f){if(!n.has(p)){const e=[];for(const t of u){const s=this._getAttributeValues(o,t,i);e.push(s)}n.set(p,this._calculateUniqueValues(e,!T&&o.returnDistinctValues))}const e=n.get(p);if(!e)continue;const t=Object.keys(e);for(const s of t){const{count:t,data:r,items:n,itemPositions:h}=e[s],m=r.join(",");if(!c||o.validateItems(n,c)){const e=a.get(m)||{attributes:{}};if(T){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:s}=await this._getAggregateGeometry(d,n);e.aggregateGeometries[s]=t}else{let s=null;if(S)s=t;else{const e=this._getAttributeValues(o,p,i),t=h.map((t=>e[t]));s=_&&"statisticParameters"in d?this._getPercentileValue(d,t):this._getStatisticValue(d,t,null,o.returnDistinctValues)}e.attributes[l]=s}let s=0;u.forEach(((t,i)=>e.attributes[this.fieldsIndex.get(t)?t:"EXPR_"+ ++s]=r[i])),a.set(m,e)}}}else if(T){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(d,this.items);t.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(o,p,i);t.attributes[l]=_&&"statisticParameters"in d?this._getPercentileValue(d,e):this._getStatisticValue(d,e,r,o.returnDistinctValues)}const I="min"!==h&&"max"!==h||!(0,Z.AZ)(this.fieldsIndex.get(p))&&!this._isAnyDateField(p)?null:this.fieldsIndex.get(p)?.type;s.push({name:l,alias:l,type:I||"esriFieldTypeDouble"})}const p=f?Array.from(a.values()):[t];return this._sortFeatures(p,h,((e,t)=>e.attributes[t])),d&&(p.length=Math.min(d,p.length)),{fields:s,features:p}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return(0,Z.gp)(t)||(0,Z.yM)(t)||(0,Z.Oo)(t)||(0,Z.eM)(t)}async _getAggregateGeometry(e,t){const{convexHull:i,union:r}=await Promise.all([s.e(984),s.e(324)]).then(s.bind(s,82704)),{statisticType:n,outStatisticFieldName:a}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map((e=>(0,k.uo)(u,c,h,o.getGeometry(e)))),m=i(l,d,!0)[0],f={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===n){const e=m?(0,L.wt)(m):(0,L.GQ)(r(l,d));f.aggregateGeometries={...e,spatialReference:l},f.outStatisticFieldName=a||"extent"}else if("CentroidAggregate"===n){const e=m?(0,U.cv)(m):(0,U.MZ)((0,L.GQ)(r(l,d)));f.aggregateGeometries={x:e[0],y:e[1],spatialReference:l},f.outStatisticFieldName=a||"centroid"}else"ConvexHullAggregate"===n&&(f.aggregateGeometries=m,f.outStatisticFieldName=a||"convexHull");return f}_getStatisticValue(e,t,s,i){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=s?.has(r)?s.get(r):(0,Z.AZ)(this.fieldsIndex.get(r))||this._isAnyDateField(r)?(0,Q.Qv)({values:t,returnDistinct:i}):(0,Q.hU)({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:r}=e,{value:n,orderBy:a}=i,o=this.fieldsIndex.get(s);return(0,Q.GE)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),r=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,r),r}_calculateUniqueValues(e,t){const s={},i=this.items,r=i.length;for(let n=0;n<r;n++){const r=i[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(t||s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e,t=!0){const s=new Y(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:i,scale:r,timeZone:n}=e;return i?s.getExpressionValues(this.items,i,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},n):s.getDataValues(this.items,(0,a.ct)(e),t)}}function H(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,a=r*r+n*n,o=(t.x-s.x)*r+(t.y-s.y)*n,l=Math.min(1,Math.max(0,o/a));e.x=s.x+r*l,e.y=s.y+n*l}function K(e,t){return e?t?4:3:t?3:2}class W{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}var J=s(3900),X=s(79596);const ee="unsupported-query";async function te(e,{fieldsIndex:t,geometryType:s,spatialReference:i,availableFields:n}){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption&&"xyFootprint"!==e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.c(ee,"Unsupported query options",{query:e});return se(t,n,e),function(e,t,s){const{outStatistics:i,groupByFieldsForStatistics:n,having:a}=s,o=n?.length,l=i?.length;if(a){if(!o||!l)throw new r.c(ee,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:s});C(e,t,a,i,s)}if(l){if(!function(e){return null!=e&&e.every((e=>"exceedslimit"!==e.statisticType))}(i))return;const a=i.map((e=>e.onStatisticField)).filter(Boolean);D(e,t,a,{expressionName:"onStatisticFields",query:s}),o&&D(e,t,n,{expressionName:"groupByFieldsForStatistics",query:s});for(const n of i){const{onStatisticField:i,statisticType:a}=n;if("percentile_disc"!==a&&"percentile_cont"!==a||!("statisticParameters"in n))e.get(i)&&"count"!==a&&"min"!==a&&"max"!==a&&D(e,t,[i],{expressionName:`outStatistics with '${a}' statistic type`,allowedFieldTypes:ie,query:s});else{const{statisticParameters:e}=n;if(!e)throw new r.c(ee,"statisticParameters should be set for percentile type",{definition:n,query:s})}}}}(t,n,e),Promise.all([(0,X.a)(e,s,i),(0,P.Qv)(i,e.outSR)]).then((()=>e))}function se(e,t,s){const{outFields:i,orderByFields:n,returnDistinctValues:a,outStatistics:o}=s,l=o?o.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(n&&n.length>0){const i=" asc",r=" desc",a=n.map((e=>{const t=e.toLowerCase();return t.includes(i)?t.split(i)[0]:t.includes(r)?t.split(r)[0]:e})).filter((e=>!l.includes(e)));D(e,t,a,{expressionName:"orderByFields",query:s})}if(i&&i.length>0)D(e,t,i,{expressionName:"outFields",query:s,allowedFieldTypes:"all"});else if(a)throw new r.c(ee,"outFields should be specified for returnDistinctValues",{query:s});!function(e,t,s,i){if(!s)return!0;const r="where clause";D(e,t,N(e,s,{validateStandardized:!0,expressionName:r}),{expressionName:r,query:i})}(e,t,s.where,s)}const ie=new Set([...E,...R]);async function re(e,t,s,i){let n=[];if(s.valueExpression){const{arcadeUtils:e}=await(0,z.uK)();n=e.extractFieldNames(s.valueExpression)}if(s.field&&n.push(s.field),s.field2&&n.push(s.field2),s.field3&&n.push(s.field3),s.normalizationField&&n.push(s.normalizationField),!n.length&&!s.valueExpression)throw new r.c(ee,"field or valueExpression is required",{params:s});D(e,t,n,{expressionName:"statistics",query:i})}var ne=s(78104),ae=s(16424),oe=s(44980),le=(s(9456),s(66360)),ue=s(44916),ce=s(24680),he=s(57896),de=s(52888),me=s(82003);const fe=Symbol("Yield");class ye{constructor(){this._tasks=new Array,this._runningTasks=(0,de.O)(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(e){if(0===this.length)return fe;for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,s){return++this._runningTasks.value,new Promise(((i,r)=>this._tasks.push(new ge(i,r,e,t,s)))).finally((()=>--this._runningTasks.value))}unshift(e,t,s){return++this._runningTasks.value,new Promise(((i,r)=>this._tasks.unshift(new ge(i,r,e,t,s)))).finally((()=>--this._runningTasks.value))}_process(e){if(0===this._tasks.length)return!1;const t=this._tasks.shift();try{const s=(0,u.wv)(t.signal);if(s&&!t.abortCallback)t.reject((0,u.Uh)());else{const i=s?t.abortCallback?.((0,u.Uh)()):t.callback(e);(0,u.eW)(i)?i.then(t.resolve,t.reject):t.resolve(i)}}catch(e){t.reject(e)}return!0}cancelAll(){const e=(0,u.Uh)();for(const t of this._tasks)if(t.abortCallback){const s=t.abortCallback(e);t.resolve(s)}else t.reject(e);this._tasks.length=0}}class ge{constructor(e,t,s,i=void 0,r=void 0){this.resolve=e,this.reject=t,this.callback=s,this.signal=i,this.abortCallback=r}}var pe=s(41948),_e=s(43780),Te=s(1580),Se=(s(72052),s(12552));let Ie=class extends _e.c{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,pe._)([(0,Te.qq)()],Ie.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,pe._)([(0,Te.qq)()],Ie.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),Ie=(0,pe._)([(0,Se.c)("esri.views.support.DebugFlags")],Ie);const xe=new Ie;var Fe,we=s(27308);!function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(Fe||(Fe={}));const Ee=new Map([[Fe.RESOURCE_CONTROLLER_IMMEDIATE,0],[Fe.RESOURCE_CONTROLLER,4],[Fe.SLIDE,0],[Fe.STREAM_DATA_LOADER,0],[Fe.ELEVATION_QUERY,0],[Fe.TERRAIN_SURFACE,1],[Fe.SURFACE_GEOMETRY_UPDATES,1],[Fe.LOD_RENDERER,2],[Fe.GRAPHICS_CORE,2],[Fe.I3S_CONTROLLER,2],[Fe.POINT_CLOUD_LAYER,2],[Fe.FEATURE_TILE_FETCHER,2],[Fe.OVERLAY,4],[Fe.STAGE,4],[Fe.GRAPHICS_DECONFLICTOR,4],[Fe.FILTER_VISIBILITY,4],[Fe.SCALE_VISIBILITY,4],[Fe.FRUSTUM_VISIBILITY,4],[Fe.CLOUDS_GENERATOR,4],[Fe.POINT_OF_INTEREST_FREQUENT,6],[Fe.POINT_OF_INTEREST_INFREQUENT,30],[Fe.LABELER,8],[Fe.FEATURE_QUERY_ENGINE,8],[Fe.FEATURE_TILE_TREE,16],[Fe.FEATURE_TILE_TREE_ACTIVE,0],[Fe.ELEVATION_ALIGNMENT,12],[Fe.ELEVATION_ALIGNMENT_SCENE,14],[Fe.TEXT_TEXTURE_ATLAS,12],[Fe.TEXTURE_UNLOAD,12],[Fe.LINE_OF_SIGHT_TOOL,16],[Fe.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[Fe.SNAPPING,0],[Fe.SHADOW_ACCUMULATOR,30]]);function Re(e){return Ee.has(e)?Ee.get(e):"number"==typeof e?e:1}const be=(0,me.w$)(6.5),Ne=(0,me.w$)(1),Ce=(0,me.w$)(30),Me=(0,me.w$)(1e3/30),Ae=(0,me.w$)(100);var ve,De;!function(e){e.Scheduler=class{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some((e=>e.needsUpdate))}constructor(){this._updating=(0,de.O)(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new ue.c("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new s,this._state=we.K.INTERACTING,this._tasks=new ce.c,this._runQueue=new ce.c,this._load=0,this._idleStateCallbacks=new ce.c,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=(0,he.aE)((()=>xe.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),he._8);for(const e of Object.keys(Fe))this.performanceInfo.tasks.set(Fe[e],new ue.c(Fe[e]));const e=this;this._test={FRAME_SAFETY_BUDGET:be,INTERACTING_BUDGET:Me,IDLE_BUDGET:Ae,get availableBudget(){return e._budget.budget},usedBudget:0,getBudget:()=>e._budget,setBudget:t=>e._budget=t,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),(0,o.oR)(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())})))}registerTask(e,s){const i=new t(this,e,s);return this._tasks.push(i),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new ue.c(e)),i}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===we.K.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const i=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){i._idleUpdatesStartFired&&(s.idleEnd(),i._state===we.K.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==we.K.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return this._state}updateBudget(e){this._test.usedBudget=0,++this._frameNumber;let t=be,s=e.frameDuration,i=Ne;switch(this.state){case we.K.IDLE:t=(0,me.w$)(0),s=(0,me.w$)(Math.max(Ae,e.frameDuration)),i=Ce;break;case we.K.INTERACTING:s=(0,me.w$)(Math.max(Me,e.frameDuration));case we.K.ANIMATING:}return s=(0,me.w$)(s-e.elapsedFrameTime-t),this.state!==we.K.IDLE&&s<Ne&&!this._forceTask?(this._forceTask=!0,!1):(s=(0,me.w$)(Math.max(s,i)),this._budget.reset(s,this.state),this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case we.K.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case we.K.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset((0,me.w$)(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return De.SCHEDULED;let t=De.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=De.READY:t!==De.READY&&(t=De.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=.9*this._load+e*(1-.9)}_schedule(){for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{0===e.basePriority&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{s.needsUpdate&&0!==s.schedulePriority&&0!==s.basePriority&&s.blockFrame!==this._frameNumber&&(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority?(s.schedulePriority=0,this._runQueue.push(s)):--s.schedulePriority)})),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===fe&&(s.blockFrame=this._frameNumber)}catch(e){le.c.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e),s.blockFrame=this._frameNumber}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,Fe.I3S_CONTROLLER,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now()-t;if(s.runtime+=i,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+i),this._debug&&i>2*this._budget.budget&&console.log("Task",s.name,"used",i,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(Fe))this._frameTaskTimes.set(Fe[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).record(e))),this.performanceInfo.total.record(e)}get test(){return this._test}};class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,t,s){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new ye,this._handles=new oe.c,this._basePriority=Re(t),this.schedulePriority=this._basePriority,this._task=(0,de.O)(null!=s?s:this._queue),this._handles.add((0,he._I)((()=>this.task.running),(t=>e.taskRunningChanged(t))))}remove(){this.processQueue(Oe),this._scheduler.removeTask(this),this.schedule=ke.schedule,this.reschedule=ke.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=Re(e);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){return this._queue.runTask(e)}}class s{constructor(){this._begin="undefined"!=typeof performance?performance.now():0,this._budget=0,this._state=we.K.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}e.Budget=s}(ve||(ve={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(De||(De={}));const Oe=(()=>{const e=new ve.Budget;return e.enabled=!1,e})(),ke=new class{remove(){}processQueue(){}schedule(e,t,s){try{if((0,u.wv)(t)){const e=(0,u.Uh)();return s?Promise.resolve(s(e)):Promise.reject(e)}return(0,u._I)(e(Oe))}catch(e){return Promise.reject(e)}}reschedule(e,t,s){return this.schedule(e,t,s)}},Pe=new l.kB(2e6);let Ge=0;class Ue{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:G.u},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",(()=>this.clearCache())),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new l.ML(Ge+++"$$",Pe)),this.fieldsIndex=(0,n.wt)(e.fieldsIndex)?e.fieldsIndex:ae.c.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map((e=>e.name))):this.availableFields=new Set(e.availableFields.map((e=>this.fieldsIndex.get(e)?.name)).filter((e=>null!=e))),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=(0,o.oR)(this._frameTask),this.clearCache(),(0,o.mG)(this._geometryQueryCache),this._changeHandle=(0,o.oR)(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=(0,u.YF)(t);try{return(await this._executeQuery(e,{},s)).createQueryResponse()}catch(t){if(t!==J.gl)throw t;return new $([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=(0,u.YF)(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(e){if(e!==J.gl)throw e;return 0}}async executeQueryForExtent(e,t){const s=(0,u.YF)(t),i=e.outSR;try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=t.size;return r?{count:r,extent:await this._getBounds(t.items,t.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(e){if(e===J.gl)return{count:0,extent:null};throw e}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){const s=(0,u.YF)(t);try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),i=t.items,r=new Set;return await this._reschedule((()=>{for(const e of i)r.add(t.featureAdapter.getObjectId(e))}),s),r}catch(e){if(e===J.gl)return new Set;throw e}}async executeQueryForSnapping(e,t){const s=(0,u.YF)(t),{point:i,distance:r,returnEdge:n,vertexMode:o}=e;if(!n&&"none"===o)return{candidates:[]};let l=(0,a.ct)(e.query);l=await this._schedule((()=>(0,J._8)(l,this.definitionExpression,this.spatialReference)),s),l=await this._reschedule((()=>te(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s);const c=!(0,p.yK)(i.spatialReference,this.spatialReference);c&&await(0,P.Qv)(i.spatialReference,this.spatialReference);const h="number"==typeof r?r:r.x,d="number"==typeof r?r:r.y,m={xmin:i.x-h,xmax:i.x+h,ymin:i.y-d,ymax:i.y+d,spatialReference:i.spatialReference},f=c?(0,P.yU)(m,this.spatialReference):m;if(!f)return{candidates:[]};const _=(await(0,g.WW)((0,y.h4)(i),null,{signal:s}))[0],T=(await(0,g.WW)((0,y.h4)(f),null,{signal:s}))[0];if(null==_||null==T)return{candidates:[]};const S=new $(await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(T.toJSON()))),s),l,this);await this._reschedule((()=>this._executeObjectIdsQuery(S)),s),await this._reschedule((()=>this._executeTimeQuery(S)),s),await this._reschedule((()=>this._executeAttributesQuery(S)),s),await this._reschedule((()=>this._executeGeometryQueryForSnapping(S,s)),s);const I=_.toJSON(),x=c?(0,P.yU)(I,this.spatialReference):I,F=c?Math.max(f.xmax-f.xmin,f.ymax-f.ymin)/2:r;return S.createSnappingResponse({...e,point:x,distance:F},i.spatialReference)}async executeQueryForLatestObservations(e,t){const s=(0,u.YF)(t);if(!this.timeInfo?.trackIdField)throw new r.c("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const t=await this._executeQuery(e,{},s);return await this._reschedule((()=>this._filterLatest(t)),s),t.createQueryResponse()}catch(t){if(t!==J.gl)throw t;return new $([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const i=(0,u.YF)(s),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=(0,u.YF)(s),{field:r,field2:n,field3:a,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:r,field2:n,field3:a,valueExpression:o},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=(0,u.YF)(s),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=(0,u.YF)(s),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=(0,u.YF)(e);this._timeExtentPromise||=(0,ne.y)(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return(0,u.wp)(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=(0,d.WO)((0,d.Su)(),d.K);await this.featureStore.forEachBounds(e,(e=>(0,d.MZ)(i,e)));const r={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:(0,k.C6)(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(r.zmin=i[2],r.zmax=i[5]);const n=(0,P.yU)(r,t,s);if(n.spatialReference=(0,k.C6)(s),n.xmax-n.xmin==0){const e=(0,c.k8)(n.spatialReference);n.xmin-=e,n.xmax+=e}if(n.ymax-n.ymin==0){const e=(0,c.k8)(n.spatialReference);n.ymin-=e,n.ymax+=e}if(this.hasZ&&null!=n.zmin&&null!=n.zmax&&n.zmax-n.zmin==0){const e=(0,c.k8)(n.spatialReference);n.zmin-=e,n.zmax+=e}return n}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then((e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async _schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(Oe)}async _reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(Oe)}async _getAllFeaturesQueryEngineResult(e){return new $(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach((t=>e.push(t)))})().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=(0,a.ct)(e),e=await this._schedule((()=>(0,J.on)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>te(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s),e={...e,...t};const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this._reschedule((()=>this._executeObjectIdsQuery(r)),s),await this._reschedule((()=>this._executeTimeQuery(r)),s),await this._reschedule((()=>this._executeAttributesQuery(r)),s),r}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,o=null==n||(0,p.yK)(n,a.spatialReference)?a:(0,P.yU)(a,n);if(!o)return null;const l=i||r,u=(0,p.U3)(s)&&!(0,p.yK)(this.spatialReference,s)&&l?async e=>this._project(e,s):e=>e,c=this.featureAdapter,h=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(o))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const s=new Set;for(const e of h)s.add(c.getObjectId(e));const i=await this._reschedule((()=>this._getAllFeatures()),t),r=await this._reschedule((async()=>{const r=await(0,X.q0)("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(i,(e=>!s.has(c.getObjectId(e))||r(c.getGeometry(e))),t);return new $(n,e,this)}),t);return u(r)}if(!h.length)return new $([],e,this);if(this._canExecuteSinglePass(o,e))return u(new $(h,e,this));const d=await(0,X.q0)("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),m=await this._runSpatialFilter(h,(e=>d(c.getGeometry(e))),t);return u(new $(m,e,this))}async _executeGeometryQuery(e,t,s){if(null!=t&&0===t.items.length)return t;e=null!=t?t.query:e;const{geometry:r,outSR:n,spatialRel:a,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!r||null==u||(0,p.yK)(u,r.spatialReference)?r:(0,P.yU)(r,u),h=o||l,d=(0,p.U3)(n)&&!(0,p.yK)(this.spatialReference,n),m=this._geometryQueryCache&&null==t?d&&h?JSON.stringify({originalFilterGeometry:r,spatialRelationship:a,outSpatialReference:n}):JSON.stringify({originalFilterGeometry:r,spatialRelationship:a}):null,f=m?this._geometryQueryCache.get(m):null;if(null!=f)return new $(f,e,this);const y=async e=>(d&&h&&await this._project(e,n),m&&this._geometryQueryCache.put(m,e.items,e.items.length+1),e);if(!c)return y(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const g=this.featureAdapter;let _=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(r))),s);if("esriSpatialRelDisjoint"===a){if(!_.length)return y(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of _)i.add(g.getObjectId(e));const r=null!=t?t.items:await this._reschedule((()=>this._getAllFeatures()),s),n=await this._reschedule((async()=>{const t=await(0,X.q0)(a,c,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(r,(e=>!i.has(g.getObjectId(e))||t(g.getGeometry(e))),s);return new $(n,e,this)}),s);return y(n)}if(null!=t){const e=new i.is;_=_.filter((s=>(0,i.IP)(t.items,s,t.items.length,e)>=0))}if(!_.length){const t=new $([],e,this);return m&&this._geometryQueryCache.put(m,t.items,1),t}if(this._canExecuteSinglePass(c,e))return y(new $(_,e,this));const T=await(0,X.q0)(a,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(_,(e=>T(g.getGeometry(e))),s);return y(new $(S,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:s}=e,{spatialRel:i}=s;if(!e?.items?.length||!s.geometry||!i)return;const r=await(0,X.q0)(i,s.geometry,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(e.items,(e=>r(e.geometry)),t);e.items=n}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const s of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(s).forEach((e=>t.add(e)));const s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,ne.k)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=M(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let i=0;const r=new Array,n=async a=>{for(;i<e.length;){const o=e[i++];t(o)&&(r.push(o),a.madeProgress()),a.done&&await this._reschedule((e=>n(e)),s)}};return this._reschedule((e=>n(e)),s).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,n=new Map,a=this.featureAdapter.getAttribute;for(const s of e.items){const e=a(s,t),i=a(s,r),o=n.get(e);(!o||i>a(o,r))&&n.set(e,s)}e.items=Array.from(n.values())}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return(0,X.aS)(e)&&("esriSpatialRelEnvelopeIntersects"===s||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===s||"esriSpatialRelContains"===s))}async _project(e,t){if(!t||(0,p.yK)(this.spatialReference,t))return e;const s=this.featureAdapter;let i;try{const e=await this._getFullExtent();i=(0,h.getTransformation)(this.spatialReference,t,e)}catch{}const r=await(0,P.eW)(e.items.map((e=>(0,k.uo)(this.geometryType,this.hasZ,this.hasM,s.getGeometry(e)))),this.spatialReference,t,i);return e.items=r.map(((t,i)=>s.cloneWithGeometry(e.items[i],(0,_.C)(t,this.hasZ,this.hasM)))),e}_getQueryBBoxes(e){if((0,X.aS)(e)){if((0,y.Ul)(e))return[(0,m.WK)(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if((0,y.Cs)(e))return e.rings.map((e=>(0,m.WK)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[(0,f.ac)((0,m.Su)(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=(0,a.ct)(e);try{e=await this._schedule((()=>(0,J.on)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>async function(e,t,{fieldsIndex:s,geometryType:i,spatialReference:n,availableFields:a}){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.c(ee,"Unsupported query options",{query:e});return se(s,a,e),Promise.all([re(s,a,t,e),(0,X.a)(e,i,n),(0,P.Qv)(n,e.outSR)]).then((()=>e))}(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),s);const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),n=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(n)),s),await this._reschedule((()=>this._executeObjectIdsQuery(n)),s),await this._reschedule((()=>this._executeTimeQuery(n)),s),await this._reschedule((()=>this._executeAttributesQuery(n)),s),n}catch(t){if(t!==J.gl)throw t;return new $([],e,this)}}}},13136:(e,t,s)=>{s.d(t,{u:()=>i});const i={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},83624:(e,t,s)=>{s.d(t,{AT:()=>u,C6:()=>h,uo:()=>c});var i=s(97088),r=s(85152);const n=new r.c,a=new r.c,o=new r.c,l={esriGeometryPoint:i.a,esriGeometryPolyline:i.GE,esriGeometryPolygon:i.Y5,esriGeometryMultipoint:i.i};function u(e,t,s,r=e.hasZ,n=e.hasM){if(null==t)return null;const a=e.hasZ&&r,l=e.hasM&&n;if(s){const u=(0,i.iC)(o,t,e.hasZ,e.hasM,"esriGeometryPoint",s,r,n);return(0,i.a)(u,a,l)}return(0,i.a)(t,a,l)}function c(e,t,s,r,u,c,h=t,d=s){const m=t&&h,f=s&&d,y=null!=r?"coords"in r?r:r.geometry:null;if(null==y)return null;if(u){let r=(0,i.WY)(a,y,t,s,e,u,h,d);return c&&(r=(0,i.iC)(o,r,m,f,e,c)),l[e]?.(r,m,f)??null}if(c){const r=(0,i.iC)(o,y,t,s,e,c,h,d);return l[e]?.(r,m,f)??null}return(0,i.Sk)(n,y,t,s,h,d),l[e]?.(n,m,f)??null}function h(e){return e&&d in e?JSON.parse(JSON.stringify(e,m)):e}const d="_geVersion",m=(e,t)=>e!==d?t:void 0},16736:(e,t,s)=>{s.d(t,{u:()=>a});var i=s(21008),r=s(34888),n=s(85152);const a={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new r._M(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(null==e.centroid&&(e.centroid=(0,i.E)(new n.c,e.geometry,t.hasZ,t.hasM)),e.centroid)}},7684:(e,t,s)=>{s.d(t,{Qv:()=>m,eW:()=>_,yU:()=>g});var i=s(92400),r=s(10860),n=s(60074),a=s(3452),o=s(60544),l=s(29120);const u=[0,0];function c(e,t){if(!t)return null;if("x"in t){const s={x:0,y:0};return[s.x,s.y]=e(t.x,t.y,u),null!=t.z&&(s.z=t.z),null!=t.m&&(s.m=t.m),s}if("xmin"in t){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(t.xmin,t.ymin,u),[s.xmax,s.ymax]=e(t.xmax,t.ymax,u),t.hasZ&&(s.zmin=t.zmin,s.zmax=t.zmax,s.hasZ=!0),t.hasM&&(s.mmin=t.mmin,s.mmax=t.mmax,s.hasM=!0),s}return"rings"in t?{rings:h(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:h(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:d(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function h(e,t){const s=[];for(const i of e)s.push(d(i,t));return s}function d(e,t){const s=[];for(const i of e){const e=t(i[0],i[1],[0,0]);s.push(e),i.length>2&&e.push(i[2]),i.length>3&&e.push(i[3])}return s}async function m(e,t){if(!e||!t)return;const s=Array.isArray(e)?e.map((e=>null!=e.geometry?e.geometry.spatialReference:null)).filter(i.G6):[e];await(0,n.initializeProjection)(s.map((e=>({source:e,dest:t}))))}const f=c.bind(null,l.S6),y=c.bind(null,l.Y7);function g(e,t,s,i){if(!e)return e;if(s||(s=t,t=e.spatialReference),!(0,o.U3)(t)||!(0,o.U3)(s)||(0,o.yK)(t,s))return e;if((0,l.Gw)(t,s)){const t=(0,o.kn)(s)?f(e):y(e);return t.spatialReference=s,t}return(0,n.projectMany)(a.O,[e],t,s,null,i)[0]}const p=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,s,i){if(!e?.length||!t||!s||(0,o.yK)(t,s))return e;const n={geometries:e,inSpatialReference:t,outSpatialReference:s,geographicTransformation:i,resolve:(0,r.qG)()};return this._jobs.push(n),this._timer??=setTimeout(this._process,10),n.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:s,outSpatialReference:i,resolve:r,geographicTransformation:u}=e;(0,l.Gw)(s,i)?(0,o.kn)(i)?r(t.map(f)):r(t.map(y)):r((0,n.projectMany)(a.O,t,s,i,u,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function _(e,t,s,i){return p.push(e,t,s,i)}},3900:(e,t,s)=>{s.d(t,{_8:()=>f,gl:()=>d,on:()=>m});var i=s(14628),r=s(24296),n=s(60074),a=s(96784),o=s(6704),l=s(20480),u=s(60544),c=s(7684);const h=new i.O({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),d=Object.freeze({});async function m(e,t,s){const{outFields:i,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(i)for(let e=0;e<i.length;e++)i[e]=i[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),f(e,t,s)}async function f(e,t,i){if(!e)return null;let{where:n}=e;if(e.where=n=n?.trim(),(!n||/^1 *= *1$/.test(n)||t&&t===n)&&(e.where=null),!e.geometry)return e;let m=await async function(e){const{distance:t,units:i}=e,n=e.geometry;if(null==t||"vertexAttributes"in n)return n;const a=n.spatialReference,o=i?h.fromJSON(i):(0,r.PE)(a),l=a&&((0,u.Eb)(a)||(0,u.kn)(a))?n:await(0,c.Qv)(a,u.UH).then((()=>(0,c.yU)(n,u.UH)));return(await async function(){return(await Promise.all([s.e(984),s.e(324)]).then(s.bind(s,82704))).geodesicBuffer}())(l.spatialReference,l,t,o)}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;m=(0,a.GQ)(m),m.spatialReference=t}if(m){await(0,c.Qv)(m.spatialReference,i),m=function(e,t){const s=e.spatialReference;return y(e,t)&&(0,o.Ul)(e)?{spatialReference:s,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(m,i);const t=(await(0,l.WW)((0,o.h4)(m)))[0];if(null==t)throw d;const s="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,r=s&&y(m,i)?{densificationStep:8*s}:void 0,n=t.toJSON(),a=(0,c.yU)(n,n.spatialReference,i,r);if(!a)throw d;a.spatialReference=i,e.geometry=a}return e}function y(e,t){if(!e)return!1;const s=e.spatialReference;return((0,o.Ul)(e)||(0,o.Cs)(e)||(0,o.cZ)(e))&&!(0,u.yK)(s,t)&&!(0,n.canProjectWithoutEngine)(s,t)}},79596:(e,t,s)=>{s.d(t,{aS:()=>I,a:()=>S,q0:()=>T});var i=s(20744),r=s(83223),n=s(41980),a=s(6704),o=s(60544);function l(e,t){return e?t?4:3:t?3:2}function u(e,t,s,i,r,n){const a=l(r,n),{coords:o,lengths:u}=i;if(!u)return!1;for(let i=0,r=0;i<u.length;i++,r+=a)if(!c(e,t,s,o[r],o[r+1]))return!1;return!0}function c(e,t,s,i,r){if(!e)return!1;const n=l(t,s),{coords:a,lengths:o}=e;let u=!1,c=0;for(const e of o)u=h(u,a,n,c,e,i,r),c+=e*n;return u}function h(e,t,s,i,r,n,a){let o=e,l=i;for(let e=i,u=i+r*s;e<u;e+=s){l=e+s,l===u&&(l=i);const r=t[e],c=t[e+1],h=t[l],d=t[l+1];(c<a&&d>=a||d<a&&c>=a)&&r+(a-c)/(d-c)*(h-r)<n&&(o=!o)}return o}var d=s(97088),m=s(85152),f=s(83624),y=s(7684);const g="unsupported-query",p={esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null},_={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}};function T(e,t,i,o,l){if((0,a.Cs)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,d.Uh)(new m.c,t,!1,!1);return Promise.resolve((t=>function(e,t,s,i){return c(e,!1,!1,i.coords[0],i.coords[1])}(e,0,0,t)))}if((0,a.Cs)(t)&&"esriGeometryMultipoint"===i){const s=(0,d.Uh)(new m.c,t,!1,!1);if("esriSpatialRelContains"===e)return Promise.resolve((e=>u(s,!1,!1,e,o,l)))}if((0,a.Ul)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return Promise.resolve((e=>(0,r.o1)(t,(0,f.uo)(i,o,l,e))));if((0,a.Ul)(t)&&"esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return Promise.resolve((e=>(0,r.k)(t,(0,f.uo)(i,o,l,e))));if((0,a.Ul)(t)&&"esriSpatialRelIntersects"===e){const e="mesh"===(h=i)?n.ac:(0,n.Qz)(h);return Promise.resolve((s=>e(t,(0,f.uo)(i,o,l,s))))}var h;return Promise.all([s.e(984),s.e(324)]).then(s.bind(s,82704)).then((s=>{const r=s[p[e]].bind(null,t.spatialReference,t);return e=>r((0,f.uo)(i,o,l,e))}))}async function S(e,t,s){const{spatialRel:r,geometry:n}=e;if(n){if(!function(e){return null!=e&&!0===_.spatialRelationship[e]}(r))throw new i.c(g,"Unsupported query spatial relationship",{query:e});if((0,o.U3)(n.spatialReference)&&(0,o.U3)(s)){if(!function(e){return null!=e&&!0===_.queryGeometry[(0,a.Ce)(e)]}(n))throw new i.c(g,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===_.layerGeometry[e]}(t))throw new i.c(g,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,y.Qv)(e.geometry?.spatialReference,e.outSR)}}}function I(e){if((0,a.Ul)(e))return!0;if((0,a.Cs)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},78104:(e,t,s)=>{async function i(e,t){if(!e)return null;const s=t.featureAdapter,{startTimeField:i,endTimeField:r}=e;let n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if(i&&r)await t.forEach((e=>{const t=s.getAttribute(e,i),o=s.getAttribute(e,r);null==t||isNaN(t)||(n=Math.min(n,t)),null==o||isNaN(o)||(a=Math.max(a,o))}));else{const e=i||r;await t.forEach((t=>{const i=s.getAttribute(t,e);null==i||isNaN(i)||(n=Math.min(n,i),a=Math.max(a,i))}))}return{start:n,end:a}}function r(e,t,s){if(!t||!e)return null;const{startTimeField:i,endTimeField:r}=e;if(!i&&!r)return null;const{start:n,end:a}=t;if(null===n&&null===a)return null;if(void 0===n&&void 0===a)return()=>!1;const o=s.getAttributeAsTimestamp?.bind(s)??s.getAttribute.bind(s);return i&&r?function(e,t,s,i,r){return null!=i&&null!=r?n=>{const a=e(n,t),o=e(n,s);return(null==a||a<=r)&&(null==o||o>=i)}:null!=i?t=>{const r=e(t,s);return null==r||r>=i}:null!=r?s=>{const i=e(s,t);return null==i||i<=r}:void 0}(o,i,r,n,a):function(e,t,s,i){return null!=s&&null!=i&&s===i?i=>e(i,t)===s:null!=s&&null!=i?r=>{const n=e(r,t);return null!=n&&n>=s&&n<=i}:null!=s?i=>{const r=e(i,t);return null!=r&&r>=s}:null!=i?s=>{const r=e(s,t);return null!=r&&r<=i}:void 0}(o,i||r,n,a)}s.d(t,{k:()=>r,y:()=>i})},97088:(e,t,s)=>{s.d(t,{C:()=>Y,C_:()=>se,G0:()=>z,GE:()=>P,Ij:()=>ie,M$:()=>D,Oo:()=>ae,Sk:()=>re,Uh:()=>L,WY:()=>X,Y5:()=>U,a:()=>F,i:()=>O,i6:()=>$,iC:()=>J,m:()=>W,mk:()=>I,od:()=>Q,qw:()=>j,uY:()=>S,ui:()=>H,w3:()=>K,ye:()=>V});var i=s(20744),r=s(66360),n=s(70680),a=s(77048),o=s(83372),l=s(6704),u=s(34888),c=s(90412),h=s(85152);function d(e,t){return e?t?4:3:t?3:2}const m=()=>r.c.getLogger("esri.layers.graphics.featureConversionUtils"),f={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryEnvelope:0},y=(e,t,s,i,r,n)=>{e[s]=r,e[s+1]=n},g=(e,t,s,i,r,n)=>{e[s]=r,e[s+1]=n,e[s+2]=t[i+2]},p=(e,t,s,i,r,n)=>{e[s]=r,e[s+1]=n,e[s+2]=t[i+3]},_=(e,t,s,i,r,n)=>{e[s]=r,e[s+1]=n,e[s+2]=t[i+2],e[s+3]=t[i+3]};function T(e,t,s,i){if(e){if(s)return t&&i?_:g;if(t&&i)return p}else if(t&&i)return g;return y}function S({scale:e,translate:t},s){return Math.round((s-t[0])/e[0])}function I({scale:e,translate:t},s){return Math.round((t[1]-s)/e[1])}function x({scale:e,translate:t},s,i){return s*e[i]+t[i]}function F(e,t,s){return e?t?s?M(e):R(e):s?N(e):w(e):null}function w(e){const t=e.coords;return{x:t[0],y:t[1]}}function E(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e}function R(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2]}}function b(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e}function N(e){const t=e.coords;return{x:t[0],y:t[1],m:t[2]}}function C(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.m,e}function M(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2],m:t[3]}}function A(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e.coords[3]=t.m,e}function v(e,t){return e&&t?A:e?b:t?C:E}function D(e,t,s=v(null!=t.z,null!=t.m)){return s(e,t)}function O(e,t,s){if(null==e)return null;const i=d(t,s),r=[];for(let t=0;t<e.coords.length;t+=i){const s=[];for(let r=0;r<i;r++)s.push(e.coords[t+r]);r.push(s)}return t?s?{points:r,hasZ:t,hasM:s}:{points:r,hasZ:t}:s?{points:r,hasM:s}:{points:r}}function k(e,t,s=d(t.hasZ,t.hasM)){e.lengths[0]=t.points.length;const i=e.coords;let r=0;for(const e of t.points)for(let t=0;t<s;t++)i[r++]=e[t];return e}function P(e,t,s){if(!e)return null;const i=d(t,s),{coords:r,lengths:n}=e,a=[];let o=0;for(const e of n){const t=[];for(let s=0;s<e;s++){const e=[];for(let t=0;t<i;t++)e.push(r[o++]);t.push(e)}a.push(t)}return t?s?{paths:a,hasZ:t,hasM:s}:{paths:a,hasZ:t}:s?{paths:a,hasM:s}:{paths:a}}function G(e,t,s=d(t.hasZ,t.hasM)){const{lengths:i,coords:r}=e;let n=0;for(const e of t.paths){for(const t of e)for(let e=0;e<s;e++)r[n++]=t[e];i.push(e.length)}return e}function U(e,t,s){if(!e)return null;const i=d(t,s),{coords:r,lengths:n}=e,a=[];let o=0;for(const e of n){const t=[];for(let s=0;s<e;s++){const e=[];for(let t=0;t<i;t++)e.push(r[o++]);t.push(e)}a.push(t)}return t?s?{rings:a,hasZ:t,hasM:s}:{rings:a,hasZ:t}:s?{rings:a,hasM:s}:{rings:a}}function L(e,t,s=t.hasZ,i=t.hasM){return function(e,t,s,i){const r=d(s,i),{lengths:n,coords:a}=e;let o=0;oe(e);for(const e of t){for(const t of e)for(let e=0;e<r;e++)a[o++]=t[e];n.push(e.length)}return e}(e,t.rings,s,i)}const q=[],Z=[];function V(e,t,s,i,r){q[0]=e;const[n]=Q(Z,q,t,s,i,r);return le(q),le(Z),n}function Q(e,t,s,r,n,a){if(le(e),!s){for(const s of t){const t=a?s.attributes[a]:void 0;e.push(new u._M(null,s.attributes,null,t))}return e}switch(s){case"esriGeometryPoint":return function(e,t,s,i,r){const n=v(s,i);for(const{geometry:s,attributes:i}of t){const t=null!=s?n(new h.c,s):null;e.push(new u._M(t,i,null,r?i[r]:void 0))}return e}(e,t,r,n,a);case"esriGeometryMultipoint":return function(e,t,s,i,r){const n=d(s,i);for(const{geometry:s,attributes:i}of t){const t=null!=s?k(new h.c,s,n):null;e.push(new u._M(t,i,null,r?i[r]:void 0))}return e}(e,t,r,n,a);case"esriGeometryPolyline":return function(e,t,s,i,r){const n=d(s,i);for(const{geometry:s,attributes:i,centroid:a}of t){const t=null!=s?G(new h.c,s,n):null,o=null!=a?D(new h.c,a):null;e.push(new u._M(t,i,o,r?i[r]:void 0))}return e}(e,t,r,n,a);case"esriGeometryPolygon":return function(e,t,s,i,r){for(const{geometry:n,centroid:a,attributes:o}of t){const t=null!=n?L(new h.c,n,s,i):null,l=r?o[r]:void 0;null!=a?e.push(new u._M(t,o,E(new h.c,a),l)):e.push(new u._M(t,o,null,l))}return e}(e,t,r,n,a);default:m().error("convertToFeatureSet:unknown-geometry",new i.c(`Unable to parse unknown geometry type '${s}'`)),le(e)}return e}function z(e,t,s,i){Z[0]=e,B(q,Z,t,s,i);const r=q[0];return le(q),le(Z),r}function Y(e,t,s){if(null==e)return null;const r=new h.c;return"hasZ"in e&&null==t&&(t=e.hasZ),"hasM"in e&&null==s&&(s=e.hasM),(0,l._x)(e)?v(null!=t?t:null!=e.z,null!=s?s:null!=e.m)(r,e):(0,l.Cs)(e)?L(r,e,t,s):(0,l.cZ)(e)?G(r,e,d(t,s)):(0,l._)(e)?k(r,e,d(t,s)):void m().error("convertFromGeometry:unknown-geometry",new i.c(`Unable to parse unknown geometry type '${e}'`))}function j(e,t,s,r){const n=e&&("coords"in e?e:e.geometry);if(null==n)return null;switch(t){case"esriGeometryPoint":{let e=w;return s&&r?e=M:s?e=R:r&&(e=N),e(n)}case"esriGeometryMultipoint":return O(n,s,r);case"esriGeometryPolyline":return P(n,s,r);case"esriGeometryPolygon":return U(n,s,r);default:return m().error("convertToGeometry:unknown-geometry",new i.c(`Unable to parse unknown geometry type '${t}'`)),null}}function B(e,t,s,r,n){if(le(e),null==s)return function(e,t){for(const s of t)e.push({attributes:s.attributes});return e}(e,t);switch(s){case"esriGeometryPoint":return function(e,t,s,i){let r=w;s&&i?r=M:s?r=R:i&&(r=N);for(const s of t){const{geometry:t,attributes:i}=s,n=null!=t?r(t):null;e.push({attributes:i,geometry:n})}return e}(e,t,r,n);case"esriGeometryMultipoint":return function(e,t,s,i){for(const{geometry:r,attributes:n}of t)e.push({attributes:n,geometry:null!=r?O(r,s,i):null});return e}(e,t,r,n);case"esriGeometryPolyline":return function(e,t,s,i){for(const{geometry:r,attributes:n}of t)e.push({attributes:n,geometry:null!=r?P(r,s,i):null});return e}(e,t,r,n);case"esriGeometryPolygon":return function(e,t,s,i){for(const{geometry:r,attributes:n,centroid:a}of t){const t=null!=r?U(r,s,i):null;if(null!=a){const s=w(a);e.push({attributes:n,centroid:s,geometry:t})}else e.push({attributes:n,geometry:t})}return e}(e,t,r,n);default:m().error("convertToFeatureSet:unknown-geometry",new i.c(`Unable to parse unknown geometry type '${s}'`))}return e}function $(e){const{objectIdFieldName:t,spatialReference:s,transform:i,fields:r,hasM:n,hasZ:a,features:o,geometryType:l,exceededTransferLimit:u,uniqueIdField:c,queryGeometry:h,queryGeometryType:d}=e,m={features:B([],o,l,a,n),fields:r,geometryType:l,objectIdFieldName:t,spatialReference:s,uniqueIdField:c,queryGeometry:j(h,d,!1,!1)};return i&&(m.transform=i),u&&(m.exceededTransferLimit=u),n&&(m.hasM=n),a&&(m.hasZ=a),m}function H(e,t){const s=new c.c,{hasM:r,hasZ:n,features:a,objectIdFieldName:o,spatialReference:l,geometryType:u,exceededTransferLimit:h,transform:d,fields:f}=e;return f&&(s.fields=f),s.geometryType=u??null,s.objectIdFieldName=o??t??null,s.spatialReference=l??null,s.objectIdFieldName?(a&&Q(s.features,a,u,n,r,s.objectIdFieldName),h&&(s.exceededTransferLimit=h),r&&(s.hasM=r),n&&(s.hasZ=n),d&&(s.transform=d),s):(m().error(new i.c("optimized-features:invalid-objectIdFieldName","objectIdFieldName is missing")),s)}function K(e){const{transform:t,features:s,hasM:i,hasZ:r}=e;if(!t)return e;for(const e of s)null!=e.geometry&&ie(e.geometry,e.geometry,i,r,t),null!=e.centroid&&ie(e.centroid,e.centroid,i,r,t);return e.transform=null,e}function W(e,t){const{geometryType:s,features:i,hasM:r,hasZ:n}=t;if(!e)return t;for(let t=0;t<i.length;t++){const a=i[t],o=a.weakClone();o.geometry=new h.c,J(o.geometry,a.geometry,r,n,s,e),a.centroid&&(o.centroid=new h.c,J(o.centroid,a.centroid,r,n,"esriGeometryPoint",e)),i[t]=o}return t.transform=e,t}function J(e,t,s,i,r,n,a=s,o=i){if(oe(e),!t?.coords.length)return null;const l=f[r],{coords:u,lengths:c}=t,h=d(s,i),m=d(s&&a,i&&o),y=T(s,i,a,o);if(!c.length)return y(e.coords,u,0,0,S(n,u[0]),I(n,u[1])),oe(e,h,0),e;let g,p,_,x,F=0,w=0,E=w;for(const t of c){if(t<l)continue;let s=0;w=E,_=g=S(n,u[F]),x=p=I(n,u[F+1]),y(e.coords,u,w,F,_,x),s++,F+=h,w+=m;for(let i=1;i<t;i++,F+=h)_=S(n,u[F]),x=I(n,u[F+1]),_===g&&x===p||(y(e.coords,u,w,F,_-g,x-p),w+=m,s++,g=_,p=x);s>=l&&(e.lengths.push(s),E=w)}return le(e.coords,E),e.coords.length?e:null}function X(e,t,s,i,r,n,a=s,o=i){if(oe(e),!t?.coords.length)return null;const l=f[r],{coords:u,lengths:c}=t,h=d(s,i),m=d(s&&a,i&&o),y=T(s,i,a,o);if(!c.length)return y(e.coords,u,0,0,u[0],u[1]),oe(e,h,0),e;let g=0;const p=n*n;for(const t of c){if(t<l){g+=t*h;continue}const s=e.coords.length/m,i=g,r=g+(t-1)*h;y(e.coords,u,e.coords.length,i,u[i],u[i+1]),te(e.coords,u,h,p,y,i,r),y(e.coords,u,e.coords.length,r,u[r],u[r+1]);const n=e.coords.length/m-s;n>=l?e.lengths.push(n):le(e.coords,s*m),g+=t*h}return e.coords.length?e:null}function ee(e,t,s,i){const r=e[t],n=e[t+1],a=e[s],o=e[s+1],l=e[i],u=e[i+1];let c=a,h=o,d=l-c,m=u-h;if(0!==d||0!==m){const e=((r-c)*d+(n-h)*m)/(d*d+m*m);e>1?(c=l,h=u):e>0&&(c+=d*e,h+=m*e)}return d=r-c,m=n-h,d*d+m*m}function te(e,t,s,i,r,n,a){let o,l=i,u=0;for(let e=n+s;e<a;e+=s)o=ee(t,e,n,a),o>l&&(u=e,l=o);l>i&&(u-n>s&&te(e,t,s,i,r,n,u),r(e,t,e.length,u,t[u],t[u+1]),a-u>s&&te(e,t,s,i,r,u,a))}function se(e,t,s,i){if(!t?.coords?.length)return null;const r=d(s,i);let n=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(t&&t.coords){const e=t.coords;for(let t=0;t<e.length;t+=r){const s=e[t],i=e[t+1];n=Math.min(n,s),u=Math.max(u,s),l=Math.min(l,i),c=Math.max(c,i)}}return(0,a.is)(e)?(0,a.qy)(e,n,l,u,c):(0,o.WK)(n,l,u,c,e),e}function ie(e,t,s,i,r){const{coords:a,lengths:o}=t,l=d(s,i);if(!a.length)return e!==t&&oe(e),e;(0,n.EN)(r);const{originPosition:u,scale:c,translate:h}=r,m=ue;m.originPosition=u;const f=m.scale;f[0]=c[0]??1,f[1]=-(c[1]??1),f[2]=c[2]??1,f[3]=c[3]??1;const y=m.translate;if(y[0]=h[0]??0,y[1]=h[1]??0,y[2]=h[2]??0,y[3]=h[3]??0,!o.length){for(let t=0;t<l;++t)e.coords[t]=x(m,a[t],t);return e!==t&&oe(e,l,0),e}let g=0;for(let t=0;t<o.length;t++){const s=o[t];e.lengths[t]=s;for(let t=0;t<l;++t)e.coords[g+t]=x(m,a[g+t],t);let i=e.coords[g],r=e.coords[g+1];g+=l;for(let t=1;t<s;t++,g+=l){i+=a[g]*f[0],r+=a[g+1]*f[1],e.coords[g]=i,e.coords[g+1]=r;for(let t=2;t<l;++t)e.coords[g+t]=x(m,a[g+t],t)}}return e!==t&&oe(e,a.length,o.length),e}function re(e,t,s,i,r,n){if(oe(e),e.lengths.push(...t.lengths),s===r&&i===n)for(let s=0;s<t.coords.length;s++)e.coords.push(t.coords[s]);else{const a=d(s,i),o=T(s,i,r,n),l=t.coords;for(let t=0;t<l.length;t+=a)o(e.coords,l,e.coords.length,t,l[t],l[t+1])}return e}function ne(e,t,s,i){let r=0,n=e[i*t],a=e[i*(t+1)];for(let o=1;o<s;o++){const s=n+e[i*(t+o)],l=a+e[i*(t+o)+1],u=(s-n)*(l+a);n=s,a=l,r+=u}return.5*r}function ae(e,t){const{coords:s,lengths:i}=e;let r=0,n=0;for(let e=0;e<i.length;e++){const a=i[e];n+=ne(s,r,a,t),r+=a}return Math.abs(n)}function oe(e,t=0,s=0){le(e.lengths,s),le(e.coords,t)}function le(e,t=0){e.length!==t&&(e.length=t)}const ue={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]}},16424:(e,t,s)=>{s.d(t,{c:()=>d});var i=s(20744),r=s(40504),n=s(66360),a=s(86916),o=s(75824),l=s(564),u=s(28484),c=s(39452);const h=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],g(e))}static fromLayerJSON(e){return new d(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const s=[];for(const e of this.fields){const t=e?.name,i=f(t);if(t&&i){const r=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(r,e),this._normalizedFieldsMap.set(i,e),s.push(`${r}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.gp)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.iW)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.Mz)(e)||(0,l.w1)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}s.sort(),this.uid=s.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.Mz)(e)||(0,l.w1)(e)||e.nullable||void 0!==(0,l.gB)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(m(e))??this._normalizedFieldsMap.get(f(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(n.c.getLogger("esri.layers.support.FieldsIndex").error(new i.c("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.Gw):y.has(t.type)?u.OI:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.OI?o.qG.instance:t===u.Gw?c.Kq.utcInstance:(0,a.wJ)(h,t,(()=>c._C.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.eM)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,r.wt)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function f(e){return(0,l.gP)(e)?.toLowerCase()??""}const y=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const s=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:r}=e,n=(i?"startField"in i?i.startField:i.startTimeField:"")??"",a=(i?"endField"in i?i.endField:i.endTimeField:"")??"",o=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,u.Mt)(e.dateFieldsTimeReference):null,l=r?function(e){return"timeZone"in e}(r)?r.timeZone??o:r.dateFieldsTimeReference?(0,u.Mt)(r.dateFieldsTimeReference):o??u.Gw:null,c=i?function(e){return"timeZone"in e}(i)?i.timeZone??o:i.timeReference?(0,u.Mt)(i.timeReference):o:null,h=new Map([[m(r?.creationDateField??""),l],[m(r?.editDateField??""),l],[m(n),c],[m(a),c]]);for(const{name:i,type:r}of e.fields)if(y.has(r))t.set(i,u.OI);else if("date"!==r&&"esriFieldTypeDate"!==r)t.set(i,null);else if(s)t.set(i,u.OI);else{const e=h.get(m(i??""))??o;t.set(i,e)}return t}},36408:(e,t,s)=>{s.d(t,{M:()=>i});const i=new(s(14628).O)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},27308:(e,t,s)=>{var i;s.d(t,{K:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))}}]);
|