@lystech/sections 0.6.0 → 0.9.0
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 +188 -1
- package/dist/Audience.d.ts +14 -0
- package/dist/BoutonEdition.d.ts +13 -0
- package/dist/BoutonEditionCorps.d.ts +12 -0
- package/dist/SectionsProvider.d.ts +62 -2
- package/dist/catalogue.d.ts +30 -0
- package/dist/constantes.d.ts +38 -0
- package/dist/editeur/ApercuMobile.d.ts +7 -0
- package/dist/editeur/ChoixAudience.d.ts +6 -0
- package/dist/editeur/MarquesBoutique.d.ts +26 -0
- package/dist/editeur/api.d.ts +16 -1
- package/dist/editeur/boutique/Collections.d.ts +8 -0
- package/dist/editeur/boutique/FicheCollection.d.ts +23 -0
- package/dist/editeur/boutique/FicheProduit.d.ts +23 -0
- package/dist/editeur/boutique/ListeVirtuelle.d.ts +13 -0
- package/dist/editeur/boutique/ModuleBoutique.d.ts +44 -0
- package/dist/editeur/boutique/Publier.d.ts +15 -0
- package/dist/editeur/boutique/Selecteur.d.ts +10 -0
- package/dist/editeur/boutique/api.d.ts +131 -0
- package/dist/editeur/boutique/commun.d.ts +19 -0
- package/dist/editeur/boutique/photos.d.ts +9 -0
- package/dist/editeur/boutique/styles.d.ts +1 -0
- package/dist/editeur/pont.d.ts +7 -0
- package/dist/editeur/styles.d.ts +1 -1
- package/dist/editeur.js +6 -1736
- package/dist/index.d.ts +9 -2
- package/dist/index.js +351 -209
- package/dist/morceaux/ApercuMobile-CSoo4dpM.js +63 -0
- package/dist/morceaux/BoutonEditionCorps-B57eJtJn.js +112 -0
- package/dist/morceaux/ModuleBoutique-CgqcQjIb.js +1509 -0
- package/dist/morceaux/constantes-BAdpe1ss.js +24 -0
- package/dist/morceaux/index-C_uFDnBO.js +2217 -0
- package/dist/types.d.ts +30 -0
- package/dist/useSection.d.ts +15 -0
- package/package.json +46 -46
- package/dist/morceaux/constantes-BPZxUYge.js +0 -19
package/dist/index.js
CHANGED
|
@@ -1,203 +1,328 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { appliquerAuxTextes as
|
|
6
|
-
import { adaptateurI18next as
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { b as le, a as K, A as de, E as Q, s as fe, c as R, d as l, F as X } from "./morceaux/constantes-BAdpe1ss.js";
|
|
2
|
+
import { C as qe } from "./morceaux/constantes-BAdpe1ss.js";
|
|
3
|
+
import { useRef as v, useEffect as E, useState as w, useCallback as y, useMemo as k, useContext as he, createContext as me, Suspense as we, lazy as ge } from "react";
|
|
4
|
+
import { jsx as A, Fragment as te, jsxs as Y } from "react/jsx-runtime";
|
|
5
|
+
import { appliquerAuxTextes as B } from "./morceaux/sourceTexte-BMPMpNg9.js";
|
|
6
|
+
import { adaptateurI18next as $e } from "./morceaux/sourceTexte-BMPMpNg9.js";
|
|
7
|
+
function je(e) {
|
|
8
|
+
return { [de]: e };
|
|
9
|
+
}
|
|
10
|
+
function Oe(e, t = !1) {
|
|
11
|
+
return t ? { [K]: e, [le]: "" } : { [K]: e };
|
|
12
|
+
}
|
|
13
|
+
function Te(e) {
|
|
14
|
+
const t = v(e);
|
|
15
|
+
t.current = e, E(() => {
|
|
16
|
+
const n = (r) => t.current(r.detail);
|
|
17
|
+
return window.addEventListener(Q, n), () => window.removeEventListener(Q, n);
|
|
18
|
+
}, []);
|
|
19
|
+
}
|
|
20
|
+
const ne = me(null), pe = "https://api.lystech.ca/api";
|
|
21
|
+
function ee() {
|
|
22
|
+
if (typeof window > "u") return !1;
|
|
23
|
+
try {
|
|
24
|
+
return window.self !== window.top && (window.name === X || new URL(window.location.href).searchParams.has(X));
|
|
25
|
+
} catch {
|
|
26
|
+
return !1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function ye() {
|
|
9
30
|
if (typeof window > "u") return null;
|
|
10
|
-
|
|
31
|
+
try {
|
|
32
|
+
return window.localStorage.getItem(R) ? null : new URLSearchParams(window.location.hash.replace(/^#/, "")).get(l) ?? new URL(window.location.href).searchParams.get(l) ?? window.localStorage.getItem(l) ?? window.sessionStorage.getItem(l);
|
|
33
|
+
} catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function Ee() {
|
|
38
|
+
if (typeof window > "u") return null;
|
|
39
|
+
const e = (t) => {
|
|
11
40
|
try {
|
|
12
|
-
window.localStorage.setItem(
|
|
41
|
+
window.localStorage.setItem(l, t);
|
|
13
42
|
} catch {
|
|
14
43
|
try {
|
|
15
|
-
window.sessionStorage.setItem(
|
|
44
|
+
window.sessionStorage.setItem(l, t);
|
|
16
45
|
} catch {
|
|
17
46
|
}
|
|
18
47
|
}
|
|
19
|
-
return
|
|
48
|
+
return t;
|
|
20
49
|
};
|
|
21
50
|
try {
|
|
22
|
-
if (window.localStorage.getItem(
|
|
23
|
-
window.localStorage.removeItem(
|
|
51
|
+
if (window.localStorage.getItem(R)) {
|
|
52
|
+
window.localStorage.removeItem(R), window.localStorage.removeItem(l);
|
|
24
53
|
try {
|
|
25
|
-
window.sessionStorage.removeItem(
|
|
54
|
+
window.sessionStorage.removeItem(l);
|
|
26
55
|
} catch {
|
|
27
56
|
}
|
|
28
57
|
return null;
|
|
29
58
|
}
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
const a =
|
|
59
|
+
const t = window.location.hash.replace(/^#/, "");
|
|
60
|
+
if (t.includes(l + "=")) {
|
|
61
|
+
const s = new URLSearchParams(t), c = s.get(l);
|
|
62
|
+
if (c) {
|
|
63
|
+
s.delete(l);
|
|
64
|
+
const a = s.toString();
|
|
36
65
|
return window.history.replaceState(
|
|
37
66
|
{},
|
|
38
67
|
"",
|
|
39
68
|
window.location.pathname + window.location.search + (a ? "#" + a : "")
|
|
40
|
-
),
|
|
69
|
+
), e(c);
|
|
41
70
|
}
|
|
42
71
|
}
|
|
43
|
-
const
|
|
44
|
-
return
|
|
72
|
+
const n = new URL(window.location.href), r = n.searchParams.get(l);
|
|
73
|
+
return r ? (n.searchParams.delete(l), window.history.replaceState({}, "", n.toString()), e(r)) : window.localStorage.getItem(l) ?? window.sessionStorage.getItem(l);
|
|
45
74
|
} catch {
|
|
46
75
|
return null;
|
|
47
76
|
}
|
|
48
77
|
}
|
|
49
|
-
function
|
|
50
|
-
site:
|
|
51
|
-
page:
|
|
52
|
-
langue:
|
|
53
|
-
apiBaseUrl:
|
|
54
|
-
sectionsInitiales:
|
|
55
|
-
sourceTexte:
|
|
78
|
+
function De({
|
|
79
|
+
site: e,
|
|
80
|
+
page: t,
|
|
81
|
+
langue: n = "fr",
|
|
82
|
+
apiBaseUrl: r = pe,
|
|
83
|
+
sectionsInitiales: s,
|
|
84
|
+
sourceTexte: c,
|
|
56
85
|
pagesPartagees: a,
|
|
57
|
-
|
|
86
|
+
session: h,
|
|
87
|
+
connexionPropre: S = !1,
|
|
88
|
+
children: b
|
|
58
89
|
}) {
|
|
59
|
-
const [
|
|
60
|
-
|
|
61
|
-
), [
|
|
62
|
-
|
|
63
|
-
), [j,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
90
|
+
const [g, P] = w(
|
|
91
|
+
s ?? []
|
|
92
|
+
), [_, p] = w(
|
|
93
|
+
s?.length ? "pret" : "chargement"
|
|
94
|
+
), [j, re] = w(0), [F, oe] = w({}), [M, ce] = w(!1), [I] = w(ee), [N, z] = w(null), [O, se] = w(
|
|
95
|
+
() => ee() ? null : ye()
|
|
96
|
+
), [ie, ae] = w(0), H = v(null);
|
|
97
|
+
E(() => {
|
|
98
|
+
if (!e || !t) return;
|
|
99
|
+
H.current?.abort();
|
|
100
|
+
const o = new AbortController();
|
|
101
|
+
H.current = o, p("chargement");
|
|
102
|
+
const u = encodeURIComponent(e) + "/" + encodeURIComponent([t, ...a ?? []].join(",")), d = new Headers(h?.entetes ?? {});
|
|
103
|
+
return O && d.set("Authorization", "Bearer " + O), fetch(
|
|
104
|
+
r + "/site-sections/membre/" + u + (O ? "?toutes=1" : ""),
|
|
105
|
+
{ signal: o.signal, credentials: "include", headers: d }
|
|
106
|
+
).then(
|
|
71
107
|
(i) => i.ok ? i.json() : Promise.reject(new Error(String(i.status)))
|
|
72
108
|
).then((i) => {
|
|
73
|
-
|
|
109
|
+
o.signal.aborted || (P(Array.isArray(i?.sections) ? i.sections : []), z(i?.viewer ?? null), p("pret"));
|
|
74
110
|
}).catch((i) => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
111
|
+
if (o.signal.aborted || i?.name === "AbortError") throw i;
|
|
112
|
+
return fetch(r + "/site-sections/public/" + u, {
|
|
113
|
+
signal: o.signal
|
|
114
|
+
}).then(
|
|
115
|
+
(C) => C.ok ? C.json() : Promise.reject(new Error(String(C.status)))
|
|
116
|
+
).then((C) => {
|
|
117
|
+
o.signal.aborted || (P(Array.isArray(C) ? C : []), z(null), p("pret"));
|
|
118
|
+
});
|
|
119
|
+
}).catch((i) => {
|
|
120
|
+
o.signal.aborted || i?.name === "AbortError" || p("erreur");
|
|
121
|
+
}), () => o.abort();
|
|
122
|
+
}, [e, t, r, j, (a ?? []).join(","), h?.cle ?? null, O]);
|
|
123
|
+
const D = y(() => re((o) => o + 1), []), q = v({}), J = y((o, u) => {
|
|
124
|
+
q.current[o] = u;
|
|
80
125
|
}, []);
|
|
81
|
-
|
|
82
|
-
!
|
|
83
|
-
}, [
|
|
84
|
-
const
|
|
85
|
-
(
|
|
126
|
+
E(() => {
|
|
127
|
+
!c || !g.length || B(g, c);
|
|
128
|
+
}, [g, c]);
|
|
129
|
+
const L = y(
|
|
130
|
+
(o, u) => oe((d) => ({ ...d, [o]: u })),
|
|
86
131
|
[]
|
|
87
|
-
),
|
|
88
|
-
site:
|
|
89
|
-
page:
|
|
90
|
-
langue:
|
|
132
|
+
), m = v({
|
|
133
|
+
site: e,
|
|
134
|
+
page: t,
|
|
135
|
+
langue: n,
|
|
91
136
|
poserApercu: () => {
|
|
92
137
|
},
|
|
93
138
|
recharger: () => {
|
|
94
139
|
}
|
|
95
140
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
const
|
|
100
|
-
async (
|
|
101
|
-
const
|
|
102
|
-
if (!
|
|
103
|
-
if (!
|
|
141
|
+
m.current.site = e, m.current.page = t, m.current.langue = n, m.current.poserApercu = L, m.current.sourceTexte = c, m.current.replis = q.current, m.current.recharger = D, E(() => {
|
|
142
|
+
m.current.surChangementDePage?.(t);
|
|
143
|
+
}, [t]);
|
|
144
|
+
const U = v(null), $ = y(
|
|
145
|
+
async (o, u = {}) => {
|
|
146
|
+
const d = U.current;
|
|
147
|
+
if (!d) throw new Error("Aucune connexion d'édition active.");
|
|
148
|
+
if (!o.startsWith("/"))
|
|
104
149
|
throw new Error(
|
|
105
150
|
"appelEdition attend un chemin de l'API, ex. « /results/site/droits »."
|
|
106
151
|
);
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
return
|
|
152
|
+
const f = new Headers(u.headers);
|
|
153
|
+
f.set("Authorization", "Bearer " + d), typeof u.body == "string" && !f.has("Content-Type") && f.set("Content-Type", "application/json");
|
|
154
|
+
const i = await fetch(r + o, { ...u, headers: f });
|
|
155
|
+
return i.status === 401 && fe(), i;
|
|
111
156
|
},
|
|
112
|
-
[
|
|
157
|
+
[r]
|
|
113
158
|
);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
159
|
+
E(() => {
|
|
160
|
+
if (!I) return;
|
|
161
|
+
const o = (u) => {
|
|
162
|
+
if (u.source !== window.parent || u.origin !== window.location.origin) return;
|
|
163
|
+
const d = u.data;
|
|
164
|
+
if (d?.lystech !== "apercu" || !Array.isArray(d.blocs)) return;
|
|
165
|
+
const f = d.blocs.filter((i) => /^i18n:/.test(i.blockType));
|
|
166
|
+
f.length && c && B(f, c);
|
|
167
|
+
for (const i of d.blocs)
|
|
168
|
+
/^i18n:/.test(i.blockType) || L(i.blockType, i.data);
|
|
169
|
+
};
|
|
170
|
+
window.addEventListener("message", o);
|
|
171
|
+
try {
|
|
172
|
+
window.parent.postMessage({ lystech: "apercu-pret" }, window.location.origin);
|
|
173
|
+
} catch {
|
|
174
|
+
}
|
|
175
|
+
return () => window.removeEventListener("message", o);
|
|
176
|
+
}, [I, c, L]);
|
|
177
|
+
const V = y(
|
|
178
|
+
(o) => m.current.ouvrirBoutique?.(o ?? null) ?? !1,
|
|
179
|
+
[]
|
|
180
|
+
);
|
|
181
|
+
E(() => {
|
|
182
|
+
if (I) return;
|
|
183
|
+
const o = Ee();
|
|
184
|
+
if (!o) return;
|
|
185
|
+
let u = !0, d;
|
|
186
|
+
return import("@lystech/sections/editeur").then((f) => {
|
|
187
|
+
u && (U.current = o, ce(!0), d = f.monterEditeur({
|
|
188
|
+
jeton: o,
|
|
189
|
+
site: e,
|
|
190
|
+
apiBaseUrl: r,
|
|
191
|
+
pont: m.current
|
|
124
192
|
}));
|
|
125
|
-
}).catch((
|
|
126
|
-
console.error("[lystech] éditeur indisponible:",
|
|
193
|
+
}).catch((f) => {
|
|
194
|
+
console.error("[lystech] éditeur indisponible:", f?.message ?? f);
|
|
127
195
|
}), () => {
|
|
128
|
-
|
|
196
|
+
u = !1, U.current = null, d?.();
|
|
129
197
|
};
|
|
130
|
-
}, [
|
|
131
|
-
const
|
|
198
|
+
}, [e, r, I, ie]);
|
|
199
|
+
const W = y((o) => {
|
|
200
|
+
if (o) {
|
|
201
|
+
try {
|
|
202
|
+
window.localStorage.removeItem(R), window.localStorage.setItem(l, o);
|
|
203
|
+
} catch {
|
|
204
|
+
try {
|
|
205
|
+
window.sessionStorage.setItem(l, o);
|
|
206
|
+
} catch {
|
|
207
|
+
window.location.hash = l + "=" + encodeURIComponent(o);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
se(o), ae((u) => u + 1);
|
|
211
|
+
}
|
|
212
|
+
}, []), G = v(h?.entetes);
|
|
213
|
+
G.current = h?.entetes;
|
|
214
|
+
const Z = y(
|
|
215
|
+
(o, u = {}) => {
|
|
216
|
+
if (!o.startsWith("/"))
|
|
217
|
+
return Promise.reject(new Error("appelSession attend un chemin de l'API."));
|
|
218
|
+
const d = new Headers(u.headers);
|
|
219
|
+
for (const [f, i] of Object.entries(G.current ?? {})) d.set(f, i);
|
|
220
|
+
return fetch(r + o, { ...u, headers: d, credentials: "include" });
|
|
221
|
+
},
|
|
222
|
+
[r]
|
|
223
|
+
), ue = k(
|
|
132
224
|
() => ({
|
|
133
|
-
site:
|
|
134
|
-
page:
|
|
135
|
-
langue:
|
|
136
|
-
apiBaseUrl:
|
|
137
|
-
sections:
|
|
138
|
-
etat:
|
|
139
|
-
recharger:
|
|
140
|
-
apercu:
|
|
141
|
-
poserApercu:
|
|
142
|
-
modeEdition:
|
|
143
|
-
declarerRepli:
|
|
144
|
-
appelEdition:
|
|
225
|
+
site: e,
|
|
226
|
+
page: t,
|
|
227
|
+
langue: n,
|
|
228
|
+
apiBaseUrl: r,
|
|
229
|
+
sections: g,
|
|
230
|
+
etat: _,
|
|
231
|
+
recharger: D,
|
|
232
|
+
apercu: F,
|
|
233
|
+
poserApercu: L,
|
|
234
|
+
modeEdition: M,
|
|
235
|
+
declarerRepli: J,
|
|
236
|
+
appelEdition: $,
|
|
237
|
+
ouvrirBoutique: V,
|
|
238
|
+
modeApercu: I,
|
|
239
|
+
visiteur: N,
|
|
240
|
+
entrerEnEdition: W,
|
|
241
|
+
connexionPropre: S,
|
|
242
|
+
appelSession: Z
|
|
145
243
|
}),
|
|
146
244
|
[
|
|
147
|
-
t,
|
|
148
245
|
e,
|
|
149
|
-
|
|
246
|
+
t,
|
|
150
247
|
n,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
R,
|
|
154
|
-
S,
|
|
248
|
+
r,
|
|
249
|
+
g,
|
|
155
250
|
_,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
251
|
+
D,
|
|
252
|
+
F,
|
|
253
|
+
L,
|
|
254
|
+
M,
|
|
255
|
+
J,
|
|
256
|
+
$,
|
|
257
|
+
V,
|
|
258
|
+
I,
|
|
259
|
+
N,
|
|
260
|
+
W,
|
|
261
|
+
S,
|
|
262
|
+
Z
|
|
159
263
|
]
|
|
160
264
|
);
|
|
161
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ A(ne.Provider, { value: ue, children: b });
|
|
266
|
+
}
|
|
267
|
+
function x() {
|
|
268
|
+
return he(ne);
|
|
269
|
+
}
|
|
270
|
+
function Ae() {
|
|
271
|
+
return x()?.visiteur ?? null;
|
|
162
272
|
}
|
|
163
|
-
function
|
|
164
|
-
|
|
273
|
+
function Se(e, t, n = []) {
|
|
274
|
+
if (t === "everyone") return !0;
|
|
275
|
+
if (!e) return !1;
|
|
276
|
+
switch (t) {
|
|
277
|
+
case "loggedIn":
|
|
278
|
+
return e.isLoggedIn;
|
|
279
|
+
case "members":
|
|
280
|
+
return e.activePlanUIDs.length > 0;
|
|
281
|
+
case "nonMembers":
|
|
282
|
+
return e.activePlanUIDs.length === 0;
|
|
283
|
+
case "plans":
|
|
284
|
+
return n.some((r) => e.activePlanUIDs.includes(r));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function Ue({ show: e, plans: t, fallback: n = null, children: r }) {
|
|
288
|
+
const s = Ae();
|
|
289
|
+
return /* @__PURE__ */ A(te, { children: Se(s, e, t) ? r : n });
|
|
165
290
|
}
|
|
166
|
-
const
|
|
167
|
-
function
|
|
168
|
-
site:
|
|
169
|
-
apiBaseUrl:
|
|
170
|
-
className:
|
|
171
|
-
mention:
|
|
172
|
-
connexion:
|
|
173
|
-
methodes:
|
|
291
|
+
const be = "https://api.lystech.ca/api";
|
|
292
|
+
function ke({
|
|
293
|
+
site: e,
|
|
294
|
+
apiBaseUrl: t,
|
|
295
|
+
className: n,
|
|
296
|
+
mention: r = "Réalisé avec Lystech",
|
|
297
|
+
connexion: s = "Connexion",
|
|
298
|
+
methodes: c
|
|
174
299
|
}) {
|
|
175
|
-
const a =
|
|
176
|
-
if (!
|
|
177
|
-
const
|
|
178
|
-
if (!
|
|
179
|
-
|
|
300
|
+
const a = x(), h = e ?? a?.site ?? "", S = t ?? a?.apiBaseUrl ?? be, [b, g] = w(!1);
|
|
301
|
+
if (!h) return null;
|
|
302
|
+
const P = async () => {
|
|
303
|
+
if (!b) {
|
|
304
|
+
g(!0);
|
|
180
305
|
try {
|
|
181
306
|
(await import("@lystech/sections/editeur")).monterConnexion({
|
|
182
|
-
site:
|
|
183
|
-
apiBaseUrl:
|
|
184
|
-
...
|
|
185
|
-
surJeton: (
|
|
307
|
+
site: h,
|
|
308
|
+
apiBaseUrl: S,
|
|
309
|
+
...c ? { methodes: c } : {},
|
|
310
|
+
surJeton: (j) => {
|
|
186
311
|
try {
|
|
187
|
-
window.localStorage.removeItem(
|
|
312
|
+
window.localStorage.removeItem(R), window.localStorage.setItem(l, j);
|
|
188
313
|
} catch {
|
|
189
|
-
window.location.hash =
|
|
314
|
+
window.location.hash = l + "=" + encodeURIComponent(j);
|
|
190
315
|
}
|
|
191
316
|
window.location.reload();
|
|
192
317
|
}
|
|
193
318
|
});
|
|
194
|
-
} catch (
|
|
195
|
-
console.error("[lystech] connexion indisponible:",
|
|
319
|
+
} catch (p) {
|
|
320
|
+
console.error("[lystech] connexion indisponible:", p?.message ?? p);
|
|
196
321
|
} finally {
|
|
197
|
-
|
|
322
|
+
g(!1);
|
|
198
323
|
}
|
|
199
324
|
}
|
|
200
|
-
},
|
|
325
|
+
}, _ = {
|
|
201
326
|
color: "inherit",
|
|
202
327
|
font: "inherit",
|
|
203
328
|
background: "none",
|
|
@@ -207,10 +332,10 @@ function st({
|
|
|
207
332
|
textDecoration: "underline",
|
|
208
333
|
textUnderlineOffset: "0.2em"
|
|
209
334
|
};
|
|
210
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ Y(
|
|
211
336
|
"div",
|
|
212
337
|
{
|
|
213
|
-
className:
|
|
338
|
+
className: n,
|
|
214
339
|
style: {
|
|
215
340
|
display: "flex",
|
|
216
341
|
flexWrap: "wrap",
|
|
@@ -221,109 +346,126 @@ function st({
|
|
|
221
346
|
lineHeight: 1.5
|
|
222
347
|
},
|
|
223
348
|
children: [
|
|
224
|
-
|
|
349
|
+
r !== null && /* @__PURE__ */ A(
|
|
225
350
|
"a",
|
|
226
351
|
{
|
|
227
352
|
href: "https://lystech.ca",
|
|
228
353
|
target: "_blank",
|
|
229
354
|
rel: "noreferrer",
|
|
230
355
|
style: { color: "inherit" },
|
|
231
|
-
children:
|
|
356
|
+
children: r
|
|
232
357
|
}
|
|
233
358
|
),
|
|
234
|
-
!a?.modeEdition && /* @__PURE__ */
|
|
235
|
-
|
|
236
|
-
/* @__PURE__ */
|
|
359
|
+
!a?.modeEdition && !a?.connexionPropre && /* @__PURE__ */ Y(te, { children: [
|
|
360
|
+
r !== null && /* @__PURE__ */ A("span", { "aria-hidden": "true", children: "·" }),
|
|
361
|
+
/* @__PURE__ */ A("button", { type: "button", style: _, onClick: P, children: b ? "…" : s })
|
|
237
362
|
] })
|
|
238
363
|
]
|
|
239
364
|
}
|
|
240
365
|
);
|
|
241
366
|
}
|
|
242
|
-
|
|
243
|
-
|
|
367
|
+
const Ie = ge(() => import("./morceaux/BoutonEditionCorps-B57eJtJn.js"));
|
|
368
|
+
function Fe(e) {
|
|
369
|
+
const t = x();
|
|
370
|
+
return !t || !e.connecte || t.modeEdition || t.modeApercu || e.peutEditer === !1 ? null : /* @__PURE__ */ A(we, { fallback: null, children: /* @__PURE__ */ A(Ie, { ...e }) });
|
|
371
|
+
}
|
|
372
|
+
function Ce(e) {
|
|
373
|
+
return !!e && typeof e == "object" && !Array.isArray(e) && Object.keys(e).every((t) => /^[a-z]{2}(-[A-Za-z]{2})?$/.test(t));
|
|
244
374
|
}
|
|
245
|
-
function
|
|
246
|
-
if (Array.isArray(
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
return
|
|
375
|
+
function T(e, t) {
|
|
376
|
+
if (Array.isArray(e)) return e.map((n) => T(n, t));
|
|
377
|
+
if (Ce(e)) {
|
|
378
|
+
const n = e, r = t.slice(0, 2);
|
|
379
|
+
return n[t] ?? n[r] ?? Object.values(n).find((c) => c != null) ?? "";
|
|
250
380
|
}
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
for (const [
|
|
254
|
-
r
|
|
255
|
-
return
|
|
381
|
+
if (e && typeof e == "object") {
|
|
382
|
+
const n = {};
|
|
383
|
+
for (const [r, s] of Object.entries(e))
|
|
384
|
+
n[r] = T(s, t);
|
|
385
|
+
return n;
|
|
256
386
|
}
|
|
257
|
-
return
|
|
387
|
+
return e;
|
|
258
388
|
}
|
|
259
|
-
function
|
|
260
|
-
if (!
|
|
261
|
-
return
|
|
262
|
-
const
|
|
263
|
-
for (const [
|
|
264
|
-
|
|
265
|
-
return
|
|
389
|
+
function ve(e, t) {
|
|
390
|
+
if (!t || typeof t != "object" || Array.isArray(t))
|
|
391
|
+
return e;
|
|
392
|
+
const n = { ...e };
|
|
393
|
+
for (const [r, s] of Object.entries(t))
|
|
394
|
+
s != null && (n[r] = s);
|
|
395
|
+
return n;
|
|
266
396
|
}
|
|
267
|
-
function
|
|
268
|
-
return (
|
|
397
|
+
function Le(e) {
|
|
398
|
+
return (t) => ({ "data-lystech-champ": `${e}:${t}` });
|
|
269
399
|
}
|
|
270
|
-
function
|
|
271
|
-
const
|
|
272
|
-
return
|
|
273
|
-
|
|
274
|
-
}, [
|
|
275
|
-
const
|
|
276
|
-
(
|
|
277
|
-
), a =
|
|
400
|
+
function Me(e, t) {
|
|
401
|
+
const n = x(), r = n?.apercu?.[e], s = n?.declarerRepli;
|
|
402
|
+
return E(() => {
|
|
403
|
+
s?.(e, t.defaut);
|
|
404
|
+
}, [s, e, t.defaut]), k(() => {
|
|
405
|
+
const c = n?.sections.find(
|
|
406
|
+
(b) => b.blockType === e
|
|
407
|
+
), a = !!c?.hidden, h = a ? null : r ?? c?.data ?? null, S = h ? T(h, n?.langue ?? "fr") : null;
|
|
278
408
|
return {
|
|
279
|
-
contenu:
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
409
|
+
contenu: ve(t.defaut, S),
|
|
410
|
+
visible: !a,
|
|
411
|
+
audience: c?.audience ?? null,
|
|
412
|
+
publie: !!c?.data,
|
|
413
|
+
UID: c?.UID ?? null,
|
|
414
|
+
chargement: n?.etat === "chargement",
|
|
415
|
+
ancrage: { "data-lystech-section": e },
|
|
416
|
+
champ: Le(e)
|
|
285
417
|
};
|
|
286
418
|
}, [
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
419
|
+
n?.sections,
|
|
420
|
+
n?.langue,
|
|
421
|
+
n?.etat,
|
|
422
|
+
r,
|
|
423
|
+
e,
|
|
424
|
+
t.defaut
|
|
293
425
|
]);
|
|
294
426
|
}
|
|
295
|
-
function
|
|
296
|
-
const
|
|
297
|
-
return
|
|
298
|
-
const
|
|
299
|
-
(
|
|
300
|
-
);
|
|
301
|
-
return c.length === 0 ? {
|
|
302
|
-
items: (
|
|
303
|
-
...
|
|
304
|
-
__uid: `defaut-${
|
|
427
|
+
function Ne(e, t) {
|
|
428
|
+
const n = x();
|
|
429
|
+
return k(() => {
|
|
430
|
+
const r = { "data-lystech-section": e }, s = (n?.sections ?? []).filter(
|
|
431
|
+
(a) => a.blockType === e
|
|
432
|
+
), c = s.filter((a) => !a.hidden);
|
|
433
|
+
return s.length > 0 && c.length === 0 ? { items: [], publie: !0, chargement: n?.etat === "chargement", ancrage: r } : c.length === 0 ? {
|
|
434
|
+
items: (t?.defaut ?? []).map((a, h) => ({
|
|
435
|
+
...a,
|
|
436
|
+
__uid: `defaut-${h}`
|
|
305
437
|
})),
|
|
306
438
|
publie: !1,
|
|
307
|
-
chargement:
|
|
308
|
-
ancrage:
|
|
439
|
+
chargement: n?.etat === "chargement",
|
|
440
|
+
ancrage: r
|
|
309
441
|
} : {
|
|
310
|
-
items: c.map((
|
|
311
|
-
...
|
|
312
|
-
__uid:
|
|
442
|
+
items: c.map((a) => ({
|
|
443
|
+
...T(a.data ?? {}, n?.langue ?? "fr"),
|
|
444
|
+
__uid: a.UID
|
|
313
445
|
})),
|
|
314
446
|
publie: !0,
|
|
315
|
-
chargement:
|
|
316
|
-
ancrage:
|
|
447
|
+
chargement: n?.etat === "chargement",
|
|
448
|
+
ancrage: r
|
|
317
449
|
};
|
|
318
|
-
}, [
|
|
450
|
+
}, [n?.sections, n?.langue, n?.etat, e, t?.defaut]);
|
|
319
451
|
}
|
|
320
452
|
export {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
453
|
+
K as ATTR_COLLECTION,
|
|
454
|
+
le as ATTR_COLLECTION_AFFICHEE,
|
|
455
|
+
de as ATTR_PRODUIT,
|
|
456
|
+
Ue as Audience,
|
|
457
|
+
Fe as BoutonEdition,
|
|
458
|
+
qe as CLASSE_HORS_EDITION,
|
|
459
|
+
Q as EVENEMENT_CATALOGUE,
|
|
460
|
+
De as SectionsProvider,
|
|
461
|
+
ke as SignatureLystech,
|
|
462
|
+
$e as adaptateurI18next,
|
|
463
|
+
B as appliquerAuxTextes,
|
|
464
|
+
Oe as marqueCollection,
|
|
465
|
+
je as marqueProduit,
|
|
466
|
+
Te as useCatalogueModifie,
|
|
467
|
+
Me as useSection,
|
|
468
|
+
Ne as useSectionList,
|
|
469
|
+
x as useSectionsContext,
|
|
470
|
+
Ae as useVisiteur
|
|
329
471
|
};
|