chunk-BVMSF6QA.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import {
  2. i
  3. } from "./chunk-BQ7UE3XL.js";
  4. import {
  5. t as t3
  6. } from "./chunk-QY775BFA.js";
  7. import {
  8. I,
  9. R,
  10. c,
  11. h,
  12. m as m2
  13. } from "./chunk-65BYCSII.js";
  14. import {
  15. G,
  16. K,
  17. V,
  18. kt
  19. } from "./chunk-VBRY5KJM.js";
  20. import {
  21. s,
  22. t3 as t2,
  23. y
  24. } from "./chunk-Y3WMVFTW.js";
  25. import {
  26. m,
  27. r,
  28. t
  29. } from "./chunk-GZT4BVFP.js";
  30. // node_modules/@arcgis/core/portal/support/resourceExtension.js
  31. function p(i2) {
  32. return o[n(i2)] || e;
  33. }
  34. function n(i2) {
  35. return i2 instanceof Blob ? i2.type : t4(i2.url);
  36. }
  37. function t4(p2) {
  38. const n2 = kt(p2);
  39. return g[n2] || a;
  40. }
  41. var o = {};
  42. var a = "text/plain";
  43. var e = o[a];
  44. 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" };
  45. for (const l in g)
  46. o[g[l]] = l;
  47. // node_modules/@arcgis/core/core/accessorSupport/decorators/persistable.js
  48. function w(r2) {
  49. const e2 = r(r2) && r2.origins ? r2.origins : [void 0];
  50. return (t5, o2) => {
  51. const i2 = v(r2, t5, o2);
  52. for (const r3 of e2) {
  53. const e3 = y(t5, r3, o2);
  54. for (const t6 in i2)
  55. e3[t6] = i2[t6];
  56. }
  57. };
  58. }
  59. function v(r2, e2, o2) {
  60. if (r(r2) && r2.type === "resource")
  61. return U(r2, e2, o2);
  62. switch (r(r2) && r2.type ? r2.type : "other") {
  63. case "other":
  64. return { read: true, write: true };
  65. case "url": {
  66. const { read: t5, write: r3 } = R;
  67. return { read: t5, write: r3 };
  68. }
  69. }
  70. }
  71. function U(e2, s2, u) {
  72. const p2 = s(s2, u);
  73. return { type: String, read: (t5, r2, e3) => {
  74. const o2 = m2(t5, r2, e3);
  75. return p2.type === String ? o2 : typeof p2.type == "function" ? new p2.type({ url: o2 }) : void 0;
  76. }, write: { writer(s3, a2, l, f) {
  77. if (!f || !f.resources)
  78. return typeof s3 == "string" ? void (a2[l] = c(s3, f)) : void (a2[l] = s3.write({}, f));
  79. 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));
  80. 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;
  81. } } };
  82. }
  83. function j(t5, r2, o2, i2, u, a2, c2, l) {
  84. const m3 = t3(), y2 = b(o2, i2, c2), h2 = G(m(l, "prefix"), m3), d = `${h2}.${p(y2)}`, g2 = c2.portalItem.resourceFromPath(d);
  85. V(i2) && c2.resources.pendingOperations.push(P(i2).then((t6) => {
  86. g2.path = `${h2}.${p(t6)}`, u[a2] = g2.itemRelativeUrl;
  87. }).catch(() => {
  88. })), S(t5, r2, g2, y2, c2.resources.toAdd), u[a2] = g2.itemRelativeUrl;
  89. }
  90. function I2(t5, r2, e2, o2, i2, n2, s2, p2) {
  91. const a2 = s2.portalItem.resourceFromPath(o2), c2 = b(e2, o2, s2);
  92. 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);
  93. }
  94. function O(t5, r2, e2, o2) {
  95. o2.resources.toKeep.push({ resource: o2.portalItem.resourceFromPath(t5) }), r2[e2] = t5;
  96. }
  97. function S(t5, r2, e2, o2, i2) {
  98. i2.push({ resource: e2, content: o2, finish: (e3) => {
  99. N(t5, r2, e3);
  100. } });
  101. }
  102. function b(t5, r2, e2) {
  103. return typeof t5 == "string" ? { url: r2 } : new Blob([JSON.stringify(t5.toJSON(e2))], { type: "application/json" });
  104. }
  105. async function P(t5) {
  106. const r2 = (await import("./request-EYE34PBM.js")).default, { data: e2 } = await r2(t5, { responseType: "blob" });
  107. return e2;
  108. }
  109. function R2(t5) {
  110. return t(t5) ? null : typeof t5 == "string" ? t5 : t5.url;
  111. }
  112. function N(t5, r2, e2) {
  113. typeof t5[r2] == "string" ? t5[r2] = e2.url : t5[r2].url = e2.url;
  114. }
  115. export {
  116. w
  117. };
  118. //# sourceMappingURL=chunk-BVMSF6QA.js.map