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