chunk-WCLXPK5D.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import {
  2. h
  3. } from "./chunk-JBMHQ5RK.js";
  4. import {
  5. r
  6. } from "./chunk-YXWMMD76.js";
  7. // node_modules/@arcgis/core/core/NestedMap.js
  8. var t = class {
  9. constructor() {
  10. this._outer = /* @__PURE__ */ new Map();
  11. }
  12. clear() {
  13. this._outer.clear();
  14. }
  15. get empty() {
  16. return 0 === this._outer.size;
  17. }
  18. get(t2, e2) {
  19. var _a;
  20. return (_a = this._outer.get(t2)) == null ? void 0 : _a.get(e2);
  21. }
  22. set(t2, e2, r2) {
  23. const s2 = this._outer.get(t2);
  24. s2 ? s2.set(e2, r2) : this._outer.set(t2, /* @__PURE__ */ new Map([[e2, r2]]));
  25. }
  26. delete(t2, e2) {
  27. const r2 = this._outer.get(t2);
  28. r2 && (r2.delete(e2), 0 === r2.size && this._outer.delete(t2));
  29. }
  30. forEach(t2) {
  31. this._outer.forEach((e2, r2) => t2(e2, r2));
  32. }
  33. };
  34. // node_modules/@arcgis/core/views/webgl/ProgramCache.js
  35. var s = class {
  36. constructor(r2) {
  37. this._rctx = r2, this._store = new t();
  38. }
  39. dispose() {
  40. this._store.forEach((r2) => r2.forEach((r3) => r3.dispose())), this._store.clear();
  41. }
  42. acquire(t2, s2, o, c) {
  43. const i = this._store.get(t2, s2);
  44. if (r(i))
  45. return i.ref(), i;
  46. const h2 = new h(this._rctx, t2, s2, o, c);
  47. return h2.ref(), this._store.set(t2, s2, h2), h2;
  48. }
  49. get test() {
  50. let r2 = 0;
  51. return this._store.forEach((t2) => t2.forEach((t3) => r2 += t3.hasGLName ? 2 : 1)), { cachedWebGLObjects: r2 };
  52. }
  53. };
  54. // node_modules/@arcgis/core/views/webgl/programUtils.js
  55. function e(e2) {
  56. const { options: n2, value: o } = e2;
  57. return "number" == typeof n2[o];
  58. }
  59. function n(n2) {
  60. let o = "";
  61. for (const t2 in n2) {
  62. const i = n2[t2];
  63. if ("boolean" == typeof i)
  64. i && (o += `#define ${t2}
  65. `);
  66. else if ("number" == typeof i)
  67. o += `#define ${t2} ${i.toFixed()}
  68. `;
  69. else if ("object" == typeof i)
  70. if (e(i)) {
  71. const { value: e2, options: n3, namespace: f } = i, s2 = f ? `${f}_` : "";
  72. for (const t3 in n3)
  73. o += `#define ${s2}${t3} ${n3[t3].toFixed()}
  74. `;
  75. o += `#define ${t2} ${s2}${e2}
  76. `;
  77. } else {
  78. const e2 = i.options;
  79. let n3 = 0;
  80. for (const t3 in e2)
  81. o += `#define ${e2[t3]} ${(n3++).toFixed()}
  82. `;
  83. o += `#define ${t2} ${e2[i.value]}
  84. `;
  85. }
  86. }
  87. return o;
  88. }
  89. export {
  90. s,
  91. n
  92. };
  93. //# sourceMappingURL=chunk-WCLXPK5D.js.map