@startinblox/core 0.19.0-beta.9 → 0.19.0

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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { d as defineComponent, u as uniqID, f as fuzzyCompare, p as parseFieldsString, a as findClosingBracketMatchIndex, c as compare, e as evalTemplateString, s as setDeepProperty, t as transformArrayToContainer } from "./assets/helpers-bf15809c.js";
2
- import { h } from "./assets/helpers-bf15809c.js";
1
+ import { d as defineComponent, u as uniqID, i as importInlineCSS, f as fuzzyCompare, p as parseFieldsString, a as findClosingBracketMatchIndex, c as compare, e as evalTemplateString, s as setDeepProperty, t as transformArrayToContainer } from "./helpers-4tVqSOBU.js";
2
+ import { h } from "./helpers-4tVqSOBU.js";
3
3
  import PubSub$1 from "https://cdn.skypack.dev/pubsub-js";
4
4
  import L from "https://cdn.skypack.dev/leaflet";
5
5
  import "https://cdn.skypack.dev/leaflet.markercluster";
@@ -10993,6 +10993,8 @@ class CustomGetter {
10993
10993
  return;
10994
10994
  try {
10995
10995
  let isUrl = new URL(path);
10996
+ if (!isUrl.protocol.startsWith("http"))
10997
+ throw new Error("Not a valid HTTP url");
10996
10998
  if (isUrl) {
10997
10999
  let value = this.resource[this.getExpandedPredicate(path)];
10998
11000
  return value ? value : void 0;
@@ -11125,7 +11127,14 @@ class CustomGetter {
11125
11127
  * @param prop
11126
11128
  */
11127
11129
  isFullResource() {
11128
- return Object.keys(this.resource).filter((p) => !p.startsWith("@")).length > 0 || this.resource["@id"].startsWith("_:b");
11130
+ let propertiesKeys = Object.keys(this.resource).filter((p) => !p.startsWith("@"));
11131
+ if (this.resource["@id"].startsWith("_:b"))
11132
+ return true;
11133
+ if (propertiesKeys.length === 1 && propertiesKeys[0] === this.getExpandedPredicate("permissions"))
11134
+ return false;
11135
+ else if (propertiesKeys.length > 0)
11136
+ return true;
11137
+ return false;
11129
11138
  }
11130
11139
  /**
11131
11140
  * Get permissions of a resource
@@ -11133,21 +11142,19 @@ class CustomGetter {
11133
11142
  * @returns
11134
11143
  */
11135
11144
  async getPermissions() {
11136
- let permissionsIds = this.resource[this.getExpandedPredicate("permissions")];
11137
- if (!permissionsIds) {
11138
- await this.getResource(this.resourceId, { ...this.clientContext, ...this.serverContext }, this.parentId, true);
11139
- permissionsIds = this.resource[this.getExpandedPredicate("permissions")];
11145
+ let permissions = this.resource[this.getExpandedPredicate("permissions")];
11146
+ if (!permissions) {
11147
+ await this.getResource(
11148
+ this.resourceId,
11149
+ { ...this.clientContext, ...this.serverContext },
11150
+ this.parentId,
11151
+ true
11152
+ );
11153
+ permissions = this.resource[this.getExpandedPredicate("permissions")];
11140
11154
  }
11141
- if (!permissionsIds)
11142
- return [];
11143
- if (!Array.isArray(permissionsIds))
11144
- permissionsIds = [permissionsIds];
11145
- const permissions = await Promise.all(
11146
- permissionsIds.map((p) => store.get(p["@id"] + this.parentId)).map((p) => p ? p["mode.@type"] : "")
11147
- );
11148
- return permissions ? permissions.map(
11149
- (perm) => ContextParser$1.expandTerm(perm, this.serverContext, true)
11150
- ) : [];
11155
+ if (!Array.isArray(permissions))
11156
+ permissions = [permissions];
11157
+ return permissions ? permissions : [];
11151
11158
  }
11152
11159
  /**
11153
11160
  * returns compacted @type of resource
@@ -11357,7 +11364,7 @@ class Store {
11357
11364
  resolve2(null);
11358
11365
  return;
11359
11366
  }
11360
- const serverContext = await myParser.parse([resource["@context"] || {}]);
11367
+ const serverContext = await myParser.parse([resource["@context"] || base_context]);
11361
11368
  await this.cacheGraph(resource, clientContext, serverContext, parentId ? parentId : key, serverPagination, serverSearch);
11362
11369
  this.loadingList.delete(key);
11363
11370
  document.dispatchEvent(new CustomEvent("resourceReady", { detail: { id: key, resource: this.get(key) } }));
@@ -11738,6 +11745,12 @@ class Store {
11738
11745
  }
11739
11746
  return iri;
11740
11747
  }
11748
+ /**
11749
+ * Return the user session information
11750
+ */
11751
+ async getSession() {
11752
+ return await this.session;
11753
+ }
11741
11754
  /**
11742
11755
  * Return language of the users
11743
11756
  */
@@ -12092,9 +12105,15 @@ const StoreMixin = {
12092
12105
  if (this.nestedField) {
12093
12106
  const resource = await store.getData(value, this.context);
12094
12107
  const nestedResource = resource ? await resource[this.nestedField] : null;
12095
- this.resourceId = nestedResource ? nestedResource["@id"] : null;
12096
- if (!this.resourceId)
12097
- throw `Error: the key "${this.nestedField}" does not exist on the resource`;
12108
+ this.resourceId = nestedResource ? await nestedResource["@id"] : null;
12109
+ if (resource && !this.resourceId && !nestedResource) {
12110
+ console.trace();
12111
+ console.log(nestedResource);
12112
+ for (const property in await resource) {
12113
+ console.log(`${property}: ${await resource[property]}`);
12114
+ }
12115
+ throw `Error: the key "${this.nestedField}" does not exist on the resource at id "${await resource["@id"]}"`;
12116
+ }
12098
12117
  }
12099
12118
  this.updateNavigateSubscription();
12100
12119
  this.subscription = PubSub.subscribe(this.resourceId, this.updateDOM.bind(this));
@@ -12604,7 +12623,6 @@ const MultipleFormMixin = {
12604
12623
  }
12605
12624
  } catch (ex) {
12606
12625
  this.dataSrc = value;
12607
- console.log("Not an array", ex);
12608
12626
  }
12609
12627
  }
12610
12628
  const nextProcessor = listValueTransformations.shift();
@@ -13454,18 +13472,18 @@ var arrayMap = _arrayMap, baseIndexOf = _baseIndexOf, baseIndexOfWith = _baseInd
13454
13472
  var arrayProto = Array.prototype;
13455
13473
  var splice = arrayProto.splice;
13456
13474
  function basePullAll$1(array, values, iteratee, comparator) {
13457
- var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values.length, seen2 = array;
13475
+ var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values.length, seen = array;
13458
13476
  if (array === values) {
13459
13477
  values = copyArray(values);
13460
13478
  }
13461
13479
  if (iteratee) {
13462
- seen2 = arrayMap(array, baseUnary$1(iteratee));
13480
+ seen = arrayMap(array, baseUnary$1(iteratee));
13463
13481
  }
13464
13482
  while (++index2 < length) {
13465
13483
  var fromIndex = 0, value = values[index2], computed = iteratee ? iteratee(value) : value;
13466
- while ((fromIndex = indexOf2(seen2, computed, fromIndex, comparator)) > -1) {
13467
- if (seen2 !== array) {
13468
- splice.call(seen2, fromIndex, 1);
13484
+ while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
13485
+ if (seen !== array) {
13486
+ splice.call(seen, fromIndex, 1);
13469
13487
  }
13470
13488
  splice.call(array, fromIndex, 1);
13471
13489
  }
@@ -13662,11 +13680,11 @@ var fromDelta_converters$1 = {
13662
13680
  function applyInlineAttributes(attrs2, next2) {
13663
13681
  var first = [], then = [];
13664
13682
  attrs2 = attrs2 || {};
13665
- var tag2 = el2, seen2 = {};
13683
+ var tag2 = el2, seen = {};
13666
13684
  while (tag2._format) {
13667
- seen2[tag2._format] = true;
13685
+ seen[tag2._format] = true;
13668
13686
  if (!attrs2[tag2._format]) {
13669
- for (var k2 in seen2) {
13687
+ for (var k2 in seen) {
13670
13688
  delete activeInline[k2];
13671
13689
  }
13672
13690
  el2 = tag2.parent();
@@ -24010,7 +24028,7 @@ var UrlMatch = (
24010
24028
  );
24011
24029
  var Matcher = (
24012
24030
  /** @class */
24013
- function() {
24031
+ /* @__PURE__ */ function() {
24014
24032
  function Matcher2(cfg) {
24015
24033
  this.__jsduckDummyDocProp = null;
24016
24034
  this.tagBuilder = cfg.tagBuilder;
@@ -24230,7 +24248,7 @@ var EmailMatcher = (
24230
24248
  );
24231
24249
  var CurrentEmailMatch = (
24232
24250
  /** @class */
24233
- function() {
24251
+ /* @__PURE__ */ function() {
24234
24252
  function CurrentEmailMatch2(cfg) {
24235
24253
  if (cfg === void 0) {
24236
24254
  cfg = {};
@@ -24957,7 +24975,7 @@ function parseHtml(html2, _a) {
24957
24975
  }
24958
24976
  var CurrentTag = (
24959
24977
  /** @class */
24960
- function() {
24978
+ /* @__PURE__ */ function() {
24961
24979
  function CurrentTag2(cfg) {
24962
24980
  if (cfg === void 0) {
24963
24981
  cfg = {};
@@ -25461,57 +25479,6 @@ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
25461
25479
  TelMixin,
25462
25480
  attributeDirectory
25463
25481
  }, Symbol.toStringTag, { value: "Module" }));
25464
- const scriptRel = "modulepreload";
25465
- const assetsURL = function(dep, importerUrl) {
25466
- return new URL(dep, importerUrl).href;
25467
- };
25468
- const seen = {};
25469
- const __vitePreload = function preload(baseModule, deps, importerUrl) {
25470
- if (!deps || deps.length === 0) {
25471
- return baseModule();
25472
- }
25473
- const links = document.getElementsByTagName("link");
25474
- return Promise.all(deps.map((dep) => {
25475
- dep = assetsURL(dep, importerUrl);
25476
- if (dep in seen)
25477
- return;
25478
- seen[dep] = true;
25479
- const isCss = dep.endsWith(".css");
25480
- const cssSelector = isCss ? '[rel="stylesheet"]' : "";
25481
- const isBaseRelative = !!importerUrl;
25482
- if (isBaseRelative) {
25483
- for (let i = links.length - 1; i >= 0; i--) {
25484
- const link4 = links[i];
25485
- if (link4.href === dep && (!isCss || link4.rel === "stylesheet")) {
25486
- return;
25487
- }
25488
- }
25489
- } else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
25490
- return;
25491
- }
25492
- const link3 = document.createElement("link");
25493
- link3.rel = isCss ? "stylesheet" : scriptRel;
25494
- if (!isCss) {
25495
- link3.as = "script";
25496
- link3.crossOrigin = "";
25497
- }
25498
- link3.href = dep;
25499
- document.head.appendChild(link3);
25500
- if (isCss) {
25501
- return new Promise((res, rej) => {
25502
- link3.addEventListener("load", res);
25503
- link3.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`)));
25504
- });
25505
- }
25506
- })).then(() => baseModule()).catch((err) => {
25507
- const e = new Event("vite:preloadError", { cancelable: true });
25508
- e.payload = err;
25509
- window.dispatchEvent(e);
25510
- if (!e.defaultPrevented) {
25511
- throw err;
25512
- }
25513
- });
25514
- };
25515
25482
  var exports = {};
25516
25483
  !function(e, t) {
25517
25484
  "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.SlimSelect = t() : e.SlimSelect = t();
@@ -26136,8 +26103,8 @@ const TranslationMixin = {
26136
26103
  async getTranslationModule(langCode) {
26137
26104
  const translationsModules = {
26138
26105
  // define modules in a static way, snowpack does not support dynamic strings here
26139
- en: () => __vitePreload(() => import("./assets/en-e53105c5.js"), true ? [] : void 0, import.meta.url),
26140
- fr: () => __vitePreload(() => import("./assets/fr-a7fcdb64.js"), true ? [] : void 0, import.meta.url)
26106
+ en: () => import("./en-7f7JgW9b.js"),
26107
+ fr: () => import("./fr-r9OPSsZY.js")
26141
26108
  };
26142
26109
  if (!translationsModules[langCode]) {
26143
26110
  console.warn(`${langCode}.json translation file may not exist, English is setted by default`);
@@ -26196,7 +26163,7 @@ const AutocompletionMixin = {
26196
26163
  mutationObserver: null
26197
26164
  },
26198
26165
  created() {
26199
- __vitePreload(() => Promise.resolve({}), true ? ["./assets/slimselect-43e3ebc8.css"] : void 0, import.meta.url);
26166
+ importInlineCSS("slimselect", () => import("./slimselect-AzdIsdl3.js"));
26200
26167
  this.slimSelect = null;
26201
26168
  this.addToAttributes(true, "autocomplete");
26202
26169
  this.listCallbacks.push(this.addCallback.bind(this));
@@ -26935,7 +26902,7 @@ var quill = { exports: {} };
26935
26902
  value: true
26936
26903
  });
26937
26904
  exports3.default = exports3.BlockEmbed = exports3.bubbleFormats = void 0;
26938
- var _createClass = function() {
26905
+ var _createClass = /* @__PURE__ */ function() {
26939
26906
  function defineProperties(target2, props) {
26940
26907
  for (var i = 0; i < props.length; i++) {
26941
26908
  var descriptor = props[i];
@@ -27216,7 +27183,7 @@ var quill = { exports: {} };
27216
27183
  } : function(obj) {
27217
27184
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
27218
27185
  };
27219
- var _slicedToArray = function() {
27186
+ var _slicedToArray = /* @__PURE__ */ function() {
27220
27187
  function sliceIterator(arr, i) {
27221
27188
  var _arr = [];
27222
27189
  var _n = true;
@@ -27252,7 +27219,7 @@ var quill = { exports: {} };
27252
27219
  }
27253
27220
  };
27254
27221
  }();
27255
- var _createClass = function() {
27222
+ var _createClass = /* @__PURE__ */ function() {
27256
27223
  function defineProperties(target2, props) {
27257
27224
  for (var i = 0; i < props.length; i++) {
27258
27225
  var descriptor = props[i];
@@ -27908,7 +27875,7 @@ var quill = { exports: {} };
27908
27875
  Object.defineProperty(exports3, "__esModule", {
27909
27876
  value: true
27910
27877
  });
27911
- var _createClass = function() {
27878
+ var _createClass = /* @__PURE__ */ function() {
27912
27879
  function defineProperties(target2, props) {
27913
27880
  for (var i = 0; i < props.length; i++) {
27914
27881
  var descriptor = props[i];
@@ -28082,7 +28049,7 @@ var quill = { exports: {} };
28082
28049
  Object.defineProperty(exports3, "__esModule", {
28083
28050
  value: true
28084
28051
  });
28085
- var _createClass = function() {
28052
+ var _createClass = /* @__PURE__ */ function() {
28086
28053
  function defineProperties(target2, props) {
28087
28054
  for (var i = 0; i < props.length; i++) {
28088
28055
  var descriptor = props[i];
@@ -28412,7 +28379,7 @@ var quill = { exports: {} };
28412
28379
  value: true
28413
28380
  });
28414
28381
  exports3.default = exports3.Code = void 0;
28415
- var _slicedToArray = function() {
28382
+ var _slicedToArray = /* @__PURE__ */ function() {
28416
28383
  function sliceIterator(arr, i) {
28417
28384
  var _arr = [];
28418
28385
  var _n = true;
@@ -28448,7 +28415,7 @@ var quill = { exports: {} };
28448
28415
  }
28449
28416
  };
28450
28417
  }();
28451
- var _createClass = function() {
28418
+ var _createClass = /* @__PURE__ */ function() {
28452
28419
  function defineProperties(target2, props) {
28453
28420
  for (var i = 0; i < props.length; i++) {
28454
28421
  var descriptor = props[i];
@@ -28668,7 +28635,7 @@ var quill = { exports: {} };
28668
28635
  } : function(obj) {
28669
28636
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
28670
28637
  };
28671
- var _slicedToArray = function() {
28638
+ var _slicedToArray = /* @__PURE__ */ function() {
28672
28639
  function sliceIterator(arr, i) {
28673
28640
  var _arr = [];
28674
28641
  var _n = true;
@@ -28704,7 +28671,7 @@ var quill = { exports: {} };
28704
28671
  }
28705
28672
  };
28706
28673
  }();
28707
- var _createClass = function() {
28674
+ var _createClass = /* @__PURE__ */ function() {
28708
28675
  function defineProperties(target2, props) {
28709
28676
  for (var i = 0; i < props.length; i++) {
28710
28677
  var descriptor = props[i];
@@ -29046,7 +29013,7 @@ var quill = { exports: {} };
29046
29013
  value: true
29047
29014
  });
29048
29015
  exports3.default = exports3.Range = void 0;
29049
- var _slicedToArray = function() {
29016
+ var _slicedToArray = /* @__PURE__ */ function() {
29050
29017
  function sliceIterator(arr, i) {
29051
29018
  var _arr = [];
29052
29019
  var _n = true;
@@ -29082,7 +29049,7 @@ var quill = { exports: {} };
29082
29049
  }
29083
29050
  };
29084
29051
  }();
29085
- var _createClass = function() {
29052
+ var _createClass = /* @__PURE__ */ function() {
29086
29053
  function defineProperties(target2, props) {
29087
29054
  for (var i = 0; i < props.length; i++) {
29088
29055
  var descriptor = props[i];
@@ -29532,7 +29499,7 @@ var quill = { exports: {} };
29532
29499
  Object.defineProperty(exports3, "__esModule", {
29533
29500
  value: true
29534
29501
  });
29535
- var _createClass = function() {
29502
+ var _createClass = /* @__PURE__ */ function() {
29536
29503
  function defineProperties(target2, props) {
29537
29504
  for (var i = 0; i < props.length; i++) {
29538
29505
  var descriptor = props[i];
@@ -30381,7 +30348,7 @@ var quill = { exports: {} };
30381
30348
  Object.defineProperty(exports3, "__esModule", {
30382
30349
  value: true
30383
30350
  });
30384
- var _slicedToArray = function() {
30351
+ var _slicedToArray = /* @__PURE__ */ function() {
30385
30352
  function sliceIterator(arr, i) {
30386
30353
  var _arr = [];
30387
30354
  var _n = true;
@@ -30417,7 +30384,7 @@ var quill = { exports: {} };
30417
30384
  }
30418
30385
  };
30419
30386
  }();
30420
- var _createClass = function() {
30387
+ var _createClass = /* @__PURE__ */ function() {
30421
30388
  function defineProperties(target2, props) {
30422
30389
  for (var i = 0; i < props.length; i++) {
30423
30390
  var descriptor = props[i];
@@ -30692,7 +30659,7 @@ var quill = { exports: {} };
30692
30659
  } : function(obj) {
30693
30660
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
30694
30661
  };
30695
- var _slicedToArray = function() {
30662
+ var _slicedToArray = /* @__PURE__ */ function() {
30696
30663
  function sliceIterator(arr, i) {
30697
30664
  var _arr = [];
30698
30665
  var _n = true;
@@ -30728,7 +30695,7 @@ var quill = { exports: {} };
30728
30695
  }
30729
30696
  };
30730
30697
  }();
30731
- var _createClass = function() {
30698
+ var _createClass = /* @__PURE__ */ function() {
30732
30699
  function defineProperties(target2, props) {
30733
30700
  for (var i = 0; i < props.length; i++) {
30734
30701
  var descriptor = props[i];
@@ -31281,7 +31248,7 @@ var quill = { exports: {} };
31281
31248
  Object.defineProperty(exports3, "__esModule", {
31282
31249
  value: true
31283
31250
  });
31284
- var _slicedToArray = function() {
31251
+ var _slicedToArray = /* @__PURE__ */ function() {
31285
31252
  function sliceIterator(arr, i) {
31286
31253
  var _arr = [];
31287
31254
  var _n = true;
@@ -31338,7 +31305,7 @@ var quill = { exports: {} };
31338
31305
  return getter.call(receiver);
31339
31306
  }
31340
31307
  };
31341
- var _createClass = function() {
31308
+ var _createClass = /* @__PURE__ */ function() {
31342
31309
  function defineProperties(target2, props) {
31343
31310
  for (var i = 0; i < props.length; i++) {
31344
31311
  var descriptor = props[i];
@@ -31569,7 +31536,7 @@ var quill = { exports: {} };
31569
31536
  value: true
31570
31537
  });
31571
31538
  exports3.ColorStyle = exports3.ColorClass = exports3.ColorAttributor = void 0;
31572
- var _createClass = function() {
31539
+ var _createClass = /* @__PURE__ */ function() {
31573
31540
  function defineProperties(target2, props) {
31574
31541
  for (var i = 0; i < props.length; i++) {
31575
31542
  var descriptor = props[i];
@@ -31670,7 +31637,7 @@ var quill = { exports: {} };
31670
31637
  value: true
31671
31638
  });
31672
31639
  exports3.sanitize = exports3.default = void 0;
31673
- var _createClass = function() {
31640
+ var _createClass = /* @__PURE__ */ function() {
31674
31641
  function defineProperties(target2, props) {
31675
31642
  for (var i = 0; i < props.length; i++) {
31676
31643
  var descriptor = props[i];
@@ -31795,7 +31762,7 @@ var quill = { exports: {} };
31795
31762
  } : function(obj) {
31796
31763
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
31797
31764
  };
31798
- var _createClass = function() {
31765
+ var _createClass = /* @__PURE__ */ function() {
31799
31766
  function defineProperties(target2, props) {
31800
31767
  for (var i = 0; i < props.length; i++) {
31801
31768
  var descriptor = props[i];
@@ -32417,7 +32384,7 @@ var quill = { exports: {} };
32417
32384
  Object.defineProperty(exports3, "__esModule", {
32418
32385
  value: true
32419
32386
  });
32420
- var _createClass = function() {
32387
+ var _createClass = /* @__PURE__ */ function() {
32421
32388
  function defineProperties(target2, props) {
32422
32389
  for (var i = 0; i < props.length; i++) {
32423
32390
  var descriptor = props[i];
@@ -32482,7 +32449,7 @@ var quill = { exports: {} };
32482
32449
  Object.defineProperty(exports3, "__esModule", {
32483
32450
  value: true
32484
32451
  });
32485
- var _createClass = function() {
32452
+ var _createClass = /* @__PURE__ */ function() {
32486
32453
  function defineProperties(target2, props) {
32487
32454
  for (var i = 0; i < props.length; i++) {
32488
32455
  var descriptor = props[i];
@@ -32707,7 +32674,7 @@ var quill = { exports: {} };
32707
32674
  value: true
32708
32675
  });
32709
32676
  exports3.FontClass = exports3.FontStyle = void 0;
32710
- var _createClass = function() {
32677
+ var _createClass = /* @__PURE__ */ function() {
32711
32678
  function defineProperties(target2, props) {
32712
32679
  for (var i = 0; i < props.length; i++) {
32713
32680
  var descriptor = props[i];
@@ -32877,7 +32844,7 @@ var quill = { exports: {} };
32877
32844
  value: true
32878
32845
  });
32879
32846
  exports3.getLastChangeIndex = exports3.default = void 0;
32880
- var _createClass = function() {
32847
+ var _createClass = /* @__PURE__ */ function() {
32881
32848
  function defineProperties(target2, props) {
32882
32849
  for (var i = 0; i < props.length; i++) {
32883
32850
  var descriptor = props[i];
@@ -33060,7 +33027,7 @@ var quill = { exports: {} };
33060
33027
  value: true
33061
33028
  });
33062
33029
  exports3.default = exports3.BaseTooltip = void 0;
33063
- var _createClass = function() {
33030
+ var _createClass = /* @__PURE__ */ function() {
33064
33031
  function defineProperties(target2, props) {
33065
33032
  for (var i = 0; i < props.length; i++) {
33066
33033
  var descriptor = props[i];
@@ -34786,7 +34753,7 @@ var quill = { exports: {} };
34786
34753
  } : function(obj) {
34787
34754
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
34788
34755
  };
34789
- var _slicedToArray = function() {
34756
+ var _slicedToArray = /* @__PURE__ */ function() {
34790
34757
  function sliceIterator(arr, i) {
34791
34758
  var _arr = [];
34792
34759
  var _n = true;
@@ -34822,7 +34789,7 @@ var quill = { exports: {} };
34822
34789
  }
34823
34790
  };
34824
34791
  }();
34825
- var _createClass = function() {
34792
+ var _createClass = /* @__PURE__ */ function() {
34826
34793
  function defineProperties(target2, props) {
34827
34794
  for (var i = 0; i < props.length; i++) {
34828
34795
  var descriptor = props[i];
@@ -35211,7 +35178,7 @@ var quill = { exports: {} };
35211
35178
  Object.defineProperty(exports3, "__esModule", {
35212
35179
  value: true
35213
35180
  });
35214
- var _createClass = function() {
35181
+ var _createClass = /* @__PURE__ */ function() {
35215
35182
  function defineProperties(target2, props) {
35216
35183
  for (var i = 0; i < props.length; i++) {
35217
35184
  var descriptor = props[i];
@@ -35313,7 +35280,7 @@ var quill = { exports: {} };
35313
35280
  value: true
35314
35281
  });
35315
35282
  exports3.addControls = exports3.default = void 0;
35316
- var _slicedToArray = function() {
35283
+ var _slicedToArray = /* @__PURE__ */ function() {
35317
35284
  function sliceIterator(arr, i) {
35318
35285
  var _arr = [];
35319
35286
  var _n = true;
@@ -35349,7 +35316,7 @@ var quill = { exports: {} };
35349
35316
  }
35350
35317
  };
35351
35318
  }();
35352
- var _createClass = function() {
35319
+ var _createClass = /* @__PURE__ */ function() {
35353
35320
  function defineProperties(target2, props) {
35354
35321
  for (var i = 0; i < props.length; i++) {
35355
35322
  var descriptor = props[i];
@@ -35673,7 +35640,7 @@ var quill = { exports: {} };
35673
35640
  Object.defineProperty(exports3, "__esModule", {
35674
35641
  value: true
35675
35642
  });
35676
- var _createClass = function() {
35643
+ var _createClass = /* @__PURE__ */ function() {
35677
35644
  function defineProperties(target2, props) {
35678
35645
  for (var i = 0; i < props.length; i++) {
35679
35646
  var descriptor = props[i];
@@ -35781,7 +35748,7 @@ var quill = { exports: {} };
35781
35748
  Object.defineProperty(exports3, "__esModule", {
35782
35749
  value: true
35783
35750
  });
35784
- var _createClass = function() {
35751
+ var _createClass = /* @__PURE__ */ function() {
35785
35752
  function defineProperties(target2, props) {
35786
35753
  for (var i = 0; i < props.length; i++) {
35787
35754
  var descriptor = props[i];
@@ -35876,7 +35843,7 @@ var quill = { exports: {} };
35876
35843
  Object.defineProperty(exports3, "__esModule", {
35877
35844
  value: true
35878
35845
  });
35879
- var _createClass = function() {
35846
+ var _createClass = /* @__PURE__ */ function() {
35880
35847
  function defineProperties(target2, props) {
35881
35848
  for (var i = 0; i < props.length; i++) {
35882
35849
  var descriptor = props[i];
@@ -35964,7 +35931,7 @@ var quill = { exports: {} };
35964
35931
  Object.defineProperty(exports3, "__esModule", {
35965
35932
  value: true
35966
35933
  });
35967
- var _slicedToArray = function() {
35934
+ var _slicedToArray = /* @__PURE__ */ function() {
35968
35935
  function sliceIterator(arr, i) {
35969
35936
  var _arr = [];
35970
35937
  var _n = true;
@@ -36021,7 +35988,7 @@ var quill = { exports: {} };
36021
35988
  return getter.call(receiver);
36022
35989
  }
36023
35990
  };
36024
- var _createClass = function() {
35991
+ var _createClass = /* @__PURE__ */ function() {
36025
35992
  function defineProperties(target2, props) {
36026
35993
  for (var i = 0; i < props.length; i++) {
36027
35994
  var descriptor = props[i];
@@ -36306,7 +36273,7 @@ var quill = { exports: {} };
36306
36273
  value: true
36307
36274
  });
36308
36275
  exports3.IndentClass = void 0;
36309
- var _createClass = function() {
36276
+ var _createClass = /* @__PURE__ */ function() {
36310
36277
  function defineProperties(target2, props) {
36311
36278
  for (var i = 0; i < props.length; i++) {
36312
36279
  var descriptor = props[i];
@@ -36457,7 +36424,7 @@ var quill = { exports: {} };
36457
36424
  Object.defineProperty(exports3, "__esModule", {
36458
36425
  value: true
36459
36426
  });
36460
- var _createClass = function() {
36427
+ var _createClass = /* @__PURE__ */ function() {
36461
36428
  function defineProperties(target2, props) {
36462
36429
  for (var i = 0; i < props.length; i++) {
36463
36430
  var descriptor = props[i];
@@ -36525,7 +36492,7 @@ var quill = { exports: {} };
36525
36492
  value: true
36526
36493
  });
36527
36494
  exports3.default = exports3.ListItem = void 0;
36528
- var _createClass = function() {
36495
+ var _createClass = /* @__PURE__ */ function() {
36529
36496
  function defineProperties(target2, props) {
36530
36497
  for (var i = 0; i < props.length; i++) {
36531
36498
  var descriptor = props[i];
@@ -36794,7 +36761,7 @@ var quill = { exports: {} };
36794
36761
  Object.defineProperty(exports3, "__esModule", {
36795
36762
  value: true
36796
36763
  });
36797
- var _createClass = function() {
36764
+ var _createClass = /* @__PURE__ */ function() {
36798
36765
  function defineProperties(target2, props) {
36799
36766
  for (var i = 0; i < props.length; i++) {
36800
36767
  var descriptor = props[i];
@@ -36981,7 +36948,7 @@ var quill = { exports: {} };
36981
36948
  Object.defineProperty(exports3, "__esModule", {
36982
36949
  value: true
36983
36950
  });
36984
- var _createClass = function() {
36951
+ var _createClass = /* @__PURE__ */ function() {
36985
36952
  function defineProperties(target2, props) {
36986
36953
  for (var i = 0; i < props.length; i++) {
36987
36954
  var descriptor = props[i];
@@ -37113,7 +37080,7 @@ var quill = { exports: {} };
37113
37080
  Object.defineProperty(exports3, "__esModule", {
37114
37081
  value: true
37115
37082
  });
37116
- var _createClass = function() {
37083
+ var _createClass = /* @__PURE__ */ function() {
37117
37084
  function defineProperties(target2, props) {
37118
37085
  for (var i = 0; i < props.length; i++) {
37119
37086
  var descriptor = props[i];
@@ -37242,7 +37209,7 @@ var quill = { exports: {} };
37242
37209
  value: true
37243
37210
  });
37244
37211
  exports3.default = exports3.FormulaBlot = void 0;
37245
- var _createClass = function() {
37212
+ var _createClass = /* @__PURE__ */ function() {
37246
37213
  function defineProperties(target2, props) {
37247
37214
  for (var i = 0; i < props.length; i++) {
37248
37215
  var descriptor = props[i];
@@ -37368,7 +37335,7 @@ var quill = { exports: {} };
37368
37335
  value: true
37369
37336
  });
37370
37337
  exports3.default = exports3.CodeToken = exports3.CodeBlock = void 0;
37371
- var _createClass = function() {
37338
+ var _createClass = /* @__PURE__ */ function() {
37372
37339
  function defineProperties(target2, props) {
37373
37340
  for (var i = 0; i < props.length; i++) {
37374
37341
  var descriptor = props[i];
@@ -37719,7 +37686,7 @@ var quill = { exports: {} };
37719
37686
  return getter.call(receiver);
37720
37687
  }
37721
37688
  };
37722
- var _createClass = function() {
37689
+ var _createClass = /* @__PURE__ */ function() {
37723
37690
  function defineProperties(target2, props) {
37724
37691
  for (var i = 0; i < props.length; i++) {
37725
37692
  var descriptor = props[i];
@@ -38632,7 +38599,7 @@ lodash.exports;
38632
38599
  }
38633
38600
  return new LodashWrapper(value);
38634
38601
  }
38635
- var baseCreate = function() {
38602
+ var baseCreate = /* @__PURE__ */ function() {
38636
38603
  function object() {
38637
38604
  }
38638
38605
  return function(proto2) {
@@ -39269,12 +39236,12 @@ lodash.exports;
39269
39236
  caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined$1;
39270
39237
  }
39271
39238
  array = arrays[0];
39272
- var index2 = -1, seen2 = caches[0];
39239
+ var index2 = -1, seen = caches[0];
39273
39240
  outer:
39274
39241
  while (++index2 < length && result2.length < maxLength) {
39275
39242
  var value = array[index2], computed = iteratee2 ? iteratee2(value) : value;
39276
39243
  value = comparator || value !== 0 ? value : 0;
39277
- if (!(seen2 ? cacheHas(seen2, computed) : includes2(result2, computed, comparator))) {
39244
+ if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) {
39278
39245
  othIndex = othLength;
39279
39246
  while (--othIndex) {
39280
39247
  var cache = caches[othIndex];
@@ -39282,8 +39249,8 @@ lodash.exports;
39282
39249
  continue outer;
39283
39250
  }
39284
39251
  }
39285
- if (seen2) {
39286
- seen2.push(computed);
39252
+ if (seen) {
39253
+ seen.push(computed);
39287
39254
  }
39288
39255
  result2.push(value);
39289
39256
  }
@@ -39578,18 +39545,18 @@ lodash.exports;
39578
39545
  };
39579
39546
  }
39580
39547
  function basePullAll2(array, values2, iteratee2, comparator) {
39581
- var indexOf3 = comparator ? baseIndexOfWith2 : baseIndexOf2, index2 = -1, length = values2.length, seen2 = array;
39548
+ var indexOf3 = comparator ? baseIndexOfWith2 : baseIndexOf2, index2 = -1, length = values2.length, seen = array;
39582
39549
  if (array === values2) {
39583
39550
  values2 = copyArray2(values2);
39584
39551
  }
39585
39552
  if (iteratee2) {
39586
- seen2 = arrayMap2(array, baseUnary2(iteratee2));
39553
+ seen = arrayMap2(array, baseUnary2(iteratee2));
39587
39554
  }
39588
39555
  while (++index2 < length) {
39589
39556
  var fromIndex = 0, value = values2[index2], computed = iteratee2 ? iteratee2(value) : value;
39590
- while ((fromIndex = indexOf3(seen2, computed, fromIndex, comparator)) > -1) {
39591
- if (seen2 !== array) {
39592
- splice2.call(seen2, fromIndex, 1);
39557
+ while ((fromIndex = indexOf3(seen, computed, fromIndex, comparator)) > -1) {
39558
+ if (seen !== array) {
39559
+ splice2.call(seen, fromIndex, 1);
39593
39560
  }
39594
39561
  splice2.call(array, fromIndex, 1);
39595
39562
  }
@@ -39760,8 +39727,8 @@ lodash.exports;
39760
39727
  var index2 = -1, length = array.length, resIndex = 0, result2 = [];
39761
39728
  while (++index2 < length) {
39762
39729
  var value = array[index2], computed = iteratee2 ? iteratee2(value) : value;
39763
- if (!index2 || !eq(computed, seen2)) {
39764
- var seen2 = computed;
39730
+ if (!index2 || !eq(computed, seen)) {
39731
+ var seen = computed;
39765
39732
  result2[resIndex++] = value === 0 ? 0 : value;
39766
39733
  }
39767
39734
  }
@@ -39790,7 +39757,7 @@ lodash.exports;
39790
39757
  return result2 == "0" && 1 / value == -INFINITY2 ? "-0" : result2;
39791
39758
  }
39792
39759
  function baseUniq(array, iteratee2, comparator) {
39793
- var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen2 = result2;
39760
+ var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
39794
39761
  if (comparator) {
39795
39762
  isCommon = false;
39796
39763
  includes2 = arrayIncludesWith;
@@ -39801,28 +39768,28 @@ lodash.exports;
39801
39768
  }
39802
39769
  isCommon = false;
39803
39770
  includes2 = cacheHas;
39804
- seen2 = new SetCache();
39771
+ seen = new SetCache();
39805
39772
  } else {
39806
- seen2 = iteratee2 ? [] : result2;
39773
+ seen = iteratee2 ? [] : result2;
39807
39774
  }
39808
39775
  outer:
39809
39776
  while (++index2 < length) {
39810
39777
  var value = array[index2], computed = iteratee2 ? iteratee2(value) : value;
39811
39778
  value = comparator || value !== 0 ? value : 0;
39812
39779
  if (isCommon && computed === computed) {
39813
- var seenIndex = seen2.length;
39780
+ var seenIndex = seen.length;
39814
39781
  while (seenIndex--) {
39815
- if (seen2[seenIndex] === computed) {
39782
+ if (seen[seenIndex] === computed) {
39816
39783
  continue outer;
39817
39784
  }
39818
39785
  }
39819
39786
  if (iteratee2) {
39820
- seen2.push(computed);
39787
+ seen.push(computed);
39821
39788
  }
39822
39789
  result2.push(value);
39823
- } else if (!includes2(seen2, computed, comparator)) {
39824
- if (seen2 !== result2) {
39825
- seen2.push(computed);
39790
+ } else if (!includes2(seen, computed, comparator)) {
39791
+ if (seen !== result2) {
39792
+ seen.push(computed);
39826
39793
  }
39827
39794
  result2.push(value);
39828
39795
  }
@@ -40469,7 +40436,7 @@ lodash.exports;
40469
40436
  if (arrStacked && othStacked) {
40470
40437
  return arrStacked == other && othStacked == array;
40471
40438
  }
40472
- var index2 = -1, result2 = true, seen2 = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
40439
+ var index2 = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
40473
40440
  stack.set(array, other);
40474
40441
  stack.set(other, array);
40475
40442
  while (++index2 < arrLength) {
@@ -40484,10 +40451,10 @@ lodash.exports;
40484
40451
  result2 = false;
40485
40452
  break;
40486
40453
  }
40487
- if (seen2) {
40454
+ if (seen) {
40488
40455
  if (!arraySome(other, function(othValue2, othIndex) {
40489
- if (!cacheHas(seen2, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
40490
- return seen2.push(othIndex);
40456
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
40457
+ return seen.push(othIndex);
40491
40458
  }
40492
40459
  })) {
40493
40460
  result2 = false;
@@ -41939,7 +41906,7 @@ lodash.exports;
41939
41906
  var gte = createRelationalOperation(function(value, other) {
41940
41907
  return value >= other;
41941
41908
  });
41942
- var isArguments2 = baseIsArguments2(function() {
41909
+ var isArguments2 = baseIsArguments2(/* @__PURE__ */ function() {
41943
41910
  return arguments;
41944
41911
  }()) ? baseIsArguments2 : function(value) {
41945
41912
  return isObjectLike2(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable2.call(value, "callee");
@@ -43575,11 +43542,11 @@ var fromDelta_converters = {
43575
43542
  function applyStyles(attrs2, next2) {
43576
43543
  var first = [], then = [];
43577
43544
  attrs2 = attrs2 || {};
43578
- var tag2 = el2, seen2 = {};
43545
+ var tag2 = el2, seen = {};
43579
43546
  while (tag2._format) {
43580
- seen2[tag2._format] = true;
43547
+ seen[tag2._format] = true;
43581
43548
  if (!attrs2[tag2._format]) {
43582
- for (var k2 in seen2) {
43549
+ for (var k2 in seen) {
43583
43550
  delete activeInline[k2];
43584
43551
  }
43585
43552
  el2 = tag2.parent();
@@ -50661,7 +50628,7 @@ var baseIsArguments = _baseIsArguments, isObjectLike$1 = isObjectLike_1;
50661
50628
  var objectProto$1 = Object.prototype;
50662
50629
  var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
50663
50630
  var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
50664
- var isArguments$1 = baseIsArguments(function() {
50631
+ var isArguments$1 = baseIsArguments(/* @__PURE__ */ function() {
50665
50632
  return arguments;
50666
50633
  }()) ? baseIsArguments : function(value) {
50667
50634
  return isObjectLike$1(value) && hasOwnProperty$1.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
@@ -50932,7 +50899,7 @@ const RichtextMixin = {
50932
50899
  quill: null
50933
50900
  },
50934
50901
  created() {
50935
- __vitePreload(() => Promise.resolve({}), true ? ["./assets/quill.snow-8f222e44.css"] : void 0, import.meta.url);
50902
+ importInlineCSS("quill", () => import("./quill.snow-gf_AguUg.js"));
50936
50903
  this.quill = null;
50937
50904
  this.listCallbacks.push(this.addCallback.bind(this));
50938
50905
  },
@@ -53129,9 +53096,15 @@ const SolidForm = {
53129
53096
  let value = this.value;
53130
53097
  if (this.resource && !((_b = (_a = this.resource).isContainer) == null ? void 0 : _b.call(_a))) {
53131
53098
  for (let predicate of Object.keys(this.value)) {
53132
- const object = await this.resource[predicate];
53099
+ let object = await this.resource[predicate];
53100
+ if (!object) {
53101
+ object = await this.resource[store.getExpandedPredicate(predicate, this.context)];
53102
+ }
53133
53103
  if (object && object["@id"] && !value[predicate]["@id"])
53134
53104
  value[predicate]["@id"] = object["@id"];
53105
+ if (object && !object["@id"] && Array.isArray(object) && value[predicate].length == 0 && object.length > 0) {
53106
+ value[predicate] = object;
53107
+ }
53135
53108
  }
53136
53109
  }
53137
53110
  return transformArrayToContainer(value);
@@ -53349,6 +53322,8 @@ const SolidFormSearch = {
53349
53322
  get value() {
53350
53323
  const values = {};
53351
53324
  this.widgets.forEach((widget) => {
53325
+ if (widget == null)
53326
+ return;
53352
53327
  const name = (widget.component || widget).name;
53353
53328
  if (name == null)
53354
53329
  return;
@@ -53552,16 +53527,14 @@ const SolidAcChecker = {
53552
53527
  return;
53553
53528
  let displayElement;
53554
53529
  const ContextParser3 = JSONLDContextParser.ContextParser;
53555
- const myParser2 = new ContextParser3();
53556
- const context2 = await myParser2.parse(this.context);
53557
53530
  const permissions = await this.resource.permissions;
53558
53531
  if (this.permission) {
53559
53532
  displayElement = permissions.some((p) => {
53560
- return ContextParser3.compactIri(p, context2) === this.permission;
53533
+ return ContextParser3.expandTerm(p, this.context, true) === this.permission;
53561
53534
  });
53562
53535
  } else if (this.noPermission) {
53563
53536
  displayElement = permissions.every((p) => {
53564
- return ContextParser3.compactIri(p, context2) !== this.noPermission;
53537
+ return ContextParser3.expandTerm(p, this.context, true) !== this.noPermission;
53565
53538
  });
53566
53539
  } else {
53567
53540
  console.warn('solid-ac-checker: you should define at least one of "permission" or "no-permission" attribute.');
@@ -53577,7 +53550,7 @@ const SolidAcChecker = {
53577
53550
  Sib.register(SolidAcChecker);
53578
53551
  const SolidDelete = {
53579
53552
  name: "solid-delete",
53580
- use: [NextMixin, ValidationMixin, AttributeBinderMixin],
53553
+ use: [NextMixin, ValidationMixin, AttributeBinderMixin, ContextMixin],
53581
53554
  attributes: {
53582
53555
  dataSrc: {
53583
53556
  type: String,
@@ -53593,10 +53566,6 @@ const SolidDelete = {
53593
53566
  if (newValue !== oldValue)
53594
53567
  this.planRender();
53595
53568
  }
53596
- },
53597
- extraContext: {
53598
- type: String,
53599
- default: null
53600
53569
  }
53601
53570
  },
53602
53571
  initialState: {
@@ -53614,16 +53583,6 @@ const SolidDelete = {
53614
53583
  });
53615
53584
  }
53616
53585
  },
53617
- get context() {
53618
- let extraContextElement = this.extraContext ? document.getElementById(this.extraContext) : (
53619
- // take element extra context first
53620
- document.querySelector("[data-default-context]")
53621
- );
53622
- let extraContext = {};
53623
- if (extraContextElement)
53624
- extraContext = JSON.parse(extraContextElement.textContent || "{}");
53625
- return { ...base_context, ...extraContext };
53626
- },
53627
53586
  async delete(e) {
53628
53587
  e.stopPropagation();
53629
53588
  if (!this.dataSrc)
@@ -53973,10 +53932,10 @@ const SolidMap = {
53973
53932
  hasBeenResetOnce: false
53974
53933
  },
53975
53934
  created() {
53976
- __vitePreload(() => Promise.resolve({}), true ? ["./assets/leaflet-3c081932.css"] : void 0, import.meta.url);
53977
- __vitePreload(() => Promise.resolve({}), true ? ["./assets/default-theme-d0f20a8a.css"] : void 0, import.meta.url);
53978
- __vitePreload(() => Promise.resolve({}), true ? ["./assets/MarkerCluster-614dea0a.css"] : void 0, import.meta.url);
53979
- __vitePreload(() => Promise.resolve({}), true ? ["./assets/MarkerCluster.Default-61258232.css"] : void 0, import.meta.url);
53935
+ importInlineCSS("leaflet", () => import("./leaflet-2MZa2u07.js"));
53936
+ importInlineCSS("default-theme", () => import("./default-theme-oAPinkzv.js"));
53937
+ importInlineCSS("marker-cluster", () => import("./MarkerCluster-96Sa2BSd.js"));
53938
+ importInlineCSS("marker-cluster-default", () => import("./MarkerCluster.Default-CpBAgxXL.js"));
53980
53939
  document.body.addEventListener(
53981
53940
  "navigate",
53982
53941
  () => setTimeout(() => this.isVisible && !this.hasBeenResetOnce && this.reset())
@@ -54138,6 +54097,279 @@ const SolidMap = {
54138
54097
  }
54139
54098
  };
54140
54099
  Sib.register(SolidMap);
54100
+ const SolidMembership = {
54101
+ name: "solid-membership",
54102
+ use: [NextMixin, ValidationMixin, ContextMixin],
54103
+ attributes: {
54104
+ // Data Source being a group URI in that case
54105
+ dataSrc: {
54106
+ type: String,
54107
+ default: null,
54108
+ callback: function() {
54109
+ this.resourceId = this.dataSrc;
54110
+ }
54111
+ },
54112
+ dataLeaveLabel: {
54113
+ type: String,
54114
+ default: null,
54115
+ callback: function(newValue, oldValue) {
54116
+ if (newValue !== oldValue)
54117
+ this.planRender();
54118
+ }
54119
+ },
54120
+ dataJoinLabel: {
54121
+ type: String,
54122
+ default: null,
54123
+ callback: function(newValue, oldValue) {
54124
+ if (newValue !== oldValue)
54125
+ this.planRender();
54126
+ }
54127
+ }
54128
+ },
54129
+ initialState: {
54130
+ renderPlanned: false
54131
+ },
54132
+ created() {
54133
+ this.planRender();
54134
+ },
54135
+ async populate() {
54136
+ if (!store.session)
54137
+ return;
54138
+ let currentUserSession = await store.session;
54139
+ if (!currentUserSession)
54140
+ return;
54141
+ this.userId = await currentUserSession.webId;
54142
+ if (!this.userId)
54143
+ return;
54144
+ this.resource = await store.getData(this.resourceId);
54145
+ if (!this.resource)
54146
+ return;
54147
+ let memberPredicate = store.getExpandedPredicate("user_set", base_context);
54148
+ this.currentMembers = await this.resource[memberPredicate];
54149
+ if (!Array.isArray(this.currentMembers)) {
54150
+ this.currentMembers = [this.currentMembers];
54151
+ }
54152
+ this.isMember = this.currentMembers ? this.currentMembers.some((member) => member["@id"] === this.userId) : false;
54153
+ },
54154
+ planRender() {
54155
+ if (!this.renderPlanned) {
54156
+ this.renderPlanned = true;
54157
+ setTimeout(() => {
54158
+ this.render();
54159
+ this.renderPlanned = false;
54160
+ });
54161
+ }
54162
+ },
54163
+ async changeMembership(e) {
54164
+ e.stopPropagation();
54165
+ if (!this.dataSrc)
54166
+ return;
54167
+ this.performAction();
54168
+ },
54169
+ async joinGroup() {
54170
+ this.currentMembers.push({ "@id": this.userId });
54171
+ let currentRes = {
54172
+ "@context": this.context,
54173
+ "user_set": this.currentMembers
54174
+ };
54175
+ return store.patch(currentRes, this.dataSrc).then((response) => {
54176
+ if (!response) {
54177
+ console.warn(`Error while joining group ${this.dataSrc} for user ${this.userId}`);
54178
+ return;
54179
+ }
54180
+ this.goToNext(null);
54181
+ const eventData = { detail: { resource: { "@id": this.dataSrc } }, bubbles: true };
54182
+ this.element.dispatchEvent(new CustomEvent("save", eventData));
54183
+ this.element.dispatchEvent(new CustomEvent("memberAdded", eventData));
54184
+ this.planRender();
54185
+ });
54186
+ },
54187
+ async leaveGroup() {
54188
+ let userSet = this.currentMembers.filter((value) => {
54189
+ const userId = value["@id"];
54190
+ if (userId == this.userId)
54191
+ return false;
54192
+ else
54193
+ return true;
54194
+ });
54195
+ let currentRes = {
54196
+ "@context": this.context,
54197
+ "user_set": userSet
54198
+ };
54199
+ return store.patch(currentRes, this.dataSrc).then((response) => {
54200
+ if (!response) {
54201
+ console.warn(`Error while leaving group ${this.dataSrc} for user ${this.userId}`);
54202
+ return;
54203
+ }
54204
+ this.goToNext(null);
54205
+ const eventData = { detail: { resource: { "@id": this.dataSrc } }, bubbles: true };
54206
+ this.element.dispatchEvent(new CustomEvent("save", eventData));
54207
+ this.element.dispatchEvent(new CustomEvent("memberRemoved", eventData));
54208
+ this.planRender();
54209
+ });
54210
+ },
54211
+ switchMembership() {
54212
+ if (this.isMember) {
54213
+ return this.leaveGroup();
54214
+ } else {
54215
+ return this.joinGroup();
54216
+ }
54217
+ },
54218
+ validateModal() {
54219
+ return this.switchMembership();
54220
+ },
54221
+ update() {
54222
+ this.render();
54223
+ },
54224
+ async render() {
54225
+ await this.populate();
54226
+ let button = html$1``;
54227
+ if (this.isMember) {
54228
+ button = html$1`
54229
+ <solid-ac-checker data-src="${this.dataSrc}"
54230
+ permission="acl:Read"
54231
+ >
54232
+ <button @click=${this.changeMembership.bind(this)}>${this.dataLeaveLabel || this.t("solid-leave-group.button")}</button>
54233
+ ${this.getModalDialog()}
54234
+ </solid-ac-checker>
54235
+ `;
54236
+ } else {
54237
+ button = html$1`
54238
+ <solid-ac-checker data-src="${this.dataSrc}"
54239
+ permission="acl:Read"
54240
+ >
54241
+ <button @click=${this.changeMembership.bind(this)}>${this.dataJoinLabel || this.t("solid-join-group.button")}</button>
54242
+ ${this.getModalDialog()}
54243
+ </solid-ac-checker>
54244
+ `;
54245
+ }
54246
+ render$1(button, this.element);
54247
+ }
54248
+ };
54249
+ Sib.register(SolidMembership);
54250
+ const SolidMemberDelete = {
54251
+ name: "solid-member-delete",
54252
+ use: [NextMixin, ValidationMixin, ContextMixin],
54253
+ attributes: {
54254
+ // Data Source being a group URI in that case
54255
+ dataSrc: {
54256
+ type: String,
54257
+ default: null,
54258
+ callback: function() {
54259
+ this.resourceId = this.dataSrc;
54260
+ }
54261
+ },
54262
+ dataLabel: {
54263
+ type: String,
54264
+ default: null,
54265
+ callback: function(newValue, oldValue) {
54266
+ if (newValue !== oldValue)
54267
+ this.planRender();
54268
+ }
54269
+ },
54270
+ // The user id to remove from the group
54271
+ dataTargetSrc: {
54272
+ type: String,
54273
+ default: null,
54274
+ callback: function(newValue, oldValue) {
54275
+ if (newValue !== oldValue)
54276
+ this.planRender();
54277
+ }
54278
+ },
54279
+ dataUnknownMember: {
54280
+ type: String,
54281
+ default: "Given user is not a member of this group",
54282
+ callback: function(newValue, oldValue) {
54283
+ if (newValue !== oldValue)
54284
+ this.planRender();
54285
+ }
54286
+ }
54287
+ },
54288
+ initialState: {
54289
+ renderPlanned: false
54290
+ },
54291
+ created() {
54292
+ this.planRender();
54293
+ },
54294
+ async populate() {
54295
+ this.resource = await store.getData(this.resourceId);
54296
+ if (!this.resource)
54297
+ return;
54298
+ let memberPredicate = store.getExpandedPredicate("user_set", base_context);
54299
+ this.currentMembers = await this.resource[memberPredicate];
54300
+ if (!Array.isArray(this.currentMembers)) {
54301
+ this.currentMembers = [this.currentMembers];
54302
+ }
54303
+ this.isMember = this.currentMembers ? this.currentMembers.some((member) => member["@id"] === this.dataTargetSrc) : false;
54304
+ console.log("populate", this.dataSrc, this.dataTargetSrc, this.currentMembers, this.isMember);
54305
+ },
54306
+ planRender() {
54307
+ if (!this.renderPlanned) {
54308
+ this.renderPlanned = true;
54309
+ setTimeout(() => {
54310
+ this.render();
54311
+ this.renderPlanned = false;
54312
+ });
54313
+ }
54314
+ },
54315
+ async removeMember(e) {
54316
+ e.stopPropagation();
54317
+ if (!this.dataSrc)
54318
+ return;
54319
+ this.performAction();
54320
+ },
54321
+ async deleteMembership() {
54322
+ console.log("deleteMembership", this.dataSrc, this.dataTargetSrc, this.currentMembers);
54323
+ let userSet = this.currentMembers.filter((value) => {
54324
+ const userId = value["@id"];
54325
+ if (userId == this.dataTargetSrc)
54326
+ return false;
54327
+ else
54328
+ return true;
54329
+ });
54330
+ let currentRes = {
54331
+ "@context": this.context,
54332
+ "user_set": userSet
54333
+ };
54334
+ return store.patch(currentRes, this.dataSrc).then((response) => {
54335
+ if (!response) {
54336
+ console.warn(`Error while removing user ${this.dataTargetSrc} from group ${this.dataSrc}`);
54337
+ return;
54338
+ }
54339
+ this.goToNext(null);
54340
+ const eventData = { detail: { resource: { "@id": this.dataSrc } }, bubbles: true };
54341
+ this.element.dispatchEvent(new CustomEvent("save", eventData));
54342
+ this.element.dispatchEvent(new CustomEvent("memberRemoved", eventData));
54343
+ this.planRender();
54344
+ });
54345
+ },
54346
+ validateModal() {
54347
+ return this.deleteMembership();
54348
+ },
54349
+ update() {
54350
+ this.render();
54351
+ },
54352
+ async render() {
54353
+ await this.populate();
54354
+ let button = html$1``;
54355
+ if (this.isMember) {
54356
+ button = html$1`
54357
+ <solid-ac-checker data-src="${this.dataSrc}"
54358
+ permission="acl:Write"
54359
+ >
54360
+ <button @click=${this.removeMember.bind(this)}>${this.dataLabel || this.t("solid-delete-member.button")}</button>
54361
+ ${this.getModalDialog()}
54362
+ </solid-ac-checker>
54363
+ `;
54364
+ } else {
54365
+ button = html$1`
54366
+ <span>${this.dataUnknownMember || this.t("solid-member-unknown.span")}</span>
54367
+ `;
54368
+ }
54369
+ render$1(button, this.element);
54370
+ }
54371
+ };
54372
+ Sib.register(SolidMemberDelete);
54141
54373
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
54142
54374
  __proto__: null,
54143
54375
  AltMixin,
@@ -54577,6 +54809,8 @@ export {
54577
54809
  SolidFormSearch,
54578
54810
  SolidLang,
54579
54811
  SolidMap,
54812
+ SolidMemberDelete,
54813
+ SolidMembership,
54580
54814
  SolidTable,
54581
54815
  SolidTemplateElement,
54582
54816
  SolidWidget,
@@ -54588,6 +54822,7 @@ export {
54588
54822
  TranslationMixin,
54589
54823
  ValidationMixin,
54590
54824
  WidgetMixin,
54825
+ base_context as baseContext,
54591
54826
  html$1 as html,
54592
54827
  ifDefined,
54593
54828
  newWidgetFactory,
@@ -54597,4 +54832,3 @@ export {
54597
54832
  until,
54598
54833
  widgetFactory
54599
54834
  };
54600
- //# sourceMappingURL=index.js.map