@edifice.io/client 2.5.9-develop-b2school.20260212120233 → 2.5.9-develop-pedago.20260213101441

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,8 +1,9 @@
1
1
  var T = Object.defineProperty;
2
- var P = (u, e, t) => e in u ? T(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
3
- var n = (u, e, t) => P(u, typeof e != "symbol" ? e + "" : e, t);
2
+ var P = (n, e, t) => e in n ? T(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var u = (n, e, t) => P(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import axios from "axios";
5
5
  import { MimeTypeUtils } from "@edifice.io/utilities";
6
+ import { UAParser } from "ua-parser-js";
6
7
  const ERROR_CODE = {
7
8
  SUCCESS: "0000",
8
9
  UNKNOWN: "0010",
@@ -97,10 +98,10 @@ const ERROR_CODE = {
97
98
  INFOTIP: "infotip",
98
99
  RGPD_COOKIES: "rgpdCookies"
99
100
  // TODO compléter
100
- }, R = class R {
101
+ }, C = class C {
101
102
  constructor(e) {
102
- n(this, "name");
103
- n(this, "listeners", /* @__PURE__ */ new Set());
103
+ u(this, "name");
104
+ u(this, "listeners", /* @__PURE__ */ new Set());
104
105
  this.name = e;
105
106
  }
106
107
  /**
@@ -109,8 +110,8 @@ const ERROR_CODE = {
109
110
  * @returns the channel instance
110
111
  */
111
112
  static getChannel(e) {
112
- let t = R.channels.get(e);
113
- return t || (t = new R(e), R.channels.set(e, t)), t;
113
+ let t = C.channels.get(e);
114
+ return t || (t = new C(e), C.channels.set(e, t)), t;
114
115
  }
115
116
  /**
116
117
  * Add a listener and return a revocation function to remove it.
@@ -135,14 +136,14 @@ const ERROR_CODE = {
135
136
  * Close this channel: remove listeners and unregister from global map.
136
137
  */
137
138
  close() {
138
- this.listeners.clear(), R.channels.delete(this.name);
139
+ this.listeners.clear(), C.channels.delete(this.name);
139
140
  }
140
141
  };
141
- n(R, "channels", /* @__PURE__ */ new Map());
142
- let SimpleChannel = R;
142
+ u(C, "channels", /* @__PURE__ */ new Map());
143
+ let SimpleChannel = C;
143
144
  class Subscription {
144
145
  constructor(e, t) {
145
- n(this, "revoke");
146
+ u(this, "revoke");
146
147
  this._channel = e, this.revoke = this.setReceiver((s) => t == null ? void 0 : t(s));
147
148
  }
148
149
  setReceiver(e) {
@@ -159,7 +160,7 @@ class Subject {
159
160
  /* We maintain channels for sending messages.
160
161
  * Receiving channels are instantiated per subscription.
161
162
  */
162
- n(this, "publishChannels", /* @__PURE__ */ new Map());
163
+ u(this, "publishChannels", /* @__PURE__ */ new Map());
163
164
  }
164
165
  getChannelName(e) {
165
166
  return "Subject:" + e;
@@ -194,9 +195,9 @@ const ASYNC_DATA_NAME = {
194
195
  class Promisified {
195
196
  constructor() {
196
197
  //-------------------------------------
197
- n(this, "_resolution");
198
- n(this, "_rejection");
199
- n(this, "_promise", new Promise((e, t) => {
198
+ u(this, "_resolution");
199
+ u(this, "_rejection");
200
+ u(this, "_promise", new Promise((e, t) => {
200
201
  this._resolution = e, this._rejection = t;
201
202
  }));
202
203
  }
@@ -213,8 +214,8 @@ class Promisified {
213
214
  class NotifyFramework {
214
215
  constructor() {
215
216
  //-------------------------------------
216
- n(this, "promises", {});
217
- n(this, "subject", new Subject());
217
+ u(this, "promises", {});
218
+ u(this, "subject", new Subject());
218
219
  }
219
220
  asyncData(e) {
220
221
  return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
@@ -245,8 +246,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
245
246
  class Http {
246
247
  constructor(e) {
247
248
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
248
- n(this, "axios");
249
- n(this, "_latestResponse");
249
+ u(this, "axios");
250
+ u(this, "_latestResponse");
250
251
  this.axios = axios.create(e);
251
252
  }
252
253
  setCdn(e) {
@@ -343,7 +344,7 @@ class Http {
343
344
  }
344
345
  class TransportFramework {
345
346
  constructor() {
346
- n(this, "_http", new Http());
347
+ u(this, "_http", new Http());
347
348
  }
348
349
  get http() {
349
350
  return this._http;
@@ -362,11 +363,11 @@ class ConfigurationFrameworkFactory {
362
363
  const http$2 = transport.http;
363
364
  class Session {
364
365
  constructor() {
365
- n(this, "_me", null);
366
- n(this, "_currentLanguage", "");
367
- n(this, "_notLoggedIn", !0);
368
- n(this, "_description");
369
- n(this, "_profile");
366
+ u(this, "_me", null);
367
+ u(this, "_currentLanguage", "");
368
+ u(this, "_notLoggedIn", !0);
369
+ u(this, "_description");
370
+ u(this, "_profile");
370
371
  }
371
372
  get currentLanguage() {
372
373
  return this._currentLanguage;
@@ -484,7 +485,7 @@ class Session {
484
485
  }
485
486
  class SessionFramework {
486
487
  constructor() {
487
- n(this, "session", new Session());
488
+ u(this, "session", new Session());
488
489
  }
489
490
  initialize() {
490
491
  return this.session.initialize();
@@ -508,22 +509,22 @@ class SessionFramework {
508
509
  const session = new SessionFramework();
509
510
  class Theme {
510
511
  constructor() {
511
- n(this, "_conf");
512
- n(this, "_loaded");
512
+ u(this, "_conf");
513
+ u(this, "_loaded");
513
514
  // legacy (readonly)
514
- n(this, "skinName", "");
515
- n(this, "themeName", "");
516
- n(this, "skin", "raw");
517
- n(this, "themeUrl", "/assets/themes/raw/default/");
518
- n(this, "templateOverrides", {});
519
- n(this, "portalTemplate", "/assets/themes/raw/portal.html");
520
- n(this, "basePath", "");
521
- n(this, "logoutCallback", "");
522
- n(this, "skins", []);
523
- n(this, "is1D", !1);
524
- n(this, "is2D", !1);
525
- n(this, "_onSkinReady", notify.onSkinReady());
526
- n(this, "_onOverrideReady", notify.onOverridesReady());
515
+ u(this, "skinName", "");
516
+ u(this, "themeName", "");
517
+ u(this, "skin", "raw");
518
+ u(this, "themeUrl", "/assets/themes/raw/default/");
519
+ u(this, "templateOverrides", {});
520
+ u(this, "portalTemplate", "/assets/themes/raw/portal.html");
521
+ u(this, "basePath", "");
522
+ u(this, "logoutCallback", "");
523
+ u(this, "skins", []);
524
+ u(this, "is1D", !1);
525
+ u(this, "is2D", !1);
526
+ u(this, "_onSkinReady", notify.onSkinReady());
527
+ u(this, "_onOverrideReady", notify.onOverridesReady());
527
528
  }
528
529
  initialize(e) {
529
530
  return notify.onSessionReady().promise.then(() => this.load(e));
@@ -895,7 +896,7 @@ class Idiom {
895
896
  class UserPreferences {
896
897
  constructor() {
897
898
  //-------------------------------------
898
- n(this, "data", {});
899
+ u(this, "data", {});
899
900
  }
900
901
  get(e) {
901
902
  return this.data[e];
@@ -922,10 +923,10 @@ class UserPreferences {
922
923
  class User {
923
924
  constructor() {
924
925
  //-------------------------------------
925
- n(this, "_me", null);
926
- n(this, "_keepOpenOnLogout", !1);
927
- n(this, "_preferences", new UserPreferences());
928
- n(this, "_bookmarkedApps", []);
926
+ u(this, "_me", null);
927
+ u(this, "_keepOpenOnLogout", !1);
928
+ u(this, "_preferences", new UserPreferences());
929
+ u(this, "_bookmarkedApps", []);
929
930
  }
930
931
  get keepOpenOnLogout() {
931
932
  return this._keepOpenOnLogout;
@@ -999,9 +1000,9 @@ const http$1 = transport == null ? void 0 : transport.http;
999
1000
  class AppConf {
1000
1001
  constructor() {
1001
1002
  //-------------------------------------
1002
- n(this, "_publicConf", {});
1003
- n(this, "_currentApp");
1004
- n(this, "_appConf", {});
1003
+ u(this, "_publicConf", {});
1004
+ u(this, "_currentApp");
1005
+ u(this, "_appConf", {});
1005
1006
  }
1006
1007
  /**
1007
1008
  * Get the currently initialized App.
@@ -1039,8 +1040,8 @@ class AppConf {
1039
1040
  class Analytics {
1040
1041
  constructor() {
1041
1042
  //-------------------------------------
1042
- n(this, "_status", "void");
1043
- n(this, "_params");
1043
+ u(this, "_status", "void");
1044
+ u(this, "_params");
1044
1045
  }
1045
1046
  get status() {
1046
1047
  return this._status;
@@ -1122,10 +1123,56 @@ class Analytics {
1122
1123
  };
1123
1124
  }
1124
1125
  }
1126
+ function setCookie(n, e) {
1127
+ if (typeof document > "u") return;
1128
+ const t = location.protocol === "https:" ? "; Secure" : "";
1129
+ document.cookie = `${n}=${encodeURIComponent(e)}; path=/; SameSite=Strict${t}`;
1130
+ }
1131
+ function getCookie(n) {
1132
+ if (typeof document > "u") return null;
1133
+ const e = document.cookie.match(new RegExp("(^| )" + n + "=([^;]+)"));
1134
+ if (e)
1135
+ try {
1136
+ return decodeURIComponent(e[2]);
1137
+ } catch {
1138
+ return e[2];
1139
+ }
1140
+ return null;
1141
+ }
1142
+ function isPad() {
1143
+ return typeof window < "u" && "ongesturechange" in window;
1144
+ }
1145
+ function detectDevice() {
1146
+ if (typeof window > "u")
1147
+ return { osName: "", osVersion: "", deviceType: "", deviceName: "" };
1148
+ const n = UAParser(), e = isPad(), t = n.device.vendor || "", s = n.device.model || "", r = t && s ? `${t} ${s}` : s || t || "Unknown";
1149
+ let i = n.os.name || "Unknown", o = n.device.type || (e ? "tablet" : "desktop"), a = r;
1150
+ return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet", a = "iPad"), {
1151
+ osName: i,
1152
+ osVersion: n.os.version || "Unknown",
1153
+ deviceType: o,
1154
+ deviceName: a
1155
+ };
1156
+ }
1157
+ function readDeviceCookies() {
1158
+ const n = getCookie("osName"), e = getCookie("osVersion"), t = getCookie("deviceType"), s = getCookie("deviceName");
1159
+ return n && e && t && s ? { osName: n, osVersion: e, deviceType: t, deviceName: s } : null;
1160
+ }
1161
+ function setDeviceCookies() {
1162
+ try {
1163
+ const n = readDeviceCookies();
1164
+ if (n != null)
1165
+ return n;
1166
+ const e = detectDevice();
1167
+ return setCookie("osName", e.osName), setCookie("osVersion", e.osVersion), setCookie("deviceType", e.deviceType), setCookie("deviceName", e.deviceName), e;
1168
+ } catch (n) {
1169
+ return console.warn("Device detection failed, using Unknown values:", n), { osName: "Unknown", osVersion: "Unknown", deviceType: "Unknown", deviceName: "Unknown" };
1170
+ }
1171
+ }
1125
1172
  class ConfigurationFramework {
1126
1173
  constructor() {
1127
1174
  //-------------------------------------
1128
- n(this, "Platform", {
1175
+ u(this, "Platform", {
1129
1176
  deploymentTag: "",
1130
1177
  cdnDomain: "",
1131
1178
  apps: new AppConf(),
@@ -1134,10 +1181,11 @@ class ConfigurationFramework {
1134
1181
  idiom: new Idiom(),
1135
1182
  listLanguages: () => transport.http.get("/languages")
1136
1183
  });
1137
- n(this, "School", {
1184
+ u(this, "School", {
1138
1185
  //apps; -> pinnedApps;
1139
1186
  });
1140
- n(this, "User", new User());
1187
+ u(this, "User", new User());
1188
+ setDeviceCookies();
1141
1189
  }
1142
1190
  async initialize(e, t) {
1143
1191
  if (!e) {
@@ -1180,12 +1228,12 @@ class ConfigurationFramework {
1180
1228
  // }
1181
1229
  }
1182
1230
  const configure = new ConfigurationFramework(), http = transport == null ? void 0 : transport.http;
1183
- var v;
1184
- const me = (v = session == null ? void 0 : session.session) == null ? void 0 : v.user;
1231
+ var D;
1232
+ const me = (D = session == null ? void 0 : session.session) == null ? void 0 : D.user;
1185
1233
  class Notification {
1186
1234
  constructor(e) {
1187
- n(this, "_id");
1188
- n(this, "model");
1235
+ u(this, "_id");
1236
+ u(this, "model");
1189
1237
  e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
1190
1238
  }
1191
1239
  isUnread() {
@@ -1205,14 +1253,14 @@ class Notification {
1205
1253
  class TimelineApp {
1206
1254
  constructor() {
1207
1255
  //-------------------------------------
1208
- n(this, "_notifications", []);
1209
- n(this, "_notificationTypes", []);
1256
+ u(this, "_notifications", []);
1257
+ u(this, "_notificationTypes", []);
1210
1258
  // ex: ["BLOG"]
1211
- n(this, "_flashMessages", []);
1212
- n(this, "_pageNumber", 0);
1213
- n(this, "_lastPage", !1);
1214
- n(this, "_loading", !1);
1215
- n(this, "showMine", !1);
1259
+ u(this, "_flashMessages", []);
1260
+ u(this, "_pageNumber", 0);
1261
+ u(this, "_lastPage", !1);
1262
+ u(this, "_loading", !1);
1263
+ u(this, "showMine", !1);
1216
1264
  }
1217
1265
  get notifications() {
1218
1266
  return this._notifications;
@@ -1361,7 +1409,7 @@ const m = class m {
1361
1409
  //
1362
1410
  // PROTECTED HELPERS
1363
1411
  //
1364
- n(this, "checkHttpResponse", (e) => {
1412
+ u(this, "checkHttpResponse", (e) => {
1365
1413
  if (this.http.latestResponse.status >= 300)
1366
1414
  throw this.http.latestResponse.statusText;
1367
1415
  return e;
@@ -1579,8 +1627,8 @@ const m = class m {
1579
1627
  //
1580
1628
  // STATIC REGISTRY
1581
1629
  //
1582
- n(m, "registry", new ServiceRegistry()), // Expose some useful functions
1583
- n(m, "register", m.registry.register.bind(m.registry)), n(m, "findService", m.registry.findService.bind(m.registry)), n(m, "findMainService", m.registry.findMainService.bind(m.registry)), n(m, "isRegistered", m.registry.isRegistered.bind(m.registry));
1630
+ u(m, "registry", new ServiceRegistry()), // Expose some useful functions
1631
+ u(m, "register", m.registry.register.bind(m.registry)), u(m, "findService", m.registry.findService.bind(m.registry)), u(m, "findMainService", m.registry.findMainService.bind(m.registry)), u(m, "isRegistered", m.registry.isRegistered.bind(m.registry));
1584
1632
  let ResourceService = m;
1585
1633
  const APP$3 = "scrapbook", RESOURCE$3 = "scrapbook";
1586
1634
  class ScrapbookResourceService extends ResourceService {
@@ -1623,7 +1671,7 @@ class ScrapbookResourceService extends ResourceService {
1623
1671
  }
1624
1672
  ResourceService.register(
1625
1673
  { application: RESOURCE$3, resourceType: RESOURCE$3 },
1626
- (u) => new ScrapbookResourceService(u)
1674
+ (n) => new ScrapbookResourceService(n)
1627
1675
  );
1628
1676
  const APP$2 = "homeworks", RESOURCE$2 = "homeworks";
1629
1677
  class HomeworksResourceService extends ResourceService {
@@ -1673,7 +1721,7 @@ class HomeworksResourceService extends ResourceService {
1673
1721
  }
1674
1722
  ResourceService.register(
1675
1723
  { application: RESOURCE$2, resourceType: RESOURCE$2 },
1676
- (u) => new HomeworksResourceService(u)
1724
+ (n) => new HomeworksResourceService(n)
1677
1725
  );
1678
1726
  const APP$1 = "timelinegenerator", RESOURCE$1 = "timelinegenerator";
1679
1727
  class TimelineGeneratorResourceService extends ResourceService {
@@ -1728,7 +1776,7 @@ class TimelineGeneratorResourceService extends ResourceService {
1728
1776
  }
1729
1777
  ResourceService.register(
1730
1778
  { application: RESOURCE$1, resourceType: RESOURCE$1 },
1731
- (u) => new TimelineGeneratorResourceService(u)
1779
+ (n) => new TimelineGeneratorResourceService(n)
1732
1780
  );
1733
1781
  const APP = "collaborativeeditor", RESOURCE = "collaborativeeditor";
1734
1782
  class CollaborativeEditorResourceService extends ResourceService {
@@ -1776,7 +1824,7 @@ class CollaborativeEditorResourceService extends ResourceService {
1776
1824
  }
1777
1825
  ResourceService.register(
1778
1826
  { application: RESOURCE, resourceType: RESOURCE },
1779
- (u) => new CollaborativeEditorResourceService(u)
1827
+ (n) => new CollaborativeEditorResourceService(n)
1780
1828
  );
1781
1829
  const globalCache = {}, mutexPromise = {};
1782
1830
  class CacheService {
@@ -1993,7 +2041,7 @@ class DirectoryService {
1993
2041
  this.cache.clearCache("/directory/sharebookmark/all");
1994
2042
  const i = r.map((h) => typeof h == "string" ? h : h.id), o = s.map((h) => typeof h == "string" ? h : h.id), a = t.map(async (h) => {
1995
2043
  if (typeof h == "string") {
1996
- const { displayName: y, groups: d, id: g, users: A } = await this.getBookMarkById(h), f = A.map((_) => _.id), w = d.map((_) => _.id);
2044
+ const { displayName: y, groups: d, id: g, users: A } = await this.getBookMarkById(h), f = A.map((v) => v.id), w = d.map((v) => v.id);
1997
2045
  return {
1998
2046
  displayName: y,
1999
2047
  id: g,
@@ -2019,10 +2067,10 @@ const loadedScripts = {};
2019
2067
  class HttpService {
2020
2068
  constructor(e, t) {
2021
2069
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
2022
- n(this, "axios");
2023
- n(this, "baseUrl");
2024
- n(this, "headers", {});
2025
- n(this, "_latestResponse");
2070
+ u(this, "axios");
2071
+ u(this, "baseUrl");
2072
+ u(this, "headers", {});
2073
+ u(this, "_latestResponse");
2026
2074
  this.context = e, this.axios = axios.create(t);
2027
2075
  }
2028
2076
  fixBaseUrl(e) {
@@ -3089,44 +3137,44 @@ class ShareService {
3089
3137
  }
3090
3138
  }
3091
3139
  const defaultMappers = {
3092
- csv: function({ type: u, extension: e }) {
3093
- return MimeTypeUtils.INSTANCE.isCsvLike(u, e);
3140
+ csv: function({ type: n, extension: e }) {
3141
+ return MimeTypeUtils.INSTANCE.isCsvLike(n, e);
3094
3142
  },
3095
- doc: function({ type: u, extension: e }) {
3096
- return MimeTypeUtils.INSTANCE.isWordLike(u, e) ? !0 : u.indexOf("document") !== -1 && u.indexOf("wordprocessing") !== -1;
3143
+ doc: function({ type: n, extension: e }) {
3144
+ return MimeTypeUtils.INSTANCE.isWordLike(n, e) ? !0 : n.indexOf("document") !== -1 && n.indexOf("wordprocessing") !== -1;
3097
3145
  },
3098
- xls: function({ type: u, extension: e }) {
3099
- return MimeTypeUtils.INSTANCE.isExcelLike(u, e) ? !0 : u.indexOf("document") !== -1 && u.indexOf("spreadsheet") !== -1 || u.indexOf("ms-excel") !== -1;
3146
+ xls: function({ type: n, extension: e }) {
3147
+ return MimeTypeUtils.INSTANCE.isExcelLike(n, e) ? !0 : n.indexOf("document") !== -1 && n.indexOf("spreadsheet") !== -1 || n.indexOf("ms-excel") !== -1;
3100
3148
  },
3101
- img: function({ type: u }) {
3102
- return u.indexOf("image") !== -1;
3149
+ img: function({ type: n }) {
3150
+ return n.indexOf("image") !== -1;
3103
3151
  },
3104
- pdf: function({ type: u }) {
3105
- return u.indexOf("pdf") !== -1 || u === "application/x-download";
3152
+ pdf: function({ type: n }) {
3153
+ return n.indexOf("pdf") !== -1 || n === "application/x-download";
3106
3154
  },
3107
- ppt: function({ type: u, extension: e }) {
3108
- return MimeTypeUtils.INSTANCE.isPowerpointLike(u, e) ? !0 : u.indexOf("document") !== -1 && u.indexOf("presentation") !== -1 || u.indexOf("powerpoint") !== -1;
3155
+ ppt: function({ type: n, extension: e }) {
3156
+ return MimeTypeUtils.INSTANCE.isPowerpointLike(n, e) ? !0 : n.indexOf("document") !== -1 && n.indexOf("presentation") !== -1 || n.indexOf("powerpoint") !== -1;
3109
3157
  },
3110
- txt: function({ type: u, extension: e }) {
3111
- return MimeTypeUtils.INSTANCE.isTxtLike(u, e);
3158
+ txt: function({ type: n, extension: e }) {
3159
+ return MimeTypeUtils.INSTANCE.isTxtLike(n, e);
3112
3160
  },
3113
- md: function({ type: u, extension: e }) {
3114
- return MimeTypeUtils.INSTANCE.isMdLike(u, e);
3161
+ md: function({ type: n, extension: e }) {
3162
+ return MimeTypeUtils.INSTANCE.isMdLike(n, e);
3115
3163
  },
3116
- video: function({ type: u }) {
3117
- return u.indexOf("video") !== -1;
3164
+ video: function({ type: n }) {
3165
+ return n.indexOf("video") !== -1;
3118
3166
  },
3119
- audio: function({ type: u }) {
3120
- return u.indexOf("audio") !== -1;
3167
+ audio: function({ type: n }) {
3168
+ return n.indexOf("audio") !== -1;
3121
3169
  },
3122
- zip: function({ type: u }) {
3123
- return u.indexOf("zip") !== -1 || u.indexOf("rar") !== -1 || u.indexOf("tar") !== -1 || u.indexOf("7z") !== -1;
3170
+ zip: function({ type: n }) {
3171
+ return n.indexOf("zip") !== -1 || n.indexOf("rar") !== -1 || n.indexOf("tar") !== -1 || n.indexOf("7z") !== -1;
3124
3172
  }
3125
- }, D = class D {
3173
+ }, _ = class _ {
3126
3174
  /* Similar role notion as in infra-front > workspace > Model.ts */
3127
3175
  static getRole(e) {
3128
3176
  var t, s;
3129
- return D.role(
3177
+ return _.role(
3130
3178
  (t = e.metadata) == null ? void 0 : t["content-type"],
3131
3179
  !1,
3132
3180
  (s = e.metadata) == null ? void 0 : s.extension
@@ -3146,10 +3194,10 @@ const defaultMappers = {
3146
3194
  }
3147
3195
  };
3148
3196
  // FIXME add edumedia support
3149
- n(D, "roleMappers", [
3197
+ u(_, "roleMappers", [
3150
3198
  (e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
3151
3199
  ]);
3152
- let DocumentHelper = D;
3200
+ let DocumentHelper = _;
3153
3201
  class WorkspaceService {
3154
3202
  constructor(e) {
3155
3203
  this.context = e;
@@ -3315,8 +3363,8 @@ class WorkspaceService {
3315
3363
  }
3316
3364
  let ATTag;
3317
3365
  class AnalyticsService {
3318
- constructor(u) {
3319
- this.context = u;
3366
+ constructor(n) {
3367
+ this.context = n;
3320
3368
  }
3321
3369
  get http() {
3322
3370
  return this.context.http();
@@ -3329,7 +3377,7 @@ class AnalyticsService {
3329
3377
  * @param locationPath
3330
3378
  * @param app
3331
3379
  */
3332
- async trackPageLoad(u, e) {
3380
+ async trackPageLoad(n, e) {
3333
3381
  const [t] = await Promise.all([
3334
3382
  // get Xiti configuration
3335
3383
  this.getXitiConfig(e.name.toLowerCase()),
@@ -3339,7 +3387,7 @@ class AnalyticsService {
3339
3387
  if (!t || !ATInternet) return;
3340
3388
  let s = t.LIBELLE_SERVICE.default || null;
3341
3389
  for (const r in t.LIBELLE_SERVICE)
3342
- if (r !== "default" && u.indexOf(r) >= 0) {
3390
+ if (r !== "default" && n.indexOf(r) >= 0) {
3343
3391
  s = t.LIBELLE_SERVICE[r];
3344
3392
  break;
3345
3393
  }
@@ -3366,7 +3414,7 @@ class AnalyticsService {
3366
3414
  level2: t.STRUCT_UAI
3367
3415
  }), ATTag.dispatch();
3368
3416
  }
3369
- async getXitiConfig(u) {
3417
+ async getXitiConfig(n) {
3370
3418
  const [e, t] = await Promise.all([
3371
3419
  this.http.get("/analyticsConf"),
3372
3420
  //FIXME change servers config to only keep the "all-in-one" query to /analyticsConf.
@@ -3374,7 +3422,7 @@ class AnalyticsService {
3374
3422
  ]);
3375
3423
  if (!(e != null && e.type))
3376
3424
  throw ERROR_CODE.MALFORMED_DATA;
3377
- return t != null && t.active && (e.xiti = await this.getXitiTrackingParams(t, u)), e.xiti;
3425
+ return t != null && t.active && (e.xiti = await this.getXitiTrackingParams(t, n)), e.xiti;
3378
3426
  }
3379
3427
  async loadXitiScript() {
3380
3428
  if (typeof ATInternet > "u") {
@@ -3386,13 +3434,13 @@ class AnalyticsService {
3386
3434
  eval(response);
3387
3435
  }
3388
3436
  }
3389
- async getXitiTrackingParams(u, e) {
3390
- if (!u.structureMap || !e) return;
3437
+ async getXitiTrackingParams(n, e) {
3438
+ if (!n.structureMap || !e) return;
3391
3439
  const t = await this.session.getUser(), s = await this.session.getUserProfile();
3392
3440
  let r;
3393
3441
  if (!(t != null && t.structures)) return;
3394
3442
  for (const l of t.structures) {
3395
- const p = u.structureMap[l];
3443
+ const p = n.structureMap[l];
3396
3444
  if (p && p.collectiviteId && p.UAI) {
3397
3445
  r = p;
3398
3446
  break;
@@ -3423,15 +3471,15 @@ class AnalyticsService {
3423
3471
  OUTIL: o.OUTIL ? o.OUTIL : "",
3424
3472
  STRUCT_ID: r.collectiviteId,
3425
3473
  STRUCT_UAI: r.UAI,
3426
- PROJET: r.projetId ? r.projetId : u.ID_PROJET,
3427
- EXPLOITANT: u.ID_EXPLOITANT,
3428
- PLATFORME: r.plateformeId ? r.plateformeId : u.ID_PLATEFORME,
3474
+ PROJET: r.projetId ? r.projetId : n.ID_PROJET,
3475
+ EXPLOITANT: n.ID_EXPLOITANT,
3476
+ PLATFORME: r.plateformeId ? r.plateformeId : n.ID_PLATEFORME,
3429
3477
  ID_PERSO: a(t.userId),
3430
3478
  PROFILE: s && s.length > 0 ? c[s[0]] ?? "" : ""
3431
3479
  };
3432
3480
  }
3433
3481
  }
3434
- const C = class C {
3482
+ const R = class R {
3435
3483
  // in minutes. Applies to recorded videos.
3436
3484
  constructor(e) {
3437
3485
  this.context = e;
@@ -3452,8 +3500,8 @@ const C = class C {
3452
3500
  APP$4.VIDEO
3453
3501
  );
3454
3502
  return {
3455
- maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? C.MAX_WEIGHT,
3456
- maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? C.MAX_DURATION,
3503
+ maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? R.MAX_WEIGHT,
3504
+ maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? R.MAX_DURATION,
3457
3505
  acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
3458
3506
  (s) => s.toUpperCase()
3459
3507
  )) ?? []
@@ -3510,9 +3558,9 @@ const C = class C {
3510
3558
  throw new Error("Video cannot be uploaded.");
3511
3559
  }
3512
3560
  };
3513
- n(C, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
3514
- n(C, "MAX_DURATION", 3);
3515
- let VideoService = C;
3561
+ u(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
3562
+ u(R, "MAX_DURATION", 3);
3563
+ let VideoService = R;
3516
3564
  class EmbedderService {
3517
3565
  constructor(e) {
3518
3566
  this.context = e;
@@ -3607,7 +3655,7 @@ class AbstractBehaviourService {
3607
3655
  //-----------------
3608
3656
  //--- Utilities ---
3609
3657
  //-----------------
3610
- n(this, "_cache");
3658
+ u(this, "_cache");
3611
3659
  this.context = e, this._cache = new CacheService(this.context);
3612
3660
  }
3613
3661
  getApplication() {
@@ -3641,8 +3689,8 @@ class AbstractBehaviourService {
3641
3689
  class ActualitesBehaviour extends AbstractBehaviourService {
3642
3690
  constructor() {
3643
3691
  super(...arguments);
3644
- n(this, "APP", "actualites");
3645
- n(this, "RESOURCE", "actualites");
3692
+ u(this, "APP", "actualites");
3693
+ u(this, "RESOURCE", "actualites");
3646
3694
  }
3647
3695
  async loadResources() {
3648
3696
  return (await this.httpGet(
@@ -3665,8 +3713,8 @@ class ActualitesBehaviour extends AbstractBehaviourService {
3665
3713
  class BlogBehaviour extends AbstractBehaviourService {
3666
3714
  constructor() {
3667
3715
  super(...arguments);
3668
- n(this, "APP", "blog");
3669
- n(this, "RESOURCE", "blog");
3716
+ u(this, "APP", "blog");
3717
+ u(this, "RESOURCE", "blog");
3670
3718
  }
3671
3719
  loadResources() {
3672
3720
  return new Promise(async (t, s) => {
@@ -3695,8 +3743,8 @@ class BlogBehaviour extends AbstractBehaviourService {
3695
3743
  class CollaborativewallBehaviour extends AbstractBehaviourService {
3696
3744
  constructor() {
3697
3745
  super(...arguments);
3698
- n(this, "APP", "collaborativewall");
3699
- n(this, "RESOURCE", "collaborativewall");
3746
+ u(this, "APP", "collaborativewall");
3747
+ u(this, "RESOURCE", "collaborativewall");
3700
3748
  }
3701
3749
  async loadResources() {
3702
3750
  return (await this.httpGet(
@@ -3718,8 +3766,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
3718
3766
  class CommunityBehaviour extends AbstractBehaviourService {
3719
3767
  constructor() {
3720
3768
  super(...arguments);
3721
- n(this, "APP", "community");
3722
- n(this, "RESOURCE", "community");
3769
+ u(this, "APP", "community");
3770
+ u(this, "RESOURCE", "community");
3723
3771
  }
3724
3772
  async loadResources() {
3725
3773
  return (await this.httpGet(
@@ -3743,8 +3791,8 @@ class CommunityBehaviour extends AbstractBehaviourService {
3743
3791
  class ExercizerBehaviour extends AbstractBehaviourService {
3744
3792
  constructor() {
3745
3793
  super(...arguments);
3746
- n(this, "APP", "exercizer");
3747
- n(this, "RESOURCE", "exercizer");
3794
+ u(this, "APP", "exercizer");
3795
+ u(this, "RESOURCE", "exercizer");
3748
3796
  }
3749
3797
  async loadResources() {
3750
3798
  return (await this.httpGet(
@@ -3769,8 +3817,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
3769
3817
  class FormulaireBehaviour extends AbstractBehaviourService {
3770
3818
  constructor() {
3771
3819
  super(...arguments);
3772
- n(this, "APP", "formulaire");
3773
- n(this, "RESOURCE", "formulaire");
3820
+ u(this, "APP", "formulaire");
3821
+ u(this, "RESOURCE", "formulaire");
3774
3822
  }
3775
3823
  async loadResources() {
3776
3824
  return (await this.httpGet(
@@ -3790,8 +3838,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
3790
3838
  class ForumBehaviour extends AbstractBehaviourService {
3791
3839
  constructor() {
3792
3840
  super(...arguments);
3793
- n(this, "APP", "forum");
3794
- n(this, "RESOURCE", "forum");
3841
+ u(this, "APP", "forum");
3842
+ u(this, "RESOURCE", "forum");
3795
3843
  }
3796
3844
  async loadResources() {
3797
3845
  return (await this.httpGet("/forum/categories")).map(
@@ -3811,8 +3859,8 @@ class ForumBehaviour extends AbstractBehaviourService {
3811
3859
  class HomeworksBehaviour extends AbstractBehaviourService {
3812
3860
  constructor() {
3813
3861
  super(...arguments);
3814
- n(this, "APP", "homeworks");
3815
- n(this, "RESOURCE", "homeworks");
3862
+ u(this, "APP", "homeworks");
3863
+ u(this, "RESOURCE", "homeworks");
3816
3864
  }
3817
3865
  async loadResources() {
3818
3866
  return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
@@ -3830,8 +3878,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
3830
3878
  class MagnetoBehaviour extends AbstractBehaviourService {
3831
3879
  constructor() {
3832
3880
  super(...arguments);
3833
- n(this, "APP", "magneto");
3834
- n(this, "RESOURCE", "magneto");
3881
+ u(this, "APP", "magneto");
3882
+ u(this, "RESOURCE", "magneto");
3835
3883
  }
3836
3884
  async loadResources() {
3837
3885
  const { all: t } = await this.httpGet(
@@ -3852,8 +3900,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
3852
3900
  class MindmapBehaviour extends AbstractBehaviourService {
3853
3901
  constructor() {
3854
3902
  super(...arguments);
3855
- n(this, "APP", "mindmap");
3856
- n(this, "RESOURCE", "mindmap");
3903
+ u(this, "APP", "mindmap");
3904
+ u(this, "RESOURCE", "mindmap");
3857
3905
  }
3858
3906
  async loadResources() {
3859
3907
  return (await this.httpGet("/mindmap/list/all")).map(
@@ -3873,8 +3921,8 @@ class MindmapBehaviour extends AbstractBehaviourService {
3873
3921
  class PagesBehaviour extends AbstractBehaviourService {
3874
3922
  constructor() {
3875
3923
  super(...arguments);
3876
- n(this, "APP", "pages");
3877
- n(this, "RESOURCE", "pages");
3924
+ u(this, "APP", "pages");
3925
+ u(this, "RESOURCE", "pages");
3878
3926
  }
3879
3927
  async loadResources() {
3880
3928
  const t = await this.httpGet("/pages/list/all"), s = [];
@@ -3912,8 +3960,8 @@ class PagesBehaviour extends AbstractBehaviourService {
3912
3960
  class PollBehaviour extends AbstractBehaviourService {
3913
3961
  constructor() {
3914
3962
  super(...arguments);
3915
- n(this, "APP", "poll");
3916
- n(this, "RESOURCE", "poll");
3963
+ u(this, "APP", "poll");
3964
+ u(this, "RESOURCE", "poll");
3917
3965
  }
3918
3966
  async loadResources() {
3919
3967
  return (await this.httpGet("/poll/list/all")).map((s) => {
@@ -3934,8 +3982,8 @@ class PollBehaviour extends AbstractBehaviourService {
3934
3982
  class ScrapbookBehaviour extends AbstractBehaviourService {
3935
3983
  constructor() {
3936
3984
  super(...arguments);
3937
- n(this, "APP", "scrapbook");
3938
- n(this, "RESOURCE", "scrapbook");
3985
+ u(this, "APP", "scrapbook");
3986
+ u(this, "RESOURCE", "scrapbook");
3939
3987
  }
3940
3988
  async loadResources() {
3941
3989
  return (await this.httpGet(
@@ -3958,8 +4006,8 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
3958
4006
  class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3959
4007
  constructor() {
3960
4008
  super(...arguments);
3961
- n(this, "APP", "timelinegenerator");
3962
- n(this, "RESOURCE", "timelinegenerator");
4009
+ u(this, "APP", "timelinegenerator");
4010
+ u(this, "RESOURCE", "timelinegenerator");
3963
4011
  }
3964
4012
  loadResources() {
3965
4013
  return new Promise(async (t, s) => {
@@ -3989,8 +4037,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3989
4037
  class WikiBehaviour extends AbstractBehaviourService {
3990
4038
  constructor() {
3991
4039
  super(...arguments);
3992
- n(this, "APP", "wiki");
3993
- n(this, "RESOURCE", "wiki");
4040
+ u(this, "APP", "wiki");
4041
+ u(this, "RESOURCE", "wiki");
3994
4042
  }
3995
4043
  async loadResources() {
3996
4044
  return (await this.httpGet(
@@ -4013,8 +4061,8 @@ class WikiBehaviour extends AbstractBehaviourService {
4013
4061
  class WorkspaceBehaviour extends AbstractBehaviourService {
4014
4062
  constructor() {
4015
4063
  super(...arguments);
4016
- n(this, "APP", "workspace");
4017
- n(this, "RESOURCE", "workspace");
4064
+ u(this, "APP", "workspace");
4065
+ u(this, "RESOURCE", "workspace");
4018
4066
  }
4019
4067
  loadResources({ search: t, asset_id: s }) {
4020
4068
  return new Promise(async (r, i) => {
@@ -4132,13 +4180,13 @@ const b = class b {
4132
4180
  //
4133
4181
  // STATIC REGISTRY
4134
4182
  //
4135
- n(b, "registry", new ServiceRegistry()), // Expose some useful functions
4136
- n(b, "findBehaviour", b.registry.findService.bind(b.registry)), n(b, "hasBehaviour", b.registry.isRegistered.bind(b.registry)), n(b, "resourceProducingApps", []);
4183
+ u(b, "registry", new ServiceRegistry()), // Expose some useful functions
4184
+ u(b, "findBehaviour", b.registry.findService.bind(b.registry)), u(b, "hasBehaviour", b.registry.isRegistered.bind(b.registry)), u(b, "resourceProducingApps", []);
4137
4185
  let SnipletsService = b;
4138
4186
  const SEND_ALL = "*";
4139
4187
  class WebBroker {
4140
4188
  constructor(e) {
4141
- n(this, "subscription");
4189
+ u(this, "subscription");
4142
4190
  this.odeServices = e;
4143
4191
  }
4144
4192
  get http() {
@@ -4170,10 +4218,10 @@ class WebBroker {
4170
4218
  }
4171
4219
  class DataService {
4172
4220
  constructor(e) {
4173
- n(this, "_webBroker");
4174
- n(this, "app");
4175
- n(this, "user");
4176
- n(this, "profile");
4221
+ u(this, "_webBroker");
4222
+ u(this, "app");
4223
+ u(this, "user");
4224
+ u(this, "profile");
4177
4225
  this.odeServices = e;
4178
4226
  }
4179
4227
  get conf() {
@@ -4335,20 +4383,20 @@ class AudienceService {
4335
4383
  }
4336
4384
  class OdeServices {
4337
4385
  constructor() {
4338
- n(this, "_analytics");
4339
- n(this, "_cache");
4340
- n(this, "_conf");
4341
- n(this, "_data");
4342
- n(this, "_directory");
4343
- n(this, "_http");
4344
- n(this, "_idiom");
4345
- n(this, "_notify");
4346
- n(this, "_rights");
4347
- n(this, "_session");
4348
- n(this, "_share");
4349
- n(this, "_video");
4350
- n(this, "_workspace");
4351
- n(this, "_embedder");
4386
+ u(this, "_analytics");
4387
+ u(this, "_cache");
4388
+ u(this, "_conf");
4389
+ u(this, "_data");
4390
+ u(this, "_directory");
4391
+ u(this, "_http");
4392
+ u(this, "_idiom");
4393
+ u(this, "_notify");
4394
+ u(this, "_rights");
4395
+ u(this, "_session");
4396
+ u(this, "_share");
4397
+ u(this, "_video");
4398
+ u(this, "_workspace");
4399
+ u(this, "_embedder");
4352
4400
  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);
4353
4401
  }
4354
4402
  initialize() {
@@ -4481,9 +4529,9 @@ class TransportFrameworkFactory {
4481
4529
  return transport;
4482
4530
  }
4483
4531
  }
4484
- const isActionAvailable = (u, e) => {
4532
+ const isActionAvailable = (n, e) => {
4485
4533
  const t = e == null ? void 0 : e.filter(
4486
- (s) => s.id === u && s.available
4534
+ (s) => s.id === n && s.available
4487
4535
  );
4488
4536
  return t && t.length > 0;
4489
4537
  }, firstLevelWidgets = [
@@ -4550,10 +4598,10 @@ const isActionAvailable = (u, e) => {
4550
4598
  class WidgetFramework {
4551
4599
  constructor() {
4552
4600
  //-------------------------------------
4553
- n(this, "_initialized");
4554
- n(this, "_widgets", []);
4601
+ u(this, "_initialized");
4602
+ u(this, "_widgets", []);
4555
4603
  ////////////////////////////////////// USER PREFERENCES
4556
- n(this, "_userPrefs", {});
4604
+ u(this, "_userPrefs", {});
4557
4605
  }
4558
4606
  initialize(e, t) {
4559
4607
  return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
@@ -4617,8 +4665,8 @@ class WidgetFramework {
4617
4665
  class Widget {
4618
4666
  //-------------------------------------
4619
4667
  constructor(e) {
4620
- n(this, "_schoolConf", {});
4621
- n(this, "_userPref");
4668
+ u(this, "_schoolConf", {});
4669
+ u(this, "_userPref");
4622
4670
  this._platformConf = e, this._userPref = null;
4623
4671
  }
4624
4672
  get platformConf() {