@instantdb/react-common 1.0.2 → 1.0.3-branch-idb-fix.24363841776.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.
@@ -53,10 +53,10 @@ function Bs() {
53
53
  {
54
54
  for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), I = 1; I < m; I++)
55
55
  v[I - 1] = arguments[I];
56
- M("error", d, v);
56
+ R("error", d, v);
57
57
  }
58
58
  }
59
- function M(d, m, v) {
59
+ function R(d, m, v) {
60
60
  {
61
61
  var I = _.ReactDebugCurrentFrame, W = I.getStackAddendum();
62
62
  W !== "" && (m += "%s", v = v.concat([W]));
@@ -130,14 +130,14 @@ function Bs() {
130
130
  }
131
131
  return null;
132
132
  }
133
- var E = Object.assign, j = 0, R, U, L, A, k, K, H;
133
+ var E = Object.assign, j = 0, M, U, L, A, k, K, H;
134
134
  function Y() {
135
135
  }
136
136
  Y.__reactDisabledLog = !0;
137
137
  function oe() {
138
138
  {
139
139
  if (j === 0) {
140
- R = console.log, U = console.info, L = console.warn, A = console.error, k = console.group, K = console.groupCollapsed, H = console.groupEnd;
140
+ M = console.log, U = console.info, L = console.warn, A = console.error, k = console.group, K = console.groupCollapsed, H = console.groupEnd;
141
141
  var d = {
142
142
  configurable: !0,
143
143
  enumerable: !0,
@@ -167,7 +167,7 @@ function Bs() {
167
167
  };
168
168
  Object.defineProperties(console, {
169
169
  log: E({}, d, {
170
- value: R
170
+ value: M
171
171
  }),
172
172
  info: E({}, d, {
173
173
  value: U
@@ -192,27 +192,27 @@ function Bs() {
192
192
  j < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
193
  }
194
194
  }
195
- var ge = _.ReactCurrentDispatcher, Mt;
195
+ var ge = _.ReactCurrentDispatcher, Rt;
196
196
  function ct(d, m, v) {
197
197
  {
198
- if (Mt === void 0)
198
+ if (Rt === void 0)
199
199
  try {
200
200
  throw Error();
201
201
  } catch (W) {
202
202
  var I = W.stack.trim().match(/\n( *(at )?)/);
203
- Mt = I && I[1] || "";
203
+ Rt = I && I[1] || "";
204
204
  }
205
205
  return `
206
- ` + Mt + d;
206
+ ` + Rt + d;
207
207
  }
208
208
  }
209
- var Rt = !1, ut;
209
+ var Mt = !1, ut;
210
210
  {
211
211
  var ms = typeof WeakMap == "function" ? WeakMap : Map;
212
212
  ut = new ms();
213
213
  }
214
214
  function kn(d, m) {
215
- if (!d || Rt)
215
+ if (!d || Mt)
216
216
  return "";
217
217
  {
218
218
  var v = ut.get(d);
@@ -220,7 +220,7 @@ function Bs() {
220
220
  return v;
221
221
  }
222
222
  var I;
223
- Rt = !0;
223
+ Mt = !0;
224
224
  var W = Error.prepareStackTrace;
225
225
  Error.prepareStackTrace = void 0;
226
226
  var V;
@@ -277,7 +277,7 @@ function Bs() {
277
277
  }
278
278
  }
279
279
  } finally {
280
- Rt = !1, ge.current = V, Be(), Error.prepareStackTrace = W;
280
+ Mt = !1, ge.current = V, Be(), Error.prepareStackTrace = W;
281
281
  }
282
282
  var Le = d ? d.displayName || d.name : "", Ce = Le ? ct(Le) : "";
283
283
  return typeof d == "function" && ut.set(d, Ce), Ce;
@@ -365,11 +365,11 @@ function Bs() {
365
365
  function Pn(d) {
366
366
  return "" + d;
367
367
  }
368
- function Mn(d) {
368
+ function Rn(d) {
369
369
  if (Os(d))
370
370
  return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", As(d)), Pn(d);
371
371
  }
372
- var Rn = _.ReactCurrentOwner, Es = {
372
+ var Mn = _.ReactCurrentOwner, Es = {
373
373
  key: !0,
374
374
  ref: !0,
375
375
  __self: !0,
@@ -392,7 +392,7 @@ function Bs() {
392
392
  return d.key !== void 0;
393
393
  }
394
394
  function Is(d, m) {
395
- typeof d.ref == "string" && Rn.current;
395
+ typeof d.ref == "string" && Mn.current;
396
396
  }
397
397
  function Ps(d, m) {
398
398
  {
@@ -405,7 +405,7 @@ function Bs() {
405
405
  });
406
406
  }
407
407
  }
408
- function Ms(d, m) {
408
+ function Rs(d, m) {
409
409
  {
410
410
  var v = function() {
411
411
  $n || ($n = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", m));
@@ -416,7 +416,7 @@ function Bs() {
416
416
  });
417
417
  }
418
418
  }
419
- var Rs = function(d, m, v, I, W, V, D) {
419
+ var Ms = function(d, m, v, I, W, V, D) {
420
420
  var $ = {
421
421
  // This tag allows us to uniquely identify this as a React Element
422
422
  $$typeof: t,
@@ -448,7 +448,7 @@ function Bs() {
448
448
  function js(d, m, v, I, W) {
449
449
  {
450
450
  var V, D = {}, $ = null, ae = null;
451
- v !== void 0 && (Mn(v), $ = "" + v), Cs(m) && (Mn(m.key), $ = "" + m.key), ks(m) && (ae = m.ref, Is(m, W));
451
+ v !== void 0 && (Rn(v), $ = "" + v), Cs(m) && (Rn(m.key), $ = "" + m.key), ks(m) && (ae = m.ref, Is(m, W));
452
452
  for (V in m)
453
453
  Ge.call(m, V) && !Es.hasOwnProperty(V) && (D[V] = m[V]);
454
454
  if (d && d.defaultProps) {
@@ -458,9 +458,9 @@ function Bs() {
458
458
  }
459
459
  if ($ || ae) {
460
460
  var te = typeof d == "function" ? d.displayName || d.name || "Unknown" : d;
461
- $ && Ps(D, te), ae && Ms(D, te);
461
+ $ && Ps(D, te), ae && Rs(D, te);
462
462
  }
463
- return Rs(d, $, ae, W, I, Rn.current, D);
463
+ return Ms(d, $, ae, W, I, Mn.current, D);
464
464
  }
465
465
  }
466
466
  var $t = _.ReactCurrentOwner, xn = _.ReactDebugCurrentFrame;
@@ -762,7 +762,7 @@ function Jt(n) {
762
762
  for (; n.finalities.revoke.length > 0; )
763
763
  n.finalities.revoke.pop()();
764
764
  }
765
- function Me(n, e) {
765
+ function Re(n, e) {
766
766
  return e ? n : [""].concat(n).map((t) => {
767
767
  const r = `${t}`;
768
768
  return r.indexOf("/") === -1 && r.indexOf("~") === -1 ? r : r.replace(/~/g, "~0").replace(/\//g, "~1");
@@ -793,7 +793,7 @@ function Ys(n) {
793
793
  }), e;
794
794
  }
795
795
  const Zs = Object.prototype.propertyIsEnumerable;
796
- function Mr(n, e) {
796
+ function Rr(n, e) {
797
797
  let t;
798
798
  if (Array.isArray(n))
799
799
  return Array.prototype.concat.call(n);
@@ -829,7 +829,7 @@ function Mr(n, e) {
829
829
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
830
830
  }
831
831
  function ce(n) {
832
- n.copy || (n.copy = Mr(n.original, n.options));
832
+ n.copy || (n.copy = Rr(n.original, n.options));
833
833
  }
834
834
  function Ze(n) {
835
835
  if (!me(n))
@@ -929,7 +929,7 @@ function _n(n, e) {
929
929
  } else
930
930
  n.forEach((r, s) => e(s, r, n));
931
931
  }
932
- function Rr(n, e, t) {
932
+ function Mr(n, e, t) {
933
933
  if ($e(n) || !me(n, t) || e.has(n) || Object.isFrozen(n))
934
934
  return;
935
935
  const r = n instanceof Set, s = r ? /* @__PURE__ */ new Map() : void 0;
@@ -941,7 +941,7 @@ function Rr(n, e, t) {
941
941
  const u = !((a = c.assignedMap) === null || a === void 0) && a.size || c.operated ? c.copy : c.original;
942
942
  ot(r ? s : n, i, u);
943
943
  } else
944
- Rr(o, e, t);
944
+ Mr(o, e, t);
945
945
  }), s) {
946
946
  const i = n, o = Array.from(i);
947
947
  i.clear(), o.forEach((a) => {
@@ -951,7 +951,7 @@ function Rr(n, e, t) {
951
951
  }
952
952
  function Xs(n, e) {
953
953
  const t = n.type === 3 ? n.setMap : n.copy;
954
- n.finalities.revoke.length > 1 && n.assignedMap.get(e) && t && Rr(Ee(t, e), n.finalities.handledSet, n.options);
954
+ n.finalities.revoke.length > 1 && n.assignedMap.get(e) && t && Mr(Ee(t, e), n.finalities.handledSet, n.options);
955
955
  }
956
956
  function Yt(n) {
957
957
  n.type === 3 && n.copy && (n.copy.clear(), n.setMap.forEach((e) => {
@@ -986,7 +986,7 @@ function ei(n, e, t, r, s) {
986
986
  c.length < i.length && ([i, c] = [c, i], [t, r] = [r, t]);
987
987
  for (let u = 0; u < i.length; u += 1)
988
988
  if (o.get(u.toString()) && c[u] !== i[u]) {
989
- const l = e.concat([u]), f = Me(l, s);
989
+ const l = e.concat([u]), f = Re(l, s);
990
990
  t.push({
991
991
  op: X.Replace,
992
992
  path: f,
@@ -1000,7 +1000,7 @@ function ei(n, e, t, r, s) {
1000
1000
  });
1001
1001
  }
1002
1002
  for (let u = i.length; u < c.length; u += 1) {
1003
- const l = e.concat([u]), f = Me(l, s);
1003
+ const l = e.concat([u]), f = Re(l, s);
1004
1004
  t.push({
1005
1005
  op: X.Add,
1006
1006
  path: f,
@@ -1011,7 +1011,7 @@ function ei(n, e, t, r, s) {
1011
1011
  if (i.length < c.length) {
1012
1012
  const { arrayLengthAssignment: u = !0 } = a.enablePatches;
1013
1013
  if (u) {
1014
- const l = e.concat(["length"]), f = Me(l, s);
1014
+ const l = e.concat(["length"]), f = Re(l, s);
1015
1015
  r.push({
1016
1016
  op: X.Replace,
1017
1017
  path: f,
@@ -1019,7 +1019,7 @@ function ei(n, e, t, r, s) {
1019
1019
  });
1020
1020
  } else
1021
1021
  for (let l = c.length; i.length < l; l -= 1) {
1022
- const f = e.concat([l - 1]), h = Me(f, s);
1022
+ const f = e.concat([l - 1]), h = Re(f, s);
1023
1023
  r.push({
1024
1024
  op: X.Remove,
1025
1025
  path: h
@@ -1032,7 +1032,7 @@ function ti({ original: n, copy: e, assignedMap: t }, r, s, i, o) {
1032
1032
  const u = Ee(n, c), l = mt(Ee(e, c)), f = a ? rt(n, c) ? X.Replace : X.Add : X.Remove;
1033
1033
  if (Oe(u, l) && f === X.Replace)
1034
1034
  return;
1035
- const h = r.concat(c), y = Me(h, o);
1035
+ const h = r.concat(c), y = Re(h, o);
1036
1036
  s.push(f === X.Remove ? { op: f, path: y } : { op: f, path: y, value: l }), i.push(f === X.Add ? { op: X.Remove, path: y } : f === X.Remove ? { op: X.Add, path: y, value: u } : { op: X.Replace, path: y, value: u });
1037
1037
  });
1038
1038
  }
@@ -1040,7 +1040,7 @@ function ni({ original: n, copy: e }, t, r, s, i) {
1040
1040
  let o = 0;
1041
1041
  n.forEach((a) => {
1042
1042
  if (!e.has(a)) {
1043
- const c = t.concat([o]), u = Me(c, i);
1043
+ const c = t.concat([o]), u = Re(c, i);
1044
1044
  r.push({
1045
1045
  op: X.Remove,
1046
1046
  path: u,
@@ -1054,7 +1054,7 @@ function ni({ original: n, copy: e }, t, r, s, i) {
1054
1054
  o += 1;
1055
1055
  }), o = 0, e.forEach((a) => {
1056
1056
  if (!n.has(a)) {
1057
- const c = t.concat([o]), u = Me(c, i);
1057
+ const c = t.concat([o]), u = Re(c, i);
1058
1058
  r.push({
1059
1059
  op: X.Add,
1060
1060
  path: u,
@@ -1471,7 +1471,7 @@ function xr(n) {
1471
1471
  return t.original;
1472
1472
  let s;
1473
1473
  function i() {
1474
- s = r === 2 ? bn(n) ? new Map(n) : new (Object.getPrototypeOf(n)).constructor(n) : r === 3 ? Array.from(t.setMap.values()) : Mr(n, t == null ? void 0 : t.options);
1474
+ s = r === 2 ? bn(n) ? new Map(n) : new (Object.getPrototypeOf(n)).constructor(n) : r === 3 ? Array.from(t.setMap.values()) : Rr(n, t == null ? void 0 : t.options);
1475
1475
  }
1476
1476
  if (t) {
1477
1477
  t.finalized = !0;
@@ -1537,7 +1537,7 @@ const ai = (n) => function e(t, r, s) {
1537
1537
  } catch (O) {
1538
1538
  throw Jt(x(S)), O;
1539
1539
  }
1540
- const M = (O) => {
1540
+ const R = (O) => {
1541
1541
  const F = x(S);
1542
1542
  if (!$e(O)) {
1543
1543
  if (O !== void 0 && !Oe(O, S) && (F != null && F.operated))
@@ -1564,9 +1564,9 @@ const ai = (n) => function e(t, r, s) {
1564
1564
  }
1565
1565
  return _([O]);
1566
1566
  };
1567
- return T instanceof Promise ? T.then(M, (O) => {
1567
+ return T instanceof Promise ? T.then(R, (O) => {
1568
1568
  throw Jt(x(S)), O;
1569
- }) : M(T);
1569
+ }) : R(T);
1570
1570
  }, Ot = ai();
1571
1571
  Object.prototype.constructor.toString();
1572
1572
  function Dr(n, e) {
@@ -1966,7 +1966,7 @@ function Ct(n) {
1966
1966
  throw new Error(`Invalid date value \`${n}\`. Expected a date, number, or string, got type ${typeof n}.`);
1967
1967
  }
1968
1968
  }
1969
- class Re {
1969
+ class Me {
1970
1970
  constructor(e, t) {
1971
1971
  p(this, "attrs");
1972
1972
  p(this, "linkIndex");
@@ -2099,9 +2099,9 @@ function Kr(n, e) {
2099
2099
  }
2100
2100
  function qr(n, e) {
2101
2101
  if (n)
2102
- return new Re(n.attrs, n.linkIndex);
2102
+ return new Me(n.attrs, n.linkIndex);
2103
2103
  if (e && "__type" in e)
2104
- return new Re(e.attrs, e.linkIndex);
2104
+ return new Me(e.attrs, e.linkIndex);
2105
2105
  }
2106
2106
  function Ci(n, e) {
2107
2107
  return Qe(n.eav, [e]) !== void 0;
@@ -2220,13 +2220,13 @@ function Qr(n, e, t) {
2220
2220
  n[s] = r[s];
2221
2221
  });
2222
2222
  }
2223
- function Mi(n, [e]) {
2223
+ function Ri(n, [e]) {
2224
2224
  n.addAttr(e);
2225
2225
  }
2226
2226
  function Br(n) {
2227
2227
  return fe(n.eav, 3);
2228
2228
  }
2229
- function Ri(n, e, [t]) {
2229
+ function Mi(n, e, [t]) {
2230
2230
  if (!e.getAttr(t))
2231
2231
  return;
2232
2232
  const r = Br(n).filter(([s, i]) => i !== t);
@@ -2251,10 +2251,10 @@ function $i(n, e, t) {
2251
2251
  nn(n, e, s);
2252
2252
  break;
2253
2253
  case "add-attr":
2254
- Mi(e, s);
2254
+ Ri(e, s);
2255
2255
  break;
2256
2256
  case "delete-attr":
2257
- Ri(n, e, s);
2257
+ Mi(n, e, s);
2258
2258
  break;
2259
2259
  case "update-attr":
2260
2260
  ji(n, e, s);
@@ -2425,7 +2425,7 @@ function Ni(n, e, t) {
2425
2425
  });
2426
2426
  }, {
2427
2427
  mark: (s) => {
2428
- if (s instanceof Re)
2428
+ if (s instanceof Me)
2429
2429
  return "immutable";
2430
2430
  }
2431
2431
  });
@@ -2792,11 +2792,11 @@ function Oo(n, e, t, { etype: r, level: s, form: i }, o) {
2792
2792
  var g, w, S;
2793
2793
  const b = !!(e.cardinalityInference && ((S = (w = (g = t.linkIndex) == null ? void 0 : g[r]) == null ? void 0 : w[y]) != null && S.isSingular));
2794
2794
  try {
2795
- const [_, T, M] = Ao(n, t, r, s, y, u), O = es(e, t, {
2795
+ const [_, T, R] = Ao(n, t, r, s, y, u), O = es(e, t, {
2796
2796
  etype: _,
2797
2797
  level: T,
2798
2798
  form: i[y],
2799
- join: M
2799
+ join: R
2800
2800
  }), F = b ? O[0] : O;
2801
2801
  return { [y]: F };
2802
2802
  } catch (_) {
@@ -2845,13 +2845,13 @@ function Po(n, e, t) {
2845
2845
  const r = Object.keys(t)[0];
2846
2846
  return re(n, e, r);
2847
2847
  }
2848
- function Mo(n, e, t, r) {
2848
+ function Ro(n, e, t, r) {
2849
2849
  if (t)
2850
2850
  return Io(n, t);
2851
2851
  if (r)
2852
2852
  return Po(n, e, r);
2853
2853
  }
2854
- function Ro(n, e, t) {
2854
+ function Mo(n, e, t) {
2855
2855
  var s, i;
2856
2856
  if (!Array.isArray(t.fields))
2857
2857
  return Li(n, e);
@@ -2870,13 +2870,13 @@ function jo(n, e, { etype: t, pageInfo: r, dq: s, form: i }) {
2870
2870
  var g, w;
2871
2871
  const o = (g = i == null ? void 0 : i.$) == null ? void 0 : g.order, a = Xr(i), c = $o(i);
2872
2872
  let u = Hi(n, s);
2873
- const l = r == null ? void 0 : r["start-cursor"], f = r == null ? void 0 : r["end-cursor"], h = Mo(e, t, l, o);
2873
+ const l = r == null ? void 0 : r["start-cursor"], f = r == null ? void 0 : r["end-cursor"], h = Ro(e, t, l, o);
2874
2874
  if (h && ((w = h == null ? void 0 : h["forward-identity"]) == null ? void 0 : w[2]) !== "id") {
2875
2875
  const S = h["checked-data-type"] === "date", _ = h.id;
2876
2876
  u = u.map(([T]) => {
2877
2877
  var O, F, P, C, G;
2878
- let M = (G = (C = (P = (F = (O = n.eav.get(T)) == null ? void 0 : O.get(_)) == null ? void 0 : F.values()) == null ? void 0 : P.next()) == null ? void 0 : C.value) == null ? void 0 : G[2];
2879
- return S && (M = on(M)), [T, M];
2878
+ let R = (G = (C = (P = (F = (O = n.eav.get(T)) == null ? void 0 : O.get(_)) == null ? void 0 : F.values()) == null ? void 0 : P.next()) == null ? void 0 : C.value) == null ? void 0 : G[2];
2879
+ return S && (R = on(R)), [T, R];
2880
2880
  });
2881
2881
  }
2882
2882
  u.sort(c === "asc" ? function(_, T) {
@@ -2885,7 +2885,7 @@ function jo(n, e, { etype: t, pageInfo: r, dq: s, form: i }) {
2885
2885
  return Et(T, _, h == null ? void 0 : h["checked-data-type"]);
2886
2886
  });
2887
2887
  let y = {};
2888
- const b = Ro(e, t, s);
2888
+ const b = Mo(e, t, s);
2889
2889
  for (const S of u) {
2890
2890
  const [_] = S;
2891
2891
  if (y[_] || !a && l && h && ko(l, h, c, S) || !a && f && h && Co(f, h, c, S))
@@ -3372,9 +3372,9 @@ function ha({ attrsStore: n, schema: e }, t) {
3372
3372
  const _ = w[0];
3373
3373
  if (S) {
3374
3374
  f(g, S);
3375
- const T = o(g, S), M = a(g, S);
3376
- u(T), u(M);
3377
- const O = ((h = T == null ? void 0 : T["reverse-identity"]) == null ? void 0 : h[1]) || ((y = M == null ? void 0 : M["forward-identity"]) == null ? void 0 : y[1]) || S;
3375
+ const T = o(g, S), R = a(g, S);
3376
+ u(T), u(R);
3377
+ const O = ((h = T == null ? void 0 : T["reverse-identity"]) == null ? void 0 : h[1]) || ((y = R == null ? void 0 : R["forward-identity"]) == null ? void 0 : y[1]) || S;
3378
3378
  if (l(O, _))
3379
3379
  f(O, cn(_));
3380
3380
  else {
@@ -3393,11 +3393,11 @@ function ha({ attrsStore: n, schema: e }, t) {
3393
3393
  if (aa.has(g)) {
3394
3394
  const T = o(w, "id");
3395
3395
  u(T), T || c(pt(e, w, "id", { "unique?": !0 }));
3396
- for (const M of Object.keys(_)) {
3397
- const O = o(w, M);
3398
- if (u(O), ua.has(g) && (O || c(pt(e, w, M, M === "id" ? { "unique?": !0 } : null))), ca.has(g)) {
3399
- const F = a(w, M);
3400
- !O && !F && c(sr(e, w, M)), u(F);
3396
+ for (const R of Object.keys(_)) {
3397
+ const O = o(w, R);
3398
+ if (u(O), ua.has(g) && (O || c(pt(e, w, R, R === "id" ? { "unique?": !0 } : null))), ca.has(g)) {
3399
+ const F = a(w, R);
3400
+ !O && !F && c(sr(e, w, R)), u(F);
3401
3401
  }
3402
3402
  }
3403
3403
  }
@@ -3406,7 +3406,7 @@ function ha({ attrsStore: n, schema: e }, t) {
3406
3406
  const b = { ...n.attrs };
3407
3407
  for (const g of s)
3408
3408
  b[g.id] = g;
3409
- return [new Re(b, n.linkIndex), i];
3409
+ return [new Me(b, n.linkIndex), i];
3410
3410
  }
3411
3411
  return [n, i];
3412
3412
  }
@@ -3794,7 +3794,11 @@ class ss extends ya {
3794
3794
  r(o);
3795
3795
  }, i.onsuccess = (o) => {
3796
3796
  const c = o.target.result;
3797
- if (s) {
3797
+ if (c.onclose = () => {
3798
+ this._dbPromise = this._init();
3799
+ }, c.onversionchange = () => {
3800
+ c.close();
3801
+ }, s) {
3798
3802
  const u = Ta(this._appId, c).catch((l) => {
3799
3803
  _a("Error upgrading store from version 5 to 6.")(l);
3800
3804
  });
@@ -3813,66 +3817,62 @@ class ss extends ya {
3813
3817
  for (const i of ga)
3814
3818
  s.objectStoreNames.contains(i) || s.createObjectStore(i);
3815
3819
  }
3820
+ // Browsers can close IndexedDB connections unexpectedly (backgrounded tabs,
3821
+ // memory pressure, cross-tab version changes, etc.), causing
3822
+ // `db.transaction()` to throw InvalidStateError. This helper catches that
3823
+ // error and retries once with a fresh connection.
3824
+ async _withRetry(t) {
3825
+ try {
3826
+ const r = await this._dbPromise;
3827
+ return await t(r);
3828
+ } catch (r) {
3829
+ if (r instanceof DOMException && r.name === "InvalidStateError") {
3830
+ this._dbPromise = this._init();
3831
+ const s = await this._dbPromise;
3832
+ return await t(s);
3833
+ }
3834
+ throw r;
3835
+ }
3836
+ }
3816
3837
  async getItem(t) {
3817
- const r = await this._dbPromise;
3818
- return new Promise((s, i) => {
3838
+ return this._withRetry((r) => new Promise((s, i) => {
3819
3839
  const c = r.transaction([this._storeName], "readonly").objectStore(this._storeName).get(t);
3820
- c.onerror = (u) => {
3821
- i(u);
3822
- }, c.onsuccess = (u) => {
3840
+ c.onerror = () => {
3841
+ i(c.error);
3842
+ }, c.onsuccess = () => {
3823
3843
  c.result ? s(c.result) : s(null);
3824
3844
  };
3825
- });
3845
+ }));
3826
3846
  }
3827
3847
  async setItem(t, r) {
3828
- const s = await this._dbPromise;
3829
- return new Promise((i, o) => {
3830
- const u = s.transaction([this._storeName], "readwrite").objectStore(this._storeName).put(r, t);
3831
- u.onerror = (l) => {
3832
- o(l);
3833
- }, u.onsuccess = (l) => {
3834
- i();
3835
- };
3836
- });
3848
+ return this._withRetry((s) => new Promise((i, o) => {
3849
+ const a = s.transaction([this._storeName], "readwrite");
3850
+ a.objectStore(this._storeName).put(r, t), a.oncomplete = () => i(), a.onerror = () => o(a.error), a.onabort = () => o(a.error);
3851
+ }));
3837
3852
  }
3838
- // Performs all writes in a transaction so that all succeed or none succeed.
3839
3853
  async multiSet(t) {
3840
- const r = await this._dbPromise;
3841
- return new Promise((s, i) => {
3842
- const o = r.transaction([this._storeName], "readwrite"), a = o.objectStore(this._storeName), c = /* @__PURE__ */ new Set();
3843
- for (const [u, l] of t) {
3844
- const f = a.put(l, u);
3845
- c.add(f);
3846
- }
3847
- for (const u of c)
3848
- u.onerror = (l) => {
3849
- o.abort(), i(l);
3850
- }, u.onsuccess = (l) => {
3851
- c.delete(u), c.size === 0 && s();
3852
- };
3853
- });
3854
+ return this._withRetry((r) => new Promise((s, i) => {
3855
+ const o = r.transaction([this._storeName], "readwrite"), a = o.objectStore(this._storeName);
3856
+ for (const [c, u] of t)
3857
+ a.put(u, c);
3858
+ o.oncomplete = () => s(), o.onerror = () => i(o.error), o.onabort = () => i(o.error);
3859
+ }));
3854
3860
  }
3855
3861
  async removeItem(t) {
3856
- const r = await this._dbPromise;
3857
- return new Promise((s, i) => {
3858
- const c = r.transaction([this._storeName], "readwrite").objectStore(this._storeName).delete(t);
3859
- c.onerror = (u) => {
3860
- i(u);
3861
- }, c.onsuccess = (u) => {
3862
- s();
3863
- };
3864
- });
3862
+ return this._withRetry((r) => new Promise((s, i) => {
3863
+ const o = r.transaction([this._storeName], "readwrite");
3864
+ o.objectStore(this._storeName).delete(t), o.oncomplete = () => s(), o.onerror = () => i(o.error), o.onabort = () => i(o.error);
3865
+ }));
3865
3866
  }
3866
3867
  async getAllKeys() {
3867
- const t = await this._dbPromise;
3868
- return new Promise((r, s) => {
3868
+ return this._withRetry((t) => new Promise((r, s) => {
3869
3869
  const a = t.transaction([this._storeName], "readonly").objectStore(this._storeName).getAllKeys();
3870
- a.onerror = (c) => {
3871
- s(c);
3872
- }, a.onsuccess = (c) => {
3873
- r(a.result.filter((u) => typeof u == "string"));
3870
+ a.onerror = () => {
3871
+ s(a.error);
3872
+ }, a.onsuccess = () => {
3873
+ r(a.result.filter((c) => typeof c == "string"));
3874
3874
  };
3875
- });
3875
+ }));
3876
3876
  }
3877
3877
  }
3878
3878
  class is {
@@ -4036,7 +4036,7 @@ async function Pa({ apiURI: n, appId: e, fileName: t, refreshToken: r, metadata:
4036
4036
  });
4037
4037
  return i;
4038
4038
  }
4039
- async function Ma(n, e) {
4039
+ async function Ra(n, e) {
4040
4040
  return (await fetch(n, {
4041
4041
  method: "PUT",
4042
4042
  body: e,
@@ -4045,7 +4045,7 @@ async function Ma(n, e) {
4045
4045
  }
4046
4046
  })).ok;
4047
4047
  }
4048
- async function Ra({ apiURI: n, appId: e, path: t, refreshToken: r }) {
4048
+ async function Ma({ apiURI: n, appId: e, path: t, refreshToken: r }) {
4049
4049
  const { data: s } = await we(`${n}/storage/signed-download-url?app_id=${e}&filename=${encodeURIComponent(t)}`, {
4050
4050
  method: "GET",
4051
4051
  headers: {
@@ -4133,7 +4133,7 @@ function dr(n) {
4133
4133
  }, e;
4134
4134
  }, {});
4135
4135
  }
4136
- const us = "v1.0.2";
4136
+ const us = "v1.0.3-branch-idb-fix.24363841776.1";
4137
4137
  function xa(n, e) {
4138
4138
  return {
4139
4139
  info: n ? (...t) => console.info(...t, e()) : () => {
@@ -4921,12 +4921,12 @@ class Za {
4921
4921
  const T = f[_];
4922
4922
  if (Ci(T.store, w)) {
4923
4923
  mr(T.store, l.attrsStore, S);
4924
- const M = qt(s, T.store, l.attrsStore), O = Ha(T.store, l.attrsStore, S)[w];
4925
- M ? (h.push({
4924
+ const R = qt(s, T.store, l.attrsStore), O = Ha(T.store, l.attrsStore, S)[w];
4925
+ R ? (h.push({
4926
4926
  oldEntity: T.entity,
4927
- newEntity: M,
4927
+ newEntity: R,
4928
4928
  changedFields: O || {}
4929
- }), T.entity = M) : c.push(_), delete u[w];
4929
+ }), T.entity = R) : c.push(_), delete u[w];
4930
4930
  continue e;
4931
4931
  }
4932
4932
  }
@@ -5002,7 +5002,7 @@ function Xa({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
5002
5002
  const h = [], y = [], b = [];
5003
5003
  let g = !1, w = 0, S = 0;
5004
5004
  const _ = [], T = new TextEncoder();
5005
- function M() {
5005
+ function R() {
5006
5006
  f = !0;
5007
5007
  for (const A of h)
5008
5008
  A(a ?? void 0);
@@ -5054,7 +5054,7 @@ function Xa({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
5054
5054
  K > 0 && (w += H, S -= H, _.splice(0, K));
5055
5055
  }
5056
5056
  function z(A, k) {
5057
- a = k, M(), A.error(k), P();
5057
+ a = k, R(), A.error(k), P();
5058
5058
  }
5059
5059
  async function ee() {
5060
5060
  const A = await t({
@@ -5091,7 +5091,7 @@ function Xa({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
5091
5091
  function j(A) {
5092
5092
  return l ? (z(A, new ie("Stream has been closed.")), null) : o || (z(A, new ie("Stream has not been initialized.")), null);
5093
5093
  }
5094
- async function R(A) {
5094
+ async function M(A) {
5095
5095
  c = A;
5096
5096
  let k = !0, K = 0;
5097
5097
  for (; k; ) {
@@ -5155,7 +5155,7 @@ function Xa({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
5155
5155
  // browser restarts
5156
5156
  async start(A) {
5157
5157
  try {
5158
- await R(A);
5158
+ await M(A);
5159
5159
  } catch (k) {
5160
5160
  z(A, k);
5161
5161
  }
@@ -5175,7 +5175,7 @@ function Xa({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
5175
5175
  chunks: [],
5176
5176
  offset: w + S,
5177
5177
  isDone: !0
5178
- }) : P(), M();
5178
+ }) : P(), R();
5179
5179
  },
5180
5180
  abort(A) {
5181
5181
  o ? r({
@@ -5184,7 +5184,7 @@ function Xa({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
5184
5184
  offset: w + S,
5185
5185
  isDone: !0,
5186
5186
  abortReason: A
5187
- }) : P(), M();
5187
+ }) : P(), R();
5188
5188
  }
5189
5189
  }),
5190
5190
  addCompleteCb: F,
@@ -5280,16 +5280,16 @@ function tc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
5280
5280
  signal: z.signal
5281
5281
  });
5282
5282
  for (let q = 0; q < N.files.length; q++) {
5283
- const E = N.files[q + 1], R = await ee;
5284
- if (E && (ee = fetch(E.url, { signal: z.signal })), !R.ok) {
5283
+ const E = N.files[q + 1], M = await ee;
5284
+ if (E && (ee = fetch(E.url, { signal: z.signal })), !M.ok) {
5285
5285
  if (_++, _ > 10) {
5286
5286
  S(C, new ie("Unable to process stream."));
5287
5287
  return;
5288
5288
  }
5289
5289
  return { retry: !0 };
5290
5290
  }
5291
- if (R.body) {
5292
- const U = R.body.getReader();
5291
+ if (M.body) {
5292
+ const U = M.body.getReader();
5293
5293
  try {
5294
5294
  for (; ; ) {
5295
5295
  const { done: L, value: A } = await U.read();
@@ -5310,7 +5310,7 @@ function tc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
5310
5310
  U.releaseLock();
5311
5311
  }
5312
5312
  } else {
5313
- const U = await R.arrayBuffer();
5313
+ const U = await M.arrayBuffer();
5314
5314
  let L = U;
5315
5315
  if (i) {
5316
5316
  z.abort();
@@ -5336,7 +5336,7 @@ function tc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
5336
5336
  }
5337
5337
  }
5338
5338
  }
5339
- async function M(P) {
5339
+ async function R(P) {
5340
5340
  let C = !0, G = 0;
5341
5341
  for (; C; ) {
5342
5342
  C = !1;
@@ -5373,7 +5373,7 @@ function tc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
5373
5373
  return {
5374
5374
  stream: new O({
5375
5375
  start(P) {
5376
- M(P);
5376
+ R(P);
5377
5377
  },
5378
5378
  cancel(P) {
5379
5379
  i = !0, c && r({ eventId: c }), b();
@@ -6024,14 +6024,14 @@ class yc {
6024
6024
  const { q: y, result: b } = t, g = ne(y);
6025
6025
  if (!this._hasQueryListeners() && !this.querySubs.currentValue[g])
6026
6026
  break;
6027
- const w = (c = (a = b == null ? void 0 : b[0]) == null ? void 0 : a.data) == null ? void 0 : c["page-info"], S = (l = (u = b == null ? void 0 : b[0]) == null ? void 0 : u.data) == null ? void 0 : l.aggregate, _ = fr(b), T = this.ensureAttrs(), M = et(T, _, r, this.config.useDateObjects);
6027
+ const w = (c = (a = b == null ? void 0 : b[0]) == null ? void 0 : a.data) == null ? void 0 : c["page-info"], S = (l = (u = b == null ? void 0 : b[0]) == null ? void 0 : u.data) == null ? void 0 : l.aggregate, _ = fr(b), T = this.ensureAttrs(), R = et(T, _, r, this.config.useDateObjects);
6028
6028
  this.querySubs.updateInPlace((O) => {
6029
6029
  if (!O[g]) {
6030
6030
  this._log.info("Missing value in querySubs", { hash: g, q: y });
6031
6031
  return;
6032
6032
  }
6033
6033
  O[g].result = {
6034
- store: M,
6034
+ store: R,
6035
6035
  attrsStore: T,
6036
6036
  pageInfo: w,
6037
6037
  aggregate: S,
@@ -6080,10 +6080,10 @@ class yc {
6080
6080
  T.pendingMutations = w;
6081
6081
  });
6082
6082
  const S = Vt(w.entries()), _ = y.map((T) => {
6083
- var q, E, j, R;
6084
- const M = T["instaql-query"], O = T["instaql-result"], F = ne(M), P = fr(O), C = this.ensureAttrs(), G = et(C, P, r, this.config.useDateObjects), { store: N, attrsStore: B } = this._applyOptimisticUpdates(G, C, S, g), z = (E = (q = O == null ? void 0 : O[0]) == null ? void 0 : q.data) == null ? void 0 : E["page-info"], ee = (R = (j = O == null ? void 0 : O[0]) == null ? void 0 : j.data) == null ? void 0 : R.aggregate;
6083
+ var q, E, j, M;
6084
+ const R = T["instaql-query"], O = T["instaql-result"], F = ne(R), P = fr(O), C = this.ensureAttrs(), G = et(C, P, r, this.config.useDateObjects), { store: N, attrsStore: B } = this._applyOptimisticUpdates(G, C, S, g), z = (E = (q = O == null ? void 0 : O[0]) == null ? void 0 : q.data) == null ? void 0 : E["page-info"], ee = (M = (j = O == null ? void 0 : O[0]) == null ? void 0 : j.data) == null ? void 0 : M.aggregate;
6085
6085
  return {
6086
- q: M,
6086
+ q: R,
6087
6087
  hash: F,
6088
6088
  store: N,
6089
6089
  attrsStore: B,
@@ -6091,10 +6091,10 @@ class yc {
6091
6091
  aggregate: ee
6092
6092
  };
6093
6093
  });
6094
- _.forEach(({ hash: T, q: M, store: O, attrsStore: F, pageInfo: P, aggregate: C }) => {
6094
+ _.forEach(({ hash: T, q: R, store: O, attrsStore: F, pageInfo: P, aggregate: C }) => {
6095
6095
  this.querySubs.updateInPlace((G) => {
6096
6096
  if (!G[T]) {
6097
- this._log.error("Missing value in querySubs", { hash: T, q: M });
6097
+ this._log.error("Missing value in querySubs", { hash: T, q: R });
6098
6098
  return;
6099
6099
  }
6100
6100
  G[T].result = {
@@ -6260,7 +6260,7 @@ class yc {
6260
6260
  i && (i.dfd.reject(s), this._completeQueryOnce(e, t, i.dfd));
6261
6261
  }
6262
6262
  _setAttrs(e) {
6263
- this.attrs = new Re(e.reduce((t, r) => (t[r.id] = r, t), {}), this._linkIndex), this.notifyAttrsSubs();
6263
+ this.attrs = new Me(e.reduce((t, r) => (t[r.id] = r, t), {}), this._linkIndex), this.notifyAttrsSubs();
6264
6264
  }
6265
6265
  _startQuerySub(e, t) {
6266
6266
  const r = J();
@@ -6394,13 +6394,13 @@ class yc {
6394
6394
  r.push(u);
6395
6395
  }
6396
6396
  if (!t.size && !r.length)
6397
- return this.attrs || new Re({}, this._linkIndex);
6397
+ return this.attrs || new Me({}, this._linkIndex);
6398
6398
  const s = { ...((o = this.attrs) == null ? void 0 : o.attrs) || {} };
6399
6399
  for (const a of r)
6400
6400
  s[a.id] = a;
6401
6401
  for (const a of t)
6402
6402
  delete s[a];
6403
- return new Re(s, this._linkIndex);
6403
+ return new Me(s, this._linkIndex);
6404
6404
  }
6405
6405
  /** Runs instaql on a query and a store */
6406
6406
  dataForQuery(e, t = !0) {
@@ -7092,12 +7092,12 @@ class yc {
7092
7092
  fileName: i,
7093
7093
  refreshToken: s
7094
7094
  });
7095
- return await Ma(o, t);
7095
+ return await Ra(o, t);
7096
7096
  }
7097
7097
  async getDownloadUrl(e) {
7098
7098
  var i;
7099
7099
  const t = await this.getCurrentUser(), r = (i = t == null ? void 0 : t.user) == null ? void 0 : i.refresh_token;
7100
- return await Ra({
7100
+ return await Ma({
7101
7101
  apiURI: this.config.apiURI,
7102
7102
  appId: this.config.appId,
7103
7103
  path: e,
@@ -7261,15 +7261,15 @@ const vc = (n) => JSON.stringify(n), nt = (n, e = !1) => JSON.stringify([n, e]),
7261
7261
  u.set(nt(E, j.afterInclusive), j), S();
7262
7262
  }, T = (E, j) => {
7263
7263
  l.set(nt(E), j), C(), S();
7264
- }, M = (E, j) => {
7264
+ }, R = (E, j) => {
7265
7265
  var A, k;
7266
- const { cursor: R } = Tr(E), U = f.get(Ne("reverse", R));
7266
+ const { cursor: M } = Tr(E), U = f.get(Ne("reverse", M));
7267
7267
  U == null || U();
7268
7268
  const L = n.subscribeQuery({
7269
7269
  [a]: {
7270
7270
  ...i,
7271
7271
  $: {
7272
- after: R,
7272
+ after: M,
7273
7273
  before: j.endCursor,
7274
7274
  beforeInclusive: !0,
7275
7275
  where: (A = i.$) == null ? void 0 : A.where,
@@ -7281,23 +7281,23 @@ const vc = (n) => JSON.stringify(n), nt = (n, e = !1) => JSON.stringify([n, e]),
7281
7281
  if (K.error)
7282
7282
  return w(K.error);
7283
7283
  const H = K.data[a], Y = K.pageInfo[a];
7284
- Ye(H && Y, "Expected query subscription to contain rows and pageInfo"), T(R, {
7284
+ Ye(H && Y, "Expected query subscription to contain rows and pageInfo"), T(M, {
7285
7285
  data: H,
7286
7286
  status: "frozen",
7287
7287
  hasMore: Y.hasNextPage,
7288
7288
  endCursor: Y.endCursor
7289
7289
  });
7290
7290
  }, r);
7291
- f.set(Ne("reverse", R), L);
7291
+ f.set(Ne("reverse", M), L);
7292
7292
  }, O = (E) => {
7293
- var R, U;
7293
+ var M, U;
7294
7294
  const j = n.subscribeQuery({
7295
7295
  [a]: {
7296
7296
  ...i,
7297
7297
  $: {
7298
7298
  limit: o,
7299
7299
  after: E,
7300
- where: (R = i.$) == null ? void 0 : R.where,
7300
+ where: (M = i.$) == null ? void 0 : M.where,
7301
7301
  fields: (U = i.$) == null ? void 0 : U.fields,
7302
7302
  order: Sr(c)
7303
7303
  }
@@ -7316,7 +7316,7 @@ const vc = (n) => JSON.stringify(n), nt = (n, e = !1) => JSON.stringify([n, e]),
7316
7316
  f.set(Ne("reverse", E), j);
7317
7317
  }, F = (E, j = !1) => {
7318
7318
  var U, L;
7319
- const R = n.subscribeQuery({
7319
+ const M = n.subscribeQuery({
7320
7320
  [a]: {
7321
7321
  ...i,
7322
7322
  $: {
@@ -7340,12 +7340,12 @@ const vc = (n) => JSON.stringify(n), nt = (n, e = !1) => JSON.stringify([n, e]),
7340
7340
  afterInclusive: j
7341
7341
  });
7342
7342
  }, r);
7343
- f.set(Ne("forward", E, j), R);
7343
+ f.set(Ne("forward", E, j), M);
7344
7344
  }, P = (E, j = !1) => {
7345
7345
  var k, K;
7346
- const R = nt(E, j), U = f.get(Ne("forward", E, j));
7346
+ const M = nt(E, j), U = f.get(Ne("forward", E, j));
7347
7347
  U == null || U();
7348
- const L = u.get(R);
7348
+ const L = u.get(M);
7349
7349
  if (!(L != null && L.endCursor))
7350
7350
  return;
7351
7351
  const A = n.subscribeQuery({
@@ -7378,20 +7378,20 @@ const vc = (n) => JSON.stringify(n), nt = (n, e = !1) => JSON.stringify([n, e]),
7378
7378
  const E = Array.from(l.entries()).at(-1);
7379
7379
  if (!E)
7380
7380
  return;
7381
- const [j, R] = E;
7382
- if (!(R != null && R.hasMore) || !Ac(R))
7381
+ const [j, M] = E;
7382
+ if (!(M != null && M.hasMore) || !Ac(M))
7383
7383
  return;
7384
- const U = `${j}:${vc(R.endCursor)}`;
7385
- U != b && (b = U, M(j, R), O(R.endCursor));
7384
+ const U = `${j}:${vc(M.endCursor)}`;
7385
+ U != b && (b = U, R(j, M), O(M.endCursor));
7386
7386
  }, G = () => {
7387
7387
  const E = Array.from(u.entries()).at(-1);
7388
7388
  if (!E)
7389
7389
  return;
7390
- const [j, R] = E;
7391
- if (!R.endCursor)
7390
+ const [j, M] = E;
7391
+ if (!M.endCursor)
7392
7392
  return;
7393
7393
  const { cursor: U, afterInclusive: L } = Tr(j);
7394
- P(U, L), F(R.endCursor);
7394
+ P(U, L), F(M.endCursor);
7395
7395
  };
7396
7396
  return g = n.subscribeQuery({
7397
7397
  [a]: {
@@ -7409,10 +7409,10 @@ const vc = (n) => JSON.stringify(n), nt = (n, e = !1) => JSON.stringify([n, e]),
7409
7409
  return;
7410
7410
  if (E.error)
7411
7411
  return w(E.error);
7412
- const j = E.pageInfo[a], R = (L = E == null ? void 0 : E.data) == null ? void 0 : L[a];
7413
- if (Ye(R && j, "Expected rows and pageInfo"), R.length < o) {
7412
+ const j = E.pageInfo[a], M = (L = E == null ? void 0 : E.data) == null ? void 0 : L[a];
7413
+ if (Ye(M && j, "Expected rows and pageInfo"), M.length < o) {
7414
7414
  _(Qt, {
7415
- data: R,
7415
+ data: M,
7416
7416
  status: "pre-bootstrap"
7417
7417
  });
7418
7418
  return;
@@ -7420,7 +7420,7 @@ const vc = (n) => JSON.stringify(n), nt = (n, e = !1) => JSON.stringify([n, e]),
7420
7420
  const U = j.startCursor;
7421
7421
  if (!U) {
7422
7422
  _(Qt, {
7423
- data: R,
7423
+ data: M,
7424
7424
  status: "pre-bootstrap"
7425
7425
  });
7426
7426
  return;
@@ -7481,15 +7481,15 @@ const vc = (n) => JSON.stringify(n), nt = (n, e = !1) => JSON.stringify([n, e]),
7481
7481
  function Pc() {
7482
7482
  return globalThis.__instantDbSchemaHashStore = globalThis.__instantDbSchemaHashStore ?? /* @__PURE__ */ new WeakMap(), globalThis.__instantDbSchemaHashStore;
7483
7483
  }
7484
- function Mc() {
7484
+ function Rc() {
7485
7485
  return globalThis.__instantDbStore = globalThis.__instantDbStore ?? {}, globalThis.__instantDbStore;
7486
7486
  }
7487
7487
  function dn(n) {
7488
7488
  const e = n.__adminToken, t = n.__extraDedupeKey;
7489
7489
  return n.appId + "_" + (n.websocketURI || "default_ws_uri") + "_" + (n.apiURI || "default_api_uri") + "_" + (e || "client_only") + "_" + n.useDateObjects + "_" + (t || "");
7490
7490
  }
7491
- const hn = Mc(), vr = Pc();
7492
- class Rc {
7491
+ const hn = Rc(), vr = Pc();
7492
+ class Mc {
7493
7493
  constructor(e) {
7494
7494
  p(this, "db");
7495
7495
  /**
@@ -7700,7 +7700,7 @@ class xc {
7700
7700
  p(this, "storage");
7701
7701
  p(this, "streams");
7702
7702
  p(this, "tx", On());
7703
- this._reactor = e, this.auth = new Rc(this._reactor), this.storage = new jc(this._reactor), this.streams = new $c(this._reactor);
7703
+ this._reactor = e, this.auth = new Mc(this._reactor), this.storage = new jc(this._reactor), this.streams = new $c(this._reactor);
7704
7704
  }
7705
7705
  /**
7706
7706
  * Use this to write data! You can create, update, delete, and link objects