@speckle/objectsender 2.19.5 → 2.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,44 +1,39 @@
1
- var St = Object.defineProperty;
2
- var Tt = (t, e, r) => e in t ? St(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var S = (t, e, r) => (Tt(t, typeof e != "symbol" ? e + "" : e, r), r), tt = (t, e, r) => {
4
- if (!e.has(t))
5
- throw TypeError("Cannot " + r);
1
+ var mt = Object.defineProperty;
2
+ var it = (t) => {
3
+ throw TypeError(t);
6
4
  };
7
- var T = (t, e, r) => (tt(t, e, "read from private field"), r ? r.call(t) : e.get(t)), y = (t, e, r) => {
8
- if (e.has(t))
9
- throw TypeError("Cannot add the same private member more than once");
10
- e instanceof WeakSet ? e.add(t) : e.set(t, r);
11
- }, b = (t, e, r, a) => (tt(t, e, "write to private field"), a ? a.call(t, r) : e.set(t, r), r);
12
- var p = (t, e, r) => (tt(t, e, "access private method"), r);
5
+ var Ct = (t, e, r) => e in t ? mt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
6
+ var S = (t, e, r) => Ct(t, typeof e != "symbol" ? e + "" : e, r), X = (t, e, r) => e.has(t) || it("Cannot " + r);
7
+ var T = (t, e, r) => (X(t, e, "read from private field"), r ? r.call(t) : e.get(t)), j = (t, e, r) => e.has(t) ? it("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), b = (t, e, r, a) => (X(t, e, "write to private field"), a ? a.call(t, r) : e.set(t, r), r), y = (t, e, r) => (X(t, e, "access private method"), r);
13
8
  import "reflect-metadata";
14
- import { retry as vt, timeoutAt as jt } from "@speckle/shared";
15
- function et(t) {
16
- function e(O, _) {
17
- return O << _ | O >>> 32 - _;
9
+ import { retry as wt, timeoutAt as St } from "@speckle/shared";
10
+ function Y(t) {
11
+ function e(k, _) {
12
+ return k << _ | k >>> 32 - _;
18
13
  }
19
- function r(O) {
20
- let _ = "", k, w;
21
- for (k = 7; k >= 0; k--)
22
- w = O >>> k * 4 & 15, _ += w.toString(16);
14
+ function r(k) {
15
+ let _ = "", z, w;
16
+ for (z = 7; z >= 0; z--)
17
+ w = k >>> z * 4 & 15, _ += w.toString(16);
23
18
  return _;
24
19
  }
25
- function a(O) {
26
- O = O.replace(/\r\n/g, `
20
+ function a(k) {
21
+ k = k.replace(/\r\n/g, `
27
22
  `);
28
23
  let _ = "";
29
- for (let k = 0; k < O.length; k++) {
30
- const w = O.charCodeAt(k);
24
+ for (let z = 0; z < k.length; z++) {
25
+ const w = k.charCodeAt(z);
31
26
  w < 128 ? _ += String.fromCharCode(w) : w > 127 && w < 2048 ? (_ += String.fromCharCode(w >> 6 | 192), _ += String.fromCharCode(w & 63 | 128)) : (_ += String.fromCharCode(w >> 12 | 224), _ += String.fromCharCode(w >> 6 & 63 | 128), _ += String.fromCharCode(w & 63 | 128));
32
27
  }
33
28
  return _;
34
29
  }
35
30
  let i, n, g;
36
- const f = new Array(80);
37
- let j = 1732584193, A = 4023233417, o = 2562383102, u = 271733878, v = 3285377520, l, s, c, h, d, m;
31
+ const d = new Array(80);
32
+ let O = 1732584193, $ = 4023233417, o = 2562383102, l = 271733878, v = 3285377520, f, s, c, u, p, m;
38
33
  t = a(t);
39
- const C = t.length, $ = [];
34
+ const C = t.length, P = [];
40
35
  for (n = 0; n < C - 3; n += 4)
41
- g = t.charCodeAt(n) << 24 | t.charCodeAt(n + 1) << 16 | t.charCodeAt(n + 2) << 8 | t.charCodeAt(n + 3), $.push(g);
36
+ g = t.charCodeAt(n) << 24 | t.charCodeAt(n + 1) << 16 | t.charCodeAt(n + 2) << 8 | t.charCodeAt(n + 3), P.push(g);
42
37
  switch (C % 4) {
43
38
  case 0:
44
39
  n = 2147483648;
@@ -53,90 +48,88 @@ function et(t) {
53
48
  n = t.charCodeAt(C - 3) << 24 | t.charCodeAt(C - 2) << 16 | t.charCodeAt(C - 1) << 8 | 128;
54
49
  break;
55
50
  }
56
- for ($.push(n); $.length % 16 !== 14; )
57
- $.push(0);
58
- for ($.push(C >>> 29), $.push(C << 3 & 4294967295), i = 0; i < $.length; i += 16) {
59
- for (n = 0; n < 16; n++)
60
- f[n] = $[i + n];
51
+ for (P.push(n); P.length % 16 !== 14; ) P.push(0);
52
+ for (P.push(C >>> 29), P.push(C << 3 & 4294967295), i = 0; i < P.length; i += 16) {
53
+ for (n = 0; n < 16; n++) d[n] = P[i + n];
61
54
  for (n = 16; n <= 79; n++)
62
- f[n] = e(f[n - 3] ^ f[n - 8] ^ f[n - 14] ^ f[n - 16], 1);
63
- for (l = j, s = A, c = o, h = u, d = v, n = 0; n <= 19; n++)
64
- m = e(l, 5) + (s & c | ~s & h) + d + f[n] + 1518500249 & 4294967295, d = h, h = c, c = e(s, 30), s = l, l = m;
55
+ d[n] = e(d[n - 3] ^ d[n - 8] ^ d[n - 14] ^ d[n - 16], 1);
56
+ for (f = O, s = $, c = o, u = l, p = v, n = 0; n <= 19; n++)
57
+ m = e(f, 5) + (s & c | ~s & u) + p + d[n] + 1518500249 & 4294967295, p = u, u = c, c = e(s, 30), s = f, f = m;
65
58
  for (n = 20; n <= 39; n++)
66
- m = e(l, 5) + (s ^ c ^ h) + d + f[n] + 1859775393 & 4294967295, d = h, h = c, c = e(s, 30), s = l, l = m;
59
+ m = e(f, 5) + (s ^ c ^ u) + p + d[n] + 1859775393 & 4294967295, p = u, u = c, c = e(s, 30), s = f, f = m;
67
60
  for (n = 40; n <= 59; n++)
68
- m = e(l, 5) + (s & c | s & h | c & h) + d + f[n] + 2400959708 & 4294967295, d = h, h = c, c = e(s, 30), s = l, l = m;
61
+ m = e(f, 5) + (s & c | s & u | c & u) + p + d[n] + 2400959708 & 4294967295, p = u, u = c, c = e(s, 30), s = f, f = m;
69
62
  for (n = 60; n <= 79; n++)
70
- m = e(l, 5) + (s ^ c ^ h) + d + f[n] + 3395469782 & 4294967295, d = h, h = c, c = e(s, 30), s = l, l = m;
71
- j = j + l & 4294967295, A = A + s & 4294967295, o = o + c & 4294967295, u = u + h & 4294967295, v = v + d & 4294967295;
63
+ m = e(f, 5) + (s ^ c ^ u) + p + d[n] + 3395469782 & 4294967295, p = u, u = c, c = e(s, 30), s = f, f = m;
64
+ O = O + f & 4294967295, $ = $ + s & 4294967295, o = o + c & 4294967295, l = l + u & 4294967295, v = v + p & 4294967295;
72
65
  }
73
- return (r(j) + r(A) + r(o) + r(u) + r(v)).toLowerCase().substring(0, 40);
66
+ return (r(O) + r($) + r(o) + r(l) + r(v)).toLowerCase().substring(0, 40);
74
67
  }
75
- var Ot = typeof global == "object" && global && global.Object === Object && global, kt = typeof self == "object" && self && self.Object === Object && self, at = Ot || kt || Function("return this")(), R = at.Symbol, pt = Object.prototype, zt = pt.hasOwnProperty, At = pt.toString, M = R ? R.toStringTag : void 0;
76
- function $t(t) {
77
- var e = zt.call(t, M), r = t[M];
68
+ var Tt = typeof global == "object" && global && global.Object === Object && global, vt = typeof self == "object" && self && self.Object === Object && self, tt = Tt || vt || Function("return this")(), D = tt.Symbol, lt = Object.prototype, jt = lt.hasOwnProperty, Ot = lt.toString, R = D ? D.toStringTag : void 0;
69
+ function kt(t) {
70
+ var e = jt.call(t, R), r = t[R];
78
71
  try {
79
- t[M] = void 0;
72
+ t[R] = void 0;
80
73
  var a = !0;
81
74
  } catch {
82
75
  }
83
- var i = At.call(t);
84
- return a && (e ? t[M] = r : delete t[M]), i;
76
+ var i = Ot.call(t);
77
+ return a && (e ? t[R] = r : delete t[R]), i;
85
78
  }
86
- var Pt = Object.prototype, It = Pt.toString;
87
- function xt(t) {
88
- return It.call(t);
79
+ var zt = Object.prototype, At = zt.toString;
80
+ function $t(t) {
81
+ return At.call(t);
89
82
  }
90
- var Et = "[object Null]", Dt = "[object Undefined]", ht = R ? R.toStringTag : void 0;
91
- function yt(t) {
92
- return t == null ? t === void 0 ? Dt : Et : ht && ht in Object(t) ? $t(t) : xt(t);
83
+ var Pt = "[object Null]", It = "[object Undefined]", st = D ? D.toStringTag : void 0;
84
+ function ft(t) {
85
+ return t == null ? t === void 0 ? It : Pt : st && st in Object(t) ? kt(t) : $t(t);
93
86
  }
94
- function gt(t) {
87
+ function dt(t) {
95
88
  return t != null && typeof t == "object";
96
89
  }
97
- var Ft = "[object Symbol]";
98
- function it(t) {
99
- return typeof t == "symbol" || gt(t) && yt(t) == Ft;
90
+ var xt = "[object Symbol]";
91
+ function et(t) {
92
+ return typeof t == "symbol" || dt(t) && ft(t) == xt;
100
93
  }
101
- function Rt(t, e) {
94
+ function Et(t, e) {
102
95
  for (var r = -1, a = t == null ? 0 : t.length, i = Array(a); ++r < a; )
103
96
  i[r] = e(t[r], r, t);
104
97
  return i;
105
98
  }
106
- var st = Array.isArray, Lt = 1 / 0, ut = R ? R.prototype : void 0, lt = ut ? ut.toString : void 0;
107
- function _t(t) {
99
+ var rt = Array.isArray, Dt = 1 / 0, ot = D ? D.prototype : void 0, ct = ot ? ot.toString : void 0;
100
+ function pt(t) {
108
101
  if (typeof t == "string")
109
102
  return t;
110
- if (st(t))
111
- return Rt(t, _t) + "";
112
- if (it(t))
113
- return lt ? lt.call(t) : "";
103
+ if (rt(t))
104
+ return Et(t, pt) + "";
105
+ if (et(t))
106
+ return ct ? ct.call(t) : "";
114
107
  var e = t + "";
115
- return e == "0" && 1 / t == -Lt ? "-0" : e;
108
+ return e == "0" && 1 / t == -Dt ? "-0" : e;
116
109
  }
117
- function bt(t) {
110
+ function yt(t) {
118
111
  var e = typeof t;
119
112
  return t != null && (e == "object" || e == "function");
120
113
  }
121
- var Mt = "[object AsyncFunction]", Nt = "[object Function]", Ht = "[object GeneratorFunction]", Ut = "[object Proxy]";
122
- function Gt(t) {
123
- if (!bt(t))
114
+ var Ft = "[object AsyncFunction]", Rt = "[object Function]", Lt = "[object GeneratorFunction]", Mt = "[object Proxy]";
115
+ function Nt(t) {
116
+ if (!yt(t))
124
117
  return !1;
125
- var e = yt(t);
126
- return e == Nt || e == Ht || e == Mt || e == Ut;
118
+ var e = ft(t);
119
+ return e == Rt || e == Lt || e == Ft || e == Mt;
127
120
  }
128
- var rt = at["__core-js_shared__"], ft = function() {
129
- var t = /[^.]+$/.exec(rt && rt.keys && rt.keys.IE_PROTO || "");
121
+ var Z = tt["__core-js_shared__"], ht = function() {
122
+ var t = /[^.]+$/.exec(Z && Z.keys && Z.keys.IE_PROTO || "");
130
123
  return t ? "Symbol(src)_1." + t : "";
131
124
  }();
132
- function Kt(t) {
133
- return !!ft && ft in t;
125
+ function Ht(t) {
126
+ return !!ht && ht in t;
134
127
  }
135
- var Bt = Function.prototype, qt = Bt.toString;
136
- function Wt(t) {
128
+ var Ut = Function.prototype, Gt = Ut.toString;
129
+ function Kt(t) {
137
130
  if (t != null) {
138
131
  try {
139
- return qt.call(t);
132
+ return Gt.call(t);
140
133
  } catch {
141
134
  }
142
135
  try {
@@ -146,157 +139,157 @@ function Wt(t) {
146
139
  }
147
140
  return "";
148
141
  }
149
- var Jt = /[\\^$.*+?()[\]{}|]/g, Vt = /^\[object .+?Constructor\]$/, Xt = Function.prototype, Yt = Object.prototype, Zt = Xt.toString, Qt = Yt.hasOwnProperty, te = RegExp(
150
- "^" + Zt.call(Qt).replace(Jt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
142
+ var Bt = /[\\^$.*+?()[\]{}|]/g, qt = /^\[object .+?Constructor\]$/, Wt = Function.prototype, Jt = Object.prototype, Vt = Wt.toString, Xt = Jt.hasOwnProperty, Yt = RegExp(
143
+ "^" + Vt.call(Xt).replace(Bt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
151
144
  );
152
- function ee(t) {
153
- if (!bt(t) || Kt(t))
145
+ function Zt(t) {
146
+ if (!yt(t) || Ht(t))
154
147
  return !1;
155
- var e = Gt(t) ? te : Vt;
156
- return e.test(Wt(t));
148
+ var e = Nt(t) ? Yt : qt;
149
+ return e.test(Kt(t));
157
150
  }
158
- function re(t, e) {
151
+ function Qt(t, e) {
159
152
  return t == null ? void 0 : t[e];
160
153
  }
161
- function mt(t, e) {
162
- var r = re(t, e);
163
- return ee(r) ? r : void 0;
154
+ function gt(t, e) {
155
+ var r = Qt(t, e);
156
+ return Zt(r) ? r : void 0;
164
157
  }
165
- function ne(t, e) {
158
+ function te(t, e) {
166
159
  return t === e || t !== t && e !== e;
167
160
  }
168
- var ae = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ie = /^\w*$/;
169
- function se(t, e) {
170
- if (st(t))
161
+ var ee = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, re = /^\w*$/;
162
+ function ne(t, e) {
163
+ if (rt(t))
171
164
  return !1;
172
165
  var r = typeof t;
173
- return r == "number" || r == "symbol" || r == "boolean" || t == null || it(t) ? !0 : ie.test(t) || !ae.test(t) || e != null && t in Object(e);
166
+ return r == "number" || r == "symbol" || r == "boolean" || t == null || et(t) ? !0 : re.test(t) || !ee.test(t) || e != null && t in Object(e);
174
167
  }
175
- var U = mt(Object, "create");
176
- function oe() {
177
- this.__data__ = U ? U(null) : {}, this.size = 0;
168
+ var N = gt(Object, "create");
169
+ function ae() {
170
+ this.__data__ = N ? N(null) : {}, this.size = 0;
178
171
  }
179
- function ce(t) {
172
+ function ie(t) {
180
173
  var e = this.has(t) && delete this.__data__[t];
181
174
  return this.size -= e ? 1 : 0, e;
182
175
  }
183
- var he = "__lodash_hash_undefined__", ue = Object.prototype, le = ue.hasOwnProperty;
184
- function fe(t) {
176
+ var se = "__lodash_hash_undefined__", oe = Object.prototype, ce = oe.hasOwnProperty;
177
+ function he(t) {
185
178
  var e = this.__data__;
186
- if (U) {
179
+ if (N) {
187
180
  var r = e[t];
188
- return r === he ? void 0 : r;
181
+ return r === se ? void 0 : r;
189
182
  }
190
- return le.call(e, t) ? e[t] : void 0;
183
+ return ce.call(e, t) ? e[t] : void 0;
191
184
  }
192
- var de = Object.prototype, pe = de.hasOwnProperty;
193
- function ye(t) {
185
+ var ue = Object.prototype, le = ue.hasOwnProperty;
186
+ function fe(t) {
194
187
  var e = this.__data__;
195
- return U ? e[t] !== void 0 : pe.call(e, t);
188
+ return N ? e[t] !== void 0 : le.call(e, t);
196
189
  }
197
- var ge = "__lodash_hash_undefined__";
198
- function _e(t, e) {
190
+ var de = "__lodash_hash_undefined__";
191
+ function pe(t, e) {
199
192
  var r = this.__data__;
200
- return this.size += this.has(t) ? 0 : 1, r[t] = U && e === void 0 ? ge : e, this;
193
+ return this.size += this.has(t) ? 0 : 1, r[t] = N && e === void 0 ? de : e, this;
201
194
  }
202
- function E(t) {
195
+ function x(t) {
203
196
  var e = -1, r = t == null ? 0 : t.length;
204
197
  for (this.clear(); ++e < r; ) {
205
198
  var a = t[e];
206
199
  this.set(a[0], a[1]);
207
200
  }
208
201
  }
209
- E.prototype.clear = oe;
210
- E.prototype.delete = ce;
211
- E.prototype.get = fe;
212
- E.prototype.has = ye;
213
- E.prototype.set = _e;
214
- function be() {
202
+ x.prototype.clear = ae;
203
+ x.prototype.delete = ie;
204
+ x.prototype.get = he;
205
+ x.prototype.has = fe;
206
+ x.prototype.set = pe;
207
+ function ye() {
215
208
  this.__data__ = [], this.size = 0;
216
209
  }
217
- function Z(t, e) {
210
+ function J(t, e) {
218
211
  for (var r = t.length; r--; )
219
- if (ne(t[r][0], e))
212
+ if (te(t[r][0], e))
220
213
  return r;
221
214
  return -1;
222
215
  }
223
- var me = Array.prototype, Ce = me.splice;
224
- function we(t) {
225
- var e = this.__data__, r = Z(e, t);
216
+ var ge = Array.prototype, _e = ge.splice;
217
+ function be(t) {
218
+ var e = this.__data__, r = J(e, t);
226
219
  if (r < 0)
227
220
  return !1;
228
221
  var a = e.length - 1;
229
- return r == a ? e.pop() : Ce.call(e, r, 1), --this.size, !0;
222
+ return r == a ? e.pop() : _e.call(e, r, 1), --this.size, !0;
230
223
  }
231
- function Se(t) {
232
- var e = this.__data__, r = Z(e, t);
224
+ function me(t) {
225
+ var e = this.__data__, r = J(e, t);
233
226
  return r < 0 ? void 0 : e[r][1];
234
227
  }
235
- function Te(t) {
236
- return Z(this.__data__, t) > -1;
228
+ function Ce(t) {
229
+ return J(this.__data__, t) > -1;
237
230
  }
238
- function ve(t, e) {
239
- var r = this.__data__, a = Z(r, t);
231
+ function we(t, e) {
232
+ var r = this.__data__, a = J(r, t);
240
233
  return a < 0 ? (++this.size, r.push([t, e])) : r[a][1] = e, this;
241
234
  }
242
- function L(t) {
235
+ function F(t) {
243
236
  var e = -1, r = t == null ? 0 : t.length;
244
237
  for (this.clear(); ++e < r; ) {
245
238
  var a = t[e];
246
239
  this.set(a[0], a[1]);
247
240
  }
248
241
  }
249
- L.prototype.clear = be;
250
- L.prototype.delete = we;
251
- L.prototype.get = Se;
252
- L.prototype.has = Te;
253
- L.prototype.set = ve;
254
- var je = mt(at, "Map");
255
- function Oe() {
242
+ F.prototype.clear = ye;
243
+ F.prototype.delete = be;
244
+ F.prototype.get = me;
245
+ F.prototype.has = Ce;
246
+ F.prototype.set = we;
247
+ var Se = gt(tt, "Map");
248
+ function Te() {
256
249
  this.size = 0, this.__data__ = {
257
- hash: new E(),
258
- map: new (je || L)(),
259
- string: new E()
250
+ hash: new x(),
251
+ map: new (Se || F)(),
252
+ string: new x()
260
253
  };
261
254
  }
262
- function ke(t) {
255
+ function ve(t) {
263
256
  var e = typeof t;
264
257
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
265
258
  }
266
- function Q(t, e) {
259
+ function V(t, e) {
267
260
  var r = t.__data__;
268
- return ke(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
261
+ return ve(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
269
262
  }
270
- function ze(t) {
271
- var e = Q(this, t).delete(t);
263
+ function je(t) {
264
+ var e = V(this, t).delete(t);
272
265
  return this.size -= e ? 1 : 0, e;
273
266
  }
274
- function Ae(t) {
275
- return Q(this, t).get(t);
267
+ function Oe(t) {
268
+ return V(this, t).get(t);
276
269
  }
277
- function $e(t) {
278
- return Q(this, t).has(t);
270
+ function ke(t) {
271
+ return V(this, t).has(t);
279
272
  }
280
- function Pe(t, e) {
281
- var r = Q(this, t), a = r.size;
273
+ function ze(t, e) {
274
+ var r = V(this, t), a = r.size;
282
275
  return r.set(t, e), this.size += r.size == a ? 0 : 1, this;
283
276
  }
284
- function D(t) {
277
+ function E(t) {
285
278
  var e = -1, r = t == null ? 0 : t.length;
286
279
  for (this.clear(); ++e < r; ) {
287
280
  var a = t[e];
288
281
  this.set(a[0], a[1]);
289
282
  }
290
283
  }
291
- D.prototype.clear = Oe;
292
- D.prototype.delete = ze;
293
- D.prototype.get = Ae;
294
- D.prototype.has = $e;
295
- D.prototype.set = Pe;
296
- var Ie = "Expected a function";
297
- function ot(t, e) {
284
+ E.prototype.clear = Te;
285
+ E.prototype.delete = je;
286
+ E.prototype.get = Oe;
287
+ E.prototype.has = ke;
288
+ E.prototype.set = ze;
289
+ var Ae = "Expected a function";
290
+ function nt(t, e) {
298
291
  if (typeof t != "function" || e != null && typeof e != "function")
299
- throw new TypeError(Ie);
292
+ throw new TypeError(Ae);
300
293
  var r = function() {
301
294
  var a = arguments, i = e ? e.apply(this, a) : a[0], n = r.cache;
302
295
  if (n.has(i))
@@ -304,70 +297,66 @@ function ot(t, e) {
304
297
  var g = t.apply(this, a);
305
298
  return r.cache = n.set(i, g) || n, g;
306
299
  };
307
- return r.cache = new (ot.Cache || D)(), r;
300
+ return r.cache = new (nt.Cache || E)(), r;
308
301
  }
309
- ot.Cache = D;
310
- var xe = 500;
311
- function Ee(t) {
312
- var e = ot(t, function(a) {
313
- return r.size === xe && r.clear(), a;
302
+ nt.Cache = E;
303
+ var $e = 500;
304
+ function Pe(t) {
305
+ var e = nt(t, function(a) {
306
+ return r.size === $e && r.clear(), a;
314
307
  }), r = e.cache;
315
308
  return e;
316
309
  }
317
- var De = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Fe = /\\(\\)?/g, Re = Ee(function(t) {
310
+ var Ie = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, xe = /\\(\\)?/g, Ee = Pe(function(t) {
318
311
  var e = [];
319
- return t.charCodeAt(0) === 46 && e.push(""), t.replace(De, function(r, a, i, n) {
320
- e.push(i ? n.replace(Fe, "$1") : a || r);
312
+ return t.charCodeAt(0) === 46 && e.push(""), t.replace(Ie, function(r, a, i, n) {
313
+ e.push(i ? n.replace(xe, "$1") : a || r);
321
314
  }), e;
322
315
  });
323
- function Le(t) {
324
- return t == null ? "" : _t(t);
316
+ function De(t) {
317
+ return t == null ? "" : pt(t);
325
318
  }
326
- function Me(t, e) {
327
- return st(t) ? t : se(t, e) ? [t] : Re(Le(t));
319
+ function Fe(t, e) {
320
+ return rt(t) ? t : ne(t, e) ? [t] : Ee(De(t));
328
321
  }
329
- var Ne = 1 / 0;
330
- function He(t) {
331
- if (typeof t == "string" || it(t))
322
+ var Re = 1 / 0;
323
+ function Le(t) {
324
+ if (typeof t == "string" || et(t))
332
325
  return t;
333
326
  var e = t + "";
334
- return e == "0" && 1 / t == -Ne ? "-0" : e;
327
+ return e == "0" && 1 / t == -Re ? "-0" : e;
335
328
  }
336
- function Ue(t, e) {
337
- e = Me(e, t);
329
+ function Me(t, e) {
330
+ e = Fe(e, t);
338
331
  for (var r = 0, a = e.length; t != null && r < a; )
339
- t = t[He(e[r++])];
332
+ t = t[Le(e[r++])];
340
333
  return r && r == a ? t : void 0;
341
334
  }
342
- function Ge(t, e, r) {
343
- var a = t == null ? void 0 : Ue(t, e);
335
+ function Ne(t, e, r) {
336
+ var a = t == null ? void 0 : Me(t, e);
344
337
  return a === void 0 ? r : a;
345
338
  }
346
- const Ct = Symbol("detach"), ct = Symbol("chunkable");
347
- function tr() {
348
- return Reflect.metadata(Ct, !0);
339
+ const _t = Symbol("detach"), at = Symbol("chunkable");
340
+ function Ye() {
341
+ return Reflect.metadata(_t, !0);
349
342
  }
350
- function er(t) {
351
- return Reflect.metadata(ct, t);
343
+ function Ze(t) {
344
+ return Reflect.metadata(at, t);
352
345
  }
353
- function Ke(t, e) {
354
- return !!Reflect.getMetadata(Ct, t, e);
346
+ function He(t, e) {
347
+ return !!Reflect.getMetadata(_t, t, e);
355
348
  }
356
- function Be(t, e) {
357
- return !!Reflect.getMetadata(ct, t, e);
349
+ function Ue(t, e) {
350
+ return !!Reflect.getMetadata(at, t, e);
358
351
  }
359
- function qe(t, e) {
360
- return Reflect.getMetadata(ct, t, e);
352
+ function Ge(t, e) {
353
+ return Reflect.getMetadata(at, t, e);
361
354
  }
362
- const We = (t) => gt(t) && !!Ge(t, "speckle_type");
363
- var P, N, I, H, F, X, G, nt, Y, wt;
364
- class Je {
365
- constructor(e, r = 1e3, a = et) {
366
- y(this, P);
367
- y(this, I);
368
- y(this, F);
369
- y(this, G);
370
- y(this, Y);
355
+ const Ke = (t) => dt(t) && !!Ne(t, "speckle_type");
356
+ var h, L, M, W, Q, bt;
357
+ class Be {
358
+ constructor(e, r = 1e3, a = Y) {
359
+ j(this, h);
371
360
  S(this, "chunkSize");
372
361
  S(this, "detachLineage");
373
362
  S(this, "lineage");
@@ -376,171 +365,164 @@ class Je {
376
365
  S(this, "transport");
377
366
  S(this, "uniqueId");
378
367
  S(this, "hashingFunction");
379
- this.chunkSize = r, this.detachLineage = [!0], this.lineage = [], this.familyTree = {}, this.closureTable = {}, this.transport = e, this.uniqueId = 0, this.hashingFunction = a || et;
368
+ this.chunkSize = r, this.detachLineage = [!0], this.lineage = [], this.familyTree = {}, this.closureTable = {}, this.transport = e, this.uniqueId = 0, this.hashingFunction = a || Y;
380
369
  }
381
370
  async write(e) {
382
- return await p(this, P, N).call(this, e, !0);
371
+ return await y(this, h, L).call(this, e, !0);
383
372
  }
384
373
  dispose() {
385
374
  this.detachLineage = [], this.lineage = [], this.familyTree = {}, this.closureTable = {}, this.transport = null;
386
375
  }
387
376
  }
388
- P = new WeakSet(), N = async function(e, r) {
377
+ h = new WeakSet(), L = async function(e, r) {
389
378
  const a = `${this.uniqueId++}-obj`;
390
379
  this.lineage.push(a);
391
380
  const i = { speckle_type: e.speckle_type || "Base" };
392
381
  for (const o in e) {
393
- const u = e[o];
394
- if (u === void 0 || o === "id" || o.startsWith("_"))
395
- continue;
396
- if (typeof u != "object") {
397
- i[o] = u;
382
+ const l = e[o];
383
+ if (l === void 0 || o === "id" || o.startsWith("_")) continue;
384
+ if (typeof l != "object") {
385
+ i[o] = l;
398
386
  continue;
399
387
  }
400
- const v = o.startsWith("@") || Ke(e, o), l = Array.isArray(u), s = l ? Be(e, o) || o.match(/^@\((\d*)\)/) : !1;
401
- if (l && s && u.length !== 0 && typeof u[0] != "object") {
388
+ const v = o.startsWith("@") || He(e, o), f = Array.isArray(l), s = f ? Ue(e, o) || o.match(/^@\((\d*)\)/) : !1;
389
+ if (f && s && l.length !== 0 && typeof l[0] != "object") {
402
390
  let c = this.chunkSize;
403
- typeof s == "boolean" ? c = qe(e, o) : c = s[1] !== "" ? parseInt(s[1]) : this.chunkSize;
404
- const h = [];
405
- let d = new dt(), m = 0;
406
- for (const C of u)
407
- m === c && (h.push(await p(this, G, nt).call(this, d)), d = new dt(), m = 0), d.data.push(C), m++;
408
- d.data.length !== 0 && h.push(await p(this, G, nt).call(this, d)), typeof s == "boolean" ? i[o] = h : i[o.replace(s[0], "")] = h;
391
+ typeof s == "boolean" ? c = Ge(e, o) : c = s[1] !== "" ? parseInt(s[1]) : this.chunkSize;
392
+ const u = [];
393
+ let p = new ut(), m = 0;
394
+ for (const C of l)
395
+ m === c && (u.push(await y(this, h, Q).call(this, p)), p = new ut(), m = 0), p.data.push(C), m++;
396
+ p.data.length !== 0 && u.push(await y(this, h, Q).call(this, p)), typeof s == "boolean" ? i[o] = u : i[o.replace(s[0], "")] = u;
409
397
  continue;
410
398
  }
411
- if (u.speckle_type) {
412
- const c = await p(this, I, H).call(this, {
413
- value: u,
399
+ if (l.speckle_type) {
400
+ const c = await y(this, h, M).call(this, {
401
+ value: l,
414
402
  isDetached: v
415
403
  });
416
- i[o] = v ? p(this, F, X).call(this, c.id) : c;
404
+ i[o] = v ? y(this, h, W).call(this, c.id) : c;
417
405
  continue;
418
406
  }
419
- i[o] = await p(this, I, H).call(this, {
420
- value: u,
407
+ i[o] = await y(this, h, M).call(this, {
408
+ value: l,
421
409
  isDetached: v
422
410
  });
423
411
  }
424
412
  const n = this.detachLineage.pop(), g = this.lineage.pop();
425
413
  if (this.familyTree[g]) {
426
414
  const o = {};
427
- Object.entries(this.familyTree[g]).forEach(([u, v]) => {
428
- o[u] = v - this.detachLineage.length;
415
+ Object.entries(this.familyTree[g]).forEach(([l, v]) => {
416
+ o[l] = v - this.detachLineage.length;
429
417
  }), i.totalChildrenCount = Object.keys(o).length, i.totalChildrenCount && (i.__closure = o);
430
418
  }
431
- const { hash: f, serializedObject: j, size: A } = p(this, Y, wt).call(this, i);
432
- return i.id = f, (n || r) && this.transport && await this.transport.write(j, A), r && this.transport && await this.transport.flush(), { hash: f, traversed: i };
433
- }, I = new WeakSet(), H = async function({
419
+ const { hash: d, serializedObject: O, size: $ } = y(this, h, bt).call(this, i);
420
+ return i.id = d, (n || r) && this.transport && await this.transport.write(O, $), r && this.transport && await this.transport.flush(), { hash: d, traversed: i };
421
+ }, M = async function({
434
422
  value: e,
435
423
  isDetached: r = !1
436
424
  }) {
437
- if (typeof e != "object")
438
- return e;
425
+ if (typeof e != "object") return e;
439
426
  if (Array.isArray(e)) {
440
427
  const a = e;
441
- if (a.length === 0)
442
- return e;
443
- if (typeof a[0] != "object")
444
- return a;
428
+ if (a.length === 0) return e;
429
+ if (typeof a[0] != "object") return a;
445
430
  if (!r)
446
431
  return Promise.all(
447
- e.map(async (n) => await p(this, I, H).call(this, { value: n }))
432
+ e.map(async (n) => await y(this, h, M).call(this, { value: n }))
448
433
  );
449
434
  const i = [];
450
435
  for (const n of e)
451
- if (We(n)) {
436
+ if (Ke(n)) {
452
437
  this.detachLineage.push(r);
453
- const { hash: g } = await p(this, P, N).call(this, n, !1);
454
- i.push(p(this, F, X).call(this, g));
438
+ const { hash: g } = await y(this, h, L).call(this, n, !1);
439
+ i.push(y(this, h, W).call(this, g));
455
440
  } else
456
- i.push(await p(this, I, H).call(this, { value: n, isDetached: r }));
441
+ i.push(await y(this, h, M).call(this, { value: n, isDetached: r }));
457
442
  return i;
458
443
  }
459
- if (!e.speckle_type)
460
- return e;
444
+ if (!e.speckle_type) return e;
461
445
  if (e.speckle_type)
462
- return this.detachLineage.push(r), (await p(this, P, N).call(this, e, !1)).traversed;
446
+ return this.detachLineage.push(r), (await y(this, h, L).call(this, e, !1)).traversed;
463
447
  throw new Error(`Unsupported type '${typeof e}': ${e}.`);
464
- }, F = new WeakSet(), X = function(e) {
448
+ }, W = function(e) {
465
449
  return this.lineage.forEach((r) => {
466
450
  this.familyTree[r] || (this.familyTree[r] = {}), (!this.familyTree[r][e] || this.familyTree[r][e] > this.detachLineage.length) && (this.familyTree[r][e] = this.detachLineage.length);
467
451
  }), {
468
452
  referencedId: e,
469
453
  speckle_type: "reference"
470
454
  };
471
- }, G = new WeakSet(), nt = async function(e) {
455
+ }, Q = async function(e) {
472
456
  this.detachLineage.push(!0);
473
- const { hash: r } = await p(this, P, N).call(this, e, !1);
474
- return p(this, F, X).call(this, r);
475
- }, Y = new WeakSet(), wt = function(e) {
457
+ const { hash: r } = await y(this, h, L).call(this, e, !1);
458
+ return y(this, h, W).call(this, r);
459
+ }, bt = function(e) {
476
460
  const r = JSON.stringify(e), a = this.hashingFunction(r), i = r.substring(0, 1) + `"id":"${a}",` + r.substring(1);
477
461
  return {
478
- hash: et(r),
462
+ hash: Y(r),
479
463
  serializedObject: i,
480
464
  size: r.length
481
465
  // approx, good enough as we're just limiting artificially batch sizes based on this
482
466
  };
483
467
  };
484
- class dt {
468
+ class ut {
485
469
  constructor() {
486
470
  S(this, "speckle_type");
487
471
  S(this, "data");
488
472
  this.data = [], this.speckle_type = "Speckle.Core.Models.DataChunk";
489
473
  }
490
474
  }
491
- var z, K, x, B, q, W, J, V;
492
- class Ve {
475
+ var A, H, I, U, G, K, B, q;
476
+ class qe {
493
477
  constructor(e, r, a, i) {
494
- y(this, z, void 0);
495
- y(this, K, void 0);
496
- y(this, x, void 0);
497
- y(this, B, void 0);
498
- y(this, q, void 0);
499
- y(this, W, void 0);
500
- y(this, J, void 0);
501
- y(this, V, void 0);
502
- b(this, K, (i == null ? void 0 : i.maxSize) || 2e5), b(this, J, (i == null ? void 0 : i.flushRetryCount) || 3), b(this, V, (i == null ? void 0 : i.flushTimeout) || 2 * 60 * 1e3), b(this, x, 0), b(this, B, e), b(this, q, r), b(this, W, a), b(this, z, []);
478
+ j(this, A);
479
+ j(this, H);
480
+ j(this, I);
481
+ j(this, U);
482
+ j(this, G);
483
+ j(this, K);
484
+ j(this, B);
485
+ j(this, q);
486
+ b(this, H, (i == null ? void 0 : i.maxSize) || 2e5), b(this, B, (i == null ? void 0 : i.flushRetryCount) || 3), b(this, q, (i == null ? void 0 : i.flushTimeout) || 2 * 60 * 1e3), b(this, I, 0), b(this, U, e), b(this, G, r), b(this, K, a), b(this, A, []);
503
487
  }
504
488
  async write(e, r) {
505
- T(this, z).push(e), b(this, x, T(this, x) + r), !(T(this, x) < T(this, K)) && await this.flush();
489
+ T(this, A).push(e), b(this, I, T(this, I) + r), !(T(this, I) < T(this, H)) && await this.flush();
506
490
  }
507
491
  async flush() {
508
- if (T(this, z).length === 0)
509
- return;
510
- const e = new FormData(), r = "[" + T(this, z).join(",") + "]";
492
+ if (T(this, A).length === 0) return;
493
+ const e = new FormData(), r = "[" + T(this, A).join(",") + "]";
511
494
  e.append("object-batch", new Blob([r], { type: "application/json" }));
512
- const a = new URL(`/objects/${T(this, q)}`, T(this, B)), i = await vt(
495
+ const a = new URL(`/objects/${T(this, G)}`, T(this, U)), i = await wt(
513
496
  async () => await Promise.race([
514
497
  fetch(a, {
515
498
  method: "POST",
516
- headers: { Authorization: `Bearer ${T(this, W)}` },
499
+ headers: { Authorization: `Bearer ${T(this, K)}` },
517
500
  body: e
518
501
  }),
519
- jt(T(this, V), "Object sender flush timed out")
502
+ St(T(this, q), "Object sender flush timed out")
520
503
  ]),
521
- T(this, J),
504
+ T(this, B),
522
505
  (n) => n * 1e3
523
506
  );
524
507
  if (i.status !== 201)
525
508
  throw new Error(
526
509
  `Unexpected error when sending data. Expected status 200, got ${i.status}`
527
510
  );
528
- b(this, z, []), b(this, x, 0);
511
+ b(this, A, []), b(this, I, 0);
529
512
  }
530
513
  dispose() {
531
- b(this, z, []);
514
+ b(this, A, []);
532
515
  }
533
516
  }
534
- z = new WeakMap(), K = new WeakMap(), x = new WeakMap(), B = new WeakMap(), q = new WeakMap(), W = new WeakMap(), J = new WeakMap(), V = new WeakMap();
535
- class rr {
517
+ A = new WeakMap(), H = new WeakMap(), I = new WeakMap(), U = new WeakMap(), G = new WeakMap(), K = new WeakMap(), B = new WeakMap(), q = new WeakMap();
518
+ class Qe {
536
519
  constructor(e) {
537
520
  S(this, "speckle_type");
538
521
  if (this.speckle_type = this.constructor.name, e)
539
- for (const r in e)
540
- this[r] = e[r];
522
+ for (const r in e) this[r] = e[r];
541
523
  }
542
524
  }
543
- const nr = async (t, {
525
+ const tr = async (t, {
544
526
  serverUrl: e = "https://app.speckle.systems",
545
527
  projectId: r,
546
528
  token: a,
@@ -548,20 +530,20 @@ const nr = async (t, {
548
530
  }) => {
549
531
  const n = performance.now();
550
532
  i == null || i.log("Starting to send");
551
- const g = new Ve(e, r, a), f = new Je(g);
552
- let j;
533
+ const g = new qe(e, r, a), d = new Be(g);
534
+ let O;
553
535
  try {
554
- j = await f.write(t);
536
+ O = await d.write(t);
555
537
  } finally {
556
- g.dispose(), f.dispose();
538
+ g.dispose(), d.dispose();
557
539
  }
558
- const A = performance.now();
559
- return i.log(`Finished sending in ${(A - n) / 1e3}s.`), j;
540
+ const $ = performance.now();
541
+ return i.log(`Finished sending in ${($ - n) / 1e3}s.`), O;
560
542
  };
561
543
  export {
562
- rr as Base,
563
- er as Chunkable,
564
- tr as Detach,
565
- nr as send
544
+ Qe as Base,
545
+ Ze as Chunkable,
546
+ Ye as Detach,
547
+ tr as send
566
548
  };
567
549
  //# sourceMappingURL=objectsender.js.map