@arcgis/core 4.32.0-next.20241218 → 4.32.0-next.20241219
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/Basemap.js +1 -1
- package/arcade.js +1 -1
- package/assets/components/assets/text-area/t9n/messages.en.json +1 -1
- package/assets/components/assets/text-area/t9n/messages.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{57aa1fcef6587305b347.js → 0191142d5f55cc8cf37a.js} +93 -93
- package/assets/esri/core/workers/chunks/{7a0ddaf2c279a2d24c86.js → 0837a630e12a21fc2e50.js} +1 -1
- package/assets/esri/core/workers/chunks/0b3e1e903120da297641.js +1 -0
- package/assets/esri/core/workers/chunks/{6ceafd4420d21110d820.js → 0da2aaca3f0b4fe910e3.js} +1 -1
- package/assets/esri/core/workers/chunks/0f1a7aeec18db5323365.js +1 -0
- package/assets/esri/core/workers/chunks/{cca47dab8c1b8ae49fab.js → 11052103efe3d53a784e.js} +1 -1
- package/assets/esri/core/workers/chunks/19d72185d50ba1ebff50.js +1 -0
- package/assets/esri/core/workers/chunks/{b99de19b6930ba6dad98.js → 1d8609ba413e8a172719.js} +1 -1
- package/assets/esri/core/workers/chunks/{d05fab1af651b7e92442.js → 23fe65988dbc9e5d7842.js} +1 -1
- package/assets/esri/core/workers/chunks/2427a01678f3d9fbf30b.js +1 -0
- package/assets/esri/core/workers/chunks/3a90163b76b0bc7f21d2.js +1 -0
- package/assets/esri/core/workers/chunks/3ef5002b21b1a5b97e11.js +1 -0
- package/assets/esri/core/workers/chunks/48266c87363e7dcaefb3.js +1 -0
- package/assets/esri/core/workers/chunks/{d3790bd1a644eae1005b.js → 48f6eb3b63fec1d3312d.js} +4 -5
- package/assets/esri/core/workers/chunks/668679baf519ada9ae28.js +1 -0
- package/assets/esri/core/workers/chunks/7156d2ae914e1add0109.js +1 -0
- package/assets/esri/core/workers/chunks/737f381f2cfeddb96d15.js +1 -0
- package/assets/esri/core/workers/chunks/{b77d294ad7064734d015.js → 741d5dadfab2a7689054.js} +1 -1
- package/assets/esri/core/workers/chunks/756c2f7c8659deab6c96.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{1cee35ea0a80737730d5.js → 770d233254419b741616.js} +1 -1
- package/assets/esri/core/workers/chunks/8249351daa45ca82ca0c.js +1 -0
- package/assets/esri/core/workers/chunks/84d26c6c805f5855ffd3.js +1 -0
- package/assets/esri/core/workers/chunks/9372d08ba8bf3342c48f.js +1 -0
- package/assets/esri/core/workers/chunks/9cc9bac6e02ab241e852.js +1 -0
- package/assets/esri/core/workers/chunks/{d347dd19a37ba2f19970.js → 9fc49968dea8e2b64f3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a0a37c238863ffc1b768.js → a4c8b773283ea8f0e256.js} +1 -1
- package/assets/esri/core/workers/chunks/a776f71b4c7b8728a973.js +1 -0
- package/assets/esri/core/workers/chunks/a77aa86896bbb0e088df.js +1 -0
- package/assets/esri/core/workers/chunks/{7c9e4d479d740723304b.js → b1e4813f0c73fc2a483c.js} +2 -2
- package/assets/esri/core/workers/chunks/{7c9e4d479d740723304b.js.LICENSE.txt → b1e4813f0c73fc2a483c.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/bd37c9cc720587665fd3.js +1 -0
- package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/cb3af81e1fe6405c4885.js +1 -0
- package/assets/esri/core/workers/chunks/cc427e8f1b17744b6ea4.js +1 -0
- package/assets/esri/core/workers/chunks/cfe4b8101ea96d6996d3.js +2 -0
- package/assets/esri/core/workers/chunks/{f3f5c5138de8428bd30f.js.LICENSE.txt → cfe4b8101ea96d6996d3.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d7b76bc7bff34abc2253.js +1 -0
- package/assets/esri/core/workers/chunks/dd34df14eb4940e2497b.js +1 -0
- package/assets/esri/core/workers/chunks/dfd9432ba01881d0a4d9.js +2 -0
- package/assets/esri/core/workers/chunks/{ed2ebe42d6483470939a.js.LICENSE.txt → dfd9432ba01881d0a4d9.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/e1913990f30d285b3b15.js +2 -0
- package/assets/esri/core/workers/chunks/{aff820b27ca9585e297e.js.LICENSE.txt → e1913990f30d285b3b15.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{e6490fe7c87c1d649ea6.js → e5d55a35dace70239902.js} +1 -1
- package/assets/esri/core/workers/chunks/ebf9caf2dc8af89afec2.js +2 -0
- package/assets/esri/core/workers/chunks/{2eb36a16de1a823513cd.js.LICENSE.txt → ebf9caf2dc8af89afec2.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/f25c04cf1a4bc1d2636a.js +1 -0
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/chunks/HUDMaterial.glsl.js +41 -42
- package/chunks/OITBlend.glsl.js +3 -3
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/core/number.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/interfaces.d.ts +967 -731
- package/intl/messages.js +1 -1
- package/package.json +2 -2
- package/renderers/support/RendererLegendOptions.js +1 -1
- package/rest/featureService/utils.js +1 -1
- package/rest/support/AddressToLocationsParameters.js +1 -1
- package/rest/support/LocationToAddressParameters.js +1 -1
- package/smartMapping/popup/classBreaks.js +1 -1
- package/smartMapping/popup/clusters.js +1 -1
- package/smartMapping/popup/dotDensity.js +1 -1
- package/smartMapping/popup/heatmap.js +1 -1
- package/smartMapping/popup/predominance.js +1 -1
- package/smartMapping/popup/relationship.js +1 -1
- package/smartMapping/popup/simple.js +1 -1
- package/smartMapping/popup/support/utils.js +1 -1
- package/smartMapping/popup/templates.js +1 -1
- package/smartMapping/popup/uniqueValues.js +1 -1
- package/smartMapping/raster/renderers/flow.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/symbology/support/utils.js +1 -1
- package/support/BasemapStyle.js +1 -1
- package/support/revision.js +1 -1
- package/versionManagement/versionAdapters/utils.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +2 -2
- package/views/3d/webgl.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/applications/Components/CollectionFlattener.d.ts +0 -4
- package/applications/Components/CollectionFlattener.js +0 -5
- package/assets/esri/core/workers/chunks/062da071fd27022f6cb1.js +0 -1
- package/assets/esri/core/workers/chunks/0f0cc8150326ca7bcd6f.js +0 -1
- package/assets/esri/core/workers/chunks/1808a2b023fa04c6ee6c.js +0 -1
- package/assets/esri/core/workers/chunks/1d31b07805af85a4ba7b.js +0 -1
- package/assets/esri/core/workers/chunks/1fb142a533e4ee492a50.js +0 -1
- package/assets/esri/core/workers/chunks/28f3e139a4e3b70d84a4.js +0 -1
- package/assets/esri/core/workers/chunks/2daf5f46e4b137d33f12.js +0 -1
- package/assets/esri/core/workers/chunks/2eb36a16de1a823513cd.js +0 -2
- package/assets/esri/core/workers/chunks/382c3da5ce9b3231f57c.js +0 -1
- package/assets/esri/core/workers/chunks/433798a25dd688cef327.js +0 -1
- package/assets/esri/core/workers/chunks/56a04f5976b926de448e.js +0 -1
- package/assets/esri/core/workers/chunks/6bd6c280c741f8917cc8.js +0 -1
- package/assets/esri/core/workers/chunks/70153bb44fd5b7cfecb8.js +0 -1
- package/assets/esri/core/workers/chunks/78981dee7b5403c32517.js +0 -1
- package/assets/esri/core/workers/chunks/7bb52be0a02fb2a2631c.js +0 -1
- package/assets/esri/core/workers/chunks/80f1f967646f7a7d37ec.js +0 -1
- package/assets/esri/core/workers/chunks/820bb7ea30ad30ce8f42.js +0 -1
- package/assets/esri/core/workers/chunks/95ea191f6a307b73b545.js +0 -1
- package/assets/esri/core/workers/chunks/9fab71f1041c40d976af.js +0 -1
- package/assets/esri/core/workers/chunks/aa31073c7fe3b0e4e499.js +0 -1
- package/assets/esri/core/workers/chunks/af5d74311cec22601f73.js +0 -1
- package/assets/esri/core/workers/chunks/aff820b27ca9585e297e.js +0 -2
- package/assets/esri/core/workers/chunks/bf2d1a700fff4ae0db33.js +0 -1
- package/assets/esri/core/workers/chunks/da6c0c894e7e281169fa.js +0 -1
- package/assets/esri/core/workers/chunks/ed2ebe42d6483470939a.js +0 -2
- package/assets/esri/core/workers/chunks/f3f5c5138de8428bd30f.js +0 -2
- package/assets/esri/core/workers/chunks/f429d95eb986f3d215f3.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import{isAbortError as s}from"../../core/promiseUtils.js";import{on as o,watch as l,syncAndInitial as a,when as n}from"../../core/reactiveUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{resolveTimeZone as c,convertDateFormatToIntlOptions as h,formatTimestamp as p}from"../../intl/date.js";import{getLocale as m}from"../../intl/locale.js";import{fetchServiceDescription as v}from"../../rest/networkService.js";import f from"../../rest/support/RouteParameters.js";import y from"../../rest/support/Stop.js";import g from"../../rest/support/TravelMode.js";import{defaultDatePattern as T,defaultTimePattern as w}from"../../support/dateUtils.js";import{system as _,shortTimeZoneName as D}from"../../time/timeZoneUtils.js";import{DepartureTimeOption as C}from"./support/directionsUtils.js";import{getDefaultLocaleOptions as S}from"../support/dateUtils.js";import b from"../support/GoTo.js";import{DateTime as I,FixedOffsetZone as M,IANAZone as A}from"luxon";function j(e){return"esri.Graphic"===e?.declaredClass}function P(e){return"esri.rest.support.Stop"===e?.declaredClass}var L;!function(e){e[e.Active=0]="Active",e[e.Complete=1]="Complete",e[e.Failed=2]="Failed",e[e.Idle=3]="Idle",e[e.Suspended=4]="Suspended"}(L||(L={}));let E=class extends(b(i.EventedAccessor)){constructor(e){super(e),this._highlight=null,this._loadPromise=null,this._loadController=null,this._routeController=null,this._serviceDescriptionStatus=L.Idle,this.apiKey=void 0,this.defaultTravelMode=null,this.departureIsoDate=null,this.departureIsoTime=null,this.departureOption=C.NOW,this.departureTime="now",this.lastError=null,this.lastRoute=null,this.layer=null,this.maxStops=50,this.routeParameters=new f({directionsLengthUnits:"kilometers",findBestSequence:!1,returnZ:!0,startTime:null,startTimeIsUTC:!0,useTimeWindows:!1}),this.serviceDescription=null,this.view=null}initialize(){this.addHandles([o((()=>this.layer?.stops),"change",(()=>{this.clearResults()})),l((()=>this.layer),(e=>{if(null!=e){for(;e.stops.length<2;)e.stops.add(new y);this._set("defaultTravelMode",null),this.addHandles(n((()=>null!=this.serviceDescription?e.routeInfo?.analysisSettings?.travelMode:null),(e=>{this.defaultTravelMode=this._resolveDefaultTravelMode(e)}),{once:!0}))}}),a)]);const e=c(this.view?.timeZone??_),t=I.fromMillis(Date.now());this.departureIsoDate=t.toFormat(T,S(e)),this.departureIsoTime=t.toFormat(w,S(e))}get _directionsLanguage(){if(null==this.serviceDescription)return;const e=this.serviceDescription.directionsSupportedLanguages;if(!e)return;const t=(this.routeParameters.directionsLanguage??m()).slice(0,2);return e.find((e=>e.toLowerCase().slice(0,2)===t))}get formattedEta(){const e=this.layer?.routeInfo?.endTime,t=this.layer?.routeInfo?.endTimeOffset;if(this.departureOption===C.UNSPECIFIED||!e||!t)return null;const r=I.fromJSDate(e,{zone:M.instance(t)}),i=I.fromJSDate(e,{zone:A.create(c(this.view?.timeZone??_))}),s=I.fromJSDate(new Date,{zone:A.create(c(this.view?.timeZone??_))}),o=s.year===i.year&&s.month===i.month&&s.day===i.day,l=i.offset===t?void 0:D,a=o?void 0:h("short-date"),n=h("short-time");return p(r.toISO(),{...a,...n,timeZoneName:l})}get impedanceAttribute(){const e=this.routeParameters.travelMode?.impedanceAttributeName??this.routeParameters.impedanceAttribute??this.serviceDescription?.impedance??null;return this.getCostAttribute(e)}get selectedTravelMode(){return null==this.serviceDescription?null:this.defaultTravelMode??this.serviceDescription.defaultTravelMode??this.serviceDescription.supportedTravelModes?.[0]??null}set selectedTravelMode(e){this._override("selectedTravelMode",e)}get state(){if(null!=this._routeController)return"routing";if(null!=this.lastError)return"error";switch(this._serviceDescriptionStatus){case L.Suspended:return"unauthenticated";case L.Idle:return"disabled";case L.Active:return"initializing";case L.Failed:return"error";default:return"ready"}}get timeAttribute(){const e=this.routeParameters.travelMode?.timeAttributeName??this.routeParameters.directionsTimeAttribute??this.serviceDescription?.directionsTimeAttribute??null;return this.getCostAttribute(e)}get travelModes(){const e=this.serviceDescription?.supportedTravelModes?.slice()??[];return null==this.defaultTravelMode||e.includes(this.defaultTravelMode)||e.unshift(this.defaultTravelMode),e}async load(){if(null!=this._loadPromise)return this._loadPromise;this._loadPromise=this._load(),await this._loadPromise,this._loadPromise=null}async highlight(e){if(this.clearHighlights(),!this.view||!this.layer)return;const t=await this.view.whenLayerView(this.layer);this._highlight=t.highlight(e)}clearHighlights(){null!=this._highlight&&(this._highlight.remove(),this._highlight=null)}centerAt(e){if(null==this.view)return;const t=P(e)||j(e)?e.geometry:e;null!=t&&this.callGoTo({target:t})}clearResults(){this._set("lastRoute",null),this.layer?.removeResult()}async getDirections(){const{apiKey:e,layer:t,state:i}=this;if(null==t)throw new r("directions-view-model:missing-route-layer","A route layer must be associated with the view model.");if("unauthenticated"===i||"initializing"===i||"disabled"===i||this._serviceDescriptionStatus===L.Failed)throw new r("directions-view-model:not-loaded","Cannot get directions until view model loads.");this._set("lastError",null),null!=this._routeController&&(this._routeController.abort(),this._routeController=null);const{startTime:o,startTimeIsUTC:l}=this._getStartTimeParameters(),a=this.view?.spatialReference??null,n=this.routeParameters.clone();n.set({startTime:o,startTimeIsUTC:l,directionsLanguage:this._directionsLanguage,apiKey:e,outSpatialReference:a}),null!=this.selectedTravelMode&&(n.travelMode=this.selectedTravelMode);if(t.stops.filter((({geometry:e})=>null!=e)).length<2){const e=new r("directions-view-model:not-enough-stops","Not enough stops for routing");throw this._set("lastError",e),e}this._routeController=new AbortController;const{signal:u}=this._routeController;let d=null;try{d=await t.solve(n,{signal:u})}catch(c){if(!s(c)){const e=new r("directions-view-model:unable-to-route","Unable to route to these addresses",{error:c});throw this._set("lastError",e),this._set("lastRoute",null),e}}finally{this._routeController=null}for(const r of d.stops)null==r.geometry&&(r.name=null);return t.update(d),this._set("lastRoute",d),this.zoomToRoute(),d}getCostAttribute(e){return(this.serviceDescription?.networkDataset?.networkAttributes??[]).find((({name:t,usageType:r})=>t===e&&"cost"===r))??null}reset(){this.clearHighlights(),this.clearResults(),null!=this.layer&&(this.layer.removeAll(),this.layer.stops=new t([new y,new y]))}save(){if(!this.layer)throw new r("directions-view-model:missing-layer","save() requires a layer");return this.layer.save()}saveAs(e,t={}){if(!this.layer)throw new r("directions-view-model:missing-layer","saveAs() requires a layer");return this.layer.saveAs(e,t)}updateDepartureTime(){if(this.departureIsoDate&&this.departureIsoTime)switch(this.departureOption){case C.NOW:this.departureTime="now";break;case C.DEPART_AT:{const e=I.fromISO(`${this.departureIsoDate}T${this.departureIsoTime}`,{zone:M.instance(0)});this.departureTime=e.toJSDate();break}case C.UNSPECIFIED:this.departureTime=null}}zoomToRoute(){const{view:e,layer:t}=this;if(null==e||null==t?.routeInfo)return;const{geometry:r}=t.routeInfo;if(null==r)return;const i=r.extent;if(!i)return;const s=i.width>i.height,o=i.clone().expand(s?2:1);this.callGoTo({target:o})}_getStartTimeParameters(){if("now"===this.departureTime){return{startTime:this.serviceDescription?.capabilities.supportsNow??!1?"now":new Date,startTimeIsUTC:!0}}return null==this.departureTime?{startTime:void 0,startTimeIsUTC:void 0}:{startTime:this.departureTime,startTimeIsUTC:!1}}async _load(){if(null==this.layer)return;null!=this._loadController&&(this._loadController.abort(),this._loadController=null),this._loadController=new AbortController;const{signal:e}=this._loadController;try{this._serviceDescriptionStatus=L.Active;const t=await v(this.layer.url,this.apiKey,{signal:e});this._set("serviceDescription",t),this._serviceDescriptionStatus=L.Complete}catch(t){if(s(t))return void(this._serviceDescriptionStatus=L.Idle);if("identity-manager:user-aborted"===t.name)return void(this._serviceDescriptionStatus=L.Suspended);const e=new r("directions-view-model:service-metadata-unavailable","Cannot load route service metadata",{error:t});throw this._serviceDescriptionStatus=L.Failed,this._set("lastError",e),e}finally{this._loadController=null}}_resolveDefaultTravelMode(e){if(null==this.serviceDescription)return null;const{defaultTravelMode:t,supportedTravelModes:r}=this.serviceDescription,i=/^<(?<name>.*)>$/i.exec(e.name)?.groups?.name;if(i){const s=r?.find((({name:e})=>e.toLocaleLowerCase()===i.trim().toLocaleLowerCase())),o=s??t;return g.fromJSON({...o?.toJSON(),...e.toJSON()})}const s=r?.find((({name:t})=>t.toLocaleLowerCase()===e.name.toLocaleLowerCase()));return s??t}};e([u()],E.prototype,"_directionsLanguage",null),e([u()],E.prototype,"_routeController",void 0),e([u()],E.prototype,"_serviceDescriptionStatus",void 0),e([u()],E.prototype,"apiKey",void 0),e([u()],E.prototype,"defaultTravelMode",void 0),e([u()],E.prototype,"departureTime",void 0),e([u()],E.prototype,"formattedEta",null),e([u({readOnly:!0})],E.prototype,"impedanceAttribute",null),e([u()],E.prototype,"lastError",void 0),e([u({readOnly:!0})],E.prototype,"lastRoute",void 0),e([u()],E.prototype,"layer",void 0),e([u({type:Number,range:{min:2,max:50},nonNullable:!0})],E.prototype,"maxStops",void 0),e([u({type:f,nonNullable:!0})],E.prototype,"routeParameters",void 0),e([u()],E.prototype,"selectedTravelMode",null),e([u({readOnly:!0})],E.prototype,"serviceDescription",void 0),e([u({readOnly:!0})],E.prototype,"state",null),e([u({readOnly:!0})],E.prototype,"timeAttribute",null),e([u()],E.prototype,"travelModes",null),e([u()],E.prototype,"view",void 0),e([u()],E.prototype,"getDirections",null),e([u()],E.prototype,"zoomToRoute",null),E=e([d("esri.widgets.Directions.DirectionsViewModel")],E);const R=E;export{R as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import{isAbortError as o}from"../../core/promiseUtils.js";import{on as s,watch as l,syncAndInitial as a,when as n}from"../../core/reactiveUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{resolveTimeZone as h,convertDateFormatToIntlOptions as c,formatTimestamp as p}from"../../intl/date.js";import{getLocale as m,getLanguage as v}from"../../intl/locale.js";import{fetchServiceDescription as f}from"../../rest/networkService.js";import y from"../../rest/support/RouteParameters.js";import g from"../../rest/support/Stop.js";import T from"../../rest/support/TravelMode.js";import{defaultDatePattern as w,defaultTimePattern as _}from"../../support/dateUtils.js";import{system as D,shortTimeZoneName as C}from"../../time/timeZoneUtils.js";import{DepartureTimeOption as S}from"./support/directionsUtils.js";import{getDefaultLocaleOptions as b}from"../support/dateUtils.js";import I from"../support/GoTo.js";import{DateTime as M,FixedOffsetZone as A,IANAZone as j}from"luxon";function P(e){return"esri.Graphic"===e?.declaredClass}function L(e){return"esri.rest.support.Stop"===e?.declaredClass}var E;!function(e){e[e.Active=0]="Active",e[e.Complete=1]="Complete",e[e.Failed=2]="Failed",e[e.Idle=3]="Idle",e[e.Suspended=4]="Suspended"}(E||(E={}));let R=class extends(I(i.EventedAccessor)){constructor(e){super(e),this._highlight=null,this._loadPromise=null,this._loadController=null,this._routeController=null,this._serviceDescriptionStatus=E.Idle,this.apiKey=void 0,this.defaultTravelMode=null,this.departureIsoDate=null,this.departureIsoTime=null,this.departureOption=S.NOW,this.departureTime="now",this.lastError=null,this.lastRoute=null,this.layer=null,this.maxStops=50,this.routeParameters=new y({directionsLengthUnits:"kilometers",findBestSequence:!1,returnZ:!0,startTime:null,startTimeIsUTC:!0,useTimeWindows:!1}),this.serviceDescription=null,this.view=null}initialize(){this.addHandles([s((()=>this.layer?.stops),"change",(()=>{this.clearResults()})),l((()=>this.layer),(e=>{if(null!=e){for(;e.stops.length<2;)e.stops.add(new g);this._set("defaultTravelMode",null),this.addHandles(n((()=>null!=this.serviceDescription?e.routeInfo?.analysisSettings?.travelMode:null),(e=>{this.defaultTravelMode=this._resolveDefaultTravelMode(e)}),{once:!0}))}}),a)]);const e=h(this.view?.timeZone??D),t=M.fromMillis(Date.now());this.departureIsoDate=t.toFormat(w,b(e)),this.departureIsoTime=t.toFormat(_,b(e))}get _directionsLanguage(){const e=this.serviceDescription?.directionsSupportedLanguages;if(!e)return;const t=this.routeParameters.directionsLanguage??m(),r=v(t);return e.find((e=>{const t=v(e);return"no"===r?t===r||"nb"===t:t===r}))}get formattedEta(){const e=this.layer?.routeInfo?.endTime,t=this.layer?.routeInfo?.endTimeOffset;if(this.departureOption===S.UNSPECIFIED||!e||!t)return null;const r=M.fromJSDate(e,{zone:A.instance(t)}),i=M.fromJSDate(e,{zone:j.create(h(this.view?.timeZone??D))}),o=M.fromJSDate(new Date,{zone:j.create(h(this.view?.timeZone??D))}),s=o.year===i.year&&o.month===i.month&&o.day===i.day,l=i.offset===t?void 0:C,a=s?void 0:c("short-date"),n=c("short-time");return p(r.toISO(),{...a,...n,timeZoneName:l})}get impedanceAttribute(){const e=this.routeParameters.travelMode?.impedanceAttributeName??this.routeParameters.impedanceAttribute??this.serviceDescription?.impedance??null;return this.getCostAttribute(e)}get selectedTravelMode(){return null==this.serviceDescription?null:this.defaultTravelMode??this.serviceDescription.defaultTravelMode??this.serviceDescription.supportedTravelModes?.[0]??null}set selectedTravelMode(e){this._override("selectedTravelMode",e)}get state(){if(null!=this._routeController)return"routing";if(null!=this.lastError)return"error";switch(this._serviceDescriptionStatus){case E.Suspended:return"unauthenticated";case E.Idle:return"disabled";case E.Active:return"initializing";case E.Failed:return"error";default:return"ready"}}get timeAttribute(){const e=this.routeParameters.travelMode?.timeAttributeName??this.routeParameters.directionsTimeAttribute??this.serviceDescription?.directionsTimeAttribute??null;return this.getCostAttribute(e)}get travelModes(){const e=this.serviceDescription?.supportedTravelModes?.slice()??[];return null==this.defaultTravelMode||e.includes(this.defaultTravelMode)||e.unshift(this.defaultTravelMode),e}async load(){if(null!=this._loadPromise)return this._loadPromise;this._loadPromise=this._load(),await this._loadPromise,this._loadPromise=null}async highlight(e){if(this.clearHighlights(),!this.view||!this.layer)return;const t=await this.view.whenLayerView(this.layer);this._highlight=t.highlight(e)}clearHighlights(){null!=this._highlight&&(this._highlight.remove(),this._highlight=null)}centerAt(e){if(null==this.view)return;const t=L(e)||P(e)?e.geometry:e;null!=t&&this.callGoTo({target:t})}clearResults(){this._set("lastRoute",null),this.layer?.removeResult()}async getDirections(){const{apiKey:e,layer:t,state:i}=this;if(null==t)throw new r("directions-view-model:missing-route-layer","A route layer must be associated with the view model.");if("unauthenticated"===i||"initializing"===i||"disabled"===i||this._serviceDescriptionStatus===E.Failed)throw new r("directions-view-model:not-loaded","Cannot get directions until view model loads.");this._set("lastError",null),null!=this._routeController&&(this._routeController.abort(),this._routeController=null);const{startTime:s,startTimeIsUTC:l}=this._getStartTimeParameters(),a=this.view?.spatialReference??null,n=this.routeParameters.clone();n.set({startTime:s,startTimeIsUTC:l,directionsLanguage:this._directionsLanguage,apiKey:e,outSpatialReference:a}),null!=this.selectedTravelMode&&(n.travelMode=this.selectedTravelMode);if(t.stops.filter((({geometry:e})=>null!=e)).length<2){const e=new r("directions-view-model:not-enough-stops","Not enough stops for routing");throw this._set("lastError",e),e}this._routeController=new AbortController;const{signal:u}=this._routeController;let d=null;try{d=await t.solve(n,{signal:u})}catch(h){if(!o(h)){const e=new r("directions-view-model:unable-to-route","Unable to route to these addresses",{error:h});throw this._set("lastError",e),this._set("lastRoute",null),e}}finally{this._routeController=null}for(const r of d.stops)null==r.geometry&&(r.name=null);return t.update(d),this._set("lastRoute",d),this.zoomToRoute(),d}getCostAttribute(e){return(this.serviceDescription?.networkDataset?.networkAttributes??[]).find((({name:t,usageType:r})=>t===e&&"cost"===r))??null}reset(){this.clearHighlights(),this.clearResults(),null!=this.layer&&(this.layer.removeAll(),this.layer.stops=new t([new g,new g]))}save(){if(!this.layer)throw new r("directions-view-model:missing-layer","save() requires a layer");return this.layer.save()}saveAs(e,t={}){if(!this.layer)throw new r("directions-view-model:missing-layer","saveAs() requires a layer");return this.layer.saveAs(e,t)}updateDepartureTime(){if(this.departureIsoDate&&this.departureIsoTime)switch(this.departureOption){case S.NOW:this.departureTime="now";break;case S.DEPART_AT:{const e=M.fromISO(`${this.departureIsoDate}T${this.departureIsoTime}`,{zone:A.instance(0)});this.departureTime=e.toJSDate();break}case S.UNSPECIFIED:this.departureTime=null}}zoomToRoute(){const{view:e,layer:t}=this;if(null==e||null==t?.routeInfo)return;const{geometry:r}=t.routeInfo;if(null==r)return;const i=r.extent;if(!i)return;const o=i.width>i.height,s=i.clone().expand(o?2:1);this.callGoTo({target:s})}_getStartTimeParameters(){if("now"===this.departureTime){return{startTime:this.serviceDescription?.capabilities.supportsNow??!1?"now":new Date,startTimeIsUTC:!0}}return null==this.departureTime?{startTime:void 0,startTimeIsUTC:void 0}:{startTime:this.departureTime,startTimeIsUTC:!1}}async _load(){if(null==this.layer)return;null!=this._loadController&&(this._loadController.abort(),this._loadController=null),this._loadController=new AbortController;const{signal:e}=this._loadController;try{this._serviceDescriptionStatus=E.Active;const t=await f(this.layer.url,this.apiKey,{signal:e});this._set("serviceDescription",t),this._serviceDescriptionStatus=E.Complete}catch(t){if(o(t))return void(this._serviceDescriptionStatus=E.Idle);if("identity-manager:user-aborted"===t.name)return void(this._serviceDescriptionStatus=E.Suspended);const e=new r("directions-view-model:service-metadata-unavailable","Cannot load route service metadata",{error:t});throw this._serviceDescriptionStatus=E.Failed,this._set("lastError",e),e}finally{this._loadController=null}}_resolveDefaultTravelMode(e){if(null==this.serviceDescription)return null;const{defaultTravelMode:t,supportedTravelModes:r}=this.serviceDescription,i=/^<(?<name>.*)>$/i.exec(e.name)?.groups?.name;if(i){const o=r?.find((({name:e})=>e.toLocaleLowerCase()===i.trim().toLocaleLowerCase())),s=o??t;return T.fromJSON({...s?.toJSON(),...e.toJSON()})}const o=r?.find((({name:t})=>t.toLocaleLowerCase()===e.name.toLocaleLowerCase()));return o??t}};e([u()],R.prototype,"_directionsLanguage",null),e([u()],R.prototype,"_routeController",void 0),e([u()],R.prototype,"_serviceDescriptionStatus",void 0),e([u()],R.prototype,"apiKey",void 0),e([u()],R.prototype,"defaultTravelMode",void 0),e([u()],R.prototype,"departureTime",void 0),e([u()],R.prototype,"formattedEta",null),e([u({readOnly:!0})],R.prototype,"impedanceAttribute",null),e([u()],R.prototype,"lastError",void 0),e([u({readOnly:!0})],R.prototype,"lastRoute",void 0),e([u()],R.prototype,"layer",void 0),e([u({type:Number,range:{min:2,max:50},nonNullable:!0})],R.prototype,"maxStops",void 0),e([u({type:y,nonNullable:!0})],R.prototype,"routeParameters",void 0),e([u()],R.prototype,"selectedTravelMode",null),e([u({readOnly:!0})],R.prototype,"serviceDescription",void 0),e([u({readOnly:!0})],R.prototype,"state",null),e([u({readOnly:!0})],R.prototype,"timeAttribute",null),e([u()],R.prototype,"travelModes",null),e([u()],R.prototype,"view",void 0),e([u()],R.prototype,"getDirections",null),e([u()],R.prototype,"zoomToRoute",null),R=e([d("esri.widgets.Directions.DirectionsViewModel")],R);const O=R;export{O as default};
|
package/widgets/Features.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import i from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,when as n}from"../core/reactiveUtils.js";import{waitAnimationFrame as r}from"../core/scheduling.js";import{throttle as l}from"../core/throttle.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as c}from"../geometry/support/geometryUtils.js";import{substituteActionImage as u,getActionStyles as h}from"../support/actions/actionUtils.js";import p from"./Feature.js";import m from"./Spinner.js";import v from"./Widget.js";import{css as g}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{css as _}from"./Features/css.js";import f from"./Features/FeaturesDrillIn.js";import M from"./Features/FeaturesViewModel.js";import F from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as b}from"./Popup/actions.js";import{zoomToLocation as y}from"./Popup/actionUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{Heading as A}from"./support/Heading.js";import{setFocus as x}from"./support/widgetUtils.js";import{messageBundle as N}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{substitute as k}from"../intl/substitute.js";import{formatNumber as E}from"../intl/number.js";const j="selected-index",L=0,W="features-spinner";function S(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let B=class extends(w(v)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new t,this._drillInWidget=new f({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new b,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new M,this.visibleElements=new F,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:l}=e;return e.visible?O("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-uid":n,disabled:r,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,textEnabled:!this._hideActionText,title:this._hideActionText?i:void 0},this._getFallbackIcon(e)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=l((()=>this._displaySpinner()),L),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),s((()=>this.viewModel?.active),(e=>this._drillInWidget.closed=!e)),s((()=>this.visibleElements?.closeButton),(e=>this._drillInWidget.closable=e)),s((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.viewModel?.screenLocation),(()=>this._closeOpenActionMenu())),s((()=>this.selectedFeatureWidget),(()=>this._destroyDrillInFlowItemWidgets())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),this._drillInWidget.on("close",(()=>this.close())),this._drillInWidget.on("exit",(()=>this._destroyDrillInFlowItemWidgets())),this._drillInWidget.on("open-feature",(({feature:e})=>this._openRelatedFeature(e))),this._drillInWidget.on("zoom-to-feature",(({featureWidget:e})=>y(this.viewModel,e)))])}loadDependencies(){return I({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new p({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():i.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):i.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(j);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(n((()=>!this.viewModel.waitingForResult),(()=>this._addSelectedFeatureIndexHandle()),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return O("div",{bind:this,class:this.classes(_.base,C.widget,C.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?O("div",{class:_.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:O("div",{class:_.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=t;return O("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._openFeatureMenu,scale:"s",text:k(e.pageText,{index:E(o+1),total:E(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return O("calcite-action-bar",{class:_.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},O("calcite-action-group",{scale:"s"},O("calcite-action",{appearance:"solid",class:_.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),O("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,s=i.indexOf(e);return O("calcite-list-item",{bind:this,"data-feature-index":s,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},O("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach((e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(S(o)?o:null)||(S(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])})),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer();return t.featureViewModels.length?O("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:"single"},Array.from(i.keys(),(e=>{const t=i.get(e)?.map((e=>this._renderFeatureMenuItem(e))),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?O("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t}))):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?O("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map(((e,t)=>this._renderHeaderAction(e,t))).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,_drillInFlowItems:s,featureNavigationTop:n,featureMenuOpen:r}=this,{title:l,active:a}=this.viewModel,d=t.heading&&l?l:"";return O("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[_.contentFeature]:!0,[_.flowItemCollapsed]:i}),closable:t.closeButton,closed:!a,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:!r&&0===s.length,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?O(A,{class:this.classes(_.featuresHeading,C.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:O("div",{class:this.classes(_.container,_.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,featureMenuTitle:i,messages:o,messagesCommon:s}=this,{active:n,featureViewModels:r,pendingPromisesCount:l}=e,a=i??o.selectFeature;return t?O("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:k(o.total,{total:r.length}),heading:a,key:"feature-menu",loading:e.waitingForContents,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()}},l>0?O("calcite-loader",{class:_.loader,inline:!0,key:"feature-menu-loader",label:s.loading,slot:"header-actions-end"}):null,O("div",{class:_.container},this._renderFeatureMenu()),O("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:_.featureMenuObserver}),O("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?O("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=u({action:e,feature:this.selectedFeature}),s={[_.icon]:!!t,[_.actionImage]:!!o};return t&&(s[t]=!0),o||t?O("span",{"aria-hidden":"true",class:this.classes(_.icon,s),key:"icon",styles:h(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?O("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},O("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?O("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=c(i);this.open({features:[t],location:null!=o?o:void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await o(r(t));const i="menu-flow-item"===e?this._featureMenuViewportNode:this._rootFlowItemNode;x(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?k(r,{messages:t}):"remove-selected-feature"===s?k(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?k(r,{messages:t}):e.title;return l&&n?k(l,n):l??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,j)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find((({uid:e})=>e===i));o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:W,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,W),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([a()],B.prototype,"_drillInFlowItems",void 0),e([a()],B.prototype,"_hideActionText",null),e([a()],B.prototype,"_featureNavigationVisible",null),e([a()],B.prototype,"_isCollapsed",null),e([a()],B.prototype,"_collapseEnabled",null),e([a({readOnly:!0})],B.prototype,"active",null),e([a()],B.prototype,"collapsed",void 0),e([a()],B.prototype,"content",null),e([a()],B.prototype,"icon",null),e([a()],B.prototype,"featureMenuOpen",null),e([a()],B.prototype,"featureMenuTitle",null),e([a()],B.prototype,"featureNavigationTop",void 0),e([a()],B.prototype,"features",null),e([a()],B.prototype,"goToOverride",null),e([a({type:b})],B.prototype,"headerActions",void 0),e([a()],B.prototype,"headingLevel",void 0),e([a()],B.prototype,"location",null),e([a()],B.prototype,"label",null),e([a()],B.prototype,"map",null),e([a(),N("esri/widgets/Features/t9n/Features")],B.prototype,"messages",void 0),e([a(),N("esri/t9n/common")],B.prototype,"messagesCommon",void 0),e([a()],B.prototype,"promises",null),e([a()],B.prototype,"responsiveActionsEnabled",void 0),e([a({readOnly:!0})],B.prototype,"selectedFeature",null),e([a({readOnly:!0})],B.prototype,"selectedDrillInFeature",null),e([a()],B.prototype,"selectedFeatureIndex",null),e([a({readOnly:!0})],B.prototype,"selectedFeatureWidget",null),e([a()],B.prototype,"spatialReference",null),e([a()],B.prototype,"title",null),e([a()],B.prototype,"timeZone",null),e([a()],B.prototype,"updateLocationEnabled",null),e([a()],B.prototype,"view",null),e([a({type:M}),T(["triggerAction","trigger-action"])],B.prototype,"viewModel",void 0),e([a({type:F,nonNullable:!0})],B.prototype,"visibleElements",void 0),e([a()],B.prototype,"visible",null),B=e([d("esri.widgets.Features")],B);const R=B;export{R as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import i from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,when as n}from"../core/reactiveUtils.js";import{waitAnimationFrame as r}from"../core/scheduling.js";import{throttle as l}from"../core/throttle.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as c}from"../geometry/support/geometryUtils.js";import{substituteActionImage as u,getActionStyles as h}from"../support/actions/actionUtils.js";import p from"./Feature.js";import m from"./Spinner.js";import v from"./Widget.js";import{css as g}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{css as _}from"./Features/css.js";import f from"./Features/FeaturesDrillIn.js";import M from"./Features/FeaturesViewModel.js";import F from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as b}from"./Popup/actions.js";import{zoomToLocation as y}from"./Popup/actionUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{Heading as A}from"./support/Heading.js";import{setFocus as x}from"./support/widgetUtils.js";import{messageBundle as N}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{substitute as k}from"../intl/substitute.js";import{formatNumber as E}from"../intl/number.js";const j="selected-index",L=0,W="features-spinner";function S(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let B=class extends(w(v)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new t,this._drillInWidget=new f({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new b,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new M,this.visibleElements=new F,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:l}=e;return e.visible?O("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":n,disabled:r,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,textEnabled:!this._hideActionText,title:this._hideActionText?i:void 0},this._getFallbackIcon(e)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=l((()=>this._displaySpinner()),L),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),s((()=>this.viewModel?.active),(e=>this._drillInWidget.closed=!e)),s((()=>this.visibleElements?.closeButton),(e=>this._drillInWidget.closable=e)),s((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.viewModel?.screenLocation),(()=>this._closeOpenActionMenu())),s((()=>this.selectedFeatureWidget),(()=>this._destroyDrillInFlowItemWidgets())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),this._drillInWidget.on("close",(()=>this.close())),this._drillInWidget.on("exit",(()=>this._destroyDrillInFlowItemWidgets())),this._drillInWidget.on("open-feature",(({feature:e})=>this._openRelatedFeature(e))),this._drillInWidget.on("zoom-to-feature",(({featureWidget:e})=>y(this.viewModel,e)))])}loadDependencies(){return I({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new p({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():i.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):i.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(j);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(n((()=>!this.viewModel.waitingForResult),(()=>this._addSelectedFeatureIndexHandle()),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return O("div",{bind:this,class:this.classes(_.base,C.widget,C.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?O("div",{class:_.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:O("div",{class:_.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=t;return O("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._openFeatureMenu,scale:"s",text:k(e.pageText,{index:E(o+1),total:E(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return O("calcite-action-bar",{class:_.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},O("calcite-action-group",{scale:"s"},O("calcite-action",{appearance:"solid",class:_.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),O("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,s=i.indexOf(e);return O("calcite-list-item",{bind:this,"data-feature-index":s,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},O("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach((e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(S(o)?o:null)||(S(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])})),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer();return t.featureViewModels.length?O("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:"single"},Array.from(i.keys(),(e=>{const t=i.get(e)?.map((e=>this._renderFeatureMenuItem(e))),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?O("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t}))):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?O("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map(((e,t)=>this._renderHeaderAction(e,t))).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,_drillInFlowItems:s,featureNavigationTop:n,featureMenuOpen:r}=this,{title:l,active:a}=this.viewModel,d=t.heading&&l?l:"";return O("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[_.contentFeature]:!0,[_.flowItemCollapsed]:i}),closable:t.closeButton,closed:!a,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:!r&&0===s.length,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?O(A,{class:this.classes(_.featuresHeading,C.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:O("div",{class:this.classes(_.container,_.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,featureMenuTitle:i,messages:o,messagesCommon:s}=this,{active:n,featureViewModels:r,pendingPromisesCount:l}=e,a=i??o.selectFeature;return t?O("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:k(o.total,{total:r.length}),heading:a,key:"feature-menu",loading:e.waitingForContents,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()}},l>0?O("calcite-loader",{class:_.loader,inline:!0,key:"feature-menu-loader",label:s.loading,slot:"header-actions-end"}):null,O("div",{class:_.container},this._renderFeatureMenu()),O("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:_.featureMenuObserver}),O("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?O("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=u({action:e,feature:this.selectedFeature}),s={[_.icon]:!!t,[_.actionImage]:!!o};return t&&(s[t]=!0),o||t?O("span",{"aria-hidden":"true",class:this.classes(_.icon,s),key:"icon",styles:h(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?O("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},O("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?O("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=c(i);this.open({features:[t],location:null!=o?o:void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await o(r(t));const i="menu-flow-item"===e?this._featureMenuViewportNode:this._rootFlowItemNode;x(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?k(r,{messages:t}):"remove-selected-feature"===s?k(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?k(r,{messages:t}):e.title;return l&&n?k(l,n):l??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,j)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find((({uid:e})=>e===i));o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:W,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,W),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([a()],B.prototype,"_drillInFlowItems",void 0),e([a()],B.prototype,"_hideActionText",null),e([a()],B.prototype,"_featureNavigationVisible",null),e([a()],B.prototype,"_isCollapsed",null),e([a()],B.prototype,"_collapseEnabled",null),e([a({readOnly:!0})],B.prototype,"active",null),e([a()],B.prototype,"collapsed",void 0),e([a()],B.prototype,"content",null),e([a()],B.prototype,"icon",null),e([a()],B.prototype,"featureMenuOpen",null),e([a()],B.prototype,"featureMenuTitle",null),e([a()],B.prototype,"featureNavigationTop",void 0),e([a()],B.prototype,"features",null),e([a()],B.prototype,"goToOverride",null),e([a({type:b})],B.prototype,"headerActions",void 0),e([a()],B.prototype,"headingLevel",void 0),e([a()],B.prototype,"location",null),e([a()],B.prototype,"label",null),e([a()],B.prototype,"map",null),e([a(),N("esri/widgets/Features/t9n/Features")],B.prototype,"messages",void 0),e([a(),N("esri/t9n/common")],B.prototype,"messagesCommon",void 0),e([a()],B.prototype,"promises",null),e([a()],B.prototype,"responsiveActionsEnabled",void 0),e([a({readOnly:!0})],B.prototype,"selectedFeature",null),e([a({readOnly:!0})],B.prototype,"selectedDrillInFeature",null),e([a()],B.prototype,"selectedFeatureIndex",null),e([a({readOnly:!0})],B.prototype,"selectedFeatureWidget",null),e([a()],B.prototype,"spatialReference",null),e([a()],B.prototype,"title",null),e([a()],B.prototype,"timeZone",null),e([a()],B.prototype,"updateLocationEnabled",null),e([a()],B.prototype,"view",null),e([a({type:M}),T(["triggerAction","trigger-action"])],B.prototype,"viewModel",void 0),e([a({type:F,nonNullable:!0})],B.prototype,"visibleElements",void 0),e([a()],B.prototype,"visible",null),B=e([d("esri.widgets.Features")],B);const R=B;export{R as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as l}from"../../support/actions/actionUtils.js";import a from"../Widget.js";import{getStatusIcon as r,getVisibilityIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";var v;let _=v=class extends a{constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:l,parent:a,css:r}=this,c="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,d="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:p}=i,m="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":p?.id,dragDisabled:!i.sortable||d,id:p?.uid,key:`list-item-${p?.uid}`,label:t,metadata:{parentTitles:e,_title:t},open:"open"in i&&i.open,selected:"none"!==o&&s.includes(i),title:c,unavailable:m,value:p?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,a),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,a=!!l;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:a},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:a&&"connected"===l}),icon:r({connectionStatus:l,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,l="temporaryTableIndicators"in t&&t.temporaryTableIndicators,a=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||l)&&a?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{item:e,parent:t,messages:i,visibilityAppearance:n,css:o}=this;if(!("visible"in e&&"layerVisibility"in i&&"visibleToggle"in o&&n))return null;const{visible:s}=e,l=t?.visibilityMode;if("inherited"===l)return null;const a=c({visible:s,exclusive:"exclusive"===l,visibilityAppearance:n}),r="checkbox"===n,d=i.layerVisibility;return h("calcite-action",{appearance:"transparent",class:o.visibleToggle,icon:r?a:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:d,title:d},r?null:h("calcite-icon",{class:this.classes({[o.visibleIcon]:"exclusive"!==l&&s}),icon:a,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map((e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map((e=>this._renderAction({action:e,textEnabled:!0}))))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("visible"in t))return;const l=[...this.parentTitles??[],t.title],{children:a,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r);return c||!u&&!c&&e&&"group"===r?.type?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:!!e&&(t.childrenSortable&&m(t)),group:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},a?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error))).toArray().map((e=>this._renderItem(e,t,l))),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map((e=>e.filter((e=>e.visible))))}get _actionsCount(){return this.item.actionsSections.reduce(((e,t)=>e+t.length),0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:l,title:a,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent",disabled:l,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:a??"",textEnabled:n,title:a??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{className:i,icon:n}=e;if(n)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!i,[t.itemActionImage]:!!o};return i&&(s[i]=!0),o||i?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:l(o)}):null}_renderItem(e,t,i=[]){return h(v,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_handleCalciteListItemSelect(e,t,i){g(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}};_.vnodeSelector="calcite-list-item",e([t()],_.prototype,"activeItem",void 0),e([t()],_.prototype,"canMove",void 0),e([t()],_.prototype,"css",void 0),e([t()],_.prototype,"displayMode",void 0),e([t()],_.prototype,"dragEnabled",void 0),e([t()],_.prototype,"item",void 0),e([t()],_.prototype,"layerTablesEnabled",void 0),e([t()],_.prototype,"listModeDisabled",void 0),e([t()],_.prototype,"messages",void 0),e([t()],_.prototype,"messagesCommon",void 0),e([t()],_.prototype,"onAction",void 0),e([t()],_.prototype,"onPanelOpen",void 0),e([t()],_.prototype,"onCatalogOpen",void 0),e([t()],_.prototype,"onTablesOpen",void 0),e([t()],_.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],_.prototype,"onTooltipReferenceChange",void 0),e([t()],_.prototype,"parent",void 0),e([t()],_.prototype,"parentTitles",void 0),e([t()],_.prototype,"rootGroupUid",void 0),e([t()],_.prototype,"selectionMode",void 0),e([t()],_.prototype,"selectedItems",void 0),e([t()],_.prototype,"selectedDragItemLayerUid",void 0),e([t()],_.prototype,"visibleElements",void 0),e([t()],_.prototype,"visibilityAppearance",void 0),e([t()],_.prototype,"_title",null),e([t()],_.prototype,"_renderedItemStatus",null),e([t()],_.prototype,"_renderedItemTemporaryIcon",null),e([t()],_.prototype,"_renderedItemToggle",null),e([t()],_.prototype,"_renderedPanel",null),e([t()],_.prototype,"_renderedPanelAction",null),e([t()],_.prototype,"_renderedActions",null),e([t()],_.prototype,"_renderedActionMenu",null),e([t()],_.prototype,"_renderedActionMenuContent",null),e([t()],_.prototype,"_renderedCatalogFootprintIcon",null),e([t()],_.prototype,"_renderedCatalogDynamicIcon",null),e([t()],_.prototype,"_renderedCatalogSelectNode",null),e([t()],_.prototype,"_renderedChildList",null),e([t()],_.prototype,"_hasTables",null),e([t()],_.prototype,"_renderedTablesItem",null),e([t()],_.prototype,"_renderedItemMessage",null),e([t()],_.prototype,"_singleAction",null),e([t()],_.prototype,"_filteredSections",null),e([t()],_.prototype,"_actionsCount",null),_=v=e([i("esri.widgets.LayerList.LayerListItem")],_);const I=_;export{I as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as a}from"../../support/actions/actionUtils.js";import l from"../Widget.js";import{getStatusIcon as r,getVisibilityIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";var v;let _=v=class extends l{constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:a,parent:l,css:r}=this,c="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in a&&!i.visibleAtCurrentTimeExtent?`${t} (${a.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in a&&!i.visibleAtCurrentScale?`${t} (${a.layerInvisibleAtScale})`:t,d="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:p}=i,m="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":p?.id,dragDisabled:!i.sortable||d,id:p?.uid,key:`list-item-${p?.uid}`,label:t,metadata:{parentTitles:e,_title:t},open:"open"in i&&i.open,selected:"none"!==o&&s.includes(i),title:c,unavailable:m,value:p?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,l),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,a="connectionStatus"in e?e.connectionStatus:void 0,l=!!a;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:l},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:l&&"connected"===a}),icon:r({connectionStatus:a,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,a="temporaryTableIndicators"in t&&t.temporaryTableIndicators,l=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||a)&&l?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{item:e,parent:t,messages:i,visibilityAppearance:n,css:o}=this;if(!("visible"in e&&"layerVisibility"in i&&"visibleToggle"in o&&n))return null;const{visible:s}=e,a=t?.visibilityMode;if("inherited"===a)return null;const l=c({visible:s,exclusive:"exclusive"===a,visibilityAppearance:n}),r="checkbox"===n,d=i.layerVisibility;return h("calcite-action",{appearance:"transparent",class:o.visibleToggle,icon:r?l:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:d,title:d},r?null:h("calcite-icon",{class:this.classes({[o.visibleIcon]:"exclusive"!==a&&s}),icon:l,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map((e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map((e=>this._renderAction({action:e,textEnabled:!0}))))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("visible"in t))return;const a=[...this.parentTitles??[],t.title],{children:l,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r);return c||!u&&!c&&e&&"group"===r?.type?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:!!e&&(t.childrenSortable&&m(t)),group:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},l?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error))).toArray().map((e=>this._renderItem(e,t,a))),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map((e=>e.filter((e=>e.visible))))}get _actionsCount(){return this.item.actionsSections.reduce(((e,t)=>e+t.length),0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:a,title:l,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent","data-action-id":i.id,disabled:a,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:l??"",textEnabled:n,title:l??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{className:i,icon:n}=e;if(n)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!i,[t.itemActionImage]:!!o};return i&&(s[i]=!0),o||i?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return h(v,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_handleCalciteListItemSelect(e,t,i){g(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}};_.vnodeSelector="calcite-list-item",e([t()],_.prototype,"activeItem",void 0),e([t()],_.prototype,"canMove",void 0),e([t()],_.prototype,"css",void 0),e([t()],_.prototype,"displayMode",void 0),e([t()],_.prototype,"dragEnabled",void 0),e([t()],_.prototype,"item",void 0),e([t()],_.prototype,"layerTablesEnabled",void 0),e([t()],_.prototype,"listModeDisabled",void 0),e([t()],_.prototype,"messages",void 0),e([t()],_.prototype,"messagesCommon",void 0),e([t()],_.prototype,"onAction",void 0),e([t()],_.prototype,"onPanelOpen",void 0),e([t()],_.prototype,"onCatalogOpen",void 0),e([t()],_.prototype,"onTablesOpen",void 0),e([t()],_.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],_.prototype,"onTooltipReferenceChange",void 0),e([t()],_.prototype,"parent",void 0),e([t()],_.prototype,"parentTitles",void 0),e([t()],_.prototype,"rootGroupUid",void 0),e([t()],_.prototype,"selectionMode",void 0),e([t()],_.prototype,"selectedItems",void 0),e([t()],_.prototype,"selectedDragItemLayerUid",void 0),e([t()],_.prototype,"visibleElements",void 0),e([t()],_.prototype,"visibilityAppearance",void 0),e([t()],_.prototype,"_title",null),e([t()],_.prototype,"_renderedItemStatus",null),e([t()],_.prototype,"_renderedItemTemporaryIcon",null),e([t()],_.prototype,"_renderedItemToggle",null),e([t()],_.prototype,"_renderedPanel",null),e([t()],_.prototype,"_renderedPanelAction",null),e([t()],_.prototype,"_renderedActions",null),e([t()],_.prototype,"_renderedActionMenu",null),e([t()],_.prototype,"_renderedActionMenuContent",null),e([t()],_.prototype,"_renderedCatalogFootprintIcon",null),e([t()],_.prototype,"_renderedCatalogDynamicIcon",null),e([t()],_.prototype,"_renderedCatalogSelectNode",null),e([t()],_.prototype,"_renderedChildList",null),e([t()],_.prototype,"_hasTables",null),e([t()],_.prototype,"_renderedTablesItem",null),e([t()],_.prototype,"_renderedItemMessage",null),e([t()],_.prototype,"_singleAction",null),e([t()],_.prototype,"_filteredSections",null),e([t()],_.prototype,"_actionsCount",null),_=v=e([i("esri.widgets.LayerList.LayerListItem")],_);const I=_;export{I as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import o from"../../core/Collection.js";import t from"../../core/Error.js";import i from"../../core/Logger.js";import{watch as n,on as s}from"../../core/reactiveUtils.js";import{removeTrailingSlash as a}from"../../core/urlUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import{getOwningPortalUrl as p}from"../../layers/support/layerUtils.js";import l from"../../portal/Portal.js";import{hasUserTypeExtension as h,hasPrivilege as m}from"../../portal/support/utils.js";import c from"../../rest/featureService/FeatureService.js";import{createFeatureServices as g}from"../../rest/featureService/utils.js";import{getVersioningStates as w}from"../../versionManagement/utils.js";import f from"../../versionManagement/VersioningState.js";import E from"../../versionManagement/VersionManagementService.js";import{createVersionAdapters as L}from"../../versionManagement/versionAdapters/utils.js";let _=class extends r{constructor(e){super(e),this._portalLookup=new Map,this._updatingHandlesLoad=new v,this._updatingHandlesExecute=new v,this.advancedEditingUserTypeExtensionLookup=new Map,this.executionError=void 0,this.featureServiceLookup=new Map,this.loadError=void 0,this.serverVersionLookup=new Map,this.serviceNameLookup=new Map,this.userLookup=new Map,this.versionIdentifierLookup=new Map,this.versionInfoLookup=new Map,this.versionAdministratorLookup=new Map,this.versionManagementServiceLookup=new Map,this.versioningStateLookup=new Map,this.view=null,this.versioningStates=null}initialize(){this._viewChangeHandle(),this.addHandles([n((()=>this.view),(()=>{this._resetAllLookupProperties(),this._viewChangeHandle()})),n((()=>this.versioningStates),(()=>{this._resetVersioningLookupProperties(),this._setVersioningStatesLookups()}))])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":this.executionError?"failed":"ready"}async alterVersion(e){return this._updatingHandlesExecute.addPromise(this._alterVersionInternal(e))}async changeVersion(e,r,o){return this._updatingHandlesExecute.addPromise(this._changeVersionInternal(e,r,o))}async createVersion(e){return this._updatingHandlesExecute.addPromise(this._createVersionInternal(e))}async deleteVersion(e,r,o){return this._updatingHandlesExecute.addPromise(this._deleteVersionInternal(e,r,o))}async getVersionInfos(e){return this._updatingHandlesExecute.addPromise(this._getVersionInfosInternal(e))}async _alterVersionInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=this.versioningStateLookup.get(e.featureServerUrl);if(!r)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);if(!this.serverVersionLookup.has(e.featureServerUrl)||this.serverVersionLookup.get(e.featureServerUrl)<=11.1)throw this._logError("version-management-view-model:execution-error","no-valid-enterprise-version"),new t("version-management-view-model:execution-error",this.executionError);if(!this.advancedEditingUserTypeExtensionLookup.get(e.featureServerUrl))throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError);const{featureServerUrl:o,versionIdentifier:i,...n}=e,s=await r.alterVersion(i,n).catch((e=>{throw this._logExecutionError(e),e}));return await this.getVersionInfos(o),s}async _changeVersionInternal(e,r,o){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const i=this.versioningStateLookup.get(e);if(!i)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);const n={name:r,guid:o};return await i.changeVersion(n).catch((e=>{throw this._logExecutionError(e),e}))}_updateVersionableItems(e){this._updatingHandlesLoad.addPromise((async()=>{L(e.added).forEach((e=>{const r=e.featureServiceUrl,o=this.versioningStateLookup.get(r);o&&(o.versionableItems.find((r=>r.versionableItem===e.versionableItem))||o.versionableItems.add(e))}));L(e.removed).forEach((e=>{const{allLayers:r,allTables:o}=this.view.map,t=e.featureServiceUrl,i=this.versioningStateLookup.get(t);if(!i)return void this._logError("version-management-view-model:execution-error","no-version-management-service-found");const n=e=>("feature"===e.type||"subtype-group"===e.type)&&(e.url?.includes(t)??!1);[...r.filter(n),...o.filter(n)].length||(this.featureServiceLookup.delete(t),this.serviceNameLookup.delete(t),this.versioningStateLookup.delete(t),this.versioningStates.remove(i));const s=i.versionableItems.find((r=>r.versionableItem===e.versionableItem));s&&i.versionableItems.remove(s)}))})())}async _createVersionInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=e.featureServerUrl,o=this.versioningStateLookup.get(r);if(!o)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);const i=this.advancedEditingUserTypeExtensionLookup.get(e.featureServerUrl),n=this.userLookup.get(r).toUpperCase(),s=this._isEmptyString(e.ownerName)?n:e.ownerName?.trim().toUpperCase();if(s!==n){if(this.serverVersionLookup.get(r)<=11.1)throw this._logError("version-management-view-model:execution-error","versioning-api-error"),new t("version-management-view-model:execution-error",this.executionError);if(!i)throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError)}let a=await(this.versioningStateLookup.get(r)?.getVersionInfos());if("SDE"===s?.toUpperCase()&&"DEFAULT"===e.versionName.toUpperCase()||a?.find((r=>r.versionIdentifier.name.toUpperCase()===(s+"."+e.versionName).toUpperCase()||r.versionIdentifier.name.toUpperCase()===(n+"."+e.versionName).toUpperCase())))throw this._logError("version-management-view-model:execution-error","no-valid-version-name"),new t("version-management-view-model:execution-error",this.executionError);const d=await o.versionManagementService.createVersion({versionName:e.versionName,access:s!==n?"public":e.access,description:e.description}).catch((e=>{throw this._logExecutionError(e),e}));if(s!==n){const{guid:o,name:t}=d.versionIdentifier,i={featureServerUrl:r,versionIdentifier:{guid:o,name:t},access:e.access,ownerName:s};await this.alterVersion(i)||this.deleteVersion(r,n+"."+e.versionName,d.versionIdentifier.guid)}return await this.getVersionInfos(r),a=await(this.versioningStateLookup.get(r)?.getVersionInfos()),a?.find((e=>e.versionIdentifier.guid===d.versionIdentifier.guid))}async _deleteVersionInternal(e,r,o){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const i=this.versioningStateLookup.get(e);if(!i)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);if(this.serverVersionLookup.get(e)<=11.1)throw this._logError("version-management-view-model:execution-error","versioning-api-error"),new t("version-management-view-model:execution-error",this.executionError);if(!this.advancedEditingUserTypeExtensionLookup.get(e))throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError);const n={name:r,guid:o};return await i.deleteVersion(n).catch((e=>{throw this._logExecutionError(e),new t("version-management-view-model:execution-error",this.executionError)}))}async _getVersionInfosInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=this.featureServiceLookup.get(e)?.featureService;if(!r)throw this._logError("version-management-view-model:execution-error","no-feature-service-found"),new t("version-management-view-model:execution-error",this.executionError);r.loaded||await r.load().catch((e=>{throw this._logExecutionError(e),e}));const o=r.url;this.serverVersionLookup.set(o,r.sourceJSON?.currentVersion??0),this.serverVersionLookup.get(o)<=11.1&&this.advancedEditingUserTypeExtensionLookup.set(o,!1);const i=this.userLookup.get(e);this._portalLookup.get(e)&&i?(this.advancedEditingUserTypeExtensionLookup.set(o,await h(this._portalLookup.get(e),i,"advediting")),this.versionAdministratorLookup.set(o,await m(this._portalLookup.get(e),i,"features:user:manageVersions"))):(this.advancedEditingUserTypeExtensionLookup.set(o,!1),this.versionAdministratorLookup.set(o,!1));const n=this.versioningStateLookup.get(e);if(!n)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);n.loaded||await n.load().catch((e=>{throw this._logExecutionError(e),e}));return await n.getVersionInfos(!0).catch((e=>{throw this._logExecutionError(e),e}))}_isEmptyString(e){return!e||0===e.trim().length}_logError(e,r){switch(i.getLogger(this).error(new t(e,r)),e){case"version-management-view-model:load-error":this._setLoadError(r);break;case"version-management-view-model:execution-error":this._setExecutionError(r)}}_logExecutionError(e){this._logError("version-management-view-model:execution-error",e.message)}async _viewChangeHandle(){this._updatingHandlesLoad.addPromise((async()=>{if(this._setLoadError(),!this.view)return void this._setLoadError("no-view-property");if(this.view&&"2d"!==this.view.type)return void this._logError("version-management-view-model:load-error","sceneView-not-supported");this.removeHandles("map-change-handle"),this.addHandles([n((()=>this.view?.map),(()=>{this._resetAllLookupProperties(),this._mapChangeHandle(this.versioningStates)}))],"map-change-handle");const e=await this._getVersioningStates();await this._mapChangeHandle(e)})())}async _mapChangeHandle(e){this._updatingHandlesLoad.addPromise((async()=>{this._setLoadError(),this.removeHandles("map-layers-tables-change-handle"),this.addHandles([s((()=>this.view?.map.allLayers),"change",(e=>{(e.added.some((({type:e})=>"feature"===e))||e.removed.some((({type:e})=>"feature"===e))||e.added.some((({type:e})=>"subtype-group"===e))||e.removed.some((({type:e})=>"subtype-group"===e)))&&(this._resetServiceRelatedLookupProperties(),this._propertiesChangeInternal(this.versioningStates),this._updateVersionableItems(e))})),s((()=>this.view?.map.allTables),"change",(e=>{(e.added.some((({type:e})=>"feature"===e))||e.removed.some((({type:e})=>"feature"===e))||e.added.some((({type:e})=>"subtype-group"===e))||e.removed.some((({type:e})=>"subtype-group"===e)))&&(this._resetServiceRelatedLookupProperties(),this._propertiesChangeInternal(this.versioningStates),this._updateVersionableItems(e))}))],"map-layers-tables-change-handle"),await this._propertiesChangeInternal(e)})())}async _propertiesChangeInternal(e){this._updatingHandlesLoad.addPromise((async()=>{const r=e=>"feature"===e.type||"subtype-group"===e.type,{allLayers:o,allTables:t}=this.view.map;if(this._setLoadError(),this.featureServiceLookup=g([...o.filter(r),...t.filter(r)]),this.featureServiceLookup.size){this._updateFeatureServiceLookup(e),this.serviceNameLookup=new Map;for(const e of this.featureServiceLookup.values()){const{featureService:r,featureService:{url:o}}=e;if(!this.serviceNameLookup.has(o)){if(r.loaded||await r.load().catch((e=>{i.getLogger(this).error(e)})),!r.versionManagementServiceUrl){this.featureServiceLookup.delete(o);continue}const e=await p(o),t=new l({authMode:"immediate",url:e});await t.load().catch((e=>{i.getLogger(this).error(e)}));const n=t.user?.username;if(!r.loaded||!t.loaded||!n)continue;this.serviceNameLookup.set(a(o),o.split("/").at(-2)),this.userLookup.set(o,n),this._portalLookup.set(o,t)}}this.removeHandles("versioning-states-change-handle"),e.forEach((e=>this._handleVersioningStateLookupUpdate(e))),await this._updateVersioningStates(e),this.versioningStates=e}else this._logError("version-management-view-model:load-error","no-feature-services")})())}_updateFeatureServiceLookup(e){for(const r of e){const e=r.featureServiceUrl;if(!this.featureServiceLookup.has(e)){const o=new c({url:e}),t=r.versionableItems.toArray().flatMap((e=>"network"===e.type?null:e.versionableItem));this.featureServiceLookup.set(e,{featureService:o,layers:t})}}}async _updateVersioningStates(e){for(const r of this.featureServiceLookup.values()){const t=r.featureService;if(!t.versionManagementServiceUrl)continue;if(!e.find((e=>e.featureServiceUrl===t.url))&&t.versionManagementServiceUrl){const i=new o(L(r.layers)),n=new f({versionManagementService:new E({url:t.versionManagementServiceUrl}),versionableItems:i});e.add(n),this._handleVersioningStateLookupUpdate(n)}await this.getVersionInfos(t.url)}}async _getVersioningStates(){return this.versioningStates&&this.versioningStates.length?this.versioningStates:this.view?await w(this.view,!1):(this._logError("version-management-view-model:load-error","no-view-property"),new o)}_handleVersioningStateLookupUpdate(e){this.versioningStateLookup.set(e.featureServiceUrl,e),this._addHandlesToVersioningState(e),this.versionIdentifierLookup.set(e.featureServiceUrl,e.currentVersionInfo?.versionIdentifier),this.versionManagementServiceLookup.set(e.featureServiceUrl,e.versionManagementService)}async _setVersioningStatesLookups(){this._updatingHandlesLoad.addPromise((async()=>{this.versioningStates&&(this.removeHandles("versioning-states-change-handle"),this._updateFeatureServiceLookup(this.versioningStates),this.versioningStates.forEach((e=>this._handleVersioningStateLookupUpdate(e))),await this._updateVersioningStates(this.versioningStates))})())}_addHandlesToVersioningState(e){this.addHandles([n((()=>e.versionInfos),(()=>{this.versionInfoLookup.set(e.featureServiceUrl,e.versionInfos)})),n((()=>e.currentVersionInfo?.versionIdentifier),(()=>{this.versionIdentifierLookup.set(e.featureServiceUrl,e.currentVersionInfo?.versionIdentifier)}))],"versioning-states-change-handle")}_resetVersioningLookupProperties(){this.versionIdentifierLookup=new Map,this.versionInfoLookup=new Map,this.versionManagementServiceLookup=new Map,this.versioningStateLookup=new Map}_resetAllLookupProperties(){this._portalLookup=new Map,this.advancedEditingUserTypeExtensionLookup=new Map,this.serverVersionLookup=new Map,this.userLookup=new Map,this.versioningStates=new o,this._resetVersioningLookupProperties(),this._resetServiceRelatedLookupProperties()}_resetServiceRelatedLookupProperties(){this.featureServiceLookup=new Map,this.serviceNameLookup=new Map}_setExecutionError(e){this._set("executionError",e)}_setLoadError(e){this._set("loadError",e)}};e([d()],_.prototype,"_portalLookup",void 0),e([d()],_.prototype,"advancedEditingUserTypeExtensionLookup",void 0),e([d({readOnly:!0})],_.prototype,"executionError",void 0),e([d()],_.prototype,"featureServiceLookup",void 0),e([d({readOnly:!0})],_.prototype,"loadError",void 0),e([d()],_.prototype,"serverVersionLookup",void 0),e([d()],_.prototype,"serviceNameLookup",void 0),e([d({readOnly:!0})],_.prototype,"state",null),e([d()],_.prototype,"userLookup",void 0),e([d()],_.prototype,"versionIdentifierLookup",void 0),e([d()],_.prototype,"versionInfoLookup",void 0),e([d()],_.prototype,"versionAdministratorLookup",void 0),e([d()],_.prototype,"versionManagementServiceLookup",void 0),e([d()],_.prototype,"versioningStateLookup",void 0),e([d()],_.prototype,"view",void 0),e([d()],_.prototype,"versioningStates",void 0),_=e([u("esri.widgets.VersionManagement.VersionManagementViewModel")],_);const S=_;export{S as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import o from"../../core/Collection.js";import t from"../../core/Error.js";import i from"../../core/Logger.js";import{watch as n,on as s}from"../../core/reactiveUtils.js";import{removeTrailingSlash as a}from"../../core/urlUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import{getOwningPortalUrl as p}from"../../layers/support/layerUtils.js";import l from"../../portal/Portal.js";import{hasUserTypeExtension as h,hasPrivilege as m}from"../../portal/support/utils.js";import c from"../../rest/featureService/FeatureService.js";import{createFeatureServices as g}from"../../rest/featureService/utils.js";import{getVersioningStates as w}from"../../versionManagement/utils.js";import f from"../../versionManagement/VersioningState.js";import E from"../../versionManagement/VersionManagementService.js";import{createVersionAdapters as L}from"../../versionManagement/versionAdapters/utils.js";let _=class extends r{constructor(e){super(e),this._portalLookup=new Map,this._updatingHandlesLoad=new v,this._updatingHandlesExecute=new v,this.advancedEditingUserTypeExtensionLookup=new Map,this.executionError=void 0,this.featureServiceLookup=new Map,this.loadError=void 0,this.serverVersionLookup=new Map,this.serviceNameLookup=new Map,this.userLookup=new Map,this.versionIdentifierLookup=new Map,this.versionInfoLookup=new Map,this.versionAdministratorLookup=new Map,this.versionManagementServiceLookup=new Map,this.versioningStateLookup=new Map,this.view=null,this.versioningStates=null}initialize(){this._viewChangeHandle(),this.addHandles([n((()=>this.view),(()=>{this._resetAllLookupProperties(),this._viewChangeHandle()})),n((()=>this.versioningStates),(()=>{this._resetVersioningLookupProperties(),this._setVersioningStatesLookups()}))])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":this.executionError?"failed":"ready"}async alterVersion(e){return this._updatingHandlesExecute.addPromise(this._alterVersionInternal(e))}async changeVersion(e,r,o){return this._updatingHandlesExecute.addPromise(this._changeVersionInternal(e,r,o))}async createVersion(e){return this._updatingHandlesExecute.addPromise(this._createVersionInternal(e))}async deleteVersion(e,r,o){return this._updatingHandlesExecute.addPromise(this._deleteVersionInternal(e,r,o))}async getVersionInfos(e){return this._updatingHandlesExecute.addPromise(this._getVersionInfosInternal(e))}async _alterVersionInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=this.versioningStateLookup.get(e.featureServerUrl);if(!r)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);if(!this.serverVersionLookup.has(e.featureServerUrl)||this.serverVersionLookup.get(e.featureServerUrl)<=11.1)throw this._logError("version-management-view-model:execution-error","no-valid-enterprise-version"),new t("version-management-view-model:execution-error",this.executionError);if(!this.advancedEditingUserTypeExtensionLookup.get(e.featureServerUrl))throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError);const{featureServerUrl:o,versionIdentifier:i,...n}=e,s=await r.alterVersion(i,n).catch((e=>{throw this._logExecutionError(e),e}));return await this.getVersionInfos(o),s}async _changeVersionInternal(e,r,o){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const i=this.versioningStateLookup.get(e);if(!i)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);const n={name:r,guid:o};return await i.changeVersion(n).catch((e=>{throw this._logExecutionError(e),e}))}_updateVersionableItems(e){this._updatingHandlesLoad.addPromise((async()=>{L(e.added).forEach((e=>{const r=e.featureServiceUrl,o=this.versioningStateLookup.get(r);o&&(o.versionableItems.find((r=>r.versionableItem===e.versionableItem))||o.versionableItems.add(e))}));L(e.removed).forEach((e=>{const{allLayers:r,allTables:o}=this.view.map,t=e.featureServiceUrl,i=this.versioningStateLookup.get(t);if(!i)return void this._logError("version-management-view-model:execution-error","no-version-management-service-found");const n=e=>("feature"===e.type||"subtype-group"===e.type)&&(e.url?.includes(t)??!1);[...r.filter(n),...o.filter(n)].length||(this.featureServiceLookup.delete(t),this.serviceNameLookup.delete(t),this.versioningStateLookup.delete(t),this.versioningStates.remove(i));const s=i.versionableItems.find((r=>r.versionableItem===e.versionableItem));s&&i.versionableItems.remove(s)}))})())}async _createVersionInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=e.featureServerUrl,o=this.versioningStateLookup.get(r);if(!o)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);const i=this.advancedEditingUserTypeExtensionLookup.get(e.featureServerUrl),n=this.userLookup.get(r).toUpperCase(),s=this._isEmptyString(e.ownerName)?n:e.ownerName?.trim().toUpperCase();if(s!==n){if(this.serverVersionLookup.get(r)<=11.1)throw this._logError("version-management-view-model:execution-error","versioning-api-error"),new t("version-management-view-model:execution-error",this.executionError);if(!i)throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError)}let a=await(this.versioningStateLookup.get(r)?.getVersionInfos());if("SDE"===s?.toUpperCase()&&"DEFAULT"===e.versionName.toUpperCase()||a?.find((r=>r.versionIdentifier.name.toUpperCase()===(s+"."+e.versionName).toUpperCase()||r.versionIdentifier.name.toUpperCase()===(n+"."+e.versionName).toUpperCase())))throw this._logError("version-management-view-model:execution-error","no-valid-version-name"),new t("version-management-view-model:execution-error",this.executionError);const d=await o.versionManagementService.createVersion({versionName:e.versionName,access:s!==n?"public":e.access,description:e.description}).catch((e=>{throw this._logExecutionError(e),e}));if(s!==n){const{guid:o,name:t}=d.versionIdentifier,i={featureServerUrl:r,versionIdentifier:{guid:o,name:t},access:e.access,ownerName:s};await this.alterVersion(i)||this.deleteVersion(r,n+"."+e.versionName,d.versionIdentifier.guid)}return await this.getVersionInfos(r),a=await(this.versioningStateLookup.get(r)?.getVersionInfos()),a?.find((e=>e.versionIdentifier.guid===d.versionIdentifier.guid))}async _deleteVersionInternal(e,r,o){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const i=this.versioningStateLookup.get(e);if(!i)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);if(this.serverVersionLookup.get(e)<=11.1)throw this._logError("version-management-view-model:execution-error","versioning-api-error"),new t("version-management-view-model:execution-error",this.executionError);if(!this.advancedEditingUserTypeExtensionLookup.get(e))throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError);const n={name:r,guid:o};return await i.deleteVersion(n).catch((e=>{throw this._logExecutionError(e),new t("version-management-view-model:execution-error",this.executionError)}))}async _getVersionInfosInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=this.featureServiceLookup.get(e)?.featureService;if(!r)throw this._logError("version-management-view-model:execution-error","no-feature-service-found"),new t("version-management-view-model:execution-error",this.executionError);r.loaded||await r.load().catch((e=>{throw this._logExecutionError(e),e}));const o=r.url;this.serverVersionLookup.set(o,r.sourceJSON?.currentVersion??0),this.serverVersionLookup.get(o)<=11.1&&this.advancedEditingUserTypeExtensionLookup.set(o,!1);const i=this.userLookup.get(e);this._portalLookup.get(e)&&i?(this.advancedEditingUserTypeExtensionLookup.set(o,await h(this._portalLookup.get(e),i,"advediting")),this.versionAdministratorLookup.set(o,await m(this._portalLookup.get(e),i,"features:user:manageVersions"))):(this.advancedEditingUserTypeExtensionLookup.set(o,!1),this.versionAdministratorLookup.set(o,!1));const n=this.versioningStateLookup.get(e);if(!n)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);n.loaded||await n.load().catch((e=>{throw this._logExecutionError(e),e}));return await n.getVersionInfos(!0).catch((e=>{throw this._logExecutionError(e),e}))}_isEmptyString(e){return!e||0===e.trim().length}_logError(e,r){switch(i.getLogger(this).error(new t(e,r)),e){case"version-management-view-model:load-error":this._setLoadError(r);break;case"version-management-view-model:execution-error":this._setExecutionError(r)}}_logExecutionError(e){this._logError("version-management-view-model:execution-error",e.message)}async _viewChangeHandle(){this._updatingHandlesLoad.addPromise((async()=>{if(this._setLoadError(),!this.view)return void this._setLoadError("no-view-property");if(this.view&&"2d"!==this.view.type)return void this._logError("version-management-view-model:load-error","sceneView-not-supported");this.removeHandles("map-change-handle"),this.addHandles([n((()=>this.view?.map),(()=>{this._resetAllLookupProperties(),this._mapChangeHandle(this.versioningStates)}))],"map-change-handle");const e=await this._getVersioningStates();await this._mapChangeHandle(e)})())}async _mapChangeHandle(e){this._updatingHandlesLoad.addPromise((async()=>{this._setLoadError(),this.removeHandles("map-layers-tables-change-handle"),this.addHandles([s((()=>this.view?.map.allLayers),"change",(e=>{(e.added.some((({type:e})=>"feature"===e))||e.removed.some((({type:e})=>"feature"===e))||e.added.some((({type:e})=>"subtype-group"===e))||e.removed.some((({type:e})=>"subtype-group"===e)))&&(this._resetServiceRelatedLookupProperties(),this._propertiesChangeInternal(this.versioningStates),this._updateVersionableItems(e))})),s((()=>this.view?.map.allTables),"change",(e=>{(e.added.some((({type:e})=>"feature"===e))||e.removed.some((({type:e})=>"feature"===e))||e.added.some((({type:e})=>"subtype-group"===e))||e.removed.some((({type:e})=>"subtype-group"===e)))&&(this._resetServiceRelatedLookupProperties(),this._propertiesChangeInternal(this.versioningStates),this._updateVersionableItems(e))}))],"map-layers-tables-change-handle"),await this._propertiesChangeInternal(e)})())}async _propertiesChangeInternal(e){this._updatingHandlesLoad.addPromise((async()=>{const r=e=>"feature"===e.type||"subtype-group"===e.type,{allLayers:o,allTables:t}=this.view.map;if(this._setLoadError(),this.featureServiceLookup=g([...o.filter(r),...t.filter(r)]),this.featureServiceLookup.size){this._updateFeatureServiceLookup(e),this.serviceNameLookup=new Map;for(const e of this.featureServiceLookup.values()){const{featureService:r,featureService:{url:o}}=e;if(!this.serviceNameLookup.has(o)){if(r.loaded||await r.load().catch((e=>{i.getLogger(this).error(e)})),!r.versionManagementServiceUrl){this.featureServiceLookup.delete(o);continue}const e=await p(o),t=new l({authMode:"immediate",url:e});await t.load().catch((e=>{i.getLogger(this).error(e)}));const n=t.user?.username;if(!r.loaded||!t.loaded||!n)continue;this.serviceNameLookup.set(a(o),o.split("/").at(-2)),this.userLookup.set(o,n),this._portalLookup.set(o,t)}}this.removeHandles("versioning-states-change-handle"),e.forEach((e=>this._handleVersioningStateLookupUpdate(e))),await this._updateVersioningStates(e),this.versioningStates=e}else this._logError("version-management-view-model:load-error","no-feature-services")})())}_updateFeatureServiceLookup(e){for(const r of e){const e=r.featureServiceUrl;if(!this.featureServiceLookup.has(e)){const o=new c({url:e}),t=r.versionableItems.toArray().flatMap((e=>"network"===e.type?null:e.versionableItem)).filter((e=>!!e));this.featureServiceLookup.set(e,{featureService:o,layers:t})}}}async _updateVersioningStates(e){for(const r of this.featureServiceLookup.values()){const t=r.featureService;if(!t.versionManagementServiceUrl)continue;if(!e.find((e=>e.featureServiceUrl===t.url))&&t.versionManagementServiceUrl){const i=new o(L(r.layers)),n=new f({versionManagementService:new E({url:t.versionManagementServiceUrl}),versionableItems:i});e.add(n),this._handleVersioningStateLookupUpdate(n)}await this.getVersionInfos(t.url)}}async _getVersioningStates(){return this.versioningStates&&this.versioningStates.length?this.versioningStates:this.view?await w(this.view,!1):(this._logError("version-management-view-model:load-error","no-view-property"),new o)}_handleVersioningStateLookupUpdate(e){this.versioningStateLookup.set(e.featureServiceUrl,e),this._addHandlesToVersioningState(e),this.versionIdentifierLookup.set(e.featureServiceUrl,e.currentVersionInfo?.versionIdentifier),this.versionManagementServiceLookup.set(e.featureServiceUrl,e.versionManagementService)}async _setVersioningStatesLookups(){this._updatingHandlesLoad.addPromise((async()=>{this.versioningStates&&(this.removeHandles("versioning-states-change-handle"),this._updateFeatureServiceLookup(this.versioningStates),this.versioningStates.forEach((e=>this._handleVersioningStateLookupUpdate(e))),await this._updateVersioningStates(this.versioningStates))})())}_addHandlesToVersioningState(e){this.addHandles([n((()=>e.versionInfos),(()=>{this.versionInfoLookup.set(e.featureServiceUrl,e.versionInfos)})),n((()=>e.currentVersionInfo?.versionIdentifier),(()=>{this.versionIdentifierLookup.set(e.featureServiceUrl,e.currentVersionInfo?.versionIdentifier)}))],"versioning-states-change-handle")}_resetVersioningLookupProperties(){this.versionIdentifierLookup=new Map,this.versionInfoLookup=new Map,this.versionManagementServiceLookup=new Map,this.versioningStateLookup=new Map}_resetAllLookupProperties(){this._portalLookup=new Map,this.advancedEditingUserTypeExtensionLookup=new Map,this.serverVersionLookup=new Map,this.userLookup=new Map,this.versioningStates=new o,this._resetVersioningLookupProperties(),this._resetServiceRelatedLookupProperties()}_resetServiceRelatedLookupProperties(){this.featureServiceLookup=new Map,this.serviceNameLookup=new Map}_setExecutionError(e){this._set("executionError",e)}_setLoadError(e){this._set("loadError",e)}};e([d()],_.prototype,"_portalLookup",void 0),e([d()],_.prototype,"advancedEditingUserTypeExtensionLookup",void 0),e([d({readOnly:!0})],_.prototype,"executionError",void 0),e([d()],_.prototype,"featureServiceLookup",void 0),e([d({readOnly:!0})],_.prototype,"loadError",void 0),e([d()],_.prototype,"serverVersionLookup",void 0),e([d()],_.prototype,"serviceNameLookup",void 0),e([d({readOnly:!0})],_.prototype,"state",null),e([d()],_.prototype,"userLookup",void 0),e([d()],_.prototype,"versionIdentifierLookup",void 0),e([d()],_.prototype,"versionInfoLookup",void 0),e([d()],_.prototype,"versionAdministratorLookup",void 0),e([d()],_.prototype,"versionManagementServiceLookup",void 0),e([d()],_.prototype,"versioningStateLookup",void 0),e([d()],_.prototype,"view",void 0),e([d()],_.prototype,"versioningStates",void 0),_=e([u("esri.widgets.VersionManagement.VersionManagementViewModel")],_);const S=_;export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
export{accessibleHandler}from"./decorators/accessibleHandler.js";export{messageBundle}from"./decorators/messageBundle.js";export{vmEvent}from"./decorators/vmEvent.js";export{tsx,tsxFragment}from"./jsxFactory.js";export{additionalAllowedTags,classes,discardNode,isActivationKey,isRTL,onResize,renderingSanitizer,safeAttrs,setFocus,storeNode}from"./widgetUtils.js";export{getCalciteThemeClass,isDarkTheme,setCalciteThemeClass}from"../../support/themeUtils.js";function e(e){return e&&"function"==typeof e.render}function t(e){return e&&"function"==typeof e.postMixInProperties&&"function"==typeof e.buildRendering&&"function"==typeof e.postCreate&&"function"==typeof e.startup}export{t as hasDomNode,e as isWidget};
|
|
5
|
+
export{accessibleHandler}from"./decorators/accessibleHandler.js";export{messageBundle}from"./decorators/messageBundle.js";export{vmEvent}from"./decorators/vmEvent.js";export{tsx,tsxFragment}from"./jsxFactory.js";export{additionalAllowedTags,classes,cssTransition,discardNode,isActivationKey,isRTL,onResize,renderingSanitizer,safeAttrs,setFocus,storeNode}from"./widgetUtils.js";export{getCalciteThemeClass,isDarkTheme,setCalciteThemeClass}from"../../support/themeUtils.js";function e(e){return e&&"function"==typeof e.render}function t(e){return e&&"function"==typeof e.postMixInProperties&&"function"==typeof e.buildRendering&&"function"==typeof e.postCreate&&"function"==typeof e.startup}export{t as hasDomNode,e as isWidget};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"@esri/arcgis-html-sanitizer";import t from"../../core/ArrayPool.js";import{handlesGroup as
|
|
5
|
+
import e from"@esri/arcgis-html-sanitizer";import t from"../../core/ArrayPool.js";import{handlesGroup as n,makeHandle as r}from"../../core/handleUtils.js";import"../../core/has.js";import"../../core/Logger.js";import{signalFromSignalOrOptions as i}from"../../core/promiseUtils.js";import{watch as o,syncAndInitial as s}from"../../core/reactiveUtils.js";import{waitAnimationFrame as a}from"../../core/scheduling.js";import{clearVNodeCache as c}from"./vnodeCache.js";var l,u,d=function(e){if("WebkitTransition"in e.style)l="webkitTransitionEnd",u="webkitAnimationEnd";else{if(!("transition"in e.style))throw new Error("Your browser is not supported!");l="transitionend",u="animationend"}},f=function(e){l||d(e)},m=function(e,t){return void 0===t&&(t=e+"-active"),function(n){f(n);var r=!1,i=function(o){r||(r=!0,n.removeEventListener(l,i),n.removeEventListener(u,i),n.classList.remove(e),n.classList.remove(t))};n.classList.add(e),n.addEventListener(l,i),n.addEventListener(u,i),requestAnimationFrame((function(){n.classList.add(t)}))}},p=function(e,t){return void 0===t&&(t=e+"-active"),function(n,r){f(n);var i=!1,o=function(e){i||(i=!0,n.removeEventListener(l,o),n.removeEventListener(u,o),r())};n.classList.add(e),n.addEventListener(l,o),n.addEventListener(u,o),requestAnimationFrame((function(){n.classList.add(t)}))}};function v(...e){const n=t.acquire();for(let t=0;t<e.length;t++){const r=e[t],i=typeof r;if("string"===i)n.push(r);else if(Array.isArray(r))n.push.apply(n,r);else if("object"===i)for(const e in r)r[e]&&n.push(e)}const r=n.join(" ");return t.release(n),r}const h=(()=>{const e=new Map,t=new ResizeObserver((t=>{c();for(const n of t)e.get(n.target)?.(n)})),i=(n,i,o)=>(e.set(n,i),t.observe(n,o),r((()=>{t.unobserve(n),e.delete(n)})));return(e,t,a)=>{let c=null;return n([o((()=>"function"==typeof e?e():e),(e=>{c?.remove(),e&&(c=i(e,t,a))}),s),r((()=>c?.remove()))])}})();function g(e){const t=e?.closest("[dir]");return null!==t&&t instanceof HTMLElement&&"rtl"===t.dir||"rtl"===document.dir}function L(e,t){return("enter"===e?m:p)(t)}function w(e){const t="data-node-ref";this[e.getAttribute(t)]=null}function y(e){const t="data-node-ref";this[e.getAttribute(t)]=e}const b=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup",...["animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"]],E=b.reduce(((e,t)=>(e[t]=[],e)),{}),j=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],A=new e({whiteList:E,onTagAttr:(e,t,n)=>{const r=`${t}="${n}"`;if(j.includes(t))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function k(e){return"Enter"===e||" "===e}async function T(e,t){await a(i(t));const n="function"==typeof e?e():e;n&&("setFocus"in n&&"function"==typeof n.setFocus?await n.setFocus():n instanceof HTMLElement&&n.focus())}export{b as additionalAllowedTags,v as classes,L as cssTransition,w as discardNode,k as isActivationKey,g as isRTL,h as onResize,A as renderingSanitizer,j as safeAttrs,T as setFocus,y as storeNode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6343],{39516:(e,t,r)=>{async function s(e,t){const{default:s}=await r.e(8368).then(r.bind(r,88368));return s.create(e,{fieldsIndex:t})}function i(e,t){return"1=1"===e?t??e:"1=1"===t?e??t:null!=e&&""!==e?null!=t&&""!==t?`(${e}) AND (${t})`:e:t}r.d(t,{G:()=>s,m:()=>i})},13069:(e,t,r)=>{r.d(t,{AG:()=>l,lk:()=>i,vD:()=>n,yS:()=>o});const s="randomUUID"in crypto;function i(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${i().toUpperCase()}}`}function n(){return`{${i()}}`}function l(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},17625:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var s=r(90237),i=(r(59456),r(13874)),o=(r(86162),r(52464),r(65345),r(42980),r(20917),r(92438),r(96576),r(93618),r(65494),r(15036)),n=r(92071),l=r(74887),a=r(84952),u=r(10107),p=r(44208),d=r(53966),c=(r(87811),r(40608)),y=r(50498),h=r(4146),m=r(49186),f=r(92474),g=r(29953),v=r(64714),_=r(22671),w=r(5443),x=r(39829);let I=class extends f.A{constructor(){super(...arguments),this.type="geojson",this.refresh=(0,l.sg)((async e=>{await this.load();const{extent:t,timeExtent:r}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,r&&(this.sourceJSON.timeInfo.timeExtent=[r.start,r.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}}))}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then((()=>this._applyEdits(e)))}openPorts(){return this.load().then((()=>this._connection.openPorts()))}queryFeatures(e,t={}){return this.load(t).then((()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))).then((e=>_.A.fromJSON(e)))}queryFeaturesJSON(e,t={}){return this.load(t).then((()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)))}queryFeatureCount(e,t={}){return this.load(t).then((()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)))}queryObjectIds(e,t={}){return this.load(t).then((()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)))}queryExtent(e,t={}){return this.load(t).then((()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t))).then((e=>({count:e.count,extent:w.A.fromJSON(e.extent)})))}querySnapping(e,t={}){return this.load(t).then((()=>this._connection.invoke("querySnapping",e,t)))}async queryAttributeBins(e,t={}){return await this.load(),this._connection.invoke("queryAttributeBins",e?.toJSON(),t)}_applyEdits(e){if(!this._connection)throw new m.A("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,r=[],s=[],i=[];if(e.addFeatures)for(const t of e.addFeatures)r.push(this._serializeFeature(t));if(e.deleteFeatures)for(const r of e.deleteFeatures)"objectId"in r&&null!=r.objectId?s.push(r.objectId):"attributes"in r&&null!=r.attributes[t]&&s.push(r.attributes[t]);if(e.updateFeatures)for(const t of e.updateFeatures)i.push(this._serializeFeature(t));return this._connection.invoke("applyEdits",{adds:r,updates:i,deletes:s}).then((({extent:e,timeExtent:t,featureEditResults:r})=>(this.sourceJSON.extent=e,t&&(this.sourceJSON.timeInfo.timeExtent=[t.start,t.end]),this._createEditsResult(r))))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m.A("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,r=this._geometryForSerialization(e);return r?{geometry:r.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return null==t?null:"mesh"===t.type||"extent"===t.type?x.A.fromExtent(t.extent):t}async _startWorker(e){this._connection=await(0,g.ho)("GeoJSONSourceWorker",{strategy:(0,p.A)("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:r,hasZ:s,geometryType:i,objectIdField:o,url:n,timeInfo:l,customParameters:a}=this.layer,u="defaults"===this.layer.originOf("spatialReference"),c={url:n,customParameters:a,fields:t&&t.map((e=>e.toJSON())),geometryType:y.g.toJSON(i),hasZ:s,objectIdField:o,timeInfo:l?l.toJSON():null,spatialReference:u?null:r&&r.toJSON()},h=await this._connection.invoke("load",c,{signal:e});for(const e of h.warnings)d.A.getLogger(this.layer).warn("#load()",`${e.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:e});h.featureErrors.length&&d.A.getLogger(this.layer).warn("#load()",`Encountered ${h.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:h.featureErrors}),this.sourceJSON=h.layerDefinition,this.capabilities=(0,v.f)(this.sourceJSON.hasZ,!0)}};(0,s._)([(0,u.MZ)()],I.prototype,"capabilities",void 0),(0,s._)([(0,u.MZ)()],I.prototype,"type",void 0),(0,s._)([(0,u.MZ)({constructOnly:!0})],I.prototype,"layer",void 0),(0,s._)([(0,u.MZ)()],I.prototype,"sourceJSON",void 0),I=(0,s._)([(0,c.$)("esri.layers.graphics.sources.GeoJSONSource")],I);var E=r(63074),A=r(69208),F=r(87718),M=r(76294),b=r(16131),S=r(32756),T=r(8303),O=r(54310),R=r(25036),Z=r(82935),P=r(10873),j=r(29005),N=r(20437),U=r(17036),C=r(30524),$=r(81457),J=r(39383),D=r(61956),q=r(30291),B=r(56400),G=r(16930);const Q=(0,U.p)();let z=class extends((0,S.fY)((0,A.d)((0,M.J)((0,F.F)((0,E.dM)((0,Z.e)((0,R.j)((0,O.J)((0,b.q)((0,T.A)((0,n.P)(h.A)))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new I({layer:this}),this.spatialReference=G.A.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(l.QP).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),(0,C.yp)(this.renderer,this.fieldsIndex),(0,C.sv)(this.timeInfo,this.fieldsIndex)}));return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&null==this.geometryType}get parsedUrl(){return this.url?(0,a.An)(this.url):null}set renderer(e){(0,C.yp)(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=(0,a.An)(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await r.e(8628).then(r.bind(r,78628));await this.load();const i=await s(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),i}on(e,t){return super.on(e,t)}createPopupTemplate(e){return(0,q.tn)(this,e)}createQuery(){const e=new D.A,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:s}=this;return e.timeExtent=null!=r&&null!=s?s.offset(-r.value,r.unit):s||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(D.A.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(D.A.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(D.A.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(D.A.from(e)||this.createQuery(),t)))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return null!=t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};(0,s._)([(0,u.MZ)(P.zQ)],z.prototype,"attributeTableTemplate",void 0),(0,s._)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!1}})],z.prototype,"capabilities",null),(0,s._)([(0,u.MZ)({type:String})],z.prototype,"copyright",void 0),(0,s._)([(0,u.MZ)({readOnly:!0})],z.prototype,"createQueryVersion",null),(0,s._)([(0,u.MZ)((0,B.P6)("dateFieldsTimeReference"))],z.prototype,"dateFieldsTimeZone",void 0),(0,s._)([(0,u.MZ)({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),(0,s._)([(0,u.MZ)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],z.prototype,"definitionExpression",void 0),(0,s._)([(0,u.MZ)({type:String})],z.prototype,"displayField",void 0),(0,s._)([(0,u.MZ)({type:Boolean})],z.prototype,"editingEnabled",void 0),(0,s._)([(0,u.MZ)(P.Yj)],z.prototype,"elevationInfo",void 0),(0,s._)([(0,u.MZ)({type:[N.A],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],z.prototype,"fields",void 0),(0,s._)([(0,u.MZ)(Q.fieldsIndex)],z.prototype,"fieldsIndex",void 0),(0,s._)([(0,u.MZ)({type:w.A,json:{name:"extent"}})],z.prototype,"fullExtent",void 0),(0,s._)([(0,u.MZ)({type:["point","polygon","polyline","multipoint"],json:{read:{reader:y.g.read}}})],z.prototype,"geometryType",void 0),(0,s._)([(0,u.MZ)({type:Boolean})],z.prototype,"hasZ",void 0),(0,s._)([(0,u.MZ)(P.id)],z.prototype,"id",void 0),(0,s._)([(0,u.MZ)({type:Boolean,readOnly:!0})],z.prototype,"isTable",null),(0,s._)([(0,u.MZ)(P.kF)],z.prototype,"labelsVisible",void 0),(0,s._)([(0,u.MZ)({type:[$.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:J.w},write:!0}})],z.prototype,"labelingInfo",void 0),(0,s._)([(0,u.MZ)(P.fV)],z.prototype,"legendEnabled",void 0),(0,s._)([(0,u.MZ)({type:["show","hide"]})],z.prototype,"listMode",void 0),(0,s._)([(0,u.MZ)({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],z.prototype,"objectIdField",void 0),(0,s._)([(0,u.MZ)(P.ke)],z.prototype,"opacity",void 0),(0,s._)([(0,u.MZ)({type:["GeoJSON"]})],z.prototype,"operationalLayerType",void 0),(0,s._)([(0,u.MZ)(Q.outFields)],z.prototype,"outFields",void 0),(0,s._)([(0,u.MZ)({readOnly:!0})],z.prototype,"parsedUrl",null),(0,s._)([(0,u.MZ)(P.M6)],z.prototype,"popupEnabled",void 0),(0,s._)([(0,u.MZ)({type:i.A,json:{name:"popupInfo",write:!0}})],z.prototype,"popupTemplate",void 0),(0,s._)([(0,u.MZ)({types:o.H,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:o.X}}}})],z.prototype,"renderer",null),(0,s._)([(0,u.MZ)(P.PY)],z.prototype,"screenSizePerspectiveEnabled",void 0),(0,s._)([(0,u.MZ)({readOnly:!0})],z.prototype,"source",void 0),(0,s._)([(0,u.MZ)({type:G.A})],z.prototype,"spatialReference",void 0),(0,s._)([(0,u.MZ)({type:[j.A]})],z.prototype,"templates",void 0),(0,s._)([(0,u.MZ)()],z.prototype,"title",void 0),(0,s._)([(0,u.MZ)({json:{read:!1},readOnly:!0})],z.prototype,"type",void 0),(0,s._)([(0,u.MZ)(P.OZ)],z.prototype,"url",null),z=(0,s._)([(0,c.$)("esri.layers.GeoJSONLayer")],z);const k=z},99352:(e,t,r)=>{r.d(t,{F:()=>s});const s={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!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,supportsTrueCurve:!1}},64714:(e,t,r)=>{r.d(t,{F0:()=>a,Vx:()=>d,e2:()=>y,f:()=>h});var s=r(44208),i=r(4718),o=r(99352),n=r(4071),l=r(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?l.Cb:"esriGeometryPolyline"===e?l.yM:l.WR}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let p=1;function d(e,t){if((0,s.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this${c(t)} = null;`;for(const t in e)r+=`this${c(t)} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${p++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new s}catch(r){return()=>({[t]:null,...e})}}function c(e){return u.test(e)?`.${e}`:`["${e}"]`}function y(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.o8)(e)}}]}function h(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:o.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:n.$,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},69208:(e,t,r)=>{r.d(t,{d:()=>n});var s=r(90237),i=r(10107),o=(r(44208),r(53966),r(87811),r(40608));const n=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,s._)([(0,i.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,s._)([(0,o.$)("esri.layers.mixins.CustomParametersMixin")],t),t}},32756:(e,t,r)=>{r.d(t,{Rr:()=>a,fY:()=>p,ne:()=>u});var s=r(90237),i=r(93637),o=r(10107),n=(r(44208),r(53966),r(87811),r(40608)),l=r(91880);function a(e,t,r){if(!e)return null;const s=e.find((e=>!!e.field));if(!s)return null;const i=new l.A;return i.read(s,r),[i]}const u={type:[l.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:a},write:{writer:function(e,t,r,s){const o=e.find((e=>!!e.field));o&&(0,i.sM)(r,[o.toJSON()],t)}}}},p=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,s._)([(0,o.MZ)(u)],t.prototype,"orderBy",void 0),t=(0,s._)([(0,n.$)("esri.layers.mixins.OrderedLayer")],t),t}},8303:(e,t,r)=>{r.d(t,{A:()=>I});var s=r(90237),i=r(92602),o=r(70333),n=r(78888),l=r(60999),a=r(49186),u=r(53966),p=r(97768),d=r(74887),c=r(84952),y=r(10107),h=(r(44208),r(87811),r(36005)),m=r(40608),f=r(43937),g=r(83531),v=r(20655),_=r(80812),w=r(41318),x=r(10407);const I=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,p.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new _.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:s}=await r.e(1204).then(r.bind(r,41204));return(0,d.Te)(t),await s({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,d.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,d.QP)(e),!0))))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,d.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const s=!o.id?.findCredential(this.url),i=e===r.id;if(i&&r.portal.user)return this._getUserPrivileges(r,s);let n,l;if(i)n=r.portal.url;else try{n=await(0,g.wI)(this.url,t)}catch(e){(0,d.QP)(e)}if(!n||!(0,c.b8)(n,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(o.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,d.QP)(e)}const a=!0,u=!1,p=!1;if(!l)return{features:{edit:a,fullEdit:u},content:{updateItem:p}};try{if(i?await r.reload():(r=new _.default({id:e,portal:{url:n}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,s)}catch(e){(0,d.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:p}}}_getUserPrivileges(e,t){const r=(0,x.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,d.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;const r=E.credential===t?E.user:await this._fetchEditingUser(e);return E.credential=t,E.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=o.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const s=`${r.owningSystemUrl}/sharing/rest`,i=v.A.getDefault();if(i&&i.loaded&&(0,c.S8)(i.restUrl)===(0,c.S8)(s))return i.user;const a=`${s}/community/self`,u=null!=e?e.signal:null,p=await(0,l.Ke)((0,n.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return p.ok?w.A.fromJSON(p.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,s=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&s&&!(0,c.ut)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,y.MZ)({type:_.default})],t.prototype,"portalItem",null),(0,s._)([(0,h.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,y.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,s._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,s._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,s._)([(0,m.$)("esri.layers.mixins.PortalLayer")],t),t},E={credential:null,user:null}},82935:(e,t,r)=>{r.d(t,{B:()=>y,e:()=>h});var s=r(90237),i=r(10107),o=(r(44208),r(53966),r(87811),r(36005)),n=r(40608),l=r(89317),a=r(30524),u=r(96184),p=r(73133),d=r(79677),c=r(10184);const y={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:l.K}}},h=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const r=t.timeInfo.exportOptions;if(!r)return null;const s=r.timeOffset,i=p.j.fromJSON(r.timeOffsetUnits);return s&&i?new c.A({value:s,unit:i}):null}set timeInfo(e){(0,a.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,s._)([(0,i.MZ)({type:d.A,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,s._)([(0,i.MZ)({type:c.A})],t.prototype,"timeOffset",void 0),(0,s._)([(0,o.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,s._)([(0,i.MZ)({value:null,type:u.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,s._)([(0,i.MZ)(y)],t.prototype,"useViewTime",void 0),t=(0,s._)([(0,n.$)("esri.layers.mixins.TemporalLayer")],t),t}},29005:(e,t,r)=>{r.d(t,{A:()=>d});var s=r(90237),i=r(69540),o=r(66552),n=r(25482),l=r(10107),a=(r(44208),r(53966),r(87811),r(40608));const u=new o.J({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends(i.A.ClonableMixin(n.A)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,s._)([(0,l.MZ)({json:{write:!0}})],p.prototype,"name",void 0),(0,s._)([(0,l.MZ)({json:{write:!0}})],p.prototype,"description",void 0),(0,s._)([(0,l.MZ)({json:{read:u.read,write:u.write}})],p.prototype,"drawingTool",void 0),(0,s._)([(0,l.MZ)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,s._)([(0,l.MZ)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,s._)([(0,a.$)("esri.layers.support.FeatureTemplate")],p);const d=p},91880:(e,t,r)=>{r.d(t,{A:()=>d});var s,i=r(90237),o=r(66552),n=r(25482),l=r(10107),a=(r(44208),r(53966),r(87811),r(40608));const u=new o.J({asc:"ascending",desc:"descending"});let p=s=class extends n.A{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new s({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,i._)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"field",void 0),(0,i._)([(0,l.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],p.prototype,"valueExpression",void 0),(0,i._)([(0,l.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],p.prototype,"order",void 0),p=s=(0,i._)([(0,a.$)("esri.layers.support.OrderByInfo")],p);const d=p},96184:(e,t,r)=>{r.d(t,{A:()=>m});var s=r(90237),i=r(69540),o=r(25482),n=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),a=r(40608),u=r(43937),p=r(79677),d=r(10184),c=r(56400);function y(e,t){return d.A.fromJSON({value:e,unit:t})}let h=class extends(i.A.ClonableMixin(o.A)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?p.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?y(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?y(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,s._)([(0,n.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],h.prototype,"cumulative",void 0),(0,s._)([(0,n.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],h.prototype,"endField",void 0),(0,s._)([(0,n.MZ)({type:p.A,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"fullTimeExtent",void 0),(0,s._)([(0,l.w)("fullTimeExtent",["timeExtent"])],h.prototype,"readFullTimeExtent",null),(0,s._)([(0,u.K)("fullTimeExtent")],h.prototype,"writeFullTimeExtent",null),(0,s._)([(0,n.MZ)({type:Boolean,json:{write:!0}})],h.prototype,"hasLiveData",void 0),(0,s._)([(0,n.MZ)({type:d.A,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"interval",void 0),(0,s._)([(0,l.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],h.prototype,"readInterval",null),(0,s._)([(0,u.K)("interval")],h.prototype,"writeInterval",null),(0,s._)([(0,n.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],h.prototype,"startField",void 0),(0,s._)([(0,n.MZ)((0,c.P6)("timeReference",!0))],h.prototype,"timeZone",void 0),(0,s._)([(0,n.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"trackIdField",void 0),(0,s._)([(0,n.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],h.prototype,"useTime",void 0),(0,s._)([(0,n.MZ)({type:[Date],json:{read:!1}})],h.prototype,"stops",void 0),h=(0,s._)([(0,a.$)("esri.layers.support.TimeInfo")],h);const m=h},4071:(e,t,r)=>{r.d(t,{$:()=>s,P:()=>i});const s={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportedStatistics:void 0},i={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}}},17036:(e,t,r)=>{r.d(t,{p:()=>a});var s=r(44208),i=r(53966),o=r(20437),n=r(95466),l=r(30524);function a(){return{fields:{type:[o.A],value:null,set:function(e){if(e&&(0,s.A)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");i.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return n.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||i.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,l.DB)(this.fieldsIndex,e)}}}}},32730:(e,t,r)=>{r.d(t,{BI:()=>f,D3:()=>h,XJ:()=>m,lc:()=>y,mX:()=>v,rU:()=>g,tH:()=>E});var s=r(799);const i="__begin__",o="__end__",n=new RegExp(i,"ig"),l=new RegExp(o,"ig"),a=new RegExp("^"+i,"i"),u=new RegExp(o+"$","i"),p='"',d=p+" + ",c=" + "+p;function y(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function m(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=y(e.labelExpression),t.type="conventional"),t}function f(e){const t=m(e);if(!t)return null;switch(t.type){case"conventional":return v(t.expression);case"arcade":return t.expression}return null}function g(e){const t=m(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(_);return t?.[1].trim()||null}(t.expression);case"arcade":return E(t.expression)}return null}function v(e){let t;return e?(t=(0,s.HC)(e,(e=>i+'$feature["'+e+'"]'+o)),t=a.test(t)?t.replace(a,""):p+t,t=u.test(t)?t.replace(u,""):t+p,t=t.replaceAll(n,d).replaceAll(l,c)):t='""',t}const _=/^\s*\{([^}]+)\}\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,x=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,I=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function E(e){if(!e)return null;let t=w.exec(e)||x.exec(e);return t?t[1]||t[3]:(t=I.exec(e),t?t[2]:null)}},73133:(e,t,r)=>{r.d(t,{j:()=>s});const s=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},22671:(e,t,r)=>{r.d(t,{A:()=>_});var s,i=r(90237),o=r(59456),n=r(52106),l=r(66552),a=r(25482),u=r(4718),p=r(10107),d=(r(44208),r(53966),r(36005)),c=r(40608),y=r(43937),h=r(16930),m=r(65864),f=r(20437);const g=new l.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=s=class extends a.A{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=h.A.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const i=e[t],o=n.A.fromJSON(i),l=i.geometry?.spatialReference;null==o.geometry||l||(o.geometry.spatialReference=r);const a=i.aggregateGeometries,u=o.aggregateGeometries;if(a&&null!=u)for(const e in u){const t=u[e],s=a[e],i=s?.spatialReference;null==t||i||(t.spatialReference=r)}s.push(o)}return s}writeGeometryType(e,t,r,s){if(e)return void g.write(e,t,r,s);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,m.rS)(e);return s&&!r&&t.spatialReference&&(s.spatialReference=h.A.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,u.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e?.[r];s.geometry=t?.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,i]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-s)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=o.length;e<t;e++)n?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,i],scale:[o,n]}=r;let l=null,a=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;a=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*o+s),(e=>i-e*n),l,a);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,r){let s,i;const o=[];for(let n=0,l=e.length;n<l;n++){const l=e[n];if(n>0){const e=t(l[0]),n=r(l[1]);e===s&&n===i||(o.push([e-s,n-i]),s=e,i=n)}else s=t(l[0]),i=r(l[1]),o.push([s,i])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,m.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,o=s.length;e<o;e++){const o=s[e],n=this._quantizePoints(o,t,r);n&&i.push(n)}return i.length>0?((0,m.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s&&s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,s,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),s&&(e.z=s(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,m.Bi)(e)?e.rings:e.paths;let n,l;for(let e=0,s=o.length;e<s;e++){const s=o[e];for(let e=0,i=s.length;e<i;e++){const i=s[e];e>0?(n+=i[0],l+=i[1]):(n=i[0],l=i[1]),i[0]=t(n),i[1]=r(l)}}if(s&&i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2]),r[3]=i(r[3])}}else if(s)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),s&&null!=e.zmax&&null!=e.zmin&&(e.zmax=s(e.zmax),e.zmin=s(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let n,l;for(let e=0,s=o.length;e<s;e++){const s=o[e];e>0?(n+=s[0],l+=s[1]):(n=s[0],l=s[1]),s[0]=t(n),s[1]=r(l)}if(s&&i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=s(t[2]),t[3]=i(t[3])}else if(s)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=s(t[2])}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2])}}:null}};(0,i._)([(0,p.MZ)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,i._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,p.MZ)({type:[n.A],json:{write:!0}})],v.prototype,"features",void 0),(0,i._)([(0,d.w)("features")],v.prototype,"readFeatures",null),(0,i._)([(0,p.MZ)({type:[f.A],json:{write:!0}})],v.prototype,"fields",void 0),(0,i._)([(0,p.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],v.prototype,"geometryType",void 0),(0,i._)([(0,y.K)("geometryType")],v.prototype,"writeGeometryType",null),(0,i._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,i._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,i._)([(0,p.MZ)({types:o.yR,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,i._)([(0,d.w)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,i._)([(0,p.MZ)({type:h.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,i._)([(0,y.K)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,i._)([(0,p.MZ)({json:{write:!0}})],v.prototype,"transform",void 0),v=s=(0,i._)([(0,c.$)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const _=v},10184:(e,t,r)=>{r.d(t,{A:()=>c});var s=r(90237),i=r(69540),o=r(25482),n=r(88930),l=r(10107),a=(r(44208),r(53966),r(87811),r(93223)),u=r(40608),p=r(73133);let d=class extends(i.A.ClonableMixin(o.A)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,n.t)(this.value,this.unit,"milliseconds")}};(0,s._)([(0,a.e)(p.j,{nonNullable:!0})],d.prototype,"unit",void 0),(0,s._)([(0,l.MZ)({type:Number,json:{write:!0},nonNullable:!0})],d.prototype,"value",void 0),d=(0,s._)([(0,u.$)("esri.time.TimeInterval")],d);const c=d}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7367],{87367:(n,t,e)=>{e.r(t),e.d(t,{registerFunctions:()=>C});var r=e(47609),i=e(66395),a=e(85935),u=e(78502),o=e(78878),c=e(80672),s=e(50377),l=e(51092),f=e(83047),d=e(5443),w=e(91075),A=e(14469),h=e(48526),y=e(86738),m=e(39829),p=e(82799),v=e(65864),g=e(20655),D=e(70333),T=e(78888);async function $(n,t,e){const r=D.id?.findCredential(n.restUrl);if(!r)return null;if("loaded"===n.loadStatus&&""===t&&n.user?.sourceJSON&&!1===e)return n.user.sourceJSON;const i={responseType:"json",query:{f:"json"}};if(e&&(i.query.returnUserLicenseTypeExtensions=!0),""===t){const t=await(0,T.A)(n.restUrl+"/community/self",i);if(t.data){const n=t.data;if(n?.username)return n}return null}const a=await(0,T.A)(n.restUrl+"/community/users/"+t,i);if(a.data){const n=a.data;return n.error?null:n}return null}var I=e(54218);function P(n,t,e){if((0,o.B)(n,2,2,t,e),n[0]instanceof w.A&&n[1]instanceof w.A);else if(n[0]instanceof w.A&&null===n[1]);else if(n[1]instanceof w.A&&null===n[0]);else if(null!==n[0]||null!==n[1])throw new a.D$(t,a.TX.InvalidParameter,e)}async function X(n,t){if("polygon"!==n.type&&"polyline"!==n.type&&"extent"!==n.type)return 0;let e=1;(n.spatialReference.vcsWkid||n.spatialReference.latestVcsWkid)&&(e=(0,s.G9)(n.spatialReference)/(0,f.GA)(n.spatialReference));let r=0;if("polyline"===n.type)for(const t of n.paths)for(let n=1;n<t.length;n++)r+=(0,s.BM)(t[n],t[n-1],e);else if("polygon"===n.type)for(const t of n.rings){for(let n=1;n<t.length;n++)r+=(0,s.BM)(t[n],t[n-1],e);(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||void 0!==t[0][2]&&t[0][2]!==t[t.length-1][2])&&(r+=(0,s.BM)(t[0],t[t.length-1],e))}else"extent"===n.type&&(r+=2*(0,s.BM)([n.xmin,n.ymin,0],[n.xmax,n.ymin,0],e),r+=2*(0,s.BM)([n.xmin,n.ymin,0],[n.xmin,n.ymax,0],e),r*=2,r+=4*Math.abs((0,o.E)(n.zmax,0)*e-(0,o.E)(n.zmin,0)*e));const i=new p.A({hasZ:!1,hasM:!1,spatialReference:n.spatialReference,paths:[[[0,0],[0,r]]]});return(0,A.Zu)(i,t)}function C(n){"async"===n.mode&&(n.functions.disjoint=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null===i[0]||null===i[1]||(0,A.nf)(i[0],i[1]))))},n.functions.intersects=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null!==i[0]&&null!==i[1]&&(0,A.HY)(i[0],i[1]))))},n.functions.touches=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null!==i[0]&&null!==i[1]&&(0,A.yI)(i[0],i[1]))))},n.functions.crosses=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null!==i[0]&&null!==i[1]&&(0,A.NN)(i[0],i[1]))))},n.functions.within=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null!==i[0]&&null!==i[1]&&(0,A.ux)(i[0],i[1]))))},n.functions.contains=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null!==i[0]&&null!==i[1]&&(0,A.gR)(i[0],i[1]))))},n.functions.overlaps=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null!==i[0]&&null!==i[1]&&(0,A.$f)(i[0],i[1]))))},n.functions.equals=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>((0,o.B)(i,2,2,t,e),i[0]===i[1]||(i[0]instanceof w.A&&i[1]instanceof w.A?(0,A.aI)(i[0],i[1]):((0,o.g)(i[0])&&(0,o.g)(i[1])||!!((0,o.k)(i[0])&&(0,o.k)(i[1])||(0,o.j)(i[0])&&(0,o.j)(i[1])))&&i[0].equals(i[1])))))},n.functions.relate=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,3,3,t,e),i[0]instanceof w.A&&i[1]instanceof w.A)return(0,A.c7)(i[0],i[1],(0,o.f)(i[2]));if(i[0]instanceof w.A&&null===i[1])return!1;if(i[1]instanceof w.A&&null===i[0])return!1;if(null===i[0]&&null===i[1])return!1;throw new a.D$(t,a.TX.InvalidParameter,e)}))},n.functions.intersection=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null===i[0]||null===i[1]?null:(0,A.y$)(i[0],i[1]))))},n.functions.union=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{const c=[];if(0===(i=(0,o.C)(i)).length)throw new a.D$(t,a.TX.WrongNumberOfParameters,e);if(1===i.length)if((0,I.cy)(i[0])){const n=(0,o.C)(i[0]);for(let r=0;r<n.length;r++)if(null!==n[r]){if(!(n[r]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);c.push(n[r])}}else{if(!(0,o.m)(i[0])){if(i[0]instanceof w.A)return(0,o.s)((0,u.Yq)(i[0]),t.spatialReference);if(null===i[0])return null;throw new a.D$(t,a.TX.InvalidParameter,e)}{const n=(0,o.C)(i[0].toArray());for(let r=0;r<n.length;r++)if(null!==n[r]){if(!(n[r]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);c.push(n[r])}}}else for(let n=0;n<i.length;n++)if(null!==i[n]){if(!(i[n]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);c.push(i[n])}return 0===c.length?null:(0,A.KC)(c)}))},n.functions.difference=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null===i[0]?null:null===i[1]?(0,u.Yq)(i[0]):(0,A.iv)(i[0],i[1]))))},n.functions.symmetricdifference=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(P(i=(0,o.C)(i),t,e),null===i[0]&&null===i[1]?null:null===i[0]?(0,u.Yq)(i[1]):null===i[1]?(0,u.Yq)(i[0]):(0,A.BT)(i[0],i[1]))))},n.functions.clip=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,2,t,e),!(i[1]instanceof d.A)&&null!==i[1])throw new a.D$(t,a.TX.InvalidParameter,e);if(null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return null===i[1]?null:(0,A.$Q)(i[0],i[1])}))},n.functions.cut=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,2,t,e),!(i[1]instanceof p.A)&&null!==i[1])throw new a.D$(t,a.TX.InvalidParameter,e);if(null===i[0])return[];if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return null===i[1]?[(0,u.Yq)(i[0])]:(0,A.Jj)(i[0],i[1])}))},n.functions.area=function(t,e){return n.standardFunctionAsync(t,e,(async(n,r,i)=>{if((0,o.B)(i,1,2,t,e),null===(i=(0,o.C)(i))[0])return 0;if((0,o.p)(i[0])){const n=await i[0].sumArea((0,u.uf)((0,o.E)(i[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new a.D$(t,a.TX.Cancelled,e);return n}if((0,I.cy)(i[0])||(0,o.m)(i[0])){const n=(0,o.D)(i[0],t.spatialReference);return null===n?0:(0,A._2)(n,(0,u.uf)((0,o.E)(i[1],-1)))}if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A._2)(i[0],(0,u.uf)((0,o.E)(i[1],-1)))}))},n.functions.areageodetic=function(t,e){return n.standardFunctionAsync(t,e,(async(n,r,i)=>{if((0,o.B)(i,1,2,t,e),null===(i=(0,o.C)(i))[0])return 0;if((0,o.p)(i[0])){const n=await i[0].sumArea((0,u.uf)((0,o.E)(i[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new a.D$(t,a.TX.Cancelled,e);return n}if((0,I.cy)(i[0])||(0,o.m)(i[0])){const n=(0,o.D)(i[0],t.spatialReference);return null===n?0:(0,A.PW)(n,(0,u.uf)((0,o.E)(i[1],-1)))}if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.PW)(i[0],(0,u.uf)((0,o.E)(i[1],-1)))}))},n.functions.length=function(t,e){return n.standardFunctionAsync(t,e,(async(n,r,i)=>{if((0,o.B)(i,1,2,t,e),null===(i=(0,o.C)(i))[0])return 0;if((0,o.p)(i[0])){const n=await i[0].sumLength((0,u.SQ)((0,o.E)(i[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new a.D$(t,a.TX.Cancelled,e);return n}if((0,I.cy)(i[0])||(0,o.m)(i[0])){const n=(0,o.F)(i[0],t.spatialReference);return null===n?0:(0,A.Zu)(n,(0,u.SQ)((0,o.E)(i[1],-1)))}if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.Zu)(i[0],(0,u.SQ)((0,o.E)(i[1],-1)))}))},n.functions.length3d=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if((0,o.B)(i,1,2,t,e),null===(i=(0,o.C)(i))[0])return 0;if((0,I.cy)(i[0])||(0,o.m)(i[0])){const n=(0,o.F)(i[0],t.spatialReference);return null===n?0:!0===n.hasZ?X(n,(0,u.SQ)((0,o.E)(i[1],-1))):(0,A.Zu)(n,(0,u.SQ)((0,o.E)(i[1],-1)))}if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return!0===i[0].hasZ?X(i[0],(0,u.SQ)((0,o.E)(i[1],-1))):(0,A.Zu)(i[0],(0,u.SQ)((0,o.E)(i[1],-1)))}))},n.functions.lengthgeodetic=function(t,e){return n.standardFunctionAsync(t,e,(async(n,r,i)=>{if((0,o.B)(i,1,2,t,e),null===(i=(0,o.C)(i))[0])return 0;if((0,o.p)(i[0])){const n=await i[0].sumLength((0,u.SQ)((0,o.E)(i[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new a.D$(t,a.TX.Cancelled,e);return n}if((0,I.cy)(i[0])||(0,o.m)(i[0])){const n=(0,o.F)(i[0],t.spatialReference);return null===n?0:(0,A.mh)(n,(0,u.SQ)((0,o.E)(i[1],-1)))}if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.mh)(i[0],(0,u.SQ)((0,o.E)(i[1],-1)))}))},n.functions.distance=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{i=(0,o.C)(i),(0,o.B)(i,2,3,t,e);let c=i[0];((0,I.cy)(i[0])||(0,o.m)(i[0]))&&(c=(0,o.G)(i[0],t.spatialReference));let s=i[1];if(((0,I.cy)(i[1])||(0,o.m)(i[1]))&&(s=(0,o.G)(i[1],t.spatialReference)),!(c instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);if(!(s instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.Io)(c,s,(0,u.SQ)((0,o.E)(i[2],-1)))}))},n.functions.distancegeodetic=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{i=(0,o.C)(i),(0,o.B)(i,2,3,t,e);const c=i[0],s=i[1];if(!(c instanceof y.A))throw new a.D$(t,a.TX.InvalidParameter,e);if(!(s instanceof y.A))throw new a.D$(t,a.TX.InvalidParameter,e);const l=new p.A({paths:[],spatialReference:c.spatialReference});return l.addPath([c,s]),(0,A.mh)(l,(0,u.SQ)((0,o.E)(i[2],-1)))}))},n.functions.densify=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,3,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);const c=(0,o.d)(i[1]);if(isNaN(c))throw new a.D$(t,a.TX.InvalidParameter,e);if(c<=0)throw new a.D$(t,a.TX.InvalidParameter,e);return i[0]instanceof m.A||i[0]instanceof p.A?(0,A.jL)(i[0],c,(0,u.SQ)((0,o.E)(i[2],-1))):i[0]instanceof d.A?(0,A.jL)(m.A.fromExtent(i[0]),c,(0,u.SQ)((0,o.E)(i[2],-1))):i[0]}))},n.functions.densifygeodetic=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,3,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);const c=(0,o.d)(i[1]);if(isNaN(c))throw new a.D$(t,a.TX.InvalidParameter,e);if(c<=0)throw new a.D$(t,a.TX.InvalidParameter,e);return i[0]instanceof m.A||i[0]instanceof p.A?(0,A.Ow)(i[0],c,(0,u.SQ)((0,o.E)(i[2],-1))):i[0]instanceof d.A?(0,A.Ow)(m.A.fromExtent(i[0]),c,(0,u.SQ)((0,o.E)(i[2],-1))):i[0]}))},n.functions.generalize=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,4,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);const c=(0,o.d)(i[1]);if(isNaN(c))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.px)(i[0],c,(0,o.e)((0,o.E)(i[2],!0)),(0,u.SQ)((0,o.E)(i[3],-1)))}))},n.functions.buffer=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,3,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);const c=(0,o.d)(i[1]);if(isNaN(c))throw new a.D$(t,a.TX.InvalidParameter,e);return 0===c?(0,u.Yq)(i[0]):(0,A.r)(i[0],c,(0,u.SQ)((0,o.E)(i[2],-1)))}))},n.functions.buffergeodetic=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,3,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);const c=(0,o.d)(i[1]);if(isNaN(c))throw new a.D$(t,a.TX.InvalidParameter,e);return 0===c?(0,u.Yq)(i[0]):(0,A.SE)(i[0],c,(0,u.SQ)((0,o.E)(i[2],-1)))}))},n.functions.offset=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,6,t,e),null===i[0])return null;if(!(i[0]instanceof m.A||i[0]instanceof p.A))throw new a.D$(t,a.TX.InvalidParameter,e);const c=(0,o.d)(i[1]);if(isNaN(c))throw new a.D$(t,a.TX.InvalidParameter,e);const s=(0,o.d)((0,o.E)(i[4],10));if(isNaN(s))throw new a.D$(t,a.TX.InvalidParameter,e);const l=(0,o.d)((0,o.E)(i[5],0));if(isNaN(l))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.cY)(i[0],c,(0,u.SQ)((0,o.E)(i[2],-1)),(0,o.f)((0,o.E)(i[3],"round")).toLowerCase(),s,l)}))},n.functions.rotate=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,2,3,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);const u=i[0]instanceof d.A?m.A.fromExtent(i[0]):i[0],c=(0,o.d)(i[1]);if(isNaN(c))throw new a.D$(t,a.TX.InvalidParameter,e);const s=(0,o.E)(i[2],null);if(null===s)return(0,A.e$)(u,c);if(s instanceof y.A)return(0,A.e$)(u,c,s);throw new a.D$(t,a.TX.InvalidParameter,e)}))},n.functions.centroid=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,1,1,t,e),null===i[0])return null;let c=i[0];if(((0,I.cy)(i[0])||(0,o.m)(i[0]))&&(c=(0,o.G)(i[0],t.spatialReference)),null===c)return null;if(!(c instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return c instanceof y.A?(0,o.s)((0,u.Yq)(c),t.spatialReference):c instanceof m.A?c.centroid:c instanceof p.A?(0,s.tI)(c):c instanceof h.A?(0,s.e0)(c):c instanceof d.A?c.center:null}))},n.functions.measuretocoordinate=function(t,e){return n.standardFunctionAsync(t,e,((n,r,u)=>{if(u=(0,o.C)(u),(0,o.B)(u,2,2,t,e),null===u[0])return null;let c=u[0];if(((0,I.cy)(u[0])||(0,o.m)(u[0]))&&(c=(0,o.F)(u[0],t.spatialReference)),null===c)return null;if(!(c instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);if(!(c instanceof p.A))throw new a.D$(t,a.TX.InvalidParameter,e);if((0,I.Et)(!1===u[1]))throw new a.D$(t,a.TX.InvalidParameter,e);const s=(0,l.EP)(c,u[1]);return s?i.A.convertObjectToArcadeDictionary(s,(0,o.H)(t),!1,!0):null}))},n.functions.pointtocoordinate=function(t,e){return n.standardFunctionAsync(t,e,((n,r,u)=>{if(u=(0,o.C)(u),(0,o.B)(u,2,2,t,e),null===u[0])return null;let c=u[0];if(((0,I.cy)(u[0])||(0,o.m)(u[0]))&&(c=(0,o.F)(u[0],t.spatialReference)),null===c)return null;if(!(c instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);if(!(c instanceof p.A))throw new a.D$(t,a.TX.InvalidParameter,e);const s=u[1];if(null===s)return null;if(!(s instanceof y.A))throw new a.D$(t,a.TX.InvalidParameter,e);if((0,I.Et)(!1===u[1]))throw new a.D$(t,a.TX.InvalidParameter,e);const f=(0,l.sO)(c,s);return f?i.A.convertObjectToArcadeDictionary(f,(0,o.H)(t),!1,!0):null}))},n.functions.distancetocoordinate=function(t,e){return n.standardFunctionAsync(t,e,((n,r,u)=>{if(u=(0,o.C)(u),(0,o.B)(u,2,2,t,e),null===u[0])return null;let c=u[0];if(((0,I.cy)(u[0])||(0,o.m)(u[0]))&&(c=(0,o.F)(u[0],t.spatialReference)),null===c)return null;if(!(c instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);if(!(c instanceof p.A))throw new a.D$(t,a.TX.InvalidParameter,e);if((0,I.Et)(!1===u[1]))throw new a.D$(t,a.TX.InvalidParameter,e);const s=(0,l.du)(c,u[1]);return s?i.A.convertObjectToArcadeDictionary(s,(0,o.H)(t),!1,!0):null}))},n.functions.multiparttosinglepart=function(t,e){return n.standardFunctionAsync(t,e,(async(n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,1,1,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);if(i[0]instanceof y.A)return[(0,o.s)((0,u.Yq)(i[0]),t.spatialReference)];if(i[0]instanceof d.A)return[(0,o.s)((0,u.Yq)(i[0]),t.spatialReference)];const c=await(0,A.CR)(i[0]);if(c instanceof m.A){const n=[],t=[];for(let e=0;e<c.rings.length;e++)if(c.isClockwise(c.rings[e])){const t=(0,v.rS)({rings:[c.rings[e]],hasZ:!0===c.hasZ,hasM:!0===c.hasM,spatialReference:c.spatialReference.toJSON()});n.push(t)}else t.push({ring:c.rings[e],pt:c.getPoint(e,0)});for(let e=0;e<t.length;e++)for(let r=0;r<n.length;r++)if(n[r].contains(t[e].pt)){n[r].addRing(t[e].ring);break}return n}if(c instanceof p.A){const n=[];for(let t=0;t<c.paths.length;t++){const e=(0,v.rS)({paths:[c.paths[t]],hasZ:!0===c.hasZ,hasM:!0===c.hasM,spatialReference:c.spatialReference.toJSON()});n.push(e)}return n}if(i[0]instanceof h.A){const n=[],e=(0,o.s)((0,u.Yq)(i[0]),t.spatialReference);for(let t=0;t<e.points.length;t++)n.push(e.getPoint(t));return n}return null}))},n.functions.issimple=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,1,1,t,e),null===i[0])return!0;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.pn)(i[0])}))},n.functions.simplify=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,1,1,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.CR)(i[0])}))},n.functions.convexhull=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>{if(i=(0,o.C)(i),(0,o.B)(i,1,1,t,e),null===i[0])return null;if(!(i[0]instanceof w.A))throw new a.D$(t,a.TX.InvalidParameter,e);return(0,A.HF)(i[0])}))},n.functions.getuser=function(t,e){return n.standardFunctionAsync(t,e,(async(n,u,s)=>{(0,o.B)(s,0,2,t,e);let l=(0,o.E)(s[1],""),f=!0===l;if(l=!0===l||!1===l?"":(0,o.f)(l),0===s.length||s[0]instanceof r.A){let n;n=t.services?.portal?t.services.portal:g.A.getDefault(),s.length>0&&(n=(0,c.R)(s[0],n));const e=await $(n,l,f);if(e){const n=JSON.parse(JSON.stringify(e));for(const t of["lastLogin","created","modified"])void 0!==n[t]&&null!==n[t]&&(n[t]=new Date(n[t]));return i.A.convertObjectToArcadeDictionary(n,(0,o.H)(t))}return null}let d=null;if((0,o.p)(s[0])&&(d=s[0]),d){if(f=!1,l)return null;await d.load();const n=await d.getOwningSystemUrl();if(!n){if(!l){const n=await d.getIdentityUser();return n?i.A.convertObjectToArcadeDictionary({username:n},(0,o.H)(t)):null}return null}let e;e=t.services?.portal?t.services.portal:g.A.getDefault(),e=(0,c.R)(new r.A(n),e);const a=await $(e,l,f);if(a){const n=JSON.parse(JSON.stringify(a));for(const t of["lastLogin","created","modified"])void 0!==n[t]&&null!==n[t]&&(n[t]=new Date(n[t]));return i.A.convertObjectToArcadeDictionary(n,(0,o.H)(t))}return null}throw new a.D$(t,a.TX.InvalidParameter,e)}))},n.functions.nearestcoordinate=function(t,e){return n.standardFunctionAsync(t,e,(async(n,r,u)=>{if(u=(0,o.C)(u),(0,o.B)(u,2,2,t,e),!(u[0]instanceof w.A||null===u[0]))throw new a.D$(t,a.TX.InvalidParameter,e);if(!(u[1]instanceof y.A||null===u[1]))throw new a.D$(t,a.TX.InvalidParameter,e);if(null===u[0]||null===u[1])return null;const c=await(0,A.fC)(u[0],u[1]);return null===c?null:i.A.convertObjectToArcadeDictionary({coordinate:c.coordinate,distance:c.distance,sideOfLine:0===c.distance?"straddle":c.isRightSide?"right":"left"},(0,o.H)(t),!1,!0)}))},n.functions.nearestvertex=function(t,e){return n.standardFunctionAsync(t,e,(async(n,r,u)=>{if(u=(0,o.C)(u),(0,o.B)(u,2,2,t,e),!(u[0]instanceof w.A||null===u[0]))throw new a.D$(t,a.TX.InvalidParameter,e);if(!(u[1]instanceof y.A||null===u[1]))throw new a.D$(t,a.TX.InvalidParameter,e);if(null===u[0]||null===u[1])return null;const c=await(0,A.JT)(u[0],u[1]);return null===c?null:i.A.convertObjectToArcadeDictionary({coordinate:c.coordinate,distance:c.distance,sideOfLine:0===c.distance?"straddle":c.isRightSide?"right":"left"},(0,o.H)(t),!1,!0)}))})}},80672:(n,t,e)=>{e.d(t,{R:()=>i});var r=e(20655);function i(n,t){return null===n?t:new r.A({url:n.field("url")})}},14469:(n,t,e)=>{e.d(t,{$Q:()=>f,$f:()=>D,BT:()=>C,CR:()=>I,HF:()=>P,HY:()=>m,Io:()=>h,JT:()=>O,Jj:()=>d,KC:()=>F,NN:()=>A,Ow:()=>j,PW:()=>Y,SE:()=>B,Zu:()=>q,_2:()=>J,aI:()=>y,c7:()=>T,cY:()=>E,e$:()=>b,fC:()=>N,gR:()=>w,iv:()=>X,jL:()=>Q,mh:()=>H,nf:()=>g,pn:()=>$,px:()=>x,r:()=>R,ux:()=>v,y$:()=>S,yI:()=>p}),e(59456);var r=e(29953),i=e(86738),a=e(65864);function u(n){return Array.isArray(n)?n[0]?.spatialReference:n?.spatialReference}function o(n){return n?Array.isArray(n)?n.map(o):n.toJSON?n.toJSON():n:n}function c(n){return Array.isArray(n)?n.map((n=>(0,a.rS)(n))):(0,a.rS)(n)}let s;async function l(n,t){return(await async function(){return s||(s=(0,r.ho)("geometryEngineWorker",{strategy:"distributed"})),s}()).invoke("executeGEOperation",{operation:n,parameters:o(t)})}async function f(n,t){return c(await l("clip",[u(n),n,t]))}async function d(n,t){return c(await l("cut",[u(n),n,t]))}function w(n,t){return l("contains",[u(n),n,t])}function A(n,t){return l("crosses",[u(n),n,t])}function h(n,t,e){return l("distance",[u(n),n,t,e])}function y(n,t){return l("equals",[u(n),n,t])}function m(n,t){return l("intersects",[u(n),n,t])}function p(n,t){return l("touches",[u(n),n,t])}function v(n,t){return l("within",[u(n),n,t])}function g(n,t){return l("disjoint",[u(n),n,t])}function D(n,t){return l("overlaps",[u(n),n,t])}function T(n,t,e){return l("relate",[u(n),n,t,e])}function $(n){return l("isSimple",[u(n),n])}async function I(n){return c(await l("simplify",[u(n),n]))}async function P(n,t=!1){return c(await l("convexHull",[u(n),n,t]))}async function X(n,t){return c(await l("difference",[u(n),n,t]))}async function C(n,t){return c(await l("symmetricDifference",[u(n),n,t]))}async function S(n,t){return c(await l("intersect",[u(n),n,t]))}async function F(n,t=null){const e=function(n,t){let e;return Array.isArray(n)?e=n:(e=[],e.push(n),null!=t&&e.push(t)),e}(n,t);return c(await l("union",[u(e),e]))}async function E(n,t,e,r,i,a){return c(await l("offset",[u(n),n,t,e,r,i,a]))}async function R(n,t,e,r=!1){const i=[u(n),n,t,e,r];return c(await l("buffer",i))}async function B(n,t,e,r,i,a){const o=[u(n),n,t,e,r,i,a];return c(await l("geodesicBuffer",o))}async function N(n,t,e=!0){const r=await l("nearestCoordinate",[u(n),n,t,e]);return{...r,coordinate:i.A.fromJSON(r.coordinate)}}async function O(n,t){const e=await l("nearestVertex",[u(n),n,t]);return{...e,coordinate:i.A.fromJSON(e.coordinate)}}async function b(n,t,e){if(null==n)throw new L;const r=n.spatialReference;if(null==(e=e??function(n){return"xmin"in n?n.center:"x"in n?n:n.extent?.center}(n)))throw new L;const i=n.constructor.fromJSON(await l("rotate",[r,n,t,e]));return i.spatialReference=r,i}async function x(n,t,e,r){return c(await l("generalize",[u(n),n,t,e,r]))}async function Q(n,t,e){return c(await l("densify",[u(n),n,t,e]))}async function j(n,t,e,r=0){return c(await l("geodesicDensify",[u(n),n,t,e,r]))}function J(n,t){return l("planarArea",[u(n),n,t])}function q(n,t){return l("planarLength",[u(n),n,t])}function Y(n,t,e){return l("geodesicArea",[u(n),n,t,e])}function H(n,t,e){return l("geodesicLength",[u(n),n,t,e])}class L extends Error{constructor(){super("Illegal Argument Exception")}}}}]);
|