@arcgis/core 4.32.2 → 4.32.3

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/WebLinkChart.js +1 -1
  2. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +2 -0
  3. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{e51feb7a08e554372293.js → 3d9d056be30a9a5d5420.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{c01fb5b090b36fdf317f.js → 6ef137ff1f70a179bbc3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/a2293ef59b8b98a640e8.js +1 -0
  8. package/assets/esri/core/workers/chunks/b8416f2560710258c239.js +1 -0
  9. package/assets/esri/core/workers/chunks/{6e92569a4a82592b95dc.js → d8957c711756df11f774.js} +1 -1
  10. package/assets/esri/themes/base/widgets/_Sketch.scss +4 -4
  11. package/assets/esri/themes/dark/main.css +1 -1
  12. package/assets/esri/themes/light/main.css +1 -1
  13. package/assets/esri/themes/light/view.css +1 -1
  14. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  15. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  16. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  17. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  18. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  19. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  20. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  21. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  22. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  23. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  24. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  25. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  26. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  27. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  28. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  29. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  30. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  31. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  32. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  33. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  34. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  35. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  36. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  37. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  38. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  39. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  40. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  41. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  42. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  43. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  44. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  45. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  46. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  47. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  48. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  49. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  50. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  51. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  52. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  53. package/interfaces.d.ts +17 -15
  54. package/kernel.js +1 -1
  55. package/layers/LinkChartLayer.js +1 -1
  56. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  57. package/layers/mixins/SublayersOwner.js +1 -1
  58. package/package.json +1 -1
  59. package/support/revision.js +1 -1
  60. package/symbols/support/previewSymbol2D.js +1 -1
  61. package/webdoc/support/webdocSaveUtils.js +1 -1
  62. package/webdoc/support/writeUtils.js +1 -1
  63. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  64. package/widgets/support/SelectionToolbar.js +1 -1
  65. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  66. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  67. package/assets/esri/core/workers/chunks/68ac336f7384bbca85ab.js +0 -1
  68. package/assets/esri/core/workers/chunks/bd3487b587851b20ff2a.js +0 -1
@@ -1 +1 @@
1
- {"formFailedToLoad":"Form yüklenemedi.","differentValues":"(Farklı değerler)","empty":"Değer yok","showAllOptions":"Tüm seçenekleri göster","valueExpressionError":"Değer hesaplanamadı","failedToCalculateValues":"Değerler hesaplanamadı","expressionEvaluationFailed":"Biçim hesaplamaları yürütemedi","formComplexityThresholdExceeded":"Form yüklenemedi. Lütfen daha az detayla deneyin","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Lütfen bir değer girin","outsideRange":"Değer {min} ve {max} arasında olmalıdır","outsideRangeMax":"Değer {max}'dan küçük veya eşit olmalıdır","outsideRangeMin":"Değer {min}'den büyük veya eşit olmalıdır","invalidCodedValue":"Değer listelenen değerlerden biri olmalıdır.","invalidType":"Geçerli bir değer değil","invalidBatchFormType":"Bir veya daha fazla detay geçersiz değerler içeriyor. Ayrı detayları kontrol edin.","tooShort":"Bu alan minimum {min} karakter içerir","featuresInError":"Bir veya daha fazla detayda hata var. Ayrı detayları kontrol edin.","nonVisibleError_checkIndividualFeatures":"Bir veya daha fazla detayda geçersiz değerler içeren gizli alanlar var. Ayrı ayrı detayları kontrol edin ve sorunları düzeltin.","featuresWithInvalidValues":"Bir veya daha fazla detayda geçersiz değerler var","nonVisibleError_changeValues":"Seçili detayda geçersiz değerlere sahip gizli alanlar var. Alanların görünür olması için değerleri değiştirin."},"noVisibleFields":{"noElementsInCommon":"Seçili detaylarda paylaşılmış alan yok","noElements":"Seçili detaylarda görüntülenecek alan yok","elementsHiddenInSome":"Seçili detaylarda, görünürlük ifadeleri nedeniyle görüntülenmeyen paylaşılan alanlar var","allElementsHidden":"Seçili detaylarda görüntülenecek alan yok"},"requiredFieldBatchMode":"Bu alan bir veya daha fazla detay için gereklidir.","requiredFieldLabel":"{name} - gerekli alan"}
1
+ {"formFailedToLoad":"Form yüklenemedi.","differentValues":"(Farklı değerler)","empty":"Değer yok","showAllOptions":"Tüm seçenekleri göster","valueExpressionError":"Değer hesaplanamadı","failedToCalculateValues":"Değerler hesaplanamadı","expressionEvaluationFailed":"Biçim hesaplamaları yürütemedi","formComplexityThresholdExceeded":"Form yüklenemedi. Lütfen daha az detayla deneyin","unsupportedContingentValues":"Birden fazla detay için özniteliklerin düzenlenmesi, olasılıklı değerlere sahip katmanlarda kullanılamaz.","validationErrors":{"cannotBeNull":"Lütfen bir değer girin","outsideRange":"Değer {min} ve {max} arasında olmalıdır","outsideRangeMax":"Değer {max}'dan küçük veya eşit olmalıdır","outsideRangeMin":"Değer {min}'den büyük veya eşit olmalıdır","invalidCodedValue":"Değer listelenen değerlerden biri olmalıdır.","invalidType":"Geçerli bir değer değil","invalidBatchFormType":"Bir veya daha fazla detay geçersiz değerler içeriyor. Ayrı detayları kontrol edin.","tooShort":"Bu alan minimum {min} karakter içerir","featuresInError":"Bir veya daha fazla detayda hata var. Ayrı detayları kontrol edin.","nonVisibleError_checkIndividualFeatures":"Bir veya daha fazla detayda geçersiz değerler içeren gizli alanlar var. Ayrı ayrı detayları kontrol edin ve sorunları düzeltin.","featuresWithInvalidValues":"Bir veya daha fazla detayda geçersiz değerler var","nonVisibleError_changeValues":"Seçili detayda geçersiz değerlere sahip gizli alanlar var. Alanların görünür olması için değerleri değiştirin."},"noVisibleFields":{"noElementsInCommon":"Seçili detaylarda paylaşılmış alan yok","noElements":"Seçili detaylarda görüntülenecek alan yok","elementsHiddenInSome":"Seçili detaylarda, görünürlük ifadeleri nedeniyle görüntülenmeyen paylaşılan alanlar var","allElementsHidden":"Seçili detaylarda görüntülenecek alan yok"},"requiredFieldBatchMode":"Bu alan bir veya daha fazla detay için gereklidir.","requiredFieldLabel":"{name} - gerekli alan"}
@@ -1 +1 @@
1
- {"formFailedToLoad":"Не вдалося завантажити форму.","differentValues":"(Різні значення)","empty":"Без значення","showAllOptions":"Показати всі опції","valueExpressionError":"Не вдалося обчислити значення","failedToCalculateValues":"Не вдалося обчислити значення","expressionEvaluationFailed":"Не вдалося виконати обчислення форми.","formComplexityThresholdExceeded":"Не вдалося завантажити форму. Спробуйте з меншою кількістю обʼєктів","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Введіть значення","outsideRange":"Значення має знаходитися в діапазоні від {min} до {max}","outsideRangeMax":"Значення має бути менше або дорівнювати {max}","outsideRangeMin":"Значення має бути більше або дорівнювати {min}","invalidCodedValue":"Значення має бути одним з перелічених значень.","invalidType":"Неприпустиме значення","invalidBatchFormType":"Деякі обʼєкти містять неприпустимі значення. Перевірте окремі обʼєкти.","tooShort":"Це поле потребує щонайменше {min} символів","featuresInError":"Деякі обʼєкти мають помилки. Перевірте окремі обʼєкти.","nonVisibleError_checkIndividualFeatures":"Деякі обʼєкти мають приховані поля з неприпустимими значеннями. Перевірте окремі обʼєкти та усуньте проблеми.","featuresWithInvalidValues":"Деякі обʼєкти мають неприпустимі значення","nonVisibleError_changeValues":"Вибраний обʼєкт має приховані поля з неприпустимими значеннями. Змініть значення, щоб поля стали видимими."},"noVisibleFields":{"noElementsInCommon":"У вибраних обʼєктів немає спільних полів","noElements":"У вибраного обʼєкту немає полів для відображення","elementsHiddenInSome":"У вибраних обʼєктів є спільні поля, які не відображаються через вирази видимості","allElementsHidden":"У вибраних обʼєктів немає полів для відображення"},"requiredFieldBatchMode":"Для цього поля потрібен один або кілька обʼєктів.","requiredFieldLabel":"{name} - обов’язкове поле"}
1
+ {"formFailedToLoad":"Не вдалося завантажити форму.","differentValues":"(Різні значення)","empty":"Без значення","showAllOptions":"Показати всі опції","valueExpressionError":"Не вдалося обчислити значення","failedToCalculateValues":"Не вдалося обчислити значення","expressionEvaluationFailed":"Не вдалося виконати обчислення форми.","formComplexityThresholdExceeded":"Не вдалося завантажити форму. Спробуйте з меншою кількістю обʼєктів","unsupportedContingentValues":"Атрибути редагування для декількох обʼєктів не доступні для шарів із залежними значеннями.","validationErrors":{"cannotBeNull":"Введіть значення","outsideRange":"Значення має знаходитися в діапазоні від {min} до {max}","outsideRangeMax":"Значення має бути менше або дорівнювати {max}","outsideRangeMin":"Значення має бути більше або дорівнювати {min}","invalidCodedValue":"Значення має бути одним з перелічених значень.","invalidType":"Неприпустиме значення","invalidBatchFormType":"Деякі обʼєкти містять неприпустимі значення. Перевірте окремі обʼєкти.","tooShort":"Це поле потребує щонайменше {min} символів","featuresInError":"Деякі обʼєкти мають помилки. Перевірте окремі обʼєкти.","nonVisibleError_checkIndividualFeatures":"Деякі обʼєкти мають приховані поля з неприпустимими значеннями. Перевірте окремі обʼєкти та усуньте проблеми.","featuresWithInvalidValues":"Деякі обʼєкти мають неприпустимі значення","nonVisibleError_changeValues":"Вибраний обʼєкт має приховані поля з неприпустимими значеннями. Змініть значення, щоб поля стали видимими."},"noVisibleFields":{"noElementsInCommon":"У вибраних обʼєктів немає спільних полів","noElements":"У вибраного обʼєкту немає полів для відображення","elementsHiddenInSome":"У вибраних обʼєктів є спільні поля, які не відображаються через вирази видимості","allElementsHidden":"У вибраних обʼєктів немає полів для відображення"},"requiredFieldBatchMode":"Для цього поля потрібен один або кілька обʼєктів.","requiredFieldLabel":"{name} - обов’язкове поле"}
@@ -1 +1 @@
1
- {"formFailedToLoad":"Không thể tải biểu mẫu.","differentValues":"(Các giá trị khác nhau)","empty":"Không có giá trị","showAllOptions":"Hiển thị tất cả tùy chọn","valueExpressionError":"Không thể tính toán giá trị","failedToCalculateValues":"Không thể tính toán giá trị","expressionEvaluationFailed":"Không thể chạy tính toán biểu mẫu","formComplexityThresholdExceeded":"Không thể tải biểu mẫu. Vui lòng thử với ít đối tượng hơn","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Vui lòng nhập giá trị","outsideRange":"Giá trị phải nằm trong khoảng từ {min} đến {max}","outsideRangeMax":"Giá trị phải nhỏ hơn hoặc bằng {max}","outsideRangeMin":"Giá trị phải lớn hơn hoặc bằng {min}","invalidCodedValue":"Giá trị phải là một trong các giá trị được liệt kê.","invalidType":"Không phải là giá trị hợp lệ","invalidBatchFormType":"Một hoặc nhiều đối tượng chứa giá trị không hợp lệ. Kiểm tra từng đối tượng.","tooShort":"Trường này yêu cầu nhập tối thiểu {min} ký tự","featuresInError":"Một hoặc nhiều đối tượng có lỗi. Kiểm tra từng đối tượng.","nonVisibleError_checkIndividualFeatures":"Một hoặc nhiều đối tượng có trường bị ẩn với giá trị không hợp lệ. Kiểm tra từng đối tượng và khắc phục sự cố.","featuresWithInvalidValues":"Một hoặc nhiều đối tượng có giá trị không hợp lệ","nonVisibleError_changeValues":"Đối tượng được chọn có trường bị ẩn với giá trị không hợp lệ. Thay đổi giá trị để các trường có thể nhìn thấy được."},"noVisibleFields":{"noElementsInCommon":"Đối tượng được chọn không có trường được chia sẻ","noElements":"Đối tượng được chọn không có trường để hiển thị","elementsHiddenInSome":"Đối tượng được chọn có trường được chia sẻ không được hiển thị vì biểu thức tùy chọn","allElementsHidden":"Đối tượng được chọn không có trường để hiển thị"},"requiredFieldBatchMode":"Cần có trường này cho một hoặc nhiều đối tượng.","requiredFieldLabel":"{name} - trường bắt buộc"}
1
+ {"formFailedToLoad":"Không thể tải biểu mẫu.","differentValues":"(Các giá trị khác nhau)","empty":"Không có giá trị","showAllOptions":"Hiển thị tất cả tùy chọn","valueExpressionError":"Không thể tính toán giá trị","failedToCalculateValues":"Không thể tính toán giá trị","expressionEvaluationFailed":"Không thể chạy tính toán biểu mẫu","formComplexityThresholdExceeded":"Không thể tải biểu mẫu. Vui lòng thử với ít đối tượng hơn","unsupportedContingentValues":"Tính năng chỉnh sửa thuộc tính cho nhiều đối tượng không khả dụng đối với lớp có giá trị ràng buộc.","validationErrors":{"cannotBeNull":"Vui lòng nhập giá trị","outsideRange":"Giá trị phải nằm trong khoảng từ {min} đến {max}","outsideRangeMax":"Giá trị phải nhỏ hơn hoặc bằng {max}","outsideRangeMin":"Giá trị phải lớn hơn hoặc bằng {min}","invalidCodedValue":"Giá trị phải là một trong các giá trị được liệt kê.","invalidType":"Không phải là giá trị hợp lệ","invalidBatchFormType":"Một hoặc nhiều đối tượng chứa giá trị không hợp lệ. Kiểm tra từng đối tượng.","tooShort":"Trường này yêu cầu nhập tối thiểu {min} ký tự","featuresInError":"Một hoặc nhiều đối tượng có lỗi. Kiểm tra từng đối tượng.","nonVisibleError_checkIndividualFeatures":"Một hoặc nhiều đối tượng có trường bị ẩn với giá trị không hợp lệ. Kiểm tra từng đối tượng và khắc phục sự cố.","featuresWithInvalidValues":"Một hoặc nhiều đối tượng có giá trị không hợp lệ","nonVisibleError_changeValues":"Đối tượng được chọn có trường bị ẩn với giá trị không hợp lệ. Thay đổi giá trị để các trường có thể nhìn thấy được."},"noVisibleFields":{"noElementsInCommon":"Đối tượng được chọn không có trường được chia sẻ","noElements":"Đối tượng được chọn không có trường để hiển thị","elementsHiddenInSome":"Đối tượng được chọn có trường được chia sẻ không được hiển thị vì biểu thức tùy chọn","allElementsHidden":"Đối tượng được chọn không có trường để hiển thị"},"requiredFieldBatchMode":"Cần có trường này cho một hoặc nhiều đối tượng.","requiredFieldLabel":"{name} - trường bắt buộc"}
@@ -1 +1 @@
1
- {"formFailedToLoad":"表单加载失败。","differentValues":"(不同值)","empty":"没有值","showAllOptions":"显示所有选项","valueExpressionError":"计算值失败","failedToCalculateValues":"无法计算值","expressionEvaluationFailed":"表单计算失败","formComplexityThresholdExceeded":"表单加载失败。 请尝试减少处理的要素数量","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"请输入一个值","outsideRange":"值应该介于 {min} 到 {max} 之间","outsideRangeMax":"值应小于或等于 {max}","outsideRangeMin":"值应大于或等于 {min}","invalidCodedValue":"值应为下列某个值。","invalidType":"不是有效值","invalidBatchFormType":"一个或多个要素包含无效值。 检查各个要素。","tooShort":"此字段至少需要 {min} 个字符。","featuresInError":"一个或多个要素具有错误。 检查各个要素。","nonVisibleError_checkIndividualFeatures":"一个或多个要素的隐藏字段具有无效值。 请检查单个要素并解决该问题。","featuresWithInvalidValues":"一个或多个要素具有无效值","nonVisibleError_changeValues":"所选要素的隐藏字段具有无效值。 修改这些值,使其可见。"},"noVisibleFields":{"noElementsInCommon":"所选要素没有共享字段","noElements":"所选要素没有可显示的字段","elementsHiddenInSome":"所选要素的共享字段因可见性表达式未显示","allElementsHidden":"所选要素没有任何可显示的字段"},"requiredFieldBatchMode":"此字段为一个或多个要素的必填项。","requiredFieldLabel":"{name} - 为必填字段"}
1
+ {"formFailedToLoad":"表单加载失败。","differentValues":"(不同值)","empty":"没有值","showAllOptions":"显示所有选项","valueExpressionError":"计算值失败","failedToCalculateValues":"无法计算值","expressionEvaluationFailed":"表单计算失败","formComplexityThresholdExceeded":"表单加载失败。 请尝试减少处理的要素数量","unsupportedContingentValues":"编辑多个要素的属性不适用于具有条件值的图层。","validationErrors":{"cannotBeNull":"请输入一个值","outsideRange":"值应该介于 {min} 到 {max} 之间","outsideRangeMax":"值应小于或等于 {max}","outsideRangeMin":"值应大于或等于 {min}","invalidCodedValue":"值应为下列某个值。","invalidType":"不是有效值","invalidBatchFormType":"一个或多个要素包含无效值。 检查各个要素。","tooShort":"此字段至少需要 {min} 个字符。","featuresInError":"一个或多个要素具有错误。 检查各个要素。","nonVisibleError_checkIndividualFeatures":"一个或多个要素的隐藏字段具有无效值。 请检查单个要素并解决该问题。","featuresWithInvalidValues":"一个或多个要素具有无效值","nonVisibleError_changeValues":"所选要素的隐藏字段具有无效值。 修改这些值,使其可见。"},"noVisibleFields":{"noElementsInCommon":"所选要素没有共享字段","noElements":"所选要素没有可显示的字段","elementsHiddenInSome":"所选要素的共享字段因可见性表达式未显示","allElementsHidden":"所选要素没有任何可显示的字段"},"requiredFieldBatchMode":"此字段为一个或多个要素的必填项。","requiredFieldLabel":"{name} - 为必填字段"}
@@ -1 +1 @@
1
- {"formFailedToLoad":"無法載入表格。","differentValues":"(不同值)","empty":"沒有值","showAllOptions":"顯示所有選項","valueExpressionError":"無法計算值。","failedToCalculateValues":"無法計算值","expressionEvaluationFailed":"表格無法執行計算","formComplexityThresholdExceeded":"無法載入表格。 請試著使用較少的圖徵","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"請輸入一個值","outsideRange":"值應該介於 {min} 到 {max}","outsideRangeMax":"值必須小於或等於 {max}","outsideRangeMin":"值必須大於或等於 {min}","invalidCodedValue":"值必須是其中一個列出值。","invalidType":"非有效值","invalidBatchFormType":"一或多個圖徵包含無效值。 檢查個別圖徵。","tooShort":"此欄位至少需要 {min} 個字元","featuresInError":"一或多個圖徵發生錯誤。 檢查個別圖徵。","nonVisibleError_checkIndividualFeatures":"一或多個圖徵具有包含無效值的隱藏欄位。 檢查個別圖徵並更正問題。","featuresWithInvalidValues":"一或多個圖徵具有無效值","nonVisibleError_changeValues":"所選圖徵具有包含無效值的隱藏欄位。 變更值以使欄位可見。"},"noVisibleFields":{"noElementsInCommon":"所選圖徵沒有分享的欄位","noElements":"所選圖徵沒有要顯示的欄位","elementsHiddenInSome":"所選圖徵具有分享的欄位,由於可見性表達式而未顯示","allElementsHidden":"所選圖徵沒有要顯示的欄位"},"requiredFieldBatchMode":"此欄位對於一或多個圖徵是必要的。","requiredFieldLabel":"{name} - 必要欄位"}
1
+ {"formFailedToLoad":"無法載入表格。","differentValues":"(不同值)","empty":"沒有值","showAllOptions":"顯示所有選項","valueExpressionError":"無法計算值。","failedToCalculateValues":"無法計算值","expressionEvaluationFailed":"表格無法執行計算","formComplexityThresholdExceeded":"無法載入表格。 請試著使用較少的圖徵","unsupportedContingentValues":"對於具有意外值的圖層,無法編輯多個圖徵的屬性。","validationErrors":{"cannotBeNull":"請輸入一個值","outsideRange":"值應該介於 {min} 到 {max}","outsideRangeMax":"值必須小於或等於 {max}","outsideRangeMin":"值必須大於或等於 {min}","invalidCodedValue":"值必須是其中一個列出值。","invalidType":"非有效值","invalidBatchFormType":"一或多個圖徵包含無效值。 檢查個別圖徵。","tooShort":"此欄位至少需要 {min} 個字元","featuresInError":"一或多個圖徵發生錯誤。 檢查個別圖徵。","nonVisibleError_checkIndividualFeatures":"一或多個圖徵具有包含無效值的隱藏欄位。 檢查個別圖徵並更正問題。","featuresWithInvalidValues":"一或多個圖徵具有無效值","nonVisibleError_changeValues":"所選圖徵具有包含無效值的隱藏欄位。 變更值以使欄位可見。"},"noVisibleFields":{"noElementsInCommon":"所選圖徵沒有分享的欄位","noElements":"所選圖徵沒有要顯示的欄位","elementsHiddenInSome":"所選圖徵具有分享的欄位,由於可見性表達式而未顯示","allElementsHidden":"所選圖徵沒有要顯示的欄位"},"requiredFieldBatchMode":"此欄位對於一或多個圖徵是必要的。","requiredFieldLabel":"{name} - 必要欄位"}
@@ -1 +1 @@
1
- {"formFailedToLoad":"無法載入表格。","differentValues":"(不同值)","empty":"沒有值","showAllOptions":"顯示所有選項","valueExpressionError":"無法計算值。","failedToCalculateValues":"無法計算值","expressionEvaluationFailed":"表格無法執行計算","formComplexityThresholdExceeded":"無法載入表格。 請試著使用較少的圖徵","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"請輸入一個值","outsideRange":"值應該介於 {min} 到 {max}","outsideRangeMax":"值必須小於或等於 {max}","outsideRangeMin":"值必須大於或等於 {min}","invalidCodedValue":"值必須是其中一個列出值。","invalidType":"非有效值","invalidBatchFormType":"一或多個圖徵包含無效值。 檢查個別圖徵。","tooShort":"此欄位至少需要 {min} 個字元","featuresInError":"一或多個圖徵發生錯誤。 檢查個別圖徵。","nonVisibleError_checkIndividualFeatures":"一或多個圖徵具有包含無效值的隱藏欄位。 檢查個別圖徵並更正問題。","featuresWithInvalidValues":"一或多個圖徵具有無效值","nonVisibleError_changeValues":"所選圖徵具有包含無效值的隱藏欄位。 變更值以使欄位可見。"},"noVisibleFields":{"noElementsInCommon":"所選圖徵沒有分享的欄位","noElements":"所選圖徵沒有要顯示的欄位","elementsHiddenInSome":"所選圖徵具有分享的欄位,由於可見性表達式而未顯示","allElementsHidden":"所選圖徵沒有要顯示的欄位"},"requiredFieldBatchMode":"此欄位對於一或多個圖徵是必要的。","requiredFieldLabel":"{name} - 必要欄位"}
1
+ {"formFailedToLoad":"無法載入表格。","differentValues":"(不同值)","empty":"沒有值","showAllOptions":"顯示所有選項","valueExpressionError":"無法計算值。","failedToCalculateValues":"無法計算值","expressionEvaluationFailed":"表格無法執行計算","formComplexityThresholdExceeded":"無法載入表格。 請試著使用較少的圖徵","unsupportedContingentValues":"對於具有意外值的圖層,無法編輯多個圖徵的屬性。","validationErrors":{"cannotBeNull":"請輸入一個值","outsideRange":"值應該介於 {min} 到 {max}","outsideRangeMax":"值必須小於或等於 {max}","outsideRangeMin":"值必須大於或等於 {min}","invalidCodedValue":"值必須是其中一個列出值。","invalidType":"非有效值","invalidBatchFormType":"一或多個圖徵包含無效值。 檢查個別圖徵。","tooShort":"此欄位至少需要 {min} 個字元","featuresInError":"一或多個圖徵發生錯誤。 檢查個別圖徵。","nonVisibleError_checkIndividualFeatures":"一或多個圖徵具有包含無效值的隱藏欄位。 檢查個別圖徵並更正問題。","featuresWithInvalidValues":"一或多個圖徵具有無效值","nonVisibleError_changeValues":"所選圖徵具有包含無效值的隱藏欄位。 變更值以使欄位可見。"},"noVisibleFields":{"noElementsInCommon":"所選圖徵沒有分享的欄位","noElements":"所選圖徵沒有要顯示的欄位","elementsHiddenInSome":"所選圖徵具有分享的欄位,由於可見性表達式而未顯示","allElementsHidden":"所選圖徵沒有要顯示的欄位"},"requiredFieldBatchMode":"此欄位對於一或多個圖徵是必要的。","requiredFieldLabel":"{name} - 必要欄位"}
package/interfaces.d.ts CHANGED
@@ -1629,6 +1629,8 @@ declare namespace __esri {
1629
1629
  interface generalSharedKgUtils {
1630
1630
  extentToInBoundsRings(extent: Extent): number[][][];
1631
1631
  getBindParametersFromCypherQuery(query: string): Promise<BindParamsFromCypherQueryResult>;
1632
+ getDefaultKnowledgeSublayerLabelingInfos(graphTypeName: string, geometryType: "point" | "multipoint" | "polyline" | "polygon" | nullish, displayLabelProperty: string): LabelClass[] | nullish;
1633
+ getDefaultLinkChartSublayerLabelingInfos(graphType: "entity" | "relationship", graphTypeName: string, displayLabelProperty: string): LabelClass[] | nullish;
1632
1634
  newLinkChartLayerWithOptimizedGeometry(properties?: LinkChartLayerConstructProperties): LinkChartLayer;
1633
1635
  }
1634
1636
 
@@ -100061,7 +100063,7 @@ declare namespace __esri {
100061
100063
  *
100062
100064
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100063
100065
  */
100064
- whenLayerView(layer: PointCloudLayer): Promise<any>;
100066
+ whenLayerView(layer: PointCloudLayer): Promise<PointCloudLayerView>;
100065
100067
  /**
100066
100068
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100067
100069
  * on the view for the given layer.
@@ -100070,7 +100072,7 @@ declare namespace __esri {
100070
100072
  *
100071
100073
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100072
100074
  */
100073
- whenLayerView(layer: StreamLayer): Promise<any>;
100075
+ whenLayerView(layer: StreamLayer): Promise<StreamLayerView>;
100074
100076
  /**
100075
100077
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100076
100078
  * on the view for the given layer.
@@ -100079,7 +100081,7 @@ declare namespace __esri {
100079
100081
  *
100080
100082
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100081
100083
  */
100082
- whenLayerView(layer: WFSLayer): Promise<any>;
100084
+ whenLayerView(layer: WFSLayer): Promise<WFSLayerView>;
100083
100085
  /**
100084
100086
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100085
100087
  * on the view for the given layer.
@@ -100088,7 +100090,7 @@ declare namespace __esri {
100088
100090
  *
100089
100091
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100090
100092
  */
100091
- whenLayerView(layer: OGCFeatureLayer): Promise<any>;
100093
+ whenLayerView(layer: OGCFeatureLayer): Promise<OGCFeatureLayerView>;
100092
100094
  /**
100093
100095
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100094
100096
  * on the view for the given layer.
@@ -100097,7 +100099,7 @@ declare namespace __esri {
100097
100099
  *
100098
100100
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100099
100101
  */
100100
- whenLayerView(layer: FeatureLayer): Promise<any>;
100102
+ whenLayerView(layer: FeatureLayer): Promise<FeatureLayerView>;
100101
100103
  /**
100102
100104
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100103
100105
  * on the view for the given layer.
@@ -100106,7 +100108,7 @@ declare namespace __esri {
100106
100108
  *
100107
100109
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100108
100110
  */
100109
- whenLayerView(layer: CSVLayer): Promise<any>;
100111
+ whenLayerView(layer: CSVLayer): Promise<CSVLayerView>;
100110
100112
  /**
100111
100113
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100112
100114
  * on the view for the given layer.
@@ -100115,7 +100117,7 @@ declare namespace __esri {
100115
100117
  *
100116
100118
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100117
100119
  */
100118
- whenLayerView(layer: GeoJSONLayer): Promise<any>;
100120
+ whenLayerView(layer: GeoJSONLayer): Promise<GeoJSONLayerView>;
100119
100121
  /**
100120
100122
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100121
100123
  * on the view for the given layer.
@@ -100124,7 +100126,7 @@ declare namespace __esri {
100124
100126
  *
100125
100127
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100126
100128
  */
100127
- whenLayerView(layer: GeoRSSLayer): Promise<any>;
100129
+ whenLayerView(layer: GeoRSSLayer): Promise<GeoRSSLayerView>;
100128
100130
  /**
100129
100131
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100130
100132
  * on the view for the given layer.
@@ -100133,7 +100135,7 @@ declare namespace __esri {
100133
100135
  *
100134
100136
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100135
100137
  */
100136
- whenLayerView(layer: GraphicsLayer): Promise<any>;
100138
+ whenLayerView(layer: GraphicsLayer): Promise<GraphicsLayerView>;
100137
100139
  /**
100138
100140
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100139
100141
  * on the view for the given layer.
@@ -100142,7 +100144,7 @@ declare namespace __esri {
100142
100144
  *
100143
100145
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100144
100146
  */
100145
- whenLayerView(layer: ImageryLayer): Promise<any>;
100147
+ whenLayerView(layer: ImageryLayer): Promise<ImageryLayerView>;
100146
100148
  /**
100147
100149
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100148
100150
  * on the view for the given layer.
@@ -100151,7 +100153,7 @@ declare namespace __esri {
100151
100153
  *
100152
100154
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100153
100155
  */
100154
- whenLayerView(layer: KMLLayer): Promise<any>;
100156
+ whenLayerView(layer: KMLLayer): Promise<KMLLayerView>;
100155
100157
  /**
100156
100158
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100157
100159
  * on the view for the given layer.
@@ -100160,7 +100162,7 @@ declare namespace __esri {
100160
100162
  *
100161
100163
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100162
100164
  */
100163
- whenLayerView(layer: SceneLayer): Promise<any>;
100165
+ whenLayerView(layer: SceneLayer): Promise<SceneLayerView>;
100164
100166
  /**
100165
100167
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100166
100168
  * on the view for the given layer.
@@ -100169,7 +100171,7 @@ declare namespace __esri {
100169
100171
  *
100170
100172
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100171
100173
  */
100172
- whenLayerView(layer: DimensionLayer): Promise<any>;
100174
+ whenLayerView(layer: DimensionLayer): Promise<DimensionLayerView>;
100173
100175
  /**
100174
100176
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100175
100177
  * on the view for the given layer.
@@ -100178,7 +100180,7 @@ declare namespace __esri {
100178
100180
  *
100179
100181
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100180
100182
  */
100181
- whenLayerView(layer: MediaLayer): Promise<any>;
100183
+ whenLayerView(layer: MediaLayer): Promise<MediaLayerView>;
100182
100184
  /**
100183
100185
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100184
100186
  * on the view for the given layer.
@@ -100187,7 +100189,7 @@ declare namespace __esri {
100187
100189
  *
100188
100190
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView Read more...}
100189
100191
  */
100190
- whenLayerView(layer: ViewshedLayer): Promise<any>;
100192
+ whenLayerView(layer: ViewshedLayer): Promise<ViewshedLayerView>;
100191
100193
  /**
100192
100194
  * Gets the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html LayerView} created
100193
100195
  * on the view for the given layer.
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.32";let s,r=e;r="4.32.2";function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.32";let s,r=e;r="4.32.3";function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{serializationUtilsModuleWrapper as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import i from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as s,isAbortError as l,createAbortError as h}from"../core/promiseUtils.js";import{watch as d,sync as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as y,idToName as g}from"../core/accessorSupport/PropertyOrigin.js";import m from"../geometry/Extent.js";import f from"../geometry/Point.js";import L from"../geometry/Polyline.js";import b from"./Layer.js";import{convertFromGeometry as w}from"./graphics/featureConversionUtils.js";import{systemOidFieldName as M,systemOriginIdFieldName as k,systemDestinationIdFieldName as C,systemLayoutGeometryFieldName as T,systemAggregationCountFieldName as N}from"./knowledgeGraph/constants.js";import{IdealEdgeLengthTypeOptions as D}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as v}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import x from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as I}from"./knowledgeGraph/layerUtils.js";import E from"./knowledgeGraph/SessionMemoryStorage.js";import{convertLayoutTypeToWebSupportedFormat as S,getRelationshipEndNodeIds as _}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as R}from"./mixins/BlendLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{LCChronologicalLayout as G,LCSimpleLayout as z,LCSmartTreeLayout as P,LCRadialTreeLayout as O,LCHierarchicalLayout as F,LCCommunityLayout as U,LCForceDirectedLayout as B,NodeFlag as Q,load as W,CallStatus as $,LinkType as H}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as K}from"../rest/knowledgeGraphService.js";let V=class extends(A(R(j(r(b))))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(a.ofType(x)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(x)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new i("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(d((()=>this.layers.concat(this.tables)),((e,t)=>this._handleSublayersChange(e,t)),p))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],o=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new i("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,r)=>{const s=this._graphTypeLookup.get(r);if(!s)return n.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(r);"relationship"===s.type?t.has(r)||(t.add(r),o.push(s)):"entity"===s.type?t.has(r)||(t.add(r),a.push(s)):(n.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(r))})):(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]);const r=new v({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=o,this.dataManager=r}load(e){const a=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await I(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1})),await this._initializeDiagram(),this.layers.forEach((a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise((e=>{a.on("layerview-create",(()=>{e(null)}))})))})),this.tables.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t)};return this.addResolvingPromise(new Promise((i=>{K(this.url).then((async n=>{n.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),n.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}));const r=this.linkChart?.linkChartProperties;if(r?.originIdOf("entitiesUrl")===y.LINK_CHART&&(this.membershipModified=!1,this._originalInclusionList=await t.fetchAndConvertSerializedLinkChart({entitiesUrl:r?.entitiesUrl,relationshipsUrl:r?.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(n.dataModel),this.initializationLinkChartConfig={layoutSettings:r?.layoutSettings??void 0,layoutMode:S(r.layoutType)}),this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache){const e=E.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);if(a){o(this.dataManager.sublayerCaches,t,(()=>new Map)).set(i.id,a)}}await a()}else{const t="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{s(e),await a()})))}i(null)}))}))),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):n.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await _(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const r of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id))&&n.push(r);if(t){const e=new Set,t=[];for(const a of n)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const r of n)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);a&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings}),n.length>0&&(this.membershipModified=!0);const o=[];return this.layers.forEach((e=>{o.push(e.refreshCachedQueryEngine())})),await Promise.all(o),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id))),await this._handleNewRecords(i,t),i.length>0&&(this.membershipModified=!0),s(t?.signal)}catch(i){throw l(i)&&a.length>0&&this.removeRecords(a,{overrideMembershipCheck:!0}),i}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===y.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===y.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{const a=o(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:w(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}}))}))}async calculateLinkChartLayout(e="organic-standard",t){const a=[],r=[],l=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{a.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{r.push({typeName:t,feature:e})}))})),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const d=new Map,p=new Map,c=new Map,u=new Map,y=new Uint8Array(a.length),g=new Float64Array(a.length),b=new Float64Array(a.length),D=new Float64Array(a.length),v=new Float64Array(a.length),x=new Uint32Array(r.length),I=new Uint32Array(r.length),E=new Float64Array(r.length),S=new Float64Array(r.length),_=[],R="organic-standard",A=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let j,K="organic-standard",V=0,q=0;const J=G.apply;switch(K="geographic-organic-standard"===e?R:e,K){case"organic-standard":j=B.apply;break;case"organic-community":j=U.apply;break;case"hierarchical-bottom-to-top":j=F.apply;break;case"radial-root-centric":j=O.apply;break;case"tree-left-to-right":j=P.apply;break;default:j=z.apply}let X=!1;a.forEach((({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[M])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?y[V]=Q.IsGeographic:y[V]=Q.None;const n=t.lockedNodeLocations.get(i.attributes[M]);g[V]=n.x,b[V]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){y[V]=Q.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":g[V]=t?.x,b[V]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(g[V]=e.x,b[V]=e.y):y[V]=Q.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(g[V]=e.x,b[V]=e.y):y[V]=Q.IsMovable;break;default:y[V]=Q.IsMovable}(null==g[V]||null==b[V]||Number.isNaN(g[V])||Number.isNaN(b[V]))&&(y[V]=Q.IsMovable,g[V]=0,b[V]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!X&&t?.lockedNodeLocations?.has(i.attributes[M])&&(X=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;D[V]=o?new Date(o).getTime():NaN;const r=e?.endField,s=r&&e?.endField?i.attributes[r]:null;v[V]=s?new Date(s).getTime():NaN,g[V]=0,b[V]=0,y[V]=Q.IsMovable}else y[V]=Q.IsMovable,g[V]=0,b[V]=0;u.set(i.attributes[M],V),_[V]={feature:i,typeName:a},V++})),X&&n.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let Y=!1;const Z=new Map;r.forEach((a=>{const i=a.feature.attributes[k],n=a.feature.attributes[C],o=u.get(i),r=u.get(n),s=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?s?.startField:null,d=h?a.feature.attributes[h]:null,p=s?.endField,c=p?a.feature.attributes[p]:null;if(void 0!==o&&void 0!==r){let t=i+"-"+n;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+c);const s=Z.get(t),h=s?.has(a.typeName);h||(x[q]=o,I[q]=r,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(E[q]=d?new Date(d).getTime():NaN,S[q]=c?new Date(c).getTime():NaN),void 0===s?Z.set(t,new Map([[a.typeName,q]])):s.set(a.typeName,q),q++),l.push(a)}else Y=!0,this.relationshipLinkChartDiagramLookup.set(i,null)})),Y&&n.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const ee=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),te=this._convertValidatedOrganicSettingsToCalculationSettings(ee);await W();let ae=$.Error,ie=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:ae,links:ie,graphics:a}=J((()=>t?.signal?.aborted??!1),y,g,b,D,v,x.subarray(0,q),I.subarray(0,q),E.subarray(0,q),S.subarray(0,q),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),ae===$.Success&&(this.chronologicalAuxiliaryGraphics=a)}else({status:ae,links:ie}=j((()=>t?.signal?.aborted??!1),y,g,b,x.subarray(0,q),I.subarray(0,q),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(s(t?.signal),ae===$.Error)throw new i("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(ae===$.Canceled)throw h();for(let i=0;i<_.length;i++){if(b[i]>84.9999?b[i]=84.9999:b[i]<-84.9999&&(b[i]=-84.9999),g[i]>179.9999?g[i]=179.9999:g[i]<-179.9999&&(g[i]=-179.9999),_[i].feature.attributes[T]=new f(g[i],b[i]),d.has(_[i].typeName)){const e=d.get(_[i].typeName);e?.set(_[i].feature.attributes[M],_[i].feature)}else{const e=new Map;e.set(_[i].feature.attributes[M],_[i].feature),d.set(_[i].typeName,e)}c.set(_[i].feature.attributes[M],_[i].feature);const e=w(_[i].feature.attributes[T]);this.entityLinkChartDiagramLookup.set(_[i].feature.attributes[M],_[i].feature.attributes[T]?e:null);const t=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,_[i].typeName,(()=>({useAllData:!1,members:new Map})));o(t.members,_[i].feature.attributes[M],(()=>({id:_[i].feature.attributes[M],linkChartLocation:void 0}))).linkChartLocation=_[i].feature.attributes[T],_[i].feature.attributes[T].x<A.xmin&&(A.xmin=_[i].feature.attributes[T].x),_[i].feature.attributes[T].x>A.xmax&&(A.xmax=_[i].feature.attributes[T].x),_[i].feature.attributes[T].y<A.ymin&&(A.ymin=_[i].feature.attributes[T].y),_[i].feature.attributes[T].y>A.ymax&&(A.ymax=_[i].feature.attributes[T].y)}if(this.linkChartExtent.xmin=A.xmin,this.linkChartExtent.xmax=A.xmax,this.linkChartExtent.ymin=A.ymin,this.linkChartExtent.ymax=A.ymax,!ie)throw new i("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ne=new Map,oe=new Map,re=new Map,se=new Set;for(let i=0;i<l.length;i++){const a=[],r=l[i],s=r.feature.attributes[k],h=r.feature.attributes[C];let d=s+"-"+h;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(r.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?r.feature.attributes[a]:null,n=e?.endField;d+="-"+i+"-"+(n?r.feature.attributes[n]:null)}const y=Z.get(d).get(r.typeName),g=0===y?0:ie?.vertexEndIndex[y-1];if(!se.has(y)){if(se.add(y),ie.types[y]===H.Recursive){const e=[ie.vertices[2*g],ie.vertices[2*g+1]],t=[ie.vertices[2*(g+1)],ie.vertices[2*(g+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],o=[i[0]+n[1],i[1]-n[0]],r=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(o),a.push(t),a.push(r),a.push(e)}else{if(ie.types[y]!==H.Regular){n.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<ie.vertexEndIndex[y];e++)a.push([ie.vertices[2*e],ie.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=_[u.get(s)]?.feature.attributes[T],t=_[u.get(h)]?.feature.attributes[T];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);ne.has(d)?ne.get(d).push(a):ne.set(d,[a])}const m=ne.get(d);oe.has(d)||(oe.set(d,new Map),re.set(d,new Map));const f=oe.get(d),b=re.get(d);f.has(r.typeName)||(f.set(r.typeName,m.shift()),b.set(r.typeName,0));const N=f.get(r.typeName);b.set(r.typeName,b.get(r.typeName)+1);const D=new L({paths:[N]});if(r.feature.attributes[T]=D,p.has(r.typeName)){const e=p.get(r.typeName);e?.set(r.feature.attributes[M],r.feature)}else{const e=new Map;e.set(r.feature.attributes[M],r.feature),p.set(r.typeName,e)}c.set(r.feature.attributes[M],r.feature);const v=w(r.feature.attributes[T]);this.relationshipLinkChartDiagramLookup.set(r.feature.attributes[M],r.feature.attributes[T]?v:null);const x=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,r.typeName,(()=>({useAllData:!1,members:new Map})));o(x.members,r.feature.attributes[M],(()=>({id:r.feature.attributes[M],linkChartLocation:void 0}))).linkChartLocation=v}for(const i of l)i.feature.attributes[N]=re.get(i.feature.attributes[k]+"-"+i.feature.attributes[C])?.get(i.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:d,links:p,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new f({x:i.x,y:i.y})))}));return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),s(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),s(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach((e=>{a.set(e.objectType.name,e.timeInfo)})),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=[];this.dataManager.addToLayer(e);for(const n of e)this.sublayerIdsCache.has(n.typeName)||(this.sublayerIdsCache.set(n.typeName,new Set),a.push(n.typeName)),this.sublayerIdsCache.get(n.typeName).add(n.id);for(const n of a){const e=this._graphTypeLookup.get(n);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(n):this.dataManager.relationshipTypeNames.add(n),t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.set(n,new Map)}}await I(this,a,t),await this.dataManager.refreshCacheContent(e.map((e=>e.id)),void 0,void 0,void 0,t);const i={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[n,o]of this.entityLinkChartDiagramLookup.entries())o&&i.lockedNodeLocations.set(n,new f(o.coords[0],o.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,i)}_createSublayers(e,t,a){e.forEach((e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)}))}_updateSublayers(e,t){t.forEach((t=>{t.parentCompositeLayer=this;const a=e.find((e=>e.type===t.graphType&&e.name===t.graphTypeName));a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))}))}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=y.PORTAL_ITEM&&e<y.USER}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e?.members?.forEach((e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=w(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[k]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[C]);if(t&&a){const i=w(new L({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[M],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[M],null)}))}))):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig||{}}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=1,o=e=>a(e)&&e>=1,r=e=>Object.values(D).includes(e),s=e=>a(e)&&e>=0,l={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return l;const{computationBudgetTime:h,autoRepulsionRadius:d,repulsionRadiusMultiplier:p,absoluteIdealEdgeLength:c,multiplicativeIdealEdgeLength:u,idealEdgeLengthType:y}=t;return o(h)?l.computationBudgetTime=h:h&&n.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),l.autoRepulsionRadius=d,!d&&i(p)?l.repulsionRadiusMultiplier=p:d||(l.autoRepulsionRadius=!0,n.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&(r(y)?l.idealEdgeLengthType=y:void 0!==y&&n.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===y&&s(c)?l.absoluteIdealEdgeLength=c:"absolute-value"===y&&void 0!==c?n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===y&&s(u)?l.multiplicativeIdealEdgeLength=u:"multiplier"===y&&void 0!==u&&n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),l}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===D.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===D.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new x({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map((e=>e.name)).concat((e.relationshipTypes??[]).map((e=>e.name)))),i=new Set((e.entityTypes??[]).map((e=>e.name))),o=new Set((e.relationshipTypes??[]).map((e=>e.name)));if(this.layers){for(const a of this.layers)!a.graphType&&t.has(a.graphTypeName)&&(a.graphType=i.has(a.graphTypeName)?"entity":"relationship");const e=this.layers.filter((e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):o.has(e.graphTypeName))));this.setAtOrigin("layers",e,g(this.originIdOf("layers")))}else this.layers=new a;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map((e=>e.graphTypeName))??[],a=this.layers.map((e=>e.graphTypeName)).concat(t);for(const n of a)e.has(n)||this._originalInclusionList.namedTypeDefinitions.set(n,{useAllData:!1,members:new Map});const i=[];for(const o of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(o)||(n.getLogger(this).warn(`A named type, ${o}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(o));for(const n of i)this._originalInclusionList.namedTypeDefinitions.delete(n)}}};e([c()],V.prototype,"dataPreloadedInLocalCache",void 0),e([c()],V.prototype,"initializationLinkChartConfig",void 0),e([c()],V.prototype,"membershipModified",void 0),e([c()],V.prototype,"dataManager",void 0),e([c()],V.prototype,"initializationInclusionModeDefinition",null),e([c()],V.prototype,"knowledgeGraph",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],V.prototype,"layers",void 0),e([c({readOnly:!0})],V.prototype,"linkChart",null),e([c()],V.prototype,"entityLinkChartDiagramLookup",void 0),e([c()],V.prototype,"relationshipLinkChartDiagramLookup",void 0),e([c()],V.prototype,"linkChartExtent",void 0),e([c()],V.prototype,"memberEntityTypes",void 0),e([c()],V.prototype,"memberRelationshipTypes",void 0),e([c({type:["LinkChartLayer"]})],V.prototype,"operationalLayerType",void 0),e([c()],V.prototype,"sublayerIdsCache",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],V.prototype,"tables",void 0),e([c({json:{read:!1}})],V.prototype,"type",void 0),e([c({json:{read:!1}})],V.prototype,"chronologicalAuxiliaryGraphics",void 0),V=e([u("esri.layers.LinkChartLayer")],V);const q=V;export{q as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{serializationUtilsModuleWrapper as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import i from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as s,isAbortError as l,createAbortError as h}from"../core/promiseUtils.js";import{watch as d,sync as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as y,idToName as g}from"../core/accessorSupport/PropertyOrigin.js";import m from"../geometry/Extent.js";import f from"../geometry/Point.js";import L from"../geometry/Polyline.js";import b from"./Layer.js";import{convertFromGeometry as w}from"./graphics/featureConversionUtils.js";import{systemOidFieldName as M,systemOriginIdFieldName as k,systemDestinationIdFieldName as C,systemLayoutGeometryFieldName as T,systemAggregationCountFieldName as N}from"./knowledgeGraph/constants.js";import{IdealEdgeLengthTypeOptions as v}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as D}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import x from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as I}from"./knowledgeGraph/layerUtils.js";import E from"./knowledgeGraph/SessionMemoryStorage.js";import{convertLayoutTypeToWebSupportedFormat as S,getRelationshipEndNodeIds as _}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as R}from"./mixins/BlendLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{url as G}from"./support/commonProperties.js";import{LCChronologicalLayout as z,LCSimpleLayout as P,LCSmartTreeLayout as O,LCRadialTreeLayout as F,LCHierarchicalLayout as U,LCCommunityLayout as B,LCForceDirectedLayout as Q,NodeFlag as W,load as $,CallStatus as H,LinkType as K}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as V}from"../rest/knowledgeGraphService.js";let q=class extends(A(R(j(r(b))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(a.ofType(x)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(x)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new i("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(d((()=>this.layers.concat(this.tables)),((e,t)=>this._handleSublayersChange(e,t)),p))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],o=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new i("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,r)=>{const s=this._graphTypeLookup.get(r);if(!s)return n.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(r);"relationship"===s.type?t.has(r)||(t.add(r),o.push(s)):"entity"===s.type?t.has(r)||(t.add(r),a.push(s)):(n.getLogger(this).warn(`A named type, ${r}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(r))})):(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]);const r=new D({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=o,this.dataManager=r}load(e){const a=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await I(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1})),await this._initializeDiagram(),this.layers.forEach((a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise((e=>{a.on("layerview-create",(()=>{e(null)}))})))})),this.tables.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t)};return this.addResolvingPromise(new Promise((i=>{V(this.url).then((async n=>{n.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),n.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}));const r=this.linkChart?.linkChartProperties;if(r?.originIdOf("entitiesUrl")===y.LINK_CHART&&(this.membershipModified=!1,this._originalInclusionList=await t.fetchAndConvertSerializedLinkChart({entitiesUrl:r?.entitiesUrl,relationshipsUrl:r?.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(n.dataModel),this.initializationLinkChartConfig={layoutSettings:r?.layoutSettings??void 0,layoutMode:S(r.layoutType)}),this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache){const e=E.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);if(a){o(this.dataManager.sublayerCaches,t,(()=>new Map)).set(i.id,a)}}await a()}else{const t="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{s(e),await a()})))}i(null)}))}))),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):n.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await _(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const r of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id))&&n.push(r);if(t){const e=new Set,t=[];for(const a of n)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const r of n)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);a&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings}),n.length>0&&(this.membershipModified=!0);const o=[];return this.layers.forEach((e=>{o.push(e.refreshCachedQueryEngine())})),await Promise.all(o),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id))),await this._handleNewRecords(i,t),i.length>0&&(this.membershipModified=!0),s(t?.signal)}catch(i){throw l(i)&&a.length>0&&this.removeRecords(a,{overrideMembershipCheck:!0}),i}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===y.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===y.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{const a=o(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:w(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}}))}))}async calculateLinkChartLayout(e="organic-standard",t){const a=[],r=[],l=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{a.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{r.push({typeName:t,feature:e})}))})),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const d=new Map,p=new Map,c=new Map,u=new Map,y=new Uint8Array(a.length),g=new Float64Array(a.length),b=new Float64Array(a.length),v=new Float64Array(a.length),D=new Float64Array(a.length),x=new Uint32Array(r.length),I=new Uint32Array(r.length),E=new Float64Array(r.length),S=new Float64Array(r.length),_=[],R="organic-standard",A=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let j,G="organic-standard",V=0,q=0;const J=z.apply;switch(G="geographic-organic-standard"===e?R:e,G){case"organic-standard":j=Q.apply;break;case"organic-community":j=B.apply;break;case"hierarchical-bottom-to-top":j=U.apply;break;case"radial-root-centric":j=F.apply;break;case"tree-left-to-right":j=O.apply;break;default:j=P.apply}let X=!1;a.forEach((({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[M])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?y[V]=W.IsGeographic:y[V]=W.None;const n=t.lockedNodeLocations.get(i.attributes[M]);g[V]=n.x,b[V]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){y[V]=W.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":g[V]=t?.x,b[V]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(g[V]=e.x,b[V]=e.y):y[V]=W.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(g[V]=e.x,b[V]=e.y):y[V]=W.IsMovable;break;default:y[V]=W.IsMovable}(null==g[V]||null==b[V]||Number.isNaN(g[V])||Number.isNaN(b[V]))&&(y[V]=W.IsMovable,g[V]=0,b[V]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!X&&t?.lockedNodeLocations?.has(i.attributes[M])&&(X=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;v[V]=o?new Date(o).getTime():NaN;const r=e?.endField,s=r&&e?.endField?i.attributes[r]:null;D[V]=s?new Date(s).getTime():NaN,g[V]=0,b[V]=0,y[V]=W.IsMovable}else y[V]=W.IsMovable,g[V]=0,b[V]=0;u.set(i.attributes[M],V),_[V]={feature:i,typeName:a},V++})),X&&n.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let Y=!1;const Z=new Map;r.forEach((a=>{const i=a.feature.attributes[k],n=a.feature.attributes[C],o=u.get(i),r=u.get(n),s=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?s?.startField:null,d=h?a.feature.attributes[h]:null,p=s?.endField,c=p?a.feature.attributes[p]:null;if(void 0!==o&&void 0!==r){let t=i+"-"+n;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+c);const s=Z.get(t),h=s?.has(a.typeName);h||(x[q]=o,I[q]=r,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(E[q]=d?new Date(d).getTime():NaN,S[q]=c?new Date(c).getTime():NaN),void 0===s?Z.set(t,new Map([[a.typeName,q]])):s.set(a.typeName,q),q++),l.push(a)}else Y=!0,this.relationshipLinkChartDiagramLookup.set(i,null)})),Y&&n.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const ee=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),te=this._convertValidatedOrganicSettingsToCalculationSettings(ee);await $();let ae=H.Error,ie=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:ae,links:ie,graphics:a}=J((()=>t?.signal?.aborted??!1),y,g,b,v,D,x.subarray(0,q),I.subarray(0,q),E.subarray(0,q),S.subarray(0,q),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),ae===H.Success&&(this.chronologicalAuxiliaryGraphics=a)}else({status:ae,links:ie}=j((()=>t?.signal?.aborted??!1),y,g,b,x.subarray(0,q),I.subarray(0,q),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(s(t?.signal),ae===H.Error)throw new i("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(ae===H.Canceled)throw h();for(let i=0;i<_.length;i++){if(b[i]>84.9999?b[i]=84.9999:b[i]<-84.9999&&(b[i]=-84.9999),g[i]>179.9999?g[i]=179.9999:g[i]<-179.9999&&(g[i]=-179.9999),_[i].feature.attributes[T]=new f(g[i],b[i]),d.has(_[i].typeName)){const e=d.get(_[i].typeName);e?.set(_[i].feature.attributes[M],_[i].feature)}else{const e=new Map;e.set(_[i].feature.attributes[M],_[i].feature),d.set(_[i].typeName,e)}c.set(_[i].feature.attributes[M],_[i].feature);const e=w(_[i].feature.attributes[T]);this.entityLinkChartDiagramLookup.set(_[i].feature.attributes[M],_[i].feature.attributes[T]?e:null);const t=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,_[i].typeName,(()=>({useAllData:!1,members:new Map})));o(t.members,_[i].feature.attributes[M],(()=>({id:_[i].feature.attributes[M],linkChartLocation:void 0}))).linkChartLocation=_[i].feature.attributes[T],_[i].feature.attributes[T].x<A.xmin&&(A.xmin=_[i].feature.attributes[T].x),_[i].feature.attributes[T].x>A.xmax&&(A.xmax=_[i].feature.attributes[T].x),_[i].feature.attributes[T].y<A.ymin&&(A.ymin=_[i].feature.attributes[T].y),_[i].feature.attributes[T].y>A.ymax&&(A.ymax=_[i].feature.attributes[T].y)}if(this.linkChartExtent.xmin=A.xmin,this.linkChartExtent.xmax=A.xmax,this.linkChartExtent.ymin=A.ymin,this.linkChartExtent.ymax=A.ymax,!ie)throw new i("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ne=new Map,oe=new Map,re=new Map,se=new Set;for(let i=0;i<l.length;i++){const a=[],r=l[i],s=r.feature.attributes[k],h=r.feature.attributes[C];let d=s+"-"+h;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(r.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?r.feature.attributes[a]:null,n=e?.endField;d+="-"+i+"-"+(n?r.feature.attributes[n]:null)}const y=Z.get(d).get(r.typeName),g=0===y?0:ie?.vertexEndIndex[y-1];if(!se.has(y)){if(se.add(y),ie.types[y]===K.Recursive){const e=[ie.vertices[2*g],ie.vertices[2*g+1]],t=[ie.vertices[2*(g+1)],ie.vertices[2*(g+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],o=[i[0]+n[1],i[1]-n[0]],r=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(o),a.push(t),a.push(r),a.push(e)}else{if(ie.types[y]!==K.Regular){n.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<ie.vertexEndIndex[y];e++)a.push([ie.vertices[2*e],ie.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=_[u.get(s)]?.feature.attributes[T],t=_[u.get(h)]?.feature.attributes[T];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);ne.has(d)?ne.get(d).push(a):ne.set(d,[a])}const m=ne.get(d);oe.has(d)||(oe.set(d,new Map),re.set(d,new Map));const f=oe.get(d),b=re.get(d);f.has(r.typeName)||(f.set(r.typeName,m.shift()),b.set(r.typeName,0));const N=f.get(r.typeName);b.set(r.typeName,b.get(r.typeName)+1);const v=new L({paths:[N]});if(r.feature.attributes[T]=v,p.has(r.typeName)){const e=p.get(r.typeName);e?.set(r.feature.attributes[M],r.feature)}else{const e=new Map;e.set(r.feature.attributes[M],r.feature),p.set(r.typeName,e)}c.set(r.feature.attributes[M],r.feature);const D=w(r.feature.attributes[T]);this.relationshipLinkChartDiagramLookup.set(r.feature.attributes[M],r.feature.attributes[T]?D:null);const x=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,r.typeName,(()=>({useAllData:!1,members:new Map})));o(x.members,r.feature.attributes[M],(()=>({id:r.feature.attributes[M],linkChartLocation:void 0}))).linkChartLocation=D}for(const i of l)i.feature.attributes[N]=re.get(i.feature.attributes[k]+"-"+i.feature.attributes[C])?.get(i.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:d,links:p,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new f({x:i.x,y:i.y})))}));return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),s(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),s(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach((e=>{a.set(e.objectType.name,e.timeInfo)})),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=[];this.dataManager.addToLayer(e);for(const n of e)this.sublayerIdsCache.has(n.typeName)||(this.sublayerIdsCache.set(n.typeName,new Set),a.push(n.typeName)),this.sublayerIdsCache.get(n.typeName).add(n.id);for(const n of a){const e=this._graphTypeLookup.get(n);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(n):this.dataManager.relationshipTypeNames.add(n),t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.set(n,new Map)}}await I(this,a,t),await this.dataManager.refreshCacheContent(e.map((e=>e.id)),void 0,void 0,void 0,t);const i={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[n,o]of this.entityLinkChartDiagramLookup.entries())o&&i.lockedNodeLocations.set(n,new f(o.coords[0],o.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,i)}_createSublayers(e,t,a){e.forEach((e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)}))}_updateSublayers(e,t){t.forEach((t=>{t.parentCompositeLayer=this;const a=e.find((e=>e.type===t.graphType&&e.name===t.graphTypeName));a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))}))}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=y.PORTAL_ITEM&&e<y.USER}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e?.members?.forEach((e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=w(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[k]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[C]);if(t&&a){const i=w(new L({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[M],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[M],null)}))}))):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig||{}}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=1,o=e=>a(e)&&e>=1,r=e=>Object.values(v).includes(e),s=e=>a(e)&&e>=0,l={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return l;const{computationBudgetTime:h,autoRepulsionRadius:d,repulsionRadiusMultiplier:p,absoluteIdealEdgeLength:c,multiplicativeIdealEdgeLength:u,idealEdgeLengthType:y}=t;return o(h)?l.computationBudgetTime=h:h&&n.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),l.autoRepulsionRadius=d,!d&&i(p)?l.repulsionRadiusMultiplier=p:d||(l.autoRepulsionRadius=!0,n.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&(r(y)?l.idealEdgeLengthType=y:void 0!==y&&n.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===y&&s(c)?l.absoluteIdealEdgeLength=c:"absolute-value"===y&&void 0!==c?n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===y&&s(u)?l.multiplicativeIdealEdgeLength=u:"multiplier"===y&&void 0!==u&&n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),l}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===v.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===v.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new x({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map((e=>e.name)).concat((e.relationshipTypes??[]).map((e=>e.name)))),i=new Set((e.entityTypes??[]).map((e=>e.name))),o=new Set((e.relationshipTypes??[]).map((e=>e.name)));if(this.layers){for(const a of this.layers)!a.graphType&&t.has(a.graphTypeName)&&(a.graphType=i.has(a.graphTypeName)?"entity":"relationship");const e=this.layers.filter((e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):o.has(e.graphTypeName))));this.setAtOrigin("layers",e,g(this.originIdOf("layers")))}else this.layers=new a;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map((e=>e.graphTypeName))??[],a=this.layers.map((e=>e.graphTypeName)).concat(t);for(const n of a)e.has(n)||this._originalInclusionList.namedTypeDefinitions.set(n,{useAllData:!1,members:new Map});const i=[];for(const o of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(o)||(n.getLogger(this).warn(`A named type, ${o}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(o));for(const n of i)this._originalInclusionList.namedTypeDefinitions.delete(n)}}};e([c(G)],q.prototype,"url",void 0),e([c()],q.prototype,"dataPreloadedInLocalCache",void 0),e([c()],q.prototype,"initializationLinkChartConfig",void 0),e([c()],q.prototype,"membershipModified",void 0),e([c()],q.prototype,"dataManager",void 0),e([c()],q.prototype,"initializationInclusionModeDefinition",null),e([c()],q.prototype,"knowledgeGraph",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],q.prototype,"layers",void 0),e([c({readOnly:!0})],q.prototype,"linkChart",null),e([c()],q.prototype,"entityLinkChartDiagramLookup",void 0),e([c()],q.prototype,"relationshipLinkChartDiagramLookup",void 0),e([c()],q.prototype,"linkChartExtent",void 0),e([c()],q.prototype,"memberEntityTypes",void 0),e([c()],q.prototype,"memberRelationshipTypes",void 0),e([c({type:["LinkChartLayer"]})],q.prototype,"operationalLayerType",void 0),e([c()],q.prototype,"sublayerIdsCache",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],q.prototype,"tables",void 0),e([c({json:{read:!1}})],q.prototype,"type",void 0),e([c({json:{read:!1}})],q.prototype,"chronologicalAuxiliaryGraphics",void 0),q=e([u("esri.layers.LinkChartLayer")],q);const J=q;export{J as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as i}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projection.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as S,systemAggregationCountFieldName as v,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as D,displayFilterEnabledProperty as P,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as H,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as oe,fixTimeInfoFields as ie}from"../support/fieldUtils.js";import ne from"../support/LabelClass.js";import{reader as se}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:o,...i}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...i,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let o={enabled:r};return r&&(o={...o,...Te.call(this,e,t)}),o}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(D(A(G(M(Z(W(K(V(i(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=S,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:v,type:"esriFieldTypeInteger",alias:v,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){oe(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const o=le(I(g.toJSON(this.geometryType)).renderer);return he(o.symbol,r),o}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),i=ue.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:i}=await this._setupQueryObjects(r),n=await i.executeQueryForExtent(o.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new l(n.extent):new l,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return await o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[S]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>ie(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),o=r.geometry;if(o&&!o.spatialReference?.isWGS84&&(await d(o.spatialReference,f),r.geometry=h(o instanceof u||o instanceof m||o instanceof y?o:o.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const i=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(i)}}};e([n(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([n()],Ie.prototype,"capabilities",void 0),e([n({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([n({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([n()],Ie.prototype,"displayField",void 0),e([n(fe(r(P)))],Ie.prototype,"displayFilterEnabled",void 0),e([n(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([n(fe(r(J)))],Ie.prototype,"effect",void 0),e([n()],Ie.prototype,"elevationInfo",void 0),e([n(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([n(fe(r(te)))],Ie.prototype,"featureReduction",null),e([n()],Ie.prototype,"fields",null),e([n()],Ie.prototype,"geometryType",null),e([n()],Ie.prototype,"geometryFieldName",null),e([n({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([n({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([n()],Ie.prototype,"hasM",null),e([n()],Ie.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([n({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([n({type:[ne],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:ve,write:be()}})],Ie.prototype,"labelingInfo",null),e([n({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([n(fe(r(z)))],Ie.prototype,"legendEnabled",void 0),e([n(fe(r(H)))],Ie.prototype,"maxScale",void 0),e([n(fe(r(X)))],Ie.prototype,"minScale",void 0),e([n()],Ie.prototype,"objectIdField",void 0),e([n()],Ie.prototype,"objectType",void 0),e([n(fe(r($)))],Ie.prototype,"opacity",void 0),e([n(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([n({clonable:!1})],Ie.prototype,"parent",void 0),e([n()],Ie.prototype,"parentCompositeLayer",void 0),e([n(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([n({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([n({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([n()],Ie.prototype,"source",void 0),e([n()],Ie.prototype,"spatialReference",null),e([n({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([n({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([n({json:{read:!1}})],Ie.prototype,"type",void 0),e([n(fe(r(Y)))],Ie.prototype,"useViewTime",void 0),e([n({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([s("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);const Se=Ie;function ve(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",v],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){o.getLogger(this).warn("Error updating labelingInfo",n)}return se(e,t,r)}export{Se as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as i}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projection.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as S,systemAggregationCountFieldName as v,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as D,displayFilterEnabledProperty as P,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as H,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as oe,fixTimeInfoFields as ie}from"../support/fieldUtils.js";import ne from"../support/LabelClass.js";import{reader as se}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:o,...i}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...i,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let o={enabled:r};return r&&(o={...o,...Te.call(this,e,t)}),o}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(D(A(G(M(Z(W(K(V(i(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=S,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:v,type:"esriFieldTypeInteger",alias:v,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){oe(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const o=le(I(g.toJSON(this.geometryType)).renderer);return he(o.symbol,r),o}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),i=ue.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:i}=await this._setupQueryObjects(r),n=await i.executeQueryForExtent(o.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new l(n.extent):new l,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return await o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[S]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>ie(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),o=r.geometry;if(o&&!o.spatialReference?.isWGS84&&(await d(o.spatialReference,f),r.geometry=h(o instanceof u||o instanceof m||o instanceof y?o:o.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const i=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(i)}}};e([n(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([n()],Ie.prototype,"capabilities",void 0),e([n({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([n({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([n()],Ie.prototype,"displayField",void 0),e([n(fe(r(P)))],Ie.prototype,"displayFilterEnabled",void 0),e([n(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([n(fe(r(J)))],Ie.prototype,"effect",void 0),e([n()],Ie.prototype,"elevationInfo",void 0),e([n(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([n(fe(r(te)))],Ie.prototype,"featureReduction",null),e([n()],Ie.prototype,"fields",null),e([n()],Ie.prototype,"geometryType",null),e([n()],Ie.prototype,"geometryFieldName",null),e([n({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([n({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([n()],Ie.prototype,"hasM",null),e([n()],Ie.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([n({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([n({type:[ne],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:ve,write:be()}})],Ie.prototype,"labelingInfo",null),e([n({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([n(fe(r(z)))],Ie.prototype,"legendEnabled",void 0),e([n(fe(r(H)))],Ie.prototype,"maxScale",void 0),e([n(fe(r(X)))],Ie.prototype,"minScale",void 0),e([n()],Ie.prototype,"objectIdField",void 0),e([n()],Ie.prototype,"objectType",void 0),e([n(fe(r($)))],Ie.prototype,"opacity",void 0),e([n(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([n({clonable:!1})],Ie.prototype,"parent",void 0),e([n()],Ie.prototype,"parentCompositeLayer",void 0),e([n(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([n({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([n({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([n()],Ie.prototype,"source",void 0),e([n()],Ie.prototype,"spatialReference",null),e([n({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([n({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([n({json:{read:!1}})],Ie.prototype,"type",void 0),e([n(fe(r(Y)))],Ie.prototype,"useViewTime",void 0),e([n({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([s("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);const Se=Ie;function ve(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",v],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){o.getLogger(this).warn("Error updating labelingInfo",n)}return se(e,t,r)}export{Se as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import s from"../../core/CollectionFlattener.js";import t from"../../core/Error.js";import o from"../../core/Logger.js";import{watch as a,sync as l}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{getProperties as n}from"../../core/accessorSupport/utils.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{OriginId as y,nameToId as c,idToName as b}from"../../core/accessorSupport/PropertyOrigin.js";import d from"../support/Sublayer.js";import{isSublayerOverhaul as p}from"../support/sublayerUtils.js";function h(e,r){const s=[],t={};return e?(e.forEach((e=>{const o=new d;if(o.read(e,r),t[o.id]=o,null!=e.parentLayerId&&-1!==e.parentLayerId){const r=t[e.parentLayerId];r.sublayers||(r.sublayers=[]),r.sublayers.unshift(o)}else s.unshift(o)})),s):s}const f=r.ofType(d);function S(e,r){e&&e.forEach((e=>{r(e),e.sublayers&&e.sublayers.length&&S(e.sublayers,r)}))}const m=m=>{let E=class extends m{constructor(...e){super(...e),this.allSublayers=new s({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.subtables=null,this.addHandles([a((()=>this.sublayers),((e,r)=>this._handleSublayersChange(e,r)),l),a((()=>this.subtables),((e,r)=>this._handleSublayersChange(e,r)),l)])}destroy(){this.allSublayers.destroy()}readSublayers(e,r){if(!r||!e)return;const{sublayersSourceJSON:s}=this,t=c(r.origin);if(t<y.SERVICE)return;if(s[t]={context:r,visibleLayers:e.visibleLayers||s[t].visibleLayers,layers:e.layers||s[t].layers},t>y.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:o,origin:a}=this.createSublayersForOrigin("web-document"),l=n(this);l.setDefaultOrigin(a),this._set("sublayers",new f(o)),l.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((r=>r.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const r=c("web-document"===e?"web-map":e);let s=y.SERVICE,t=this.sublayersSourceJSON[y.SERVICE].layers,o=this.sublayersSourceJSON[y.SERVICE].context,a=null;const l=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter((e=>e<=r));for(const y of l){const e=this.sublayersSourceJSON[y];p(e.layers)&&(s=y,t=e.layers,o=e.context,e.visibleLayers&&(a={visibleLayers:e.visibleLayers,context:e.context}))}const i=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter((e=>e>s&&e<=r));let n=null;for(const y of i){const{layers:e,visibleLayers:r,context:s}=this.sublayersSourceJSON[y];e&&(n={layers:e,context:s}),r&&(a={visibleLayers:r,context:s})}const u=h(t,o),d=new Map,m=new Set;if(n)for(const y of n.layers)d.set(y.id,y);if(a?.visibleLayers)for(const y of a.visibleLayers)m.add(y);return S(u,(e=>{n&&e.read(d.get(e.id),n.context),a&&e.read({defaultVisibility:m.has(e.id)},a.context)})),{origin:b(s),sublayers:new f({items:u})}}read(e,r){super.read(e,r),this.readSublayers(e,r)}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.addHandles(e.on("before-changes",(e=>{o.getLogger("esri.layers.TileLayer").error(new t("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return e([i({readOnly:!0})],E.prototype,"allSublayers",void 0),e([i({readOnly:!0,type:r.ofType(d)})],E.prototype,"serviceSublayers",void 0),e([i({value:null,type:f,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],E.prototype,"sublayers",void 0),e([i({readOnly:!0})],E.prototype,"sublayersSourceJSON",void 0),e([i({type:f,json:{read:{source:"tables"}}})],E.prototype,"subtables",void 0),E=e([u("esri.layers.mixins.SublayersOwner")],E),E};export{m as SublayersOwner,S as forEachSublayer};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import s from"../../core/CollectionFlattener.js";import t from"../../core/Error.js";import o from"../../core/Logger.js";import{watch as a,sync as l}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{getProperties as n}from"../../core/accessorSupport/utils.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{OriginId as y,nameToId as c,idToName as b}from"../../core/accessorSupport/PropertyOrigin.js";import d from"../support/Sublayer.js";import{isSublayerOverhaul as p}from"../support/sublayerUtils.js";function h(e,r){const s=[],t={};return e?(e.forEach((e=>{const o=new d;if(o.read(e,r),t[o.id]=o,null!=e.parentLayerId&&-1!==e.parentLayerId){const r=t[e.parentLayerId];r.sublayers||(r.sublayers=[]),r.sublayers.unshift(o)}else s.unshift(o)})),s):s}const f=r.ofType(d);function S(e,r){e&&e.forEach((e=>{r(e),e.sublayers&&e.sublayers.length&&S(e.sublayers,r)}))}const m=m=>{let E=class extends m{constructor(...e){super(...e),this.allSublayers=new s({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{},[y.LINK_CHART]:{}},this.subtables=null,this.addHandles([a((()=>this.sublayers),((e,r)=>this._handleSublayersChange(e,r)),l),a((()=>this.subtables),((e,r)=>this._handleSublayersChange(e,r)),l)])}destroy(){this.allSublayers.destroy()}readSublayers(e,r){if(!r||!e)return;const{sublayersSourceJSON:s}=this,t=c(r.origin);if(t<y.SERVICE)return;if(s[t]={context:r,visibleLayers:e.visibleLayers||s[t].visibleLayers,layers:e.layers||s[t].layers},t>y.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:o,origin:a}=this.createSublayersForOrigin("web-document"),l=n(this);l.setDefaultOrigin(a),this._set("sublayers",new f(o)),l.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((r=>r.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const r=c("web-document"===e?"web-map":e);let s=y.SERVICE,t=this.sublayersSourceJSON[y.SERVICE].layers,o=this.sublayersSourceJSON[y.SERVICE].context,a=null;const l=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter((e=>e<=r));for(const y of l){const e=this.sublayersSourceJSON[y];p(e.layers)&&(s=y,t=e.layers,o=e.context,e.visibleLayers&&(a={visibleLayers:e.visibleLayers,context:e.context}))}const i=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter((e=>e>s&&e<=r));let n=null;for(const y of i){const{layers:e,visibleLayers:r,context:s}=this.sublayersSourceJSON[y];e&&(n={layers:e,context:s}),r&&(a={visibleLayers:r,context:s})}const u=h(t,o),d=new Map,m=new Set;if(n)for(const y of n.layers)d.set(y.id,y);if(a?.visibleLayers)for(const y of a.visibleLayers)m.add(y);return S(u,(e=>{n&&e.read(d.get(e.id),n.context),a&&e.read({defaultVisibility:m.has(e.id)},a.context)})),{origin:b(s),sublayers:new f({items:u})}}read(e,r){super.read(e,r),this.readSublayers(e,r)}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.addHandles(e.on("before-changes",(e=>{o.getLogger("esri.layers.TileLayer").error(new t("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return e([i({readOnly:!0})],E.prototype,"allSublayers",void 0),e([i({readOnly:!0,type:r.ofType(d)})],E.prototype,"serviceSublayers",void 0),e([i({value:null,type:f,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],E.prototype,"sublayers",void 0),e([i({readOnly:!0})],E.prototype,"sublayersSourceJSON",void 0),e([i({type:f,json:{read:{source:"tables"}}})],E.prototype,"subtables",void 0),E=e([u("esri.layers.mixins.SublayersOwner")],E),E};export{m as SublayersOwner,S as forEachSublayer};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.32.2",
3
+ "version": "4.32.3",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK 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.32/esri/copyright.txt for details.
4
4
  */
5
- const e="20250227",d="00dc618934e2859bff49d30ee5da51b8edf97155";export{e as buildDate,d as commitHash};
5
+ const c="20250228",f="72429da6105b72777f4e3010ac9c4ffc079b9dc9";export{c as buildDate,f 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.32/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../Color.js";import{getColorLuminance as e}from"../../core/colorUtils.js";import i from"../../core/Error.js";import{loadFont as o}from"../../core/fontUtils.js";import{pt2px as n}from"../../core/screenUtils.js";import{quantizePolygon as a,quantizePolyline as l}from"../../geometry/support/quantizationUtils.js";import{getFill as s,getStroke as r,getDashArray as h,getPatternUrlWithColor as c}from"./gfxUtils.js";import{SymbolSizeDefaults as m,shapes as u,adjustColorBrightness as p}from"./previewUtils.js";import{renderSymbol as d}from"./renderUtils.js";import{backgroundPadding as g}from"./textUtils.js";const f="picture-fill",y="picture-marker",w="simple-fill",x="simple-line",b="simple-marker",v="text",M="Aa",S=m.size,z=m.maxSize,k=m.maxOutlineSize,L=m.lineWidth,C=225,$=document.createElement("canvas");function j(t,e,i){if("polygon"===t.type){const o=t.extent,n=0===o.width?1:o.width,l=0===o.height?1:o.height;t=a({originPosition:"upperLeft",scale:[n/e,l/i],translate:[o.xmin,o.ymax]},{},t);let s="";for(let e=0;e<t.rings.length;e++){const i=t.rings[e];for(let t=0;t<i.length;t++){const e=i[t][0],o=i[t][1];let n="";0===t?(n=`M${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n):t===i.length-1?(n=`l${e.toString()} ${o.toString()} Z`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}if("polyline"===t.type){const o=t.extent,n=0===o.width?1:o.width,a=0===o.height?1:o.height;t=l({originPosition:"lowerLeft",scale:[n/e,a/i],translate:[o.xmin,o.ymax]},{},t);let s="";for(let e=0;e<t.paths.length;e++){const i=t.paths[e];for(let t=0;t<i.length;t++){const e=i[t][0],o=i[t][1];let n="";0===t?(n=`M${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}return""}function B(t,e){const i=$.getContext("2d"),o=[];e&&(e.weight&&o.push(e.weight),e.size&&o.push(e.size+"px"),e.family&&o.push(e.family)),i.font=o.join(" ");const{width:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:l,actualBoundingBoxAscent:s,actualBoundingBoxDescent:r}=i.measureText(t);return{width:Math.ceil(Math.max(n,a+l)),height:Math.ceil(s+r),x:Math.floor(a),y:Math.floor((s-r)/2)}}function P(t){const e=t?.size;return{width:null!=e&&"object"==typeof e&&"width"in e?n(e.width):null,height:null!=e&&"object"==typeof e&&"height"in e?n(e.height):null}}async function U(t,e){const i=e.fill,o=t.color;if("pattern"===i?.type&&o&&t.type!==f){const t=await c(i.src,o.toCss(!0));i.src=t,e.fill=i}}async function A(t,e,i,n){if(!("font"in t)||!t.font||"text"!==e.shape.type)return;try{await o(t.font)}catch{}const{width:a,height:l}=P(n);if(!/[\uE600-\uE6FF]/.test(e.shape.text)){const{width:o,height:s,x:r,y:h}=B(e.shape.text,{weight:e.font?.weight,size:e.font?.size,family:e.font?.family});i[0]=a??o,i[1]=l??s,e.shape.x=r,e.shape.y=h;let c="angle"in t?t.angle:null;if(null!=n?.rotation&&(c=(c??0)+n.rotation),c){const t=c*(Math.PI/180),e=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t));i[1]=i[0]*e+i[1]*o}}}function E(t,e,i,o,a){if(null!=t.haloColor&&null!=t.haloSize){a.masking??=i.map((()=>[]));const l=n(t.haloSize);o[0]+=l,o[1]+=l,i.unshift([{...e,fill:null,stroke:{color:t.haloColor,width:2*l,join:"round",cap:"round"}}]),a.masking.unshift([{shape:{type:"rect",x:0,y:0,width:o[0]+2*g,height:o[1]+2*g},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}null==t.backgroundColor&&null==t.borderLineColor||(o[0]+=2*g,o[1]+=2*g,i.unshift([{shape:{type:"rect",x:0,y:0,width:o[0],height:o[1]},fill:t.backgroundColor,stroke:{color:t.borderLineColor,width:n(t.borderLineSize)}}]),a.masking?.unshift([]))}function F(t,e){return t>e?"dark":"light"}function Z(t,e){const i="number"==typeof e?.size?e?.size:null,o=null!=i?n(i):null,a=null!=e?.maxSize?n(e.maxSize):null;let l="angle"in t?t.angle:null;null!=e?.rotation&&(l=(l??0)+e.rotation);const c=s(t);let m=r(t);"dark"!==q(t,245)||e?.ignoreWhiteSymbols||(m={width:.75,...m,color:"#bdc3c7"});let p=null;const d={shape:null,fill:c,stroke:m,offset:[0,0]};m?.width&&(m.width=Math.min(m.width,k));const g=m?.width||0;let C=null!=e?.size&&(null==e?.scale||e?.scale),$=0,U=0,A=!1;switch(t.type){case b:{const i=t.style,{width:s,height:r}=P(e);let h=s===r&&null!=s?s:null!=o?o:Math.min(n(t.size),a||z);if(!0===e?.useMarkerSymbolSize&&null!==s&&null!==r){const e=Math.min(n(t.size),a||z);h=e>s&&e>r?Math.min(s,r):e}switch($=h,U=h,i){case"circle":d.shape={type:"circle",cx:0,cy:0,r:.5*h},C||($+=g,U+=g);break;case"cross":d.shape={type:"path",path:[{command:"M",values:[0,.5*U]},{command:"L",values:[$,.5*U]},{command:"M",values:[.5*$,0]},{command:"L",values:[.5*$,U]}]};break;case"diamond":d.shape={type:"path",path:[{command:"M",values:[0,.5*U]},{command:"L",values:[.5*$,0]},{command:"L",values:[$,.5*U]},{command:"L",values:[.5*$,U]},{command:"Z",values:[]}]},C||($+=g,U+=g);break;case"square":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"Z",values:[]}]},C||($+=g,U+=g),l&&(A=!0);break;case"triangle":d.shape={type:"path",path:[{command:"M",values:[.5*$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"Z",values:[]}]},C||($+=g,U+=g),l&&(A=!0);break;case"x":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,U]},{command:"M",values:[$,0]},{command:"L",values:[0,U]}]},l&&(A=!0);break;case"path":d.shape={type:"path",path:t.path||""},C||($+=g,U+=g),l&&(A=!0),C=!0}break}case x:{const{width:t,height:i}=P(e),n=h(m).reduce(((t,e)=>t+e),0),a=n&&Math.ceil(L/n),l=i??o??g,s=t??(n*a||L);if(C=!0,"polyline"===e?.geometry?.type&&e?.geometry?.extent){$=s,U=i??$;const t=1e3,o=.15*t;p=[$,U],U=p[0]>p[1]?t*p[1]/p[0]:t,$=p[0]>p[1]?t:t*p[0]/p[1],m?.width&&(m.width=m.width*t/(p[1]>p[0]?p[1]:p[0]),m.width>o&&(m.width=o)),d.shape={type:"path",path:j(e.geometry,$,U)}}else $=null!=e?.maxSize?Math.min(s,e.maxSize):s,U=l,m&&(m.width=l),d.shape={type:"path",path:[{command:"M",values:[l/2,U/2]},{command:"L",values:[$-l/2,U/2]}]};break}case f:case w:{const t="object"==typeof e?.symbolConfig&&!!e?.symbolConfig?.isSquareFill,{width:i,height:n}=P(e);$=!t&&i!==n||null==i?null!=o?o:S:i,U=!t&&i!==n||null==n?$:n,C||($+=g,U+=g),C=!0,e?.geometry?.extent&&"polygon"===e?.geometry?.type?(p=[$,U],U=p[0]>p[1]?1e3*p[1]/p[0]:1e3,$=p[0]>p[1]?1e3:1e3*p[0]/p[1],d.shape={type:"path",path:j(e.geometry,$,U)}):d.shape=t?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:u.fill[0];break}case y:{const i=Math.min(n(t.width),a||z),s=Math.min(n(t.height),a||z),{width:r,height:h}=P(e),c=r===h&&null!=r?r:null!=o?o:Math.max(i,s),m=t.width/t.height;$=m<=1?Math.ceil(c*m):c,U=m<=1?c:Math.ceil(c/m),d.shape={type:"image",x:-Math.round($/2),y:-Math.round(U/2),width:$,height:U,src:t.url||""},l&&(A=!0);break}case v:{const i=t,l=e?.overrideText||i.text||M,s=i.font,{width:r,height:h}=P(e),c=null!=h?h:null!=o?o:Math.min(n(s.size),a||z),{width:m,height:u}=B(l,{weight:s.weight,size:c,family:s.family}),p=/[\uE600-\uE6FF]/.test(l);$=r??(p?c:m),U=p?c:u;let g=.5*(p?c:u);p&&(g+=5),d.shape={type:"text",text:l,x:i.xoffset||0,y:i.yoffset||g,align:"middle",alignBaseline:i.verticalAlignment,decoration:s&&s.decoration,rotated:i.rotated,kerning:i.kerning},d.font=s&&{size:c,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:d,size:[$,U],outputSize:p,renderOptions:{node:e?.node,scale:C,opacity:e?.opacity,rotations:[l],useRotationSize:A,effectView:e?.effectView,ariaLabel:e?.ariaLabel}}}async function D(t,e){const{shapeDescriptor:o,size:n,renderOptions:a,outputSize:l}=Z(t,e);if(!o.shape)throw new i("symbolPreview: renderPreviewHTML2D","symbol not supported.");await U(t,o),await A(t,o,n,e);const s=[[o]];if("object"==typeof e?.symbolConfig&&e?.symbolConfig?.applyColorModulation){const t=.6*n[0];s.unshift([{...o,offset:[-t,0],fill:p(o.fill,-.3)}]),s.push([{...o,offset:[t,0],fill:p(o.fill,.3)}]),n[0]+=2*t,a.scale=!1}"text"===t.type&&E(t,o,s,n,a);const r=d(s,n,a);if(l&&r){const t="img"===r.nodeName.toLowerCase()?r:r.firstChild;"svg"===t.nodeName.toLowerCase()&&t.setAttribute("viewBox",`0 0 ${n[0].toString()} ${n[1].toString()}`),t.setAttribute("width",l[0].toString()),t.setAttribute("height",l[1].toString()),l.length>2&&(t.style.setProperty("padding-left",l[2]?.toString()+"px"),t.style.setProperty("padding-right",l[2]?.toString()+"px"),t.style.setProperty("padding-top",l[3]?.toString()+"px"),t.style.setProperty("padding-bottom",l[3]?.toString()+"px"),t.style.setProperty("box-sizing","border-box"))}return r}function q(i,o=C){const n=s(i),a=r(i),l=!n||"type"in n?null:new t(n),h=a?.color?new t(a?.color):null,c=l?F(e(l),o):null,m=h?F(e(h),o):null;return m?c?c===m?c:o>=C?"light":"dark":m:c}export{q as getContrastingBackgroundTheme,Z as getRenderSymbolParameters,D as previewSymbol2D};
5
+ import t from"../../Color.js";import{getColorLuminance as e}from"../../core/colorUtils.js";import i from"../../core/Error.js";import{loadFont as o}from"../../core/fontUtils.js";import{pt2px as n}from"../../core/screenUtils.js";import{quantizePolygon as a,quantizePolyline as l}from"../../geometry/support/quantizationUtils.js";import{getFill as s,getStroke as r,getDashArray as h,getPatternUrlWithColor as c}from"./gfxUtils.js";import{SymbolSizeDefaults as m,shapes as u,adjustColorBrightness as p}from"./previewUtils.js";import{renderSymbol as d}from"./renderUtils.js";import{backgroundPadding as g}from"./textUtils.js";const f="picture-fill",y="picture-marker",w="simple-fill",x="simple-line",b="simple-marker",v="text",M="Aa",S=m.size,z=m.maxSize,k=m.maxOutlineSize,L=m.lineWidth,C=225,$=document.createElement("canvas");function j(t,e,i){if("polygon"===t.type){const o=t.extent,n=0===o.width?1:o.width,l=0===o.height?1:o.height;t=a({originPosition:"upperLeft",scale:[n/e,l/i],translate:[o.xmin,o.ymax]},{},t);let s="";for(let e=0;e<t.rings.length;e++){const i=t.rings[e];for(let t=0;t<i.length;t++){const e=i[t][0],o=i[t][1];let n="";0===t?(n=`M${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n):t===i.length-1?(n=`l${e.toString()} ${o.toString()} Z`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}if("polyline"===t.type){const o=t.extent,n=0===o.width?1:o.width,a=0===o.height?1:o.height;t=l({originPosition:"upperLeft",scale:[n/e,a/i],translate:[o.xmin,o.ymax]},{},t);let s="";for(let e=0;e<t.paths.length;e++){const i=t.paths[e];for(let t=0;t<i.length;t++){const e=i[t][0],o=i[t][1];let n="";0===t?(n=`M${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}return""}function B(t,e){const i=$.getContext("2d"),o=[];e&&(e.weight&&o.push(e.weight),e.size&&o.push(e.size+"px"),e.family&&o.push(e.family)),i.font=o.join(" ");const{width:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:l,actualBoundingBoxAscent:s,actualBoundingBoxDescent:r}=i.measureText(t);return{width:Math.ceil(Math.max(n,a+l)),height:Math.ceil(s+r),x:Math.floor(a),y:Math.floor((s-r)/2)}}function P(t){const e=t?.size;return{width:null!=e&&"object"==typeof e&&"width"in e?n(e.width):null,height:null!=e&&"object"==typeof e&&"height"in e?n(e.height):null}}async function U(t,e){const i=e.fill,o=t.color;if("pattern"===i?.type&&o&&t.type!==f){const t=await c(i.src,o.toCss(!0));i.src=t,e.fill=i}}async function A(t,e,i,n){if(!("font"in t)||!t.font||"text"!==e.shape.type)return;try{await o(t.font)}catch{}const{width:a,height:l}=P(n);if(!/[\uE600-\uE6FF]/.test(e.shape.text)){const{width:o,height:s,x:r,y:h}=B(e.shape.text,{weight:e.font?.weight,size:e.font?.size,family:e.font?.family});i[0]=a??o,i[1]=l??s,e.shape.x=r,e.shape.y=h;let c="angle"in t?t.angle:null;if(null!=n?.rotation&&(c=(c??0)+n.rotation),c){const t=c*(Math.PI/180),e=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t));i[1]=i[0]*e+i[1]*o}}}function E(t,e,i,o,a){if(null!=t.haloColor&&null!=t.haloSize){a.masking??=i.map((()=>[]));const l=n(t.haloSize);o[0]+=l,o[1]+=l,i.unshift([{...e,fill:null,stroke:{color:t.haloColor,width:2*l,join:"round",cap:"round"}}]),a.masking.unshift([{shape:{type:"rect",x:0,y:0,width:o[0]+2*g,height:o[1]+2*g},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}null==t.backgroundColor&&null==t.borderLineColor||(o[0]+=2*g,o[1]+=2*g,i.unshift([{shape:{type:"rect",x:0,y:0,width:o[0],height:o[1]},fill:t.backgroundColor,stroke:{color:t.borderLineColor,width:n(t.borderLineSize)}}]),a.masking?.unshift([]))}function F(t,e){return t>e?"dark":"light"}function Z(t,e){const i="number"==typeof e?.size?e?.size:null,o=null!=i?n(i):null,a=null!=e?.maxSize?n(e.maxSize):null;let l="angle"in t?t.angle:null;null!=e?.rotation&&(l=(l??0)+e.rotation);const c=s(t);let m=r(t);"dark"!==q(t,245)||e?.ignoreWhiteSymbols||(m={width:.75,...m,color:"#bdc3c7"});let p=null;const d={shape:null,fill:c,stroke:m,offset:[0,0]};m?.width&&(m.width=Math.min(m.width,k));const g=m?.width||0;let C=null!=e?.size&&(null==e?.scale||e?.scale),$=0,U=0,A=!1;switch(t.type){case b:{const i=t.style,{width:s,height:r}=P(e);let h=s===r&&null!=s?s:null!=o?o:Math.min(n(t.size),a||z);if(!0===e?.useMarkerSymbolSize&&null!==s&&null!==r){const e=Math.min(n(t.size),a||z);h=e>s&&e>r?Math.min(s,r):e}switch($=h,U=h,i){case"circle":d.shape={type:"circle",cx:0,cy:0,r:.5*h},C||($+=g,U+=g);break;case"cross":d.shape={type:"path",path:[{command:"M",values:[0,.5*U]},{command:"L",values:[$,.5*U]},{command:"M",values:[.5*$,0]},{command:"L",values:[.5*$,U]}]};break;case"diamond":d.shape={type:"path",path:[{command:"M",values:[0,.5*U]},{command:"L",values:[.5*$,0]},{command:"L",values:[$,.5*U]},{command:"L",values:[.5*$,U]},{command:"Z",values:[]}]},C||($+=g,U+=g);break;case"square":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"Z",values:[]}]},C||($+=g,U+=g),l&&(A=!0);break;case"triangle":d.shape={type:"path",path:[{command:"M",values:[.5*$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"Z",values:[]}]},C||($+=g,U+=g),l&&(A=!0);break;case"x":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,U]},{command:"M",values:[$,0]},{command:"L",values:[0,U]}]},l&&(A=!0);break;case"path":d.shape={type:"path",path:t.path||""},C||($+=g,U+=g),l&&(A=!0),C=!0}break}case x:{const{width:t,height:i}=P(e),n=h(m).reduce(((t,e)=>t+e),0),a=n&&Math.ceil(L/n),l=i??o??g,s=t??(n*a||L);if(C=!0,"polyline"===e?.geometry?.type&&e?.geometry?.extent){$=s,U=i??$;const t=1e3,o=.15*t;p=[$,U],U=p[0]>p[1]?t*p[1]/p[0]:t,$=p[0]>p[1]?t:t*p[0]/p[1],m?.width&&(m.width=m.width*t/(p[1]>p[0]?p[1]:p[0]),m.width>o&&(m.width=o)),d.shape={type:"path",path:j(e.geometry,$,U)}}else $=null!=e?.maxSize?Math.min(s,e.maxSize):s,U=l,m&&(m.width=l),d.shape={type:"path",path:[{command:"M",values:[l/2,U/2]},{command:"L",values:[$-l/2,U/2]}]};break}case f:case w:{const t="object"==typeof e?.symbolConfig&&!!e?.symbolConfig?.isSquareFill,{width:i,height:n}=P(e);$=!t&&i!==n||null==i?null!=o?o:S:i,U=!t&&i!==n||null==n?$:n,C||($+=g,U+=g),C=!0,e?.geometry?.extent&&"polygon"===e?.geometry?.type?(p=[$,U],U=p[0]>p[1]?1e3*p[1]/p[0]:1e3,$=p[0]>p[1]?1e3:1e3*p[0]/p[1],d.shape={type:"path",path:j(e.geometry,$,U)}):d.shape=t?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:u.fill[0];break}case y:{const i=Math.min(n(t.width),a||z),s=Math.min(n(t.height),a||z),{width:r,height:h}=P(e),c=r===h&&null!=r?r:null!=o?o:Math.max(i,s),m=t.width/t.height;$=m<=1?Math.ceil(c*m):c,U=m<=1?c:Math.ceil(c/m),d.shape={type:"image",x:-Math.round($/2),y:-Math.round(U/2),width:$,height:U,src:t.url||""},l&&(A=!0);break}case v:{const i=t,l=e?.overrideText||i.text||M,s=i.font,{width:r,height:h}=P(e),c=null!=h?h:null!=o?o:Math.min(n(s.size),a||z),{width:m,height:u}=B(l,{weight:s.weight,size:c,family:s.family}),p=/[\uE600-\uE6FF]/.test(l);$=r??(p?c:m),U=p?c:u;let g=.5*(p?c:u);p&&(g+=5),d.shape={type:"text",text:l,x:i.xoffset||0,y:i.yoffset||g,align:"middle",alignBaseline:i.verticalAlignment,decoration:s&&s.decoration,rotated:i.rotated,kerning:i.kerning},d.font=s&&{size:c,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:d,size:[$,U],outputSize:p,renderOptions:{node:e?.node,scale:C,opacity:e?.opacity,rotations:[l],useRotationSize:A,effectView:e?.effectView,ariaLabel:e?.ariaLabel}}}async function D(t,e){const{shapeDescriptor:o,size:n,renderOptions:a,outputSize:l}=Z(t,e);if(!o.shape)throw new i("symbolPreview: renderPreviewHTML2D","symbol not supported.");await U(t,o),await A(t,o,n,e);const s=[[o]];if("object"==typeof e?.symbolConfig&&e?.symbolConfig?.applyColorModulation){const t=.6*n[0];s.unshift([{...o,offset:[-t,0],fill:p(o.fill,-.3)}]),s.push([{...o,offset:[t,0],fill:p(o.fill,.3)}]),n[0]+=2*t,a.scale=!1}"text"===t.type&&E(t,o,s,n,a);const r=d(s,n,a);if(l&&r){const t="img"===r.nodeName.toLowerCase()?r:r.firstChild;"svg"===t.nodeName.toLowerCase()&&t.setAttribute("viewBox",`0 0 ${n[0].toString()} ${n[1].toString()}`),t.setAttribute("width",l[0].toString()),t.setAttribute("height",l[1].toString()),l.length>2&&(t.style.setProperty("padding-left",l[2]?.toString()+"px"),t.style.setProperty("padding-right",l[2]?.toString()+"px"),t.style.setProperty("padding-top",l[3]?.toString()+"px"),t.style.setProperty("padding-bottom",l[3]?.toString()+"px"),t.style.setProperty("box-sizing","border-box"))}return r}function q(i,o=C){const n=s(i),a=r(i),l=!n||"type"in n?null:new t(n),h=a?.color?new t(a?.color):null,c=l?F(e(l),o):null,m=h?F(e(h),o):null;return m?c?c===m?c:o>=C?"light":"dark":m:c}export{q as getContrastingBackgroundTheme,Z as getRenderSymbolParameters,D as previewSymbol2D};