@arcgis/coding-components 4.31.0-next.2 → 4.31.0-next.21

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 (205) hide show
  1. package/README.md +22 -3
  2. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  3. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ar.json +1 -1
  4. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +1 -1
  5. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +1 -1
  6. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +6 -6
  7. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +1 -1
  8. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +1 -1
  9. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +1 -1
  10. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +1 -1
  11. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +1 -1
  12. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +1 -1
  13. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +1 -1
  14. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +1 -1
  15. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +1 -1
  16. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +1 -1
  17. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.id.json +1 -1
  18. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +1 -1
  19. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ko.json +1 -1
  20. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nb.json +1 -1
  21. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +1 -1
  22. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +1 -1
  23. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +1 -1
  24. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +1 -1
  25. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ru.json +1 -1
  26. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +1 -1
  27. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +1 -1
  28. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +1 -1
  29. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +1 -1
  30. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +1 -1
  31. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +1 -1
  32. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +5 -5
  33. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +1 -1
  34. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +1 -1
  35. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +1 -1
  36. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +1 -1
  37. package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.ca.json +2 -2
  38. package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.de.json +1 -1
  39. package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.he.json +1 -1
  40. package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.ca.json +1 -1
  41. package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.it.json +1 -1
  42. package/dist/arcgis-coding-components/assets/code-editor/css.worker.js +1 -1
  43. package/dist/arcgis-coding-components/assets/code-editor/html.worker.js +1 -1
  44. package/dist/arcgis-coding-components/assets/code-editor/json.worker.js +1 -1
  45. package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +33 -0
  46. package/dist/arcgis-coding-components/assets/code-editor/ts.worker.js +1 -1
  47. package/dist/arcgis-coding-components/assets/language-api-panel/t9n/language-api-panel.t9n.ca.json +1 -1
  48. package/dist/arcgis-coding-components/assets/sql-expression-editor/api/sql-expression-api.t9n.en.json +735 -0
  49. package/dist/arcgis-coding-components/index.esm.js +2 -2
  50. package/dist/arcgis-coding-components/{p-7984ea8e.js → p-1b799777.js} +2 -2
  51. package/dist/arcgis-coding-components/p-4d5cf512.entry.js +6 -0
  52. package/dist/arcgis-coding-components/{p-60c2a820.js → p-56266a64.js} +2 -2
  53. package/dist/arcgis-coding-components/{p-e8211ffe.js → p-57b8bcd7.js} +1 -1
  54. package/dist/arcgis-coding-components/{p-9eced6fc.js → p-5b67b62b.js} +2 -2
  55. package/dist/arcgis-coding-components/{p-93a97573.js → p-64137fec.js} +3 -3
  56. package/dist/arcgis-coding-components/{p-e7ee4d64.js → p-6621a80f.js} +3 -3
  57. package/dist/arcgis-coding-components/p-77dd5521.js +6 -0
  58. package/dist/arcgis-coding-components/p-8eb7e694.js +6 -0
  59. package/dist/arcgis-coding-components/p-a2341e0c.js +6 -0
  60. package/dist/arcgis-coding-components/{p-bb7e832e.js → p-b715834b.js} +3 -3
  61. package/dist/arcgis-coding-components/p-cbee273f.js +6 -0
  62. package/dist/arcgis-coding-components/{p-5ef7cce5.js → p-cdc52d2f.js} +1 -1
  63. package/dist/arcgis-coding-components/{p-36fedc23.js → p-d7d1f130.js} +12 -12
  64. package/dist/arcgis-coding-components/p-e1f9b463.entry.js +6 -0
  65. package/dist/arcgis-coding-components/{p-62ee6251.js → p-e5a924a1.js} +1 -1
  66. package/dist/arcgis-coding-components/p-f2d64a9d.js +6 -0
  67. package/dist/arcgis-coding-components/{p-03ea6cd7.js → p-ff62d134.js} +3 -3
  68. package/dist/arcgis-coding-components/p-ffce0588.entry.js +6 -0
  69. package/dist/cjs/{app-globals-aee5f4b5.js → app-globals-a9ef3ca8.js} +1 -1
  70. package/dist/cjs/arcade-defaults-f5241680.js +349 -0
  71. package/dist/cjs/arcade-language-features-0b9f3947.js +274 -0
  72. package/dist/cjs/arcade-mode-cc08d9cd.js +335 -0
  73. package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +181 -1501
  74. package/dist/cjs/arcgis-coding-components.cjs.js +4 -4
  75. package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +81 -0
  76. package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +80 -0
  77. package/dist/cjs/{css-7cc05f76.js → css-bb6a49ec.js} +1 -1
  78. package/dist/cjs/{cssMode-2b0daeae.js → cssMode-e7fac7d7.js} +3 -4
  79. package/dist/cjs/{html-f56911e1.js → html-7ff4071d.js} +3 -4
  80. package/dist/cjs/{htmlMode-43eed674.js → htmlMode-c89193ec.js} +3 -4
  81. package/dist/cjs/{index-b34238a6.js → index-4b7880ab.js} +9 -1
  82. package/dist/cjs/index.cjs.js +4 -3
  83. package/dist/cjs/{javascript-5115cb76.js → javascript-864c0220.js} +3 -4
  84. package/dist/cjs/{jsonMode-550dda36.js → jsonMode-ac4a7be7.js} +3 -4
  85. package/dist/cjs/{arcade-defaults-a8d8f8e2.js → language-defaults-base-57b37f9f.js} +842 -1183
  86. package/dist/cjs/loader.cjs.js +4 -4
  87. package/dist/cjs/sql-expr-defaults-245b036d.js +1347 -0
  88. package/dist/cjs/sql-expr-mode-304f5ce2.js +20844 -0
  89. package/dist/cjs/{tsMode-336306a9.js → tsMode-d30d4ab1.js} +4 -5
  90. package/dist/cjs/{typescript-b395242f.js → typescript-6c87ddb3.js} +3 -4
  91. package/dist/components/arcade-defaults.js +54 -1369
  92. package/dist/components/arcade-language-features.js +271 -0
  93. package/dist/components/arcade-mode.js +4 -264
  94. package/dist/components/arcade-results.js +7 -5
  95. package/dist/components/arcade-suggestions.js +7 -5
  96. package/dist/components/arcade-variables.js +8 -6
  97. package/dist/components/arcgis-arcade-editor.js +37 -35
  98. package/dist/components/arcgis-arcade-results.js +1 -1
  99. package/dist/components/arcgis-arcade-suggestions.js +1 -1
  100. package/dist/components/arcgis-arcade-variables.js +1 -1
  101. package/dist/components/arcgis-assets.d.ts +1 -1
  102. package/dist/components/arcgis-assets.js +1 -1
  103. package/dist/components/arcgis-code-editor.js +1 -1
  104. package/dist/components/arcgis-language-api-panel.js +1 -1
  105. package/dist/components/arcgis-sql-expression-editor.d.ts +11 -0
  106. package/dist/components/arcgis-sql-expression-editor.js +120 -0
  107. package/dist/components/arcgis-sql-expression-fields.d.ts +11 -0
  108. package/dist/components/arcgis-sql-expression-fields.js +11 -0
  109. package/dist/components/chunk-2JTWBRMN.js +1154 -0
  110. package/dist/components/code-editor.js +40 -13
  111. package/dist/components/fields.js +5 -5
  112. package/dist/components/index.js +1 -1
  113. package/dist/components/index2.js +30 -22
  114. package/dist/components/language-api-panel.js +13 -40
  115. package/dist/components/language-defaults-base.js +1309 -0
  116. package/dist/components/markdown.js +1 -1
  117. package/dist/components/sql-expr-defaults.js +196 -0
  118. package/dist/components/sql-expr-mode.js +20842 -0
  119. package/dist/components/sql-expression-fields.js +102 -0
  120. package/dist/components/useT9n.js +45 -8
  121. package/dist/components/utilities.js +1 -1
  122. package/dist/esm/{app-globals-59faaf33.js → app-globals-6d0ca11d.js} +1 -1
  123. package/dist/esm/arcade-defaults-066445c4.js +344 -0
  124. package/dist/esm/arcade-language-features-0e00c199.js +269 -0
  125. package/dist/esm/{arcade-mode-5d46035e.js → arcade-mode-abf1e1cf.js} +3 -263
  126. package/dist/esm/arcgis-arcade-editor_6.entry.js +127 -1447
  127. package/dist/esm/arcgis-coding-components.js +5 -5
  128. package/dist/esm/arcgis-sql-expression-editor.entry.js +77 -0
  129. package/dist/esm/arcgis-sql-expression-fields.entry.js +76 -0
  130. package/dist/esm/{css-e257dc49.js → css-c6dae12d.js} +1 -1
  131. package/dist/esm/{cssMode-c11f7f40.js → cssMode-052bb603.js} +2 -3
  132. package/dist/esm/{html-a6c37a99.js → html-572696a1.js} +2 -3
  133. package/dist/esm/{htmlMode-1270bc7d.js → htmlMode-fc184f2d.js} +2 -3
  134. package/dist/esm/{index-a970952c.js → index-0edd9846.js} +9 -1
  135. package/dist/esm/index.js +4 -3
  136. package/dist/esm/{javascript-ee179624.js → javascript-8bfc0096.js} +3 -4
  137. package/dist/esm/{jsonMode-07502ccb.js → jsonMode-7adf94ff.js} +2 -3
  138. package/dist/esm/{arcade-defaults-9eb28407.js → language-defaults-base-85a7f476.js} +833 -1179
  139. package/dist/esm/loader.js +5 -5
  140. package/dist/esm/sql-expr-defaults-be84ec7f.js +1339 -0
  141. package/dist/esm/sql-expr-mode-a4413e5c.js +20840 -0
  142. package/dist/esm/{tsMode-96749a12.js → tsMode-d10773c8.js} +2 -3
  143. package/dist/esm/{typescript-a3cf9881.js → typescript-9491f23e.js} +2 -3
  144. package/dist/loader/cdn.js +1 -1
  145. package/dist/loader/index.cjs.js +1 -1
  146. package/dist/loader/index.es2017.js +1 -1
  147. package/dist/loader/index.js +1 -1
  148. package/dist/types/components/arcade-editor/arcade-editor.d.ts +45 -10
  149. package/dist/types/components/arcade-results/arcade-results.d.ts +43 -1
  150. package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +22 -1
  151. package/dist/types/components/arcade-variables/arcade-variables.d.ts +28 -1
  152. package/dist/types/components/code-editor/code-editor.d.ts +16 -5
  153. package/dist/types/components/language-api-panel/language-api-panel.d.ts +34 -8
  154. package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +24 -0
  155. package/dist/types/components/sql-expression-fields/sql-expression-fields.d.ts +32 -0
  156. package/dist/types/components.d.ts +98 -24
  157. package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +8 -1
  158. package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +5 -1
  159. package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/sql-expression-editor/sql-expression-editor.stories.d.ts +13 -0
  160. package/dist/types/dependencies.d.ts +6 -10
  161. package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -0
  162. package/dist/types/utils/arcade-monaco/arcade-profile-strategy.d.ts +9 -0
  163. package/dist/types/utils/fields.d.ts +2 -2
  164. package/dist/types/utils/language-defaults-base.d.ts +2 -9
  165. package/dist/types/utils/profile/editor-profile.d.ts +7 -6
  166. package/dist/types/utils/profile/types.d.ts +53 -65
  167. package/dist/types/utils/profile/utils.d.ts +9 -8
  168. package/dist/types/utils/sql-expr-monaco/DependentFiles/DateOnly.d.ts +41 -0
  169. package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlInterval.d.ts +16 -0
  170. package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlTimestampOffset.d.ts +26 -0
  171. package/dist/types/utils/sql-expr-monaco/DependentFiles/TimeOnly.d.ts +37 -0
  172. package/dist/types/utils/sql-expr-monaco/DependentFiles/UnknownTimeZone.d.ts +11 -0
  173. package/dist/types/utils/sql-expr-monaco/DependentFiles/WhereGrammar.d.ts +122 -0
  174. package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlCompareUtils.d.ts +5 -0
  175. package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlDateParsingUtils.d.ts +18 -0
  176. package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlUtils.d.ts +6 -0
  177. package/dist/types/utils/sql-expr-monaco/DependentFiles/standardizedFunctions.d.ts +156 -0
  178. package/dist/types/utils/sql-expr-monaco/DependentFiles/support.d.ts +150 -0
  179. package/dist/types/utils/sql-expr-monaco/PeggyGrammar/sql92grammar.d.ts +1397 -0
  180. package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +6 -0
  181. package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +45 -0
  182. package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -0
  183. package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +21 -0
  184. package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +39 -0
  185. package/dist/types/utils/sql-expr-monaco/sql-expr-language-syntax.d.ts +8 -0
  186. package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +43 -0
  187. package/dist/types/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +19 -0
  188. package/dist/types/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +34 -0
  189. package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +100 -0
  190. package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +41 -0
  191. package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +17 -0
  192. package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +24 -0
  193. package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +13 -0
  194. package/dist/types/utils/sql-expr-monaco/types.d.ts +89 -0
  195. package/package.json +27 -21
  196. package/dist/arcgis-coding-components/p-0c6de9b3.js +0 -6
  197. package/dist/arcgis-coding-components/p-81c37dab.entry.js +0 -6
  198. package/dist/cjs/arcade-mode-b85ae7d4.js +0 -595
  199. package/dist/components/chunk-IHYYRFLQ.js +0 -1363
  200. package/dist/types/components/arcade-editor/t9n-types.d.ts +0 -8
  201. package/dist/types/components/arcade-results/t9n-types.d.ts +0 -13
  202. package/dist/types/components/arcade-suggestions/t9n-types.d.ts +0 -6
  203. package/dist/types/components/arcade-variables/t9n-types.d.ts +0 -8
  204. package/dist/types/components/language-api-panel/t9n-types.d.ts +0 -8
  205. package/dist/types/utils/profile/predefined-profile.d.ts +0 -2
@@ -1,12 +1,10 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.2
4
+ * v4.31.0-next.21
5
5
  */
6
6
  'use strict';
7
7
 
8
- const index = require('./index-b34238a6.js');
9
-
10
8
  function _interopNamespace(e) {
11
9
  if (e && e.__esModule) return e;
12
10
  var n = Object.create(null);
@@ -120616,7 +120614,7 @@ registerLanguage({
120616
120614
  mimetypes: ["text/css"],
120617
120615
  loader: () => {
120618
120616
  {
120619
- return Promise.resolve().then(function () { return require('./css-7cc05f76.js'); });
120617
+ return Promise.resolve().then(function () { return require('./css-bb6a49ec.js'); });
120620
120618
  }
120621
120619
  }
120622
120620
  });
@@ -120634,7 +120632,7 @@ registerLanguage({
120634
120632
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
120635
120633
  loader: () => {
120636
120634
  {
120637
- return Promise.resolve().then(function () { return require('./html-f56911e1.js'); });
120635
+ return Promise.resolve().then(function () { return require('./html-7ff4071d.js'); });
120638
120636
  }
120639
120637
  }
120640
120638
  });
@@ -120654,7 +120652,7 @@ registerLanguage({
120654
120652
  mimetypes: ["text/javascript"],
120655
120653
  loader: () => {
120656
120654
  {
120657
- return Promise.resolve().then(function () { return require('./javascript-5115cb76.js'); });
120655
+ return Promise.resolve().then(function () { return require('./javascript-864c0220.js'); });
120658
120656
  }
120659
120657
  }
120660
120658
  });
@@ -120672,7 +120670,7 @@ registerLanguage({
120672
120670
  mimetypes: ["text/typescript"],
120673
120671
  loader: () => {
120674
120672
  {
120675
- return Promise.resolve().then(function () { return require('./typescript-b395242f.js'); });
120673
+ return Promise.resolve().then(function () { return require('./typescript-6c87ddb3.js'); });
120676
120674
  }
120677
120675
  }
120678
120676
  });
@@ -120791,19 +120789,19 @@ var cssDefaults = new LanguageServiceDefaultsImpl$3("css", optionsDefault$1, mod
120791
120789
  var scssDefaults = new LanguageServiceDefaultsImpl$3("scss", optionsDefault$1, modeConfigurationDefault$2);
120792
120790
  var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, modeConfigurationDefault$2);
120793
120791
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
120794
- function getMode$4() {
120792
+ function getMode$3() {
120795
120793
  {
120796
- return Promise.resolve().then(function () { return require('./cssMode-2b0daeae.js'); });
120794
+ return Promise.resolve().then(function () { return require('./cssMode-e7fac7d7.js'); });
120797
120795
  }
120798
120796
  }
120799
120797
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
120800
- getMode$4().then((mode) => mode.setupMode(lessDefaults));
120798
+ getMode$3().then((mode) => mode.setupMode(lessDefaults));
120801
120799
  });
120802
120800
  monaco_editor_core_exports$3.languages.onLanguage("scss", () => {
120803
- getMode$4().then((mode) => mode.setupMode(scssDefaults));
120801
+ getMode$3().then((mode) => mode.setupMode(scssDefaults));
120804
120802
  });
120805
120803
  monaco_editor_core_exports$3.languages.onLanguage("css", () => {
120806
- getMode$4().then((mode) => mode.setupMode(cssDefaults));
120804
+ getMode$3().then((mode) => mode.setupMode(cssDefaults));
120807
120805
  });
120808
120806
 
120809
120807
  /*!-----------------------------------------------------------------------------
@@ -120916,16 +120914,16 @@ monaco_editor_core_exports$2.languages.html = {
120916
120914
  razorLanguageService,
120917
120915
  registerHTMLLanguageService
120918
120916
  };
120919
- function getMode$3() {
120917
+ function getMode$2() {
120920
120918
  {
120921
- return Promise.resolve().then(function () { return require('./htmlMode-43eed674.js'); });
120919
+ return Promise.resolve().then(function () { return require('./htmlMode-c89193ec.js'); });
120922
120920
  }
120923
120921
  }
120924
120922
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
120925
120923
  const defaults = new LanguageServiceDefaultsImpl$2(languageId, options, modeConfiguration);
120926
120924
  let mode;
120927
120925
  const onLanguageListener = monaco_editor_core_exports$2.languages.onLanguage(languageId, async () => {
120928
- mode = (await getMode$3()).setupMode(defaults);
120926
+ mode = (await getMode$2()).setupMode(defaults);
120929
120927
  });
120930
120928
  return {
120931
120929
  defaults,
@@ -121018,9 +121016,9 @@ var modeConfigurationDefault$1 = {
121018
121016
  };
121019
121017
  var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault, modeConfigurationDefault$1);
121020
121018
  monaco_editor_core_exports$1.languages.json = { jsonDefaults };
121021
- function getMode$2() {
121019
+ function getMode$1() {
121022
121020
  {
121023
- return Promise.resolve().then(function () { return require('./jsonMode-550dda36.js'); });
121021
+ return Promise.resolve().then(function () { return require('./jsonMode-ac4a7be7.js'); });
121024
121022
  }
121025
121023
  }
121026
121024
  monaco_editor_core_exports$1.languages.register({
@@ -121030,7 +121028,7 @@ monaco_editor_core_exports$1.languages.register({
121030
121028
  mimetypes: ["application/json"]
121031
121029
  });
121032
121030
  monaco_editor_core_exports$1.languages.onLanguage("json", () => {
121033
- getMode$2().then((mode) => mode.setupMode(jsonDefaults));
121031
+ getMode$1().then((mode) => mode.setupMode(jsonDefaults));
121034
121032
  });
121035
121033
 
121036
121034
  /*!-----------------------------------------------------------------------------
@@ -121270,10 +121268,10 @@ var modeConfigurationDefault = {
121270
121268
  var typescriptDefaults = new LanguageServiceDefaultsImpl({ allowNonTsExtensions: true, target: 99 /* Latest */ }, { noSemanticValidation: false, noSyntaxValidation: false, onlyVisible: false }, {}, {}, modeConfigurationDefault);
121271
121269
  var javascriptDefaults = new LanguageServiceDefaultsImpl({ allowNonTsExtensions: true, allowJs: true, target: 99 /* Latest */ }, { noSemanticValidation: true, noSyntaxValidation: false, onlyVisible: false }, {}, {}, modeConfigurationDefault);
121272
121270
  var getTypeScriptWorker = () => {
121273
- return getMode$1().then((mode) => mode.getTypeScriptWorker());
121271
+ return getMode().then((mode) => mode.getTypeScriptWorker());
121274
121272
  };
121275
121273
  var getJavaScriptWorker = () => {
121276
- return getMode$1().then((mode) => mode.getJavaScriptWorker());
121274
+ return getMode().then((mode) => mode.getJavaScriptWorker());
121277
121275
  };
121278
121276
  monaco_editor_core_exports.languages.typescript = {
121279
121277
  ModuleKind,
@@ -121287,16 +121285,16 @@ monaco_editor_core_exports.languages.typescript = {
121287
121285
  getTypeScriptWorker,
121288
121286
  getJavaScriptWorker
121289
121287
  };
121290
- function getMode$1() {
121288
+ function getMode() {
121291
121289
  {
121292
- return Promise.resolve().then(function () { return require('./tsMode-336306a9.js'); });
121290
+ return Promise.resolve().then(function () { return require('./tsMode-d30d4ab1.js'); });
121293
121291
  }
121294
121292
  }
121295
121293
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
121296
- return getMode$1().then((mode) => mode.setupTypeScript(typescriptDefaults));
121294
+ return getMode().then((mode) => mode.setupTypeScript(typescriptDefaults));
121297
121295
  });
121298
121296
  monaco_editor_core_exports.languages.onLanguage("javascript", () => {
121299
- return getMode$1().then((mode) => mode.setupJavaScript(javascriptDefaults));
121297
+ return getMode().then((mode) => mode.setupJavaScript(javascriptDefaults));
121300
121298
  });
121301
121299
 
121302
121300
  /*---------------------------------------------------------------------------------------------
@@ -166736,6 +166734,760 @@ class ToggleHighContrast extends EditorAction {
166736
166734
  }
166737
166735
  registerEditorAction(ToggleHighContrast);
166738
166736
 
166737
+ // src/index.ts
166738
+ var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis && !("forceESM" in window.$arcgis);
166739
+ function isDefaultModule(module) {
166740
+ return module.default !== void 0;
166741
+ }
166742
+ async function importLayersFeatureLayer() {
166743
+ if (isAMD) {
166744
+ return await window.$arcgis.import("esri/layers/FeatureLayer");
166745
+ }
166746
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/layers/FeatureLayer.js')); });
166747
+ return isDefaultModule(module) ? module.default : module;
166748
+ }
166749
+ async function newLayersFeatureLayer(properties) {
166750
+ const ModConstructor = await importLayersFeatureLayer();
166751
+ return new ModConstructor(properties);
166752
+ }
166753
+ async function importPortalPortalItem() {
166754
+ if (isAMD) {
166755
+ return await window.$arcgis.import("esri/portal/PortalItem");
166756
+ }
166757
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/portal/PortalItem.js')); });
166758
+ return isDefaultModule(module) ? module.default : module;
166759
+ }
166760
+ async function newPortalPortalItem(properties) {
166761
+ const ModConstructor = await importPortalPortalItem();
166762
+ return new ModConstructor(properties);
166763
+ }
166764
+ async function importWebMap() {
166765
+ if (isAMD) {
166766
+ return await window.$arcgis.import("esri/WebMap");
166767
+ }
166768
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebMap.js')); });
166769
+ return isDefaultModule(module) ? module.default : module;
166770
+ }
166771
+ async function newWebMap(properties) {
166772
+ const ModConstructor = await importWebMap();
166773
+ return new ModConstructor(properties);
166774
+ }
166775
+ async function importWebScene() {
166776
+ if (isAMD) {
166777
+ return await window.$arcgis.import("esri/WebScene");
166778
+ }
166779
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebScene.js')); });
166780
+ return isDefaultModule(module) ? module.default : module;
166781
+ }
166782
+ async function newWebScene(properties) {
166783
+ const ModConstructor = await importWebScene();
166784
+ return new ModConstructor(properties);
166785
+ }
166786
+ async function importArcade() {
166787
+ if (isAMD) {
166788
+ return await window.$arcgis.import("esri/arcade");
166789
+ }
166790
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/arcade.js')); });
166791
+ return isDefaultModule(module) ? module.default : module;
166792
+ }
166793
+ async function importRequest() {
166794
+ if (isAMD) {
166795
+ return await window.$arcgis.import("esri/request");
166796
+ }
166797
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/request.js')); });
166798
+ return isDefaultModule(module) ? module.default : module;
166799
+ }
166800
+
166801
+ //#region Type Guards
166802
+ function isFeatureLayerLikeInstance(item) {
166803
+ return (!!item &&
166804
+ typeof item === "object" &&
166805
+ "declaredClass" in item &&
166806
+ typeof item.declaredClass === "string" &&
166807
+ item.declaredClass.startsWith("esri.layers.") &&
166808
+ isFieldsDefinition(item) &&
166809
+ "queryFeatures" in item &&
166810
+ typeof item.queryFeatures === "function");
166811
+ }
166812
+ function isGroupLayerCapable(item) {
166813
+ return (!!item &&
166814
+ typeof item === "object" &&
166815
+ "allLayers" in item &&
166816
+ "allTables" in item &&
166817
+ typeof item.allLayers === "object" &&
166818
+ typeof item.allTables === "object");
166819
+ }
166820
+ function isMapInstance(item) {
166821
+ return (!!item &&
166822
+ typeof item === "object" &&
166823
+ "declaredClass" in item &&
166824
+ typeof item.declaredClass === "string" &&
166825
+ (item.declaredClass === "esri.Map" ||
166826
+ item.declaredClass === "esri.WebMap" ||
166827
+ item.declaredClass === "esri.WebScene"));
166828
+ }
166829
+ function isLoadAllCapable(item) {
166830
+ return !!item && typeof item === "object" && "loadAll" in item && typeof item.loadAll === "function";
166831
+ }
166832
+ function isPortalItemDefinition(item) {
166833
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
166834
+ }
166835
+ function isFeatureLayerItemDefinition(item) {
166836
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
166837
+ }
166838
+ function isFieldsDefinition(item) {
166839
+ return !!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields);
166840
+ }
166841
+ function isUrlDefinition(item) {
166842
+ return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
166843
+ }
166844
+ function isSupportedServiceUrlDefinition(item) {
166845
+ return isUrlDefinition(item) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(item.url);
166846
+ }
166847
+ function isFeatureDefinition(item) {
166848
+ return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
166849
+ }
166850
+ function isFeatureSetDefinition(item) {
166851
+ return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
166852
+ }
166853
+ function isFeatureSetCollectionDefinition(item) {
166854
+ return isPortalItemDefinition(item) || isMapInstance(item) || isSupportedServiceUrlDefinition(item);
166855
+ }
166856
+ function isSubtypeInstance(item) {
166857
+ return (!!item &&
166858
+ typeof item === "object" &&
166859
+ "declaredClass" in item &&
166860
+ item.declaredClass === "esri.layers.support.Subtype");
166861
+ }
166862
+ function isCodedValueDomainInstance(item) {
166863
+ return (!!item &&
166864
+ typeof item === "object" &&
166865
+ "declaredClass" in item &&
166866
+ item.declaredClass === "esri.layers.support.CodedValueDomain");
166867
+ }
166868
+ function isInheritedDomainInstance(item) {
166869
+ return (!!item &&
166870
+ typeof item === "object" &&
166871
+ "declaredClass" in item &&
166872
+ item.declaredClass === "esri.layers.support.InheritedDomain");
166873
+ }
166874
+ function isPredefinedProfile(item) {
166875
+ return (!!item &&
166876
+ typeof item === "object" &&
166877
+ "id" in item &&
166878
+ typeof item.id === "string" &&
166879
+ "definitions" in item &&
166880
+ typeof item.definitions === "object" &&
166881
+ !Array.isArray(item.definitions));
166882
+ }
166883
+ function isTitleCapableSource(item) {
166884
+ return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
166885
+ }
166886
+ function isUrlCapableSource(item) {
166887
+ return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
166888
+ }
166889
+ function isLayerIdCapableSource(item) {
166890
+ return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
166891
+ }
166892
+ function isFeatureTypesCapableLayer(item) {
166893
+ return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
166894
+ }
166895
+ function isDomainsCapableLayer(item) {
166896
+ return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
166897
+ }
166898
+ function isSubtypeFieldCapableLayer(item) {
166899
+ return !!item && typeof item === "object" && "subtypeField" in item;
166900
+ }
166901
+ function isSubtypesCapableLayer(item) {
166902
+ return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
166903
+ }
166904
+ function isPortalItemCapable(item) {
166905
+ return !!item && typeof item === "object" && "portalItem" in item;
166906
+ }
166907
+ function isRelationshipsCapableLayer(item) {
166908
+ return (isLayerIdCapableSource(item) &&
166909
+ "relationships" in item &&
166910
+ "url" in item &&
166911
+ Array.isArray(item.relationships) &&
166912
+ typeof item.url === "string");
166913
+ }
166914
+ function isTableCapableLayer(item) {
166915
+ return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
166916
+ }
166917
+ function isLoadableSource(item) {
166918
+ return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
166919
+ }
166920
+ //#endregion
166921
+ //#region Service Metadata
166922
+ async function supportedSourceFromDefinition(definition) {
166923
+ if (!definition) {
166924
+ return null;
166925
+ }
166926
+ let source = null;
166927
+ if (isFieldsDefinition(definition)) {
166928
+ source = definition;
166929
+ }
166930
+ else {
166931
+ source = await newLayersFeatureLayer(definition);
166932
+ }
166933
+ if (isLoadableSource(source)) {
166934
+ await source.load();
166935
+ }
166936
+ return source;
166937
+ }
166938
+ async function serviceMetaData(url) {
166939
+ url += "/layers";
166940
+ const request = await importRequest();
166941
+ const response = await request(url, { responseType: "json", query: { f: "json" } });
166942
+ const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
166943
+ const layers = getSupportedLayerInfos(response.data?.layers, queryCapability);
166944
+ const tables = getSupportedLayerInfos(response.data?.tables, queryCapability);
166945
+ return { layers, tables };
166946
+ }
166947
+ function getSupportedLayerInfos(layers, queryCapability) {
166948
+ if (!layers) {
166949
+ return [];
166950
+ }
166951
+ return layers.filter((layer) => {
166952
+ switch (layer.type) {
166953
+ case "Feature Layer":
166954
+ case "Oriented Imagery Layer":
166955
+ case "Catalog Layer":
166956
+ case "Table": {
166957
+ const capabilities = layer.capabilities
166958
+ ? layer.capabilities
166959
+ .toLowerCase()
166960
+ .split(",")
166961
+ .map((value) => value.trim())
166962
+ : [];
166963
+ return capabilities.includes(queryCapability);
166964
+ }
166965
+ default:
166966
+ return false;
166967
+ }
166968
+ });
166969
+ }
166970
+ //#endregion
166971
+
166972
+ // src/array-utils.ts
166973
+
166974
+ // src/deferred.ts
166975
+ var Deferred = class {
166976
+ /**
166977
+ * Resolves the promise.
166978
+ * @param value The value to resolve the promise with.
166979
+ */
166980
+ resolve(_value) {
166981
+ }
166982
+ /**
166983
+ * Rejects the promise.
166984
+ */
166985
+ reject(_error) {
166986
+ }
166987
+ /**
166988
+ * Creates a new deferred promise.
166989
+ */
166990
+ constructor() {
166991
+ this.promise = new Promise((resolve, reject) => {
166992
+ this.resolve = resolve;
166993
+ this.reject = reject;
166994
+ });
166995
+ }
166996
+ };
166997
+
166998
+ // src/dom.ts
166999
+ function inTargetElement(element, targetElement) {
167000
+ let currentElement = element;
167001
+ while (currentElement) {
167002
+ if (currentElement === targetElement) {
167003
+ return true;
167004
+ }
167005
+ if (!currentElement.parentNode) {
167006
+ return false;
167007
+ }
167008
+ if (currentElement.parentNode instanceof ShadowRoot) {
167009
+ currentElement = currentElement.parentNode.host;
167010
+ } else {
167011
+ currentElement = currentElement.parentNode;
167012
+ }
167013
+ }
167014
+ return false;
167015
+ }
167016
+ function observeAncestorsMutation(element, attributeFilter, callback) {
167017
+ const { subscribe } = observe(attributeFilter);
167018
+ return subscribe((mutations) => {
167019
+ const matched = mutations.some((mutation) => inTargetElement(element, mutation.target));
167020
+ if (matched) {
167021
+ callback();
167022
+ }
167023
+ });
167024
+ }
167025
+ var observers = {};
167026
+ function observe(attributeFilter) {
167027
+ const attributes = attributeFilter.join(",");
167028
+ const previousObserver = observers[attributes];
167029
+ if (previousObserver !== void 0) {
167030
+ return previousObserver;
167031
+ }
167032
+ const subscribers = /* @__PURE__ */ new Set();
167033
+ const mutationObserver = new MutationObserver((mutations) => subscribers.forEach((callback) => callback(mutations)));
167034
+ mutationObserver.observe(document.documentElement, {
167035
+ attributes: true,
167036
+ attributeFilter,
167037
+ subtree: true
167038
+ });
167039
+ const observer = {
167040
+ subscribe(callback) {
167041
+ subscribers.add(callback);
167042
+ return {
167043
+ remove: () => {
167044
+ subscribers.delete(callback);
167045
+ if (subscribers.size === 0) {
167046
+ mutationObserver.disconnect();
167047
+ observers[attributes] = void 0;
167048
+ }
167049
+ }
167050
+ };
167051
+ }
167052
+ };
167053
+ observers[attributes] = observer;
167054
+ return observer;
167055
+ }
167056
+ function closestElement(base, selector) {
167057
+ let currentElement = base;
167058
+ while (currentElement) {
167059
+ const element = currentElement.closest(selector);
167060
+ if (element) {
167061
+ return element;
167062
+ }
167063
+ const rootElement = currentElement.getRootNode();
167064
+ if (rootElement === document) {
167065
+ return null;
167066
+ }
167067
+ currentElement = rootElement.host;
167068
+ }
167069
+ return null;
167070
+ }
167071
+ function getElementTheme(base) {
167072
+ const themeElt = closestElement(base, ":is(.calcite-mode-light, .calcite-mode-dark)");
167073
+ return themeElt && themeElt.classList.contains("calcite-mode-dark") ? "dark" : "light";
167074
+ }
167075
+ function getElementAttribute(el, prop, fallbackValue) {
167076
+ const closest = closestElement(el, `[${prop}]`);
167077
+ return closest?.getAttribute(prop) ?? fallbackValue;
167078
+ }
167079
+ function isElement(ref) {
167080
+ return ref.nodeType === Node.ELEMENT_NODE;
167081
+ }
167082
+ function isHTMLWithSetFocus(ref) {
167083
+ return "setFocus" in ref && typeof ref.setFocus === "function";
167084
+ }
167085
+ function setFocus(ref, selector = "") {
167086
+ if (!isElement(ref)) {
167087
+ return false;
167088
+ }
167089
+ if (ref.matches(selector)) {
167090
+ if (isHTMLWithSetFocus(ref)) {
167091
+ setTimeout(() => ref.setFocus(), 0);
167092
+ }
167093
+ return true;
167094
+ }
167095
+ for (const child of ref.children) {
167096
+ if (setFocus(child, selector)) {
167097
+ return true;
167098
+ }
167099
+ }
167100
+ const shadowRoot = ref.shadowRoot;
167101
+ if (shadowRoot) {
167102
+ for (const child of shadowRoot.children) {
167103
+ if (setFocus(child, selector)) {
167104
+ return true;
167105
+ }
167106
+ }
167107
+ }
167108
+ return false;
167109
+ }
167110
+ function setFocusOnElement(ref, selector) {
167111
+ if (!ref?.shadowRoot) {
167112
+ return;
167113
+ }
167114
+ if (ref.hasAttribute("hydrated") || ref.hasAttribute("calcite-hydrated")) {
167115
+ setFocus(ref, selector);
167116
+ return;
167117
+ }
167118
+ const mutationObserver = new MutationObserver(() => {
167119
+ mutationObserver.disconnect();
167120
+ setFocus(ref, selector);
167121
+ });
167122
+ mutationObserver.observe(ref, {
167123
+ attributes: true,
167124
+ attributeFilter: ["hydrated", "calcite-hydrated"]
167125
+ });
167126
+ }
167127
+
167128
+ // src/errors.ts
167129
+ function safeCall(callback, thisContext, ...rest) {
167130
+ try {
167131
+ return callback?.call(thisContext, ...rest);
167132
+ } catch (error) {
167133
+ console.error(error, callback);
167134
+ }
167135
+ return void 0;
167136
+ }
167137
+ async function safeAsyncCall(callback, thisContext, ...rest) {
167138
+ try {
167139
+ const result = callback?.call(thisContext, ...rest);
167140
+ return result instanceof Promise ? await result : result;
167141
+ } catch (error) {
167142
+ console.error(error, callback);
167143
+ }
167144
+ return void 0;
167145
+ }
167146
+
167147
+ // src/guid.ts
167148
+ function gen(count) {
167149
+ let out = "";
167150
+ for (let i = 0; i < count; i++) {
167151
+ out += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
167152
+ }
167153
+ return out;
167154
+ }
167155
+ function generateGuid() {
167156
+ return [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
167157
+ }
167158
+
167159
+ // src/intl.ts
167160
+ var supportedLocalesArray = [
167161
+ "ar",
167162
+ "bg",
167163
+ "bs",
167164
+ "ca",
167165
+ "cs",
167166
+ "da",
167167
+ "de",
167168
+ "el",
167169
+ "en",
167170
+ "es",
167171
+ "et",
167172
+ "fi",
167173
+ "fr",
167174
+ "he",
167175
+ "hr",
167176
+ "hu",
167177
+ "id",
167178
+ "it",
167179
+ "ja",
167180
+ "ko",
167181
+ "lt",
167182
+ "lv",
167183
+ "nl",
167184
+ "nb",
167185
+ "pl",
167186
+ "pt-BR",
167187
+ "pt-PT",
167188
+ "ro",
167189
+ "ru",
167190
+ "sk",
167191
+ "sl",
167192
+ "sr",
167193
+ "sv",
167194
+ "th",
167195
+ "tr",
167196
+ "uk",
167197
+ "vi",
167198
+ "zh-CN",
167199
+ "zh-HK",
167200
+ "zh-TW"
167201
+ ];
167202
+ var supportedLocales = new Set(supportedLocalesArray);
167203
+ var defaultLocale = "en";
167204
+ var localeEquivalencies = {
167205
+ // We use `pt-BR` as it will have the same translations as `pt`, which has no corresponding bundle
167206
+ pt: "pt-PT",
167207
+ // We support both 'nb' and 'no' (BCP 47) for Norwegian but only `nb` has corresponding bundle
167208
+ no: "nb",
167209
+ // We can `zh-CN` as base translation for chinese locales which has no corresponding bundle.
167210
+ zh: "zh-CN"
167211
+ };
167212
+ async function fetchT9nStringsBundle(locale, assetsPath, prefix = "") {
167213
+ const path = `${assetsPath}/${prefix}`;
167214
+ const filePath = `${path}${locale}.json`;
167215
+ t9nStringsCache[filePath] ?? (t9nStringsCache[filePath] = fetchBundle(locale, path));
167216
+ return await t9nStringsCache[filePath];
167217
+ }
167218
+ var t9nStringsCache = {};
167219
+ async function fetchBundle(locale, path) {
167220
+ const filePath = `${path}${locale}.json`;
167221
+ try {
167222
+ const response = await fetch(filePath);
167223
+ if (response.ok) {
167224
+ return await response.json();
167225
+ }
167226
+ } catch (error) {
167227
+ console.error(error);
167228
+ return {};
167229
+ }
167230
+ if (locale === defaultLocale) {
167231
+ return {};
167232
+ }
167233
+ return await fetchBundle(defaultLocale, path);
167234
+ }
167235
+ function getElementLocales(element) {
167236
+ const lang = getElementAttribute(element, "lang", navigator.language || defaultLocale);
167237
+ return { lang, t9nLocale: langToLocale(lang) };
167238
+ }
167239
+ function langToLocale(lang) {
167240
+ const parts = lang.split("-");
167241
+ const normalized = `${parts[0].toLowerCase()}${parts.slice(1).join("-").toUpperCase()}`;
167242
+ if (supportedLocales.has(normalized)) {
167243
+ return normalized;
167244
+ }
167245
+ const languageCode = normalized.slice(0, 2).toLowerCase();
167246
+ const locale = localeEquivalencies[languageCode] ?? languageCode;
167247
+ if (supportedLocales.has(locale)) {
167248
+ return locale;
167249
+ }
167250
+ return defaultLocale;
167251
+ }
167252
+ function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
167253
+ let result = void 0;
167254
+ const callback = () => void updateComponentLocateState(element, assetsPath, assetName).then((newResult) => {
167255
+ if (result?.lang !== newResult.lang || result.t9nLocale !== newResult.t9nLocale || result.t9nStrings !== newResult.t9nStrings) {
167256
+ onUpdated(newResult);
167257
+ }
167258
+ result = newResult;
167259
+ }).catch(console.error);
167260
+ callback();
167261
+ return observeAncestorsMutation(element, ["lang"], callback);
167262
+ }
167263
+ async function updateComponentLocateState(element, assetsPath, assetName = element.tagName.toLowerCase().replace("arcgis-", "")) {
167264
+ const { lang, t9nLocale } = getElementLocales(element);
167265
+ const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
167266
+ const prefix = `${assetName}.t9n.`;
167267
+ const t9nStrings = await fetchT9nStringsBundle(t9nLocale, t9nAssetsPath, prefix);
167268
+ return { lang, t9nLocale, t9nStrings };
167269
+ }
167270
+
167271
+ // src/strings.ts
167272
+ var doubleQuote = '"';
167273
+ var singleQuote = "'";
167274
+ function repeatString(value, n) {
167275
+ return new Array(n + 1).join(value);
167276
+ }
167277
+ function quoteString(value) {
167278
+ let quote = doubleQuote;
167279
+ let alternateQuote = singleQuote;
167280
+ const avoidEscape = value.includes(quote) && !value.includes(alternateQuote);
167281
+ if (avoidEscape) {
167282
+ alternateQuote = doubleQuote;
167283
+ quote = singleQuote;
167284
+ }
167285
+ const alternateEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${alternateQuote})+)`, "gu");
167286
+ value = value.replace(
167287
+ alternateEscape,
167288
+ (_, boundaryChar, leadingEscapedSlashes, escapedQuoteChars) => (
167289
+ // We divide the escapedQuoteChars by 2 since there are 2 characters in each escaped part ('\\"'.length === 2)
167290
+ boundaryChar + leadingEscapedSlashes + repeatString(alternateQuote, escapedQuoteChars.length / 2)
167291
+ )
167292
+ );
167293
+ const quoteEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${quote}+)`, "gu");
167294
+ value = value.replace(
167295
+ quoteEscape,
167296
+ (_, boundaryChar, leadingEscapedSlashes, quoteChars) => boundaryChar + leadingEscapedSlashes + repeatString(`\\${quote}`, quoteChars.length)
167297
+ );
167298
+ return quote + value + quote;
167299
+ }
167300
+ function createFilterExpression(filterWord) {
167301
+ const sanitizedWord = filterWord ? filterWord.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu, "\\$&") : "^.*$";
167302
+ return new RegExp(sanitizedWord, "i");
167303
+ }
167304
+ function setValuesInString(message, values = {}) {
167305
+ return (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
167306
+ }
167307
+ function addLTRMark(value) {
167308
+ return `\u200E${value ?? ""}\u200E`;
167309
+ }
167310
+
167311
+ // src/timeouts.ts
167312
+ function devToolsAwareTimeout(callback, timeout) {
167313
+ const interval = timeout > longTimeoutThreshold ? longTimeoutInterval : timeout / shortTimeoutIntervals;
167314
+ let elapsed = 0;
167315
+ const reference = setInterval(() => {
167316
+ elapsed += interval;
167317
+ if (elapsed >= timeout) {
167318
+ clearInterval(reference);
167319
+ callback();
167320
+ }
167321
+ }, interval);
167322
+ return reference;
167323
+ }
167324
+ var longTimeoutThreshold = 4e3;
167325
+ var longTimeoutInterval = 2e3;
167326
+ var shortTimeoutIntervals = 4;
167327
+
167328
+ // src/type-guards.ts
167329
+ function isNotNull(item) {
167330
+ return item !== null;
167331
+ }
167332
+ function isNotUndefined(item) {
167333
+ return item !== void 0;
167334
+ }
167335
+
167336
+ // src/ui.ts
167337
+ function debounce(func, waitFor = 100) {
167338
+ let timeout;
167339
+ return (...args) => {
167340
+ const later = () => {
167341
+ clearTimeout(timeout);
167342
+ func(...args);
167343
+ };
167344
+ clearTimeout(timeout);
167345
+ timeout = setTimeout(later, waitFor);
167346
+ };
167347
+ }
167348
+
167349
+ // src/url.ts
167350
+ function hasSameOrigin(url1, url2, ignoreProtocol = false) {
167351
+ if (!url1 || !url2) {
167352
+ return false;
167353
+ }
167354
+ const url1Obj = new URL(url1);
167355
+ const url2Obj = new URL(url2);
167356
+ if (!ignoreProtocol && url1Obj.protocol !== url2Obj.protocol) {
167357
+ return false;
167358
+ }
167359
+ if (url1Obj.host == null || url2Obj.host == null) {
167360
+ return false;
167361
+ }
167362
+ return url1Obj.host.toLowerCase() === url2Obj.host.toLowerCase() && url1Obj.port === url2Obj.port;
167363
+ }
167364
+ function isURL(url) {
167365
+ try {
167366
+ new URL(url);
167367
+ return true;
167368
+ } catch (e) {
167369
+ return false;
167370
+ }
167371
+ }
167372
+
167373
+ /**
167374
+ * Filters a collection of items by the given keys and filter word.
167375
+ */
167376
+ function filterCollection(collection, keys, filterWord, beforeFilteringFn) {
167377
+ if (!keys) {
167378
+ return [];
167379
+ }
167380
+ const _keys = !Array.isArray(keys) ? [keys] : keys;
167381
+ if (!_keys.length) {
167382
+ return [];
167383
+ }
167384
+ const filterExpression = createFilterExpression(filterWord);
167385
+ return collection.filter((item) => {
167386
+ if (beforeFilteringFn) {
167387
+ const res = beforeFilteringFn(item);
167388
+ if (res !== null || res !== undefined) {
167389
+ return res;
167390
+ }
167391
+ }
167392
+ return _keys.some((key) => filterExpression.test(String(item[key] ?? "")));
167393
+ });
167394
+ }
167395
+ /**
167396
+ * Returns the url to the portal item.
167397
+ */
167398
+ function portalItemPageUrl(portalItem) {
167399
+ if (!portalItem) {
167400
+ return "";
167401
+ }
167402
+ return `${portalItem.portal.url}/home/item.html?id=${portalItem.id}`;
167403
+ }
167404
+ //#endregion
167405
+
167406
+ /**
167407
+ * Returns an icon name for the field type
167408
+ */
167409
+ function fieldTypeToIconName(field) {
167410
+ switch (field.type) {
167411
+ case "oid":
167412
+ return "key";
167413
+ case "small-integer":
167414
+ case "big-integer":
167415
+ case "integer":
167416
+ case "single":
167417
+ case "double":
167418
+ case "long":
167419
+ return "number";
167420
+ case "global-id":
167421
+ case "guid":
167422
+ return "key";
167423
+ case "string":
167424
+ return "string";
167425
+ case "date":
167426
+ return "date-time";
167427
+ case "date-only":
167428
+ return "calendar";
167429
+ case "time-only":
167430
+ return "clock";
167431
+ case "timestamp-offset":
167432
+ return "time-zone";
167433
+ default:
167434
+ return "cube";
167435
+ }
167436
+ }
167437
+ /**
167438
+ * Returns the ApiValueVariable type for the given field.
167439
+ */
167440
+ function fieldTypeToApiValueVarType(field) {
167441
+ switch (field.type) {
167442
+ case "small-integer":
167443
+ case "integer":
167444
+ case "big-integer":
167445
+ case "single":
167446
+ case "double":
167447
+ case "long":
167448
+ case "oid":
167449
+ return "number";
167450
+ case "global-id":
167451
+ case "guid":
167452
+ case "string":
167453
+ return "text";
167454
+ case "date":
167455
+ return "date";
167456
+ case "date-only":
167457
+ return "dateOnly";
167458
+ case "time-only":
167459
+ return "time";
167460
+ default:
167461
+ return "text";
167462
+ }
167463
+ }
167464
+ function supportedFields(fields) {
167465
+ return (fields ?? []).filter((field) => {
167466
+ switch (field.type) {
167467
+ case "string":
167468
+ case "small-integer":
167469
+ case "integer":
167470
+ case "big-integer":
167471
+ case "single":
167472
+ case "double":
167473
+ case "long":
167474
+ case "date":
167475
+ case "date-only":
167476
+ case "time-only":
167477
+ case "timestamp-offset":
167478
+ case "oid":
167479
+ case "guid":
167480
+ case "global-id":
167481
+ return true;
167482
+ default:
167483
+ return false;
167484
+ }
167485
+ });
167486
+ }
167487
+ function fieldAlias(field) {
167488
+ return field.alias || field.name;
167489
+ }
167490
+
166739
167491
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
166740
167492
 
166741
167493
  function commonjsRequire (path) {
@@ -169011,752 +169763,6 @@ var main = {exports: {}};
169011
169763
  });
169012
169764
  }(main, main.exports));
169013
169765
 
169014
- // src/index.ts
169015
- var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis;
169016
- function isDefaultModule(module) {
169017
- return module.default !== void 0;
169018
- }
169019
- async function importLayersFeatureLayer() {
169020
- if (isAMD) {
169021
- return await window.$arcgis.import("esri/layers/FeatureLayer");
169022
- }
169023
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/layers/FeatureLayer.js')); });
169024
- return isDefaultModule(module) ? module.default : module;
169025
- }
169026
- async function newLayersFeatureLayer(properties) {
169027
- const ModConstructor = await importLayersFeatureLayer();
169028
- return new ModConstructor(properties);
169029
- }
169030
- async function importPortalPortalItem() {
169031
- if (isAMD) {
169032
- return await window.$arcgis.import("esri/portal/PortalItem");
169033
- }
169034
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/portal/PortalItem.js')); });
169035
- return isDefaultModule(module) ? module.default : module;
169036
- }
169037
- async function newPortalPortalItem(properties) {
169038
- const ModConstructor = await importPortalPortalItem();
169039
- return new ModConstructor(properties);
169040
- }
169041
- async function importWebMap() {
169042
- if (isAMD) {
169043
- return await window.$arcgis.import("esri/WebMap");
169044
- }
169045
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebMap.js')); });
169046
- return isDefaultModule(module) ? module.default : module;
169047
- }
169048
- async function newWebMap(properties) {
169049
- const ModConstructor = await importWebMap();
169050
- return new ModConstructor(properties);
169051
- }
169052
- async function importWebScene() {
169053
- if (isAMD) {
169054
- return await window.$arcgis.import("esri/WebScene");
169055
- }
169056
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebScene.js')); });
169057
- return isDefaultModule(module) ? module.default : module;
169058
- }
169059
- async function newWebScene(properties) {
169060
- const ModConstructor = await importWebScene();
169061
- return new ModConstructor(properties);
169062
- }
169063
- async function importArcade() {
169064
- if (isAMD) {
169065
- return await window.$arcgis.import("esri/arcade");
169066
- }
169067
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/arcade.js')); });
169068
- return isDefaultModule(module) ? module.default : module;
169069
- }
169070
- async function importRequest() {
169071
- if (isAMD) {
169072
- return await window.$arcgis.import("esri/request");
169073
- }
169074
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/request.js')); });
169075
- return isDefaultModule(module) ? module.default : module;
169076
- }
169077
-
169078
- //#region Type Guards
169079
- function isQueryableLayerInstance(item) {
169080
- return (!!item &&
169081
- typeof item === "object" &&
169082
- "declaredClass" in item &&
169083
- typeof item.declaredClass === "string" &&
169084
- item.declaredClass.startsWith("esri.layers.") &&
169085
- "fields" in item &&
169086
- "queryFeatures" in item &&
169087
- typeof item.queryFeatures === "function");
169088
- }
169089
- function isSubtypeSublayerInstance(item) {
169090
- return (!!item &&
169091
- typeof item === "object" &&
169092
- "declaredClass" in item &&
169093
- typeof item.declaredClass === "string" &&
169094
- item.declaredClass === "esri.layers.support.SubtypeSublayer");
169095
- }
169096
- function isGroupLayerInstance(item) {
169097
- return (!!item &&
169098
- typeof item === "object" &&
169099
- "declaredClass" in item &&
169100
- typeof item.declaredClass === "string" &&
169101
- item.declaredClass === "esri.layers.GroupLayer");
169102
- }
169103
- function isMapInstance(item) {
169104
- return (!!item &&
169105
- typeof item === "object" &&
169106
- "declaredClass" in item &&
169107
- typeof item.declaredClass === "string" &&
169108
- (item.declaredClass === "esri.Map" ||
169109
- item.declaredClass === "esri.WebMap" ||
169110
- item.declaredClass === "esri.WebScene"));
169111
- }
169112
- function isWebMapInstance(item) {
169113
- return item.declaredClass === "esri.WebMap";
169114
- }
169115
- function isWebSceneInstance(item) {
169116
- return item.declaredClass === "esri.WebScene";
169117
- }
169118
- function isLoadableMapInstance(item) {
169119
- return item.declaredClass === "esri.WebMap" || item.declaredClass === "esri.WebScene";
169120
- }
169121
- function isPortalItemDefinition(item) {
169122
- return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169123
- }
169124
- function isFeatureLayerItemDefinition(item) {
169125
- return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169126
- }
169127
- function isFieldsDefinition(item) {
169128
- return !!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields);
169129
- }
169130
- function isUrlDefinition(item) {
169131
- return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169132
- }
169133
- function isSupportedServiceUrlDefinition(item) {
169134
- return isUrlDefinition(item) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(item.url);
169135
- }
169136
- function isSubtypeInstance(item) {
169137
- return (!!item &&
169138
- typeof item === "object" &&
169139
- "declaredClass" in item &&
169140
- item.declaredClass === "esri.layers.support.Subtype");
169141
- }
169142
- function isCodedValueDomainInstance(item) {
169143
- return (!!item &&
169144
- typeof item === "object" &&
169145
- "declaredClass" in item &&
169146
- item.declaredClass === "esri.layers.support.CodedValueDomain");
169147
- }
169148
- function isInheritedDomainInstance(item) {
169149
- return (!!item &&
169150
- typeof item === "object" &&
169151
- "declaredClass" in item &&
169152
- item.declaredClass === "esri.layers.support.InheritedDomain");
169153
- }
169154
- function isPredefinedProfile(item) {
169155
- return (!!item &&
169156
- typeof item === "object" &&
169157
- "id" in item &&
169158
- typeof item.id === "string" &&
169159
- "definitions" in item &&
169160
- typeof item.definitions === "object" &&
169161
- !Array.isArray(item.definitions));
169162
- }
169163
- function isTitleCapableSource(item) {
169164
- return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169165
- }
169166
- function isUrlCapableSource(item) {
169167
- return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169168
- }
169169
- function isLayerIdCapableSource(item) {
169170
- return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
169171
- }
169172
- function isFeatureTypesCapableLayer(item) {
169173
- return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
169174
- }
169175
- function isDomainsCapableLayer(item) {
169176
- return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169177
- }
169178
- function isSubtypeFieldCapableLayer(item) {
169179
- return !!item && typeof item === "object" && "subtypeField" in item;
169180
- }
169181
- function isSubtypesCapableLayer(item) {
169182
- return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
169183
- }
169184
- function isRelationshipsCapableLayer(item) {
169185
- return (isLayerIdCapableSource(item) &&
169186
- "relationships" in item &&
169187
- "url" in item &&
169188
- Array.isArray(item.relationships) &&
169189
- typeof item.url === "string");
169190
- }
169191
- function isTableCapableLayer(item) {
169192
- return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169193
- }
169194
- function isLoadableSource(item) {
169195
- return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169196
- }
169197
- //#endregion
169198
- //#region Service Metadata
169199
- async function supportedSourceFromDefinition(definition) {
169200
- if (!definition) {
169201
- return null;
169202
- }
169203
- let source = null;
169204
- if (isFieldsDefinition(definition)) {
169205
- source = definition;
169206
- }
169207
- else {
169208
- source = await newLayersFeatureLayer(definition);
169209
- }
169210
- if (isLoadableSource(source)) {
169211
- await source.load();
169212
- }
169213
- return source;
169214
- }
169215
- async function serviceMetaData(url) {
169216
- url += "/layers";
169217
- const request = await importRequest();
169218
- const response = await request(url, { responseType: "json", query: { f: "json" } });
169219
- const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
169220
- const layers = getSupportedLayerInfos(response.data?.layers, queryCapability);
169221
- const tables = getSupportedLayerInfos(response.data?.tables, queryCapability);
169222
- return { layers, tables };
169223
- }
169224
- function getSupportedLayerInfos(layers, queryCapability) {
169225
- if (!layers) {
169226
- return [];
169227
- }
169228
- return layers.filter((layer) => {
169229
- switch (layer.type) {
169230
- case "Feature Layer":
169231
- case "Oriented Imagery Layer":
169232
- case "Catalog Layer":
169233
- case "Table": {
169234
- const capabilities = layer.capabilities
169235
- ? layer.capabilities
169236
- .toLowerCase()
169237
- .split(",")
169238
- .map((value) => value.trim())
169239
- : [];
169240
- return capabilities.includes(queryCapability);
169241
- }
169242
- default:
169243
- return false;
169244
- }
169245
- });
169246
- }
169247
- //#endregion
169248
-
169249
- // src/array-utils.ts
169250
-
169251
- // src/deferred.ts
169252
- var Deferred = class {
169253
- /**
169254
- * Resolves the promise.
169255
- * @param value The value to resolve the promise with.
169256
- */
169257
- resolve(_value) {
169258
- }
169259
- /**
169260
- * Rejects the promise.
169261
- */
169262
- reject(_error) {
169263
- }
169264
- /**
169265
- * Creates a new deferred promise.
169266
- */
169267
- constructor() {
169268
- this.promise = new Promise((resolve, reject) => {
169269
- this.resolve = resolve;
169270
- this.reject = reject;
169271
- });
169272
- }
169273
- };
169274
-
169275
- // src/dom.ts
169276
- function inTargetElement(element, targetElement) {
169277
- let currentElement = element;
169278
- while (currentElement) {
169279
- if (currentElement === targetElement) {
169280
- return true;
169281
- }
169282
- if (!currentElement.parentNode) {
169283
- return false;
169284
- }
169285
- if (currentElement.parentNode instanceof ShadowRoot) {
169286
- currentElement = currentElement.parentNode.host;
169287
- } else {
169288
- currentElement = currentElement.parentNode;
169289
- }
169290
- }
169291
- return false;
169292
- }
169293
- function observeAncestorsMutation(element, attributeFilter, callback) {
169294
- const { subscribe } = observe(attributeFilter);
169295
- return subscribe((mutations) => {
169296
- const matched = mutations.some((mutation) => inTargetElement(element, mutation.target));
169297
- if (matched) {
169298
- callback();
169299
- }
169300
- });
169301
- }
169302
- var observers = {};
169303
- function observe(attributeFilter) {
169304
- const attributes = attributeFilter.join(",");
169305
- const previousObserver = observers[attributes];
169306
- if (previousObserver !== void 0) {
169307
- return previousObserver;
169308
- }
169309
- const subscribers = /* @__PURE__ */ new Set();
169310
- const mutationObserver = new MutationObserver((mutations) => subscribers.forEach((callback) => callback(mutations)));
169311
- mutationObserver.observe(document.documentElement, {
169312
- attributes: true,
169313
- attributeFilter,
169314
- subtree: true
169315
- });
169316
- const observer = {
169317
- subscribe(callback) {
169318
- subscribers.add(callback);
169319
- return {
169320
- remove: () => {
169321
- subscribers.delete(callback);
169322
- if (subscribers.size === 0) {
169323
- mutationObserver.disconnect();
169324
- observers[attributes] = void 0;
169325
- }
169326
- }
169327
- };
169328
- }
169329
- };
169330
- observers[attributes] = observer;
169331
- return observer;
169332
- }
169333
- function closestElement(base, selector) {
169334
- let currentElement = base;
169335
- while (currentElement) {
169336
- const element = currentElement.closest(selector);
169337
- if (element) {
169338
- return element;
169339
- }
169340
- const rootElement = currentElement.getRootNode();
169341
- if (rootElement === document) {
169342
- return null;
169343
- }
169344
- currentElement = rootElement.host;
169345
- }
169346
- return null;
169347
- }
169348
- function getElementTheme(base) {
169349
- const themeElt = closestElement(base, ":is(.calcite-mode-light, .calcite-mode-dark)");
169350
- return themeElt && themeElt.classList.contains("calcite-mode-dark") ? "dark" : "light";
169351
- }
169352
- function getElementAttribute(el, prop, fallbackValue) {
169353
- const closest = closestElement(el, `[${prop}]`);
169354
- return closest?.getAttribute(prop) ?? fallbackValue;
169355
- }
169356
- function isElement(ref) {
169357
- return ref.nodeType === Node.ELEMENT_NODE;
169358
- }
169359
- function isHTMLWithSetFocus(ref) {
169360
- return "setFocus" in ref && typeof ref.setFocus === "function";
169361
- }
169362
- function setFocus(ref, selector = "") {
169363
- if (!isElement(ref)) {
169364
- return false;
169365
- }
169366
- if (ref.matches(selector)) {
169367
- if (isHTMLWithSetFocus(ref)) {
169368
- setTimeout(() => ref.setFocus(), 0);
169369
- }
169370
- return true;
169371
- }
169372
- for (const child of ref.children) {
169373
- if (setFocus(child, selector)) {
169374
- return true;
169375
- }
169376
- }
169377
- const shadowRoot = ref.shadowRoot;
169378
- if (shadowRoot) {
169379
- for (const child of shadowRoot.children) {
169380
- if (setFocus(child, selector)) {
169381
- return true;
169382
- }
169383
- }
169384
- }
169385
- return false;
169386
- }
169387
- function setFocusOnElement(ref, selector) {
169388
- if (!ref?.shadowRoot) {
169389
- return;
169390
- }
169391
- if (ref.hasAttribute("hydrated") || ref.hasAttribute("calcite-hydrated")) {
169392
- setFocus(ref, selector);
169393
- return;
169394
- }
169395
- const mutationObserver = new MutationObserver(() => {
169396
- mutationObserver.disconnect();
169397
- setFocus(ref, selector);
169398
- });
169399
- mutationObserver.observe(ref, {
169400
- attributes: true,
169401
- attributeFilter: ["hydrated", "calcite-hydrated"]
169402
- });
169403
- }
169404
-
169405
- // src/errors.ts
169406
- function safeCall(callback, thisContext, ...rest) {
169407
- try {
169408
- return callback?.call(thisContext, ...rest);
169409
- } catch (error) {
169410
- console.error(error, callback);
169411
- }
169412
- return void 0;
169413
- }
169414
- async function safeAsyncCall(callback, thisContext, ...rest) {
169415
- try {
169416
- const result = callback?.call(thisContext, ...rest);
169417
- return result instanceof Promise ? await result : result;
169418
- } catch (error) {
169419
- console.error(error, callback);
169420
- }
169421
- return void 0;
169422
- }
169423
-
169424
- // src/guid.ts
169425
- function gen(count) {
169426
- let out = "";
169427
- for (let i = 0; i < count; i++) {
169428
- out += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
169429
- }
169430
- return out;
169431
- }
169432
- function generateGuid() {
169433
- return [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
169434
- }
169435
- var camelToKebab = (string) => string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : "-"}${upper.toLowerCase()}`);
169436
- var upperBeforeLower = /[A-Z]+(?![a-z])|[A-Z]/gu;
169437
- var capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1);
169438
- var camelToHuman = (string) => capitalize(string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : " "}${upper}`));
169439
-
169440
- // src/intl.ts
169441
- var supportedLocales = /* @__PURE__ */ new Set([
169442
- "ar",
169443
- "bg",
169444
- "bs",
169445
- "ca",
169446
- "cs",
169447
- "da",
169448
- "de",
169449
- "el",
169450
- "en",
169451
- "es",
169452
- "et",
169453
- "fi",
169454
- "fr",
169455
- "he",
169456
- "hr",
169457
- "hu",
169458
- "id",
169459
- "it",
169460
- "ja",
169461
- "ko",
169462
- "lt",
169463
- "lv",
169464
- "nl",
169465
- "nb",
169466
- "pl",
169467
- "pt-BR",
169468
- "pt-PT",
169469
- "ro",
169470
- "ru",
169471
- "sk",
169472
- "sl",
169473
- "sr",
169474
- "sv",
169475
- "th",
169476
- "tr",
169477
- "uk",
169478
- "vi",
169479
- "zh-CN",
169480
- "zh-HK",
169481
- "zh-TW"
169482
- ]);
169483
- var defaultLocale = "en";
169484
- async function fetchT9NStringsBundle(locale, assetsPath, prefix = "") {
169485
- const path = `${assetsPath}/${prefix}`;
169486
- const filePath = `${path}${locale}.json`;
169487
- t9nStringsCache[filePath] ?? (t9nStringsCache[filePath] = fetchBundle(locale, path));
169488
- return await t9nStringsCache[filePath];
169489
- }
169490
- var t9nStringsCache = {};
169491
- async function fetchBundle(locale, path) {
169492
- const filePath = `${path}${locale}.json`;
169493
- try {
169494
- const response = await fetch(filePath);
169495
- if (response.ok) {
169496
- return await response.json();
169497
- }
169498
- } catch (error) {
169499
- console.error(error);
169500
- return fallbackBundle;
169501
- }
169502
- if (locale === defaultLocale) {
169503
- return fallbackBundle;
169504
- }
169505
- return await fetchBundle(defaultLocale, path);
169506
- }
169507
- var fallbackBundle = new Proxy(
169508
- {},
169509
- {
169510
- get: (_target, property) => camelToHuman(property.toString())
169511
- }
169512
- );
169513
- function getElementLocales(element) {
169514
- const lang = getElementAttribute(element, "lang", navigator.language || defaultLocale);
169515
- if (supportedLocales.has(lang)) {
169516
- return { lang, t9nLocale: lang };
169517
- }
169518
- const rootCode = lang.slice(0, 2);
169519
- return { lang, t9nLocale: supportedLocales.has(rootCode) ? rootCode : defaultLocale };
169520
- }
169521
- function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
169522
- let result = void 0;
169523
- const callback = () => void updateComponentLocateState(element, assetsPath, assetName).then((newResult) => {
169524
- if (result?.lang !== newResult.lang || result.t9nLocale !== newResult.t9nLocale || result.t9nStrings !== newResult.t9nStrings) {
169525
- onUpdated(newResult);
169526
- }
169527
- result = newResult;
169528
- }).catch(console.error);
169529
- callback();
169530
- return observeAncestorsMutation(element, ["lang"], callback);
169531
- }
169532
- async function updateComponentLocateState(element, assetsPath, assetName = element.tagName.toLowerCase().replace("arcgis-", "")) {
169533
- const { lang, t9nLocale } = getElementLocales(element);
169534
- const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
169535
- const prefix = `${assetName}.t9n.`;
169536
- const t9nStrings = await fetchT9NStringsBundle(t9nLocale, t9nAssetsPath, prefix);
169537
- return { lang, t9nLocale, t9nStrings };
169538
- }
169539
-
169540
- // src/strings.ts
169541
- var doubleQuote = '"';
169542
- var singleQuote = "'";
169543
- function repeatString(value, n) {
169544
- return new Array(n + 1).join(value);
169545
- }
169546
- function quoteString(value) {
169547
- let quote = doubleQuote;
169548
- let alternateQuote = singleQuote;
169549
- const avoidEscape = value.includes(quote) && !value.includes(alternateQuote);
169550
- if (avoidEscape) {
169551
- alternateQuote = doubleQuote;
169552
- quote = singleQuote;
169553
- }
169554
- const alternateEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${alternateQuote})+)`, "gu");
169555
- value = value.replace(
169556
- alternateEscape,
169557
- (_, boundaryChar, leadingEscapedSlashes, escapedQuoteChars) => (
169558
- // We divide the escapedQuoteChars by 2 since there are 2 characters in each escaped part ('\\"'.length === 2)
169559
- boundaryChar + leadingEscapedSlashes + repeatString(alternateQuote, escapedQuoteChars.length / 2)
169560
- )
169561
- );
169562
- const quoteEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${quote}+)`, "gu");
169563
- value = value.replace(
169564
- quoteEscape,
169565
- (_, boundaryChar, leadingEscapedSlashes, quoteChars) => boundaryChar + leadingEscapedSlashes + repeatString(`\\${quote}`, quoteChars.length)
169566
- );
169567
- return quote + value + quote;
169568
- }
169569
- function createFilterExpression(filterWord) {
169570
- const sanitizedWord = filterWord ? filterWord.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu, "\\$&") : "^.*$";
169571
- return new RegExp(sanitizedWord, "i");
169572
- }
169573
- function setValuesInString(message, values = {}) {
169574
- return (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
169575
- }
169576
- function addLTRMark(value) {
169577
- return `\u200E${value ?? ""}\u200E`;
169578
- }
169579
-
169580
- // src/timeouts.ts
169581
- function devToolsAwareTimeout(callback, timeout) {
169582
- const interval = timeout > longTimeoutThreshold ? longTimeoutInterval : timeout / shortTimeoutIntervals;
169583
- let elapsed = 0;
169584
- const reference = setInterval(() => {
169585
- elapsed += interval;
169586
- if (elapsed >= timeout) {
169587
- clearInterval(reference);
169588
- callback();
169589
- }
169590
- }, interval);
169591
- return reference;
169592
- }
169593
- var longTimeoutThreshold = 4e3;
169594
- var longTimeoutInterval = 2e3;
169595
- var shortTimeoutIntervals = 4;
169596
-
169597
- // src/type-guards.ts
169598
- function isNotNull(item) {
169599
- return item !== null;
169600
- }
169601
- function isNotUndefined(item) {
169602
- return item !== void 0;
169603
- }
169604
-
169605
- // src/ui.ts
169606
- function debounce(func, waitFor = 100) {
169607
- let timeout;
169608
- return (...args) => {
169609
- const later = () => {
169610
- clearTimeout(timeout);
169611
- func(...args);
169612
- };
169613
- clearTimeout(timeout);
169614
- timeout = setTimeout(later, waitFor);
169615
- };
169616
- }
169617
-
169618
- // src/url.ts
169619
- function hasSameOrigin(url1, url2, ignoreProtocol = false) {
169620
- if (!url1 || !url2) {
169621
- return false;
169622
- }
169623
- const url1Obj = new URL(url1);
169624
- const url2Obj = new URL(url2);
169625
- if (!ignoreProtocol && url1Obj.protocol !== url2Obj.protocol) {
169626
- return false;
169627
- }
169628
- if (url1Obj.host == null || url2Obj.host == null) {
169629
- return false;
169630
- }
169631
- return url1Obj.host.toLowerCase() === url2Obj.host.toLowerCase() && url1Obj.port === url2Obj.port;
169632
- }
169633
- function isURL(url) {
169634
- try {
169635
- new URL(url);
169636
- return true;
169637
- } catch (e) {
169638
- return false;
169639
- }
169640
- }
169641
-
169642
- /**
169643
- * Filters a collection of items by the given keys and filter word.
169644
- */
169645
- function filterCollection(collection, keys, filterWord, beforeFilteringFn) {
169646
- if (!keys) {
169647
- return [];
169648
- }
169649
- const _keys = !Array.isArray(keys) ? [keys] : keys;
169650
- if (!_keys.length) {
169651
- return [];
169652
- }
169653
- const filterExpression = createFilterExpression(filterWord);
169654
- return collection.filter((item) => {
169655
- if (beforeFilteringFn) {
169656
- const res = beforeFilteringFn(item);
169657
- if (res !== null || res !== undefined) {
169658
- return res;
169659
- }
169660
- }
169661
- return _keys.some((key) => filterExpression.test(String(item[key] ?? "")));
169662
- });
169663
- }
169664
- /**
169665
- * Returns the url to the portal item.
169666
- */
169667
- function portalItemPageUrl(portalItem) {
169668
- if (!portalItem) {
169669
- return "";
169670
- }
169671
- return `${portalItem.portal.url}/home/item.html?id=${portalItem.id}`;
169672
- }
169673
- //#endregion
169674
-
169675
- /**
169676
- * Returns an icon name for the field type
169677
- */
169678
- function fieldTypeToIconName(field) {
169679
- switch (field.type) {
169680
- case "oid":
169681
- return "key";
169682
- case "small-integer":
169683
- case "big-integer":
169684
- case "integer":
169685
- case "single":
169686
- case "double":
169687
- case "long":
169688
- return "number";
169689
- case "global-id":
169690
- case "guid":
169691
- return "key";
169692
- case "string":
169693
- return "string";
169694
- case "date":
169695
- return "date-time";
169696
- case "date-only":
169697
- return "calendar";
169698
- case "time-only":
169699
- return "clock";
169700
- case "timestamp-offset":
169701
- return "time-zone";
169702
- default:
169703
- return "cube";
169704
- }
169705
- }
169706
- /**
169707
- * Returns the Arcade type for the given field.
169708
- */
169709
- function fieldTypeToArcadeType(field) {
169710
- switch (field.type) {
169711
- case "small-integer":
169712
- case "integer":
169713
- case "big-integer":
169714
- case "single":
169715
- case "double":
169716
- case "long":
169717
- case "oid":
169718
- return "number";
169719
- case "global-id":
169720
- case "guid":
169721
- case "string":
169722
- return "text";
169723
- case "date":
169724
- return "date";
169725
- case "date-only":
169726
- return "dateOnly";
169727
- case "time-only":
169728
- return "time";
169729
- default:
169730
- return "text";
169731
- }
169732
- }
169733
- function supportedFields(fields) {
169734
- return (fields ?? []).filter((field) => {
169735
- switch (field.type) {
169736
- case "string":
169737
- case "small-integer":
169738
- case "integer":
169739
- case "big-integer":
169740
- case "single":
169741
- case "double":
169742
- case "long":
169743
- case "date":
169744
- case "date-only":
169745
- case "time-only":
169746
- case "timestamp-offset":
169747
- case "oid":
169748
- case "guid":
169749
- case "global-id":
169750
- return true;
169751
- default:
169752
- return false;
169753
- }
169754
- });
169755
- }
169756
- function fieldAlias(field) {
169757
- return field.alias || field.name;
169758
- }
169759
-
169760
169766
  //#endregion
169761
169767
  //#region Support functions
169762
169768
  async function getRelatedFeatureLayer(layer, relationship) {
@@ -169772,14 +169778,6 @@ function sortFields(layer) {
169772
169778
  if (secondField.type === "oid") {
169773
169779
  return 1;
169774
169780
  }
169775
- if (isSubtypeSublayerInstance(layer)) {
169776
- if (firstField.name === layer.parent.subtypeField) {
169777
- return -1;
169778
- }
169779
- if (secondField.name === layer.parent.subtypeField) {
169780
- return 1;
169781
- }
169782
- }
169783
169781
  if (isSubtypeFieldCapableLayer(layer)) {
169784
169782
  if (firstField.name === layer.subtypeField) {
169785
169783
  return -1;
@@ -169817,86 +169815,28 @@ function assembleMemberExpression(obj, prop) {
169817
169815
  return `${obj}${getMemberExpressionProperty(prop)}`;
169818
169816
  }
169819
169817
  function getMapPortalItem(map) {
169820
- if (isWebMapInstance(map) || isWebSceneInstance(map)) {
169818
+ if (isPortalItemCapable(map)) {
169821
169819
  return map.portalItem;
169822
169820
  }
169823
169821
  return null;
169824
169822
  }
169825
- //#endregion
169826
- //#region Editor Profile to Language Service Profile functions
169827
- async function variablesToLSVariable(editorVariables, kind = main.exports.CompletionItemKind.Variable) {
169828
- return await Promise.all(editorVariables.map(async (editorVariable) => {
169829
- switch (editorVariable.type) {
169830
- case "dictionary":
169831
- return await dictionaryToLSDictionary(editorVariable, kind);
169832
- case "feature":
169833
- return await featureToLSFeature(editorVariable, kind);
169834
- default:
169835
- return variableToLSVariable(editorVariable, kind);
169836
- }
169837
- }));
169838
- }
169839
- function variableToLSVariable(editorVariable, kind) {
169840
- const { name, type } = editorVariable;
169841
- const description = editorVariable.getDescription();
169842
- return {
169843
- name,
169844
- description,
169845
- type,
169846
- completion: {
169847
- label: name,
169848
- detail: name,
169849
- insertText: name,
169850
- insertTextMode: main.exports.InsertTextMode.asIs,
169851
- insertTextFormat: main.exports.InsertTextFormat.PlainText,
169852
- kind,
169853
- documentation: { kind: "markdown", value: description },
169854
- },
169855
- };
169856
- }
169857
- async function featureToLSFeature(editorFeature, kind) {
169858
- // Get the source for the definition
169859
- const source = await editorFeature.loadSource();
169860
- const { name } = editorFeature;
169861
- const description = editorFeature.getDescription();
169862
- const resultCompletion = {
169863
- label: name,
169864
- detail: name,
169865
- insertText: name,
169866
- insertTextMode: main.exports.InsertTextMode.asIs,
169867
- insertTextFormat: main.exports.InsertTextFormat.PlainText,
169868
- kind,
169869
- };
169870
- const result = {
169871
- name,
169872
- description,
169873
- type: "dictionary",
169874
- properties: [],
169875
- completion: resultCompletion,
169876
- };
169877
- // No source definition, then it will be a feature without any known fields
169878
- if (!source) {
169879
- return result;
169880
- }
169881
- // Create properties for the fields and the aliases
169882
- // Also improve the feature completion documentation
169883
- let featureCompletionDescription = description;
169823
+ /**
169824
+ * converts fields to profile values and calculates the feature completion description all in one iteration
169825
+ */
169826
+ function fieldsToProfileValues(fields, initialFeatureCompletionDescription, includeAliases = false) {
169827
+ let featureCompletionDescription = initialFeatureCompletionDescription;
169884
169828
  const fieldProfileValues = [];
169885
169829
  const aliasProfileValues = [];
169886
- supportedFields(source.fields).forEach((field) => {
169887
- let fieldCompletionDescription = `**${field.name}** \n${field.type}`;
169888
- if (field.description) {
169889
- fieldCompletionDescription += ` \n'${field.description}`;
169890
- }
169830
+ supportedFields(fields).forEach((field) => {
169891
169831
  if (featureCompletionDescription) {
169892
169832
  featureCompletionDescription += " \n \n";
169893
169833
  }
169894
- featureCompletionDescription += `**${field.name}** (${fieldAlias(field)}) \n${field.type}`;
169834
+ featureCompletionDescription += `**${field.name}** (${field.alias}) \n${field.type}`;
169895
169835
  if (field.description) {
169896
169836
  featureCompletionDescription += ` \n'${field.description}`;
169897
169837
  }
169898
169838
  // The property for the field
169899
- const type = fieldTypeToArcadeType(field);
169839
+ const type = fieldTypeToApiValueVarType(field);
169900
169840
  const insertText = getMemberExpressionProperty(field.name, false);
169901
169841
  const description = fieldAlias(field);
169902
169842
  fieldProfileValues.push({
@@ -169910,65 +169850,35 @@ async function featureToLSFeature(editorFeature, kind) {
169910
169850
  insertTextMode: main.exports.InsertTextMode.asIs,
169911
169851
  insertTextFormat: main.exports.InsertTextFormat.PlainText,
169912
169852
  kind: main.exports.CompletionItemKind.Field,
169913
- documentation: { kind: "markdown", value: fieldCompletionDescription },
169914
169853
  },
169915
169854
  });
169916
- if (!field.alias || field.alias.toLowerCase() === field.name.toLowerCase()) {
169917
- return;
169918
- }
169919
- // The property for the alias if different than the field name
169920
- let aliasCompletionDescription = `**${field.alias}** \n${field.type}`;
169921
- if (field.description) {
169922
- aliasCompletionDescription += ` \n'${field.description}`;
169855
+ if (includeAliases) {
169856
+ if (!field.alias || field.alias.toLowerCase() === field.name.toLowerCase()) {
169857
+ return;
169858
+ }
169859
+ // The property for the alias if different than the field name
169860
+ let aliasCompletionDescription = `**${field.alias}** \n${field.type}`;
169861
+ if (field.description) {
169862
+ aliasCompletionDescription += ` \n'${field.description}`;
169863
+ }
169864
+ aliasProfileValues.push({
169865
+ name: field.alias,
169866
+ description: field.name,
169867
+ type,
169868
+ completion: {
169869
+ label: field.alias,
169870
+ detail: field.name,
169871
+ insertText,
169872
+ insertTextMode: main.exports.InsertTextMode.asIs,
169873
+ insertTextFormat: main.exports.InsertTextFormat.PlainText,
169874
+ kind: main.exports.CompletionItemKind.Field,
169875
+ documentation: { kind: "markdown", value: aliasCompletionDescription },
169876
+ },
169877
+ });
169923
169878
  }
169924
- aliasProfileValues.push({
169925
- name: field.alias,
169926
- description: field.name,
169927
- type,
169928
- completion: {
169929
- label: field.alias,
169930
- detail: field.name,
169931
- insertText,
169932
- insertTextMode: main.exports.InsertTextMode.asIs,
169933
- insertTextFormat: main.exports.InsertTextFormat.PlainText,
169934
- kind: main.exports.CompletionItemKind.Field,
169935
- documentation: { kind: "markdown", value: aliasCompletionDescription },
169936
- },
169937
- });
169938
169879
  });
169939
- result.properties = [...fieldProfileValues, ...aliasProfileValues];
169940
- resultCompletion.documentation = { kind: "markdown", value: featureCompletionDescription };
169941
- return result;
169942
- }
169943
- async function dictionaryToLSDictionary(editorDictionary, kind) {
169944
- const { name, dictionaryVariables: variables } = editorDictionary;
169945
- const description = editorDictionary.getDescription();
169946
- const completionDescription = variables.reduce((previous, p) => {
169947
- if (previous !== "") {
169948
- previous += " \n \n";
169949
- }
169950
- previous += `**${p.name}** \n${p.type}`;
169951
- const description = p.getDescription();
169952
- if (description) {
169953
- previous += ` \n${description}`;
169954
- }
169955
- return previous;
169956
- }, description);
169957
- return {
169958
- name,
169959
- description,
169960
- type: "dictionary",
169961
- properties: await variablesToLSVariable(variables, main.exports.CompletionItemKind.Field),
169962
- completion: {
169963
- label: name,
169964
- detail: name,
169965
- insertText: name,
169966
- insertTextMode: main.exports.InsertTextMode.asIs,
169967
- insertTextFormat: main.exports.InsertTextFormat.PlainText,
169968
- kind,
169969
- documentation: { kind: "markdown", value: completionDescription },
169970
- },
169971
- };
169880
+ const properties = [...fieldProfileValues, ...aliasProfileValues];
169881
+ return [properties, featureCompletionDescription];
169972
169882
  }
169973
169883
  /**
169974
169884
  * Represents a item in the EditorProfile. The profile is converted into an optimized way for
@@ -170502,7 +170412,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
170502
170412
  const relationshipsGroup = new GroupOfVariables(this._profile, { code: "relationships" });
170503
170413
  const relationshipItems = await Promise.all(source.relationships.map(async (relationship) => {
170504
170414
  const relatedLayer = await getRelatedFeatureLayer(source, relationship);
170505
- if (!isQueryableLayerInstance(relatedLayer)) {
170415
+ if (!isFeatureLayerLikeInstance(relatedLayer)) {
170506
170416
  return null;
170507
170417
  }
170508
170418
  if (relationship.relatedTableId === this.relationshipsProperties?.sourceTableId) {
@@ -170673,13 +170583,14 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170673
170583
  if (typeof this._featureSetCollections.source === "string") {
170674
170584
  return this._profile?.intlStrings.featureservice ?? "featureservice";
170675
170585
  }
170676
- if (isWebSceneInstance(this._featureSetCollections.source)) {
170677
- return this._profile?.intlStrings.webscene ?? "webscene";
170678
- }
170679
- if (isWebMapInstance(this._featureSetCollections.source)) {
170680
- return this._profile?.intlStrings.webmap ?? "webmap";
170586
+ switch (this._featureSetCollections.source.declaredClass) {
170587
+ case "esri.WebMap":
170588
+ return this._profile?.intlStrings.webmap ?? "webmap";
170589
+ case "esri.WebScene":
170590
+ return this._profile?.intlStrings.webscene ?? "webscene";
170591
+ default:
170592
+ return this._profile?.intlStrings.map ?? "map";
170681
170593
  }
170682
- return this._profile?.intlStrings.map ?? "map";
170683
170594
  }
170684
170595
  async loadSource() {
170685
170596
  if (isNotNull(this._loadPromise) && isNotUndefined(this._loadPromise)) {
@@ -170746,7 +170657,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170746
170657
  return null;
170747
170658
  }
170748
170659
  async _featureSetCollectionFromMap(map) {
170749
- if (isLoadableMapInstance(map)) {
170660
+ if (isLoadAllCapable(map)) {
170750
170661
  // Make sure the map is loaded
170751
170662
  await map.loadAll();
170752
170663
  }
@@ -170804,11 +170715,11 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170804
170715
  .toArray()
170805
170716
  .reverse()
170806
170717
  .forEach((layer) => {
170807
- if (isQueryableLayerInstance(layer)) {
170718
+ if (isFeatureLayerLikeInstance(layer)) {
170808
170719
  layerVariables.push(this._createFeatureSetVariable(layer, true));
170809
170720
  return;
170810
170721
  }
170811
- if (isGroupLayerInstance(layer)) {
170722
+ if (isGroupLayerCapable(layer)) {
170812
170723
  const groupLayerVariables = filteringTables
170813
170724
  ? this._convertWebMapLayersToVariables(layer.allTables, true)
170814
170725
  : this._convertWebMapLayersToVariables(layer.allLayers);
@@ -170817,31 +170728,31 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170817
170728
  });
170818
170729
  return layerVariables;
170819
170730
  }
170820
- _createFeatureSetVariable(featureLayer, isFromWebMap = false) {
170731
+ _createFeatureSetVariable(featureLayerLike, isFromWebMap = false) {
170821
170732
  return new FeatureSetVariable(this, {
170822
170733
  profile: this._profile,
170823
- declaration: { name: featureLayer.title, definition: featureLayer },
170734
+ declaration: { name: featureLayerLike.title, definition: featureLayerLike },
170824
170735
  label: isFromWebMap
170825
- ? featureLayer.title
170826
- : featureLayer.sourceJSON.name ?? featureLayer.title,
170736
+ ? featureLayerLike.title
170737
+ : featureLayerLike.sourceJSON.name ?? featureLayerLike.title,
170827
170738
  description: "",
170828
170739
  nonInteractive: true,
170829
- }, this._makeFeatureSetSnippets(featureLayer, isFromWebMap));
170740
+ }, this._makeFeatureSetSnippets(featureLayerLike, isFromWebMap));
170830
170741
  }
170831
- _makeFeatureSetSnippets(featureLayer, isFromWebMap = false) {
170742
+ _makeFeatureSetSnippets(featureLayerLike, isFromWebMap = false) {
170832
170743
  if (!this._profile?.supportFeatureSetFunctions) {
170833
170744
  return [];
170834
170745
  }
170835
170746
  if (isFromWebMap) {
170836
- const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.id}")`;
170837
- const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayer.title}")`;
170747
+ const snippetById = `FeatureSetById(${this.snippet}, "${featureLayerLike.id}")`;
170748
+ const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayerLike.title}")`;
170838
170749
  return [
170839
170750
  new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById }),
170840
170751
  new ValueVariable({ profile: this._profile, label: snippetByName, description: "", snippet: snippetByName }),
170841
170752
  ];
170842
170753
  }
170843
170754
  else {
170844
- const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.layerId}")`;
170755
+ const snippetById = `FeatureSetById(${this.snippet}, "${featureLayerLike.layerId}")`;
170845
170756
  return [new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById })];
170846
170757
  }
170847
170758
  }
@@ -170879,14 +170790,6 @@ class EditorProfile extends DictionaryVariable {
170879
170790
  get supportFeatureSetFunctions() {
170880
170791
  return this.definition?.bundles?.includes("data-access") ?? false;
170881
170792
  }
170882
- /**
170883
- * Returns the language service profile. It is different than the editor profile as it is optimized for Monaco.
170884
- */
170885
- async toLSProfile() {
170886
- const { apiVersion, bundles, hiddenApiItems } = this.definition ?? {};
170887
- const variables = await variablesToLSVariable(this.dictionaryVariables);
170888
- return { apiVersion, bundles, variables, hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()) };
170889
- }
170890
170793
  /**
170891
170794
  * Returns the EditorProfile as a json. The EditorProfile may have been updated. This function allows to
170892
170795
  * get the new json representing mutations.
@@ -170900,179 +170803,6 @@ class EditorProfile extends DictionaryVariable {
170900
170803
  }
170901
170804
  //#endregion
170902
170805
 
170903
- function isFeatureDefinition(item) {
170904
- return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
170905
- }
170906
- function isFeatureSetDefinition(item) {
170907
- return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
170908
- }
170909
- function isFeatureSetCollectionDefinition(item) {
170910
- return isPortalItemDefinition(item) || isMapInstance(item) || isSupportedServiceUrlDefinition(item);
170911
- }
170912
- /**
170913
- * Get a PredefinedProfile for a locale. If not already loaded then fetch it.
170914
- * If the locale doesn't exist or the locale profile file doesn't exist then returns
170915
- * the english version of the profile.
170916
- */
170917
- async function getSdkPredefinedProfiles(locale = "en") {
170918
- const profiles = sdkPredefinedProfilesMap.get(locale);
170919
- if (profiles) {
170920
- return profiles;
170921
- }
170922
- if (!supportedLocales.has(locale)) {
170923
- return await getSdkPredefinedProfiles("en");
170924
- }
170925
- try {
170926
- const response = await fetch(index.getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
170927
- if (response.ok) {
170928
- return cacheSdkPredefinedProfiles(locale, (await response.json()));
170929
- }
170930
- if (locale === "en") {
170931
- return null;
170932
- }
170933
- return await getSdkPredefinedProfiles("en");
170934
- }
170935
- catch {
170936
- return null;
170937
- }
170938
- }
170939
- const sdkPredefinedProfilesMap = new Map();
170940
- /**
170941
- * Convert a stored profile into a PredefinedProfile and add it to the in-memory
170942
- * Map of profiles per locale.
170943
- */
170944
- function cacheSdkPredefinedProfiles(locale, profiles) {
170945
- const map = new Map();
170946
- profiles.forEach((profile) => {
170947
- map.set(profile.id, profile);
170948
- });
170949
- sdkPredefinedProfilesMap.set(locale, map);
170950
- return map;
170951
- }
170952
- async function getSdkPredefinedProfile(id, locale = "en") {
170953
- const profiles = await getSdkPredefinedProfiles(locale);
170954
- return profiles?.get(id) ?? null;
170955
- }
170956
- function isExtendedPredefinedProfileDefinition(item) {
170957
- return !!item && typeof item === "object" && "additionalVariables" in item && Array.isArray(item.additionalVariables);
170958
- }
170959
- function convertApiVariables(variables) {
170960
- return variables?.map(convertApiVariable);
170961
- }
170962
- function convertApiVariable(variable) {
170963
- switch (variable.type) {
170964
- case "dictionary":
170965
- return {
170966
- ...variable,
170967
- type: variable.type,
170968
- properties: convertApiVariables(variable.properties),
170969
- };
170970
- case "array": {
170971
- return {
170972
- ...variable,
170973
- type: variable.type,
170974
- elementType: { type: "number", name: "number" },
170975
- };
170976
- }
170977
- default:
170978
- return { ...variable, type: variable.type };
170979
- }
170980
- }
170981
- async function convertToEditorProfileDefinition(predefinedProfile, locale = "en") {
170982
- if (!isPredefinedProfile(predefinedProfile)) {
170983
- return undefined;
170984
- }
170985
- const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
170986
- if (!sdkPredefinedProfile) {
170987
- return undefined;
170988
- }
170989
- const editorProfile = {
170990
- bundles: [...sdkPredefinedProfile.bundles],
170991
- variables: [],
170992
- hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase()),
170993
- };
170994
- // Merge the SDK variables' definitions/properties with the predefined profile definitions.
170995
- sdkPredefinedProfile.variables.forEach((predefinedVariable) => {
170996
- // Don't include disabled variables
170997
- if (predefinedProfile.disabledVariables?.includes(predefinedVariable.name)) {
170998
- return;
170999
- }
171000
- // Try to get a definition from the predefined profile, for the variable that needs one.
171001
- const definition = predefinedProfile.definitions[predefinedVariable.name];
171002
- // Note: Something is weird with TS. The sdkVariables are being casted to the wrong type
171003
- // despite the type checking from the switch statement.
171004
- switch (predefinedVariable.type) {
171005
- case "dictionary": {
171006
- // For dictionary, we support properties overrride
171007
- return editorProfile.variables.push(convertApiVariable({
171008
- ...predefinedVariable,
171009
- type: predefinedVariable.type,
171010
- properties: Array.isArray(definition) ? [...definition] : predefinedVariable.properties,
171011
- }));
171012
- }
171013
- case "feature":
171014
- // If the definition is not valid, then we don't include it.
171015
- if (!isFeatureDefinition(definition)) {
171016
- return;
171017
- }
171018
- return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
171019
- case "featureSet":
171020
- // If the definition is not valid, then we don't include it.
171021
- if (!isFeatureSetDefinition(definition)) {
171022
- return;
171023
- }
171024
- return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
171025
- case "featureSetCollection":
171026
- // If the definition is not valid, then we don't include it.
171027
- if (!isFeatureSetCollectionDefinition(definition)) {
171028
- return;
171029
- }
171030
- return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
171031
- default:
171032
- return editorProfile.variables.push(convertApiVariable(predefinedVariable));
171033
- }
171034
- });
171035
- if (isExtendedPredefinedProfileDefinition(predefinedProfile)) {
171036
- editorProfile.variables.push(...(predefinedProfile.additionalVariables ?? []));
171037
- }
171038
- return editorProfile;
171039
- }
171040
-
171041
- /**
171042
- * Returns the arcade diagnostic service.
171043
- * Example:
171044
- * ```ts
171045
- * const diagnosticService = await getArcadeDiagnosticService();
171046
- * diagnosticService.onDidChangeDiagnostics(({uri, diaganostics }) => {
171047
- * // Filter the diagnostics for the uri of interest
171048
- * // Do something with the diagnostics
171049
- * });
171050
- * ```
171051
- */
171052
- async function getArcadeDiagnosticService() {
171053
- const mode = await getMode();
171054
- return mode.getArcadeDiagnosticService();
171055
- }
171056
- /**
171057
- * Returns the arcade worker for the model.
171058
- * Example:
171059
- * ```ts
171060
- * const arcadeWorker = await getArcadeWorker(model.uri);
171061
- * ```
171062
- * @returns arcade worker
171063
- */
171064
- async function getArcadeWorker(uri) {
171065
- const mode = await getMode();
171066
- return await mode.getArcadeWorker(uri);
171067
- }
171068
- /**
171069
- * Request the arcade mode
171070
- * @returns arcade mode module
171071
- */
171072
- async function getMode() {
171073
- return await Promise.resolve().then(function () { return require('./arcade-mode-b85ae7d4.js'); });
171074
- }
171075
-
171076
170806
  // this file contains the building blocks for a language default provider
171077
170807
  const defaultContext = {
171078
170808
  locale: "en",
@@ -171114,20 +170844,11 @@ class LanguageDefaultsBase {
171114
170844
  return this._languageOptions;
171115
170845
  }
171116
170846
  /**
171117
- * Dispose the editor profile for the given model id.
171118
- * It is the responsibility of the caller that created the editor profile to dispose it.
171119
- * @param modelId The model id for which to dispose the editor profile.
170847
+ * Dispose any cached resources for the model
171120
170848
  */
171121
- disposeEditorProfileForModel(modelId) {
170849
+ disposeForModel(modelId) {
171122
170850
  const key = this._getApiKey(modelId);
171123
170851
  this._profileMap.delete(key);
171124
- }
171125
- /**
171126
- * Dispose the api context for the given model id.
171127
- * @param modelId The model id for which to dispose the api context.
171128
- */
171129
- disposeApiContextForModel(modelId) {
171130
- const key = this._getApiKey(modelId);
171131
170852
  if (this._apiContextMap.delete(key)) {
171132
170853
  this._fireModelContextDidChange(key);
171133
170854
  }
@@ -171168,100 +170889,37 @@ class LanguageDefaultsBase {
171168
170889
  }
171169
170890
  }
171170
170891
 
171171
- const arcadeLanguageId = "arcade";
171172
- class ArcadeLanguageServiceDefaults extends LanguageDefaultsBase {
171173
- constructor() {
171174
- super(...arguments);
171175
- this._languageId = arcadeLanguageId;
171176
- this._languageOptions = {};
171177
- }
171178
- /**
171179
- * Create an EditorProfile for the given model id using the given definition and locale.
171180
- * The EditorProfile is used by the the Arcade Language service as well by the cosing components.
171181
- * The definition can be a pre-defined profile or an editor profile definition.
171182
- * If the locale is not provided then the 'en' locale is used.
171183
- * @param modelId The model id for which to create the context.
171184
- * @param definition The definition to use for the model context.
171185
- * @param locale The locale to use for the model context.
171186
- * @returns The EditorProfile for the model.
171187
- */
171188
- async setProfileForModel(modelId, definition, apiContext = { locale: "en" }) {
171189
- // Convert pre-defined profile to a runtime profile
171190
- if (isPredefinedProfile(definition)) {
171191
- definition = await convertToEditorProfileDefinition(definition, apiContext.locale);
171192
- }
171193
- const intlStrings = await fetchT9NStringsBundle(apiContext.locale, index.getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
171194
- if (!intlStrings) {
171195
- throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
171196
- }
171197
- this.disposeEditorProfileForModel(modelId);
171198
- const key = this._getApiKey(modelId);
171199
- const editorProfile = new EditorProfile(definition, intlStrings);
171200
- this._profileMap.set(key, editorProfile);
171201
- const apiProfile = await editorProfile.toLSProfile();
171202
- this.updateApiContextForModel(modelId, {
171203
- locale: apiContext.locale,
171204
- profile: apiProfile,
171205
- snippets: apiContext.snippets,
171206
- });
171207
- }
171208
- /**
171209
- * Set or update the Arcade language service options.
171210
- * @param languageOptions The language options to set.
171211
- */
171212
- setLanguageOptions(languageOptions = {}) {
171213
- // Check if options have actually changed.
171214
- // Avoid restarting the worker when no updates.
171215
- // Today we only have the 'assetsPath' as a property
171216
- if (this._languageOptions.assetsPath === languageOptions.assetsPath) {
171217
- return;
171218
- }
171219
- this._languageOptions = { ...this._languageOptions, ...languageOptions };
171220
- this._onDidChange.fire(this);
171221
- }
171222
- /**
171223
- * Gets the API library for the given model id.
171224
- * @param modelId The model id for which to get the API library.
171225
- * @returns The API library for the model.
171226
- */
171227
- async getApiLibrary(modelId) {
171228
- const uri = Uri.parse(modelId);
171229
- const worker = await getArcadeWorker(uri);
171230
- return await worker.getApiLibrary(this.getApiContextForModel(uri));
171231
- }
171232
- }
171233
- const arcadeDefaults = new ArcadeLanguageServiceDefaults();
171234
- const arcade = {
171235
- setProfileForModel: arcadeDefaults.setProfileForModel.bind(arcadeDefaults),
171236
- };
171237
-
171238
170892
  exports.Deferred = Deferred;
170893
+ exports.EditorProfile = EditorProfile;
171239
170894
  exports.Emitter = Emitter;
171240
170895
  exports.IStandaloneThemeService = IStandaloneThemeService;
171241
170896
  exports.KeyCode = KeyCode;
171242
170897
  exports.KeyMod = KeyMod;
170898
+ exports.LanguageDefaultsBase = LanguageDefaultsBase;
171243
170899
  exports.MarkerSeverity = MarkerSeverity;
171244
170900
  exports.Range = Range;
171245
170901
  exports.Uri = Uri;
171246
170902
  exports.addLTRMark = addLTRMark;
171247
- exports.arcade = arcade;
171248
- exports.arcadeDefaults = arcadeDefaults;
171249
- exports.camelToKebab = camelToKebab;
171250
170903
  exports.commonjsGlobal = commonjsGlobal;
171251
170904
  exports.createFilterExpression = createFilterExpression;
171252
170905
  exports.debounce = debounce;
171253
170906
  exports.devToolsAwareTimeout = devToolsAwareTimeout;
171254
170907
  exports.editor = editor;
170908
+ exports.fetchT9nStringsBundle = fetchT9nStringsBundle;
170909
+ exports.fieldsToProfileValues = fieldsToProfileValues;
171255
170910
  exports.filterCollection = filterCollection;
171256
170911
  exports.generateGuid = generateGuid;
171257
170912
  exports.generateTokensCSSForColorMap = generateTokensCSSForColorMap;
171258
- exports.getArcadeDiagnosticService = getArcadeDiagnosticService;
171259
170913
  exports.getElementLocales = getElementLocales;
171260
170914
  exports.getElementTheme = getElementTheme;
171261
- exports.getMode = getMode;
171262
170915
  exports.hasSameOrigin = hasSameOrigin;
171263
170916
  exports.importArcade = importArcade;
171264
170917
  exports.importRequest = importRequest;
170918
+ exports.isFeatureDefinition = isFeatureDefinition;
170919
+ exports.isFeatureSetCollectionDefinition = isFeatureSetCollectionDefinition;
170920
+ exports.isFeatureSetDefinition = isFeatureSetDefinition;
170921
+ exports.isNotUndefined = isNotUndefined;
170922
+ exports.isPredefinedProfile = isPredefinedProfile;
171265
170923
  exports.isURL = isURL;
171266
170924
  exports.languages = languages;
171267
170925
  exports.main = main;
@@ -171274,4 +170932,5 @@ exports.setFocusOnElement = setFocusOnElement;
171274
170932
  exports.setValuesInString = setValuesInString;
171275
170933
  exports.startLocaleObserver = startLocaleObserver;
171276
170934
  exports.supportedFields = supportedFields;
170935
+ exports.supportedLocales = supportedLocales;
171277
170936
  exports.typescriptDefaults = typescriptDefaults;