@edifice.io/client 2.0.0-develop-pedago.3 → 2.0.0-develop-pedago.4

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,6 +1,6 @@
1
1
  var v = Object.defineProperty;
2
- var T = (o, e, t) => e in o ? v(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var n = (o, e, t) => T(o, typeof e != "symbol" ? e + "" : e, t);
2
+ var T = (n, e, t) => e in n ? v(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var o = (n, e, t) => T(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import axios from "axios";
5
5
  import { MimeTypeUtils } from "@edifice.io/utilities";
6
6
  const ERROR_CODE = {
@@ -97,7 +97,7 @@ const ERROR_CODE = {
97
97
  };
98
98
  class Subscription {
99
99
  constructor(e, t) {
100
- n(this, "revoke");
100
+ o(this, "revoke");
101
101
  this._channel = e, this.revoke = this.setReceiver(
102
102
  (s) => t == null ? void 0 : t(s.data)
103
103
  );
@@ -115,7 +115,7 @@ class Subject {
115
115
  * => We maintain here channels for *sending* messages.
116
116
  * *Receiving* channels will be instantiated while subscribing.
117
117
  */
118
- n(this, "publishChannels", /* @__PURE__ */ new Map());
118
+ o(this, "publishChannels", /* @__PURE__ */ new Map());
119
119
  }
120
120
  getChannelName(e) {
121
121
  return "Subject:" + e;
@@ -150,9 +150,9 @@ const ASYNC_DATA_NAME = {
150
150
  class Promisified {
151
151
  constructor() {
152
152
  //-------------------------------------
153
- n(this, "_resolution");
154
- n(this, "_rejection");
155
- n(this, "_promise", new Promise((e, t) => {
153
+ o(this, "_resolution");
154
+ o(this, "_rejection");
155
+ o(this, "_promise", new Promise((e, t) => {
156
156
  this._resolution = e, this._rejection = t;
157
157
  }));
158
158
  }
@@ -169,8 +169,8 @@ class Promisified {
169
169
  class NotifyFramework {
170
170
  constructor() {
171
171
  //-------------------------------------
172
- n(this, "promises", {});
173
- n(this, "subject", new Subject());
172
+ o(this, "promises", {});
173
+ o(this, "subject", new Subject());
174
174
  }
175
175
  asyncData(e) {
176
176
  return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
@@ -201,8 +201,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
201
201
  class Http {
202
202
  constructor(e) {
203
203
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
204
- n(this, "axios");
205
- n(this, "_latestResponse");
204
+ o(this, "axios");
205
+ o(this, "_latestResponse");
206
206
  this.axios = axios.create(e);
207
207
  }
208
208
  setCdn(e) {
@@ -299,7 +299,7 @@ class Http {
299
299
  }
300
300
  class TransportFramework {
301
301
  constructor() {
302
- n(this, "_http", new Http());
302
+ o(this, "_http", new Http());
303
303
  }
304
304
  get http() {
305
305
  return this._http;
@@ -318,11 +318,11 @@ class ConfigurationFrameworkFactory {
318
318
  const http$2 = transport.http;
319
319
  class Session {
320
320
  constructor() {
321
- n(this, "_me", null);
322
- n(this, "_currentLanguage", "");
323
- n(this, "_notLoggedIn", !0);
324
- n(this, "_description");
325
- n(this, "_profile");
321
+ o(this, "_me", null);
322
+ o(this, "_currentLanguage", "");
323
+ o(this, "_notLoggedIn", !0);
324
+ o(this, "_description");
325
+ o(this, "_profile");
326
326
  }
327
327
  get currentLanguage() {
328
328
  return this._currentLanguage;
@@ -440,7 +440,7 @@ class Session {
440
440
  }
441
441
  class SessionFramework {
442
442
  constructor() {
443
- n(this, "session", new Session());
443
+ o(this, "session", new Session());
444
444
  }
445
445
  initialize() {
446
446
  return this.session.initialize();
@@ -464,22 +464,22 @@ class SessionFramework {
464
464
  const session = new SessionFramework();
465
465
  class Theme {
466
466
  constructor() {
467
- n(this, "_conf");
468
- n(this, "_loaded");
467
+ o(this, "_conf");
468
+ o(this, "_loaded");
469
469
  // legacy (readonly)
470
- n(this, "skinName", "");
471
- n(this, "themeName", "");
472
- n(this, "skin", "raw");
473
- n(this, "themeUrl", "/assets/themes/raw/default/");
474
- n(this, "templateOverrides", {});
475
- n(this, "portalTemplate", "/assets/themes/raw/portal.html");
476
- n(this, "basePath", "");
477
- n(this, "logoutCallback", "/");
478
- n(this, "skins", []);
479
- n(this, "is1D", !1);
480
- n(this, "is2D", !1);
481
- n(this, "_onSkinReady", notify.onSkinReady());
482
- n(this, "_onOverrideReady", notify.onOverridesReady());
470
+ o(this, "skinName", "");
471
+ o(this, "themeName", "");
472
+ o(this, "skin", "raw");
473
+ o(this, "themeUrl", "/assets/themes/raw/default/");
474
+ o(this, "templateOverrides", {});
475
+ o(this, "portalTemplate", "/assets/themes/raw/portal.html");
476
+ o(this, "basePath", "");
477
+ o(this, "logoutCallback", "/");
478
+ o(this, "skins", []);
479
+ o(this, "is1D", !1);
480
+ o(this, "is2D", !1);
481
+ o(this, "_onSkinReady", notify.onSkinReady());
482
+ o(this, "_onOverrideReady", notify.onOverridesReady());
483
483
  }
484
484
  initialize(e) {
485
485
  return notify.onSessionReady().promise.then(() => this.load(e));
@@ -851,7 +851,7 @@ class Idiom {
851
851
  class UserPreferences {
852
852
  constructor() {
853
853
  //-------------------------------------
854
- n(this, "data", {});
854
+ o(this, "data", {});
855
855
  }
856
856
  get(e) {
857
857
  return this.data[e];
@@ -878,10 +878,10 @@ class UserPreferences {
878
878
  class User {
879
879
  constructor() {
880
880
  //-------------------------------------
881
- n(this, "_me", null);
882
- n(this, "_keepOpenOnLogout", !1);
883
- n(this, "_preferences", new UserPreferences());
884
- n(this, "_bookmarkedApps", []);
881
+ o(this, "_me", null);
882
+ o(this, "_keepOpenOnLogout", !1);
883
+ o(this, "_preferences", new UserPreferences());
884
+ o(this, "_bookmarkedApps", []);
885
885
  }
886
886
  get keepOpenOnLogout() {
887
887
  return this._keepOpenOnLogout;
@@ -955,9 +955,9 @@ const http$1 = transport == null ? void 0 : transport.http;
955
955
  class AppConf {
956
956
  constructor() {
957
957
  //-------------------------------------
958
- n(this, "_publicConf", {});
959
- n(this, "_currentApp");
960
- n(this, "_appConf", {});
958
+ o(this, "_publicConf", {});
959
+ o(this, "_currentApp");
960
+ o(this, "_appConf", {});
961
961
  }
962
962
  /**
963
963
  * Get the currently initialized App.
@@ -995,8 +995,8 @@ class AppConf {
995
995
  class Analytics {
996
996
  constructor() {
997
997
  //-------------------------------------
998
- n(this, "_status", "void");
999
- n(this, "_params");
998
+ o(this, "_status", "void");
999
+ o(this, "_params");
1000
1000
  }
1001
1001
  get status() {
1002
1002
  return this._status;
@@ -1081,7 +1081,7 @@ class Analytics {
1081
1081
  class ConfigurationFramework {
1082
1082
  constructor() {
1083
1083
  //-------------------------------------
1084
- n(this, "Platform", {
1084
+ o(this, "Platform", {
1085
1085
  deploymentTag: "",
1086
1086
  cdnDomain: "",
1087
1087
  apps: new AppConf(),
@@ -1090,10 +1090,10 @@ class ConfigurationFramework {
1090
1090
  idiom: new Idiom(),
1091
1091
  listLanguages: () => transport.http.get("/languages")
1092
1092
  });
1093
- n(this, "School", {
1093
+ o(this, "School", {
1094
1094
  //apps; -> pinnedApps;
1095
1095
  });
1096
- n(this, "User", new User());
1096
+ o(this, "User", new User());
1097
1097
  }
1098
1098
  async initialize(e, t) {
1099
1099
  if (!e) {
@@ -1140,8 +1140,8 @@ var _;
1140
1140
  const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
1141
1141
  class Notification {
1142
1142
  constructor(e) {
1143
- n(this, "_id");
1144
- n(this, "model");
1143
+ o(this, "_id");
1144
+ o(this, "model");
1145
1145
  e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
1146
1146
  }
1147
1147
  isUnread() {
@@ -1161,14 +1161,14 @@ class Notification {
1161
1161
  class TimelineApp {
1162
1162
  constructor() {
1163
1163
  //-------------------------------------
1164
- n(this, "_notifications", []);
1165
- n(this, "_notificationTypes", []);
1164
+ o(this, "_notifications", []);
1165
+ o(this, "_notificationTypes", []);
1166
1166
  // ex: ["BLOG"]
1167
- n(this, "_flashMessages", []);
1168
- n(this, "_pageNumber", 0);
1169
- n(this, "_lastPage", !1);
1170
- n(this, "_loading", !1);
1171
- n(this, "showMine", !1);
1167
+ o(this, "_flashMessages", []);
1168
+ o(this, "_pageNumber", 0);
1169
+ o(this, "_lastPage", !1);
1170
+ o(this, "_loading", !1);
1171
+ o(this, "showMine", !1);
1172
1172
  }
1173
1173
  get notifications() {
1174
1174
  return this._notifications;
@@ -1317,7 +1317,7 @@ const f = class f {
1317
1317
  //
1318
1318
  // PROTECTED HELPERS
1319
1319
  //
1320
- n(this, "checkHttpResponse", (e) => {
1320
+ o(this, "checkHttpResponse", (e) => {
1321
1321
  if (this.http.latestResponse.status >= 300)
1322
1322
  throw this.http.latestResponse.statusText;
1323
1323
  return e;
@@ -1535,8 +1535,8 @@ const f = class f {
1535
1535
  //
1536
1536
  // STATIC REGISTRY
1537
1537
  //
1538
- n(f, "registry", new ServiceRegistry()), // Expose some useful functions
1539
- n(f, "register", f.registry.register.bind(f.registry)), n(f, "findService", f.registry.findService.bind(f.registry)), n(f, "findMainService", f.registry.findMainService.bind(f.registry)), n(f, "isRegistered", f.registry.isRegistered.bind(f.registry));
1538
+ o(f, "registry", new ServiceRegistry()), // Expose some useful functions
1539
+ o(f, "register", f.registry.register.bind(f.registry)), o(f, "findService", f.registry.findService.bind(f.registry)), o(f, "findMainService", f.registry.findMainService.bind(f.registry)), o(f, "isRegistered", f.registry.isRegistered.bind(f.registry));
1540
1540
  let ResourceService = f;
1541
1541
  const APP = "scrapbook", RESOURCE = "scrapbook";
1542
1542
  class ScrapbookResourceService extends ResourceService {
@@ -1579,7 +1579,7 @@ class ScrapbookResourceService extends ResourceService {
1579
1579
  }
1580
1580
  ResourceService.register(
1581
1581
  { application: RESOURCE, resourceType: RESOURCE },
1582
- (o) => new ScrapbookResourceService(o)
1582
+ (n) => new ScrapbookResourceService(n)
1583
1583
  );
1584
1584
  const globalCache = {}, mutexPromise = {};
1585
1585
  class CacheService {
@@ -1819,10 +1819,10 @@ const loadedScripts = {};
1819
1819
  class HttpService {
1820
1820
  constructor(e, t) {
1821
1821
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
1822
- n(this, "axios");
1823
- n(this, "baseUrl");
1824
- n(this, "headers", {});
1825
- n(this, "_latestResponse");
1822
+ o(this, "axios");
1823
+ o(this, "baseUrl");
1824
+ o(this, "headers", {});
1825
+ o(this, "_latestResponse");
1826
1826
  this.context = e, this.axios = axios.create(t);
1827
1827
  }
1828
1828
  fixBaseUrl(e) {
@@ -2536,38 +2536,38 @@ class ShareService {
2536
2536
  }
2537
2537
  }
2538
2538
  const defaultMappers = {
2539
- csv: function({ type: o, extension: e }) {
2540
- return MimeTypeUtils.INSTANCE.isCsvLike(o, e);
2539
+ csv: function({ type: n, extension: e }) {
2540
+ return MimeTypeUtils.INSTANCE.isCsvLike(n, e);
2541
2541
  },
2542
- doc: function({ type: o, extension: e }) {
2543
- return MimeTypeUtils.INSTANCE.isWordLike(o, e) ? !0 : o.indexOf("document") !== -1 && o.indexOf("wordprocessing") !== -1;
2542
+ doc: function({ type: n, extension: e }) {
2543
+ return MimeTypeUtils.INSTANCE.isWordLike(n, e) ? !0 : n.indexOf("document") !== -1 && n.indexOf("wordprocessing") !== -1;
2544
2544
  },
2545
- xls: function({ type: o, extension: e }) {
2546
- return MimeTypeUtils.INSTANCE.isExcelLike(o, e) ? !0 : o.indexOf("document") !== -1 && o.indexOf("spreadsheet") !== -1 || o.indexOf("ms-excel") !== -1;
2545
+ xls: function({ type: n, extension: e }) {
2546
+ return MimeTypeUtils.INSTANCE.isExcelLike(n, e) ? !0 : n.indexOf("document") !== -1 && n.indexOf("spreadsheet") !== -1 || n.indexOf("ms-excel") !== -1;
2547
2547
  },
2548
- img: function({ type: o }) {
2549
- return o.indexOf("image") !== -1;
2548
+ img: function({ type: n }) {
2549
+ return n.indexOf("image") !== -1;
2550
2550
  },
2551
- pdf: function({ type: o }) {
2552
- return o.indexOf("pdf") !== -1 || o === "application/x-download";
2551
+ pdf: function({ type: n }) {
2552
+ return n.indexOf("pdf") !== -1 || n === "application/x-download";
2553
2553
  },
2554
- ppt: function({ type: o, extension: e }) {
2555
- return MimeTypeUtils.INSTANCE.isPowerpointLike(o, e) ? !0 : o.indexOf("document") !== -1 && o.indexOf("presentation") !== -1 || o.indexOf("powerpoint") !== -1;
2554
+ ppt: function({ type: n, extension: e }) {
2555
+ return MimeTypeUtils.INSTANCE.isPowerpointLike(n, e) ? !0 : n.indexOf("document") !== -1 && n.indexOf("presentation") !== -1 || n.indexOf("powerpoint") !== -1;
2556
2556
  },
2557
- txt: function({ type: o, extension: e }) {
2558
- return MimeTypeUtils.INSTANCE.isTxtLike(o, e);
2557
+ txt: function({ type: n, extension: e }) {
2558
+ return MimeTypeUtils.INSTANCE.isTxtLike(n, e);
2559
2559
  },
2560
- md: function({ type: o, extension: e }) {
2561
- return MimeTypeUtils.INSTANCE.isMdLike(o, e);
2560
+ md: function({ type: n, extension: e }) {
2561
+ return MimeTypeUtils.INSTANCE.isMdLike(n, e);
2562
2562
  },
2563
- video: function({ type: o }) {
2564
- return o.indexOf("video") !== -1;
2563
+ video: function({ type: n }) {
2564
+ return n.indexOf("video") !== -1;
2565
2565
  },
2566
- audio: function({ type: o }) {
2567
- return o.indexOf("audio") !== -1;
2566
+ audio: function({ type: n }) {
2567
+ return n.indexOf("audio") !== -1;
2568
2568
  },
2569
- zip: function({ type: o }) {
2570
- return o.indexOf("zip") !== -1 || o.indexOf("rar") !== -1 || o.indexOf("tar") !== -1 || o.indexOf("7z") !== -1;
2569
+ zip: function({ type: n }) {
2570
+ return n.indexOf("zip") !== -1 || n.indexOf("rar") !== -1 || n.indexOf("tar") !== -1 || n.indexOf("7z") !== -1;
2571
2571
  }
2572
2572
  }, w = class w {
2573
2573
  /* Similar role notion as in infra-front > workspace > Model.ts */
@@ -2593,7 +2593,7 @@ const defaultMappers = {
2593
2593
  }
2594
2594
  };
2595
2595
  // FIXME add edumedia support
2596
- n(w, "roleMappers", [
2596
+ o(w, "roleMappers", [
2597
2597
  (e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
2598
2598
  ]);
2599
2599
  let DocumentHelper = w;
@@ -2996,8 +2996,8 @@ class IdiomService {
2996
2996
  }
2997
2997
  let ATTag;
2998
2998
  class AnalyticsService {
2999
- constructor(o) {
3000
- this.context = o;
2999
+ constructor(n) {
3000
+ this.context = n;
3001
3001
  }
3002
3002
  get http() {
3003
3003
  return this.context.http();
@@ -3010,7 +3010,7 @@ class AnalyticsService {
3010
3010
  * @param locationPath
3011
3011
  * @param app
3012
3012
  */
3013
- async trackPageLoad(o, e) {
3013
+ async trackPageLoad(n, e) {
3014
3014
  const [t] = await Promise.all([
3015
3015
  // get Xiti configuration
3016
3016
  this.getXitiConfig(e.name.toLowerCase()),
@@ -3020,7 +3020,7 @@ class AnalyticsService {
3020
3020
  if (!t || !ATInternet) return;
3021
3021
  let s = t.LIBELLE_SERVICE.default || null;
3022
3022
  for (const r in t.LIBELLE_SERVICE)
3023
- if (r !== "default" && o.indexOf(r) >= 0) {
3023
+ if (r !== "default" && n.indexOf(r) >= 0) {
3024
3024
  s = t.LIBELLE_SERVICE[r];
3025
3025
  break;
3026
3026
  }
@@ -3047,7 +3047,7 @@ class AnalyticsService {
3047
3047
  level2: t.STRUCT_UAI
3048
3048
  }), ATTag.dispatch();
3049
3049
  }
3050
- async getXitiConfig(o) {
3050
+ async getXitiConfig(n) {
3051
3051
  const [e, t] = await Promise.all([
3052
3052
  this.http.get("/analyticsConf"),
3053
3053
  //FIXME change servers config to only keep the "all-in-one" query to /analyticsConf.
@@ -3055,7 +3055,7 @@ class AnalyticsService {
3055
3055
  ]);
3056
3056
  if (!(e != null && e.type))
3057
3057
  throw ERROR_CODE.MALFORMED_DATA;
3058
- return t != null && t.active && (e.xiti = await this.getXitiTrackingParams(t, o)), e.xiti;
3058
+ return t != null && t.active && (e.xiti = await this.getXitiTrackingParams(t, n)), e.xiti;
3059
3059
  }
3060
3060
  async loadXitiScript() {
3061
3061
  if (typeof ATInternet > "u") {
@@ -3067,13 +3067,13 @@ class AnalyticsService {
3067
3067
  eval(response);
3068
3068
  }
3069
3069
  }
3070
- async getXitiTrackingParams(o, e) {
3071
- if (!o.structureMap || !e) return;
3070
+ async getXitiTrackingParams(n, e) {
3071
+ if (!n.structureMap || !e) return;
3072
3072
  const t = await this.session.getUser(), s = await this.session.getUserProfile();
3073
3073
  let r;
3074
3074
  if (!(t != null && t.structures)) return;
3075
3075
  for (const h of t.structures) {
3076
- const l = o.structureMap[h];
3076
+ const l = n.structureMap[h];
3077
3077
  if (l && l.collectiviteId && l.UAI) {
3078
3078
  r = l;
3079
3079
  break;
@@ -3104,9 +3104,9 @@ class AnalyticsService {
3104
3104
  OUTIL: u.OUTIL ? u.OUTIL : "",
3105
3105
  STRUCT_ID: r.collectiviteId,
3106
3106
  STRUCT_UAI: r.UAI,
3107
- PROJET: r.projetId ? r.projetId : o.ID_PROJET,
3108
- EXPLOITANT: o.ID_EXPLOITANT,
3109
- PLATFORME: r.plateformeId ? r.plateformeId : o.ID_PLATEFORME,
3107
+ PROJET: r.projetId ? r.projetId : n.ID_PROJET,
3108
+ EXPLOITANT: n.ID_EXPLOITANT,
3109
+ PLATFORME: r.plateformeId ? r.plateformeId : n.ID_PLATEFORME,
3110
3110
  ID_PERSO: a(t.userId),
3111
3111
  PROFILE: s && s.length > 0 ? c[s[0]] ?? "" : ""
3112
3112
  };
@@ -3191,8 +3191,8 @@ const C = class C {
3191
3191
  throw new Error("Video cannot be uploaded.");
3192
3192
  }
3193
3193
  };
3194
- n(C, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
3195
- n(C, "MAX_DURATION", 3);
3194
+ o(C, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
3195
+ o(C, "MAX_DURATION", 3);
3196
3196
  let VideoService = C;
3197
3197
  class EmbedderService {
3198
3198
  constructor(e) {
@@ -3288,7 +3288,7 @@ class AbstractBehaviourService {
3288
3288
  //-----------------
3289
3289
  //--- Utilities ---
3290
3290
  //-----------------
3291
- n(this, "_cache");
3291
+ o(this, "_cache");
3292
3292
  this.context = e, this._cache = new CacheService(this.context);
3293
3293
  }
3294
3294
  getApplication() {
@@ -3322,8 +3322,8 @@ class AbstractBehaviourService {
3322
3322
  class ActualitesBehaviour extends AbstractBehaviourService {
3323
3323
  constructor() {
3324
3324
  super(...arguments);
3325
- n(this, "APP", "actualites");
3326
- n(this, "RESOURCE", "actualites");
3325
+ o(this, "APP", "actualites");
3326
+ o(this, "RESOURCE", "actualites");
3327
3327
  }
3328
3328
  async loadResources() {
3329
3329
  return (await this.httpGet(
@@ -3346,8 +3346,8 @@ class ActualitesBehaviour extends AbstractBehaviourService {
3346
3346
  class BlogBehaviour extends AbstractBehaviourService {
3347
3347
  constructor() {
3348
3348
  super(...arguments);
3349
- n(this, "APP", "blog");
3350
- n(this, "RESOURCE", "blog");
3349
+ o(this, "APP", "blog");
3350
+ o(this, "RESOURCE", "blog");
3351
3351
  }
3352
3352
  loadResources() {
3353
3353
  return new Promise(async (t, s) => {
@@ -3376,8 +3376,8 @@ class BlogBehaviour extends AbstractBehaviourService {
3376
3376
  class CollaborativewallBehaviour extends AbstractBehaviourService {
3377
3377
  constructor() {
3378
3378
  super(...arguments);
3379
- n(this, "APP", "collaborativewall");
3380
- n(this, "RESOURCE", "collaborativewall");
3379
+ o(this, "APP", "collaborativewall");
3380
+ o(this, "RESOURCE", "collaborativewall");
3381
3381
  }
3382
3382
  async loadResources() {
3383
3383
  return (await this.httpGet(
@@ -3399,8 +3399,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
3399
3399
  class CommunityBehaviour extends AbstractBehaviourService {
3400
3400
  constructor() {
3401
3401
  super(...arguments);
3402
- n(this, "APP", "community");
3403
- n(this, "RESOURCE", "community");
3402
+ o(this, "APP", "community");
3403
+ o(this, "RESOURCE", "community");
3404
3404
  }
3405
3405
  async loadResources() {
3406
3406
  return (await this.httpGet(
@@ -3424,8 +3424,8 @@ class CommunityBehaviour extends AbstractBehaviourService {
3424
3424
  class ExercizerBehaviour extends AbstractBehaviourService {
3425
3425
  constructor() {
3426
3426
  super(...arguments);
3427
- n(this, "APP", "exercizer");
3428
- n(this, "RESOURCE", "exercizer");
3427
+ o(this, "APP", "exercizer");
3428
+ o(this, "RESOURCE", "exercizer");
3429
3429
  }
3430
3430
  async loadResources() {
3431
3431
  return (await this.httpGet(
@@ -3449,8 +3449,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
3449
3449
  class FormulaireBehaviour extends AbstractBehaviourService {
3450
3450
  constructor() {
3451
3451
  super(...arguments);
3452
- n(this, "APP", "formulaire");
3453
- n(this, "RESOURCE", "formulaire");
3452
+ o(this, "APP", "formulaire");
3453
+ o(this, "RESOURCE", "formulaire");
3454
3454
  }
3455
3455
  async loadResources() {
3456
3456
  return (await this.httpGet(
@@ -3470,8 +3470,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
3470
3470
  class ForumBehaviour extends AbstractBehaviourService {
3471
3471
  constructor() {
3472
3472
  super(...arguments);
3473
- n(this, "APP", "forum");
3474
- n(this, "RESOURCE", "forum");
3473
+ o(this, "APP", "forum");
3474
+ o(this, "RESOURCE", "forum");
3475
3475
  }
3476
3476
  async loadResources() {
3477
3477
  return (await this.httpGet("/forum/categories")).map(
@@ -3491,8 +3491,8 @@ class ForumBehaviour extends AbstractBehaviourService {
3491
3491
  class HomeworksBehaviour extends AbstractBehaviourService {
3492
3492
  constructor() {
3493
3493
  super(...arguments);
3494
- n(this, "APP", "homeworks");
3495
- n(this, "RESOURCE", "homeworks");
3494
+ o(this, "APP", "homeworks");
3495
+ o(this, "RESOURCE", "homeworks");
3496
3496
  }
3497
3497
  async loadResources() {
3498
3498
  return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
@@ -3510,8 +3510,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
3510
3510
  class MagnetoBehaviour extends AbstractBehaviourService {
3511
3511
  constructor() {
3512
3512
  super(...arguments);
3513
- n(this, "APP", "magneto");
3514
- n(this, "RESOURCE", "magneto");
3513
+ o(this, "APP", "magneto");
3514
+ o(this, "RESOURCE", "magneto");
3515
3515
  }
3516
3516
  async loadResources() {
3517
3517
  const { all: t } = await this.httpGet(
@@ -3532,8 +3532,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
3532
3532
  class MindmapBehaviour extends AbstractBehaviourService {
3533
3533
  constructor() {
3534
3534
  super(...arguments);
3535
- n(this, "APP", "mindmap");
3536
- n(this, "RESOURCE", "mindmap");
3535
+ o(this, "APP", "mindmap");
3536
+ o(this, "RESOURCE", "mindmap");
3537
3537
  }
3538
3538
  async loadResources() {
3539
3539
  return (await this.httpGet("/mindmap/list/all")).map(
@@ -3553,8 +3553,8 @@ class MindmapBehaviour extends AbstractBehaviourService {
3553
3553
  class PagesBehaviour extends AbstractBehaviourService {
3554
3554
  constructor() {
3555
3555
  super(...arguments);
3556
- n(this, "APP", "pages");
3557
- n(this, "RESOURCE", "pages");
3556
+ o(this, "APP", "pages");
3557
+ o(this, "RESOURCE", "pages");
3558
3558
  }
3559
3559
  async loadResources() {
3560
3560
  const t = await this.httpGet("/pages/list/all"), s = [];
@@ -3592,8 +3592,8 @@ class PagesBehaviour extends AbstractBehaviourService {
3592
3592
  class PollBehaviour extends AbstractBehaviourService {
3593
3593
  constructor() {
3594
3594
  super(...arguments);
3595
- n(this, "APP", "poll");
3596
- n(this, "RESOURCE", "poll");
3595
+ o(this, "APP", "poll");
3596
+ o(this, "RESOURCE", "poll");
3597
3597
  }
3598
3598
  async loadResources() {
3599
3599
  return (await this.httpGet("/poll/list/all")).map((s) => {
@@ -3614,8 +3614,8 @@ class PollBehaviour extends AbstractBehaviourService {
3614
3614
  class ScrapbookBehaviour extends AbstractBehaviourService {
3615
3615
  constructor() {
3616
3616
  super(...arguments);
3617
- n(this, "APP", "scrapbook");
3618
- n(this, "RESOURCE", "scrapbook");
3617
+ o(this, "APP", "scrapbook");
3618
+ o(this, "RESOURCE", "scrapbook");
3619
3619
  }
3620
3620
  async loadResources() {
3621
3621
  return (await this.httpGet(
@@ -3638,8 +3638,8 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
3638
3638
  class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3639
3639
  constructor() {
3640
3640
  super(...arguments);
3641
- n(this, "APP", "timelinegenerator");
3642
- n(this, "RESOURCE", "timelinegenerator");
3641
+ o(this, "APP", "timelinegenerator");
3642
+ o(this, "RESOURCE", "timelinegenerator");
3643
3643
  }
3644
3644
  loadResources() {
3645
3645
  return new Promise(async (t, s) => {
@@ -3669,8 +3669,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3669
3669
  class WikiBehaviour extends AbstractBehaviourService {
3670
3670
  constructor() {
3671
3671
  super(...arguments);
3672
- n(this, "APP", "wiki");
3673
- n(this, "RESOURCE", "wiki");
3672
+ o(this, "APP", "wiki");
3673
+ o(this, "RESOURCE", "wiki");
3674
3674
  }
3675
3675
  async loadResources() {
3676
3676
  return (await this.httpGet("/wiki/listallpages")).map((s) => s.pages.map((r) => {
@@ -3691,8 +3691,8 @@ class WikiBehaviour extends AbstractBehaviourService {
3691
3691
  class WorkspaceBehaviour extends AbstractBehaviourService {
3692
3692
  constructor() {
3693
3693
  super(...arguments);
3694
- n(this, "APP", "workspace");
3695
- n(this, "RESOURCE", "workspace");
3694
+ o(this, "APP", "workspace");
3695
+ o(this, "RESOURCE", "workspace");
3696
3696
  }
3697
3697
  loadResources({ search: t, asset_id: s }) {
3698
3698
  return new Promise(async (r, i) => {
@@ -3722,21 +3722,21 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
3722
3722
  const y = class y {
3723
3723
  static async initialize(e, t) {
3724
3724
  const s = e.http();
3725
- return new Promise((r) => {
3726
- this.resourceProducingApps.length ? r(this.resourceProducingApps) : (this.resourceProducingApps = [t, "workspace"], (async () => {
3727
- try {
3728
- const [i, u] = await Promise.all([
3729
- s.get("/resources-applications"),
3730
- e.session().getUser()
3731
- ]);
3732
- u && u.apps && (i != null && i.length) && (this.resourceProducingApps = i.filter(
3733
- (a) => u.apps.some((c) => c.address.includes(a))
3734
- ));
3735
- } catch {
3736
- }
3737
- r(this.resourceProducingApps);
3738
- })());
3739
- });
3725
+ if (!this.resourceProducingApps.length) {
3726
+ this.resourceProducingApps = [t, "workspace"];
3727
+ try {
3728
+ const [r, i] = await Promise.all([
3729
+ s.get("/resources-applications"),
3730
+ e.session().getUser()
3731
+ ]);
3732
+ i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
3733
+ (u) => i.apps.some((a) => a.address.includes(u))
3734
+ ));
3735
+ } catch (r) {
3736
+ console.warn("Failed to load resource-producing apps:", r);
3737
+ }
3738
+ }
3739
+ return this.resourceProducingApps;
3740
3740
  }
3741
3741
  static async registerBehaviours(e) {
3742
3742
  this.resourceProducingApps.forEach((t) => {
@@ -3807,13 +3807,13 @@ const y = class y {
3807
3807
  //
3808
3808
  // STATIC REGISTRY
3809
3809
  //
3810
- n(y, "registry", new ServiceRegistry()), // Expose some useful functions
3811
- n(y, "findBehaviour", y.registry.findService.bind(y.registry)), n(y, "hasBehaviour", y.registry.isRegistered.bind(y.registry)), n(y, "resourceProducingApps", []);
3810
+ o(y, "registry", new ServiceRegistry()), // Expose some useful functions
3811
+ o(y, "findBehaviour", y.registry.findService.bind(y.registry)), o(y, "hasBehaviour", y.registry.isRegistered.bind(y.registry)), o(y, "resourceProducingApps", []);
3812
3812
  let SnipletsService = y;
3813
3813
  const SEND_ALL = "*";
3814
3814
  class WebBroker {
3815
3815
  constructor(e) {
3816
- n(this, "subscription");
3816
+ o(this, "subscription");
3817
3817
  this.odeServices = e;
3818
3818
  }
3819
3819
  get http() {
@@ -3845,10 +3845,10 @@ class WebBroker {
3845
3845
  }
3846
3846
  class DataService {
3847
3847
  constructor(e) {
3848
- n(this, "_webBroker");
3849
- n(this, "app");
3850
- n(this, "user");
3851
- n(this, "profile");
3848
+ o(this, "_webBroker");
3849
+ o(this, "app");
3850
+ o(this, "user");
3851
+ o(this, "profile");
3852
3852
  this.odeServices = e;
3853
3853
  }
3854
3854
  get conf() {
@@ -4010,20 +4010,20 @@ class AudienceService {
4010
4010
  }
4011
4011
  class OdeServices {
4012
4012
  constructor() {
4013
- n(this, "_analytics");
4014
- n(this, "_cache");
4015
- n(this, "_conf");
4016
- n(this, "_data");
4017
- n(this, "_directory");
4018
- n(this, "_http");
4019
- n(this, "_idiom");
4020
- n(this, "_notify");
4021
- n(this, "_rights");
4022
- n(this, "_session");
4023
- n(this, "_share");
4024
- n(this, "_video");
4025
- n(this, "_workspace");
4026
- n(this, "_embedder");
4013
+ o(this, "_analytics");
4014
+ o(this, "_cache");
4015
+ o(this, "_conf");
4016
+ o(this, "_data");
4017
+ o(this, "_directory");
4018
+ o(this, "_http");
4019
+ o(this, "_idiom");
4020
+ o(this, "_notify");
4021
+ o(this, "_rights");
4022
+ o(this, "_session");
4023
+ o(this, "_share");
4024
+ o(this, "_video");
4025
+ o(this, "_workspace");
4026
+ o(this, "_embedder");
4027
4027
  this._analytics = new AnalyticsService(this), this._cache = new CacheService(this), this._conf = new ConfService(this), this._data = new DataService(this), this._directory = new DirectoryService(this), this._http = new HttpService(this), this._idiom = new IdiomService(this), this._notify = NotifyFrameworkFactory.instance(), this._rights = new RightService(this), this._session = new SessionService(this), this._share = new ShareService(this), this._video = new VideoService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
4028
4028
  }
4029
4029
  initialize() {
@@ -4156,9 +4156,9 @@ class TransportFrameworkFactory {
4156
4156
  return transport;
4157
4157
  }
4158
4158
  }
4159
- const isActionAvailable = (o, e) => {
4159
+ const isActionAvailable = (n, e) => {
4160
4160
  const t = e == null ? void 0 : e.filter(
4161
- (s) => s.id === o && s.available
4161
+ (s) => s.id === n && s.available
4162
4162
  );
4163
4163
  return t && t.length > 0;
4164
4164
  }, firstLevelWidgets = [
@@ -4225,10 +4225,10 @@ const isActionAvailable = (o, e) => {
4225
4225
  class WidgetFramework {
4226
4226
  constructor() {
4227
4227
  //-------------------------------------
4228
- n(this, "_initialized");
4229
- n(this, "_widgets", []);
4228
+ o(this, "_initialized");
4229
+ o(this, "_widgets", []);
4230
4230
  ////////////////////////////////////// USER PREFERENCES
4231
- n(this, "_userPrefs", {});
4231
+ o(this, "_userPrefs", {});
4232
4232
  }
4233
4233
  initialize(e, t) {
4234
4234
  return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
@@ -4292,8 +4292,8 @@ class WidgetFramework {
4292
4292
  class Widget {
4293
4293
  //-------------------------------------
4294
4294
  constructor(e) {
4295
- n(this, "_schoolConf", {});
4296
- n(this, "_userPref");
4295
+ o(this, "_schoolConf", {});
4296
+ o(this, "_userPref");
4297
4297
  this._platformConf = e, this._userPref = null;
4298
4298
  }
4299
4299
  get platformConf() {