123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- import {
- i
- } from "./chunk-BQ7UE3XL.js";
- import {
- t as t3
- } from "./chunk-QY775BFA.js";
- import {
- I,
- R,
- c,
- h,
- m as m2
- } from "./chunk-65BYCSII.js";
- import {
- G,
- K,
- V,
- kt
- } from "./chunk-VBRY5KJM.js";
- import {
- s,
- t3 as t2,
- y
- } from "./chunk-Y3WMVFTW.js";
- import {
- m,
- r,
- t
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/portal/support/resourceExtension.js
- function p(i2) {
- return o[n(i2)] || e;
- }
- function n(i2) {
- return i2 instanceof Blob ? i2.type : t4(i2.url);
- }
- function t4(p2) {
- const n2 = kt(p2);
- return g[n2] || 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" };
- for (const l in g)
- o[g[l]] = l;
- // node_modules/@arcgis/core/core/accessorSupport/decorators/persistable.js
- function w(r2) {
- const e2 = r(r2) && r2.origins ? r2.origins : [void 0];
- return (t5, o2) => {
- const i2 = v(r2, t5, o2);
- for (const r3 of e2) {
- const e3 = y(t5, r3, o2);
- for (const t6 in i2)
- e3[t6] = i2[t6];
- }
- };
- }
- function v(r2, e2, o2) {
- if (r(r2) && r2.type === "resource")
- return U(r2, e2, o2);
- switch (r(r2) && r2.type ? r2.type : "other") {
- case "other":
- return { read: true, write: true };
- case "url": {
- const { read: t5, write: r3 } = R;
- return { read: t5, write: r3 };
- }
- }
- }
- function U(e2, s2, u) {
- const p2 = s(s2, u);
- return { type: String, read: (t5, r2, e3) => {
- const o2 = m2(t5, r2, e3);
- return p2.type === String ? o2 : typeof p2.type == "function" ? new p2.type({ url: o2 }) : void 0;
- }, write: { writer(s3, a2, l, f) {
- if (!f || !f.resources)
- return typeof s3 == "string" ? void (a2[l] = c(s3, f)) : void (a2[l] = s3.write({}, f));
- const m3 = R2(s3), g2 = m3 ? c(m3, { ...f, verifyItemRelativeUrls: f && f.verifyItemRelativeUrls ? { writtenUrls: f.verifyItemRelativeUrls.writtenUrls, rootPath: null } : null }, I.NO) : null, w2 = p2.type !== String && (!i(this) || f && f.origin && this.originIdOf(u) > t2(f.origin));
- f && f.portalItem && r(g2) && !K(g2) ? w2 ? I2(this, u, s3, g2, a2, l, f, e2) : O(g2, a2, l, f) : f && f.portalItem && (t(g2) || r(h(g2)) || V(g2) || w2) ? j(this, u, s3, g2, a2, l, f, e2) : a2[l] = g2;
- } } };
- }
- function j(t5, r2, o2, i2, u, a2, c2, l) {
- const m3 = t3(), y2 = b(o2, i2, c2), h2 = G(m(l, "prefix"), m3), d = `${h2}.${p(y2)}`, g2 = c2.portalItem.resourceFromPath(d);
- V(i2) && c2.resources.pendingOperations.push(P(i2).then((t6) => {
- g2.path = `${h2}.${p(t6)}`, u[a2] = g2.itemRelativeUrl;
- }).catch(() => {
- })), S(t5, r2, g2, y2, c2.resources.toAdd), u[a2] = g2.itemRelativeUrl;
- }
- function I2(t5, r2, e2, o2, i2, n2, s2, p2) {
- const a2 = s2.portalItem.resourceFromPath(o2), c2 = b(e2, o2, s2);
- p(c2) === kt(a2.path) ? (S(t5, r2, a2, c2, s2.resources.toUpdate), i2[n2] = o2) : j(t5, r2, e2, o2, i2, n2, s2, p2);
- }
- function O(t5, r2, e2, o2) {
- o2.resources.toKeep.push({ resource: o2.portalItem.resourceFromPath(t5) }), r2[e2] = t5;
- }
- function S(t5, r2, e2, o2, i2) {
- i2.push({ resource: e2, content: o2, finish: (e3) => {
- N(t5, r2, e3);
- } });
- }
- function b(t5, r2, e2) {
- return typeof t5 == "string" ? { url: r2 } : new Blob([JSON.stringify(t5.toJSON(e2))], { type: "application/json" });
- }
- async function P(t5) {
- const r2 = (await import("./request-EYE34PBM.js")).default, { data: e2 } = await r2(t5, { responseType: "blob" });
- return e2;
- }
- function R2(t5) {
- return t(t5) ? null : typeof t5 == "string" ? t5 : t5.url;
- }
- function N(t5, r2, e2) {
- typeof t5[r2] == "string" ? t5[r2] = e2.url : t5[r2].url = e2.url;
- }
- export {
- w
- };
- //# sourceMappingURL=chunk-BVMSF6QA.js.map
|