@arcgis/core 4.24.0-next.20220622 → 4.24.2

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 (68) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{aa14e999e03ccb770455.js → 48576ac3dd2efaa25141.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{6a02a75e935af0fc2b2b.js → a68428fde8bc960da276.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{e5c8584ae764892c324d.js → d1bc85b78d6f217b022a.js} +1 -1
  5. package/assets/esri/themes/base/widgets/_Editor.scss +6 -0
  6. package/assets/esri/themes/base/widgets/_SnappingControls.scss +4 -0
  7. package/assets/esri/themes/dark/main.css +1 -1
  8. package/assets/esri/themes/light/main.css +1 -1
  9. package/assets/esri/themes/light/view.css +1 -1
  10. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ar.json +1 -1
  11. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bg.json +1 -1
  12. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bs.json +1 -1
  13. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ca.json +1 -1
  14. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_cs.json +1 -1
  15. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_da.json +1 -1
  16. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_de.json +1 -1
  17. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_el.json +1 -1
  18. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_es.json +1 -1
  19. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_et.json +1 -1
  20. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fi.json +1 -1
  21. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fr.json +1 -1
  22. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_he.json +1 -1
  23. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hr.json +1 -1
  24. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hu.json +1 -1
  25. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_id.json +1 -1
  26. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_it.json +1 -1
  27. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ja.json +1 -1
  28. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ko.json +1 -1
  29. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lt.json +1 -1
  30. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lv.json +1 -1
  31. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nb.json +1 -1
  32. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nl.json +1 -1
  33. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pl.json +1 -1
  34. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-BR.json +1 -1
  35. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-PT.json +1 -1
  36. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ro.json +1 -1
  37. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ru.json +1 -1
  38. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sk.json +1 -1
  39. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sl.json +1 -1
  40. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sr.json +1 -1
  41. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sv.json +1 -1
  42. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_th.json +1 -1
  43. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_tr.json +1 -1
  44. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_uk.json +1 -1
  45. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_vi.json +1 -1
  46. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-CN.json +1 -1
  47. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-HK.json +1 -1
  48. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-TW.json +1 -1
  49. package/config.js +1 -1
  50. package/package.json +1 -1
  51. package/support/revision.js +1 -1
  52. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  53. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  54. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  55. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  56. package/views/3d/state/utils/navigationUtils.js +1 -1
  57. package/views/3d/terrain/Tile.js +1 -1
  58. package/views/3d/terrain/TileCompositor.js +1 -1
  59. package/views/3d/terrain/TileRenderer.js +1 -1
  60. package/views/webgl/context-util.js +1 -1
  61. package/widgets/Editor/UpdateWorkflow.js +1 -1
  62. package/widgets/Editor.js +1 -1
  63. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  64. package/widgets/FeatureForm/InputField.js +1 -1
  65. package/widgets/FeatureForm.js +1 -1
  66. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  67. package/widgets/support/SnappingControls/SnappingLayerListViewModel.js +1 -1
  68. package/widgets/support/SnappingControls/SnappingListItem.js +1 -1
@@ -1 +1 @@
1
- {"widgetLabel":"تبديل خريطة الأساس","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"تبديل خريطة الأساس","incompatibleSpatialReference":"تحتوي خريطة الأساس هذه على إسناد مكاني غير متوافق"}
@@ -1 +1 @@
1
- {"widgetLabel":"Превключване на базова карта","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Превключване на базова карта","incompatibleSpatialReference":"Тази базова карта има несъвместима пространствена препратка"}
@@ -1 +1 @@
1
- {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"Ova kartografska podloga sadrži nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Activa o desactiva el mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Activa o desactiva el mapa base","incompatibleSpatialReference":"Aquest mapa de base té una referència espacial no compatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"Přepnout podkladovou mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Přepnout podkladovou mapu","incompatibleSpatialReference":"Podkladová mapa nemá kompatibilní souřadnicový systém."}
@@ -1 +1 @@
1
- {"widgetLabel":"Skift baggrundskort","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Skift baggrundskort","incompatibleSpatialReference":"Dette baggrundskortet har en inkompatibel spatial reference"}
@@ -1 +1 @@
1
- {"widgetLabel":"Grundkarte wechseln","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Grundkarte wechseln","incompatibleSpatialReference":"Diese Grundkarte weist einen nicht kompatiblen Raumbezug auf."}
@@ -1 +1 @@
1
- {"widgetLabel":"Εναλλαγή υποβάθρου","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Εναλλαγή υποβάθρου","incompatibleSpatialReference":"Αυτός ο βασικός χάρτης έχει μια μη συμβατή χωρική αναφορά"}
@@ -1 +1 @@
1
- {"widgetLabel":"Cambiar el mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Cambiar el mapa base","incompatibleSpatialReference":"Este mapa base tiene una referencia espacial incompatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"Vaheta aluskaarti","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Vaheta aluskaarti","incompatibleSpatialReference":"Aluskaardil on ühildumatu koordinaatsüsteem"}
@@ -1 +1 @@
1
- {"widgetLabel":"Vaihda taustakarttaa","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Vaihda taustakarttaa","incompatibleSpatialReference":"Tässä taustakartassa on yhteensopimaton koordinaatistotieto"}
@@ -1 +1 @@
1
- {"widgetLabel":"Basculer le fond de carte","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Basculer le fond de carte","incompatibleSpatialReference":"Ce fond de carte possède une référence spatiale incompatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"הדלק או כבה מפת בסיס","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"הדלק או כבה מפת בסיס","incompatibleSpatialReference":"למפת בסיס זו יש ייחוס מרחבי לא תואם"}
@@ -1 +1 @@
1
- {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"Ova kartografska podloga sadrži nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alaptérkép átváltása","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alaptérkép átváltása","incompatibleSpatialReference":"Ez az alaptérkép egy nem kompatibilis térbeli referenciával rendelkezik"}
@@ -1 +1 @@
1
- {"widgetLabel":"Nyalakan/Matikan peta dasar","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Nyalakan/Matikan peta dasar","incompatibleSpatialReference":"Peta dasar ini memiliki referensi spasial yang tidak kompatibel"}
@@ -1 +1 @@
1
- {"widgetLabel":"Attiva/disattiva mappa di base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Attiva/disattiva mappa di base","incompatibleSpatialReference":"Questa mappa di base ha un riferimento spaziale incompatibile"}
@@ -1 +1 @@
1
- {"widgetLabel":"ベースマップの切り替え","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"ベースマップの切り替え","incompatibleSpatialReference":"このベースマップの空間参照は互換性がありません"}
@@ -1 +1 @@
1
- {"widgetLabel":"베이스맵 토글","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"베이스맵 토글","incompatibleSpatialReference":"이 베이스맵에 호환되지 않는 공간 기준 체계가 있습니다."}
@@ -1 +1 @@
1
- {"widgetLabel":"Perjungti pagrindo žemėlapį","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Perjungti pagrindo žemėlapį","incompatibleSpatialReference":"Šis pagrindo žemėlapis turi nesuderinamą erdvinę nuorodą"}
@@ -1 +1 @@
1
- {"widgetLabel":"Pārslēgt pamatkarti","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Pārslēgt pamatkarti","incompatibleSpatialReference":"Šai pamatkartei ir nesaderīga telpiskā atskaite"}
@@ -1 +1 @@
1
- {"widgetLabel":"Veksle mellom bakgrunnskart","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Veksle mellom bakgrunnskart","incompatibleSpatialReference":"Dette bakgrunnskartet har en inkompatibel romlig referanse"}
@@ -1 +1 @@
1
- {"widgetLabel":"Basiskaart in- en uitschakelen","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Basiskaart in- en uitschakelen","incompatibleSpatialReference":"Deze basiskaart heeft een incompatibele ruimtelijke referentie"}
@@ -1 +1 @@
1
- {"widgetLabel":"Przełącz mapę bazową","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Przełącz mapę bazową","incompatibleSpatialReference":"Ta mapa bazowa ma niezgodne odniesienie przestrzenne"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"Este mapa base tem uma referência espacial incompatível"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"Este mapa base contém uma referência espacial incompatível"}
@@ -1 +1 @@
1
- {"widgetLabel":"Comutare hartă fundal","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Comutare hartă fundal","incompatibleSpatialReference":"Această hartă de fundal are o referință spațială incompatibilă"}
@@ -1 +1 @@
1
- {"widgetLabel":"Переключить базовую карту","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Переключить базовую карту","incompatibleSpatialReference":"Пространственная привязка данной базовой карты несовместима."}
@@ -1 +1 @@
1
- {"widgetLabel":"Prepnúť podkladovú mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prepnúť podkladovú mapu","incompatibleSpatialReference":"Táto podkladová mapa má nekompatibilný priestorový referenčný systém"}
@@ -1 +1 @@
1
- {"widgetLabel":"Preklopi temeljno karto","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Preklopi temeljno karto","incompatibleSpatialReference":"Ta temeljna karta ima nezdružljiv koordinatni sistem"}
@@ -1 +1 @@
1
- {"widgetLabel":"Uklj./isklj. pozadinsku mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Uklj./isklj. pozadinsku mapu","incompatibleSpatialReference":"Ova pozadinska mapa ima nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Växla baskarta","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Växla baskarta","incompatibleSpatialReference":"Den här baskartan har en inkompatibel spatial referens"}
@@ -1 +1 @@
1
- {"widgetLabel":"ปุ่มสำหรับเปิดปิดแผนที่ฐาน","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"ปุ่มสำหรับเปิดปิดแผนที่ฐาน","incompatibleSpatialReference":"แผนที่ฐานนี้มีการอ้างอิงเชิงพื้นที่ที่ไม่สามารถใช้งานร่วมกันได้"}
@@ -1 +1 @@
1
- {"widgetLabel":"Altlık haritayı aç/kapat","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Altlık haritayı aç/kapat","incompatibleSpatialReference":"Bu altlık haritada uyumsuz bir mekânsal referans var"}
@@ -1 +1 @@
1
- {"widgetLabel":"Перемикнути базову карту","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Перемикнути базову карту","incompatibleSpatialReference":"Ця базова карта має несумісну просторову прив'язку"}
@@ -1 +1 @@
1
- {"widgetLabel":"Chuyển đổi bản đồ nền","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Chuyển đổi bản đồ nền","incompatibleSpatialReference":"Bản đồ nền này có tham chiếu không gian không tương thích"}
@@ -1 +1 @@
1
- {"widgetLabel":"切换底图","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切换底图","incompatibleSpatialReference":"此底图具有不兼容的空间参考"}
@@ -1 +1 @@
1
- {"widgetLabel":"切換底圖","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切換底圖","incompatibleSpatialReference":"此底圖具有不相容的空間參考"}
@@ -1 +1 @@
1
- {"widgetLabel":"切換底圖","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切換底圖","incompatibleSpatialReference":"此底圖具有不相容的空間參考"}
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";import{buildDate as r}from"./support/revision.js";const s={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.24.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${r}/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const r={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){const e="4.24.2";r.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}r.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(r,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),r.request.corsEnabledServers=[],r.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{r as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.24.0-next.20220622",
3
+ "version": "4.24.2",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- const e="20220622",c="dec209fa147823d6b85738e6cbc080ee96117e6a";export{e as buildDate,c as commitHash};
5
+ const b="20220624",c="7915c1c020ba03688ff44b4994b3ae7405550d5d";export{b as buildDate,c as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/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{h as i,d as r,r as e,c 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 u}from"../../../webgl/ProgramTemplate.js";const l=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.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=u(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 u=s(d),f=Math.abs(Math.cos(u)),g=Math.abs(Math.sin(u)),x=Math.round(p*f+_*g),b=Math.round(n.worldScreenWidth);if(x<=b)return!1;const j=p*g+_*f,E=b*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,u),r(P,P,this._worldDimensionsPx),o(P,P,l),!0}}export{f as WorldExtentClipRenderer};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{h as i,d as r,r as e,c 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};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import a from"../../../../core/Handles.js";import{releaseMaybe as s,destroyMaybe as n,isSome as r,isNone as l,removeMaybe as o}from"../../../../core/maybe.js";import{watch as h,sync as p,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{createScreenPoint as d,screenPointObjectToArray as _,createScreenPointArray as v}from"../../../../core/screenUtils.js";import{property as P}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as m,u as g,m as w}from"../../../../chunks/mat4.js";import{e as f,l as M,c as D,g as T,a as V,m as b,n as k,s as E}from"../../../../chunks/vec3.js";import{a as S,c as H}from"../../../../chunks/vec3f64.js";import{c as x,a as I,n as R,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as O,create as C,intersectRay as z,normal as G}from"../../../../geometry/support/plane.js";import{create as U}from"../../../../geometry/support/ray.js";import{sv3d as L,sm4d as K,sv2d as A}from"../../../../geometry/support/vectorStacks.js";import{POINTER_MOVE_TIMER_MS as B,PLANE_PREVIEW_OUTLINE_WIDTH as F,forceVerticalModifier as N,forceHorizontalModifier as q,PREVIEW_FADE_DURATION_SECONDS as Z,PLANE_OUTLINE_COLOR as J,PLANE_BACKGROUND_COLOR as Q,PREVIEW_FADE_DOT_THRESHOLD as W,INITIAL_DEPTH_OFFSET_FRAC as X}from"./sliceToolConfig.js";import{createShiftManipulator as Y,createRotateManipulator as $,createResizeManipulator as tt,createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,RotationAxis as nt,resizePlane as rt,calculatePlaneHalfSize as lt,SliceOrientation as ot,createPlane as ht,DidPointerMoveRecentlyFlag as pt,calculateBoundedPlaneTranslateRotate as ut,updateShiftRestartHandle as ct,updateRotateHeadingHandle as dt,updateRotateTiltHandle as _t,updateResizeHandle as vt,createShiftPlane as Pt}from"./sliceToolUtils.js";import{getRotateHeadingTexture as yt,getTiltRotateTexture as mt}from"./images/Factory.js";import{calculateInputRotationTransform as gt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as wt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreen as ft}from"../../support/geometryUtils/ray.js";import{newIntersector as Mt}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as Dt}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{AnalysisToolBase as Tt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as Vt}from"../../../interactive/dragEventPipeline.js";import{createScreenPointFromEvent as bt}from"../../../support/screenUtils.js";var kt;let Et=kt=class extends Tt{constructor(t){super(t),this.clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._handles=new a,this._viewHandles=new a,this._frameTask=null,this._pointerMoveTimerMs=B,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=d(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Mt(t.view.state.viewingMode),this._intersector.options.store=Dt.MIN}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");this.rotateHeadingImage=yt(this.view.toolViewManager.textures),this.rotateTiltImage=mt(this.view.toolViewManager.textures);const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(r(this.analysisViewData.plane)&&I(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=Y(this.view),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",(e=>{this._onShiftGrab(e),t(this.shiftManipulator)})),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=$(this.view,this.rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",(e=>{this._onRotateHeadingGrab(e),t(this.rotateHeadingManipulator)})),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=$(this.view,this.rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",(e=>{this._onRotateTiltGrab(e),t(this.rotateTiltManipulator)})),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map(((e,i)=>{const a=tt(this.view,e);return a.events.on("grab-changed",(e=>{this._onResizeGrab(e,i),t(a)})),this._handles.add(this._createResizeDragPipeline(a)),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=F,this._handles.add(h((()=>this.analysisViewData.plane),(()=>this._updateManipulators()),p));const e=h((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),u);this._handles.add([e,h((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this.rotateHeadingImage=s(this.rotateHeadingImage),this.rotateTiltImage=s(this.rotateTiltImage),this._handles=n(this._handles),this._viewHandles=n(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=n(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=n(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._isPlacingSlicePlane||"exclude"===this.layersMode?"crosshair":r(this._creatingPointerId)?"grabbing":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this._handles.remove("analysis"),this._set("analysis",t)}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=r(t)&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return r(this.inputState)&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){l(this.analysisViewData.plane)||(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){l(this.analysisViewData.plane)||(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this.shiftManipulator&&(this._updateManipulators(),t||this._clearPointerMoveTimeout())}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Ht(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Ht(t))return;this._onClickPlacePlane(t)&&t.stopPropagation();break;case"click":if(!Ht(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.editable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&r(e)&&"shift"===e.type){const i=bt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(bt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&r(this.analysisViewData.plane)){const e=bt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),I(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const i=bt(t),a=x();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if(I(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new e),"pointer-drag"===t.type){const e=this._calculatePickRay(i);this.inputState=St(e,t.pointerId,a.origin,a)}return!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(bt(t)).then((t=>{if(t.results.length){const e=t.results[0],i="graphic"===e?.type&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(t){return(t.key===N||t.key===q)&&(this._activeKeyModifiers[t.key]=!0,r(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==N&&t.key!==q||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],r(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||l(this.analysisViewData.plane))return;const e=this._calculatePickRay(t.screenPoint);I(this.analysisViewData.plane,this._startPlane),this.inputState=St(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(l(a)||"shift"!==a.type)return;const s=r(this.analysisViewData.plane)?I(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{r(s)&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(l(this.analysisViewData.plane))return null;const i=.001,a=Math.min((1-Math.abs(f(R(this.analysisViewData.plane),e.ray.direction)/M(e.ray.direction)))/i,1),s=-O(this._startPlane.plane,e.renderEnd),n=-O(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(l(this.analysisViewData.plane))return;const e=D(L.get(),this._startPlane.origin),i=D(L.get(),R(this._startPlane));T(i,i,-t.depth),V(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||l(this.analysisViewData.plane))return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.HEADING,C()),i=this._calculatePickRay(t.screenPoint),a=H();z(e,i,a)&&(I(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(l(a)||"rotate"!==a.type)return;const s=r(this.analysisViewData.plane)?I(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{r(s)&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||l(this.analysisViewData.plane))return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.TILT,C()),i=this._calculatePickRay(t.screenPoint),a=H();z(e,i,a)&&(I(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(l(a)||"rotate"!==a.type)return;const s=r(this.analysisViewData.plane)?I(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{r(s)&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(l(this.analysisViewData.plane))return null;const i=G(t.rotatePlane),a=gt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(l(this.analysisViewData.plane))return;const e=m(K.get(),t.rotateAngle,t.rotateAxis),i=b(L.get(),this._startPlane.basis1,e),a=b(L.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||l(this.analysisViewData.plane))return;const i=this._calculatePickRay(t.screenPoint),a=L.get();z(this.analysisViewData.plane.plane,i,a)&&(I(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:S(a)})}_createResizeDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(l(a)||"resize"!==a.type||l(this.analysisViewData.plane))return;const s=I(this.analysisViewData.plane,x());e.next(wt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(l(this.analysisViewData.plane))return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,I(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(!r(e))throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,l(t))return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=r(i)?i:x();if(i=r(i)?I(i,xt):null,this._pickPlane(t,!0,e,a)){const t=W;let e=!1;r(i)&&(e=f(i.plane,a.plane)<t||f(k(L.get(),i.basis1),k(L.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}r(this._previewPlane)&&l(this._frameTask)&&0===this._previewPlaneOpacity?this._frameTask=c({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*Z),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):l(this._previewPlane)&&r(this._frameTask)?this._removeFrameTask():r(this._previewPlane)&&this._updateManipulators()}_removeFrameTask(){this._frameTask=o(this._frameTask)}_calculatePickRay(t){const e=U(),i=_(t,It);return ft(this.view.state.camera,i,e),k(e.direction,e.direction),e}_pickMinResult(t){const e=_(t,A.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=L.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(L.get()),l=this.view.state.camera;f(r,l.viewForward)>0&&T(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*X,p=T(L.get(),r,h);V(p,p,n);const u=this.analysis.tiltEnabled?ot.TILTED:ot.HORIZONTAL_OR_VERTICAL,c=i[N]?ot.VERTICAL:i[q]?ot.HORIZONTAL:u;return ht(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=o(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=pt,this.rotateHeadingManipulator.state|=pt,this.rotateTiltManipulator.state|=pt,this._prevPointerMoveTimeout=this.clock.setTimeout((()=>{this.shiftManipulator.state&=~pt,this.rotateHeadingManipulator.state&=~pt,this.rotateTiltManipulator.state&=~pt}),this._pointerMoveTimerMs)}_updateManipulators(){if(kt.disableEngineLayers)return;let t=null,e=!1;if(r(this.analysisViewData.plane))t=this.analysisViewData.plane,e=!1;else{if(!r(this._previewPlane))return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=ut(t,K.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ct(this.shiftManipulator,i,t,this.view.state.camera),dt(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),_t(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>vt(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=E(L.get(),M(t.basis1),M(t.basis2),1),s=g(K.get(),a),n=w(s,i,s);this._previewPlaneOutlineVisualElement.transform=n,this._previewPlaneGridVisualElement.transform=n,this._updateMaterials()}_updateMaterials(){const t=[J[0],J[1],J[2],J[3]*this._previewPlaneOpacity];this._previewPlaneOutlineVisualElement.color=t;const e=[Q[0],Q[1],Q[2],Q[3]*this._previewPlaneOpacity],i=[0,0,0,0];this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=i}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}testData(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function St(t,e,i,a){const s=Pt(i,R(a),t.direction,C()),n=H();return z(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Ht(t){return"mouse"!==t.pointerType||0===t.button}Et.disableEngineLayers=!1,t([P()],Et.prototype,"clock",void 0),t([P({constructOnly:!0})],Et.prototype,"view",void 0),t([P()],Et.prototype,"analysisViewData",void 0),t([P({readOnly:!0})],Et.prototype,"state",null),t([P({readOnly:!0})],Et.prototype,"cursor",null),t([P()],Et.prototype,"analysis",null),t([P()],Et.prototype,"removeIncompleteOnCancel",void 0),t([P({readOnly:!0})],Et.prototype,"layersMode",void 0),t([P({value:null})],Et.prototype,"inputState",null),t([P()],Et.prototype,"_isPlacingSlicePlane",null),t([P()],Et.prototype,"_creatingPointerId",null),Et=kt=t([y("esri.views.3d.analysis.Slice.SliceTool")],Et);const xt=x(),It=v(),Rt=Et;export{Rt as default};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import a from"../../../../core/Handles.js";import{releaseMaybe as s,destroyMaybe as n,isSome as r,isNone as l,removeMaybe as o}from"../../../../core/maybe.js";import{watch as h,sync as p,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{createScreenPoint as d,screenPointObjectToArray as _,createScreenPointArray as v}from"../../../../core/screenUtils.js";import{property as P}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as m,u as g,m as w}from"../../../../chunks/mat4.js";import{e as f,l as M,c as D,g as T,a as V,m as b,n as k,s as E}from"../../../../chunks/vec3.js";import{a as S,c as H}from"../../../../chunks/vec3f64.js";import{c as x,a as I,n as R,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as O,create as C,intersectRay as z,normal as G}from"../../../../geometry/support/plane.js";import{create as U}from"../../../../geometry/support/ray.js";import{sv3d as L,sm4d as K,sv2d as A}from"../../../../geometry/support/vectorStacks.js";import{POINTER_MOVE_TIMER_MS as B,PLANE_PREVIEW_OUTLINE_WIDTH as F,forceVerticalModifier as N,forceHorizontalModifier as q,PREVIEW_FADE_DURATION_SECONDS as Z,PLANE_OUTLINE_COLOR as J,PLANE_BACKGROUND_COLOR as Q,PREVIEW_FADE_DOT_THRESHOLD as W,INITIAL_DEPTH_OFFSET_FRAC as X}from"./sliceToolConfig.js";import{createShiftManipulator as Y,createRotateManipulator as $,createResizeManipulator as tt,createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,RotationAxis as nt,resizePlane as rt,calculatePlaneHalfSize as lt,SliceOrientation as ot,createPlane as ht,DidPointerMoveRecentlyFlag as pt,calculateBoundedPlaneTranslateRotate as ut,updateShiftRestartHandle as ct,updateRotateHeadingHandle as dt,updateRotateTiltHandle as _t,updateResizeHandle as vt,createShiftPlane as Pt}from"./sliceToolUtils.js";import{getRotateHeadingTexture as yt,getTiltRotateTexture as mt}from"./images/Factory.js";import{calculateInputRotationTransform as gt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as wt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreen as ft}from"../../support/geometryUtils/ray.js";import{newIntersector as Mt}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as Dt}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{AnalysisToolBase as Tt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as Vt}from"../../../interactive/dragEventPipeline.js";import{createScreenPointFromEvent as bt}from"../../../support/screenUtils.js";var kt;let Et=kt=class extends Tt{constructor(t){super(t),this.clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._handles=new a,this._viewHandles=new a,this._frameTask=null,this._pointerMoveTimerMs=B,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=d(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Mt(t.view.state.viewingMode),this._intersector.options.store=Dt.MIN}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");this.rotateHeadingImage=yt(this.view.toolViewManager.textures),this.rotateTiltImage=mt(this.view.toolViewManager.textures);const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(r(this.analysisViewData.plane)&&I(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=Y(this.view),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",(e=>{this._onShiftGrab(e),t(this.shiftManipulator)})),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=$(this.view,this.rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",(e=>{this._onRotateHeadingGrab(e),t(this.rotateHeadingManipulator)})),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=$(this.view,this.rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",(e=>{this._onRotateTiltGrab(e),t(this.rotateTiltManipulator)})),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map(((e,i)=>{const a=tt(this.view,e);return a.events.on("grab-changed",(e=>{this._onResizeGrab(e,i),t(a)})),this._handles.add(this._createResizeDragPipeline(a)),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=F,this._handles.add(h((()=>this.analysisViewData.plane),(()=>this._updateManipulators()),p));const e=h((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),u);this._handles.add([e,h((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this.rotateHeadingImage=s(this.rotateHeadingImage),this.rotateTiltImage=s(this.rotateTiltImage),this._handles=n(this._handles),this._viewHandles=n(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=n(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=n(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._isPlacingSlicePlane||"exclude"===this.layersMode?"crosshair":r(this._creatingPointerId)?"grabbing":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this._handles.remove("analysis"),this._set("analysis",t)}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=r(t)&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return r(this.inputState)&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){l(this.analysisViewData.plane)||(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){l(this.analysisViewData.plane)||(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this.shiftManipulator&&(this._updateManipulators(),t||this._clearPointerMoveTimeout())}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Ht(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Ht(t))return;this._onClickPlacePlane(t)&&t.stopPropagation();break;case"click":if(!Ht(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.editable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&r(e)&&"shift"===e.type){const i=bt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(bt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&r(this.analysisViewData.plane)){const e=bt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),I(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const i=bt(t),a=x();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if(I(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new e),"pointer-drag"===t.type){const e=this._calculatePickRay(i);this.inputState=St(e,t.pointerId,a.origin,a)}return!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(bt(t)).then((t=>{if(t.results.length){const e=t.results[0],i="graphic"===e?.type&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(t){return(t.key===N||t.key===q)&&(this._activeKeyModifiers[t.key]=!0,r(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==N&&t.key!==q||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],r(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||l(this.analysisViewData.plane))return;const e=this._calculatePickRay(t.screenPoint);I(this.analysisViewData.plane,this._startPlane),this.inputState=St(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(l(a)||"shift"!==a.type)return;const s=r(this.analysisViewData.plane)?I(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{r(s)&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(l(this.analysisViewData.plane))return null;const i=.001,a=Math.min((1-Math.abs(f(R(this.analysisViewData.plane),e.ray.direction)/M(e.ray.direction)))/i,1),s=-O(this._startPlane.plane,e.renderEnd),n=-O(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(l(this.analysisViewData.plane))return;const e=D(L.get(),this._startPlane.origin),i=D(L.get(),R(this._startPlane));T(i,i,-t.depth),V(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||l(this.analysisViewData.plane))return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.HEADING,C()),i=this._calculatePickRay(t.screenPoint),a=H();z(e,i,a)&&(I(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(l(a)||"rotate"!==a.type)return;const s=r(this.analysisViewData.plane)?I(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{r(s)&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||l(this.analysisViewData.plane))return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.TILT,C()),i=this._calculatePickRay(t.screenPoint),a=H();z(e,i,a)&&(I(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(l(a)||"rotate"!==a.type)return;const s=r(this.analysisViewData.plane)?I(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{r(s)&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(l(this.analysisViewData.plane))return null;const i=G(t.rotatePlane),a=gt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(l(this.analysisViewData.plane))return;const e=m(K.get(),t.rotateAngle,t.rotateAxis);if(l(e))return;const i=b(L.get(),this._startPlane.basis1,e),a=b(L.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||l(this.analysisViewData.plane))return;const i=this._calculatePickRay(t.screenPoint),a=L.get();z(this.analysisViewData.plane.plane,i,a)&&(I(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:S(a)})}_createResizeDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(l(a)||"resize"!==a.type||l(this.analysisViewData.plane))return;const s=I(this.analysisViewData.plane,x());e.next(wt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(l(this.analysisViewData.plane))return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,I(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(!r(e))throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,l(t))return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=r(i)?i:x();if(i=r(i)?I(i,xt):null,this._pickPlane(t,!0,e,a)){const t=W;let e=!1;r(i)&&(e=f(i.plane,a.plane)<t||f(k(L.get(),i.basis1),k(L.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}r(this._previewPlane)&&l(this._frameTask)&&0===this._previewPlaneOpacity?this._frameTask=c({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*Z),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):l(this._previewPlane)&&r(this._frameTask)?this._removeFrameTask():r(this._previewPlane)&&this._updateManipulators()}_removeFrameTask(){this._frameTask=o(this._frameTask)}_calculatePickRay(t){const e=U(),i=_(t,It);return ft(this.view.state.camera,i,e),k(e.direction,e.direction),e}_pickMinResult(t){const e=_(t,A.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=L.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(L.get()),l=this.view.state.camera;f(r,l.viewForward)>0&&T(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*X,p=T(L.get(),r,h);V(p,p,n);const u=this.analysis.tiltEnabled?ot.TILTED:ot.HORIZONTAL_OR_VERTICAL,c=i[N]?ot.VERTICAL:i[q]?ot.HORIZONTAL:u;return ht(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=o(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=pt,this.rotateHeadingManipulator.state|=pt,this.rotateTiltManipulator.state|=pt,this._prevPointerMoveTimeout=this.clock.setTimeout((()=>{this.shiftManipulator.state&=~pt,this.rotateHeadingManipulator.state&=~pt,this.rotateTiltManipulator.state&=~pt}),this._pointerMoveTimerMs)}_updateManipulators(){if(kt.disableEngineLayers)return;let t=null,e=!1;if(r(this.analysisViewData.plane))t=this.analysisViewData.plane,e=!1;else{if(!r(this._previewPlane))return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=ut(t,K.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ct(this.shiftManipulator,i,t,this.view.state.camera),dt(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),_t(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>vt(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=E(L.get(),M(t.basis1),M(t.basis2),1),s=g(K.get(),a),n=w(s,i,s);this._previewPlaneOutlineVisualElement.transform=n,this._previewPlaneGridVisualElement.transform=n,this._updateMaterials()}_updateMaterials(){const t=[J[0],J[1],J[2],J[3]*this._previewPlaneOpacity];this._previewPlaneOutlineVisualElement.color=t;const e=[Q[0],Q[1],Q[2],Q[3]*this._previewPlaneOpacity],i=[0,0,0,0];this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=i}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}testData(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function St(t,e,i,a){const s=Pt(i,R(a),t.direction,C()),n=H();return z(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Ht(t){return"mouse"!==t.pointerType||0===t.button}Et.disableEngineLayers=!1,t([P()],Et.prototype,"clock",void 0),t([P({constructOnly:!0})],Et.prototype,"view",void 0),t([P()],Et.prototype,"analysisViewData",void 0),t([P({readOnly:!0})],Et.prototype,"state",null),t([P({readOnly:!0})],Et.prototype,"cursor",null),t([P()],Et.prototype,"analysis",null),t([P()],Et.prototype,"removeIncompleteOnCancel",void 0),t([P({readOnly:!0})],Et.prototype,"layersMode",void 0),t([P({value:null})],Et.prototype,"inputState",null),t([P()],Et.prototype,"_isPlacingSlicePlane",null),t([P()],Et.prototype,"_creatingPointerId",null),Et=kt=t([y("esri.views.3d.analysis.Slice.SliceTool")],Et);const xt=x(),It=v(),Rt=Et;export{Rt 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.24/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import a from"../../../../../core/Evented.js";import r from"../../../../../core/Handles.js";import{handlesGroup as e}from"../../../../../core/handleUtils.js";import{destroyMaybe as i,unwrap as o}from"../../../../../core/maybe.js";import{f as s,b as n,m as l,d as p,u}from"../../../../../chunks/mat4.js";import{c as h}from"../../../../../chunks/mat4f64.js";import{s as m}from"../../../../../chunks/vec3.js";import{f as c}from"../../../../../chunks/vec3f64.js";import{sv3d as f,sm4d as d}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as _}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as g}from"../../Manipulator3D.js";import{screenToMapXYAtLocation as M}from"../dragEventPipeline3D.js";import{ManipulatorType as w}from"../ManipulatorType.js";import{colors as v}from"../settings.js";import{DISC_RADIUS as j,DISC_HEIGHT as y,DISC_TRANSLATE_ARROW_OFFSET as A,DISC_TRANSLATE_ARROW_SIZE as I}from"./config.js";import{Manipulation as T}from"./Manipulation.js";import{createGraphicMoveDragPipeline as b}from"./moveUtils.js";import{CullFaceOptions as D}from"../../../webgl-engine/lib/basicInterfaces.js";import E from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as S}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as k}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as P,constrainToMapAxis as U,addScreenDelta as R}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as L}from"../../../../interactive/interfaces.js";class O extends T{constructor(t){super(),this._handles=new r,this._arrowManipulatorInfos=new Array,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),this._angle=0,this._scale=1,this._radius=j,this._updateAfterDrag=!1,this.events=new a,this._tool=t.tool,this._view=t.view,null!=t.radius&&(this._radius=t.radius),this._createManipulators(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}set orthogonalAvailable(t){this._arrowManipulatorInfos[1].manipulator.available=t,this._arrowManipulatorInfos[3].manipulator.available=t}destroy(){this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._handles=i(this._handles),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(t){for(const{manipulator:a}of this._arrowManipulatorInfos)t(a,w.TRANSLATE_XY)}createGraphicDragPipeline(t,a,r){const e=a.graphic,i=_(e),s=o(e.geometry).spatialReference;return b(a,r,(a=>this.createDragPipeline(((r,e,i,o,s)=>a(r,t(r,e,i,o,s),i)),i,s,e)),this._view.state.viewingMode)}createDragPipeline(t,a,r,i){return e(this._arrowManipulatorInfos.map((({manipulator:e},o)=>x(e,((e,s,n,l,p)=>{const u=s.next((t=>({...t,manipulatorType:w.TRANSLATE_XY}))).next(P(this._view,e.elevationAlignedLocation)).next(M(this._view,e.elevationAlignedLocation,a,r,i)).next(U(e.location,this.angle+(o+1)*Math.PI*.5)).next(R());t(e,u,n,l,p)})))))}get angle(){return this._angle}set angle(t){this._angle=t,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(t){this._radius!==t&&(this._radius=t,this._updateManipulators())}_updateManipulators(){for(let t=0;t<this._arrowManipulatorInfos.length;t++)this._updateArrowManipulator(this._arrowManipulatorInfos[t],t);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:t,transform:a},r){const e=this._radius/j,i=I*e,o=i*Math.sqrt(3)/2,p=E.createExtrudedTriangle(o,i/2,i/2,y);E.transformInPlace(p,s(d.get(),m(f.get(),0,-o/3,0))),t.renderObjects=[{geometry:p,material:this._opaqueMaterial,stateMask:L.Focused},{geometry:p,material:this._transparentMaterial,stateMask:L.Unfocused}],t.radius=o/3*2*1.2;const u=n(d.get(),r*Math.PI/2),h=s(d.get(),m(f.get(),0,A*e,0));l(a,u,h)}_createManipulators(){for(let t=0;t<4;t++){const a=this._createArrowManipulator(t);this._arrowManipulatorInfos.push(a)}this._updateManipulatorTransform()}_updateManipulatorTransform(){const t=this.angle,a=p(d.get(),t,c(0,0,1)),r=u(d.get(),m(f.get(),this.displayScale,this.displayScale,this.displayScale)),e=l(d.get(),r,a);for(const i of this._arrowManipulatorInfos){const t=l(d.get(),e,i.transform);i.manipulator.modelTransform=t}}_createArrowManipulator(t){const a=new g({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:c(0,0,1)}}),r={manipulator:a,transform:h()};return this._updateArrowManipulator(r,t),this._handles.add(a.events.on("drag",(t=>{this._updateAfterDrag&&"end"===t.action&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)}))),r}_createMaterial(a=1){const r=t.toUnitRGBA(v.main);return r[3]*=a,new k({color:r,transparent:1!==a,cullFace:D.Back,renderOccluded:S.Transparent})}get test(){return{arrowManipulators:this._arrowManipulatorInfos.map((({manipulator:t})=>t))}}}export{O as MoveXYAxisManipulation};
5
+ import t from"../../../../../Color.js";import a from"../../../../../core/Evented.js";import r from"../../../../../core/Handles.js";import{handlesGroup as e}from"../../../../../core/handleUtils.js";import{destroyMaybe as i,unwrap as o,isNone as s}from"../../../../../core/maybe.js";import{f as n,b as l,m as p,d as u,u as h}from"../../../../../chunks/mat4.js";import{c as m}from"../../../../../chunks/mat4f64.js";import{s as c}from"../../../../../chunks/vec3.js";import{f}from"../../../../../chunks/vec3f64.js";import{sv3d as d,sm4d as _}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as g}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as M}from"../../Manipulator3D.js";import{screenToMapXYAtLocation as w}from"../dragEventPipeline3D.js";import{ManipulatorType as v}from"../ManipulatorType.js";import{colors as j}from"../settings.js";import{DISC_RADIUS as y,DISC_HEIGHT as A,DISC_TRANSLATE_ARROW_OFFSET as I,DISC_TRANSLATE_ARROW_SIZE as T}from"./config.js";import{Manipulation as b}from"./Manipulation.js";import{createGraphicMoveDragPipeline as D}from"./moveUtils.js";import{CullFaceOptions as E}from"../../../webgl-engine/lib/basicInterfaces.js";import S from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as k}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as x}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as P,dragAtLocation as U,constrainToMapAxis as R,addScreenDelta as L}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as O}from"../../../../interactive/interfaces.js";class q extends b{constructor(t){super(),this._handles=new r,this._arrowManipulatorInfos=new Array,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),this._angle=0,this._scale=1,this._radius=y,this._updateAfterDrag=!1,this.events=new a,this._tool=t.tool,this._view=t.view,null!=t.radius&&(this._radius=t.radius),this._createManipulators(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}set orthogonalAvailable(t){this._arrowManipulatorInfos[1].manipulator.available=t,this._arrowManipulatorInfos[3].manipulator.available=t}destroy(){this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._handles=i(this._handles),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(t){for(const{manipulator:a}of this._arrowManipulatorInfos)t(a,v.TRANSLATE_XY)}createGraphicDragPipeline(t,a,r){const e=a.graphic,i=g(e),s=o(e.geometry).spatialReference;return D(a,r,(a=>this.createDragPipeline(((r,e,i,o,s)=>a(r,t(r,e,i,o,s),i)),i,s,e)),this._view.state.viewingMode)}createDragPipeline(t,a,r,i){return e(this._arrowManipulatorInfos.map((({manipulator:e},o)=>P(e,((e,s,n,l,p)=>{const u=s.next((t=>({...t,manipulatorType:v.TRANSLATE_XY}))).next(U(this._view,e.elevationAlignedLocation)).next(w(this._view,e.elevationAlignedLocation,a,r,i)).next(R(e.location,this.angle+(o+1)*Math.PI*.5)).next(L());t(e,u,n,l,p)})))))}get angle(){return this._angle}set angle(t){this._angle=t,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(t){this._radius!==t&&(this._radius=t,this._updateManipulators())}_updateManipulators(){for(let t=0;t<this._arrowManipulatorInfos.length;t++)this._updateArrowManipulator(this._arrowManipulatorInfos[t],t);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:t,transform:a},r){const e=this._radius/y,i=T*e,o=i*Math.sqrt(3)/2,s=S.createExtrudedTriangle(o,i/2,i/2,A);S.transformInPlace(s,n(_.get(),c(d.get(),0,-o/3,0))),t.renderObjects=[{geometry:s,material:this._opaqueMaterial,stateMask:O.Focused},{geometry:s,material:this._transparentMaterial,stateMask:O.Unfocused}],t.radius=o/3*2*1.2;const u=l(_.get(),r*Math.PI/2),h=n(_.get(),c(d.get(),0,I*e,0));p(a,u,h)}_createManipulators(){for(let t=0;t<4;t++){const a=this._createArrowManipulator(t);this._arrowManipulatorInfos.push(a)}this._updateManipulatorTransform()}_updateManipulatorTransform(){const t=this.angle,a=u(_.get(),t,f(0,0,1));if(s(a))return;const r=h(_.get(),c(d.get(),this.displayScale,this.displayScale,this.displayScale)),e=p(_.get(),r,a);for(const i of this._arrowManipulatorInfos){const t=p(_.get(),e,i.transform);i.manipulator.modelTransform=t}}_createArrowManipulator(t){const a=new M({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:f(0,0,1)}}),r={manipulator:a,transform:m()};return this._updateArrowManipulator(r,t),this._handles.add(a.events.on("drag",(t=>{this._updateAfterDrag&&"end"===t.action&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)}))),r}_createMaterial(a=1){const r=t.toUnitRGBA(j.main);return r[3]*=a,new x({color:r,transparent:1!==a,cullFace:E.Back,renderOccluded:k.Transparent})}get test(){return{arrowManipulators:this._arrowManipulatorInfos.map((({manipulator:t})=>t))}}}export{q as MoveXYAxisManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalPI as t}from"../../../../../core/Cyclical.js";import e from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{clamp as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isSome as s,destroyMaybe as r,unwrapOr as n}from"../../../../../core/maybe.js";import{createAngle as l,createLength as c}from"../../../../../core/quantityUtils.js";import{when as h,initial as p,watch as u}from"../../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../../core/scheduling.js";import{createScreenPointArray as g}from"../../../../../core/screenUtils.js";import{d as m,u as _,m as f,h as M,e as D}from"../../../../../chunks/mat4.js";import{c as S}from"../../../../../chunks/mat4f64.js";import{s as v,b as y,l as b,d as T,f as R,a as j}from"../../../../../chunks/vec3.js";import{a as k,f as w}from"../../../../../chunks/vec3f64.js";import{b as O}from"../../../../../chunks/vec4f64.js";import{fromPositionAndNormal as A,create as I,normal as P}from"../../../../../geometry/support/plane.js";import{wrap as E,distance2 as F}from"../../../../../geometry/support/ray.js";import{sv3d as C,sm4d as U}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as x}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as z}from"../../Manipulator3D.js";import{calculateInputRotationTransform as L}from"../../manipulatorUtils.js";import{screenToRenderPlane as N}from"../dragEventPipeline3D.js";import{ManipulatorType as G}from"../ManipulatorType.js";import{ROTATE_INDICATOR_DIRECTION_BUFFER as H,SCALE_INDICATOR_DIRECTION_BUFFER as V,RING_HEIGHT as q,ROTATE_INDICATOR_ARROW_PLACEMENT_PERCENTAGE as B,ROTATE_INDICATOR_ARROW_TIP_LENGTH as J,ROTATE_INDICATOR_ARROW_TIP_RADIUS as K,RING_THICKNESS as Q,HANDLE_COLOR as W,DRAG_THRESHOLD_PX as X,RING_INDICATOR_DELAY_MS as Y,RING_RADIUS as Z,INNER_INDICATOR_RADIUS as $,INDICATOR_THICKNESS as tt,OUTER_INDICATOR_RADIUS as et,SCALE_INDICATOR_OFFSET1 as at,SCALE_INDICATOR_OFFSET2 as it,RING_RESET_ANIMATION_SPEED_FACTOR as ot,GEOMETRY_SEGMENTS as st,ROTATE_INDICATOR_ARC_LENGTH as rt,SCALE_INDICATOR_ARC_LENGTH as nt}from"../manipulations/config.js";import{CullFaceOptions as lt}from"../../../webgl-engine/lib/basicInterfaces.js";import ct from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as ht}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as pt}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as ut}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as dt,ManipulatorStateFlags as gt}from"../../../../interactive/interfaces.js";import{Tooltip as mt}from"../../../../interactive/tooltip/Tooltip.js";import{TransformRotateTooltipInfo as _t,TransformScaleTooltipInfo as ft,TransformAbsoluteTooltipInfo as Mt}from"../../../../interactive/tooltip/TransformTooltipInfos.js";var Dt,St;!function(t){t.ScaleIn=dt.Custom2,t.ScaleOut=dt.Custom3,t.RotateLeft=dt.Custom4,t.RotateRight=dt.Custom5,t.Unlocked=dt.Custom7,t.DelayedFocused=dt.Custom8,t.TouchInput=dt.Custom12}(Dt||(Dt={}));class vt{constructor({adapter:t,tooltipOptions:i,mode:o,tool:r}){this.mode=null,this._handles=new a,this._scaleRotateDragData=null,this._activeAnimation=null,this.events=new e,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>s(this._scaleRotateDragData)&&"scale"===this._scaleRotateDragData.mode?this.adapter.scale:1,this.tool=r,this.mode=o,this.adapter=t,this._tooltipOptions=i,this._tooltip=new mt({view:r.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this._handles.add(h((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),p))}get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}destroy(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=null),this._handles=r(this._handles),this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this._tooltip=r(this._tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=d({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=r(this._activeAnimation))}forEachManipulator(t){t(this._ringManipulator,G.SCALE_ROTATE)}_createManipulator(){const e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);const a=this.tool.graphicState.graphic,r=ut(e,((e,r,n)=>{this._scaleRotateDragData=null;const l=this.adapter.startInteraction(),c={mode:"none",origin:k(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();const h=C.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,h),r.next(N(this.tool.view,A(e.renderLocation,h,I()))).next((e=>{const r=P(e.plane),n=L(e.renderStart,e.renderEnd,c.origin,r),h=t.shortestSignedDiff(c.angle,n);c.angleDir=i(c.angleDir+h,-H,H),c.angle=n;const p=yt(c,e),u=p-this.adapter.scale;if(c.scaleDir=i(c.scaleDir+u,-V,V),this._onScaleChanged(),"none"===c.mode){const t=this.mode||bt(e,e.plane,c.origin,this.tool.view.state.camera);if(s(t)){switch(t){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:a,angle:0}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()})}c.mode=t}}switch(c.mode){case"rotate":l.state.angle=c.initialAngle+n;break;case"scale":l.state.scale=p,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:a,xScale:p,yScale:p})}break;case"end":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:p,yScale:p})}}return"end"===e.action&&(this.startAnimation(Rt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState(),l.done()),e})).next(this._updateTooltipPipelineStep(c)),n.next((()=>{if(l.cancel(),s(this._scaleRotateDragData)){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1})}this.startAnimation(Rt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()}))}));this._handles.add([r,e.events.on("focus-changed",(t=>{"focus"===t.action?this.startAnimation(jt(this,(()=>this._updateDelayedFocusedState()))):this._updateDelayedFocusedState()})),e.events.on("immediate-click",(t=>{t.stopPropagation()})),u((()=>this.tool.graphicState?.displaying),(t=>this._ringManipulator.available=t),p)])}_updateTooltipPipelineStep(t){return e=>{const a=this._tooltipOptions;if(!a.enabled)return e;if("end"===e.action)return this._updateFocusTooltip(),e;const i=this._tooltip,o=this._tooltipOptions.visualVariables,r=s(o)?o.size:null,h=s(o)?o.rotation:null;switch(t.mode){case"scale":i.info=new ft({tooltipOptions:a,scale:{value:this.adapter.scale},size:c(n(this.adapter.size,-1),"meters"),sizeUnit:s(r)?r.unit:null,sizePrecision:s(r)?kt(r.valueType):null});break;case"rotate":{const t=s(h)?kt(h.valueType):null,e=s(h)?h.rotationType:"geographic";i.info=new _t({tooltipOptions:a,rotation:l(n(-this.adapter.relativeAngle,0),"radians","geographic"),rotationPrecision:t,orientation:l(-this.adapter.angle,"radians","geographic"),orientationPrecision:t,rotationType:e})}}return e}}_updateFocusTooltip(){if(!this._tooltipOptions.enabled)return;if(this.getFocused()){const t=this._tooltipOptions.visualVariables,e=s(t)?t.rotation:null,a=s(t)?t.size:null;this._tooltip.info=new Mt({tooltipOptions:this._tooltipOptions,orientation:l(-this.adapter.angle,"radians","geographic"),orientationEnabled:null==this.mode||"rotate"===this.mode,orientationPrecision:s(e)?kt(e.valueType):null,rotationType:s(e)?e.rotationType:"geographic",size:c(n(this.adapter.size,-1),"meters"),sizeUnit:s(a)?a.unit:null,sizeEnabled:null==this.mode||"scale"===this.mode,sizePrecision:s(a)?kt(a.valueType):null})}else this._tooltip.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(Dt.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){if(this._ringManipulator.updateStateEnabled(Dt.Unlocked,!(s(this._scaleRotateDragData)&&"none"!==this._scaleRotateDragData.mode)),s(this._scaleRotateDragData))switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(Dt.ScaleIn|Dt.ScaleOut,!1),this._ringManipulator.updateStateEnabled(Dt.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(Dt.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(Dt.RotateLeft|Dt.RotateRight,!1),this._ringManipulator.updateStateEnabled(Dt.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(Dt.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(Dt.ScaleIn|Dt.ScaleOut|Dt.RotateLeft|Dt.RotateRight,!1)}_updateManipulatorTransform(){const t=m(U.get(),this.adapter.angle,w(0,0,1)),e=this.getScale(),a=_(U.get(),v(C.get(),e,e,e));this._ringManipulator.modelTransform=f(U.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const i=[],o=Math.ceil(st*(e-t)/(2*Math.PI));for(let s=0;s<o+1;s++){const r=t+s*(e-t)/o;i.push(w(a*Math.cos(r),a*Math.sin(r),0))}return i},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,q/2],[-t/2,q/2]],i=(t,e)=>ct.createPathExtrusionGeometry(a(e),t,[],[],!1),o=e(Z),s=i(o,Q),r={left:[],right:[]},n=[];for(let j=0;j<2;j++){const e=j*Math.PI-Math.PI/4,a=Math.PI/2-rt,o=e+a,s=e+Math.PI/2-a,l=t(o,s,$),c=i(l,tt);n.push(l),n.push(t(o,s,et-Q/2)),r.left.push(c),r.right.push(c);for(let t=0;t<2;t++){const e=0===t,a=S();if(e){M(a,a,[1,-1,1]),D(a,a,-o,[0,0,1]);const t=Math.round(B*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}else{D(a,a,s,[0,0,1]);const t=Math.round((1-B)*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}const i=ct.createExtrudedTriangle(J,0,K,q);ct.transformInPlace(i,a),(e?r.left:r.right).push(i)}}const l=[];for(let M=0;M<2;M++){const e=M*Math.PI-Math.PI/4,a=Math.PI/2-nt,o=e+a,s=e+Math.PI/2-a,r=t(o,s,et);l.push(i(r,tt))}const c=e(Z+at),h=e(Z+it),p=i(c,tt),u=i(h,tt),d=e(Z-at),g=e(Z-it),m=i(d,tt),_=i(g,tt),f=this._createMaterial(),v=this._createMaterial(.66),y=this._createMaterial(.5),b=this._createMaterial(.33);let T=[{geometry:s,material:f,stateMask:Dt.DelayedFocused},{geometry:s,material:y,stateMask:gt.None}];this.mode&&"scale"!==this.mode||(T=T.concat([{geometry:l,material:f,stateMask:Dt.DelayedFocused|Dt.Unlocked},{geometry:p,material:v,stateMask:Dt.DelayedFocused|Dt.ScaleIn},{geometry:u,material:b,stateMask:Dt.DelayedFocused|Dt.ScaleIn},{geometry:m,material:v,stateMask:Dt.DelayedFocused|Dt.ScaleOut},{geometry:_,material:b,stateMask:Dt.DelayedFocused|Dt.ScaleOut}])),this.mode&&"rotate"!==this.mode||(T=T.concat([{geometry:r.right,material:f,stateMask:Dt.DelayedFocused|Dt.Unlocked},{geometry:r.left,material:f,stateMask:Dt.DelayedFocused|Dt.RotateLeft},{geometry:r.right,material:f,stateMask:Dt.DelayedFocused|Dt.RotateRight}]));const R=[o,...n];return new z({view:this.tool.view,renderObjects:T,autoScaleRenderObjects:!1,worldOriented:!0,radius:Q,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:x(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:R,direction:w(0,0,1)}})}_createMaterial(t=1){const e=O([...W,t]);return new pt({color:e,transparent:1!==t,cullFace:lt.Back,renderOccluded:ht.Transparent})}get test(){return{ringManipulator:this._ringManipulator,tooltip:this._tooltip}}}function yt(t,e){const a=y(C.get(),e.renderStart,t.origin),i=y(C.get(),e.renderEnd,t.origin),o=b(a),s=b(i);return 0===o?0:s/o}function bt(t,e,a,i){const{renderStart:o,renderEnd:s}=t,r=Tt(o,i,C.get()),n=Tt(s,i,C.get());if(T(r,n)<X*X)return null;const l=y(C.get(),o,a),c=R(C.get(),l,P(e)),h=o,p=j(C.get(),h,c),u=Tt(a,i,C.get()),d=r,g=Tt(p,i,C.get()),m=y(C.get(),g,d),_=y(C.get(),r,u),f=E(d,m),M=E(u,_);return F(f,n)<F(M,n)?"rotate":"scale"}function Tt(t,e,a){return e.projectToScreen(t,wt),v(a,wt[0],wt[1],0)}function Rt(t,e){let a=null,i=1;const o=()=>i;return{start:()=>{i=t.getScale(),a=t.getScale,t.getScale=o,e()},update:t=>(i+=((i+1)/2-i)*Math.min(t*ot,1),e(),Math.abs(i-1)<.01?St.STOP:St.CONTINUE),destroy:()=>{t.getScale=a,e()}}}function jt(t,e){let a=0,i=null;const o=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=o,a=0,e()},update:t=>(a+=t,!i()||a>Y?St.STOP:St.CONTINUE),destroy:()=>{t.getFocused=i,e()}}}function kt(t){switch(t){case"integer":case"long":return 0;default:return null}}!function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(St||(St={}));const wt=g();export{vt as GraphicScaleRotateTransform};
5
+ import{cyclicalPI as t}from"../../../../../core/Cyclical.js";import e from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{clamp as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isSome as s,destroyMaybe as r,unwrapOr as n,isNone as l}from"../../../../../core/maybe.js";import{createAngle as c,createLength as h}from"../../../../../core/quantityUtils.js";import{when as p,initial as u,watch as d}from"../../../../../core/reactiveUtils.js";import{addFrameTask as g}from"../../../../../core/scheduling.js";import{createScreenPointArray as m}from"../../../../../core/screenUtils.js";import{d as _,u as f,m as M,h as D,e as S}from"../../../../../chunks/mat4.js";import{c as v}from"../../../../../chunks/mat4f64.js";import{s as y,b,l as T,d as R,f as j,a as k}from"../../../../../chunks/vec3.js";import{a as w,f as O}from"../../../../../chunks/vec3f64.js";import{b as A}from"../../../../../chunks/vec4f64.js";import{fromPositionAndNormal as I,create as P,normal as E}from"../../../../../geometry/support/plane.js";import{wrap as F,distance2 as C}from"../../../../../geometry/support/ray.js";import{sv3d as U,sm4d as x}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as z}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as L}from"../../Manipulator3D.js";import{calculateInputRotationTransform as N}from"../../manipulatorUtils.js";import{screenToRenderPlane as G}from"../dragEventPipeline3D.js";import{ManipulatorType as H}from"../ManipulatorType.js";import{ROTATE_INDICATOR_DIRECTION_BUFFER as V,SCALE_INDICATOR_DIRECTION_BUFFER as q,RING_HEIGHT as B,ROTATE_INDICATOR_ARROW_PLACEMENT_PERCENTAGE as J,ROTATE_INDICATOR_ARROW_TIP_LENGTH as K,ROTATE_INDICATOR_ARROW_TIP_RADIUS as Q,RING_THICKNESS as W,HANDLE_COLOR as X,DRAG_THRESHOLD_PX as Y,RING_INDICATOR_DELAY_MS as Z,RING_RADIUS as $,INNER_INDICATOR_RADIUS as tt,INDICATOR_THICKNESS as et,OUTER_INDICATOR_RADIUS as at,SCALE_INDICATOR_OFFSET1 as it,SCALE_INDICATOR_OFFSET2 as ot,RING_RESET_ANIMATION_SPEED_FACTOR as st,GEOMETRY_SEGMENTS as rt,ROTATE_INDICATOR_ARC_LENGTH as nt,SCALE_INDICATOR_ARC_LENGTH as lt}from"../manipulations/config.js";import{CullFaceOptions as ct}from"../../../webgl-engine/lib/basicInterfaces.js";import ht from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as pt}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as ut}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as dt}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as gt,ManipulatorStateFlags as mt}from"../../../../interactive/interfaces.js";import{Tooltip as _t}from"../../../../interactive/tooltip/Tooltip.js";import{TransformRotateTooltipInfo as ft,TransformScaleTooltipInfo as Mt,TransformAbsoluteTooltipInfo as Dt}from"../../../../interactive/tooltip/TransformTooltipInfos.js";var St,vt;!function(t){t.ScaleIn=gt.Custom2,t.ScaleOut=gt.Custom3,t.RotateLeft=gt.Custom4,t.RotateRight=gt.Custom5,t.Unlocked=gt.Custom7,t.DelayedFocused=gt.Custom8,t.TouchInput=gt.Custom12}(St||(St={}));class yt{constructor({adapter:t,tooltipOptions:i,mode:o,tool:r}){this.mode=null,this._handles=new a,this._scaleRotateDragData=null,this._activeAnimation=null,this.events=new e,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>s(this._scaleRotateDragData)&&"scale"===this._scaleRotateDragData.mode?this.adapter.scale:1,this.tool=r,this.mode=o,this.adapter=t,this._tooltipOptions=i,this._tooltip=new _t({view:r.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this._handles.add(p((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),u))}get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}destroy(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=null),this._handles=r(this._handles),this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this._tooltip=r(this._tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=g({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=r(this._activeAnimation))}forEachManipulator(t){t(this._ringManipulator,H.SCALE_ROTATE)}_createManipulator(){const e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);const a=this.tool.graphicState.graphic,r=dt(e,((e,r,n)=>{this._scaleRotateDragData=null;const l=this.adapter.startInteraction(),c={mode:"none",origin:w(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();const h=U.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,h),r.next(G(this.tool.view,I(e.renderLocation,h,P()))).next((e=>{const r=E(e.plane),n=N(e.renderStart,e.renderEnd,c.origin,r),h=t.shortestSignedDiff(c.angle,n);c.angleDir=i(c.angleDir+h,-V,V),c.angle=n;const p=bt(c,e),u=p-this.adapter.scale;if(c.scaleDir=i(c.scaleDir+u,-q,q),this._onScaleChanged(),"none"===c.mode){const t=this.mode||Tt(e,e.plane,c.origin,this.tool.view.state.camera);if(s(t)){switch(t){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:a,angle:0}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()})}c.mode=t}}switch(c.mode){case"rotate":l.state.angle=c.initialAngle+n;break;case"scale":l.state.scale=p,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:a,xScale:p,yScale:p})}break;case"end":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:p,yScale:p})}}return"end"===e.action&&(this.startAnimation(jt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState(),l.done()),e})).next(this._updateTooltipPipelineStep(c)),n.next((()=>{if(l.cancel(),s(this._scaleRotateDragData)){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1})}this.startAnimation(jt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()}))}));this._handles.add([r,e.events.on("focus-changed",(t=>{"focus"===t.action?this.startAnimation(kt(this,(()=>this._updateDelayedFocusedState()))):this._updateDelayedFocusedState()})),e.events.on("immediate-click",(t=>{t.stopPropagation()})),d((()=>this.tool.graphicState?.displaying),(t=>this._ringManipulator.available=t),u)])}_updateTooltipPipelineStep(t){return e=>{const a=this._tooltipOptions;if(!a.enabled)return e;if("end"===e.action)return this._updateFocusTooltip(),e;const i=this._tooltip,o=this._tooltipOptions.visualVariables,r=s(o)?o.size:null,l=s(o)?o.rotation:null;switch(t.mode){case"scale":i.info=new Mt({tooltipOptions:a,scale:{value:this.adapter.scale},size:h(n(this.adapter.size,-1),"meters"),sizeUnit:s(r)?r.unit:null,sizePrecision:s(r)?wt(r.valueType):null});break;case"rotate":{const t=s(l)?wt(l.valueType):null,e=s(l)?l.rotationType:"geographic";i.info=new ft({tooltipOptions:a,rotation:c(n(-this.adapter.relativeAngle,0),"radians","geographic"),rotationPrecision:t,orientation:c(-this.adapter.angle,"radians","geographic"),orientationPrecision:t,rotationType:e})}}return e}}_updateFocusTooltip(){if(!this._tooltipOptions.enabled)return;if(this.getFocused()){const t=this._tooltipOptions.visualVariables,e=s(t)?t.rotation:null,a=s(t)?t.size:null;this._tooltip.info=new Dt({tooltipOptions:this._tooltipOptions,orientation:c(-this.adapter.angle,"radians","geographic"),orientationEnabled:null==this.mode||"rotate"===this.mode,orientationPrecision:s(e)?wt(e.valueType):null,rotationType:s(e)?e.rotationType:"geographic",size:h(n(this.adapter.size,-1),"meters"),sizeUnit:s(a)?a.unit:null,sizeEnabled:null==this.mode||"scale"===this.mode,sizePrecision:s(a)?wt(a.valueType):null})}else this._tooltip.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(St.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){if(this._ringManipulator.updateStateEnabled(St.Unlocked,!(s(this._scaleRotateDragData)&&"none"!==this._scaleRotateDragData.mode)),s(this._scaleRotateDragData))switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(St.ScaleIn|St.ScaleOut,!1),this._ringManipulator.updateStateEnabled(St.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(St.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(St.RotateLeft|St.RotateRight,!1),this._ringManipulator.updateStateEnabled(St.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(St.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(St.ScaleIn|St.ScaleOut|St.RotateLeft|St.RotateRight,!1)}_updateManipulatorTransform(){const t=_(x.get(),this.adapter.angle,O(0,0,1));if(l(t))return;const e=this.getScale(),a=f(x.get(),y(U.get(),e,e,e));this._ringManipulator.modelTransform=M(x.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const i=[],o=Math.ceil(rt*(e-t)/(2*Math.PI));for(let s=0;s<o+1;s++){const r=t+s*(e-t)/o;i.push(O(a*Math.cos(r),a*Math.sin(r),0))}return i},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,B/2],[-t/2,B/2]],i=(t,e)=>ht.createPathExtrusionGeometry(a(e),t,[],[],!1),o=e($),s=i(o,W),r={left:[],right:[]},n=[];for(let j=0;j<2;j++){const e=j*Math.PI-Math.PI/4,a=Math.PI/2-nt,o=e+a,s=e+Math.PI/2-a,l=t(o,s,tt),c=i(l,et);n.push(l),n.push(t(o,s,at-W/2)),r.left.push(c),r.right.push(c);for(let t=0;t<2;t++){const e=0===t,a=v();if(e){D(a,a,[1,-1,1]),S(a,a,-o,[0,0,1]);const t=Math.round(J*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}else{S(a,a,s,[0,0,1]);const t=Math.round((1-J)*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}const i=ht.createExtrudedTriangle(K,0,Q,B);ht.transformInPlace(i,a),(e?r.left:r.right).push(i)}}const l=[];for(let D=0;D<2;D++){const e=D*Math.PI-Math.PI/4,a=Math.PI/2-lt,o=e+a,s=e+Math.PI/2-a,r=t(o,s,at);l.push(i(r,et))}const c=e($+it),h=e($+ot),p=i(c,et),u=i(h,et),d=e($-it),g=e($-ot),m=i(d,et),_=i(g,et),f=this._createMaterial(),M=this._createMaterial(.66),y=this._createMaterial(.5),b=this._createMaterial(.33);let T=[{geometry:s,material:f,stateMask:St.DelayedFocused},{geometry:s,material:y,stateMask:mt.None}];this.mode&&"scale"!==this.mode||(T=T.concat([{geometry:l,material:f,stateMask:St.DelayedFocused|St.Unlocked},{geometry:p,material:M,stateMask:St.DelayedFocused|St.ScaleIn},{geometry:u,material:b,stateMask:St.DelayedFocused|St.ScaleIn},{geometry:m,material:M,stateMask:St.DelayedFocused|St.ScaleOut},{geometry:_,material:b,stateMask:St.DelayedFocused|St.ScaleOut}])),this.mode&&"rotate"!==this.mode||(T=T.concat([{geometry:r.right,material:f,stateMask:St.DelayedFocused|St.Unlocked},{geometry:r.left,material:f,stateMask:St.DelayedFocused|St.RotateLeft},{geometry:r.right,material:f,stateMask:St.DelayedFocused|St.RotateRight}]));const R=[o,...n];return new L({view:this.tool.view,renderObjects:T,autoScaleRenderObjects:!1,worldOriented:!0,radius:W,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:z(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:R,direction:O(0,0,1)}})}_createMaterial(t=1){const e=A([...X,t]);return new ut({color:e,transparent:1!==t,cullFace:ct.Back,renderOccluded:pt.Transparent})}get test(){return{ringManipulator:this._ringManipulator,tooltip:this._tooltip}}}function bt(t,e){const a=b(U.get(),e.renderStart,t.origin),i=b(U.get(),e.renderEnd,t.origin),o=T(a),s=T(i);return 0===o?0:s/o}function Tt(t,e,a,i){const{renderStart:o,renderEnd:s}=t,r=Rt(o,i,U.get()),n=Rt(s,i,U.get());if(R(r,n)<Y*Y)return null;const l=b(U.get(),o,a),c=j(U.get(),l,E(e)),h=o,p=k(U.get(),h,c),u=Rt(a,i,U.get()),d=r,g=Rt(p,i,U.get()),m=b(U.get(),g,d),_=b(U.get(),r,u),f=F(d,m),M=F(u,_);return C(f,n)<C(M,n)?"rotate":"scale"}function Rt(t,e,a){return e.projectToScreen(t,Ot),y(a,Ot[0],Ot[1],0)}function jt(t,e){let a=null,i=1;const o=()=>i;return{start:()=>{i=t.getScale(),a=t.getScale,t.getScale=o,e()},update:t=>(i+=((i+1)/2-i)*Math.min(t*st,1),e(),Math.abs(i-1)<.01?vt.STOP:vt.CONTINUE),destroy:()=>{t.getScale=a,e()}}}function kt(t,e){let a=0,i=null;const o=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=o,a=0,e()},update:t=>(a+=t,!i()||a>Z?vt.STOP:vt.CONTINUE),destroy:()=>{t.getFocused=i,e()}}}function wt(t){switch(t){case"integer":case"long":return 0;default:return null}}!function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(vt||(vt={}));const Ot=m();export{yt as GraphicScaleRotateTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o}from"../../../../core/mathUtils.js";import{isNone as r}from"../../../../core/maybe.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{d as i,m as s,e as c}from"../../../../chunks/mat4.js";import{c as m}from"../../../../chunks/mat4f64.js";import{a as u}from"../../../../chunks/vec2.js";import{a as l}from"../../../../chunks/vec2f64.js";import{c as p,e as f,g as h,b as M,n as y,f as g,m as d,a as b,l as j,h as v,s as z,d as x}from"../../../../chunks/vec3.js";import{c as P}from"../../../../chunks/vec3f64.js";import{create as k,axis as I,fromPoints as w,wrapAxisAngle as E}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as S,vectorCoordinates as A}from"../../../../geometry/support/coordinateSystem.js";import{create as H,intersectRay as G,fromNormalAndOffset as U}from"../../../../geometry/support/plane.js";import{j as V,h as q,c as C}from"../../../../chunks/sphere.js";import{angle as F}from"../../../../geometry/support/vector.js";import{sv3d as R,sm4d as T}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as W,fromScreenAtEye as B}from"../../support/geometryUtils/ray.js";import{intersectScreen as D}from"../../support/geometryUtils/sphere.js";import{Camera as J}from"../../webgl-engine/lib/Camera.js";var K;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(K||(K={}));const L=30,N=[1,3e8],O=70;function Q(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function X(t,e,n){const o=R.get(),r=R.get(),a=R.get();p(r,t),p(a,e);const i=f(r,n),s=f(a,n);h(o,n,i),M(r,r,o),y(r,r),h(o,n,s),M(a,a,o),y(a,a);const c=f(r,a);g(o,n,r);const m=f(a,o);return Math.atan2(m,c)}function Y(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function Z(t,e,n){const o=i(T.get(),n[3],I(n));M(Ot,t.eye,e),d(Ot,Ot,o),t.eye=b(Ot,Ot,e),M(Ot,t.center,e),d(Ot,Ot,o),t.center=b(Ot,Ot,e),t.up=d(Ot,t.up,o)}function $(t,e,n,o){return G(t,W(e,n,$t),o)}function _(t,e,n,o){return G(t,B(e,n,$t),o)}function tt(t,e,n,o){const r=R.get();let a=1-n;M(r,e,t.eye);const i=j(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(h(r,r,a),t.eye=b(Ot,t.eye,r),t.center=v(Ot,t.center,e,a))}function et(t,e,n){e.getScreenCenter(nt),D(t,e,nt,Ot)&&(e.center=Ot);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=h(R.get(),e.viewForward,r);e.eye=M(Ot,e.center,a)}const nt=a();function ot(t,e,n){rt(e,n),y(n,n),h(n,n,t)}function rt(t,e){z(e,0,0,0);for(const n of t)b(e,e,n);h(e,e,1/t.length)}function at(t,e,n,o){return Math.sin(t/j(e))*(n+o.radius)}function it(t,e,n,o){return at(Math.PI/2,e,n,o)+(t-Math.PI/2)}var st;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(st||(st={}));const ct={Elevation:3e4,Angle:e(6)},mt={Pole:.95,Angle:e(18),Tilt:45},ut=e(80);function lt(t,e,n,o,r,a){const i=P(),s=C();let c=!0,m=!0;return t.intersectScreen(n,i,a)?s[3]=j(i):(m=!1,e.aboveGround&&r!==K.Ellipsoid?s[3]=Math.max(j(e.center),.9*o.radius):s[3]=j(e.eye)-e.relativeElevation,r===K.Silhouette?Mt(s,e,n,i):c=D(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:m}}function pt(t,e,n,o){if(j(t.eye)-o.radius>ct.Elevation)return st.Horizontal;if(!n)return st.Vertical;B(t,e,_t);return-Math.sign(t.relativeElevation)*(.5*Math.PI+F(t.eye,_t.direction))<ct.Angle?st.Vertical:st.Horizontal}function ft(t,e,n){M(ht,n,e),t.eye=M(Ot,t.eye,ht),t.center=M(Ot,t.center,ht)}const ht=P();function Mt(t,e,n,o){const a=B(e,n,$t);return!r(a)&&(V(t,a,yt),q(t,a,o)?!(x(yt,a.origin)<x(o,a.origin))||(p(o,yt),!1):(M(gt,e.eye,e.center),y(gt,gt),U(gt,-f(y(gt,gt),yt),dt),G(dt,a,o),!1))}const yt=P(),gt=P(),dt=H();function bt(r,a,i,s,c,m){let u;if(g(Yt,r,a),M(Qt,r,a),j(r)<=c||!s.aboveGround){g(i,Qt,s.eye);const l=f(r,a)/(j(r)*j(a)),p=Math.cos(n(t.normalize(e(m)),0,ut));u=-o(l)-Math.max(0,j(a)-c)/(p*c)}else M(jt,s.eye,s.center),g(i,Qt,jt),u=-j(Qt)/c;return y(i,i),h(i,i,j(Yt)),u}const jt=P();function vt(r,a,i,s){let c,m;const u=Math.cos(n(t.normalize(e(s)),0,ut));return c=a>i?-(a-i)/(u*i):a<-i?Math.PI-(a+i)/(u*i):o(a/i),m=r>i?-(r-i)/(u*i):r<-i?Math.PI-(r+i)/(u*i):o(r/i),(m-c)*i}function zt(t,e,n,o,r,a,i,s,c,m){const l=vt(t[2],e[2],i[3],c),p=m?vt(t[0],e[0],i[3],180):e[0]-t[0],h=Math.sin(s)*p-Math.cos(s)*l,M=Math.cos(s)*p+Math.sin(s)*l;y(Ot,r);const g=m?h/Math.sqrt(Math.abs(i[3]**2-f(n,Ot)**2)):h/i[3],d=M/Math.sqrt(Math.abs(i[3]**2-f(n,o)**2));u(a,g,d)}function xt(t,e,n,o,r,a,i,s,c,m){g(Yt,t,e),S(a.up,a.eye,Ct,Ft,Rt),S([0,0,1],a.eye,Ut,Vt,qt),p(n,Vt),p(o,Ut),y(n,n),h(n,n,j(Yt)),A(t,y(Ft,Ft),y(Rt,Rt),y(Ct,Ct),Tt),A(e,Ft,Rt,Ct,Wt),zt(Tt,Wt,t,Ut,Vt,r,i,s,c,m)}function Pt(t,e,n,o,r,a,c){i(Jt,r,o),i(Kt,c,a),s(Lt,Jt,Kt),M(e,t,n),d(e,e,Lt),b(e,e,n)}function kt(t,e,n,o,r,a){i(Jt,o,n),i(Kt,a,r),s(Lt,Jt,Kt),M(Ot,t.eye,e),d(Ot,Ot,Lt),t.eye=b(Ot,Ot,e),M(Ot,t.center,e),d(Ot,Ot,Lt),t.center=b(Ot,Ot,e),M(Ot,t.up,e),d(Ot,Ot,Lt),t.up=b(Ot,Ot,e)}function It(t,e,n,o,r,a,i=mt.Pole,s=mt.Angle){const c=Math.abs(o)>Math.PI-s||Math.abs(o)<s,m=Math.abs(t[2])<n*i||Math.abs(e)>n;return!!(c&&m&&a.aboveGround&&r<mt.Tilt)}function wt(t,e,n,o,r,a){if(a)w(n,o,Dt),Z(e,t,Dt);else{const a=bt(n,o,Zt,e,t[3],r);Z(e,t,E(Zt,a))}}function Et(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let m,u;p(Nt,o),Xt.copyFrom(e);for(let l=0;l<s&&x(n,Nt)>c&&(m=x(n,Nt),xt(n,Nt,Vt,Ut,Bt,Xt,t,r,a,i),kt(Xt,t,Ut,Bt[1],Vt,Bt[0]),Pt(Nt,Nt,t,Ut,Bt[1],Vt,Bt[0]),u=x(n,Nt),u<m||0===l);l++)e.copyFrom(Xt)}function St(n,o,r,a,i,s,c){It(r,f(o.up,r),n[3],-t.normalize(e(i)),s,o,mt.Pole,mt.Angle)?Et(n,o,r,a,-t.normalize(e(i)),s,c):wt(n,o,r,a,s,c)}function At(t,e,n,o,r,a){const{eye:i}=t;S([0,0,1],i,Ut,Vt,qt);const s=e.translation[0]*n.pan,m="zoom"===r.mode?0:e.translation[1]*n.pan,u=Math.max(Math.sqrt(Math.abs(1-f(t.center,Ut)**2/j(t.center)**2)),.5),l=(Math.sin(a)*m+Math.cos(a)*s)/u,p=-Math.cos(a)*m+Math.sin(a)*s;switch(c(o.pan.matrix,o.pan.matrix,l,Ut),o.pan.enabled=!0,r.mode){case"pan":c(o.pan.matrix,o.pan.matrix,p,Vt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Ht(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=g(R.get(),i,a),m=e.translation[0]*n.pan;switch(0!==m&&(c(o.pan.matrix,o.pan.matrix,-m,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Gt(n,o,r,a,i,s,c,m,u){It(n.center,f(n.up,n.center),j(n.center),-t.normalize(e(s)),c,o)?At(o,r,a,m,u,-t.normalize(e(i))):Ht(o,r,a,m,u)}const Ut=P(),Vt=P(),qt=P(),Ct=P(),Ft=P(),Rt=P(),Tt=P(),Wt=P(),Bt=l(),Dt=k(),Jt=m(),Kt=m(),Lt=m(),Nt=P(),Ot=P(),Qt=P(),Xt=new J,Yt=P(),Zt=P(),$t={origin:P(),direction:P()},_t={origin:P(),direction:P()};export{N as DISTANCE_CLAMP_VALUES,st as NavigationMode,L as PIVOT_DISTANCE_MODIFIER,mt as PreservingHeadingThreshold,O as SCREEN_PIXEL_AREA,K as SpherePickPointFallback,ut as TiltThresholdPanningSpeed,ct as VerticalPanTresholds,ft as applyPanPlanar,wt as applyPanSphericalDirectRotation,Et as applyPanSphericalPreserveHeading,Z as applyRotation,kt as applyRotationWithTwoAxes,et as applyZoomOnSphere,tt as applyZoomToPoint,rt as centroid,ot as centroidOnSphere,pt as decideNavigationMode,$ as intersectPlaneFromScreenPoint,_ as intersectPlaneFromScreenPointAtEye,vt as lengthFromPoints,Q as normalizeCoordinate,Y as normalizeRotationDelta,it as offSurfaceTiltToEyeTiltGlobal,at as onSurfaceTiltToEyeTiltGlobal,Gt as panMotionToRotationMatrix,St as panToPosition,lt as pickPointAndInitSphere,It as preserveHeadingThreshold,Pt as rotatePointAroundTwoAxes,bt as rotationAngleAndAxisDirectRotation,xt as rotationAnglesAndAxesHeadingPreserving,zt as rotationAnglesHeadingPreserving,X as rotationFromPointsAroundAxis,Mt as sphereOrPlanePointFromScreenPoint};
5
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o}from"../../../../core/mathUtils.js";import{isNone as r}from"../../../../core/maybe.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{d as i,m as s,e as c}from"../../../../chunks/mat4.js";import{c as m}from"../../../../chunks/mat4f64.js";import{a as u}from"../../../../chunks/vec2.js";import{a as l}from"../../../../chunks/vec2f64.js";import{c as p,e as f,g as h,b as M,n as y,f as g,m as d,a as b,l as j,h as v,s as z,d as x}from"../../../../chunks/vec3.js";import{c as P}from"../../../../chunks/vec3f64.js";import{create as k,axis as I,fromPoints as w,wrapAxisAngle as E}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as S,vectorCoordinates as A}from"../../../../geometry/support/coordinateSystem.js";import{create as H,intersectRay as G,fromNormalAndOffset as U}from"../../../../geometry/support/plane.js";import{j as V,h as q,c as C}from"../../../../chunks/sphere.js";import{angle as F}from"../../../../geometry/support/vector.js";import{sv3d as R,sm4d as T}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as W,fromScreenAtEye as B}from"../../support/geometryUtils/ray.js";import{intersectScreen as D}from"../../support/geometryUtils/sphere.js";import{Camera as J}from"../../webgl-engine/lib/Camera.js";var K;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(K||(K={}));const L=30,N=[1,3e8],O=70;function Q(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function X(t,e,n){const o=R.get(),r=R.get(),a=R.get();p(r,t),p(a,e);const i=f(r,n),s=f(a,n);h(o,n,i),M(r,r,o),y(r,r),h(o,n,s),M(a,a,o),y(a,a);const c=f(r,a);g(o,n,r);const m=f(a,o);return Math.atan2(m,c)}function Y(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function Z(t,e,n){const o=i(T.get(),n[3],I(n));r(o)||(M(Ot,t.eye,e),d(Ot,Ot,o),t.eye=b(Ot,Ot,e),M(Ot,t.center,e),d(Ot,Ot,o),t.center=b(Ot,Ot,e),t.up=d(Ot,t.up,o))}function $(t,e,n,o){return G(t,W(e,n,$t),o)}function _(t,e,n,o){return G(t,B(e,n,$t),o)}function tt(t,e,n,o){const r=R.get();let a=1-n;M(r,e,t.eye);const i=j(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(h(r,r,a),t.eye=b(Ot,t.eye,r),t.center=v(Ot,t.center,e,a))}function et(t,e,n){e.getScreenCenter(nt),D(t,e,nt,Ot)&&(e.center=Ot);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=h(R.get(),e.viewForward,r);e.eye=M(Ot,e.center,a)}const nt=a();function ot(t,e,n){rt(e,n),y(n,n),h(n,n,t)}function rt(t,e){z(e,0,0,0);for(const n of t)b(e,e,n);h(e,e,1/t.length)}function at(t,e,n,o){return Math.sin(t/j(e))*(n+o.radius)}function it(t,e,n,o){return at(Math.PI/2,e,n,o)+(t-Math.PI/2)}var st;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(st||(st={}));const ct={Elevation:3e4,Angle:e(6)},mt={Pole:.95,Angle:e(18),Tilt:45},ut=e(80);function lt(t,e,n,o,r,a){const i=P(),s=C();let c=!0,m=!0;return t.intersectScreen(n,i,a)?s[3]=j(i):(m=!1,e.aboveGround&&r!==K.Ellipsoid?s[3]=Math.max(j(e.center),.9*o.radius):s[3]=j(e.eye)-e.relativeElevation,r===K.Silhouette?Mt(s,e,n,i):c=D(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:m}}function pt(t,e,n,o){if(j(t.eye)-o.radius>ct.Elevation)return st.Horizontal;if(!n)return st.Vertical;B(t,e,_t);return-Math.sign(t.relativeElevation)*(.5*Math.PI+F(t.eye,_t.direction))<ct.Angle?st.Vertical:st.Horizontal}function ft(t,e,n){M(ht,n,e),t.eye=M(Ot,t.eye,ht),t.center=M(Ot,t.center,ht)}const ht=P();function Mt(t,e,n,o){const a=B(e,n,$t);return!r(a)&&(V(t,a,yt),q(t,a,o)?!(x(yt,a.origin)<x(o,a.origin))||(p(o,yt),!1):(M(gt,e.eye,e.center),y(gt,gt),U(gt,-f(y(gt,gt),yt),dt),G(dt,a,o),!1))}const yt=P(),gt=P(),dt=H();function bt(r,a,i,s,c,m){let u;if(g(Yt,r,a),M(Qt,r,a),j(r)<=c||!s.aboveGround){g(i,Qt,s.eye);const l=f(r,a)/(j(r)*j(a)),p=Math.cos(n(t.normalize(e(m)),0,ut));u=-o(l)-Math.max(0,j(a)-c)/(p*c)}else M(jt,s.eye,s.center),g(i,Qt,jt),u=-j(Qt)/c;return y(i,i),h(i,i,j(Yt)),u}const jt=P();function vt(r,a,i,s){let c,m;const u=Math.cos(n(t.normalize(e(s)),0,ut));return c=a>i?-(a-i)/(u*i):a<-i?Math.PI-(a+i)/(u*i):o(a/i),m=r>i?-(r-i)/(u*i):r<-i?Math.PI-(r+i)/(u*i):o(r/i),(m-c)*i}function zt(t,e,n,o,r,a,i,s,c,m){const l=vt(t[2],e[2],i[3],c),p=m?vt(t[0],e[0],i[3],180):e[0]-t[0],h=Math.sin(s)*p-Math.cos(s)*l,M=Math.cos(s)*p+Math.sin(s)*l;y(Ot,r);const g=m?h/Math.sqrt(Math.abs(i[3]**2-f(n,Ot)**2)):h/i[3],d=M/Math.sqrt(Math.abs(i[3]**2-f(n,o)**2));u(a,g,d)}function xt(t,e,n,o,r,a,i,s,c,m){g(Yt,t,e),S(a.up,a.eye,Ct,Ft,Rt),S([0,0,1],a.eye,Ut,Vt,qt),p(n,Vt),p(o,Ut),y(n,n),h(n,n,j(Yt)),A(t,y(Ft,Ft),y(Rt,Rt),y(Ct,Ct),Tt),A(e,Ft,Rt,Ct,Wt),zt(Tt,Wt,t,Ut,Vt,r,i,s,c,m)}function Pt(t,e,n,o,r,a,c){i(Jt,r,o),i(Kt,c,a),s(Lt,Jt,Kt),M(e,t,n),d(e,e,Lt),b(e,e,n)}function kt(t,e,n,o,r,a){i(Jt,o,n),i(Kt,a,r),s(Lt,Jt,Kt),M(Ot,t.eye,e),d(Ot,Ot,Lt),t.eye=b(Ot,Ot,e),M(Ot,t.center,e),d(Ot,Ot,Lt),t.center=b(Ot,Ot,e),M(Ot,t.up,e),d(Ot,Ot,Lt),t.up=b(Ot,Ot,e)}function It(t,e,n,o,r,a,i=mt.Pole,s=mt.Angle){const c=Math.abs(o)>Math.PI-s||Math.abs(o)<s,m=Math.abs(t[2])<n*i||Math.abs(e)>n;return!!(c&&m&&a.aboveGround&&r<mt.Tilt)}function wt(t,e,n,o,r,a){if(a)w(n,o,Dt),Z(e,t,Dt);else{const a=bt(n,o,Zt,e,t[3],r);Z(e,t,E(Zt,a))}}function Et(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let m,u;p(Nt,o),Xt.copyFrom(e);for(let l=0;l<s&&x(n,Nt)>c&&(m=x(n,Nt),xt(n,Nt,Vt,Ut,Bt,Xt,t,r,a,i),kt(Xt,t,Ut,Bt[1],Vt,Bt[0]),Pt(Nt,Nt,t,Ut,Bt[1],Vt,Bt[0]),u=x(n,Nt),u<m||0===l);l++)e.copyFrom(Xt)}function St(n,o,r,a,i,s,c){It(r,f(o.up,r),n[3],-t.normalize(e(i)),s,o,mt.Pole,mt.Angle)?Et(n,o,r,a,-t.normalize(e(i)),s,c):wt(n,o,r,a,s,c)}function At(t,e,n,o,r,a){const{eye:i}=t;S([0,0,1],i,Ut,Vt,qt);const s=e.translation[0]*n.pan,m="zoom"===r.mode?0:e.translation[1]*n.pan,u=Math.max(Math.sqrt(Math.abs(1-f(t.center,Ut)**2/j(t.center)**2)),.5),l=(Math.sin(a)*m+Math.cos(a)*s)/u,p=-Math.cos(a)*m+Math.sin(a)*s;switch(c(o.pan.matrix,o.pan.matrix,l,Ut),o.pan.enabled=!0,r.mode){case"pan":c(o.pan.matrix,o.pan.matrix,p,Vt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Ht(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=g(R.get(),i,a),m=e.translation[0]*n.pan;switch(0!==m&&(c(o.pan.matrix,o.pan.matrix,-m,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Gt(n,o,r,a,i,s,c,m,u){It(n.center,f(n.up,n.center),j(n.center),-t.normalize(e(s)),c,o)?At(o,r,a,m,u,-t.normalize(e(i))):Ht(o,r,a,m,u)}const Ut=P(),Vt=P(),qt=P(),Ct=P(),Ft=P(),Rt=P(),Tt=P(),Wt=P(),Bt=l(),Dt=k(),Jt=m(),Kt=m(),Lt=m(),Nt=P(),Ot=P(),Qt=P(),Xt=new J,Yt=P(),Zt=P(),$t={origin:P(),direction:P()},_t={origin:P(),direction:P()};export{N as DISTANCE_CLAMP_VALUES,st as NavigationMode,L as PIVOT_DISTANCE_MODIFIER,mt as PreservingHeadingThreshold,O as SCREEN_PIXEL_AREA,K as SpherePickPointFallback,ut as TiltThresholdPanningSpeed,ct as VerticalPanTresholds,ft as applyPanPlanar,wt as applyPanSphericalDirectRotation,Et as applyPanSphericalPreserveHeading,Z as applyRotation,kt as applyRotationWithTwoAxes,et as applyZoomOnSphere,tt as applyZoomToPoint,rt as centroid,ot as centroidOnSphere,pt as decideNavigationMode,$ as intersectPlaneFromScreenPoint,_ as intersectPlaneFromScreenPointAtEye,vt as lengthFromPoints,Q as normalizeCoordinate,Y as normalizeRotationDelta,it as offSurfaceTiltToEyeTiltGlobal,at as onSurfaceTiltToEyeTiltGlobal,Gt as panMotionToRotationMatrix,St as panToPosition,lt as pickPointAndInitSphere,It as preserveHeadingThreshold,Pt as rotatePointAroundTwoAxes,bt as rotationAngleAndAxisDirectRotation,xt as rotationAnglesAndAxesHeadingPreserving,zt as rotationAnglesHeadingPreserving,X as rotationFromPointsAroundAxis,Mt as sphereOrPlanePointFromScreenPoint};