@lystech/sections 0.3.0 → 0.4.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/dist/editeur.js CHANGED
@@ -1,190 +1,248 @@
1
- import { jsx as e, jsxs as b, Fragment as Q } from "react/jsx-runtime";
2
- import { createRoot as Z } from "react-dom/client";
3
- import { useState as k, useRef as F, useEffect as B, useCallback as H, useMemo as W } from "react";
4
- function se({
1
+ import { jsx as e, jsxs as m, Fragment as te } from "react/jsx-runtime";
2
+ import { createRoot as ne } from "react-dom/client";
3
+ import { useState as L, useRef as B, useEffect as J, useCallback as F, useMemo as K } from "react";
4
+ function de({
5
5
  jeton: n,
6
6
  site: t,
7
- apiBaseUrl: c,
7
+ apiBaseUrl: i,
8
8
  surJetonRefuse: r
9
9
  }) {
10
10
  const a = {
11
11
  "Content-Type": "application/json",
12
12
  Authorization: "Bearer " + n
13
13
  };
14
- function f(o, i) {
15
- if (i && (o.status === 401 || o.status === 403) && r(), !o.ok) throw new Error(String(o.status));
14
+ function d(o, c) {
15
+ if (c && (o.status === 401 || o.status === 403) && r(), !o.ok) throw new Error(String(o.status));
16
16
  }
17
- async function u(o, i = !0) {
18
- const h = await fetch(c + o, {
19
- headers: i ? a : void 0
17
+ async function l(o, c = !0) {
18
+ const h = await fetch(i + o, {
19
+ headers: c ? a : void 0
20
20
  });
21
- return f(h, i), await h.json();
21
+ return d(h, c), await h.json();
22
22
  }
23
- async function m(o, i, h) {
24
- const g = await fetch(c + o, {
25
- method: i,
23
+ async function b(o, c, h) {
24
+ const g = await fetch(i + o, {
25
+ method: c,
26
26
  headers: a,
27
27
  body: h === void 0 ? void 0 : JSON.stringify(h)
28
28
  });
29
- return f(g, !0), await g.json();
29
+ return d(g, !0), await g.json();
30
30
  }
31
31
  return {
32
32
  /** Les blocs que le site a déclaré savoir afficher. Route publique. */
33
- schemas: () => u("/site-sections/public/" + encodeURIComponent(t) + "/schemas", !1),
33
+ schemas: () => l("/site-sections/public/" + encodeURIComponent(t) + "/schemas", !1),
34
34
  /** Ce qui existe sur une page, brouillons compris. */
35
- pourPage: (o) => u("/site-sections?page=" + encodeURIComponent(o)),
36
- creer: (o, i, h) => m("/site-sections", "POST", { page: o, blockType: i, draft: h }),
37
- enregistrerBrouillon: (o, i) => m("/site-sections/" + o + "/draft", "PUT", { draft: i }),
38
- publier: (o) => m("/site-sections/" + o + "/publish", "POST"),
35
+ pourPage: (o) => l("/site-sections?page=" + encodeURIComponent(o)),
36
+ creer: (o, c, h) => b("/site-sections", "POST", { page: o, blockType: c, draft: h }),
37
+ enregistrerBrouillon: (o, c) => b("/site-sections/" + o + "/draft", "PUT", { draft: c }),
38
+ publier: (o) => b("/site-sections/" + o + "/publish", "POST"),
39
39
  /** Ramène le brouillon à ce qui est en ligne. */
40
- annuler: (o) => m("/site-sections/" + o + "/revert", "POST")
40
+ annuler: (o) => b("/site-sections/" + o + "/revert", "POST")
41
41
  };
42
42
  }
43
- function ce({
43
+ const pe = {
44
+ apiKey: "AIzaSyCpAeHlt1wZvM5KtYg7X7MDVnWVJT86gvc",
45
+ authDomain: "lystech.firebaseapp.com",
46
+ projectId: "lystech",
47
+ storageBucket: "lystech.appspot.com",
48
+ messagingSenderId: "237347321732",
49
+ appId: "1:237347321732:web:7f9586d48e488d73ddcfd1"
50
+ };
51
+ function fe() {
52
+ return /* @__PURE__ */ m("span", { className: "marque", children: [
53
+ /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ e(
54
+ "path",
55
+ {
56
+ d: "M12 2c2.6 2.4 3.9 4.9 3.9 7.5 0 1.6-.5 3-1.6 4.2 1.9-.3 3.4-1.1 4.6-2.4-.2 3.4-2.3 5.9-6.1 7.3V22h-1.6v-3.4C7.4 17.2 5.3 14.7 5.1 11.3c1.2 1.3 2.7 2.1 4.6 2.4-1.1-1.2-1.6-2.6-1.6-4.2C8.1 6.9 9.4 4.4 12 2z",
57
+ fill: "currentColor"
58
+ }
59
+ ) }),
60
+ /* @__PURE__ */ e("span", { className: "marque__mot", children: "Lystech" })
61
+ ] });
62
+ }
63
+ function me() {
64
+ return /* @__PURE__ */ m("svg", { viewBox: "0 0 18 18", "aria-hidden": "true", focusable: "false", className: "logo", children: [
65
+ /* @__PURE__ */ e("path", { fill: "#4285F4", d: "M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84a4.14 4.14 0 0 1-1.8 2.72v2.26h2.91c1.7-1.57 2.69-3.88 2.69-6.62z" }),
66
+ /* @__PURE__ */ e("path", { fill: "#34A853", d: "M9 18c2.43 0 4.47-.8 5.96-2.18l-2.91-2.26c-.81.54-1.84.86-3.05.86-2.34 0-4.33-1.58-5.04-3.71H.96v2.33A9 9 0 0 0 9 18z" }),
67
+ /* @__PURE__ */ e("path", { fill: "#FBBC05", d: "M3.96 10.71a5.41 5.41 0 0 1 0-3.42V4.96H.96a9 9 0 0 0 0 8.08l3-2.33z" }),
68
+ /* @__PURE__ */ e("path", { fill: "#EA4335", d: "M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.59C13.46.89 11.43 0 9 0A9 9 0 0 0 .96 4.96l3 2.33C4.67 5.16 6.66 3.58 9 3.58z" })
69
+ ] });
70
+ }
71
+ function be() {
72
+ return /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", className: "logo", children: /* @__PURE__ */ e(
73
+ "path",
74
+ {
75
+ fill: "#fff",
76
+ d: "M22 12.06C22 6.5 17.52 2 12 2S2 6.5 2 12.06c0 5.02 3.66 9.18 8.44 9.94v-7.03H7.9v-2.91h2.54V9.85c0-2.52 1.49-3.91 3.77-3.91 1.09 0 2.24.2 2.24.2v2.46h-1.26c-1.24 0-1.63.78-1.63 1.57v1.89h2.78l-.45 2.91h-2.33V22c4.78-.76 8.44-4.92 8.44-9.94z"
77
+ }
78
+ ) });
79
+ }
80
+ function xe({
44
81
  site: n,
45
82
  apiBaseUrl: t,
46
- surJeton: c,
47
- surFermer: r
83
+ methodes: i = ["google", "facebook"],
84
+ surJeton: r,
85
+ surFermer: a
48
86
  }) {
49
- const [a, f] = k(""), [u, m] = k(""), [o, i] = k({ nom: "repos" }), h = async (v) => {
50
- if (!a || !u) {
51
- i({ nom: "erreur", texte: "Entrez votre adresse et votre mot de passe." });
52
- return;
87
+ const [d, l] = L({ nom: "repos" }), b = (g) => {
88
+ switch (g) {
89
+ case "auth/popup-blocked":
90
+ return "Votre navigateur a bloqué la fenêtre de connexion. Autorisez les fenêtres pour ce site, puis réessayez.";
91
+ case "auth/popup-closed-by-user":
92
+ case "auth/cancelled-popup-request":
93
+ return "Connexion annulée.";
94
+ case "auth/unauthorized-domain":
95
+ return "Ce domaine n'est pas encore autorisé côté Lystech. Prévenez la personne qui gère le site.";
96
+ case "auth/account-exists-with-different-credential":
97
+ return "Cette adresse est déjà associée à un autre mode de connexion. Essayez l'autre bouton.";
98
+ case "auth/network-request-failed":
99
+ return "Connexion au réseau impossible. Vérifiez votre lien Internet.";
100
+ default:
101
+ return "La connexion a échoué. Réessayez dans un instant.";
53
102
  }
54
- i({ nom: "envoi" });
55
- try {
56
- const S = await fetch(t + "/site-sections/edit-login", {
57
- method: "POST",
58
- headers: { "Content-Type": "application/json" },
59
- body: JSON.stringify({ site: n, email: a, password: u, demanderAcces: v })
103
+ }, o = async (g, C = !1) => {
104
+ const E = await fetch(t + "/site-sections/edit-login/third-party", {
105
+ method: "POST",
106
+ headers: { "Content-Type": "application/json" },
107
+ body: JSON.stringify({
108
+ site: n,
109
+ token: g,
110
+ tokenType: "firebase",
111
+ demanderAcces: C
112
+ })
113
+ });
114
+ if (E.status === 429) {
115
+ l({
116
+ nom: "erreur",
117
+ texte: "Trop de tentatives. Réessayez dans quelques minutes."
60
118
  });
61
- if (S.status === 429) {
62
- i({
63
- nom: "erreur",
64
- texte: "Trop de tentatives. Réessayez dans quelques minutes."
65
- });
119
+ return;
120
+ }
121
+ const v = await E.json().catch(() => null);
122
+ if (v?.ok && v?.token) {
123
+ r(v.token);
124
+ return;
125
+ }
126
+ switch (v?.raison) {
127
+ case "sans_acces":
128
+ l({ nom: "sans-acces", jeton: g });
66
129
  return;
67
- }
68
- const _ = await S.json().catch(() => null);
69
- if (_?.ok && _?.token) {
70
- c(_.token);
130
+ case "demande_envoyee":
131
+ l({ nom: "demande-envoyee" });
71
132
  return;
72
- }
73
- if (_?.raison === "sans_acces") {
74
- i({ nom: "sans-acces" });
133
+ case "trop_de_demandes":
134
+ l({
135
+ nom: "erreur",
136
+ texte: "Trop de demandes aujourd'hui. Réessayez demain."
137
+ });
75
138
  return;
76
- }
77
- if (_?.raison === "demande_envoyee") {
78
- i({ nom: "demande-envoyee" });
139
+ case "aucun_compte":
140
+ l({ nom: "aucun-compte", adresse: "" });
79
141
  return;
80
- }
81
- if (_?.raison === "trop_de_demandes") {
82
- i({
142
+ case "adresse_non_verifiee":
143
+ l({
83
144
  nom: "erreur",
84
- texte: "Trop de demandes aujourd'hui. Réessayez demain."
145
+ texte: "Votre fournisseur n'a pas confirmé cette adresse courriel. Vérifiez-la chez lui, puis réessayez."
85
146
  });
86
147
  return;
87
- }
88
- i({
89
- nom: "erreur",
90
- texte: "Adresse ou mot de passe incorrect."
91
- });
92
- } catch {
93
- i({
94
- nom: "erreur",
95
- texte: "Connexion au serveur impossible. Vérifiez votre réseau."
96
- });
148
+ default:
149
+ l({
150
+ nom: "erreur",
151
+ texte: "La connexion a échoué. Réessayez dans un instant."
152
+ });
97
153
  }
98
- }, g = o.nom === "envoi";
99
- return /* @__PURE__ */ e("div", { className: "voile", role: "dialog", "aria-modal": "true", "aria-label": "Modifier ce site", children: /* @__PURE__ */ b("div", { className: "fenetre", children: [
100
- /* @__PURE__ */ b("div", { className: "panneau__tete", children: [
101
- /* @__PURE__ */ b("div", { style: { flex: 1 }, children: [
102
- /* @__PURE__ */ e("h2", { className: "panneau__titre", children: "Modifier ce site" }),
103
- /* @__PURE__ */ e("p", { className: "panneau__sous", children: "Vous vous connectez à Lystech. Cet accès ne sert qu'à modifier le contenu de ce site." })
104
- ] }),
105
- /* @__PURE__ */ e(
154
+ }, c = async (g) => {
155
+ l({ nom: "envoi", quoi: g });
156
+ try {
157
+ const [{ initializeApp: C, getApps: E }, v] = await Promise.all([
158
+ import("./morceaux/index.esm-B4AB50RA.js"),
159
+ import("./morceaux/index.esm-B4hL1FOE.js")
160
+ ]), R = E().find((_) => _.name === "lystech-edition") ?? C(pe, "lystech-edition"), q = g === "google" ? new v.GoogleAuthProvider() : new v.FacebookAuthProvider(), w = await (await v.signInWithPopup(v.getAuth(R), q)).user.getIdToken();
161
+ await o(w);
162
+ } catch (C) {
163
+ l({ nom: "erreur", texte: b(String(C?.code ?? "")) });
164
+ }
165
+ }, h = d.nom === "envoi";
166
+ return /* @__PURE__ */ e("div", { className: "voile", role: "dialog", "aria-modal": "true", "aria-label": "Modifier ce site", children: /* @__PURE__ */ m("div", { className: "fenetre", children: [
167
+ /* @__PURE__ */ e(
168
+ "button",
169
+ {
170
+ type: "button",
171
+ className: "fenetre__fermer",
172
+ onClick: a,
173
+ "aria-label": "Fermer",
174
+ children: "✕"
175
+ }
176
+ ),
177
+ /* @__PURE__ */ m("div", { className: "fenetre__tete", children: [
178
+ /* @__PURE__ */ e(fe, {}),
179
+ /* @__PURE__ */ e("h2", { className: "fenetre__titre", children: "Modifier ce site" }),
180
+ /* @__PURE__ */ e("p", { className: "fenetre__sous", children: "Vous vous connectez à Lystech. Cet accès ne sert qu'à modifier le contenu de ce site." })
181
+ ] }),
182
+ /* @__PURE__ */ m("div", { className: "fenetre__corps", children: [
183
+ d.nom === "erreur" && /* @__PURE__ */ e("p", { className: "message message--erreur", children: d.texte }),
184
+ d.nom === "aucun-compte" && /* @__PURE__ */ e("p", { className: "message message--info", children: "Aucun compte Lystech ne correspond à cette adresse. Adressez-vous à la personne responsable du site." }),
185
+ d.nom === "sans-acces" && /* @__PURE__ */ e("p", { className: "message message--info", children: "Vous êtes bien reconnu, mais vous n'avez pas encore le droit de modifier ce site. Vous pouvez le demander : la personne responsable recevra un courriel." }),
186
+ d.nom === "demande-envoyee" && /* @__PURE__ */ e("p", { className: "message message--ok", children: "Demande envoyée. La personne responsable du site vous répondra." }),
187
+ d.nom === "sans-acces" ? /* @__PURE__ */ e(
106
188
  "button",
107
189
  {
108
190
  type: "button",
109
- className: "bouton bouton--icone bouton--discret",
110
- onClick: r,
111
- "aria-label": "Fermer",
112
- children: "✕"
191
+ className: "bouton bouton--principal bouton--large",
192
+ onClick: () => {
193
+ o(d.jeton, !0);
194
+ },
195
+ children: "Demander l'accès"
113
196
  }
114
- )
197
+ ) : d.nom === "demande-envoyee" || d.nom === "aucun-compte" ? /* @__PURE__ */ e(
198
+ "button",
199
+ {
200
+ type: "button",
201
+ className: "bouton bouton--large",
202
+ onClick: a,
203
+ children: "Fermer"
204
+ }
205
+ ) : /* @__PURE__ */ m("div", { className: "fournisseurs", children: [
206
+ i.includes("google") && /* @__PURE__ */ m(
207
+ "button",
208
+ {
209
+ type: "button",
210
+ className: "fournisseur fournisseur--google",
211
+ disabled: h,
212
+ onClick: () => {
213
+ c("google");
214
+ },
215
+ children: [
216
+ /* @__PURE__ */ e(me, {}),
217
+ /* @__PURE__ */ e("span", { children: d.nom === "envoi" && d.quoi === "google" ? "Connexion…" : "Continuer avec Google" })
218
+ ]
219
+ }
220
+ ),
221
+ i.includes("facebook") && /* @__PURE__ */ m(
222
+ "button",
223
+ {
224
+ type: "button",
225
+ className: "fournisseur fournisseur--facebook",
226
+ disabled: h,
227
+ onClick: () => {
228
+ c("facebook");
229
+ },
230
+ children: [
231
+ /* @__PURE__ */ e(be, {}),
232
+ /* @__PURE__ */ e("span", { children: d.nom === "envoi" && d.quoi === "facebook" ? "Connexion…" : "Continuer avec Facebook" })
233
+ ]
234
+ }
235
+ )
236
+ ] })
115
237
  ] }),
116
- /* @__PURE__ */ b(
117
- "form",
118
- {
119
- className: "panneau__corps",
120
- onSubmit: (v) => {
121
- v.preventDefault(), h(!1);
122
- },
123
- children: [
124
- o.nom === "erreur" && /* @__PURE__ */ e("p", { className: "message message--erreur", children: o.texte }),
125
- o.nom === "sans-acces" && /* @__PURE__ */ e("p", { className: "message message--info", children: "Vous êtes bien reconnu, mais vous n'avez pas encore le droit de modifier ce site. Vous pouvez le demander : la personne responsable recevra un courriel." }),
126
- o.nom === "demande-envoyee" && /* @__PURE__ */ e("p", { className: "message message--ok", children: "Demande envoyée. La personne responsable du site vous répondra." }),
127
- o.nom !== "demande-envoyee" && /* @__PURE__ */ b(Q, { children: [
128
- /* @__PURE__ */ b("div", { className: "champ", children: [
129
- /* @__PURE__ */ e("label", { className: "champ__etiquette", htmlFor: "lys-courriel", children: "Adresse courriel" }),
130
- /* @__PURE__ */ e(
131
- "input",
132
- {
133
- id: "lys-courriel",
134
- type: "text",
135
- inputMode: "email",
136
- autoComplete: "email",
137
- value: a,
138
- disabled: g,
139
- onChange: (v) => f(v.target.value)
140
- }
141
- )
142
- ] }),
143
- /* @__PURE__ */ b("div", { className: "champ", children: [
144
- /* @__PURE__ */ e("label", { className: "champ__etiquette", htmlFor: "lys-mdp", children: "Mot de passe" }),
145
- /* @__PURE__ */ e(
146
- "input",
147
- {
148
- id: "lys-mdp",
149
- type: "password",
150
- autoComplete: "current-password",
151
- value: u,
152
- disabled: g,
153
- onChange: (v) => m(v.target.value)
154
- }
155
- )
156
- ] })
157
- ] }),
158
- /* @__PURE__ */ e("div", { style: { display: "flex", gap: 8, marginTop: 4 }, children: o.nom === "sans-acces" ? /* @__PURE__ */ e(
159
- "button",
160
- {
161
- type: "button",
162
- className: "bouton bouton--principal",
163
- disabled: g,
164
- onClick: () => {
165
- h(!0);
166
- },
167
- children: "Demander l'accès"
168
- }
169
- ) : o.nom === "demande-envoyee" ? /* @__PURE__ */ e("button", { type: "button", className: "bouton", onClick: r, children: "Fermer" }) : /* @__PURE__ */ e(
170
- "button",
171
- {
172
- type: "submit",
173
- className: "bouton bouton--principal",
174
- disabled: g,
175
- children: g ? "Vérification…" : "Se connecter"
176
- }
177
- ) })
178
- ]
179
- }
180
- )
238
+ /* @__PURE__ */ e("p", { className: "fenetre__pied", children: "Votre mot de passe reste chez votre fournisseur : ce site ne le voit jamais." })
181
239
  ] }) });
182
240
  }
183
- function le(n, t) {
184
- const c = n && typeof n == "object" && !Array.isArray(n) ? Object.keys(n).filter((a) => /^[a-z]{2}(-[A-Za-z]{2})?$/.test(a)) : [], r = t.slice(0, 2);
185
- return Array.from(/* @__PURE__ */ new Set([r, ...c]));
241
+ function he(n, t) {
242
+ const i = n && typeof n == "object" && !Array.isArray(n) ? Object.keys(n).filter((a) => /^[a-z]{2}(-[A-Za-z]{2})?$/.test(a)) : [], r = t.slice(0, 2);
243
+ return Array.from(/* @__PURE__ */ new Set([r, ...i]));
186
244
  }
187
- function ue(n) {
245
+ function ge(n) {
188
246
  switch (n.type) {
189
247
  case "number":
190
248
  return 0;
@@ -196,14 +254,14 @@ function ue(n) {
196
254
  return "";
197
255
  }
198
256
  }
199
- function G({ champ: n, valeur: t, changer: c }) {
257
+ function Z({ champ: n, valeur: t, changer: i }) {
200
258
  switch (n.type) {
201
259
  case "richText":
202
260
  return /* @__PURE__ */ e(
203
261
  "textarea",
204
262
  {
205
263
  value: String(t ?? ""),
206
- onChange: (r) => c(r.target.value)
264
+ onChange: (r) => i(r.target.value)
207
265
  }
208
266
  );
209
267
  case "number":
@@ -212,17 +270,17 @@ function G({ champ: n, valeur: t, changer: c }) {
212
270
  {
213
271
  type: "number",
214
272
  value: t === "" || t == null ? "" : String(t),
215
- onChange: (r) => c(r.target.value === "" ? "" : Number(r.target.value))
273
+ onChange: (r) => i(r.target.value === "" ? "" : Number(r.target.value))
216
274
  }
217
275
  );
218
276
  case "boolean":
219
- return /* @__PURE__ */ b("label", { className: "bascule", children: [
277
+ return /* @__PURE__ */ m("label", { className: "bascule", children: [
220
278
  /* @__PURE__ */ e(
221
279
  "input",
222
280
  {
223
281
  type: "checkbox",
224
282
  checked: t === !0,
225
- onChange: (r) => c(r.target.checked)
283
+ onChange: (r) => i(r.target.checked)
226
284
  }
227
285
  ),
228
286
  /* @__PURE__ */ e("span", { children: t === !0 ? "Oui" : "Non" })
@@ -233,15 +291,15 @@ function G({ champ: n, valeur: t, changer: c }) {
233
291
  {
234
292
  type: "date",
235
293
  value: String(t ?? "").slice(0, 10),
236
- onChange: (r) => c(r.target.value)
294
+ onChange: (r) => i(r.target.value)
237
295
  }
238
296
  );
239
297
  case "choice":
240
- return /* @__PURE__ */ b(
298
+ return /* @__PURE__ */ m(
241
299
  "select",
242
300
  {
243
301
  value: String(t ?? ""),
244
- onChange: (r) => c(r.target.value),
302
+ onChange: (r) => i(r.target.value),
245
303
  children: [
246
304
  /* @__PURE__ */ e("option", { value: "", children: "—" }),
247
305
  (n.options ?? []).map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r))
@@ -254,18 +312,18 @@ function G({ champ: n, valeur: t, changer: c }) {
254
312
  {
255
313
  type: "url",
256
314
  value: String(t ?? ""),
257
- onChange: (r) => c(r.target.value),
315
+ onChange: (r) => i(r.target.value),
258
316
  placeholder: "https://"
259
317
  }
260
318
  );
261
319
  case "image":
262
- return /* @__PURE__ */ b(Q, { children: [
320
+ return /* @__PURE__ */ m(te, { children: [
263
321
  /* @__PURE__ */ e(
264
322
  "input",
265
323
  {
266
324
  type: "url",
267
325
  value: String(t ?? ""),
268
- onChange: (r) => c(r.target.value),
326
+ onChange: (r) => i(r.target.value),
269
327
  placeholder: "https://…"
270
328
  }
271
329
  ),
@@ -277,24 +335,24 @@ function G({ champ: n, valeur: t, changer: c }) {
277
335
  {
278
336
  type: "text",
279
337
  value: String(t ?? ""),
280
- onChange: (r) => c(r.target.value)
338
+ onChange: (r) => i(r.target.value)
281
339
  }
282
340
  );
283
341
  }
284
342
  }
285
- function ee({ champ: n, valeur: t, changer: c, langue: r }) {
343
+ function oe({ champ: n, valeur: t, changer: i, langue: r }) {
286
344
  if (n.type === "list") {
287
- const a = Array.isArray(t) ? t : [], f = n.of ?? [], u = (m, o, i) => {
288
- const h = a.map((g, v) => v === m ? { ...g, [o]: i } : g);
289
- c(h);
345
+ const a = Array.isArray(t) ? t : [], d = n.of ?? [], l = (b, o, c) => {
346
+ const h = a.map((g, C) => C === b ? { ...g, [o]: c } : g);
347
+ i(h);
290
348
  };
291
- return /* @__PURE__ */ b("div", { className: "champ", children: [
349
+ return /* @__PURE__ */ m("div", { className: "champ", children: [
292
350
  /* @__PURE__ */ e("span", { className: "champ__etiquette", children: n.label }),
293
351
  n.help && /* @__PURE__ */ e("p", { className: "champ__aide", children: n.help }),
294
- a.map((m, o) => /* @__PURE__ */ b("div", { className: "liste__item", children: [
295
- /* @__PURE__ */ b("div", { className: "liste__tete", children: [
352
+ a.map((b, o) => /* @__PURE__ */ m("div", { className: "liste__item", children: [
353
+ /* @__PURE__ */ m("div", { className: "liste__tete", children: [
296
354
  /* @__PURE__ */ e("span", { className: "liste__rang", children: o + 1 }),
297
- /* @__PURE__ */ b("span", { style: { display: "flex", gap: 4 }, children: [
355
+ /* @__PURE__ */ m("span", { style: { display: "flex", gap: 4 }, children: [
298
356
  /* @__PURE__ */ e(
299
357
  "button",
300
358
  {
@@ -303,8 +361,8 @@ function ee({ champ: n, valeur: t, changer: c, langue: r }) {
303
361
  title: "Monter",
304
362
  disabled: o === 0,
305
363
  onClick: () => {
306
- const i = [...a];
307
- [i[o - 1], i[o]] = [i[o], i[o - 1]], c(i);
364
+ const c = [...a];
365
+ [c[o - 1], c[o]] = [c[o], c[o - 1]], i(c);
308
366
  },
309
367
  children: "↑"
310
368
  }
@@ -317,8 +375,8 @@ function ee({ champ: n, valeur: t, changer: c, langue: r }) {
317
375
  title: "Descendre",
318
376
  disabled: o === a.length - 1,
319
377
  onClick: () => {
320
- const i = [...a];
321
- [i[o], i[o + 1]] = [i[o + 1], i[o]], c(i);
378
+ const c = [...a];
379
+ [c[o], c[o + 1]] = [c[o + 1], c[o]], i(c);
322
380
  },
323
381
  children: "↓"
324
382
  }
@@ -329,21 +387,21 @@ function ee({ champ: n, valeur: t, changer: c, langue: r }) {
329
387
  type: "button",
330
388
  className: "bouton bouton--icone bouton--discret",
331
389
  title: "Retirer",
332
- onClick: () => c(a.filter((i, h) => h !== o)),
390
+ onClick: () => i(a.filter((c, h) => h !== o)),
333
391
  children: "✕"
334
392
  }
335
393
  )
336
394
  ] })
337
395
  ] }),
338
- f.map((i) => /* @__PURE__ */ e(
339
- ee,
396
+ d.map((c) => /* @__PURE__ */ e(
397
+ oe,
340
398
  {
341
- champ: i,
399
+ champ: c,
342
400
  langue: r,
343
- valeur: m?.[i.key],
344
- changer: (h) => u(o, i.key, h)
401
+ valeur: b?.[c.key],
402
+ changer: (h) => l(o, c.key, h)
345
403
  },
346
- i.key
404
+ c.key
347
405
  ))
348
406
  ] }, o)),
349
407
  /* @__PURE__ */ e(
@@ -351,9 +409,9 @@ function ee({ champ: n, valeur: t, changer: c, langue: r }) {
351
409
  {
352
410
  type: "button",
353
411
  className: "bouton",
354
- onClick: () => c([
412
+ onClick: () => i([
355
413
  ...a,
356
- Object.fromEntries(f.map((m) => [m.key, ue(m)]))
414
+ Object.fromEntries(d.map((b) => [b.key, ge(b)]))
357
415
  ]),
358
416
  children: "+ Ajouter"
359
417
  }
@@ -361,175 +419,175 @@ function ee({ champ: n, valeur: t, changer: c, langue: r }) {
361
419
  ] });
362
420
  }
363
421
  if (n.localized) {
364
- const a = le(t, r), f = t && typeof t == "object" && !Array.isArray(t) ? t : {};
365
- return /* @__PURE__ */ b("div", { className: "champ", children: [
422
+ const a = he(t, r), d = t && typeof t == "object" && !Array.isArray(t) ? t : {};
423
+ return /* @__PURE__ */ m("div", { className: "champ", children: [
366
424
  /* @__PURE__ */ e("span", { className: "champ__etiquette", children: n.label }),
367
425
  n.help && /* @__PURE__ */ e("p", { className: "champ__aide", children: n.help }),
368
- a.map((u) => /* @__PURE__ */ b("div", { style: { marginBottom: 8 }, children: [
369
- /* @__PURE__ */ e("span", { className: "champ__langue", children: u }),
426
+ a.map((l) => /* @__PURE__ */ m("div", { style: { marginBottom: 8 }, children: [
427
+ /* @__PURE__ */ e("span", { className: "champ__langue", children: l }),
370
428
  /* @__PURE__ */ e(
371
- G,
429
+ Z,
372
430
  {
373
431
  champ: n,
374
- valeur: f[u],
375
- changer: (m) => c({ ...f, [u]: m })
432
+ valeur: d[l],
433
+ changer: (b) => i({ ...d, [l]: b })
376
434
  }
377
435
  )
378
- ] }, u))
436
+ ] }, l))
379
437
  ] });
380
438
  }
381
- return /* @__PURE__ */ b("div", { className: "champ", children: [
439
+ return /* @__PURE__ */ m("div", { className: "champ", children: [
382
440
  /* @__PURE__ */ e("label", { className: "champ__etiquette", children: n.label }),
383
- /* @__PURE__ */ e(G, { champ: n, valeur: t, changer: c }),
441
+ /* @__PURE__ */ e(Z, { champ: n, valeur: t, changer: i }),
384
442
  n.help && /* @__PURE__ */ e("p", { className: "champ__aide", children: n.help })
385
443
  ] });
386
444
  }
387
- const de = ["lystech-editeur-hote", "lystech-connexion-hote"];
388
- function pe(n) {
445
+ const ve = ["lystech-editeur-hote", "lystech-connexion-hote"];
446
+ function ye(n) {
389
447
  const t = /* @__PURE__ */ new Map();
390
- for (const [c, r] of Object.entries(n))
391
- for (const [a, f] of Object.entries(r)) {
392
- const u = String(f ?? "").trim();
393
- if (u.length < 2 || u.includes("{{")) continue;
394
- const m = t.get(u);
395
- m ? m.push({ ns: c, chemin: a }) : t.set(u, [{ ns: c, chemin: a }]);
448
+ for (const [i, r] of Object.entries(n))
449
+ for (const [a, d] of Object.entries(r)) {
450
+ const l = String(d ?? "").trim();
451
+ if (l.length < 2 || l.includes("{{")) continue;
452
+ const b = t.get(l);
453
+ b ? b.push({ ns: i, chemin: a }) : t.set(l, [{ ns: i, chemin: a }]);
396
454
  }
397
455
  return t;
398
456
  }
399
- function me(n) {
400
- const t = /* @__PURE__ */ new Map(), c = document.body.querySelectorAll("*");
401
- for (const r of c) {
402
- if (de.some((u) => r.id === u || r.closest("#" + u)) || r.children.length > 0) continue;
457
+ function _e(n) {
458
+ const t = /* @__PURE__ */ new Map(), i = document.body.querySelectorAll("*");
459
+ for (const r of i) {
460
+ if (ve.some((l) => r.id === l || r.closest("#" + l)) || r.children.length > 0) continue;
403
461
  const a = (r.textContent ?? "").trim();
404
462
  if (a.length < 2) continue;
405
- const f = n.get(a);
406
- f && t.set(r, { valeur: a, candidats: f });
463
+ const d = n.get(a);
464
+ d && t.set(r, { valeur: a, candidats: d });
407
465
  }
408
466
  return t;
409
467
  }
410
- function be({
468
+ function we({
411
469
  source: n,
412
470
  actif: t,
413
- surModification: c
471
+ surModification: i
414
472
  }) {
415
- const r = F(/* @__PURE__ */ new Map()), a = F(null), [f, u] = k(null), m = F(n);
416
- m.current = n;
417
- const o = F(c);
418
- return o.current = c, B(() => {
473
+ const r = B(/* @__PURE__ */ new Map()), a = B(null), [d, l] = L(null), b = B(n);
474
+ b.current = n;
475
+ const o = B(i);
476
+ return o.current = i, J(() => {
419
477
  if (!t) return;
420
- const i = m.current.langueCourante(), h = pe(m.current.dictionnaire(i)), g = () => {
421
- r.current = me(h);
478
+ const c = b.current.langueCourante(), h = ye(b.current.dictionnaire(c)), g = () => {
479
+ r.current = _e(h);
422
480
  };
423
481
  g();
424
- let v;
425
- const S = new MutationObserver(() => {
426
- a.current || (clearTimeout(v), v = setTimeout(g, 250));
482
+ let C;
483
+ const E = new MutationObserver(() => {
484
+ a.current || (clearTimeout(C), C = setTimeout(g, 250));
427
485
  });
428
- S.observe(document.body, { childList: !0, subtree: !0 });
429
- const _ = "outline:2px dashed rgba(59,165,141,.85);outline-offset:3px;border-radius:3px;cursor:text;", U = (d) => {
430
- const s = d.target;
486
+ E.observe(document.body, { childList: !0, subtree: !0 });
487
+ const v = "outline:2px dashed rgba(59,165,141,.85);outline-offset:3px;border-radius:3px;cursor:text;", R = (p) => {
488
+ const s = p.target;
431
489
  !(s instanceof HTMLElement) || a.current || r.current.has(s) && (s.dataset.lysStyleAvant || (s.dataset.lysStyleAvant = s.getAttribute("style") ?? ""), s.setAttribute(
432
490
  "style",
433
- (s.dataset.lysStyleAvant ?? "") + _
491
+ (s.dataset.lysStyleAvant ?? "") + v
434
492
  ));
435
- }, z = (d) => {
436
- const s = d.target;
493
+ }, q = (p) => {
494
+ const s = p.target;
437
495
  if (!(s instanceof HTMLElement) || a.current?.el === s || s.dataset.lysStyleAvant === void 0) return;
438
- const y = s.dataset.lysStyleAvant;
439
- delete s.dataset.lysStyleAvant, y ? s.setAttribute("style", y) : s.removeAttribute("style");
440
- }, T = (d, s) => {
441
- const y = d.getAttribute("style") ?? "";
496
+ const N = s.dataset.lysStyleAvant;
497
+ delete s.dataset.lysStyleAvant, N ? s.setAttribute("style", N) : s.removeAttribute("style");
498
+ }, I = (p, s) => {
499
+ const N = p.getAttribute("style") ?? "";
442
500
  a.current = {
443
- el: d,
444
- avant: (d.textContent ?? "").trim(),
501
+ el: p,
502
+ avant: (p.textContent ?? "").trim(),
445
503
  ns: s.ns,
446
504
  chemin: s.chemin,
447
- styleAvant: d.dataset.lysStyleAvant ?? y
448
- }, d.setAttribute("contenteditable", "plaintext-only"), d.setAttribute(
505
+ styleAvant: p.dataset.lysStyleAvant ?? N
506
+ }, p.setAttribute("contenteditable", "plaintext-only"), p.setAttribute(
449
507
  "style",
450
- (d.dataset.lysStyleAvant ?? "") + "outline:2px solid #3ba58d;outline-offset:3px;border-radius:3px;"
451
- ), d.focus();
452
- const P = window.getSelection(), O = document.createRange();
453
- O.selectNodeContents(d), P?.removeAllRanges(), P?.addRange(O);
454
- }, w = async (d) => {
508
+ (p.dataset.lysStyleAvant ?? "") + "outline:2px solid #3ba58d;outline-offset:3px;border-radius:3px;"
509
+ ), p.focus();
510
+ const P = window.getSelection(), D = document.createRange();
511
+ D.selectNodeContents(p), P?.removeAllRanges(), P?.addRange(D);
512
+ }, w = async (p) => {
455
513
  const s = a.current;
456
514
  if (!s) return;
457
515
  a.current = null;
458
- const y = (s.el.textContent ?? "").trim();
516
+ const N = (s.el.textContent ?? "").trim();
459
517
  s.el.removeAttribute("contenteditable");
460
518
  const P = s.el.dataset.lysStyleAvant;
461
- if (delete s.el.dataset.lysStyleAvant, P ? s.el.setAttribute("style", P) : s.el.removeAttribute("style"), d || y === s.avant) {
462
- d && (s.el.textContent = s.avant);
519
+ if (delete s.el.dataset.lysStyleAvant, P ? s.el.setAttribute("style", P) : s.el.removeAttribute("style"), p || N === s.avant) {
520
+ p && (s.el.textContent = s.avant);
463
521
  return;
464
522
  }
465
- const O = m.current.langueCourante();
466
- m.current.poser(O, s.ns, s.chemin, y), await o.current(s.ns, s.chemin, O, y);
467
- }, N = (d) => {
468
- const s = d.target;
523
+ const D = b.current.langueCourante();
524
+ b.current.poser(D, s.ns, s.chemin, N), await o.current(s.ns, s.chemin, D, N);
525
+ }, _ = (p) => {
526
+ const s = p.target;
469
527
  if (!(s instanceof HTMLElement)) return;
470
528
  if (a.current) {
471
529
  if (a.current.el === s) return;
472
530
  w(!1);
473
531
  }
474
- const y = r.current.get(s);
475
- if (y) {
476
- if (d.preventDefault(), d.stopPropagation(), y.candidats.length === 1) {
477
- T(s, y.candidats[0]);
532
+ const N = r.current.get(s);
533
+ if (N) {
534
+ if (p.preventDefault(), p.stopPropagation(), N.candidats.length === 1) {
535
+ I(s, N.candidats[0]);
478
536
  return;
479
537
  }
480
- u({
538
+ l({
481
539
  el: s,
482
- candidats: y.candidats,
483
- x: d.clientX,
484
- y: d.clientY
540
+ candidats: N.candidats,
541
+ x: p.clientX,
542
+ y: p.clientY
485
543
  });
486
544
  }
487
- }, A = (d) => {
488
- a.current && (d.key === "Escape" ? (d.preventDefault(), w(!0)) : d.key === "Enter" && !d.shiftKey && (d.preventDefault(), w(!1)));
489
- }, M = () => {
545
+ }, O = (p) => {
546
+ a.current && (p.key === "Escape" ? (p.preventDefault(), w(!0)) : p.key === "Enter" && !p.shiftKey && (p.preventDefault(), w(!1)));
547
+ }, H = () => {
490
548
  a.current && w(!1);
491
549
  };
492
- document.addEventListener("mouseover", U, !0), document.addEventListener("mouseout", z, !0), document.addEventListener("click", N, !0);
493
- const I = (d) => {
550
+ document.addEventListener("mouseover", R, !0), document.addEventListener("mouseout", q, !0), document.addEventListener("click", _, !0);
551
+ const U = (p) => {
494
552
  if (!a.current) return;
495
- const s = d.inputType;
496
- (s === "insertParagraph" || s === "insertLineBreak") && (d.preventDefault(), w(!1));
553
+ const s = p.inputType;
554
+ (s === "insertParagraph" || s === "insertLineBreak") && (p.preventDefault(), w(!1));
497
555
  };
498
- return document.addEventListener("beforeinput", I, !0), document.addEventListener("keydown", A, !0), document.addEventListener("focusout", M, !0), window.__lysChoisir = (d, s) => {
499
- u(null), T(s, d);
556
+ return document.addEventListener("beforeinput", U, !0), document.addEventListener("keydown", O, !0), document.addEventListener("focusout", H, !0), window.__lysChoisir = (p, s) => {
557
+ l(null), I(s, p);
500
558
  }, () => {
501
- clearTimeout(v), S.disconnect(), document.removeEventListener("mouseover", U, !0), document.removeEventListener("mouseout", z, !0), document.removeEventListener("click", N, !0), document.removeEventListener("beforeinput", I, !0), document.removeEventListener("keydown", A, !0), document.removeEventListener("focusout", M, !0), a.current && w(!0), delete window.__lysChoisir;
559
+ clearTimeout(C), E.disconnect(), document.removeEventListener("mouseover", R, !0), document.removeEventListener("mouseout", q, !0), document.removeEventListener("click", _, !0), document.removeEventListener("beforeinput", U, !0), document.removeEventListener("keydown", O, !0), document.removeEventListener("focusout", H, !0), a.current && w(!0), delete window.__lysChoisir;
502
560
  };
503
- }, [t]), f ? /* @__PURE__ */ b(
561
+ }, [t]), d ? /* @__PURE__ */ m(
504
562
  "div",
505
563
  {
506
564
  className: "choix",
507
565
  style: {
508
- top: Math.min(f.y + 10, window.innerHeight - 200),
509
- left: Math.min(f.x, window.innerWidth - 280)
566
+ top: Math.min(d.y + 10, window.innerHeight - 200),
567
+ left: Math.min(d.x, window.innerWidth - 280)
510
568
  },
511
569
  children: [
512
570
  /* @__PURE__ */ e("p", { className: "choix__titre", children: "Ce texte apparaît à plusieurs endroits." }),
513
571
  /* @__PURE__ */ e("p", { className: "choix__aide", children: "Lequel corrigez-vous ?" }),
514
- f.candidats.map((i) => /* @__PURE__ */ b(
572
+ d.candidats.map((c) => /* @__PURE__ */ m(
515
573
  "button",
516
574
  {
517
575
  type: "button",
518
576
  className: "choix__option",
519
- onClick: () => window.__lysChoisir?.(i, f.el),
577
+ onClick: () => window.__lysChoisir?.(c, d.el),
520
578
  children: [
521
- /* @__PURE__ */ e("span", { className: "choix__chemin", children: i.chemin }),
522
- /* @__PURE__ */ e("span", { className: "choix__ns", children: i.ns })
579
+ /* @__PURE__ */ e("span", { className: "choix__chemin", children: c.chemin }),
580
+ /* @__PURE__ */ e("span", { className: "choix__ns", children: c.ns })
523
581
  ]
524
582
  },
525
- i.ns + ":" + i.chemin
583
+ c.ns + ":" + c.chemin
526
584
  )),
527
585
  /* @__PURE__ */ e(
528
586
  "button",
529
587
  {
530
588
  type: "button",
531
589
  className: "bouton bouton--discret",
532
- onClick: () => u(null),
590
+ onClick: () => l(null),
533
591
  children: "Annuler"
534
592
  }
535
593
  )
@@ -537,189 +595,211 @@ function be({
537
595
  }
538
596
  ) : null;
539
597
  }
540
- const Y = /^i18n:([^:]+):(.*)$/, J = "commun";
541
- function K(n, t) {
598
+ const $ = /^i18n:([^:]+):(.*)$/, G = "commun";
599
+ function ee(n, t) {
542
600
  return JSON.stringify(n ?? {}) === JSON.stringify(t ?? {});
543
601
  }
544
- function fe({ api: n, pont: t }) {
545
- const [c, r] = k([]), [a, f] = k([]), [u, m] = k(t.page), [o, i] = k(null), [h, g] = k({}), [v, S] = k(!1), [_, U] = k("modifier"), [z, T] = k(!1), [w, N] = k(
602
+ function Ne({ api: n, pont: t }) {
603
+ const [i, r] = L([]), [a, d] = L([]), [l, b] = L(t.page), [o, c] = L(null), [h, g] = L({}), [C, E] = L(!1), [v, R] = L("modifier"), [q, I] = L(!1), [w, _] = L(
546
604
  null
547
605
  );
548
- B(() => (t.surChangementDePage = (l) => {
549
- m(l), i(null), S(!1);
606
+ J(() => (t.surChangementDePage = (u) => {
607
+ b(u), c(null), E(!1);
550
608
  }, () => {
551
609
  t.surChangementDePage = void 0;
552
610
  }), [t]);
553
- const A = H(async () => {
611
+ const O = F(async () => {
554
612
  try {
555
- const [l, p] = await Promise.all([
556
- n.pourPage(u),
557
- u === J ? Promise.resolve([]) : n.pourPage(J)
558
- ]), x = [...l, ...p];
559
- return f(x), x;
613
+ const [u, f] = await Promise.all([
614
+ n.pourPage(l),
615
+ l === G ? Promise.resolve([]) : n.pourPage(G)
616
+ ]), x = [...u, ...f];
617
+ return d(x), x;
560
618
  } catch {
561
- return N({
619
+ return _({
562
620
  ton: "erreur",
563
621
  texte: "Impossible de lire le contenu du site."
564
622
  }), [];
565
623
  }
566
- }, [n, u]);
567
- B(() => {
624
+ }, [n, l]);
625
+ J(() => {
568
626
  n.schemas().then(r).catch(() => r([]));
569
- }, [n]), B(() => {
570
- A();
571
- }, [A]);
572
- const M = H(
573
- (l, p) => {
574
- let x = null, C = -1;
575
- for (const R of c) {
576
- const L = Y.exec(R.blockType);
577
- if (!L || L[1] !== l) continue;
578
- const q = L[2];
579
- (q === "" || p === q || p.startsWith(q + ".")) && q.length > C && (x = R, C = q.length);
627
+ }, [n]), J(() => {
628
+ O();
629
+ }, [O]);
630
+ const H = F(
631
+ (u, f) => {
632
+ let x = null, A = -1;
633
+ for (const T of i) {
634
+ const y = $.exec(T.blockType);
635
+ if (!y || y[1] !== u) continue;
636
+ const k = y[2];
637
+ (k === "" || f === k || f.startsWith(k + ".")) && k.length > A && (x = T, A = k.length);
580
638
  }
581
639
  if (!x) return null;
582
- const E = Y.exec(x.blockType)?.[2] ?? "", j = E ? p.slice(E.length + 1) : p;
583
- return { bloc: x, champ: j };
640
+ const S = $.exec(x.blockType)?.[2] ?? "", z = S ? f.slice(S.length + 1) : f;
641
+ return { bloc: x, champ: z };
584
642
  },
585
- [c]
586
- ), I = H(
587
- (l) => c.find((p) => p.blockType === l),
588
- [c]
589
- ), d = W(
590
- () => c.filter((l) => {
591
- const p = l.pages ?? [];
592
- return p.includes(u) || p.includes(J);
643
+ [i]
644
+ ), U = F(
645
+ (u) => i.find((f) => f.blockType === u),
646
+ [i]
647
+ ), p = K(
648
+ () => i.filter((u) => {
649
+ const f = u.pages ?? [];
650
+ return f.includes(l) || f.includes(G);
593
651
  }),
594
- [c, u]
595
- ), s = W(
596
- () => a.filter((l) => l.draft && !K(l.draft, l.data)),
652
+ [i, l]
653
+ ), s = K(
654
+ () => a.filter((u) => u.draft && !ee(u.draft, u.data)),
597
655
  [a]
598
- ), y = H(
599
- async (l, p, x, C) => {
600
- const E = M(l, p);
601
- if (!E) {
602
- N({
656
+ ), N = F(
657
+ async (u, f, x, A) => {
658
+ const S = H(u, f);
659
+ if (!S) {
660
+ _({
603
661
  ton: "erreur",
604
- texte: `Ce texte (${l}:${p}) n'appartient à aucun bloc déclaré.`
662
+ texte: `Ce texte (${u}:${f}) n'appartient à aucun bloc déclaré.`
605
663
  });
606
664
  return;
607
665
  }
608
- const j = a.find((X) => X.blockType === E.bloc.blockType), R = j?.draft ?? j?.data ?? {}, L = R[E.champ], q = L && typeof L == "object" && !Array.isArray(L) ? { ...L, [x]: C } : { [x]: C }, $ = { ...R, [E.champ]: q };
666
+ const z = a.find((M) => M.blockType === S.bloc.blockType), T = z?.draft ?? z?.data ?? {}, y = T[S.champ], k = y && typeof y == "object" && !Array.isArray(y) ? { ...y, [x]: A } : { [x]: A }, j = { ...T, [S.champ]: k };
609
667
  try {
610
- if (j?.UID)
611
- await n.enregistrerBrouillon(j.UID, $);
668
+ if (z?.UID)
669
+ await n.enregistrerBrouillon(z.UID, j);
612
670
  else {
613
- const X = E.bloc.pages?.[0] ?? u;
614
- await n.creer(X, E.bloc.blockType, $);
671
+ const M = S.bloc.pages?.[0] ?? l;
672
+ await n.creer(M, S.bloc.blockType, j);
615
673
  }
616
- await A(), N(null);
674
+ await O(), _(null);
617
675
  } catch {
618
- N({
676
+ _({
619
677
  ton: "erreur",
620
678
  texte: "Enregistrement impossible. Votre texte est toujours à l'écran."
621
679
  });
622
680
  }
623
681
  },
624
- [n, M, u, A, a]
682
+ [n, H, l, O, a]
625
683
  ), P = async () => {
626
684
  if (!s.length) return;
627
- T(!0), N(null);
628
- const l = s.length;
685
+ I(!0), _(null);
686
+ const u = s.length;
629
687
  try {
630
- for (const p of s) await n.publier(p.UID);
631
- await A(), t.recharger(), N({
688
+ for (const f of s) await n.publier(f.UID);
689
+ await O(), t.recharger(), _({
632
690
  ton: "ok",
633
- texte: l === 1 ? "Publié. Vos visiteurs le voient maintenant." : `${l} modifications publiées.`
691
+ texte: u === 1 ? "Publié. Vos visiteurs le voient maintenant." : `${u} modifications publiées.`
634
692
  });
635
693
  } catch {
636
- N({
694
+ _({
637
695
  ton: "erreur",
638
696
  texte: "La publication a échoué. Rien n'a été mis en ligne."
639
697
  });
640
698
  } finally {
641
- T(!1);
699
+ I(!1);
642
700
  }
643
- }, O = async () => {
644
- T(!0);
701
+ }, D = async () => {
702
+ I(!0);
645
703
  try {
646
- for (const p of s) await n.annuler(p.UID);
647
- const l = await A();
704
+ for (const f of s) await n.annuler(f.UID);
705
+ const u = await O();
648
706
  if (t.sourceTexte) {
649
- const { appliquerAuxTextes: p } = await import("./morceaux/sourceTexte-BMPMpNg9.js");
650
- p(
651
- l.map((x) => ({ blockType: x.blockType, data: x.data })),
707
+ const { appliquerAuxTextes: f } = await import("./morceaux/sourceTexte-BMPMpNg9.js");
708
+ f(
709
+ u.map((x) => ({ blockType: x.blockType, data: x.data })),
652
710
  t.sourceTexte
653
711
  );
654
712
  }
655
- N({
713
+ _({
656
714
  ton: "info",
657
715
  texte: "Modifications abandonnées. On est revenu à ce qui est en ligne."
658
716
  });
659
717
  } finally {
660
- T(!1);
718
+ I(!1);
719
+ }
720
+ }, se = (u) => {
721
+ const f = a.find((T) => T.blockType === u), x = f?.draft ?? f?.data ?? {}, A = U(u), S = $.exec(u), z = {};
722
+ if (S && A && t.sourceTexte) {
723
+ const T = S[1], y = S[2], k = t.sourceTexte.langues(), j = {};
724
+ for (const M of k)
725
+ j[M] = t.sourceTexte.dictionnaire(M)[T] ?? {};
726
+ for (const M of A.fields) {
727
+ const ue = y ? y + "." + M.key : M.key, X = {};
728
+ for (const W of k) {
729
+ const Y = j[W]?.[ue];
730
+ typeof Y == "string" && (X[W] = Y);
731
+ }
732
+ Object.keys(X).length && (z[M.key] = X);
733
+ }
734
+ }
735
+ for (const [T, y] of Object.entries(x)) {
736
+ const k = z[T], j = y && typeof y == "object" && !Array.isArray(y) && k && typeof k == "object" && !Array.isArray(k);
737
+ z[T] = j ? { ...k, ...y } : y;
661
738
  }
662
- }, oe = (l) => {
663
- const p = a.find((x) => x.blockType === l);
664
- g({ ...p?.draft ?? p?.data ?? {} }), i(l), S(!1), N(null);
665
- }, re = (l, p) => g((x) => ({ ...x, [l]: p })), ae = async () => {
739
+ g(z), c(u), E(!1), _(null);
740
+ }, ie = (u, f) => g((x) => ({ ...x, [u]: f })), ce = async () => {
666
741
  if (o) {
667
- T(!0);
742
+ I(!0);
668
743
  try {
669
- const l = a.find((x) => x.blockType === o);
670
- if (l?.UID) await n.enregistrerBrouillon(l.UID, h);
744
+ const u = a.find((x) => x.blockType === o);
745
+ if (u?.UID) await n.enregistrerBrouillon(u.UID, h);
671
746
  else {
672
- const x = I(o)?.pages?.[0] ?? u;
747
+ const x = U(o)?.pages?.[0] ?? l;
673
748
  await n.creer(x, o, h);
674
749
  }
675
- const p = await A();
750
+ const f = await O();
676
751
  if (t.sourceTexte) {
677
752
  const { appliquerAuxTextes: x } = await import("./morceaux/sourceTexte-BMPMpNg9.js");
678
753
  x(
679
- p.map((C) => ({ blockType: C.blockType, data: C.draft ?? C.data })),
754
+ f.map((A) => ({ blockType: A.blockType, data: A.draft ?? A.data })),
680
755
  t.sourceTexte
681
756
  );
682
757
  }
683
- N({
758
+ _({
684
759
  ton: "ok",
685
760
  texte: "Enregistré. Rien n'a encore changé pour vos visiteurs."
686
761
  });
687
762
  } catch {
688
- N({ ton: "erreur", texte: "L'enregistrement a échoué." });
763
+ _({ ton: "erreur", texte: "L'enregistrement a échoué." });
689
764
  } finally {
690
- T(!1);
765
+ I(!1);
691
766
  }
692
767
  }
693
- }, ie = () => {
768
+ }, le = () => {
769
+ try {
770
+ window.localStorage.setItem("lystech-edit-sortie", "1"), window.localStorage.removeItem("lystech-edit");
771
+ } catch {
772
+ }
694
773
  try {
695
774
  window.sessionStorage.removeItem("lystech-edit");
696
775
  } catch {
697
776
  }
698
777
  window.location.reload();
699
- }, D = o ? I(o) : void 0, V = !o && !v;
700
- return /* @__PURE__ */ b("div", { className: "calque", children: [
778
+ }, V = o ? U(o) : void 0, Q = !o && !C;
779
+ return /* @__PURE__ */ m("div", { className: "calque", children: [
780
+ /* @__PURE__ */ e("div", { className: "cadre-global", "aria-hidden": "true" }),
701
781
  t.sourceTexte && /* @__PURE__ */ e(
702
- be,
782
+ we,
703
783
  {
704
784
  source: t.sourceTexte,
705
- actif: V && !z && _ === "modifier",
706
- surModification: y
785
+ actif: Q && !q && v === "modifier",
786
+ surModification: N
707
787
  }
708
788
  ),
709
- V && /* @__PURE__ */ b("div", { className: "barre", children: [
789
+ Q && /* @__PURE__ */ m("div", { className: "barre", children: [
710
790
  /* @__PURE__ */ e("span", { className: "barre__point" }),
711
- /* @__PURE__ */ e("span", { className: "barre__texte", children: _ === "modifier" ? "Cliquez un texte pour le corriger" : "Navigation libre — les clics ouvrent les liens" }),
791
+ /* @__PURE__ */ e("span", { className: "barre__texte", children: v === "modifier" ? "Cliquez un texte pour le corriger" : "Navigation libre — les clics ouvrent les liens" }),
712
792
  /* @__PURE__ */ e(
713
793
  "button",
714
794
  {
715
795
  type: "button",
716
- className: "bouton " + (_ === "circuler" ? "bouton--principal" : ""),
717
- onClick: () => U((l) => l === "modifier" ? "circuler" : "modifier"),
718
- title: _ === "modifier" ? "Passer en navigation pour changer de page" : "Revenir a la modification des textes",
719
- children: _ === "modifier" ? "Circuler" : "Modifier"
796
+ className: "bouton " + (v === "circuler" ? "bouton--principal" : ""),
797
+ onClick: () => R((u) => u === "modifier" ? "circuler" : "modifier"),
798
+ title: v === "modifier" ? "Passer en navigation pour changer de page" : "Revenir a la modification des textes",
799
+ children: v === "modifier" ? "Circuler" : "Modifier"
720
800
  }
721
801
  ),
722
- s.length > 0 ? /* @__PURE__ */ b(Q, { children: [
802
+ s.length > 0 ? /* @__PURE__ */ m(te, { children: [
723
803
  /* @__PURE__ */ e("span", { className: "barre__compte", children: s.length === 1 ? "1 modification non publiée" : `${s.length} modifications non publiées` }),
724
804
  /* @__PURE__ */ e(
725
805
  "button",
@@ -727,7 +807,7 @@ function fe({ api: n, pont: t }) {
727
807
  type: "button",
728
808
  className: "bouton bouton--principal",
729
809
  onClick: P,
730
- disabled: z,
810
+ disabled: q,
731
811
  children: "Publier"
732
812
  }
733
813
  ),
@@ -736,8 +816,8 @@ function fe({ api: n, pont: t }) {
736
816
  {
737
817
  type: "button",
738
818
  className: "bouton bouton--discret",
739
- onClick: O,
740
- disabled: z,
819
+ onClick: D,
820
+ disabled: q,
741
821
  children: "Abandonner"
742
822
  }
743
823
  )
@@ -746,25 +826,29 @@ function fe({ api: n, pont: t }) {
746
826
  "button",
747
827
  {
748
828
  type: "button",
749
- className: "bouton bouton--discret",
750
- onClick: () => S(!0),
751
- children: "Plus…"
829
+ className: "bouton bouton--icone bouton--discret",
830
+ onClick: () => E(!0),
831
+ title: "Tous les contenus",
832
+ "aria-label": "Tous les contenus",
833
+ children: "⋮"
752
834
  }
753
835
  ),
754
836
  /* @__PURE__ */ e(
755
837
  "button",
756
838
  {
757
839
  type: "button",
758
- className: "bouton bouton--discret",
759
- onClick: ie,
760
- children: "Quitter"
840
+ className: "bouton bouton--icone bouton--sortie",
841
+ onClick: le,
842
+ title: "Quitter le mode édition",
843
+ "aria-label": "Quitter le mode édition",
844
+ children: "✕"
761
845
  }
762
846
  )
763
847
  ] }),
764
- w && V && /* @__PURE__ */ e("div", { className: "flottant", children: /* @__PURE__ */ e("p", { className: "message message--" + w.ton, children: w.texte }) }),
765
- v && /* @__PURE__ */ b("div", { className: "panneau", role: "dialog", "aria-label": "Tous les contenus", children: [
766
- /* @__PURE__ */ b("div", { className: "panneau__tete", children: [
767
- /* @__PURE__ */ b("div", { style: { flex: 1 }, children: [
848
+ w && Q && /* @__PURE__ */ e("div", { className: "flottant", children: /* @__PURE__ */ e("p", { className: "message message--" + w.ton, children: w.texte }) }),
849
+ C && /* @__PURE__ */ m("div", { className: "panneau", role: "dialog", "aria-label": "Tous les contenus", children: [
850
+ /* @__PURE__ */ m("div", { className: "panneau__tete", children: [
851
+ /* @__PURE__ */ m("div", { style: { flex: 1 }, children: [
768
852
  /* @__PURE__ */ e("h2", { className: "panneau__titre", children: "Tous les contenus" }),
769
853
  /* @__PURE__ */ e("p", { className: "panneau__sous", children: "Y compris ce qui ne s'affiche pas dans la page : titre de l'onglet, description dans les moteurs de recherche, textes contenant une valeur calculée." })
770
854
  ] }),
@@ -773,76 +857,76 @@ function fe({ api: n, pont: t }) {
773
857
  {
774
858
  type: "button",
775
859
  className: "bouton bouton--icone bouton--discret",
776
- onClick: () => S(!1),
860
+ onClick: () => E(!1),
777
861
  "aria-label": "Fermer",
778
862
  children: "✕"
779
863
  }
780
864
  )
781
865
  ] }),
782
- /* @__PURE__ */ b("div", { className: "panneau__corps", children: [
783
- d.length === 0 && /* @__PURE__ */ e("p", { className: "message message--info", children: "Aucun contenu déclaré pour cette page." }),
784
- d.map((l) => {
785
- const p = a.find((C) => C.blockType === l.blockType), x = p?.draft && !K(p.draft, p.data);
786
- return /* @__PURE__ */ b(
866
+ /* @__PURE__ */ m("div", { className: "panneau__corps", children: [
867
+ p.length === 0 && /* @__PURE__ */ e("p", { className: "message message--info", children: "Aucun contenu déclaré pour cette page." }),
868
+ p.map((u) => {
869
+ const f = a.find((A) => A.blockType === u.blockType), x = f?.draft && !ee(f.draft, f.data);
870
+ return /* @__PURE__ */ m(
787
871
  "button",
788
872
  {
789
873
  type: "button",
790
874
  className: "rangee",
791
- onClick: () => oe(l.blockType),
875
+ onClick: () => se(u.blockType),
792
876
  children: [
793
- /* @__PURE__ */ e("span", { className: "rangee__nom", children: l.label }),
794
- /* @__PURE__ */ e("span", { className: "rangee__info", children: x ? "non publié" : `${l.fields.length} textes` })
877
+ /* @__PURE__ */ e("span", { className: "rangee__nom", children: u.label }),
878
+ /* @__PURE__ */ e("span", { className: "rangee__info", children: x ? "non publié" : `${u.fields.length} textes` })
795
879
  ]
796
880
  },
797
- l.blockType
881
+ u.blockType
798
882
  );
799
883
  })
800
884
  ] })
801
885
  ] }),
802
- o && D && /* @__PURE__ */ b(
886
+ o && V && /* @__PURE__ */ m(
803
887
  "div",
804
888
  {
805
889
  className: "panneau",
806
890
  role: "dialog",
807
- "aria-label": "Modifier " + D.label,
891
+ "aria-label": "Modifier " + V.label,
808
892
  children: [
809
- /* @__PURE__ */ b("div", { className: "panneau__tete", children: [
810
- /* @__PURE__ */ b("div", { style: { flex: 1 }, children: [
811
- /* @__PURE__ */ e("h2", { className: "panneau__titre", children: D.label }),
812
- D.description && /* @__PURE__ */ e("p", { className: "panneau__sous", children: D.description })
893
+ /* @__PURE__ */ m("div", { className: "panneau__tete", children: [
894
+ /* @__PURE__ */ m("div", { style: { flex: 1 }, children: [
895
+ /* @__PURE__ */ e("h2", { className: "panneau__titre", children: V.label }),
896
+ V.description && /* @__PURE__ */ e("p", { className: "panneau__sous", children: V.description })
813
897
  ] }),
814
898
  /* @__PURE__ */ e(
815
899
  "button",
816
900
  {
817
901
  type: "button",
818
902
  className: "bouton bouton--icone bouton--discret",
819
- onClick: () => i(null),
903
+ onClick: () => c(null),
820
904
  "aria-label": "Fermer",
821
905
  children: "✕"
822
906
  }
823
907
  )
824
908
  ] }),
825
- /* @__PURE__ */ b("div", { className: "panneau__corps", children: [
909
+ /* @__PURE__ */ m("div", { className: "panneau__corps", children: [
826
910
  w && /* @__PURE__ */ e("p", { className: "message message--" + w.ton, children: w.texte }),
827
- D.fields.map((l) => /* @__PURE__ */ e(
828
- ee,
911
+ V.fields.map((u) => /* @__PURE__ */ e(
912
+ oe,
829
913
  {
830
- champ: l,
914
+ champ: u,
831
915
  langue: t.langue,
832
- valeur: h[l.key],
833
- changer: (p) => re(l.key, p)
916
+ valeur: h[u.key],
917
+ changer: (f) => ie(u.key, f)
834
918
  },
835
- l.key
919
+ u.key
836
920
  ))
837
921
  ] }),
838
- /* @__PURE__ */ b("div", { className: "panneau__pied", children: [
922
+ /* @__PURE__ */ m("div", { className: "panneau__pied", children: [
839
923
  /* @__PURE__ */ e(
840
924
  "button",
841
925
  {
842
926
  type: "button",
843
927
  className: "bouton bouton--discret",
844
- onClick: () => i(null),
845
- disabled: z,
928
+ onClick: () => c(null),
929
+ disabled: q,
846
930
  children: "Fermer"
847
931
  }
848
932
  ),
@@ -852,8 +936,8 @@ function fe({ api: n, pont: t }) {
852
936
  {
853
937
  type: "button",
854
938
  className: "bouton bouton--principal",
855
- onClick: ae,
856
- disabled: z,
939
+ onClick: ce,
940
+ disabled: q,
857
941
  children: "Enregistrer"
858
942
  }
859
943
  )
@@ -863,7 +947,7 @@ function fe({ api: n, pont: t }) {
863
947
  )
864
948
  ] });
865
949
  }
866
- const xe = `
950
+ const ke = `
867
951
  :host {
868
952
  all: initial;
869
953
  --fond: #16181d;
@@ -1000,13 +1084,94 @@ const xe = `
1000
1084
  }
1001
1085
 
1002
1086
  .fenetre {
1003
- width: min(420px, 100%);
1004
- max-height: 90vh;
1087
+ position: relative;
1088
+ width: min(408px, 100%);
1089
+ max-height: 92vh;
1005
1090
  overflow-y: auto;
1091
+ padding: 30px 28px 20px;
1006
1092
  border: 1px solid var(--bord);
1007
- border-radius: 12px;
1008
- background: var(--fond);
1009
- box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
1093
+ border-radius: 18px;
1094
+ /* Une lueur d'accent dans le coin superieur : de la presence, sans le
1095
+ degrade violet-bleu qu'on voit sur une page d'accueil sur deux. */
1096
+ background:
1097
+ radial-gradient(120% 90% at 50% -20%, rgba(59, 165, 141, 0.16), transparent 62%),
1098
+ var(--fond);
1099
+ box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
1100
+ text-align: center;
1101
+ }
1102
+
1103
+ .fenetre__fermer {
1104
+ position: absolute; top: 12px; right: 12px;
1105
+ width: 30px; height: 30px;
1106
+ display: inline-flex; align-items: center; justify-content: center;
1107
+ border: 0; border-radius: 8px;
1108
+ background: transparent; color: var(--texte-doux);
1109
+ font: inherit; font-size: 14px; cursor: pointer;
1110
+ }
1111
+ .fenetre__fermer:hover { background: var(--fond-clair); color: var(--texte); }
1112
+
1113
+ /* ------------------------------------------------------------ MARQUE ---- */
1114
+
1115
+ .marque {
1116
+ display: inline-flex; align-items: center; gap: 7px;
1117
+ margin-bottom: 16px;
1118
+ color: var(--accent);
1119
+ }
1120
+ .marque svg { width: 20px; height: 20px; display: block; }
1121
+ .marque__mot {
1122
+ font-size: 12px; font-weight: 600;
1123
+ letter-spacing: 0.16em; text-transform: uppercase;
1124
+ color: var(--texte-doux);
1125
+ }
1126
+
1127
+ .fenetre__titre {
1128
+ margin: 0 0 6px;
1129
+ font-size: 20px; font-weight: 640; letter-spacing: -0.01em;
1130
+ color: var(--texte);
1131
+ }
1132
+ .fenetre__sous {
1133
+ margin: 0 auto 22px;
1134
+ max-width: 30ch;
1135
+ font-size: 13px; line-height: 1.5; color: var(--texte-doux);
1136
+ }
1137
+ .fenetre__corps { text-align: left; }
1138
+ .fenetre__pied {
1139
+ margin: 18px 0 0;
1140
+ padding-top: 14px;
1141
+ border-top: 1px solid var(--bord);
1142
+ font-size: 11.5px; line-height: 1.5; color: var(--texte-doux);
1143
+ text-align: center;
1144
+ }
1145
+
1146
+ /* ------------------------------------------------------ FOURNISSEURS ---- */
1147
+
1148
+ .fournisseurs { display: flex; flex-direction: column; gap: 10px; }
1149
+
1150
+ .fournisseur {
1151
+ display: flex; align-items: center; justify-content: center; gap: 10px;
1152
+ width: 100%; padding: 12px 16px;
1153
+ border: 1px solid transparent; border-radius: 10px;
1154
+ font: inherit; font-size: 14px; font-weight: 600;
1155
+ cursor: pointer;
1156
+ transition: transform 90ms ease, filter 90ms ease;
1157
+ }
1158
+ .fournisseur:hover { filter: brightness(1.06); }
1159
+ .fournisseur:active { transform: translateY(1px); }
1160
+ .fournisseur:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
1161
+ .fournisseur[disabled] { opacity: 0.55; cursor: default; transform: none; filter: none; }
1162
+ .fournisseur .logo { width: 18px; height: 18px; flex: none; display: block; }
1163
+
1164
+ /* LES COULEURS DE CHAQUE MARQUE, telles qu'elles les publient. Un bouton
1165
+ Google repeint aux couleurs du site devient moins reconnaissable — et un
1166
+ bouton de connexion qu'on ne reconnait pas est un bouton sur lequel on
1167
+ hesite a cliquer. */
1168
+ .fournisseur--google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
1169
+ .fournisseur--facebook { background: #1877f2; color: #fff; }
1170
+
1171
+ .bouton--large { width: 100%; padding: 12px 16px; font-size: 14px; }
1172
+
1173
+ @media (prefers-reduced-motion: reduce) {
1174
+ .fournisseur { transition: none; }
1010
1175
  }
1011
1176
 
1012
1177
  /* ------------------------------------------------------------ CHAMPS ---- */
@@ -1023,7 +1188,11 @@ const xe = `
1023
1188
  text-transform: uppercase; color: var(--texte-doux);
1024
1189
  }
1025
1190
 
1191
+ /* TOUS les types de champs, pas seulement ceux auxquels on pensait. Un
1192
+ type oublie — « password », « email » — retombe sur le style brut du
1193
+ navigateur : une ligne blanche au milieu d'un panneau sombre. */
1026
1194
  input[type="text"], input[type="url"], input[type="number"], input[type="date"],
1195
+ input[type="password"], input[type="email"], input[type="tel"], input[type="search"],
1027
1196
  select, textarea {
1028
1197
  width: 100%;
1029
1198
  padding: 8px 10px;
@@ -1088,7 +1257,7 @@ input:focus, select:focus, textarea:focus {
1088
1257
  @media (prefers-reduced-motion: reduce) {
1089
1258
  * { transition: none !important; animation: none !important; }
1090
1259
  }
1091
- `, he = `
1260
+ `, Ce = `
1092
1261
  /* --------------------------------------------------------- CHOIX -------- */
1093
1262
 
1094
1263
  /* Quand un meme texte vient de plusieurs cles, on demande laquelle plutot que
@@ -1138,71 +1307,95 @@ input:focus, select:focus, textarea:focus {
1138
1307
  max-width: min(460px, calc(100vw - 24px));
1139
1308
  }
1140
1309
  .flottant .message { margin: 0; box-shadow: 0 8px 26px rgba(0,0,0,.4); }
1141
- `, ge = "lystech-editeur-hote", ve = "lystech-connexion-hote";
1142
- function te(n) {
1310
+ `, Ae = `
1311
+ /* ON NE DOIT JAMAIS SE DEMANDER SI ON EST EN MODE EDITION. Une barre en bas
1312
+ se confond avec un bandeau de temoins ; un lisere qui borde tout l'ecran,
1313
+ present sur chaque page, ne se confond avec rien. Il ne prend aucun clic. */
1314
+ .cadre-global {
1315
+ position: fixed;
1316
+ inset: 0;
1317
+ pointer-events: none;
1318
+ border: 2px solid var(--accent);
1319
+ border-radius: 4px;
1320
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
1321
+ opacity: 0.85;
1322
+ }
1323
+
1324
+ /* La sortie est rouge au survol seulement : visible quand on la cherche,
1325
+ discrete le reste du temps — c'est le geste qu'on fait une fois. */
1326
+ .bouton--sortie { color: var(--texte-doux); background: transparent; border-color: transparent; }
1327
+ .bouton--sortie:hover { background: rgba(217, 119, 106, 0.16); color: var(--danger); }
1328
+ `, Se = "lystech-editeur-hote", Ee = "lystech-connexion-hote";
1329
+ function re(n) {
1143
1330
  document.getElementById(n)?.remove();
1144
1331
  const t = document.createElement("div");
1145
1332
  t.id = n, document.body.appendChild(t);
1146
- const c = t.attachShadow({ mode: "open" }), r = document.createElement("style");
1147
- r.textContent = xe + he, c.appendChild(r);
1333
+ const i = t.attachShadow({ mode: "open" }), r = document.createElement("style");
1334
+ r.textContent = ke + Ce + Ae, i.appendChild(r);
1148
1335
  const a = document.createElement("div");
1149
- return c.appendChild(a), { hote: t, point: a };
1336
+ return i.appendChild(a), { hote: t, point: a };
1150
1337
  }
1151
- function ne(n, t) {
1152
- let c = n;
1338
+ function ae(n, t) {
1339
+ let i = n;
1153
1340
  return () => {
1154
- const r = c;
1155
- c = null, setTimeout(() => {
1341
+ const r = i;
1342
+ i = null, setTimeout(() => {
1156
1343
  r?.unmount(), t.remove();
1157
1344
  }, 0);
1158
1345
  };
1159
1346
  }
1160
- function we({
1347
+ function qe({
1161
1348
  site: n,
1162
1349
  apiBaseUrl: t,
1163
- surJeton: c
1350
+ methodes: i,
1351
+ surJeton: r
1164
1352
  }) {
1165
- const { hote: r, point: a } = te(ve), f = Z(a), u = () => m();
1166
- f.render(
1353
+ const { hote: a, point: d } = re(Ee), l = ne(d), b = () => o();
1354
+ l.render(
1167
1355
  /* @__PURE__ */ e(
1168
- ce,
1356
+ xe,
1169
1357
  {
1170
1358
  site: n,
1171
1359
  apiBaseUrl: t,
1172
- surJeton: (o) => {
1173
- m(), c(o);
1360
+ ...i ? { methodes: i } : {},
1361
+ surJeton: (c) => {
1362
+ o(), r(c);
1174
1363
  },
1175
- surFermer: u
1364
+ surFermer: b
1176
1365
  }
1177
1366
  )
1178
1367
  );
1179
- const m = ne(f, r);
1180
- return m;
1368
+ const o = ae(l, a);
1369
+ return o;
1181
1370
  }
1182
- function ke({
1371
+ function Ie({
1183
1372
  jeton: n,
1184
1373
  site: t,
1185
- apiBaseUrl: c,
1374
+ apiBaseUrl: i,
1186
1375
  pont: r
1187
1376
  }) {
1188
- const { hote: a, point: f } = te(ge), u = Z(f), m = () => {
1377
+ const { hote: a, point: d } = re(Se), l = ne(d), b = () => {
1378
+ try {
1379
+ window.localStorage.setItem("lystech-edit-sortie", "1"), window.localStorage.removeItem("lystech-edit");
1380
+ } catch {
1381
+ }
1189
1382
  try {
1190
1383
  window.sessionStorage.removeItem("lystech-edit");
1191
1384
  } catch {
1192
1385
  }
1193
1386
  window.location.reload();
1194
1387
  };
1195
- return u.render(
1388
+ return l.render(
1196
1389
  /* @__PURE__ */ e(
1197
- fe,
1390
+ Ne,
1198
1391
  {
1199
- api: se({ jeton: n, site: t, apiBaseUrl: c, surJetonRefuse: m }),
1392
+ api: de({ jeton: n, site: t, apiBaseUrl: i, surJetonRefuse: b }),
1200
1393
  pont: r
1201
1394
  }
1202
1395
  )
1203
- ), ne(u, a);
1396
+ ), ae(l, a);
1204
1397
  }
1205
1398
  export {
1206
- we as monterConnexion,
1207
- ke as monterEditeur
1399
+ qe as monterConnexion,
1400
+ Ie as monterEditeur
1208
1401
  };