@arcgis/core 4.27.0-next.20230519 → 4.27.0-next.20230521

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 (148) hide show
  1. package/README.md +12 -10
  2. package/WebMap.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/03bc91648286b9b75e30.js +1 -0
  5. package/assets/esri/core/workers/chunks/099cacba30fd93af8ebc.js +1 -0
  6. package/assets/esri/core/workers/chunks/16e459b16bdd6e1a821b.js +1 -0
  7. package/assets/esri/core/workers/chunks/{b5df3bafd74cbc04dfa2.js → 34ec9623a1bece86a82b.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{ceb59b3c52d644e7cde8.js → 3ce1fe5e7a841f6dc355.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{375108906a5b6b0a4857.js → a5bd457d0284419b4f34.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{cf425d255519cb8b024b.js → df6f54607ad4c6e28d1d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{bb1fc781324709eb9f95.js → ff1c005eede0cf964332.js} +1 -1
  12. package/assets/esri/images/portal/360vr16.png +0 -0
  13. package/assets/esri/themes/base/_core.scss +2 -0
  14. package/assets/esri/themes/base/widgets/_Editor.scss +1 -2
  15. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +169 -0
  16. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +29 -19
  17. package/assets/esri/themes/dark/main.css +1 -1
  18. package/assets/esri/themes/light/main.css +1 -1
  19. package/assets/esri/themes/light/view.css +1 -1
  20. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  21. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  22. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -0
  23. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -0
  24. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -0
  25. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -0
  26. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -0
  27. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -0
  28. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -0
  29. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -0
  30. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -0
  31. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -0
  32. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -0
  33. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -0
  34. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -0
  35. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -0
  36. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -0
  37. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -0
  38. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -0
  39. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -0
  40. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -0
  41. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -0
  42. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -0
  43. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -0
  44. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -0
  45. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nb.json +1 -0
  46. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -0
  47. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -0
  48. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -0
  49. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -0
  50. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -0
  51. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -0
  52. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -0
  53. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -0
  54. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -0
  55. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -0
  56. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -0
  57. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -0
  58. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -0
  59. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -0
  60. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -0
  61. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -0
  62. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -0
  63. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
  64. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
  65. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
  66. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
  67. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  68. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
  69. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
  70. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  71. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
  72. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
  73. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
  74. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  75. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
  76. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
  77. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
  78. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
  79. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
  80. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
  81. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
  82. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
  83. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  84. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
  85. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
  86. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
  87. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
  88. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
  89. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
  90. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
  91. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
  92. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
  93. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
  94. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
  95. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
  96. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
  97. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
  98. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
  99. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
  100. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
  101. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
  102. package/chunks/mat3.js +1 -1
  103. package/core/libs/gl-matrix-2/mat3.js +1 -1
  104. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  105. package/interfaces.d.ts +24 -0
  106. package/layers/OrientedImageryLayer.js +1 -1
  107. package/layers/orientedImagery/core/bestImageUtils.js +1 -1
  108. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  109. package/layers/orientedImagery/transformations/groundToImageUtils.js +1 -1
  110. package/layers/support/layerUtils.js +1 -1
  111. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  112. package/layers/support/rasterFunctions/TableFunction.js +5 -0
  113. package/layers/support/rasterFunctions/TableFunctionArguments.js +5 -0
  114. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  115. package/package.json +1 -1
  116. package/portal/PortalItem.js +1 -1
  117. package/smartMapping/support/adapters/support/layerUtils.js +1 -1
  118. package/smartMapping/symbology/color.js +1 -1
  119. package/support/revision.js +1 -1
  120. package/views/2d/FrameTask.js +1 -1
  121. package/views/2d/LabelManager.js +1 -1
  122. package/views/2d/engine/Bitmap.js +1 -1
  123. package/views/2d/engine/Stage.js +1 -1
  124. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  125. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  126. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  127. package/views/2d/engine/webgl/Painter.js +1 -1
  128. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  129. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  130. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  131. package/views/MapView.js +1 -1
  132. package/widgets/Editor/EditorViewModel.js +1 -1
  133. package/widgets/Editor/UpdateWorkflow.js +1 -1
  134. package/widgets/Editor/Workflow.js +1 -1
  135. package/widgets/Editor.js +1 -1
  136. package/widgets/Features/FeaturesVisibleElements.js +5 -0
  137. package/widgets/Features.js +1 -1
  138. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +5 -0
  139. package/widgets/OrientedImageryViewer/symbols.js +5 -0
  140. package/widgets/OrientedImageryViewer.js +5 -0
  141. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  142. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  143. package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
  144. package/widgets/UtilityNetworkTrace/support/ResultAreaHandler.js +5 -0
  145. package/widgets/UtilityNetworkTrace.js +1 -1
  146. package/assets/esri/core/workers/chunks/0e947d6d045866f909ec.js +0 -1
  147. package/assets/esri/core/workers/chunks/6b3b277a21de7c434717.js +0 -1
  148. package/assets/esri/core/workers/chunks/ba519dda35d14056693b.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import{id as i}from"../kernel.js";import r from"../core/Error.js";import{JSONSupportMixin as o}from"../core/JSONSupport.js";import{clone as s,fixJson as a}from"../core/lang.js";import n from"../core/Loadable.js";import{unwrapOrThrow as l}from"../core/maybe.js";import{isDataProtocol as p,makeAbsolute as c}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import g from"../geometry/Extent.js";import y from"./Portal.js";import w from"./PortalItemResource.js";import v from"./PortalRating.js";var f;const b=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),k=new Set(["KML","GeoJson","CSV"]);let S=f=class extends(o(n)){static from(e){return u(f,e)}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.isOrgItem=!1,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.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}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.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e?i=t.includes("Web Tool")?"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=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replaceAll(/(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.includes("configurableApp")?i="Instant App":"Insights Page"===e&&(i="Insights Report"),i}readExtent(e){return e&&e.length?new g(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 s,a=!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?(a=i.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.includes("Table"),l=i.includes("Route Layer"),p=i.includes("Markup"),c=i.includes("Spatiotemporal"),d=i.includes("UtilityNetwork"),s=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":a?"featureshosted":d?"utilitynetwork":"features"):s="map service"===e||"wms"===e||"wmts"===e?a||i.includes("Tiled")||"wmts"===e?"maptiles":"mapimages":"scene service"===e?i.includes("Line")?"sceneweblayerline":i.includes("3DObject")?"sceneweblayermultipatch":i.includes("Point")?"sceneweblayerpoint":i.includes("IntegratedMesh")?"sceneweblayermesh":i.includes("PointCloud")?"sceneweblayerpointcloud":i.includes("Polygon")?"sceneweblayerpolygon":i.includes("Building")?"sceneweblayerbuilding":i.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.includes("Elevation 3D Layer")?"elevationlayer":i.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"video service"===e?"mediaservice":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e?i.includes("Web Tool")?"tool":"layers":"geodata service"===e?"geodataservice":"layers"):s="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?i.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.includes("configurableApp")?"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.includes("ArcGIS Pro")||"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.includes("Explorer Mapping Application")||i.includes("Document")?"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":"hub project"===e?"hubproject":"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":"pro report template"===e?"proreporttemplate":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"experience builder widget"===e?"experiencebuilderwidget":"experience builder widget package"===e?"experiencebuilderwidgetpackage":"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":"notebook code snippets"===e||"notebook code snippet library"===e?"notebookcodesnippets":"suitability model"===e?"suitabilitymodel":"esri classifier definition"===e?"classifierdefinition":"esri classification schema"===e?"classificationschema":"insights data engineering workbook"===e?"dataengineeringworkbook":"insights data engineering model"===e?"dataengineeringmodel":"deep learning studio project"===e?"deeplearningproject":"discussion"===e?"discussion":"allsource project"===e?"allsourceproject":"api key"===e?"apikey":"data pipeline"===e?"datapipelines":"maps",s?t(r+s+o+".png"):null}get isLayer(){return null!=this.type&&b.has(this.type)}get itemCdnUrl(){let e=this.itemUrl;return e&&i&&!i.findCredential(e)&&(e=i._normalizeAGOLorgDomain(e),e=e.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),e=e.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),e=e.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),e}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${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: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){const t=this.portal??(this.portal=y.getDefault()),i=t.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:null!=e?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof v&&(e=e.rating),null==e||isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new v({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:s(this.applicationProxies),avgRating:this.avgRating,categories:s(this.categories),created:s(this.created),culture:this.culture,description:this.description,extent:s(this.extent),groupCategories:s(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:s(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:s(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:s(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:s(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new f({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const i of["tags","typeKeywords","categories"])e[i]=e[i]?.join(", ");const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await l(this.portal).request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return l(this.portal).request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await l(this.portal).request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new v(t)):null}fetchRelatedItems(e,t){return l(this.portal).requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},f)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return l(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((()=>l(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 r("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new r("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:i}=this;await l(t).signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},p={method:"post",query:{copyPrivateResources:"all"===o,folder:"string"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(","),title:n}},{itemId:c}=await t.request(`${i}/copy`,p);return new f({id:c,portal:t})}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)p(t)?r.query={data:t}:r.query={url:c(t)},null!=i&&(r.query.filename=i);else{const e=new FormData;null!=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 r("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:i}=await import("./support/resourceUtils.js");return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResource:r}=await import("./support/resourceUtils.js");return e.portalItem=this,r(e,"add",t,i)}async removeResource(e,t){const{removeResource:i}=await import("./support/resourceUtils.js");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new r("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await import("./support/resourceUtils.js");return t(this,e)}resourceFromPath(e){return new w({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:s(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:s(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:s(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 f({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([d({type:["private","shared","org","public"]})],S.prototype,"access",void 0),e([d()],S.prototype,"accessInformation",void 0),e([d({type:String})],S.prototype,"apiKey",void 0),e([d({json:{read:{source:"appProxies"}}})],S.prototype,"applicationProxies",void 0),e([d()],S.prototype,"avgRating",void 0),e([d()],S.prototype,"categories",void 0),e([d({type:Date})],S.prototype,"created",void 0),e([d()],S.prototype,"culture",void 0),e([d()],S.prototype,"description",void 0),e([d({readOnly:!0})],S.prototype,"displayName",null),e([d({type:g})],S.prototype,"extent",void 0),e([m("extent")],S.prototype,"readExtent",null),e([d()],S.prototype,"groupCategories",void 0),e([d({readOnly:!0})],S.prototype,"iconUrl",null),e([d()],S.prototype,"id",void 0),e([d({readOnly:!0})],S.prototype,"isLayer",null),e([d({type:Boolean,readOnly:!0})],S.prototype,"isOrgItem",void 0),e([d()],S.prototype,"itemControl",void 0),e([d({readOnly:!0})],S.prototype,"itemPageUrl",null),e([d({readOnly:!0})],S.prototype,"itemUrl",null),e([d()],S.prototype,"licenseInfo",void 0),e([d({type:Date})],S.prototype,"modified",void 0),e([d()],S.prototype,"name",void 0),e([d()],S.prototype,"numComments",void 0),e([d()],S.prototype,"numRatings",void 0),e([d()],S.prototype,"numViews",void 0),e([d()],S.prototype,"owner",void 0),e([d()],S.prototype,"ownerFolder",void 0),e([d({type:y})],S.prototype,"portal",void 0),e([d()],S.prototype,"screenshots",void 0),e([d()],S.prototype,"size",void 0),e([d()],S.prototype,"snippet",void 0),e([d()],S.prototype,"sourceJSON",void 0),e([d({type:String})],S.prototype,"sourceUrl",void 0),e([d({type:String})],S.prototype,"spatialReference",void 0),e([d()],S.prototype,"tags",void 0),e([d()],S.prototype,"thumbnail",void 0),e([d({readOnly:!0})],S.prototype,"thumbnailUrl",null),e([d()],S.prototype,"title",void 0),e([d()],S.prototype,"type",void 0),e([d()],S.prototype,"typeKeywords",void 0),e([d({type:String,json:{read(e,t){if(k.has(t.type)){const t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],S.prototype,"url",void 0),e([d({readOnly:!0})],S.prototype,"userItemUrl",null),S=f=e([h("esri.portal.PortalItem")],S);const x=S;export{x as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import{id as i}from"../kernel.js";import r from"../core/Error.js";import{JSONSupportMixin as o}from"../core/JSONSupport.js";import{clone as s,fixJson as a}from"../core/lang.js";import n from"../core/Loadable.js";import{unwrapOrThrow as l}from"../core/maybe.js";import{isDataProtocol as p,makeAbsolute as c}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import g from"../geometry/Extent.js";import y from"./Portal.js";import w from"./PortalItemResource.js";import v from"./PortalRating.js";var f;const b=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),k=new Set(["KML","GeoJson","CSV"]);let S=f=class extends(o(n)){static from(e){return u(f,e)}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.isOrgItem=!1,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.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}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.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e?i=t.includes("Web Tool")?"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=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replaceAll(/(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.includes("configurableApp")?i="Instant App":"Insights Page"===e&&(i="Insights Report"),i}readExtent(e){return e&&e.length?new g(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 s,a=!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?(a=i.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.includes("Table"),l=i.includes("Route Layer"),p=i.includes("Markup"),c=i.includes("Spatiotemporal"),d=i.includes("UtilityNetwork"),s=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":a?"featureshosted":d?"utilitynetwork":"features"):s="map service"===e||"wms"===e||"wmts"===e?a||i.includes("Tiled")||"wmts"===e?"maptiles":"mapimages":"scene service"===e?i.includes("Line")?"sceneweblayerline":i.includes("3DObject")?"sceneweblayermultipatch":i.includes("Point")?"sceneweblayerpoint":i.includes("IntegratedMesh")?"sceneweblayermesh":i.includes("PointCloud")?"sceneweblayerpointcloud":i.includes("Polygon")?"sceneweblayerpolygon":i.includes("Building")?"sceneweblayerbuilding":i.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.includes("Elevation 3D Layer")?"elevationlayer":i.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"video service"===e?"mediaservice":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e?i.includes("Web Tool")?"tool":"layers":"geodata service"===e?"geodataservice":"layers"):s="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?i.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.includes("configurableApp")?"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.includes("ArcGIS Pro")||"explorer map"===e&&i.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===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":"360 vr experience"===e?"360vr":"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.includes("Explorer Mapping Application")||i.includes("Document")?"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":"hub project"===e?"hubproject":"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":"pro report template"===e?"proreporttemplate":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"experience builder widget"===e?"experiencebuilderwidget":"experience builder widget package"===e?"experiencebuilderwidgetpackage":"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":"notebook code snippets"===e||"notebook code snippet library"===e?"notebookcodesnippets":"suitability model"===e?"suitabilitymodel":"esri classifier definition"===e?"classifierdefinition":"esri classification schema"===e?"classificationschema":"insights data engineering workbook"===e?"dataengineeringworkbook":"insights data engineering model"===e?"dataengineeringmodel":"deep learning studio project"===e?"deeplearningproject":"discussion"===e?"discussion":"allsource project"===e?"allsourceproject":"api key"===e?"apikey":"data pipeline"===e?"datapipelines":"maps",s?t(r+s+o+".png"):null}get isLayer(){return null!=this.type&&b.has(this.type)}get itemCdnUrl(){let e=this.itemUrl;return e&&i&&!i.findCredential(e)&&(e=i._normalizeAGOLorgDomain(e),e=e.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),e=e.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),e=e.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),e}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${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: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){const t=this.portal??(this.portal=y.getDefault()),i=t.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:null!=e?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof v&&(e=e.rating),null==e||isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new v({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:s(this.applicationProxies),avgRating:this.avgRating,categories:s(this.categories),created:s(this.created),culture:this.culture,description:this.description,extent:s(this.extent),groupCategories:s(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:s(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:s(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:s(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:s(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new f({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const i of["tags","typeKeywords","categories"])e[i]=e[i]?.join(", ");const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await l(this.portal).request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return l(this.portal).request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await l(this.portal).request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new v(t)):null}fetchRelatedItems(e,t){return l(this.portal).requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},f)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return l(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((()=>l(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 r("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new r("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:i}=this;await l(t).signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},p={method:"post",query:{copyPrivateResources:"all"===o,folder:"string"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(","),title:n}},{itemId:c}=await t.request(`${i}/copy`,p);return new f({id:c,portal:t})}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)p(t)?r.query={data:t}:r.query={url:c(t)},null!=i&&(r.query.filename=i);else{const e=new FormData;null!=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 r("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:i}=await import("./support/resourceUtils.js");return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResource:r}=await import("./support/resourceUtils.js");return e.portalItem=this,r(e,"add",t,i)}async removeResource(e,t){const{removeResource:i}=await import("./support/resourceUtils.js");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new r("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await import("./support/resourceUtils.js");return t(this,e)}resourceFromPath(e){return new w({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:s(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:s(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:s(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 f({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([d({type:["private","shared","org","public"]})],S.prototype,"access",void 0),e([d()],S.prototype,"accessInformation",void 0),e([d({type:String})],S.prototype,"apiKey",void 0),e([d({json:{read:{source:"appProxies"}}})],S.prototype,"applicationProxies",void 0),e([d()],S.prototype,"avgRating",void 0),e([d()],S.prototype,"categories",void 0),e([d({type:Date})],S.prototype,"created",void 0),e([d()],S.prototype,"culture",void 0),e([d()],S.prototype,"description",void 0),e([d({readOnly:!0})],S.prototype,"displayName",null),e([d({type:g})],S.prototype,"extent",void 0),e([m("extent")],S.prototype,"readExtent",null),e([d()],S.prototype,"groupCategories",void 0),e([d({readOnly:!0})],S.prototype,"iconUrl",null),e([d()],S.prototype,"id",void 0),e([d({readOnly:!0})],S.prototype,"isLayer",null),e([d({type:Boolean,readOnly:!0})],S.prototype,"isOrgItem",void 0),e([d()],S.prototype,"itemControl",void 0),e([d({readOnly:!0})],S.prototype,"itemPageUrl",null),e([d({readOnly:!0})],S.prototype,"itemUrl",null),e([d()],S.prototype,"licenseInfo",void 0),e([d({type:Date})],S.prototype,"modified",void 0),e([d()],S.prototype,"name",void 0),e([d()],S.prototype,"numComments",void 0),e([d()],S.prototype,"numRatings",void 0),e([d()],S.prototype,"numViews",void 0),e([d()],S.prototype,"owner",void 0),e([d()],S.prototype,"ownerFolder",void 0),e([d({type:y})],S.prototype,"portal",void 0),e([d()],S.prototype,"screenshots",void 0),e([d()],S.prototype,"size",void 0),e([d()],S.prototype,"snippet",void 0),e([d()],S.prototype,"sourceJSON",void 0),e([d({type:String})],S.prototype,"sourceUrl",void 0),e([d({type:String})],S.prototype,"spatialReference",void 0),e([d()],S.prototype,"tags",void 0),e([d()],S.prototype,"thumbnail",void 0),e([d({readOnly:!0})],S.prototype,"thumbnailUrl",null),e([d()],S.prototype,"title",void 0),e([d()],S.prototype,"type",void 0),e([d()],S.prototype,"typeKeywords",void 0),e([d({type:String,json:{read(e,t){if(k.has(t.type)){const t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],S.prototype,"url",void 0),e([d({readOnly:!0})],S.prototype,"userItemUrl",null),S=f=e([h("esri.portal.PortalItem")],S);const x=S;export{x 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.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../CSVLayerAdapter.js";import r from"../FeatureLayerAdapter.js";import a from"../FeatureLayerBinningAdapter.js";import t from"../InMemoryLayerAdapter.js";import y from"../LayerAdapter.js";import L from"../PointCloudLayerAdapter.js";import o from"../SceneLayerAdapter.js";import n from"../StreamLayerAdapter.js";var p;!function(e){e[e.CSVLayer=0]="CSVLayer",e[e.GeoJSONLayer=1]="GeoJSONLayer",e[e.FeatureLayer=2]="FeatureLayer",e[e.OGCFeatureLayer=3]="OGCFeatureLayer",e[e.SceneLayer=4]="SceneLayer",e[e.StreamLayer=5]="StreamLayer",e[e.PointCloudLayer=6]="PointCloudLayer",e[e.WFSLayer=7]="WFSLayer"}(p||(p={}));const u={[p.CSVLayer]:{adapter:e,type:"csv",label:"CSVLayer"},[p.FeatureLayer]:{adapter:r,type:"feature",label:"FeatureLayer"},[p.OGCFeatureLayer]:{adapter:t,type:"ogc-feature",label:"OGCFeatureLayer"},[p.GeoJSONLayer]:{adapter:r,type:"geojson",label:"GeoJSONLayer"},[p.SceneLayer]:{adapter:o,type:"scene",label:"SceneLayer"},[p.StreamLayer]:{adapter:n,type:"stream",label:"StreamLayer"},[p.PointCloudLayer]:{adapter:L,type:"point-cloud",label:"PointCloudLayer"},[p.WFSLayer]:{adapter:r,type:"wfs",label:"WFSLayer"}},S=[p.CSVLayer,p.FeatureLayer,p.OGCFeatureLayer,p.GeoJSONLayer,p.SceneLayer,p.StreamLayer,p.PointCloudLayer,p.WFSLayer],l=[p.CSVLayer,p.FeatureLayer,p.OGCFeatureLayer,p.SceneLayer,p.StreamLayer,p.GeoJSONLayer,p.WFSLayer],m=[p.CSVLayer,p.FeatureLayer,p.OGCFeatureLayer,p.GeoJSONLayer,p.WFSLayer];function d(e){return e.map((e=>u[e].label))}function i(e){return e.map((e=>u[e].type))}function F(e,r=S,t){if(e instanceof y)return e;const L=C(e,r);return L?t?new a({layer:e}):new L({layer:e}):null}function C(e,r=S){let a=null;return r.some((r=>{const t=e.type===u[r].type;return t&&(a=u[r].adapter),t})),a}export{p as LayerType,m as binningCapableLayerTypes,F as createLayerAdapter,S as defaultSupportedLayerTypes,l as featureCapableLayerTypes,d as getLayerTypeLabels,i as getLayerTypes};
5
+ import e from"../CSVLayerAdapter.js";import r from"../FeatureLayerAdapter.js";import a from"../FeatureLayerBinningAdapter.js";import t from"../InMemoryLayerAdapter.js";import y from"../LayerAdapter.js";import L from"../PointCloudLayerAdapter.js";import o from"../SceneLayerAdapter.js";import n from"../StreamLayerAdapter.js";var p;!function(e){e[e.CSVLayer=0]="CSVLayer",e[e.GeoJSONLayer=1]="GeoJSONLayer",e[e.FeatureLayer=2]="FeatureLayer",e[e.OGCFeatureLayer=3]="OGCFeatureLayer",e[e.SceneLayer=4]="SceneLayer",e[e.StreamLayer=5]="StreamLayer",e[e.PointCloudLayer=6]="PointCloudLayer",e[e.WFSLayer=7]="WFSLayer"}(p||(p={}));const u={[p.CSVLayer]:{adapter:e,type:"csv",label:"CSVLayer"},[p.FeatureLayer]:{adapter:r,type:"feature",label:"FeatureLayer"},[p.OGCFeatureLayer]:{adapter:t,type:"ogc-feature",label:"OGCFeatureLayer"},[p.GeoJSONLayer]:{adapter:r,type:"geojson",label:"GeoJSONLayer"},[p.SceneLayer]:{adapter:o,type:"scene",label:"SceneLayer"},[p.StreamLayer]:{adapter:n,type:"stream",label:"StreamLayer"},[p.PointCloudLayer]:{adapter:L,type:"point-cloud",label:"PointCloudLayer"},[p.WFSLayer]:{adapter:r,type:"wfs",label:"WFSLayer"}},S=[p.CSVLayer,p.FeatureLayer,p.OGCFeatureLayer,p.GeoJSONLayer,p.SceneLayer,p.StreamLayer,p.PointCloudLayer,p.WFSLayer],l=[p.CSVLayer,p.FeatureLayer,p.OGCFeatureLayer,p.SceneLayer,p.StreamLayer,p.GeoJSONLayer,p.WFSLayer],m=[p.CSVLayer,p.FeatureLayer,p.OGCFeatureLayer,p.StreamLayer,p.GeoJSONLayer,p.WFSLayer];function d(e){return e.map((e=>u[e].label))}function i(e){return e.map((e=>u[e].type))}function F(e,r=S,t){if(e instanceof y)return e;const L=C(e,r);return L?t?new a({layer:e}):new L({layer:e}):null}function C(e,r=S){let a=null;return r.some((r=>{const t=e.type===u[r].type;return t&&(a=u[r].adapter),t})),a}export{p as LayerType,m as binningCapableLayerTypes,F as createLayerAdapter,S as defaultSupportedLayerTypes,l as featureCapableLayerTypes,d as getLayerTypeLabels,i as getLayerTypes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import{isSome as r}from"../../core/arrayUtils.js";import i from"./support/colors.js";import{createThemes as g,getThemesforBasemap as t,getRawSchemes as l,filterSchemesByName as a,filterSchemesByTag as n}from"./support/symbologyUtils.js";import{hasIdenticalColors as o,toWorldScale as h}from"./support/utils.js";const s={light:{color:[153,153,153,.25],width:"0.5px"},lighter:{color:[194,194,194,.25],width:"0.5px"},lightest:{color:[153,153,153,.25],width:"0.5px"}},b={lightBasemaps:{outline:s.lighter,fillOpacity:.8,width:"2px",size:"8px"},darkBasemaps:{outline:s.light,fillOpacity:.6,width:"2px",size:"8px"},grayBasemaps:{outline:s.lightest,fillOpacity:.8,width:"2px",size:"8px"}},d="#aaaaaa",y="#ffffff",u="12px",p=["highlight-red-gray-bright","highlight-purple-gray-bright","highlight-blue-bright-gray-bright","highlight-green-gray-bright","highlight-yellow-gray-bright"],c=["highlight-pink-gray-dark","highlight-purple-gray-dark","highlight-blue-bright-gray-dark","highlight-green-gray-dark","highlight-brown-gray-dark"],m=["extremes-red-gray-bright","extremes-purple-gray-bright","extremes-blue-bright-gray-bright","extremes-green-gray-bright","extremes-yellow-gray-bright"],v=["extremes-pink-gray-dark","extremes-purple-gray-dark","extremes-blue-bright-gray-dark","extremes-green-gray-dark","extremes-brown-gray-dark"],q=["highlight-orange-gray","highlight-bluegreen-gray","highlight-purple-gray","highlight-pink-gray","highlight-blue-gray","highlight-red-gray","highlight-orange-gray-dark","highlight-blue-gray-dark","highlight-orange-gray-bright","highlight-blue-gray-bright","extremes-orange-gray","extremes-bluegreen-gray","extremes-purple-gray","extremes-pink-gray","extremes-blue-gray","extremes-red-gray","extremes-orange-gray-dark","extremes-blue-gray-dark","extremes-orange-gray-bright","extremes-blue-gray-bright"].concat(p).concat(c).concat(m).concat(v),w=["seq-single-blues","seq-single-greens","seq-single-grays","seq-single-oranges","seq-single-purples","seq-single-reds","seq-multi-bugn","seq-multi-bupu","seq-multi-gnbu","seq-multi-orrd","seq-multi-pubu","seq-multi-pubugn","seq-multi-purd","seq-multi-rdpu","seq-multi-ylgn","seq-multi-ylgnbu","seq-multi-ylorbr","seq-multi-ylorrd"],k=["div-brbg","div-piyg","div-prgn","div-puor","div-rdbu","div-rdgy","div-rdylbu","div-rdylgn","div-spectral"],x=["seq-blue-bright-1","seq-green-bright-1","seq-green-bright-2","seq-green-bright-3","seq-blue-bright-2","seq-blue-bright-3","seq-blue-bright-4","seq-blue-bright-5","seq-red-purple-bright","seq-red-magenta-bright","seq-red-bright-3","seq-red-bright-4","seq-yellow-bright-1","seq-yellow-bright-2","seq-yellow-bright-3","seq-yellow-bright-4","seq-yellow-gray-bright","seq-green-gray-bright","seq-blue-gray-bright","seq-red-gray-bright","seq-gray-redbright","seq-gray-green-bright","seq-gray-blue-bright","seq-gray-purple-bright","seq-plaingray-bright","seq-greengray-bright","seq-coolgray-bright","seq-warmgray-bright","seq-yellow-green-combo-bright","seq-cyan-blue-combo-bright","seq-magenta-purple-combo-bright"],f=["div-yellow-orange-purple-bright","div-yellow-blue-bright-1","div-yellow-blue-bright-2","div-yellow-blue-bright","div-yellow-blue-bright-3","div-yellow-purple-bright-1","div-yellow-purple-bright-2","div-yellow-red-bright-1","div-yellow-red-bright-2","div-yellow-gray-bright-1","div-yellow-gray-bright-2","div-yellow-gray-bright-3","div-purple-green-bright-1","div-purple-green-bright-2","div-pink-yellow-bright-1","div-pink-yellow-bright-2","div-red-blue-bright-1","div-red-blue-bright-2","div-orange-blue-bright-3","div-orange-blue-bright-4","div-red-purple-bright","div-red-gray-bright-1","div-red-gray-bright-2","div-red-gray-bright-3","div-teal-yellow-bright-1","div-teal-yellow-bright-2","div-teal-orange-bright","div-green-red-bright","div-green-magenta-bright","div-green-purple-bright-1","div-green-purple-bright-2","div-green-blue-bright-1","div-green-blue-bright-2","div-green-gray-bright-1","div-green-gray-bright-2","div-green-gray-bright-3","div-blue-green-bright-1","div-blue-yellow-bright-2","div-blue-lightorange-bright","div-blue-orange-bright-1","div-blue-orange-bright-2","div-blue-red-bright-1","div-blue-red-bright-2","div-blue-tan-bright","div-blue-gray-bright-1","div-blue-gray-bright-2","div-blue-gray-bright-3"],B=["div-blue-yellow-brown","div-purple-yellow-brown","div-purple-beige-green","div-teal-yellow-brown","div-yellow-magenta-light","div-green-yellow-blue","div-brown-blue","div-red-green-cyan","div-yellow-slate-teal","div-blue-green-orange","div-purple-orange","div-purple-green","div-teal-orange","div-red-purple-blue","div-yellow-magenta","div-green-blue","div-blue-brown","div-red-cyan","div-yellow-teal"],C=["seq-magenta","seq-red","seq-orange","seq-yellow","seq-yellowgreen","seq-green","seq-turquoise","seq-royal","seq-blueberry","seq-purple","seq-brown","seq-blue","seq-red-darkblue","seq-purple-darkgreen","seq-blue-darkgreen","seq-green-darkpurple","seq-blue-gray","seq-magenta-light","seq-red-light","seq-orange-light","seq-mustard-light","seq-yellowgreen-light","seq-green-light","seq-aqua-light","seq-cyan-light","seq-blue-light","seq-purple-light","seq-brown-light","seq-steel-light","seq-brown-palegreen","seq-purple-pink-yellow","seq-blue-green-yellow","seq-green-avocado-lightpurple","seq-turquoise-lightgreen","seq-red-brown-white","seq-purple-pink-white","seq-blue-green-white","seq-green-avocado-white","seq-turquoise-lightgreen-white","seq-mentone-beach","seq-snowy-mountain","seq-snow-cactus","seq-subdued-red-yellow","seq-subdued-purple-blue","seq-subdued-blue-cyan","seq-subdued-green-yellow","seq-subdued-green","seq-subdued-brown-tan","seq-subdued-gray-green","seq-subdued-green-tan","seq-subdued-blue-purple","seq-subdued-pink-brown","seq-subdued-green-pink","seq-lines-blue-orange","seq-lines-purple-brown","seq-lines-green-brown","seq-lines-yellow-blue","seq-esribrand-red","seq-esribrand-red-orange","seq-esribrand-orange","seq-esribrand-orangeyellow","seq-esribrand-yellow","seq-esribrand-yellowgreen","seq-esribrand-green","seq-esribrand-greenblue","seq-esribrand-blue","seq-esribrand-violet","seq-esribrand-violetred","seq-esribrand-brown","seq-esribrand-gray"],z=["div-green-purple","div-blue-red","div-green-magenta","div-blue-orange","div-blue-yellow","div-purple-yellow","div-magenta-yellow","div-purple-green-dark","div-green-brown","div-green-gray","div-blue-white","div-red-steel","div-aqua-darkgray-red","div-green-purple-light","div-blue-red-light","div-green-purple-light-2","div-cyan-blue-light","div-blue-yellow-light","div-purple-yellow-light","div-magenta-yellow-light","div-purple-green-light","div-blue-blue","div-green-green","div-blue-green-light","div-red-green-light","div-blue-yellow-brown-light","div-blue-white-brown","div-subdued-red-green","div-subdued-red-purple","div-subdued-brown-gray","div-subdued-sepia-gray","div-subdued-blue-gray","div-subdued-tan-blue","div-subdued-green-blue","div-subdued-green-pink","div-subdued-green-brown","div-lines-blue-brown","div-lines-green-purple","div-lines-red-gray","div-lines-green-orange","div-lines-yellow-blue","div-esribrand-red-bluegreen","div-esribrand-red-blue","div-esribrand-red-violet","div-esribrand-red-violetred","div-esribrand-red-gray","div-esribrand-redorange-greenblue","div-esribrand-redorange-blue","div-esribrand-redorange-violet","div-esribrand-redorange-violetred","div-esribrand-redorange-gray","div-esribrand-orange-greenblue","div-esribrand-orange-blue","div-esribrand-orange-violet","div-esribrand-orange-violetred","div-esribrand-orange-gray","div-esribrand-orangeyellow-greenblue","div-esribrand-orangeyellow-blue","div-esribrand-orangeyellow-violet","div-esribrand-orangeyellow-violetred","div-esribrand-orangeyellow-gray","div-esribrand-yellow-green-blue","div-esribrand-yellow-blue","div-esribrand-yellow-violet","div-esribrand-yellow-violetred","div-esribrand-yellow-brown","div-esribrand-yellow-gray","div-esribrand-yellowgreen-greenblue","div-esribrand-yellowgreen-blue","div-esribrand-yellowgreen-violet","div-esribrand-yellowgreen-violetred","div-esribrand-yellowgreen-brown","div-esribrand-yellowgreen-gray","div-esribrand-green-blue","div-esribrand-green-violet","div-esribrand-green-violetred","div-esribrand-green-gray","div-esribrand-greenblue-blue","div-esribrand-greenblue-violetred","div-esribrand-greenblue-brown","div-esribrand-greenblue-gray","div-esribrand-blue-brown","div-esribrand-blue-gray","div-esribrand-violet-brown","esribrand-violet-gray","div-esribrand-violetred-gray","div-esribrand-brown-gray"],O={streets:["streets","streets-vector","streets-relief-vector","streets-navigation-vector"],light:["gray","gray-vector"],topo:["topo","topo-vector"],terrain:["terrain"],"national-geographic":["national-geographic"],oceans:["oceans"],osm:["osm"],satellite:["satellite"],hybrid:["hybrid"],dark:["dark-gray","dark-gray-vector","streets-night-vector"]},D=["extremesdiv-orange-gray-blue","extremesdiv-yellow-gray-purple","extremesdiv-red-gray-blue","extremesdiv-green-gray-purple"],G=["point-cloud-elevation-scheme","point-cloud-intensity-scheme"],T={streets:{common:b.lightBasemaps,primary:"seq-yellow-red-purple",secondary:["seq-yellow-orange-red","seq-yellow-pink-purple","seq-yellow-purple-blue","seq-yellow-green-blue","seq-teal-lightgreen-bright","seq-green-lightgray-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright"].concat(C).concat(x).concat(w).concat(G)},light:{common:b.grayBasemaps,primary:"seq-single-blues",secondary:["seq-yellow-red-purple","seq-orange-red-light","seq-yellow-orange-red","seq-yellow-pink-purple","seq-yellow-purple-blue","seq-teal-lightgreen-bright","seq-green-lightgray-bright","seq-red-lightgray-bright","seq-blue-lightgray-bright","seq-orange-lightgray-bright","seq-blue-red-yellow-bright","seq-blue-tan-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-blues-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright"].concat(C).concat(x).concat(w).concat(G).filter((e=>"seq-single-blues"!==e))},topo:{common:b.lightBasemaps,primary:"seq-yellow-green-blue",secondary:["seq-yellow-pink-purple","seq-yellow-purple-blue","seq-yellow-red-purple","seq-yellow-orange-red","seq-teal-lightgreen-bright","seq-green-lightgray-bright","seq-blue-lightgray-bright","seq-orange-lightgray-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright"].concat(C).concat(x).concat(w).concat(G)},terrain:{common:b.lightBasemaps,primary:"seq-pink-red",secondary:["seq-yellow-pink-purple","seq-yellow-red-purple","seq-yellow-orange-red","seq-orange-red-light","seq-teal-lightgreen-bright","seq-green-lightgray-bright","seq-red-lightgray-bright","seq-blue-lightgray-bright","seq-orange-lightgray-bright","seq-blue-red-yellow-bright","seq-blue-tan-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-blues-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright"].concat(C).concat(x).concat(w).concat(G)},"national-geographic":{common:b.lightBasemaps,primary:"seq-yellow-orange-red",secondary:["seq-yellow-red-purple","seq-yellow-pink-purple","seq-yellow-purple-blue","seq-yellow-green-blue","seq-teal-lightgreen-bright","seq-blue-lightgray-bright","seq-reds-bright","seq-purples-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright"].concat(C).concat(x).concat(w).concat(G)},oceans:{common:b.lightBasemaps,primary:"seq-yellow-green-blue",secondary:["seq-yellow-red-purple","seq-yellow-orange-red","seq-yellow-pink-purple","seq-yellow-purple-blue","seq-teal-lightgreen-bright","seq-green-lightgray-bright","seq-red-lightgray-bright","seq-blue-lightgray-bright","seq-blue-red-yellow-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright"].concat(C).concat(x).concat(w).concat(G)},osm:{common:b.lightBasemaps,primary:"seq-red-blue-green",secondary:["seq-yellow-pink-purple","seq-yellow-red-purple","seq-yellow-purple-blue","seq-teal-lightgreen-bright","seq-blue-lightgray-bright","seq-blue-red-yellow-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright"].concat(C).concat(x).concat(w).concat(G)},satellite:{common:b.darkBasemaps,primary:"seq-orange-red-dark",secondary:["seq-yellow-green-blue","seq-red-blue-green","seq-yellow-purple-blue","seq-teal-lightgreen-bright","seq-blue-lightgray-bright","seq-gray-lightgreen-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-blues-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright","seq-lightmagenta-darkgray-bright","seq-lightblue-darkgray-bright"].concat(C).concat(x).concat(w).concat(G)},hybrid:{common:b.darkBasemaps,primary:"seq-orange-red-dark",secondary:["seq-yellow-green-blue","seq-red-blue-green","seq-yellow-purple-blue","seq-teal-lightgreen-bright","seq-blue-lightgray-bright","seq-gray-lightgreen-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-blues-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright","seq-lightmagenta-darkgray-bright","seq-lightblue-darkgray-bright"].concat(C).concat(x).concat(w).concat(G)},dark:{common:b.grayBasemaps,primary:"seq-blue-gray-bright",secondary:["seq-blue-lightgray-bright","seq-gray-lightgreen-bright","seq-reds-bright","seq-purples-bright","seq-blues-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-teal-lightgreen-bright","seq-lightred-darkgray-bright","seq-lightmagenta-darkgray-bright","seq-lightblue-darkgray-bright"].concat(C).concat(x).concat(w).concat(G).filter((e=>"seq-blue-gray-bright"!==e))}},F=g({themeDictionary:{"high-to-low":{name:"high-to-low",label:"TODO",description:"TODO",basemapGroups:O,schemes:{default:T}},"above-and-below":{name:"above-and-below",label:"TODO",description:"TODO",basemapGroups:O,schemes:{default:{streets:{common:b.lightBasemaps,primary:"div-bluegreen-yellow-orange",secondary:["div-orange-yellow-blue-light","div-green-yellow-redpurple","div-green-yellow-orange","div-green-gray-bright","div-red-blue-bright","div-blue-orange-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightred-gray-bright"].concat(z).concat(f).concat(B).concat(k)},light:{common:b.grayBasemaps,primary:"div-rdbu",secondary:["div-bluegreen-orange","div-orange-purple","div-bluegreen-purple","div-orange-pink","div-blue-yellow-red-bright","div-green-gray-bright","div-red-green-bright","div-red-blue-bright","div-orange-gray-bright","div-blue-orange-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-blue-green-bright","div-purple-brown-bright","div-blue-brown-bright","div-teal-brown-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightblue-gray-bright","div-lightgreen-gray-bright","div-lightred-gray-bright","div-yellow-green-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)},topo:{common:b.lightBasemaps,primary:"div-orange-pink",secondary:["div-redpurple-blue","div-orange-blue","div-green-pink","div-blue-yellow-red-bright","div-green-gray-bright","div-red-green-bright","div-red-blue-bright","div-orange-gray-bright","div-blue-orange-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-blue-green-bright","div-purple-brown-bright","div-blue-brown-bright","div-teal-brown-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightblue-gray-bright","div-lightgreen-gray-bright","div-lightred-gray-bright","div-yellow-green-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)},terrain:{common:b.lightBasemaps,primary:"div-bluegreen-orange",secondary:["div-bluegreen-redpurple","div-green-redpurple","div-green-orange","div-blue-yellow-red-bright","div-green-gray-bright","div-red-blue-bright","div-orange-gray-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-blue-green-bright","div-purple-brown-bright","div-blue-brown-bright","div-teal-brown-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightblue-gray-bright","div-lightgreen-gray-bright","div-lightred-gray-bright","div-yellow-green-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)},"national-geographic":{common:b.lightBasemaps,primary:"div-orange-yellow-blue-light",secondary:["div-bluegreen-yellow-orange","div-green-yellow-redpurple","div-red-green-bright","div-red-blue-bright","div-orange-gray-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-blue-green-bright","div-purple-brown-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightred-gray-bright","div-yellow-green-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)},oceans:{common:b.lightBasemaps,primary:"div-red-yellow-pink",secondary:["div-blue-green","div-bluegreen-yellow-redpurple","div-bluegreen-yellow-orange","div-blue-yellow-red-bright","div-green-gray-bright","div-red-green-bright","div-red-blue-bright","div-orange-gray-bright","div-blue-orange-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-blue-green-bright","div-purple-brown-bright","div-blue-brown-bright","div-teal-brown-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightblue-gray-bright","div-lightgreen-gray-bright","div-lightred-gray-bright","div-yellow-green-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)},osm:{common:b.lightBasemaps,primary:"div-bluegreen-pink",secondary:["div-bluegreen-redpurple","div-bluegreen-orange","div-orange-pink","div-green-gray-bright","div-red-blue-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-blue-green-bright","div-purple-brown-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightred-gray-bright","div-yellow-green-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)},satellite:{common:b.darkBasemaps,primary:"div-blue-green-bright",secondary:["div-red-yellow-purple","div-orange-yellow-pink","div-orange-yellow-blue-light","div-green-gray-bright","div-red-green-bright","div-red-blue-bright","div-orange-gray-bright","div-blue-orange-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-orange-yellow-blue-dark","div-purple-brown-bright","div-blue-brown-bright","div-teal-brown-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightblue-gray-bright","div-lightgreen-gray-bright","div-lightred-gray-bright","div-lightmagenta-gray-bright","div-yellow-green-bright","div-lightblue-yellow-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)},hybrid:{common:b.darkBasemaps,primary:"div-blue-green-bright",secondary:["div-red-yellow-purple","div-orange-yellow-pink","div-orange-yellow-blue-light","div-green-gray-bright","div-red-green-bright","div-red-blue-bright","div-orange-gray-bright","div-blue-orange-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-orange-yellow-blue-dark","div-purple-brown-bright","div-blue-brown-bright","div-teal-brown-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightblue-gray-bright","div-lightgreen-gray-bright","div-lightred-gray-bright","div-lightmagenta-gray-bright","div-yellow-green-bright","div-lightblue-yellow-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)},dark:{common:b.grayBasemaps,primary:"div-blue-red-bright-1",secondary:["div-blue-green-bright","div-yellow-gray-purple","div-lightblue-yellow-bright","div-red-gray-blue","div-green-gray-purple","div-orange-gray-blue","div-green-gray-bright","div-red-green-bright","div-red-blue-bright","div-orange-gray-bright","div-blue-orange-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-green-teal-bright","div-purple-brown-bright","div-blue-brown-bright","div-teal-brown-bright","div-lightgreen-yellow-bright","div-lightblue-gray-bright","div-lightgreen-gray-bright","div-lightred-gray-bright","div-lightmagenta-gray-bright","div-yellow-green-bright","div-green-darkgray-bright"].concat(z).concat(f).concat(B).concat(k)}}}},"centered-on":{name:"centered-on",label:"TODO",description:"TODO",basemapGroups:O,schemes:{default:{streets:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:["highlight-bluegreen","highlight-orange-gray","highlight-bluegreen-gray"].concat(c)},light:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:["highlight-purple","highlight-orange-gray","highlight-purple-gray"].concat(c)},topo:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:["highlight-pink","highlight-orange-gray","highlight-pink-gray"].concat(c)},terrain:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:["highlight-bluegreen","highlight-orange-gray","highlight-bluegreen-gray"].concat(c)},"national-geographic":{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:["highlight-blue","highlight-orange-gray","highlight-blue-gray"].concat(c)},oceans:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"highlight-red",primaryGray:"highlight-red-gray",secondary:["highlight-pink","highlight-red-gray","highlight-pink-gray"].concat(c)},osm:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"highlight-pink",primaryGray:"highlight-pink-gray",secondary:["highlight-bluegreen","highlight-pink-gray","highlight-bluegreen-gray"].concat(c)},satellite:{common:{outline:s.light,width:"2px",size:"8px"},primary:"highlight-orange-dark",primaryGray:"highlight-orange-gray-dark",secondary:["highlight-blue-dark","highlight-orange-gray-dark","highlight-blue-gray-dark"].concat(p)},hybrid:{common:{outline:s.light,width:"2px",size:"8px"},primary:"highlight-orange-dark",primaryGray:"highlight-orange-gray-dark",secondary:["highlight-blue-dark","highlight-orange-gray-dark","highlight-blue-gray-dark"].concat(p)},dark:{common:{outline:s.light,width:"2px",size:"8px"},primary:"highlight-orange-bright",primaryGray:"highlight-orange-gray-bright",secondary:["highlight-blue-bright","highlight-orange-gray-bright","highlight-blue-gray-bright"].concat(p)}}}},extremes:{name:"extremes",label:"TODO",description:"TODO",basemapGroups:O,schemes:{default:{streets:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"extremesdiv-bluegreen-yellow-orange",primaryGray:"extremes-bluegreen-gray",secondary:["extremesdiv-orange-yellow-blue-light","extremesdiv-green-yellow-redpurple","extremesdiv-green-yellow-orange","extremes-orange","extremes-bluegreen","extremes-orange-gray","extremes-bluegreen-gray"].concat(v)},light:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"extremesdiv-orange-purple",primaryGray:"extremes-orange-gray",secondary:["extremesdiv-bluegreen-purple","extremesdiv-bluegreen-orange","extremesdiv-orange-pink","extremes-orange","extremes-purple","extremes-orange-gray","extremes-purple-gray"].concat(v)},topo:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"extremesdiv-orange-pink",primaryGray:"extremes-orange-gray",secondary:["extremesdiv-redpurple-blue","extremesdiv-orange-blue","extremesdiv-green-pink","extremes-orange","extremes-pink","extremes-orange-gray","extremes-pink-gray"].concat(v)},terrain:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"extremesdiv-bluegreen-orange",primaryGray:"extremes-bluegreen-gray",secondary:["extremesdiv-bluegreen-redpurple","extremesdiv-green-redpurple","extremesdiv-green-orange","extremes-orange","extremes-bluegreen","extremes-orange-gray","extremes-bluegreen-gray"].concat(v)},"national-geographic":{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"extremesdiv-orange-yellow-blue-light",primaryGray:"extremes-orange-gray",secondary:["extremesdiv-bluegreen-yellow-orange","extremesdiv-green-yellow-redpurple","extremes-orange","extremes-blue","extremes-orange-gray","extremes-blue-gray"].concat(v)},oceans:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"extremesdiv-red-yellow-pink",primaryGray:"extremes-red-gray",secondary:["extremesdiv-blue-green","extremesdiv-bluegreen-yellow-redpurple","extremesdiv-bluegreen-yellow-orange","extremes-red","extremes-pink","extremes-red-gray","extremes-pink-gray"].concat(v)},osm:{common:{outline:s.lighter,width:"2px",size:"8px"},primary:"extremesdiv-bluegreen-pink",primaryGray:"extremes-bluegreen-gray",secondary:["extremesdiv-bluegreen-redpurple","extremesdiv-bluegreen-orange","extremesdiv-orange-pink","extremes-pink","extremes-bluegreen","extremes-pink-gray","extremes-bluegreen-gray"].concat(v)},satellite:{common:{outline:s.light,width:"2px",size:"8px"},primary:"extremesdiv-orange-yellow-blue-dark",primaryGray:"extremes-orange-gray-dark",secondary:["extremesdiv-red-yellow-purple","extremesdiv-orange-yellow-pink","extremesdiv-orange-yellow-blue-light","extremes-orange-dark","extremes-blue-dark","extremes-orange-gray-dark","extremes-blue-gray-dark"].concat(m)},hybrid:{common:{outline:s.light,width:"2px",size:"8px"},primary:"extremesdiv-orange-yellow-blue-dark",primaryGray:"extremes-orange-gray-dark",secondary:["extremesdiv-red-yellow-purple","extremesdiv-orange-yellow-pink","extremesdiv-orange-yellow-blue-light","extremes-orange-dark","extremes-blue-dark","extremes-orange-gray-dark","extremes-blue-gray-dark"].concat(m)},dark:{common:{outline:s.light,width:"2px",size:"8px"},primary:"extremesdiv-orange-gray-blue",primaryGray:"extremes-orange-gray-bright",secondary:["extremesdiv-yellow-gray-purple","extremesdiv-red-gray-blue","extremesdiv-green-gray-purple","extremes-orange-bright","extremes-blue-bright","extremes-orange-gray-bright","extremes-blue-gray-bright"].concat(m)}}}},above:{name:"above",label:"TODO",description:"TODO",basemapGroups:O,schemes:{default:T}},below:{name:"below",label:"TODO",description:"TODO",basemapGroups:O,schemes:{default:T}},"90-10":{name:"90-10",label:"TODO",description:"TODO",basemapGroups:O,schemes:{default:T}}}});function S(e){return t(F,e)}function j(e){const i=e.theme,g=l({basemap:e.basemap,basemapTheme:e.basemapTheme,theme:F.get(i)});if(!g)return;let t=g.schemesInfo;const a=t.common,{basemapId:n,basemapTheme:o}=g;!e.worldScale||"centered-on"!==i&&"extremes"!==i||(t={...t},t.secondary=t.secondary.slice(0),t.secondary.push(t.primary),t.primary=t.primaryGray,delete t.primaryGray,t.secondary=t.secondary.filter((e=>{const r=e.includes("gray"),i=D.includes(e);return e!==t.primary&&r&&!i})));const h={...e,basemap:n};return{primaryScheme:L(h,t.primary,a),secondarySchemes:t.secondary.map((e=>L(h,e,a))).filter(r),basemapId:n,basemapTheme:o}}function I(e){return a(e.name,j(e))}function E(e){return n(e.includedTags,e.excludedTags,j(e))}function U(e){let r,i,g="";const t=e.id;if(t){const e=t.split("/");e&&(g=e[0],r=e[1],i=e[2])}const a=l({basemap:r,theme:F.get(g)});if(!a)return;const{schemesInfo:n}=a;return L({theme:g,basemap:r,geometryType:e.geometryType,worldScale:e.worldScale,view:e.view},i,n.common)}function A(r){if(!r)return;const i={...r};return i.colors=i.colors.map((r=>new e(r))),i.tags=[...i.tags],i.colorsForClassBreaks=i.colorsForClassBreaks.map((r=>({numClasses:r.numClasses,colors:r.colors.map((r=>new e(r)))}))),i.noDataColor&&(i.noDataColor=new e(i.noDataColor)),"outline"in i&&i.outline&&(i.outline={color:i.outline.color&&new e(i.outline.color),width:i.outline.width}),i}function H(e){const r=e;return r.colors.reverse(),r.colorsForClassBreaks.forEach((e=>{e.colors.reverse()})),r}function J(e){const r=e.theme,i=e.colors,g=F.get(r).supportedBasemaps,t=[],a={theme:r,basemap:null,geometryType:e.geometryType,worldScale:e.worldScale,view:e.view};return g.forEach((e=>{const g=l({basemap:e,theme:F.get(r)}).schemesInfo;if(a.basemap=e,g){const e=K(L(a,g.primary,g.common),i);e&&t.push(e),g.secondary.forEach((e=>{const r=K(L(a,e,g.common),i);r&&t.push(r)}))}})),t}function K(e,r){let i,g;if(g=o(e.colors,r),g)i=g>0?e:H(e);else{let t;e.colorsForClassBreaks.some((e=>(e.numClasses===r.length&&(t=e.colors),!!t))),t&&(g=o(t,r),g&&(i=g>0?e:H(e)))}return i}function L(e,r,g){const t=i[r];if(!t)return;const l=e.theme,a="mesh"!==e.geometryType&&e.worldScale?e.view:null;let n=g.fillOpacity;null==n&&null!=r&&q.includes(r)&&(n=.8);const o="below"===e.theme,h=o?[...t.stops].reverse():t.stops,s=[];for(const i in t)if("stops"!==i&&"name"!==i&&"tags"!==i){const e=+i;s.push({numClasses:e,colors:o?[...t[e]].reverse():t[e]})}const b=null!=r&&q.includes(r)?y:d,p=l+"/"+e.basemap+"/"+r,c=n||1;switch(e.geometryType){case"point":case"multipoint":return M({id:p,name:t.name,tags:t.tags,theme:l,opacity:c,colors:h,colorsForClassBreaks:s,noDataColor:b,outline:g.outline,size:g.size},a);case"polyline":return N({id:p,name:t.name,tags:t.tags,theme:l,opacity:c,colors:h,colorsForClassBreaks:s,noDataColor:b,width:g.width},a);case"polygon":return P({id:p,name:t.name,tags:t.tags,theme:l,opacity:c,colors:h,colorsForClassBreaks:s,noDataColor:b,outline:g.outline,size:u},a);case"mesh":return Q({id:p,name:t.name,tags:t.tags,theme:l,opacity:c,colors:h,colorsForClassBreaks:s,noDataColor:b});default:return}}function M(r,i){return{id:r.id,name:r.name,tags:[...r.tags],theme:r.theme,colors:r.colors.map((r=>new e(r))),colorsForClassBreaks:R(r.colorsForClassBreaks),noDataColor:new e(r.noDataColor),outline:{color:new e(r.outline.color),width:r.outline.width},size:i&&"3d"===i.type?h(r.size,i):r.size,opacity:r.opacity}}function N(r,i){return{id:r.id,name:r.name,tags:[...r.tags],theme:r.theme,colors:r.colors.map((r=>new e(r))),colorsForClassBreaks:R(r.colorsForClassBreaks),noDataColor:new e(r.noDataColor),width:i&&"3d"===i.type?h(r.width,i):r.width,opacity:r.opacity}}function P(r,i){return{id:r.id,name:r.name,tags:[...r.tags],theme:r.theme,colors:r.colors.map((r=>new e(r))),colorsForClassBreaks:R(r.colorsForClassBreaks),noDataColor:new e(r.noDataColor),outline:{color:new e(r.outline.color),width:r.outline.width},opacity:r.opacity,size:i&&"3d"===i.type?h(r.size,i):r.size}}function Q(r){return{id:r.id,name:r.name,tags:[...r.tags],theme:r.theme,colors:r.colors.map((r=>new e(r))),colorsForClassBreaks:R(r.colorsForClassBreaks),noDataColor:new e(r.noDataColor),opacity:r.opacity}}function R(r){return r.map((r=>({numClasses:r.numClasses,colors:r.colors.map((r=>new e(r)))})))}export{A as cloneScheme,H as flipColors,J as getMatchingSchemes,U as getSchemeById,I as getSchemeByName,j as getSchemes,E as getSchemesByTag,S as getThemes,x as seqColorSets2019,C as seqColorSets2021,w as seqColorSetsFromPortal};
5
+ import e from"../../Color.js";import{isSome as r}from"../../core/arrayUtils.js";import i from"./support/colors.js";import{createThemes as a,getThemesforBasemap as l,getRawSchemes as t,filterSchemesByName as o,filterSchemesByTag as g}from"./support/symbologyUtils.js";import{hasIdenticalColors as n,toWorldScale as s}from"./support/utils.js";const d={light:{color:[153,153,153,.25],width:"0.5px"},lighter:{color:[194,194,194,.25],width:"0.5px"},lightest:{color:[153,153,153,.25],width:"0.5px"}},h={lightBasemaps:{outline:d.lighter,fillOpacity:.8,width:"2px",size:"8px"},darkBasemaps:{outline:d.light,fillOpacity:.6,width:"2px",size:"8px"},grayBasemaps:{outline:d.lightest,fillOpacity:.8,width:"2px",size:"8px"}},b="#aaaaaa",c="#ffffff",y="12px",u=["highlight-blue","highlight-bluegreen","highlight-orange","highlight-pink","highlight-purple","highlight-red","highlight-blue-bright","highlight-orange-bright","highlight-blue-dark","highlight-orange-dark","highlight-blue-gray","highlight-bluegreen-gray","highlight-orange-gray","highlight-pink-gray","highlight-purple-gray","highlight-red-gray","highlight-blue-gray-bright","highlight-orange-gray-bright","highlight-blue-gray-dark","highlight-orange-gray-dark"],p=["highlight-red-gray-bright","highlight-purple-gray-bright","highlight-blue-bright-gray-bright","highlight-green-gray-bright","highlight-yellow-gray-bright"],m=["highlight-pink-gray-dark","highlight-purple-gray-dark","highlight-blue-bright-gray-dark","highlight-green-gray-dark","highlight-brown-gray-dark"],v=["extremes-blue","extremes-blue-bright","extremes-blue-dark","extremes-bluegreen","extremes-orange","extremes-orange-bright","extremes-orange-dark","extremes-pink","extremes-purple","extremes-red","extremesdiv-blue-green","extremesdiv-bluegreen-orange","extremesdiv-bluegreen-pink","extremesdiv-bluegreen-purple","extremesdiv-bluegreen-redpurple","extremesdiv-bluegreen-yellow-orange","extremesdiv-bluegreen-yellow-redpurple","extremesdiv-green-orange","extremesdiv-green-pink","extremesdiv-green-redpurple","extremesdiv-green-yellow-orange","extremesdiv-green-yellow-redpurple","extremesdiv-orange-blue","extremesdiv-orange-pink","extremesdiv-orange-purple","extremesdiv-orange-yellow-blue-dark","extremesdiv-orange-yellow-blue-light","extremesdiv-orange-yellow-pink","extremesdiv-red-yellow-pink","extremesdiv-red-yellow-purple","extremesdiv-redpurple-blue","extremes-blue-gray","extremes-blue-gray-bright","extremes-blue-gray-dark","extremes-bluegreen-gray","extremes-orange-gray","extremes-orange-gray-bright","extremes-orange-gray-dark","extremes-pink-gray","extremes-purple-gray","extremes-red-gray","extremesdiv-green-gray-purple","extremesdiv-orange-gray-blue","extremesdiv-red-gray-blue","extremesdiv-yellow-gray-purple"],w=["extremes-red-gray-bright","extremes-purple-gray-bright","extremes-blue-bright-gray-bright","extremes-green-gray-bright","extremes-yellow-gray-bright"],q=["extremes-pink-gray-dark","extremes-purple-gray-dark","extremes-blue-bright-gray-dark","extremes-green-gray-dark","extremes-brown-gray-dark"],x=["highlight-orange-gray","highlight-bluegreen-gray","highlight-purple-gray","highlight-pink-gray","highlight-blue-gray","highlight-red-gray","highlight-orange-gray-dark","highlight-blue-gray-dark","highlight-orange-gray-bright","highlight-blue-gray-bright","extremes-orange-gray","extremes-bluegreen-gray","extremes-purple-gray","extremes-pink-gray","extremes-blue-gray","extremes-red-gray","extremes-orange-gray-dark","extremes-blue-gray-dark","extremes-orange-gray-bright","extremes-blue-gray-bright","extremesdiv-green-gray-purple","extremesdiv-orange-gray-blue","extremesdiv-red-gray-blue","extremesdiv-yellow-gray-purple"].concat(p).concat(m).concat(w).concat(q),k=["seq-single-blues","seq-single-greens","seq-single-grays","seq-single-oranges","seq-single-purples","seq-single-reds","seq-multi-bugn","seq-multi-bupu","seq-multi-gnbu","seq-multi-orrd","seq-multi-pubu","seq-multi-pubugn","seq-multi-purd","seq-multi-rdpu","seq-multi-ylgn","seq-multi-ylgnbu","seq-multi-ylorbr","seq-multi-ylorrd"],f=["seq-yellow-red-purple","seq-yellow-orange-red","seq-yellow-pink-purple","seq-yellow-purple-blue","seq-yellow-green-blue","seq-teal-lightgreen-bright","seq-green-lightgray-bright","seq-teal-lightbrown-bright","seq-reds-bright","seq-purples-bright","seq-greens-bright","seq-browns-bright","seq-dark-to-light-magenta-bright","seq-dark-to-light-purple-bright","seq-dark-to-light-blue-bright","seq-dark-to-light-green-bright","seq-brown-to-tan-bright","seq-lightgray-blue-bright","seq-lightgray-green-bright","seq-lightgray-darkmagenta-bright","seq-yellow-darkblue-bright","seq-lightred-darkgray-bright","seq-single-blues","seq-orange-red-light","seq-red-lightgray-bright","seq-blue-lightgray-bright","seq-orange-lightgray-bright","seq-blue-red-yellow-bright","seq-blue-tan-bright","seq-blues-bright","seq-pink-red","seq-red-blue-green","seq-orange-red-dark","seq-gray-lightgreen-bright","seq-lightmagenta-darkgray-bright","seq-lightblue-darkgray-bright","seq-blue-gray-bright"],B=["div-bluegreen-yellow-orange","div-orange-yellow-blue-light","div-green-yellow-redpurple","div-green-yellow-orange","div-green-gray-bright","div-red-blue-bright","div-blue-orange-bright","div-blue-lightgreen-bright","div-red-gray-bright","div-blue-gray-bright","div-red-lightgreen-bright","div-green-teal-bright","div-lightgreen-yellow-bright","div-lightred-gray-bright","div-rdbu","div-bluegreen-orange","div-orange-purple","div-bluegreen-purple","div-orange-pink","div-blue-yellow-red-bright","div-red-green-bright","div-orange-gray-bright","div-blue-green-bright","div-purple-brown-bright","div-blue-brown-bright","div-teal-brown-bright","div-lightblue-gray-bright","div-lightgreen-gray-bright","div-yellow-green-bright","div-green-darkgray-bright","div-redpurple-blue","div-orange-blue","div-green-pink","div-bluegreen-redpurple","div-green-redpurple","div-green-orange","div-red-yellow-pink","div-blue-green","div-bluegreen-yellow-redpurple","div-bluegreen-pink","div-red-yellow-purple","div-orange-yellow-pink","div-orange-yellow-blue-dark","div-lightmagenta-gray-bright","div-lightblue-yellow-bright","div-blue-red-bright-1","div-yellow-gray-purple","div-red-gray-blue","div-green-gray-purple","div-orange-gray-blue"],C=["div-brbg","div-piyg","div-prgn","div-puor","div-rdbu","div-rdgy","div-rdylbu","div-rdylgn","div-spectral"],z=["seq-blue-bright-1","seq-green-bright-1","seq-green-bright-2","seq-green-bright-3","seq-blue-bright-2","seq-blue-bright-3","seq-blue-bright-4","seq-blue-bright-5","seq-red-purple-bright","seq-red-magenta-bright","seq-red-bright-3","seq-red-bright-4","seq-yellow-bright-1","seq-yellow-bright-2","seq-yellow-bright-3","seq-yellow-bright-4","seq-yellow-gray-bright","seq-green-gray-bright","seq-blue-gray-bright","seq-red-gray-bright","seq-gray-redbright","seq-gray-green-bright","seq-gray-blue-bright","seq-gray-purple-bright","seq-plaingray-bright","seq-greengray-bright","seq-coolgray-bright","seq-warmgray-bright","seq-yellow-green-combo-bright","seq-cyan-blue-combo-bright","seq-magenta-purple-combo-bright"],O=["div-yellow-orange-purple-bright","div-yellow-blue-bright-1","div-yellow-blue-bright-2","div-yellow-blue-bright","div-yellow-blue-bright-3","div-yellow-purple-bright-1","div-yellow-purple-bright-2","div-yellow-red-bright-1","div-yellow-red-bright-2","div-yellow-gray-bright-1","div-yellow-gray-bright-2","div-yellow-gray-bright-3","div-purple-green-bright-1","div-purple-green-bright-2","div-pink-yellow-bright-1","div-pink-yellow-bright-2","div-red-blue-bright-1","div-red-blue-bright-2","div-orange-blue-bright-3","div-orange-blue-bright-4","div-red-purple-bright","div-red-gray-bright-1","div-red-gray-bright-2","div-red-gray-bright-3","div-teal-yellow-bright-1","div-teal-yellow-bright-2","div-teal-orange-bright","div-green-red-bright","div-green-magenta-bright","div-green-purple-bright-1","div-green-purple-bright-2","div-green-blue-bright-1","div-green-blue-bright-2","div-green-gray-bright-1","div-green-gray-bright-2","div-green-gray-bright-3","div-blue-green-bright-1","div-blue-yellow-bright-2","div-blue-lightorange-bright","div-blue-orange-bright-1","div-blue-orange-bright-2","div-blue-red-bright-1","div-blue-red-bright-2","div-blue-tan-bright","div-blue-gray-bright-1","div-blue-gray-bright-2","div-blue-gray-bright-3"],D=["div-blue-yellow-brown","div-purple-yellow-brown","div-purple-beige-green","div-teal-yellow-brown","div-yellow-magenta-light","div-green-yellow-blue","div-brown-blue","div-red-green-cyan","div-yellow-slate-teal","div-blue-green-orange","div-purple-orange","div-purple-green","div-teal-orange","div-red-purple-blue","div-yellow-magenta","div-green-blue","div-blue-brown","div-red-cyan","div-yellow-teal"],G=["seq-magenta","seq-red","seq-orange","seq-yellow","seq-yellowgreen","seq-green","seq-turquoise","seq-royal","seq-blueberry","seq-purple","seq-brown","seq-blue","seq-red-darkblue","seq-purple-darkgreen","seq-blue-darkgreen","seq-green-darkpurple","seq-blue-gray","seq-magenta-light","seq-red-light","seq-orange-light","seq-mustard-light","seq-yellowgreen-light","seq-green-light","seq-aqua-light","seq-cyan-light","seq-blue-light","seq-purple-light","seq-brown-light","seq-steel-light","seq-brown-palegreen","seq-purple-pink-yellow","seq-blue-green-yellow","seq-green-avocado-lightpurple","seq-turquoise-lightgreen","seq-red-brown-white","seq-purple-pink-white","seq-blue-green-white","seq-green-avocado-white","seq-turquoise-lightgreen-white","seq-mentone-beach","seq-snowy-mountain","seq-snow-cactus","seq-subdued-red-yellow","seq-subdued-purple-blue","seq-subdued-blue-cyan","seq-subdued-green-yellow","seq-subdued-green","seq-subdued-brown-tan","seq-subdued-gray-green","seq-subdued-green-tan","seq-subdued-blue-purple","seq-subdued-pink-brown","seq-subdued-green-pink","seq-lines-blue-orange","seq-lines-purple-brown","seq-lines-green-brown","seq-lines-yellow-blue","seq-esribrand-red","seq-esribrand-red-orange","seq-esribrand-orange","seq-esribrand-orangeyellow","seq-esribrand-yellow","seq-esribrand-yellowgreen","seq-esribrand-green","seq-esribrand-greenblue","seq-esribrand-blue","seq-esribrand-violet","seq-esribrand-violetred","seq-esribrand-brown","seq-esribrand-gray"],T=["div-green-purple","div-blue-red","div-green-magenta","div-blue-orange","div-blue-yellow","div-purple-yellow","div-magenta-yellow","div-purple-green-dark","div-green-brown","div-green-gray","div-blue-white","div-red-steel","div-aqua-darkgray-red","div-green-purple-light","div-blue-red-light","div-green-purple-light-2","div-cyan-blue-light","div-blue-yellow-light","div-purple-yellow-light","div-magenta-yellow-light","div-purple-green-light","div-blue-blue","div-green-green","div-blue-green-light","div-red-green-light","div-blue-yellow-brown-light","div-blue-white-brown","div-subdued-red-green","div-subdued-red-purple","div-subdued-brown-gray","div-subdued-sepia-gray","div-subdued-blue-gray","div-subdued-tan-blue","div-subdued-green-blue","div-subdued-green-pink","div-subdued-green-brown","div-lines-blue-brown","div-lines-green-purple","div-lines-red-gray","div-lines-green-orange","div-lines-yellow-blue","div-esribrand-red-bluegreen","div-esribrand-red-blue","div-esribrand-red-violet","div-esribrand-red-violetred","div-esribrand-red-gray","div-esribrand-redorange-greenblue","div-esribrand-redorange-blue","div-esribrand-redorange-violet","div-esribrand-redorange-violetred","div-esribrand-redorange-gray","div-esribrand-orange-greenblue","div-esribrand-orange-blue","div-esribrand-orange-violet","div-esribrand-orange-violetred","div-esribrand-orange-gray","div-esribrand-orangeyellow-greenblue","div-esribrand-orangeyellow-blue","div-esribrand-orangeyellow-violet","div-esribrand-orangeyellow-violetred","div-esribrand-orangeyellow-gray","div-esribrand-yellow-green-blue","div-esribrand-yellow-blue","div-esribrand-yellow-violet","div-esribrand-yellow-violetred","div-esribrand-yellow-brown","div-esribrand-yellow-gray","div-esribrand-yellowgreen-greenblue","div-esribrand-yellowgreen-blue","div-esribrand-yellowgreen-violet","div-esribrand-yellowgreen-violetred","div-esribrand-yellowgreen-brown","div-esribrand-yellowgreen-gray","div-esribrand-green-blue","div-esribrand-green-violet","div-esribrand-green-violetred","div-esribrand-green-gray","div-esribrand-greenblue-blue","div-esribrand-greenblue-violetred","div-esribrand-greenblue-brown","div-esribrand-greenblue-gray","div-esribrand-blue-brown","div-esribrand-blue-gray","div-esribrand-violet-brown","esribrand-violet-gray","div-esribrand-violetred-gray","div-esribrand-brown-gray"],F={streets:["streets","streets-vector","streets-relief-vector","streets-navigation-vector"],light:["gray","gray-vector"],topo:["topo","topo-vector"],terrain:["terrain"],"national-geographic":["national-geographic"],oceans:["oceans"],osm:["osm"],satellite:["satellite"],hybrid:["hybrid"],dark:["dark-gray","dark-gray-vector","streets-night-vector"]},S=["extremesdiv-orange-gray-blue","extremesdiv-yellow-gray-purple","extremesdiv-red-gray-blue","extremesdiv-green-gray-purple"],j=["point-cloud-elevation-scheme","point-cloud-intensity-scheme"],I={streets:{common:h.lightBasemaps,primary:"seq-yellow-red-purple",secondary:f.filter((e=>"seq-yellow-red-purple"!==e)).concat(G).concat(z).concat(k).concat(j)},light:{common:h.grayBasemaps,primary:"seq-single-blues",secondary:f.concat(G).concat(z).concat(k).concat(j).filter((e=>"seq-single-blues"!==e))},topo:{common:h.lightBasemaps,primary:"seq-yellow-green-blue",secondary:f.filter((e=>"seq-yellow-green-blue"!==e)).concat(G).concat(z).concat(k).concat(j)},terrain:{common:h.lightBasemaps,primary:"seq-pink-red",secondary:f.filter((e=>"seq-pink-red"!==e)).concat(G).concat(z).concat(k).concat(j)},"national-geographic":{common:h.lightBasemaps,primary:"seq-yellow-orange-red",secondary:f.filter((e=>"seq-yellow-orange-red"!==e)).concat(G).concat(z).concat(k).concat(j)},oceans:{common:h.lightBasemaps,primary:"seq-yellow-green-blue",secondary:f.filter((e=>"seq-yellow-green-blue"!==e)).concat(G).concat(z).concat(k).concat(j)},osm:{common:h.lightBasemaps,primary:"seq-red-blue-green",secondary:f.filter((e=>"seq-red-blue-green"!==e)).concat(G).concat(z).concat(k).concat(j)},satellite:{common:h.darkBasemaps,primary:"seq-orange-red-dark",secondary:f.filter((e=>"seq-orange-red-dark"!==e)).concat(G).concat(z).concat(k).concat(j)},hybrid:{common:h.darkBasemaps,primary:"seq-orange-red-dark",secondary:f.filter((e=>"seq-orange-red-dark"!==e)).concat(G).concat(z).concat(k).concat(j)},dark:{common:h.grayBasemaps,primary:"seq-blue-gray-bright",secondary:f.concat(G).concat(z).concat(k).concat(j).filter((e=>"seq-blue-gray-bright"!==e))}},E=a({themeDictionary:{"high-to-low":{name:"high-to-low",label:"TODO",description:"TODO",basemapGroups:F,schemes:{default:I}},"above-and-below":{name:"above-and-below",label:"TODO",description:"TODO",basemapGroups:F,schemes:{default:{streets:{common:h.lightBasemaps,primary:"div-bluegreen-yellow-orange",secondary:B.filter((e=>"div-bluegreen-yellow-orange"!==e)).concat(T).concat(O).concat(D).concat(C)},light:{common:h.grayBasemaps,primary:"div-rdbu",secondary:B.filter((e=>"div-rdbu"!==e)).concat(T).concat(O).concat(D).concat(C)},topo:{common:h.lightBasemaps,primary:"div-orange-pink",secondary:B.filter((e=>"div-orange-pink"!==e)).concat(T).concat(O).concat(D).concat(C)},terrain:{common:h.lightBasemaps,primary:"div-bluegreen-orange",secondary:B.filter((e=>"div-bluegreen-orange"!==e)).concat(T).concat(O).concat(D).concat(C)},"national-geographic":{common:h.lightBasemaps,primary:"div-orange-yellow-blue-light",secondary:B.filter((e=>"div-orange-yellow-blue-light"!==e)).concat(T).concat(O).concat(D).concat(C)},oceans:{common:h.lightBasemaps,primary:"div-red-yellow-pink",secondary:B.filter((e=>"div-red-yellow-pink"!==e)).concat(T).concat(O).concat(D).concat(C)},osm:{common:h.lightBasemaps,primary:"div-bluegreen-pink",secondary:B.filter((e=>"div-bluegreen-pink"!==e)).concat(T).concat(O).concat(D).concat(C)},satellite:{common:h.darkBasemaps,primary:"div-blue-green-bright",secondary:B.filter((e=>"div-blue-green-bright"!==e)).concat(T).concat(O).concat(D).concat(C)},hybrid:{common:h.darkBasemaps,primary:"div-blue-green-bright",secondary:B.filter((e=>"div-blue-green-bright"!==e)).concat(T).concat(O).concat(D).concat(C)},dark:{common:h.grayBasemaps,primary:"div-blue-red-bright-1",secondary:B.filter((e=>"div-blue-red-bright-1"!==e)).concat(T).concat(O).concat(D).concat(C)}}}},"centered-on":{name:"centered-on",label:"TODO",description:"TODO",basemapGroups:F,schemes:{default:{streets:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:u.filter((e=>"highlight-orange"!==e)).concat(m).concat(p)},light:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:u.filter((e=>"highlight-orange"!==e)).concat(m).concat(p)},topo:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:u.filter((e=>"highlight-orange"!==e)).concat(m).concat(p)},terrain:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:u.filter((e=>"highlight-orange"!==e)).concat(m).concat(p)},"national-geographic":{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"highlight-orange",primaryGray:"highlight-orange-gray",secondary:u.filter((e=>"highlight-orange"!==e)).concat(m).concat(p)},oceans:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"highlight-red",primaryGray:"highlight-red-gray",secondary:u.filter((e=>"highlight-red"!==e)).concat(m).concat(p)},osm:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"highlight-pink",primaryGray:"highlight-pink-gray",secondary:u.filter((e=>"highlight-pink"!==e)).concat(m).concat(p)},satellite:{common:{outline:d.light,width:"2px",size:"8px"},primary:"highlight-orange-dark",primaryGray:"highlight-orange-gray-dark",secondary:u.filter((e=>"highlight-orange-dark"!==e)).concat(m).concat(p)},hybrid:{common:{outline:d.light,width:"2px",size:"8px"},primary:"highlight-orange-dark",primaryGray:"highlight-orange-gray-dark",secondary:u.filter((e=>"highlight-orange-dark"!==e)).concat(m).concat(p)},dark:{common:{outline:d.light,width:"2px",size:"8px"},primary:"highlight-orange-bright",primaryGray:"highlight-orange-gray-bright",secondary:u.filter((e=>"highlight-orange-bright"!==e)).concat(m).concat(p)}}}},extremes:{name:"extremes",label:"TODO",description:"TODO",basemapGroups:F,schemes:{default:{streets:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"extremesdiv-bluegreen-yellow-orange",primaryGray:"extremes-bluegreen-gray",secondary:v.filter((e=>"extremesdiv-bluegreen-yellow-orange"!==e)).concat(q).concat(w)},light:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"extremesdiv-orange-purple",primaryGray:"extremes-orange-gray",secondary:v.filter((e=>"extremesdiv-orange-purple"!==e)).concat(q).concat(w)},topo:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"extremesdiv-orange-pink",primaryGray:"extremes-orange-gray",secondary:v.filter((e=>"extremesdiv-orange-pink"!==e)).concat(q).concat(w)},terrain:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"extremesdiv-bluegreen-orange",primaryGray:"extremes-bluegreen-gray",secondary:v.filter((e=>"extremesdiv-bluegreen-orange"!==e)).concat(q).concat(w)},"national-geographic":{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"extremesdiv-orange-yellow-blue-light",primaryGray:"extremes-orange-gray",secondary:v.filter((e=>"extremesdiv-orange-yellow-blue-light"!==e)).concat(q).concat(w)},oceans:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"extremesdiv-red-yellow-pink",primaryGray:"extremes-red-gray",secondary:v.filter((e=>"extremesdiv-red-yellow-pink"!==e)).concat(q).concat(w)},osm:{common:{outline:d.lighter,width:"2px",size:"8px"},primary:"extremesdiv-bluegreen-pink",primaryGray:"extremes-bluegreen-gray",secondary:v.filter((e=>"extremesdiv-bluegreen-pink"!==e)).concat(q).concat(w)},satellite:{common:{outline:d.light,width:"2px",size:"8px"},primary:"extremesdiv-orange-yellow-blue-dark",primaryGray:"extremes-orange-gray-dark",secondary:v.filter((e=>"extremesdiv-orange-yellow-blue-dark"!==e)).concat(w).concat(q)},hybrid:{common:{outline:d.light,width:"2px",size:"8px"},primary:"extremesdiv-orange-yellow-blue-dark",primaryGray:"extremes-orange-gray-dark",secondary:v.filter((e=>"extremesdiv-orange-yellow-blue-dark"!==e)).concat(w).concat(q)},dark:{common:{outline:d.light,width:"2px",size:"8px"},primary:"extremesdiv-orange-yellow-blue-dark",primaryGray:"extremes-orange-gray-bright",secondary:v.filter((e=>"extremesdiv-orange-yellow-blue-dark"!==e)).concat(w).concat(q)}}}},above:{name:"above",label:"TODO",description:"TODO",basemapGroups:F,schemes:{default:I}},below:{name:"below",label:"TODO",description:"TODO",basemapGroups:F,schemes:{default:I}},"90-10":{name:"90-10",label:"TODO",description:"TODO",basemapGroups:F,schemes:{default:I}}}});function U(e){return l(E,e)}function A(e){const i=e.theme,a=t({basemap:e.basemap,basemapTheme:e.basemapTheme,theme:E.get(i)});if(!a)return;let l=a.schemesInfo;const o=l.common,{basemapId:g,basemapTheme:n}=a;!e.worldScale||"centered-on"!==i&&"extremes"!==i||(l={...l},l.secondary=l.secondary.slice(0),l.secondary.push(l.primary),l.primary=l.primaryGray,delete l.primaryGray,l.secondary=l.secondary.filter((e=>{const r=e.includes("gray"),i=S.includes(e);return e!==l.primary&&r&&!i})));const s={...e,basemap:g};return{primaryScheme:Q(s,l.primary,o),secondarySchemes:l.secondary.map((e=>Q(s,e,o))).filter(r),basemapId:g,basemapTheme:n}}function H(e){return o(e.name,A(e))}function J(e){return g(e.includedTags,e.excludedTags,A(e))}function K(e){let r,i,a="";const l=e.id;if(l){const e=l.split("/");e&&(a=e[0],r=e[1],i=e[2])}const o=t({basemap:r,theme:E.get(a)});if(!o)return;const{schemesInfo:g}=o;return Q({theme:a,basemap:r,geometryType:e.geometryType,worldScale:e.worldScale,view:e.view},i,g.common)}function L(r){if(!r)return;const i={...r};return i.colors=i.colors.map((r=>new e(r))),i.tags=[...i.tags],i.colorsForClassBreaks=i.colorsForClassBreaks.map((r=>({numClasses:r.numClasses,colors:r.colors.map((r=>new e(r)))}))),i.noDataColor&&(i.noDataColor=new e(i.noDataColor)),"outline"in i&&i.outline&&(i.outline={color:i.outline.color&&new e(i.outline.color),width:i.outline.width}),i}function M(e){const r=e;return r.colors.reverse(),r.colorsForClassBreaks.forEach((e=>{e.colors.reverse()})),r}function N(e){const r=e.theme,i=e.colors,a=E.get(r).supportedBasemaps,l=[],o={theme:r,basemap:null,geometryType:e.geometryType,worldScale:e.worldScale,view:e.view};return a.forEach((e=>{const a=t({basemap:e,theme:E.get(r)}).schemesInfo;if(o.basemap=e,a){const e=P(Q(o,a.primary,a.common),i);e&&l.push(e),a.secondary.forEach((e=>{const r=P(Q(o,e,a.common),i);r&&l.push(r)}))}})),l}function P(e,r){let i,a;if(a=n(e.colors,r),a)i=a>0?e:M(e);else{let l;e.colorsForClassBreaks.some((e=>(e.numClasses===r.length&&(l=e.colors),!!l))),l&&(a=n(l,r),a&&(i=a>0?e:M(e)))}return i}function Q(e,r,a){const l=i[r];if(!l)return;const t=e.theme,o="mesh"!==e.geometryType&&e.worldScale?e.view:null;let g=a.fillOpacity;null==g&&null!=r&&x.includes(r)&&(g=.8);const n="below"===e.theme,s=n?[...l.stops].reverse():l.stops,d=[];for(const i in l)if("stops"!==i&&"name"!==i&&"tags"!==i){const e=+i;d.push({numClasses:e,colors:n?[...l[e]].reverse():l[e]})}const h=null!=r&&x.includes(r)?c:b,u=t+"/"+e.basemap+"/"+r,p=g||1;switch(e.geometryType){case"point":case"multipoint":return R({id:u,name:l.name,tags:l.tags,theme:t,opacity:p,colors:s,colorsForClassBreaks:d,noDataColor:h,outline:a.outline,size:a.size},o);case"polyline":return V({id:u,name:l.name,tags:l.tags,theme:t,opacity:p,colors:s,colorsForClassBreaks:d,noDataColor:h,width:a.width},o);case"polygon":return W({id:u,name:l.name,tags:l.tags,theme:t,opacity:p,colors:s,colorsForClassBreaks:d,noDataColor:h,outline:a.outline,size:y},o);case"mesh":return X({id:u,name:l.name,tags:l.tags,theme:t,opacity:p,colors:s,colorsForClassBreaks:d,noDataColor:h});default:return}}function R(r,i){return{id:r.id,name:r.name,tags:[...r.tags],theme:r.theme,colors:r.colors.map((r=>new e(r))),colorsForClassBreaks:Y(r.colorsForClassBreaks),noDataColor:new e(r.noDataColor),outline:{color:new e(r.outline.color),width:r.outline.width},size:i&&"3d"===i.type?s(r.size,i):r.size,opacity:r.opacity}}function V(r,i){return{id:r.id,name:r.name,tags:[...r.tags],theme:r.theme,colors:r.colors.map((r=>new e(r))),colorsForClassBreaks:Y(r.colorsForClassBreaks),noDataColor:new e(r.noDataColor),width:i&&"3d"===i.type?s(r.width,i):r.width,opacity:r.opacity}}function W(r,i){return{id:r.id,name:r.name,tags:[...r.tags],theme:r.theme,colors:r.colors.map((r=>new e(r))),colorsForClassBreaks:Y(r.colorsForClassBreaks),noDataColor:new e(r.noDataColor),outline:{color:new e(r.outline.color),width:r.outline.width},opacity:r.opacity,size:i&&"3d"===i.type?s(r.size,i):r.size}}function X(r){return{id:r.id,name:r.name,tags:[...r.tags],theme:r.theme,colors:r.colors.map((r=>new e(r))),colorsForClassBreaks:Y(r.colorsForClassBreaks),noDataColor:new e(r.noDataColor),opacity:r.opacity}}function Y(r){return r.map((r=>({numClasses:r.numClasses,colors:r.colors.map((r=>new e(r)))})))}export{L as cloneScheme,M as flipColors,N as getMatchingSchemes,K as getSchemeById,H as getSchemeByName,A as getSchemes,J as getSchemesByTag,U as getThemes,z as seqColorSets2019,G as seqColorSets2021,k as seqColorSetsFromPortal};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- const a="20230519",c="d18906c709a82a8c5e777fca9b3351bb8a40d6f0";export{a as buildDate,c as commitHash};
5
+ const e="20230521",b="8a3d9849005d1e5d3b60c4e100e2101ee40bbbbc";export{e as buildDate,b 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e}from"../../core/reactiveUtils.js";import{addFrameTask as t}from"../../core/scheduling.js";class a{constructor(e){this.view=e,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions)},this.update=()=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{basemapView:e,graphicsView:t,labelManager:a,layerViews:s,state:{id:i}}=this.view;e?.baseLayerViews.forEach(this._updateLayerView,this),s.forEach(this._updateLayerView,this),e?.referenceLayerViews.forEach(this._updateLayerView,this),null!=a&&(a.lastUpdateId!==i&&(a.viewChange(),a.lastUpdateId=i),a.updateRequested&&a.processUpdate(this._updateParameters)),null!=t&&(t.lastUpdateId!==i&&(t.viewChange(),t.lastUpdateId=i),t.updateRequested&&t.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||this._frameTaskHandle?.pause()}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const a=this.view;this.stationary=a.stationary,this._updateParameters={state:a.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:a.renderingOptions},this._stationaryHandle=e((()=>a.stationary),(e=>{this.stationary=e,this.requestFrame()})),this._frameTaskHandle=t(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(e){if(!e.attached)return void this.requestUpdate();const t=this.view.state,a=e.lastUpdateId;null!=a&&(this.stationary||e.moving)||(e.moving=!0,e.moveStart()),a!==t.id&&e.viewChange(),this.stationary&&e.moving&&(e.moving=!1,e.moveEnd()),e.lastUpdateId=t.id,e.updateRequested&&e.processUpdate(this._updateParameters),"layerViews"in e&&e.layerViews.forEach(this._updateLayerView,this)}}export{a as default};
5
+ import{watch as t}from"../../core/reactiveUtils.js";import{addFrameTask as e}from"../../core/scheduling.js";class a{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions)},this.update=()=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:t,graphicsView:e,labelManager:a,state:{id:s}}=this.view;t.forEach(this._updateLayerView,this),null!=a&&(a.lastUpdateId!==s&&(a.viewChange(),a.lastUpdateId=s),a.updateRequested&&a.processUpdate(this._updateParameters)),null!=e&&(e.lastUpdateId!==s&&(e.viewChange(),e.lastUpdateId=s),e.updateRequested&&e.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||this._frameTaskHandle?.pause()}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const a=this.view;this.stationary=a.stationary,this._updateParameters={state:a.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:a.renderingOptions},this._stationaryHandle=t((()=>a.stationary),(t=>{this.stationary=t,this.requestFrame()})),this._frameTaskHandle=e(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,a=t.lastUpdateId;null!=a&&(this.stationary||t.moving)||(t.moving=!0,t.moveStart()),a!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}}export{a 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import"../../core/Error.js";import{HandleOwnerMixin as s}from"../../core/HandleOwner.js";import has from"../../core/has.js";import"../../core/Logger.js";import{removeMaybe as i}from"../../core/maybe.js";import{throttle as o}from"../../core/throttle.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{CollisionEngine as p}from"./engine/webgl/collisions/CollisionEngine.js";const l=32;let d=class extends(s(t)){constructor(e){super(e),this._applyVisibilityPassThrottled=o(this._applyVisibilityPass,l,this),this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}initialize(){this.collisionEngine=new p}destroy(){this.collisionEngine=null,this._applyVisibilityPassThrottled=i(this._applyVisibilityPassThrottled)}get updating(){return has("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}:\n-> updateRequested: ${this.updateRequested}`),this.updateRequested}update(e){this._applyVisibilityPassThrottled(e)}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this._set("updateParameters",e),this.updateRequested&&(this.updateRequested=!1,this.update(e))}_applyVisibilityPass(e){const t=this.view;if(t)try{const s=t.featuresTilingScheme.getClosestInfoForScale(e.state.scale).level;this.collisionEngine.run(t.allLayerViews.items,e,s)}catch(s){}}};e([r()],d.prototype,"updateRequested",void 0),e([r({readOnly:!0})],d.prototype,"updateParameters",void 0),e([r()],d.prototype,"updating",null),e([r()],d.prototype,"view",void 0),d=e([a("esri.views.2d.layers.labels.LabelManager")],d);const u=d;export{u as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import"../../core/Error.js";import{HandleOwnerMixin as s}from"../../core/HandleOwner.js";import has from"../../core/has.js";import"../../core/Logger.js";import{throttle as i}from"../../core/throttle.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{CollisionEngine as a}from"./engine/webgl/collisions/CollisionEngine.js";const p=32;let l=class extends(s(t)){constructor(e){super(e),this.collisionEngine=new a,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null,this._applyVisibilityPass=i((e=>{const t=this.view;if(t)try{const s=t.featuresTilingScheme.getClosestInfoForScale(e.state.scale).level;this.collisionEngine.run(t.allLayerViews.items,e,s)}catch(s){}}),p,this),this.addHandles(this._applyVisibilityPass)}get updating(){return has("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}:\n-> updateRequested: ${this.updateRequested}`),this.updateRequested}update(e){this._applyVisibilityPass(e)}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}};e([o()],l.prototype,"updateRequested",void 0),e([o()],l.prototype,"updating",null),e([o()],l.prototype,"view",void 0),l=e([r("esri.views.2d.layers.labels.LabelManager")],l);const d=l;export{d 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{applySome as t}from"../../../core/maybe.js";import{createResolver as e,onAbortOrThrow as s,throwIfNotAbortError as i}from"../../../core/promiseUtils.js";import{g as r,h,r as o,k as u,m as a}from"../../../chunks/mat3.js";import{c as n}from"../../../chunks/mat3f32.js";import{f as d}from"../../../chunks/vec2f32.js";import{DisplayObject as l}from"./DisplayObject.js";import c from"./ImageryBitmapSource.js";import{ContextType as _}from"../../webgl/contextUtils.js";import{SizedPixelFormat as p,PixelFormat as m,TextureWrapMode as x}from"../../webgl/enums.js";import{Texture as g}from"../../webgl/Texture.js";import{TextureDescriptor as f}from"../../webgl/TextureDescriptor.js";function w(t){return t&&"render"in t}function b(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function v(e){return w(e)?e instanceof c?t(e.getRenderedRasterPixels(),(t=>t.renderedRasterPixels)):b(e):e}class T extends l{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),null!=this._uploadStatus&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return void 0!==this._height?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){null==t&&null==this._source||(this._source=t,this.invalidateTexture(),this.requestRender())}get width(){return void 0!==this._width?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,i){null!=this._uploadStatus&&this._uploadStatus.controller.abort();const r=new AbortController,h=e();return s(i,(()=>r.abort())),s(r,(t=>h.reject(t))),this._uploadStatus={controller:r,resolver:h},this.source=t,h.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}updateTransitionProperties(t,e){t>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(t,e)}setTransform(t){const e=r(this.transforms.dvs),[s,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),n=this.resolution/this.pixelRatio/t.resolution,l=n*this.width,c=n*this.height,_=Math.PI*this.rotation/180;h(e,e,d(s,i)),h(e,e,d(l/2,c/2)),o(e,e,-_),h(e,e,d(-l/2,-c/2)),u(e,e,d(l,c)),a(this.transforms.dvs,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const s=v(this.source);try{if(null!=this._uploadStatus){const{controller:t,resolver:i}=this._uploadStatus,r={signal:t.signal},{width:h,height:o}=this,u=this._texture,a=e.textureUploadManager;await a.enqueueTextureUpdate({data:s,texture:u,width:h,height:o},r),i.resolve(),this._uploadStatus=null}else this._texture.setData(s);this.ready()}catch(r){i(r)}}onDetach(){this.destroy()}_createTransforms(){return{dvs:n()}}_createTexture(t){const e=this.immutable&&t.type===_.WEBGL2,s=new f;return s.internalFormat=e?p.RGBA8:m.RGBA,s.wrapMode=x.CLAMP_TO_EDGE,s.isImmutable=e,s.width=this._sourceWidth,s.height=this._sourceHeight,new g(t,s)}}export{T as Bitmap,w as isImageSource,b as rasterize};
5
+ import{applySome as t}from"../../../core/maybe.js";import{createResolver as e,onAbortOrThrow as s,throwIfNotAbortError as i}from"../../../core/promiseUtils.js";import{g as r,h,r as o,l as u,m as a}from"../../../chunks/mat3.js";import{c as n}from"../../../chunks/mat3f32.js";import{f as d}from"../../../chunks/vec2f32.js";import{DisplayObject as l}from"./DisplayObject.js";import c from"./ImageryBitmapSource.js";import{ContextType as _}from"../../webgl/contextUtils.js";import{SizedPixelFormat as p,PixelFormat as m,TextureWrapMode as x}from"../../webgl/enums.js";import{Texture as g}from"../../webgl/Texture.js";import{TextureDescriptor as f}from"../../webgl/TextureDescriptor.js";function w(t){return t&&"render"in t}function b(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function v(e){return w(e)?e instanceof c?t(e.getRenderedRasterPixels(),(t=>t.renderedRasterPixels)):b(e):e}class T extends l{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),null!=this._uploadStatus&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return void 0!==this._height?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){null==t&&null==this._source||(this._source=t,this.invalidateTexture(),this.requestRender())}get width(){return void 0!==this._width?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,i){null!=this._uploadStatus&&this._uploadStatus.controller.abort();const r=new AbortController,h=e();return s(i,(()=>r.abort())),s(r,(t=>h.reject(t))),this._uploadStatus={controller:r,resolver:h},this.source=t,h.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}updateTransitionProperties(t,e){t>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(t,e)}setTransform(t){const e=r(this.transforms.dvs),[s,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),n=this.resolution/this.pixelRatio/t.resolution,l=n*this.width,c=n*this.height,_=Math.PI*this.rotation/180;h(e,e,d(s,i)),h(e,e,d(l/2,c/2)),o(e,e,-_),h(e,e,d(-l/2,-c/2)),u(e,e,d(l,c)),a(this.transforms.dvs,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const s=v(this.source);try{if(null!=this._uploadStatus){const{controller:t,resolver:i}=this._uploadStatus,r={signal:t.signal},{width:h,height:o}=this,u=this._texture,a=e.textureUploadManager;await a.enqueueTextureUpdate({data:s,texture:u,width:h,height:o},r),i.resolve(),this._uploadStatus=null}else this._texture.setData(s);this.ready()}catch(r){i(r)}}onDetach(){this.destroy()}_createTransforms(){return{dvs:n()}}_createTexture(t){const e=this.immutable&&t.type===_.WEBGL2,s=new f;return s.internalFormat=e?p.RGBA8:m.RGBA,s.wrapMode=x.CLAMP_TO_EDGE,s.isImmutable=e,s.width=this._sourceWidth,s.height=this._sourceHeight,new g(t,s)}}export{T as Bitmap,w as isImageSource,b as rasterize};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{on as t}from"../../../core/events.js";import has from"../../../core/has.js";import{removeMaybe as r}from"../../../core/maybe.js";import{addFrameTask as s}from"../../../core/scheduling.js";import{c as i}from"../../../chunks/mat3f32.js";import n from"../../../symbols/cim/CIMResourceManager.js";import{Container as a}from"./Container.js";import{BufferPool as o}from"./webgl/BufferPool.js";import{WGLDrawPhase as h}from"./webgl/enums.js";import d from"./webgl/Painter.js";import{Profiler as l}from"./webgl/Profiler.js";import{Timeline as c}from"../support/Timeline.js";import{resampleHermite as p}from"../../support/screenshotUtils.js";import{createContextForView as m}from"../../webgl/contextUtils.js";import{TextureWrapMode as u,SizedPixelFormat as f,PixelFormat as _,RenderbufferFormat as g,PixelType as b}from"../../webgl/enums.js";import{FramebufferObject as w}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as R}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as y}from"../../webgl/RenderingContext.js";import{TextureDescriptor as x}from"../../webgl/TextureDescriptor.js";import P from"../../webgl/capabilities/isWebGL2Context.js";import{createEmptyImageData as j}from"../../../core/imageUtils.js";const T=2e3;class L extends a{constructor(r,i){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this.renderRequested=!1,this.stage=this,this._stationary=!0;const{canvas:a=document.createElement("canvas"),alpha:h=!0,stencil:p=!0,contextOptions:u={}}=i;this._canvas=a;const f=m("2d",a,{alpha:h,antialias:!1,depth:!0,stencil:p});this.context=new y(f??null,u),this.resourceManager=new n,this.painter=new d(this.context,this,this.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),r.appendChild(this._debugOutput));const _=()=>this._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new c,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new l(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return _()}},this._taskHandle=s({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=t(a,"webglcontextlost",(t=>{this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)})})),this._bufferPool=new o,a.setAttribute("style","width: 100%; height:100%; display:block;"),r.appendChild(a)}destroy(){this.removeAllChildren(),this._emptyTrash(),this._taskHandle=r(this._taskHandle),this._lostWebGLContextHandle=r(this._lostWebGLContextHandle),this._canvas.parentNode?.removeChild(this._canvas),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.resourceManager.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get background(){return this._background}set background(e){this._background=e,this.requestRender()}get bufferPool(){return this._bufferPool}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=T,this.renderRequested||(this.renderRequested=!0,this.emit("will-render"),this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this.renderRequested=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash(),this.emit("post-render")}_createTransforms(){return{dvs:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._renderChildren(this.children,e);for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,t.drawPhase=h.MAP,this.painter.beforeRenderLayers(r,this.background);for(const s of e)s.processRender(t);this.painter.prepareDisplay(t,this.background,this.state.padding),this.painter.renderLayers(r),t.drawPhase=h.HIGHLIGHT,this.painter.beforeRenderLayers(r);for(const s of e)s.processRender(t);this.painter.renderLayers(r);if(this._isLabelDrawPhaseRequired(e)){t.drawPhase=h.LABEL,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}if(has("esri-tiles-debug")){t.drawPhase=h.DEBUG,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._resizeCanvas(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),super.doRender(e)}async takeScreenshot(e){const t=Math.round(this.state.size[0]*e.resolutionScale),r=Math.round(this.state.size[1]*e.resolutionScale),s=e.resolutionScale,i=this.context,n=this._state.clone();if(null!=e.rotation){const t=n.viewpoint;n.viewpoint.rotation=e.rotation,n.viewpoint=t}const a={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:n,pixelRatio:s,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1},o=P(i.gl),h=new x(t,r);h.wrapMode=u.CLAMP_TO_EDGE,h.internalFormat=o?f.RGBA8:_.RGBA,h.isImmutable=o;const d=new w(i,h,new R(g.DEPTH_STENCIL,t,r)),l=i.getBoundFramebufferObject(),c=i.getViewport();i.bindFramebuffer(d),i.setViewport(0,0,t,r),this._renderChildren(e.children,a);const m=this._readbackScreenshot(d,{...e.cropArea,y:r-(e.cropArea.y+e.cropArea.height)});i.bindFramebuffer(l),i.setViewport(c.x,c.y,c.width,c.height),this.requestRender();const b=await m;let y;return 1===e.outputScale?y=b:(y=new ImageData(Math.round(b.width*e.outputScale),Math.round(b.height*e.outputScale)),p(b,y,!0)),d.dispose(),y}async _readbackScreenshot(e,t){const r=j(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,_.RGBA,b.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_resizeCanvas(e){const t=this._canvas,r=t.style,{state:{size:s},pixelRatio:i}=e,n=s[0],a=s[1],o=Math.round(n*i),h=Math.round(a*i);t.width===o&&t.height===h||(t.width=o,t.height=h),r.width=n+"px",r.height=a+"px"}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}_isLabelDrawPhaseRequired(e){let t=!1;for(const r of e){if(!(r instanceof a)){t=t||!1;break}if("hasLabels"in r&&r.hasLabels)return!0;t=t||this._isLabelDrawPhaseRequired(r.children)}return t}}export{T as EXTRA_RENDER_TIME,L as Stage};
5
+ import e from"../../../core/Error.js";import{on as t}from"../../../core/events.js";import has from"../../../core/has.js";import{removeMaybe as r}from"../../../core/maybe.js";import{addFrameTask as s}from"../../../core/scheduling.js";import{c as i}from"../../../chunks/mat3f32.js";import n from"../../../symbols/cim/CIMResourceManager.js";import{Container as a}from"./Container.js";import{BufferPool as o}from"./webgl/BufferPool.js";import{WGLDrawPhase as h}from"./webgl/enums.js";import d from"./webgl/Painter.js";import{Profiler as l}from"./webgl/Profiler.js";import{Timeline as c}from"../support/Timeline.js";import{resampleHermite as p}from"../../support/screenshotUtils.js";import{createContextForView as m}from"../../webgl/contextUtils.js";import{TextureWrapMode as u,SizedPixelFormat as f,PixelFormat as _,RenderbufferFormat as g,PixelType as b}from"../../webgl/enums.js";import{FramebufferObject as w}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as R}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as y}from"../../webgl/RenderingContext.js";import{TextureDescriptor as x}from"../../webgl/TextureDescriptor.js";import P from"../../webgl/capabilities/isWebGL2Context.js";import{createEmptyImageData as C}from"../../../core/imageUtils.js";const j=2e3;class T extends a{constructor(r,i){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this.renderRequested=!1,this.stage=this,this._stationary=!0;const{canvas:a=document.createElement("canvas"),alpha:h=!0,stencil:p=!0,contextOptions:u={}}=i;this._canvas=a;const f=m("2d",a,{alpha:h,antialias:!1,depth:!0,stencil:p});this.context=new y(f??null,u),this.resourceManager=new n,this.painter=new d(this.context,this,this.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),r.appendChild(this._debugOutput));const _=()=>this._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new c,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new l(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return _()}},this._taskHandle=s({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=t(a,"webglcontextlost",(t=>{this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)})})),this._bufferPool=new o,a.setAttribute("style","width: 100%; height:100%; display:block;"),r.appendChild(a)}destroy(){this.removeAllChildren(),this._emptyTrash(),this._taskHandle=r(this._taskHandle),this._lostWebGLContextHandle=r(this._lostWebGLContextHandle),this._canvas.parentNode?.removeChild(this._canvas),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.resourceManager.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=j,this.renderRequested||(this.renderRequested=!0,this.emit("will-render"),this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this.renderRequested=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash(),this.emit("post-render")}_createTransforms(){return{dvs:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._renderChildren(this.children,e);for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,t.drawPhase=h.MAP,this.painter.beforeRenderLayers(r,this.backgroundColor);for(const s of e)s.processRender(t);this.painter.prepareDisplay(t,this.backgroundColor,this.state.padding),this.painter.renderLayers(r),t.drawPhase=h.HIGHLIGHT,this.painter.beforeRenderLayers(r);for(const s of e)s.processRender(t);this.painter.renderLayers(r);if(this._isLabelDrawPhaseRequired(e)){t.drawPhase=h.LABEL,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}if(has("esri-tiles-debug")){t.drawPhase=h.DEBUG,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._resizeCanvas(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),super.doRender(e)}async takeScreenshot(e){const t=Math.round(this.state.size[0]*e.resolutionScale),r=Math.round(this.state.size[1]*e.resolutionScale),s=e.resolutionScale,i=this.context,n=this._state.clone();if(null!=e.rotation){const t=n.viewpoint;n.viewpoint.rotation=e.rotation,n.viewpoint=t}const a={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:n,pixelRatio:s,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1},o=P(i.gl),h=new x(t,r);h.wrapMode=u.CLAMP_TO_EDGE,h.internalFormat=o?f.RGBA8:_.RGBA,h.isImmutable=o;const d=new w(i,h,new R(g.DEPTH_STENCIL,t,r)),l=i.getBoundFramebufferObject(),c=i.getViewport();i.bindFramebuffer(d),i.setViewport(0,0,t,r),this._renderChildren(e.children,a);const m=this._readbackScreenshot(d,{...e.cropArea,y:r-(e.cropArea.y+e.cropArea.height)});i.bindFramebuffer(l),i.setViewport(c.x,c.y,c.width,c.height),this.requestRender();const b=await m;let y;return 1===e.outputScale?y=b:(y=new ImageData(Math.round(b.width*e.outputScale),Math.round(b.height*e.outputScale)),p(b,y,!0)),d.dispose(),y}async _readbackScreenshot(e,t){const r=C(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,_.RGBA,b.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_resizeCanvas(e){const t=this._canvas,r=t.style,{state:{size:s},pixelRatio:i}=e,n=s[0],a=s[1],o=Math.round(n*i),h=Math.round(a*i);t.width===o&&t.height===h||(t.width=o,t.height=h),r.width=n+"px",r.height=a+"px"}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}_isLabelDrawPhaseRequired(e){let t=!1;for(const r of e){if(!(r instanceof a)){t=t||!1;break}if("hasLabels"in r&&r.hasLabels)return!0;t=t||this._isLabelDrawPhaseRequired(r.children)}return t}}export{j as EXTRA_RENDER_TIME,T as Stage};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as t}from"../../../../core/mathUtils.js";import{j as s,d as a,h as e,r as i}from"../../../../chunks/mat3.js";import{c as r}from"../../../../chunks/mat3f32.js";import{DisplayObject as n}from"../DisplayObject.js";class o extends n{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){null!=this._displayData&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(r){const{displayData:n}=this;if(null==n)return;const o=n.extent.xmin,l=n.extent.ymax,p=[0,0];r.toScreen(p,[o,l]);const m=(n.extent.xmax-n.extent.xmin)/n.size[0]/r.resolution,d=t(r.rotation),{dvs:c}=this.transforms;s(c,[-1,1,0]),a(c,c,[2/(r.size[0]*r.pixelRatio),-2/(r.size[1]*r.pixelRatio),1]),e(c,c,[p[0],p[1],0]),i(c,c,d),a(c,c,[m*r.pixelRatio,m*r.pixelRatio,1])}_createTransforms(){return{dvs:r()}}}export{o as FlowDisplayObject};
5
+ import{deg2rad as t}from"../../../../core/mathUtils.js";import{k as s,d as a,h as e,r as i}from"../../../../chunks/mat3.js";import{c as r}from"../../../../chunks/mat3f32.js";import{DisplayObject as n}from"../DisplayObject.js";class o extends n{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){null!=this._displayData&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(r){const{displayData:n}=this;if(null==n)return;const o=n.extent.xmin,l=n.extent.ymax,p=[0,0];r.toScreen(p,[o,l]);const m=(n.extent.xmax-n.extent.xmin)/n.size[0]/r.resolution,d=t(r.rotation),{dvs:c}=this.transforms;s(c,[-1,1,0]),a(c,c,[2/(r.size[0]*r.pixelRatio),-2/(r.size[1]*r.pixelRatio),1]),e(c,c,[p[0],p[1],0]),i(c,c,d),a(c,c,[m*r.pixelRatio,m*r.pixelRatio,1])}_createTransforms(){return{dvs:r()}}}export{o as FlowDisplayObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../core/maybe.js";import{g as t,h as s,r,k as i,m as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as u}from"../../../../chunks/vec2f32.js";import{DisplayObject as n}from"../DisplayObject.js";import{TextureSamplingMode as h}from"../../../webgl/enums.js";import{createTransformTexture as l,createRasterTexture as d,createColormapTexture as _}from"../../../webgl/rasterUtils.js";const p={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class x extends n{constructor(e=null,t=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e)}get processed(){return this._processed}set processed(t){this._processed=t,t||(e(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||p}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdschanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(e||"nearest")?h.LINEAR:h.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(t){this._transformGrid=t,this._transformGridTexture=e(this._transformGridTexture)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}_createTransforms(){return{dvs:a()}}setTransform(e){const a=t(this.transforms.dvs),[n,h]=e.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/e.resolution,d=l*this.width,_=l*this.height,p=Math.PI*this.rotation/180;s(a,a,u(n,h)),s(a,a,u(d/2,_/2)),r(a,a,-p),s(a,a,u(-d/2,-_/2)),i(a,a,u(d,_)),o(this.transforms.dvs,e.displayViewMat3,a)}getTextures({forProcessing:e=!1,useProcessedTexture:t=!1}={}){const s=t?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?t?(i.push(s),r.push("u_image"),this._colormapTexture&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):(this._transformGridTexture&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),i.push(s),r.push("u_image"),this._colormapTexture&&!e&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const t=this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=l(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;0!==e.length&&(this.processedTexture=e.shift(),e.forEach((e=>e?.dispose())),e.length=0)}_createOrDestroyRasterTexture(e){const t=this.source?.extractBands(this.bandIds);if(!this._isValidSource(t))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloat?.textureFloatLinear;const r=this._getTextureSamplingMethod(this.interpolation),i=this.isRendereredSource||!e.capabilities.textureFloat?.textureFloat;this._rasterTexture=d(e,t,r,i),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(e){const t=this._rasterTextureBandIds;return!(null==t&&null==e||t&&e&&t.join("")===e.join(""))}_isValidSource(e){return null!=e&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:t,colormap:s}=this.symbolizerParameters,r="lut"===t||"stretch"===t&&null!=s;return!this._supportsBilinearTexture||r||"bilinear"!==e&&"cubic"!==e?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,s=this.symbolizerParameters.colormap;return s?t?s.length!==t.length||s.some(((e,s)=>e!==t[s]))?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=_(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=_(e,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){this._transformGridTexture&&(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}class c extends x{get source(){return this._source}}function m(e){return null!=e.source}export{x as RasterBitmap,c as RasterBitmapWithSource,m as hasSource};
5
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{g as t,h as s,r,l as i,m as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as u}from"../../../../chunks/vec2f32.js";import{DisplayObject as n}from"../DisplayObject.js";import{TextureSamplingMode as h}from"../../../webgl/enums.js";import{createTransformTexture as l,createRasterTexture as d,createColormapTexture as _}from"../../../webgl/rasterUtils.js";const p={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class x extends n{constructor(e=null,t=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e)}get processed(){return this._processed}set processed(t){this._processed=t,t||(e(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||p}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdschanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(e||"nearest")?h.LINEAR:h.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(t){this._transformGrid=t,this._transformGridTexture=e(this._transformGridTexture)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}_createTransforms(){return{dvs:a()}}setTransform(e){const a=t(this.transforms.dvs),[n,h]=e.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/e.resolution,d=l*this.width,_=l*this.height,p=Math.PI*this.rotation/180;s(a,a,u(n,h)),s(a,a,u(d/2,_/2)),r(a,a,-p),s(a,a,u(-d/2,-_/2)),i(a,a,u(d,_)),o(this.transforms.dvs,e.displayViewMat3,a)}getTextures({forProcessing:e=!1,useProcessedTexture:t=!1}={}){const s=t?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?t?(i.push(s),r.push("u_image"),this._colormapTexture&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):(this._transformGridTexture&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),i.push(s),r.push("u_image"),this._colormapTexture&&!e&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const t=this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=l(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;0!==e.length&&(this.processedTexture=e.shift(),e.forEach((e=>e?.dispose())),e.length=0)}_createOrDestroyRasterTexture(e){const t=this.source?.extractBands(this.bandIds);if(!this._isValidSource(t))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloat?.textureFloatLinear;const r=this._getTextureSamplingMethod(this.interpolation),i=this.isRendereredSource||!e.capabilities.textureFloat?.textureFloat;this._rasterTexture=d(e,t,r,i),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(e){const t=this._rasterTextureBandIds;return!(null==t&&null==e||t&&e&&t.join("")===e.join(""))}_isValidSource(e){return null!=e&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:t,colormap:s}=this.symbolizerParameters,r="lut"===t||"stretch"===t&&null!=s;return!this._supportsBilinearTexture||r||"bilinear"!==e&&"cubic"!==e?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,s=this.symbolizerParameters.colormap;return s?t?s.length!==t.length||s.some(((e,s)=>e!==t[s]))?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=_(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=_(e,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){this._transformGridTexture&&(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}class c extends x{get source(){return this._source}}function m(e){return null!=e.source}export{x as RasterBitmap,c as RasterBitmapWithSource,m as hasSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{g as t,h as e,r as s,k as a,m as r}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f32.js";import{f as o}from"../../../../chunks/vec2f32.js";import{createVFMesh as l,createVFMeshScalar as n}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{DisplayObject as c}from"../DisplayObject.js";import{createProgramDescriptor as h}from"../webgl/Utils.js";import{BufferObject as m}from"../../../webgl/BufferObject.js";import{Usage as u,DataType as d}from"../../../webgl/enums.js";import{VertexArrayObject as v}from"../../../webgl/VertexArrayObject.js";class f extends c{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||null==this.vaoData||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,null!=this.source&&null==this.vaoData){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const e=l(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(t.context,e);this.vaoData={magdir:s}}break;case"simple_scalar":{const e=n(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(t.context,e);this.vaoData={scalar:s}}break;case"wind_speed":{const e=l(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(t.context,e),a=n(this.source,this.symbolizerParameters),r=this._createVectorFieldVAO(t.context,a);this.vaoData={magdir:s,scalar:r}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:i()}}setTransform(i){const l=t(this.transforms.dvs),[n,c]=i.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/i.resolution,m=h*this.width,u=h*this.height,d=Math.PI*this.rotation/180;e(l,l,o(n,c)),e(l,l,o(m/2,u/2)),s(l,l,-d),e(l,l,o(-m/2,-u/2)),a(l,l,o(m,u)),r(this.transforms.dvs,i.displayViewMat3,l)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:a}=e,r=m.createVertex(t,u.STATIC_DRAW,new Float32Array(s)),i=m.createIndex(t,u.STATIC_DRAW,new Uint32Array(a)),o=h("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:d.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:d.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:d.FLOAT,normalized:!1}]});return{vao:new v(t,o.attributes,o.bufferLayouts,{geometry:r},i),elementCount:a.length}}}export{f as RasterVFDisplayObject};
5
+ import"../../../../core/has.js";import{g as t,h as e,r as s,l as a,m as r}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f32.js";import{f as o}from"../../../../chunks/vec2f32.js";import{createVFMesh as l,createVFMeshScalar as n}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{DisplayObject as c}from"../DisplayObject.js";import{createProgramDescriptor as h}from"../webgl/Utils.js";import{BufferObject as m}from"../../../webgl/BufferObject.js";import{Usage as u,DataType as d}from"../../../webgl/enums.js";import{VertexArrayObject as v}from"../../../webgl/VertexArrayObject.js";class f extends c{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||null==this.vaoData||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,null!=this.source&&null==this.vaoData){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const e=l(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(t.context,e);this.vaoData={magdir:s}}break;case"simple_scalar":{const e=n(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(t.context,e);this.vaoData={scalar:s}}break;case"wind_speed":{const e=l(this.source,this.symbolizerParameters),s=this._createVectorFieldVAO(t.context,e),a=n(this.source,this.symbolizerParameters),r=this._createVectorFieldVAO(t.context,a);this.vaoData={magdir:s,scalar:r}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:i()}}setTransform(i){const l=t(this.transforms.dvs),[n,c]=i.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/i.resolution,m=h*this.width,u=h*this.height,d=Math.PI*this.rotation/180;e(l,l,o(n,c)),e(l,l,o(m/2,u/2)),s(l,l,-d),e(l,l,o(-m/2,-u/2)),a(l,l,o(m,u)),r(this.transforms.dvs,i.displayViewMat3,l)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:a}=e,r=m.createVertex(t,u.STATIC_DRAW,new Float32Array(s)),i=m.createIndex(t,u.STATIC_DRAW,new Uint32Array(a)),o=h("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:d.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:d.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:d.FLOAT,normalized:!1}]});return{vao:new v(t,o.attributes,o.bufferLayouts,{geometry:r},i),elementCount:a.length}}}export{f as RasterVFDisplayObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../core/maybe.js";import{brushes as t}from"../brushes.js";import s from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as r}from"./BitBlitRenderer.js";import{WGLDrawPhase as i,WGLGeometryType as n,WGLSymbologyType as o}from"./enums.js";import l from"./MaterialManager.js";import a from"./TextureManager.js";import{TextureUploadManager as f}from"./TextureUploadManager.js";import{WorldExtentClipRenderer as h}from"./WorldExtentClipRenderer.js";import{AnimationEffect as c}from"./effects/AnimationEffect.js";import{BlendEffect as u}from"./effects/BlendEffect.js";import{FeatureEffect as _}from"./effects/FeatureEffect.js";import d from"./effects/HighlightEffect.js";import{HittestEffect as b}from"./effects/HittestEffect.js";import{HittestEffectVTL as p}from"./effects/HittestEffectVTL.js";import{EffectManager as g}from"./effects/post-processing/EffectManager.js";import E from"./painter/RenderPass.js";import{ContextType as m}from"../../../webgl/contextUtils.js";import{TextureSamplingMode as T,TextureWrapMode as C,RenderbufferFormat as M,BlendFactor as w,CompareFunction as B}from"../../../webgl/enums.js";import{FramebufferObject as F}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as O}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";function S(e,s){switch(e){case n.LINE:return t.line;case n.TEXT:return t.text;case n.LABEL:return t.label;case n.FILL:return s===o.DOT_DENSITY?t.dotDensity:t.fill;case n.MARKER:switch(s){case o.HEATMAP:return t.heatmap;case o.PIE_CHART:return t.pieChart;default:return t.marker}}}class P{constructor(e,t,i){this.context=e,this._blitRenderer=new r,this._worldExtentClipRenderer=new h,this._isClippedToWorldExtent=!1,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._prevFBO=null,this._vtlMaterialManager=new s,this._blendEffect=new u,this._stencilBuf=null,this._fbos=null,this._fboPool=[],this._renderTarget=null,this.effects={highlight:new d,hittest:new b,hittestVTL:new p,integrate:new c,insideEffect:new _("inside"),outsideEffect:new _("outside")},this.materialManager=new l(e),this.textureManager=new a(t,i,e.type===m.WEBGL2),this.textureUploadManager=new f(e,t),this._effectsManager=new g}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getRenderTarget(){return this._renderTarget}setRenderTarget(e){this._renderTarget=e}getFbos(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return this._fbos}const s=new x(e,t);s.samplingMode=T.NEAREST,s.wrapMode=C.CLAMP_TO_EDGE;const r=new O(M.DEPTH_STENCIL,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new F(this.context,s,this._stencilBuf),blend:new F(this.context,s,this._stencilBuf),effect0:new F(this.context,s,this._stencilBuf)}}return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new x(e,t);r.samplingMode=T.NEAREST,r.wrapMode=C.CLAMP_TO_EDGE,s=new F(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderLayers(e,t=null){const{width:s,height:r}=e.getViewport();this._prevFBO=e.getBoundFramebufferObject();const i=this.getFbos(s,r);if(e.bindFramebuffer(i?.output),e.setColorMask(!0,!0,!0,!0),null!=t){const{r:s,g:r,b:i,a:n}=t.color;e.setClearColor(n*s/255,n*r/255,n*i/255,n)}else e.setClearColor(0,0,0,0);e.setDepthWriteEnabled(!0),e.setClearDepth(1),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.setDepthWriteEnabled(!1)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,requireFBO:o,drawPhase:l}=e;if(o||L(l,i,n,s))r.bindFramebuffer(this._fbos?.blend),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1);else{const e=this._getOutputFBO();r.bindFramebuffer(e)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(r.gl.STENCIL_BUFFER_BIT)}compositeLayer(e,t){const{context:s,blendMode:r,effects:n,requireFBO:o,drawPhase:l}=e;if(o||L(l,r,n,t)){null!=n&&n.length>0&&l===i.MAP&&this._applyEffects(e,n);const o=this._getOutputFBO();s.bindFramebuffer(o),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const a=null==r||l===i.HIGHLIGHT?"normal":r,f=this._fbos;f?.blend.colorTexture&&this._blendEffect.draw(e,f.blend.colorTexture,T.NEAREST,a,t)}}renderLayers(e){e.bindFramebuffer(this._prevFBO);const t=this._getOutputFBO();t&&(e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),this._isClippedToWorldExtent?(e.setStencilTestEnabled(!0),e.setStencilFunction(B.EQUAL,1,255)):e.setStencilTestEnabled(!1),this.blitTexture(e,t.colorTexture,T.NEAREST))}prepareDisplay(e,t,s){const{context:r}=e;if(r.bindFramebuffer(this._prevFBO),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t.color;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setStencilWriteMask(255),r.setClearStencil(0),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.STENCIL_BUFFER_BIT),this._isClippedToWorldExtent=this._worldExtentClipRenderer.render(e,s)}dispose(){if(this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentClipRenderer=e(this._worldExtentClipRenderer),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._vtlMaterialManager=e(this._vtlMaterialManager),this._prevFBO=null}getBrush(e,t){const s=S(e,t);let r=this._brushCache.get(s);return void 0===r&&(r=new s,this._brushCache.set(s,r)),r}renderObject(e,s,r,i){const n=t[r];if(!n)return;let o=this._brushCache.get(n);void 0===o&&(o=new n,this._brushCache.set(n,o)),o.prepareState(e,i),o.draw(e,s,i)}renderObjects(e,s,r,i){const n=t[r];if(!n)return;let o=this._brushCache.get(n);void 0===o&&(o=new n,this._brushCache.set(n,o)),o.drawMany(e,s,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new E(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r)}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}_getOutputFBO(){return null!=this._renderTarget?this._renderTarget:this._fbos?.output??null}_applyEffects(e,t){const s=this._fbos?.blend;if(!s)return;const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:o}of i)r.bindFramebuffer(s),n.draw(e,s,o)}}function L(e,t,s,r){return e!==i.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{P as default};
5
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{brushes as t}from"../brushes.js";import s from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as r}from"./BitBlitRenderer.js";import{WGLDrawPhase as i,WGLGeometryType as n,WGLSymbologyType as o}from"./enums.js";import l from"./MaterialManager.js";import a from"./TextureManager.js";import{TextureUploadManager as f}from"./TextureUploadManager.js";import{WorldExtentClipRenderer as h}from"./WorldExtentClipRenderer.js";import{AnimationEffect as c}from"./effects/AnimationEffect.js";import{BlendEffect as u}from"./effects/BlendEffect.js";import{FeatureEffect as _}from"./effects/FeatureEffect.js";import d from"./effects/HighlightEffect.js";import{HittestEffect as b}from"./effects/HittestEffect.js";import{HittestEffectVTL as p}from"./effects/HittestEffectVTL.js";import{EffectManager as g}from"./effects/post-processing/EffectManager.js";import E from"./painter/RenderPass.js";import{ContextType as m}from"../../../webgl/contextUtils.js";import{TextureSamplingMode as T,TextureWrapMode as C,RenderbufferFormat as M,BlendFactor as w,CompareFunction as B}from"../../../webgl/enums.js";import{FramebufferObject as F}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as O}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";function S(e,s){switch(e){case n.LINE:return t.line;case n.TEXT:return t.text;case n.LABEL:return t.label;case n.FILL:return s===o.DOT_DENSITY?t.dotDensity:t.fill;case n.MARKER:switch(s){case o.HEATMAP:return t.heatmap;case o.PIE_CHART:return t.pieChart;default:return t.marker}}}class P{constructor(e,t,i){this.context=e,this._blitRenderer=new r,this._worldExtentClipRenderer=new h,this._isClippedToWorldExtent=!1,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._prevFBO=null,this._vtlMaterialManager=new s,this._blendEffect=new u,this._stencilBuf=null,this._fbos=null,this._fboPool=[],this._renderTarget=null,this.effects={highlight:new d,hittest:new b,hittestVTL:new p,integrate:new c,insideEffect:new _("inside"),outsideEffect:new _("outside")},this.materialManager=new l(e),this.textureManager=new a(t,i,e.type===m.WEBGL2),this.textureUploadManager=new f(e,t),this._effectsManager=new g}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getRenderTarget(){return this._renderTarget}setRenderTarget(e){this._renderTarget=e}getFbos(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return this._fbos}const s=new x(e,t);s.samplingMode=T.NEAREST,s.wrapMode=C.CLAMP_TO_EDGE;const r=new O(M.DEPTH_STENCIL,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new F(this.context,s,this._stencilBuf),blend:new F(this.context,s,this._stencilBuf),effect0:new F(this.context,s,this._stencilBuf)}}return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new x(e,t);r.samplingMode=T.NEAREST,r.wrapMode=C.CLAMP_TO_EDGE,s=new F(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderLayers(e,t=null){const{width:s,height:r}=e.getViewport();this._prevFBO=e.getBoundFramebufferObject();const i=this.getFbos(s,r);if(e.bindFramebuffer(i?.output),e.setColorMask(!0,!0,!0,!0),null!=t){const{r:s,g:r,b:i,a:n}=t;e.setClearColor(n*s/255,n*r/255,n*i/255,n)}else e.setClearColor(0,0,0,0);e.setDepthWriteEnabled(!0),e.setClearDepth(1),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.setDepthWriteEnabled(!1)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,requireFBO:o,drawPhase:l}=e;if(o||L(l,i,n,s))r.bindFramebuffer(this._fbos?.blend),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1);else{const e=this._getOutputFBO();r.bindFramebuffer(e)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(r.gl.STENCIL_BUFFER_BIT)}compositeLayer(e,t){const{context:s,blendMode:r,effects:n,requireFBO:o,drawPhase:l}=e;if(o||L(l,r,n,t)){null!=n&&n.length>0&&l===i.MAP&&this._applyEffects(e,n);const o=this._getOutputFBO();s.bindFramebuffer(o),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const a=null==r||l===i.HIGHLIGHT?"normal":r,f=this._fbos;f?.blend.colorTexture&&this._blendEffect.draw(e,f.blend.colorTexture,T.NEAREST,a,t)}}renderLayers(e){e.bindFramebuffer(this._prevFBO);const t=this._getOutputFBO();t&&(e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),this._isClippedToWorldExtent?(e.setStencilTestEnabled(!0),e.setStencilFunction(B.EQUAL,1,255)):e.setStencilTestEnabled(!1),this.blitTexture(e,t.colorTexture,T.NEAREST))}prepareDisplay(e,t,s){const{context:r}=e;if(r.bindFramebuffer(this._prevFBO),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setStencilWriteMask(255),r.setClearStencil(0),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.STENCIL_BUFFER_BIT),this._isClippedToWorldExtent=this._worldExtentClipRenderer.render(e,s)}dispose(){if(this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentClipRenderer=e(this._worldExtentClipRenderer),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._vtlMaterialManager=e(this._vtlMaterialManager),this._prevFBO=null}getBrush(e,t){const s=S(e,t);let r=this._brushCache.get(s);return void 0===r&&(r=new s,this._brushCache.set(s,r)),r}renderObject(e,s,r,i){const n=t[r];if(!n)return;let o=this._brushCache.get(n);void 0===o&&(o=new n,this._brushCache.set(n,o)),o.prepareState(e,i),o.draw(e,s,i)}renderObjects(e,s,r,i){const n=t[r];if(!n)return;let o=this._brushCache.get(n);void 0===o&&(o=new n,this._brushCache.set(n,o)),o.drawMany(e,s,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new E(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r)}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}_getOutputFBO(){return null!=this._renderTarget?this._renderTarget:this._fbos?.output??null}_applyEffects(e,t){const s=this._fbos?.blend;if(!s)return;const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:o}of i)r.bindFramebuffer(s),n.draw(e,s,o)}}function L(e,t,s,r){return e!==i.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{P 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{j as i,d as r,r as e,h as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f64.js";import{s as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import c from"./VertexStream.js";import{stencil as d}from"./shaders/StencilPrograms.js";import{StencilOperation as p,CompareFunction as _}from"../../../webgl/enums.js";import{createProgram as l}from"../../../webgl/ProgramTemplate.js";const u=n(-.5,-.5);class f{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,s){const{context:i}=t;return!!this._updateGeometry(t,s)&&(this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(p.KEEP,p.KEEP,p.REPLACE),i.setStencilFunction(_.ALWAYS,1,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(t){if(this._initialized)return;const s=l(t,d);s&&(this._program=s,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:d}=n,p=Math.round(c[0]*m),_=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const l=s(d),f=Math.abs(Math.cos(l)),b=Math.abs(Math.sin(l)),g=Math.round(p*f+_*b),j=Math.round(n.worldScreenWidth);if(g<=j)return!1;const x=p*b+_*f,E=j*m,M=(a.left-a.right)*m/p,w=(a.bottom-a.top)*m/_;h(this._worldDimensionsPx,E,x,1),h(this._pxToNdc,2/p,-2/_,1),h(this._centerNdc,M,w,1);const P=this._mat3;return i(P,this._centerNdc),r(P,P,this._pxToNdc),0!==d&&e(P,P,l),r(P,P,this._worldDimensionsPx),o(P,P,u),!0}}export{f as WorldExtentClipRenderer};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{k as i,d as r,r as e,h as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f64.js";import{s as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import c from"./VertexStream.js";import{stencil as d}from"./shaders/StencilPrograms.js";import{StencilOperation as p,CompareFunction as _}from"../../../webgl/enums.js";import{createProgram as l}from"../../../webgl/ProgramTemplate.js";const u=n(-.5,-.5);class f{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,s){const{context:i}=t;return!!this._updateGeometry(t,s)&&(this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(p.KEEP,p.KEEP,p.REPLACE),i.setStencilFunction(_.ALWAYS,1,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(t){if(this._initialized)return;const s=l(t,d);s&&(this._program=s,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:d}=n,p=Math.round(c[0]*m),_=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const l=s(d),f=Math.abs(Math.cos(l)),b=Math.abs(Math.sin(l)),g=Math.round(p*f+_*b),x=Math.round(n.worldScreenWidth);if(g<=x)return!1;const j=p*b+_*f,E=x*m,M=(a.left-a.right)*m/p,w=(a.bottom-a.top)*m/_;h(this._worldDimensionsPx,E,j,1),h(this._pxToNdc,2/p,-2/_,1),h(this._centerNdc,M,w,1);const P=this._mat3;return i(P,this._centerNdc),r(P,P,this._pxToNdc),0!==d&&e(P,P,l),r(P,P,this._worldDimensionsPx),o(P,P,u),!0}}export{f as WorldExtentClipRenderer};