import { i } from "./chunk-IZUZZJS7.js"; import { n } from "./chunk-I4RYNNL6.js"; import { R, U, d as d2, m, p, x } from "./chunk-4ONPMX2F.js"; import { G, K, V, kt } from "./chunk-VEGAOVMY.js"; import { d, s, t3 as t } from "./chunk-2Z2TG5CU.js"; // node_modules/@arcgis/core/portal/support/resourceExtension.js function t2(i2) { return o[p2(i2)] || e; } function p2(i2) { return i2 instanceof Blob ? i2.type : n2(i2.url); } function n2(t3) { const p3 = kt(t3); return g[p3] || a; } var o = {}; var a = "text/plain"; var e = o[a]; var g = { png: "image/png", jpeg: "image/jpeg", jpg: "image/jpg", bmp: "image/bmp", gif: "image/gif", json: "application/json", txt: "text/plain", xml: "application/xml", svg: "image/svg+xml", zip: "application/zip", pbf: "application/vnd.mapbox-vector-tile", gz: "application/gzip", "bin.gz": "application/octet-stream" }; for (const c in g) o[g[c]] = c; // node_modules/@arcgis/core/core/accessorSupport/decorators/persistable.js function g2(t3) { var _a; const r = (_a = t3 == null ? void 0 : t3.origins) != null ? _a : [void 0]; return (e2, o2) => { const s2 = h(t3, e2, o2); for (const t4 of r) { const r2 = d(e2, t4, o2); for (const t5 in s2) r2[t5] = s2[t5]; } }; } function h(t3, r, e2) { var _a; if ("resource" === (t3 == null ? void 0 : t3.type)) return v(t3, r, e2); switch ((_a = t3 == null ? void 0 : t3.type) != null ? _a : "other") { case "other": return { read: true, write: true }; case "url": { const { read: t4, write: r2 } = x; return { read: t4, write: r2 }; } } } function v(o2, s2, n3) { const p3 = s(s2, n3); return { type: String, read: (t3, r, e2) => { const o3 = p(t3, r, e2); return p3.type === String ? o3 : "function" == typeof p3.type ? new p3.type({ url: o3 }) : void 0; }, write: { writer(s3, i2, u, c) { if (!c || !c.resources) return "string" == typeof s3 ? void (i2[u] = m(s3, c)) : void (i2[u] = s3.write({}, c)); const y = x2(s3), d3 = m(y, { ...c, verifyItemRelativeUrls: c && c.verifyItemRelativeUrls ? { writtenUrls: c.verifyItemRelativeUrls.writtenUrls, rootPath: void 0 } : void 0 }, R.NO), g3 = p3.type !== String && (!i(this) || c && c.origin && this.originIdOf(n3) > t(c.origin)), h2 = { object: this, propertyName: n3, value: s3, targetUrl: d3, dest: i2, targetPropertyName: u, context: c, params: o2 }; c && c.portalItem && d3 && !K(d3) ? g3 ? w(h2) : j(h2) : c && c.portalItem && (null == d3 || null != U(d3) || V(d3) || g3) ? U2(h2) : i2[u] = d3; } } }; } function U2(t3) { var _a, _b, _c; const { targetUrl: r, params: s2, value: i2, context: a2, dest: p3, targetPropertyName: c } = t3; if (!a2.portalItem) return; const l = d2(r), m2 = (_a = l == null ? void 0 : l.filename) != null ? _a : n(), f = (_b = s2 == null ? void 0 : s2.prefix) != null ? _b : l == null ? void 0 : l.prefix, d3 = N(i2, r, a2), g3 = G(f, m2), h2 = `${g3}.${t2(d3)}`, v2 = a2.portalItem.resourceFromPath(h2); V(r) && a2.resources && a2.resources.pendingOperations.push(P(r).then((t4) => { v2.path = `${g3}.${t2(t4)}`, p3[c] = v2.itemRelativeUrl; }).catch(() => { })); const U3 = (_c = s2 == null ? void 0 : s2.compress) != null ? _c : false; a2.resources && I({ ...t3, resource: v2, content: d3, compress: U3, updates: a2.resources.toAdd }), p3[c] = v2.itemRelativeUrl; } function w(t3) { var _a; const { context: r, targetUrl: e2, params: o2, value: n3, dest: i2, targetPropertyName: a2 } = t3; if (!r.portalItem) return; const p3 = r.portalItem.resourceFromPath(e2), c = N(n3, e2, r), l = t2(c), m2 = kt(p3.path), f = (_a = o2 == null ? void 0 : o2.compress) != null ? _a : false; l === m2 ? (r.resources && I({ ...t3, resource: p3, content: c, compress: f, updates: r.resources.toUpdate }), i2[a2] = e2) : U2(t3); } function j({ context: t3, targetUrl: r, dest: e2, targetPropertyName: o2 }) { t3.portalItem && t3.resources && (t3.resources.toKeep.push({ resource: t3.portalItem.resourceFromPath(r), compress: false }), e2[o2] = r); } function I({ object: t3, propertyName: r, updates: e2, resource: o2, content: s2, compress: n3 }) { e2.push({ resource: o2, content: s2, compress: n3, finish: (e3) => { O(t3, r, e3); } }); } function N(t3, r, e2) { return "string" == typeof t3 ? { url: r } : new Blob([JSON.stringify(t3.toJSON(e2))], { type: "application/json" }); } async function P(t3) { const r = (await import("./request-TKJSZZ4X.js")).default, { data: e2 } = await r(t3, { responseType: "blob" }); return e2; } function x2(t3) { return null == t3 ? null : "string" == typeof t3 ? t3 : t3.url; } function O(t3, r, e2) { "string" == typeof t3[r] ? t3[r] = e2.url : t3[r].url = e2.url; } export { g2 as g }; //# sourceMappingURL=chunk-IN44RUPP.js.map