import { s, s2, s3 } from "./chunk-E5O6P5I2.js"; import { r, t, x } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/core/urlUtils.js var s4 = s2.getLogger("esri.core.urlUtils"); var u = s.request; var l = "esri/config: esriConfig.request.proxyUrl is not set."; var c = /^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i; var f = /^\s*http:/i; var a = /^\s*https:/i; var h = /^\s*file:/i; var p = /:\d+$/; var d = /^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i; var g = new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"); var m = new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$"); var y = class { constructor(t2 = "") { 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; let n = x(this.uri.match(g)); 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), null != this.authority && (n = x(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); } toString() { return this.uri; } }; var $ = {}; var x2 = new y(s.applicationUrl); var w = x2; var O = q(); var U = O; var b = () => w; var C = () => U; function q() { const t2 = x(w.path), n = t2.substring(0, t2.lastIndexOf(t2.split("/")[t2.split("/").length - 1])); return `${`${w.scheme}://${w.host}${null != w.port ? `:${w.port}` : ""}`}${n}`; } function j(t2) { if (!t2) return null; const n = { path: null, query: null }, e = new y(t2), r2 = t2.indexOf("?"); return null === e.query ? n.path = t2 : (n.path = t2.substring(0, r2), n.query = L(e.query)), e.fragment && (n.hash = e.fragment, null === e.query && (n.path = n.path.substring(0, n.path.length - (e.fragment.length + 1)))), n; } function L(t2) { const n = t2.split("&"), e = {}; for (const r2 of n) { if (!r2) continue; const t3 = r2.indexOf("="); let n2, o; t3 < 0 ? (n2 = decodeURIComponent(r2), o = "") : (n2 = decodeURIComponent(r2.slice(0, t3)), o = decodeURIComponent(r2.slice(t3 + 1))); let i = e[n2]; "string" == typeof i && (i = e[n2] = [i]), Array.isArray(i) ? i.push(o) : e[n2] = o; } return e; } function v(t2) { return t2 && "object" == typeof t2 && "toJSON" in t2 && "function" == typeof t2.toJSON; } function I(t2, n) { return t2 ? n && "function" == typeof n ? Object.keys(t2).map((e) => encodeURIComponent(e) + "=" + encodeURIComponent(n(e, t2[e]))).join("&") : Object.keys(t2).map((e) => { const r2 = t2[e]; if (null == r2) return ""; const o = encodeURIComponent(e) + "=", i = n && n[e]; return i ? o + encodeURIComponent(i(r2)) : Array.isArray(r2) ? r2.map((t3) => v(t3) ? o + encodeURIComponent(JSON.stringify(t3)) : o + encodeURIComponent(t3)).join("&") : v(r2) ? o + encodeURIComponent(JSON.stringify(r2)) : o + encodeURIComponent(r2); }).filter((t3) => t3).join("&") : ""; } function A(t2 = false) { let e, r2 = u.proxyUrl; if ("string" == typeof t2) { e = ht(t2); const n = J(t2); n && (r2 = n.proxyUrl); } else e = !!t2; if (!r2) throw s4.warn(l), new s3("urlutils:proxy-not-set", l); e && $t() && (r2 = mt(r2)); return j(r2); } function S(t2) { const n = J(t2); let e, r2; if (n) { const t3 = P(n.proxyUrl); e = t3.path, r2 = t3.query ? L(t3.query) : null; } if (e) { const n2 = j(t2); t2 = e + "?" + n2.path; const o = I({ ...r2, ...n2.query }); o && (t2 = `${t2}?${o}`); } return t2; } var B = { path: "", query: "" }; function P(t2) { const n = t2.indexOf("?"); return -1 !== n ? (B.path = t2.slice(0, n), B.query = t2.slice(n + 1)) : (B.path = t2, B.query = null), B; } function k(t2) { return t2 = (t2 = xt(t2 = bt(t2 = P(t2).path), true)).toLowerCase(); } function E(t2) { const n = { proxyUrl: t2.proxyUrl, urlPrefix: k(t2.urlPrefix) }, e = u.proxyRules, r2 = n.urlPrefix; let o = e.length; for (let i = 0; i < e.length; i++) { const t3 = e[i].urlPrefix; if (0 === r2.indexOf(t3)) { if (r2.length === t3.length) return -1; o = i; break; } 0 === t3.indexOf(r2) && (o = i + 1); } return e.splice(o, 0, n), o; } function J(t2) { const n = u.proxyRules, e = k(t2); for (let r2 = 0; r2 < n.length; r2++) if (0 === e.indexOf(n[r2].urlPrefix)) return n[r2]; } function N(t2, n) { return t2 = T(t2), n = T(n), xt(t2) === xt(n); } function T(t2) { const n = (t2 = F(t2)).indexOf("/sharing"); return n > 0 ? t2.substring(0, n) : t2.replace(/\/+$/, ""); } function W(t2) { const n = (n2) => null == n2 || n2 instanceof RegExp && n2.test(t2) || "string" == typeof n2 && t2.startsWith(n2), e = u.interceptors; if (e) { for (const r2 of e) if (Array.isArray(r2.urls)) { if (r2.urls.some(n)) return r2; } else if (n(r2.urls)) return r2; } return null; } function z(t2, n, e = false) { if (!t2 || !n) return false; const r2 = vt(t2), o = vt(n); return !(!e && r2.scheme !== o.scheme) && (null != r2.host && null != o.host && (r2.host.toLowerCase() === o.host.toLowerCase() && r2.port === o.port)); } function D(t2) { if ("string" == typeof t2) { if (!K(t2)) return true; t2 = vt(t2); } if (z(t2, w)) return true; const n = u.trustedServers || []; for (let e = 0; e < n.length; e++) { const r2 = M(n[e]); for (let n2 = 0; n2 < r2.length; n2++) if (z(t2, r2[n2])) return true; } return false; } function M(t2) { return $[t2] || (at(t2) || ft(t2) ? $[t2] = [new y(Q(t2))] : $[t2] = [new y(`http://${t2}`), new y(`https://${t2}`)]), $[t2]; } function Q(t2, n = U, e) { return ft(t2) ? e && e.preserveProtocolRelative ? t2 : "http" === w.scheme && w.authority === H(t2).slice(2) ? `http:${t2}` : `https:${t2}` : at(t2) ? t2 : x(G("/" === t2[0] ? wt(n) : n, t2)); } function _(t2, n = U, e) { if (null == t2 || !K(t2)) return t2; const r2 = F(t2), o = r2.toLowerCase(), i = F(n).toLowerCase().replace(/\/+$/, ""), s5 = e ? F(e).toLowerCase().replace(/\/+$/, "") : null; if (s5 && 0 !== i.indexOf(s5)) return t2; const u2 = (t3, n2, e2) => -1 === (e2 = t3.indexOf(n2, e2)) ? t3.length : e2; let l2 = u2(o, "/", o.indexOf("//") + 2), c2 = -1; for (; o.slice(0, l2 + 1) === i.slice(0, l2) + "/" && (c2 = l2 + 1, l2 !== o.length); ) l2 = u2(o, "/", l2 + 1); if (-1 === c2) return t2; if (s5 && c2 < s5.length) return t2; t2 = r2.slice(c2); const f2 = i.slice(c2 - 1).replace(/[^/]+/g, "").length; if (f2 > 0) for (let a2 = 0; a2 < f2; a2++) t2 = `../${t2}`; else t2 = `./${t2}`; return t2; } function F(t2) { return t2 = jt(t2 = Rt(t2 = qt(t2 = Q(t2 = t2.trim())))); } function G(...t2) { const n = t2.filter(r); if (!n || !n.length) return; const e = []; if (K(n[0])) { const t3 = n[0], r3 = t3.indexOf("//"); -1 !== r3 && (e.push(t3.slice(0, r3 + 1)), dt(n[0]) && (e[0] += "/"), n[0] = t3.slice(r3 + 2)); } else "/" === n[0][0] && e.push(""); const r2 = n.reduce((t3, n2) => n2 ? t3.concat(n2.split("/")) : t3, []); for (let o = 0; o < r2.length; o++) { const t3 = r2[o]; ".." === t3 && e.length > 0 && ".." !== e[e.length - 1] ? e.pop() : (!t3 && o === r2.length - 1 || t3 && ("." !== t3 || 0 === e.length)) && e.push(t3); } return e.join("/"); } function H(t2, n = false) { if (null == t2 || V(t2) || X(t2)) return null; let e = t2.indexOf("://"); if (-1 === e && ft(t2)) e = 2; else { if (-1 === e) return null; e += 3; } const r2 = t2.indexOf("/", e); return -1 !== r2 && (t2 = t2.slice(0, r2)), n && (t2 = xt(t2, true)), t2; } function K(t2) { return ft(t2) || at(t2); } function V(t2) { return null != t2 && "blob:" === t2.slice(0, 5); } function X(t2) { return null != t2 && "data:" === t2.slice(0, 5); } function Y(t2) { const n = nt(t2); if (!n || !n.isBase64) return null; const e = atob(n.data), r2 = new Uint8Array(e.length); for (let o = 0; o < e.length; o++) r2[o] = e.charCodeAt(o); return r2.buffer; } function Z(t2) { return btoa(String.fromCharCode.apply(null, t2)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } var tt = /^data:(.*?)(;base64)?,(.*)$/; function nt(t2) { const n = t2.match(tt); if (!n) return null; const [, e, r2, o] = n; return { mediaType: e, isBase64: !!r2, data: o }; } function et(t2) { return t2.isBase64 ? `data:${t2.mediaType};base64,${t2.data}` : `data:${t2.mediaType},${t2.data}`; } function it(t2, n) { ut(t2, n) || ct(t2, n); } function ut(t2, n) { if (!t2) return false; const e = document.createElement("a"); if (!("download" in e)) return false; const r2 = URL.createObjectURL(t2); return e.download = n, e.href = r2, e.style.display = "none", document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(r2), true; } function ct(t2, n) { return !!window.navigator.msSaveOrOpenBlob && window.navigator.msSaveOrOpenBlob(t2, n); } function ft(t2) { return null != t2 && "/" === t2[0] && "/" === t2[1]; } function at(t2) { return null != t2 && c.test(t2); } function ht(t2) { return null != t2 && a.test(t2) || "https" === w.scheme && ft(t2); } function pt(t2) { return null != t2 && f.test(t2) || "http" === w.scheme && ft(t2); } function dt(t2) { return null != t2 && h.test(t2); } function mt(t2) { return ft(t2) ? `https:${t2}` : t2.replace(f, "https:"); } function yt() { return "http" === w.scheme; } function $t() { return "https" === w.scheme; } function xt(t2, n = false) { return ft(t2) ? t2.slice(2) : (t2 = t2.replace(c, ""), n && t2.length > 1 && "/" === t2[0] && "/" === t2[1] && (t2 = t2.slice(2)), t2); } function wt(t2) { const n = t2.indexOf("//"), e = t2.indexOf("/", n + 2); return -1 === e ? t2 : t2.slice(0, e); } function Ot(t2) { let n = 0; if (K(t2)) { const e2 = t2.indexOf("//"); -1 !== e2 && (n = e2 + 2); } const e = t2.lastIndexOf("/"); return e < n ? t2 : t2.slice(0, e + 1); } function Ut(t2, n) { if (!t2) return ""; const e = j(t2).path.replace(/\/+$/, ""), r2 = e.substring(e.lastIndexOf("/") + 1); if (!(n == null ? void 0 : n.length)) return r2; const o = new RegExp(`.(${n.join("|")})$`, "ig"); return r2.replace(o, ""); } function bt(t2) { return t2 && "/" === t2[t2.length - 1] ? t2 : `${t2}/`; } function Ct(t2) { return t2.replace(/\/+$/, ""); } function qt(t2) { if (/^https?:\/\//i.test(t2)) { const n = P(t2); t2 = (t2 = n.path.replace(/\/{2,}/g, "/")).replace("/", "//"), n.query && (t2 += `?${n.query}`); } return t2; } function Rt(t2) { return t2.replace(/^(https?:\/\/)(arcgis\.com)/i, "$1www.$2"); } function jt(t2) { const n = u.httpsDomains; if (!pt(t2)) return t2; const e = t2.indexOf("/", 7); let r2; if (r2 = -1 === e ? t2 : t2.slice(0, e), r2 = r2.toLowerCase().slice(7), p.test(r2)) { if (!r2.endsWith(":80")) return t2; r2 = r2.slice(0, -3), t2 = t2.replace(":80", ""); } return yt() && r2 === w.authority && !d.test(t2) || ($t() && r2 === w.authority || n && n.some((t3) => r2 === t3 || r2.endsWith(`.${t3}`)) || $t() && !J(t2)) && (t2 = mt(t2)), t2; } function Lt(t2, n, e) { if (!(n && e && t2 && K(t2))) return t2; const r2 = t2.indexOf("//"), o = t2.indexOf("/", r2 + 2), i = t2.indexOf(":", r2 + 2), s5 = Math.min(o < 0 ? t2.length : o, i < 0 ? t2.length : i); if (t2.slice(r2 + 2, s5).toLowerCase() !== n.toLowerCase()) return t2; return `${t2.slice(0, r2 + 2)}${e}${t2.slice(s5)}`; } function vt(t2) { return "string" == typeof t2 ? new y(Q(t2)) : (t2.scheme || (t2.scheme = w.scheme), t2); } function It(t2) { return Nt.test(t2); } function At(t2, n) { const e = j(t2), r2 = Object.keys(e.query || {}); return r2.length > 0 && n && n.warn("removeQueryParameters()", `Url query parameters are not supported, the following parameters have been removed: ${r2.join(", ")}.`), e.path; } function St(t2, n, e) { const r2 = j(t2), o = r2.query || {}; return o[n] = String(e), `${r2.path}?${I(o)}`; } function Bt(t2, n) { const e = j(t2), r2 = e.query || {}; for (const i in n) r2[i] = n[i]; const o = I(r2); return o ? `${e.path}?${o}` : e.path; } function kt(t2) { if (t(t2)) return null; const n = t2.match(Jt); return n ? n[2] : null; } function Et(t2) { if (t(t2)) return null; const n = t2.match(Jt); return n ? { path: n[1], extension: n[2] } : { path: t2, extension: null }; } var Jt = /([^.]*)\.([^\/]*)$/; var Nt = /(^data:image\/svg|\.svg$)/i; export { y, b, C, j, L, I, A, S, E, J, N, W, z, D, Q, _, F, G, H, K, V, X, Y, Z, nt, et, it, ft, ht, mt, Ot, Ut, Ct, Lt, It, At, St, Bt, kt, Et }; //# sourceMappingURL=chunk-VEGAOVMY.js.map