@edifice.io/client 2.5.2-develop-b2school-actualites.20251201115331 → 2.5.2-develop-pedago.20251201132016

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
@@ -97,7 +97,7 @@ const ERROR_CODE = {
97
97
  INFOTIP: "infotip",
98
98
  RGPD_COOKIES: "rgpdCookies"
99
99
  // TODO compléter
100
- }, R = class R {
100
+ }, b = class b {
101
101
  constructor(e) {
102
102
  n(this, "name");
103
103
  n(this, "listeners", /* @__PURE__ */ new Set());
@@ -109,8 +109,8 @@ const ERROR_CODE = {
109
109
  * @returns the channel instance
110
110
  */
111
111
  static getChannel(e) {
112
- let t = R.channels.get(e);
113
- return t || (t = new R(e), R.channels.set(e, t)), t;
112
+ let t = b.channels.get(e);
113
+ return t || (t = new b(e), b.channels.set(e, t)), t;
114
114
  }
115
115
  /**
116
116
  * Add a listener and return a revocation function to remove it.
@@ -135,11 +135,11 @@ const ERROR_CODE = {
135
135
  * Close this channel: remove listeners and unregister from global map.
136
136
  */
137
137
  close() {
138
- this.listeners.clear(), R.channels.delete(this.name);
138
+ this.listeners.clear(), b.channels.delete(this.name);
139
139
  }
140
140
  };
141
- n(R, "channels", /* @__PURE__ */ new Map());
142
- let SimpleChannel = R;
141
+ n(b, "channels", /* @__PURE__ */ new Map());
142
+ let SimpleChannel = b;
143
143
  class Subscription {
144
144
  constructor(e, t) {
145
145
  n(this, "revoke");
@@ -970,10 +970,10 @@ class User {
970
970
  let r = !0;
971
971
  const i = [];
972
972
  s.bookmarks.forEach((o, a) => {
973
- const c = this._me.apps.find((l) => l.name === o);
973
+ const c = this._me.apps.find((h) => h.name === o);
974
974
  if (c) {
975
- const l = Object.assign({}, c);
976
- this._bookmarkedApps.push(l);
975
+ const h = Object.assign({}, c);
976
+ this._bookmarkedApps.push(h);
977
977
  } else
978
978
  i.push(o), r = !1;
979
979
  }), i.forEach((o) => {
@@ -1080,10 +1080,10 @@ class Analytics {
1080
1080
  if (!e.structureMap || !configure.Platform.apps.currentApp) return;
1081
1081
  const t = await notify.onSessionReady().promise, s = session.session.description;
1082
1082
  let r;
1083
- for (const l of t.structures) {
1084
- const h = e.structureMap[l];
1085
- if (h && h.collectiviteId && h.UAI) {
1086
- r = h;
1083
+ for (const h of t.structures) {
1084
+ const l = e.structureMap[h];
1085
+ if (l && l.collectiviteId && l.UAI) {
1086
+ r = l;
1087
1087
  break;
1088
1088
  }
1089
1089
  }
@@ -1094,11 +1094,11 @@ class Analytics {
1094
1094
  if (!i) return;
1095
1095
  const o = i.xiti;
1096
1096
  if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
1097
- function a(l) {
1098
- let h = "";
1099
- for (let p = 0; p < l.length; p++)
1100
- h += l.charCodeAt(p);
1101
- return h;
1097
+ function a(h) {
1098
+ let l = "";
1099
+ for (let E = 0; E < h.length; E++)
1100
+ l += h.charCodeAt(E);
1101
+ return l;
1102
1102
  }
1103
1103
  const c = {
1104
1104
  Student: "ELEVE",
@@ -1141,7 +1141,7 @@ class ConfigurationFramework {
1141
1141
  }
1142
1142
  async initialize(e, t) {
1143
1143
  if (!e) {
1144
- const r = (l) => (l < 10 ? "0" : "") + l.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
1144
+ const r = (h) => (h < 10 ? "0" : "") + h.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
1145
1145
  e = `${o}${r(a)}${r(c)}`;
1146
1146
  }
1147
1147
  const s = e;
@@ -1180,8 +1180,8 @@ class ConfigurationFramework {
1180
1180
  // }
1181
1181
  }
1182
1182
  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;
1183
+ var D;
1184
+ const me = (D = session == null ? void 0 : session.session) == null ? void 0 : D.user;
1185
1185
  class Notification {
1186
1186
  constructor(e) {
1187
1187
  n(this, "_id");
@@ -1904,19 +1904,19 @@ class ConfService {
1904
1904
  conf: t,
1905
1905
  publicTheme: s
1906
1906
  }) {
1907
- var p;
1908
- const r = await this.http.get("/theme"), i = (p = t == null ? void 0 : t.overriding) == null ? void 0 : p.find(
1909
- (d) => (
1907
+ var E;
1908
+ const r = await this.http.get("/theme"), i = (E = t == null ? void 0 : t.overriding) == null ? void 0 : E.find(
1909
+ (p) => (
1910
1910
  // Fix #WB2-2660:
1911
1911
  // If Public access => get the neo theme
1912
1912
  // Else get the theme from the user preference
1913
- s ? d.parent === "theme-open-ent" && d.bootstrapVersion === "ode-bootstrap-neo" : d.child === (r == null ? void 0 : r.themeName)
1913
+ s ? p.parent === "theme-open-ent" && p.bootstrapVersion === "ode-bootstrap-neo" : p.child === (r == null ? void 0 : r.themeName)
1914
1914
  )
1915
- ), o = s ? "default" : (r == null ? void 0 : r.skinName) || (i == null ? void 0 : i.skins[0]), a = (r == null ? void 0 : r.skin) || `/assets/themes/${i == null ? void 0 : i.child}/skins/${o}/`, c = i == null ? void 0 : i.skins, l = i == null ? void 0 : i.bootstrapVersion.split("-").slice(-1)[0], h = (i == null ? void 0 : i.parent) === "panda";
1915
+ ), o = s ? "default" : (r == null ? void 0 : r.skinName) || (i == null ? void 0 : i.skins[0]), a = (r == null ? void 0 : r.skin) || `/assets/themes/${i == null ? void 0 : i.child}/skins/${o}/`, c = i == null ? void 0 : i.skins, h = i == null ? void 0 : i.bootstrapVersion.split("-").slice(-1)[0], l = (i == null ? void 0 : i.parent) === "panda";
1916
1916
  return {
1917
1917
  basePath: `${this.cdnDomain}${a}../../`,
1918
- bootstrapVersion: l,
1919
- is1d: h,
1918
+ bootstrapVersion: h,
1919
+ is1d: l,
1920
1920
  logoutCallback: (r == null ? void 0 : r.logoutCallback) || "",
1921
1921
  skin: i == null ? void 0 : i.child,
1922
1922
  skinName: o,
@@ -1962,26 +1962,25 @@ class DirectoryService {
1962
1962
  }));
1963
1963
  }
1964
1964
  async getBookMarkById(e) {
1965
- const { groups: t, id: s, name: r, users: i, notVisibleCount: o } = await this.http.get(
1965
+ const { groups: t, id: s, name: r, users: i } = await this.http.get(
1966
1966
  `/directory/sharebookmark/${e}`
1967
1967
  );
1968
1968
  return {
1969
1969
  id: s,
1970
1970
  displayName: r,
1971
- notVisibleCount: o,
1972
- groups: t.map(({ name: a, id: c, nbUsers: l }) => ({
1973
- nbUsers: l,
1974
- displayName: a,
1975
- id: c
1971
+ groups: t.map(({ name: o, id: a, nbUsers: c }) => ({
1972
+ nbUsers: c,
1973
+ displayName: o,
1974
+ id: a
1976
1975
  })),
1977
- users: i.map(({ displayName: a, id: c, profile: l }) => ({
1978
- profile: l,
1979
- displayName: a,
1976
+ users: i.map(({ displayName: o, id: a, profile: c }) => ({
1977
+ profile: c,
1978
+ displayName: o,
1980
1979
  // these info are missing from api
1981
1980
  firstName: "",
1982
1981
  lastName: "",
1983
1982
  login: "",
1984
- id: c
1983
+ id: a
1985
1984
  }))
1986
1985
  };
1987
1986
  }
@@ -1991,27 +1990,27 @@ class DirectoryService {
1991
1990
  users: r
1992
1991
  }) {
1993
1992
  this.cache.clearCache("/directory/sharebookmark/all");
1994
- const i = r.map((d) => typeof d == "string" ? d : d.id), o = s.map((d) => typeof d == "string" ? d : d.id), a = t.map(async (d) => {
1995
- if (typeof d == "string") {
1996
- const { displayName: b, groups: E, id: g, users: A } = await this.getBookMarkById(d), f = A.map((F) => F.id), y = E.map((F) => F.id);
1993
+ const i = r.map((p) => typeof p == "string" ? p : p.id), o = s.map((p) => typeof p == "string" ? p : p.id), a = t.map(async (p) => {
1994
+ if (typeof p == "string") {
1995
+ const { displayName: d, groups: g, id: A, users: f } = await this.getBookMarkById(p), y = f.map((_) => _.id), F = g.map((_) => _.id);
1997
1996
  return {
1998
- displayName: b,
1999
- id: g,
2000
- members: [...y, ...f]
1997
+ displayName: d,
1998
+ id: A,
1999
+ members: [...F, ...y]
2001
2000
  };
2002
2001
  } else
2003
- return Promise.resolve(d);
2004
- }), l = (await Promise.all(a)).map((d) => d.members).reduce((d, b) => [...d, ...b], []), h = {
2002
+ return Promise.resolve(p);
2003
+ }), h = (await Promise.all(a)).map((p) => p.members).reduce((p, d) => [...p, ...d], []), l = {
2005
2004
  name: e,
2006
- members: [...i, ...o, ...l]
2007
- }, { id: p } = await this.http.postJson(
2005
+ members: [...i, ...o, ...h]
2006
+ }, { id: E } = await this.http.postJson(
2008
2007
  "/directory/sharebookmark",
2009
- h
2008
+ l
2010
2009
  );
2011
2010
  return {
2012
- id: p,
2011
+ id: E,
2013
2012
  displayName: e,
2014
- members: h.members
2013
+ members: l.members
2015
2014
  };
2016
2015
  }
2017
2016
  }
@@ -2296,7 +2295,7 @@ class RightService {
2296
2295
  return e.map((s) => this.parseResourceRight(s)).filter((s) => s !== void 0);
2297
2296
  }
2298
2297
  /**
2299
- * Check wether a user has the expected right for a resource
2298
+ * Check wether a user has the expected right for a ressource
2300
2299
  * @param user the userId and groupId concerned by the check
2301
2300
  * @param expect the expected right to check
2302
2301
  * @param rights array of Right for the resource
@@ -2556,18 +2555,18 @@ class SessionService {
2556
2555
  const i = [];
2557
2556
  return r.bookmarks.forEach((o, a) => {
2558
2557
  const c = ((e == null ? void 0 : e.apps) || []).find(
2559
- (l) => l.name === o
2558
+ (h) => h.name === o
2560
2559
  );
2561
2560
  if (c) {
2562
- const l = Object.assign({}, c);
2563
- i.push(l);
2561
+ const h = Object.assign({}, c);
2562
+ i.push(h);
2564
2563
  }
2565
2564
  }), i;
2566
2565
  }
2567
2566
  async getUserProfile(e = {}) {
2568
- var c, l;
2567
+ var c, h;
2569
2568
  const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: o, value: a } = await this.cache.httpGet(i, t);
2570
- return o.status < 200 || o.status >= 300 || typeof a == "string" ? ["Guest"] : ((l = (c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) == null ? void 0 : l.type) || ["Guest"];
2569
+ return o.status < 200 || o.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"];
2571
2570
  }
2572
2571
  async isAdml() {
2573
2572
  const e = await this.getUser();
@@ -2893,88 +2892,83 @@ class ShareService {
2893
2892
  get cache() {
2894
2893
  return this.context.cache();
2895
2894
  }
2896
- async searchShareSubjects(e, t, s, r) {
2897
- const i = StringUtils.removeAccents(s).toLowerCase(), o = await this.cache.httpGetJson(
2898
- r || `/${e}/share/json/${t}?search=${s}`
2899
- ), a = o.users.visibles.filter(({ username: p, firstName: d, lastName: b, login: E }) => {
2895
+ async searchShareSubjects(e, t, s) {
2896
+ const r = StringUtils.removeAccents(s).toLowerCase(), i = await this.cache.httpGetJson(
2897
+ `/${e}/share/json/${t}?search=${s}`
2898
+ ), o = i.users.visibles.filter(({ username: l, firstName: E, lastName: p, login: d }) => {
2900
2899
  const g = StringUtils.removeAccents(
2901
- b || ""
2900
+ p || ""
2902
2901
  ).toLowerCase(), A = StringUtils.removeAccents(
2903
- d || ""
2902
+ E || ""
2904
2903
  ).toLowerCase(), f = StringUtils.removeAccents(
2905
- p || ""
2906
- ).toLowerCase(), y = StringUtils.removeAccents(E || "").toLowerCase();
2907
- return f.includes(i) || A.includes(i) || g.includes(i) || y.includes(i);
2908
- }).map((p) => ({
2909
- avatarUrl: this.directory.getAvatarUrl(p.id, "user"),
2910
- directoryUrl: this.directory.getDirectoryUrl(p.id, "user"),
2911
- displayName: p.username,
2912
- id: p.id,
2913
- profile: p.profile,
2904
+ l || ""
2905
+ ).toLowerCase(), y = StringUtils.removeAccents(d || "").toLowerCase();
2906
+ return f.includes(r) || A.includes(r) || g.includes(r) || y.includes(r);
2907
+ }).map((l) => ({
2908
+ avatarUrl: this.directory.getAvatarUrl(l.id, "user"),
2909
+ directoryUrl: this.directory.getDirectoryUrl(l.id, "user"),
2910
+ displayName: l.username,
2911
+ id: l.id,
2912
+ profile: l.profile,
2914
2913
  type: "user"
2915
- })), c = o.groups.visibles.filter(({ name: p }) => StringUtils.removeAccents(p || "").toLowerCase().includes(i)).map((p) => ({
2916
- avatarUrl: this.directory.getAvatarUrl(p.id, "group"),
2917
- directoryUrl: this.directory.getDirectoryUrl(p.id, "group"),
2918
- displayName: p.name,
2919
- id: p.id,
2914
+ })), a = i.groups.visibles.filter(({ name: l }) => StringUtils.removeAccents(l || "").toLowerCase().includes(r)).map((l) => ({
2915
+ avatarUrl: this.directory.getAvatarUrl(l.id, "group"),
2916
+ directoryUrl: this.directory.getDirectoryUrl(l.id, "group"),
2917
+ displayName: l.name,
2918
+ id: l.id,
2920
2919
  type: "group",
2921
- structureName: p.structureName
2920
+ structureName: l.structureName
2922
2921
  }));
2923
- return [...(await this.directory.getBookMarks()).filter(({ displayName: p }) => StringUtils.removeAccents(
2924
- p || ""
2925
- ).toLowerCase().includes(i)).map((p) => ({
2922
+ return [...(await this.directory.getBookMarks()).filter(({ displayName: l }) => StringUtils.removeAccents(
2923
+ l || ""
2924
+ ).toLowerCase().includes(r)).map((l) => ({
2926
2925
  avatarUrl: "",
2927
2926
  directoryUrl: "",
2928
2927
  profile: "",
2929
- displayName: p.displayName,
2930
- id: p.id,
2928
+ displayName: l.displayName,
2929
+ id: l.id,
2931
2930
  type: "sharebookmark"
2932
- })), ...a, ...c];
2931
+ })), ...o, ...a];
2933
2932
  }
2934
- async getShareMapping(e, t) {
2935
- const s = await this.cache.httpGetJson(
2936
- t || `/${e}/rights/sharing`
2933
+ async getShareMapping(e) {
2934
+ const t = await this.cache.httpGetJson(
2935
+ `/${e}/rights/sharing`
2937
2936
  );
2938
- for (const r of Object.keys(s))
2939
- if (r.includes(".")) {
2940
- const i = r.split(".")[1], o = s[r];
2941
- delete s[r], s[i] = o;
2937
+ for (const s of Object.keys(t))
2938
+ if (s.includes(".")) {
2939
+ const r = s.split(".")[1], i = t[s];
2940
+ delete t[s], t[r] = i;
2942
2941
  }
2943
- return s;
2942
+ return t;
2944
2943
  }
2945
2944
  getActionsAvailableFor({ id: e, type: t }, s, r) {
2946
2945
  const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
2947
- for (const l of a)
2948
- r[l].filter(
2949
- (d) => o.includes(d)
2950
- ).length > 0 && c.push(l);
2946
+ for (const h of a)
2947
+ r[h].filter(
2948
+ (p) => o.includes(p)
2949
+ ).length > 0 && c.push(h);
2951
2950
  return c;
2952
2951
  }
2953
- async getRightsForResource(e, t, s) {
2954
- const r = await this.directory.getBookMarks(), i = `/${e}/share/json/${t}?search=`, o = await this.cache.httpGetJson(
2955
- (s == null ? void 0 : s.getResourceRights) || i
2956
- ), a = await this.getShareMapping(
2957
- e,
2958
- s == null ? void 0 : s.getShareMapping
2959
- ), c = await this.cache.httpGetJson(
2952
+ async getRightsForResource(e, t) {
2953
+ const s = await this.directory.getBookMarks(), r = `/${e}/share/json/${t}?search=`, i = await this.cache.httpGetJson(r), o = await this.getShareMapping(e), a = await this.cache.httpGetJson(
2960
2954
  "/infra/public/json/sharing-rights.json"
2961
- ), l = Object.keys(o.users.checked).map((E) => o.users.visibles.find(
2962
- (A) => A.id === E
2963
- )).filter((E) => E !== void 0).map((E) => {
2955
+ ), c = Object.keys(i.users.checked).map((d) => i.users.visibles.find(
2956
+ (A) => A.id === d
2957
+ )).filter((d) => d !== void 0).map((d) => {
2964
2958
  const g = this.getActionsAvailableFor(
2965
- { id: E.id, type: "user" },
2966
- o,
2967
- a
2959
+ { id: d.id, type: "user" },
2960
+ i,
2961
+ o
2968
2962
  );
2969
2963
  return {
2970
- id: E.id,
2964
+ id: d.id,
2971
2965
  type: "user",
2972
- displayName: E.username,
2973
- profile: E.profile,
2974
- avatarUrl: this.directory.getAvatarUrl(E.id, "user"),
2975
- directoryUrl: this.directory.getDirectoryUrl(E.id, "user"),
2966
+ displayName: d.username,
2967
+ profile: d.profile,
2968
+ avatarUrl: this.directory.getAvatarUrl(d.id, "user"),
2969
+ directoryUrl: this.directory.getDirectoryUrl(d.id, "user"),
2976
2970
  actions: g.map((f) => {
2977
- const y = c[f];
2971
+ const y = a[f];
2978
2972
  return {
2979
2973
  displayName: f,
2980
2974
  id: f,
@@ -2982,23 +2976,23 @@ class ShareService {
2982
2976
  };
2983
2977
  })
2984
2978
  };
2985
- }).sort((E, g) => (E.displayName || "").localeCompare(g.displayName)), h = Object.keys(o.groups.checked).map((E) => o.groups.visibles.find(
2986
- (A) => A.id === E
2987
- )).filter((E) => E !== void 0).map((E) => {
2979
+ }).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), h = Object.keys(i.groups.checked).map((d) => i.groups.visibles.find(
2980
+ (A) => A.id === d
2981
+ )).filter((d) => d !== void 0).map((d) => {
2988
2982
  const g = this.getActionsAvailableFor(
2989
- { id: E.id, type: "group" },
2990
- o,
2991
- a
2983
+ { id: d.id, type: "group" },
2984
+ i,
2985
+ o
2992
2986
  );
2993
2987
  return {
2994
- id: E.id,
2988
+ id: d.id,
2995
2989
  type: "group",
2996
- displayName: E.name,
2990
+ displayName: d.name,
2997
2991
  profile: void 0,
2998
- avatarUrl: this.directory.getAvatarUrl(E.id, "group"),
2999
- directoryUrl: this.directory.getDirectoryUrl(E.id, "group"),
2992
+ avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
2993
+ directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
3000
2994
  actions: g.map((f) => {
3001
- const y = c[f];
2995
+ const y = a[f];
3002
2996
  return {
3003
2997
  displayName: f,
3004
2998
  id: f,
@@ -3006,67 +3000,58 @@ class ShareService {
3006
3000
  };
3007
3001
  })
3008
3002
  };
3009
- }).sort((E, g) => (E.displayName || "").localeCompare(g.displayName)), p = [...l, ...h], d = o.groups.visibles.map(
3010
- ({ groupDisplayName: E, id: g, name: A, labels: f }) => ({
3003
+ }).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), l = [...c, ...h], E = i.groups.visibles.map(
3004
+ ({ groupDisplayName: d, id: g, name: A, labels: f }) => ({
3011
3005
  labels: f,
3012
- displayName: E || A,
3006
+ displayName: d || A,
3013
3007
  id: g
3014
3008
  })
3015
- ), b = o.users.visibles.map(
3016
- ({ id: E, profile: g, username: A, firstName: f, lastName: y, login: D }) => ({
3009
+ ), p = i.users.visibles.map(
3010
+ ({ id: d, profile: g, username: A, firstName: f, lastName: y, login: F }) => ({
3017
3011
  displayName: A,
3018
3012
  firstName: f,
3019
3013
  lastName: y,
3020
- login: D,
3014
+ login: F,
3021
3015
  profile: g,
3022
- id: E
3016
+ id: d
3023
3017
  })
3024
3018
  );
3025
3019
  return {
3026
- rights: p,
3027
- visibleBookmarks: r,
3028
- visibleGroups: d,
3029
- visibleUsers: b
3020
+ rights: l,
3021
+ visibleBookmarks: s,
3022
+ visibleGroups: E,
3023
+ visibleUsers: p
3030
3024
  };
3031
3025
  }
3032
- async getPutSharePayload(e, t, s) {
3033
- const r = {
3034
- users: {},
3026
+ async saveRights(e, t, s) {
3027
+ const r = await this.getShareMapping(e), i = {
3028
+ bookmarks: {},
3035
3029
  groups: {},
3036
- bookmarks: {}
3037
- }, i = await this.getShareMapping(e, s);
3038
- for (const o of t) {
3039
- const a = o.actions.map((l) => i[l.id]).reduce((l, h) => Array.isArray(h) ? [...l, ...h] : l, []), c = [...new Set(a)];
3040
- c.length > 0 && (o.type === "user" ? r.users[o.id] = c : o.type === "group" ? r.groups[o.id] = c : r.bookmarks[o.id] = c);
3030
+ users: {}
3031
+ };
3032
+ for (const c of s) {
3033
+ const h = c.actions.map((E) => r[E.id]).reduce((E, p) => Array.isArray(p) ? [...E, ...p] : E, []), l = [...new Set(h)];
3034
+ l.length > 0 && (c.type === "user" ? i.users[c.id] = l : c.type === "group" ? i.groups[c.id] = l : i.bookmarks[c.id] = l);
3041
3035
  }
3042
- return r;
3036
+ const o = `/${e}/share/resource/${t}`;
3037
+ return this.cache.clearCache(`/${e}/share/json/${t}?search=`), await this.http.putJson(o, i);
3043
3038
  }
3044
- async saveRights(e, t, s, r) {
3045
- const i = await this.getPutSharePayload(
3046
- e,
3047
- s,
3048
- r == null ? void 0 : r.getShareMapping
3049
- ), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`;
3050
- return this.cache.clearCache(
3051
- (r == null ? void 0 : r.getResourceRights) || `/${e}/share/json/${t}?search=`
3052
- ), await this.http.putJson(o, i);
3053
- }
3054
- async getActionsForApp(e, t) {
3055
- const s = await this.cache.httpGetJson(
3039
+ async getActionsForApp(e) {
3040
+ const t = await this.cache.httpGetJson(
3056
3041
  "/infra/public/json/sharing-rights.json"
3057
- ), r = await this.getShareMapping(e, t);
3058
- return Object.keys(s).map((o) => {
3059
- const a = s[o];
3042
+ ), s = await this.getShareMapping(e);
3043
+ return Object.keys(t).map((i) => {
3044
+ const o = t[i];
3060
3045
  return {
3061
- displayName: o,
3062
- id: o,
3063
- priority: a.priority,
3064
- requires: a.requires
3046
+ displayName: i,
3047
+ id: i,
3048
+ priority: o.priority,
3049
+ requires: o.requires
3065
3050
  };
3066
- }).filter((o) => {
3067
- var a;
3068
- return ((a = r[o.id]) == null ? void 0 : a.length) > 0;
3069
- }).sort((o, a) => o.priority - a.priority);
3051
+ }).filter((i) => {
3052
+ var o;
3053
+ return ((o = s[i.id]) == null ? void 0 : o.length) > 0;
3054
+ }).sort((i, o) => i.priority - o.priority);
3070
3055
  }
3071
3056
  }
3072
3057
  const defaultMappers = {
@@ -3103,11 +3088,11 @@ const defaultMappers = {
3103
3088
  zip: function({ type: u }) {
3104
3089
  return u.indexOf("zip") !== -1 || u.indexOf("rar") !== -1 || u.indexOf("tar") !== -1 || u.indexOf("7z") !== -1;
3105
3090
  }
3106
- }, _ = class _ {
3091
+ }, C = class C {
3107
3092
  /* Similar role notion as in infra-front > workspace > Model.ts */
3108
3093
  static getRole(e) {
3109
3094
  var t, s;
3110
- return _.role(
3095
+ return C.role(
3111
3096
  (t = e.metadata) == null ? void 0 : t["content-type"],
3112
3097
  !1,
3113
3098
  (s = e.metadata) == null ? void 0 : s.extension
@@ -3127,10 +3112,10 @@ const defaultMappers = {
3127
3112
  }
3128
3113
  };
3129
3114
  // FIXME add edumedia support
3130
- n(_, "roleMappers", [
3115
+ n(C, "roleMappers", [
3131
3116
  (e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
3132
3117
  ]);
3133
- let DocumentHelper = _;
3118
+ let DocumentHelper = C;
3134
3119
  class WorkspaceService {
3135
3120
  constructor(e) {
3136
3121
  this.context = e;
@@ -3220,7 +3205,7 @@ class WorkspaceService {
3220
3205
  throw this.http.latestResponse.statusText;
3221
3206
  return r.forEach((o, a) => {
3222
3207
  const c = e.findIndex(
3223
- (l) => l._id === o._id
3208
+ (h) => h._id === o._id
3224
3209
  );
3225
3210
  0 <= c && c < e.length && (e[c] = i[a]);
3226
3211
  }), e.filter((o) => !!o);
@@ -3239,8 +3224,8 @@ class WorkspaceService {
3239
3224
  {
3240
3225
  const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
3241
3226
  if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
3242
- const l = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
3243
- return l ? a + l : null;
3227
+ const h = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
3228
+ return h ? a + h : null;
3244
3229
  } else
3245
3230
  return a + r;
3246
3231
  }
@@ -3372,10 +3357,10 @@ class AnalyticsService {
3372
3357
  const t = await this.session.getUser(), s = await this.session.getUserProfile();
3373
3358
  let r;
3374
3359
  if (!(t != null && t.structures)) return;
3375
- for (const l of t.structures) {
3376
- const h = u.structureMap[l];
3377
- if (h && h.collectiviteId && h.UAI) {
3378
- r = h;
3360
+ for (const h of t.structures) {
3361
+ const l = u.structureMap[h];
3362
+ if (l && l.collectiviteId && l.UAI) {
3363
+ r = l;
3379
3364
  break;
3380
3365
  }
3381
3366
  }
@@ -3384,11 +3369,11 @@ class AnalyticsService {
3384
3369
  if (!i) return;
3385
3370
  const o = i.xiti;
3386
3371
  if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
3387
- function a(l) {
3388
- let h = "";
3389
- for (let p = 0; p < l.length; p++)
3390
- h += l.charCodeAt(p);
3391
- return h;
3372
+ function a(h) {
3373
+ let l = "";
3374
+ for (let E = 0; E < h.length; E++)
3375
+ l += h.charCodeAt(E);
3376
+ return l;
3392
3377
  }
3393
3378
  const c = {
3394
3379
  Student: "ELEVE",
@@ -3412,7 +3397,7 @@ class AnalyticsService {
3412
3397
  };
3413
3398
  }
3414
3399
  }
3415
- const C = class C {
3400
+ const R = class R {
3416
3401
  // in minutes. Applies to recorded videos.
3417
3402
  constructor(e) {
3418
3403
  this.context = e;
@@ -3433,8 +3418,8 @@ const C = class C {
3433
3418
  APP$4.VIDEO
3434
3419
  );
3435
3420
  return {
3436
- maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? C.MAX_WEIGHT,
3437
- maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? C.MAX_DURATION,
3421
+ maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? R.MAX_WEIGHT,
3422
+ maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? R.MAX_DURATION,
3438
3423
  acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
3439
3424
  (s) => s.toUpperCase()
3440
3425
  )) ?? []
@@ -3465,35 +3450,35 @@ const C = class C {
3465
3450
  { headers: { "Content-Type": "multipart/form-data" } }
3466
3451
  );
3467
3452
  if (c.state == "running") {
3468
- let l = 0, h = 1;
3453
+ let h = 0, l = 1;
3469
3454
  do {
3470
- const p = h + l;
3455
+ const E = l + h;
3471
3456
  await new Promise(
3472
- (b) => setTimeout(b, p * 1e3)
3473
- ), l = h, h = Math.min(8, p);
3474
- const d = await this.http.get(
3457
+ (d) => setTimeout(d, E * 1e3)
3458
+ ), h = l, l = Math.min(8, E);
3459
+ const p = await this.http.get(
3475
3460
  `/video/status/${c.processid}`
3476
3461
  );
3477
- if (d.state == "succeed")
3478
- return d.videoworkspaceid && d.videosize && this.context.data().trackVideoSave(
3479
- d.videoworkspaceid,
3462
+ if (p.state == "succeed")
3463
+ return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
3464
+ p.videoworkspaceid,
3480
3465
  Math.round(r),
3481
- d.videosize,
3466
+ p.videosize,
3482
3467
  s,
3483
3468
  e.url,
3484
3469
  i,
3485
3470
  e.device
3486
- ), d;
3487
- if (d.state == "error")
3471
+ ), p;
3472
+ if (p.state == "error")
3488
3473
  break;
3489
3474
  } while (!0);
3490
3475
  }
3491
3476
  throw new Error("Video cannot be uploaded.");
3492
3477
  }
3493
3478
  };
3494
- n(C, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
3495
- n(C, "MAX_DURATION", 3);
3496
- let VideoService = C;
3479
+ n(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
3480
+ n(R, "MAX_DURATION", 3);
3481
+ let VideoService = R;
3497
3482
  class EmbedderService {
3498
3483
  constructor(e) {
3499
3484
  this.context = e;
@@ -3530,10 +3515,10 @@ class EmbedderService {
3530
3515
  const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
3531
3516
  let i = !0;
3532
3517
  const o = t.match(s) || [], a = [];
3533
- return (t.match(r) || []).forEach((l, h) => {
3534
- l.includes("ignore") || a.push(o[h]);
3535
- }), a.forEach((l) => {
3536
- if (!e.includes(l)) {
3518
+ return (t.match(r) || []).forEach((h, l) => {
3519
+ h.includes("ignore") || a.push(o[l]);
3520
+ }), a.forEach((h) => {
3521
+ if (!e.includes(h)) {
3537
3522
  i = !1;
3538
3523
  return;
3539
3524
  }
@@ -3565,15 +3550,15 @@ class EmbedderService {
3565
3550
  let o = e.embed;
3566
3551
  for (const a of i) {
3567
3552
  let c = s.split(a)[0];
3568
- const l = c.split("}");
3569
- l.length > 1 && (c = l[l.length - 1]);
3570
- let h = t.split(c)[1];
3571
- if (!h)
3553
+ const h = c.split("}");
3554
+ h.length > 1 && (c = h[h.length - 1]);
3555
+ let l = t.split(c)[1];
3556
+ if (!l)
3572
3557
  continue;
3573
- const p = s.split(a)[1].split("{")[0];
3574
- p && (h = h.split(p)[0]);
3575
- const d = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
3576
- o = o.replace(d, h);
3558
+ const E = s.split(a)[1].split("{")[0];
3559
+ E && (l = l.split(E)[0]);
3560
+ const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
3561
+ o = o.replace(p, l);
3577
3562
  }
3578
3563
  return o;
3579
3564
  }
@@ -4002,17 +3987,17 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
4002
3987
  try {
4003
3988
  let o = "/workspace/documents?filter=all&hierarchical=true";
4004
3989
  s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
4005
- const c = (await this.httpGet(o)).filter((l) => !l.deleted).map((l) => {
4006
- const h = l.metadata["content-type"] && l.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${l._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
3990
+ const c = (await this.httpGet(o)).filter((h) => !h.deleted).map((h) => {
3991
+ const l = h.metadata["content-type"] && h.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${h._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
4007
3992
  return this.dataToResource({
4008
- title: l.name,
4009
- ownerName: l.ownerName,
4010
- owner: l.owner,
4011
- icon: h,
4012
- path: `/workspace/document/${l._id}`,
4013
- _id: l._id,
4014
- shared: !!(l.shared && l.shared.length >= 0),
4015
- modified: l.modified
3993
+ title: h.name,
3994
+ ownerName: h.ownerName,
3995
+ owner: h.owner,
3996
+ icon: l,
3997
+ path: `/workspace/document/${h._id}`,
3998
+ _id: h._id,
3999
+ shared: !!(h.shared && h.shared.length >= 0),
4000
+ modified: h.modified
4016
4001
  });
4017
4002
  });
4018
4003
  r(c);
@@ -4579,18 +4564,18 @@ class WidgetFramework {
4579
4564
  t.listSkins().then((r) => {
4580
4565
  var a;
4581
4566
  const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
4582
- this._widgets = this._widgets.filter((c, l) => {
4583
- const h = c.platformConf.name;
4584
- return i.indexOf(h) !== -1 ? !1 : (this._userPrefs[h] || (this._userPrefs[h] = {
4585
- index: defaultWidgetOrder[h] ?? 999,
4567
+ this._widgets = this._widgets.filter((c, h) => {
4568
+ const l = c.platformConf.name;
4569
+ return i.indexOf(l) !== -1 ? !1 : (this._userPrefs[l] || (this._userPrefs[l] = {
4570
+ index: defaultWidgetOrder[l] ?? 999,
4586
4571
  show: !0,
4587
4572
  position: c.platformConf.position
4588
- }), c.platformConf.mandatory && (this._userPrefs[h].show = !0, this._userPrefs[h].index = defaultWidgetOrder[h] ?? 999), c.platformConf.i18n && s.push(c.platformConf.i18n), c.applyUserPref(this._userPrefs[h]), !0);
4573
+ }), 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);
4589
4574
  });
4590
4575
  const o = new Idiom();
4591
- this._widgets = this._widgets.sort((c, l) => {
4592
- const h = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), p = o.translate(`timeline.settings.${l.platformConf.name}`).toLowerCase();
4593
- return h < p ? -1 : h > p ? 1 : 0;
4576
+ this._widgets = this._widgets.sort((c, h) => {
4577
+ const l = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${h.platformConf.name}`).toLowerCase();
4578
+ return l < E ? -1 : l > E ? 1 : 0;
4594
4579
  });
4595
4580
  });
4596
4581
  }