chunk-4NKD334K.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. import {
  2. p as p2
  3. } from "./chunk-65K7LC56.js";
  4. import {
  5. d as d2
  6. } from "./chunk-ATPLLI5W.js";
  7. import {
  8. l
  9. } from "./chunk-XH7RUGVZ.js";
  10. import {
  11. m as m2
  12. } from "./chunk-TBBTRX4O.js";
  13. import {
  14. U,
  15. r as r3
  16. } from "./chunk-VNFRAYHO.js";
  17. import {
  18. n as n2
  19. } from "./chunk-R5IG2D6H.js";
  20. import {
  21. M2 as M,
  22. o
  23. } from "./chunk-ECW2QABR.js";
  24. import {
  25. d,
  26. e,
  27. n2 as n,
  28. u2 as u,
  29. y3 as y
  30. } from "./chunk-Y3WMVFTW.js";
  31. import {
  32. b
  33. } from "./chunk-IHXECKQQ.js";
  34. import {
  35. f,
  36. m,
  37. p,
  38. w
  39. } from "./chunk-ULGDPLM2.js";
  40. import {
  41. r as r2,
  42. s3 as s
  43. } from "./chunk-EMJ4ZSM2.js";
  44. import {
  45. r
  46. } from "./chunk-GZT4BVFP.js";
  47. // node_modules/@arcgis/core/portal/PortalQueryResult.js
  48. var e2 = class extends y {
  49. constructor(r4) {
  50. super(r4), this.nextQueryParams = null, this.queryParams = null, this.results = null, this.total = null;
  51. }
  52. };
  53. e([d()], e2.prototype, "nextQueryParams", void 0), e([d()], e2.prototype, "queryParams", void 0), e([d()], e2.prototype, "results", void 0), e([d()], e2.prototype, "total", void 0), e2 = e([n("esri.portal.PortalQueryResult")], e2);
  54. var p3 = e2;
  55. // node_modules/@arcgis/core/portal/Portal.js
  56. var G;
  57. var O;
  58. var U2 = { PortalGroup: () => import("./PortalGroup-D7OB5LSW.js"), PortalItem: () => import("./PortalItem-VBDEEBID.js"), PortalUser: () => import("./PortalUser-LHCQVD2S.js") };
  59. var j = G = class extends u(m2) {
  60. constructor(e3) {
  61. super(e3), this.access = null, this.allSSL = false, this.authMode = "auto", this.authorizedCrossOriginDomains = null, this.basemapGalleryGroupQuery = null, this.bingKey = null, this.canListApps = false, this.canListData = false, this.canListPreProvisionedItems = false, this.canProvisionDirectPurchase = false, this.canSearchPublic = true, this.canShareBingPublic = false, this.canSharePublic = false, this.canSignInArcGIS = false, this.canSignInIDP = false, this.colorSetsGroupQuery = null, this.commentsEnabled = false, this.created = null, this.culture = null, this.customBaseUrl = null, this.defaultBasemap = null, this.defaultDevBasemap = null, this.defaultExtent = null, this.defaultVectorBasemap = null, this.description = null, this.devBasemapGalleryGroupQuery = null, this.eueiEnabled = null, this.featuredGroups = null, this.featuredItemsGroupQuery = null, this.galleryTemplatesGroupQuery = null, this.livingAtlasGroupQuery = null, this.hasCategorySchema = false, this.helperServices = null, this.homePageFeaturedContent = null, this.homePageFeaturedContentCount = null, this.httpPort = null, this.httpsPort = null, this.id = null, this.ipCntryCode = null, this.isPortal = false, this.isReadOnly = false, this.layerTemplatesGroupQuery = null, this.maxTokenExpirationMinutes = null, this.modified = null, this.name = null, this.portalHostname = null, this.portalMode = null, this.portalProperties = null, this.region = null, this.rotatorPanels = null, this.showHomePageDescription = false, this.sourceJSON = null, this.supportsHostedServices = false, this.symbolSetsGroupQuery = null, this.templatesGroupQuery = null, this.units = null, this.url = r2.portalUrl, this.urlKey = null, this.user = null, this.useStandardizedQuery = false, this.useVectorBasemaps = false, this.vectorBasemapGalleryGroupQuery = null;
  62. }
  63. normalizeCtorArgs(e3) {
  64. return typeof e3 == "string" ? { url: e3 } : e3;
  65. }
  66. destroy() {
  67. this._esriId_credentialCreateHandle && (this._esriId_credentialCreateHandle.remove(), this._esriId_credentialCreateHandle = null);
  68. }
  69. readAuthorizedCrossOriginDomains(e3) {
  70. if (e3)
  71. for (const r4 of e3)
  72. r2.request.trustedServers.includes(r4) || r2.request.trustedServers.push(r4);
  73. return e3;
  74. }
  75. readDefaultBasemap(e3) {
  76. return this._readBasemap(e3);
  77. }
  78. readDefaultDevBasemap(e3) {
  79. return this._readBasemap(e3);
  80. }
  81. readDefaultVectorBasemap(e3) {
  82. return this._readBasemap(e3);
  83. }
  84. get extraQuery() {
  85. const e3 = !(this.user && this.user.orgId) || this.canSearchPublic;
  86. return this.id && !e3 ? ` AND orgid:${this.id}` : null;
  87. }
  88. get isOrganization() {
  89. return !!this.access;
  90. }
  91. get restUrl() {
  92. let e3 = this.url;
  93. if (e3) {
  94. const t = e3.indexOf("/sharing");
  95. e3 = t > 0 ? e3.substring(0, t) : this.url.replace(/\/+$/, ""), e3 += "/sharing/rest";
  96. }
  97. return e3;
  98. }
  99. get thumbnailUrl() {
  100. const e3 = this.restUrl, t = this.thumbnail;
  101. return e3 && t ? this._normalizeSSL(e3 + "/portals/self/resources/" + t) : null;
  102. }
  103. readUrlKey(e3) {
  104. return e3 ? e3.toLowerCase() : e3;
  105. }
  106. readUser(e3) {
  107. let t = null;
  108. return e3 && (t = p2.fromJSON(e3), t.portal = this), t;
  109. }
  110. load(e3) {
  111. const t = import("./Basemap-TZ3SGI2Y.js").then(({ default: t2 }) => {
  112. f(e3), O = t2;
  113. }).then(() => this.sourceJSON ? this.sourceJSON : this._fetchSelf(this.authMode, false, e3)).then((e4) => {
  114. if (n2) {
  115. const e5 = n2;
  116. this.credential = e5.findCredential(this.restUrl), this.credential || this.authMode !== G.AUTH_MODE_AUTO || (this._esriId_credentialCreateHandle = e5.on("credential-create", () => {
  117. e5.findCredential(this.restUrl) && this._signIn();
  118. }));
  119. }
  120. this.sourceJSON = e4, this.read(e4);
  121. });
  122. return this.addResolvingPromise(t), Promise.resolve(this);
  123. }
  124. async createElevationLayers() {
  125. await this.load();
  126. const e3 = this._getHelperService("defaultElevationLayers"), t = (await import("./ElevationLayer-AEMRYKQF.js")).default;
  127. return e3 ? e3.map((e4) => new t({ id: e4.id, url: e4.url })) : [];
  128. }
  129. fetchBasemaps(e3, r4) {
  130. const o2 = new d2();
  131. return o2.query = e3 || (r2.apiKey && r3(this.url) ? this.devBasemapGalleryGroupQuery : this.useVectorBasemaps ? this.vectorBasemapGalleryGroupQuery : this.basemapGalleryGroupQuery), o2.disableExtraQuery = true, this.queryGroups(o2, r4).then((e4) => {
  132. if (o2.num = 100, o2.query = 'type:"Web Map" -type:"Web Application"', e4.total) {
  133. const t = e4.results[0];
  134. return o2.sortField = t.sortField || "name", o2.sortOrder = t.sortOrder || "desc", t.queryItems(o2, r4);
  135. }
  136. return null;
  137. }).then((e4) => {
  138. let t;
  139. return t = e4 && e4.total ? e4.results.filter((e5) => e5.type === "Web Map").map((e5) => new O({ portalItem: e5 })) : [], t;
  140. });
  141. }
  142. fetchCategorySchema(e3) {
  143. return this.hasCategorySchema ? this._request(this.restUrl + "/portals/self/categorySchema", e3).then((e4) => e4.categorySchema) : p(e3) ? Promise.reject(m()) : Promise.resolve([]);
  144. }
  145. fetchFeaturedGroups(e3) {
  146. const t = this.featuredGroups, r4 = new d2();
  147. if (r4.num = 100, r4.sortField = "title", t && t.length) {
  148. const o2 = [];
  149. for (const e4 of t)
  150. o2.push(`(title:"${e4.title}" AND owner:${e4.owner})`);
  151. return r4.query = o2.join(" OR "), this.queryGroups(r4, e3).then((e4) => e4.results);
  152. }
  153. return p(e3) ? Promise.reject(m()) : Promise.resolve([]);
  154. }
  155. fetchRegions(e3) {
  156. const t = this.user?.culture || this.culture || l();
  157. return this._request(this.restUrl + "/portals/regions", { ...e3, query: { culture: t } });
  158. }
  159. fetchSettings(e3) {
  160. const t = this.user?.culture || this.culture || l();
  161. return this._request(this.restUrl + "/portals/self/settings", { ...e3, query: { culture: t } });
  162. }
  163. static getDefault() {
  164. return G._default && !G._default.destroyed || (G._default = new G()), G._default;
  165. }
  166. queryGroups(e3, t) {
  167. return this._queryPortal("/community/groups", e3, "PortalGroup", t);
  168. }
  169. queryItems(e3, t) {
  170. return this._queryPortal("/search", e3, "PortalItem", t);
  171. }
  172. queryUsers(e3, t) {
  173. return e3.sortField || (e3.sortField = "username"), this._queryPortal("/community/users", e3, "PortalUser", t);
  174. }
  175. toJSON() {
  176. throw new s("internal:not-yet-implemented", "Portal.toJSON is not yet implemented");
  177. }
  178. static fromJSON(e3) {
  179. if (!e3)
  180. return null;
  181. if (e3.declaredClass)
  182. throw new Error("JSON object is already hydrated");
  183. return new G({ sourceJSON: e3 });
  184. }
  185. _getHelperService(e3) {
  186. const t = this.helperServices && this.helperServices[e3];
  187. if (!t)
  188. throw new s("portal:service-not-found", `The \`helperServices\` do not include an entry named "${e3}"`);
  189. return t;
  190. }
  191. _getHelperServiceUrl(e3) {
  192. const t = this._getHelperService(e3);
  193. if (!t.url)
  194. throw new s("portal:service-url-not-found", `The \`helperServices\` entry "${e3}" does not include a \`url\` value`);
  195. return t.url;
  196. }
  197. _fetchSelf(e3 = this.authMode, t = false, r4) {
  198. const o2 = this.restUrl + "/portals/self", s2 = { authMode: e3, query: { culture: l().toLowerCase() }, ...r4 };
  199. return s2.authMode === "auto" && (s2.authMode = "no-prompt"), t && (s2.query.default = true), this._request(o2, s2);
  200. }
  201. _queryPortal(e3, t, r4, o2) {
  202. const s2 = b(d2, t), i = (t2) => this._request(this.restUrl + e3, { ...s2.toRequestOptions(this), ...o2 }).then((e4) => {
  203. const r5 = s2.clone();
  204. return r5.start = e4.nextStart, new p3({ nextQueryParams: r5, queryParams: s2, total: e4.total, results: G._resultsToTypedArray(t2, { portal: this }, e4, o2) });
  205. }).then((e4) => Promise.all(e4.results.map((t3) => typeof t3.when == "function" ? t3.when() : e4)).then(() => e4, (t3) => (w(t3), e4)));
  206. return r4 && U2[r4] ? U2[r4]().then(({ default: e4 }) => (f(o2), i(e4))) : i();
  207. }
  208. _signIn() {
  209. if (this.authMode === G.AUTH_MODE_ANONYMOUS)
  210. return Promise.reject(new s("portal:invalid-auth-mode", `Current "authMode"' is "${this.authMode}"`));
  211. if (this.loadStatus === "failed")
  212. return Promise.reject(this.loadError);
  213. const e3 = (e4) => Promise.resolve().then(() => this.loadStatus === "not-loaded" ? (e4 || (this.authMode = "immediate"), this.load().then(() => null)) : this.loadStatus === "loading" ? this.load().then(() => this.credential ? null : (this.credential = e4, this._fetchSelf("immediate"))) : this.user && this.credential === e4 ? null : (this.credential = e4, this._fetchSelf("immediate"))).then((e5) => {
  214. e5 && (this.sourceJSON = e5, this.read(e5));
  215. });
  216. return n2 ? n2.getCredential(this.restUrl).then((t) => e3(t)) : e3(this.credential);
  217. }
  218. _normalizeSSL(e3) {
  219. return e3.replace(/^http:/i, "https:").replace(":7080", ":7443");
  220. }
  221. _normalizeUrl(e3) {
  222. const t = this.credential && this.credential.token;
  223. return this._normalizeSSL(t ? e3 + (e3.includes("?") ? "&" : "?") + "token=" + t : e3);
  224. }
  225. _requestToTypedArray(e3, t, r4) {
  226. return this._request(e3, t).then((e4) => {
  227. const t2 = G._resultsToTypedArray(r4, { portal: this }, e4);
  228. return Promise.all(t2.map((t3) => typeof t3.when == "function" ? t3.when() : e4)).then(() => t2, () => t2);
  229. });
  230. }
  231. _readBasemap(e3) {
  232. if (e3) {
  233. const t = O.fromJSON(e3);
  234. return t.portalItem = { portal: this }, t;
  235. }
  236. return null;
  237. }
  238. _request(e3, t = {}) {
  239. const r4 = { f: "json", ...t.query }, { authMode: s2 = this.authMode === G.AUTH_MODE_ANONYMOUS ? "anonymous" : "auto", body: i = null, cacheBust: a = false, method: l2 = "auto", responseType: u2 = "json", signal: n3 } = t, p4 = { authMode: s2, body: i, cacheBust: a, method: l2, query: r4, responseType: u2, timeout: 0, signal: n3 };
  240. return U(this._normalizeSSL(e3), p4).then((e4) => e4.data);
  241. }
  242. static _resultsToTypedArray(e3, t, r4, o2) {
  243. let s2;
  244. if (r4) {
  245. const i = r(o2) ? o2.signal : null;
  246. s2 = r4.listings || r4.notifications || r4.userInvitations || r4.tags || r4.items || r4.groups || r4.comments || r4.provisions || r4.results || r4.relatedItems || r4, (e3 || t) && (s2 = s2.map((r5) => {
  247. const o3 = Object.assign(e3 ? e3.fromJSON(r5) : r5, t);
  248. return typeof o3.load == "function" && o3.load(i), o3;
  249. }));
  250. } else
  251. s2 = [];
  252. return s2;
  253. }
  254. };
  255. j.AUTH_MODE_ANONYMOUS = "anonymous", j.AUTH_MODE_AUTO = "auto", j.AUTH_MODE_IMMEDIATE = "immediate", e([d()], j.prototype, "access", void 0), e([d()], j.prototype, "allSSL", void 0), e([d()], j.prototype, "authMode", void 0), e([d()], j.prototype, "authorizedCrossOriginDomains", void 0), e([o("authorizedCrossOriginDomains")], j.prototype, "readAuthorizedCrossOriginDomains", null), e([d()], j.prototype, "basemapGalleryGroupQuery", void 0), e([d()], j.prototype, "bingKey", void 0), e([d()], j.prototype, "canListApps", void 0), e([d()], j.prototype, "canListData", void 0), e([d()], j.prototype, "canListPreProvisionedItems", void 0), e([d()], j.prototype, "canProvisionDirectPurchase", void 0), e([d()], j.prototype, "canSearchPublic", void 0), e([d()], j.prototype, "canShareBingPublic", void 0), e([d()], j.prototype, "canSharePublic", void 0), e([d()], j.prototype, "canSignInArcGIS", void 0), e([d()], j.prototype, "canSignInIDP", void 0), e([d()], j.prototype, "colorSetsGroupQuery", void 0), e([d()], j.prototype, "commentsEnabled", void 0), e([d({ type: Date })], j.prototype, "created", void 0), e([d()], j.prototype, "credential", void 0), e([d()], j.prototype, "culture", void 0), e([d()], j.prototype, "currentVersion", void 0), e([d()], j.prototype, "customBaseUrl", void 0), e([d()], j.prototype, "defaultBasemap", void 0), e([o("defaultBasemap")], j.prototype, "readDefaultBasemap", null), e([d()], j.prototype, "defaultDevBasemap", void 0), e([o("defaultDevBasemap")], j.prototype, "readDefaultDevBasemap", null), e([d({ type: M })], j.prototype, "defaultExtent", void 0), e([d()], j.prototype, "defaultVectorBasemap", void 0), e([o("defaultVectorBasemap")], j.prototype, "readDefaultVectorBasemap", null), e([d()], j.prototype, "description", void 0), e([d()], j.prototype, "devBasemapGalleryGroupQuery", void 0), e([d()], j.prototype, "eueiEnabled", void 0), e([d({ readOnly: true })], j.prototype, "extraQuery", null), e([d()], j.prototype, "featuredGroups", void 0), e([d()], j.prototype, "featuredItemsGroupQuery", void 0), e([d()], j.prototype, "galleryTemplatesGroupQuery", void 0), e([d()], j.prototype, "livingAtlasGroupQuery", void 0), e([d()], j.prototype, "hasCategorySchema", void 0), e([d()], j.prototype, "helpBase", void 0), e([d()], j.prototype, "helperServices", void 0), e([d()], j.prototype, "helpMap", void 0), e([d()], j.prototype, "homePageFeaturedContent", void 0), e([d()], j.prototype, "homePageFeaturedContentCount", void 0), e([d()], j.prototype, "httpPort", void 0), e([d()], j.prototype, "httpsPort", void 0), e([d()], j.prototype, "id", void 0), e([d()], j.prototype, "ipCntryCode", void 0), e([d({ readOnly: true })], j.prototype, "isOrganization", null), e([d()], j.prototype, "isPortal", void 0), e([d()], j.prototype, "isReadOnly", void 0), e([d()], j.prototype, "layerTemplatesGroupQuery", void 0), e([d()], j.prototype, "maxTokenExpirationMinutes", void 0), e([d({ type: Date })], j.prototype, "modified", void 0), e([d()], j.prototype, "name", void 0), e([d()], j.prototype, "portalHostname", void 0), e([d()], j.prototype, "portalMode", void 0), e([d()], j.prototype, "portalProperties", void 0), e([d()], j.prototype, "region", void 0), e([d({ readOnly: true })], j.prototype, "restUrl", null), e([d()], j.prototype, "rotatorPanels", void 0), e([d()], j.prototype, "showHomePageDescription", void 0), e([d()], j.prototype, "sourceJSON", void 0), e([d()], j.prototype, "staticImagesUrl", void 0), e([d({ json: { name: "2DStylesGroupQuery" } })], j.prototype, "stylesGroupQuery2d", void 0), e([d({ json: { name: "stylesGroupQuery" } })], j.prototype, "stylesGroupQuery3d", void 0), e([d()], j.prototype, "supportsHostedServices", void 0), e([d()], j.prototype, "symbolSetsGroupQuery", void 0), e([d()], j.prototype, "templatesGroupQuery", void 0), e([d()], j.prototype, "thumbnail", void 0), e([d({ readOnly: true })], j.prototype, "thumbnailUrl", null), e([d()], j.prototype, "units", void 0), e([d()], j.prototype, "url", void 0), e([d()], j.prototype, "urlKey", void 0), e([o("urlKey")], j.prototype, "readUrlKey", null), e([d()], j.prototype, "user", void 0), e([o("user")], j.prototype, "readUser", null), e([d()], j.prototype, "useStandardizedQuery", void 0), e([d()], j.prototype, "useVectorBasemaps", void 0), e([d()], j.prototype, "vectorBasemapGalleryGroupQuery", void 0), j = G = e([n("esri.portal.Portal")], j);
  256. var B = j;
  257. export {
  258. B
  259. };
  260. //# sourceMappingURL=chunk-4NKD334K.js.map