@hublo/mstaff-client-sdk 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/main.cjs +1 -0
- package/dist/main.js +1403 -0
- package/dist/mocks.cjs +15 -0
- package/dist/mocks.js +2421 -0
- package/package.json +63 -0
package/dist/main.js
ADDED
|
@@ -0,0 +1,1403 @@
|
|
|
1
|
+
var X = Object.defineProperty;
|
|
2
|
+
var Y = (e, t, r) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var v = (e, t, r) => (Y(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { reactive as ee, h as _ } from "vue";
|
|
5
|
+
import te from "axios";
|
|
6
|
+
import { defineStore as ne } from "pinia";
|
|
7
|
+
import { useTimeAgo as re } from "@vueuse/core";
|
|
8
|
+
var z = {
|
|
9
|
+
expireTimes: "1d",
|
|
10
|
+
path: "; path=/",
|
|
11
|
+
domain: "",
|
|
12
|
+
secure: !1,
|
|
13
|
+
sameSite: "; SameSite=Lax"
|
|
14
|
+
}, ie = (
|
|
15
|
+
/** @class */
|
|
16
|
+
function() {
|
|
17
|
+
function e() {
|
|
18
|
+
this.current_default_config = z;
|
|
19
|
+
}
|
|
20
|
+
return e.prototype.config = function(t) {
|
|
21
|
+
for (var r in this.current_default_config)
|
|
22
|
+
this.current_default_config[r] = t[r] ? t[r] : z[r];
|
|
23
|
+
}, e.prototype.get = function(t) {
|
|
24
|
+
var r = decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(t).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
|
|
25
|
+
if (r && r.substring(0, 1) === "{" && r.substring(r.length - 1, r.length) === "}")
|
|
26
|
+
try {
|
|
27
|
+
r = JSON.parse(r);
|
|
28
|
+
} catch {
|
|
29
|
+
return r;
|
|
30
|
+
}
|
|
31
|
+
return r;
|
|
32
|
+
}, e.prototype.set = function(t, r, n, i, c, d, m) {
|
|
33
|
+
if (t) {
|
|
34
|
+
if (/^(?:expires|max-age|path|domain|secure|SameSite)$/i.test(t))
|
|
35
|
+
throw new Error('Cookie name illegality. Cannot be set to ["expires","max-age","path","domain","secure","SameSite"] current key name: ' + t);
|
|
36
|
+
} else
|
|
37
|
+
throw new Error("Cookie name is not found in the first argument.");
|
|
38
|
+
r && r.constructor === Object && (r = JSON.stringify(r));
|
|
39
|
+
var l = "";
|
|
40
|
+
if (n == null && (n = this.current_default_config.expireTimes ? this.current_default_config.expireTimes : ""), n && n != 0)
|
|
41
|
+
switch (n.constructor) {
|
|
42
|
+
case Number:
|
|
43
|
+
n === 1 / 0 || n === -1 ? l = "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : l = "; max-age=" + n;
|
|
44
|
+
break;
|
|
45
|
+
case String:
|
|
46
|
+
if (/^(?:\d+(y|m|d|h|min|s))$/i.test(n)) {
|
|
47
|
+
var o = n.replace(/^(\d+)(?:y|m|d|h|min|s)$/i, "$1");
|
|
48
|
+
switch (n.replace(/^(?:\d+)(y|m|d|h|min|s)$/i, "$1").toLowerCase()) {
|
|
49
|
+
case "m":
|
|
50
|
+
l = "; max-age=" + +o * 2592e3;
|
|
51
|
+
break;
|
|
52
|
+
case "d":
|
|
53
|
+
l = "; max-age=" + +o * 86400;
|
|
54
|
+
break;
|
|
55
|
+
case "h":
|
|
56
|
+
l = "; max-age=" + +o * 3600;
|
|
57
|
+
break;
|
|
58
|
+
case "min":
|
|
59
|
+
l = "; max-age=" + +o * 60;
|
|
60
|
+
break;
|
|
61
|
+
case "s":
|
|
62
|
+
l = "; max-age=" + o;
|
|
63
|
+
break;
|
|
64
|
+
case "y":
|
|
65
|
+
l = "; max-age=" + +o * 31104e3;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
} else
|
|
69
|
+
l = "; expires=" + n;
|
|
70
|
+
break;
|
|
71
|
+
case Date:
|
|
72
|
+
l = "; expires=" + n.toUTCString();
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
return document.cookie = encodeURIComponent(t) + "=" + encodeURIComponent(r) + l + (c ? "; domain=" + c : this.current_default_config.domain ? this.current_default_config.domain : "") + (i ? "; path=" + i : this.current_default_config.path ? this.current_default_config.path : "; path=/") + (d == null ? this.current_default_config.secure ? "; Secure" : "" : d ? "; Secure" : "") + (m == null ? this.current_default_config.sameSite ? "; SameSute=" + this.current_default_config.sameSite : "" : m ? "; SameSite=" + m : ""), this;
|
|
76
|
+
}, e.prototype.remove = function(t, r, n) {
|
|
77
|
+
return !t || !this.isKey(t) ? !1 : (document.cookie = encodeURIComponent(t) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (n ? "; domain=" + n : this.current_default_config.domain ? this.current_default_config.domain : "") + (r ? "; path=" + r : this.current_default_config.path ? this.current_default_config.path : "; path=/") + "; SameSite=Lax", !0);
|
|
78
|
+
}, e.prototype.isKey = function(t) {
|
|
79
|
+
return new RegExp("(?:^|;\\s*)" + encodeURIComponent(t).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=").test(document.cookie);
|
|
80
|
+
}, e.prototype.keys = function() {
|
|
81
|
+
if (!document.cookie)
|
|
82
|
+
return [];
|
|
83
|
+
for (var t = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/), r = 0; r < t.length; r++)
|
|
84
|
+
t[r] = decodeURIComponent(t[r]);
|
|
85
|
+
return t;
|
|
86
|
+
}, e;
|
|
87
|
+
}()
|
|
88
|
+
), T = null;
|
|
89
|
+
function oe() {
|
|
90
|
+
T == null && (T = new ie());
|
|
91
|
+
var e = ee(T);
|
|
92
|
+
return { cookies: e };
|
|
93
|
+
}
|
|
94
|
+
function se() {
|
|
95
|
+
const { cookies: e } = oe();
|
|
96
|
+
function t(c) {
|
|
97
|
+
return e.get(c);
|
|
98
|
+
}
|
|
99
|
+
function r(c, d) {
|
|
100
|
+
return e.set(c, d);
|
|
101
|
+
}
|
|
102
|
+
function n(c) {
|
|
103
|
+
return e.remove(c);
|
|
104
|
+
}
|
|
105
|
+
function i() {
|
|
106
|
+
e.keys().forEach((c) => n(c));
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
getItem: t,
|
|
110
|
+
setItem: r,
|
|
111
|
+
removeItem: n,
|
|
112
|
+
clear: i
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
let L = null;
|
|
116
|
+
function D(e = {
|
|
117
|
+
auth: "token",
|
|
118
|
+
refresh: "refresh_token",
|
|
119
|
+
expiration: "token_expiration_date"
|
|
120
|
+
}, t = se()) {
|
|
121
|
+
if (L)
|
|
122
|
+
return L;
|
|
123
|
+
function r() {
|
|
124
|
+
return t.getItem(e.auth);
|
|
125
|
+
}
|
|
126
|
+
function n() {
|
|
127
|
+
return t.getItem(e.refresh);
|
|
128
|
+
}
|
|
129
|
+
function i() {
|
|
130
|
+
return t.getItem(e.expiration);
|
|
131
|
+
}
|
|
132
|
+
function c(f, p) {
|
|
133
|
+
const h = s(f);
|
|
134
|
+
if (!h.exp)
|
|
135
|
+
throw new Error("Invalid JWT token.");
|
|
136
|
+
t.setItem(e.auth, f), t.setItem(e.refresh, p), t.setItem(e.expiration, ((h.exp - 60) * 1e3).toString());
|
|
137
|
+
}
|
|
138
|
+
function d() {
|
|
139
|
+
t.removeItem(e.auth), t.removeItem(e.refresh), t.removeItem(e.expiration);
|
|
140
|
+
}
|
|
141
|
+
function m() {
|
|
142
|
+
return l() && !o();
|
|
143
|
+
}
|
|
144
|
+
function l() {
|
|
145
|
+
return !!r();
|
|
146
|
+
}
|
|
147
|
+
function o() {
|
|
148
|
+
const f = i();
|
|
149
|
+
return f ? new Date(f) < /* @__PURE__ */ new Date() : !0;
|
|
150
|
+
}
|
|
151
|
+
function s(f) {
|
|
152
|
+
return JSON.parse(atob(f.split(".")[1]));
|
|
153
|
+
}
|
|
154
|
+
function u() {
|
|
155
|
+
return t;
|
|
156
|
+
}
|
|
157
|
+
return L = {
|
|
158
|
+
keys: e,
|
|
159
|
+
getAuthToken: r,
|
|
160
|
+
getRefreshToken: n,
|
|
161
|
+
getExpiration: i,
|
|
162
|
+
authenticate: c,
|
|
163
|
+
clear: d,
|
|
164
|
+
isAuthenticated: m,
|
|
165
|
+
hasAuth: l,
|
|
166
|
+
isExpired: o,
|
|
167
|
+
getStorage: u
|
|
168
|
+
}, L;
|
|
169
|
+
}
|
|
170
|
+
function ae(e) {
|
|
171
|
+
let t = {
|
|
172
|
+
"Content-Type": "application/json"
|
|
173
|
+
};
|
|
174
|
+
e && r(e);
|
|
175
|
+
function r(h, b = !1) {
|
|
176
|
+
return t = b ? h : { ...t, ...h }, this;
|
|
177
|
+
}
|
|
178
|
+
function n() {
|
|
179
|
+
return t;
|
|
180
|
+
}
|
|
181
|
+
function i(h, b) {
|
|
182
|
+
return t[h] = b, this;
|
|
183
|
+
}
|
|
184
|
+
function c(h) {
|
|
185
|
+
return t[h];
|
|
186
|
+
}
|
|
187
|
+
function d(h) {
|
|
188
|
+
return t[h] && delete t[h], this;
|
|
189
|
+
}
|
|
190
|
+
function m(h) {
|
|
191
|
+
return i("Authorization", "Bearer " + h), this;
|
|
192
|
+
}
|
|
193
|
+
function l() {
|
|
194
|
+
return d("Authorization"), this;
|
|
195
|
+
}
|
|
196
|
+
function o() {
|
|
197
|
+
return !!c("Authorization");
|
|
198
|
+
}
|
|
199
|
+
function s() {
|
|
200
|
+
return i("Content-Type", "multipart/form-data"), this;
|
|
201
|
+
}
|
|
202
|
+
function u() {
|
|
203
|
+
return i("Content-Type", "application/json"), this;
|
|
204
|
+
}
|
|
205
|
+
function f() {
|
|
206
|
+
return c("Content-Type") === "multipart/form-data";
|
|
207
|
+
}
|
|
208
|
+
function p() {
|
|
209
|
+
return c("Content-Type") === "application/json";
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
setHeaders: r,
|
|
213
|
+
getHeaders: n,
|
|
214
|
+
setHeader: i,
|
|
215
|
+
getHeader: c,
|
|
216
|
+
removeHeader: d,
|
|
217
|
+
setAuthorization: m,
|
|
218
|
+
removeAuthorization: l,
|
|
219
|
+
hasAuthorization: o,
|
|
220
|
+
setFormData: s,
|
|
221
|
+
setJson: u,
|
|
222
|
+
isFormData: f,
|
|
223
|
+
isJson: p
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function ce(e) {
|
|
227
|
+
let t = null;
|
|
228
|
+
e && r(e);
|
|
229
|
+
function r(i) {
|
|
230
|
+
if (i = i.toLowerCase(), !["get", "post", "put", "patch", "delete"].includes(i))
|
|
231
|
+
throw new Error("Invalid method.");
|
|
232
|
+
return t = i, this;
|
|
233
|
+
}
|
|
234
|
+
function n() {
|
|
235
|
+
return t;
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
setMethod: r,
|
|
239
|
+
getMethod: n
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function ue(e, t, r) {
|
|
243
|
+
let n = null;
|
|
244
|
+
r && i(r);
|
|
245
|
+
function i(o) {
|
|
246
|
+
if (!["post", "put", "patch"].includes(e.getMethod()))
|
|
247
|
+
throw new Error("Payload can only be set for POST, PUT and PATCH requests.");
|
|
248
|
+
return o instanceof FormData ? t.setFormData() : d(o) && (o = m(o), t.setFormData()), t.isFormData() && e.getMethod() === "put" && (e.setMethod("post"), o.append("_method", "PUT")), n = o, this;
|
|
249
|
+
}
|
|
250
|
+
function c() {
|
|
251
|
+
return n;
|
|
252
|
+
}
|
|
253
|
+
function d(o) {
|
|
254
|
+
for (const s in o) {
|
|
255
|
+
const u = o[s];
|
|
256
|
+
if (l(u))
|
|
257
|
+
return !0;
|
|
258
|
+
if (typeof u == "object" && d(u))
|
|
259
|
+
return !0;
|
|
260
|
+
}
|
|
261
|
+
return !1;
|
|
262
|
+
}
|
|
263
|
+
function m(o, s = null, u = 0) {
|
|
264
|
+
const f = !s;
|
|
265
|
+
f && (s = new FormData());
|
|
266
|
+
for (const p in o) {
|
|
267
|
+
const h = o[p];
|
|
268
|
+
l(h) ? (o[p] = "<<FileIndex:" + u + ">>", s.append(u, h, h.name), u++) : typeof h == "object" && (o[p] = m(o[p], s, u));
|
|
269
|
+
}
|
|
270
|
+
return f ? (s.append("payload", JSON.stringify(o)), s) : o;
|
|
271
|
+
}
|
|
272
|
+
function l(o) {
|
|
273
|
+
return typeof File < "u" && o instanceof File || typeof Blob < "u" && o instanceof Blob;
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
setPayload: i,
|
|
277
|
+
getPayload: c
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
const I = class I {
|
|
281
|
+
/**
|
|
282
|
+
* Construct the class with the provided sub logger.
|
|
283
|
+
*/
|
|
284
|
+
constructor(t = {}) {
|
|
285
|
+
/** LEVEL represent the current logging level */
|
|
286
|
+
v(this, "level", 3);
|
|
287
|
+
/** Underlying logger to use. Default to console */
|
|
288
|
+
v(this, "logger");
|
|
289
|
+
/** Prefix to use for messages */
|
|
290
|
+
v(this, "prefix");
|
|
291
|
+
this.logger = t.logger || console, this.prefix = t.prefix || "";
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* setLevel change the current logging level to display
|
|
295
|
+
* @param {Number} level
|
|
296
|
+
*/
|
|
297
|
+
setLevel(t) {
|
|
298
|
+
this.level = t;
|
|
299
|
+
}
|
|
300
|
+
/** debug display messages only if level is DEBUG or less */
|
|
301
|
+
debug(...t) {
|
|
302
|
+
this.level <= I.LEVEL_DEBUG && M(this.logger.debug, this.prefix, t);
|
|
303
|
+
}
|
|
304
|
+
/** info display messages only if level is INFO or less */
|
|
305
|
+
info(...t) {
|
|
306
|
+
this.level <= I.LEVEL_INFO && M(this.logger.info, this.prefix, t);
|
|
307
|
+
}
|
|
308
|
+
/** warn display messages only if level is WARN or less */
|
|
309
|
+
warn(...t) {
|
|
310
|
+
this.level <= I.LEVEL_WARN && M(this.logger.warn, this.prefix, t);
|
|
311
|
+
}
|
|
312
|
+
/** error display messages only if level is ERROR or less */
|
|
313
|
+
error(...t) {
|
|
314
|
+
this.level <= I.LEVEL_ERROR && M(this.logger.error, this.prefix, t);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
/** Possible logging level by order of verbosity (more verbose first) */
|
|
318
|
+
v(I, "LEVEL_DEBUG", 0), v(I, "LEVEL_INFO", 1), v(I, "LEVEL_WARN", 2), v(I, "LEVEL_ERROR", 3), v(I, "LEVEL_OFF", 4);
|
|
319
|
+
let j = I;
|
|
320
|
+
const M = (e, t, r) => {
|
|
321
|
+
t ? e(t, ...r) : e(...r);
|
|
322
|
+
}, x = new j({
|
|
323
|
+
prefix: "[SDK]"
|
|
324
|
+
});
|
|
325
|
+
let V = null, Q = null, G = null, U = null;
|
|
326
|
+
const le = () => V, de = (e) => {
|
|
327
|
+
if (x.info("[Config] Environment:", e), !e)
|
|
328
|
+
throw new Error("Invalid environment.");
|
|
329
|
+
V = e;
|
|
330
|
+
}, me = () => Q, fe = (e) => {
|
|
331
|
+
if (x.info("[Config] API Host:", e), !e)
|
|
332
|
+
throw new Error("Invalid API host.");
|
|
333
|
+
Q = e;
|
|
334
|
+
}, pe = () => U, he = (e) => {
|
|
335
|
+
U = e;
|
|
336
|
+
}, ye = () => G, ge = (e) => {
|
|
337
|
+
if (x.info("[Config] Main App Host:", e), !e)
|
|
338
|
+
throw new Error("Invalid main app host.");
|
|
339
|
+
G = e;
|
|
340
|
+
}, $ = {
|
|
341
|
+
getEnvironment: le,
|
|
342
|
+
getApiHost: me,
|
|
343
|
+
getErrorHandler: pe,
|
|
344
|
+
setEnvironment: de,
|
|
345
|
+
setApiHost: fe,
|
|
346
|
+
setErrorHandler: he,
|
|
347
|
+
getMainAppHost: ye,
|
|
348
|
+
setMainAppHost: ge
|
|
349
|
+
};
|
|
350
|
+
function be(e) {
|
|
351
|
+
const t = $.getApiHost().replace(/\/$/g, "");
|
|
352
|
+
let r = null, n = {}, i = {};
|
|
353
|
+
e && m(e);
|
|
354
|
+
function c() {
|
|
355
|
+
return t + l() + p();
|
|
356
|
+
}
|
|
357
|
+
function d() {
|
|
358
|
+
return l(!0, !0);
|
|
359
|
+
}
|
|
360
|
+
function m(a) {
|
|
361
|
+
return r = "/" + a.replace(/^\//g, ""), this;
|
|
362
|
+
}
|
|
363
|
+
function l(a = !0, R = !1) {
|
|
364
|
+
return a ? r.replace(/:(\w+)/g, (A, E) => R ? "*" : i[E] || ":" + E) : r;
|
|
365
|
+
}
|
|
366
|
+
function o(a) {
|
|
367
|
+
return n = a, this;
|
|
368
|
+
}
|
|
369
|
+
function s(a, R) {
|
|
370
|
+
return n[a] = R, this;
|
|
371
|
+
}
|
|
372
|
+
function u(a) {
|
|
373
|
+
return n[a] && delete n[a], this;
|
|
374
|
+
}
|
|
375
|
+
function f() {
|
|
376
|
+
return Object.keys(n).length > 0;
|
|
377
|
+
}
|
|
378
|
+
function p(a = !0) {
|
|
379
|
+
if (!f())
|
|
380
|
+
return "";
|
|
381
|
+
let R = "";
|
|
382
|
+
for (const A in n)
|
|
383
|
+
if (Array.isArray(n[A]))
|
|
384
|
+
for (const E of n[A])
|
|
385
|
+
R += (R.length ? "&" : "") + `${A}[]=` + E;
|
|
386
|
+
else
|
|
387
|
+
R += (R.length ? "&" : "") + A + "=" + n[A];
|
|
388
|
+
return (a ? "?" : "") + R;
|
|
389
|
+
}
|
|
390
|
+
function h(a) {
|
|
391
|
+
return i = a, this;
|
|
392
|
+
}
|
|
393
|
+
function b(a, R) {
|
|
394
|
+
return i[a] = R, this;
|
|
395
|
+
}
|
|
396
|
+
function S(a) {
|
|
397
|
+
return i[a] && delete i[a], this;
|
|
398
|
+
}
|
|
399
|
+
return {
|
|
400
|
+
setPath: m,
|
|
401
|
+
getPath: l,
|
|
402
|
+
getUri: c,
|
|
403
|
+
getMockUri: d,
|
|
404
|
+
setQueryParams: o,
|
|
405
|
+
setQueryParam: s,
|
|
406
|
+
removeQueryParam: u,
|
|
407
|
+
hasQuery: f,
|
|
408
|
+
getQueryString: p,
|
|
409
|
+
setRouteParams: h,
|
|
410
|
+
setRouteParam: b,
|
|
411
|
+
removeRouteParam: S
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function we(e) {
|
|
415
|
+
let t = [];
|
|
416
|
+
function r() {
|
|
417
|
+
return t = o(arguments), d(), this;
|
|
418
|
+
}
|
|
419
|
+
function n() {
|
|
420
|
+
return t.length > 0;
|
|
421
|
+
}
|
|
422
|
+
function i(s) {
|
|
423
|
+
return t.includes(s.trim()) ? this : (t.push(s.trim()), d(), this);
|
|
424
|
+
}
|
|
425
|
+
function c(s) {
|
|
426
|
+
const u = t.indexOf(s.trim());
|
|
427
|
+
return u === -1 ? this : (t.splice(u, 1), d(), this);
|
|
428
|
+
}
|
|
429
|
+
function d() {
|
|
430
|
+
t.length ? e.setQueryParam("groups", l(t)) : e.removeQueryParam("groups");
|
|
431
|
+
}
|
|
432
|
+
function m(s) {
|
|
433
|
+
return s.split(",").map((u) => u.trim());
|
|
434
|
+
}
|
|
435
|
+
function l(s) {
|
|
436
|
+
return s.join(",");
|
|
437
|
+
}
|
|
438
|
+
function o(s) {
|
|
439
|
+
let u = [];
|
|
440
|
+
return s.length === 1 ? typeof s[0] == "string" ? u = m(s[0]) : Array.isArray(s[0]) && (u = s[0]) : u = Array.from(s), u;
|
|
441
|
+
}
|
|
442
|
+
return {
|
|
443
|
+
setGroups: r,
|
|
444
|
+
hasGroups: n,
|
|
445
|
+
addGroup: i,
|
|
446
|
+
removeGroup: c
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
function Re(e) {
|
|
450
|
+
let t = !1, r = !1, n = 1, i = 10;
|
|
451
|
+
function c() {
|
|
452
|
+
return t = !0, d(), this;
|
|
453
|
+
}
|
|
454
|
+
function d() {
|
|
455
|
+
r = !0;
|
|
456
|
+
const p = f(arguments);
|
|
457
|
+
return o(p.page || 1, !1), s(p.perPage || i, !1), u(), this;
|
|
458
|
+
}
|
|
459
|
+
function m() {
|
|
460
|
+
return r = !1, u(), this;
|
|
461
|
+
}
|
|
462
|
+
function l() {
|
|
463
|
+
return r;
|
|
464
|
+
}
|
|
465
|
+
function o(p, h = !0) {
|
|
466
|
+
return t = !0, r = !0, n = p, h && u(), this;
|
|
467
|
+
}
|
|
468
|
+
function s(p, h = !0) {
|
|
469
|
+
return t = !0, r = !0, i = p, h && u(), this;
|
|
470
|
+
}
|
|
471
|
+
function u() {
|
|
472
|
+
t ? l() ? (e.removeQueryParam("pagination"), e.setQueryParam("page", n), e.setQueryParam("nbResultPerPage", i)) : (e.removeQueryParam("page"), e.removeQueryParam("nbResultPerPage"), e.setQueryParam("pagination", "false")) : (e.removeQueryParam("page"), e.removeQueryParam("nbResultPerPage"), e.removeQueryParam("pagination"));
|
|
473
|
+
}
|
|
474
|
+
function f(p) {
|
|
475
|
+
if (p.length === 1 && typeof p[0] == "object")
|
|
476
|
+
return p[0];
|
|
477
|
+
const h = {};
|
|
478
|
+
return p.length >= 1 && (h.page = p[0]), p.length >= 2 && (h.perPage = p[1]), h;
|
|
479
|
+
}
|
|
480
|
+
return {
|
|
481
|
+
isList: c,
|
|
482
|
+
paginate: d,
|
|
483
|
+
disablePagination: m,
|
|
484
|
+
hasPagination: l,
|
|
485
|
+
setPage: o,
|
|
486
|
+
setPerPage: s
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function Ae(e) {
|
|
490
|
+
let t = !1, r = "id", n = "ASC";
|
|
491
|
+
function i() {
|
|
492
|
+
t = !0;
|
|
493
|
+
const s = o(arguments);
|
|
494
|
+
return s.orderBy && d(s.orderBy, !1), s.orderDir && m(s.orderDir, !1), l(), this;
|
|
495
|
+
}
|
|
496
|
+
function c() {
|
|
497
|
+
return t;
|
|
498
|
+
}
|
|
499
|
+
function d(s, u = !0) {
|
|
500
|
+
return t = !0, r = s, u && l(), this;
|
|
501
|
+
}
|
|
502
|
+
function m(s, u = !0) {
|
|
503
|
+
if (s = s.toUpperCase(), ["ASC", "DESC"].indexOf(s) === -1)
|
|
504
|
+
throw new Error("Invalid order direction");
|
|
505
|
+
return t = !0, n = s, u && l(), this;
|
|
506
|
+
}
|
|
507
|
+
function l() {
|
|
508
|
+
c() && (e.setQueryParam("orderBy", r), e.setQueryParam("orderDirection", n));
|
|
509
|
+
}
|
|
510
|
+
function o(s) {
|
|
511
|
+
if (s.length === 1 && typeof s[0] == "object")
|
|
512
|
+
return s[0];
|
|
513
|
+
const u = {};
|
|
514
|
+
return s.length >= 1 && (u.orderBy = s[0]), s.length >= 2 && (u.orderDir = s[1]), u;
|
|
515
|
+
}
|
|
516
|
+
return {
|
|
517
|
+
setOrder: i,
|
|
518
|
+
hasOrder: c,
|
|
519
|
+
setOrderBy: d,
|
|
520
|
+
setOrderDir: m
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
function Ie() {
|
|
524
|
+
let e = !1;
|
|
525
|
+
function t() {
|
|
526
|
+
return e = !0, this;
|
|
527
|
+
}
|
|
528
|
+
function r() {
|
|
529
|
+
return e;
|
|
530
|
+
}
|
|
531
|
+
return {
|
|
532
|
+
setSilent: t,
|
|
533
|
+
isSilent: r
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
function Pe() {
|
|
537
|
+
let e = "json";
|
|
538
|
+
function t(n = "json") {
|
|
539
|
+
if (["arraybuffer", "document", "json", "text", "stream", "blob"].indexOf(n) === -1)
|
|
540
|
+
throw new Error("Invalid response type");
|
|
541
|
+
return e = n, this;
|
|
542
|
+
}
|
|
543
|
+
function r() {
|
|
544
|
+
return e;
|
|
545
|
+
}
|
|
546
|
+
return {
|
|
547
|
+
setResponseType: t,
|
|
548
|
+
getResponseType: r
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function ve(e) {
|
|
552
|
+
function t() {
|
|
553
|
+
return e;
|
|
554
|
+
}
|
|
555
|
+
function r() {
|
|
556
|
+
return e.data;
|
|
557
|
+
}
|
|
558
|
+
function n() {
|
|
559
|
+
return e.data;
|
|
560
|
+
}
|
|
561
|
+
return {
|
|
562
|
+
getResponse: t,
|
|
563
|
+
getData: r,
|
|
564
|
+
getPayload: n
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
function Ee(e, t = !1) {
|
|
568
|
+
let r = !1, n = !1;
|
|
569
|
+
return e.response ? (r = !0, n = !0) : e.request && (r = !0), !t && $.getErrorHandler() && $.getErrorHandler()(e), {
|
|
570
|
+
sent: r,
|
|
571
|
+
responded: n,
|
|
572
|
+
error: e
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
function Se(e) {
|
|
576
|
+
function t() {
|
|
577
|
+
return e;
|
|
578
|
+
}
|
|
579
|
+
function r() {
|
|
580
|
+
return e.data;
|
|
581
|
+
}
|
|
582
|
+
function n() {
|
|
583
|
+
return e.data;
|
|
584
|
+
}
|
|
585
|
+
function i() {
|
|
586
|
+
return e.data["@type"] === "hydra:Collection";
|
|
587
|
+
}
|
|
588
|
+
function c() {
|
|
589
|
+
return i() ? e.data["hydra:member"] : null;
|
|
590
|
+
}
|
|
591
|
+
function d() {
|
|
592
|
+
return i() ? e.data["hydra:totalItems"] : null;
|
|
593
|
+
}
|
|
594
|
+
function m() {
|
|
595
|
+
return i() ? e.data["hydra:view"] && e.data["hydra:view"]["hydra:last"] : !1;
|
|
596
|
+
}
|
|
597
|
+
function l() {
|
|
598
|
+
return !i() || !m() ? null : parseInt(e.data["hydra:view"]["@id"].match(/page=(\d+)/)[1]);
|
|
599
|
+
}
|
|
600
|
+
function o() {
|
|
601
|
+
return !i() || !m() ? null : parseInt(e.data["hydra:view"]["hydra:last"].match(/page=(\d+)/)[1]);
|
|
602
|
+
}
|
|
603
|
+
return {
|
|
604
|
+
getResponse: t,
|
|
605
|
+
getData: r,
|
|
606
|
+
getPayload: n,
|
|
607
|
+
isCollection: i,
|
|
608
|
+
getCollection: c,
|
|
609
|
+
getTotal: d,
|
|
610
|
+
hasPagination: m,
|
|
611
|
+
getPage: l,
|
|
612
|
+
getPages: o
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
function Ce(e, t, r, n, i, c) {
|
|
616
|
+
async function d() {
|
|
617
|
+
const l = r.getMethod(), o = t.getUri(), s = e.getHeaders(), u = n.getPayload(), f = [o];
|
|
618
|
+
["post", "put", "patch"].includes(l) && f.push(u || {}), f.push({
|
|
619
|
+
headers: s,
|
|
620
|
+
responseType: c.getResponseType()
|
|
621
|
+
}), x.info("[Request] Sending request:", `[${l.toUpperCase()}]`, o);
|
|
622
|
+
try {
|
|
623
|
+
const p = await te[l](...f);
|
|
624
|
+
return m(p);
|
|
625
|
+
} catch (p) {
|
|
626
|
+
throw Ee(p, i.isSilent());
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function m(l) {
|
|
630
|
+
if (l.headers) {
|
|
631
|
+
const o = Object.keys(l.headers), s = o.map((u) => u.toLowerCase()).indexOf("content-type");
|
|
632
|
+
if (s !== -1 && l.headers[o[s]].includes("application/ld+json"))
|
|
633
|
+
return Se(l);
|
|
634
|
+
}
|
|
635
|
+
return ve(l);
|
|
636
|
+
}
|
|
637
|
+
return {
|
|
638
|
+
send: d
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
function w(e, t = "get", r = null) {
|
|
642
|
+
const n = ae(), i = be(e), c = ce(t), d = ue(c, n, r), m = we(i), l = Re(i), o = Ae(i), s = Ie(), u = Pe(), f = Ce(n, i, c, d, s, u);
|
|
643
|
+
return {
|
|
644
|
+
...n,
|
|
645
|
+
...i,
|
|
646
|
+
...c,
|
|
647
|
+
...d,
|
|
648
|
+
...m,
|
|
649
|
+
...l,
|
|
650
|
+
...o,
|
|
651
|
+
...s,
|
|
652
|
+
...u,
|
|
653
|
+
...f
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
function y(e, t = "get", r = null) {
|
|
657
|
+
const n = w(e, t, r), i = D();
|
|
658
|
+
i.isAuthenticated() && n.setAuthorization(i.getAuthToken());
|
|
659
|
+
const c = n.send;
|
|
660
|
+
return n.send = async function() {
|
|
661
|
+
if (!n.hasAuthorization())
|
|
662
|
+
throw new Error("::SDK Request:: Request cannot be sent, missing authorization header.");
|
|
663
|
+
return c();
|
|
664
|
+
}, n;
|
|
665
|
+
}
|
|
666
|
+
const ke = (e, t) => y("/v2/activity/candidate/:candidateId/establishment/:establishmentId").setRouteParams({ candidateId: e, establishmentId: t }), cn = () => ({
|
|
667
|
+
listByCandidateAndEstablishment: ke
|
|
668
|
+
}), $e = (e, t, r) => y("/candidate/:candidateId/share/establishment/:establishmentId").setMethod("post").setRouteParams({ candidateId: e, establishmentId: t }).setPayload(r), Le = (e, t) => y("/candidate/:candidateId/archive/establishment/:establishmentId").setRouteParams({ candidateId: e, establishmentId: t }), Me = (e, t) => y("/candidate/:candidateId/archive/establishment/:establishmentId").setMethod("post").setRouteParams({ candidateId: e, establishmentId: t }), Oe = (e, t) => y("/candidate/:candidateId/archive/establishment/:establishmentId").setMethod("delete").setRouteParams({ candidateId: e, establishmentId: t }), un = () => ({
|
|
669
|
+
share: $e,
|
|
670
|
+
isArchived: Le,
|
|
671
|
+
archive: Me,
|
|
672
|
+
unarchive: Oe
|
|
673
|
+
}), De = (e, t) => y("/comment/establishment/:establishmentId/candidate/:userId").setRouteParams({ establishmentId: e, userId: t }), xe = (e, t, r) => y("/comment/establishment/:establishmentId/candidate/:userId").setRouteParams({ establishmentId: e, userId: t }).setMethod("post").setPayload(r), _e = (e, t) => y("/comment/:commentId").setRouteParams({ commentId: e }).setMethod("put").setPayload(t), Te = (e) => y("/comment/:commentId").setRouteParams({ commentId: e }).setMethod("delete"), ln = () => ({
|
|
674
|
+
getForEstablishmentCandidate: De,
|
|
675
|
+
postForEstablishmentCandidate: xe,
|
|
676
|
+
update: _e,
|
|
677
|
+
remove: Te
|
|
678
|
+
}), je = () => w("contractType").isList().addGroup("Term:id").addGroup("Term:name"), dn = () => ({
|
|
679
|
+
list: je
|
|
680
|
+
}), Ne = (e) => y("/v2/talents").isList().setQueryParam("establishment-id", e), mn = () => ({
|
|
681
|
+
list: Ne
|
|
682
|
+
}), ze = (e, t, r) => y("/cvtheque/establishment/:establishmentId/candidate/:candidateId/label/synchronize").setRouteParams({ establishmentId: e, candidateId: t }).setMethod("post").setPayload(r), fn = () => ({
|
|
683
|
+
syncCandidateLabels: ze
|
|
684
|
+
}), Fe = () => w("diploma").isList().addGroup("Term:id").addGroup("Term:name"), pn = () => ({
|
|
685
|
+
list: Fe
|
|
686
|
+
}), qe = (e) => y("document/candidate/:candidateId").setRouteParams({ candidateId: e }).isList().disablePagination(), Be = (e, t) => y("document/candidate/:candidateId/establishment/:establishmentId/recruiter").setRouteParams({ candidateId: e, establishmentId: t }).isList().disablePagination(), He = (e, t) => y("document/candidate/:candidateId/establishment/:establishmentId/candidate").setRouteParams({ candidateId: e, establishmentId: t }).isList().disablePagination(), Ve = (e) => y("document/recruiter").setMethod("post").setPayload(e), Qe = (e) => y("document/:documentId").setRouteParams({ documentId: e }).setMethod("delete"), hn = () => ({
|
|
687
|
+
listByCandidate: qe,
|
|
688
|
+
listByCandidateAndEstablishmentFromRecruiter: Be,
|
|
689
|
+
listByCandidateAndEstablishmentFromCandidate: He,
|
|
690
|
+
addFromRecruiter: Ve,
|
|
691
|
+
remove: Qe
|
|
692
|
+
}), Ge = (e, t) => y("/v2/establishments/:establishmentId/email-history").setRouteParams({ establishmentId: t }).setQueryParam("receiverId", e).isList().disablePagination(), yn = () => ({
|
|
693
|
+
listByCandidateAndEstablishment: Ge
|
|
694
|
+
}), Ue = (e, t) => y("/email/candidate/:candidateId").setMethod("post").setRouteParams({ candidateId: e }).setPayload(t), Ke = (e, t) => y("/v2/emails/send").setMethod("post").setFormData().setPayload({ recipientIds: e, ...t }), gn = () => ({
|
|
695
|
+
sendToCandidate: Ue,
|
|
696
|
+
sendToRecipients: Ke
|
|
697
|
+
}), Je = (e, t = !0) => {
|
|
698
|
+
const r = y("/v2/establishments/:establishmentId/email-templates").setRouteParams({ establishmentId: e }).isList().disablePagination();
|
|
699
|
+
return t && r.setQueryParam("global", !0), r;
|
|
700
|
+
}, We = () => y("/v2/self/email-templates").isList().disablePagination(), bn = () => ({
|
|
701
|
+
listByEstablishment: Je,
|
|
702
|
+
listSelf: We
|
|
703
|
+
}), Ze = (e, t) => y("establishment-career/:establishmentId/:versionId").setRouteParams({ establishmentId: e, versionId: t }), Xe = (e, t = "published") => y("establishment-career/:establishmentId/state/:state").setRouteParams({ establishmentId: e, state: t }), Ye = (e, t, r = null) => {
|
|
704
|
+
const n = r !== null ? y("establishment-career/:establishmentId/:versionId").setRouteParams({ establishmentId: e, versionId: r }) : y("establishment-career/:establishmentId").setRouteParams({ establishmentId: e });
|
|
705
|
+
return n.setMethod("post").setPayload(t), n;
|
|
706
|
+
}, et = (e, t) => y("establishment-career/:establishmentId/logo-banner").setMethod("post").setRouteParams({ establishmentId: e }).setPayload(t), tt = (e, t, r) => y("establishment-career/:establishmentId/publish/:versionId").setMethod("post").setRouteParams({ establishmentId: e, versionId: t }).setPayload(r), wn = () => ({
|
|
707
|
+
readById: Ze,
|
|
708
|
+
readByState: Xe,
|
|
709
|
+
upsert: Ye,
|
|
710
|
+
uploadLogoAndBanner: et,
|
|
711
|
+
publish: tt
|
|
712
|
+
}), nt = (e) => w("establishment/:establishmentId").setRouteParams({ establishmentId: e }), rt = (e) => y("establishment/:establishmentId/authorizations").setRouteParams({ establishmentId: e }), K = () => ({
|
|
713
|
+
read: nt,
|
|
714
|
+
authorizations: rt
|
|
715
|
+
}), it = (e) => w("feature-flag/maintenance").setMethod("post").setPayload(e), ot = (e, t) => w("feature-flag/establishment").setMethod("post").setPayload({ establishment: e, flagName: t }), Rn = () => ({
|
|
716
|
+
maintenanceModeEnabled: it,
|
|
717
|
+
forEstablishment: ot
|
|
718
|
+
}), st = () => w("job").isList().addGroup("Term:id").addGroup("Term:name"), An = () => ({
|
|
719
|
+
list: st
|
|
720
|
+
}), at = (e) => y("/label/establishment/:establishmentId").isList().setRouteParams({ establishmentId: e }), ct = (e, t) => y("/label/establishment/:establishmentId").setMethod("post").setRouteParams({ establishmentId: e }).setPayload(t), ut = (e, t) => y("/label/:labelId").setMethod("put").setRouteParams({ labelId: e }).setPayload(t), lt = (e) => y("/label/:labelId").setMethod("delete").setRouteParams({ labelId: e }), dt = (e, t, r) => y("/label/establishment/:establishmentId/candidate/:candidateId/synchronize").setMethod("post").setPayload(r).setRouteParams({ establishmentId: e, candidateId: t }), In = () => ({
|
|
721
|
+
listByEstablishment: at,
|
|
722
|
+
addToEstablishment: ct,
|
|
723
|
+
update: ut,
|
|
724
|
+
remove: lt,
|
|
725
|
+
syncForCandidate: dt
|
|
726
|
+
}), mt = (e) => w("offer/:offerId").setRouteParams({ offerId: e }), Pn = () => ({
|
|
727
|
+
read: mt
|
|
728
|
+
}), ft = (e, t = !1) => {
|
|
729
|
+
const r = y("/recruiter/establishment/:establishmentId").isList().setRouteParams({ establishmentId: e });
|
|
730
|
+
return t && r.setQueryParam("exclude-me", 1), r;
|
|
731
|
+
}, vn = () => ({
|
|
732
|
+
listByEstablishment: ft
|
|
733
|
+
}), pt = (e) => y("/recruitment/establishment/:establishmentId/mine").isList().setRouteParams({ establishmentId: e }), ht = (e, t) => y("/recruitment/mine/establishment/:establishmentId/has-not/candidate/:candidateId").isList().setRouteParams({ establishmentId: e, candidateId: t }), yt = (e, t) => y("/recruitment/mine/establishment/:establishmentId/has/candidate/:candidateId").isList().setRouteParams({ establishmentId: e, candidateId: t }), gt = (e, t) => y("/recruitment/establishment/:establishmentId/has/candidate/:candidateId").isList().setRouteParams({ establishmentId: e, candidateId: t }), bt = (e, t) => y("/recruitment/:recruitmentId/candidate").setMethod("put").setRouteParams({ recruitmentId: e }).setPayload(t), wt = (e, t) => y("/recruitment/:recruitmentId/candidate/:candidateId").setMethod("delete").setRouteParams({ recruitmentId: e, candidateId: t }), En = () => ({
|
|
734
|
+
mineByEstablishment: pt,
|
|
735
|
+
mineWithoutCandidate: ht,
|
|
736
|
+
mineWithCandidate: yt,
|
|
737
|
+
withCandidate: gt,
|
|
738
|
+
addCandidates: bt,
|
|
739
|
+
removeCandidate: wt
|
|
740
|
+
}), Rt = (e, t, r, n = null) => {
|
|
741
|
+
const i = w("candidate/register/open").setMethod("post"), c = { email: e };
|
|
742
|
+
return t === "establishment" && (c.establishmentId = r), t === "offer" && (c.offerId = r), n && (c.referer = n), i.setPayload(c), i;
|
|
743
|
+
}, At = (e, t) => w("candidate/register/update/:token").setMethod("post").setRouteParams({ token: e }).setPayload(t), It = (e) => w("candidate/register/read/:token").setRouteParams({ token: e }), Pt = (e) => w("candidate/register/close/:token").setMethod("post").setRouteParams({ token: e }), Sn = () => ({
|
|
744
|
+
open: Rt,
|
|
745
|
+
update: At,
|
|
746
|
+
read: It,
|
|
747
|
+
close: Pt
|
|
748
|
+
}), vt = () => w("speciality").isList().addGroup("Term:id").addGroup("Term:name"), Cn = () => ({
|
|
749
|
+
list: vt
|
|
750
|
+
}), Et = (e) => y("/tag/public/establishment/:establishmentId").isList().setRouteParams({ establishmentId: e }), kn = () => ({
|
|
751
|
+
listByEstablishment: Et
|
|
752
|
+
}), St = (e) => w("user/email/isset/:email").setRouteParams({ email: e }), Ct = () => y("user/self").addGroup("user:self"), kt = (e) => y("/user/:uuid").setRouteParams({ uuid: e }), $t = (e) => w("/user/:uuid").setRouteParams({ uuid: e }), J = () => ({
|
|
753
|
+
emailExists: St,
|
|
754
|
+
self: Ct,
|
|
755
|
+
byUuidPrivate: kt,
|
|
756
|
+
byUuid: $t
|
|
757
|
+
});
|
|
758
|
+
let O;
|
|
759
|
+
function Lt() {
|
|
760
|
+
if (O)
|
|
761
|
+
return O;
|
|
762
|
+
const e = {
|
|
763
|
+
user: void 0,
|
|
764
|
+
roles: [],
|
|
765
|
+
establishments: {}
|
|
766
|
+
}, t = async () => {
|
|
767
|
+
if (!D().isAuthenticated())
|
|
768
|
+
throw new Error("::SDK Authorization:: User not authenticated");
|
|
769
|
+
const o = (await J().self().send()).getData();
|
|
770
|
+
e.user = {
|
|
771
|
+
id: o.id,
|
|
772
|
+
email: o.email,
|
|
773
|
+
firstName: o.firstName,
|
|
774
|
+
lastName: o.lastName,
|
|
775
|
+
avatar: o.avatar
|
|
776
|
+
}, e.roles = o.roles;
|
|
777
|
+
}, r = async (o) => {
|
|
778
|
+
if (!D().isAuthenticated())
|
|
779
|
+
throw new Error("::SDK Authorization:: User not authenticated");
|
|
780
|
+
e.establishments[o] = (await K().authorizations(o).send()).getData();
|
|
781
|
+
}, n = (o) => {
|
|
782
|
+
if (e.user === void 0)
|
|
783
|
+
throw new Error("::SDK Authorization:: User not fetched");
|
|
784
|
+
return e.roles.includes(o);
|
|
785
|
+
};
|
|
786
|
+
return O = {
|
|
787
|
+
fetchSelf: t,
|
|
788
|
+
fetchPermission: r,
|
|
789
|
+
hasRole: n,
|
|
790
|
+
hasRoleRH: () => n("ROLE_RH"),
|
|
791
|
+
hasRoleCandidate: () => n("ROLE_CANDIDATE"),
|
|
792
|
+
hasRoleAdmin: () => n("ROLE_ADMIN"),
|
|
793
|
+
hasPermission: (o, ...s) => {
|
|
794
|
+
const u = e.establishments[o];
|
|
795
|
+
if (u === void 0)
|
|
796
|
+
throw new Error(`::SDK Authorization:: Permissions not fetched for establishment ${o}`);
|
|
797
|
+
return s.every((f) => u[f] === !0);
|
|
798
|
+
},
|
|
799
|
+
clear: () => {
|
|
800
|
+
e.user = void 0, e.roles = [], e.establishments = {};
|
|
801
|
+
}
|
|
802
|
+
}, O;
|
|
803
|
+
}
|
|
804
|
+
async function $n(e, ...t) {
|
|
805
|
+
if (!D().isAuthenticated())
|
|
806
|
+
throw "ERR_NOT_AUTHENTICATED";
|
|
807
|
+
const n = Lt();
|
|
808
|
+
await Promise.all([
|
|
809
|
+
n.fetchSelf(),
|
|
810
|
+
n.fetchPermission(e)
|
|
811
|
+
]);
|
|
812
|
+
for (let i = 0; i < t.length; i++) {
|
|
813
|
+
const c = t[i];
|
|
814
|
+
if (!n.hasPermission(e, c))
|
|
815
|
+
throw "ERR_MISSING_PERMISSION";
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
const Ln = ne("authorization", {
|
|
819
|
+
state: () => ({
|
|
820
|
+
user: void 0,
|
|
821
|
+
establishments: {}
|
|
822
|
+
}),
|
|
823
|
+
getters: {
|
|
824
|
+
roles: (e) => e.user.roles ?? [],
|
|
825
|
+
isRH() {
|
|
826
|
+
return this.roles.includes("ROLE_RH");
|
|
827
|
+
},
|
|
828
|
+
isCandidate() {
|
|
829
|
+
return this.roles.includes("ROLE_CANDIDATE");
|
|
830
|
+
},
|
|
831
|
+
isAdmin() {
|
|
832
|
+
return this.roles.includes("ROLE_ADMIN");
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
actions: {
|
|
836
|
+
async fetchSelf(e) {
|
|
837
|
+
if (this.user === void 0 || e) {
|
|
838
|
+
const t = await J().self().send();
|
|
839
|
+
this.user = t.getData();
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
async fetchPermission(e, t) {
|
|
843
|
+
if (!this.establishments[e] || t) {
|
|
844
|
+
const r = await K().authorizations(e).send();
|
|
845
|
+
this.establishments[e] = r.getData();
|
|
846
|
+
}
|
|
847
|
+
},
|
|
848
|
+
hasPermission(e, ...t) {
|
|
849
|
+
const r = this.establishments[e];
|
|
850
|
+
return r === void 0 ? !1 : t.every((n) => r[n] === !0);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}), C = (e, t, r) => {
|
|
854
|
+
const n = typeof t == "string" ? t.split(".") : [t];
|
|
855
|
+
let i = e;
|
|
856
|
+
for (const [c, d] of n.entries()) {
|
|
857
|
+
if (c === n.length - 1)
|
|
858
|
+
return i[d] !== void 0 ? i[d] : r;
|
|
859
|
+
if (!(d in i) || typeof i[d] != "object")
|
|
860
|
+
return r;
|
|
861
|
+
i = i[d];
|
|
862
|
+
}
|
|
863
|
+
return r;
|
|
864
|
+
}, F = (e, t, r) => {
|
|
865
|
+
const n = typeof t == "string" ? t.split(".") : [t], i = (m) => typeof m == "number" || /^\d$/g.test(m), c = (m) => parseInt(m, 10);
|
|
866
|
+
let d = e;
|
|
867
|
+
return n.forEach((m, l) => {
|
|
868
|
+
if (l === n.length - 1)
|
|
869
|
+
d[m] = r;
|
|
870
|
+
else {
|
|
871
|
+
const o = i(n[l + 1]) ? [] : {};
|
|
872
|
+
m = i(m) ? c(m) : m, d[m] = d[m] ?? o, d = d[m];
|
|
873
|
+
}
|
|
874
|
+
}), e;
|
|
875
|
+
}, Mt = (e) => {
|
|
876
|
+
if (typeof e == "object") {
|
|
877
|
+
if (Array.isArray(e))
|
|
878
|
+
return [...e];
|
|
879
|
+
if (Object(e) === e)
|
|
880
|
+
return { ...e };
|
|
881
|
+
}
|
|
882
|
+
return e;
|
|
883
|
+
}, W = (e, t) => {
|
|
884
|
+
const r = { ...e };
|
|
885
|
+
for (const [n, i] of Object.entries(t))
|
|
886
|
+
n in r && typeof r[n] == "object" && typeof i == "object" ? r[n] = W(r[n], i) : r[n] = Mt(i);
|
|
887
|
+
return r;
|
|
888
|
+
};
|
|
889
|
+
let k = null;
|
|
890
|
+
function g() {
|
|
891
|
+
if (k)
|
|
892
|
+
return k;
|
|
893
|
+
const e = $.getEnvironment(), t = (() => e === "prod" || e === "production" ? "pPROC7dPoJ7XdxHrwsTQNXCGX79MJjhp" : e === "staging" ? "823rqOTwVk1ZCWVyBAdLInZ77TcFF0CF" : "TMZX6evFnu87JrBHV5qLwHsld5C6hilZ")(), r = !!t, n = e !== "prod" && e !== "production";
|
|
894
|
+
let i = null;
|
|
895
|
+
function c() {
|
|
896
|
+
return r;
|
|
897
|
+
}
|
|
898
|
+
function d() {
|
|
899
|
+
const f = window.analytics = window.analytics || [];
|
|
900
|
+
if (!f.initialize)
|
|
901
|
+
if (f.invoked)
|
|
902
|
+
window.console && console.error && console.error("Segment snippet included twice.");
|
|
903
|
+
else {
|
|
904
|
+
f.invoked = !0, f.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on", "addSourceMiddleware", "addIntegrationMiddleware", "setAnonymousId", "addDestinationMiddleware"], f.factory = function(p) {
|
|
905
|
+
return function() {
|
|
906
|
+
if (window.analytics.initialized)
|
|
907
|
+
return window.analytics[p].apply(window.analytics, arguments);
|
|
908
|
+
const h = Array.prototype.slice.call(arguments);
|
|
909
|
+
return h.unshift(p), f.push(h), f;
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
for (let p = 0; p < f.methods.length; p++) {
|
|
913
|
+
const h = f.methods[p];
|
|
914
|
+
f[h] = f.factory(h);
|
|
915
|
+
}
|
|
916
|
+
f.load = function(p, h) {
|
|
917
|
+
const b = document.createElement("script");
|
|
918
|
+
b.id = "analytics-script", b.type = "text/javascript", b.async = !0, b.src = "https://cdn.segment.com/analytics.js/v1/" + p + "/analytics.min.js", b.onerror = () => window.dispatchEvent(new Event("analytics-error"));
|
|
919
|
+
const S = document.getElementsByTagName("script")[0];
|
|
920
|
+
S.parentNode.insertBefore(b, S), f._loadOptions = h;
|
|
921
|
+
}, f._writeKey = t, f.SNIPPET_VERSION = "4.16.1", f.load(t), f.page(), f.ready(() => window.dispatchEvent(new Event("analytics-ready")));
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
async function m() {
|
|
925
|
+
return i !== null || (i = new Promise((f, p) => {
|
|
926
|
+
if (!c())
|
|
927
|
+
return u("Analytics is disabled."), f();
|
|
928
|
+
if (window.addEventListener("analytics-ready", () => {
|
|
929
|
+
u("Analytics script loaded successfully."), f();
|
|
930
|
+
}), window.addEventListener("analytics-error", () => {
|
|
931
|
+
u("Analytics script failed to load. Consider disabling your AdBlocker.", null, "error"), p();
|
|
932
|
+
}), u("Loading Analytics script."), window.analytics)
|
|
933
|
+
return f();
|
|
934
|
+
d();
|
|
935
|
+
})), i;
|
|
936
|
+
}
|
|
937
|
+
async function l(f, p) {
|
|
938
|
+
try {
|
|
939
|
+
if (await this.analyticsScriptReady(), u("[identify]", [f, p]), c())
|
|
940
|
+
return window.analytics.identify(f, p);
|
|
941
|
+
} catch {
|
|
942
|
+
u("[identify]", [f, p], "error");
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
async function o(f, p, h) {
|
|
946
|
+
typeof h != "object" && (h = {});
|
|
947
|
+
try {
|
|
948
|
+
if (await this.analyticsScriptReady(), u("[page]", [f, p, h]), c())
|
|
949
|
+
return window.analytics.page(f, {
|
|
950
|
+
category: p,
|
|
951
|
+
...h
|
|
952
|
+
});
|
|
953
|
+
} catch {
|
|
954
|
+
u("[page]", [f, p, h], "error");
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
async function s(f, p, h) {
|
|
958
|
+
typeof h != "object" && (h = {});
|
|
959
|
+
try {
|
|
960
|
+
if (await this.analyticsScriptReady(), u("[track]", [f, p, h]), c())
|
|
961
|
+
return window.analytics.track(f, {
|
|
962
|
+
category: p,
|
|
963
|
+
...h
|
|
964
|
+
});
|
|
965
|
+
} catch {
|
|
966
|
+
u("[track]", [f, p, h], "error");
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
function u(f, p = [], h = "log") {
|
|
970
|
+
p || (p = []), n && console[h](`%cⒶ%c ::SDK Analytics:: ${f}`, "color: green;", "color: inherit;", ...p);
|
|
971
|
+
}
|
|
972
|
+
return k = {
|
|
973
|
+
analyticsScriptReady: m,
|
|
974
|
+
isEnabled: c,
|
|
975
|
+
identify: l,
|
|
976
|
+
page: o,
|
|
977
|
+
track: s,
|
|
978
|
+
consoleMessage: u
|
|
979
|
+
}, k;
|
|
980
|
+
}
|
|
981
|
+
g.destroy = () => k = null;
|
|
982
|
+
function Ot() {
|
|
983
|
+
const e = "Hubler Application";
|
|
984
|
+
function t(o) {
|
|
985
|
+
var u;
|
|
986
|
+
if (!o)
|
|
987
|
+
throw new Error(`Missing arguments for domain "${e}"`);
|
|
988
|
+
const s = !!o.offerId;
|
|
989
|
+
if (s && !o.recruitmentId)
|
|
990
|
+
throw new Error(`Missing argument "recruitmentId" for domain "${e}"`);
|
|
991
|
+
return {
|
|
992
|
+
companyId: (u = o.establishmentId) == null ? void 0 : u.toString(),
|
|
993
|
+
jobOfferId: s ? o.offerId.toString() : null,
|
|
994
|
+
recruitmentId: s ? o.recruitmentId.toString() : null,
|
|
995
|
+
selections: [s ? "Application" : "Spontaneous Application"]
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
async function r(o) {
|
|
999
|
+
return g().page("Application Authentication Viewed", e, t(o));
|
|
1000
|
+
}
|
|
1001
|
+
async function n(o) {
|
|
1002
|
+
return g().page("Application Magic Link Viewed", e, t(o));
|
|
1003
|
+
}
|
|
1004
|
+
async function i(o) {
|
|
1005
|
+
return g().page("Application Job Viewed", e, t(o));
|
|
1006
|
+
}
|
|
1007
|
+
async function c(o) {
|
|
1008
|
+
return g().page("Application Information Viewed", e, t(o));
|
|
1009
|
+
}
|
|
1010
|
+
async function d(o) {
|
|
1011
|
+
return g().page("Application Document Viewed", e, t(o));
|
|
1012
|
+
}
|
|
1013
|
+
async function m(o) {
|
|
1014
|
+
return g().page("Application Success Viewed", e, t(o));
|
|
1015
|
+
}
|
|
1016
|
+
async function l(o) {
|
|
1017
|
+
if (!o.error)
|
|
1018
|
+
throw new Error(`Missing argument "error" for domain "${e}", event "Application Form Failed"`);
|
|
1019
|
+
return g().track("Application Form Failed", e, { ...t(o), error: o.error });
|
|
1020
|
+
}
|
|
1021
|
+
return {
|
|
1022
|
+
applicationAuthenticationViewed: r,
|
|
1023
|
+
applicationMagicLinkViewed: n,
|
|
1024
|
+
applicationJobViewed: i,
|
|
1025
|
+
applicationInformationViewed: c,
|
|
1026
|
+
applicationDocumentViewed: d,
|
|
1027
|
+
applicationSuccessViewed: m,
|
|
1028
|
+
applicationFormFailed: l
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
function Dt() {
|
|
1032
|
+
const e = "Profile";
|
|
1033
|
+
function t(a, R) {
|
|
1034
|
+
var E;
|
|
1035
|
+
if (!a)
|
|
1036
|
+
throw new Error(`Missing arguments for domain "${e}"`);
|
|
1037
|
+
const A = {
|
|
1038
|
+
companyId: a.companyId ? a.companyId.toString() : null,
|
|
1039
|
+
hublerId: (E = a.hublerId) == null ? void 0 : E.toString()
|
|
1040
|
+
};
|
|
1041
|
+
return R && (A.productId = a.companyId ? a.companyId + "_2" : null), a.recruitmentId && (A.recruitmentId = a.recruitmentId.toString()), a.selections && (A.selections = a.selections), a.institutionId && (A.institutionId = a.institutionId.map(String)), A;
|
|
1042
|
+
}
|
|
1043
|
+
async function r(a) {
|
|
1044
|
+
return g().track(a.name, e, t(a.properties), !0);
|
|
1045
|
+
}
|
|
1046
|
+
async function n(a) {
|
|
1047
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1048
|
+
}
|
|
1049
|
+
async function i(a) {
|
|
1050
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1051
|
+
}
|
|
1052
|
+
async function c(a) {
|
|
1053
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1054
|
+
}
|
|
1055
|
+
async function d(a) {
|
|
1056
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1057
|
+
}
|
|
1058
|
+
async function m(a) {
|
|
1059
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1060
|
+
}
|
|
1061
|
+
async function l(a) {
|
|
1062
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1063
|
+
}
|
|
1064
|
+
async function o(a) {
|
|
1065
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1066
|
+
}
|
|
1067
|
+
async function s(a) {
|
|
1068
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1069
|
+
}
|
|
1070
|
+
async function u(a) {
|
|
1071
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1072
|
+
}
|
|
1073
|
+
async function f(a) {
|
|
1074
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1075
|
+
}
|
|
1076
|
+
async function p(a) {
|
|
1077
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1078
|
+
}
|
|
1079
|
+
async function h(a) {
|
|
1080
|
+
return g().track(a.name, e, t(a.properties, !0));
|
|
1081
|
+
}
|
|
1082
|
+
async function b(a) {
|
|
1083
|
+
return g().page(a.name, a.properties.category, t(a.properties, !1));
|
|
1084
|
+
}
|
|
1085
|
+
async function S(a) {
|
|
1086
|
+
return g().track(a.name, e, t(a.properties, !1));
|
|
1087
|
+
}
|
|
1088
|
+
return {
|
|
1089
|
+
profileDocumentDeleted: r,
|
|
1090
|
+
profileLabelAdded: n,
|
|
1091
|
+
profileLabelRemoved: i,
|
|
1092
|
+
profileShared: c,
|
|
1093
|
+
profileArchived: d,
|
|
1094
|
+
profileCandidateAdded: m,
|
|
1095
|
+
profileCommentAdded: l,
|
|
1096
|
+
profileDocumentAdded: o,
|
|
1097
|
+
profileDocumentDownloaded: s,
|
|
1098
|
+
profileDocumentRequested: u,
|
|
1099
|
+
profileRecruitmentAdded: f,
|
|
1100
|
+
profileRecruitmentRemoved: p,
|
|
1101
|
+
profileTabSelected: h,
|
|
1102
|
+
profileViewed: b,
|
|
1103
|
+
profileEmailSent: S
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
const q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1107
|
+
__proto__: null,
|
|
1108
|
+
useAnalyticsHublerApplication: Ot,
|
|
1109
|
+
useAnalyticsProfile: Dt
|
|
1110
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1111
|
+
function Mn() {
|
|
1112
|
+
function e(r) {
|
|
1113
|
+
return g().identify(r.id, {
|
|
1114
|
+
email: r.email,
|
|
1115
|
+
firstName: r.firstname,
|
|
1116
|
+
lastName: r.lastname,
|
|
1117
|
+
createdAt: r.createdAt,
|
|
1118
|
+
type: "Hubler",
|
|
1119
|
+
lang: "fr",
|
|
1120
|
+
medium: t() ? "MOBILE_DEVICE" : "WEB_BROWSER"
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
function t() {
|
|
1124
|
+
let r = !1;
|
|
1125
|
+
return function(n) {
|
|
1126
|
+
(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(n) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(n.substr(0, 4))) && (r = !0);
|
|
1127
|
+
}(navigator.userAgent || navigator.vendor || window.opera), r;
|
|
1128
|
+
}
|
|
1129
|
+
return {
|
|
1130
|
+
identifyCandidate: e
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
const xt = "AIzaSyDicyRD6rvVdnicp1tgV0ElazASNGbyyTs", Z = () => new Promise((e) => {
|
|
1134
|
+
window.google && window.google.maps ? e() : (window.addEventListener("gmap-ready", () => e()), jt());
|
|
1135
|
+
}), _t = (e, t) => Z().then(() => Tt(e, t)), Tt = (e, t) => {
|
|
1136
|
+
const r = new window.google.maps.places.Autocomplete(e, { componentRestrictions: { country: ["fr", "re", "yt", "gp", "mq"] } });
|
|
1137
|
+
window.google.maps.event.addListener(r, "place_changed", () => {
|
|
1138
|
+
const n = r.getPlace();
|
|
1139
|
+
n.formatted_address && t(n);
|
|
1140
|
+
});
|
|
1141
|
+
}, jt = () => {
|
|
1142
|
+
window.onGmapScriptReady = function() {
|
|
1143
|
+
};
|
|
1144
|
+
const e = document.createElement("script");
|
|
1145
|
+
e.src = "https://maps.googleapis.com/maps/api/js?key=" + xt + "&libraries=places&callback=onGmapScriptReady", e.async = !0, e.defer = !0, e.onload = () => window.dispatchEvent(new Event("gmap-ready")), document.body.appendChild(e);
|
|
1146
|
+
}, On = {
|
|
1147
|
+
scriptReady: Z,
|
|
1148
|
+
autocompleteInput: _t
|
|
1149
|
+
}, Nt = {
|
|
1150
|
+
common: {
|
|
1151
|
+
the: "le",
|
|
1152
|
+
from: "de"
|
|
1153
|
+
},
|
|
1154
|
+
timeAgo: {
|
|
1155
|
+
"just-now": "à l'instant",
|
|
1156
|
+
ago: "il y a {0}",
|
|
1157
|
+
in: "dans {0}",
|
|
1158
|
+
"last-month": "le mois dernier",
|
|
1159
|
+
"next-month": "le mois prochain",
|
|
1160
|
+
month: "mois | mois",
|
|
1161
|
+
"last-year": "l'année dernière",
|
|
1162
|
+
"next-year": "l'année prochaine",
|
|
1163
|
+
year: "an | ans",
|
|
1164
|
+
yesterday: "hier",
|
|
1165
|
+
tomorrow: "demain",
|
|
1166
|
+
day: "jour | jours",
|
|
1167
|
+
"last-week": "la semaine dernière",
|
|
1168
|
+
"next-week": "la semaine prochaine",
|
|
1169
|
+
week: "semaine | semaines",
|
|
1170
|
+
hour: "heure | heures",
|
|
1171
|
+
minute: "minute | minutes",
|
|
1172
|
+
second: "seconde | secondes"
|
|
1173
|
+
}
|
|
1174
|
+
}, zt = {
|
|
1175
|
+
fr: Nt
|
|
1176
|
+
};
|
|
1177
|
+
let N = null;
|
|
1178
|
+
const Ft = () => N, Dn = (e = {}) => {
|
|
1179
|
+
let t = e.locale || "fr";
|
|
1180
|
+
const r = (m) => t = m, n = () => t, i = W(zt, (e == null ? void 0 : e.messages) || {});
|
|
1181
|
+
return N = {
|
|
1182
|
+
t: (m, l) => {
|
|
1183
|
+
const o = C(i, `${t}.${m}`);
|
|
1184
|
+
return o ? l ? qt(o, l) : o : m;
|
|
1185
|
+
},
|
|
1186
|
+
tNode: (m, l) => {
|
|
1187
|
+
const o = C(i, `${t}.${m}`);
|
|
1188
|
+
return o ? Bt(o, l) : m;
|
|
1189
|
+
},
|
|
1190
|
+
setLocale: r,
|
|
1191
|
+
getLocale: n
|
|
1192
|
+
}, N;
|
|
1193
|
+
}, qt = (e, t) => e ? e.replace(/{{ ?([a-zA-Z_.]+) ?}}/g, (r, n) => C(t, n)) : null, Bt = (e, t) => {
|
|
1194
|
+
if (!e)
|
|
1195
|
+
return null;
|
|
1196
|
+
const r = e.split(/(\{[{%]+[^{}]*[%}]+})/g).filter((n) => n !== "").map((n) => {
|
|
1197
|
+
const i = n.startsWith("{%") && n.endsWith("%}") ? "slot" : n.startsWith("{{") && n.endsWith("}}") ? "variable" : "text";
|
|
1198
|
+
if (i === "text")
|
|
1199
|
+
return () => B.text(n);
|
|
1200
|
+
n = n.replace(/[{}%]/g, "").trim();
|
|
1201
|
+
const c = n.match(/^[a-zA-Z_.]+/)[0];
|
|
1202
|
+
n = n.replace(c, "").trim();
|
|
1203
|
+
const d = {};
|
|
1204
|
+
return n !== "" && ([...n.matchAll(/([a-zA-Z_.]+)(=([a-zA-Z_.]+))?/g)].reduce((o, s) => (s[3] === void 0 ? F(o, s[1], C(t, s[1])) : F(o, s[1], C(t, s[3])), o), d), [...n.matchAll(/([a-zA-Z_.]+)="([^"]+)"/g)].reduce((o, s) => {
|
|
1205
|
+
let u = s[2];
|
|
1206
|
+
return new RegExp(/^[0-9]*$/).exec(s[2]) ? u = parseInt(s[2]) : new RegExp(/^(true|false)$/).exec(s[2]) && (u = s[2] === "true"), o[s[1]] = u, o;
|
|
1207
|
+
}, d)), (m) => B[i](c, t, m, d);
|
|
1208
|
+
});
|
|
1209
|
+
return { setup: (n, { slots: i }) => () => r.map((c) => c(i)) };
|
|
1210
|
+
}, B = {
|
|
1211
|
+
slot: (e, t, r, n) => _("span", { class: "node node--slot" }, r[e.trim()](n)),
|
|
1212
|
+
variable: (e, t) => _("span", { class: "node node--variable" }, C(t, e.trim())),
|
|
1213
|
+
text: (e) => _("span", { class: "node node--text" }, e)
|
|
1214
|
+
};
|
|
1215
|
+
function xn(e) {
|
|
1216
|
+
const { t } = Ft(), r = {
|
|
1217
|
+
justNow: t("timeAgo.just-now"),
|
|
1218
|
+
past: (n) => n.match(/\d/) ? t("timeAgo.ago", [n]) : n,
|
|
1219
|
+
future: (n) => n.match(/\d/) ? t("timeAgo.in", [n]) : n,
|
|
1220
|
+
month: (n, i) => n === 1 ? t(i ? "timeAgo.last-month" : "timeAgo.next-month") : `${n} ${t("timeAgo.month", n)}`,
|
|
1221
|
+
year: (n, i) => n === 1 ? t(i ? "timeAgo.last-year" : "timeAgo.next-year") : `${n} ${t("timeAgo.year", n)}`,
|
|
1222
|
+
day: (n, i) => n === 1 ? t(i ? "timeAgo.yesterday" : "timeAgo.tomorrow") : `${n} ${t("timeAgo.day", n)}`,
|
|
1223
|
+
week: (n, i) => n === 1 ? t(i ? "timeAgo.last-week" : "timeAgo.next-week") : `${n} ${t("timeAgo.week", n)}`,
|
|
1224
|
+
hour: (n) => `${n} ${t("timeAgo.hour", n)}`,
|
|
1225
|
+
minute: (n) => `${n} ${t("timeAgo.minute", n)}`,
|
|
1226
|
+
second: (n) => `${n} ${t("timeAgo.second", n)}`,
|
|
1227
|
+
invalid: ""
|
|
1228
|
+
};
|
|
1229
|
+
return re(e, {
|
|
1230
|
+
fullDateFormatter: (n) => n.toLocaleDateString(),
|
|
1231
|
+
messages: r
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
function Ht() {
|
|
1235
|
+
let e = null;
|
|
1236
|
+
function t() {
|
|
1237
|
+
return e;
|
|
1238
|
+
}
|
|
1239
|
+
function r() {
|
|
1240
|
+
return e.controller;
|
|
1241
|
+
}
|
|
1242
|
+
function n() {
|
|
1243
|
+
return "use" + e.controller.charAt(0).toUpperCase() + e.controller.slice(1) + "QSController";
|
|
1244
|
+
}
|
|
1245
|
+
function i() {
|
|
1246
|
+
return e.action;
|
|
1247
|
+
}
|
|
1248
|
+
function c() {
|
|
1249
|
+
return e.arguments;
|
|
1250
|
+
}
|
|
1251
|
+
function d() {
|
|
1252
|
+
return !!(e && e.controller && e.action);
|
|
1253
|
+
}
|
|
1254
|
+
function m() {
|
|
1255
|
+
window.location.search.length !== 0 && (e = window.location.search.substring(1).split("&").reduce((l, o) => {
|
|
1256
|
+
const s = o.split("=");
|
|
1257
|
+
return s[0] === "controller" || s[0] === "action" ? l[s[0]] = decodeURIComponent(s[1]) : l.arguments[s[0]] = decodeURIComponent(s[1]), l;
|
|
1258
|
+
}, { controller: null, action: null, arguments: {} }));
|
|
1259
|
+
}
|
|
1260
|
+
return m(), {
|
|
1261
|
+
getParams: t,
|
|
1262
|
+
getController: r,
|
|
1263
|
+
getControllerComposableName: n,
|
|
1264
|
+
getAction: i,
|
|
1265
|
+
getArguments: c,
|
|
1266
|
+
hasAction: d
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
function Vt() {
|
|
1270
|
+
async function e({ domain: n, event: i, ...c }) {
|
|
1271
|
+
const d = "useAnalytics" + n.charAt(0).toUpperCase() + n.slice(1);
|
|
1272
|
+
if (!t(d))
|
|
1273
|
+
throw new Error(`Domain ${n} is not defined`);
|
|
1274
|
+
const m = q[d]();
|
|
1275
|
+
if (!r(m, i))
|
|
1276
|
+
throw new Error(`Event ${i} is not defined in domain ${n}`);
|
|
1277
|
+
return m[i](c);
|
|
1278
|
+
}
|
|
1279
|
+
function t(n) {
|
|
1280
|
+
return !!q[n];
|
|
1281
|
+
}
|
|
1282
|
+
function r(n, i) {
|
|
1283
|
+
return !!n[i];
|
|
1284
|
+
}
|
|
1285
|
+
return {
|
|
1286
|
+
call: e
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
const H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1290
|
+
__proto__: null,
|
|
1291
|
+
useAnalyticsQSController: Vt
|
|
1292
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1293
|
+
function Qt(e) {
|
|
1294
|
+
if (!e.hasAction())
|
|
1295
|
+
throw new Error("No action found in router");
|
|
1296
|
+
function t() {
|
|
1297
|
+
if (!r())
|
|
1298
|
+
throw new Error(`Controller ${e.getController()} not found`);
|
|
1299
|
+
const i = H[e.getControllerComposableName()]();
|
|
1300
|
+
if (!n(i))
|
|
1301
|
+
throw new Error(`Action ${e.getAction()} not found in controller ${e.getController()}`);
|
|
1302
|
+
return i[e.getAction()](e.getArguments());
|
|
1303
|
+
}
|
|
1304
|
+
function r() {
|
|
1305
|
+
return e.getControllerComposableName() in H;
|
|
1306
|
+
}
|
|
1307
|
+
function n(i) {
|
|
1308
|
+
return e.getAction() in i;
|
|
1309
|
+
}
|
|
1310
|
+
return {
|
|
1311
|
+
dispatch: t
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
function _n() {
|
|
1315
|
+
let e = !1;
|
|
1316
|
+
function t(i, c, d) {
|
|
1317
|
+
n(), d();
|
|
1318
|
+
}
|
|
1319
|
+
function r(i, c, d) {
|
|
1320
|
+
if (!e)
|
|
1321
|
+
return e = !0, t(i, c, d);
|
|
1322
|
+
d();
|
|
1323
|
+
}
|
|
1324
|
+
function n() {
|
|
1325
|
+
const i = Ht();
|
|
1326
|
+
if (!i.hasAction())
|
|
1327
|
+
return;
|
|
1328
|
+
Qt(i).dispatch();
|
|
1329
|
+
}
|
|
1330
|
+
return {
|
|
1331
|
+
vueRouterBeforeEach: t,
|
|
1332
|
+
vueRouterBeforeFirst: r,
|
|
1333
|
+
handle: n
|
|
1334
|
+
};
|
|
1335
|
+
}
|
|
1336
|
+
const P = () => $.getMainAppHost(), Gt = () => `${P()}/rh/establishments`, Ut = (e) => `${P()}/rh/establishment/${e}`, Kt = (e) => e && typeof e == "object" && e.urls && e.urls.display ? e.urls.display : "", Jt = (e) => `${P()}/rh/establishment/${e}/cvtheque/`, Wt = (e, t) => `${P()}/rh/establishment/${e}/recruitment/${t}`, Zt = (e, t) => `${P()}/rh/establishment/${e}/recruitment/${t}/kanban`, Xt = (e) => `${P()}/rh/establishment/${e}/career-configuration`, Yt = (e, t = null) => t ? `${P()}/career-website/${e}/${t}` : `${P()}/career-website/${e}`, en = (e, t) => `${P()}/career-website-preview/${e}/${t}`, tn = (e, t = null) => {
|
|
1337
|
+
const r = P().replace("://", `://${e}.`);
|
|
1338
|
+
return t ? `${r}?_version=${t}` : `${r}`;
|
|
1339
|
+
};
|
|
1340
|
+
function Tn() {
|
|
1341
|
+
return {
|
|
1342
|
+
root: P,
|
|
1343
|
+
establishments: Gt,
|
|
1344
|
+
establishment: Ut,
|
|
1345
|
+
img: Kt,
|
|
1346
|
+
cvtheque: Jt,
|
|
1347
|
+
recruitment: Wt,
|
|
1348
|
+
recruitmentKanban: Zt,
|
|
1349
|
+
career: Xt,
|
|
1350
|
+
careerConfig: Yt,
|
|
1351
|
+
careerPreview: en,
|
|
1352
|
+
careerWebsite: tn
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
const jn = "0.2.3";
|
|
1356
|
+
export {
|
|
1357
|
+
j as BaseLogger,
|
|
1358
|
+
On as Gmap,
|
|
1359
|
+
$ as SDKConfig,
|
|
1360
|
+
x as SDKLogger,
|
|
1361
|
+
jn as VERSION,
|
|
1362
|
+
Mt as _clone,
|
|
1363
|
+
C as _get,
|
|
1364
|
+
W as _merge,
|
|
1365
|
+
F as _set,
|
|
1366
|
+
Dn as createI18n,
|
|
1367
|
+
cn as useActivityRepository,
|
|
1368
|
+
Ot as useAnalyticsHublerApplication,
|
|
1369
|
+
Mn as useAnalyticsIdentify,
|
|
1370
|
+
Dt as useAnalyticsProfile,
|
|
1371
|
+
D as useAuthentication,
|
|
1372
|
+
Lt as useAuthorization,
|
|
1373
|
+
Ln as useAuthorizationStore,
|
|
1374
|
+
$n as useCanAccessEstablishmentMiddleware,
|
|
1375
|
+
un as useCandidateRepository,
|
|
1376
|
+
ln as useCommentRepository,
|
|
1377
|
+
dn as useContractTypeRepository,
|
|
1378
|
+
mn as useCvbankRepository,
|
|
1379
|
+
fn as useCvthequeRepository,
|
|
1380
|
+
pn as useDiplomaRepository,
|
|
1381
|
+
hn as useDocumentRepository,
|
|
1382
|
+
Tn as useDomainUrls,
|
|
1383
|
+
yn as useEmailHistoryRepository,
|
|
1384
|
+
gn as useEmailRepository,
|
|
1385
|
+
bn as useEmailTemplateRepository,
|
|
1386
|
+
wn as useEstablishmentCareerRepository,
|
|
1387
|
+
K as useEstablishmentRepository,
|
|
1388
|
+
Rn as useFeatureFlagRepository,
|
|
1389
|
+
Ft as useI18n,
|
|
1390
|
+
An as useJobRepository,
|
|
1391
|
+
In as useLabelRepository,
|
|
1392
|
+
xn as useLocaleTimeAgo,
|
|
1393
|
+
Pn as useOfferRepository,
|
|
1394
|
+
y as usePrivateRequest,
|
|
1395
|
+
_n as useQSAction,
|
|
1396
|
+
vn as useRecruiterRepository,
|
|
1397
|
+
En as useRecruitmentRepository,
|
|
1398
|
+
Sn as useRegisterRepository,
|
|
1399
|
+
w as useRequest,
|
|
1400
|
+
Cn as useSpecialityRepository,
|
|
1401
|
+
kn as useTagRepository,
|
|
1402
|
+
J as useUserRepository
|
|
1403
|
+
};
|