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

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