@arcgis/core 4.23.0-next.20220130 → 4.23.0-next.20220131

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.
Files changed (108) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{357033117dfe61eb81ea.js → 0c15d77d8e817cf45a9a.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{e93dfdede0532a89ffa5.js → 2b25fc7945a187c2bb9d.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{7903a3e2e0faff0f86c0.js → 56657f890e0f79f5d2ad.js} +1 -1
  5. package/assets/esri/core/workers/chunks/70d6bb3c7112cb702389.js +1 -0
  6. package/assets/esri/core/workers/chunks/810a763373d7f78ae398.js +1 -0
  7. package/assets/esri/core/workers/chunks/{9d77467aa71d345fc1b6.js → bcc01bbffaa3bb5f60a8.js} +1 -1
  8. package/assets/esri/core/workers/chunks/d98dab12b71912fa397b.js +1 -0
  9. package/assets/esri/core/workers/chunks/{ff6abdc72076f3994659.js → f7150547d7e3259a0f29.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{386f86f961146f530aa7.js → fc046a15466c25d081ff.js} +1 -1
  11. package/assets/esri/images/portal/mediaservice16.png +0 -0
  12. package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
  13. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  14. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  15. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  16. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  17. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  18. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  19. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  20. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  21. package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
  22. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  23. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  24. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  25. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  26. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  27. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  28. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  29. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  30. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  31. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  32. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  33. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  34. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  35. package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
  36. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  37. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  38. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  39. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  40. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  41. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  42. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  43. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  44. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  45. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  46. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  47. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  48. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  49. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  50. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  51. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  52. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  53. package/interfaces.d.ts +449 -45
  54. package/layers/RouteLayer.d.ts +4 -0
  55. package/layers/RouteLayer.js +1 -1
  56. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  57. package/package.json +1 -1
  58. package/portal/PortalItem.js +1 -1
  59. package/rest/support/DirectionLine.d.ts +4 -0
  60. package/rest/support/DirectionPoint.d.ts +4 -0
  61. package/rest/support/RouteInfo.d.ts +4 -0
  62. package/rest/support/RouteInfo.js +1 -1
  63. package/rest/support/RouteSolveResult.d.ts +4 -0
  64. package/support/revision.js +1 -1
  65. package/views/2d/layers/RouteLayerView2D.js +1 -1
  66. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  67. package/views/3d/environment/CloudsComposition.js +1 -1
  68. package/views/3d/environment/CloudsGenerator.js +1 -1
  69. package/views/3d/environment/Fog.js +1 -1
  70. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  71. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  72. package/views/3d/environment/Precipitation.js +1 -1
  73. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  74. package/views/3d/environment/Stars.js +1 -1
  75. package/views/3d/layers/I3SMeshView3D.js +1 -1
  76. package/views/3d/layers/i3s/I3SCrossfadeHelper.js +1 -1
  77. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  78. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  79. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  80. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  81. package/views/3d/support/LaserLineRenderer.js +1 -1
  82. package/views/3d/terrain/OverlayRenderer.js +1 -1
  83. package/views/3d/terrain/TerrainRenderer.js +1 -1
  84. package/views/3d/terrain/TileRenderer.js +1 -1
  85. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  86. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  87. package/views/3d/webgl-engine/lib/HighlightHelper.js +1 -1
  88. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  89. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  90. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  91. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  92. package/views/3d/webgl-engine/lib/ShadowHighlightHelper.js +1 -1
  93. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  94. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  95. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  96. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  97. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  98. package/widgets/Directions/DirectionsViewModel.js +1 -1
  99. package/widgets/Directions/support/directionsUtils.js +1 -1
  100. package/widgets/Directions/support/resources.js +1 -1
  101. package/widgets/Directions.js +1 -1
  102. package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +0 -1
  103. package/assets/esri/core/workers/chunks/fc7e31d87555beb63291.js +0 -1
  104. package/assets/esri/core/workers/chunks/fff6b0338f06dad0c45d.js +0 -1
  105. package/widgets/Directions/support/CostSummary.js +0 -5
  106. package/widgets/Directions/support/RouteSection.js +0 -5
  107. package/widgets/Directions/support/RouteSections.js +0 -5
  108. package/widgets/Directions/support/maneuverUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import"../geometry.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import s from"../core/Collection.js";import n from"../core/Error.js";import{isSome as l,isNone as a}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{convertUnit as y}from"../core/unitUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import S from"../geometry/Extent.js";import{WGS84 as h}from"../geometry/support/spatialReferenceUtils.js";import g from"./Layer.js";import{BlendLayer as b}from"./mixins/BlendLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import P from"./support/DefaultSymbols.js";import{fetchServiceDescription as N}from"../rest/networkService.js";import{solve as I}from"../rest/route.js";import D from"../rest/support/DirectionLine.js";import O from"../rest/support/DirectionPoint.js";import{directionsTimeUnitJsonMap as j,directionsLengthUnitJsonMap as L}from"../rest/support/networkEnums.js";import C from"../rest/support/PointBarrier.js";import _ from"../rest/support/PolygonBarrier.js";import T from"../rest/support/PolylineBarrier.js";import J from"../rest/support/RouteInfo.js";import R from"../rest/support/RouteParameters.js";import x from"../rest/support/RouteSettings.js";import F from"../rest/support/Stop.js";import k from"../geometry/SpatialReference.js";import A from"../geometry/Multipoint.js";function G(e){return e.length?e:null}function U(e){return"layers"in e}function M(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function W(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function E(e,t,r){var o,i,s,a,p,u,y,m,f,c,d;const S=t.networkDataset.networkAttributes.filter((e=>"esriNAUTCost"===e.usageType)),h=t.supportedTravelModes.find((e=>e.id===t.defaultTravelMode)),g=null!=(o=r.travelMode)?o:h,{timeAttributeName:b,distanceAttributeName:w}=g,v=S.find((e=>e.name===b)),B=S.find((e=>e.name===w)),P=null!=(i=null!=(s=null==(a=r.travelMode)?void 0:a.impedanceAttributeName)?s:r.impedanceAttribute)?i:t.impedance,N=j.fromJSON(null==v?void 0:v.units),I=L.fromJSON(null==B?void 0:B.units);if(!N||!I)throw new n("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const D=null!=(p=r.directionsLanguage)?p:t.directionsLanguage,O=null!=(u=null!=(y=r.accumulateAttributes)?y:t.accumulateAttributeNames)?u:[],C=new Set(S.filter((({name:e})=>e===b||e===w||e===P||O.includes(e))).map((({name:e})=>e))),_=e=>{for(const t in e)C.has(t)||delete e[t]};for(const n of e.pointBarriers){var T;if(l(n.costs))n.addedCost=null!=(T=n.costs[P])?T:0,_(n.costs)}for(const n of e.polygonBarriers){var J;if(l(n.costs))n.scaleFactor=null!=(J=n.costs[P])?J:1,_(n.costs)}for(const n of e.polylineBarriers){var R;if(l(n.costs))n.scaleFactor=null!=(R=n.costs[P])?R:1,_(n.costs)}const{routeInfo:F}=e,{findBestSequence:k,preserveFirstStop:A,preserveLastStop:G,startTimeIsUTC:U,timeWindowsAreUTC:M}=r;F.analysisSettings=new x({accumulateAttributes:O,directionsLanguage:D,findBestSequence:k,preserveFirstStop:A,preserveLastStop:G,startTimeIsUTC:U,timeWindowsAreUTC:M,travelMode:g}),F.totalDuration=q(null!=(m=F.totalCosts[b])?m:0,N),F.totalDistance=V(null!=(f=F.totalCosts[w])?f:0,I),F.totalLateDuration=q(null!=(c=F.totalViolations[b])?c:0,N),F.totalWaitDuration=q(null!=(d=F.totalWait[b])?d:0,N),l(F.totalCosts)&&_(F.totalCosts),l(F.totalViolations)&&_(F.totalViolations),l(F.totalWait)&&_(F.totalWait);for(const n of e.stops){var W,E,H,K,Q,Z;if(l(n.serviceCosts))n.serviceDuration=q(null!=(W=n.serviceCosts[b])?W:0,N),n.serviceDistance=V(null!=(E=n.serviceCosts[w])?E:0,I),_(n.serviceCosts);if(l(n.cumulativeCosts))n.cumulativeDuration=q(null!=(H=n.cumulativeCosts[b])?H:0,N),n.cumulativeDistance=V(null!=(K=n.cumulativeCosts[w])?K:0,I),_(n.cumulativeCosts);if(l(n.violations))n.lateDuration=q(null!=(Q=n.violations[b])?Q:0,N),_(n.violations);if(l(n.wait))n.waitDuration=q(null!=(Z=n.wait[b])?Z:0,N),_(n.wait)}}function q(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function V(e,t){return"decimal-degrees"===t||"points"===t?e:y(e,t,"meters")}const H=s.ofType(D),K=s.ofType(O),Q=s.ofType(C),Z=s.ofType(_),$=s.ofType(T),z=s.ofType(F);let X=class extends(b(B(w(v(p(g)))))){constructor(...e){super(...e),this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new P,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Q,this.polygonBarriers=new Z,this.polylineBarriers=new $,this.routeInfo=null,this.spatialReference=k.WGS84,this.stops=new z,this.title="Route",this.type="route"}writeFeatureCollectionWebmap(e,t){const r=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),o=r.map(((e,t)=>t));u("featureCollection.layers",r,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=o}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>D.fromPortalJSON(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>O.fromPortalJSON(e)))}get fullExtent(){if(l(this.routeInfo)&&l(this.routeInfo.geometry))return this.routeInfo.geometry.extent;if(this.stops.length>1){const{spatialReference:e}=this.stops[0],t=new A({spatialReference:e}),r=this.stops.toArray().map((e=>e.geometry));for(const o of r)l(o)&&t.addPoint(o);return t.extent}return new S({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:k.WGS84})}readMaxScale(e,t){var r;const o=(U(t)?t.layers:t.featureCollection.layers).find((e=>l(e.layerDefinition.maxScale)));return null!=(r=null==o?void 0:o.layerDefinition.maxScale)?r:0}readMinScale(e,t){var r;const o=(U(t)?t.layers:t.featureCollection.layers).find((e=>l(e.layerDefinition.minScale)));return null!=(r=null==o?void 0:o.layerDefinition.minScale)?r:0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>C.fromPortalJSON(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>_.fromPortalJSON(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>T.fromPortalJSON(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,"RouteInfo",(e=>J.fromPortalJSON(e)));return r.length>0?r.getItemAt(0):null}get routeServiceUrl(){var e,r,o,i;return null!=(e=this.portalItem)&&e.id&&null!=(r=null==(o=this.portalItem.portal.helperServices)||null==(i=o.route)?void 0:i.url)?r:t.routeServiceUrl}readSpatialReference(e,t){var r,o;const i=U(t)?t.layers:t.featureCollection.layers;if(!i.length)return k.WGS84;const{layerDefinition:s}=i[0],n=null!=(r=null!=(o=s.spatialReference)?o:s.extent.spatialReference)?r:h;return k.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>F.fromPortalJSON(e)),(e=>this._setStopSymbol(e)))}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}async solve(e,t){var r,o,i,l;const p=null!=(r=null==e?void 0:e.stops)?r:this.stops,u=null!=(o=null==e?void 0:e.pointBarriers)?o:G(this.pointBarriers),y=null!=(i=null==e?void 0:e.polylineBarriers)?i:G(this.polylineBarriers),m=null!=(l=null==e?void 0:e.polygonBarriers)?l:G(this.polygonBarriers);if(a(p))throw new n("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((M(p)||W(p))&&p.features.length<2||s.isCollection(p)&&p.length<2)throw new n("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");const f=await N(this.routeServiceUrl,null==e?void 0:e.apiKey,t),c={startTime:new Date},d={directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:u,polylineBarriers:y,polygonBarriers:m,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!u,returnDirections:!0,returnPolygonBarriers:!!m,returnPolylineBarriers:!!y,returnRoutes:!0,returnStops:!0,stops:p},S=e?R.from(e):new R;for(const s in c)null==S[s]&&(S[s]=c[s]);S.set(d);const h=await I(this.routeServiceUrl,S,t),g=this._toRouteLayerSolution(h);return E(g,f,S),g}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:l}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",l)}_getLayerDefinition(){return{capabilities:"Query,Update,Editing",extent:this.fullExtent.toJSON(),hasM:!1,hasZ:!1,maxScale:this.maxScale,minScale:this.minScale,objectIdField:"__OBJECTID",spatialReference:this.spatialReference.toJSON(),type:"Feature Layer",typeIdField:""}}_getNetworkFeatures(e,t,n,l){const p=(U(e)?e.layers:e.featureCollection.layers).find((e=>e.layerDefinition.name===t));if(a(p))return new s;const{layerDefinition:u,popupInfo:y,featureSet:m}=p,f=u.drawingInfo.renderer,{features:c}=m,d=f&&i(f),S=c.map((e=>{var i;const s=n(e),{attributes:l}=e,a=new r({attributes:l});return null!=s.symbol||(s.symbol=null!=(i=null==d?void 0:d.getSymbol(a))?i:this._getNetworkSymbol(t)),null!=s.popupTemplate||(s.popupTemplate=y&&o.fromJSON(y)),s}));return l&&S.some((e=>!e.symbol))&&l(S),new s(S)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}_setStopSymbol(e){if(!e)return;if(e.length<2){for(const t of e)t.symbol=this.defaultSymbols.invalidStop;return}const t=e.map((e=>e.sequence)).filter((e=>l(e))),r=Math.min(...t),o=Math.max(...t);for(const i of e)i.sequence!==r?i.sequence!==o?"ok"===i.status||"not-located-on-closest"===i.status?"waypoint"!==i.locationType?"break"!==i.locationType?i.symbol=this.defaultSymbols.middleStop:i.symbol=this.defaultSymbols.breakStop:i.symbol=this.defaultSymbols.waypointStop:i.symbol=this.defaultSymbols.invalidStop:i.symbol=this.defaultSymbols.lastStop:i.symbol=this.defaultSymbols.firstStop}_toRouteLayerSolution(e){var t,r,o;const i=e.routeResults[0].stops.map((e=>F.fromJSON(e.toJSON())));this._setStopSymbol(i);const s=new z(i),n=new Z(null==(t=e.polygonBarriers)?void 0:t.map((e=>{const t=_.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),l=new $(null==(r=e.polylineBarriers)?void 0:r.map((e=>{const t=T.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),a=new Q(null==(o=e.pointBarriers)?void 0:o.map((e=>{const t=C.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),p=J.fromJSON(e.routeResults[0].route.toJSON());p.symbol=this.defaultSymbols.routeInfo;const u=new K(e.routeResults[0].directionPoints.features.map((e=>{const t=O.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new H(e.routeResults[0].directionLines.features.map((e=>{const t=D.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:u,pointBarriers:a,polygonBarriers:n,polylineBarriers:l,routeInfo:p,stops:s}}_writeDirectionLines(){return a(this.directionLines)||!this.directionLines.length?null:{featureSet:{features:this.directionLines.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionLines.toJSON()}},fields:D.fields,geometryType:"esriGeometryPolyline",name:"DirectionLines",title:"Direction Lines"},popupInfo:D.popupInfo}}_writeDirectionPoints(){return a(this.directionPoints)||!this.directionPoints.length?null:{featureSet:{features:this.directionPoints.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionPoints.toJSON()}},fields:O.fields,geometryType:"esriGeometryPoint",name:"DirectionPoints",title:"Direction Points"},popupInfo:O.popupInfo}}_writePointBarriers(){return a(this.pointBarriers)||!this.pointBarriers.length?null:{featureSet:{features:this.pointBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.pointBarriers.toJSON()}},fields:C.fields,geometryType:"esriGeometryPoint",name:"Barrier",title:"Point Barrier"},popupInfo:C.popupInfo}}_writePolygonBarriers(){return a(this.polygonBarriers)||!this.polygonBarriers.length?null:{featureSet:{features:this.polygonBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolygon"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polygonBarriers.toJSON()}},fields:_.fields,geometryType:"esriGeometryPolygon",name:"PolygonBarriers",title:"Polygon Barriers"},popupInfo:_.popupInfo}}_writePolylineBarriers(){return a(this.polylineBarriers)||!this.polylineBarriers.length?null:{featureSet:{features:this.polylineBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polylineBarriers.toJSON()}},fields:T.fields,geometryType:"esriGeometryPolyline",name:"PolylineBarriers",title:"Line Barriers"},popupInfo:T.popupInfo}}_writeRouteInfo(){return a(this.routeInfo)?null:{featureSet:{features:[this.routeInfo.toPortalJSON()],geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.routeInfo.toJSON()}},fields:J.fields,geometryType:"esriGeometryPolyline",name:"RouteInfo",title:"Route Details"},popupInfo:J.popupInfo}}_writeStops(){return a(this.stops)||!this.stops.length?null:{featureSet:{features:this.stops.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"uniqueValue",field1:"Sequence",defaultSymbol:this.defaultSymbols.middleStop.toJSON(),uniqueValueInfos:[{value:"1",symbol:this.defaultSymbols.firstStop.toJSON(),label:"First Stop"},{value:`${this.stops.length}`,symbol:this.defaultSymbols.lastStop.toJSON(),label:"Last Stop"}]}},fields:F.fields,geometryType:"esriGeometryPoint",name:"Stops",title:"Stops"},popupInfo:F.popupInfo}}};e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],X.prototype,"_featureCollection",void 0),e([d("web-map","_featureCollection")],X.prototype,"writeFeatureCollectionWebmap",null),e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],X.prototype,"_type",void 0),e([m({nonNullable:!0,type:P})],X.prototype,"defaultSymbols",void 0),e([m({readOnly:!0})],X.prototype,"directionLines",void 0),e([f(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],X.prototype,"readDirectionLines",null),e([m({readOnly:!0})],X.prototype,"directionPoints",void 0),e([f(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],X.prototype,"readDirectionPoints",null),e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],X.prototype,"featureCollectionType",void 0),e([m({readOnly:!0})],X.prototype,"fullExtent",null),e([m({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],X.prototype,"legendEnabled",void 0),e([m({type:["show","hide"]})],X.prototype,"listMode",void 0),e([m({type:Number,nonNullable:!0,json:{write:!1}})],X.prototype,"maxScale",void 0),e([f(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],X.prototype,"readMaxScale",null),e([m({type:Number,nonNullable:!0,json:{write:!1}})],X.prototype,"minScale",void 0),e([f(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],X.prototype,"readMinScale",null),e([m({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],X.prototype,"operationalLayerType",void 0),e([m({nonNullable:!0,type:s.ofType(C)})],X.prototype,"pointBarriers",void 0),e([f(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],X.prototype,"readPointBarriers",null),e([m({nonNullable:!0,type:s.ofType(_)})],X.prototype,"polygonBarriers",void 0),e([f(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],X.prototype,"readPolygonBarriers",null),e([m({nonNullable:!0,type:s.ofType(T)})],X.prototype,"polylineBarriers",void 0),e([f(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],X.prototype,"readPolylineBarriers",null),e([m({readOnly:!0})],X.prototype,"routeInfo",void 0),e([f(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],X.prototype,"readRouteInfo",null),e([m({nonNullable:!0})],X.prototype,"routeServiceUrl",null),e([m({type:k})],X.prototype,"spatialReference",void 0),e([f(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],X.prototype,"readSpatialReference",null),e([m({nonNullable:!0,type:s.ofType(F)})],X.prototype,"stops",void 0),e([f(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],X.prototype,"readStops",null),e([m()],X.prototype,"title",void 0),e([m({readOnly:!0,json:{read:!1}})],X.prototype,"type",void 0),X=e([c("esri.layers.RouteLayer")],X);const Y=X;export{Y as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import"../geometry.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import s from"../core/Collection.js";import n from"../core/Error.js";import{isSome as l,isNone as a}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{convertUnit as y}from"../core/unitUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import h from"../geometry/Extent.js";import{WGS84 as S}from"../geometry/support/spatialReferenceUtils.js";import g from"./Layer.js";import{BlendLayer as b}from"./mixins/BlendLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import P from"./support/DefaultSymbols.js";import{fetchServiceDescription as N}from"../rest/networkService.js";import{solve as I}from"../rest/route.js";import D from"../rest/support/DirectionLine.js";import O from"../rest/support/DirectionPoint.js";import{directionsTimeUnitJsonMap as j,directionsLengthUnitJsonMap as L}from"../rest/support/networkEnums.js";import _ from"../rest/support/PointBarrier.js";import C from"../rest/support/PolygonBarrier.js";import T from"../rest/support/PolylineBarrier.js";import J from"../rest/support/RouteInfo.js";import R from"../rest/support/RouteParameters.js";import x from"../rest/support/RouteSettings.js";import A from"../rest/support/Stop.js";import F from"../geometry/SpatialReference.js";import k from"../geometry/Multipoint.js";function G(e){return e.length?e:null}function U(e){return"layers"in e}function M(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function W(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function E(e,t,r){var o,i,s,a,p,u,y,m,f,c,d;const h=t.networkDataset.networkAttributes.filter((e=>"esriNAUTCost"===e.usageType)),S=t.supportedTravelModes.find((e=>e.id===t.defaultTravelMode)),g=null!=(o=r.travelMode)?o:S,{timeAttributeName:b,distanceAttributeName:w}=g,v=h.find((e=>e.name===b)),B=h.find((e=>e.name===w)),P=null!=(i=null!=(s=null==(a=r.travelMode)?void 0:a.impedanceAttributeName)?s:r.impedanceAttribute)?i:t.impedance,N=j.fromJSON(null==v?void 0:v.units),I=L.fromJSON(null==B?void 0:B.units);if(!N||!I)throw new n("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const D=null!=(p=r.directionsLanguage)?p:t.directionsLanguage,O=null!=(u=null!=(y=r.accumulateAttributes)?y:t.accumulateAttributeNames)?u:[],_=new Set(h.filter((({name:e})=>e===b||e===w||e===P||O.includes(e))).map((({name:e})=>e))),C=e=>{for(const t in e)_.has(t)||delete e[t]};for(const n of e.pointBarriers){var T;if(l(n.costs))n.addedCost=null!=(T=n.costs[P])?T:0,C(n.costs)}for(const n of e.polygonBarriers){var J;if(l(n.costs))n.scaleFactor=null!=(J=n.costs[P])?J:1,C(n.costs)}for(const n of e.polylineBarriers){var R;if(l(n.costs))n.scaleFactor=null!=(R=n.costs[P])?R:1,C(n.costs)}const{routeInfo:A}=e,{findBestSequence:F,preserveFirstStop:k,preserveLastStop:G,startTimeIsUTC:U,timeWindowsAreUTC:M}=r;A.analysisSettings=new x({accumulateAttributes:O,directionsLanguage:D,findBestSequence:F,preserveFirstStop:k,preserveLastStop:G,startTimeIsUTC:U,timeWindowsAreUTC:M,travelMode:g}),A.totalDuration=q(null!=(m=A.totalCosts[b])?m:0,N),A.totalDistance=V(null!=(f=A.totalCosts[w])?f:0,I),A.totalLateDuration=q(null!=(c=A.totalViolations[b])?c:0,N),A.totalWaitDuration=q(null!=(d=A.totalWait[b])?d:0,N),l(A.totalCosts)&&C(A.totalCosts),l(A.totalViolations)&&C(A.totalViolations),l(A.totalWait)&&C(A.totalWait);for(const n of e.stops){var W,E,H,K,Q,Z;if(l(n.serviceCosts))n.serviceDuration=q(null!=(W=n.serviceCosts[b])?W:0,N),n.serviceDistance=V(null!=(E=n.serviceCosts[w])?E:0,I),C(n.serviceCosts);if(l(n.cumulativeCosts))n.cumulativeDuration=q(null!=(H=n.cumulativeCosts[b])?H:0,N),n.cumulativeDistance=V(null!=(K=n.cumulativeCosts[w])?K:0,I),C(n.cumulativeCosts);if(l(n.violations))n.lateDuration=q(null!=(Q=n.violations[b])?Q:0,N),C(n.violations);if(l(n.wait))n.waitDuration=q(null!=(Z=n.wait[b])?Z:0,N),C(n.wait)}}function q(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function V(e,t){return"decimal-degrees"===t||"points"===t?e:y(e,t,"meters")}const H=s.ofType(D),K=s.ofType(O),Q=s.ofType(_),Z=s.ofType(C),$=s.ofType(T),z=s.ofType(A);let X=class extends(b(B(w(v(p(g)))))){constructor(...e){super(...e),this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new P,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Q,this.polygonBarriers=new Z,this.polylineBarriers=new $,this.routeInfo=null,this.spatialReference=F.WGS84,this.stops=new z,this.title="Route",this.type="route"}writeFeatureCollectionWebmap(e,t){const r=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),o=r.map(((e,t)=>t));u("featureCollection.layers",r,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=o}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>D.fromPortalJSON(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>O.fromPortalJSON(e)))}get fullExtent(){if(l(this.routeInfo)&&l(this.routeInfo.geometry))return this.routeInfo.geometry.extent;if(this.stops.length>1){const{spatialReference:e}=this.stops[0],t=new k({spatialReference:e}),r=this.stops.toArray().map((e=>e.geometry));for(const o of r)l(o)&&t.addPoint(o);return t.extent}return new h({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:F.WGS84})}readMaxScale(e,t){var r;const o=(U(t)?t.layers:t.featureCollection.layers).find((e=>l(e.layerDefinition.maxScale)));return null!=(r=null==o?void 0:o.layerDefinition.maxScale)?r:0}readMinScale(e,t){var r;const o=(U(t)?t.layers:t.featureCollection.layers).find((e=>l(e.layerDefinition.minScale)));return null!=(r=null==o?void 0:o.layerDefinition.minScale)?r:0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>_.fromPortalJSON(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>C.fromPortalJSON(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>T.fromPortalJSON(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,"RouteInfo",(e=>J.fromPortalJSON(e)));return r.length>0?r.getItemAt(0):null}get routeServiceUrl(){var e,r,o,i;return null!=(e=this.portalItem)&&e.id&&null!=(r=null==(o=this.portalItem.portal.helperServices)||null==(i=o.route)?void 0:i.url)?r:t.routeServiceUrl}readSpatialReference(e,t){var r,o;const i=U(t)?t.layers:t.featureCollection.layers;if(!i.length)return F.WGS84;const{layerDefinition:s}=i[0],n=null!=(r=null!=(o=s.spatialReference)?o:s.extent.spatialReference)?r:S;return F.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>A.fromPortalJSON(e)),(e=>this._setStopSymbol(e)))}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){l(this.directionLines)&&(this.directionLines.removeAll(),this._set("directionLines",null)),l(this.directionPoints)&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),l(this.routeInfo)&&this._set("routeInfo",null),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}async solve(e,t){var r,o,i,l;const p=null!=(r=null==e?void 0:e.stops)?r:this.stops,u=null!=(o=null==e?void 0:e.pointBarriers)?o:G(this.pointBarriers),y=null!=(i=null==e?void 0:e.polylineBarriers)?i:G(this.polylineBarriers),m=null!=(l=null==e?void 0:e.polygonBarriers)?l:G(this.polygonBarriers);if(a(p))throw new n("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((M(p)||W(p))&&p.features.length<2||s.isCollection(p)&&p.length<2)throw new n("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");const f=await N(this.routeServiceUrl,null==e?void 0:e.apiKey,t),c={startTime:new Date},d={directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:u,polylineBarriers:y,polygonBarriers:m,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!u,returnDirections:!0,returnPolygonBarriers:!!m,returnPolylineBarriers:!!y,returnRoutes:!0,returnStops:!0,stops:p},h=e?R.from(e):new R;for(const s in c)null==h[s]&&(h[s]=c[s]);h.set(d);const S=await I(this.routeServiceUrl,h,t),g=this._toRouteLayerSolution(S);return E(g,f,h),g}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:l}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",l)}_getLayerDefinition(){return{capabilities:"Query,Update,Editing",extent:this.fullExtent.toJSON(),hasM:!1,hasZ:!1,maxScale:this.maxScale,minScale:this.minScale,objectIdField:"__OBJECTID",spatialReference:this.spatialReference.toJSON(),type:"Feature Layer",typeIdField:""}}_getNetworkFeatures(e,t,n,l){const p=(U(e)?e.layers:e.featureCollection.layers).find((e=>e.layerDefinition.name===t));if(a(p))return new s;const{layerDefinition:u,popupInfo:y,featureSet:m}=p,f=u.drawingInfo.renderer,{features:c}=m,d=f&&i(f),h=c.map((e=>{var i;const s=n(e),{attributes:l}=e,a=new r({attributes:l});return null!=s.symbol||(s.symbol=null!=(i=null==d?void 0:d.getSymbol(a))?i:this._getNetworkSymbol(t)),null!=s.popupTemplate||(s.popupTemplate=y&&o.fromJSON(y)),s}));return l&&h.some((e=>!e.symbol))&&l(h),new s(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}_setStopSymbol(e){if(!e)return;if(e.length<2){for(const t of e)t.symbol=this.defaultSymbols.invalidStop;return}const t=e.map((e=>e.sequence)).filter((e=>l(e))),r=Math.min(...t),o=Math.max(...t);for(const i of e)i.sequence!==r?i.sequence!==o?"ok"===i.status||"not-located-on-closest"===i.status?"waypoint"!==i.locationType?"break"!==i.locationType?i.symbol=this.defaultSymbols.middleStop:i.symbol=this.defaultSymbols.breakStop:i.symbol=this.defaultSymbols.waypointStop:i.symbol=this.defaultSymbols.invalidStop:i.symbol=this.defaultSymbols.lastStop:i.symbol=this.defaultSymbols.firstStop}_toRouteLayerSolution(e){var t,r,o;const i=e.routeResults[0].stops.map((e=>A.fromJSON(e.toJSON())));this._setStopSymbol(i);const s=new z(i),n=new Z(null==(t=e.polygonBarriers)?void 0:t.map((e=>{const t=C.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),l=new $(null==(r=e.polylineBarriers)?void 0:r.map((e=>{const t=T.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),a=new Q(null==(o=e.pointBarriers)?void 0:o.map((e=>{const t=_.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),p=J.fromJSON(e.routeResults[0].route.toJSON());p.symbol=this.defaultSymbols.routeInfo;const u=new K(e.routeResults[0].directionPoints.features.map((e=>{const t=O.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new H(e.routeResults[0].directionLines.features.map((e=>{const t=D.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:u,pointBarriers:a,polygonBarriers:n,polylineBarriers:l,routeInfo:p,stops:s}}_writeDirectionLines(){return a(this.directionLines)||!this.directionLines.length?null:{featureSet:{features:this.directionLines.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionLines.toJSON()}},fields:D.fields,geometryType:"esriGeometryPolyline",name:"DirectionLines",title:"Direction Lines"},popupInfo:D.popupInfo}}_writeDirectionPoints(){return a(this.directionPoints)||!this.directionPoints.length?null:{featureSet:{features:this.directionPoints.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionPoints.toJSON()}},fields:O.fields,geometryType:"esriGeometryPoint",name:"DirectionPoints",title:"Direction Points"},popupInfo:O.popupInfo}}_writePointBarriers(){return a(this.pointBarriers)||!this.pointBarriers.length?null:{featureSet:{features:this.pointBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.pointBarriers.toJSON()}},fields:_.fields,geometryType:"esriGeometryPoint",name:"Barrier",title:"Point Barrier"},popupInfo:_.popupInfo}}_writePolygonBarriers(){return a(this.polygonBarriers)||!this.polygonBarriers.length?null:{featureSet:{features:this.polygonBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolygon"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polygonBarriers.toJSON()}},fields:C.fields,geometryType:"esriGeometryPolygon",name:"PolygonBarriers",title:"Polygon Barriers"},popupInfo:C.popupInfo}}_writePolylineBarriers(){return a(this.polylineBarriers)||!this.polylineBarriers.length?null:{featureSet:{features:this.polylineBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polylineBarriers.toJSON()}},fields:T.fields,geometryType:"esriGeometryPolyline",name:"PolylineBarriers",title:"Line Barriers"},popupInfo:T.popupInfo}}_writeRouteInfo(){return a(this.routeInfo)?null:{featureSet:{features:[this.routeInfo.toPortalJSON()],geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.routeInfo.toJSON()}},fields:J.fields,geometryType:"esriGeometryPolyline",name:"RouteInfo",title:"Route Details"},popupInfo:J.popupInfo}}_writeStops(){return a(this.stops)||!this.stops.length?null:{featureSet:{features:this.stops.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"uniqueValue",field1:"Sequence",defaultSymbol:this.defaultSymbols.middleStop.toJSON(),uniqueValueInfos:[{value:"1",symbol:this.defaultSymbols.firstStop.toJSON(),label:"First Stop"},{value:`${this.stops.length}`,symbol:this.defaultSymbols.lastStop.toJSON(),label:"Last Stop"}]}},fields:A.fields,geometryType:"esriGeometryPoint",name:"Stops",title:"Stops"},popupInfo:A.popupInfo}}};e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],X.prototype,"_featureCollection",void 0),e([d("web-map","_featureCollection")],X.prototype,"writeFeatureCollectionWebmap",null),e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],X.prototype,"_type",void 0),e([m({nonNullable:!0,type:P})],X.prototype,"defaultSymbols",void 0),e([m({readOnly:!0})],X.prototype,"directionLines",void 0),e([f(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],X.prototype,"readDirectionLines",null),e([m({readOnly:!0})],X.prototype,"directionPoints",void 0),e([f(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],X.prototype,"readDirectionPoints",null),e([m({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],X.prototype,"featureCollectionType",void 0),e([m({readOnly:!0})],X.prototype,"fullExtent",null),e([m({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],X.prototype,"legendEnabled",void 0),e([m({type:["show","hide"]})],X.prototype,"listMode",void 0),e([m({type:Number,nonNullable:!0,json:{write:!1}})],X.prototype,"maxScale",void 0),e([f(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],X.prototype,"readMaxScale",null),e([m({type:Number,nonNullable:!0,json:{write:!1}})],X.prototype,"minScale",void 0),e([f(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],X.prototype,"readMinScale",null),e([m({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],X.prototype,"operationalLayerType",void 0),e([m({nonNullable:!0,type:s.ofType(_)})],X.prototype,"pointBarriers",void 0),e([f(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],X.prototype,"readPointBarriers",null),e([m({nonNullable:!0,type:s.ofType(C)})],X.prototype,"polygonBarriers",void 0),e([f(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],X.prototype,"readPolygonBarriers",null),e([m({nonNullable:!0,type:s.ofType(T)})],X.prototype,"polylineBarriers",void 0),e([f(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],X.prototype,"readPolylineBarriers",null),e([m({readOnly:!0})],X.prototype,"routeInfo",void 0),e([f(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],X.prototype,"readRouteInfo",null),e([m({nonNullable:!0})],X.prototype,"routeServiceUrl",null),e([m({type:F})],X.prototype,"spatialReference",void 0),e([f(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],X.prototype,"readSpatialReference",null),e([m({nonNullable:!0,type:s.ofType(A)})],X.prototype,"stops",void 0),e([f(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],X.prototype,"readStops",null),e([m()],X.prototype,"title",void 0),e([m({readOnly:!0,json:{read:!1}})],X.prototype,"type",void 0),X=e([c("esri.layers.RouteLayer")],X);const Y=X;export{Y 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.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import s from"../../../core/has.js";import a from"../../../core/Logger.js";import{isSome as r,isNone as d}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{EsriPromiseMixin as n}from"../../../core/Promise.js";import{isAbortError as h}from"../../../core/promiseUtils.js";import{init as l}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection.js";import{create as p,intersectsSphere as g}from"../../../geometry/support/aaBoundingRect.js";import{makeDehydratedPoint as m}from"../dehydratedFeatures.js";import{PromiseQueue as y}from"../../support/PromiseQueue.js";import{addTask as x}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as f}from"../../../views/3d/layers/i3s/I3SIndex.js";import b from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as w,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import v from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as C}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as D,getIndexCrs as L,findIntersectingNodes as S}from"../../../views/3d/layers/i3s/I3SUtil.js";import V from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as I}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{ClientType as U,maxDownloadSlots as F}from"../../../views/3d/support/index.js";import{extractSafeScaleBounds as P,scaleBoundsPredicate as O}from"../../../views/support/layerViewUtils.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const q=a.getLogger("esri.layers.graphics.controllers.I3SOnDemandController"),G=100,j=2,Q=1e4,T=1e-4,E=1.2,B=500,H=1.5;let k=class extends(n(t)){constructor(e){super(e),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new o({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new o,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new i,this._idleQueue=new y,this._elevationUpdateNodes=new o({deallocator:null}),this._errorCount=0}get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store.lodType}get isGraphics3D(){return"points"===this.layer.profile}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_INDEX);return new C(e,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_DATA);return new C(e,this.layer.apiKey)}get crsVertex(){return D(this.layer)}get crsIndex(){return L(this.layer)}get rootNodeVisible(){if(r(this._index)){const e=this._index.rootNode;if(r(e))return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}initialize(){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData,this._lodHandling=new b(this.layerView);const e=this.layerView.i3slayer;this.layer=e,this._defaultGeometrySchema=e.store.defaultGeometrySchema,this.disableIDBCache=s("disable-feature:idb-cache"),"fields"in e&&(this._fields=e.fields,this._attributeStorageInfo=e.attributeStorageInfo),this.addResolvingPromise(Promise.all([this.layer.indexInfo,this.layer.when(),this.layerView.when()]).then((([t])=>{var i;if(this.destroyed||!this.layerView||this.layerView.destroyed)return;const s=this.layerView.view;this._setClippingArea(s.clippingArea);const a=this.layerView.view.resourceController;this._handles.add([l(s,"pointsOfInterest.focus.renderLocation",(e=>this._pointOfInterestChanged(e))),a.memoryController.events.on("quality-changed",(()=>this._setCameraDirty())),l(this.layerView,"suspended",(e=>{const t=e?()=>this._updateViewData():()=>this._updateIdleState(!0),i=e?()=>{}:()=>this._updateIdleState(!1);this._idleStateCallbacks?(e&&this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=a.scheduler.registerIdleStateCallbacks(t,i)})),x(this.layerView.view.resourceController.scheduler,{update:(e,t)=>this._frame(e,t),needsUpdate:()=>this.updating}),this.watch("uncompressedTextureDownsamplingEnabled",(()=>this.restartNodeLoading())),this.watch(["featureTarget","fixedFeatureTarget"],(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),s.state.watch("contentCamera",(()=>this._setCameraDirty())),this.layer.watch("elevationInfo",(()=>this._elevationInfoChanged())),this.layer.watch("effectiveScaleRange",(()=>this._scaleBoundsChanged())),this.layerView.watch("lodFactor",(()=>this._setCameraDirty())),this.layerView.watch("availableFields?",(()=>this._requiredFieldsChange())),this.layerView.watch("holeFilling",(e=>r(this._index)&&(this._index.holeFilling=e)))]),this._updateScaleHandles(),this._viewportQueries=new V(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,s.elevationProvider,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this.lod,angleDependentLoD:this.lod<.5}),this._index=new f(e,t,this.indexStreamController,this._viewportQueries,q,this.layerView.holeFilling,(e=>this.layerView.isNodeLoaded(e)),(e=>this.layerView.isNodeReloading(e)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,w.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(e=>this.layerView.computeVisibilityObb?this.layerView.computeVisibilityObb(e):null),null!=(i=this.layerView)&&i.computeNodeFiltering?e=>this.layerView.computeNodeFiltering(e):void 0),this._index.imModificationsChanged(!!this.layerView.hasModifications),this._startNodeLoading()}))),this._tmpPoint=m(0,0,0,this.crsIndex)}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;r(t)&&i&&i.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);r(i)&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,R.prune(),r(z)&&(z.hide(),z=null)}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=X(e,i),a=X(t,i);return s>=0&&a>=0?{index:s,name:t[a].name,field:t[a],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();K(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=p();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){r(this._viewportQueries)&&(this._viewportQueries.setPointOfInterest(e),r(this._index)&&(this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),r(this._viewportQueries)&&r(this._index)&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this.notifyChange("rootNodeVisible"),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateElevationChanged(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;if(d(s))return;const a=this._elevationUpdateNodes;a.clear(),S(e,t,s,this.crsIndex,i,(e=>a.push(e.index))),a.forAll((e=>{i.invalidateBoundingVolumeCache(e),e===s.index&&this.notifyChange("rootNodeVisible")})),a.length&&this.restartNodeLoading()}getParentIndex(e){return r(this._index)&&this._index.getParentIndex(e)}_elevationInfoChanged(){r(this._index)&&this._index.updateElevationInfo(this.layer.elevationInfo),this._setCameraDirty()}_updateScaleHandles(){const e="scale-bounds";this._handles.remove(e),this.areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),e)}_scaleBoundsChanged(){this.areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(e){this._updateScaleInBoundingRect(e.extent,e.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;!d(s)&&_(e,t,J,this.crsIndex)&&this._loadedNodeScales.forEach(((e,t)=>{const s=i.getNode(t);r(s)&&g(J,s.mbs)&&this._loadedNodeScales.set(t,this._computeScale(s))}))}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get areScaleBoundsActive(){const{minScale:e,maxScale:t}=P(this.layer);return this.scaleVisibilityEnabled&&(e>0||t>0)}get unloadedMemoryEstimate(){return d(this._index)||this.layerView.suspended?0:this._index.getUnloadedMemoryEstimate()*this.lodDropFactor}get indexDepth(){return r(this._index)?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=e}_frame(e,t){return this.layerView.suspended?(this._updateViewData(),this._evaluateUpdating(),-1/0):!this.layerView.visible||d(this._index)?-1/0:(this._processLogError(e,t),this._index.getPriority())}_processLogError(e,t){try{this._process(e,t)}catch(i){this._errorCount<50?q.error("Error during processing: "+i):50===this._errorCount&&q.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null==this._nodeLoader||d(this._index)||(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this.isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this.isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.getIndexLoading(),t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(d(this._index))return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update([...this._loadingNodes.keys()],e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading()||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(d(this._index)||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.isGraphics3D||d(this._index)||d(this._viewportQueries))return;const e=!this._index.isLoading(),t=this.featureTarget*this.baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.getIndexMissing()>B){if(this._featureLOD<=T)return;this._featureLOD/=H,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=Q||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this.lod,a=this._index.checkFeatureTarget(t,s);a!==s&&(this._featureLOD=a/this.baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*E||e&&i.estimate>t))return;if(this._featureLOD<=T)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(Q,Math.max(T,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(d(t))return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);r(s)&&(!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s));s=t.getParent(s.index))if(this._enableFromGPUCache(s,w.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(d(this._index))return!1;let i=(this._isIdle?G:j)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());r(t)&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const a=this._index.getNode(s.add.back());if(d(a)||a.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(a),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=j)&&(this._downloadingCount<F&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView.suspended)e=this._cameraDirty,t=e?0:1;else{const i=(r(this._index)?this._index.getIndexMissing():0)+3*(r(this._index)?this._index.updates.add.length:0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}this.updating=e,this.updatingProgress=t}_updateViewData(){if(!this._cameraDirty||d(this._index)||d(this._viewportQueries))return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this.screenSizeFactor=1/(t.perScreenPixelRatio/2),this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get lod(){return this._featureLOD*this.baseLOD}get baseLOD(){const e=this.layerView.lodFactor,t=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*t}get lodDropFactor(){if(this.fixedFeatureTarget)return 1;const e=this.layerView.view.resourceController.memoryController;return(Math.min(e.memoryFactor,.5)-e.minQuality)/(.5-e.minQuality)}isGeometryVisible(e){return r(this._index)&&this._index.isGeometryVisible(e.index)}updateVisibility(e){r(this._index)&&this._index.invalidateNodeVisibilityCache(e)}updateBoundingVolume(e){r(this._index)&&this._index.invalidateBoundingVolumeCache(e)}invalidateGeometryVisibility(e){r(this._index)&&this._index.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){r(this._index)&&this._index.invalidateVisibilityObbs()}modificationsChanged(){r(this._index)&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&(!(!r(this._index)||!this._index.isGeometryVisible(e.index))&&this._isNodeInScaleBounds(e))}_shouldDropNode(e){if(d(this._viewportQueries))return!1;const t=this.lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||d(e)||d(this._viewportQueries))return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:!this.isMeshPyramid};this._nodeLoader=new v(this.layer,this.dataStreamController,q,this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e=>this._isNodeInScaleBounds(e)),((e,t)=>this._removeNodes(e,t,W.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(d(t)||d(this._viewportQueries))return!1;R.clear(),this.layerView.getLoadedNodeIndices(R);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return R.filterInPlace((e=>{const i=t.getNode(e);return d(i)||!t.isGeometryVisible(e)||s(i)||!this._isNodeInScaleBounds(i)})),R.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(R,e,W.pop),!(i&&this.lodDropFactor<1)&&(0===R.length||(R.clear(),!1))}markNodeToRemove(e){R.push(e)}removeMarkedNodes(){this._removeNodes(R,M,W.pop)}_removeNodes(e,t,i){const s=e.length;if(0!==s&&!t.done){for(r(this._index)&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),a=this._index;i===W.fadeout&&this.layerView.nodeFadeoutEnabled&&r(a)&&a.isGeometryVisible(s)?this.layerView.fadeNode(s,I.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}if(this._loadedNodeScales.size>0)for(let t=e.length;t<s;t++){const i=e.data[t];this._loadedNodeScales.delete(i)}}}_needsUpdate(e){if(!e.resources.hasFeatureData||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}_updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t);(K(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes)?Promise.resolve(this.layerView.getAttributeData(e.index)):this._nodeLoader.loadAttributes(e,this._requiredAttributes,t.signal)).then((i=>this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:i},t.signal)),t.signal))).catch((i=>{if(!h(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)})).catch((()=>{})).then((()=>{this._updatingNodes.delete(e.index),this._evaluateUpdating()})),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void q.error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((i=>{i&&r(this._index)&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())})).catch((e=>{if(!h(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!h(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||d(this._index))return!1;if(t===w.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e);return r(t)&&r(t.attributeInfo)&&K(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){r(this._index)&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_loadCached(e,t){if(this._enableFromGPUCache(e,w.Leaf))return Promise.resolve(!0);const i=this.layerView;return!this.disableIDBCache&&i.loadCachedNodeData&&i.addCachedNodeData?this.schedule((()=>i.loadCachedNodeData(e,t,((t,i)=>this._nodeLoader.loadTextures(e,t,i)))),t).then((s=>{if(d(s))return!1;const a=this._requiredAttributes;return this.reschedule((()=>this._nodeLoader.loadAttributes(e,a,t)),t).then((r=>this.reschedule((()=>i.addCachedNodeData(e,s,{loadedAttributes:a,attributeData:r},t)),t))).then((()=>(this._nodeAdded(),!0)))})):Promise.resolve(!1)}_loadUncached(e,t){return this._downloadingCount++,this._nodeLoader.loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=N.Cached})).catch((t=>{if(!h(t))throw q.error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,r(this._index)&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&r(this._index)&&this._index.resetFailedNodes())}_getScale(e){if(this._loadedNodeScales.has(e.index))return this._loadedNodeScales.get(e.index);const t=this._computeScale(e);return this.layerView.isNodeLoaded(e.index)&&this._loadedNodeScales.set(e.index,t),t}_computeScale(e){this._tmpPoint.x=e.mbs[0],this._tmpPoint.y=e.mbs[1],this._tmpPoint.z=e.mbs[2];const t=e.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,t)}_isNodeInScaleBounds(e){if(!this.areScaleBoundsActive)return!0;const t=this._getScale(e),{minScale:i,maxScale:s}=P(this.layer);return O(t,i,s)}updateStats(e){e.index=r(this._index)?this._index.size:0,this.isGraphics3D&&(e.detail=this._featureLOD,e.target=this.featureTarget*this.baseLOD),r(this._index)&&this._index.updateStats(e)}get test(){const e=this;return{index:this._index,set disableUpdates(t){e._updatesDisabled=t,t?e.cancelNodeLoading():e.requestUpdate()},set disableIDBCache(t){e.disableIDBCache=t},set ignoreServiceObb(t){r(e._index)&&(e._index.ignoreServiceObb=t)},shouldLoadNode:t=>e._shouldLoadNode(t)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),r(this._index)&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;r(t)&&t.layerFilterChanged(e),this.requestUpdate()}};e([u({readOnly:!0})],k.prototype,"isMeshPyramid",null),e([u({readOnly:!0})],k.prototype,"isGraphics3D",null),e([u({readOnly:!0})],k.prototype,"indexStreamController",null),e([u({readOnly:!0})],k.prototype,"dataStreamController",null),e([u({readOnly:!0})],k.prototype,"crsVertex",null),e([u({readOnly:!0})],k.prototype,"crsIndex",null),e([u()],k.prototype,"screenSizeFactor",void 0),e([u()],k.prototype,"featureTarget",void 0),e([u()],k.prototype,"fixedFeatureTarget",void 0),e([u()],k.prototype,"layerView",void 0),e([u()],k.prototype,"layer",void 0),e([u({})],k.prototype,"updating",void 0),e([u({})],k.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],k.prototype,"leavesReached",void 0),e([u({constructOnly:!0})],k.prototype,"scaleVisibilityEnabled",void 0),e([u({readOnly:!0,dependsOn:[]})],k.prototype,"rootNodeVisible",null),k=e([c("esri.layers.graphics.controllers.I3SOnDemandController")],k);const R=new o({deallocator:null});let z;function K(e,t){return r(e)&&e.length===t.length&&e.every((e=>X(t,e.name)>=0))}function X(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const $={factorIM:.2,factor3dObject:.05,distancePenalty:10},J=p();var W;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(W||(W={}));const Y=k;export{Y as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import s from"../../../core/has.js";import a from"../../../core/Logger.js";import{isSome as r,isNone as d}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{EsriPromiseMixin as n}from"../../../core/Promise.js";import{isAbortError as h}from"../../../core/promiseUtils.js";import{init as l}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingRect as _}from"../../../geometry/projection.js";import{create as p,intersectsSphere as g}from"../../../geometry/support/aaBoundingRect.js";import{makeDehydratedPoint as m}from"../dehydratedFeatures.js";import{PromiseQueue as y}from"../../support/PromiseQueue.js";import{addTask as x}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as f}from"../../../views/3d/layers/i3s/I3SIndex.js";import b from"../../../views/3d/layers/i3s/I3SLodHandling.js";import{NodeState as w,CacheState as N}from"../../../views/3d/layers/i3s/I3SNode.js";import v from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as C}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as D,getIndexCrs as L,findIntersectingNodes as S}from"../../../views/3d/layers/i3s/I3SUtil.js";import V from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{FadeDirection as I}from"../../../views/3d/layers/support/I3SLayerView.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{ClientType as U,maxDownloadSlots as F}from"../../../views/3d/support/index.js";import{extractSafeScaleBounds as P,scaleBoundsPredicate as O}from"../../../views/support/layerViewUtils.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const q=a.getLogger("esri.layers.graphics.controllers.I3SOnDemandController"),G=100,j=2,Q=1e4,T=1e-4,E=1.2,B=500,H=1.5;let k=class extends(n(t)){constructor(e){super(e),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new o({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new o,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new i,this._idleQueue=new y,this._elevationUpdateNodes=new o({deallocator:null}),this._errorCount=0}get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store.lodType}get isGraphics3D(){return"points"===this.layer.profile}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_INDEX);return new C(e,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(U.I3S_DATA);return new C(e,this.layer.apiKey)}get crsVertex(){return D(this.layer)}get crsIndex(){return L(this.layer)}get rootNodeVisible(){if(r(this._index)){const e=this._index.rootNode;if(r(e))return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}initialize(){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData,this._lodHandling=new b(this.layerView);const e=this.layerView.i3slayer;this.layer=e,this._defaultGeometrySchema=e.store.defaultGeometrySchema,this.disableIDBCache=s("disable-feature:idb-cache"),"fields"in e&&(this._fields=e.fields,this._attributeStorageInfo=e.attributeStorageInfo),this.addResolvingPromise(Promise.all([this.layer.indexInfo,this.layer.when(),this.layerView.when()]).then((([t])=>{var i;if(this.destroyed||!this.layerView||this.layerView.destroyed)return;const s=this.layerView.view;this._setClippingArea(s.clippingArea);const a=this.layerView.view.resourceController;this._handles.add([l(s,"pointsOfInterest.focus.renderLocation",(e=>this._pointOfInterestChanged(e))),a.memoryController.events.on("quality-changed",(()=>this._setCameraDirty())),l(this.layerView,"suspended",(e=>{const t=e?()=>this._updateViewData():()=>this._updateIdleState(!0),i=e?()=>{}:()=>this._updateIdleState(!1);this._idleStateCallbacks?(e&&this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=a.scheduler.registerIdleStateCallbacks(t,i)})),x(this.layerView.view.resourceController.scheduler,{update:(e,t)=>this._frame(e,t),needsUpdate:()=>this.updating}),this.watch("uncompressedTextureDownsamplingEnabled",(()=>this.restartNodeLoading())),this.watch(["featureTarget","fixedFeatureTarget"],(()=>{this._setCameraDirty(),this._stableFeatureLOD=!1})),s.state.watch("contentCamera",(()=>this._setCameraDirty())),this.layer.watch("elevationInfo",(()=>this._elevationInfoChanged())),this.layer.watch("effectiveScaleRange",(()=>this._scaleBoundsChanged())),this.layerView.watch("lodFactor",(()=>this._setCameraDirty())),this.layerView.watch("availableFields?",(()=>this._requiredFieldsChange())),this.layerView.watch("holeFilling",(e=>r(this._index)&&(this._index.holeFilling=e)))]),this._updateScaleHandles(),this._viewportQueries=new V(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,s.elevationProvider,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this.lod,angleDependentLoD:this.lod<.5}),this._index=new f(e,t,this.indexStreamController,this._viewportQueries,q,this.layerView.holeFilling,(e=>this.layerView.isNodeLoaded(e)),(e=>this.layerView.isNodeReloading(e)),(e=>this._shouldLoadNode(e)),(e=>this._enableFromGPUCache(e,w.Leaf)),(e=>this._needsUpdate(e)),(()=>!this.indexStreamController.busy),(e=>this.layerView.computeVisibilityObb?this.layerView.computeVisibilityObb(e):null),null!=(i=this.layerView)&&i.computeNodeFiltering?e=>this.layerView.computeNodeFiltering(e):void 0),this._index.imModificationsChanged(!!this.layerView.hasModifications),this._startNodeLoading()}))),this._tmpPoint=m(0,0,0,this.crsIndex)}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;r(t)&&i&&i.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll((e=>{const i=t.getNode(e);r(i)&&this._modificationsNodeFilteringArray.push(i)})),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,R.prune(),r(z)&&(z.hide(),z=null)}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map((i=>{const s=X(e,i),a=X(t,i);return s>=0&&a>=0?{index:s,name:t[a].name,field:t[a],attributeStorageInfo:e[s]}:null})).filter((e=>null!=e&&e.name!==i))}_requiredFieldsChange(){const e=this._getRequiredAttributes();K(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=p();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){r(this._viewportQueries)&&(this._viewportQueries.setPointOfInterest(e),r(this._index)&&(this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),r(this._viewportQueries)&&r(this._index)&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this.notifyChange("rootNodeVisible"),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateElevationChanged(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;if(d(s))return;const a=this._elevationUpdateNodes;a.clear(),S(e,t,s,this.crsIndex,i,(e=>a.push(e.index))),a.forAll((e=>{i.invalidateBoundingVolumeCache(e),e===s.index&&this.notifyChange("rootNodeVisible")})),a.length&&this.restartNodeLoading()}getParentIndex(e){return r(this._index)&&this._index.getParentIndex(e)}_elevationInfoChanged(){r(this._index)&&this._index.updateElevationInfo(this.layer.elevationInfo),this._setCameraDirty()}_updateScaleHandles(){const e="scale-bounds";this._handles.remove(e),this.areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),e)}_scaleBoundsChanged(){this.areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(e){this._updateScaleInBoundingRect(e.extent,e.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(e,t){const i=this._index;if(d(i))return;const s=i.rootNode;!d(s)&&_(e,t,J,this.crsIndex)&&this._loadedNodeScales.forEach(((e,t)=>{const s=i.getNode(t);r(s)&&g(J,s.mbs)&&this._loadedNodeScales.set(t,this._computeScale(s))}))}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get areScaleBoundsActive(){const{minScale:e,maxScale:t}=P(this.layer);return this.scaleVisibilityEnabled&&(e>0||t>0)}get unloadedMemoryEstimate(){return d(this._index)||this.layerView.suspended?0:this._index.getUnloadedMemoryEstimate()*this.lodDropFactor}get indexDepth(){return r(this._index)?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=e}_frame(e,t){return this.layerView.suspended?(this._updateViewData(),this._evaluateUpdating(),-1/0):!this.layerView.visible||d(this._index)?-1/0:(this._processLogError(e,t),this._index.getPriority())}_processLogError(e,t){try{this._process(e,t)}catch(i){this._errorCount<50?q.error("Error during processing: "+i):50===this._errorCount&&q.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null==this._nodeLoader||d(this._index)||(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this.isIntegratedMesh&&(e.enabled=!1),e.run((()=>this._processIndex(e))),this._updateFeatureLOD(),e.run((()=>this._processCache(e))),this.isIntegratedMesh&&(e.enabled=!0),e.run((()=>this._processNodes(e,t))),this._idleQueue.runTask(e),e.run((()=>this._prefetchIndex())),t.numIndexLoading+=this._index.getIndexLoading(),t.numNodesLoading+=this._downloadingCount,e.run((()=>this._lodHandling.lodGlobalHandling(e))),this._evaluateUpdating())}_processIndex(e){if(d(this._index))return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update([...this._loadingNodes.keys()],e,(e=>this.updateNodeModificationStatus(e))),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading()||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(d(this._index)||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.isGraphics3D||d(this._index)||d(this._viewportQueries)||s("enable-feature:psl-server-lod"))return;const e=!this._index.isLoading(),t=this.featureTarget*this.baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.getIndexMissing()>B){if(this._featureLOD<=T)return;this._featureLOD/=H,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=Q||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this.lod,a=this._index.checkFeatureTarget(t,s);a!==s&&(this._featureLOD=a/this.baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*E||e&&i.estimate>t))return;if(this._featureLOD<=T)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(Q,Math.max(T,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(d(t))return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);r(s)&&(!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s));s=t.getParent(s.index))if(this._enableFromGPUCache(s,w.Hole)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(d(this._index))return!1;let i=(this._isIdle?G:j)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());r(t)&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const a=this._index.getNode(s.add.back());if(d(a)||a.cacheState!==N.Cached&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(a),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach((e=>e.abort())),this._loadingNodes.clear(),this._updatingNodes.forEach((e=>e.abort())),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=j)&&(this._downloadingCount<F&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView.suspended)e=this._cameraDirty,t=e?0:1;else{const i=(r(this._index)?this._index.getIndexMissing():0)+3*(r(this._index)?this._index.updates.add.length:0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}this.updating=e,this.updatingProgress=t}_updateViewData(){if(!this._cameraDirty||d(this._index)||d(this._viewportQueries))return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this.screenSizeFactor=1/(t.perScreenPixelRatio/2),this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this.lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=$.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get lod(){return this._featureLOD*this.baseLOD}get baseLOD(){const e=this.layerView.lodFactor,t=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*t}get lodDropFactor(){if(this.fixedFeatureTarget)return 1;const e=this.layerView.view.resourceController.memoryController;return(Math.min(e.memoryFactor,.5)-e.minQuality)/(.5-e.minQuality)}isGeometryVisible(e){return r(this._index)&&this._index.isGeometryVisible(e.index)}updateVisibility(e){r(this._index)&&this._index.invalidateNodeVisibilityCache(e)}updateBoundingVolume(e){r(this._index)&&this._index.invalidateBoundingVolumeCache(e)}invalidateGeometryVisibility(e){r(this._index)&&this._index.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){r(this._index)&&this._index.invalidateVisibilityObbs()}modificationsChanged(){r(this._index)&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&(!(!r(this._index)||!this._index.isGeometryVisible(e.index))&&this._isNodeInScaleBounds(e))}_shouldDropNode(e){if(d(this._viewportQueries))return!1;const t=this.lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||d(e)||d(this._viewportQueries))return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:!this.isMeshPyramid};this._nodeLoader=new v(this.layer,this.dataStreamController,q,this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e=>this._isNodeInScaleBounds(e)),((e,t)=>this._removeNodes(e,t,W.fadeout)),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(d(t)||d(this._viewportQueries))return!1;R.clear(),this.layerView.getLoadedNodeIndices(R);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return R.filterInPlace((e=>{const i=t.getNode(e);return d(i)||!t.isGeometryVisible(e)||s(i)||!this._isNodeInScaleBounds(i)})),R.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(R,e,W.pop),!(i&&this.lodDropFactor<1)&&(0===R.length||(R.clear(),!1))}markNodeToRemove(e){R.push(e)}removeMarkedNodes(){this._removeNodes(R,M,W.pop)}_removeNodes(e,t,i){const s=e.length;if(0!==s&&!t.done){for(r(this._index)&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),a=this._index;i===W.fadeout&&this.layerView.nodeFadeoutEnabled&&r(a)&&a.isGeometryVisible(s)?this.layerView.fadeNode(s,I.FadeOut,!0):this.layerView.removeNode(s),t.madeProgress()}if(this._loadedNodeScales.size>0)for(let t=e.length;t<s;t++){const i=e.data[t];this._loadedNodeScales.delete(i)}}}_needsUpdate(e){if(!e.resources.hasFeatureData||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}_updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t);(K(this.layerView.getLoadedAttributes(e.index),this._requiredAttributes)?Promise.resolve(this.layerView.getAttributeData(e.index)):this._nodeLoader.loadAttributes(e,this._requiredAttributes,t.signal)).then((i=>this.schedule((()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:i},t.signal)),t.signal))).catch((i=>{if(!h(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)})).catch((()=>{})).then((()=>{this._updatingNodes.delete(e.index),this._evaluateUpdating()})),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void q.error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then((i=>{i&&r(this._index)&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())})).catch((e=>{if(!h(e))throw e})).finally((()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()}))}_loadAndAddNode(e,t){return e.cacheState===N.Uncached?this._loadUncached(e,t).then((()=>!1)):this._loadCached(e,t).then((t=>!t&&(e.cacheState=N.Uncached,!0))).catch((t=>!h(t)&&(e.cacheState=N.Uncached,!0)))}_enableFromGPUCache(e,t){if(this._disableMemCache||d(this._index))return!1;if(t===w.Hole&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e);return r(t)&&r(t.attributeInfo)&&K(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){r(this._index)&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_loadCached(e,t){if(this._enableFromGPUCache(e,w.Leaf))return Promise.resolve(!0);const i=this.layerView;return!this.disableIDBCache&&i.loadCachedNodeData&&i.addCachedNodeData?this.schedule((()=>i.loadCachedNodeData(e,t,((t,i)=>this._nodeLoader.loadTextures(e,t,i)))),t).then((s=>{if(d(s))return!1;const a=this._requiredAttributes;return this.reschedule((()=>this._nodeLoader.loadAttributes(e,a,t)),t).then((r=>this.reschedule((()=>i.addCachedNodeData(e,s,{loadedAttributes:a,attributeData:r},t)),t))).then((()=>(this._nodeAdded(),!0)))})):Promise.resolve(!1)}_loadUncached(e,t){return this._downloadingCount++,this._nodeLoader.loadNodeData(e,t).catch((e=>{throw this._downloadingCount--,e})).then((i=>(this._downloadingCount--,this.schedule((()=>this.layerView.addNode(e,i,t)),t)))).then((()=>{this._nodeAdded(),e.cacheState=N.Cached})).catch((t=>{if(!h(t))throw q.error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,r(this._index)&&this._index.requestUpdate(),t}))}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&r(this._index)&&this._index.resetFailedNodes())}_getScale(e){if(this._loadedNodeScales.has(e.index))return this._loadedNodeScales.get(e.index);const t=this._computeScale(e);return this.layerView.isNodeLoaded(e.index)&&this._loadedNodeScales.set(e.index,t),t}_computeScale(e){this._tmpPoint.x=e.mbs[0],this._tmpPoint.y=e.mbs[1],this._tmpPoint.z=e.mbs[2];const t=e.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,t)}_isNodeInScaleBounds(e){if(!this.areScaleBoundsActive)return!0;const t=this._getScale(e),{minScale:i,maxScale:s}=P(this.layer);return O(t,i,s)}updateStats(e){e.index=r(this._index)?this._index.size:0,this.isGraphics3D&&(e.detail=this._featureLOD,e.target=this.featureTarget*this.baseLOD),r(this._index)&&this._index.updateStats(e)}get test(){const e=this;return{index:this._index,set disableUpdates(t){e._updatesDisabled=t,t?e.cancelNodeLoading():e.requestUpdate()},set disableIDBCache(t){e.disableIDBCache=t},set ignoreServiceObb(t){r(e._index)&&(e._index.ignoreServiceObb=t)},shouldLoadNode:t=>e._shouldLoadNode(t)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),r(this._index)&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;r(t)&&t.layerFilterChanged(e),this.requestUpdate()}};e([u({readOnly:!0})],k.prototype,"isMeshPyramid",null),e([u({readOnly:!0})],k.prototype,"isGraphics3D",null),e([u({readOnly:!0})],k.prototype,"indexStreamController",null),e([u({readOnly:!0})],k.prototype,"dataStreamController",null),e([u({readOnly:!0})],k.prototype,"crsVertex",null),e([u({readOnly:!0})],k.prototype,"crsIndex",null),e([u()],k.prototype,"screenSizeFactor",void 0),e([u()],k.prototype,"featureTarget",void 0),e([u()],k.prototype,"fixedFeatureTarget",void 0),e([u()],k.prototype,"layerView",void 0),e([u()],k.prototype,"layer",void 0),e([u({})],k.prototype,"updating",void 0),e([u({})],k.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],k.prototype,"leavesReached",void 0),e([u({constructOnly:!0})],k.prototype,"scaleVisibilityEnabled",void 0),e([u({readOnly:!0,dependsOn:[]})],k.prototype,"rootNodeVisible",null),k=e([c("esri.layers.graphics.controllers.I3SOnDemandController")],k);const R=new o({deallocator:null});let z;function K(e,t){return r(e)&&e.length===t.length&&e.every((e=>X(t,e.name)>=0))}function X(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const $={factorIM:.2,factor3dObject:.05,distancePenalty:10},J=p();var W;!function(e){e[e.pop=0]="pop",e[e.fadeout=1]="fadeout"}(W||(W={}));const Y=k;export{Y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.23.0-next.20220130",
3
+ "version": "4.23.0-next.20220131",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import i from"../core/Error.js";import{JSONSupportMixin as r}from"../core/JSONSupport.js";import{clone as o,fixJson as a}from"../core/lang.js";import s from"../core/Loadable.js";import{isSome as n}from"../core/maybe.js";import{isDataProtocol as l,makeAbsolute as p}from"../core/urlUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import h from"../geometry/Extent.js";import y from"./Portal.js";import g from"./PortalItemResource.js";import f from"./PortalRating.js";var v;let w=v=class extends(r(s)){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return d(v,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.indexOf("Table")>-1?"Table":t.indexOf("Route Layer")>-1?"Route Layer":t.indexOf("Markup")>-1?"Markup":"Feature Layer":"Image Service"===e?i=t.indexOf("Elevation 3D Layer")>-1?"Elevation Layer":t.indexOf("Tiled Imagery")>-1?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?i=t.indexOf("Web Tool")>-1?"Tool":"Geoprocessing Service":"Geocoding Service"===e?i="Locator":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=-1===t.indexOf("Spatiotemporal")&&(t.indexOf("Hosted Service")>-1||t.indexOf("Tiled")>-1)&&-1===t.indexOf("Relational")?"Tile Layer":"Map Image Layer":e&&e.toLowerCase().indexOf("add in")>-1?i=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.indexOf("configurableApp")>-1&&(i="Instant App"),i}readExtent(e){return e&&e.length?new h(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",i=this.typeKeywords||[],r="esri/images/portal/",o="16";let a,s=!1,n=!1,l=!1,p=!1,c=!1,d=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(s=i.indexOf("Hosted Service")>-1,"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.indexOf("Table")>-1,l=i.indexOf("Route Layer")>-1,p=i.indexOf("Markup")>-1,c=-1!==i.indexOf("Spatiotemporal"),d=-1!==i.indexOf("UtilityNetwork"),a=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":s?"featureshosted":d?"utilitynetwork":"features"):a="map service"===e||"wms"===e||"wmts"===e?s||i.indexOf("Tiled")>-1||"wmts"===e?"maptiles":"mapimages":"scene service"===e?i.indexOf("Line")>-1?"sceneweblayerline":i.indexOf("3DObject")>-1?"sceneweblayermultipatch":i.indexOf("Point")>-1?"sceneweblayerpoint":i.indexOf("IntegratedMesh")>-1?"sceneweblayermesh":i.indexOf("PointCloud")>-1?"sceneweblayerpointcloud":i.indexOf("Polygon")>-1?"sceneweblayerpolygon":i.indexOf("Building")>-1?"sceneweblayerbuilding":i.indexOf("Voxel")>-1?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.indexOf("Elevation 3D Layer")>-1?"elevationlayer":i.indexOf("Tiled Imagery")>-1?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e&&i.indexOf("Web Tool")>-1&&this.portal&&this.portal.isPortal?"tool":"layers"):a="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?i.indexOf("ViewingMode-Local")>-1?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.indexOf("configurableApp")>-1?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&i.indexOf("ArcGIS Pro")>-1||"explorer map"===e&&i.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&i.indexOf("Explorer Mapping Application")>-1||i.indexOf("Document")>-1?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"maps",a?t(r+a+o+".png"):null}get isLayer(){return["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","WMTS","WMS"].indexOf(this.type)>-1}get itemUrl(){const e=this.get("portal.restUrl");return e?e+"/content/items/"+this.id:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){this.portal||(this.portal=y.getDefault());const t=this.portal.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?this.portal._request(this.itemUrl,{signal:n(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}addRating(e){const t={method:"post",query:{}};return e instanceof f&&(e=e.rating),isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal._request(this.itemUrl+"/addRating",t).then((()=>new f({rating:e,created:new Date})))}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:o(this.applicationProxies),avgRating:this.avgRating,categories:o(this.categories),created:o(this.created),culture:this.culture,description:this.description,extent:o(this.extent),groupCategories:o(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:o(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:o(this.screenshots),size:this.size,snippet:this.snippet,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new v({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}deleteRating(){return this.portal._request(this.itemUrl+"/deleteRating",{method:"post"}).then((()=>{}))}fetchData(e="json",t){return this.portal._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}fetchRating(e){return this.portal._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e}).then((e=>null!=e.rating?(e.created=new Date(e.created),new f(e)):null))}fetchRelatedItems(e,t){return this.portal._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},v)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal._request(this.itemUrl,{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)l(t)?r.query={data:t}:r.query={url:p(t)},n(i)&&(r.query.filename=i);else{const e=new FormData;n(i)?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await import("./support/resourceUtils.js")).fetchResources(this,e,t)}async addResource(e,t,i){const r=await import("./support/resourceUtils.js");return e.portalItem=this,r.addOrUpdateResource(e,"add",t,i)}async removeResource(e,t){const r=await import("./support/resourceUtils.js");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new i("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r.removeResource(this,e,t)}async removeAllResources(e){return(await import("./support/resourceUtils.js")).removeAllResources(this,e)}resourceFromPath(e){return new g({portalItem:this,path:e})}toJSON(){const e=this.extent,t={created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,tags:this.tags,thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:this.typeKeywords,url:this.url};return a(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new v({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([c({type:["private","shared","org","public"]})],w.prototype,"access",void 0),e([c()],w.prototype,"accessInformation",void 0),e([c({type:String})],w.prototype,"apiKey",void 0),e([c({json:{read:{source:"appProxies"}}})],w.prototype,"applicationProxies",void 0),e([c()],w.prototype,"avgRating",void 0),e([c()],w.prototype,"categories",void 0),e([c({type:Date})],w.prototype,"created",void 0),e([c()],w.prototype,"culture",void 0),e([c()],w.prototype,"description",void 0),e([c({readOnly:!0})],w.prototype,"displayName",null),e([c({type:h})],w.prototype,"extent",void 0),e([u("extent")],w.prototype,"readExtent",null),e([c()],w.prototype,"groupCategories",void 0),e([c({readOnly:!0})],w.prototype,"iconUrl",null),e([c()],w.prototype,"id",void 0),e([c({readOnly:!0})],w.prototype,"isLayer",null),e([c()],w.prototype,"itemControl",void 0),e([c({readOnly:!0})],w.prototype,"itemUrl",null),e([c()],w.prototype,"licenseInfo",void 0),e([c({type:Date})],w.prototype,"modified",void 0),e([c()],w.prototype,"name",void 0),e([c()],w.prototype,"numComments",void 0),e([c()],w.prototype,"numRatings",void 0),e([c()],w.prototype,"numViews",void 0),e([c()],w.prototype,"owner",void 0),e([c()],w.prototype,"ownerFolder",void 0),e([c({type:y})],w.prototype,"portal",void 0),e([c()],w.prototype,"screenshots",void 0),e([c()],w.prototype,"size",void 0),e([c()],w.prototype,"snippet",void 0),e([c()],w.prototype,"sourceJSON",void 0),e([c()],w.prototype,"tags",void 0),e([c()],w.prototype,"thumbnail",void 0),e([c({readOnly:!0})],w.prototype,"thumbnailUrl",null),e([c()],w.prototype,"title",void 0),e([c()],w.prototype,"type",void 0),e([c()],w.prototype,"typeKeywords",void 0),e([c()],w.prototype,"url",void 0),e([c({readOnly:!0})],w.prototype,"userItemUrl",null),w=v=e([m("esri.portal.PortalItem")],w);const b=w;export{b as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import i from"../core/Error.js";import{JSONSupportMixin as r}from"../core/JSONSupport.js";import{clone as o,fixJson as a}from"../core/lang.js";import s from"../core/Loadable.js";import{isSome as n}from"../core/maybe.js";import{isDataProtocol as l,makeAbsolute as p}from"../core/urlUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import h from"../geometry/Extent.js";import y from"./Portal.js";import g from"./PortalItemResource.js";import f from"./PortalRating.js";var v;let w=v=class extends(r(s)){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return d(v,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.indexOf("Table")>-1?"Table":t.indexOf("Route Layer")>-1?"Route Layer":t.indexOf("Markup")>-1?"Markup":"Feature Layer":"Image Service"===e?i=t.indexOf("Elevation 3D Layer")>-1?"Elevation Layer":t.indexOf("Tiled Imagery")>-1?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Media Service"===e?i="Media Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?i=t.indexOf("Web Tool")>-1?"Tool":"Geoprocessing Service":"Geocoding Service"===e?i="Locator":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=-1===t.indexOf("Spatiotemporal")&&(t.indexOf("Hosted Service")>-1||t.indexOf("Tiled")>-1)&&-1===t.indexOf("Relational")?"Tile Layer":"Map Image Layer":e&&e.toLowerCase().indexOf("add in")>-1?i=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.indexOf("configurableApp")>-1&&(i="Instant App"),i}readExtent(e){return e&&e.length?new h(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",i=this.typeKeywords||[],r="esri/images/portal/",o="16";let a,s=!1,n=!1,l=!1,p=!1,c=!1,d=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(s=i.indexOf("Hosted Service")>-1,"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.indexOf("Table")>-1,l=i.indexOf("Route Layer")>-1,p=i.indexOf("Markup")>-1,c=-1!==i.indexOf("Spatiotemporal"),d=-1!==i.indexOf("UtilityNetwork"),a=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":s?"featureshosted":d?"utilitynetwork":"features"):a="map service"===e||"wms"===e||"wmts"===e?s||i.indexOf("Tiled")>-1||"wmts"===e?"maptiles":"mapimages":"scene service"===e?i.indexOf("Line")>-1?"sceneweblayerline":i.indexOf("3DObject")>-1?"sceneweblayermultipatch":i.indexOf("Point")>-1?"sceneweblayerpoint":i.indexOf("IntegratedMesh")>-1?"sceneweblayermesh":i.indexOf("PointCloud")>-1?"sceneweblayerpointcloud":i.indexOf("Polygon")>-1?"sceneweblayerpolygon":i.indexOf("Building")>-1?"sceneweblayerbuilding":i.indexOf("Voxel")>-1?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.indexOf("Elevation 3D Layer")>-1?"elevationlayer":i.indexOf("Tiled Imagery")>-1?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"media service"===e?"mediaservice":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e&&i.indexOf("Web Tool")>-1&&this.portal&&this.portal.isPortal?"tool":"layers"):a="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?i.indexOf("ViewingMode-Local")>-1?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.indexOf("configurableApp")>-1?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&i.indexOf("ArcGIS Pro")>-1||"explorer map"===e&&i.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&i.indexOf("Explorer Mapping Application")>-1||i.indexOf("Document")>-1?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"maps",a?t(r+a+o+".png"):null}get isLayer(){return["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","WMTS","WMS"].indexOf(this.type)>-1}get itemUrl(){const e=this.get("portal.restUrl");return e?e+"/content/items/"+this.id:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){this.portal||(this.portal=y.getDefault());const t=this.portal.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?this.portal._request(this.itemUrl,{signal:n(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}addRating(e){const t={method:"post",query:{}};return e instanceof f&&(e=e.rating),isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal._request(this.itemUrl+"/addRating",t).then((()=>new f({rating:e,created:new Date})))}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:o(this.applicationProxies),avgRating:this.avgRating,categories:o(this.categories),created:o(this.created),culture:this.culture,description:this.description,extent:o(this.extent),groupCategories:o(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:o(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:o(this.screenshots),size:this.size,snippet:this.snippet,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new v({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}deleteRating(){return this.portal._request(this.itemUrl+"/deleteRating",{method:"post"}).then((()=>{}))}fetchData(e="json",t){return this.portal._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}fetchRating(e){return this.portal._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e}).then((e=>null!=e.rating?(e.created=new Date(e.created),new f(e)):null))}fetchRelatedItems(e,t){return this.portal._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},v)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal._request(this.itemUrl,{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)l(t)?r.query={data:t}:r.query={url:p(t)},n(i)&&(r.query.filename=i);else{const e=new FormData;n(i)?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await import("./support/resourceUtils.js")).fetchResources(this,e,t)}async addResource(e,t,i){const r=await import("./support/resourceUtils.js");return e.portalItem=this,r.addOrUpdateResource(e,"add",t,i)}async removeResource(e,t){const r=await import("./support/resourceUtils.js");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new i("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r.removeResource(this,e,t)}async removeAllResources(e){return(await import("./support/resourceUtils.js")).removeAllResources(this,e)}resourceFromPath(e){return new g({portalItem:this,path:e})}toJSON(){const e=this.extent,t={created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,tags:this.tags,thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:this.typeKeywords,url:this.url};return a(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new v({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([c({type:["private","shared","org","public"]})],w.prototype,"access",void 0),e([c()],w.prototype,"accessInformation",void 0),e([c({type:String})],w.prototype,"apiKey",void 0),e([c({json:{read:{source:"appProxies"}}})],w.prototype,"applicationProxies",void 0),e([c()],w.prototype,"avgRating",void 0),e([c()],w.prototype,"categories",void 0),e([c({type:Date})],w.prototype,"created",void 0),e([c()],w.prototype,"culture",void 0),e([c()],w.prototype,"description",void 0),e([c({readOnly:!0})],w.prototype,"displayName",null),e([c({type:h})],w.prototype,"extent",void 0),e([u("extent")],w.prototype,"readExtent",null),e([c()],w.prototype,"groupCategories",void 0),e([c({readOnly:!0})],w.prototype,"iconUrl",null),e([c()],w.prototype,"id",void 0),e([c({readOnly:!0})],w.prototype,"isLayer",null),e([c()],w.prototype,"itemControl",void 0),e([c({readOnly:!0})],w.prototype,"itemUrl",null),e([c()],w.prototype,"licenseInfo",void 0),e([c({type:Date})],w.prototype,"modified",void 0),e([c()],w.prototype,"name",void 0),e([c()],w.prototype,"numComments",void 0),e([c()],w.prototype,"numRatings",void 0),e([c()],w.prototype,"numViews",void 0),e([c()],w.prototype,"owner",void 0),e([c()],w.prototype,"ownerFolder",void 0),e([c({type:y})],w.prototype,"portal",void 0),e([c()],w.prototype,"screenshots",void 0),e([c()],w.prototype,"size",void 0),e([c()],w.prototype,"snippet",void 0),e([c()],w.prototype,"sourceJSON",void 0),e([c()],w.prototype,"tags",void 0),e([c()],w.prototype,"thumbnail",void 0),e([c({readOnly:!0})],w.prototype,"thumbnailUrl",null),e([c()],w.prototype,"title",void 0),e([c()],w.prototype,"type",void 0),e([c()],w.prototype,"typeKeywords",void 0),e([c()],w.prototype,"url",void 0),e([c({readOnly:!0})],w.prototype,"userItemUrl",null),w=v=e([m("esri.portal.PortalItem")],w);const b=w;export{b as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import DirectionLine = __esri.DirectionLine;
4
+ export default DirectionLine;
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import DirectionPoint = __esri.DirectionPoint;
4
+ export default DirectionPoint;
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import RouteInfo = __esri.RouteInfo;
4
+ export default RouteInfo;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../PopupTemplate.js";import{symbolTypes as i}from"../../symbols.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{isSome as a,unwrap as l}from"../../core/maybe.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{reader as r}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../geometry/Polyline.js";import{getTimezoneOffset as p,getPrefixedProperties as m}from"../route/utils.js";import d from"./RouteSettings.js";import{fromJSON as b}from"../../symbols/support/jsonUtils.js";var T;let f=T=class extends s{constructor(t){super(t),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.version="1.0.0"}readEndTime(t,e){return a(e.attributes.EndTimeUTC)?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(t,e){return p(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(t,e){return a(e.attributes.StartTimeUTC)?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(t,e){return p(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(t,e){return m(e.attributes,"Total_")}readTotalViolations(t,e){return m(e.attributes,"TotalViolation_")}readTotalWait(t,e){return m(e.attributes,"TotalWait_")}static fromPortalJSON(t){var i,s,l,o,r,n;return new T({analysisSettings:a(t.attributes.AnalysisSettings)?d.fromJSON(JSON.parse(t.attributes.AnalysisSettings)):null,endTime:a(t.attributes.EndTime)?new Date(t.attributes.EndTime):null,endTimeOffset:null!=(i=t.attributes.EndUTCOffset)?i:null,geometry:u.fromJSON(t.geometry),messages:a(t.attributes.Messages)?JSON.parse(t.attributes.Messages):null,name:t.attributes.RouteName,objectId:t.attributes.__OBJECTID,popupTemplate:a(t.popupInfo)?e.fromJSON(t.popupInfo):null,startTime:a(t.attributes.StartTime)?new Date(t.attributes.StartTime):null,startTimeOffset:null!=(s=t.attributes.StartUTCOffset)?s:null,symbol:a(t.symbol)?b(t.symbol):null,totalCosts:a(t.attributes.TotalCosts)?JSON.parse(t.attributes.TotalCosts):null,totalDistance:null!=(l=t.attributes.TotalMeters)?l:null,totalDuration:null!=(o=t.attributes.TotalMinutes)?o:null,totalLateDuration:null!=(r=t.attributes.TotalLateMinutes)?r:null,totalWaitDuration:null!=(n=t.attributes.TotalWaitMinutes)?n:null,version:t.attributes.Version})}toPortalJSON(){return{geometry:a(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:l(this.objectId),AnalysisSettings:a(this.analysisSettings)?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:a(this.endTime)?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:a(this.messages)?JSON.stringify(this.messages):null,RouteName:l(this.name),StartTime:a(this.startTime)?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:a(this.totalCosts)?JSON.stringify(this.totalCosts):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:l(this.version)},symbol:a(this.symbol)?this.symbol.toJSON():null,popupInfo:a(this.popupTemplate)?this.popupTemplate.toJSON():null}}};f.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],f.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"SolverSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([o({json:{read:!1}})],f.prototype,"analysisSettings",void 0),t([o()],f.prototype,"endTime",void 0),t([r("endTime",["attributes.EndTimeUTC"])],f.prototype,"readEndTime",null),t([o()],f.prototype,"endTimeOffset",void 0),t([r("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],f.prototype,"readEndTimeOffset",null),t([o({json:{read:{source:"attributes.FirstStopID"}}})],f.prototype,"firstStopId",void 0),t([o({type:u})],f.prototype,"geometry",void 0),t([o({json:{read:{source:"attributes.LastStopID"}}})],f.prototype,"lastStopId",void 0),t([o({json:{read:!1}})],f.prototype,"messages",void 0),t([o({json:{read:{source:"attributes.Name"}}})],f.prototype,"name",void 0),t([o({json:{read:{source:"attributes.ObjectID"}}})],f.prototype,"objectId",void 0),t([o({type:e,json:{read:!1}})],f.prototype,"popupTemplate",void 0),t([o()],f.prototype,"startTime",void 0),t([r("startTime",["attributes.StartTimeUTC"])],f.prototype,"readStartTime",null),t([o()],f.prototype,"startTimeOffset",void 0),t([r("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],f.prototype,"readStartTimeOffset",null),t([o({json:{read:{source:"attributes.StopCount"}}})],f.prototype,"stopCount",void 0),t([o({types:i,json:{read:!1}})],f.prototype,"symbol",void 0),t([o()],f.prototype,"totalCosts",void 0),t([r("totalCosts",["attributes"])],f.prototype,"readTotalCosts",null),t([o({json:{read:!1}})],f.prototype,"totalDistance",void 0),t([o({json:{read:!1}})],f.prototype,"totalDuration",void 0),t([o({json:{read:!1}})],f.prototype,"totalLateDuration",void 0),t([o()],f.prototype,"totalViolations",void 0),t([r("totalViolations",["attributes"])],f.prototype,"readTotalViolations",null),t([o()],f.prototype,"totalWait",void 0),t([r("totalWait",["attributes"])],f.prototype,"readTotalWait",null),t([o({json:{read:!1}})],f.prototype,"totalWaitDuration",void 0),t([o({json:{read:!1}})],f.prototype,"version",void 0),f=T=t([n("esri.layers.support.RouteInfo")],f);const y=f;export{y as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../PopupTemplate.js";import{symbolTypes as i}from"../../symbols.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{isSome as a,unwrap as l}from"../../core/maybe.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{reader as r}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../geometry/Polyline.js";import{getTimezoneOffset as p,getPrefixedProperties as m}from"../route/utils.js";import d from"./RouteSettings.js";import{fromJSON as b}from"../../symbols/support/jsonUtils.js";var T;let f=T=class extends s{constructor(t){super(t),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.version="1.0.0"}readEndTime(t,e){return a(e.attributes.EndTimeUTC)?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(t,e){return p(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(t,e){return a(e.attributes.StartTimeUTC)?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(t,e){return p(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(t,e){return m(e.attributes,"Total_")}readTotalViolations(t,e){return m(e.attributes,"TotalViolation_")}readTotalWait(t,e){return m(e.attributes,"TotalWait_")}static fromPortalJSON(t){var i,s,l,o,r,n;return new T({analysisSettings:a(t.attributes.AnalysisSettings)?d.fromJSON(JSON.parse(t.attributes.AnalysisSettings)):null,endTime:a(t.attributes.EndTime)?new Date(t.attributes.EndTime):null,endTimeOffset:null!=(i=t.attributes.EndUTCOffset)?i:null,geometry:u.fromJSON(t.geometry),messages:a(t.attributes.Messages)?JSON.parse(t.attributes.Messages):null,name:t.attributes.RouteName,objectId:t.attributes.__OBJECTID,popupTemplate:a(t.popupInfo)?e.fromJSON(t.popupInfo):null,startTime:a(t.attributes.StartTime)?new Date(t.attributes.StartTime):null,startTimeOffset:null!=(s=t.attributes.StartUTCOffset)?s:null,symbol:a(t.symbol)?b(t.symbol):null,totalCosts:a(t.attributes.TotalCosts)?JSON.parse(t.attributes.TotalCosts):null,totalDistance:null!=(l=t.attributes.TotalMeters)?l:null,totalDuration:null!=(o=t.attributes.TotalMinutes)?o:null,totalLateDuration:null!=(r=t.attributes.TotalLateMinutes)?r:null,totalWaitDuration:null!=(n=t.attributes.TotalWaitMinutes)?n:null,version:t.attributes.Version})}toPortalJSON(){return{geometry:a(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:l(this.objectId),AnalysisSettings:a(this.analysisSettings)?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:a(this.endTime)?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:a(this.messages)?JSON.stringify(this.messages):null,RouteName:l(this.name),StartTime:a(this.startTime)?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:a(this.totalCosts)?JSON.stringify(this.totalCosts):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:l(this.version)},symbol:a(this.symbol)?this.symbol.toJSON():null,popupInfo:a(this.popupTemplate)?this.popupTemplate.toJSON():null}}};f.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],f.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"SolverSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([o({json:{read:!1}})],f.prototype,"analysisSettings",void 0),t([o()],f.prototype,"endTime",void 0),t([r("endTime",["attributes.EndTimeUTC"])],f.prototype,"readEndTime",null),t([o()],f.prototype,"endTimeOffset",void 0),t([r("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],f.prototype,"readEndTimeOffset",null),t([o({json:{read:{source:"attributes.FirstStopID"}}})],f.prototype,"firstStopId",void 0),t([o({type:u})],f.prototype,"geometry",void 0),t([o({json:{read:{source:"attributes.LastStopID"}}})],f.prototype,"lastStopId",void 0),t([o({json:{read:!1}})],f.prototype,"messages",void 0),t([o({json:{read:{source:"attributes.Name"}}})],f.prototype,"name",void 0),t([o({json:{read:{source:"attributes.ObjectID"}}})],f.prototype,"objectId",void 0),t([o({type:e,json:{read:!1}})],f.prototype,"popupTemplate",void 0),t([o()],f.prototype,"startTime",void 0),t([r("startTime",["attributes.StartTimeUTC"])],f.prototype,"readStartTime",null),t([o()],f.prototype,"startTimeOffset",void 0),t([r("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],f.prototype,"readStartTimeOffset",null),t([o({json:{read:{source:"attributes.StopCount"}}})],f.prototype,"stopCount",void 0),t([o({types:i,json:{read:!1}})],f.prototype,"symbol",void 0),t([o()],f.prototype,"totalCosts",void 0),t([r("totalCosts",["attributes"])],f.prototype,"readTotalCosts",null),t([o({json:{read:!1}})],f.prototype,"totalDistance",void 0),t([o({json:{read:!1}})],f.prototype,"totalDuration",void 0),t([o({json:{read:!1}})],f.prototype,"totalLateDuration",void 0),t([o()],f.prototype,"totalViolations",void 0),t([r("totalViolations",["attributes"])],f.prototype,"readTotalViolations",null),t([o()],f.prototype,"totalWait",void 0),t([r("totalWait",["attributes"])],f.prototype,"readTotalWait",null),t([o({json:{read:!1}})],f.prototype,"totalWaitDuration",void 0),t([o({json:{read:!1}})],f.prototype,"version",void 0),f=T=t([n("esri.rest.support.RouteInfo")],f);const y=f;export{y as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import supportRouteSolveResult = __esri.supportRouteSolveResult;
4
+ export default supportRouteSolveResult;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- const c="20220130",a="50879897ca0956c8c8eea000b72a8bd5019b9984";export{c as buildDate,a as commitHash};
5
+ const b="20220131",c="28cd6b6a22e238ddb4c2410b0b640a61ffb269ac";export{b as buildDate,c as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import s from"../../../core/Collection.js";import{isSome as t,unwrap as r}from"../../../core/maybe.js";import{watch as h}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/set.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as a}from"./LayerView2D.js";import n from"./graphics/GraphicContainer.js";import c from"./graphics/GraphicsView2D.js";import p from"../../layers/LayerView.js";const l=["routeInfo","directionLines","directionPoints","polygonBarriers","polylineBarriers","pointBarriers","stops"],g=Object.freeze({remove(){},pause(){},resume(){}});let d=class extends(a(p)){constructor(){super(...arguments),this._graphicsViews=new Map,this._highlightIds=new Map}attach(){for(const i of l)this.handles.add(h((()=>t(this.layer[i])?"routeInfo"===i?[r(this.layer[i])]:r(this.layer[i]).items:null),(e=>this._createGraphicsView(i,e)),{initial:!0}),i)}detach(){this._destroyGraphicsViews()}highlight(i){let t;return"number"==typeof i?t=[i]:i instanceof e?t=[i.uid]:Array.isArray(i)&&i.length>0?t="number"==typeof i[0]?i:i.map((i=>i&&i.uid)):s.isCollection(i)&&(t=i.map((i=>i&&i.uid)).toArray()),t=t.filter((i=>null!=i)),t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):g}async hitTest(i,e){if(this.suspended||!this._graphicsViews.size)return Promise.resolve(null);const s=Array.from(this._graphicsViews.values()).reverse().map((e=>e.hitTest(i))).flat().filter((i=>!!i));for(const t of s)t.layer=this.layer,t.sourceLayer=this.layer;return s}moveStart(){}moveEnd(){}update(i){for(const e of this._graphicsViews.values())e.processUpdate(i)}viewChange(){for(const i of this._graphicsViews.values())i.viewChange()}isUpdating(){for(const i of this._graphicsViews.values())if(i.updating)return!0;return!1}_createGraphicsView(i,r){this._destroyGraphicsView(i);const o=this.view,a=()=>this.requestUpdate(),p=new s(t(r)?r.map((i=>{const{attributes:s,geometry:t,symbol:r,popupInfo:h}=i.toPortalJSON();return e.fromJSON({attributes:s,geometry:t,symbol:r,popupTemplate:h})})):[]),g=new n(o.featuresTilingScheme),d=new c({container:g,graphics:p,requestUpdateCallback:a,view:o});this._graphicsViews.set(i,d),this.container.addChildAt(g,l.indexOf(i)),this._updateHighlight(),this.handles.add([h((()=>d.updating),(()=>this.notifyChange("updating")),{initial:!0})],`updating-${i}`)}_destroyGraphicsView(i){if(!this._graphicsViews.has(i))return;const e=this._graphicsViews.get(i);this.container.removeChild(e.container),e.destroy(),this.handles.remove(`updating-${i}`),this._graphicsViews.delete(i)}_destroyGraphicsViews(){this.container.removeAllChildren();for(const[i,e]of this._graphicsViews.entries())this.handles.remove(i),e.destroy();this._graphicsViews.clear()}_addHighlight(i){for(const e of i)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e);this._highlightIds.set(e,i+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_removeHighlight(i){for(const e of i)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e)-1;0===i?this._highlightIds.delete(e):this._highlightIds.set(e,i)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys());for(const e of this._graphicsViews.values())e.setHighlight(i)}};d=i([o("esri.views.2d.layers.RouteLayerView2D")],d);const m=d;export{m as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../Graphic.js";import i from"../../../core/Collection.js";import{isSome as t,unwrap as r}from"../../../core/maybe.js";import{watch as h,initial as o}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/set.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as n}from"./LayerView2D.js";import c from"./graphics/GraphicContainer.js";import p from"./graphics/GraphicsView2D.js";import l from"../../layers/LayerView.js";const g=["routeInfo","directionLines","directionPoints","polygonBarriers","polylineBarriers","pointBarriers","stops"],d=Object.freeze({remove(){},pause(){},resume(){}});let m=class extends(n(l)){constructor(){super(...arguments),this._graphicsViews=new Map,this._highlightIds=new Map}attach(){for(const e of g)this.handles.add(h((()=>t(this.layer[e])?"routeInfo"===e?[r(this.layer[e])]:r(this.layer[e]).toArray():null),(s=>this._createGraphicsView(e,s)),o),e)}detach(){this._destroyGraphicsViews()}highlight(e){let t;return"number"==typeof e?t=[e]:e instanceof s?t=[e.uid]:Array.isArray(e)&&e.length>0?t="number"==typeof e[0]?e:e.map((e=>e&&e.uid)):i.isCollection(e)&&(t=e.map((e=>e&&e.uid)).toArray()),t=t.filter((e=>null!=e)),t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):d}async hitTest(e,s){if(this.suspended||!this._graphicsViews.size)return Promise.resolve(null);const i=Array.from(this._graphicsViews.values()).reverse().map((s=>s.hitTest(e))).flat().filter((e=>!!e));for(const t of i)t.layer=this.layer,t.sourceLayer=this.layer;return i}moveStart(){}moveEnd(){}update(e){for(const s of this._graphicsViews.values())s.processUpdate(e)}viewChange(){for(const e of this._graphicsViews.values())e.viewChange()}isUpdating(){for(const e of this._graphicsViews.values())if(e.updating)return!0;return!1}_createGraphicsView(e,r){this._destroyGraphicsView(e);const a=this.view,n=()=>this.requestUpdate(),l=new i(t(r)?r.map((e=>{const{attributes:i,geometry:t,symbol:r,popupInfo:h}=e.toPortalJSON();return s.fromJSON({attributes:i,geometry:t,symbol:r,popupTemplate:h})})):[]),d=new c(a.featuresTilingScheme),m=new p({container:d,graphics:l,requestUpdateCallback:n,view:a});this._graphicsViews.set(e,m),this.container.addChildAt(d,g.indexOf(e)),this._updateHighlight(),this.handles.add([h((()=>m.updating),(()=>this.notifyChange("updating")),o)],`updating-${e}`)}_destroyGraphicsView(e){if(!this._graphicsViews.has(e))return;const s=this._graphicsViews.get(e);this.container.removeChild(s.container),s.destroy(),this.handles.remove(`updating-${e}`),this._graphicsViews.delete(e)}_destroyGraphicsViews(){this.container.removeAllChildren();for(const[e,s]of this._graphicsViews.entries())this.handles.remove(e),s.destroy();this._graphicsViews.clear()}_addHighlight(e){for(const s of e)if(this._highlightIds.has(s)){const e=this._highlightIds.get(s);this._highlightIds.set(s,e+1)}else this._highlightIds.set(s,1);this._updateHighlight()}_removeHighlight(e){for(const s of e)if(this._highlightIds.has(s)){const e=this._highlightIds.get(s)-1;0===e?this._highlightIds.delete(s):this._highlightIds.set(s,e)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys());for(const s of this._graphicsViews.values())s.setHighlight(e)}};m=e([a("esri.views.2d.layers.RouteLayerView2D")],m);const u=m;export{u 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.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Handles.js";import{lerp as t,smoothstep as i}from"../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a,destroyMaybe as r,isSome as h,isNone as n,unwrapOr as o}from"../../../core/maybe.js";import{on as d}from"../../../core/watchUtils.js";import{a as _}from"../../../chunks/mat4.js";import{c as m}from"../../../chunks/mat4f64.js";import{s as c}from"../../../chunks/vec2.js";import{a as u}from"../../../chunks/vec2f64.js";import{s as l,l as p,g as f}from"../../../chunks/vec3.js";import{c as v}from"../../../chunks/vec3f64.js";import{c as g,f as b}from"../../../chunks/vec4f64.js";import{earth as T}from"../../../geometry/support/Ellipsoid.js";import{rayLeighScaleHeight as w,atmosphereHeight as R,betaRayleigh as H,betaOzone as j,betaMie as x,innerAtmosphereDepth as q,computeInnerAltitudeFade as E}from"./atmosphereUtils.js";import{ChapmanAtmosphereTechniqueConfiguration as U,ChapmanAtmosphereTechnique as z}from"./ChapmanAtmosphereTechnique.js";import{Pos2Tex as B}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as P}from"../../webgl/enums.js";class y{constructor(e){this._view=e,this.type="realistic",this.canRender=!0,this._cameraPosition=v(),this._projectionInverse=m(),this._viewInverse=m(),this._heightParameters=g(),this._betasRayleigh=v(),this._betasCombined=v(),this._scaleHeight=0,this._radii=u(),this._nearFar=u(),this._cameraHeight=0,this._cameraHeightSq=0,this._cAtmosphere=0,this._innerFadeDistance=0,this._altitudeFade=0,this._lowerElevationBoundRadius=0,this._lowerBoundEarthRadius=T.radius,this._hazeStrength=1,this._darkenHaze=!1,this._updateRadius(T.radius)}destroy(){this._atmosphereTechnique=s(this._atmosphereTechnique),this._atmosphereHazeTechnique=s(this._atmosphereHazeTechnique),this._vao=a(this._vao),this._handles=r(this._handles)}when(){return Promise.resolve()}initializeRenderContext(t){const i=t.renderContext.rctx;this._handles=new e,h(this._view.basemapTerrain.rootTiles)&&this._updateElevation({spatialReference:this._view.basemapTerrain.spatialReference,tile:this._view.basemapTerrain.rootTiles[0],extent:this._view.basemapTerrain.rootTiles[0].extent,context:"ground"}),this._handles.add(d(this._view,"basemapTerrain","elevation-change",(e=>this._updateElevation(e)),(()=>this._updateElevation()))),this._handles.add(d(this._view,"basemapTerrain","elevation-bounds-change",(()=>this._updateVisibleElevationBounds())));const s=new U;s.haze=!1,this._atmosphereTechnique=t.shaderTechniqueRep.acquire(z,s),s.haze=!0,this._atmosphereHazeTechnique=t.shaderTechniqueRep.acquire(z,s),this._vao=F(i,B),this._scaleHeight=w*R,l(this._betasRayleigh,H[0],H[1],H[2]),l(this._betasCombined,H[0]+j[0],H[1]+j[1],H[2]+j[2])}render(e){this._render(e,this._atmosphereTechnique,e.offscreenRenderingHelper.depthTexture)}renderHaze(e,t){this._darkenHaze=t,this._render(e,this._atmosphereHazeTechnique,e.offscreenRenderingHelper.linearDepthTexture)}_render(e,t,i){this._update(e.camera);const s=e.rctx,a=e.offscreenRenderingHelper;s.useProgram(t.program),t.bindPipelineState(s),a.renderDepthDetached((()=>{t.program.bindTexture(i,"depthTex"),this._renderCommon(t.program,e)}))}_renderCommon(e,t){if(n(this._vao))return;const i=t.rctx;t.scenelightingData.setLightDirectionUniform(e),e.setUniform4fv("heightParameters",this._heightParameters),e.setUniform3fv("cameraPosition",this._cameraPosition),e.setUniformMatrix4fv("inverseProjectionMatrix",this._projectionInverse),e.setUniformMatrix4fv("inverseViewMatrix",this._viewInverse),e.setUniform2fv("nearFar",this._nearFar),e.setUniform2fv("radii",this._radii),e.setUniform1f("scaleHeight",this._scaleHeight),e.setUniform1f("betaMie",x),e.setUniform3fv("betaRayleigh",this._betasRayleigh),e.setUniform3fv("betaCombined",this._betasCombined),e.setUniform1f("innerFadeDistance",this._innerFadeDistance),e.setUniform1f("altitudeFade",this._altitudeFade),e.setUniform1f("hazeStrength",this._hazeStrength),i.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),i.drawArrays(P.TRIANGLE_STRIP,0,4)}_adjustRadiusForTesselation(e){return e*Math.cos(Math.PI/16/16)}_updateElevation(e){const t=e?e.tile:o(this._view.basemapTerrain.rootTiles,[null])[0];if(n(t)||0!==t.level)return;const i=this._adjustRadiusForTesselation(T.radius+t.elevationBounds[0]);i!==this._lowerElevationBoundRadius&&(this._lowerElevationBoundRadius=i,this._lowerBoundEarthRadius=-1,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=this._adjustRadiusForTesselation(T.radius+this._view.basemapTerrain.elevationBounds.min);(this._lowerBoundEarthRadius<0||e<this._lowerBoundEarthRadius)&&this._updateRadius(e)}_updateRadius(e){this._lowerBoundEarthRadius=e,c(this._radii,e,e+R),this._innerFadeDistance=2*Math.sqrt((2*e-q)*q)}_update(e){if(n(e))return;this._cameraHeight=p(e.eye),this._cameraHeightSq=this._cameraHeight*this._cameraHeight,this._cAtmosphere=this._cameraHeightSq-this._radii[1]*this._radii[1];const s=Math.min(1,Math.max(0,(this._cameraHeight-this._radii[0])/R));this._heightParameters=b(this._cameraHeight,this._cameraHeightSq,this._cAtmosphere,s),f(this._cameraPosition,e.eye),_(this._projectionInverse,e.projectionMatrix),_(this._viewInverse,e.viewMatrix),c(this._nearFar,e.near,e.far),this._altitudeFade=E(this._cameraHeight-this._lowerBoundEarthRadius),this._hazeStrength=this._darkenHaze?t(.6,1,i(9500,10500,this._cameraHeight-T.radius)):1}static isSupported(e){return e.renderContext.rctx.capabilities.depthTexture}}export{y as ChapmanAtmosphere};
5
+ import e from"../../../core/Handles.js";import{lerp as t,smoothstep as i}from"../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a,destroyMaybe as r,isSome as h,isNone as n,unwrapOr as o}from"../../../core/maybe.js";import{on as _}from"../../../core/watchUtils.js";import{a as d}from"../../../chunks/mat4.js";import{c as m}from"../../../chunks/mat4f64.js";import{s as c}from"../../../chunks/vec2.js";import{a as u}from"../../../chunks/vec2f64.js";import{s as l,l as p,g as f}from"../../../chunks/vec3.js";import{c as v}from"../../../chunks/vec3f64.js";import{c as g,f as b}from"../../../chunks/vec4f64.js";import{earth as T}from"../../../geometry/support/Ellipsoid.js";import{rayLeighScaleHeight as w,atmosphereHeight as R,betaRayleigh as H,betaOzone as j,betaMie as x,innerAtmosphereDepth as q,computeInnerAltitudeFade as E}from"./atmosphereUtils.js";import{ChapmanAtmosphereTechniqueConfiguration as U,ChapmanAtmosphereTechnique as z}from"./ChapmanAtmosphereTechnique.js";import{Pos2Tex as B}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as y}from"../../webgl/enums.js";class M{constructor(e){this._view=e,this.type="realistic",this.canRender=!0,this._cameraPosition=v(),this._projectionInverse=m(),this._viewInverse=m(),this._heightParameters=g(),this._betasRayleigh=v(),this._betasCombined=v(),this._scaleHeight=0,this._radii=u(),this._nearFar=u(),this._cameraHeight=0,this._cameraHeightSq=0,this._cAtmosphere=0,this._innerFadeDistance=0,this._altitudeFade=0,this._lowerElevationBoundRadius=0,this._lowerBoundEarthRadius=T.radius,this._hazeStrength=1,this._darkenHaze=!1,this._updateRadius(T.radius)}destroy(){this._atmosphereTechnique=s(this._atmosphereTechnique),this._atmosphereHazeTechnique=s(this._atmosphereHazeTechnique),this._vao=a(this._vao),this._handles=r(this._handles)}when(){return Promise.resolve()}initializeRenderContext(t){const i=t.renderContext.rctx;this._handles=new e,h(this._view.basemapTerrain.rootTiles)&&this._updateElevation({spatialReference:this._view.basemapTerrain.spatialReference,tile:this._view.basemapTerrain.rootTiles[0],extent:this._view.basemapTerrain.rootTiles[0].extent,context:"ground"}),this._handles.add(_(this._view,"basemapTerrain","elevation-change",(e=>this._updateElevation(e)),(()=>this._updateElevation()))),this._handles.add(_(this._view,"basemapTerrain","elevation-bounds-change",(()=>this._updateVisibleElevationBounds())));const s=new U;s.haze=!1,this._atmosphereTechnique=t.shaderTechniqueRep.acquire(z,s),s.haze=!0,this._atmosphereHazeTechnique=t.shaderTechniqueRep.acquire(z,s),this._vao=F(i,B),this._scaleHeight=w*R,l(this._betasRayleigh,H[0],H[1],H[2]),l(this._betasCombined,H[0]+j[0],H[1]+j[1],H[2]+j[2])}render(e){this._render(e,this._atmosphereTechnique,e.offscreenRenderingHelper.depthTexture)}renderHaze(e,t){this._darkenHaze=t,this._render(e,this._atmosphereHazeTechnique,e.offscreenRenderingHelper.linearDepthTexture)}_render(e,t,i){this._update(e.camera);const s=e.rctx.useTechnique(t);e.offscreenRenderingHelper.renderDepthDetached((()=>{s.bindTexture(i,"depthTex"),this._renderCommon(t.program,e)}))}_renderCommon(e,t){if(n(this._vao))return;const i=t.rctx;t.scenelightingData.setLightDirectionUniform(e),e.setUniform4fv("heightParameters",this._heightParameters),e.setUniform3fv("cameraPosition",this._cameraPosition),e.setUniformMatrix4fv("inverseProjectionMatrix",this._projectionInverse),e.setUniformMatrix4fv("inverseViewMatrix",this._viewInverse),e.setUniform2fv("nearFar",this._nearFar),e.setUniform2fv("radii",this._radii),e.setUniform1f("scaleHeight",this._scaleHeight),e.setUniform1f("betaMie",x),e.setUniform3fv("betaRayleigh",this._betasRayleigh),e.setUniform3fv("betaCombined",this._betasCombined),e.setUniform1f("innerFadeDistance",this._innerFadeDistance),e.setUniform1f("altitudeFade",this._altitudeFade),e.setUniform1f("hazeStrength",this._hazeStrength),i.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),i.drawArrays(y.TRIANGLE_STRIP,0,4)}_adjustRadiusForTesselation(e){return e*Math.cos(Math.PI/16/16)}_updateElevation(e){const t=e?e.tile:o(this._view.basemapTerrain.rootTiles,[null])[0];if(n(t)||0!==t.level)return;const i=this._adjustRadiusForTesselation(T.radius+t.elevationBounds[0]);i!==this._lowerElevationBoundRadius&&(this._lowerElevationBoundRadius=i,this._lowerBoundEarthRadius=-1,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=this._adjustRadiusForTesselation(T.radius+this._view.basemapTerrain.elevationBounds.min);(this._lowerBoundEarthRadius<0||e<this._lowerBoundEarthRadius)&&this._updateRadius(e)}_updateRadius(e){this._lowerBoundEarthRadius=e,c(this._radii,e,e+R),this._innerFadeDistance=2*Math.sqrt((2*e-q)*q)}_update(e){if(n(e))return;this._cameraHeight=p(e.eye),this._cameraHeightSq=this._cameraHeight*this._cameraHeight,this._cAtmosphere=this._cameraHeightSq-this._radii[1]*this._radii[1];const s=Math.min(1,Math.max(0,(this._cameraHeight-this._radii[0])/R));this._heightParameters=b(this._cameraHeight,this._cameraHeightSq,this._cAtmosphere,s),f(this._cameraPosition,e.eye),d(this._projectionInverse,e.projectionMatrix),d(this._viewInverse,e.viewMatrix),c(this._nearFar,e.near,e.far),this._altitudeFade=E(this._cameraHeight-this._lowerBoundEarthRadius),this._hazeStrength=this._darkenHaze?t(.6,1,i(9500,10500,this._cameraHeight-T.radius)):1}static isSupported(e){return e.renderContext.rctx.capabilities.depthTexture}}export{M as ChapmanAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as a}from"../../../core/mathUtils.js";import{releaseMaybe as t,disposeMaybe as e,isNone as r}from"../../../core/maybe.js";import{a as s,e as i}from"../../../chunks/mat4.js";import{c as o}from"../../../chunks/mat4f64.js";import{y as n,g as h,n as m,a as p,l as _,f as c}from"../../../chunks/vec3.js";import{c as f,f as d}from"../../../chunks/vec3f64.js";import{create as l,fromPoints as I,axis as u}from"../../../geometry/support/axisAngle.js";import{CloudsCompositionTechnique as F}from"./CloudsCompositionTechnique.js";import{weatherHeightLimit as g}from"./weather.js";import{createQuadVAO as H}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as x}from"../../webgl/enums.js";class O{constructor(a,t,e,r){this._viewingMode=t,this._inverseProjectionMatrix=o(),this._inverseViewMatrix=o(),this._technique=new F({rctx:a,viewingMode:this._viewingMode},null),this._vao=H(a),this._setDefaultParallax(e,r)}destroy(){this._technique=t(this._technique),this._vao=e(this._vao)}render(a,t,e){this._parameters.clouds=t;const i=a.camera;if(r(this._vao)||r(i))return;const o=a.rctx,n=this._technique.program;o.useProgram(n),this._technique.bindPipelineState(o),a.scenelightingData.setLightDirectionUniform(n),a.scenelightingData.setUniforms(n),s(this._inverseProjectionMatrix,i.projectionMatrix),s(this._inverseViewMatrix,i.viewMatrix),n.setUniformMatrix4fv("inverseProjectionMatrix",this._inverseProjectionMatrix),n.setUniformMatrix4fv("inverseViewMatrix",this._inverseViewMatrix),n.setUniform2f("cloudVariables",this._parameters.clouds.coverage,this._parameters.clouds.absorption),this._setParallaxParams(i.eye,e),a.cloudsCompositionParams=this._parameters,S(n,a.camera,this._parameters),o.bindVAO(this._vao),n.assertCompatibleVertexAttributeLocations(this._vao),o.drawArrays(x.TRIANGLE_STRIP,0,4)}get isFading(){return this._parameters.crossFade.stage!==N.FINISHED||this._parameters.fadeInOut.stage!==D.FINISHED||this._parameters.fadeIn.stage!==E.FINISHED||this._parameters.fadeInOutHeight.stage!==C.FINISHED}_setDefaultParallax(a,t){this._parameters={parallax:{anchorPointClouds:f(),radius:a,cloudsHeight:1e5,radiusCurvatureCorrectionFactor:0,transform:o()},parallaxNew:{anchorPointClouds:f(),radius:a,cloudsHeight:1e5,radiusCurvatureCorrectionFactor:0,transform:o()},crossFade:{stage:N.FINISHED,factor:0,distanceThresholdFactor:.3},fadeInOut:{stage:D.FINISHED,factor:0,distanceThresholdFactor:.6},fadeIn:{stage:E.FINISHED,factor:0,distanceThresholdFactor:2},fadeInOutHeight:{stage:C.FINISHED,factor:t>g?1:0},cameraPositionLastFrame:f(),startTime:0,startTimeHeightFade:0,clouds:null}}_isCameraPositionFinal(a){return n(this._parameters.cameraPositionLastFrame,a)}_setFadeInStage(a){const t=this._isCameraPositionFinal(a);this._parameters.fadeIn.stage===E.FINISHED&&(this._parameters.fadeIn.factor=1,h(this._parameters.parallax.anchorPointClouds,T),this._parameters.fadeIn.stage=E.CHANGE_ANCHOR,this._parameters.crossFade.stage=N.FINISHED,this._parameters.fadeInOut.stage=D.FINISHED),this._parameters.fadeIn.stage===E.CHANGE_ANCHOR&&t&&(h(this._parameters.parallax.anchorPointClouds,T),this._parameters.fadeIn.stage=E.FADE_IN,this._parameters.startTime=performance.now()),this._parameters.fadeIn.factor>0&&this._parameters.fadeIn.stage===E.FADE_IN&&(this._parameters.fadeIn.factor=1-(performance.now()-this._parameters.startTime)/500),this._parameters.fadeIn.factor<=0&&this._parameters.fadeIn.stage===E.FADE_IN&&(this._parameters.fadeIn.stage=E.FINISHED,this._parameters.fadeIn.factor=0)}_setCrossFadingStage(){this._parameters.crossFade.stage===N.FINISHED&&(h(this._parameters.parallaxNew.anchorPointClouds,T),this._parameters.startTime=performance.now(),this._parameters.crossFade.factor=0,this._parameters.crossFade.stage=N.CROSS_FADE),this._parameters.crossFade.factor<1&&this._parameters.crossFade.stage===N.CROSS_FADE&&(this._parameters.crossFade.factor=(performance.now()-this._parameters.startTime)/500),this._parameters.crossFade.factor>=1&&this._parameters.crossFade.stage===N.CROSS_FADE&&(this._parameters.crossFade.stage=N.FINISHED,this._parameters.crossFade.factor=1,h(this._parameters.parallax.anchorPointClouds,this._parameters.parallaxNew.anchorPointClouds))}_setFadeInOutStage(a){this._parameters.fadeInOut.stage===D.FINISHED&&(this._parameters.startTime=performance.now(),this._parameters.fadeInOut.factor=0,this._parameters.fadeInOut.stage=D.FADE_OUT),this._parameters.fadeInOut.factor<1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&(this._parameters.fadeInOut.factor=(performance.now()-this._parameters.startTime)/250),this._parameters.fadeInOut.factor>=1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&(this._parameters.fadeInOut.factor=1,h(this._parameters.parallax.anchorPointClouds,T)),this._parameters.fadeInOut.factor>=1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&this._isCameraPositionFinal(a)&&(this._parameters.startTime=performance.now(),this._parameters.fadeInOut.factor=1,this._parameters.fadeInOut.stage=D.FADE_IN,this._parameters.crossFade.stage=N.FINISHED,this._parameters.crossFade.factor=0),this._parameters.fadeInOut.factor>0&&this._parameters.fadeInOut.stage===D.FADE_IN&&(this._parameters.fadeInOut.factor=1-(performance.now()-this._parameters.startTime)/500),this._parameters.fadeInOut.factor<=0&&this._parameters.fadeInOut.stage===D.FADE_IN&&(this._parameters.fadeInOut.stage=D.FINISHED,this._parameters.fadeInOut.factor=0)}_setFadeInOutHeight(t){const e=performance.now();this._parameters.startTimeHeightFade=this._parameters.fadeInOutHeight.stage===C.FINISHED?e:this._parameters.startTimeHeightFade,t?this._parameters.fadeInOutHeight.factor+=(e-this._parameters.startTimeHeightFade)/500:this._parameters.fadeInOutHeight.factor-=(e-this._parameters.startTimeHeightFade)/500,this._parameters.startTimeHeightFade=e,this._parameters.fadeInOutHeight.factor=a(this._parameters.fadeInOutHeight.factor,0,1),this._parameters.fadeInOutHeight.stage=C.HEIGHT_FADE}_setParallaxParams(a,t){m(T,a),p(T,T,this._parameters.parallax.radius),0===this._parameters.parallax.anchorPointClouds[0]&&0===this._parameters.parallax.anchorPointClouds[1]&&0===this._parameters.parallax.anchorPointClouds[2]&&h(this._parameters.parallax.anchorPointClouds,T);const e=_(c(v,this._parameters.parallax.anchorPointClouds,T));let r=!0;e>this._parameters.fadeIn.distanceThresholdFactor*this._parameters.parallax.cloudsHeight||this._parameters.fadeIn.stage!==E.FINISHED?this._setFadeInStage(a):e>this._parameters.fadeInOut.distanceThresholdFactor*this._parameters.parallax.cloudsHeight||this._parameters.fadeInOut.stage!==D.FINISHED?this._setFadeInOutStage(a):e>this._parameters.crossFade.distanceThresholdFactor*this._parameters.parallax.cloudsHeight&&!t||this._parameters.crossFade.stage!==N.FINISHED?this._setCrossFadingStage():r=!1;const s=_(a),n=s-this._parameters.parallax.radius;(n>1.7*g||n<-g)&&this._parameters.fadeInOutHeight.factor<1?this._parameters.fadeInOutHeight.factor=1:(n>g||n<-.35*g)&&this._parameters.fadeInOutHeight.factor<1?this._setFadeInOutHeight(!0):n<g&&n>-.35*g&&this._parameters.fadeInOutHeight.factor>0?this._setFadeInOutHeight(!1):this._parameters.fadeInOutHeight.stage=C.FINISHED,this._parameters.parallax.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(s*s-this._parameters.parallax.radius*this._parameters.parallax.radius,0))/s,I(P,this._parameters.parallax.anchorPointClouds,A),this._parameters.parallax.transform=o(),i(this._parameters.parallax.transform,this._parameters.parallax.transform,A[3],u(A)),r&&(I(P,this._parameters.parallaxNew.anchorPointClouds,A),this._parameters.parallaxNew.transform=o(),i(this._parameters.parallaxNew.transform,this._parameters.parallaxNew.transform,A[3],u(A))),h(this._parameters.cameraPositionLastFrame,a)}}var E,D,N,C;function S(t,e,r){t.bindTexture(r.clouds.cubeMap.colorTexture,"cubeMap"),t.setUniform1f("cloudsHeight",r.parallax.cloudsHeight),t.setUniformMatrix4fv("rotationMatrixClouds",r.parallax.transform),t.setUniformMatrix4fv("rotationMatrixCloudsCrossFade",r.parallaxNew.transform),t.setUniform3fv("anchorPosition",r.parallax.anchorPointClouds),t.setUniform3fv("anchorPositionCrossFade",r.parallaxNew.anchorPointClouds),r.fadeInOut.stage!==D.FINISHED?t.setUniform1f("totalFadeInOut",r.fadeInOutHeight.factor+Math.max(a(r.fadeInOut.factor,0,1))):t.setUniform1f("totalFadeInOut",r.fadeInOutHeight.factor+Math.max(a(r.fadeIn.factor,0,1))),t.setUniform1f("radiusCurvatureCorrectionFactor",r.parallax.radiusCurvatureCorrectionFactor),t.setUniform1i("crossFade",r.crossFade.stage),t.setUniform1f("crossFadeAnchorFactor",a(r.crossFade.factor,0,1)),t.setUniform1f("radius",r.parallax.radius),t.setUniform3fv("cameraPosition",e.eye)}!function(a){a[a.FINISHED=0]="FINISHED",a[a.CHANGE_ANCHOR=1]="CHANGE_ANCHOR",a[a.FADE_IN=2]="FADE_IN"}(E||(E={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.FADE_OUT=1]="FADE_OUT",a[a.FADE_IN=2]="FADE_IN"}(D||(D={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.CROSS_FADE=1]="CROSS_FADE"}(N||(N={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.HEIGHT_FADE=1]="HEIGHT_FADE"}(C||(C={}));const P=d(0,0,1),A=l(),T=f(),v=f();export{O as CloudsComposition,S as bindCloudsComposition};
5
+ import{clamp as a}from"../../../core/mathUtils.js";import{releaseMaybe as t,disposeMaybe as e,isNone as r}from"../../../core/maybe.js";import{a as s,e as i}from"../../../chunks/mat4.js";import{c as o}from"../../../chunks/mat4f64.js";import{y as n,g as h,n as m,a as p,l as c,f as _}from"../../../chunks/vec3.js";import{c as f,f as d}from"../../../chunks/vec3f64.js";import{create as l,fromPoints as I,axis as u}from"../../../geometry/support/axisAngle.js";import{CloudsCompositionTechnique as F}from"./CloudsCompositionTechnique.js";import{weatherHeightLimit as g}from"./weather.js";import{createQuadVAO as H}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as x}from"../../webgl/enums.js";class O{constructor(a,t,e,r){this._viewingMode=t,this._inverseProjectionMatrix=o(),this._inverseViewMatrix=o(),this._technique=new F({rctx:a,viewingMode:this._viewingMode},null),this._vao=H(a),this._setDefaultParallax(e,r)}destroy(){this._technique=t(this._technique),this._vao=e(this._vao)}render(a,t,e){this._parameters.clouds=t;const i=a.camera;if(r(this._vao)||r(i))return;const o=a.rctx,n=o.useTechnique(this._technique);a.scenelightingData.setLightDirectionUniform(n),a.scenelightingData.setUniforms(n),s(this._inverseProjectionMatrix,i.projectionMatrix),s(this._inverseViewMatrix,i.viewMatrix),n.setUniformMatrix4fv("inverseProjectionMatrix",this._inverseProjectionMatrix),n.setUniformMatrix4fv("inverseViewMatrix",this._inverseViewMatrix),n.setUniform2f("cloudVariables",this._parameters.clouds.coverage,this._parameters.clouds.absorption),this._setParallaxParams(i.eye,e),a.cloudsCompositionParams=this._parameters,S(n,a.camera,this._parameters),o.bindVAO(this._vao),n.assertCompatibleVertexAttributeLocations(this._vao),o.drawArrays(x.TRIANGLE_STRIP,0,4)}get isFading(){return this._parameters.crossFade.stage!==N.FINISHED||this._parameters.fadeInOut.stage!==D.FINISHED||this._parameters.fadeIn.stage!==E.FINISHED||this._parameters.fadeInOutHeight.stage!==C.FINISHED}_setDefaultParallax(a,t){this._parameters={parallax:{anchorPointClouds:f(),radius:a,cloudsHeight:1e5,radiusCurvatureCorrectionFactor:0,transform:o()},parallaxNew:{anchorPointClouds:f(),radius:a,cloudsHeight:1e5,radiusCurvatureCorrectionFactor:0,transform:o()},crossFade:{stage:N.FINISHED,factor:0,distanceThresholdFactor:.3},fadeInOut:{stage:D.FINISHED,factor:0,distanceThresholdFactor:.6},fadeIn:{stage:E.FINISHED,factor:0,distanceThresholdFactor:2},fadeInOutHeight:{stage:C.FINISHED,factor:t>g?1:0},cameraPositionLastFrame:f(),startTime:0,startTimeHeightFade:0,clouds:null}}_isCameraPositionFinal(a){return n(this._parameters.cameraPositionLastFrame,a)}_setFadeInStage(a){const t=this._isCameraPositionFinal(a);this._parameters.fadeIn.stage===E.FINISHED&&(this._parameters.fadeIn.factor=1,h(this._parameters.parallax.anchorPointClouds,T),this._parameters.fadeIn.stage=E.CHANGE_ANCHOR,this._parameters.crossFade.stage=N.FINISHED,this._parameters.fadeInOut.stage=D.FINISHED),this._parameters.fadeIn.stage===E.CHANGE_ANCHOR&&t&&(h(this._parameters.parallax.anchorPointClouds,T),this._parameters.fadeIn.stage=E.FADE_IN,this._parameters.startTime=performance.now()),this._parameters.fadeIn.factor>0&&this._parameters.fadeIn.stage===E.FADE_IN&&(this._parameters.fadeIn.factor=1-(performance.now()-this._parameters.startTime)/500),this._parameters.fadeIn.factor<=0&&this._parameters.fadeIn.stage===E.FADE_IN&&(this._parameters.fadeIn.stage=E.FINISHED,this._parameters.fadeIn.factor=0)}_setCrossFadingStage(){this._parameters.crossFade.stage===N.FINISHED&&(h(this._parameters.parallaxNew.anchorPointClouds,T),this._parameters.startTime=performance.now(),this._parameters.crossFade.factor=0,this._parameters.crossFade.stage=N.CROSS_FADE),this._parameters.crossFade.factor<1&&this._parameters.crossFade.stage===N.CROSS_FADE&&(this._parameters.crossFade.factor=(performance.now()-this._parameters.startTime)/500),this._parameters.crossFade.factor>=1&&this._parameters.crossFade.stage===N.CROSS_FADE&&(this._parameters.crossFade.stage=N.FINISHED,this._parameters.crossFade.factor=1,h(this._parameters.parallax.anchorPointClouds,this._parameters.parallaxNew.anchorPointClouds))}_setFadeInOutStage(a){this._parameters.fadeInOut.stage===D.FINISHED&&(this._parameters.startTime=performance.now(),this._parameters.fadeInOut.factor=0,this._parameters.fadeInOut.stage=D.FADE_OUT),this._parameters.fadeInOut.factor<1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&(this._parameters.fadeInOut.factor=(performance.now()-this._parameters.startTime)/250),this._parameters.fadeInOut.factor>=1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&(this._parameters.fadeInOut.factor=1,h(this._parameters.parallax.anchorPointClouds,T)),this._parameters.fadeInOut.factor>=1&&this._parameters.fadeInOut.stage===D.FADE_OUT&&this._isCameraPositionFinal(a)&&(this._parameters.startTime=performance.now(),this._parameters.fadeInOut.factor=1,this._parameters.fadeInOut.stage=D.FADE_IN,this._parameters.crossFade.stage=N.FINISHED,this._parameters.crossFade.factor=0),this._parameters.fadeInOut.factor>0&&this._parameters.fadeInOut.stage===D.FADE_IN&&(this._parameters.fadeInOut.factor=1-(performance.now()-this._parameters.startTime)/500),this._parameters.fadeInOut.factor<=0&&this._parameters.fadeInOut.stage===D.FADE_IN&&(this._parameters.fadeInOut.stage=D.FINISHED,this._parameters.fadeInOut.factor=0)}_setFadeInOutHeight(t){const e=performance.now();this._parameters.startTimeHeightFade=this._parameters.fadeInOutHeight.stage===C.FINISHED?e:this._parameters.startTimeHeightFade,t?this._parameters.fadeInOutHeight.factor+=(e-this._parameters.startTimeHeightFade)/500:this._parameters.fadeInOutHeight.factor-=(e-this._parameters.startTimeHeightFade)/500,this._parameters.startTimeHeightFade=e,this._parameters.fadeInOutHeight.factor=a(this._parameters.fadeInOutHeight.factor,0,1),this._parameters.fadeInOutHeight.stage=C.HEIGHT_FADE}_setParallaxParams(a,t){m(T,a),p(T,T,this._parameters.parallax.radius),0===this._parameters.parallax.anchorPointClouds[0]&&0===this._parameters.parallax.anchorPointClouds[1]&&0===this._parameters.parallax.anchorPointClouds[2]&&h(this._parameters.parallax.anchorPointClouds,T);const e=c(_(v,this._parameters.parallax.anchorPointClouds,T));let r=!0;e>this._parameters.fadeIn.distanceThresholdFactor*this._parameters.parallax.cloudsHeight||this._parameters.fadeIn.stage!==E.FINISHED?this._setFadeInStage(a):e>this._parameters.fadeInOut.distanceThresholdFactor*this._parameters.parallax.cloudsHeight||this._parameters.fadeInOut.stage!==D.FINISHED?this._setFadeInOutStage(a):e>this._parameters.crossFade.distanceThresholdFactor*this._parameters.parallax.cloudsHeight&&!t||this._parameters.crossFade.stage!==N.FINISHED?this._setCrossFadingStage():r=!1;const s=c(a),n=s-this._parameters.parallax.radius;(n>1.7*g||n<-g)&&this._parameters.fadeInOutHeight.factor<1?this._parameters.fadeInOutHeight.factor=1:(n>g||n<-.35*g)&&this._parameters.fadeInOutHeight.factor<1?this._setFadeInOutHeight(!0):n<g&&n>-.35*g&&this._parameters.fadeInOutHeight.factor>0?this._setFadeInOutHeight(!1):this._parameters.fadeInOutHeight.stage=C.FINISHED,this._parameters.parallax.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(s*s-this._parameters.parallax.radius*this._parameters.parallax.radius,0))/s,I(A,this._parameters.parallax.anchorPointClouds,P),this._parameters.parallax.transform=o(),i(this._parameters.parallax.transform,this._parameters.parallax.transform,P[3],u(P)),r&&(I(A,this._parameters.parallaxNew.anchorPointClouds,P),this._parameters.parallaxNew.transform=o(),i(this._parameters.parallaxNew.transform,this._parameters.parallaxNew.transform,P[3],u(P))),h(this._parameters.cameraPositionLastFrame,a)}}var E,D,N,C;function S(t,e,r){t.bindTexture(r.clouds.cubeMap.colorTexture,"cubeMap"),t.setUniform1f("cloudsHeight",r.parallax.cloudsHeight),t.setUniformMatrix4fv("rotationMatrixClouds",r.parallax.transform),t.setUniformMatrix4fv("rotationMatrixCloudsCrossFade",r.parallaxNew.transform),t.setUniform3fv("anchorPosition",r.parallax.anchorPointClouds),t.setUniform3fv("anchorPositionCrossFade",r.parallaxNew.anchorPointClouds),r.fadeInOut.stage!==D.FINISHED?t.setUniform1f("totalFadeInOut",r.fadeInOutHeight.factor+Math.max(a(r.fadeInOut.factor,0,1))):t.setUniform1f("totalFadeInOut",r.fadeInOutHeight.factor+Math.max(a(r.fadeIn.factor,0,1))),t.setUniform1f("radiusCurvatureCorrectionFactor",r.parallax.radiusCurvatureCorrectionFactor),t.setUniform1i("crossFade",r.crossFade.stage),t.setUniform1f("crossFadeAnchorFactor",a(r.crossFade.factor,0,1)),t.setUniform1f("radius",r.parallax.radius),t.setUniform3fv("cameraPosition",e.eye)}!function(a){a[a.FINISHED=0]="FINISHED",a[a.CHANGE_ANCHOR=1]="CHANGE_ANCHOR",a[a.FADE_IN=2]="FADE_IN"}(E||(E={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.FADE_OUT=1]="FADE_OUT",a[a.FADE_IN=2]="FADE_IN"}(D||(D={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.CROSS_FADE=1]="CROSS_FADE"}(N||(N={})),function(a){a[a.FINISHED=0]="FINISHED",a[a.HEIGHT_FADE=1]="HEIGHT_FADE"}(C||(C={}));const A=d(0,0,1),P=l(),T=f(),v=f();export{O as CloudsComposition,S as bindCloudsComposition};