chunk-VBRY5KJM.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. import {
  2. r as r2,
  3. s,
  4. s3 as s2
  5. } from "./chunk-EMJ4ZSM2.js";
  6. import {
  7. q,
  8. r,
  9. t
  10. } from "./chunk-GZT4BVFP.js";
  11. // node_modules/@arcgis/core/core/urlUtils.js
  12. var s3 = s.getLogger("esri.core.urlUtils");
  13. var u = r2.request;
  14. var c = "esri/config: esriConfig.request.proxyUrl is not set.";
  15. var l = /^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i;
  16. var f = /^\s*http:/i;
  17. var a = /^\s*https:/i;
  18. var h = /^\s*file:/i;
  19. var p = /:\d+$/;
  20. var d = /^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i;
  21. var g = new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$");
  22. var m = new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");
  23. var y = class {
  24. constructor(t2 = "") {
  25. this.uri = t2, this.scheme = null, this.authority = null, this.path = null, this.query = null, this.fragment = null, this.user = null, this.password = null, this.host = null, this.port = null;
  26. let n = q(this.uri.match(g));
  27. this.scheme = n[2] || (n[1] ? "" : null), this.authority = n[4] || (n[3] ? "" : null), this.path = n[5], this.query = n[7] || (n[6] ? "" : null), this.fragment = n[9] || (n[8] ? "" : null), this.authority != null && (n = q(this.authority.match(m)), this.user = n[3] || null, this.password = n[4] || null, this.host = n[6] || n[7], this.port = n[9] || null);
  28. }
  29. toString() {
  30. return this.uri;
  31. }
  32. };
  33. var $ = {};
  34. var x = new y(r2.applicationUrl);
  35. var w = x;
  36. var O = q2();
  37. var U = O;
  38. var b = () => w;
  39. var C = () => U;
  40. function q2() {
  41. const t2 = q(w.path), n = t2.substring(0, t2.lastIndexOf(t2.split("/")[t2.split("/").length - 1]));
  42. return `${`${w.scheme}://${w.host}${w.port != null ? `:${w.port}` : ""}`}${n}`;
  43. }
  44. function j(t2) {
  45. const n = { path: null, query: null }, e = new y(t2), r3 = t2.indexOf("?");
  46. return e.query === null ? n.path = t2 : (n.path = t2.substring(0, r3), n.query = v(e.query)), e.fragment && (n.hash = e.fragment, e.query === null && (n.path = n.path.substring(0, n.path.length - (e.fragment.length + 1)))), n;
  47. }
  48. function v(t2) {
  49. const n = t2.split("&"), e = {};
  50. for (const r3 of n) {
  51. if (!r3)
  52. continue;
  53. const t3 = r3.indexOf("=");
  54. let n2, o;
  55. t3 < 0 ? (n2 = decodeURIComponent(r3), o = "") : (n2 = decodeURIComponent(r3.slice(0, t3)), o = decodeURIComponent(r3.slice(t3 + 1)));
  56. let i = e[n2];
  57. typeof i == "string" && (i = e[n2] = [i]), Array.isArray(i) ? i.push(o) : e[n2] = o;
  58. }
  59. return e;
  60. }
  61. function L(t2) {
  62. return t2 && typeof t2 == "object" && "toJSON" in t2 && typeof t2.toJSON == "function";
  63. }
  64. function I(t2, n) {
  65. return t2 ? n && typeof n == "function" ? Object.keys(t2).map((e) => encodeURIComponent(e) + "=" + encodeURIComponent(n(e, t2[e]))).join("&") : Object.keys(t2).map((e) => {
  66. const r3 = t2[e];
  67. if (r3 == null)
  68. return "";
  69. const o = encodeURIComponent(e) + "=", i = n && n[e];
  70. return i ? o + encodeURIComponent(i(r3)) : Array.isArray(r3) ? r3.map((t3) => L(t3) ? o + encodeURIComponent(JSON.stringify(t3)) : o + encodeURIComponent(t3)).join("&") : L(r3) ? o + encodeURIComponent(JSON.stringify(r3)) : o + encodeURIComponent(r3);
  71. }).filter((t3) => t3).join("&") : "";
  72. }
  73. function A(t2 = false) {
  74. let e, r3 = u.proxyUrl;
  75. if (typeof t2 == "string") {
  76. e = ht(t2);
  77. const n = J(t2);
  78. n && (r3 = n.proxyUrl);
  79. } else
  80. e = !!t2;
  81. if (!r3)
  82. throw s3.warn(c), new s2("urlutils:proxy-not-set", c);
  83. e && $t() && (r3 = mt(r3));
  84. return j(r3);
  85. }
  86. function S(t2) {
  87. const n = J(t2);
  88. let e, r3;
  89. if (n) {
  90. const t3 = P(n.proxyUrl);
  91. e = t3.path, r3 = t3.query ? v(t3.query) : null;
  92. }
  93. if (e) {
  94. const n2 = j(t2);
  95. t2 = e + "?" + n2.path;
  96. const o = I({ ...r3, ...n2.query });
  97. o && (t2 = `${t2}?${o}`);
  98. }
  99. return t2;
  100. }
  101. var B = { path: "", query: "" };
  102. function P(t2) {
  103. const n = t2.indexOf("?");
  104. return n !== -1 ? (B.path = t2.slice(0, n), B.query = t2.slice(n + 1)) : (B.path = t2, B.query = null), B;
  105. }
  106. function k(t2) {
  107. return t2 = (t2 = xt(t2 = bt(t2 = P(t2).path), true)).toLowerCase();
  108. }
  109. function E(t2) {
  110. const n = { proxyUrl: t2.proxyUrl, urlPrefix: k(t2.urlPrefix) }, e = u.proxyRules, r3 = n.urlPrefix;
  111. let o = e.length;
  112. for (let i = 0; i < e.length; i++) {
  113. const t3 = e[i].urlPrefix;
  114. if (r3.indexOf(t3) === 0) {
  115. if (r3.length === t3.length)
  116. return -1;
  117. o = i;
  118. break;
  119. }
  120. t3.indexOf(r3) === 0 && (o = i + 1);
  121. }
  122. return e.splice(o, 0, n), o;
  123. }
  124. function J(t2) {
  125. const n = u.proxyRules, e = k(t2);
  126. for (let r3 = 0; r3 < n.length; r3++)
  127. if (e.indexOf(n[r3].urlPrefix) === 0)
  128. return n[r3];
  129. }
  130. function N(t2, n) {
  131. return t2 = T(t2), n = T(n), xt(t2) === xt(n);
  132. }
  133. function T(t2) {
  134. const n = (t2 = F(t2)).indexOf("/sharing");
  135. return n > 0 ? t2.substring(0, n) : t2.replace(/\/+$/, "");
  136. }
  137. function W(t2) {
  138. const n = (n2) => n2 == null || n2 instanceof RegExp && n2.test(t2) || typeof n2 == "string" && t2.startsWith(n2), e = u.interceptors;
  139. if (e) {
  140. for (const r3 of e)
  141. if (Array.isArray(r3.urls)) {
  142. if (r3.urls.some(n))
  143. return r3;
  144. } else if (n(r3.urls))
  145. return r3;
  146. }
  147. return null;
  148. }
  149. function z(t2, n, e = false) {
  150. const r3 = Lt(t2), o = Lt(n);
  151. return !(!e && r3.scheme !== o.scheme) && (r3.host != null && o.host != null && (r3.host.toLowerCase() === o.host.toLowerCase() && r3.port === o.port));
  152. }
  153. function D(t2) {
  154. if (typeof t2 == "string") {
  155. if (!K(t2))
  156. return true;
  157. t2 = Lt(t2);
  158. }
  159. if (z(t2, w))
  160. return true;
  161. const n = u.trustedServers || [];
  162. for (let e = 0; e < n.length; e++) {
  163. const r3 = M(n[e]);
  164. for (let n2 = 0; n2 < r3.length; n2++)
  165. if (z(t2, r3[n2]))
  166. return true;
  167. }
  168. return false;
  169. }
  170. function M(t2) {
  171. return $[t2] || (at(t2) || ft(t2) ? $[t2] = [new y(Q(t2))] : $[t2] = [new y(`http://${t2}`), new y(`https://${t2}`)]), $[t2];
  172. }
  173. function Q(t2, n = U, e) {
  174. return ft(t2) ? e && e.preserveProtocolRelative ? t2 : w.scheme === "http" && w.authority === H(t2).slice(2) ? `http:${t2}` : `https:${t2}` : at(t2) ? t2 : q(G(t2[0] === "/" ? wt(n) : n, t2));
  175. }
  176. function _(t2, n = U, e) {
  177. if (!K(t2))
  178. return t2;
  179. const r3 = F(t2), o = r3.toLowerCase(), i = F(n).toLowerCase().replace(/\/+$/, ""), s4 = e ? F(e).toLowerCase().replace(/\/+$/, "") : null;
  180. if (s4 && i.indexOf(s4) !== 0)
  181. return t2;
  182. const u2 = (t3, n2, e2) => (e2 = t3.indexOf(n2, e2)) === -1 ? t3.length : e2;
  183. let c2 = u2(o, "/", o.indexOf("//") + 2), l2 = -1;
  184. for (; o.slice(0, c2 + 1) === i.slice(0, c2) + "/" && (l2 = c2 + 1, c2 !== o.length); )
  185. c2 = u2(o, "/", c2 + 1);
  186. if (l2 === -1)
  187. return t2;
  188. if (s4 && l2 < s4.length)
  189. return t2;
  190. t2 = r3.slice(l2);
  191. const f2 = i.slice(l2 - 1).replace(/[^/]+/g, "").length;
  192. if (f2 > 0)
  193. for (let a2 = 0; a2 < f2; a2++)
  194. t2 = `../${t2}`;
  195. else
  196. t2 = `./${t2}`;
  197. return t2;
  198. }
  199. function F(t2) {
  200. return t2 = jt(t2 = Rt(t2 = qt(t2 = Q(t2 = t2.trim()))));
  201. }
  202. function G(...t2) {
  203. const n = t2.filter(r);
  204. if (!n || !n.length)
  205. return;
  206. const e = [];
  207. if (K(n[0])) {
  208. const t3 = n[0], r4 = t3.indexOf("//");
  209. r4 !== -1 && (e.push(t3.slice(0, r4 + 1)), dt(n[0]) && (e[0] += "/"), n[0] = t3.slice(r4 + 2));
  210. } else
  211. n[0][0] === "/" && e.push("");
  212. const r3 = n.reduce((t3, n2) => n2 ? t3.concat(n2.split("/")) : t3, []);
  213. for (let o = 0; o < r3.length; o++) {
  214. const t3 = r3[o];
  215. t3 === ".." && e.length > 0 && e[e.length - 1] !== ".." ? e.pop() : (!t3 && o === r3.length - 1 || t3 && (t3 !== "." || e.length === 0)) && e.push(t3);
  216. }
  217. return e.join("/");
  218. }
  219. function H(t2, n = false) {
  220. if (V(t2) || X(t2))
  221. return null;
  222. let e = t2.indexOf("://");
  223. if (e === -1 && ft(t2))
  224. e = 2;
  225. else {
  226. if (e === -1)
  227. return null;
  228. e += 3;
  229. }
  230. const r3 = t2.indexOf("/", e);
  231. return r3 !== -1 && (t2 = t2.slice(0, r3)), n && (t2 = xt(t2, true)), t2;
  232. }
  233. function K(t2) {
  234. return ft(t2) || at(t2);
  235. }
  236. function V(t2) {
  237. return t2 != null && t2.slice(0, 5) === "blob:";
  238. }
  239. function X(t2) {
  240. return t2.slice(0, 5) === "data:";
  241. }
  242. function Y(t2) {
  243. const n = nt(t2);
  244. if (!n || !n.isBase64)
  245. return null;
  246. const e = atob(n.data), r3 = new Uint8Array(e.length);
  247. for (let o = 0; o < e.length; o++)
  248. r3[o] = e.charCodeAt(o);
  249. return r3.buffer;
  250. }
  251. function Z(t2) {
  252. return btoa(String.fromCharCode.apply(null, t2)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
  253. }
  254. var tt = /^data:(.*?)(;base64)?,(.*)$/;
  255. function nt(t2) {
  256. const n = t2.match(tt);
  257. if (!n)
  258. return null;
  259. const [, e, r3, o] = n;
  260. return { mediaType: e, isBase64: !!r3, data: o };
  261. }
  262. function et(t2) {
  263. return t2.isBase64 ? `data:${t2.mediaType};base64,${t2.data}` : `data:${t2.mediaType},${t2.data}`;
  264. }
  265. function it(t2, n) {
  266. ut(t2, n) || lt(t2, n);
  267. }
  268. function ut(t2, n) {
  269. if (!t2)
  270. return false;
  271. const e = document.createElement("a");
  272. if (!("download" in e))
  273. return false;
  274. const r3 = URL.createObjectURL(t2);
  275. return e.download = n, e.href = r3, e.style.display = "none", document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(r3), true;
  276. }
  277. function lt(t2, n) {
  278. return !!window.navigator.msSaveOrOpenBlob && window.navigator.msSaveOrOpenBlob(t2, n);
  279. }
  280. function ft(t2) {
  281. return t2 != null && t2 !== void 0 && t2[0] === "/" && t2[1] === "/";
  282. }
  283. function at(t2) {
  284. return l.test(t2);
  285. }
  286. function ht(t2) {
  287. return a.test(t2) || w.scheme === "https" && ft(t2);
  288. }
  289. function pt(t2) {
  290. return f.test(t2) || w.scheme === "http" && ft(t2);
  291. }
  292. function dt(t2) {
  293. return h.test(t2);
  294. }
  295. function mt(t2) {
  296. return ft(t2) ? `https:${t2}` : t2.replace(f, "https:");
  297. }
  298. function yt() {
  299. return w.scheme === "http";
  300. }
  301. function $t() {
  302. return w.scheme === "https";
  303. }
  304. function xt(t2, n = false) {
  305. return ft(t2) ? t2.slice(2) : (t2 = t2.replace(l, ""), n && t2.length > 1 && t2[0] === "/" && t2[1] === "/" && (t2 = t2.slice(2)), t2);
  306. }
  307. function wt(t2) {
  308. const n = t2.indexOf("//"), e = t2.indexOf("/", n + 2);
  309. return e === -1 ? t2 : t2.slice(0, e);
  310. }
  311. function Ot(t2) {
  312. let n = 0;
  313. if (K(t2)) {
  314. const e2 = t2.indexOf("//");
  315. e2 !== -1 && (n = e2 + 2);
  316. }
  317. const e = t2.lastIndexOf("/");
  318. return e < n ? t2 : t2.slice(0, e + 1);
  319. }
  320. function Ut(t2, n) {
  321. if (!t2)
  322. return "";
  323. const e = j(t2).path.replace(/\/+$/, ""), r3 = e.substring(e.lastIndexOf("/") + 1);
  324. if (!n?.length)
  325. return r3;
  326. const o = new RegExp(`.(${n.join("|")})$`, "ig");
  327. return r3.replace(o, "");
  328. }
  329. function bt(t2) {
  330. return t2 && t2[t2.length - 1] === "/" ? t2 : `${t2}/`;
  331. }
  332. function Ct(t2) {
  333. return t2.replace(/\/+$/, "");
  334. }
  335. function qt(t2) {
  336. if (/^https?:\/\//i.test(t2)) {
  337. const n = P(t2);
  338. t2 = (t2 = n.path.replace(/\/{2,}/g, "/")).replace("/", "//"), n.query && (t2 += `?${n.query}`);
  339. }
  340. return t2;
  341. }
  342. function Rt(t2) {
  343. return t2.replace(/^(https?:\/\/)(arcgis\.com)/i, "$1www.$2");
  344. }
  345. function jt(t2) {
  346. const n = u.httpsDomains;
  347. if (!pt(t2))
  348. return t2;
  349. const e = t2.indexOf("/", 7);
  350. let r3;
  351. if (r3 = e === -1 ? t2 : t2.slice(0, e), r3 = r3.toLowerCase().slice(7), p.test(r3)) {
  352. if (!r3.endsWith(":80"))
  353. return t2;
  354. r3 = r3.slice(0, -3), t2 = t2.replace(":80", "");
  355. }
  356. return yt() && r3 === w.authority && !d.test(t2) || ($t() && r3 === w.authority || n && n.some((t3) => r3 === t3 || r3.endsWith(`.${t3}`)) || $t() && !J(t2)) && (t2 = mt(t2)), t2;
  357. }
  358. function vt(t2, n, e) {
  359. if (!(n && e && t2 && K(t2)))
  360. return t2;
  361. const r3 = t2.indexOf("//"), o = t2.indexOf("/", r3 + 2), i = t2.indexOf(":", r3 + 2), s4 = Math.min(o < 0 ? t2.length : o, i < 0 ? t2.length : i);
  362. if (t2.slice(r3 + 2, s4).toLowerCase() !== n.toLowerCase())
  363. return t2;
  364. return `${t2.slice(0, r3 + 2)}${e}${t2.slice(s4)}`;
  365. }
  366. function Lt(t2) {
  367. return typeof t2 == "string" ? new y(Q(t2)) : (t2.scheme || (t2.scheme = w.scheme), t2);
  368. }
  369. function It(t2) {
  370. return Jt.test(t2);
  371. }
  372. function At(t2, n) {
  373. const e = j(t2), r3 = Object.keys(e.query || {});
  374. return r3.length > 0 && n && n.warn("removeQueryParameters()", `Url query parameters are not supported, the following parameters have been removed: ${r3.join(", ")}.`), e.path;
  375. }
  376. function St(t2, n, e) {
  377. const r3 = j(t2), o = r3.query || {};
  378. return o[n] = String(e), `${r3.path}?${I(o)}`;
  379. }
  380. function Bt(t2, n) {
  381. const e = j(t2), r3 = e.query || {};
  382. for (const i in n)
  383. r3[i] = n[i];
  384. const o = I(r3);
  385. return o ? `${e.path}?${o}` : e.path;
  386. }
  387. function kt(t2) {
  388. if (t(t2))
  389. return null;
  390. const n = t2.match(Et);
  391. return n ? n[1] : null;
  392. }
  393. var Et = /.*?\.([^\/]*)$/;
  394. var Jt = /(^data:image\/svg|\.svg$)/i;
  395. export {
  396. y,
  397. b,
  398. C,
  399. j,
  400. v,
  401. I,
  402. A,
  403. S,
  404. E,
  405. J,
  406. N,
  407. W,
  408. z,
  409. D,
  410. Q,
  411. _,
  412. F,
  413. G,
  414. H,
  415. K,
  416. V,
  417. X,
  418. Y,
  419. Z,
  420. nt,
  421. et,
  422. it,
  423. ft,
  424. ht,
  425. mt,
  426. Ot,
  427. Ut,
  428. Ct,
  429. vt,
  430. It,
  431. At,
  432. St,
  433. Bt,
  434. kt
  435. };
  436. //# sourceMappingURL=chunk-VBRY5KJM.js.map