@qaecy/cue-sdk 0.0.31 → 0.0.32

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,7 +1,7 @@
1
1
  import { getApps as xe, initializeApp as Ce } from "firebase/app";
2
- import { ref as k, getDownloadURL as X, getMetadata as $, getBlob as ne, updateMetadata as Ie, uploadBytesResumable as ft, uploadBytes as st, StringFormat as Se, uploadString as Te, listAll as U, getStorage as C, connectStorageEmulator as K } from "firebase/storage";
2
+ import { ref as k, getDownloadURL as X, getMetadata as z, getBlob as ne, updateMetadata as Ie, uploadBytesResumable as ft, uploadBytes as st, StringFormat as Se, uploadString as Te, listAll as U, getStorage as C, connectStorageEmulator as K } from "firebase/storage";
3
3
  import { Writer as Re, DataFactory as j } from "n3";
4
- import { getFirestore as Ae, connectFirestoreEmulator as Pe, collection as yt, getDocs as Oe, query as De, where as Le, limit as qe, doc as bt, getDoc as je, setDoc as ze, serverTimestamp as $e, increment as Ue } from "firebase/firestore";
4
+ import { getFirestore as Ae, connectFirestoreEmulator as Pe, collection as yt, getDocs as Oe, query as De, where as Le, limit as qe, doc as bt, getDoc as je, setDoc as $e, serverTimestamp as ze, increment as Ue } from "firebase/firestore";
5
5
  import { getAuth as Me, connectAuthEmulator as Ne, onIdTokenChanged as Fe, getIdTokenResult as at, signInWithEmailAndPassword as Be, GoogleAuthProvider as it, OAuthProvider as nt, signInWithPopup as Ge, signInWithRedirect as He, getRedirectResult as We, signInWithCustomToken as vt, signOut as Ve, onAuthStateChanged as Xe, fetchSignInMethodsForEmail as Ke, linkWithPopup as Qe, unlink as Ye, reauthenticateWithCredential as _t, EmailAuthProvider as Q, updatePassword as Ze, linkWithCredential as Je, verifyBeforeUpdateEmail as to, sendEmailVerification as eo } from "firebase/auth";
6
6
  import { v5 as oo } from "uuid";
7
7
  import "spark-md5";
@@ -344,7 +344,7 @@ class Et {
344
344
  if (this._knownMissing.has(o)) return;
345
345
  const r = k(this._bucket(t), e);
346
346
  try {
347
- const s = await $(r);
347
+ const s = await z(r);
348
348
  return `${await X(r)}&t=${encodeURIComponent(s.updated)}`;
349
349
  } catch (s) {
350
350
  if (s?.code === "storage/object-not-found" || s?.status === 404) {
@@ -385,7 +385,7 @@ class Et {
385
385
  try {
386
386
  const [a, n] = await Promise.all([
387
387
  s(X(e)),
388
- s($(e))
388
+ s(z(e))
389
389
  ]), p = `${a}&t=${encodeURIComponent(n.updated)}`, c = await fetch(p, { signal: o.signal });
390
390
  if (!c.ok) throw new Error(`HTTP ${c.status}`);
391
391
  return c.text();
@@ -401,7 +401,7 @@ class Et {
401
401
  async getMetadata(t, e) {
402
402
  const o = k(this._bucket(t), e);
403
403
  try {
404
- const r = await $(o);
404
+ const r = await z(o);
405
405
  return {
406
406
  updated: r.updated,
407
407
  contentType: r.contentType,
@@ -534,7 +534,7 @@ class Et {
534
534
  */
535
535
  async uploadProcessed(t, e, o) {
536
536
  const r = k(this.options.storageProcessed, t);
537
- return await $(r).catch(() => null) ? !1 : (await st(r, e, { customMetadata: o }), !0);
537
+ return await z(r).catch(() => null) ? !1 : (await st(r, e, { customMetadata: o }), !0);
538
538
  }
539
539
  /** List all blob names directly under `prefix` in the raw bucket. */
540
540
  async listRaw(t) {
@@ -648,8 +648,8 @@ const Z = {
648
648
  apiKey: "AIzaSyAiW42QBx9HS4Khu88pCW7MV66IhBAQul0",
649
649
  appId: "1:151132927589:web:d2ffdb377dfadfd23ab88c",
650
650
  measurementId: "G-YT4PK6HGZD"
651
- }, xt = "qaecy-mvp-406413", no = "734737865998", le = "europe-west6", Ct = "projects", It = "sessions_eu_west6", St = "spaces_chats_eu_west6", Tt = "spaces_raw_eu_west6", Rt = "spaces_processed_eu_west6", At = "spaces_logs_eu_west6", Pt = "cue_public_eu_west6", Ot = "db_persistence_eu_west6", po = "/data-views/admin/consumption", co = "/data-views/admin/profile/organizations", Dt = "/data-views/admin/profile/api-keys", Lt = "/commands/admin/profile/api-keys", lo = "/commands/admin/profile/terms", ho = (i) => `/data-views/admin/organizations/${i}/members`, go = "/commands/admin/project", uo = (i) => `/commands/admin/project/${i}`, mo = "/assistant/search", he = "/triplestore/query", wo = "/triplestore/update", fo = "/triplestore/shacl", de = "/qlever-server/qlever/query", yo = "/qlever-server/qlever/update", bo = "/qlever-server/qlever/shacl", qt = "/commands/file-system-structure/batch", vo = "/storage/sessions", _o = "/storage/raw", ge = "/storage/processed", jt = "microsoft.com", zt = "superadmin", ut = "https://cue.qaecy.com/r/";
652
- class $t {
651
+ }, xt = "qaecy-mvp-406413", no = "734737865998", le = "europe-west6", Ct = "projects", It = "sessions_eu_west6", St = "spaces_chats_eu_west6", Tt = "spaces_raw_eu_west6", Rt = "spaces_processed_eu_west6", At = "spaces_logs_eu_west6", Pt = "cue_public_eu_west6", Ot = "db_persistence_eu_west6", po = "/data-views/admin/consumption", co = "/data-views/admin/profile/organizations", Dt = "/data-views/admin/profile/api-keys", Lt = "/commands/admin/profile/api-keys", lo = "/commands/admin/profile/terms", ho = (i) => `/data-views/admin/organizations/${i}/members`, go = "/commands/admin/project", uo = (i) => `/commands/admin/project/${i}`, mo = "/assistant/search", wo = "/index/search", fo = "/index/lookup", he = "/triplestore/query", yo = "/triplestore/update", bo = "/triplestore/shacl", de = "/qlever-server/qlever/query", vo = "/qlever-server/qlever/update", _o = "/qlever-server/qlever/shacl", qt = "/commands/file-system-structure/batch", Eo = "/storage/sessions", ko = "/storage/raw", ge = "/storage/processed", jt = "microsoft.com", $t = "superadmin", ut = "https://cue.qaecy.com/r/";
652
+ class zt {
653
653
  _auth;
654
654
  _endpoints;
655
655
  _userSignal = new x(null);
@@ -678,7 +678,7 @@ class $t {
678
678
  const s = await r.getIdToken();
679
679
  this._tokenSignal.set(s);
680
680
  const a = await at(r);
681
- this._isSuperAdminSignal.set(a.claims.role === zt);
681
+ this._isSuperAdminSignal.set(a.claims.role === $t);
682
682
  } else
683
683
  this._tokenSignal.set(null), this._isSuperAdminSignal.set(!1);
684
684
  });
@@ -724,7 +724,7 @@ class $t {
724
724
  */
725
725
  async checkSuperAdmin() {
726
726
  const t = this._auth.currentUser;
727
- return t ? (await at(t)).claims.role === zt : !1;
727
+ return t ? (await at(t)).claims.role === $t : !1;
728
728
  }
729
729
  /** Sign in with a Cue API key. `projectId` is optional — omit it when no project context is available (e.g. admin flows). */
730
730
  async signInWithApiKey(t, e) {
@@ -807,8 +807,8 @@ class $t {
807
807
  return this._auth;
808
808
  }
809
809
  }
810
- const Eo = {
811
- raw: _o,
810
+ const xo = {
811
+ raw: ko,
812
812
  processed: ge
813
813
  };
814
814
  class Ut {
@@ -829,7 +829,7 @@ class Ut {
829
829
  * @param bucket - `'raw'` (default, original uploads) or `'processed'` (derived artefacts).
830
830
  */
831
831
  getDownloadUrl(t, e, o, r = "raw") {
832
- return `${this._gatewayUrl}${Eo[r]}/${t}/${e}${o}`;
832
+ return `${this._gatewayUrl}${xo[r]}/${t}/${e}${o}`;
833
833
  }
834
834
  /**
835
835
  * Returns a gateway download URL for an alternative representation using its
@@ -857,8 +857,8 @@ class Ut {
857
857
  return a.blob();
858
858
  }
859
859
  }
860
- const ko = "/data-views/tables", xo = "/commands/tables";
861
- class Co {
860
+ const Co = "/data-views/tables", Io = "/commands/tables";
861
+ class So {
862
862
  constructor(t, e) {
863
863
  this._auth = t, this._gatewayUrl = e;
864
864
  }
@@ -866,7 +866,7 @@ class Co {
866
866
  _gatewayUrl;
867
867
  async listTables(t) {
868
868
  const e = await this._auth.authenticatedFetch(
869
- `${this._gatewayUrl}${ko}`,
869
+ `${this._gatewayUrl}${Co}`,
870
870
  {
871
871
  headers: {
872
872
  "Content-Type": "application/json",
@@ -881,7 +881,7 @@ class Co {
881
881
  }
882
882
  async saveTables(t, e) {
883
883
  const o = await this._auth.authenticatedFetch(
884
- `${this._gatewayUrl}${xo}`,
884
+ `${this._gatewayUrl}${Io}`,
885
885
  {
886
886
  method: "PUT",
887
887
  headers: {
@@ -896,8 +896,8 @@ class Co {
896
896
  throw new Error(`Failed to save tables: ${o.status} ${o.statusText}`);
897
897
  }
898
898
  }
899
- const Io = "/semantic-extraction/extract";
900
- class So {
899
+ const To = "/semantic-extraction/extract";
900
+ class Ro {
901
901
  constructor(t, e) {
902
902
  this._auth = t, this._gatewayUrl = e;
903
903
  }
@@ -914,7 +914,7 @@ class So {
914
914
  const e = t.rdfFormat ?? "json-ld", o = new FormData();
915
915
  o.append("file", t.image, "page.png"), o.append("template", JSON.stringify(t.template)), o.append("space_id", t.projectId), o.append("rdf_format", e), t.category && o.append("category", t.category), t.text && o.append("text", t.text);
916
916
  const r = await this._auth.authenticatedFetch(
917
- `${this._gatewayUrl}${Io}`,
917
+ `${this._gatewayUrl}${To}`,
918
918
  {
919
919
  method: "POST",
920
920
  // Do NOT set Content-Type; browser sets it with the correct boundary.
@@ -935,7 +935,7 @@ class So {
935
935
  return { jsonld: await r.json() };
936
936
  }
937
937
  }
938
- class To {
938
+ class Ao {
939
939
  constructor(t, e) {
940
940
  this._auth = t, this._gatewayUrl = e;
941
941
  }
@@ -951,7 +951,7 @@ class To {
951
951
  * @param contextId - The context document ID (without the `.json.gz` suffix).
952
952
  */
953
953
  async getContext(t, e) {
954
- const o = `${this._gatewayUrl}${vo}/${t}/contexts/${e}.json.gz`, r = await this._auth.authenticatedFetch(o, {
954
+ const o = `${this._gatewayUrl}${Eo}/${t}/contexts/${e}.json.gz`, r = await this._auth.authenticatedFetch(o, {
955
955
  headers: {
956
956
  "cue-project-id": t,
957
957
  // Prevent the HTTP layer from auto-decompressing so we can handle it explicitly.
@@ -964,9 +964,40 @@ class To {
964
964
  return JSON.parse(await new Response(a).text());
965
965
  }
966
966
  }
967
+ class Po {
968
+ constructor(t, e) {
969
+ this._auth = t, this._gatewayUrl = e;
970
+ }
971
+ _auth;
972
+ _gatewayUrl;
973
+ async search(t, e, o) {
974
+ const r = await this._auth.authenticatedFetch(
975
+ `${this._gatewayUrl}${wo}`,
976
+ {
977
+ method: "POST",
978
+ headers: { "Content-Type": "application/json", "x-project-id": e },
979
+ body: JSON.stringify({ input: t, ...o })
980
+ }
981
+ );
982
+ if (!r.ok) throw new Error(`Index search failed: ${r.status} ${r.statusText}`);
983
+ return r.json();
984
+ }
985
+ async lookup(t, e, o) {
986
+ const r = await this._auth.authenticatedFetch(
987
+ `${this._gatewayUrl}${fo}`,
988
+ {
989
+ method: "POST",
990
+ headers: { "Content-Type": "application/json", "x-project-id": e },
991
+ body: JSON.stringify({ input: t, ...o })
992
+ }
993
+ );
994
+ if (!r.ok) throw new Error(`Index lookup failed: ${r.status} ${r.statusText}`);
995
+ return r.json();
996
+ }
997
+ }
967
998
  class Mt {
968
999
  constructor(t, e, o, r) {
969
- this._auth = t, this._gatewayUrl = e, this.projects = o, this.sync = r, this.tables = new Co(t, e), this.extraction = new So(t, e), this.contexts = new To(t, e);
1000
+ this._auth = t, this._gatewayUrl = e, this.projects = o, this.sync = r, this.tables = new So(t, e), this.extraction = new Ro(t, e), this.contexts = new Ao(t, e), this.index = new Po(t, e);
970
1001
  }
971
1002
  _auth;
972
1003
  _gatewayUrl;
@@ -977,6 +1008,8 @@ class Mt {
977
1008
  extraction;
978
1009
  /** Session context file client — fetch and decompress context documents. */
979
1010
  contexts;
1011
+ /** Direct interface to the Cue Index accessor — search and lookup. */
1012
+ index;
980
1013
  /** Active language used for language-sensitive SPARQL queries across all project classes. */
981
1014
  language = "en";
982
1015
  /** Updates the active language. All project classes (`CueProjectSchema`, `CueProjectDocuments`, `CueProjectEntities`) read this at query time. */
@@ -1062,7 +1095,7 @@ class Mt {
1062
1095
  const r = o?.format ?? "json-ld", s = r === "turtle" ? "text/turtle" : "application/ld+json";
1063
1096
  if (o?.graphType === "fuseki") {
1064
1097
  const c = await this._auth.authenticatedFetch(
1065
- `${this._gatewayUrl}${fo}`,
1098
+ `${this._gatewayUrl}${bo}`,
1066
1099
  {
1067
1100
  method: "POST",
1068
1101
  headers: {
@@ -1080,7 +1113,7 @@ class Mt {
1080
1113
  }
1081
1114
  return r === "turtle" ? c.text() : c.json();
1082
1115
  }
1083
- const a = `${this._gatewayUrl}${bo}${o?.verbose ? "?verbose=true" : ""}`, n = new URLSearchParams({ shape: t }), p = await this._auth.authenticatedFetch(a, {
1116
+ const a = `${this._gatewayUrl}${_o}${o?.verbose ? "?verbose=true" : ""}`, n = new URLSearchParams({ shape: t }), p = await this._auth.authenticatedFetch(a, {
1084
1117
  method: "POST",
1085
1118
  headers: {
1086
1119
  "Content-Type": "application/x-www-form-urlencoded",
@@ -1131,7 +1164,7 @@ const pt = [
1131
1164
  "railway",
1132
1165
  "natural",
1133
1166
  "manmade"
1134
- ], Ro = {
1167
+ ], Oo = {
1135
1168
  address: {
1136
1169
  category: "address",
1137
1170
  label: "Address",
@@ -1194,9 +1227,9 @@ const pt = [
1194
1227
  }
1195
1228
  };
1196
1229
  function T(i) {
1197
- return Ro[i];
1230
+ return Oo[i];
1198
1231
  }
1199
- const Ao = {
1232
+ const Do = {
1200
1233
  "land-use-plan": "#f59e0b",
1201
1234
  // amber – primary zoning
1202
1235
  "local-plan": "#ec4899",
@@ -1227,7 +1260,7 @@ const Ao = {
1227
1260
  function M(i, t) {
1228
1261
  return i[0] < t[2] && i[2] > t[0] && i[1] < t[3] && i[3] > t[1];
1229
1262
  }
1230
- const Po = "https://nominatim.openstreetmap.org", Oo = "cue-gis/0.0.1", Do = {
1263
+ const Lo = "https://nominatim.openstreetmap.org", qo = "cue-gis/0.0.1", jo = {
1231
1264
  address: "street",
1232
1265
  poi: "shop",
1233
1266
  railway: "station",
@@ -1242,7 +1275,7 @@ const Po = "https://nominatim.openstreetmap.org", Oo = "cue-gis/0.0.1", Do = {
1242
1275
  function B(i) {
1243
1276
  return `${L}:${i}`;
1244
1277
  }
1245
- function Lo(i) {
1278
+ function $o(i) {
1246
1279
  const t = T(i);
1247
1280
  return {
1248
1281
  id: B(i),
@@ -1257,13 +1290,13 @@ function Lo(i) {
1257
1290
  descriptionKey: `gis.layer.${L}.${i}.description`
1258
1291
  };
1259
1292
  }
1260
- class qo {
1293
+ class zo {
1261
1294
  baseUrl;
1262
1295
  userAgent;
1263
1296
  email;
1264
1297
  limit;
1265
1298
  constructor(t = {}) {
1266
- this.baseUrl = t.baseUrl ?? Po, this.userAgent = t.userAgent ?? Oo, this.email = t.email, this.limit = Math.min(t.limit ?? 40, 40);
1299
+ this.baseUrl = t.baseUrl ?? Lo, this.userAgent = t.userAgent ?? qo, this.email = t.email, this.limit = Math.min(t.limit ?? 40, 40);
1267
1300
  }
1268
1301
  async listFeatureCategoryDescriptors(t) {
1269
1302
  return (await Promise.allSettled(
@@ -1276,7 +1309,7 @@ class qo {
1276
1309
  ).map((o) => T(o.value.category));
1277
1310
  }
1278
1311
  async listAvailableLayers(t) {
1279
- return (await this.listFeatureCategoryDescriptors(t)).map((o) => Lo(o.category));
1312
+ return (await this.listFeatureCategoryDescriptors(t)).map((o) => $o(o.category));
1280
1313
  }
1281
1314
  async getFeaturesForLayer(t, e) {
1282
1315
  const o = pt.find((r) => B(r) === e);
@@ -1293,7 +1326,7 @@ class qo {
1293
1326
  * so bounded viewbox searches return meaningful results.
1294
1327
  */
1295
1328
  async search(t, e) {
1296
- const [o, r, s, a] = t, n = e ? Do[e] : "place", p = new URLSearchParams({
1329
+ const [o, r, s, a] = t, n = e ? jo[e] : "place", p = new URLSearchParams({
1297
1330
  q: n,
1298
1331
  format: "jsonv2",
1299
1332
  viewbox: `${o},${a},${s},${r}`,
@@ -1445,7 +1478,7 @@ const Nt = {
1445
1478
  1281: "infrastructure",
1446
1479
  1282: "infrastructure",
1447
1480
  9999: "other"
1448
- }, jo = {
1481
+ }, Uo = {
1449
1482
  // Residential
1450
1483
  1110: "residential",
1451
1484
  // Einfamilienhaus
@@ -1507,7 +1540,7 @@ const Nt = {
1507
1540
  // Empfangsgebäude Bahn/Bus
1508
1541
  1282: "infrastructure"
1509
1542
  // Parkhaus, Garage
1510
- }, zo = [
1543
+ }, Mo = [
1511
1544
  // "Gebäude" is the Swiss AV BoFlaeche land-cover label for a building footprint.
1512
1545
  // It does not encode the actual use type, so map it to 'other' as a safe fallback.
1513
1546
  [/^geb[äa]ude$/i, "other"],
@@ -1521,22 +1554,22 @@ const Nt = {
1521
1554
  [/gemischt|mixed|blandet/i, "mixed"]
1522
1555
  ];
1523
1556
  function O(i) {
1524
- for (const [t, e] of zo)
1557
+ for (const [t, e] of Mo)
1525
1558
  if (t.test(i)) return e;
1526
1559
  }
1527
- function $o(i, t) {
1560
+ function No(i, t) {
1528
1561
  if (i == null) return;
1529
1562
  const e = String(i).trim();
1530
- return t === "swiss-gwr" ? jo[e] ?? O(e) : t === "danish-matrikel" ? Nt[e] ?? O(e) : t === "zurich-wfs" || t === "swiss-av-wfs" ? Ft[e] ?? O(e) : Ft[e] ?? Nt[e] ?? O(e);
1563
+ return t === "swiss-gwr" ? Uo[e] ?? O(e) : t === "danish-matrikel" ? Nt[e] ?? O(e) : t === "zurich-wfs" || t === "swiss-av-wfs" ? Ft[e] ?? O(e) : Ft[e] ?? Nt[e] ?? O(e);
1531
1564
  }
1532
- function Uo(i, t) {
1565
+ function Fo(i, t) {
1533
1566
  if (i != null)
1534
1567
  return O(String(i).trim());
1535
1568
  }
1536
1569
  function me(i) {
1537
1570
  return i.trim().toLowerCase().replace(/[\s_\-]/g, "");
1538
1571
  }
1539
- const Mo = {
1572
+ const Bo = {
1540
1573
  // Swiss ÖREB rechtsstatus
1541
1574
  inkraft: "in-force",
1542
1575
  laufendeanderung: "amendment-pending",
@@ -1557,7 +1590,7 @@ const Mo = {
1557
1590
  };
1558
1591
  function we(i) {
1559
1592
  if (i)
1560
- return Mo[me(i)];
1593
+ return Bo[me(i)];
1561
1594
  }
1562
1595
  const Bt = {
1563
1596
  // Swiss Nutzungsplanung (typ_gde_bezeichnung and common variants)
@@ -1613,7 +1646,7 @@ const Bt = {
1613
1646
  // Danish plandata.dk
1614
1647
  lokalplan: "local-plan",
1615
1648
  kommuneplanramme: "municipal-plan-framework"
1616
- }, No = [
1649
+ }, Go = [
1617
1650
  [/quartiererhalt/i, "neighbourhood-conservation-plan"],
1618
1651
  [/lärmempfindlich|laermempfindlich/i, "noise-sensitivity-plan"],
1619
1652
  [/gewässerschutz|grundwasserschutz/i, "water-protection-plan"],
@@ -1657,20 +1690,20 @@ function fe(i) {
1657
1690
  if (!i) return;
1658
1691
  const t = me(i);
1659
1692
  if (t in Bt) return Bt[t];
1660
- for (const [e, o] of No)
1693
+ for (const [e, o] of Go)
1661
1694
  if (e.test(i)) return o;
1662
1695
  console.warn(
1663
1696
  `[cue-gis] Unknown zone plan type — add "${i}" to classifyZonePlanType: no ZonePlanType mapping found.`
1664
1697
  );
1665
1698
  }
1666
- const Fo = "https://maps.zh.ch/wfs/OGDZHWFS", Bo = "zurich-wfs", Go = [8.35, 47.15, 8.95, 47.7], Ho = [5.9, 45.7, 10.55, 47.85];
1699
+ const Ho = "https://maps.zh.ch/wfs/OGDZHWFS", Wo = "zurich-wfs", Vo = [8.35, 47.15, 8.95, 47.7], Xo = [5.9, 45.7, 10.55, 47.85];
1667
1700
  function J(i) {
1668
1701
  return typeof i == "string" ? i : i.typeName;
1669
1702
  }
1670
1703
  function tt(i) {
1671
1704
  return typeof i == "string" ? void 0 : i.cqlFilter;
1672
1705
  }
1673
- function Wo(i) {
1706
+ function Ko(i) {
1674
1707
  if (!i) return [0, 0];
1675
1708
  const t = i.coordinates;
1676
1709
  switch (i.type) {
@@ -1688,20 +1721,20 @@ function Wo(i) {
1688
1721
  return [0, 0];
1689
1722
  }
1690
1723
  }
1691
- function Vo(i, t) {
1724
+ function Qo(i, t) {
1692
1725
  if (!i) return t;
1693
1726
  for (const e of ["plannavn", "bezeichnung", "name", "strassenname", "objektname", "title", "label"])
1694
1727
  if (typeof i[e] == "string" && i[e]) return i[e];
1695
1728
  return t;
1696
1729
  }
1697
- function Xo(i, t, e) {
1730
+ function Yo(i, t, e) {
1698
1731
  return e ? `${i}:${t}[${e}]` : `${i}:${t}`;
1699
1732
  }
1700
- const Ko = /* @__PURE__ */ new Set(["building", "cadastre", "greenspace", "paved", "zone"]);
1733
+ const Zo = /* @__PURE__ */ new Set(["building", "cadastre", "greenspace", "paved", "zone"]);
1701
1734
  function et(i, t, e, o) {
1702
- const r = e.replace(/^ms:/, ""), s = T(t), a = Ko.has(t) ? "priority" : "raw";
1735
+ const r = e.replace(/^ms:/, ""), s = T(t), a = Zo.has(t) ? "priority" : "raw";
1703
1736
  return {
1704
- id: Xo(i, e, o),
1737
+ id: Yo(i, e, o),
1705
1738
  sourceId: i,
1706
1739
  sourceLayerId: e,
1707
1740
  category: t,
@@ -1713,32 +1746,32 @@ function et(i, t, e, o) {
1713
1746
  descriptionKey: `gis.layer.${i}.${r}.description`
1714
1747
  };
1715
1748
  }
1716
- function Qo(i, t) {
1749
+ function Jo(i, t) {
1717
1750
  if (!i) return { featureType: "building" };
1718
1751
  const e = i.grundflaeche ?? i.gbf ?? i.gebaeudegrundrissflaeche ?? i.flaeche ?? void 0, o = i.vollgeschosse ?? i.geschossanzahl ?? i.anzahl_geschosse ?? void 0, r = i.gebaeudefunktion ?? i.gfkode ?? i.art ?? i.objektart ?? void 0, s = i.baujahr ?? i.bauperiode ?? void 0, a = String(i.egid ?? i.gwr_egid ?? i.egris_egid ?? "").trim() || void 0;
1719
1752
  return {
1720
1753
  featureType: "building",
1721
1754
  areaM2: typeof e == "number" ? e : void 0,
1722
1755
  buildingUse: r ? String(r) : void 0,
1723
- buildingUseGeneric: $o(r, t),
1756
+ buildingUseGeneric: No(r, t),
1724
1757
  floors: typeof o == "number" ? o : void 0,
1725
1758
  yearBuilt: typeof s == "number" ? s : void 0,
1726
1759
  registryId: a
1727
1760
  };
1728
1761
  }
1729
- function Yo(i, t) {
1762
+ function tr(i, t) {
1730
1763
  if (!i) return { featureType: "plot" };
1731
1764
  const e = i.egris_egrid ?? i.egrid ?? void 0, o = i.nummer ?? void 0, r = i.nbident ?? void 0, s = o && r ? `${o}, ${r}` : o ?? void 0, a = i.flaechenmass ?? i.flaeche ?? void 0, n = i.art ?? i.nutzungsart ?? void 0;
1732
1765
  return {
1733
1766
  featureType: "plot",
1734
1767
  areaM2: typeof a == "number" ? a : void 0,
1735
1768
  plotUse: n ? String(n) : void 0,
1736
- plotUseGeneric: Uo(n),
1769
+ plotUseGeneric: Fo(n),
1737
1770
  plotId: s,
1738
1771
  registryId: e
1739
1772
  };
1740
1773
  }
1741
- function Zo(i) {
1774
+ function er(i) {
1742
1775
  if (!i) return { featureType: "greenspace" };
1743
1776
  const t = i.flaeche ?? void 0, e = i.art ?? void 0;
1744
1777
  return {
@@ -1747,7 +1780,7 @@ function Zo(i) {
1747
1780
  surfaceType: e ? String(e) : void 0
1748
1781
  };
1749
1782
  }
1750
- function Jo(i) {
1783
+ function or(i) {
1751
1784
  if (!i) return { featureType: "paved" };
1752
1785
  const t = i.flaeche ?? void 0, e = i.art ?? void 0;
1753
1786
  return {
@@ -1756,7 +1789,7 @@ function Jo(i) {
1756
1789
  surfaceType: e ? String(e) : void 0
1757
1790
  };
1758
1791
  }
1759
- function tr(i) {
1792
+ function rr(i) {
1760
1793
  if (!i) return { featureType: "zone" };
1761
1794
  const t = i.plannavn ?? i.bezeichnung ?? i.typ_bezeichnung ?? i.art ?? void 0, e = i.planid ?? i.plannummer ?? void 0, o = i.artcode ?? i.typ_code ?? i.abkuerzung ?? e ?? void 0, r = i.rechtsstatus ?? i.status ?? void 0, s = we(r), a = i.typ_gde_bezeichnung ?? void 0, n = fe(a), p = i.dagsordenpunkt_url ?? i.dokument_url ?? i.link ?? void 0, c = i.auflagedatum ?? void 0, h = i.festsetzungsdatum ?? void 0, d = i.genehmigungsdatum ?? void 0, g = i.inkraftsetzungsdatum ?? void 0, u = i.flaeche ?? i.flaeche_m2 ?? void 0;
1762
1795
  return {
@@ -1774,7 +1807,7 @@ function tr(i) {
1774
1807
  areaM2: typeof u == "number" ? u : void 0
1775
1808
  };
1776
1809
  }
1777
- function er(i) {
1810
+ function sr(i) {
1778
1811
  const t = i.match(/^(\w+)\s*=\s*'([^']+)'$/);
1779
1812
  if (t) {
1780
1813
  const [, o, r] = t;
@@ -1795,7 +1828,7 @@ class ot {
1795
1828
  sourceId;
1796
1829
  outputFormat;
1797
1830
  constructor(t) {
1798
- this.categoryMap = t.categoryMap, this.baseUrl = t.baseUrl ?? Fo, this.sourceId = t.sourceId ?? Bo, this.outputFormat = t.outputFormat ?? "application/json; subtype=geojson";
1831
+ this.categoryMap = t.categoryMap, this.baseUrl = t.baseUrl ?? Ho, this.sourceId = t.sourceId ?? Wo, this.outputFormat = t.outputFormat ?? "application/json; subtype=geojson";
1799
1832
  }
1800
1833
  async listFeatureCategoryDescriptors(t) {
1801
1834
  const e = await this.listAvailableLayers(t);
@@ -1819,7 +1852,7 @@ class ot {
1819
1852
  return o ? this._fetchAndConvert(t, o.descriptor, o.cqlFilter) : [];
1820
1853
  }
1821
1854
  async _fetchAndConvert(t, e, o) {
1822
- const r = await this._fetchFeatures(t, e.sourceLayerId, void 0, o), s = o ? er(o) : void 0;
1855
+ const r = await this._fetchFeatures(t, e.sourceLayerId, void 0, o), s = o ? sr(o) : void 0;
1823
1856
  return (s ? r.features.filter((n) => s(n.properties)) : r.features).map((n, p) => this.toGisFeature(n, e, p));
1824
1857
  }
1825
1858
  /**
@@ -1868,7 +1901,7 @@ class ot {
1868
1901
  return g.json();
1869
1902
  }
1870
1903
  toGisFeature(t, e, o) {
1871
- const [r, s] = Wo(t.geometry), a = Vo(t.properties, `${e.sourceLayerId}[${o}]`), n = t.bbox ? [t.bbox[0], t.bbox[1], t.bbox[2], t.bbox[3]] : void 0, p = e.tier, c = p === "priority" ? this._extractNormalisedProperties(t, e) : void 0;
1904
+ const [r, s] = Ko(t.geometry), a = Qo(t.properties, `${e.sourceLayerId}[${o}]`), n = t.bbox ? [t.bbox[0], t.bbox[1], t.bbox[2], t.bbox[3]] : void 0, p = e.tier, c = p === "priority" ? this._extractNormalisedProperties(t, e) : void 0;
1872
1905
  return {
1873
1906
  id: t.id ?? `${e.sourceLayerId}/${o}`,
1874
1907
  preferredColor: e.preferredColor,
@@ -1889,7 +1922,7 @@ class ot {
1889
1922
  };
1890
1923
  }
1891
1924
  _extractNormalisedProperties(t, e) {
1892
- return e.category === "building" ? Qo(t.properties, this.sourceId) : e.category === "greenspace" ? Zo(t.properties) : e.category === "paved" ? Jo(t.properties) : e.category === "zone" ? tr(t.properties) : Yo(t.properties, this.sourceId);
1925
+ return e.category === "building" ? Jo(t.properties, this.sourceId) : e.category === "greenspace" ? er(t.properties) : e.category === "paved" ? or(t.properties) : e.category === "zone" ? rr(t.properties) : tr(t.properties, this.sourceId);
1893
1926
  }
1894
1927
  }
1895
1928
  const ye = [8, 54.5, 15.2, 57.8], be = {
@@ -1901,7 +1934,7 @@ const ye = [8, 54.5, 15.2, 57.8], be = {
1901
1934
  { source: "danish-matrikel", typename: "mat_v001:samletfastejendom_current" }
1902
1935
  ]
1903
1936
  };
1904
- function or(i) {
1937
+ function ar(i) {
1905
1938
  if (!i) return [0, 0];
1906
1939
  const t = i.coordinates;
1907
1940
  switch (i.type) {
@@ -1919,7 +1952,7 @@ function or(i) {
1919
1952
  return [0, 0];
1920
1953
  }
1921
1954
  }
1922
- function rr(i, t) {
1955
+ function ir(i, t) {
1923
1956
  if (!i) return t;
1924
1957
  for (const e of [
1925
1958
  "mat:matrikelnummer",
@@ -1935,14 +1968,14 @@ function rr(i, t) {
1935
1968
  if (typeof i[e] == "string" && i[e]) return i[e];
1936
1969
  return t;
1937
1970
  }
1938
- function sr(i, t, e) {
1971
+ function nr(i, t, e) {
1939
1972
  return `${i}:${t}:${e}`;
1940
1973
  }
1941
- const ar = /* @__PURE__ */ new Set(["building", "cadastre", "zone"]);
1974
+ const pr = /* @__PURE__ */ new Set(["building", "cadastre", "zone"]);
1942
1975
  function rt(i, t, e) {
1943
- const o = e.typename.replace(/^[^:]+:/, ""), r = T(t), s = ar.has(t) ? "priority" : "raw";
1976
+ const o = e.typename.replace(/^[^:]+:/, ""), r = T(t), s = pr.has(t) ? "priority" : "raw";
1944
1977
  return {
1945
- id: sr(i, e.source, e.typename),
1978
+ id: nr(i, e.source, e.typename),
1946
1979
  sourceId: i,
1947
1980
  sourceLayerId: e.typename,
1948
1981
  category: t,
@@ -1954,7 +1987,7 @@ function rt(i, t, e) {
1954
1987
  descriptionKey: `gis.layer.${i}.${e.source}.${o}.description`
1955
1988
  };
1956
1989
  }
1957
- function ir(i, t) {
1990
+ function cr(i, t) {
1958
1991
  if (t === "building") {
1959
1992
  const a = i?.byg041BebyggetAreal ?? i?.byg038SamletBygningsareal, n = i?.byg021BygningensAnvendelse, p = i?.id_lokalId, c = i?.byg026Opførelsesår;
1960
1993
  return {
@@ -1990,7 +2023,7 @@ function ir(i, t) {
1990
2023
  registryId: s ?? void 0
1991
2024
  };
1992
2025
  }
1993
- class nr {
2026
+ class lr {
1994
2027
  categoryMap;
1995
2028
  dataViewsBaseUrl;
1996
2029
  getHeaders;
@@ -2059,7 +2092,7 @@ class nr {
2059
2092
  return d.json();
2060
2093
  }
2061
2094
  _toGisFeature(t, e, o) {
2062
- const [r, s] = or(t.geometry), a = t.id ?? `${e.sourceLayerId}/${o}`, n = rr(t.properties, a), p = t.bbox ? [t.bbox[0], t.bbox[1], t.bbox[2], t.bbox[3]] : void 0, c = e.tier, h = c === "priority" ? ir(t.properties, e.category) : void 0;
2095
+ const [r, s] = ar(t.geometry), a = t.id ?? `${e.sourceLayerId}/${o}`, n = ir(t.properties, a), p = t.bbox ? [t.bbox[0], t.bbox[1], t.bbox[2], t.bbox[3]] : void 0, c = e.tier, h = c === "priority" ? cr(t.properties, e.category) : void 0;
2063
2096
  return {
2064
2097
  id: a,
2065
2098
  sourceId: this.sourceId,
@@ -2080,7 +2113,7 @@ class nr {
2080
2113
  };
2081
2114
  }
2082
2115
  }
2083
- const pr = {
2116
+ const hr = {
2084
2117
  address: [
2085
2118
  "ms:ogd-0406_arv_basis_avzh_hausnummer_pos_p",
2086
2119
  "ms:ogd-0571_afv_gv_strat_strassennetz_l"
@@ -2131,16 +2164,16 @@ const pr = {
2131
2164
  }, ve = [
2132
2165
  {
2133
2166
  name: "Canton of Zürich",
2134
- coverageBBox: Go,
2167
+ coverageBBox: Vo,
2135
2168
  supportedCategories: ["address", "poi", "railway", "natural", "manmade", "building", "cadastre", "greenspace", "paved", "zone"],
2136
2169
  priority: 10,
2137
2170
  adapter: new ot({
2138
- categoryMap: pr
2171
+ categoryMap: hr
2139
2172
  })
2140
2173
  },
2141
2174
  {
2142
2175
  name: "Switzerland (national AV cadastre)",
2143
- coverageBBox: Ho,
2176
+ coverageBBox: Xo,
2144
2177
  supportedCategories: ["cadastre"],
2145
2178
  priority: 5,
2146
2179
  // Lower priority than canton-specific adapters. For ZH, the canton adapter (priority 10) wins.
@@ -2191,7 +2224,7 @@ function Gt(i) {
2191
2224
  (t, e) => pt.indexOf(t.category) - pt.indexOf(e.category)
2192
2225
  );
2193
2226
  }
2194
- class cr {
2227
+ class dr {
2195
2228
  nominatim;
2196
2229
  regions;
2197
2230
  /**
@@ -2206,9 +2239,9 @@ class cr {
2206
2239
  zonePlanTypeColors: r,
2207
2240
  ...s
2208
2241
  } = t;
2209
- this.nominatim = new qo(s);
2242
+ this.nominatim = new zo(s);
2210
2243
  const a = o ? ve : [];
2211
- this.regions = e ?? a, this.zonePlanTypeColors = { ...Ao, ...r };
2244
+ this.regions = e ?? a, this.zonePlanTypeColors = { ...Do, ...r };
2212
2245
  }
2213
2246
  /**
2214
2247
  * Return the available feature categories together with UI metadata such as
@@ -2339,7 +2372,7 @@ class cr {
2339
2372
  ), a = [], n = [];
2340
2373
  for (const d of s)
2341
2374
  d.status === "fulfilled" && (d.value.isNominatim ? n.push(...d.value.features) : a.push(...d.value.features));
2342
- const p = dr(a, n), c = /* @__PURE__ */ new Map(), h = [];
2375
+ const p = mr(a, n), c = /* @__PURE__ */ new Map(), h = [];
2343
2376
  for (const d of p) {
2344
2377
  const g = Ht(d), u = W(d), m = c.get(g);
2345
2378
  (m === void 0 || u > m) && (c.set(g, u), h.push(d));
@@ -2363,18 +2396,18 @@ function Ht(i) {
2363
2396
  const t = Math.round(i.lat * 1e3) / 1e3, e = Math.round(i.lon * 1e3) / 1e3;
2364
2397
  return `${(i.name ?? i.id ?? "").toLowerCase().trim()}|${t}|${e}`;
2365
2398
  }
2366
- const lr = 1e-3;
2367
- function hr(i, t) {
2399
+ const gr = 1e-3;
2400
+ function ur(i, t) {
2368
2401
  const e = i.lat - t.lat, o = i.lon - t.lon;
2369
2402
  return Math.sqrt(e * e + o * o);
2370
2403
  }
2371
- function dr(i, t) {
2404
+ function mr(i, t) {
2372
2405
  if (t.length === 0) return i;
2373
2406
  const e = i.filter((a) => W(a) === 3), o = i.filter((a) => W(a) !== 3), r = e.map((a) => ({ feature: { ...a, originalData: { ...a.originalData } }, matched: !1 })), s = [];
2374
2407
  for (const a of t) {
2375
- let n = -1, p = lr;
2408
+ let n = -1, p = gr;
2376
2409
  for (let c = 0; c < r.length; c++) {
2377
- const h = hr(a, r[c].feature);
2410
+ const h = ur(a, r[c].feature);
2378
2411
  h < p && (p = h, n = c);
2379
2412
  }
2380
2413
  n >= 0 ? (r[n].feature.originalData = {
@@ -2388,8 +2421,8 @@ function dr(i, t) {
2388
2421
  ...s
2389
2422
  ];
2390
2423
  }
2391
- const gr = "/data-views", ur = 1500;
2392
- class mr {
2424
+ const wr = "/data-views", fr = 1500;
2425
+ class yr {
2393
2426
  // undefined = not yet built
2394
2427
  /** @internal — construct via `cue.gis`, not directly. */
2395
2428
  constructor(t, e) {
@@ -2472,7 +2505,7 @@ class mr {
2472
2505
  }
2473
2506
  // ── Private ───────────────────────────────────────────────────────────────
2474
2507
  _scheduleDebouncedQuery() {
2475
- this._debounceTimer !== null && clearTimeout(this._debounceTimer), this._debounceTimer = setTimeout(() => this._queryLayers(), ur);
2508
+ this._debounceTimer !== null && clearTimeout(this._debounceTimer), this._debounceTimer = setTimeout(() => this._queryLayers(), fr);
2476
2509
  }
2477
2510
  _getGateway() {
2478
2511
  if (this._gatewayCache !== null && this._gatewayProjectId === this._projectId)
@@ -2483,14 +2516,14 @@ class mr {
2483
2516
  coverageBBox: ye,
2484
2517
  supportedCategories: Object.keys(be),
2485
2518
  priority: 10,
2486
- adapter: new nr({
2487
- dataViewsBaseUrl: `${this._gatewayUrl}${gr}`,
2519
+ adapter: new lr({
2520
+ dataViewsBaseUrl: `${this._gatewayUrl}${wr}`,
2488
2521
  getHeaders: async () => ({
2489
2522
  ...await this._getAuthHeaders(),
2490
2523
  "x-project-id": t
2491
2524
  })
2492
2525
  })
2493
- }), this._gatewayCache = new cr({ regions: e }), this._gatewayProjectId = t, this._gatewayCache;
2526
+ }), this._gatewayCache = new dr({ regions: e }), this._gatewayProjectId = t, this._gatewayCache;
2494
2527
  }
2495
2528
  async _queryLayers() {
2496
2529
  const t = this._bbox;
@@ -2586,9 +2619,9 @@ class Wt {
2586
2619
  async incrementUnitsConsumed(t, e, o) {
2587
2620
  if (e <= 0) return;
2588
2621
  const r = bt(this._db, "clientSync", t);
2589
- await ze(r, {
2622
+ await $e(r, {
2590
2623
  unitsConsumed: Ue(e),
2591
- lastUpdated: $e(),
2624
+ lastUpdated: ze(),
2592
2625
  lastUserId: o
2593
2626
  }, { merge: !0 });
2594
2627
  }
@@ -2769,7 +2802,7 @@ const Xt = ["superadmin", "admin", "syncer", "member"], Kt = {
2769
2802
  uploadDocuments: "syncer",
2770
2803
  viewEntities: "member"
2771
2804
  };
2772
- function wr() {
2805
+ function br() {
2773
2806
  return {
2774
2807
  changeContentCategories: !1,
2775
2808
  createEntities: !1,
@@ -2831,7 +2864,7 @@ class Qt {
2831
2864
  return e === -1 ? [] : Array.from(Xt.slice(e));
2832
2865
  }
2833
2866
  _compute() {
2834
- const t = this._projectRoles.get(), e = this._isSuperAdmin.get(), o = wr();
2867
+ const t = this._projectRoles.get(), e = this._isSuperAdmin.get(), o = br();
2835
2868
  for (const r of Object.keys(Kt))
2836
2869
  o[r] = t.includes(Kt[r]);
2837
2870
  return o.createProject = e || this._orgRole.get() === "admin", o;
@@ -2882,7 +2915,7 @@ class Yt {
2882
2915
  d.set(u, g), g += u.length;
2883
2916
  return JSON.parse(new TextDecoder().decode(d));
2884
2917
  } catch (o) {
2885
- if (fr(o)) return;
2918
+ if (vr(o)) return;
2886
2919
  throw o;
2887
2920
  }
2888
2921
  }
@@ -2904,7 +2937,7 @@ class Yt {
2904
2937
  );
2905
2938
  }
2906
2939
  }
2907
- function fr(i) {
2940
+ function vr(i) {
2908
2941
  return typeof i == "object" && i !== null && "code" in i && i.code === "storage/object-not-found";
2909
2942
  }
2910
2943
  const y = {
@@ -6186,7 +6219,7 @@ class V {
6186
6219
  ), this._nsMap = t, t;
6187
6220
  }
6188
6221
  }
6189
- const yr = `${y.qcy}ContentCategory`, br = `${y.qcy}EntityCategory`, vr = `${y.qcy}relatedEntity`, _r = `PREFIX view: <https://qlever.cs.uni-freiburg.de/materializedView/>
6222
+ const _r = `${y.qcy}ContentCategory`, Er = `${y.qcy}EntityCategory`, kr = `${y.qcy}relatedEntity`, xr = `PREFIX view: <https://qlever.cs.uni-freiburg.de/materializedView/>
6190
6223
  SELECT ?iri ?type ?parent ?deprecated ?label ?definition
6191
6224
  WHERE {
6192
6225
  SERVICE view:schemas {
@@ -6198,7 +6231,7 @@ WHERE {
6198
6231
  view:column-definition ?definition .
6199
6232
  }
6200
6233
  }`;
6201
- class Er {
6234
+ class Cr {
6202
6235
  constructor(t, e, o, r, s, a) {
6203
6236
  this._api = t, this._projectId = e, this._queryCache = r, this._graphType = s, this._verbose = a ?? !1, this._currentLang = o, this._api.setLanguage(o), this._contentCategories = new x([]), this._entityCategories = new x([]), this._relationships = new x([]), this.availableContentCategories = this._contentCategories.asReadonly(), this.availableEntityCategories = this._entityCategories.asReadonly(), this.availableEntityRelationships = this._relationships.asReadonly(), this.ready = this._load().catch(
6204
6237
  (n) => console.error("[CueProjectSchema] Initial load failed:", n)
@@ -6285,7 +6318,7 @@ class Er {
6285
6318
  */
6286
6319
  async _fetchSnapshot() {
6287
6320
  if (this._graphType !== "fuseki") {
6288
- const e = await this._runSchemaQuery(_r);
6321
+ const e = await this._runSchemaQuery(xr);
6289
6322
  if (e.contentCategories.length + e.entityCategories.length + e.relationships.length > 0) return e;
6290
6323
  console.warn(
6291
6324
  `[CueProjectSchema] Materialized view "schemas" returned no rows for project ${this._projectId} — falling back to the live schema query.`
@@ -6368,7 +6401,7 @@ WHERE {
6368
6401
  relationships: []
6369
6402
  };
6370
6403
  for (const s of o.values())
6371
- Jt(s.labels), Jt(s.definitions), s.type === yr ? r.contentCategories.push(s) : s.type === br ? r.entityCategories.push(s) : s.type === vr && r.relationships.push(s);
6404
+ Jt(s.labels), Jt(s.definitions), s.type === _r ? r.contentCategories.push(s) : s.type === Er ? r.entityCategories.push(s) : s.type === kr && r.relationships.push(s);
6372
6405
  return r;
6373
6406
  }
6374
6407
  }
@@ -6389,7 +6422,7 @@ function Jt(i) {
6389
6422
  function te(i, t) {
6390
6423
  return i[t] ?? i.default;
6391
6424
  }
6392
- const kr = "https://qlever.dev/api/osm-planet";
6425
+ const Ir = "https://qlever.dev/api/osm-planet";
6393
6426
  class _e {
6394
6427
  constructor(t, e, o = ut, r, s, a = !1) {
6395
6428
  this._api = t, this._projectId = e, this._queryCache = r, this._graphType = s, this._verbose = a, this.baseURL = `${o}${e}/`, this.entityInfoMap = this._entityInfoMapComputed, this.entityGraph = this._entityGraph.asReadonly(), this._entityOSMMap.subscribe(() => this._checkPendingOSMFetches()), this._fetchEntityGraph().catch(
@@ -6908,7 +6941,7 @@ GROUP BY ?e1Cat ?e2Cat`;
6908
6941
  const o = e.map((n) => `<${n}>`).join(" "), r = `PREFIX geo: <${R.geo}>
6909
6942
  SELECT * WHERE {
6910
6943
  VALUES ?s { ${o} }
6911
- SERVICE <${kr}> {
6944
+ SERVICE <${Ir}> {
6912
6945
  ?s geo:hasGeometry/geo:asWKT ?wkt
6913
6946
  }
6914
6947
  }`, s = await this._api.sparql(
@@ -7783,7 +7816,7 @@ const ct = {
7783
7816
  }
7784
7817
  };
7785
7818
  l.AUDIO + "", l.VIDEO + "", l.IMAGE + "", l.TEXT + "", l.MARKUP + "", l.SCRIPT + "", l.DATA + "", l.ARCHIVE + "", l.INSTALLER + "", l.BINARY + "", l.BACKUP + "", l.AUTOMATION + "", l.PRESENTATION + "", l.SPREADSHEET + "", l.FONT + "", l.GEOSPATIAL + "", l.THREE_D + "", l.CAD + "", l.BIM + "", l.PLANNING + "", l.EMAIL + "", l.MULTIMEDIA + "", l.UNKNOWN + "";
7786
- const xr = `PREFIX view: <https://qlever.cs.uni-freiburg.de/materializedView/>
7819
+ const Sr = `PREFIX view: <https://qlever.cs.uni-freiburg.de/materializedView/>
7787
7820
  SELECT ?ext ?totalSize ?docCount
7788
7821
  WHERE {
7789
7822
  SERVICE view:docs-by-suffix {
@@ -7791,7 +7824,7 @@ WHERE {
7791
7824
  view:column-totalSize ?totalSize ;
7792
7825
  view:column-docCount ?docCount .
7793
7826
  }
7794
- }`, Cr = `PREFIX view: <https://qlever.cs.uni-freiburg.de/materializedView/>
7827
+ }`, Tr = `PREFIX view: <https://qlever.cs.uni-freiburg.de/materializedView/>
7795
7828
  SELECT ?cat ?totalSize ?docCount
7796
7829
  WHERE {
7797
7830
  SERVICE view:docs-by-category {
@@ -7799,7 +7832,7 @@ WHERE {
7799
7832
  view:column-totalSize ?totalSize ;
7800
7833
  view:column-docCount ?docCount .
7801
7834
  }
7802
- }`, Ir = `PREFIX view: <https://qlever.cs.uni-freiburg.de/materializedView/>
7835
+ }`, Rr = `PREFIX view: <https://qlever.cs.uni-freiburg.de/materializedView/>
7803
7836
  SELECT ?count
7804
7837
  WHERE {
7805
7838
  SERVICE view:doc-duplicates {
@@ -8155,7 +8188,7 @@ GROUP BY ?id ?suffix ?size`, r = await this._api.sparql(o, this._projectId, this
8155
8188
  }
8156
8189
  async _fetchDocumentsBySuffix() {
8157
8190
  if (this._graphType !== "fuseki") {
8158
- const e = await this._runDocumentsBySuffixQuery(xr);
8191
+ const e = await this._runDocumentsBySuffixQuery(Sr);
8159
8192
  if (Object.keys(e).length > 0) return e;
8160
8193
  console.warn(`[CueProjectDocuments] Materialized view "docs-by-suffix" returned no rows for project ${this._projectId} — falling back to live query.`);
8161
8194
  }
@@ -8189,7 +8222,7 @@ ORDER BY DESC(?docCount)`;
8189
8222
  }
8190
8223
  async _fetchDocumentsByContentCategory() {
8191
8224
  if (this._graphType !== "fuseki") {
8192
- const e = await this._runDocumentsByContentCategoryQuery(Cr);
8225
+ const e = await this._runDocumentsByContentCategoryQuery(Tr);
8193
8226
  if (Object.keys(e).length > 0) return e;
8194
8227
  console.warn(`[CueProjectDocuments] Materialized view "docs-by-category" returned no rows for project ${this._projectId} — falling back to live query.`);
8195
8228
  }
@@ -8223,7 +8256,7 @@ ORDER BY DESC(?docCount)`;
8223
8256
  }
8224
8257
  async _fetchDuplicateCount() {
8225
8258
  if (this._graphType !== "fuseki") {
8226
- const e = await this._api.sparql(Ir, this._projectId, this._graphType);
8259
+ const e = await this._api.sparql(Rr, this._projectId, this._graphType);
8227
8260
  if (e.results.bindings.length > 0) {
8228
8261
  const o = e.results.bindings[0];
8229
8262
  return o?.count ? parseInt(o.count.value, 10) : 0;
@@ -8251,9 +8284,9 @@ WHERE {
8251
8284
  return o?.count ? parseInt(o.count.value, 10) : 0;
8252
8285
  }
8253
8286
  }
8254
- class Sr {
8287
+ class Ar {
8255
8288
  constructor(t, e, { language: o, queryCache: r, rdfBase: s = ut, graphType: a, verbose: n }) {
8256
- this._api = t, this._projectId = e, this.schema = new Er(t, e, o, r, a, n), this.entities = new _e(t, e, s, r, a, n), this.documents = new lt(t, e, o, s, r, a, n), this.availableContentCategories = this.schema.availableContentCategories, this.availableEntityCategories = this.schema.availableEntityCategories, this.availableEntityRelationships = this.schema.availableEntityRelationships, this.schemaReady = this.schema.ready, this.entityInfoMap = this.entities.entityInfoMap, this.entityGraph = this.entities.entityGraph, this.documentInfoMap = this.documents.documentInfoMap, this.projectDocumentsData = this.documents.projectDocumentsData, this.searchResults = this._searchResults.asReadonly(), this.documents.fetchOverview().catch((p) => console.error("[CueProjectView] fetchOverview failed:", p));
8289
+ this._api = t, this._projectId = e, this.schema = new Cr(t, e, o, r, a, n), this.entities = new _e(t, e, s, r, a, n), this.documents = new lt(t, e, o, s, r, a, n), this.availableContentCategories = this.schema.availableContentCategories, this.availableEntityCategories = this.schema.availableEntityCategories, this.availableEntityRelationships = this.schema.availableEntityRelationships, this.schemaReady = this.schema.ready, this.entityInfoMap = this.entities.entityInfoMap, this.entityGraph = this.entities.entityGraph, this.documentInfoMap = this.documents.documentInfoMap, this.projectDocumentsData = this.documents.projectDocumentsData, this.searchResults = this._searchResults.asReadonly(), this.documents.fetchOverview().catch((p) => console.error("[CueProjectView] fetchOverview failed:", p));
8257
8290
  }
8258
8291
  _api;
8259
8292
  _projectId;
@@ -8406,20 +8439,20 @@ function ee(i, t) {
8406
8439
  });
8407
8440
  });
8408
8441
  }
8409
- const { namedNode: Tr, literal: Hr } = j;
8410
- Tr("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
8411
- const { namedNode: Wr } = j, { namedNode: Rr, literal: Vr } = j;
8412
- Rr("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
8413
- function Ar(i) {
8414
- const t = i.split(".");
8415
- return t.length > 1 ? "." + t.pop()?.toLowerCase() : "";
8416
- }
8417
8442
  const { namedNode: Pr, literal: Xr } = j;
8418
8443
  Pr("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
8419
- const { namedNode: Or, literal: Kr } = j;
8444
+ const { namedNode: Kr } = j, { namedNode: Or, literal: Qr } = j;
8420
8445
  Or("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
8446
+ function Dr(i) {
8447
+ const t = i.split(".");
8448
+ return t.length > 1 ? "." + t.pop()?.toLowerCase() : "";
8449
+ }
8450
+ const { namedNode: Lr, literal: Yr } = j;
8451
+ Lr("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
8452
+ const { namedNode: qr, literal: Zr } = j;
8453
+ qr("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
8421
8454
  function oe(i, t, e, o, r, s, a, n = !1, p = !1) {
8422
- const c = Ar(i), h = D(o), d = `${t}/${h}${c}`;
8455
+ const c = Dr(i), h = D(o), d = `${t}/${h}${c}`;
8423
8456
  a === void 0 && (a = ct[c]?.mime ?? "application/octet-stream");
8424
8457
  const g = io(i, r);
8425
8458
  return {
@@ -8441,7 +8474,7 @@ function oe(i, t, e, o, r, s, a, n = !1, p = !1) {
8441
8474
  })
8442
8475
  };
8443
8476
  }
8444
- async function z() {
8477
+ async function $() {
8445
8478
  return import(
8446
8479
  /* webpackIgnore: true */
8447
8480
  "fs/promises"
@@ -8452,14 +8485,14 @@ async function re(i) {
8452
8485
  throw new Error(
8453
8486
  `Cannot read file from path "${i}" in a browser environment. Provide file.data (Uint8Array) instead.`
8454
8487
  );
8455
- const { readFile: t } = await z();
8488
+ const { readFile: t } = await $();
8456
8489
  return t(i);
8457
8490
  }
8458
8491
  let q = null, G = null, H = null;
8459
- function Qr(i) {
8492
+ function Jr(i) {
8460
8493
  H = i, G = null, q = null;
8461
8494
  }
8462
- async function Dr() {
8495
+ async function jr() {
8463
8496
  if (typeof window < "u") {
8464
8497
  if (!H)
8465
8498
  throw new Error(
@@ -8471,7 +8504,7 @@ async function Dr() {
8471
8504
  const t = new Uint8Array(await i.arrayBuffer()), o = await import(`${H}/dir_scanner_wasm.mjs`);
8472
8505
  await o.default({ module_or_path: t }), q = o.scan;
8473
8506
  } else {
8474
- const { readFile: i } = await z(), { join: t } = await import(
8507
+ const { readFile: i } = await $(), { join: t } = await import(
8475
8508
  /* webpackIgnore: true */
8476
8509
  "path"
8477
8510
  ), { pathToFileURL: e } = await import(
@@ -8481,7 +8514,7 @@ async function Dr() {
8481
8514
  await a.default({ module_or_path: r }), q = a.scan;
8482
8515
  }
8483
8516
  }
8484
- const Lr = "qlever", N = 1e3, mt = "cue:pending:";
8517
+ const $r = "qlever", N = 1e3, mt = "cue:pending:";
8485
8518
  async function wt(i) {
8486
8519
  const { tmpdir: t } = await import(
8487
8520
  /* webpackIgnore: true */
@@ -8498,7 +8531,7 @@ async function se(i) {
8498
8531
  return t ? JSON.parse(t) : null;
8499
8532
  }
8500
8533
  try {
8501
- const t = await (await z()).readFile(await wt(i), "utf-8");
8534
+ const t = await (await $()).readFile(await wt(i), "utf-8");
8502
8535
  return JSON.parse(t);
8503
8536
  } catch {
8504
8537
  return null;
@@ -8510,19 +8543,19 @@ async function ae(i) {
8510
8543
  window.localStorage.setItem(`${mt}${i.spaceId}`, t);
8511
8544
  return;
8512
8545
  }
8513
- await (await z()).writeFile(await wt(i.spaceId), t, "utf-8");
8546
+ await (await $()).writeFile(await wt(i.spaceId), t, "utf-8");
8514
8547
  }
8515
- async function qr(i) {
8548
+ async function zr(i) {
8516
8549
  if (typeof window < "u") {
8517
8550
  window.localStorage.removeItem(`${mt}${i}`);
8518
8551
  return;
8519
8552
  }
8520
8553
  try {
8521
- await (await z()).unlink(await wt(i));
8554
+ await (await $()).unlink(await wt(i));
8522
8555
  } catch {
8523
8556
  }
8524
8557
  }
8525
- class jr {
8558
+ class Ur {
8526
8559
  constructor(t, e, o, r) {
8527
8560
  this._auth = t, this._projects = e, this._blob = o, this._gatewayUrl = r;
8528
8561
  }
@@ -8696,7 +8729,7 @@ class jr {
8696
8729
  async _getOrCreateGraph(t, e) {
8697
8730
  const o = this._graphMap.get(t);
8698
8731
  if (o) return o;
8699
- const s = (await this._projects.getProject(t))?.projectSettings?.graph?.type ?? Lr, a = s === "qlever" ? `${this._gatewayUrl}${de}` : `${this._gatewayUrl}${he}`, n = s === "qlever" ? `${this._gatewayUrl}${yo}` : `${this._gatewayUrl}${wo}`, p = new so({
8732
+ const s = (await this._projects.getProject(t))?.projectSettings?.graph?.type ?? $r, a = s === "qlever" ? `${this._gatewayUrl}${de}` : `${this._gatewayUrl}${he}`, n = s === "qlever" ? `${this._gatewayUrl}${vo}` : `${this._gatewayUrl}${yo}`, p = new so({
8700
8733
  graphType: s,
8701
8734
  queryEndpoint: a,
8702
8735
  updateEndpoint: n,
@@ -8798,7 +8831,7 @@ WHERE {
8798
8831
  }
8799
8832
  async _flushBatch(t, e, o) {
8800
8833
  const r = [...t];
8801
- this._pendingSpaceId === e && (this._pendingItems = []), await qr(e);
8834
+ this._pendingSpaceId === e && (this._pendingItems = []), await zr(e);
8802
8835
  try {
8803
8836
  for (let s = 0; s < r.length; s += N)
8804
8837
  await this._postFssBatch(r.slice(s, s + N), e);
@@ -8839,7 +8872,7 @@ WHERE {
8839
8872
  * shown to the user before or after calling {@link sync}.
8840
8873
  */
8841
8874
  async scanCost(t) {
8842
- if (G || (G = Dr()), await G, !q) throw new Error("WASM scan function not initialised");
8875
+ if (G || (G = jr()), await G, !q) throw new Error("WASM scan function not initialised");
8843
8876
  const e = 200, o = /* @__PURE__ */ new Map();
8844
8877
  for (let r = 0; r < t.length; r += e) {
8845
8878
  const s = t.slice(r, r + e), a = await Promise.all(
@@ -8998,7 +9031,7 @@ class Ee {
8998
9031
  * ```
8999
9032
  */
9000
9033
  get gis() {
9001
- return this._gis || (this._gis = new mr(
9034
+ return this._gis || (this._gis = new yr(
9002
9035
  () => this.api.getAuthHeaders(),
9003
9036
  this._endpoints.gatewayUrl
9004
9037
  )), this._gis;
@@ -9015,7 +9048,7 @@ class Ee {
9015
9048
  authDomain: `${xt}.firebaseapp.com`,
9016
9049
  projectId: xt,
9017
9050
  messagingSenderId: no
9018
- }), this.auth = new $t(this._app, this._isEmulator, this._endpoints), this.projects = new Wt(this.auth, this._app, this._isEmulator, this._endpoints), this._storageRaw = C(this._app, Tt), this._storageProcessed = C(this._app, Rt);
9051
+ }), this.auth = new zt(this._app, this._isEmulator, this._endpoints), this.projects = new Wt(this.auth, this._app, this._isEmulator, this._endpoints), this._storageRaw = C(this._app, Tt), this._storageProcessed = C(this._app, Rt);
9019
9052
  const n = C(this._app, Pt), p = C(this._app, At), c = C(this._app, St), h = C(this._app, Ot), d = C(this._app, It);
9020
9053
  this._isEmulator && (K(this._storageRaw, this._endpoints.storageEmulatorHost, this._endpoints.storageEmulatorPort), K(this._storageProcessed, this._endpoints.storageEmulatorHost, this._endpoints.storageEmulatorPort)), this.api = this._buildApi(this.projects), new Et({
9021
9054
  storageRaw: this._storageRaw,
@@ -9049,7 +9082,7 @@ class Ee {
9049
9082
  * });
9050
9083
  */
9051
9084
  static fromApp(t, e = {}) {
9052
- const o = e.environment ?? "production", r = { ...ie[o], ...e.endpoints }, s = new $t(t, !1, r), a = new Wt(s, t, !1, r), n = C(t, Tt), p = C(t, Rt), c = C(t, Pt), h = C(t, At), d = C(t, St), g = C(t, Ot), u = C(t, It), m = new Et({
9085
+ const o = e.environment ?? "production", r = { ...ie[o], ...e.endpoints }, s = new zt(t, !1, r), a = new Wt(s, t, !1, r), n = C(t, Tt), p = C(t, Rt), c = C(t, Pt), h = C(t, At), d = C(t, St), g = C(t, Ot), u = C(t, It), m = new Et({
9053
9086
  storageRaw: n,
9054
9087
  storageProcessed: p,
9055
9088
  storagePublic: c,
@@ -9057,7 +9090,7 @@ class Ee {
9057
9090
  storageChatSessions: d,
9058
9091
  storagePersistence: g,
9059
9092
  storageSessions: u
9060
- }), f = new jr(s, a, m, r.gatewayUrl), _ = new Mt(s, r.gatewayUrl, a, f);
9093
+ }), f = new Ur(s, a, m, r.gatewayUrl), _ = new Mt(s, r.gatewayUrl, a, f);
9061
9094
  f._bindApi(_);
9062
9095
  const w = new Vt(s, t, !1, r.gatewayUrl), E = Object.create(Ee.prototype), I = new Qt(s.isSuperAdmin), v = new Yt(g), b = new Ut(s, r.gatewayUrl);
9063
9096
  return Object.assign(E, {
@@ -9102,7 +9135,7 @@ class Ee {
9102
9135
  get: (r) => this.cache.getQueryCache(t, r).then((s) => s?.results),
9103
9136
  set: (r, s) => this.cache.setQueryCache(t, r, { query: r, results: s })
9104
9137
  };
9105
- return new Sr(this.api, t, { verbose: this._verbose, ...e, queryCache: o });
9138
+ return new Ar(this.api, t, { verbose: this._verbose, ...e, queryCache: o });
9106
9139
  }
9107
9140
  /**
9108
9141
  * Creates a `CueProjectEntities` instance for the given project, with the
@@ -9188,28 +9221,29 @@ export {
9188
9221
  Ee as C,
9189
9222
  Kt as R,
9190
9223
  Mt as a,
9191
- $t as b,
9224
+ zt as b,
9192
9225
  Yt as c,
9193
- To as d,
9194
- So as e,
9195
- mr as f,
9196
- Qt as g,
9197
- Vt as h,
9198
- lt as i,
9199
- _e as j,
9200
- Er as k,
9201
- Sr as l,
9202
- Wt as m,
9203
- x as n,
9204
- Ut as o,
9205
- jr as p,
9206
- Co as q,
9207
- Qr as r,
9208
- dt as s,
9209
- gt as t,
9210
- At as u,
9211
- Ot as v,
9212
- Pt as w,
9213
- It as x,
9214
- Et as y
9226
+ Ao as d,
9227
+ Ro as e,
9228
+ yr as f,
9229
+ Po as g,
9230
+ Qt as h,
9231
+ Vt as i,
9232
+ lt as j,
9233
+ _e as k,
9234
+ Cr as l,
9235
+ Ar as m,
9236
+ Wt as n,
9237
+ x as o,
9238
+ Ut as p,
9239
+ Ur as q,
9240
+ So as r,
9241
+ Jr as s,
9242
+ dt as t,
9243
+ gt as u,
9244
+ At as v,
9245
+ Ot as w,
9246
+ Pt as x,
9247
+ It as y,
9248
+ Et as z
9215
9249
  };