@statezero/core 0.2.50 → 0.2.51

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,17 +1,17 @@
1
- import { ref as J, computed as R, onMounted as us, onBeforeUnmount as hs, watch as it, createElementBlock as $, openBlock as A, createElementVNode as h, createVNode as Mt, toDisplayString as S, createCommentVNode as V, Fragment as W, renderList as ce, normalizeClass as $t, normalizeStyle as at, withDirectives as Ue, createTextVNode as Qe, vModelCheckbox as At, vModelSelect as Ot, Transition as Pt, withCtx as Ft } from "vue";
1
+ import { ref as J, computed as R, onMounted as us, onBeforeUnmount as hs, watch as it, createElementBlock as $, openBlock as A, createElementVNode as h, createVNode as Tt, toDisplayString as S, createCommentVNode as V, Fragment as W, renderList as ce, normalizeClass as Mt, normalizeStyle as at, withDirectives as Ue, createTextVNode as Qe, vModelCheckbox as $t, vModelSelect as At, Transition as Ot, withCtx as Pt } from "vue";
2
2
  import { v7 as G } from "uuid";
3
3
  import { isNil as E, isEmpty as Ce, trim as dt, isEqual as qe } from "lodash-es";
4
4
  import Ae from "mitt";
5
- import Dt from "handlebars";
6
- import It from "superjson";
5
+ import Ft from "handlebars";
6
+ import Dt from "superjson";
7
7
  import fs from "p-queue";
8
8
  import ps from "axios";
9
9
  import { z as P } from "zod";
10
10
  import ms from "pusher-js";
11
- import vt from "sift";
11
+ import Wt, { createEqualsOperation as ee } from "sift";
12
12
  import { DateTime as ge } from "luxon";
13
13
  import { parse as ys, format as gs } from "date-fns";
14
- import { Graph as Kt } from "graphlib";
14
+ import { Graph as It } from "graphlib";
15
15
  import Le from "object-hash";
16
16
  import * as Zt from "mathjs";
17
17
  import _s from "rfdc";
@@ -22,10 +22,10 @@ function ws(n) {
22
22
  function Je(n) {
23
23
  return typeof n == "string" && /\{\{\s*TempPK_[^}\s]+\s*\}\}/.test(n);
24
24
  }
25
- function zt(n) {
25
+ function Kt(n) {
26
26
  return `{{TempPK_${n}}}`;
27
27
  }
28
- function Rt(n, e) {
28
+ function zt(n, e) {
29
29
  const t = `{{TempPK_${n}}}`, s = `"TempPK_${n}"`, r = typeof e == "string" ? `"${e}"` : String(e);
30
30
  se.set(s, r);
31
31
  for (const o of ut)
@@ -47,14 +47,14 @@ function We(n) {
47
47
  const e = Object.fromEntries(se);
48
48
  try {
49
49
  if (typeof n == "string")
50
- return Dt.compile(n, { noEscape: !0 })(e);
51
- const t = It.stringify(n), r = Dt.compile(t, { noEscape: !0 })(e);
52
- return It.parse(r);
50
+ return Ft.compile(n, { noEscape: !0 })(e);
51
+ const t = Dt.stringify(n), r = Ft.compile(t, { noEscape: !0 })(e);
52
+ return Dt.parse(r);
53
53
  } catch {
54
54
  return n;
55
55
  }
56
56
  }
57
- const vs = Ae(), Es = Ae(), Nt = Ae();
57
+ const vs = Ae(), Es = Ae(), Rt = Ae();
58
58
  class bs {
59
59
  constructor(e, t = {}) {
60
60
  this.dbName = e, this.storeName = t.storeName || "keyval-store", this.batchDelay = t.batchDelay || 50, this.version = t.version || 5, this.resetOnErrors = t.resetOnErrors || [
@@ -236,7 +236,7 @@ class bs {
236
236
  }
237
237
  }
238
238
  }
239
- class Et {
239
+ class vt {
240
240
  constructor(e, t = {}, s = null) {
241
241
  this.store = new bs(e, t), this.localMap = /* @__PURE__ */ new Map(), this.hydrate().then((r) => {
242
242
  typeof s == "function" && s(r);
@@ -347,7 +347,7 @@ class ks {
347
347
  operationsMap;
348
348
  isSyncing;
349
349
  constructor(e, t, s = null, r = null, o = {}) {
350
- this.modelClass = e, this.fetchFn = t, this.isSyncing = !1, this.pruneThreshold = o.pruneThreshold || 10, this.groundTruthArray = s || [], this.operationsMap = /* @__PURE__ */ new Map(), r && r.length > 0 && this._loadOperations(r), this.modelCache = new Et("model-cache", {}, this.onHydrated.bind(this)), this._lastRenderedData = /* @__PURE__ */ new Map(), this.renderCallbacks = /* @__PURE__ */ new Set(), this._unsubscribeTempPk = ws((i, l) => {
350
+ this.modelClass = e, this.fetchFn = t, this.isSyncing = !1, this.pruneThreshold = o.pruneThreshold || 10, this.groundTruthArray = s || [], this.operationsMap = /* @__PURE__ */ new Map(), r && r.length > 0 && this._loadOperations(r), this.modelCache = new vt("model-cache", {}, this.onHydrated.bind(this)), this._lastRenderedData = /* @__PURE__ */ new Map(), this.renderCallbacks = /* @__PURE__ */ new Set(), this._unsubscribeTempPk = ws((i, l) => {
351
351
  if (this._lastRenderedData.has(i)) {
352
352
  const a = this._lastRenderedData.get(i);
353
353
  a && typeof a == "object" && (a[this.pkField] = l), this._lastRenderedData.set(l, a), this._lastRenderedData.delete(i);
@@ -950,7 +950,7 @@ class Ve extends ve {
950
950
  super("Validation error", "validation_error", e, t), this.name = "ValidationError";
951
951
  }
952
952
  }
953
- class xt extends ve {
953
+ class Nt extends ve {
954
954
  /**
955
955
  * Creates a new DoesNotExist error.
956
956
  *
@@ -1014,7 +1014,7 @@ function Os(n) {
1014
1014
  case "ValidationError":
1015
1015
  return new Ve(s, e);
1016
1016
  case "NotFound":
1017
- return new xt(s, e);
1017
+ return new Nt(s, e);
1018
1018
  case "MultipleObjectsReturned":
1019
1019
  return new $s(s, e);
1020
1020
  case "PermissionDenied":
@@ -1029,10 +1029,10 @@ function Os(n) {
1029
1029
  case "ValueError":
1030
1030
  return new Ve(s, e);
1031
1031
  default:
1032
- return e === 400 ? new Ve(s, e) : e === 403 ? new lt(s, e) : e === 404 ? new xt(s, e) : new ve("Unknown error", "unknown", s, e);
1032
+ return e === 400 ? new Ve(s, e) : e === 403 ? new lt(s, e) : e === 404 ? new Nt(s, e) : new ve("Unknown error", "unknown", s, e);
1033
1033
  }
1034
1034
  }
1035
- const jt = {
1035
+ const xt = {
1036
1036
  CREATE: "create",
1037
1037
  UPDATE: "update",
1038
1038
  DELETE: "delete",
@@ -1130,7 +1130,7 @@ Common causes:
1130
1130
  `%cAuthentication failed for channel ${t}. Check your authEndpoint and server-side permissions.`,
1131
1131
  "color: orange; font-weight: bold;"
1132
1132
  );
1133
- }), Object.values(jt).forEach((r) => {
1133
+ }), Object.values(xt).forEach((r) => {
1134
1134
  s.bind(r, (o) => {
1135
1135
  const i = {
1136
1136
  ...o,
@@ -1145,7 +1145,7 @@ Common causes:
1145
1145
  unsubscribe(e) {
1146
1146
  const t = this.channels.get(e);
1147
1147
  if (!t) return;
1148
- Object.values(jt).forEach((r) => {
1148
+ Object.values(xt).forEach((r) => {
1149
1149
  t.unbind(r);
1150
1150
  });
1151
1151
  const s = e.startsWith("private-") ? e : this.formatChannelName(e);
@@ -1192,13 +1192,13 @@ function Fs(n, e) {
1192
1192
  const t = Ze.get(n);
1193
1193
  t && t.disconnect(), Ze.set(n, e), e.connect();
1194
1194
  }
1195
- function Ut(n = "default") {
1195
+ function jt(n = "default") {
1196
1196
  return Ze.get(n);
1197
1197
  }
1198
1198
  function Ds() {
1199
1199
  return Ze;
1200
1200
  }
1201
- let Qt = {
1201
+ let Ut = {
1202
1202
  backendConfigs: {}
1203
1203
  };
1204
1204
  const Is = P.object({
@@ -1270,8 +1270,8 @@ const Is = P.object({
1270
1270
  });
1271
1271
  let ht = null;
1272
1272
  function Rs(n) {
1273
- Qt = n;
1274
- const e = zs.safeParse(Qt);
1273
+ Ut = n;
1274
+ const e = zs.safeParse(Ut);
1275
1275
  if (!e.success) {
1276
1276
  const t = e.error.errors.map((s) => s.message);
1277
1277
  throw new x(`Error setting configuration: ${t.join(", ")}`);
@@ -1401,13 +1401,13 @@ function Qs(n) {
1401
1401
  function Vs(n) {
1402
1402
  return Me.on("clear", n), () => Me.off("clear", n);
1403
1403
  }
1404
- function Vt() {
1404
+ function Qt() {
1405
1405
  return ue.slice();
1406
1406
  }
1407
1407
  function Ls() {
1408
1408
  ue.length = 0, Me.emit("clear");
1409
1409
  }
1410
- function Lt(n) {
1410
+ function Vt(n) {
1411
1411
  const e = Number(n);
1412
1412
  !Number.isFinite(e) || e <= 0 || (X.maxEntries = Math.floor(e), ue.length > X.maxEntries && ue.splice(0, ue.length - X.maxEntries));
1413
1413
  }
@@ -1607,7 +1607,7 @@ async function L(n, e, t = {}, s, r = null, o = null, i = {}) {
1607
1607
  }, fe = Bs(l), ae = b ? fe.add(re) : re();
1608
1608
  return a ? Hs(ae, a) : ae;
1609
1609
  }
1610
- class Gt {
1610
+ class Lt {
1611
1611
  // Supported Django strftime formats and their date-fns equivalents
1612
1612
  static SUPPORTED_FORMATS = {
1613
1613
  "iso-8601": null,
@@ -1705,7 +1705,7 @@ function qs(n) {
1705
1705
  const e = Fe.getConfig();
1706
1706
  return (e.backendConfigs[n.configKey] || e.backendConfigs.default).BACKEND_TZ || "UTC";
1707
1707
  }
1708
- const Bt = {
1708
+ const Gt = {
1709
1709
  // Store backend snake_case format internally for consistency with API
1710
1710
  toInternal: (n, e = {}) => {
1711
1711
  if (typeof n == "string")
@@ -1742,14 +1742,14 @@ const Bt = {
1742
1742
  mimeType: n.mime_type
1743
1743
  };
1744
1744
  }
1745
- }, Ht = {
1745
+ }, Bt = {
1746
1746
  toInternal: (n, e = {}) => {
1747
1747
  if (E(n) || typeof n == "string") return n;
1748
1748
  if (n instanceof Date) {
1749
1749
  const { model: t, field: s, fieldSchema: r } = e, o = t?.schema || r?.format && {
1750
1750
  properties: { [s]: { format: r.format } }
1751
1751
  };
1752
- return o ? Gt.serializeDate(n, s, o) : n.toISOString();
1752
+ return o ? Lt.serializeDate(n, s, o) : n.toISOString();
1753
1753
  }
1754
1754
  throw new Error(`expected string or Date, got ${typeof n}`);
1755
1755
  },
@@ -1758,7 +1758,7 @@ const Bt = {
1758
1758
  const { model: t, field: s } = e;
1759
1759
  if (t?.schema) {
1760
1760
  const r = qs(t);
1761
- return Gt.parseDate(n, s, t.schema, r);
1761
+ return Lt.parseDate(n, s, t.schema, r);
1762
1762
  }
1763
1763
  try {
1764
1764
  return new Date(n);
@@ -1809,10 +1809,10 @@ const Bt = {
1809
1809
  }
1810
1810
  }, Se = {
1811
1811
  string: {
1812
- "file-path": Bt,
1813
- "image-path": Bt,
1814
- date: Ht,
1815
- "date-time": Ht,
1812
+ "file-path": Gt,
1813
+ "image-path": Gt,
1814
+ date: Bt,
1815
+ "date-time": Bt,
1816
1816
  "foreign-key": ke,
1817
1817
  "one-to-one": ke
1818
1818
  },
@@ -1884,7 +1884,6 @@ class ts {
1884
1884
  return t;
1885
1885
  }
1886
1886
  }
1887
- const { createEqualsOperation: ee } = vt;
1888
1887
  function Ws(n) {
1889
1888
  if (!n || !n.configKey)
1890
1889
  return "UTC";
@@ -2225,7 +2224,7 @@ function er(n = "UTC", e = null) {
2225
2224
  }
2226
2225
  function tr(n, e) {
2227
2226
  const t = Ws(e);
2228
- return vt(n, {
2227
+ return Wt(n, {
2229
2228
  operations: er(t, e)
2230
2229
  });
2231
2230
  }
@@ -2311,9 +2310,9 @@ function rr(n, e, t) {
2311
2310
  };
2312
2311
  }
2313
2312
  });
2314
- return n.filter(vt({ $or: o }));
2313
+ return n.filter(Wt({ $or: o }));
2315
2314
  }
2316
- function qt(n, e) {
2315
+ function Ht(n, e) {
2317
2316
  const t = e.split(".");
2318
2317
  let s = n;
2319
2318
  for (const r of t) {
@@ -2345,7 +2344,7 @@ function or(n, e, t) {
2345
2344
  const s = nr(e, t);
2346
2345
  return [...n].sort((r, o) => {
2347
2346
  for (const { field: i, desc: l } of s) {
2348
- const a = qt(r, i), c = qt(o, i);
2347
+ const a = Ht(r, i), c = Ht(o, i);
2349
2348
  if (a !== c) {
2350
2349
  if (a === null && c !== null) return l ? -1 : 1;
2351
2350
  if (a !== null && c === null) return l ? 1 : -1;
@@ -2447,7 +2446,7 @@ class ir {
2447
2446
  const c = Oe.get(l.operationId) || new q(l, !0);
2448
2447
  this.operationsMap.set(c.operationId, c);
2449
2448
  }
2450
- if (this.qsCache = new Et("queryset-cache", {}, this.onHydrated.bind(this)), this._lastRenderedPks = null, this.renderCallbacks = /* @__PURE__ */ new Set(), !this.isTemp) {
2449
+ if (this.qsCache = new vt("queryset-cache", {}, this.onHydrated.bind(this)), this._lastRenderedPks = null, this.renderCallbacks = /* @__PURE__ */ new Set(), !this.isTemp) {
2451
2450
  const l = Q.getStore(this.modelClass);
2452
2451
  this._modelStoreUnregister = l.registerRenderCallback(() => {
2453
2452
  this._emitRenderEvent();
@@ -2686,7 +2685,7 @@ class ir {
2686
2685
  }
2687
2686
  class ar {
2688
2687
  constructor() {
2689
- this.graph = new Kt({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2688
+ this.graph = new It({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2690
2689
  }
2691
2690
  /**
2692
2691
  * Add a queryset and its parent relationship to the graph
@@ -2772,7 +2771,7 @@ class ar {
2772
2771
  return !e && !t ? !0 : !e || !t || e.length !== t.length ? !1 : e.every((s, r) => s === t[r]);
2773
2772
  }
2774
2773
  clear() {
2775
- this.graph = new Kt({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2774
+ this.graph = new It({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2776
2775
  }
2777
2776
  }
2778
2777
  class lr {
@@ -3190,7 +3189,7 @@ class fr {
3190
3189
  }
3191
3190
  class pr {
3192
3191
  constructor(e, t, s, r = null, o = null, i) {
3193
- this.metricType = e, this.modelClass = t, this.queryset = s, this.field = r, this.ast = o, this.fetchFn = i, this.groundTruthValue = null, this.isSyncing = !1, this.strategy = fr.getStrategy(e, t), this.operations = [], this.confirmedOps = /* @__PURE__ */ new Set(), this.metricCache = new Et(
3192
+ this.metricType = e, this.modelClass = t, this.queryset = s, this.field = r, this.ast = o, this.fetchFn = i, this.groundTruthValue = null, this.isSyncing = !1, this.strategy = fr.getStrategy(e, t), this.operations = [], this.confirmedOps = /* @__PURE__ */ new Set(), this.metricCache = new vt(
3194
3193
  "metric-store-cache",
3195
3194
  {},
3196
3195
  this.onHydrated.bind(this)
@@ -3264,7 +3263,7 @@ class pr {
3264
3263
  }
3265
3264
  setGroundTruth(e) {
3266
3265
  const t = !qe(this.groundTruthValue, e);
3267
- this.groundTruthValue = e, this.setCache(), t && Nt.emit("metric::render", {
3266
+ this.groundTruthValue = e, this.setCache(), t && Rt.emit("metric::render", {
3268
3267
  metricType: this.metricType,
3269
3268
  ModelClass: this.modelClass,
3270
3269
  field: this.field,
@@ -3285,7 +3284,7 @@ class pr {
3285
3284
  this.field,
3286
3285
  this.modelClass
3287
3286
  );
3288
- return qe(this._lastCalculatedValue, e) || (this._lastCalculatedValue = e, Nt.emit("metric::render", {
3287
+ return qe(this._lastCalculatedValue, e) || (this._lastCalculatedValue = e, Rt.emit("metric::render", {
3289
3288
  metricType: this.metricType,
3290
3289
  ModelClass: this.modelClass,
3291
3290
  field: this.field,
@@ -3350,7 +3349,7 @@ class de {
3350
3349
  * @returns {Operation} The created operation
3351
3350
  */
3352
3351
  static createCreateOperation(e, t = {}, s = null) {
3353
- const o = e.ModelClass.primaryKeyField, i = s || `${G()}`, l = zt(i);
3352
+ const o = e.ModelClass.primaryKeyField, i = s || `${G()}`, l = Kt(i);
3354
3353
  return new q({
3355
3354
  operationId: i,
3356
3355
  type: M.CREATE,
@@ -3369,7 +3368,7 @@ class de {
3369
3368
  */
3370
3369
  static createBulkCreateOperation(e, t = [], s = null) {
3371
3370
  const o = e.ModelClass.primaryKeyField, i = s || `${G()}`, l = t.map((a, c) => {
3372
- const f = zt(`${i}_${c}`);
3371
+ const f = Kt(`${i}_${c}`);
3373
3372
  return { ...a, [o]: f };
3374
3373
  });
3375
3374
  return new q({
@@ -3510,7 +3509,7 @@ class de {
3510
3509
  });
3511
3510
  }
3512
3511
  }
3513
- class Jt extends Array {
3512
+ class qt extends Array {
3514
3513
  /**
3515
3514
  * Creates a new ResultTuple.
3516
3515
  *
@@ -3580,7 +3579,7 @@ class yr {
3580
3579
  lookup: s.lookup || {},
3581
3580
  defaults: s.defaults || {}
3582
3581
  }, l = t === "get_or_create" ? de.createGetOrCreateOperation(e, i.lookup, i.defaults) : de.createUpdateOrCreateOperation(e, i.lookup, i.defaults), a = l.type === "create", c = r.fromPk(l.instances[0][o], e);
3583
- let f = new Jt(c, a);
3582
+ let f = new qt(c, a);
3584
3583
  if (l.localOnly)
3585
3584
  return l.updateStatus(C.CONFIRMED, l.instances), f;
3586
3585
  const p = L(
@@ -3597,7 +3596,7 @@ class yr {
3597
3596
  return b && l.mutate({
3598
3597
  instances: [b],
3599
3598
  status: C.CONFIRMED
3600
- }), f = new Jt(c, v), Z(f), f;
3599
+ }), f = new qt(c, v), Z(f), f;
3601
3600
  }).catch((m) => {
3602
3601
  throw l.updateStatus(C.REJECTED), m;
3603
3602
  });
@@ -3727,7 +3726,7 @@ class yr {
3727
3726
  o,
3728
3727
  async (p) => {
3729
3728
  const { data: m } = p.data, y = Array.isArray(m) ? m[0] : m;
3730
- Rt(o, y);
3729
+ zt(o, y);
3731
3730
  }
3732
3731
  ).then((p) => {
3733
3732
  const { data: m, included: y, model_name: _ } = p.data;
@@ -3777,7 +3776,7 @@ class yr {
3777
3776
  const { data: m } = p.data;
3778
3777
  (Array.isArray(m) ? m : []).forEach((_, w) => {
3779
3778
  const v = `${o}_${w}`;
3780
- Rt(v, _);
3779
+ zt(v, _);
3781
3780
  });
3782
3781
  }
3783
3782
  ).then((p) => {
@@ -4139,7 +4138,7 @@ class wr {
4139
4138
  const r = [...this.followedModels.values()].some(
4140
4139
  (o) => o.has(t)
4141
4140
  );
4142
- s.add(t), r || Ut(t.configKey)?.subscribe(
4141
+ s.add(t), r || jt(t.configKey)?.subscribe(
4143
4142
  t.modelName,
4144
4143
  this.handleEvent
4145
4144
  );
@@ -4149,7 +4148,7 @@ class wr {
4149
4148
  if (!s) return;
4150
4149
  s.delete(t), [...this.followedModels.values()].some(
4151
4150
  (o) => o.has(t)
4152
- ) || Ut(t.configKey)?.unsubscribe(
4151
+ ) || jt(t.configKey)?.unsubscribe(
4153
4152
  t.modelName,
4154
4153
  this.handleEvent
4155
4154
  );
@@ -4384,7 +4383,7 @@ const Er = (n, e) => {
4384
4383
  }, vo = { class: "szd-kv__row" }, Eo = { class: "szd-kv__value" }, bo = { class: "szd-kv__row" }, ko = { class: "szd-kv__value" }, So = {
4385
4384
  key: 0,
4386
4385
  class: "szd-kv__note"
4387
- }, To = { class: "szd-ast" }, Wt = 100, Mo = {
4386
+ }, To = { class: "szd-ast" }, Jt = 100, Mo = {
4388
4387
  __name: "StateZeroDebugPanel",
4389
4388
  props: {
4390
4389
  queryset: { type: [Object, String], default: null },
@@ -4398,7 +4397,7 @@ const Er = (n, e) => {
4398
4397
  { id: "timeline", label: "Timeline" },
4399
4398
  { id: "data", label: "Data" },
4400
4399
  { id: "ast", label: "AST" }
4401
- ], r = J(""), o = J(e.useQueryset), i = J(!0), l = J(Vt()), a = J(0), c = J(!1), f = J(null), p = J(!1), m = J(null), y = J({
4400
+ ], r = J(""), o = J(e.useQueryset), i = J(!0), l = J(Qt()), a = J(0), c = J(!1), f = J(null), p = J(!1), m = J(null), y = J({
4402
4401
  request: !0,
4403
4402
  response: !0,
4404
4403
  render: !0,
@@ -4584,8 +4583,8 @@ const Er = (n, e) => {
4584
4583
  const Ke = R(() => {
4585
4584
  if (!f.value || f.value.type !== "snapshot") return [];
4586
4585
  const u = f.value.data, d = N.value, g = U.value;
4587
- return !d || !g || !u.pks ? [] : D(d.modelClass, g, u.pks, Wt);
4588
- }), Xe = R(() => !f.value || f.value.type !== "snapshot" ? !1 : f.value.data.count > Wt), ze = R(() => {
4586
+ return !d || !g || !u.pks ? [] : D(d.modelClass, g, u.pks, Jt);
4587
+ }), Xe = R(() => !f.value || f.value.type !== "snapshot" ? !1 : f.value.data.count > Jt), ze = R(() => {
4589
4588
  if (!k.value) return l.value;
4590
4589
  const u = N.value;
4591
4590
  return l.value.filter((d) => d.semanticKey === k.value ? !0 : u ? d.modelName === u.modelClass?.modelName && d.configKey === u.modelClass?.configKey : !1);
@@ -4613,7 +4612,7 @@ const Er = (n, e) => {
4613
4612
  return "";
4614
4613
  }
4615
4614
  }
4616
- function bt(u) {
4615
+ function Et(u) {
4617
4616
  if (!u) return "";
4618
4617
  switch (u.type) {
4619
4618
  case "request":
@@ -4687,36 +4686,36 @@ const Er = (n, e) => {
4687
4686
  }
4688
4687
  }
4689
4688
  }
4690
- function kt(u) {
4689
+ function bt(u) {
4691
4690
  f.value = { type: "entry", data: u };
4692
4691
  }
4693
4692
  function as(u) {
4694
4693
  f.value = { type: "snapshot", data: u };
4695
4694
  }
4696
- function St() {
4695
+ function kt() {
4697
4696
  f.value = null;
4698
4697
  }
4699
- function Tt(u) {
4698
+ function St(u) {
4700
4699
  Object.keys(y.value).forEach((d) => {
4701
4700
  y.value[d] = u;
4702
4701
  });
4703
4702
  }
4704
4703
  let tt = null, st = null, rt = null, nt = null;
4705
4704
  return us(() => {
4706
- Gs(), Lt(e.maxEntries), tt = Qs((u) => {
4705
+ Gs(), Vt(e.maxEntries), tt = Qs((u) => {
4707
4706
  i.value && (l.value = [...l.value, u], l.value.length > e.maxEntries && (l.value = l.value.slice(-e.maxEntries)));
4708
4707
  }), st = Vs(() => {
4709
4708
  l.value = [];
4710
4709
  }), rt = setInterval(() => {
4711
4710
  a.value += 1;
4712
4711
  }, 2e3), nt = setInterval(() => {
4713
- l.value = Vt();
4712
+ l.value = Qt();
4714
4713
  }, 1e3);
4715
4714
  }), hs(() => {
4716
4715
  tt && tt(), st && st(), rt && clearInterval(rt), nt && clearInterval(nt);
4717
4716
  }), it(
4718
4717
  () => e.maxEntries,
4719
- (u) => Lt(u)
4718
+ (u) => Vt(u)
4720
4719
  ), it(
4721
4720
  () => e.useQueryset,
4722
4721
  (u) => {
@@ -4761,7 +4760,7 @@ const Er = (n, e) => {
4761
4760
  h("nav", Dr, [
4762
4761
  (A(), $(W, null, ce(s, (g) => h("button", {
4763
4762
  key: g.id,
4764
- class: $t(["szd-tabs__tab", { "szd-tabs__tab--active": t.value === g.id }]),
4763
+ class: Mt(["szd-tabs__tab", { "szd-tabs__tab--active": t.value === g.id }]),
4765
4764
  onClick: (K) => t.value = g.id
4766
4765
  }, S(g.label), 11, Ir)), 64))
4767
4766
  ])
@@ -4820,13 +4819,13 @@ const Er = (n, e) => {
4820
4819
  d[22] || (d[22] = h("h3", { class: "szd-panel__heading" }, "Last Event", -1)),
4821
4820
  h("button", {
4822
4821
  class: "szd-event-preview",
4823
- onClick: d[1] || (d[1] = (g) => kt(ne.value))
4822
+ onClick: d[1] || (d[1] = (g) => bt(ne.value))
4824
4823
  }, [
4825
4824
  h("span", {
4826
4825
  class: "szd-event-preview__badge",
4827
4826
  style: at({ background: xe(ne.value.type) })
4828
4827
  }, S(ne.value.type), 5),
4829
- h("span", ln, S(bt(ne.value)), 1),
4828
+ h("span", ln, S(Et(ne.value)), 1),
4830
4829
  h("span", cn, S(et(ne.value.ts)), 1)
4831
4830
  ])
4832
4831
  ])) : V("", !0)
@@ -4835,15 +4834,15 @@ const Er = (n, e) => {
4835
4834
  h("div", un, [
4836
4835
  h("button", {
4837
4836
  class: "szd-btn szd-btn--sm",
4838
- onClick: d[2] || (d[2] = (g) => Tt(!0))
4837
+ onClick: d[2] || (d[2] = (g) => St(!0))
4839
4838
  }, "All"),
4840
4839
  h("button", {
4841
4840
  class: "szd-btn szd-btn--sm",
4842
- onClick: d[3] || (d[3] = (g) => Tt(!1))
4841
+ onClick: d[3] || (d[3] = (g) => St(!1))
4843
4842
  }, "None"),
4844
4843
  (A(), $(W, null, ce(Ne, (g) => h("label", {
4845
4844
  key: g.id,
4846
- class: $t(["szd-filter-chip", { "szd-filter-chip--active": y.value[g.id] }]),
4845
+ class: Mt(["szd-filter-chip", { "szd-filter-chip--active": y.value[g.id] }]),
4847
4846
  style: at(y.value[g.id] ? { background: g.color, borderColor: g.color } : {})
4848
4847
  }, [
4849
4848
  Ue(h("input", {
@@ -4851,7 +4850,7 @@ const Er = (n, e) => {
4851
4850
  "onUpdate:modelValue": (K) => y.value[g.id] = K,
4852
4851
  class: "szd-filter-chip__input"
4853
4852
  }, null, 8, hn), [
4854
- [At, y.value[g.id]]
4853
+ [$t, y.value[g.id]]
4855
4854
  ]),
4856
4855
  Qe(" " + S(g.label), 1)
4857
4856
  ], 6)), 64))
@@ -4860,14 +4859,14 @@ const Er = (n, e) => {
4860
4859
  (A(!0), $(W, null, ce(Ee.value, (g) => (A(), $("div", {
4861
4860
  key: g.id,
4862
4861
  class: "szd-timeline__item",
4863
- onClick: (K) => kt(g)
4862
+ onClick: (K) => bt(g)
4864
4863
  }, [
4865
4864
  h("span", mn, S(et(g.ts)), 1),
4866
4865
  h("span", {
4867
4866
  class: "szd-timeline__badge",
4868
4867
  style: at({ background: xe(g.type) })
4869
4868
  }, S(g.type), 5),
4870
- h("span", yn, S(bt(g)), 1)
4869
+ h("span", yn, S(Et(g)), 1)
4871
4870
  ], 8, pn))), 128)),
4872
4871
  Ee.value.length ? V("", !0) : (A(), $("div", gn, " No events match current filters "))
4873
4872
  ])
@@ -4901,7 +4900,7 @@ const Er = (n, e) => {
4901
4900
  value: g
4902
4901
  }, S(g), 9, Tn))), 128))
4903
4902
  ], 512), [
4904
- [Ot, m.value]
4903
+ [At, m.value]
4905
4904
  ])
4906
4905
  ]),
4907
4906
  m.value != null ? (A(), $("div", Mn, [
@@ -4929,8 +4928,8 @@ const Er = (n, e) => {
4929
4928
  h("pre", Rn, S(re.value ? JSON.stringify(re.value, null, 2) : "Select a queryset to view AST"), 1)
4930
4929
  ])) : V("", !0)
4931
4930
  ]),
4932
- Mt(Pt, { name: "szd-slide" }, {
4933
- default: Ft(() => [
4931
+ Tt(Ot, { name: "szd-slide" }, {
4932
+ default: Pt(() => [
4934
4933
  p.value ? (A(), $("div", Nn, [
4935
4934
  h("div", {
4936
4935
  class: "szd-detail__backdrop",
@@ -4957,7 +4956,7 @@ const Er = (n, e) => {
4957
4956
  value: g.semanticKey
4958
4957
  }, S(g.modelName || "?") + " · " + S(g.semanticKey), 9, Vn))), 128))
4959
4958
  ], 512), [
4960
- [Ot, r.value]
4959
+ [At, r.value]
4961
4960
  ])
4962
4961
  ]),
4963
4962
  k.value ? (A(), $("div", Ln, [
@@ -4991,7 +4990,7 @@ const Er = (n, e) => {
4991
4990
  type: "checkbox",
4992
4991
  "onUpdate:modelValue": d[8] || (d[8] = (g) => i.value = g)
4993
4992
  }, null, 512), [
4994
- [At, i.value]
4993
+ [$t, i.value]
4995
4994
  ]),
4996
4995
  d[33] || (d[33] = Qe(" Live updates ", -1))
4997
4996
  ])
@@ -5027,19 +5026,19 @@ const Er = (n, e) => {
5027
5026
  ]),
5028
5027
  _: 1
5029
5028
  }),
5030
- Mt(Pt, { name: "szd-slide" }, {
5031
- default: Ft(() => [
5029
+ Tt(Ot, { name: "szd-slide" }, {
5030
+ default: Pt(() => [
5032
5031
  f.value ? (A(), $("div", uo, [
5033
5032
  h("div", {
5034
5033
  class: "szd-detail__backdrop",
5035
- onClick: St
5034
+ onClick: kt
5036
5035
  }),
5037
5036
  h("div", ho, [
5038
5037
  h("div", fo, [
5039
5038
  h("h3", po, S(f.value.type === "entry" ? "Event Detail" : "Snapshot: " + f.value.data.label), 1),
5040
5039
  h("button", {
5041
5040
  class: "szd-btn",
5042
- onClick: St
5041
+ onClick: kt
5043
5042
  }, "Close")
5044
5043
  ]),
5045
5044
  h("div", mo, [
@@ -1,5 +1,4 @@
1
- import sift from 'sift';
2
- const { createEqualsOperation } = sift;
1
+ import sift, { createEqualsOperation } from 'sift';
3
2
  import { configInstance } from '../config.js';
4
3
  import { DateTime } from 'luxon';
5
4
  import { ModelSerializer } from '../flavours/django/serializers.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statezero/core",
3
- "version": "0.2.50",
3
+ "version": "0.2.51",
4
4
  "type": "module",
5
5
  "module": "ESNext",
6
6
  "description": "The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate",