@edifice.io/client 2.0.5 → 2.1.0-develop-b2school.20250204153130

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,90 +1,18 @@
1
1
  var v = Object.defineProperty;
2
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);
3
+ var u = (o, e, t) => T(o, 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 = {
7
- SUCCESS: "0000",
8
7
  UNKNOWN: "0010",
9
- NOT_INITIALIZED: "0020",
10
8
  NOT_SUPPORTED: "0030",
11
9
  APP_NOT_FOUND: "0040",
12
- AGENT_NOT_FOUND: "0050",
13
- TRANSPORT_ERROR: "0060",
14
10
  TIME_OUT: "0070",
15
11
  MALFORMED_DATA: "0080",
16
12
  NOT_LOGGED_IN: "0090"
17
- }, APP$1 = {
18
- ADMIN: "admin",
19
- ARCHIVE: "archive",
20
- AUTH: "auth",
21
- CAS: "cas",
22
- COMMUNICATION: "communication",
23
- CONVERSATION: "conversation",
24
- DIRECTORY: "directory",
25
- // FIXME userbook OR directory : the choice may impact some configurations, @see IXitiTrackingParams.NOM_PAGE for example
26
- USERBOOK: "userbook",
27
- INFRA: "infra",
28
- PORTAL: "portal",
13
+ }, APP$3 = {
29
14
  TIMELINE: "timeline",
30
- WORKSPACE: "workspace",
31
- // -- a few others commonly used apps
32
- EXPLORER: "explorer",
33
- VIDEO: "video",
34
- MINDMAP: "mindmap",
35
- SCRAPBOOK: "scrapbook",
36
- COLLABORATIVEWALL: "collaborativewall",
37
- WIKI: "wiki"
38
- // TODO compléter/trier les apps suivantes
39
- /*
40
- "competences"
41
- "cahier-textes"
42
- "poll"
43
- "rack"
44
- "rbs"
45
- "searchengine"
46
- "sharebigfiles"
47
- "schoolbook"
48
- "archive"
49
- "admin"
50
- "cahier-de-texte"
51
- "wiki"
52
- "cns"
53
- "conversation"
54
- "paths"
55
- "parcours"
56
- "notebook"
57
- "account"
58
- "support"
59
- "workspace"
60
- "admin-portal"
61
- "stats"
62
- "userbook" // FIXME userbook OR directory : the choice may impact some configurations, @see IXitiTrackingParams.NOM_PAGE for example
63
- "directory" // FIXME Keep in mind that ode-ts-client MUST not access the locationPath of the window !
64
- "mindmap"
65
- "timelinegenerator"
66
- "actualites"
67
- "pad"
68
- "collaborativeeditor"
69
- "settings-class"
70
- "library"
71
- "visioconf"
72
- "Web-conference"
73
- "notes"
74
- "attendance"
75
- "calendar"
76
- "canal-numerique"
77
- "collaborative-wall"
78
- "statistics"
79
- "polls"
80
- "community"
81
- "forum"
82
- "pages"
83
- "website"
84
- "parametrage"
85
- "kne"
86
- "sacoche"
87
- */
15
+ VIDEO: "video"
88
16
  }, USER_PREFS = {
89
17
  APPS: "apps",
90
18
  WIDGETS: "widgets",
@@ -97,7 +25,7 @@ const ERROR_CODE = {
97
25
  };
98
26
  class Subscription {
99
27
  constructor(e, t) {
100
- n(this, "revoke");
28
+ u(this, "revoke");
101
29
  this._channel = e, this.revoke = this.setReceiver(
102
30
  (s) => t == null ? void 0 : t(s.data)
103
31
  );
@@ -115,7 +43,7 @@ class Subject {
115
43
  * => We maintain here channels for *sending* messages.
116
44
  * *Receiving* channels will be instantiated while subscribing.
117
45
  */
118
- n(this, "publishChannels", /* @__PURE__ */ new Map());
46
+ u(this, "publishChannels", /* @__PURE__ */ new Map());
119
47
  }
120
48
  getChannelName(e) {
121
49
  return "Subject:" + e;
@@ -150,9 +78,9 @@ const ASYNC_DATA_NAME = {
150
78
  class Promisified {
151
79
  constructor() {
152
80
  //-------------------------------------
153
- n(this, "_resolution");
154
- n(this, "_rejection");
155
- n(this, "_promise", new Promise((e, t) => {
81
+ u(this, "_resolution");
82
+ u(this, "_rejection");
83
+ u(this, "_promise", new Promise((e, t) => {
156
84
  this._resolution = e, this._rejection = t;
157
85
  }));
158
86
  }
@@ -169,8 +97,8 @@ class Promisified {
169
97
  class NotifyFramework {
170
98
  constructor() {
171
99
  //-------------------------------------
172
- n(this, "promises", {});
173
- n(this, "subject", new Subject());
100
+ u(this, "promises", {});
101
+ u(this, "subject", new Subject());
174
102
  }
175
103
  asyncData(e) {
176
104
  return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
@@ -201,8 +129,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
201
129
  class Http {
202
130
  constructor(e) {
203
131
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
204
- n(this, "axios");
205
- n(this, "_latestResponse");
132
+ u(this, "axios");
133
+ u(this, "_latestResponse");
206
134
  this.axios = axios.create(e);
207
135
  }
208
136
  setCdn(e) {
@@ -280,15 +208,15 @@ class Http {
280
208
  }
281
209
  getScript(e, t, s) {
282
210
  const r = s ?? "exports", i = this.toAxiosConfig(t);
283
- return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((u) => this.mapAxiosResponse(u, t)).then((u) => {
211
+ return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((n) => this.mapAxiosResponse(n, t)).then((n) => {
284
212
  try {
285
- const a = `"use strict";var ${r.split(".")[0]}={};${u};return ${r};`;
213
+ const a = `"use strict";var ${r.split(".")[0]}={};${n};return ${r};`;
286
214
  return Function(a)();
287
215
  } catch {
288
- return u;
216
+ return n;
289
217
  }
290
- }).catch((u) => {
291
- throw this.mapAxiosError(u, t), u;
218
+ }).catch((n) => {
219
+ throw this.mapAxiosError(n, t), n;
292
220
  });
293
221
  }
294
222
  loadScript(e, t) {
@@ -299,7 +227,7 @@ class Http {
299
227
  }
300
228
  class TransportFramework {
301
229
  constructor() {
302
- n(this, "_http", new Http());
230
+ u(this, "_http", new Http());
303
231
  }
304
232
  get http() {
305
233
  return this._http;
@@ -318,11 +246,11 @@ class ConfigurationFrameworkFactory {
318
246
  const http$2 = transport.http;
319
247
  class Session {
320
248
  constructor() {
321
- n(this, "_me", null);
322
- n(this, "_currentLanguage", "");
323
- n(this, "_notLoggedIn", !0);
324
- n(this, "_description");
325
- n(this, "_profile");
249
+ u(this, "_me", null);
250
+ u(this, "_currentLanguage", "");
251
+ u(this, "_notLoggedIn", !0);
252
+ u(this, "_description");
253
+ u(this, "_profile");
326
254
  }
327
255
  get currentLanguage() {
328
256
  return this._currentLanguage;
@@ -367,8 +295,8 @@ class Session {
367
295
  hasRight(e, t) {
368
296
  if (t === "owner")
369
297
  return e.owner && e.owner.userId === this._me.userId;
370
- const s = t.right || t, i = e.shared.filter((a) => (this._me.groupsIds || []).indexOf(a.groupId) !== -1 || a.userId === this._me.userId).find((a) => a[s] || a.manager) !== void 0, u = t.workflow ? this.hasWorkflow(t.workflow) : !0;
371
- return i && u;
298
+ const s = t.right || t, i = e.shared.filter((a) => (this._me.groupsIds || []).indexOf(a.groupId) !== -1 || a.userId === this._me.userId).find((a) => a[s] || a.manager) !== void 0, n = t.workflow ? this.hasWorkflow(t.workflow) : !0;
299
+ return i && n;
372
300
  }
373
301
  ////////////////////////////////////////////////////////// Storage management
374
302
  get latestQuotaAndUsage() {
@@ -440,7 +368,7 @@ class Session {
440
368
  }
441
369
  class SessionFramework {
442
370
  constructor() {
443
- n(this, "session", new Session());
371
+ u(this, "session", new Session());
444
372
  }
445
373
  initialize() {
446
374
  return this.session.initialize();
@@ -464,22 +392,22 @@ class SessionFramework {
464
392
  const session = new SessionFramework();
465
393
  class Theme {
466
394
  constructor() {
467
- n(this, "_conf");
468
- n(this, "_loaded");
395
+ u(this, "_conf");
396
+ u(this, "_loaded");
469
397
  // 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());
398
+ u(this, "skinName", "");
399
+ u(this, "themeName", "");
400
+ u(this, "skin", "raw");
401
+ u(this, "themeUrl", "/assets/themes/raw/default/");
402
+ u(this, "templateOverrides", {});
403
+ u(this, "portalTemplate", "/assets/themes/raw/portal.html");
404
+ u(this, "basePath", "");
405
+ u(this, "logoutCallback", "/");
406
+ u(this, "skins", []);
407
+ u(this, "is1D", !1);
408
+ u(this, "is2D", !1);
409
+ u(this, "_onSkinReady", notify.onSkinReady());
410
+ u(this, "_onOverrideReady", notify.onOverridesReady());
483
411
  }
484
412
  initialize(e) {
485
413
  return notify.onSessionReady().promise.then(() => this.load(e));
@@ -812,8 +740,8 @@ class Idiom {
812
740
  else {
813
741
  const i = new Promisified();
814
742
  promises$1[t] = i.promise;
815
- const u = {};
816
- e && (u["Accept-Language"] = e), transport.http.get(t, { headers: u }).then((a) => {
743
+ const n = {};
744
+ e && (n["Accept-Language"] = e), transport.http.get(t, { headers: n }).then((a) => {
817
745
  Object.assign(bundle$1, a), typeof s == "function" && s(), i.resolve();
818
746
  }).catch((a) => {
819
747
  typeof s == "function" && s(), i.reject();
@@ -851,7 +779,7 @@ class Idiom {
851
779
  class UserPreferences {
852
780
  constructor() {
853
781
  //-------------------------------------
854
- n(this, "data", {});
782
+ u(this, "data", {});
855
783
  }
856
784
  get(e) {
857
785
  return this.data[e];
@@ -878,10 +806,10 @@ class UserPreferences {
878
806
  class User {
879
807
  constructor() {
880
808
  //-------------------------------------
881
- n(this, "_me", null);
882
- n(this, "_keepOpenOnLogout", !1);
883
- n(this, "_preferences", new UserPreferences());
884
- n(this, "_bookmarkedApps", []);
809
+ u(this, "_me", null);
810
+ u(this, "_keepOpenOnLogout", !1);
811
+ u(this, "_preferences", new UserPreferences());
812
+ u(this, "_bookmarkedApps", []);
885
813
  }
886
814
  get keepOpenOnLogout() {
887
815
  return this._keepOpenOnLogout;
@@ -913,7 +841,7 @@ class User {
913
841
  let s;
914
842
  if (t && t.length && typeof t.concat == "function") {
915
843
  this._bookmarkedApps = t, s = {
916
- bookmarks: t.map((u) => u.name),
844
+ bookmarks: t.map((n) => n.name),
917
845
  applications: []
918
846
  }, transport.http.putJson("/userbook/preference/apps", s);
919
847
  return;
@@ -925,15 +853,15 @@ class User {
925
853
  });
926
854
  let r = !0;
927
855
  const i = [];
928
- s.bookmarks.forEach((u, a) => {
929
- const c = this._me.apps.find((h) => h.name === u);
856
+ s.bookmarks.forEach((n, a) => {
857
+ const c = this._me.apps.find((h) => h.name === n);
930
858
  if (c) {
931
859
  const h = Object.assign({}, c);
932
860
  this._bookmarkedApps.push(h);
933
861
  } else
934
- i.push(u), r = !1;
935
- }), i.forEach((u) => {
936
- const a = s.bookmarks.indexOf(u);
862
+ i.push(n), r = !1;
863
+ }), i.forEach((n) => {
864
+ const a = s.bookmarks.indexOf(n);
937
865
  a !== -1 && s.bookmarks.splice(a, 1);
938
866
  }), r || transport.http.putJson("/userbook/preference/apps", s);
939
867
  });
@@ -955,9 +883,9 @@ const http$1 = transport == null ? void 0 : transport.http;
955
883
  class AppConf {
956
884
  constructor() {
957
885
  //-------------------------------------
958
- n(this, "_publicConf", {});
959
- n(this, "_currentApp");
960
- n(this, "_appConf", {});
886
+ u(this, "_publicConf", {});
887
+ u(this, "_currentApp");
888
+ u(this, "_appConf", {});
961
889
  }
962
890
  /**
963
891
  * Get the currently initialized App.
@@ -995,8 +923,8 @@ class AppConf {
995
923
  class Analytics {
996
924
  constructor() {
997
925
  //-------------------------------------
998
- n(this, "_status", "void");
999
- n(this, "_params");
926
+ u(this, "_status", "void");
927
+ u(this, "_params");
1000
928
  }
1001
929
  get status() {
1002
930
  return this._status;
@@ -1048,8 +976,8 @@ class Analytics {
1048
976
  configure.Platform.apps.currentApp
1049
977
  );
1050
978
  if (!i) return;
1051
- const u = i.xiti;
1052
- if (!u || !u.LIBELLE_SERVICE || !r.UAI) return;
979
+ const n = i.xiti;
980
+ if (!n || !n.LIBELLE_SERVICE || !r.UAI) return;
1053
981
  function a(h) {
1054
982
  let l = "";
1055
983
  for (let E = 0; E < h.length; E++)
@@ -1064,10 +992,10 @@ class Analytics {
1064
992
  Guest: "AUTRE"
1065
993
  };
1066
994
  return {
1067
- LIBELLE_SERVICE: u.LIBELLE_SERVICE,
995
+ LIBELLE_SERVICE: n.LIBELLE_SERVICE,
1068
996
  // Which property of LIBELLE_SERVICE to use depends on the frontend.
1069
- TYPE: u.OUTIL ? "TIERS" : "NATIF",
1070
- OUTIL: u.OUTIL ? u.OUTIL : "",
997
+ TYPE: n.OUTIL ? "TIERS" : "NATIF",
998
+ OUTIL: n.OUTIL ? n.OUTIL : "",
1071
999
  STRUCT_ID: r.collectiviteId,
1072
1000
  STRUCT_UAI: r.UAI,
1073
1001
  PROJET: r.projetId ? r.projetId : e.ID_PROJET,
@@ -1081,7 +1009,7 @@ class Analytics {
1081
1009
  class ConfigurationFramework {
1082
1010
  constructor() {
1083
1011
  //-------------------------------------
1084
- n(this, "Platform", {
1012
+ u(this, "Platform", {
1085
1013
  deploymentTag: "",
1086
1014
  cdnDomain: "",
1087
1015
  apps: new AppConf(),
@@ -1090,15 +1018,15 @@ class ConfigurationFramework {
1090
1018
  idiom: new Idiom(),
1091
1019
  listLanguages: () => transport.http.get("/languages")
1092
1020
  });
1093
- n(this, "School", {
1021
+ u(this, "School", {
1094
1022
  //apps; -> pinnedApps;
1095
1023
  });
1096
- n(this, "User", new User());
1024
+ u(this, "User", new User());
1097
1025
  }
1098
1026
  async initialize(e, t) {
1099
1027
  if (!e) {
1100
- const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(), u = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
1101
- e = `${u}${r(a)}${r(c)}`;
1028
+ const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(), n = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
1029
+ e = `${n}${r(a)}${r(c)}`;
1102
1030
  }
1103
1031
  const s = e;
1104
1032
  this.Platform.deploymentTag = e, typeof t == "string" && t.length > 0 && (this.Platform.cdnDomain = t), transport.http.setCdn(this.Platform.cdnDomain), await Promise.all([
@@ -1140,8 +1068,8 @@ var _;
1140
1068
  const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
1141
1069
  class Notification {
1142
1070
  constructor(e) {
1143
- n(this, "_id");
1144
- n(this, "model");
1071
+ u(this, "_id");
1072
+ u(this, "model");
1145
1073
  e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
1146
1074
  }
1147
1075
  isUnread() {
@@ -1161,14 +1089,14 @@ class Notification {
1161
1089
  class TimelineApp {
1162
1090
  constructor() {
1163
1091
  //-------------------------------------
1164
- n(this, "_notifications", []);
1165
- n(this, "_notificationTypes", []);
1092
+ u(this, "_notifications", []);
1093
+ u(this, "_notificationTypes", []);
1166
1094
  // 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);
1095
+ u(this, "_flashMessages", []);
1096
+ u(this, "_pageNumber", 0);
1097
+ u(this, "_lastPage", !1);
1098
+ u(this, "_loading", !1);
1099
+ u(this, "showMine", !1);
1172
1100
  }
1173
1101
  get notifications() {
1174
1102
  return this._notifications;
@@ -1189,20 +1117,20 @@ class TimelineApp {
1189
1117
  return this.preferences.type = this.preferences.type || [], this.preferences.type;
1190
1118
  }
1191
1119
  get preferences() {
1192
- return configure.User.preferences.get(APP$1.TIMELINE);
1120
+ return configure.User.preferences.get(APP$3.TIMELINE);
1193
1121
  }
1194
1122
  get flashMessages() {
1195
1123
  return this._flashMessages;
1196
1124
  }
1197
1125
  savePreferences() {
1198
- return configure.User.saveAppPrefs(APP$1.TIMELINE);
1126
+ return configure.User.saveAppPrefs(APP$3.TIMELINE);
1199
1127
  }
1200
1128
  resetPagination() {
1201
1129
  this._pageNumber = 0, this._lastPage = !1, this._loading = !1;
1202
1130
  }
1203
1131
  initialize() {
1204
1132
  return Promise.all([
1205
- configure.User.loadAppPrefs(APP$1.TIMELINE),
1133
+ configure.User.loadAppPrefs(APP$3.TIMELINE),
1206
1134
  transport.http.get("/timeline/types")
1207
1135
  ]).then((e) => {
1208
1136
  this._notificationTypes = e[1];
@@ -1226,10 +1154,10 @@ class TimelineApp {
1226
1154
  if (this._loading = !1, r.status === "ok")
1227
1155
  if (r.number && r.results) {
1228
1156
  const i = r.results.filter(
1229
- (u) => this._notifications.findIndex(
1230
- (a) => a._id === u._id
1157
+ (n) => this._notifications.findIndex(
1158
+ (a) => a._id === n._id
1231
1159
  ) === -1
1232
- ).map((u) => new Notification(u));
1160
+ ).map((n) => new Notification(n));
1233
1161
  this._notifications = this._notifications.concat(i), this._pageNumber++;
1234
1162
  } else
1235
1163
  this._lastPage = !0;
@@ -1266,12 +1194,10 @@ class NotifyFrameworkFactory {
1266
1194
  }
1267
1195
  const LAYER_NAME = {
1268
1196
  WIDGETS: "widgets",
1269
- EXPLORER: "explorer",
1270
1197
  TRANSPORT: "transport",
1271
1198
  WEB_DATA: "webDataPipeline"
1272
1199
  }, EVENT_NAME = {
1273
1200
  USERPREF_CHANGED: "userprefChanged",
1274
- SEARCH_RESULTED: "searchResulted",
1275
1201
  ERROR_OCCURED: "error",
1276
1202
  DATA_TRACKED: "track"
1277
1203
  };
@@ -1317,7 +1243,7 @@ const f = class f {
1317
1243
  //
1318
1244
  // PROTECTED HELPERS
1319
1245
  //
1320
- n(this, "checkHttpResponse", (e) => {
1246
+ u(this, "checkHttpResponse", (e) => {
1321
1247
  if (this.http.latestResponse.status >= 300)
1322
1248
  throw this.http.latestResponse.statusText;
1323
1249
  return e;
@@ -1469,7 +1395,7 @@ const f = class f {
1469
1395
  });
1470
1396
  return t.map((r) => {
1471
1397
  const i = s.resources.find(
1472
- (u) => u.assetId === r
1398
+ (n) => n.assetId === r
1473
1399
  );
1474
1400
  if (i === void 0)
1475
1401
  throw "explorer.assetid.notfound";
@@ -1535,10 +1461,10 @@ const f = class f {
1535
1461
  //
1536
1462
  // STATIC REGISTRY
1537
1463
  //
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));
1464
+ u(f, "registry", new ServiceRegistry()), // Expose some useful functions
1465
+ u(f, "register", f.registry.register.bind(f.registry)), u(f, "findService", f.registry.findService.bind(f.registry)), u(f, "findMainService", f.registry.findMainService.bind(f.registry)), u(f, "isRegistered", f.registry.isRegistered.bind(f.registry));
1540
1466
  let ResourceService = f;
1541
- const APP = "scrapbook", RESOURCE = "scrapbook";
1467
+ const APP$2 = "scrapbook", RESOURCE$2 = "scrapbook";
1542
1468
  class ScrapbookResourceService extends ResourceService {
1543
1469
  create(e) {
1544
1470
  throw new Error("Method not implemented.");
@@ -1556,10 +1482,10 @@ class ScrapbookResourceService extends ResourceService {
1556
1482
  return this.checkHttpResponse(s), { thumbnail: t, entId: e.entId };
1557
1483
  }
1558
1484
  getResourceType() {
1559
- return RESOURCE;
1485
+ return RESOURCE$2;
1560
1486
  }
1561
1487
  getApplication() {
1562
- return APP;
1488
+ return APP$2;
1563
1489
  }
1564
1490
  getFormUrl(e) {
1565
1491
  return e ? `/scrapbook?folderid=${e}#/create-scrapbook/` : "/scrapbook#/create-scrapbook/";
@@ -1578,9 +1504,112 @@ class ScrapbookResourceService extends ResourceService {
1578
1504
  }
1579
1505
  }
1580
1506
  ResourceService.register(
1581
- { application: RESOURCE, resourceType: RESOURCE },
1507
+ { application: RESOURCE$2, resourceType: RESOURCE$2 },
1582
1508
  (o) => new ScrapbookResourceService(o)
1583
1509
  );
1510
+ const APP$1 = "homeworks", RESOURCE$1 = "homeworks";
1511
+ class HomeworksResourceService extends ResourceService {
1512
+ async create(e) {
1513
+ const t = await this.getThumbnailPath(e.thumbnail), s = await this.http.post("/homeworks", {
1514
+ title: e.name,
1515
+ thumbnail: t,
1516
+ description: e.description,
1517
+ repeats: e.repeats
1518
+ });
1519
+ return this.checkHttpResponse(s), { thumbnail: t, entId: s._id };
1520
+ }
1521
+ async update(e) {
1522
+ const t = await this.getThumbnailPath(e.thumbnail), s = await this.http.put(
1523
+ `/homeworks/${e.entId}`,
1524
+ {
1525
+ title: e.name,
1526
+ thumbnail: t,
1527
+ repeats: e.repeats
1528
+ }
1529
+ );
1530
+ return this.checkHttpResponse(s), { thumbnail: t, entId: e.entId };
1531
+ }
1532
+ getResourceType() {
1533
+ return RESOURCE$1;
1534
+ }
1535
+ getApplication() {
1536
+ return APP$1;
1537
+ }
1538
+ getFormUrl(e) {
1539
+ return e ? `/homeworks?folderid=${e}#/create-homeworks/` : "/homeworks#/create-homeworks/";
1540
+ }
1541
+ getViewUrl(e) {
1542
+ return `/homeworks#/view-homeworks/${e}`;
1543
+ }
1544
+ getPrintUrl(e) {
1545
+ return `/homeworks/print#/print-homeworks/${e}`;
1546
+ }
1547
+ getEditUrl(e) {
1548
+ return `/homeworks#/edit-homeworks/${e}`;
1549
+ }
1550
+ getExportUrl() {
1551
+ throw new Error("Export not implemented.");
1552
+ }
1553
+ }
1554
+ ResourceService.register(
1555
+ { application: RESOURCE$1, resourceType: RESOURCE$1 },
1556
+ (o) => new HomeworksResourceService(o)
1557
+ );
1558
+ const APP = "timelinegenerator", RESOURCE = "timelinegenerator";
1559
+ class TimelineGeneratorResourceService extends ResourceService {
1560
+ async create(e) {
1561
+ const t = e.thumbnail ? await this.getThumbnailPath(e.thumbnail) : "", s = await this.http.post(
1562
+ "/timelinegenerator/timelines",
1563
+ {
1564
+ headline: e.name,
1565
+ text: e.description,
1566
+ icon: t,
1567
+ type: "default",
1568
+ folder: e.folder
1569
+ }
1570
+ );
1571
+ return this.checkHttpResponse(s), s;
1572
+ }
1573
+ async update(e) {
1574
+ const t = await this.getThumbnailPath(e.thumbnail), s = await this.http.put(
1575
+ `/timelinegenerator/timeline/${e.entId}`,
1576
+ {
1577
+ headline: e.name,
1578
+ text: e.description,
1579
+ icon: t,
1580
+ trashed: !!e.trashed,
1581
+ _id: e.entId,
1582
+ type: "default"
1583
+ }
1584
+ );
1585
+ return this.checkHttpResponse(s), { thumbnail: t, entId: e.entId };
1586
+ }
1587
+ getResourceType() {
1588
+ return RESOURCE;
1589
+ }
1590
+ getApplication() {
1591
+ return APP;
1592
+ }
1593
+ getFormUrl() {
1594
+ throw new Error("Method not implemented.");
1595
+ }
1596
+ getViewUrl(e) {
1597
+ return `/timelinegenerator#/view/${e}`;
1598
+ }
1599
+ getPrintUrl(e) {
1600
+ return `/timelinegenerator/print#/print/${e}`;
1601
+ }
1602
+ getEditUrl() {
1603
+ throw new Error("Method not implemented.");
1604
+ }
1605
+ getExportUrl() {
1606
+ throw new Error("Method not implemented.");
1607
+ }
1608
+ }
1609
+ ResourceService.register(
1610
+ { application: RESOURCE, resourceType: RESOURCE },
1611
+ (o) => new TimelineGeneratorResourceService(o)
1612
+ );
1584
1613
  const globalCache = {}, mutexPromise = {};
1585
1614
  class CacheService {
1586
1615
  constructor(e) {
@@ -1648,14 +1677,14 @@ class ConfService {
1648
1677
  ]), [r, i] = await Promise.all([
1649
1678
  this.getTheme({ conf: t, publicTheme: s === void 0 }),
1650
1679
  this.getWebAppConf({ app: e, applications: s ?? [] })
1651
- ]), u = {
1680
+ ]), n = {
1652
1681
  app: e,
1653
1682
  applications: s ?? [],
1654
1683
  conf: t,
1655
1684
  currentApp: i,
1656
1685
  theme: r
1657
1686
  };
1658
- return this.notify.onAppConfReady().resolve(u), u;
1687
+ return this.notify.onAppConfReady().resolve(n), n;
1659
1688
  }
1660
1689
  async getPublicConf(e) {
1661
1690
  const { response: t, value: s } = await this.cache.httpGet(
@@ -1707,23 +1736,23 @@ class ConfService {
1707
1736
  conf: t,
1708
1737
  publicTheme: s
1709
1738
  }) {
1710
- const r = await this.http.get("/theme"), i = s ? null : r, u = t == null ? void 0 : t.overriding.find(
1739
+ const r = await this.http.get("/theme"), i = s ? null : r, n = t == null ? void 0 : t.overriding.find(
1711
1740
  (p) => (
1712
1741
  // Public access => simply use the 1st override
1713
1742
  i === null || p.child === i.themeName
1714
1743
  )
1715
- ), a = (i == null ? void 0 : i.skinName) || u.skins[0], c = (i == null ? void 0 : i.skin) || `/assets/themes/${u.child}/skins/${a}/`, h = u.skins, l = u.bootstrapVersion.split("-").slice(-1)[0], E = u.parent === "panda";
1744
+ ), a = (i == null ? void 0 : i.skinName) || n.skins[0], c = (i == null ? void 0 : i.skin) || `/assets/themes/${n.child}/skins/${a}/`, h = n.skins, l = n.bootstrapVersion.split("-").slice(-1)[0], E = n.parent === "panda";
1716
1745
  return {
1717
1746
  basePath: `${this.cdnDomain}${c}../../`,
1718
1747
  bootstrapVersion: l,
1719
1748
  is1d: E,
1720
1749
  logoutCallback: (i == null ? void 0 : i.logoutCallback) || "/",
1721
- skin: u.child,
1750
+ skin: n.child,
1722
1751
  skinName: a,
1723
1752
  skins: h,
1724
- themeName: u.child,
1753
+ themeName: n.child,
1725
1754
  themeUrl: c,
1726
- npmTheme: u.npmTheme ?? void 0
1755
+ npmTheme: n.npmTheme ?? void 0
1727
1756
  };
1728
1757
  }
1729
1758
  async getLogoutCallback(e) {
@@ -1768,13 +1797,13 @@ class DirectoryService {
1768
1797
  return {
1769
1798
  id: s,
1770
1799
  displayName: r,
1771
- groups: t.map(({ name: u, id: a }) => ({
1772
- displayName: u,
1800
+ groups: t.map(({ name: n, id: a }) => ({
1801
+ displayName: n,
1773
1802
  id: a
1774
1803
  })),
1775
- users: i.map(({ displayName: u, id: a, profile: c }) => ({
1804
+ users: i.map(({ displayName: n, id: a, profile: c }) => ({
1776
1805
  profile: c,
1777
- displayName: u,
1806
+ displayName: n,
1778
1807
  // these info are missing from api
1779
1808
  firstName: "",
1780
1809
  lastName: "",
@@ -1789,7 +1818,7 @@ class DirectoryService {
1789
1818
  users: r
1790
1819
  }) {
1791
1820
  this.cache.clearCache("/directory/sharebookmark/all");
1792
- const i = r.map((p) => typeof p == "string" ? p : p.id), u = s.map((p) => typeof p == "string" ? p : p.id), a = t.map(async (p) => {
1821
+ const i = r.map((p) => typeof p == "string" ? p : p.id), n = s.map((p) => typeof p == "string" ? p : p.id), a = t.map(async (p) => {
1793
1822
  if (typeof p == "string") {
1794
1823
  const { displayName: d, groups: g, id: A, users: m } = await this.getBookMarkById(p), b = m.map((F) => F.id), R = g.map((F) => F.id);
1795
1824
  return {
@@ -1801,7 +1830,7 @@ class DirectoryService {
1801
1830
  return Promise.resolve(p);
1802
1831
  }), h = (await Promise.all(a)).map((p) => p.members).reduce((p, d) => [...p, ...d], []), l = {
1803
1832
  name: e,
1804
- members: [...i, ...u, ...h]
1833
+ members: [...i, ...n, ...h]
1805
1834
  }, { id: E } = await this.http.postJson(
1806
1835
  "/directory/sharebookmark",
1807
1836
  l
@@ -1817,10 +1846,10 @@ const loadedScripts = {};
1817
1846
  class HttpService {
1818
1847
  constructor(e, t) {
1819
1848
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
1820
- n(this, "axios");
1821
- n(this, "baseUrl");
1822
- n(this, "headers", {});
1823
- n(this, "_latestResponse");
1849
+ u(this, "axios");
1850
+ u(this, "baseUrl");
1851
+ u(this, "headers", {});
1852
+ u(this, "_latestResponse");
1824
1853
  this.context = e, this.axios = axios.create(t);
1825
1854
  }
1826
1855
  fixBaseUrl(e) {
@@ -1865,15 +1894,15 @@ class HttpService {
1865
1894
  status: 500,
1866
1895
  statusText: ERROR_CODE.UNKNOWN
1867
1896
  };
1868
- const { status: s, statusText: r, headers: i, data: u } = this._latestResponse;
1897
+ const { status: s, statusText: r, headers: i, data: n } = this._latestResponse;
1869
1898
  return t != null && t.disableNotifications || notify.events().publish(LAYER_NAME.TRANSPORT, {
1870
1899
  name: EVENT_NAME.ERROR_OCCURED,
1871
1900
  data: {
1872
1901
  params: t,
1873
1902
  response: { status: s, statusText: r, headers: i },
1874
- payload: u
1903
+ payload: n
1875
1904
  }
1876
- }), u;
1905
+ }), n;
1877
1906
  }
1878
1907
  mapAxiosResponse(e, t) {
1879
1908
  return this._latestResponse = e, e.data;
@@ -1996,15 +2025,15 @@ class HttpService {
1996
2025
  }
1997
2026
  getScript(e, t, s) {
1998
2027
  const r = s ?? "exports", i = this.toAxiosConfig(t);
1999
- return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((u) => this.mapAxiosResponse(u, t)).then((u) => {
2028
+ return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((n) => this.mapAxiosResponse(n, t)).then((n) => {
2000
2029
  try {
2001
- const a = `"use strict";var ${r.split(".")[0]}={};${u};return ${r};`;
2030
+ const a = `"use strict";var ${r.split(".")[0]}={};${n};return ${r};`;
2002
2031
  return Function(a)();
2003
2032
  } catch {
2004
- return u;
2033
+ return n;
2005
2034
  }
2006
- }).catch((u) => {
2007
- throw this.mapAxiosError(u, t), u;
2035
+ }).catch((n) => {
2036
+ throw this.mapAxiosError(n, t), n;
2008
2037
  });
2009
2038
  }
2010
2039
  loadScript(e, t) {
@@ -2064,13 +2093,13 @@ class RightService {
2064
2093
  * @returns true if has rights
2065
2094
  */
2066
2095
  hasResourceRight({ id: e, groupIds: t }, s, r) {
2067
- const i = r.map((u) => typeof u == "string" ? this.parseResourceRight(u) : u).filter((u) => u !== void 0);
2068
- for (const u of i) {
2069
- if (u.id === e && u.type === "creator")
2096
+ const i = r.map((n) => typeof n == "string" ? this.parseResourceRight(n) : n).filter((n) => n !== void 0);
2097
+ for (const n of i) {
2098
+ if (n.id === e && n.type === "creator")
2070
2099
  return !0;
2071
- if (u.id === e && u.type === "user" && u.right === s)
2100
+ if (n.id === e && n.type === "user" && n.right === s)
2072
2101
  return !0;
2073
- if (t.includes(u.id) && u.type === "group" && u.right === s)
2102
+ if (t.includes(n.id) && n.type === "group" && n.right === s)
2074
2103
  return !0;
2075
2104
  }
2076
2105
  return !1;
@@ -2207,7 +2236,7 @@ class SessionService {
2207
2236
  s,
2208
2237
  r,
2209
2238
  i,
2210
- u
2239
+ n
2211
2240
  ] = await Promise.all([
2212
2241
  this.getCurrentLanguage(e),
2213
2242
  this.latestQuotaAndUsage(e),
@@ -2221,7 +2250,7 @@ class SessionService {
2221
2250
  currentLanguage: t,
2222
2251
  userDescription: r,
2223
2252
  userProfile: i,
2224
- bookmarkedApps: u
2253
+ bookmarkedApps: n
2225
2254
  };
2226
2255
  }
2227
2256
  login(e, t, s, r) {
@@ -2315,9 +2344,9 @@ class SessionService {
2315
2344
  applications: []
2316
2345
  });
2317
2346
  const i = [];
2318
- return r.bookmarks.forEach((u, a) => {
2347
+ return r.bookmarks.forEach((n, a) => {
2319
2348
  const c = ((e == null ? void 0 : e.apps) || []).find(
2320
- (h) => h.name === u
2349
+ (h) => h.name === n
2321
2350
  );
2322
2351
  if (c) {
2323
2352
  const h = Object.assign({}, c);
@@ -2327,8 +2356,8 @@ class SessionService {
2327
2356
  }
2328
2357
  async getUserProfile(e = {}) {
2329
2358
  var c, h;
2330
- const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: u, value: a } = await this.cache.httpGet(i, t);
2331
- return u.status < 200 || u.status >= 300 || typeof a == "string" ? ["Guest"] : ((h = (c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) == null ? void 0 : h.type) || ["Guest"];
2359
+ const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: n, value: a } = await this.cache.httpGet(i, t);
2360
+ return n.status < 200 || n.status >= 300 || typeof a == "string" ? ["Guest"] : ((h = (c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) == null ? void 0 : h.type) || ["Guest"];
2332
2361
  }
2333
2362
  async isAdml() {
2334
2363
  const e = await this.getUser();
@@ -2592,8 +2621,8 @@ class IdiomService {
2592
2621
  else {
2593
2622
  const i = new Promisified();
2594
2623
  promises[t] = i.promise;
2595
- const u = {};
2596
- e && (u["Accept-Language"] = e), this.http.get(t, { headers: u }).then((a) => {
2624
+ const n = {};
2625
+ e && (n["Accept-Language"] = e), this.http.get(t, { headers: n }).then((a) => {
2597
2626
  Object.assign(bundle, a), typeof s == "function" && s(), i.resolve();
2598
2627
  }).catch((a) => {
2599
2628
  typeof s == "function" && s(), i.reject();
@@ -2657,7 +2686,7 @@ class ShareService {
2657
2686
  async searchShareSubjects(e, t, s) {
2658
2687
  const r = StringUtils.removeAccents(s).toLowerCase(), i = await this.cache.httpGetJson(
2659
2688
  `/${e}/share/json/${t}?search=${s}`
2660
- ), u = i.users.visibles.filter(({ username: l, firstName: E, lastName: p, login: d }) => {
2689
+ ), n = i.users.visibles.filter(({ username: l, firstName: E, lastName: p, login: d }) => {
2661
2690
  const g = StringUtils.removeAccents(
2662
2691
  p || ""
2663
2692
  ).toLowerCase(), A = StringUtils.removeAccents(
@@ -2690,7 +2719,7 @@ class ShareService {
2690
2719
  displayName: l.displayName,
2691
2720
  id: l.id,
2692
2721
  type: "sharebookmark"
2693
- })), ...u, ...a];
2722
+ })), ...n, ...a];
2694
2723
  }
2695
2724
  async getShareMapping(e) {
2696
2725
  const t = await this.cache.httpGetJson(
@@ -2704,15 +2733,15 @@ class ShareService {
2704
2733
  return t;
2705
2734
  }
2706
2735
  getActionsAvailableFor({ id: e, type: t }, s, r) {
2707
- const u = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
2736
+ const n = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
2708
2737
  for (const h of a)
2709
2738
  r[h].filter(
2710
- (p) => u.includes(p)
2739
+ (p) => n.includes(p)
2711
2740
  ).length > 0 && c.push(h);
2712
2741
  return c;
2713
2742
  }
2714
2743
  async getRightsForResource(e, t) {
2715
- const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r), u = await this.getShareMapping(e), a = await this.cache.httpGetJson(
2744
+ const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r), n = await this.getShareMapping(e), a = await this.cache.httpGetJson(
2716
2745
  "/infra/public/json/sharing-rights.json"
2717
2746
  ), c = Object.keys(i.users.checked).map((d) => i.users.visibles.find(
2718
2747
  (A) => A.id === d
@@ -2720,7 +2749,7 @@ class ShareService {
2720
2749
  const g = this.getActionsAvailableFor(
2721
2750
  { id: d.id, type: "user" },
2722
2751
  i,
2723
- u
2752
+ n
2724
2753
  );
2725
2754
  return {
2726
2755
  id: d.id,
@@ -2744,7 +2773,7 @@ class ShareService {
2744
2773
  const g = this.getActionsAvailableFor(
2745
2774
  { id: d.id, type: "group" },
2746
2775
  i,
2747
- u
2776
+ n
2748
2777
  );
2749
2778
  return {
2750
2779
  id: d.id,
@@ -2794,25 +2823,25 @@ class ShareService {
2794
2823
  const h = c.actions.map((E) => r[E.id]).reduce((E, p) => Array.isArray(p) ? [...E, ...p] : E, []), l = [...new Set(h)];
2795
2824
  l.length > 0 && (c.type === "user" ? i.users[c.id] = l : c.type === "group" ? i.groups[c.id] = l : i.bookmarks[c.id] = l);
2796
2825
  }
2797
- const u = `/${e}/share/resource/${t}`;
2798
- return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(u, i);
2826
+ const n = `/${e}/share/resource/${t}`;
2827
+ return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(n, i);
2799
2828
  }
2800
2829
  async getActionsForApp(e) {
2801
2830
  const t = await this.cache.httpGetJson(
2802
2831
  "/infra/public/json/sharing-rights.json"
2803
2832
  ), s = await this.getShareMapping(e);
2804
2833
  return Object.keys(t).map((i) => {
2805
- const u = t[i];
2834
+ const n = t[i];
2806
2835
  return {
2807
2836
  displayName: i,
2808
2837
  id: i,
2809
- priority: u.priority,
2810
- requires: u.requires
2838
+ priority: n.priority,
2839
+ requires: n.requires
2811
2840
  };
2812
2841
  }).filter((i) => {
2813
- var u;
2814
- return ((u = s[i.id]) == null ? void 0 : u.length) > 0;
2815
- }).sort((i, u) => i.priority - u.priority);
2842
+ var n;
2843
+ return ((n = s[i.id]) == null ? void 0 : n.length) > 0;
2844
+ }).sort((i, n) => i.priority - n.priority);
2816
2845
  }
2817
2846
  }
2818
2847
  const defaultMappers = {
@@ -2849,11 +2878,11 @@ const defaultMappers = {
2849
2878
  zip: function({ type: o }) {
2850
2879
  return o.indexOf("zip") !== -1 || o.indexOf("rar") !== -1 || o.indexOf("tar") !== -1 || o.indexOf("7z") !== -1;
2851
2880
  }
2852
- }, w = class w {
2881
+ }, C = class C {
2853
2882
  /* Similar role notion as in infra-front > workspace > Model.ts */
2854
2883
  static getRole(e) {
2855
2884
  var t, s;
2856
- return w.role(
2885
+ return C.role(
2857
2886
  (t = e.metadata) == null ? void 0 : t["content-type"],
2858
2887
  !1,
2859
2888
  (s = e.metadata) == null ? void 0 : s.extension
@@ -2865,18 +2894,18 @@ const defaultMappers = {
2865
2894
  this.roleMappers || console.warn("[DocumentHelper.role] should not have empty roles", this);
2866
2895
  const r = { type: e, previewRole: t, extension: s };
2867
2896
  for (const i of this.roleMappers) {
2868
- const u = i(r);
2869
- if (u)
2870
- return u;
2897
+ const n = i(r);
2898
+ if (n)
2899
+ return n;
2871
2900
  }
2872
2901
  return "unknown";
2873
2902
  }
2874
2903
  };
2875
2904
  // FIXME add edumedia support
2876
- n(w, "roleMappers", [
2905
+ u(C, "roleMappers", [
2877
2906
  (e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
2878
2907
  ]);
2879
- let DocumentHelper = w;
2908
+ let DocumentHelper = C;
2880
2909
  class WorkspaceService {
2881
2910
  constructor(e) {
2882
2911
  this.context = e;
@@ -2885,22 +2914,22 @@ class WorkspaceService {
2885
2914
  return this.context.http();
2886
2915
  }
2887
2916
  extractMetadata(e) {
2888
- const t = e.name || "", s = t.split("."), r = e.type || "application/octet-stream", i = s.length > 1 ? s[s.length - 1] : "", u = {
2917
+ const t = e.name || "", s = t.split("."), r = e.type || "application/octet-stream", i = s.length > 1 ? s[s.length - 1] : "", n = {
2889
2918
  "content-type": r,
2890
2919
  filename: t,
2891
2920
  size: e.size,
2892
2921
  extension: i,
2893
2922
  role: DocumentHelper.role(r, !1, i)
2894
- }, a = t.replace("." + u.extension, ""), c = u.extension ? a + "." + u.extension : a;
2895
- return { basename: a, fullname: c, metadata: u };
2923
+ }, a = t.replace("." + n.extension, ""), c = n.extension ? a + "." + n.extension : a;
2924
+ return { basename: a, fullname: c, metadata: n };
2896
2925
  }
2897
2926
  async saveFile(e, t) {
2898
2927
  const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
2899
2928
  i.append("file", e, s);
2900
- const u = [];
2901
- ((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") && u.push(`${t.visibility}=true`), t != null && t.application && u.push(`application=${t.application}`), r.role === "img" && u.push("quality=1"), t != null && t.parentId && u.push(`parentId=${t.parentId}`);
2929
+ const n = [];
2930
+ ((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") && n.push(`${t.visibility}=true`), t != null && t.application && n.push(`application=${t.application}`), r.role === "img" && n.push("quality=1"), t != null && t.parentId && n.push(`parentId=${t.parentId}`);
2902
2931
  const a = await this.http.postFile(
2903
- `/workspace/document?${u.join("&")}`,
2932
+ `/workspace/document?${n.join("&")}`,
2904
2933
  i
2905
2934
  );
2906
2935
  if (this.http.isResponseError())
@@ -2908,13 +2937,13 @@ class WorkspaceService {
2908
2937
  return a;
2909
2938
  }
2910
2939
  async updateFile(e, t, s) {
2911
- const { fullname: r, metadata: i } = this.extractMetadata(t), u = new FormData();
2912
- u.append("file", t, r);
2940
+ const { fullname: r, metadata: i } = this.extractMetadata(t), n = new FormData();
2941
+ n.append("file", t, r);
2913
2942
  const a = [];
2914
2943
  i.role === "img" && a.push("quality=1"), s != null && s.alt && a.push(`alt=${s.alt}`), s != null && s.legend && a.push(`legend=${s.legend}`), s != null && s.name && a.push(`name=${s.name}`);
2915
2944
  const c = await this.http.putFile(
2916
2945
  `/workspace/document/${e}?${a.join("&")}`,
2917
- u
2946
+ n
2918
2947
  );
2919
2948
  if (this.http.isResponseError())
2920
2949
  throw this.http.latestResponse.statusText;
@@ -2959,17 +2988,17 @@ class WorkspaceService {
2959
2988
  {
2960
2989
  application: t,
2961
2990
  visibility: s,
2962
- ids: r.map((u) => u._id)
2991
+ ids: r.map((n) => n._id)
2963
2992
  }
2964
2993
  );
2965
2994
  if (this.http.isResponseError())
2966
2995
  throw this.http.latestResponse.statusText;
2967
- return r.forEach((u, a) => {
2996
+ return r.forEach((n, a) => {
2968
2997
  const c = e.findIndex(
2969
- (h) => h._id === u._id
2998
+ (h) => h._id === n._id
2970
2999
  );
2971
3000
  0 <= c && c < e.length && (e[c] = i[a]);
2972
- }), e.filter((u) => !!u);
3001
+ }), e.filter((n) => !!n);
2973
3002
  }
2974
3003
  return e;
2975
3004
  }
@@ -2978,13 +3007,13 @@ class WorkspaceService {
2978
3007
  * or `null` if none exists or can be created.
2979
3008
  */
2980
3009
  getThumbnailUrl(e, t = 0, s = 0) {
2981
- var i, u;
3010
+ var i, n;
2982
3011
  const r = t > 0 || s > 0 ? `${t}x${s}` : "120x120";
2983
3012
  if (typeof e == "string")
2984
3013
  return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
2985
3014
  {
2986
3015
  const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
2987
- if ((u = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && u.includes("video")) {
3016
+ if ((n = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && n.includes("video")) {
2988
3017
  const h = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
2989
3018
  return h ? a + h : null;
2990
3019
  } else
@@ -3080,8 +3109,8 @@ class AnalyticsService {
3080
3109
  if (!r || !r.active) return;
3081
3110
  const i = await configure.Platform.apps.getPublicConf(e);
3082
3111
  if (!i) return;
3083
- const u = i.xiti;
3084
- if (!u || !u.LIBELLE_SERVICE || !r.UAI) return;
3112
+ const n = i.xiti;
3113
+ if (!n || !n.LIBELLE_SERVICE || !r.UAI) return;
3085
3114
  function a(h) {
3086
3115
  let l = "";
3087
3116
  for (let E = 0; E < h.length; E++)
@@ -3096,10 +3125,10 @@ class AnalyticsService {
3096
3125
  Guest: "AUTRE"
3097
3126
  };
3098
3127
  return {
3099
- LIBELLE_SERVICE: u.LIBELLE_SERVICE,
3128
+ LIBELLE_SERVICE: n.LIBELLE_SERVICE,
3100
3129
  // Which property of LIBELLE_SERVICE to use depends on the frontend.
3101
- TYPE: u.OUTIL ? "TIERS" : "NATIF",
3102
- OUTIL: u.OUTIL ? u.OUTIL : "",
3130
+ TYPE: n.OUTIL ? "TIERS" : "NATIF",
3131
+ OUTIL: n.OUTIL ? n.OUTIL : "",
3103
3132
  STRUCT_ID: r.collectiviteId,
3104
3133
  STRUCT_UAI: r.UAI,
3105
3134
  PROJET: r.projetId ? r.projetId : o.ID_PROJET,
@@ -3110,7 +3139,7 @@ class AnalyticsService {
3110
3139
  };
3111
3140
  }
3112
3141
  }
3113
- const C = class C {
3142
+ const w = class w {
3114
3143
  // in minutes. Applies to recorded videos.
3115
3144
  constructor(e) {
3116
3145
  this.context = e;
@@ -3128,11 +3157,11 @@ const C = class C {
3128
3157
  async getVideoConf() {
3129
3158
  var t;
3130
3159
  const e = await this.conf.getPublicConf(
3131
- APP$1.VIDEO
3160
+ APP$3.VIDEO
3132
3161
  );
3133
3162
  return {
3134
- maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? C.MAX_WEIGHT,
3135
- maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? C.MAX_DURATION,
3163
+ maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? w.MAX_WEIGHT,
3164
+ maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? w.MAX_DURATION,
3136
3165
  acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
3137
3166
  (s) => s.toUpperCase()
3138
3167
  )) ?? []
@@ -3153,13 +3182,13 @@ const C = class C {
3153
3182
  throw new Error("Invalid video file.");
3154
3183
  if (!e.filename)
3155
3184
  throw new Error("Invalid video filename");
3156
- const i = `${e.browser.name} ${e.browser.version}`, u = new FormData();
3157
- u.append("device", e.device || ""), u.append("browser", i), u.append("url", e.url), u.append("app", t), u.append("file", e.file, e.filename), u.append("weight", "" + e.file.size), u.append("captation", "" + s);
3185
+ const i = `${e.browser.name} ${e.browser.version}`, n = new FormData();
3186
+ n.append("device", e.device || ""), n.append("browser", i), n.append("url", e.url), n.append("app", t), n.append("file", e.file, e.filename), n.append("weight", "" + e.file.size), n.append("captation", "" + s);
3158
3187
  let a = `/video/encode?captation=${s}`;
3159
3188
  r && (a += `&duration=${r}`);
3160
3189
  const c = await this.http.post(
3161
3190
  a,
3162
- u,
3191
+ n,
3163
3192
  { headers: { "Content-Type": "multipart/form-data" } }
3164
3193
  );
3165
3194
  if (c.state == "running") {
@@ -3189,9 +3218,9 @@ const C = class C {
3189
3218
  throw new Error("Video cannot be uploaded.");
3190
3219
  }
3191
3220
  };
3192
- n(C, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
3193
- n(C, "MAX_DURATION", 3);
3194
- let VideoService = C;
3221
+ u(w, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
3222
+ u(w, "MAX_DURATION", 3);
3223
+ let VideoService = w;
3195
3224
  class EmbedderService {
3196
3225
  constructor(e) {
3197
3226
  this.context = e;
@@ -3227,9 +3256,9 @@ class EmbedderService {
3227
3256
  urlIsFromPattern(e, t) {
3228
3257
  const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
3229
3258
  let i = !0;
3230
- const u = t.match(s) || [], a = [];
3259
+ const n = t.match(s) || [], a = [];
3231
3260
  return (t.match(r) || []).forEach((h, l) => {
3232
- h.includes("ignore") || a.push(u[l]);
3261
+ h.includes("ignore") || a.push(n[l]);
3233
3262
  }), a.forEach((h) => {
3234
3263
  if (!e.includes(h)) {
3235
3264
  i = !1;
@@ -3260,7 +3289,7 @@ class EmbedderService {
3260
3289
  for (const s of e.url)
3261
3290
  if (this.urlIsFromPattern(t, s)) {
3262
3291
  const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
3263
- let u = e.embed;
3292
+ let n = e.embed;
3264
3293
  for (const a of i) {
3265
3294
  let c = s.split(a)[0];
3266
3295
  const h = c.split("}");
@@ -3271,9 +3300,9 @@ class EmbedderService {
3271
3300
  const E = s.split(a)[1].split("{")[0];
3272
3301
  E && (l = l.split(E)[0]);
3273
3302
  const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
3274
- u = u.replace(p, l);
3303
+ n = n.replace(p, l);
3275
3304
  }
3276
- return u;
3305
+ return n;
3277
3306
  }
3278
3307
  return "";
3279
3308
  }
@@ -3286,7 +3315,7 @@ class AbstractBehaviourService {
3286
3315
  //-----------------
3287
3316
  //--- Utilities ---
3288
3317
  //-----------------
3289
- n(this, "_cache");
3318
+ u(this, "_cache");
3290
3319
  this.context = e, this._cache = new CacheService(this.context);
3291
3320
  }
3292
3321
  getApplication() {
@@ -3320,8 +3349,8 @@ class AbstractBehaviourService {
3320
3349
  class ActualitesBehaviour extends AbstractBehaviourService {
3321
3350
  constructor() {
3322
3351
  super(...arguments);
3323
- n(this, "APP", "actualites");
3324
- n(this, "RESOURCE", "actualites");
3352
+ u(this, "APP", "actualites");
3353
+ u(this, "RESOURCE", "actualites");
3325
3354
  }
3326
3355
  async loadResources() {
3327
3356
  return (await this.httpGet(
@@ -3344,24 +3373,24 @@ class ActualitesBehaviour extends AbstractBehaviourService {
3344
3373
  class BlogBehaviour extends AbstractBehaviourService {
3345
3374
  constructor() {
3346
3375
  super(...arguments);
3347
- n(this, "APP", "blog");
3348
- n(this, "RESOURCE", "blog");
3376
+ u(this, "APP", "blog");
3377
+ u(this, "RESOURCE", "blog");
3349
3378
  }
3350
3379
  loadResources() {
3351
3380
  return new Promise(async (t, s) => {
3352
3381
  try {
3353
3382
  const r = await this.httpGet("/blog/linker"), i = [];
3354
- r.forEach((u) => {
3355
- u.thumbnail ? u.thumbnail = u.thumbnail + "?thumbnail=48x48" : u.thumbnail = "/img/illustrations/blog.svg";
3356
- const a = u.fetchPosts.map((c) => this.dataToResource({
3357
- owner: u.author.userId,
3358
- ownerName: u.author.username,
3359
- title: c.title + " [" + u.title + "]",
3360
- _id: `${u._id}#${c._id}`,
3361
- icon: u.thumbnail,
3362
- path: `/blog/id/${u._id}/post/${c._id}`,
3363
- shared: !!(u.shared && u.shared.length >= 0),
3364
- modified: u.modified
3383
+ r.forEach((n) => {
3384
+ n.thumbnail ? n.thumbnail = n.thumbnail + "?thumbnail=48x48" : n.thumbnail = "/img/illustrations/blog.svg";
3385
+ const a = n.fetchPosts.map((c) => this.dataToResource({
3386
+ owner: n.author.userId,
3387
+ ownerName: n.author.username,
3388
+ title: c.title + " [" + n.title + "]",
3389
+ _id: `${n._id}#${c._id}`,
3390
+ icon: n.thumbnail,
3391
+ path: `/blog/id/${n._id}/post/${c._id}`,
3392
+ shared: !!(n.shared && n.shared.length >= 0),
3393
+ modified: n.modified
3365
3394
  }));
3366
3395
  i.push(...a);
3367
3396
  }), t(i);
@@ -3374,8 +3403,8 @@ class BlogBehaviour extends AbstractBehaviourService {
3374
3403
  class CollaborativewallBehaviour extends AbstractBehaviourService {
3375
3404
  constructor() {
3376
3405
  super(...arguments);
3377
- n(this, "APP", "collaborativewall");
3378
- n(this, "RESOURCE", "collaborativewall");
3406
+ u(this, "APP", "collaborativewall");
3407
+ u(this, "RESOURCE", "collaborativewall");
3379
3408
  }
3380
3409
  async loadResources() {
3381
3410
  return (await this.httpGet(
@@ -3397,8 +3426,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
3397
3426
  class CommunityBehaviour extends AbstractBehaviourService {
3398
3427
  constructor() {
3399
3428
  super(...arguments);
3400
- n(this, "APP", "community");
3401
- n(this, "RESOURCE", "community");
3429
+ u(this, "APP", "community");
3430
+ u(this, "RESOURCE", "community");
3402
3431
  }
3403
3432
  async loadResources() {
3404
3433
  return (await this.httpGet(
@@ -3422,24 +3451,24 @@ class CommunityBehaviour extends AbstractBehaviourService {
3422
3451
  class ExercizerBehaviour extends AbstractBehaviourService {
3423
3452
  constructor() {
3424
3453
  super(...arguments);
3425
- n(this, "APP", "exercizer");
3426
- n(this, "RESOURCE", "exercizer");
3454
+ u(this, "APP", "exercizer");
3455
+ u(this, "RESOURCE", "exercizer");
3427
3456
  }
3428
3457
  async loadResources() {
3429
3458
  return (await this.httpGet(
3430
3459
  "/exercizer/subjects-scheduled"
3431
3460
  )).map((s) => {
3432
3461
  const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
3433
- let i, u = !1;
3462
+ let i, n = !1;
3434
3463
  const a = JSON.parse(s.scheduled_at);
3435
- return a.groupList.length > 0 ? (u = !0, i = a.groupList[0].name) : a.userList.length > 0 ? (u = !0, i = a.userList[0].name) : i = "", a.groupList.length + a.userList.length > 1 && (i += "..."), this.dataToResource({
3464
+ return a.groupList.length > 0 ? (n = !0, i = a.groupList[0].name) : a.userList.length > 0 ? (n = !0, i = a.userList[0].name) : i = "", a.groupList.length + a.userList.length > 1 && (i += "..."), this.dataToResource({
3436
3465
  title: s.title,
3437
3466
  owner: s.owner,
3438
3467
  ownerName: i,
3439
3468
  icon: r,
3440
3469
  path: "/exercizer#/linker/" + s.id,
3441
3470
  _id: "" + s.id,
3442
- shared: u,
3471
+ shared: n,
3443
3472
  modified: s.modified
3444
3473
  });
3445
3474
  });
@@ -3448,8 +3477,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
3448
3477
  class FormulaireBehaviour extends AbstractBehaviourService {
3449
3478
  constructor() {
3450
3479
  super(...arguments);
3451
- n(this, "APP", "formulaire");
3452
- n(this, "RESOURCE", "formulaire");
3480
+ u(this, "APP", "formulaire");
3481
+ u(this, "RESOURCE", "formulaire");
3453
3482
  }
3454
3483
  async loadResources() {
3455
3484
  return (await this.httpGet(
@@ -3469,8 +3498,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
3469
3498
  class ForumBehaviour extends AbstractBehaviourService {
3470
3499
  constructor() {
3471
3500
  super(...arguments);
3472
- n(this, "APP", "forum");
3473
- n(this, "RESOURCE", "forum");
3501
+ u(this, "APP", "forum");
3502
+ u(this, "RESOURCE", "forum");
3474
3503
  }
3475
3504
  async loadResources() {
3476
3505
  return (await this.httpGet("/forum/categories")).map(
@@ -3490,8 +3519,8 @@ class ForumBehaviour extends AbstractBehaviourService {
3490
3519
  class HomeworksBehaviour extends AbstractBehaviourService {
3491
3520
  constructor() {
3492
3521
  super(...arguments);
3493
- n(this, "APP", "homeworks");
3494
- n(this, "RESOURCE", "homeworks");
3522
+ u(this, "APP", "homeworks");
3523
+ u(this, "RESOURCE", "homeworks");
3495
3524
  }
3496
3525
  async loadResources() {
3497
3526
  return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
@@ -3509,8 +3538,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
3509
3538
  class MagnetoBehaviour extends AbstractBehaviourService {
3510
3539
  constructor() {
3511
3540
  super(...arguments);
3512
- n(this, "APP", "magneto");
3513
- n(this, "RESOURCE", "magneto");
3541
+ u(this, "APP", "magneto");
3542
+ u(this, "RESOURCE", "magneto");
3514
3543
  }
3515
3544
  async loadResources() {
3516
3545
  const { all: t } = await this.httpGet(
@@ -3531,8 +3560,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
3531
3560
  class MindmapBehaviour extends AbstractBehaviourService {
3532
3561
  constructor() {
3533
3562
  super(...arguments);
3534
- n(this, "APP", "mindmap");
3535
- n(this, "RESOURCE", "mindmap");
3563
+ u(this, "APP", "mindmap");
3564
+ u(this, "RESOURCE", "mindmap");
3536
3565
  }
3537
3566
  async loadResources() {
3538
3567
  return (await this.httpGet("/mindmap/list/all")).map(
@@ -3552,13 +3581,13 @@ class MindmapBehaviour extends AbstractBehaviourService {
3552
3581
  class PagesBehaviour extends AbstractBehaviourService {
3553
3582
  constructor() {
3554
3583
  super(...arguments);
3555
- n(this, "APP", "pages");
3556
- n(this, "RESOURCE", "pages");
3584
+ u(this, "APP", "pages");
3585
+ u(this, "RESOURCE", "pages");
3557
3586
  }
3558
3587
  async loadResources() {
3559
3588
  const t = await this.httpGet("/pages/list/all"), s = [];
3560
3589
  return t.forEach((r) => {
3561
- var u;
3590
+ var n;
3562
3591
  const i = r.thumbnail ? r.thumbnail + "?thumbnail=48x48" : "/img/illustrations/pages.svg";
3563
3592
  s.push(
3564
3593
  this.dataToResource({
@@ -3571,7 +3600,7 @@ class PagesBehaviour extends AbstractBehaviourService {
3571
3600
  shared: typeof r.shared < "u",
3572
3601
  modified: r.modified
3573
3602
  })
3574
- ), (u = r.pages) == null || u.forEach((a) => {
3603
+ ), (n = r.pages) == null || n.forEach((a) => {
3575
3604
  s.push(
3576
3605
  this.dataToResource({
3577
3606
  title: a.title,
@@ -3591,8 +3620,8 @@ class PagesBehaviour extends AbstractBehaviourService {
3591
3620
  class PollBehaviour extends AbstractBehaviourService {
3592
3621
  constructor() {
3593
3622
  super(...arguments);
3594
- n(this, "APP", "poll");
3595
- n(this, "RESOURCE", "poll");
3623
+ u(this, "APP", "poll");
3624
+ u(this, "RESOURCE", "poll");
3596
3625
  }
3597
3626
  async loadResources() {
3598
3627
  return (await this.httpGet("/poll/list/all")).map((s) => {
@@ -3613,8 +3642,8 @@ class PollBehaviour extends AbstractBehaviourService {
3613
3642
  class ScrapbookBehaviour extends AbstractBehaviourService {
3614
3643
  constructor() {
3615
3644
  super(...arguments);
3616
- n(this, "APP", "scrapbook");
3617
- n(this, "RESOURCE", "scrapbook");
3645
+ u(this, "APP", "scrapbook");
3646
+ u(this, "RESOURCE", "scrapbook");
3618
3647
  }
3619
3648
  async loadResources() {
3620
3649
  return (await this.httpGet(
@@ -3637,25 +3666,25 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
3637
3666
  class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3638
3667
  constructor() {
3639
3668
  super(...arguments);
3640
- n(this, "APP", "timelinegenerator");
3641
- n(this, "RESOURCE", "timelinegenerator");
3669
+ u(this, "APP", "timelinegenerator");
3670
+ u(this, "RESOURCE", "timelinegenerator");
3642
3671
  }
3643
3672
  loadResources() {
3644
3673
  return new Promise(async (t, s) => {
3645
3674
  try {
3646
3675
  const i = (await this.httpGet(
3647
3676
  "/timelinegenerator/timelines"
3648
- )).map((u) => {
3649
- const a = u.icon || "/img/illustrations/timeline-default.png";
3677
+ )).map((n) => {
3678
+ const a = n.icon || "/img/illustrations/timeline-default.png";
3650
3679
  return this.dataToResource({
3651
- title: u.headline,
3652
- ownerName: u.owner.displayName,
3653
- owner: u.owner.userId,
3680
+ title: n.headline,
3681
+ ownerName: n.owner.displayName,
3682
+ owner: n.owner.userId,
3654
3683
  icon: a,
3655
- path: "/timelinegenerator#/view/" + u._id,
3656
- _id: u._id,
3657
- shared: typeof u.shared < "u",
3658
- modified: u.modified
3684
+ path: "/timelinegenerator#/view/" + n._id,
3685
+ _id: n._id,
3686
+ shared: typeof n.shared < "u",
3687
+ modified: n.modified
3659
3688
  });
3660
3689
  });
3661
3690
  t(i);
@@ -3668,8 +3697,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3668
3697
  class WikiBehaviour extends AbstractBehaviourService {
3669
3698
  constructor() {
3670
3699
  super(...arguments);
3671
- n(this, "APP", "wiki");
3672
- n(this, "RESOURCE", "wiki");
3700
+ u(this, "APP", "wiki");
3701
+ u(this, "RESOURCE", "wiki");
3673
3702
  }
3674
3703
  async loadResources() {
3675
3704
  return (await this.httpGet(
@@ -3692,15 +3721,15 @@ class WikiBehaviour extends AbstractBehaviourService {
3692
3721
  class WorkspaceBehaviour extends AbstractBehaviourService {
3693
3722
  constructor() {
3694
3723
  super(...arguments);
3695
- n(this, "APP", "workspace");
3696
- n(this, "RESOURCE", "workspace");
3724
+ u(this, "APP", "workspace");
3725
+ u(this, "RESOURCE", "workspace");
3697
3726
  }
3698
3727
  loadResources({ search: t, asset_id: s }) {
3699
3728
  return new Promise(async (r, i) => {
3700
3729
  try {
3701
- let u = "/workspace/documents?filter=all&hierarchical=true";
3702
- s && s.length ? u += `&search=${t}` : t && t.length && (u += `&search=${t}`);
3703
- const c = (await this.httpGet(u)).filter((h) => !h.deleted).map((h) => {
3730
+ let n = "/workspace/documents?filter=all&hierarchical=true";
3731
+ s && s.length ? n += `&search=${t}` : t && t.length && (n += `&search=${t}`);
3732
+ const c = (await this.httpGet(n)).filter((h) => !h.deleted).map((h) => {
3704
3733
  const l = h.metadata["content-type"] && h.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${h._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
3705
3734
  return this.dataToResource({
3706
3735
  title: h.name,
@@ -3714,8 +3743,8 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
3714
3743
  });
3715
3744
  });
3716
3745
  r(c);
3717
- } catch (u) {
3718
- i(u);
3746
+ } catch (n) {
3747
+ i(n);
3719
3748
  }
3720
3749
  });
3721
3750
  }
@@ -3731,7 +3760,7 @@ const y = class y {
3731
3760
  e.session().getUser()
3732
3761
  ]);
3733
3762
  i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
3734
- (u) => i.apps.some((a) => a.address.includes(u))
3763
+ (n) => i.apps.some((a) => a.address.includes(n))
3735
3764
  ));
3736
3765
  } catch (r) {
3737
3766
  console.warn("Failed to load resource-producing apps:", r);
@@ -3808,13 +3837,13 @@ const y = class y {
3808
3837
  //
3809
3838
  // STATIC REGISTRY
3810
3839
  //
3811
- n(y, "registry", new ServiceRegistry()), // Expose some useful functions
3812
- n(y, "findBehaviour", y.registry.findService.bind(y.registry)), n(y, "hasBehaviour", y.registry.isRegistered.bind(y.registry)), n(y, "resourceProducingApps", []);
3840
+ u(y, "registry", new ServiceRegistry()), // Expose some useful functions
3841
+ u(y, "findBehaviour", y.registry.findService.bind(y.registry)), u(y, "hasBehaviour", y.registry.isRegistered.bind(y.registry)), u(y, "resourceProducingApps", []);
3813
3842
  let SnipletsService = y;
3814
3843
  const SEND_ALL = "*";
3815
3844
  class WebBroker {
3816
3845
  constructor(e) {
3817
- n(this, "subscription");
3846
+ u(this, "subscription");
3818
3847
  this.odeServices = e;
3819
3848
  }
3820
3849
  get http() {
@@ -3846,10 +3875,10 @@ class WebBroker {
3846
3875
  }
3847
3876
  class DataService {
3848
3877
  constructor(e) {
3849
- n(this, "_webBroker");
3850
- n(this, "app");
3851
- n(this, "user");
3852
- n(this, "profile");
3878
+ u(this, "_webBroker");
3879
+ u(this, "app");
3880
+ u(this, "user");
3881
+ u(this, "profile");
3853
3882
  this.odeServices = e;
3854
3883
  }
3855
3884
  get conf() {
@@ -3883,12 +3912,12 @@ class DataService {
3883
3912
  addUserInfos(e) {
3884
3913
  return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
3885
3914
  }
3886
- trackVideoSave(e, t, s, r, i, u, a) {
3915
+ trackVideoSave(e, t, s, r, i, n, a) {
3887
3916
  const c = this.addUserInfos({
3888
3917
  "event-type": "VIDEO_SAVE",
3889
3918
  module: "video",
3890
3919
  video_id: e,
3891
- browser: u,
3920
+ browser: n,
3892
3921
  duration: Math.round(t),
3893
3922
  weight: s,
3894
3923
  source: r ? "CAPTURED" : "UPLOADED",
@@ -3897,7 +3926,7 @@ class DataService {
3897
3926
  this.app && (c["override-module"] = this.app), a && (c.device_type = a), this.trackWebEvent(c);
3898
3927
  }
3899
3928
  trackVideoRead(e, t, s, r, i) {
3900
- const u = this.addUserInfos({
3929
+ const n = this.addUserInfos({
3901
3930
  "event-type": "VIDEO_READ",
3902
3931
  module: "video",
3903
3932
  video_id: e,
@@ -3905,7 +3934,7 @@ class DataService {
3905
3934
  source: t ? "CAPTURED" : "UPLOADED",
3906
3935
  url: s
3907
3936
  });
3908
- this.app && (u["override-module"] = this.app), i && (u.device_type = i), this.trackWebEvent(u);
3937
+ this.app && (n["override-module"] = this.app), i && (n.device_type = i), this.trackWebEvent(n);
3909
3938
  }
3910
3939
  trackSpeechAndText(e) {
3911
3940
  const t = this.addUserInfos({
@@ -4011,20 +4040,20 @@ class AudienceService {
4011
4040
  }
4012
4041
  class OdeServices {
4013
4042
  constructor() {
4014
- n(this, "_analytics");
4015
- n(this, "_cache");
4016
- n(this, "_conf");
4017
- n(this, "_data");
4018
- n(this, "_directory");
4019
- n(this, "_http");
4020
- n(this, "_idiom");
4021
- n(this, "_notify");
4022
- n(this, "_rights");
4023
- n(this, "_session");
4024
- n(this, "_share");
4025
- n(this, "_video");
4026
- n(this, "_workspace");
4027
- n(this, "_embedder");
4043
+ u(this, "_analytics");
4044
+ u(this, "_cache");
4045
+ u(this, "_conf");
4046
+ u(this, "_data");
4047
+ u(this, "_directory");
4048
+ u(this, "_http");
4049
+ u(this, "_idiom");
4050
+ u(this, "_notify");
4051
+ u(this, "_rights");
4052
+ u(this, "_session");
4053
+ u(this, "_share");
4054
+ u(this, "_video");
4055
+ u(this, "_workspace");
4056
+ u(this, "_embedder");
4028
4057
  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);
4029
4058
  }
4030
4059
  initialize() {
@@ -4226,10 +4255,10 @@ const isActionAvailable = (o, e) => {
4226
4255
  class WidgetFramework {
4227
4256
  constructor() {
4228
4257
  //-------------------------------------
4229
- n(this, "_initialized");
4230
- n(this, "_widgets", []);
4258
+ u(this, "_initialized");
4259
+ u(this, "_widgets", []);
4231
4260
  ////////////////////////////////////// USER PREFERENCES
4232
- n(this, "_userPrefs", {});
4261
+ u(this, "_userPrefs", {});
4233
4262
  }
4234
4263
  initialize(e, t) {
4235
4264
  return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
@@ -4240,8 +4269,8 @@ class WidgetFramework {
4240
4269
  var i;
4241
4270
  (i = this._initialized) == null || i.resolve();
4242
4271
  }).catch((i) => {
4243
- var u;
4244
- (u = this._initialized) == null || u.reject();
4272
+ var n;
4273
+ (n = this._initialized) == null || n.reject();
4245
4274
  })) : (r = this._initialized) == null || r.reject();
4246
4275
  })), this._initialized.promise;
4247
4276
  }
@@ -4282,9 +4311,9 @@ class WidgetFramework {
4282
4311
  position: c.platformConf.position
4283
4312
  }), c.platformConf.mandatory && (this._userPrefs[l].show = !0, this._userPrefs[l].index = defaultWidgetOrder[l] ?? 999), c.platformConf.i18n && s.push(c.platformConf.i18n), c.applyUserPref(this._userPrefs[l]), !0);
4284
4313
  });
4285
- const u = new Idiom();
4314
+ const n = new Idiom();
4286
4315
  this._widgets = this._widgets.sort((c, h) => {
4287
- const l = u.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = u.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
4316
+ const l = n.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = n.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
4288
4317
  return l < E ? -1 : l > E ? 1 : 0;
4289
4318
  });
4290
4319
  });
@@ -4293,8 +4322,8 @@ class WidgetFramework {
4293
4322
  class Widget {
4294
4323
  //-------------------------------------
4295
4324
  constructor(e) {
4296
- n(this, "_schoolConf", {});
4297
- n(this, "_userPref");
4325
+ u(this, "_schoolConf", {});
4326
+ u(this, "_userPref");
4298
4327
  this._platformConf = e, this._userPref = null;
4299
4328
  }
4300
4329
  get platformConf() {
@@ -4353,7 +4382,7 @@ class WidgetFrameworkFactory {
4353
4382
  }
4354
4383
  export {
4355
4384
  ACTION,
4356
- APP$1 as APP,
4385
+ APP$3 as APP,
4357
4386
  BOOLEAN_FILTER,
4358
4387
  ConfigurationFrameworkFactory,
4359
4388
  DocumentHelper,