@amsom-habitat/cresol 0.2.8 → 0.3.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/cresol.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { library as e } from "@fortawesome/fontawesome-svg-core";
2
- import { faBriefcase as t, faBuilding as n, faBuildingShield as r, faCheck as i, faChevronLeft as a, faChevronRight as o, faCircleExclamation as s, faCircleInfo as c, faCircleQuestion as l, faDungeon as u, faFileSignature as d, faHandsHolding as f, faHourglass as p, faHouse as ee, faInfo as m, faLayerGroup as h, faLocationDot as te, faMagnifyingGlass as ne, faPersonShelter as re, faSquareParking as ie, faStore as ae, faTag as oe, faUser as se, faUserGraduate as ce, faXmark as le } from "@fortawesome/free-solid-svg-icons";
3
- import { AmsomModal as ue, AmsomOverlay as g } from "@amsom-habitat/ui";
4
- import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as de, createTextVNode as C, createVNode as w, guardReactiveProps as T, inject as fe, mergeProps as pe, normalizeClass as E, normalizeProps as D, openBlock as O, provide as me, reactive as k, ref as A, renderList as j, renderSlot as M, resolveComponent as N, toDisplayString as P, toHandlers as he, toRef as F, unref as I, vShow as ge, withCtx as L, withDirectives as _e } from "vue";
5
- import { AmsomNavTabsHorizontal as ve } from "@amsom-habitat/nav-tabs";
6
- import ye from "@amsom-habitat/horizontal-stepper";
7
- import { AmsomAutocomplete as R } from "@amsom-habitat/amsom-autocomplete";
8
- import be from "@amsom-habitat/axios-overlay";
9
- import z from "@amsom-habitat/user-manager";
10
- import { AmsomTextarea as xe } from "@amsom-habitat/amsom-textarea";
11
- import { AmsomUploadFile as Se } from "@amsom-habitat/file-manager";
2
+ import { faBriefcase as t, faBuilding as n, faBuildingShield as r, faCheck as i, faChevronLeft as a, faChevronRight as o, faCircleExclamation as s, faCircleInfo as c, faCircleQuestion as l, faDungeon as u, faFileSignature as d, faHandsHolding as f, faHourglass as p, faHouse as m, faInfo as h, faLayerGroup as ee, faLocationDot as g, faMagnifyingGlass as _, faPersonShelter as te, faSquareParking as ne, faStore as re, faTag as ie, faUser as ae, faUserGraduate as oe, faXmark as se } from "@fortawesome/free-solid-svg-icons";
3
+ import { AmsomModal as ce, AmsomOverlay as v } from "@amsom-habitat/ui";
4
+ import { Fragment as y, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createSlots as le, createTextVNode as T, createVNode as E, guardReactiveProps as D, inject as ue, mergeProps as de, normalizeClass as O, normalizeProps as k, openBlock as A, provide as fe, reactive as j, ref as M, renderList as N, renderSlot as P, resolveComponent as F, toDisplayString as I, toHandlers as pe, toRef as L, unref as R, vShow as me, withCtx as z, withDirectives as he } from "vue";
5
+ import { AmsomNavTabsHorizontal as ge } from "@amsom-habitat/nav-tabs";
6
+ import _e from "@amsom-habitat/horizontal-stepper";
7
+ import { AmsomAutocomplete as B } from "@amsom-habitat/amsom-autocomplete";
8
+ import ve from "@amsom-habitat/axios-overlay";
9
+ import ye from "@amsom-habitat/user-manager";
10
+ import { AmsomTextarea as be } from "@amsom-habitat/amsom-textarea";
11
+ import { AmsomUploadFile as xe } from "@amsom-habitat/file-manager";
12
12
  // src/icons.js
13
- e.add(t, n, r, i, a, o, s, c, l, u, d, f, p, ee, m, h, te, ne, re, ie, ae, oe, se, ce, le);
13
+ e.add(t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, ee, g, _, te, ne, re, ie, ae, oe, se);
14
14
  // src/utils/provenanceContact.js
15
- var B = {
15
+ var Se = {
16
16
  T: "phone",
17
17
  M: "envelope",
18
18
  G: "user-shield",
19
19
  V: "building",
20
20
  IP: "exclamation-triangle",
21
21
  C: "envelope-open"
22
- }, Ce = "comment-dots", we = (e) => B[e] ?? "comment-dots", Te = Object.keys(B), Ee = "T", V = {
22
+ }, Ce = (e) => Se[e] ?? "comment-dots", we = Object.keys(Se), Te = "T", V = {
23
23
  locataire: {
24
24
  libelle: "Locataire",
25
25
  icon: "house-user",
@@ -55,14 +55,14 @@ var B = {
55
55
  icon: "circle-question",
56
56
  couleur: "danger"
57
57
  }
58
- }, De = ["L", "P"], Oe = {
59
- ...Object.fromEntries(De.map((e) => [e, "locataire"])),
58
+ }, Ee = ["L", "P"], De = {
59
+ ...Object.fromEntries(Ee.map((e) => [e, "locataire"])),
60
60
  D: "demandeur",
61
61
  T: "tiers",
62
62
  U: "autre",
63
63
  F: "fournisseur",
64
64
  E: "personnel"
65
- }, H = Object.keys(Oe), ke = (e) => [...new Set(e.map((e) => Oe[e]))], Ae = (e) => e ? V[e.categorie] ? e.categorie : Oe[e.type] ?? "inconnu" : null, je = (e) => V[Ae(e)] ?? null, Me = Symbol("cresol:draft"), U = () => ({
65
+ }, H = Object.keys(De), Oe = (e) => [...new Set(e.map((e) => De[e]))], ke = (e) => e ? V[e.categorie] ? e.categorie : De[e.type] ?? "inconnu" : null, Ae = (e) => V[ke(e)] ?? null, je = Symbol("cresol:draft"), U = () => ({
66
66
  idCommune: null,
67
67
  commune: null,
68
68
  idEntree: null,
@@ -77,7 +77,7 @@ var B = {
77
77
  typeContratActuel: null,
78
78
  idContratActuel: null,
79
79
  occupantActuel: null
80
- }), W = () => ({
80
+ }), Me = () => ({
81
81
  idMotif: null,
82
82
  idCategorie: null,
83
83
  idType: null,
@@ -111,7 +111,7 @@ var B = {
111
111
  },
112
112
  provenance: e,
113
113
  lignes: [{
114
- ...W(),
114
+ ...Me(),
115
115
  cibleMode: "contrat",
116
116
  patrimoine: U(),
117
117
  description: ""
@@ -126,7 +126,7 @@ var B = {
126
126
  return e.etage != null && !e.libelleModule && t.push(`Étage ${e.etage}`), t.length ? t.join(" — ") : "Cible non définie";
127
127
  }, Le = (e) => !!e && (e.idModule != null || e.idEntree != null), Re = (e, t) => e.cibleMode === "demande" || !e.cibleOverride && e.patrimoine == null ? !0 : e.cibleMode === "contrat" ? !!(e.contratReclamant && t || e.contratCible) && e.patrimoine?.idModule != null : e.modulePrecis ? e.patrimoine?.idModule != null : Le(e.patrimoine), ze = (e, t) => e.description == null ? !t : e.description.trim().length > 0, Be = (e = {}) => {
128
128
  let t = {
129
- ...W(),
129
+ ...Me(),
130
130
  ...e
131
131
  };
132
132
  return e.patrimoine && (t.patrimoine = {
@@ -151,17 +151,17 @@ var B = {
151
151
  } : Be(e)) : t.lignes
152
152
  };
153
153
  };
154
- function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly: r = A(!1) } = {}) {
155
- let i = k(Pe()), a = v(() => {
156
- let e = I(r);
154
+ function He({ reclamants: e, modules: t, idModulePrefere: n = M(null), readonly: r = M(!1) } = {}) {
155
+ let i = j(Pe()), a = b(() => {
156
+ let e = R(r);
157
157
  return e === !0 ? Ne : Array.isArray(e) ? e : [];
158
- }), o = (e) => a.value.includes(e), s = v(() => i.lignes[0]), c = v(() => i.lignes.slice(1)), l = v(() => I(e) ?? []), u = A(null), d = (e, t) => e.type === t.type && String(e.id) === String(t.id), f = v(() => {
158
+ }), o = (e) => a.value.includes(e), s = b(() => i.lignes[0]), c = b(() => i.lignes.slice(1)), l = b(() => R(e) ?? []), u = M(null), d = (e, t) => e.type === t.type && String(e.id) === String(t.id), f = b(() => {
159
159
  let e = u.value;
160
160
  return !e || l.value.some((t) => d(t, e)) ? l.value : [...l.value, e];
161
- }), p = v(() => f.value.find((e) => d(e, i.reclamant)) ?? f.value[0] ?? null), ee = v(() => {
162
- let e = I(t) ?? [], r = I(n);
161
+ }), p = b(() => f.value.find((e) => d(e, i.reclamant)) ?? f.value[0] ?? null), m = M(!1), h = M(0), ee = b(() => {
162
+ let e = R(t) ?? [], r = R(n);
163
163
  return (r == null ? null : e.find((e) => String(e.idModule) === String(r))) ?? e.find((e) => e.estModulePrincipal) ?? e[0] ?? null;
164
- }), m = v(() => !!p.value && De.includes(p.value.type)), h = {
164
+ }), g = b(() => !!p.value && Ee.includes(p.value.type)), _ = {
165
165
  draft: i,
166
166
  lignePrincipale: s,
167
167
  lignesAssociees: c,
@@ -169,66 +169,90 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
169
169
  reclamantsDisponibles: f,
170
170
  reclamantSelectionne: p,
171
171
  moduleReclamantPrincipal: ee,
172
- reclamantEstContrat: m,
173
- ciblesValid: v(() => i.lignes.every((e) => Re(e, m.value))),
174
- detailsValid: v(() => i.lignes.every((e, t) => ze(e, t === 0))),
172
+ reclamantEstContrat: g,
173
+ ciblesValid: b(() => i.lignes.every((e) => Re(e, g.value))),
174
+ detailsValid: b(() => i.lignes.every((e, t) => ze(e, t === 0))),
175
175
  isReadonly: o,
176
+ ciblesAssocieesReinitialisees: h,
177
+ ligneCibleValid(e) {
178
+ let t = i.lignes[e];
179
+ return !!t && Re(t, g.value);
180
+ },
176
181
  reset(e = null) {
177
- let t = Ve(e);
178
- Object.assign(i, t), i.lignes = t.lignes;
182
+ let t = e?.lignes?.[0];
183
+ m.value = !!t && [
184
+ "cibleMode",
185
+ "patrimoine",
186
+ "contratCible"
187
+ ].some((e) => t[e] != null), h.value = 0;
188
+ let n = Ve(e);
189
+ Object.assign(i, n), i.lignes = n.lignes;
179
190
  },
180
191
  setProvenance(e) {
181
192
  i.provenance = e;
182
193
  },
194
+ libererCibleFournie() {
195
+ m.value = !1;
196
+ },
183
197
  syncReclamant() {
184
198
  let e = p.value;
185
- h.setReclamant({
199
+ _.setReclamant({
186
200
  type: e?.type ?? null,
187
201
  id: e?.id ?? null
188
202
  });
189
203
  },
190
204
  selectReclamant(e) {
191
- e && (l.value.some((t) => d(t, e)) || (u.value = e), h.setReclamant(e));
205
+ e && (d(e, i.reclamant) || (m.value = !1), l.value.some((t) => d(t, e)) || (u.value = e), _.setReclamant(e));
192
206
  },
193
207
  setReclamant({ type: e, id: t }) {
208
+ let n = !d({
209
+ type: e,
210
+ id: t
211
+ }, i.reclamant);
194
212
  if (i.reclamant = {
195
213
  type: e ?? null,
196
214
  id: t ?? null
197
- }, o("cible")) return;
198
- let n = i.lignes[0];
199
- e === "D" ? (n.cibleMode = "demande", n.patrimoine = null) : (n.cibleMode = m.value ? "contrat" : "patrimoine", n.contratReclamant = m.value, n.contratCible = null, n.reprendreLocataireActuel = !1, n.patrimoine = U(), h.prefillCiblePrincipale());
215
+ }, o("cible") || m.value) return;
216
+ let r = i.lignes[0];
217
+ if (n) {
218
+ let e = i.lignes.filter((e, t) => t > 0 && e.cibleOverride);
219
+ i.lignes.forEach((e, t) => {
220
+ t > 0 && e.cibleOverride && _.toggleCibleOverride(t);
221
+ }), e.length && (h.value = e.length);
222
+ }
223
+ e === "D" ? (r.cibleMode = "demande", r.patrimoine = null) : (r.cibleMode = g.value ? "contrat" : "patrimoine", r.contratReclamant = g.value, r.contratCible = null, r.reprendreLocataireActuel = !1, r.patrimoine = U(), _.prefillCiblePrincipale());
200
224
  },
201
225
  prefillCiblePrincipale() {
202
- if (o("cible")) return;
226
+ if (o("cible") || m.value) return;
203
227
  let e = ee.value;
204
- e && h.prefillFromModule(0, e);
228
+ e && _.prefillFromModule(0, e);
205
229
  },
206
230
  _resetAfterNomenclature() {
207
- i.lignes[0].responsable = null, i.lignes.splice(1);
231
+ h.value = 0, i.lignes[0].responsable = null, i.lignes.splice(1);
208
232
  },
209
233
  setCategorie(e) {
210
234
  let t = i.lignes[0];
211
- t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null, h._resetAfterNomenclature();
235
+ t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
212
236
  },
213
237
  setType(e) {
214
238
  let t = i.lignes[0];
215
- t.idType = e, t.idNature = null, t.idMotif = null, h._resetAfterNomenclature();
239
+ t.idType = e, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
216
240
  },
217
241
  setNature(e) {
218
242
  let t = i.lignes[0];
219
- t.idNature = e, t.idMotif = null, h._resetAfterNomenclature();
243
+ t.idNature = e, t.idMotif = null, _._resetAfterNomenclature();
220
244
  },
221
245
  setMotif(e) {
222
- i.lignes[0].idMotif = e, h._resetAfterNomenclature();
246
+ i.lignes[0].idMotif = e, _._resetAfterNomenclature();
223
247
  },
224
248
  selectMotifChain(e) {
225
249
  let t = i.lignes[0];
226
- t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null, h._resetAfterNomenclature();
250
+ t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null, _._resetAfterNomenclature();
227
251
  },
228
252
  toggleLigneAssociee(e, t = {}) {
229
253
  let n = i.lignes.findIndex((t, n) => n > 0 && t.idMotif === e);
230
254
  n === -1 ? i.lignes.push({
231
- ...W(),
255
+ ...Me(),
232
256
  idMotif: e,
233
257
  ...t
234
258
  }) : i.lignes.splice(n, 1);
@@ -238,15 +262,15 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
238
262
  },
239
263
  setCibleMode(e, t) {
240
264
  let n = i.lignes[e];
241
- n && (n.cibleMode = t, n.reprendreLocataireActuel = !1, n.modulePrecis = !0, n.contratReclamant = t === "contrat" && m.value, n.contratCible = null, t === "demande" ? n.patrimoine = null : n.patrimoine ??= U());
265
+ n && (n.cibleMode = t, n.reprendreLocataireActuel = !1, n.modulePrecis = !0, n.contratReclamant = t === "contrat" && g.value, n.contratCible = null, t === "demande" ? n.patrimoine = null : n.patrimoine ??= U());
242
266
  },
243
267
  setModulePrecis(e, t) {
244
268
  let n = i.lignes[e];
245
- n && (n.modulePrecis = !!t, n.modulePrecis || h.setPatrimoineModule(e, null));
269
+ n && (n.modulePrecis = !!t, n.modulePrecis || _.setPatrimoineModule(e, null));
246
270
  },
247
271
  toggleContratReclamant(e, t) {
248
272
  let n = i.lignes[e];
249
- n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine && h.setPatrimoineModule(e, null));
273
+ n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine && _.setPatrimoineModule(e, null));
250
274
  },
251
275
  setContratCible(e, t) {
252
276
  let n = i.lignes[e];
@@ -254,31 +278,32 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
254
278
  typeContrat: t.typeContrat,
255
279
  idContrat: t.idContrat,
256
280
  libelle: t.libelle ?? null
257
- } : null, h.setPatrimoineModule(e, null));
281
+ } : null, _.setPatrimoineModule(e, null));
258
282
  },
259
283
  setPatrimoineCommune(e, t) {
260
- let n = h._patrimoine(e);
261
- n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null, h.setPatrimoineEntree(e, null));
284
+ let n = _._patrimoine(e);
285
+ n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null, _.setPatrimoineEntree(e, null));
262
286
  },
263
287
  setPatrimoineEntree(e, t) {
264
- let n = h._patrimoine(e);
265
- n && (n.idEntree = t?.idEntree ?? null, n.entree = t?.entree ?? null, n.codeProgramme = t?.codeProgramme ?? null, n.codeTranche = t?.codeTranche ?? null, n.codeBatiment = t?.codeBatiment ?? null, n.codeEscalier = t?.codeEscalier ?? null, n.etage = null, h.setPatrimoineModule(e, null));
288
+ let n = _._patrimoine(e);
289
+ n && (n.idEntree = t?.idEntree ?? null, n.entree = t?.entree ?? null, n.codeProgramme = t?.codeProgramme ?? null, n.codeTranche = t?.codeTranche ?? null, n.codeBatiment = t?.codeBatiment ?? null, n.codeEscalier = t?.codeEscalier ?? null, n.etage = null, _.setPatrimoineModule(e, null));
266
290
  },
267
291
  setPatrimoineEtage(e, t) {
268
- let n = h._patrimoine(e);
269
- n && (n.etage = t, h.setPatrimoineModule(e, null));
292
+ let n = _._patrimoine(e);
293
+ n && (n.etage = t, _.setPatrimoineModule(e, null));
270
294
  },
271
295
  setPatrimoineModule(e, t) {
272
- let n = h._patrimoine(e);
296
+ let n = _._patrimoine(e);
273
297
  n && (n.idModule = t?.idModule ?? null, n.libelleModule = t?.libelleModule ?? null, n.typeContratActuel = t?.typeContratActuel ?? null, n.idContratActuel = t?.idContratActuel ?? null, n.occupantActuel = t?.occupantActuel ?? null, t && (n.codeProgramme = t.codeProgramme ?? n.codeProgramme, n.codeTranche = t.codeTranche ?? n.codeTranche, n.codeBatiment = t.codeBatiment ?? n.codeBatiment, n.codeEscalier = t.codeEscalier ?? n.codeEscalier, t.idEntree != null && (n.idEntree = t.idEntree), t.etage != null && (n.etage = t.etage)));
274
298
  },
275
299
  prefillFromModule(e, t) {
276
- let n = h._patrimoine(e);
300
+ let n = _._patrimoine(e);
277
301
  n && t && (n.idCommune = t.idCommune ?? null, n.commune = t.commune ?? null, n.idEntree = t.idEntree ?? null, n.entree = t.adresse ?? t.numeroRue ?? null, n.codeProgramme = t.codeProgramme ?? null, n.codeTranche = t.codeTranche ?? null, n.codeBatiment = t.codeBatiment ?? null, n.codeEscalier = t.codeEscalier ?? null, n.etage = t.etage ?? null, n.idModule = t.idModule ?? null, n.libelleModule = t.libelleModule ?? t.adresse ?? null, n.typeContratActuel = t.typeContratActuel ?? null, n.idContratActuel = t.idContratActuel ?? null, n.occupantActuel = t.occupantActuel ?? null);
278
302
  },
279
303
  toggleCibleOverride(e) {
280
304
  let t = i.lignes[e];
281
305
  if (!t) return;
306
+ h.value = 0;
282
307
  let n = i.lignes[0];
283
308
  t.cibleOverride ? (t.cibleOverride = !1, t.cibleMode = null, t.patrimoine = null, t.reprendreLocataireActuel = !1, t.modulePrecis = !0, t.contratReclamant = !0, t.contratCible = null) : (t.cibleOverride = !0, t.cibleMode = n.cibleMode, t.patrimoine = n.cibleMode === "demande" ? null : { ...n.patrimoine }, t.reprendreLocataireActuel = n.reprendreLocataireActuel, t.modulePrecis = n.modulePrecis, t.contratReclamant = n.contratReclamant, t.contratCible = n.contratCible ? { ...n.contratCible } : null);
284
309
  },
@@ -335,9 +360,9 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
335
360
  idCible: i.reclamant.id,
336
361
  deduireCible: !1
337
362
  };
338
- let l = h._patrimoinePayload(r.patrimoine);
363
+ let l = _._patrimoinePayload(r.patrimoine);
339
364
  if (r.cibleMode === "contrat" && !r.reprendreLocataireActuel) {
340
- let e = r.contratReclamant && m.value ? {
365
+ let e = r.contratReclamant && g.value ? {
341
366
  typeContrat: i.reclamant.type,
342
367
  idContrat: i.reclamant.id
343
368
  } : r.contratCible;
@@ -364,7 +389,7 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
364
389
  if (n.cibleMode === "patrimoine" && !n.modulePrecis) return `Parties communes — ${r}`;
365
390
  if (n.cibleMode !== "contrat") return r;
366
391
  let a = "Contrat non défini";
367
- if (n.contratReclamant && m.value) a = "Contrat du réclamant";
392
+ if (n.contratReclamant && g.value) a = "Contrat du réclamant";
368
393
  else if (n.contratCible) {
369
394
  let e = n.contratCible;
370
395
  a = `${e.libelle ?? "Contrat"} (${e.typeContrat}/${e.idContrat})`;
@@ -372,42 +397,42 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
372
397
  return `${a} — ${r}`;
373
398
  },
374
399
  lignesPayload() {
375
- return i.lignes.map((e, t) => h._lignePayload(e, t));
400
+ return i.lignes.map((e, t) => _._lignePayload(e, t));
376
401
  },
377
402
  creationPayload() {
378
403
  let e = p.value;
379
404
  return {
380
405
  typeReclamant: e?.type ?? null,
381
406
  reclamant: e?.id ?? null,
382
- lignes: h.lignesPayload(),
407
+ lignes: _.lignesPayload(),
383
408
  provenance: i.provenance
384
409
  };
385
410
  }
386
411
  };
387
- return k(h);
412
+ return j(_);
388
413
  }
389
414
  function Ue(e) {
390
- return me(Me, e), e;
415
+ return fe(je, e), e;
391
416
  }
392
- function G() {
393
- let e = fe(Me, null);
417
+ function W() {
418
+ let e = ue(je, null);
394
419
  if (!e) throw Error("useSollicitationDraft() hors de <creer-sollicitation-form>");
395
420
  return e;
396
421
  }
397
422
  // \0plugin-vue:export-helper
398
- var K = (e, t) => {
423
+ var G = (e, t) => {
399
424
  let n = e.__vccOpts || e;
400
425
  for (let [e, r] of t) n[e] = r;
401
426
  return n;
402
427
  }, We = {
403
428
  name: "AsideBlock",
404
- components: { AmsomNavTabsHorizontal: ve },
429
+ components: { AmsomNavTabsHorizontal: ge },
405
430
  props: { nbSimilaires: {
406
431
  type: Number,
407
432
  default: 0
408
433
  } },
409
434
  setup() {
410
- return { draft: G() };
435
+ return { draft: W() };
411
436
  },
412
437
  data() {
413
438
  return { activeTab: null };
@@ -448,8 +473,8 @@ var K = (e, t) => {
448
473
  class: "badge bg-danger ms-1"
449
474
  }, Ke = { style: { "min-height": "320px" } }, qe = { key: 0 }, Je = { key: 1 };
450
475
  function Ye(e, t, n, r, i, a) {
451
- let o = N("font-awesome-icon"), s = N("amsom-nav-tabs-horizontal");
452
- return a.tabs.length ? (O(), y(s, {
476
+ let o = F("font-awesome-icon"), s = F("amsom-nav-tabs-horizontal");
477
+ return a.tabs.length ? (A(), x(s, {
453
478
  key: 0,
454
479
  modelValue: i.activeTab,
455
480
  "onUpdate:modelValue": t[0] ||= (e) => i.activeTab = e,
@@ -457,29 +482,145 @@ function Ye(e, t, n, r, i, a) {
457
482
  "item-key": "id",
458
483
  "tab-spacing": 1
459
484
  }, {
460
- libelle: L(({ item: e }) => [
461
- w(o, { icon: e.icon }, null, 8, ["icon"]),
462
- S("span", null, P(e.label), 1),
463
- e.id === "similarite" && n.nbSimilaires > 0 ? (O(), x("span", Ge, P(n.nbSimilaires), 1)) : b("", !0)
485
+ libelle: z(({ item: e }) => [
486
+ E(o, { icon: e.icon }, null, 8, ["icon"]),
487
+ w("span", null, I(e.label), 1),
488
+ e.id === "similarite" && n.nbSimilaires > 0 ? (A(), C("span", Ge, I(n.nbSimilaires), 1)) : S("", !0)
464
489
  ]),
465
- content: L(() => [S("div", Ke, [e.$slots.similaires ? _e((O(), x("div", qe, [M(e.$slots, "similaires", D(T(a.scope)))], 512)), [[ge, i.activeTab === "similarite"]]) : b("", !0), e.$slots.evenements ? _e((O(), x("div", Je, [M(e.$slots, "evenements")], 512)), [[ge, i.activeTab === "evenements"]]) : b("", !0)])]),
490
+ content: z(() => [w("div", Ke, [e.$slots.similaires ? he((A(), C("div", qe, [P(e.$slots, "similaires", k(D(a.scope)))], 512)), [[me, i.activeTab === "similarite"]]) : S("", !0), e.$slots.evenements ? he((A(), C("div", Je, [P(e.$slots, "evenements")], 512)), [[me, i.activeTab === "evenements"]]) : S("", !0)])]),
466
491
  _: 3
467
- }, 8, ["modelValue", "items"])) : b("", !0);
492
+ }, 8, ["modelValue", "items"])) : S("", !0);
493
+ }
494
+ var Xe = /*#__PURE__*/ G(We, [["render", Ye]]), Ze = {
495
+ name: "SectionComponent",
496
+ props: {
497
+ titre: {
498
+ type: String,
499
+ required: !0
500
+ },
501
+ aide: {
502
+ type: String,
503
+ default: null
504
+ }
505
+ }
506
+ }, Qe = { class: "d-flex flex-column gap-2" }, $e = { class: "d-flex flex-wrap align-items-center justify-content-between gap-2" }, et = { class: "fs-6 fw-semibold" }, tt = {
507
+ key: 0,
508
+ class: "text-muted d-flex align-items-center gap-1"
509
+ };
510
+ function nt(e, t, n, r, i, a) {
511
+ let o = F("font-awesome-icon");
512
+ return A(), C("section", Qe, [w("div", null, [w("div", $e, [w("span", et, I(n.titre), 1), P(e.$slots, "actions")]), n.aide ? (A(), C("small", tt, [E(o, { icon: "circle-info" }), T(" " + I(n.aide), 1)])) : S("", !0)]), P(e.$slots, "default")]);
513
+ }
514
+ var rt = /*#__PURE__*/ G(Ze, [["render", nt]]), it = (e) => "fa" + e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
515
+ async function at(t) {
516
+ let n = await import("@fortawesome/free-solid-svg-icons");
517
+ [...new Set(t.filter(Boolean))].forEach((t) => {
518
+ let r = n[it(t)];
519
+ r && e.add(r);
520
+ });
521
+ }
522
+ // src/utils/text.js
523
+ function K(e, t = !0) {
524
+ if (!e) return null;
525
+ let n = e.toString().normalize("NFD").replace(/[̀-ͯ]/g, "");
526
+ return t ? n.toLowerCase() : n;
527
+ }
528
+ // src/components/IconSelectComponent.vue
529
+ var ot = {
530
+ name: "IconSelectComponent",
531
+ components: { AmsomAutocomplete: B },
532
+ props: {
533
+ modelValue: {
534
+ type: [String, Number],
535
+ default: null
536
+ },
537
+ items: {
538
+ type: Array,
539
+ default: () => []
540
+ },
541
+ label: {
542
+ type: String,
543
+ required: !0
544
+ },
545
+ required: {
546
+ type: Boolean,
547
+ default: !1
548
+ },
549
+ disabled: {
550
+ type: Boolean,
551
+ default: !1
552
+ },
553
+ placeholder: {
554
+ type: String,
555
+ default: "Choisir…"
556
+ }
557
+ },
558
+ emits: ["update:modelValue"],
559
+ data() {
560
+ return { iconsReady: !1 };
561
+ },
562
+ computed: { selected() {
563
+ return this.items.find((e) => e.id === this.modelValue) ?? null;
564
+ } },
565
+ watch: { items: {
566
+ immediate: !0,
567
+ async handler(e) {
568
+ await at(e.map((e) => e.icon)), this.iconsReady = !0;
569
+ }
570
+ } },
571
+ methods: { filtrer({ search: e, items: t }) {
572
+ let n = (K(e) ?? "").trim();
573
+ return n ? t.filter((e) => (K(e?.libelle) ?? "").includes(n)) : t;
574
+ } }
575
+ }, st = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, ct = {
576
+ key: 0,
577
+ class: "ms-1 text-danger"
578
+ }, lt = { class: "d-inline-flex align-items-center gap-2" };
579
+ function ut(e, t, n, r, i, a) {
580
+ let o = F("font-awesome-icon"), s = F("amsom-autocomplete");
581
+ return A(), C("div", null, [w("label", st, [T(I(n.label), 1), n.required ? (A(), C("span", ct, "*")) : S("", !0)]), i.iconsReady ? (A(), x(s, {
582
+ key: 0,
583
+ "model-value": a.selected,
584
+ items: n.items,
585
+ "get-id": (e) => e?.id ?? null,
586
+ "get-input-libelle": (e) => e?.libelle ?? "",
587
+ "filtering-function": a.filtrer,
588
+ disabled: n.disabled,
589
+ placeholder: n.placeholder,
590
+ required: "",
591
+ "input-size": "sm",
592
+ "onUpdate:modelValue": t[0] ||= (t) => e.$emit("update:modelValue", t?.id ?? null)
593
+ }, {
594
+ options: z((e) => [w("span", lt, [e?.icon ? (A(), x(o, {
595
+ key: 0,
596
+ icon: e.icon,
597
+ "fixed-width": ""
598
+ }, null, 8, ["icon"])) : S("", !0), T(" " + I(e?.libelle), 1)])]),
599
+ _: 1
600
+ }, 8, [
601
+ "model-value",
602
+ "items",
603
+ "get-id",
604
+ "get-input-libelle",
605
+ "filtering-function",
606
+ "disabled",
607
+ "placeholder"
608
+ ])) : S("", !0)]);
468
609
  }
469
- var Xe = /*#__PURE__*/ K(We, [["render", Ye]]), Ze = {
610
+ var dt = /*#__PURE__*/ G(ot, [["render", ut]]), ft = {
470
611
  baseUrl: "",
471
- getToken: () => z.getToken(),
472
- setToken: (e) => z.setToken(e),
473
- logout: () => z.logout(),
474
- goToLoginPage: () => z.goToLoginPage()
612
+ getToken: () => ye.getToken(),
613
+ setToken: (e) => ye.setToken(e),
614
+ logout: () => ye.logout(),
615
+ goToLoginPage: () => ye.goToLoginPage()
475
616
  };
476
- function Qe(e = {}) {
477
- Object.assign(Ze, e);
617
+ function pt(e = {}) {
618
+ Object.assign(ft, e);
478
619
  }
479
- var $e = () => Ze;
620
+ var mt = () => ft;
480
621
  // src/api/transport/axiosOverlayConnector.js
481
- function et(e, t = {}) {
482
- let n = $e(), r = {
622
+ function ht(e, t = {}) {
623
+ let n = mt(), r = {
483
624
  getToken: () => n.getToken?.() ?? null,
484
625
  setToken: (e) => n.setToken?.(e),
485
626
  logout: () => n.logout?.(),
@@ -501,73 +642,73 @@ function et(e, t = {}) {
501
642
  }, t.functions.errorsHandlers = {
502
643
  ...r.errorsHandlers,
503
644
  ...t.functions.errorsHandlers ?? {}
504
- }, be(e, t);
645
+ }, ve(e, t);
505
646
  }
506
647
  // src/api/transport/httpClient.js
507
- var tt = (e, t) => {
508
- let n = t || $e().baseUrl;
648
+ var gt = (e, t) => {
649
+ let n = t || mt().baseUrl;
509
650
  if (!n) throw Error("Cresol : baseUrl non renseignée (configureCresol ou prop baseUrl)");
510
651
  return `${n}${e}`;
511
- }, nt = (e = {}) => {
652
+ }, _t = (e = {}) => {
512
653
  let t = new URLSearchParams();
513
654
  Object.entries(e).forEach(([e, n]) => {
514
655
  n != null && n !== "" && t.append(e, typeof n == "object" ? JSON.stringify(n) : n);
515
656
  });
516
657
  let n = t.toString();
517
658
  return n ? `?${n}` : "";
518
- }, rt = ({ method: e, path: t, params: n, data: r, signal: i, baseUrl: a }, o = {}) => et({
519
- url: tt(`${t}${nt(n)}`, a),
659
+ }, vt = ({ method: e, path: t, params: n, data: r, signal: i, baseUrl: a }, o = {}) => ht({
660
+ url: gt(`${t}${_t(n)}`, a),
520
661
  method: e,
521
662
  ...r === void 0 ? {} : { data: r },
522
663
  ...i ? { signal: i } : {}
523
- }, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) => rt({
664
+ }, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) => vt({
524
665
  method: "GET",
525
666
  path: e,
526
667
  params: t,
527
668
  signal: n,
528
669
  baseUrl: i
529
- }, r).then((e) => e.data), it = (e, t, { params: n, signal: r, overlay: i, baseUrl: a } = {}) => rt({
670
+ }, r).then((e) => e.data), yt = (e, t, { params: n, signal: r, overlay: i, baseUrl: a } = {}) => vt({
530
671
  method: "POST",
531
672
  path: e,
532
673
  params: n,
533
674
  data: t,
534
675
  signal: r,
535
676
  baseUrl: a
536
- }, i).then((e) => e.data), at = { mustBeAuthenticated: !1 }, J = (e, { signal: t, baseUrl: n } = {}) => q(e, {
677
+ }, i).then((e) => e.data), bt = { mustBeAuthenticated: !1 }, J = (e, { signal: t, baseUrl: n } = {}) => q(e, {
537
678
  signal: t,
538
679
  baseUrl: n,
539
- overlay: at
540
- }), ot = (e) => J("/v2/sollicitation/motifs", e), st = (e) => J("/v2/sollicitation/categories", e), ct = (e) => J("/v2/sollicitation/types", e), lt = (e) => J("/v2/sollicitation/natures", e), ut = (e) => J("/v2/sollicitation/etats", e), dt = ({ signal: e, baseUrl: t } = {}) => q("/v2/sollicitation/provenances", {
680
+ overlay: bt
681
+ }), xt = (e) => J("/v2/sollicitation/motifs", e), St = (e) => J("/v2/sollicitation/categories", e), Ct = (e) => J("/v2/sollicitation/types", e), wt = (e) => J("/v2/sollicitation/natures", e), Tt = (e) => J("/v2/sollicitation/etats", e), Et = ({ signal: e, baseUrl: t } = {}) => q("/v2/sollicitation/provenances", {
541
682
  params: { estDesactive: !1 },
542
683
  signal: e,
543
684
  baseUrl: t,
544
- overlay: at
545
- }), ft = ({ signal: e, baseUrl: t } = {}) => q("/collaborateurs", {
685
+ overlay: bt
686
+ }), Dt = ({ signal: e, baseUrl: t } = {}) => q("/collaborateurs", {
546
687
  params: { actif: !0 },
547
688
  signal: e,
548
689
  baseUrl: t
549
- }), pt = async ({ signal: e, baseUrl: t } = {}) => (await q("/v2/patrimoine/communes", {
690
+ }), Ot = async ({ signal: e, baseUrl: t } = {}) => (await q("/v2/patrimoine/communes", {
550
691
  signal: e,
551
692
  baseUrl: t
552
693
  }) ?? []).map((e) => ({
553
694
  idCommune: e.id,
554
695
  commune: e.libelle
555
- })), mt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/entrees", {
696
+ })), kt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/entrees", {
556
697
  params: { idCommune: e },
557
698
  signal: t,
558
699
  baseUrl: n
559
- }), ht = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/modules", {
700
+ }), At = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/modules", {
560
701
  params: { codeProgramme: e },
561
702
  signal: t,
562
703
  baseUrl: n
563
- }), gt = ({ idContrat: e, typeContrat: t }, { signal: n, baseUrl: r } = {}) => q("/v2/patrimoine/contrat_modules", {
704
+ }), jt = ({ idContrat: e, typeContrat: t }, { signal: n, baseUrl: r } = {}) => q("/v2/patrimoine/contrat_modules", {
564
705
  params: {
565
706
  idContrat: e,
566
707
  typeContrat: t
567
708
  },
568
709
  signal: n,
569
710
  baseUrl: r
570
- }), _t = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, baseUrl: a } = {}) => q("/v2/sollicitation/responsables", {
711
+ }), Mt = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, baseUrl: a } = {}) => q("/v2/sollicitation/responsables", {
571
712
  params: {
572
713
  motif: e,
573
714
  categorie: t,
@@ -576,11 +717,11 @@ var tt = (e, t) => {
576
717
  },
577
718
  signal: i,
578
719
  baseUrl: a
579
- }), vt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/contrat_module_rechercher", {
720
+ }), Nt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/contrat_module_rechercher", {
580
721
  params: { recherche: e },
581
722
  signal: t,
582
723
  baseUrl: n
583
- }), yt = ({ categorie: e, recherche: t }, { signal: n, baseUrl: r } = {}) => q("/v2/cresol/reclamant_rechercher", {
724
+ }), Pt = ({ categorie: e, recherche: t }, { signal: n, baseUrl: r } = {}) => q("/v2/cresol/reclamant_rechercher", {
584
725
  params: {
585
726
  categorie: e,
586
727
  recherche: t
@@ -589,11 +730,11 @@ var tt = (e, t) => {
589
730
  baseUrl: r
590
731
  });
591
732
  // src/utils/apiError.js
592
- function bt(e) {
733
+ function Ft(e) {
593
734
  let t = e?.response?.data;
594
735
  return t?.error ? t.error : t?.errorList ? t.errorList.map((e) => e.message).join(", ") : e?.response?.status === 500 ? "Erreur interne" : e?.response?.status === 401 ? "Non autorisé à faire cette action" : "Erreur";
595
736
  }
596
- var xt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", St = Symbol("cresol:data"), Ct = () => ({
737
+ var It = (e) => e?.name === "AbortError" || e?.name === "CanceledError", Lt = Symbol("cresol:data"), Rt = () => ({
597
738
  motifs: null,
598
739
  categories: null,
599
740
  types: null,
@@ -606,17 +747,17 @@ var xt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", St = Sy
606
747
  modulesByProgramme: {},
607
748
  modulesByContrat: {},
608
749
  responsablesByMotif: {}
609
- }), wt = /* @__PURE__ */ new Map(), Tt = (e) => (wt.has(e) || wt.set(e, k(Ct())), wt.get(e)), Y = /* @__PURE__ */ new Map();
610
- function Et() {
611
- wt.clear(), Y.clear();
750
+ }), zt = /* @__PURE__ */ new Map(), Bt = (e) => (zt.has(e) || zt.set(e, j(Rt())), zt.get(e)), Y = /* @__PURE__ */ new Map();
751
+ function Vt() {
752
+ zt.clear(), Y.clear();
612
753
  }
613
- var X = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n, Dt = (e, t, n) => e?.find((e) => e[t] === n)?.icon ?? null;
614
- function Ot({ onError: e, baseUrl: t } = {}) {
615
- let n = A(0), r = () => ({ baseUrl: I(t) || null }), i = () => I(t) || $e().baseUrl || "", a = () => Tt(i()), o = (t, r) => {
754
+ var X = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n, Ht = (e, t, n) => e?.find((e) => e[t] === n)?.icon ?? null;
755
+ function Ut({ onError: e, baseUrl: t } = {}) {
756
+ let n = M(0), r = () => ({ baseUrl: R(t) || null }), i = () => R(t) || mt().baseUrl || "", a = () => Bt(i()), o = (t, r) => {
616
757
  let a = `${i()}|${t}`;
617
758
  if (Y.has(a)) return Y.get(a);
618
759
  n.value += 1;
619
- let o = Promise.resolve().then(r).catch((t) => (xt(t) || e?.(bt(t)), null)).finally(() => {
760
+ let o = Promise.resolve().then(r).catch((t) => (It(t) || e?.(Ft(t)), null)).finally(() => {
620
761
  --n.value, Y.delete(a);
621
762
  });
622
763
  return Y.set(a, o), o;
@@ -625,30 +766,30 @@ function Ot({ onError: e, baseUrl: t } = {}) {
625
766
  return a();
626
767
  },
627
768
  loading: n,
628
- isLoading: v(() => n.value > 0),
769
+ isLoading: b(() => n.value > 0),
629
770
  loadNomenclature() {
630
771
  return Promise.all([
631
- s("motifs", ot),
632
- s("categories", st),
633
- s("types", ct),
634
- s("natures", lt),
635
- s("etats", ut)
772
+ s("motifs", xt),
773
+ s("categories", St),
774
+ s("types", Ct),
775
+ s("natures", wt),
776
+ s("etats", Tt)
636
777
  ]);
637
778
  },
638
- loadCollaborateurs: () => s("collaborateurs", ft),
639
- loadProvenances: () => s("provenances", dt),
779
+ loadCollaborateurs: () => s("collaborateurs", Dt),
780
+ loadProvenances: () => s("provenances", Et),
640
781
  loadCommunes() {
641
- return a().communes?.length ? Promise.resolve(a().communes) : o("communes", async () => (a().communes = await pt(r()), a().communes));
782
+ return a().communes?.length ? Promise.resolve(a().communes) : o("communes", async () => (a().communes = await Ot(r()), a().communes));
642
783
  },
643
784
  loadAdresses(e) {
644
785
  return e == null ? Promise.resolve([]) : a().adressesByCommune[e] ? Promise.resolve(a().adressesByCommune[e]) : o(`adresses:${e}`, async () => {
645
- let t = await mt(e, r());
786
+ let t = await kt(e, r());
646
787
  return a().adressesByCommune[e] = t ?? [], t;
647
788
  });
648
789
  },
649
790
  loadModulesOfProgramme(e) {
650
791
  return e == null ? Promise.resolve([]) : a().modulesByProgramme[e] ? Promise.resolve(a().modulesByProgramme[e]) : o(`modules:${e}`, async () => {
651
- let t = await ht(e, r());
792
+ let t = await At(e, r());
652
793
  return a().modulesByProgramme[e] = t ?? [], t;
653
794
  });
654
795
  },
@@ -656,7 +797,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
656
797
  if (e == null) return Promise.resolve([]);
657
798
  let n = `${t ?? ""}|${e}`;
658
799
  return a().modulesByContrat[n] ? Promise.resolve(a().modulesByContrat[n]) : o(`contratModules:${n}`, async () => {
659
- let i = await gt({
800
+ let i = await jt({
660
801
  idContrat: e,
661
802
  typeContrat: t
662
803
  }, r());
@@ -666,7 +807,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
666
807
  async searchContrats(e, { signal: t } = {}) {
667
808
  let n = (e ?? "").trim();
668
809
  if (!n) return [];
669
- let i = await vt(n, {
810
+ let i = await Nt(n, {
670
811
  ...r(),
671
812
  signal: t
672
813
  }), a = /* @__PURE__ */ new Map();
@@ -688,7 +829,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
688
829
  async searchReclamants(e, t, { signal: n } = {}) {
689
830
  let i = (t ?? "").trim();
690
831
  if (!i) return [];
691
- let a = await yt({
832
+ let a = await Pt({
692
833
  categorie: e,
693
834
  recherche: i
694
835
  }, {
@@ -724,7 +865,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
724
865
  },
725
866
  loadResponsables({ motif: e, categorie: t, type: n, nature: i }) {
726
867
  return e == null ? Promise.resolve([]) : a().responsablesByMotif[e] ? Promise.resolve(a().responsablesByMotif[e]) : o(`responsables:${e}`, async () => {
727
- let o = await _t({
868
+ let o = await Mt({
728
869
  motif: e,
729
870
  categorie: t,
730
871
  type: n,
@@ -753,46 +894,84 @@ function Ot({ onError: e, baseUrl: t } = {}) {
753
894
  typeLibelle: (e) => X(a().types, "id", e),
754
895
  natureLibelle: (e) => X(a().natures, "id", e),
755
896
  etatLibelle: (e) => X(a().etats, "code", e),
756
- motifIcon: (e) => Dt(a().motifs, "id", e),
757
- categorieIcon: (e) => Dt(a().categories, "id", e),
758
- typeIcon: (e) => Dt(a().types, "id", e),
759
- natureIcon: (e) => Dt(a().natures, "id", e)
897
+ motifIcon: (e) => Ht(a().motifs, "id", e),
898
+ categorieIcon: (e) => Ht(a().categories, "id", e),
899
+ typeIcon: (e) => Ht(a().types, "id", e),
900
+ natureIcon: (e) => Ht(a().natures, "id", e)
760
901
  };
761
- return k(c);
902
+ return j(c);
762
903
  }
763
- function kt(e) {
764
- return me(St, e), e;
904
+ function Wt(e) {
905
+ return fe(Lt, e), e;
765
906
  }
766
907
  function Z() {
767
- let e = fe(St, null);
908
+ let e = ue(Lt, null);
768
909
  if (!e) throw Error("useCresolData() hors de <creer-sollicitation-form>");
769
910
  return e;
770
911
  }
771
- // src/utils/fontAwesomeIcons.js
772
- var At = (e) => "fa" + e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
773
- async function jt(t) {
774
- let n = await import("@fortawesome/free-solid-svg-icons");
775
- [...new Set(t.filter(Boolean))].forEach((t) => {
776
- let r = n[At(t)];
777
- r && e.add(r);
778
- });
912
+ // src/composables/useCresolContext.js
913
+ var Gt = Symbol("cresol:options"), Kt = (e) => fe(Gt, e), Q = () => ue(Gt, {}), qt = {
914
+ name: "ProvenanceSelecteurBlock",
915
+ components: { IconSelectComponent: dt },
916
+ setup() {
917
+ return {
918
+ draft: W(),
919
+ data: Z(),
920
+ options: Q()
921
+ };
922
+ },
923
+ computed: {
924
+ provenances() {
925
+ return this.options.provenances;
926
+ },
927
+ loaded() {
928
+ return this.data.cache.provenances != null;
929
+ },
930
+ selected() {
931
+ return this.draft.draft.provenance;
932
+ },
933
+ libelleFige() {
934
+ return this.data.cache.provenances?.find((e) => e.id === this.selected)?.libelle ?? this.selected ?? "—";
935
+ },
936
+ provenanceChoisie() {
937
+ return this.provenances.find((e) => e.id === this.selected) ?? null;
938
+ }
939
+ }
940
+ }, Jt = { key: 0 }, Yt = ["value"], Xt = { key: 1 }, Zt = {
941
+ key: 0,
942
+ class: "fs-7 text-danger mt-1"
943
+ };
944
+ function Qt(e, t, n, r, i, a) {
945
+ let o = F("icon-select-component");
946
+ return r.draft.isReadonly("provenance") ? (A(), C("div", Jt, [t[1] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Provenance", -1), w("input", {
947
+ class: "form-control form-control-sm",
948
+ disabled: "",
949
+ value: a.libelleFige
950
+ }, null, 8, Yt)])) : (A(), C("div", Xt, [E(o, {
951
+ "model-value": a.provenanceChoisie?.id ?? null,
952
+ items: a.provenances,
953
+ label: "Provenance",
954
+ required: "",
955
+ "onUpdate:modelValue": t[0] ||= (e) => r.draft.setProvenance(e)
956
+ }, null, 8, ["model-value", "items"]), a.loaded && !a.provenanceChoisie ? (A(), C("div", Zt, " Sélectionnez par quel canal la sollicitation vous est parvenue. ")) : S("", !0)]));
779
957
  }
958
+ var $t = /*#__PURE__*/ G(qt, [["render", Qt]]);
780
959
  // src/utils/date.js
781
- function Mt(e) {
960
+ function en(e) {
782
961
  return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toISOString().slice(0, 10);
783
962
  }
784
- function Nt(e) {
963
+ function tn(e) {
785
964
  return e ? Math.floor(new Date(e).getTime() / 1e3) : null;
786
965
  }
787
- function Pt(e) {
966
+ function nn(e) {
788
967
  return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("fr-FR");
789
968
  }
790
- // src/composables/useCresolContext.js
791
- var Ft = Symbol("cresol:options"), It = (e) => me(Ft, e), Q = () => fe(Ft, {}), Lt = A(!1);
792
- jt(Object.values(V).map((e) => e.icon)).then(() => {
793
- Lt.value = !0;
969
+ // src/components/ReclamantTypeBadgeComponent.vue
970
+ var rn = M(!1);
971
+ at(Object.values(V).map((e) => e.icon)).then(() => {
972
+ rn.value = !0;
794
973
  });
795
- var Rt = {
974
+ var an = {
796
975
  name: "ReclamantTypeBadgeComponent",
797
976
  props: {
798
977
  reclamant: {
@@ -805,25 +984,25 @@ var Rt = {
805
984
  }
806
985
  },
807
986
  setup() {
808
- return { iconsReady: Lt };
987
+ return { iconsReady: rn };
809
988
  },
810
989
  computed: { type() {
811
- return je(this.reclamant);
990
+ return Ae(this.reclamant);
812
991
  } }
813
- }, zt = ["title"], Bt = { key: 1 };
814
- function Vt(e, t, n, r, i, a) {
815
- let o = N("font-awesome-icon");
816
- return a.type ? (O(), x("span", {
992
+ }, on = ["title"], sn = { key: 1 };
993
+ function cn(e, t, n, r, i, a) {
994
+ let o = F("font-awesome-icon");
995
+ return a.type ? (A(), C("span", {
817
996
  key: 0,
818
- class: E(["badge d-inline-flex align-items-center gap-1 border flex-shrink-0", `bg-${a.type.couleur}-subtle text-${a.type.couleur}-emphasis border-${a.type.couleur}-subtle`]),
997
+ class: O(["badge d-inline-flex align-items-center gap-1 border flex-shrink-0", `bg-${a.type.couleur}-subtle text-${a.type.couleur}-emphasis border-${a.type.couleur}-subtle`]),
819
998
  title: a.type.libelle
820
- }, [r.iconsReady ? (O(), y(o, {
999
+ }, [r.iconsReady ? (A(), x(o, {
821
1000
  key: 0,
822
1001
  icon: a.type.icon,
823
1002
  "fixed-width": ""
824
- }, null, 8, ["icon"])) : b("", !0), n.iconOnly ? b("", !0) : (O(), x("span", Bt, P(a.type.libelle), 1))], 10, zt)) : b("", !0);
1003
+ }, null, 8, ["icon"])) : S("", !0), n.iconOnly ? S("", !0) : (A(), C("span", sn, I(a.type.libelle), 1))], 10, on)) : S("", !0);
825
1004
  }
826
- var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
1005
+ var ln = /*#__PURE__*/ G(an, [["render", cn]]), un = [
827
1006
  {
828
1007
  key: "locataire",
829
1008
  label: "Locataire",
@@ -880,20 +1059,21 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
880
1059
  aucun: "Aucun réclamant trouvé.",
881
1060
  placeholder: "Nom, prénom, n° de contrat, de module ou de demande, adresse, téléphone ou mail…"
882
1061
  }
883
- ], Wt = {
1062
+ ], dn = {
884
1063
  signataire: "Signataire",
885
1064
  occupant: "Occupant",
886
1065
  demandeur: "Demandeur"
887
- }, Gt = {
1066
+ }, fn = {
888
1067
  name: "ReclamantRechercheBlock",
889
1068
  components: {
890
- AmsomAutocomplete: R,
891
- AmsomOverlay: g,
892
- ReclamantTypeBadgeComponent: Ht
1069
+ AmsomAutocomplete: B,
1070
+ AmsomOverlay: v,
1071
+ IconSelectComponent: dt,
1072
+ ReclamantTypeBadgeComponent: ln
893
1073
  },
894
1074
  setup() {
895
1075
  return {
896
- draft: G(),
1076
+ draft: W(),
897
1077
  data: Z(),
898
1078
  options: Q()
899
1079
  };
@@ -912,13 +1092,20 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
912
1092
  return this.options.typesReclamant ?? H;
913
1093
  },
914
1094
  autorisees() {
915
- return ke(this.typesAutorises);
1095
+ return Oe(this.typesAutorises);
916
1096
  },
917
1097
  categories() {
918
- return Ut.filter((e) => e.key === "tout" ? this.autorisees.length > 1 : this.autorisees.includes(e.key));
1098
+ return un.filter((e) => e.key === "tout" ? this.autorisees.length > 1 : this.autorisees.includes(e.key));
1099
+ },
1100
+ categoriesItems() {
1101
+ return this.categories.map((e) => ({
1102
+ id: e.key,
1103
+ libelle: e.label,
1104
+ icon: e.icon
1105
+ }));
919
1106
  },
920
1107
  categorieCourante() {
921
- return Ut.find((e) => e.key === this.categorie);
1108
+ return un.find((e) => e.key === this.categorie);
922
1109
  },
923
1110
  selectionne() {
924
1111
  return this.draft.reclamantSelectionne;
@@ -936,7 +1123,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
936
1123
  this.categorie !== "tout" && (this.categorie = this.categorieOf(e) ?? this.categorie);
937
1124
  } },
938
1125
  async created() {
939
- this.categorie = this.categorieOf(this.selectionne) ?? this.categories[0]?.key ?? null, await jt(Ut.map((e) => e.icon)), this.iconsReady = !0;
1126
+ this.categorie = this.categorieOf(this.selectionne) ?? this.categories[0]?.key ?? null, await at(un.map((e) => e.icon)), this.iconsReady = !0;
940
1127
  },
941
1128
  beforeUnmount() {
942
1129
  clearTimeout(this.rechercheTimeout), this.controller?.abort();
@@ -946,7 +1133,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
946
1133
  e && this.draft.selectReclamant(e);
947
1134
  },
948
1135
  setCategorie(e) {
949
- e !== this.categorie && (this.categorie = e, clearTimeout(this.rechercheTimeout), this.controller?.abort(), this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1);
1136
+ e && e !== this.categorie && (this.categorie = e, clearTimeout(this.rechercheTimeout), this.controller?.abort(), this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1);
950
1137
  },
951
1138
  rechercherPlusTard(e) {
952
1139
  clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercher(e), 400);
@@ -963,11 +1150,11 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
963
1150
  return e ? `${e.type}|${e.id}` : null;
964
1151
  },
965
1152
  categorieOf(e) {
966
- let t = Ae(e);
1153
+ let t = ke(e);
967
1154
  return this.autorisees.includes(t) ? t : null;
968
1155
  },
969
1156
  sortiLibelle(e) {
970
- return e?.dateSortie == null ? "sorti" : `sorti le ${Pt(e.dateSortie)}`;
1157
+ return e?.dateSortie == null ? "sorti" : `sorti le ${nn(e.dateSortie)}`;
971
1158
  },
972
1159
  nomsOf(e) {
973
1160
  return (e?.individus ?? []).map((e) => [e.nom, e.prenom].filter(Boolean).join(" ")).filter(Boolean).join(", ");
@@ -980,202 +1167,107 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
980
1167
  referenceOf(e) {
981
1168
  if (!e?.individus) return "";
982
1169
  let t = this.categorieOf(e);
983
- return t === "locataire" ? [`Contrat ${e.type}/${e.id}`, e.idModule && `Module ${e.idModule}`].filter(Boolean).join(" — ") : t === "demandeur" ? e.libelleReclamant : t === "autre" ? "Individu « Autre »" : je(e).libelle;
1170
+ return t === "locataire" ? [`Contrat ${e.type}/${e.id}`, e.idModule && `Module ${e.idModule}`].filter(Boolean).join(" — ") : t === "demandeur" ? e.libelleReclamant : t === "autre" ? "Individu « Autre »" : Ae(e).libelle;
984
1171
  },
985
1172
  detailOf(e) {
986
1173
  let t = e?.individus ?? [];
987
- if (!["locataire", "demandeur"].includes(Ae(e))) {
1174
+ if (!["locataire", "demandeur"].includes(ke(e))) {
988
1175
  let e = t[0];
989
1176
  return e ? [e.telephone, e.mail].filter(Boolean).join(" — ") : "";
990
1177
  }
991
1178
  return t.map((t) => {
992
- let n = [t.nom, t.prenom].filter(Boolean).join(" "), r = e.estActif && t.dateSortie != null && t.dateSortie * 1e3 < Date.now() ? `sorti le ${Pt(t.dateSortie)}` : null, i = [Wt[t.role]?.toLowerCase(), r].filter(Boolean).join(", ");
1179
+ let n = [t.nom, t.prenom].filter(Boolean).join(" "), r = e.estActif && t.dateSortie != null && t.dateSortie * 1e3 < Date.now() ? `sorti le ${nn(t.dateSortie)}` : null, i = [dn[t.role]?.toLowerCase(), r].filter(Boolean).join(", ");
993
1180
  return i ? `${n} (${i})` : n;
994
1181
  }).join(", ");
995
1182
  }
996
1183
  }
997
- }, Kt = { class: "d-flex flex-column gap-3" }, qt = { class: "d-flex flex-wrap gap-2" }, Jt = ["onClick"], Yt = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, Xt = { class: "min-w-0" }, Zt = {
1184
+ }, pn = { class: "row g-3" }, mn = {
1185
+ key: 0,
1186
+ class: "col-12 col-md-6"
1187
+ }, hn = { class: "col-12" }, gn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, _n = { class: "min-w-0" }, vn = {
998
1188
  key: 0,
999
1189
  class: "badge bg-warning-subtle text-warning-emphasis ms-1"
1000
- }, Qt = { class: "text-muted d-block text-truncate" }, $t = { key: 0 }, en = {
1190
+ }, yn = { class: "text-muted d-block text-truncate" }, bn = { key: 0 }, xn = {
1001
1191
  key: 0,
1002
1192
  class: "text-muted d-block text-truncate"
1003
- }, tn = {
1193
+ }, Sn = {
1004
1194
  key: 0,
1005
1195
  class: "text-muted"
1006
1196
  };
1007
- function nn(e, t, n, r, i, a) {
1008
- let o = N("font-awesome-icon"), s = N("reclamant-type-badge-component"), c = N("amsom-autocomplete"), l = N("amsom-overlay");
1009
- return i.iconsReady ? (O(), y(l, {
1197
+ function Cn(e, t, n, r, i, a) {
1198
+ let o = F("icon-select-component"), s = F("reclamant-type-badge-component"), c = F("amsom-autocomplete"), l = F("amsom-overlay");
1199
+ return i.iconsReady ? (A(), x(l, {
1010
1200
  key: 0,
1011
1201
  loading: r.options.repriseReclamant
1012
1202
  }, {
1013
- default: L(() => [S("div", Kt, [S("div", null, [t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le réclamant est… ", -1), S("div", qt, [(O(!0), x(_, null, j(a.categories, (e) => (O(), x("button", {
1014
- key: e.key,
1015
- type: "button",
1016
- class: E(["btn btn-sm d-inline-flex align-items-center gap-2", i.categorie === e.key ? "btn-primary" : "btn-outline-primary"]),
1017
- onClick: (t) => a.setCategorie(e.key)
1018
- }, [w(o, {
1019
- icon: e.icon,
1020
- "fixed-width": ""
1021
- }, null, 8, ["icon"]), S("span", null, P(e.label), 1)], 10, Jt))), 128))])]), S("div", null, [
1022
- S("label", Yt, P(a.categorieCourante.recherche), 1),
1023
- (O(), y(c, {
1024
- key: i.categorie,
1025
- modelValue: a.selectedTrouve,
1026
- "onUpdate:modelValue": t[0] ||= (e) => a.selectedTrouve = e,
1027
- items: i.trouves,
1028
- "filtering-function": ({ items: e }) => e,
1029
- loading: i.rechercheEnCours,
1030
- "get-id": a.cleReclamant,
1031
- "get-input-libelle": (e) => e?.libelle ?? "",
1032
- placeholder: a.categorieCourante.placeholder,
1033
- "input-size": "sm",
1034
- "hide-choices": "",
1035
- "debounce-delay": 0,
1036
- onSearch: a.rechercherPlusTard
1037
- }, {
1038
- options: L((e) => [S("div", Xt, [
1039
- S("div", { class: E(["fw-medium text-truncate", e?.estActif ? "" : "text-muted"]) }, [
1040
- w(s, {
1041
- reclamant: e,
1042
- "icon-only": "",
1043
- class: "me-1"
1044
- }, null, 8, ["reclamant"]),
1045
- C(" " + P(a.titreOf(e)) + " ", 1),
1046
- e?.estActif ? b("", !0) : (O(), x("span", Zt, P(a.categorieOf(e) === "demandeur" ? "inactive" : a.sortiLibelle(e)), 1))
1047
- ], 2),
1048
- S("small", Qt, [C(P(a.referenceOf(e)) + " ", 1), e?.adresse ? (O(), x("span", $t, " — " + P(e.adresse), 1)) : b("", !0)]),
1049
- a.detailOf(e) ? (O(), x("small", en, P(a.detailOf(e)), 1)) : b("", !0)
1050
- ])]),
1051
- _: 1
1052
- }, 8, [
1053
- "modelValue",
1054
- "items",
1055
- "filtering-function",
1056
- "loading",
1057
- "get-id",
1058
- "get-input-libelle",
1059
- "placeholder",
1060
- "onSearch"
1061
- ])),
1062
- i.rechercheFaite && !i.rechercheEnCours && !i.trouves.length ? (O(), x("small", tn, P(a.categorieCourante.aucun), 1)) : b("", !0)
1063
- ])])]),
1064
- _: 1
1065
- }, 8, ["loading"])) : b("", !0);
1066
- }
1067
- var rn = /*#__PURE__*/ K(Gt, [["render", nn]]), an = {
1068
- name: "ProvenanceSelecteurBlock",
1069
- setup() {
1070
- return {
1071
- draft: G(),
1072
- data: Z(),
1073
- options: Q()
1074
- };
1075
- },
1076
- data() {
1077
- return { iconsReady: !1 };
1078
- },
1079
- computed: {
1080
- provenances() {
1081
- return this.options.provenances;
1082
- },
1083
- loaded() {
1084
- return this.data.cache.provenances != null;
1085
- },
1086
- selected() {
1087
- return this.draft.draft.provenance;
1088
- },
1089
- libelleFige() {
1090
- return this.data.cache.provenances?.find((e) => e.id === this.selected)?.libelle ?? this.selected ?? "—";
1091
- },
1092
- provenanceChoisie() {
1093
- return this.provenances.find((e) => e.id === this.selected) ?? null;
1094
- }
1095
- },
1096
- async created() {
1097
- await jt([...Object.values(B), Ce]), this.iconsReady = !0;
1098
- },
1099
- methods: { iconOf: we }
1100
- }, on = {
1101
- key: 0,
1102
- class: "fs-7 text-muted"
1103
- }, sn = { class: "fw-medium" }, cn = { key: 1 }, ln = { class: "d-flex flex-wrap gap-2" }, un = ["onClick"], dn = {
1104
- key: 0,
1105
- class: "fs-7 text-danger mt-1"
1106
- };
1107
- function fn(e, t, n, r, i, a) {
1108
- let o = N("font-awesome-icon");
1109
- return r.draft.isReadonly("provenance") ? (O(), x("div", on, [t[0] ||= C(" Provenance du contact : ", -1), S("span", sn, [i.iconsReady && a.selected ? (O(), y(o, {
1110
- key: 0,
1111
- icon: a.iconOf(a.selected),
1112
- "fixed-width": ""
1113
- }, null, 8, ["icon"])) : b("", !0), C(" " + P(a.libelleFige), 1)])])) : (O(), x("div", cn, [
1114
- t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, [C(" Provenance du contact "), S("span", { class: "text-danger" }, "*")], -1),
1115
- S("div", ln, [(O(!0), x(_, null, j(a.provenances, (e) => (O(), x("button", {
1116
- key: e.id,
1117
- type: "button",
1118
- class: E(["btn btn-sm d-inline-flex align-items-center gap-2", e.id === a.selected ? "btn-primary" : "btn-outline-primary"]),
1119
- onClick: (t) => r.draft.setProvenance(e.id)
1120
- }, [i.iconsReady ? (O(), y(o, {
1121
- key: 0,
1122
- icon: e.icon,
1123
- "fixed-width": ""
1124
- }, null, 8, ["icon"])) : b("", !0), S("span", null, P(e.libelle), 1)], 10, un))), 128))]),
1125
- a.loaded && !a.provenanceChoisie ? (O(), x("div", dn, " Sélectionnez par quel canal la sollicitation vous est parvenue. ")) : b("", !0)
1126
- ]));
1127
- }
1128
- var pn = /*#__PURE__*/ K(an, [["render", fn]]), mn = {
1129
- name: "EtapeReclamantBlock",
1130
- components: {
1131
- ReclamantRechercheBlock: rn,
1132
- ProvenanceSelecteurBlock: pn
1133
- },
1134
- props: { premiere: {
1135
- type: Boolean,
1136
- default: !1
1137
- } },
1138
- setup() {
1139
- return { draft: G() };
1140
- }
1141
- }, hn = { class: "d-flex flex-column gap-3" }, gn = { class: "alert alert-light border py-2 px-3 mb-0 fs-7" };
1142
- function _n(e, t, n, r, i, a) {
1143
- let o = N("provenance-selecteur-block"), s = N("font-awesome-icon"), c = N("reclamant-recherche-block");
1144
- return O(), x("div", hn, [n.premiere ? (O(), y(o, { key: 0 })) : b("", !0), M(e.$slots, "reclamant", {
1145
- reclamant: r.draft.reclamantSelectionne,
1146
- select: r.draft.selectReclamant
1147
- }, () => [S("div", gn, [w(s, {
1148
- icon: "user",
1149
- class: "text-primary me-2"
1150
- }), t[0] ||= C(" Pour qui cette sollicitation est-elle créée\xA0? ", -1)]), w(c)])]);
1151
- }
1152
- var vn = /*#__PURE__*/ K(mn, [["render", _n]]);
1153
- // src/utils/text.js
1154
- function $(e, t = !0) {
1155
- if (!e) return null;
1156
- let n = e.toString().normalize("NFD").replace(/[̀-ͯ]/g, "");
1157
- return t ? n.toLowerCase() : n;
1203
+ default: z(() => [w("div", pn, [
1204
+ e.$slots["avant-categorie"] ? (A(), C("div", mn, [P(e.$slots, "avant-categorie")])) : S("", !0),
1205
+ w("div", { class: O(["col-12", { "col-md-6": e.$slots["avant-categorie"] }]) }, [E(o, {
1206
+ "model-value": i.categorie,
1207
+ items: a.categoriesItems,
1208
+ label: "Le réclamant est…",
1209
+ "onUpdate:modelValue": t[0] ||= (e) => a.setCategorie(e)
1210
+ }, null, 8, ["model-value", "items"])], 2),
1211
+ w("div", hn, [
1212
+ w("label", gn, [T(I(a.categorieCourante.recherche), 1), t[2] ||= w("span", { class: "ms-1 text-danger" }, "*", -1)]),
1213
+ (A(), x(c, {
1214
+ key: i.categorie,
1215
+ modelValue: a.selectedTrouve,
1216
+ "onUpdate:modelValue": t[1] ||= (e) => a.selectedTrouve = e,
1217
+ items: i.trouves,
1218
+ "filtering-function": ({ items: e }) => e,
1219
+ loading: i.rechercheEnCours,
1220
+ "get-id": a.cleReclamant,
1221
+ "get-input-libelle": (e) => e?.libelle ?? "",
1222
+ placeholder: a.categorieCourante.placeholder,
1223
+ "input-size": "sm",
1224
+ "hide-choices": "",
1225
+ "debounce-delay": 0,
1226
+ onSearch: a.rechercherPlusTard
1227
+ }, {
1228
+ options: z((e) => [w("div", _n, [
1229
+ w("div", { class: O(["fw-medium text-truncate", e?.estActif ? "" : "text-muted"]) }, [
1230
+ E(s, {
1231
+ reclamant: e,
1232
+ "icon-only": "",
1233
+ class: "me-1"
1234
+ }, null, 8, ["reclamant"]),
1235
+ T(" " + I(a.titreOf(e)) + " ", 1),
1236
+ e?.estActif ? S("", !0) : (A(), C("span", vn, I(a.categorieOf(e) === "demandeur" ? "inactive" : a.sortiLibelle(e)), 1))
1237
+ ], 2),
1238
+ w("small", yn, [T(I(a.referenceOf(e)) + " ", 1), e?.adresse ? (A(), C("span", bn, " — " + I(e.adresse), 1)) : S("", !0)]),
1239
+ a.detailOf(e) ? (A(), C("small", xn, I(a.detailOf(e)), 1)) : S("", !0)
1240
+ ])]),
1241
+ _: 1
1242
+ }, 8, [
1243
+ "modelValue",
1244
+ "items",
1245
+ "filtering-function",
1246
+ "loading",
1247
+ "get-id",
1248
+ "get-input-libelle",
1249
+ "placeholder",
1250
+ "onSearch"
1251
+ ])),
1252
+ i.rechercheFaite && !i.rechercheEnCours && !i.trouves.length ? (A(), C("small", Sn, I(a.categorieCourante.aucun), 1)) : S("", !0)
1253
+ ])
1254
+ ])]),
1255
+ _: 3
1256
+ }, 8, ["loading"])) : S("", !0);
1158
1257
  }
1159
- // src/components/ReclamantSelecteurBlock.vue
1160
- var yn = {
1258
+ var wn = /*#__PURE__*/ G(fn, [["render", Cn]]), Tn = {
1161
1259
  name: "ReclamantSelecteurBlock",
1162
1260
  components: {
1163
- AmsomAutocomplete: R,
1164
- ReclamantTypeBadgeComponent: Ht
1165
- },
1166
- props: {
1167
- mode: {
1168
- type: String,
1169
- default: null
1170
- },
1171
- inline: {
1172
- type: Boolean,
1173
- default: !0
1174
- }
1261
+ AmsomAutocomplete: B,
1262
+ ReclamantTypeBadgeComponent: ln
1175
1263
  },
1264
+ props: { mode: {
1265
+ type: String,
1266
+ default: null
1267
+ } },
1176
1268
  setup() {
1177
1269
  return {
1178
- draft: G(),
1270
+ draft: W(),
1179
1271
  options: Q()
1180
1272
  };
1181
1273
  },
@@ -1202,30 +1294,32 @@ var yn = {
1202
1294
  this.draft.selectReclamant(e);
1203
1295
  },
1204
1296
  filterReclamants({ search: e, items: t }) {
1205
- let n = ($(e) ?? "").trim();
1206
- return n ? t.filter((e) => ($(e?.libelle) ?? "").includes(n)) : t;
1297
+ let n = (K(e) ?? "").trim();
1298
+ return n ? t.filter((e) => (K(e?.libelle) ?? "").includes(n)) : t;
1207
1299
  }
1208
1300
  }
1209
- }, bn = {
1301
+ }, En = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, Dn = {
1210
1302
  key: 0,
1211
- class: "fs-7 text-muted"
1212
- }, xn = { class: "fw-medium" }, Sn = {
1213
- key: 0,
1214
- class: "btn-group btn-group-sm",
1303
+ class: "ms-1 text-danger"
1304
+ }, On = ["value"], kn = {
1305
+ key: 1,
1306
+ class: "btn-group btn-group-sm w-100",
1215
1307
  role: "group"
1216
- }, Cn = ["onClick"], wn = ["value"], Tn = ["value"];
1217
- function En(e, t, n, r, i, a) {
1218
- let o = N("reclamant-type-badge-component"), s = N("amsom-autocomplete");
1219
- return a.estFige ? (O(), x("div", bn, [t[2] ||= C(" Réclamant : ", -1), S("span", xn, P(a.reclamantSelectionne?.libelle), 1)])) : (O(), x("div", {
1220
- key: 1,
1221
- class: E(n.inline ? "d-flex align-items-center justify-content-between gap-2 border-bottom pb-2" : "d-flex flex-column gap-1")
1222
- }, [t[3] ||= S("span", { class: "fs-7 fw-semibold text-muted text-uppercase" }, "Réclamant", -1), a.presentation === "switch" ? (O(), x("div", Sn, [(O(!0), x(_, null, j(a.reclamants, (e, t) => (O(), x("button", {
1308
+ }, An = ["onClick"], jn = ["value"], Mn = ["value"];
1309
+ function Nn(e, t, n, r, i, a) {
1310
+ let o = F("reclamant-type-badge-component"), s = F("amsom-autocomplete");
1311
+ return A(), C("div", null, [w("label", En, [t[2] ||= T(" Réclamant", -1), a.estFige ? S("", !0) : (A(), C("span", Dn, "*"))]), a.estFige ? (A(), C("input", {
1312
+ key: 0,
1313
+ class: "form-control form-control-sm",
1314
+ disabled: "",
1315
+ value: a.reclamantSelectionne?.libelle ?? "—"
1316
+ }, null, 8, On)) : a.presentation === "switch" ? (A(), C("div", kn, [(A(!0), C(y, null, N(a.reclamants, (e, t) => (A(), C("button", {
1223
1317
  key: t,
1224
1318
  type: "button",
1225
- class: E(["btn btn-sm py-0", e === a.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
1319
+ class: O(["btn d-inline-flex align-items-center justify-content-center", e === a.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
1226
1320
  onClick: (t) => a.select(e)
1227
- }, P(e.libelle), 11, Cn))), 128))])) : a.presentation === "autocomplete" ? (O(), y(s, {
1228
- key: 1,
1321
+ }, I(e.libelle), 11, An))), 128))])) : a.presentation === "autocomplete" ? (A(), x(s, {
1322
+ key: 2,
1229
1323
  "model-value": a.reclamantSelectionne,
1230
1324
  items: a.reclamants,
1231
1325
  "get-id": a.reclamantId,
@@ -1233,366 +1327,75 @@ function En(e, t, n, r, i, a) {
1233
1327
  "filtering-function": a.filterReclamants,
1234
1328
  placeholder: "Rechercher un réclamant…",
1235
1329
  "input-size": "sm",
1236
- "hide-choices": "",
1237
- class: E(n.inline ? "" : "w-100"),
1330
+ required: "",
1238
1331
  "onUpdate:modelValue": t[0] ||= (e) => a.select(e)
1239
1332
  }, {
1240
- options: L((e) => [w(o, {
1333
+ options: z((e) => [E(o, {
1241
1334
  reclamant: e,
1242
1335
  "icon-only": "",
1243
1336
  class: "me-1"
1244
- }, null, 8, ["reclamant"]), C(" " + P(e?.libelle), 1)]),
1337
+ }, null, 8, ["reclamant"]), T(" " + I(e?.libelle), 1)]),
1245
1338
  _: 1
1246
1339
  }, 8, [
1247
1340
  "model-value",
1248
1341
  "items",
1249
1342
  "get-id",
1250
1343
  "get-input-libelle",
1251
- "filtering-function",
1252
- "class"
1253
- ])) : (O(), x("select", {
1254
- key: 2,
1255
- class: E(["form-select form-select-sm", n.inline ? "w-auto" : ""]),
1344
+ "filtering-function"
1345
+ ])) : (A(), C("select", {
1346
+ key: 3,
1347
+ class: "form-select form-select-sm",
1256
1348
  value: a.reclamants.indexOf(a.reclamantSelectionne),
1257
1349
  onChange: t[1] ||= (e) => a.select(a.reclamants[e.target.value])
1258
- }, [(O(!0), x(_, null, j(a.reclamants, (e, t) => (O(), x("option", {
1350
+ }, [(A(!0), C(y, null, N(a.reclamants, (e, t) => (A(), C("option", {
1259
1351
  key: t,
1260
1352
  value: t
1261
- }, P(e.libelle), 9, Tn))), 128))], 42, wn))], 2));
1353
+ }, I(e.libelle), 9, Mn))), 128))], 40, jn))]);
1262
1354
  }
1263
- // src/components/EtapeCategorieBlock.vue
1264
- var Dn = {
1265
- name: "EtapeCategorieBlock",
1266
- components: {
1267
- AmsomOverlay: g,
1268
- AmsomAutocomplete: R,
1269
- ReclamantSelecteurBlock: /* @__PURE__ */ K(yn, [["render", En]]),
1270
- ProvenanceSelecteurBlock: pn
1271
- },
1272
- props: { premiere: {
1273
- type: Boolean,
1274
- default: !1
1275
- } },
1276
- setup() {
1277
- return {
1278
- draft: G(),
1279
- data: Z(),
1280
- options: Q()
1281
- };
1282
- },
1283
- data() {
1284
- return { iconsReady: !1 };
1285
- },
1286
- computed: {
1287
- mainLigne() {
1288
- return this.draft.lignePrincipale;
1355
+ var Pn = /*#__PURE__*/ G(Tn, [["render", Nn]]), Fn = {
1356
+ B: "briefcase",
1357
+ M: "store",
1358
+ W: "dungeon",
1359
+ E: "user-graduate",
1360
+ K: "building-shield",
1361
+ F: "person-shelter",
1362
+ S: "square-parking",
1363
+ V: "hands-holding"
1364
+ };
1365
+ function In(e, t = !1, n = "circle-question") {
1366
+ return e === "L" ? t ? "building" : "house" : Fn[e] ?? n;
1367
+ }
1368
+ function Ln(e) {
1369
+ return e ? e.idCategorieModule === "L" ? e.estCollectif ? "Appartement" : "Maison" : e.categorieModule ?? "" : "";
1370
+ }
1371
+ // src/components/CiblePickerBlock.vue
1372
+ var Rn = 0, zn = {
1373
+ name: "CiblePickerBlock",
1374
+ components: { AmsomAutocomplete: B },
1375
+ props: {
1376
+ patrimoine: {
1377
+ type: Object,
1378
+ default: null
1289
1379
  },
1290
- motifFige() {
1291
- return this.draft.isReadonly("motif");
1380
+ cibleMode: {
1381
+ type: String,
1382
+ default: "contrat"
1292
1383
  },
1293
- activeMotifs() {
1294
- return (this.data.cache.motifs ?? []).filter((e) => !e.estDesactive).slice().sort((e, t) => (e.categorie ?? "").localeCompare(t.categorie ?? "") || (e.type ?? "").localeCompare(t.type ?? "") || (e.nature ?? "").localeCompare(t.nature ?? "") || (e.libelle ?? "").localeCompare(t.libelle ?? ""));
1384
+ reclamantModules: {
1385
+ type: Array,
1386
+ default: () => []
1295
1387
  },
1296
- allowedMotifs() {
1297
- let e = this.options.nomenclatureFilter;
1298
- if (typeof e != "function") return this.activeMotifs;
1299
- let t = this.draft.reclamantSelectionne;
1300
- return this.activeMotifs.filter((n) => e(n, { reclamant: t }));
1388
+ reclamantType: {
1389
+ type: String,
1390
+ default: null
1301
1391
  },
1302
- categoriesList() {
1303
- return this.distinct(this.allowedMotifs, "idCategorie", "categorie", (e) => this.data.categorieIcon(e));
1392
+ contratReclamant: {
1393
+ type: Boolean,
1394
+ default: !0
1304
1395
  },
1305
- typesList() {
1306
- return this.mainLigne.idCategorie ? this.distinct(this.allowedMotifs.filter((e) => e.idCategorie === this.mainLigne.idCategorie), "idType", "type", (e) => this.data.typeIcon(e)) : [];
1307
- },
1308
- naturesList() {
1309
- return this.mainLigne.idType ? this.distinct(this.allowedMotifs.filter((e) => e.idType === this.mainLigne.idType), "idNature", "nature", (e) => this.data.natureIcon(e)) : [];
1310
- },
1311
- motifsList() {
1312
- return this.mainLigne.idNature ? this.allowedMotifs.filter((e) => e.idNature === this.mainLigne.idNature).map((e) => ({
1313
- id: e.id,
1314
- libelle: e.libelle,
1315
- icon: e.icon
1316
- })) : [];
1317
- },
1318
- selectedMotif() {
1319
- return this.mainLigne.idMotif ? this.activeMotifs.find((e) => e.id === this.mainLigne.idMotif) ?? null : null;
1320
- },
1321
- motifsAssocies() {
1322
- let e = this.selectedMotif?.association;
1323
- return e ? Object.entries(e).map(([e, t]) => ({
1324
- libelle: e,
1325
- idMotif: t
1326
- })) : [];
1327
- },
1328
- selectionChain() {
1329
- let e = [];
1330
- return this.mainLigne.idCategorie && e.push({
1331
- level: "categorie",
1332
- libelle: this.data.categorieLibelle(this.mainLigne.idCategorie),
1333
- icon: this.data.categorieIcon(this.mainLigne.idCategorie)
1334
- }), this.mainLigne.idType && e.push({
1335
- level: "type",
1336
- libelle: this.data.typeLibelle(this.mainLigne.idType),
1337
- icon: this.data.typeIcon(this.mainLigne.idType)
1338
- }), this.mainLigne.idNature && e.push({
1339
- level: "nature",
1340
- libelle: this.data.natureLibelle(this.mainLigne.idNature),
1341
- icon: this.data.natureIcon(this.mainLigne.idNature)
1342
- }), this.mainLigne.idMotif && e.push({
1343
- level: "motif",
1344
- libelle: this.data.motifLibelle(this.mainLigne.idMotif),
1345
- icon: this.data.motifIcon(this.mainLigne.idMotif)
1346
- }), e;
1347
- },
1348
- currentLevel() {
1349
- return this.mainLigne.idCategorie ? this.mainLigne.idType ? this.mainLigne.idNature ? this.mainLigne.idMotif ? null : {
1350
- title: "Motif",
1351
- options: this.motifsList,
1352
- select: (e) => this.draft.setMotif(e)
1353
- } : {
1354
- title: "Nature",
1355
- options: this.naturesList,
1356
- select: (e) => this.draft.setNature(e)
1357
- } : {
1358
- title: "Type",
1359
- options: this.typesList,
1360
- select: (e) => this.draft.setType(e)
1361
- } : {
1362
- title: "Catégorie",
1363
- options: this.categoriesList,
1364
- select: (e) => this.draft.setCategorie(e)
1365
- };
1366
- },
1367
- motifRecherche: {
1368
- get() {
1369
- return this.selectedMotif;
1370
- },
1371
- set(e) {
1372
- let t = e && typeof e == "object" ? e : e ? this.activeMotifs.find((t) => t.id === e) : null;
1373
- t ? this.draft.selectMotifChain(t) : this.draft.setCategorie(null);
1374
- }
1375
- }
1376
- },
1377
- async created() {
1378
- await this.data.loadNomenclature(), await this.registerIcons(), this.iconsReady = !0;
1379
- },
1380
- methods: {
1381
- goBackTo(e) {
1382
- e === "categorie" ? this.draft.setCategorie(null) : e === "type" ? this.draft.setType(null) : e === "nature" ? this.draft.setNature(null) : e === "motif" && this.draft.setMotif(null);
1383
- },
1384
- isActive(e) {
1385
- return this.draft.lignesAssociees.some((t) => t.idMotif === e);
1386
- },
1387
- toggleMotifAssocie(e) {
1388
- let t = this.activeMotifs.find((t) => t.id === e.idMotif);
1389
- this.draft.toggleLigneAssociee(e.idMotif, {
1390
- libelle: e.libelle,
1391
- idCategorie: t?.idCategorie ?? null,
1392
- idType: t?.idType ?? null,
1393
- idNature: t?.idNature ?? null
1394
- });
1395
- },
1396
- registerIcons() {
1397
- return jt([
1398
- ...this.data.cache.categories ?? [],
1399
- ...this.data.cache.types ?? [],
1400
- ...this.data.cache.natures ?? [],
1401
- ...this.activeMotifs
1402
- ].map((e) => e.icon));
1403
- },
1404
- filterMotifs({ search: e, items: t }) {
1405
- let n = ($(e) ?? "").trim();
1406
- if (!n) return t;
1407
- let r = n.split(/\s+/);
1408
- return t.filter((e) => {
1409
- let t = $(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
1410
- return r.every((e) => t.includes(e));
1411
- });
1412
- },
1413
- getMotifId(e) {
1414
- return e ? e.id : null;
1415
- },
1416
- getMotifInputLibelle(e) {
1417
- return e ? e.libelle : "";
1418
- },
1419
- distinct(e, t, n, r) {
1420
- let i = /* @__PURE__ */ new Map();
1421
- for (let a of e) a[t] != null && !i.has(a[t]) && i.set(a[t], {
1422
- id: a[t],
1423
- libelle: a[n] ?? a[t],
1424
- icon: r ? r(a[t]) : null
1425
- });
1426
- return [...i.values()].sort((e, t) => (e.libelle ?? "").localeCompare(t.libelle ?? ""));
1427
- },
1428
- motifLibelleFromId(e) {
1429
- return this.activeMotifs.find((t) => t.id === e)?.libelle ?? e;
1430
- }
1431
- }
1432
- }, On = {
1433
- key: 0,
1434
- class: "d-flex flex-column gap-3"
1435
- }, kn = { key: 2 }, An = { class: "d-flex flex-wrap align-items-center gap-2" }, jn = { class: "badge rounded-pill bg-primary d-inline-flex align-items-center gap-2" }, Mn = { key: 3 }, Nn = { class: "d-flex align-items-center gap-2" }, Pn = { class: "min-w-0" }, Fn = { class: "fw-medium text-truncate" }, In = { class: "text-muted d-block text-truncate" }, Ln = {
1436
- key: 4,
1437
- class: "d-flex align-items-center gap-2 text-muted fs-7"
1438
- }, Rn = {
1439
- key: 5,
1440
- class: "d-flex flex-wrap align-items-center gap-2"
1441
- }, zn = ["onClick"], Bn = { key: 6 }, Vn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-2" }, Hn = { class: "row justify-content-around g-3" }, Un = ["title", "onClick"], Wn = { class: "fs-7 mt-1 lh-sm" }, Gn = {
1442
- key: 0,
1443
- class: "col-12 text-muted fs-7"
1444
- }, Kn = [
1445
- "id",
1446
- "checked",
1447
- "disabled",
1448
- "onChange"
1449
- ], qn = ["for"];
1450
- function Jn(e, t, n, r, i, a) {
1451
- let o = N("provenance-selecteur-block"), s = N("reclamant-selecteur-block"), c = N("font-awesome-icon"), l = N("amsom-autocomplete"), u = N("amsom-overlay");
1452
- return O(), y(u, { loading: r.data.isLoading && !r.data.cache.motifs || !i.iconsReady }, {
1453
- default: L(() => [i.iconsReady ? (O(), x("div", On, [
1454
- n.premiere ? (O(), y(o, { key: 0 })) : b("", !0),
1455
- r.options.reclamantMode === "step" ? b("", !0) : (O(), y(s, { key: 1 })),
1456
- a.motifFige && a.selectionChain.length ? (O(), x("div", kn, [t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Motif", -1), S("div", An, [(O(!0), x(_, null, j(a.selectionChain, (e, t) => (O(), x(_, { key: e.level }, [t > 0 ? (O(), y(c, {
1457
- key: 0,
1458
- icon: "fa-solid fa-chevron-right",
1459
- class: "text-muted fs-7"
1460
- })) : b("", !0), S("span", jn, [e.icon ? (O(), y(c, {
1461
- key: 0,
1462
- icon: e.icon,
1463
- "fixed-width": ""
1464
- }, null, 8, ["icon"])) : b("", !0), C(" " + P(e.libelle), 1)])], 64))), 128))])])) : b("", !0),
1465
- a.motifFige ? b("", !0) : (O(), x("div", Mn, [t[2] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Rechercher un motif ", -1), w(l, {
1466
- modelValue: a.motifRecherche,
1467
- "onUpdate:modelValue": t[0] ||= (e) => a.motifRecherche = e,
1468
- items: a.allowedMotifs,
1469
- "get-id": a.getMotifId,
1470
- "get-input-libelle": a.getMotifInputLibelle,
1471
- "get-input-libelle-from-id": a.motifLibelleFromId,
1472
- "filtering-function": a.filterMotifs,
1473
- placeholder: "Rechercher (motif, catégorie, type, nature)…",
1474
- "input-size": "sm",
1475
- "hide-choices": ""
1476
- }, {
1477
- options: L((e) => [S("div", Nn, [e?.icon ? (O(), y(c, {
1478
- key: 0,
1479
- icon: e.icon,
1480
- class: "text-primary",
1481
- "fixed-width": ""
1482
- }, null, 8, ["icon"])) : b("", !0), S("div", Pn, [S("div", Fn, P(e?.libelle), 1), S("small", In, P(e?.categorie) + " › " + P(e?.type) + " › " + P(e?.nature), 1)])])]),
1483
- _: 1
1484
- }, 8, [
1485
- "modelValue",
1486
- "items",
1487
- "get-id",
1488
- "get-input-libelle",
1489
- "get-input-libelle-from-id",
1490
- "filtering-function"
1491
- ])])),
1492
- a.motifFige ? b("", !0) : (O(), x("div", Ln, [...t[3] ||= [
1493
- S("hr", { class: "flex-grow-1 my-0" }, null, -1),
1494
- S("span", null, "ou sélection guidée", -1),
1495
- S("hr", { class: "flex-grow-1 my-0" }, null, -1)
1496
- ]])),
1497
- !a.motifFige && a.selectionChain.length ? (O(), x("div", Rn, [(O(!0), x(_, null, j(a.selectionChain, (e, t) => (O(), x(_, { key: e.level }, [t > 0 ? (O(), y(c, {
1498
- key: 0,
1499
- icon: "fa-solid fa-chevron-right",
1500
- class: "text-muted fs-7"
1501
- })) : b("", !0), S("button", {
1502
- type: "button",
1503
- class: "btn btn-sm btn-primary rounded-pill d-inline-flex align-items-center gap-2",
1504
- onClick: (t) => a.goBackTo(e.level)
1505
- }, [
1506
- e.icon ? (O(), y(c, {
1507
- key: 0,
1508
- icon: e.icon,
1509
- "fixed-width": ""
1510
- }, null, 8, ["icon"])) : b("", !0),
1511
- S("span", null, P(e.libelle), 1),
1512
- w(c, {
1513
- icon: "fa-solid fa-xmark",
1514
- class: "fs-7 opacity-75"
1515
- })
1516
- ], 8, zn)], 64))), 128))])) : b("", !0),
1517
- !a.motifFige && a.currentLevel ? (O(), x("div", Bn, [S("label", Vn, P(a.currentLevel.title), 1), S("div", Hn, [(O(!0), x(_, null, j(a.currentLevel.options, (e) => (O(), x("div", {
1518
- key: e.id,
1519
- class: "col-3 text-center"
1520
- }, [S("button", {
1521
- type: "button",
1522
- class: "btn btn-lg btn-outline-primary btn-circle d-flex align-items-center justify-content-center mx-auto",
1523
- title: e.libelle,
1524
- onClick: (t) => a.currentLevel.select(e.id)
1525
- }, [e.icon ? (O(), y(c, {
1526
- key: 0,
1527
- icon: e.icon,
1528
- size: "lg"
1529
- }, null, 8, ["icon"])) : b("", !0)], 8, Un), S("div", Wn, P(e.libelle), 1)]))), 128)), a.currentLevel.options.length ? b("", !0) : (O(), x("div", Gn, " Aucun choix disponible "))])])) : b("", !0),
1530
- a.motifsAssocies.length ? (O(), x(_, { key: 7 }, [t[4] ||= S("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
1531
- S("hr", { class: "flex-grow-1 my-0" }),
1532
- S("span", null, "Autres motifs liés"),
1533
- S("hr", { class: "flex-grow-1 my-0" })
1534
- ], -1), (O(!0), x(_, null, j(a.motifsAssocies, (e) => (O(), x("div", {
1535
- key: e.idMotif,
1536
- class: "form-check form-switch"
1537
- }, [S("input", {
1538
- id: `assoc-${e.idMotif}`,
1539
- class: "form-check-input",
1540
- type: "checkbox",
1541
- checked: a.isActive(e.idMotif),
1542
- disabled: a.motifFige,
1543
- onChange: (t) => a.toggleMotifAssocie(e)
1544
- }, null, 40, Kn), S("label", {
1545
- class: "form-check-label fs-7",
1546
- for: `assoc-${e.idMotif}`
1547
- }, P(e.libelle) + " ? ", 9, qn)]))), 128))], 64)) : b("", !0)
1548
- ])) : b("", !0)]),
1549
- _: 1
1550
- }, 8, ["loading"]);
1551
- }
1552
- var Yn = /*#__PURE__*/ K(Dn, [["render", Jn]]), Xn = {
1553
- B: "briefcase",
1554
- M: "store",
1555
- W: "dungeon",
1556
- E: "user-graduate",
1557
- K: "building-shield",
1558
- F: "person-shelter",
1559
- S: "square-parking",
1560
- V: "hands-holding"
1561
- };
1562
- function Zn(e, t = !1, n = "circle-question") {
1563
- return e === "L" ? t ? "building" : "house" : Xn[e] ?? n;
1564
- }
1565
- function Qn(e) {
1566
- return e ? e.idCategorieModule === "L" ? e.estCollectif ? "Appartement" : "Maison" : e.categorieModule ?? "" : "";
1567
- }
1568
- // src/components/CiblePickerBlock.vue
1569
- var $n = 0, er = {
1570
- name: "CiblePickerBlock",
1571
- components: { AmsomAutocomplete: R },
1572
- props: {
1573
- patrimoine: {
1574
- type: Object,
1575
- default: null
1576
- },
1577
- cibleMode: {
1578
- type: String,
1579
- default: "contrat"
1580
- },
1581
- reclamantModules: {
1582
- type: Array,
1583
- default: () => []
1584
- },
1585
- reclamantType: {
1586
- type: String,
1587
- default: null
1588
- },
1589
- contratReclamant: {
1590
- type: Boolean,
1591
- default: !0
1592
- },
1593
- contratCible: {
1594
- type: Object,
1595
- default: null
1396
+ contratCible: {
1397
+ type: Object,
1398
+ default: null
1596
1399
  },
1597
1400
  afficheCaseContratReclamant: {
1598
1401
  type: Boolean,
@@ -1623,7 +1426,7 @@ var $n = 0, er = {
1623
1426
  },
1624
1427
  data() {
1625
1428
  return {
1626
- uid: ++$n,
1429
+ uid: ++Rn,
1627
1430
  rechercheContrat: "",
1628
1431
  contratsTrouves: [],
1629
1432
  rechercheEnCours: !1,
@@ -1770,7 +1573,7 @@ var $n = 0, er = {
1770
1573
  clearTimeout(this.rechercheTimeout), this.controller?.abort();
1771
1574
  },
1772
1575
  methods: {
1773
- formatDate: Pt,
1576
+ formatDate: nn,
1774
1577
  rechercherPlusTard(e) {
1775
1578
  clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercherContrat(e), 400);
1776
1579
  },
@@ -1790,16 +1593,16 @@ var $n = 0, er = {
1790
1593
  },
1791
1594
  filterOn(e) {
1792
1595
  return ({ search: t, items: n }) => {
1793
- let r = ($(t) ?? "").trim();
1794
- return r ? n.filter((t) => ($(t?.[e]) ?? "").includes(r)) : n;
1596
+ let r = (K(t) ?? "").trim();
1597
+ return r ? n.filter((t) => (K(t?.[e]) ?? "").includes(r)) : n;
1795
1598
  };
1796
1599
  },
1797
1600
  filterModules({ search: e, items: t }) {
1798
- let n = ($(e) ?? "").trim();
1799
- return n ? t.filter((e) => String(e?.idModule ?? "").includes(n) || ($(this.moduleInputLibelle(e)) ?? "").includes(n) || ($(e?._autreLibelle) ?? "").includes(n)) : t;
1601
+ let n = (K(e) ?? "").trim();
1602
+ return n ? t.filter((e) => String(e?.idModule ?? "").includes(n) || (K(this.moduleInputLibelle(e)) ?? "").includes(n) || (K(e?._autreLibelle) ?? "").includes(n)) : t;
1800
1603
  },
1801
- getCategorieModuleIcon: Zn,
1802
- categorieLibelle: Qn,
1604
+ getCategorieModuleIcon: In,
1605
+ categorieLibelle: Ln,
1803
1606
  moduleLibelle(e) {
1804
1607
  return e ? e.libelleModule ?? e.adresse ?? `Module ${e.idModule}` : "";
1805
1608
  },
@@ -1811,63 +1614,63 @@ var $n = 0, er = {
1811
1614
  return !!e?.dateFin && e.dateFin < Math.floor(Date.now() / 1e3);
1812
1615
  }
1813
1616
  }
1814
- }, tr = { class: "d-flex flex-column gap-3" }, nr = {
1617
+ }, Bn = { class: "d-flex flex-column gap-3" }, Vn = {
1815
1618
  class: "btn-group w-100",
1816
1619
  role: "group"
1817
- }, rr = ["onClick"], ir = { class: "text-muted d-block mt-1" }, ar = {
1620
+ }, Hn = ["onClick"], Un = { class: "text-muted d-block mt-1" }, Wn = {
1818
1621
  key: 0,
1819
1622
  class: "form-check"
1820
- }, or = ["id", "checked"], sr = ["for"], cr = { key: 1 }, lr = { class: "min-w-0" }, ur = { class: "fw-medium text-truncate text-capitalize" }, dr = { class: "d-flex flex-wrap align-items-center gap-1" }, fr = { class: "text-muted" }, pr = {
1623
+ }, Gn = ["id", "checked"], Kn = ["for"], qn = { key: 1 }, Jn = { class: "min-w-0" }, Yn = { class: "fw-medium text-truncate text-capitalize" }, Xn = { class: "d-flex flex-wrap align-items-center gap-1" }, Zn = { class: "text-muted" }, Qn = {
1821
1624
  key: 0,
1822
1625
  class: "badge bg-info"
1823
- }, mr = {
1626
+ }, $n = {
1824
1627
  key: 1,
1825
1628
  class: "badge bg-warning"
1826
- }, hr = {
1629
+ }, er = {
1827
1630
  key: 0,
1828
1631
  class: "text-muted d-block text-truncate"
1829
- }, gr = { key: 1 }, _r = { class: "row g-2" }, vr = ["aria-pressed", "onClick"], yr = { class: "min-w-0" }, br = { class: "d-block fw-semibold fs-6" }, xr = { class: "d-block text-muted" }, Sr = {
1632
+ }, tr = { key: 1 }, nr = { class: "row g-2" }, rr = ["aria-pressed", "onClick"], ir = { class: "min-w-0" }, ar = { class: "d-block fw-semibold fs-6" }, or = { class: "d-block text-muted" }, sr = {
1830
1633
  key: 2,
1831
1634
  class: "row g-3"
1832
- }, Cr = { class: "min-w-0" }, wr = { class: "fw-medium text-truncate" }, Tr = { class: "text-muted d-block text-truncate" }, Er = ["value"], Dr = ["value"], Or = ["value"], kr = {
1635
+ }, cr = { class: "min-w-0" }, lr = { class: "fw-medium text-truncate" }, ur = { class: "text-muted d-block text-truncate" }, dr = ["value"], fr = ["value"], pr = ["value"], mr = {
1833
1636
  key: 0,
1834
1637
  class: "col-12 col-md-6"
1835
- }, Ar = { class: "d-flex flex-wrap align-items-center gap-1" }, jr = ["title"], Mr = { class: "text-muted" }, Nr = {
1638
+ }, hr = { class: "d-flex flex-wrap align-items-center gap-1" }, gr = ["title"], _r = { class: "text-muted" }, vr = {
1836
1639
  key: 1,
1837
1640
  class: "d-block text-truncate"
1838
- }, Pr = {
1641
+ }, yr = {
1839
1642
  key: 2,
1840
1643
  class: "text-muted d-block"
1841
- }, Fr = {
1644
+ }, br = {
1842
1645
  key: 0,
1843
1646
  class: "mt-2 d-flex flex-column gap-2"
1844
- }, Ir = { class: "form-check mb-0 ms-3" }, Lr = ["id", "checked"], Rr = ["for"];
1845
- function zr(e, t, n, r, i, a) {
1846
- let o = N("font-awesome-icon"), s = N("amsom-autocomplete");
1847
- return O(), x("div", tr, [
1848
- S("div", null, [
1849
- t[7] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " La sollicitation concerne… ", -1),
1850
- S("div", nr, [(O(!0), x(_, null, j(a.availableModes, (t) => (O(), x("button", {
1647
+ }, xr = { class: "form-check mb-0 ms-3" }, Sr = ["id", "checked"], Cr = ["for"];
1648
+ function wr(e, t, n, r, i, a) {
1649
+ let o = F("font-awesome-icon"), s = F("amsom-autocomplete");
1650
+ return A(), C("div", Bn, [
1651
+ w("div", null, [
1652
+ t[7] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " La sollicitation concerne… ", -1),
1653
+ w("div", Vn, [(A(!0), C(y, null, N(a.availableModes, (t) => (A(), C("button", {
1851
1654
  key: t.key,
1852
1655
  type: "button",
1853
- class: E(["btn btn-sm", n.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
1656
+ class: O(["btn btn-sm", n.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
1854
1657
  onClick: (n) => e.$emit("change-mode", t.key)
1855
- }, [w(o, {
1658
+ }, [E(o, {
1856
1659
  icon: t.icon,
1857
1660
  class: "me-1"
1858
- }, null, 8, ["icon"]), C(" " + P(t.label), 1)], 10, rr))), 128))]),
1859
- S("small", ir, P(a.currentMode?.aide), 1)
1661
+ }, null, 8, ["icon"]), T(" " + I(t.label), 1)], 10, Hn))), 128))]),
1662
+ w("small", Un, I(a.currentMode?.aide), 1)
1860
1663
  ]),
1861
- n.cibleMode === "contrat" ? (O(), x(_, { key: 0 }, [n.afficheCaseContratReclamant ? (O(), x("div", ar, [S("input", {
1664
+ n.cibleMode === "contrat" ? (A(), C(y, { key: 0 }, [n.afficheCaseContratReclamant ? (A(), C("div", Wn, [w("input", {
1862
1665
  id: `contrat-reclamant-${i.uid}`,
1863
1666
  class: "form-check-input",
1864
1667
  type: "checkbox",
1865
1668
  checked: n.contratReclamant,
1866
1669
  onChange: t[0] ||= (t) => e.$emit("toggle-contrat-reclamant", t.target.checked)
1867
- }, null, 40, or), S("label", {
1670
+ }, null, 40, Gn), w("label", {
1868
1671
  class: "form-check-label fs-7",
1869
1672
  for: `contrat-reclamant-${i.uid}`
1870
- }, " Contrat du réclamant ", 8, sr)])) : b("", !0), n.contratReclamant ? b("", !0) : (O(), x("div", cr, [t[8] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Contrat ciblé ", -1), w(s, {
1673
+ }, " Contrat du réclamant ", 8, Kn)])) : S("", !0), n.contratReclamant ? S("", !0) : (A(), C("div", qn, [t[8] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Contrat ciblé ", -1), E(s, {
1871
1674
  modelValue: a.selectedContrat,
1872
1675
  "onUpdate:modelValue": t[1] ||= (e) => a.selectedContrat = e,
1873
1676
  items: i.contratsTrouves,
@@ -1881,14 +1684,14 @@ function zr(e, t, n, r, i, a) {
1881
1684
  "debounce-delay": 0,
1882
1685
  onSearch: a.rechercherPlusTard
1883
1686
  }, {
1884
- options: L((e) => [S("div", lr, [
1885
- S("div", ur, P(e?.libelle ?? `Contrat ${e?.idContrat}`), 1),
1886
- S("div", dr, [
1887
- S("small", fr, "N° " + P(e?.typeContrat) + "/" + P(e?.idContrat), 1),
1888
- e?.nbModules > 1 ? (O(), x("span", pr, P(e.nbModules) + " modules", 1)) : b("", !0),
1889
- e?.estSorti ? (O(), x("span", mr, P(e.dateSortie ? `Sorti le ${a.formatDate(e.dateSortie)}` : "Sorti"), 1)) : b("", !0)
1687
+ options: z((e) => [w("div", Jn, [
1688
+ w("div", Yn, I(e?.libelle ?? `Contrat ${e?.idContrat}`), 1),
1689
+ w("div", Xn, [
1690
+ w("small", Zn, "N° " + I(e?.typeContrat) + "/" + I(e?.idContrat), 1),
1691
+ e?.nbModules > 1 ? (A(), C("span", Qn, I(e.nbModules) + " modules", 1)) : S("", !0),
1692
+ e?.estSorti ? (A(), C("span", $n, I(e.dateSortie ? `Sorti le ${a.formatDate(e.dateSortie)}` : "Sorti"), 1)) : S("", !0)
1890
1693
  ]),
1891
- a.contratAdresse(e) ? (O(), x("small", hr, P(a.contratAdresse(e)), 1)) : b("", !0)
1694
+ a.contratAdresse(e) ? (A(), C("small", er, I(a.contratAdresse(e)), 1)) : S("", !0)
1892
1695
  ])]),
1893
1696
  _: 1
1894
1697
  }, 8, [
@@ -1899,22 +1702,22 @@ function zr(e, t, n, r, i, a) {
1899
1702
  "get-id",
1900
1703
  "get-input-libelle",
1901
1704
  "onSearch"
1902
- ])]))], 64)) : b("", !0),
1903
- n.cibleMode === "patrimoine" ? (O(), x("div", gr, [t[9] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le problème concerne… ", -1), S("div", _r, [(O(!0), x(_, null, j(a.portees, (t) => (O(), x("div", {
1705
+ ])]))], 64)) : S("", !0),
1706
+ n.cibleMode === "patrimoine" ? (A(), C("div", tr, [t[9] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le problème concerne… ", -1), w("div", nr, [(A(!0), C(y, null, N(a.portees, (t) => (A(), C("div", {
1904
1707
  key: t.titre,
1905
1708
  class: "col-12 col-md-6"
1906
- }, [S("button", {
1709
+ }, [w("button", {
1907
1710
  type: "button",
1908
- class: E(["btn w-100 h-100 text-start d-flex align-items-center gap-3 p-3 rounded border text-primary", t.modulePrecis === n.modulePrecis ? "border-primary bg-light" : "bg-white"]),
1711
+ class: O(["btn w-100 h-100 text-start d-flex align-items-center gap-3 p-3 rounded border text-primary", t.modulePrecis === n.modulePrecis ? "border-primary bg-light" : "bg-white"]),
1909
1712
  "aria-pressed": t.modulePrecis === n.modulePrecis,
1910
1713
  onClick: (n) => e.$emit("set-module-precis", t.modulePrecis)
1911
- }, [w(o, {
1714
+ }, [E(o, {
1912
1715
  icon: t.icon,
1913
1716
  class: "fs-4",
1914
1717
  "fixed-width": ""
1915
- }, null, 8, ["icon"]), S("span", yr, [S("span", br, P(t.titre), 1), S("small", xr, P(t.aide), 1)])], 10, vr)]))), 128))])])) : b("", !0),
1916
- n.cibleMode === "contrat" || n.cibleMode === "patrimoine" ? (O(), x("div", Sr, [S("div", { class: E(["col-12 d-flex flex-column gap-3", { "col-md-6": a.afficheModule }]) }, [n.cibleMode === "patrimoine" ? (O(), x(_, { key: 0 }, [
1917
- S("div", null, [t[10] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), w(s, {
1718
+ }, null, 8, ["icon"]), w("span", ir, [w("span", ar, I(t.titre), 1), w("small", or, I(t.aide), 1)])], 10, rr)]))), 128))])])) : S("", !0),
1719
+ n.cibleMode === "contrat" || n.cibleMode === "patrimoine" ? (A(), C("div", sr, [w("div", { class: O(["col-12 d-flex flex-column gap-3", { "col-md-6": a.afficheModule }]) }, [n.cibleMode === "patrimoine" ? (A(), C(y, { key: 0 }, [
1720
+ w("div", null, [t[10] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), E(s, {
1918
1721
  modelValue: a.selectedCommune,
1919
1722
  "onUpdate:modelValue": t[2] ||= (e) => a.selectedCommune = e,
1920
1723
  items: r.data.cache.communes || [],
@@ -1931,7 +1734,7 @@ function zr(e, t, n, r, i, a) {
1931
1734
  "get-input-libelle",
1932
1735
  "filtering-function"
1933
1736
  ])]),
1934
- S("div", null, [t[11] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), w(s, {
1737
+ w("div", null, [t[11] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), E(s, {
1935
1738
  modelValue: a.selectedAdresse,
1936
1739
  "onUpdate:modelValue": t[3] ||= (e) => a.selectedAdresse = e,
1937
1740
  items: a.adresses,
@@ -1943,7 +1746,7 @@ function zr(e, t, n, r, i, a) {
1943
1746
  "input-size": "sm",
1944
1747
  "hide-choices": ""
1945
1748
  }, {
1946
- options: L((e) => [S("div", Cr, [S("div", wr, P(e?.entree), 1), S("small", Tr, P(e?.commune) + " — Programme " + P(e?.codeProgramme), 1)])]),
1749
+ options: z((e) => [w("div", cr, [w("div", lr, I(e?.entree), 1), w("small", ur, I(e?.commune) + " — Programme " + I(e?.codeProgramme), 1)])]),
1947
1750
  _: 1
1948
1751
  }, 8, [
1949
1752
  "modelValue",
@@ -1953,7 +1756,7 @@ function zr(e, t, n, r, i, a) {
1953
1756
  "filtering-function",
1954
1757
  "disabled"
1955
1758
  ])]),
1956
- S("div", null, [t[12] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), w(s, {
1759
+ w("div", null, [t[12] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), E(s, {
1957
1760
  modelValue: a.selectedEtage,
1958
1761
  "onUpdate:modelValue": t[4] ||= (e) => a.selectedEtage = e,
1959
1762
  items: a.etages,
@@ -1970,25 +1773,25 @@ function zr(e, t, n, r, i, a) {
1970
1773
  "get-input-libelle",
1971
1774
  "disabled"
1972
1775
  ])])
1973
- ], 64)) : (O(), x(_, { key: 1 }, [
1974
- S("div", null, [t[13] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), S("input", {
1776
+ ], 64)) : (A(), C(y, { key: 1 }, [
1777
+ w("div", null, [t[13] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), w("input", {
1975
1778
  class: "form-control form-control-sm",
1976
1779
  disabled: "",
1977
1780
  value: n.patrimoine.commune ?? "—"
1978
- }, null, 8, Er)]),
1979
- S("div", null, [t[14] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), S("input", {
1781
+ }, null, 8, dr)]),
1782
+ w("div", null, [t[14] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), w("input", {
1980
1783
  class: "form-control form-control-sm",
1981
1784
  disabled: "",
1982
1785
  value: n.patrimoine.entree ?? "—"
1983
- }, null, 8, Dr)]),
1984
- S("div", null, [t[15] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), S("input", {
1786
+ }, null, 8, fr)]),
1787
+ w("div", null, [t[15] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), w("input", {
1985
1788
  class: "form-control form-control-sm",
1986
1789
  disabled: "",
1987
1790
  value: n.patrimoine.etage ?? "—"
1988
- }, null, 8, Or)])
1989
- ], 64))], 2), a.afficheModule ? (O(), x("div", kr, [
1990
- t[16] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Module", -1),
1991
- w(s, {
1791
+ }, null, 8, pr)])
1792
+ ], 64))], 2), a.afficheModule ? (A(), C("div", mr, [
1793
+ t[16] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Module", -1),
1794
+ E(s, {
1992
1795
  modelValue: a.selectedModule,
1993
1796
  "onUpdate:modelValue": t[5] ||= (e) => a.selectedModule = e,
1994
1797
  items: a.modules,
@@ -2000,20 +1803,20 @@ function zr(e, t, n, r, i, a) {
2000
1803
  "input-size": "sm",
2001
1804
  "hide-choices": ""
2002
1805
  }, {
2003
- options: L((e) => [S("div", { class: E(["min-w-0 w-100 rounded position-relative", e?._autreLibelle ? "bg-yellow-subtle p-2" : ""]) }, [
2004
- e?._autreLibelle ? (O(), y(o, {
1806
+ options: z((e) => [w("div", { class: O(["min-w-0 w-100 rounded position-relative", e?._autreLibelle ? "bg-yellow-subtle p-2" : ""]) }, [
1807
+ e?._autreLibelle ? (A(), x(o, {
2005
1808
  key: 0,
2006
1809
  icon: "building",
2007
1810
  class: "position-absolute top-0 end-0 m-1 text-muted",
2008
1811
  title: "Autre adresse ou étage du même programme"
2009
- })) : b("", !0),
2010
- S("div", { class: E(["fw-medium text-truncate", [e?._autreLibelle ? "text-muted" : "", a.isExit(e) ? "text-decoration-line-through" : ""]]) }, P(a.moduleLibelle(e)), 3),
2011
- S("div", Ar, [a.categorieLibelle(e) ? (O(), x("span", {
1812
+ })) : S("", !0),
1813
+ w("div", { class: O(["fw-medium text-truncate", [e?._autreLibelle ? "text-muted" : "", a.isExit(e) ? "text-decoration-line-through" : ""]]) }, I(a.moduleLibelle(e)), 3),
1814
+ w("div", hr, [a.categorieLibelle(e) ? (A(), C("span", {
2012
1815
  key: 0,
2013
1816
  class: "badge bg-info",
2014
1817
  title: e?.categorieModule
2015
- }, [w(o, { icon: a.getCategorieModuleIcon(e?.idCategorieModule, e?.estCollectif) }, null, 8, ["icon"])], 8, jr)) : b("", !0), S("small", Mr, "N° " + P(e?.idModule), 1)]),
2016
- e?._autreLibelle ? (O(), x("small", Nr, P(e._autreLibelle), 1)) : e?.etage == null ? b("", !0) : (O(), x("small", Pr, " Étage " + P(e.etage), 1))
1818
+ }, [E(o, { icon: a.getCategorieModuleIcon(e?.idCategorieModule, e?.estCollectif) }, null, 8, ["icon"])], 8, gr)) : S("", !0), w("small", _r, "N° " + I(e?.idModule), 1)]),
1819
+ e?._autreLibelle ? (A(), C("small", vr, I(e._autreLibelle), 1)) : e?.etage == null ? S("", !0) : (A(), C("small", yr, " Étage " + I(e.etage), 1))
2017
1820
  ], 2)]),
2018
1821
  _: 1
2019
1822
  }, 8, [
@@ -2024,42 +1827,51 @@ function zr(e, t, n, r, i, a) {
2024
1827
  "filtering-function",
2025
1828
  "disabled"
2026
1829
  ]),
2027
- n.locataireActuelOption ? (O(), x("div", Fr, [S("div", { class: E(["alert d-flex align-items-start gap-2 py-2 px-3 mt-2 mb-0 fs-7", n.locataireActuelOption.reprendre ? "alert-warning" : "alert-secondary border"]) }, [w(o, {
1830
+ n.locataireActuelOption ? (A(), C("div", br, [w("div", { class: O(["alert d-flex align-items-start gap-2 py-2 px-3 mt-2 mb-0 fs-7", n.locataireActuelOption.reprendre ? "alert-warning" : "alert-secondary border"]) }, [E(o, {
2028
1831
  icon: "circle-info",
2029
1832
  class: "mt-1"
2030
- }), S("span", null, P(n.locataireActuelOption.hint), 1)], 2), S("div", Ir, [S("input", {
1833
+ }), w("span", null, I(n.locataireActuelOption.hint), 1)], 2), w("div", xr, [w("input", {
2031
1834
  id: `locataire-actuel-${i.uid}`,
2032
1835
  class: "form-check-input",
2033
1836
  type: "checkbox",
2034
1837
  checked: n.locataireActuelOption.reprendre,
2035
1838
  onChange: t[6] ||= (t) => e.$emit("toggle-reprendre-locataire-actuel", t.target.checked)
2036
- }, null, 40, Lr), S("label", {
1839
+ }, null, 40, Sr), w("label", {
2037
1840
  class: "form-check-label fs-7",
2038
1841
  for: `locataire-actuel-${i.uid}`
2039
- }, " Rattacher au locataire actuel du module ", 8, Rr)])])) : b("", !0)
2040
- ])) : b("", !0)])) : b("", !0)
1842
+ }, " Rattacher au locataire actuel du module ", 8, Cr)])])) : S("", !0)
1843
+ ])) : S("", !0)])) : S("", !0)
2041
1844
  ]);
2042
1845
  }
2043
- // src/components/EtapeCibleBlock.vue
2044
- var Br = {
2045
- name: "EtapeCibleBlock",
1846
+ var Tr = /*#__PURE__*/ G(zn, [["render", wr]]), Er = 0, Dr = {
1847
+ name: "LigneCibleBlock",
2046
1848
  components: {
2047
- AmsomOverlay: g,
2048
- CiblePickerBlock: /* @__PURE__ */ K(er, [["render", zr]])
1849
+ AmsomOverlay: v,
1850
+ CiblePickerBlock: Tr
2049
1851
  },
1852
+ props: { index: {
1853
+ type: Number,
1854
+ required: !0
1855
+ } },
2050
1856
  setup() {
2051
1857
  return {
2052
- draft: G(),
1858
+ draft: W(),
2053
1859
  data: Z(),
2054
1860
  options: Q()
2055
1861
  };
2056
1862
  },
1863
+ data() {
1864
+ return { uid: ++Er };
1865
+ },
2057
1866
  computed: {
2058
- lignePrincipale() {
2059
- return this.draft.lignePrincipale;
1867
+ isPrincipale() {
1868
+ return this.index === 0;
2060
1869
  },
2061
- lignesAssociees() {
2062
- return this.draft.lignesAssociees;
1870
+ ligne() {
1871
+ return this.draft.draft.lignes[this.index];
1872
+ },
1873
+ cibleFigee() {
1874
+ return this.draft.isReadonly("cible");
2063
1875
  },
2064
1876
  reclamantModules() {
2065
1877
  return this.options.modulesReclamant ?? [];
@@ -2067,68 +1879,18 @@ var Br = {
2067
1879
  mainModule() {
2068
1880
  return this.draft.moduleReclamantPrincipal;
2069
1881
  },
2070
- cibleFigee() {
2071
- return this.draft.isReadonly("cible");
2072
- },
2073
- reclamantType() {
2074
- return this.draft.draft.reclamant.type;
2075
- },
2076
- motifLibelle() {
2077
- let e = this.lignePrincipale.idMotif;
2078
- return e == null ? null : this.data.motifLibelle(e);
2079
- }
2080
- },
2081
- async created() {
2082
- if (this.reclamantType === "D" || this.cibleFigee) return;
2083
- await this.data.loadCommunes(), !this.draft.reclamantEstContrat && this.lignePrincipale.cibleMode === "contrat" && this.draft.setCibleMode(0, "patrimoine");
2084
- let e = this.lignePrincipale.patrimoine;
2085
- await this.data.loadAdresses(e?.idCommune ?? null), this.lignePrincipale.cibleMode !== "contrat" && await this.data.loadModulesOfProgramme(e?.codeProgramme ?? null);
2086
- },
2087
- methods: {
2088
- pickerProps(e) {
1882
+ localisation() {
1883
+ let e = this.ligne?.patrimoine;
2089
1884
  return {
2090
- patrimoine: e.patrimoine,
2091
- cibleMode: e.cibleMode,
2092
- reclamantModules: this.reclamantModules,
2093
- reclamantType: this.reclamantType,
2094
- contratReclamant: e.contratReclamant,
2095
- contratCible: e.contratCible,
2096
- modulePrecis: e.modulePrecis,
2097
- afficheCaseContratReclamant: this.draft.reclamantEstContrat,
2098
- locataireActuelOption: this.locataireActuelOption(e)
1885
+ actif: !this.cibleFigee && !!e && this.ligne.cibleMode !== "demande",
1886
+ idCommune: e?.idCommune ?? null,
1887
+ codeProgramme: this.ligne?.cibleMode === "patrimoine" ? e?.codeProgramme ?? null : null
2099
1888
  };
2100
1889
  },
2101
- onChangeMode(e, t = 0) {
2102
- this.draft.setCibleMode(t, e), this.applyMode(e, t);
2103
- },
2104
- onSelectCommune(e, t = 0) {
2105
- this.draft.setPatrimoineCommune(t, e ?? null), e?.idCommune != null && this.data.loadAdresses(e.idCommune);
2106
- },
2107
- onSelectAdresse(e, t = 0) {
2108
- this.draft.setPatrimoineEntree(t, e ?? null), e?.codeProgramme != null && this.data.loadModulesOfProgramme(e.codeProgramme);
2109
- },
2110
- onSelectEtage(e, t = 0) {
2111
- this.draft.setPatrimoineEtage(t, e ?? null);
2112
- },
2113
- onSelectModule(e, t = 0) {
2114
- let n = this.draft.draft.lignes[t];
2115
- e && n?.cibleMode === "contrat" ? this.draft.prefillFromModule(t, e) : this.draft.setPatrimoineModule(t, e ?? null);
2116
- },
2117
- onToggleReprendre(e, t = 0) {
2118
- this.draft.setReprendreLocataireActuel(t, e);
2119
- },
2120
- onToggleContratReclamant(e, t = 0) {
2121
- this.draft.toggleContratReclamant(t, e), e && this.draft.prefillFromModule(t, this.mainModule);
2122
- },
2123
- onSelectContrat(e, t = 0) {
2124
- this.draft.setContratCible(t, e), e && this.data.loadModulesOfContrat({
2125
- idContrat: e.idContrat,
2126
- typeContrat: e.typeContrat
2127
- });
2128
- },
2129
- locataireActuelOption(e) {
1890
+ locataireActuelOption() {
1891
+ let e = this.ligne;
2130
1892
  if (e?.cibleMode !== "contrat") return null;
2131
- let t = e?.patrimoine;
1893
+ let t = e.patrimoine;
2132
1894
  if (!t || t.idModule == null) return null;
2133
1895
  let n = e.contratReclamant && this.draft.reclamantEstContrat, r = n ? {
2134
1896
  typeContrat: this.draft.draft.reclamant.type,
@@ -2146,101 +1908,722 @@ var Br = {
2146
1908
  reprendre: i,
2147
1909
  hint: a
2148
1910
  };
1911
+ }
1912
+ },
1913
+ watch: { localisation: {
1914
+ immediate: !0,
1915
+ deep: !0,
1916
+ handler({ actif: e, idCommune: t, codeProgramme: n }) {
1917
+ e && (this.data.loadCommunes(), this.data.loadAdresses(t), this.data.loadModulesOfProgramme(n));
1918
+ }
1919
+ } },
1920
+ created() {
1921
+ this.isPrincipale && !this.cibleFigee && !this.draft.reclamantEstContrat && this.ligne.cibleMode === "contrat" && this.draft.setCibleMode(0, "patrimoine");
1922
+ },
1923
+ methods: {
1924
+ onChangeMode(e) {
1925
+ this.draft.setCibleMode(this.index, e), e !== "demande" && this.draft.prefillFromModule(this.index, this.mainModule);
1926
+ },
1927
+ onSelectModule(e) {
1928
+ e && this.ligne.cibleMode === "contrat" ? this.draft.prefillFromModule(this.index, e) : this.draft.setPatrimoineModule(this.index, e ?? null);
2149
1929
  },
2150
- async applyMode(e, t = 0) {
2151
- e === "contrat" ? this.draft.prefillFromModule(t, this.mainModule) : this.mainModule && (this.draft.prefillFromModule(t, this.mainModule), this.mainModule.idCommune != null && await this.data.loadAdresses(this.mainModule.idCommune), this.mainModule.codeProgramme != null && await this.data.loadModulesOfProgramme(this.mainModule.codeProgramme));
1930
+ onToggleContratReclamant(e) {
1931
+ this.draft.toggleContratReclamant(this.index, e), e && this.draft.prefillFromModule(this.index, this.mainModule);
1932
+ },
1933
+ onSelectContrat(e) {
1934
+ this.draft.setContratCible(this.index, e), e && this.data.loadModulesOfContrat({
1935
+ idContrat: e.idContrat,
1936
+ typeContrat: e.typeContrat
1937
+ });
2152
1938
  }
2153
1939
  }
2154
- }, Vr = { class: "d-flex flex-column gap-3" }, Hr = {
1940
+ }, Or = {
2155
1941
  key: 0,
2156
- class: "alert alert-light border py-2 px-3 mb-0 d-flex align-items-center gap-2"
2157
- }, Ur = { class: "fs-7" }, Wr = {
2158
- key: 1,
2159
- class: "d-flex flex-column gap-1"
2160
- }, Gr = {
1942
+ class: "d-flex flex-wrap align-items-center gap-2"
1943
+ }, kr = { class: "fw-medium fs-7" }, Ar = {
1944
+ key: 0,
1945
+ class: "form-check form-switch mb-0"
1946
+ }, jr = ["id", "checked"], Mr = ["for"];
1947
+ function Nr(e, t, n, r, i, a) {
1948
+ let o = F("font-awesome-icon"), s = F("cible-picker-block"), c = F("amsom-overlay");
1949
+ return A(), C("div", { class: O({ "border rounded p-2": !a.isPrincipale }) }, [a.isPrincipale ? S("", !0) : (A(), C("div", Or, [w("span", kr, I(a.ligne.libelle), 1), a.cibleFigee ? S("", !0) : (A(), C("div", Ar, [w("input", {
1950
+ id: `memecible-${i.uid}`,
1951
+ class: "form-check-input",
1952
+ type: "checkbox",
1953
+ checked: !a.ligne.cibleOverride,
1954
+ onChange: t[0] ||= (e) => r.draft.toggleCibleOverride(n.index)
1955
+ }, null, 40, jr), w("label", {
1956
+ class: "form-check-label fs-7",
1957
+ for: `memecible-${i.uid}`
1958
+ }, " Même cible que la ligne principale ", 8, Mr)]))])), a.cibleFigee ? (A(), C("div", {
1959
+ key: 1,
1960
+ class: O(["fs-7", { "mt-1": !a.isPrincipale }])
1961
+ }, [E(o, {
1962
+ icon: "location-dot",
1963
+ class: "text-primary me-2"
1964
+ }), T(" " + I(r.draft.cibleResume(a.ligne)), 1)], 2)) : a.isPrincipale || a.ligne.cibleOverride ? (A(), x(c, {
1965
+ key: 2,
1966
+ loading: r.data.isLoading && !r.data.cache.communes?.length
1967
+ }, {
1968
+ default: z(() => [E(s, {
1969
+ class: O({ "mt-2": !a.isPrincipale }),
1970
+ patrimoine: a.ligne.patrimoine,
1971
+ "cible-mode": a.ligne.cibleMode,
1972
+ "reclamant-modules": a.reclamantModules,
1973
+ "reclamant-type": r.draft.draft.reclamant.type,
1974
+ "contrat-reclamant": a.ligne.contratReclamant,
1975
+ "contrat-cible": a.ligne.contratCible,
1976
+ "module-precis": a.ligne.modulePrecis,
1977
+ "affiche-case-contrat-reclamant": r.draft.reclamantEstContrat,
1978
+ "locataire-actuel-option": a.locataireActuelOption,
1979
+ onChangeMode: a.onChangeMode,
1980
+ onSelectCommune: t[1] ||= (e) => r.draft.setPatrimoineCommune(n.index, e ?? null),
1981
+ onSelectAdresse: t[2] ||= (e) => r.draft.setPatrimoineEntree(n.index, e ?? null),
1982
+ onSelectEtage: t[3] ||= (e) => r.draft.setPatrimoineEtage(n.index, e ?? null),
1983
+ onSelectModule: a.onSelectModule,
1984
+ onSelectContrat: a.onSelectContrat,
1985
+ onToggleContratReclamant: a.onToggleContratReclamant,
1986
+ onToggleReprendreLocataireActuel: t[4] ||= (e) => r.draft.setReprendreLocataireActuel(n.index, e),
1987
+ onSetModulePrecis: t[5] ||= (e) => r.draft.setModulePrecis(n.index, e)
1988
+ }, null, 8, [
1989
+ "class",
1990
+ "patrimoine",
1991
+ "cible-mode",
1992
+ "reclamant-modules",
1993
+ "reclamant-type",
1994
+ "contrat-reclamant",
1995
+ "contrat-cible",
1996
+ "module-precis",
1997
+ "affiche-case-contrat-reclamant",
1998
+ "locataire-actuel-option",
1999
+ "onChangeMode",
2000
+ "onSelectModule",
2001
+ "onSelectContrat",
2002
+ "onToggleContratReclamant"
2003
+ ])]),
2004
+ _: 1
2005
+ }, 8, ["loading"])) : S("", !0)], 2);
2006
+ }
2007
+ var Pr = /*#__PURE__*/ G(Dr, [["render", Nr]]), Fr = {
2008
+ name: "EtapeReclamantCibleBlock",
2009
+ components: {
2010
+ SectionComponent: rt,
2011
+ ProvenanceSelecteurBlock: $t,
2012
+ ReclamantRechercheBlock: wn,
2013
+ ReclamantSelecteurBlock: Pn,
2014
+ LigneCibleBlock: Pr
2015
+ },
2016
+ setup() {
2017
+ return {
2018
+ draft: W(),
2019
+ options: Q()
2020
+ };
2021
+ }
2022
+ }, Ir = { class: "d-flex flex-column gap-4" }, Lr = {
2023
+ key: 2,
2024
+ class: "row g-3"
2025
+ }, Rr = { class: "col-12 col-md-6" }, zr = { class: "col-12 col-md-6" };
2026
+ function Br(e, t, n, r, i, a) {
2027
+ let o = F("provenance-selecteur-block"), s = F("reclamant-recherche-block"), c = F("reclamant-selecteur-block"), l = F("section-component"), u = F("ligne-cible-block");
2028
+ return A(), C("div", Ir, [E(l, {
2029
+ titre: "Réclamant",
2030
+ aide: "La personne à l’origine de la sollicitation : locataire, tiers, fournisseur…"
2031
+ }, {
2032
+ default: z(() => [e.$slots.reclamant ? (A(), C(y, { key: 0 }, [E(o), P(e.$slots, "reclamant", {
2033
+ reclamant: r.draft.reclamantSelectionne,
2034
+ select: r.draft.selectReclamant
2035
+ })], 64)) : r.options.rechercheReclamant ? (A(), x(s, { key: 1 }, {
2036
+ "avant-categorie": z(() => [E(o)]),
2037
+ _: 1
2038
+ })) : (A(), C("div", Lr, [w("div", Rr, [E(o)]), w("div", zr, [E(c)])]))]),
2039
+ _: 3
2040
+ }), r.draft.reclamantSelectionne ? (A(), x(l, {
2041
+ key: 0,
2042
+ titre: "Cible",
2043
+ aide: r.draft.draft.reclamant.type === "D" ? "Une demande de logement se cible elle-même" : "Ce sur quoi porte la sollicitation : un contrat ou un élément du patrimoine"
2044
+ }, {
2045
+ default: z(() => [E(u, { index: 0 })]),
2046
+ _: 1
2047
+ }, 8, ["aide"])) : S("", !0)]);
2048
+ }
2049
+ var Vr = /*#__PURE__*/ G(Fr, [["render", Br]]), Hr = {
2050
+ name: "SeparateurComponent",
2051
+ props: { texte: {
2052
+ type: String,
2053
+ required: !0
2054
+ } }
2055
+ }, Ur = { class: "d-flex align-items-center gap-2 text-muted fs-7" };
2056
+ function Wr(e, t, n, r, i, a) {
2057
+ return A(), C("div", Ur, [
2058
+ t[0] ||= w("hr", { class: "flex-grow-1 my-0" }, null, -1),
2059
+ w("span", null, I(n.texte), 1),
2060
+ t[1] ||= w("hr", { class: "flex-grow-1 my-0" }, null, -1)
2061
+ ]);
2062
+ }
2063
+ var Gr = /*#__PURE__*/ G(Hr, [["render", Wr]]), Kr = {
2064
+ reclamant: {
2065
+ icon: "user",
2066
+ label: "Réclamant"
2067
+ },
2068
+ cible: {
2069
+ icon: "location-dot",
2070
+ label: "Cible"
2071
+ },
2072
+ motif: {
2073
+ icon: "tag",
2074
+ label: "Motif"
2075
+ }
2076
+ }, qr = {
2077
+ name: "RecapBlock",
2078
+ props: {
2079
+ index: {
2080
+ type: Number,
2081
+ default: 0
2082
+ },
2083
+ champs: {
2084
+ type: Array,
2085
+ default: () => [
2086
+ "reclamant",
2087
+ "cible",
2088
+ "motif"
2089
+ ],
2090
+ validator: (e) => e.every((e) => Kr[e])
2091
+ }
2092
+ },
2093
+ setup() {
2094
+ return {
2095
+ draft: W(),
2096
+ data: Z()
2097
+ };
2098
+ },
2099
+ computed: {
2100
+ ligne() {
2101
+ return this.draft.draft.lignes[this.index];
2102
+ },
2103
+ valeurs() {
2104
+ return {
2105
+ reclamant: this.reclamant,
2106
+ cible: this.ligne ? this.draft.cibleResume(this.ligne) : null,
2107
+ motif: this.motif
2108
+ };
2109
+ },
2110
+ reclamant() {
2111
+ let e = this.draft.reclamantSelectionne?.libelle;
2112
+ if (!e) return null;
2113
+ let t = this.data.cache.provenances?.find((e) => e.id === this.draft.draft.provenance)?.libelle;
2114
+ return t ? `${e} · via ${t}` : e;
2115
+ },
2116
+ motif() {
2117
+ let e = this.ligne;
2118
+ return e?.idMotif ? this.index > 0 ? e.libelle ?? this.data.motifLibelle(e.idMotif) : [
2119
+ this.data.categorieLibelle(e.idCategorie),
2120
+ this.data.typeLibelle(e.idType),
2121
+ this.data.natureLibelle(e.idNature),
2122
+ this.data.motifLibelle(e.idMotif)
2123
+ ].filter(Boolean).join(" › ") : null;
2124
+ },
2125
+ items() {
2126
+ return this.champs.map((e) => ({
2127
+ champ: e,
2128
+ ...Kr[e],
2129
+ valeur: this.valeurs[e]
2130
+ })).filter((e) => e.valeur);
2131
+ }
2132
+ }
2133
+ }, Jr = { class: "alert alert-light border py-2 px-3 mb-0 d-flex flex-column gap-1" }, Yr = { class: "text-muted text-uppercase fw-semibold text-nowrap" }, Xr = { class: "min-w-0" };
2134
+ function Zr(e, t, n, r, i, a) {
2135
+ let o = F("font-awesome-icon");
2136
+ return A(), C("div", Jr, [(A(!0), C(y, null, N(a.items, (e) => (A(), C("span", {
2137
+ key: e.champ,
2138
+ class: "fs-7 d-flex align-items-start gap-2"
2139
+ }, [
2140
+ E(o, {
2141
+ icon: e.icon,
2142
+ class: "text-primary mt-1",
2143
+ "fixed-width": ""
2144
+ }, null, 8, ["icon"]),
2145
+ w("span", Yr, I(e.label), 1),
2146
+ w("span", Xr, I(e.valeur), 1)
2147
+ ]))), 128))]);
2148
+ }
2149
+ var Qr = /*#__PURE__*/ G(qr, [["render", Zr]]), $r = {
2150
+ name: "MotifChaineComponent",
2151
+ props: {
2152
+ chaine: {
2153
+ type: Array,
2154
+ default: () => []
2155
+ },
2156
+ readonly: {
2157
+ type: Boolean,
2158
+ default: !1
2159
+ }
2160
+ },
2161
+ emits: ["retirer"]
2162
+ }, ei = { class: "d-flex flex-wrap align-items-center gap-2" }, ti = ["onClick"], ni = {
2163
+ key: 2,
2164
+ class: "badge rounded-pill bg-primary d-inline-flex align-items-center gap-2"
2165
+ };
2166
+ function ri(e, t, n, r, i, a) {
2167
+ let o = F("font-awesome-icon");
2168
+ return A(), C("div", ei, [(A(!0), C(y, null, N(n.chaine, (t, r) => (A(), C(y, { key: t.key }, [r > 0 ? (A(), x(o, {
2169
+ key: 0,
2170
+ icon: "chevron-right",
2171
+ class: "text-muted fs-7"
2172
+ })) : S("", !0), n.readonly ? (A(), C("span", ni, [t.icon ? (A(), x(o, {
2173
+ key: 0,
2174
+ icon: t.icon,
2175
+ "fixed-width": ""
2176
+ }, null, 8, ["icon"])) : S("", !0), T(" " + I(t.libelle), 1)])) : (A(), C("button", {
2177
+ key: 1,
2178
+ type: "button",
2179
+ class: "btn btn-sm btn-primary rounded-pill d-inline-flex align-items-center gap-2",
2180
+ onClick: (n) => e.$emit("retirer", t.key)
2181
+ }, [
2182
+ t.icon ? (A(), x(o, {
2183
+ key: 0,
2184
+ icon: t.icon,
2185
+ "fixed-width": ""
2186
+ }, null, 8, ["icon"])) : S("", !0),
2187
+ w("span", null, I(t.libelle), 1),
2188
+ E(o, {
2189
+ icon: "xmark",
2190
+ class: "fs-7 opacity-75"
2191
+ })
2192
+ ], 8, ti))], 64))), 128))]);
2193
+ }
2194
+ var ii = /*#__PURE__*/ G($r, [["render", ri]]), $ = [
2195
+ {
2196
+ key: "categorie",
2197
+ titre: "Catégorie",
2198
+ idKey: "idCategorie",
2199
+ libelleKey: "categorie"
2200
+ },
2201
+ {
2202
+ key: "type",
2203
+ titre: "Type",
2204
+ idKey: "idType",
2205
+ libelleKey: "type"
2206
+ },
2207
+ {
2208
+ key: "nature",
2209
+ titre: "Nature",
2210
+ idKey: "idNature",
2211
+ libelleKey: "nature"
2212
+ },
2213
+ {
2214
+ key: "motif",
2215
+ titre: "Motif",
2216
+ idKey: "idMotif",
2217
+ libelleKey: "libelle"
2218
+ }
2219
+ ], ai = (e) => e.filter((e) => e.selectedId != null).map((e) => {
2220
+ let t = e.options.find((t) => t.id === e.selectedId);
2221
+ return {
2222
+ key: e.key,
2223
+ libelle: t?.libelle ?? e.selectedId,
2224
+ icon: t?.icon ?? null
2225
+ };
2226
+ }), oi = {
2227
+ name: "MotifBubbleBlock",
2228
+ components: { MotifChaineComponent: ii },
2229
+ props: { niveaux: {
2230
+ type: Array,
2231
+ required: !0
2232
+ } },
2233
+ emits: ["choisir", "retirer"],
2234
+ computed: {
2235
+ chaine() {
2236
+ return ai(this.niveaux);
2237
+ },
2238
+ courant() {
2239
+ return this.niveaux.find((e) => e.selectedId == null) ?? null;
2240
+ }
2241
+ }
2242
+ }, si = { class: "d-flex flex-column gap-3" }, ci = { key: 1 }, li = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-2" }, ui = { class: "row justify-content-around g-3" }, di = ["title", "onClick"], fi = { class: "fs-7 mt-1 lh-sm" }, pi = {
2243
+ key: 0,
2244
+ class: "col-12 text-muted fs-7"
2245
+ };
2246
+ function mi(e, t, n, r, i, a) {
2247
+ let o = F("motif-chaine-component"), s = F("font-awesome-icon");
2248
+ return A(), C("div", si, [a.chaine.length ? (A(), x(o, {
2249
+ key: 0,
2250
+ chaine: a.chaine,
2251
+ onRetirer: t[0] ||= (t) => e.$emit("retirer", t)
2252
+ }, null, 8, ["chaine"])) : S("", !0), a.courant ? (A(), C("div", ci, [w("label", li, I(a.courant.titre), 1), w("div", ui, [(A(!0), C(y, null, N(a.courant.options, (t) => (A(), C("div", {
2253
+ key: t.id,
2254
+ class: "col-3 text-center"
2255
+ }, [w("button", {
2256
+ type: "button",
2257
+ class: "btn btn-lg btn-outline-primary btn-circle d-flex align-items-center justify-content-center mx-auto",
2258
+ title: t.libelle,
2259
+ onClick: (n) => e.$emit("choisir", {
2260
+ key: a.courant.key,
2261
+ id: t.id
2262
+ })
2263
+ }, [t.icon ? (A(), x(s, {
2264
+ key: 0,
2265
+ icon: t.icon,
2266
+ size: "lg"
2267
+ }, null, 8, ["icon"])) : S("", !0)], 8, di), w("div", fi, I(t.libelle), 1)]))), 128)), a.courant.options.length ? S("", !0) : (A(), C("div", pi, " Aucun choix disponible "))])])) : S("", !0)]);
2268
+ }
2269
+ var hi = /*#__PURE__*/ G(oi, [["render", mi]]), gi = {
2270
+ categorie: "une catégorie",
2271
+ type: "un type",
2272
+ nature: "une nature"
2273
+ }, _i = {
2274
+ name: "MotifColonnesBlock",
2275
+ props: { niveaux: {
2276
+ type: Array,
2277
+ required: !0
2278
+ } },
2279
+ emits: ["choisir"],
2280
+ methods: { article(e) {
2281
+ return gi[e.key] ?? e.titre.toLowerCase();
2282
+ } }
2283
+ }, vi = { class: "row g-0 border rounded overflow-hidden" }, yi = { class: "d-flex align-items-center justify-content-between bg-light border-bottom px-2 py-1" }, bi = { class: "fs-7 fw-semibold text-muted text-uppercase" }, xi = {
2284
+ key: 0,
2285
+ class: "badge bg-secondary"
2286
+ }, Si = {
2287
+ class: "list-group list-group-flush overflow-auto",
2288
+ style: { "max-height": "260px" }
2289
+ }, Ci = ["aria-pressed", "onClick"], wi = { class: "flex-grow-1 lh-sm text-start" }, Ti = {
2290
+ key: 0,
2291
+ class: "text-muted fst-italic p-2"
2292
+ };
2293
+ function Ei(e, t, n, r, i, a) {
2294
+ let o = F("font-awesome-icon");
2295
+ return A(), C("div", vi, [(A(!0), C(y, null, N(n.niveaux, (t, r) => (A(), C("div", {
2296
+ key: t.key,
2297
+ class: O(["col-6 col-md-3 d-flex flex-column", { "border-start": r > 0 }])
2298
+ }, [
2299
+ w("div", yi, [w("span", bi, I(t.titre), 1), t.options.length ? (A(), C("span", xi, I(t.options.length), 1)) : S("", !0)]),
2300
+ w("div", Si, [(A(!0), C(y, null, N(t.options, (i) => (A(), C("button", {
2301
+ key: i.id,
2302
+ type: "button",
2303
+ class: O(["list-group-item list-group-item-action d-flex align-items-center gap-2 fs-7 px-2 py-1", { active: i.id === t.selectedId }]),
2304
+ "aria-pressed": i.id === t.selectedId,
2305
+ onClick: (n) => e.$emit("choisir", {
2306
+ key: t.key,
2307
+ id: i.id
2308
+ })
2309
+ }, [
2310
+ i.icon ? (A(), x(o, {
2311
+ key: 0,
2312
+ icon: i.icon,
2313
+ "fixed-width": ""
2314
+ }, null, 8, ["icon"])) : S("", !0),
2315
+ w("span", wi, I(i.libelle), 1),
2316
+ r < n.niveaux.length - 1 ? (A(), x(o, {
2317
+ key: 1,
2318
+ icon: "chevron-right",
2319
+ class: "opacity-50"
2320
+ })) : i.id === t.selectedId ? (A(), x(o, {
2321
+ key: 2,
2322
+ icon: "check"
2323
+ })) : S("", !0)
2324
+ ], 10, Ci))), 128))]),
2325
+ t.options.length ? S("", !0) : (A(), C("small", Ti, I(r > 0 ? `← Choisir ${a.article(n.niveaux[r - 1])}` : "Aucun choix disponible"), 1))
2326
+ ], 2))), 128))]);
2327
+ }
2328
+ // src/components/EtapeMotifBlock.vue
2329
+ var Di = {
2330
+ name: "EtapeMotifBlock",
2331
+ components: {
2332
+ AmsomOverlay: v,
2333
+ AmsomAutocomplete: B,
2334
+ SectionComponent: rt,
2335
+ SeparateurComponent: Gr,
2336
+ RecapBlock: Qr,
2337
+ MotifChaineComponent: ii,
2338
+ MotifBubbleBlock: hi,
2339
+ MotifColonnesBlock: /* @__PURE__ */ G(_i, [["render", Ei]]),
2340
+ LigneCibleBlock: Pr
2341
+ },
2342
+ setup() {
2343
+ return {
2344
+ draft: W(),
2345
+ data: Z(),
2346
+ options: Q()
2347
+ };
2348
+ },
2349
+ data() {
2350
+ return { iconsReady: !1 };
2351
+ },
2352
+ computed: {
2353
+ mainLigne() {
2354
+ return this.draft.lignePrincipale;
2355
+ },
2356
+ lignesAssociees() {
2357
+ return this.draft.lignesAssociees;
2358
+ },
2359
+ motifFige() {
2360
+ return this.draft.isReadonly("motif");
2361
+ },
2362
+ activeMotifs() {
2363
+ return (this.data.cache.motifs ?? []).filter((e) => !e.estDesactive).slice().sort((e, t) => (e.categorie ?? "").localeCompare(t.categorie ?? "") || (e.type ?? "").localeCompare(t.type ?? "") || (e.nature ?? "").localeCompare(t.nature ?? "") || (e.libelle ?? "").localeCompare(t.libelle ?? ""));
2364
+ },
2365
+ allowedMotifs() {
2366
+ return this.activeMotifs.filter((e) => this.options.estMotifPropose(e));
2367
+ },
2368
+ motifBloque() {
2369
+ return this.options.motifNonProposeMode === "block" && !this.options.motifPrincipalPropose;
2370
+ },
2371
+ niveaux() {
2372
+ let e = {
2373
+ categorie: this.data.categorieIcon,
2374
+ type: this.data.typeIcon,
2375
+ nature: this.data.natureIcon
2376
+ }, t = this.allowedMotifs;
2377
+ return $.map((n, r) => {
2378
+ let i = $[r - 1], a = !i || this.mainLigne[i.idKey] != null ? t : [], o = n.key === "motif" ? a.map((e) => ({
2379
+ id: e.id,
2380
+ libelle: e.libelle,
2381
+ icon: e.icon
2382
+ })) : this.distinct(a, n.idKey, n.libelleKey, e[n.key]), s = this.mainLigne[n.idKey];
2383
+ return s != null && (t = t.filter((e) => e[n.idKey] === s)), {
2384
+ key: n.key,
2385
+ titre: n.titre,
2386
+ options: o,
2387
+ selectedId: s
2388
+ };
2389
+ });
2390
+ },
2391
+ chaine() {
2392
+ let e = this.mainLigne, t = {
2393
+ categorie: this.data.categorieLibelle,
2394
+ type: this.data.typeLibelle,
2395
+ nature: this.data.natureLibelle,
2396
+ motif: this.data.motifLibelle
2397
+ }, n = {
2398
+ categorie: this.data.categorieIcon,
2399
+ type: this.data.typeIcon,
2400
+ nature: this.data.natureIcon,
2401
+ motif: this.data.motifIcon
2402
+ };
2403
+ return ai($.map((r) => {
2404
+ let i = e[r.idKey];
2405
+ return {
2406
+ key: r.key,
2407
+ selectedId: i,
2408
+ options: i == null ? [] : [{
2409
+ id: i,
2410
+ libelle: t[r.key](i),
2411
+ icon: n[r.key](i)
2412
+ }]
2413
+ };
2414
+ }));
2415
+ },
2416
+ selectedMotif() {
2417
+ return this.mainLigne.idMotif ? this.activeMotifs.find((e) => e.id === this.mainLigne.idMotif) ?? null : null;
2418
+ },
2419
+ motifsAssocies() {
2420
+ let e = this.selectedMotif?.association;
2421
+ return e ? Object.entries(e).map(([e, t]) => ({
2422
+ libelle: e,
2423
+ idMotif: t
2424
+ })) : [];
2425
+ },
2426
+ motifRecherche: {
2427
+ get() {
2428
+ return this.selectedMotif;
2429
+ },
2430
+ set(e) {
2431
+ let t = e && typeof e == "object" ? e : e ? this.activeMotifs.find((t) => t.id === e) : null;
2432
+ t ? this.draft.selectMotifChain(t) : this.draft.setCategorie(null);
2433
+ }
2434
+ }
2435
+ },
2436
+ async created() {
2437
+ await this.data.loadNomenclature(), await this.registerIcons(), this.iconsReady = !0;
2438
+ },
2439
+ methods: {
2440
+ setNiveau(e, t) {
2441
+ ({
2442
+ categorie: this.draft.setCategorie,
2443
+ type: this.draft.setType,
2444
+ nature: this.draft.setNature,
2445
+ motif: this.draft.setMotif
2446
+ })[e](t);
2447
+ },
2448
+ choisir({ key: e, id: t }) {
2449
+ if (this.setNiveau(e, t), this.options.motifSelectionMode !== "columns") return;
2450
+ let n = $.findIndex((t) => t.key === e) + 1;
2451
+ for (; n < $.length;) {
2452
+ let e = this.niveaux[n];
2453
+ if (e.selectedId != null || e.options.length !== 1) break;
2454
+ this.setNiveau(e.key, e.options[0].id), n += 1;
2455
+ }
2456
+ },
2457
+ retirer(e) {
2458
+ this.setNiveau(e, null);
2459
+ },
2460
+ isActive(e) {
2461
+ return this.lignesAssociees.some((t) => t.idMotif === e);
2462
+ },
2463
+ toggleMotifAssocie(e) {
2464
+ let t = this.activeMotifs.find((t) => t.id === e.idMotif);
2465
+ this.draft.toggleLigneAssociee(e.idMotif, {
2466
+ libelle: e.libelle,
2467
+ idCategorie: t?.idCategorie ?? null,
2468
+ idType: t?.idType ?? null,
2469
+ idNature: t?.idNature ?? null
2470
+ });
2471
+ },
2472
+ registerIcons() {
2473
+ return at([
2474
+ ...this.data.cache.categories ?? [],
2475
+ ...this.data.cache.types ?? [],
2476
+ ...this.data.cache.natures ?? [],
2477
+ ...this.activeMotifs
2478
+ ].map((e) => e.icon));
2479
+ },
2480
+ filterMotifs({ search: e, items: t }) {
2481
+ let n = (K(e) ?? "").trim();
2482
+ if (!n) return t;
2483
+ let r = n.split(/\s+/);
2484
+ return t.filter((e) => {
2485
+ let t = K(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
2486
+ return r.every((e) => t.includes(e));
2487
+ });
2488
+ },
2489
+ distinct(e, t, n, r) {
2490
+ let i = /* @__PURE__ */ new Map();
2491
+ for (let a of e) a[t] != null && !i.has(a[t]) && i.set(a[t], {
2492
+ id: a[t],
2493
+ libelle: a[n] ?? a[t],
2494
+ icon: r ? r(a[t]) : null
2495
+ });
2496
+ return [...i.values()].sort((e, t) => (e.libelle ?? "").localeCompare(t.libelle ?? ""));
2497
+ },
2498
+ motifLibelleFromId(e) {
2499
+ return this.activeMotifs.find((t) => t.id === e)?.libelle ?? e;
2500
+ }
2501
+ }
2502
+ }, Oi = {
2503
+ key: 0,
2504
+ class: "d-flex flex-column gap-4"
2505
+ }, ki = {
2161
2506
  key: 0,
2162
- class: "text-muted me-1"
2163
- }, Kr = { class: "d-flex align-items-center gap-2" }, qr = { class: "fw-medium fs-7" }, Jr = { class: "form-check form-switch mb-0" }, Yr = [
2507
+ class: "alert alert-info d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
2508
+ }, Ai = {
2509
+ key: 1,
2510
+ class: "alert alert-warning d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
2511
+ }, ji = { class: "d-flex align-items-center gap-2" }, Mi = { class: "min-w-0" }, Ni = { class: "fw-medium text-truncate" }, Pi = { class: "text-muted d-block text-truncate" }, Fi = [
2164
2512
  "id",
2165
2513
  "checked",
2514
+ "disabled",
2166
2515
  "onChange"
2167
- ], Xr = ["for"], Zr = {
2516
+ ], Ii = ["for"], Li = {
2168
2517
  key: 0,
2169
- class: "mt-2"
2518
+ class: "alert alert-warning d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
2170
2519
  };
2171
- function Qr(e, t, n, r, i, a) {
2172
- let o = N("font-awesome-icon"), s = N("cible-picker-block"), c = N("amsom-overlay");
2173
- return O(), y(c, { loading: r.data.isLoading }, {
2174
- default: L(() => [S("div", Vr, [
2175
- a.motifLibelle ? (O(), x("div", Hr, [w(o, {
2176
- icon: "tag",
2177
- class: "text-primary"
2178
- }), S("span", Ur, [t[9] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1), C(P(a.motifLibelle), 1)])])) : b("", !0),
2179
- a.cibleFigee ? (O(), x("div", Wr, [(O(!0), x(_, null, j(r.draft.draft.lignes, (e, t) => (O(), x("span", {
2180
- key: t,
2181
- class: "fs-7"
2182
- }, [
2183
- w(o, {
2184
- icon: "location-dot",
2185
- class: "text-primary me-2"
2186
- }),
2187
- a.lignesAssociees.length ? (O(), x("span", Gr, P(t === 0 ? a.motifLibelle : e.libelle) + " : ", 1)) : b("", !0),
2188
- C(" " + P(r.draft.cibleResume(e)), 1)
2189
- ]))), 128))])) : (O(), y(s, pe({ key: 2 }, a.pickerProps(a.lignePrincipale), {
2190
- onChangeMode: t[0] ||= (e) => a.onChangeMode(e),
2191
- onSelectCommune: t[1] ||= (e) => a.onSelectCommune(e),
2192
- onSelectAdresse: t[2] ||= (e) => a.onSelectAdresse(e),
2193
- onSelectEtage: t[3] ||= (e) => a.onSelectEtage(e),
2194
- onSelectModule: t[4] ||= (e) => a.onSelectModule(e),
2195
- onSelectContrat: t[5] ||= (e) => a.onSelectContrat(e),
2196
- onToggleContratReclamant: t[6] ||= (e) => a.onToggleContratReclamant(e),
2197
- onToggleReprendreLocataireActuel: t[7] ||= (e) => a.onToggleReprendre(e),
2198
- onSetModulePrecis: t[8] ||= (e) => r.draft.setModulePrecis(0, e)
2199
- }), null, 16)),
2200
- !a.cibleFigee && a.lignesAssociees.length && a.reclamantType !== "D" ? (O(), x(_, { key: 3 }, [t[10] ||= S("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
2201
- S("hr", { class: "flex-grow-1 my-0" }),
2202
- S("span", null, "Cible des autres motifs"),
2203
- S("hr", { class: "flex-grow-1 my-0" })
2204
- ], -1), (O(!0), x(_, null, j(a.lignesAssociees, (e, t) => (O(), x("div", {
2205
- key: e.idMotif,
2206
- class: "border rounded p-2"
2207
- }, [S("div", Kr, [S("span", qr, P(e.libelle), 1), S("div", Jr, [S("input", {
2208
- id: `memecible-${e.idMotif}`,
2209
- class: "form-check-input",
2210
- type: "checkbox",
2211
- checked: !e.patrimoine,
2212
- onChange: (e) => r.draft.toggleCibleOverride(t + 1)
2213
- }, null, 40, Yr), S("label", {
2214
- class: "form-check-label fs-7",
2215
- for: `memecible-${e.idMotif}`
2216
- }, " Même cible que la ligne principale ", 8, Xr)])]), e.patrimoine ? (O(), x("div", Zr, [w(s, pe({ ref_for: !0 }, a.pickerProps(e), {
2217
- onChangeMode: (e) => a.onChangeMode(e, t + 1),
2218
- onSelectCommune: (e) => a.onSelectCommune(e, t + 1),
2219
- onSelectAdresse: (e) => a.onSelectAdresse(e, t + 1),
2220
- onSelectEtage: (e) => a.onSelectEtage(e, t + 1),
2221
- onSelectModule: (e) => a.onSelectModule(e, t + 1),
2222
- onSelectContrat: (e) => a.onSelectContrat(e, t + 1),
2223
- onToggleContratReclamant: (e) => a.onToggleContratReclamant(e, t + 1),
2224
- onToggleReprendreLocataireActuel: (e) => a.onToggleReprendre(e, t + 1),
2225
- onSetModulePrecis: (e) => r.draft.setModulePrecis(t + 1, e)
2226
- }), null, 16, [
2227
- "onChangeMode",
2228
- "onSelectCommune",
2229
- "onSelectAdresse",
2230
- "onSelectEtage",
2231
- "onSelectModule",
2232
- "onSelectContrat",
2233
- "onToggleContratReclamant",
2234
- "onToggleReprendreLocataireActuel",
2235
- "onSetModulePrecis"
2236
- ])])) : b("", !0)]))), 128))], 64)) : b("", !0)
2237
- ])]),
2520
+ function Ri(e, t, n, r, i, a) {
2521
+ let o = F("recap-block"), s = F("font-awesome-icon"), c = F("motif-chaine-component"), l = F("amsom-autocomplete"), u = F("separateur-component"), d = F("motif-colonnes-block"), f = F("motif-bubble-block"), p = F("section-component"), m = F("ligne-cible-block"), h = F("amsom-overlay");
2522
+ return A(), x(h, { loading: r.data.isLoading && !r.data.cache.motifs || !i.iconsReady }, {
2523
+ default: z(() => [i.iconsReady ? (A(), C("div", Oi, [
2524
+ E(o, { champs: ["reclamant", "cible"] }),
2525
+ E(p, { titre: "Motif" }, {
2526
+ default: z(() => [
2527
+ r.options.motifRetire ? (A(), C("div", ki, [E(s, {
2528
+ icon: "circle-info",
2529
+ class: "mt-1"
2530
+ }), w("span", null, [
2531
+ T(" Le motif « " + I(r.options.motifRetire.libelle) + " » a été retiré ", 1),
2532
+ r.options.motifRetire.associes.length ? (A(), C(y, { key: 0 }, [T(" avec ses motifs associés (" + I(r.options.motifRetire.associes.join(", ")) + ") ", 1)], 64)) : S("", !0),
2533
+ t[1] ||= T(" : il n’est pas proposé pour ce réclamant. ", -1)
2534
+ ])])) : S("", !0),
2535
+ a.motifBloque ? (A(), C("div", Ai, [E(s, {
2536
+ icon: "circle-exclamation",
2537
+ class: "mt-1"
2538
+ }), w("span", null, " Le motif « " + I(r.data.motifLibelle(a.mainLigne.idMotif)) + " » n’est pas proposé pour ce réclamant : choisissez-en un autre pour continuer. ", 1)])) : S("", !0),
2539
+ a.motifFige ? (A(), x(c, {
2540
+ key: 2,
2541
+ chaine: a.chaine,
2542
+ readonly: ""
2543
+ }, null, 8, ["chaine"])) : (A(), C(y, { key: 3 }, [
2544
+ w("div", null, [t[2] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, [T(" Rechercher un motif"), w("span", { class: "ms-1 text-danger" }, "*")], -1), E(l, {
2545
+ modelValue: a.motifRecherche,
2546
+ "onUpdate:modelValue": t[0] ||= (e) => a.motifRecherche = e,
2547
+ items: a.allowedMotifs,
2548
+ "get-id": (e) => e?.id ?? null,
2549
+ "get-input-libelle": (e) => e?.libelle ?? "",
2550
+ "get-input-libelle-from-id": a.motifLibelleFromId,
2551
+ "filtering-function": a.filterMotifs,
2552
+ placeholder: "Rechercher (motif, catégorie, type, nature)…",
2553
+ "input-size": "sm",
2554
+ "hide-choices": ""
2555
+ }, {
2556
+ options: z((e) => [w("div", ji, [e?.icon ? (A(), x(s, {
2557
+ key: 0,
2558
+ icon: e.icon,
2559
+ class: "text-primary",
2560
+ "fixed-width": ""
2561
+ }, null, 8, ["icon"])) : S("", !0), w("div", Mi, [w("div", Ni, I(e?.libelle), 1), w("small", Pi, I(e?.categorie) + " › " + I(e?.type) + " › " + I(e?.nature), 1)])])]),
2562
+ _: 1
2563
+ }, 8, [
2564
+ "modelValue",
2565
+ "items",
2566
+ "get-id",
2567
+ "get-input-libelle",
2568
+ "get-input-libelle-from-id",
2569
+ "filtering-function"
2570
+ ])]),
2571
+ E(u, { texte: "ou sélection guidée" }),
2572
+ r.options.motifSelectionMode === "columns" ? (A(), x(d, {
2573
+ key: 0,
2574
+ niveaux: a.niveaux,
2575
+ onChoisir: a.choisir
2576
+ }, null, 8, ["niveaux", "onChoisir"])) : (A(), x(f, {
2577
+ key: 1,
2578
+ niveaux: a.niveaux,
2579
+ onChoisir: a.choisir,
2580
+ onRetirer: a.retirer
2581
+ }, null, 8, [
2582
+ "niveaux",
2583
+ "onChoisir",
2584
+ "onRetirer"
2585
+ ]))
2586
+ ], 64))
2587
+ ]),
2588
+ _: 1
2589
+ }),
2590
+ a.motifsAssocies.length ? (A(), x(p, {
2591
+ key: 0,
2592
+ titre: "Motifs complémentaires"
2593
+ }, {
2594
+ default: z(() => [
2595
+ (A(!0), C(y, null, N(a.motifsAssocies, (e) => (A(), C("div", {
2596
+ key: e.idMotif,
2597
+ class: "form-check form-switch"
2598
+ }, [w("input", {
2599
+ id: `assoc-${e.idMotif}`,
2600
+ class: "form-check-input",
2601
+ type: "checkbox",
2602
+ checked: a.isActive(e.idMotif),
2603
+ disabled: a.motifFige,
2604
+ onChange: (t) => a.toggleMotifAssocie(e)
2605
+ }, null, 40, Fi), w("label", {
2606
+ class: "form-check-label fs-7",
2607
+ for: `assoc-${e.idMotif}`
2608
+ }, I(e.libelle) + " ? ", 9, Ii)]))), 128)),
2609
+ r.draft.ciblesAssocieesReinitialisees && r.draft.draft.reclamant.type !== "D" ? (A(), C("div", Li, [E(s, {
2610
+ icon: "circle-exclamation",
2611
+ class: "mt-1"
2612
+ }), w("span", null, " Le réclamant a changé : " + I(r.draft.ciblesAssocieesReinitialisees > 1 ? `${r.draft.ciblesAssocieesReinitialisees} motifs associés reprennent` : "un motif associé reprend") + " la cible de la ligne principale. Vérifiez-la ci-dessous si elle doit être différente. ", 1)])) : S("", !0),
2613
+ a.lignesAssociees.length && r.draft.draft.reclamant.type !== "D" ? (A(), C(y, { key: 1 }, [E(u, { texte: "Cible des autres motifs" }), (A(!0), C(y, null, N(a.lignesAssociees, (e, t) => (A(), x(m, {
2614
+ key: e.idMotif,
2615
+ index: t + 1
2616
+ }, null, 8, ["index"]))), 128))], 64)) : S("", !0)
2617
+ ]),
2618
+ _: 1
2619
+ })) : S("", !0)
2620
+ ])) : S("", !0)]),
2238
2621
  _: 1
2239
2622
  }, 8, ["loading"]);
2240
2623
  }
2241
- var $r = /*#__PURE__*/ K(Br, [["render", Qr]]), ei = {
2624
+ var zi = /*#__PURE__*/ G(Di, [["render", Ri]]), Bi = {
2242
2625
  name: "LigneDocumentBlock",
2243
- components: { AmsomUploadFile: Se },
2626
+ components: { AmsomUploadFile: xe },
2244
2627
  props: {
2245
2628
  index: {
2246
2629
  type: Number,
@@ -2257,9 +2640,9 @@ var $r = /*#__PURE__*/ K(Br, [["render", Qr]]), ei = {
2257
2640
  },
2258
2641
  emits: ["update"]
2259
2642
  };
2260
- function ti(e, t, n, r, i, a) {
2261
- let o = N("amsom-upload-file");
2262
- return O(), x("div", null, [t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Document", -1), w(o, {
2643
+ function Vi(e, t, n, r, i, a) {
2644
+ let o = F("amsom-upload-file");
2645
+ return A(), C("div", null, [t[1] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Document", -1), E(o, {
2263
2646
  "model-value": n.fichier,
2264
2647
  renameable: "",
2265
2648
  "output-format": "object",
@@ -2273,12 +2656,12 @@ function ti(e, t, n, r, i, a) {
2273
2656
  "read-only"
2274
2657
  ])]);
2275
2658
  }
2276
- var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
2659
+ var Hi = /*#__PURE__*/ G(Bi, [["render", Vi]]), Ui = 4e3, Wi = {
2277
2660
  name: "LigneDetailBlock",
2278
2661
  components: {
2279
- AmsomAutocomplete: R,
2280
- AmsomTextarea: xe,
2281
- LigneDocumentBlock: ni
2662
+ AmsomAutocomplete: B,
2663
+ AmsomTextarea: be,
2664
+ LigneDocumentBlock: Hi
2282
2665
  },
2283
2666
  props: { index: {
2284
2667
  type: Number,
@@ -2286,12 +2669,12 @@ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
2286
2669
  } },
2287
2670
  setup() {
2288
2671
  return {
2289
- draft: G(),
2672
+ draft: W(),
2290
2673
  data: Z()
2291
2674
  };
2292
2675
  },
2293
2676
  computed: {
2294
- descriptionMaxLength: () => ri,
2677
+ descriptionMaxLength: () => Ui,
2295
2678
  isPrincipale() {
2296
2679
  return this.index === 0;
2297
2680
  },
@@ -2312,64 +2695,54 @@ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
2312
2695
  this.isPrincipale && this.$refs.description?.$el.querySelector("textarea")?.focus();
2313
2696
  },
2314
2697
  methods: {
2315
- timestampToDateInput: Mt,
2316
- dateInputToTimestamp: Nt,
2698
+ timestampToDateInput: en,
2699
+ dateInputToTimestamp: tn,
2317
2700
  responsableLibelle(e) {
2318
2701
  let t = e && typeof e != "object" ? this.collaborateurs.find((t) => String(t.id) === String(e)) : e;
2319
2702
  return t ? `${t.prenom} ${t.nom}` : "";
2320
2703
  },
2321
2704
  filterCollaborateurs({ search: e, items: t }) {
2322
- let n = ($(e) ?? "").trim();
2323
- return n ? t.filter((e) => ($(`${e.prenom} ${e.nom} ${e.service}`) ?? "").includes(n)) : t;
2705
+ let n = (K(e) ?? "").trim();
2706
+ return n ? t.filter((e) => (K(`${e.prenom} ${e.nom} ${e.service}`) ?? "").includes(n)) : t;
2324
2707
  }
2325
2708
  }
2326
- }, ai = { class: "d-flex flex-column gap-2" }, oi = { class: "d-flex align-items-center gap-2 mb-1" }, si = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, ci = {
2709
+ }, Gi = { class: "d-flex flex-column gap-2" }, Ki = { class: "d-flex align-items-center gap-2 mb-1" }, qi = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, Ji = {
2327
2710
  key: 0,
2328
2711
  class: "ms-1 text-danger"
2329
- }, li = {
2712
+ }, Yi = {
2330
2713
  key: 0,
2331
2714
  class: "form-check form-switch mb-0"
2332
- }, ui = [
2715
+ }, Xi = [
2333
2716
  "id",
2334
2717
  "checked",
2335
2718
  "disabled"
2336
- ], di = ["for"], fi = {
2337
- key: 1,
2338
- class: "text-muted d-block",
2339
- style: { "white-space": "pre-line" }
2340
- }, pi = { class: "row g-3" }, mi = { class: "col-6" }, hi = { class: "d-flex align-items-center gap-2 mb-1" }, gi = {
2719
+ ], Zi = ["for"], Qi = ["rows", "value"], $i = { class: "row g-3" }, ea = { class: "col-6" }, ta = { class: "d-flex align-items-center gap-2 mb-1" }, na = {
2341
2720
  key: 0,
2342
2721
  class: "form-check form-switch mb-0"
2343
- }, _i = [
2722
+ }, ra = [
2344
2723
  "id",
2345
2724
  "checked",
2346
2725
  "disabled"
2347
- ], vi = ["for"], yi = ["value"], bi = {
2348
- key: 1,
2349
- class: "text-muted d-block"
2350
- }, xi = {
2726
+ ], ia = ["for"], aa = ["value"], oa = ["value"], sa = ["value"], ca = { class: "min-w-0" }, la = { class: "fw-medium text-truncate" }, ua = {
2351
2727
  key: 0,
2352
2728
  class: "text-muted d-block"
2353
- }, Si = { class: "min-w-0" }, Ci = { class: "fw-medium text-truncate" }, wi = {
2354
- key: 0,
2355
- class: "text-muted d-block"
2356
- }, Ti = {
2729
+ }, da = {
2357
2730
  key: 2,
2358
2731
  class: "text-muted"
2359
- }, Ei = { class: "col-12 col-md-6" };
2360
- function Di(e, t, n, r, i, a) {
2361
- let o = N("amsom-textarea"), s = N("amsom-autocomplete"), c = N("ligne-document-block");
2362
- return O(), x("div", ai, [S("div", null, [S("div", oi, [S("label", si, [t[6] ||= C(" Description", -1), a.isPrincipale ? (O(), x("span", ci, "*")) : b("", !0)]), a.isPrincipale ? b("", !0) : (O(), x("div", li, [S("input", {
2732
+ }, fa = { class: "col-12 col-md-6" };
2733
+ function pa(e, t, n, r, i, a) {
2734
+ let o = F("amsom-textarea"), s = F("amsom-autocomplete"), c = F("ligne-document-block");
2735
+ return A(), C("div", Gi, [w("div", null, [w("div", Ki, [w("label", qi, [t[6] ||= T(" Description", -1), a.isPrincipale ? (A(), C("span", Ji, "*")) : S("", !0)]), a.isPrincipale ? S("", !0) : (A(), C("div", Yi, [w("input", {
2363
2736
  id: `memedetail-${a.ligne.idMotif}`,
2364
2737
  class: "form-check-input",
2365
2738
  type: "checkbox",
2366
2739
  checked: a.ligne.description == null,
2367
2740
  disabled: r.draft.isReadonly("description"),
2368
2741
  onChange: t[0] ||= (e) => r.draft.toggleDescriptionOverride(n.index)
2369
- }, null, 40, ui), S("label", {
2742
+ }, null, 40, Xi), w("label", {
2370
2743
  class: "form-check-label fs-7",
2371
2744
  for: `memedetail-${a.ligne.idMotif}`
2372
- }, " Même description ", 8, di)]))]), !r.draft.isReadonly("description") && (a.isPrincipale || a.ligne.description != null) ? (O(), y(o, {
2745
+ }, " Même description ", 8, Zi)]))]), !r.draft.isReadonly("description") && (a.isPrincipale || a.ligne.description != null) ? (A(), x(o, {
2373
2746
  key: 0,
2374
2747
  ref: "description",
2375
2748
  "model-value": a.ligne.description,
@@ -2383,25 +2756,42 @@ function Di(e, t, n, r, i, a) {
2383
2756
  "rows",
2384
2757
  "maxlength",
2385
2758
  "placeholder"
2386
- ])) : (O(), x("small", fi, P((a.ligne.description ?? a.lignePrincipale.description) || "—"), 1))]), S("div", pi, [S("div", mi, [S("div", null, [S("div", hi, [t[7] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, " Date des faits ", -1), a.isPrincipale ? b("", !0) : (O(), x("div", gi, [S("input", {
2759
+ ])) : (A(), C("textarea", {
2760
+ key: 1,
2761
+ class: "form-control form-control-sm",
2762
+ disabled: "",
2763
+ rows: a.isPrincipale ? 7 : 5,
2764
+ value: (a.ligne.description ?? a.lignePrincipale.description) || ""
2765
+ }, null, 8, Qi))]), w("div", $i, [w("div", ea, [w("div", null, [w("div", ta, [t[7] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, " Date des faits ", -1), a.isPrincipale ? S("", !0) : (A(), C("div", na, [w("input", {
2387
2766
  id: `memedate-${a.ligne.idMotif}`,
2388
2767
  class: "form-check-input",
2389
2768
  type: "checkbox",
2390
2769
  checked: !a.ligne.dateFaitsOverride,
2391
2770
  disabled: r.draft.isReadonly("dateFaits"),
2392
2771
  onChange: t[2] ||= (e) => r.draft.toggleDateFaitsOverride(n.index)
2393
- }, null, 40, _i), S("label", {
2772
+ }, null, 40, ra), w("label", {
2394
2773
  class: "form-check-label fs-7",
2395
2774
  for: `memedate-${a.ligne.idMotif}`
2396
- }, " Même date ", 8, vi)]))]), !r.draft.isReadonly("dateFaits") && (a.isPrincipale || a.ligne.dateFaitsOverride) ? (O(), x("input", {
2775
+ }, " Même date ", 8, ia)]))]), !r.draft.isReadonly("dateFaits") && (a.isPrincipale || a.ligne.dateFaitsOverride) ? (A(), C("input", {
2397
2776
  key: 0,
2398
2777
  value: a.timestampToDateInput(a.ligne.dateFaits),
2399
2778
  type: "date",
2400
2779
  class: "form-control form-control-sm",
2401
2780
  onInput: t[3] ||= (e) => r.draft.setDateFaits(n.index, a.dateInputToTimestamp(e.target.value))
2402
- }, null, 40, yi)) : (O(), x("small", bi, P(a.timestampToDateInput(a.dateFaits) || "—"), 1))]), S("div", null, [
2403
- t[8] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Responsable ", -1),
2404
- r.draft.isReadonly("responsable") ? (O(), x("small", xi, P(a.responsableLibelle(a.ligne.responsable) || "Déterminé automatiquement"), 1)) : (O(), y(s, {
2781
+ }, null, 40, aa)) : (A(), C("input", {
2782
+ key: 1,
2783
+ value: a.timestampToDateInput(a.dateFaits),
2784
+ type: "date",
2785
+ class: "form-control form-control-sm",
2786
+ disabled: ""
2787
+ }, null, 8, oa))]), w("div", null, [
2788
+ t[8] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Responsable ", -1),
2789
+ r.draft.isReadonly("responsable") ? (A(), C("input", {
2790
+ key: 0,
2791
+ class: "form-control form-control-sm",
2792
+ disabled: "",
2793
+ value: a.responsableLibelle(a.ligne.responsable) || "Déterminé automatiquement"
2794
+ }, null, 8, sa)) : (A(), x(s, {
2405
2795
  key: 1,
2406
2796
  "model-value": a.ligne.responsable,
2407
2797
  items: a.collaborateurs,
@@ -2413,7 +2803,7 @@ function Di(e, t, n, r, i, a) {
2413
2803
  "hide-choices": "",
2414
2804
  "onUpdate:modelValue": t[4] ||= (e) => r.draft.setResponsable(n.index, e ?? null)
2415
2805
  }, {
2416
- options: L((e) => [S("div", Si, [S("div", Ci, P(e?.prenom) + " " + P(e?.nom), 1), e?.service ? (O(), x("small", wi, P(e.service), 1)) : b("", !0)])]),
2806
+ options: z((e) => [w("div", ca, [w("div", la, I(e?.prenom) + " " + I(e?.nom), 1), e?.service ? (A(), C("small", ua, I(e.service), 1)) : S("", !0)])]),
2417
2807
  _: 1
2418
2808
  }, 8, [
2419
2809
  "model-value",
@@ -2422,8 +2812,8 @@ function Di(e, t, n, r, i, a) {
2422
2812
  "get-input-libelle",
2423
2813
  "filtering-function"
2424
2814
  ])),
2425
- a.isPrincipale && !a.ligne.responsable && !r.draft.isReadonly("responsable") ? (O(), x("small", Ti, " Aucun paramétrage trouvé : le responsable sera déterminé automatiquement. ")) : b("", !0)
2426
- ])]), S("div", Ei, [w(c, {
2815
+ a.isPrincipale && !a.ligne.responsable && !r.draft.isReadonly("responsable") ? (A(), C("small", da, " Aucun paramétrage trouvé : le responsable sera déterminé automatiquement. ")) : S("", !0)
2816
+ ])]), w("div", fa, [E(c, {
2427
2817
  index: n.index,
2428
2818
  fichier: a.ligne.fichier,
2429
2819
  readonly: r.draft.isReadonly("fichier"),
@@ -2435,15 +2825,17 @@ function Di(e, t, n, r, i, a) {
2435
2825
  ])])])]);
2436
2826
  }
2437
2827
  // src/components/EtapeDetailsBlock.vue
2438
- var Oi = {
2828
+ var ma = {
2439
2829
  name: "EtapeDetailsBlock",
2440
2830
  components: {
2441
- AmsomOverlay: g,
2442
- LigneDetailBlock: /* @__PURE__ */ K(ii, [["render", Di]])
2831
+ AmsomOverlay: v,
2832
+ LigneDetailBlock: /* @__PURE__ */ G(Wi, [["render", pa]]),
2833
+ RecapBlock: Qr,
2834
+ SectionComponent: rt
2443
2835
  },
2444
2836
  setup() {
2445
2837
  return {
2446
- draft: G(),
2838
+ draft: W(),
2447
2839
  data: Z()
2448
2840
  };
2449
2841
  },
@@ -2456,10 +2848,6 @@ var Oi = {
2456
2848
  },
2457
2849
  collaborateurs() {
2458
2850
  return (this.data.cache.collaborateurs ?? []).filter((e) => e.actif !== !1);
2459
- },
2460
- motifLibelle() {
2461
- let e = this.lignePrincipale.idMotif;
2462
- return e == null ? null : this.data.motifLibelle(e);
2463
2851
  }
2464
2852
  },
2465
2853
  async created() {
@@ -2495,66 +2883,61 @@ var Oi = {
2495
2883
  }
2496
2884
  }
2497
2885
  }
2498
- }, ki = { class: "d-flex flex-column gap-3" }, Ai = { class: "alert alert-light border py-2 px-3 mb-0 d-flex flex-column gap-1" }, ji = {
2499
- key: 0,
2500
- class: "fs-7"
2501
- }, Mi = { class: "fs-7" }, Ni = { class: "bg-light rounded px-2 py-1 d-flex flex-column gap-1" }, Pi = { class: "fs-7" }, Fi = { class: "fs-7" };
2502
- function Ii(e, t, n, r, i, a) {
2503
- let o = N("font-awesome-icon"), s = N("ligne-detail-block"), c = N("amsom-overlay");
2504
- return O(), y(c, { loading: r.data.isLoading && !r.data.cache.collaborateurs }, {
2505
- default: L(() => [S("div", ki, [
2506
- S("div", Ai, [a.motifLibelle ? (O(), x("span", ji, [
2507
- w(o, {
2508
- icon: "tag",
2509
- class: "text-primary me-2"
2510
- }),
2511
- t[0] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
2512
- C(P(a.motifLibelle), 1)
2513
- ])) : b("", !0), S("span", Mi, [
2514
- w(o, {
2515
- icon: "location-dot",
2516
- class: "text-primary me-2"
2517
- }),
2518
- t[1] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Cible", -1),
2519
- C(" " + P(r.draft.cibleResume(a.lignePrincipale)), 1)
2520
- ])]),
2521
- w(s, { index: 0 }),
2522
- a.lignesAssociees.length ? (O(), x(_, { key: 0 }, [t[4] ||= S("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
2523
- S("hr", { class: "flex-grow-1 my-0" }),
2524
- S("span", null, "Détail des autres motifs"),
2525
- S("hr", { class: "flex-grow-1 my-0" })
2526
- ], -1), (O(!0), x(_, null, j(a.lignesAssociees, (e, n) => (O(), x("div", {
2527
- key: e.idMotif,
2528
- class: "border rounded p-2 d-flex flex-column gap-2"
2529
- }, [S("div", Ni, [S("span", Pi, [
2530
- w(o, {
2531
- icon: "tag",
2532
- class: "text-primary me-2"
2533
- }),
2534
- t[2] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
2535
- C(" " + P(e.libelle), 1)
2536
- ]), S("span", Fi, [
2537
- w(o, {
2538
- icon: "location-dot",
2539
- class: "text-primary me-2"
2540
- }),
2541
- t[3] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Cible", -1),
2542
- C(" " + P(r.draft.cibleResume(e)), 1)
2543
- ])]), w(s, { index: n + 1 }, null, 8, ["index"])]))), 128))], 64)) : b("", !0)
2886
+ }, ha = { class: "d-flex flex-column gap-4" }, ga = { class: "text-muted d-flex align-items-start gap-2" };
2887
+ function _a(e, t, n, r, i, a) {
2888
+ let o = F("recap-block"), s = F("font-awesome-icon"), c = F("ligne-detail-block"), l = F("section-component"), u = F("amsom-overlay");
2889
+ return A(), x(u, { loading: r.data.isLoading && !r.data.cache.collaborateurs }, {
2890
+ default: z(() => [w("div", ha, [
2891
+ E(o),
2892
+ w("small", ga, [E(s, {
2893
+ icon: "circle-info",
2894
+ class: "mt-1"
2895
+ }), t[0] ||= T(" Rappel RGPD : ne saisissez que les informations nécessaires au traitement de la sollicitation, aucune donnée sensible (santé, opinions, situation judiciaire…) ni appréciation personnelle sur le réclamant. ", -1)]),
2896
+ E(l, { titre: a.lignesAssociees.length ? "Motif principal" : "Détails" }, {
2897
+ default: z(() => [E(c, { index: 0 })]),
2898
+ _: 1
2899
+ }, 8, ["titre"]),
2900
+ a.lignesAssociees.length ? (A(), x(l, {
2901
+ key: 0,
2902
+ titre: "Détail des autres motifs"
2903
+ }, {
2904
+ default: z(() => [(A(!0), C(y, null, N(a.lignesAssociees, (e, t) => (A(), C("div", {
2905
+ key: e.idMotif,
2906
+ class: "border rounded p-2 d-flex flex-column gap-2"
2907
+ }, [E(o, {
2908
+ index: t + 1,
2909
+ champs: ["motif", "cible"]
2910
+ }, null, 8, ["index"]), E(c, { index: t + 1 }, null, 8, ["index"])]))), 128))]),
2911
+ _: 1
2912
+ })) : S("", !0)
2544
2913
  ])]),
2545
2914
  _: 1
2546
2915
  }, 8, ["loading"]);
2547
2916
  }
2548
- // src/components/StepperBlock.vue
2549
- var Li = {
2917
+ var va = /*#__PURE__*/ G(ma, [["render", _a]]), ya = [
2918
+ {
2919
+ key: "reclamantCible",
2920
+ label: "Réclamant et cible",
2921
+ icon: "user"
2922
+ },
2923
+ {
2924
+ key: "motif",
2925
+ label: "Motif",
2926
+ icon: "tag"
2927
+ },
2928
+ {
2929
+ key: "details",
2930
+ label: "Détails",
2931
+ icon: "info"
2932
+ }
2933
+ ], ba = {
2550
2934
  name: "StepperBlock",
2551
2935
  components: {
2552
- AmsomHorizontalStepper: ye,
2553
- AmsomOverlay: g,
2554
- EtapeReclamantBlock: vn,
2555
- EtapeCategorieBlock: Yn,
2556
- EtapeCibleBlock: $r,
2557
- EtapeDetailsBlock: /* @__PURE__ */ K(Oi, [["render", Ii]])
2936
+ AmsomHorizontalStepper: _e,
2937
+ AmsomOverlay: v,
2938
+ EtapeReclamantCibleBlock: Vr,
2939
+ EtapeMotifBlock: zi,
2940
+ EtapeDetailsBlock: va
2558
2941
  },
2559
2942
  props: {
2560
2943
  step: {
@@ -2573,36 +2956,13 @@ var Li = {
2573
2956
  ],
2574
2957
  setup() {
2575
2958
  return {
2576
- draft: G(),
2959
+ draft: W(),
2577
2960
  data: Z(),
2578
2961
  options: Q()
2579
2962
  };
2580
2963
  },
2581
2964
  computed: {
2582
- steps() {
2583
- return [
2584
- ...this.options.reclamantMode === "step" ? [{
2585
- key: "reclamant",
2586
- label: "Réclamant",
2587
- icon: "user"
2588
- }] : [],
2589
- {
2590
- key: "categorie",
2591
- label: "Catégorisation",
2592
- icon: "tag"
2593
- },
2594
- {
2595
- key: "cible",
2596
- label: "Cible",
2597
- icon: "location-dot"
2598
- },
2599
- {
2600
- key: "details",
2601
- label: "Détails",
2602
- icon: "info"
2603
- }
2604
- ];
2605
- },
2965
+ steps: () => ya,
2606
2966
  currentKey() {
2607
2967
  return this.steps[this.step - 1]?.key ?? null;
2608
2968
  },
@@ -2616,11 +2976,14 @@ var Li = {
2616
2976
  provenanceValid() {
2617
2977
  return this.options.provenances.some((e) => e.id === this.draft.draft.provenance);
2618
2978
  },
2979
+ motifPropose() {
2980
+ return this.options.motifNonProposeMode !== "block" || this.options.motifPrincipalPropose;
2981
+ },
2619
2982
  canGoNext() {
2620
2983
  return this.gatePassed(this.currentKey);
2621
2984
  },
2622
2985
  canCreer() {
2623
- return !!this.lignePrincipale.idMotif && this.provenanceValid && this.draft.ciblesValid && this.draft.detailsValid && this.draft.reclamantSelectionne != null;
2986
+ return !!this.lignePrincipale.idMotif && this.motifPropose && this.provenanceValid && this.draft.ciblesValid && this.draft.detailsValid && this.draft.reclamantSelectionne != null;
2624
2987
  },
2625
2988
  stepperSteps() {
2626
2989
  return this.steps.map((e, t) => {
@@ -2649,7 +3012,7 @@ var Li = {
2649
3012
  } },
2650
3013
  methods: {
2651
3014
  gatePassed(e) {
2652
- return e === "reclamant" ? this.draft.reclamantSelectionne != null && this.provenanceValid : e === "categorie" ? !!this.lignePrincipale.idMotif && this.provenanceValid : e !== "cible" || this.draft.ciblesValid;
3015
+ return e === "reclamantCible" ? this.draft.reclamantSelectionne != null && this.provenanceValid && this.draft.ligneCibleValid(0) : e !== "motif" || !!this.lignePrincipale.idMotif && this.motifPropose && this.draft.ciblesValid;
2653
3016
  },
2654
3017
  onStepClick(e) {
2655
3018
  e < this.step && this.$emit("update:step", e);
@@ -2658,7 +3021,7 @@ var Li = {
2658
3021
  this.step > 1 && this.$emit("update:step", this.step - 1);
2659
3022
  },
2660
3023
  goNext() {
2661
- this.step >= this.steps.length || !this.canGoNext || (this.currentKey === "categorie" && this.preloadResponsables(), this.$emit("update:step", this.step + 1));
3024
+ this.step >= this.steps.length || !this.canGoNext || (this.currentKey === "motif" && this.preloadResponsables(), this.$emit("update:step", this.step + 1));
2662
3025
  },
2663
3026
  preloadResponsables() {
2664
3027
  this.draft.draft.lignes.forEach((e) => this.data.loadResponsables({
@@ -2669,73 +3032,67 @@ var Li = {
2669
3032
  }));
2670
3033
  }
2671
3034
  }
2672
- }, Ri = { class: "d-flex flex-column gap-3" }, zi = {
3035
+ }, xa = { class: "d-flex flex-column gap-3" }, Sa = {
2673
3036
  key: 0,
2674
3037
  class: "w-100 fs-6 fw-medium my-3 alert alert-info",
2675
3038
  style: { "white-space": "pre-line" }
2676
- }, Bi = { style: { "min-height": "260px" } }, Vi = { class: "d-flex justify-content-between" }, Hi = { key: 1 }, Ui = ["disabled"], Wi = ["disabled"];
2677
- function Gi(e, t, n, r, i, a) {
2678
- let o = N("amsom-horizontal-stepper"), s = N("font-awesome-icon"), c = N("etape-reclamant-block"), l = N("etape-categorie-block"), u = N("etape-cible-block"), d = N("etape-details-block"), f = N("amsom-overlay");
2679
- return O(), y(f, { loading: n.creating }, {
2680
- default: L(() => [S("div", Ri, [
2681
- w(o, {
3039
+ }, Ca = { style: { "min-height": "260px" } }, wa = { class: "d-flex justify-content-between" }, Ta = { key: 1 }, Ea = ["disabled"], Da = ["disabled"];
3040
+ function Oa(e, t, n, r, i, a) {
3041
+ let o = F("amsom-horizontal-stepper"), s = F("font-awesome-icon"), c = F("etape-reclamant-cible-block"), l = F("etape-motif-block"), u = F("etape-details-block"), d = F("amsom-overlay");
3042
+ return A(), x(d, { loading: n.creating }, {
3043
+ default: z(() => [w("div", xa, [
3044
+ E(o, {
2682
3045
  steps: a.stepperSteps,
2683
3046
  size: "md",
2684
3047
  onStepClick: a.onStepClick
2685
3048
  }, null, 8, ["steps", "onStepClick"]),
2686
- a.aideMotif ? (O(), x("div", zi, [w(s, {
3049
+ a.aideMotif ? (A(), C("div", Sa, [E(s, {
2687
3050
  icon: "circle-info",
2688
3051
  class: "text-info-emphasis me-2"
2689
- }), S("span", null, P(a.aideMotif), 1)])) : b("", !0),
2690
- S("div", Bi, [a.currentKey === "reclamant" ? (O(), y(c, {
2691
- key: 0,
2692
- premiere: n.step === 1
2693
- }, de({ _: 2 }, [e.$slots.reclamant ? {
3052
+ }), w("span", null, I(a.aideMotif), 1)])) : S("", !0),
3053
+ w("div", Ca, [a.currentKey === "reclamantCible" ? (A(), x(c, { key: 0 }, le({ _: 2 }, [e.$slots.reclamant ? {
2694
3054
  name: "reclamant",
2695
- fn: L((t) => [M(e.$slots, "reclamant", D(T(t)))]),
3055
+ fn: z((t) => [P(e.$slots, "reclamant", k(D(t)))]),
2696
3056
  key: "0"
2697
- } : void 0]), 1032, ["premiere"])) : a.currentKey === "categorie" ? (O(), y(l, {
2698
- key: 1,
2699
- premiere: n.step === 1
2700
- }, null, 8, ["premiere"])) : a.currentKey === "cible" ? (O(), y(u, { key: 2 })) : a.currentKey === "details" ? (O(), y(d, { key: 3 })) : b("", !0)]),
2701
- S("div", Vi, [n.step > 1 ? (O(), x("button", {
3057
+ } : void 0]), 1024)) : a.currentKey === "motif" ? (A(), x(l, { key: 1 })) : a.currentKey === "details" ? (A(), x(u, { key: 2 })) : S("", !0)]),
3058
+ w("div", wa, [n.step > 1 ? (A(), C("button", {
2702
3059
  key: 0,
2703
3060
  class: "btn btn-sm btn-outline-secondary",
2704
3061
  onClick: t[0] ||= (...e) => a.goPrevious && a.goPrevious(...e)
2705
- }, [w(s, {
3062
+ }, [E(s, {
2706
3063
  icon: "chevron-left",
2707
3064
  class: "me-1"
2708
- }), t[3] ||= C(" Précédent ", -1)])) : (O(), x("span", Hi)), n.step < a.steps.length ? (O(), x("button", {
3065
+ }), t[3] ||= T(" Précédent ", -1)])) : (A(), C("span", Ta)), n.step < a.steps.length ? (A(), C("button", {
2709
3066
  key: 2,
2710
3067
  class: "btn btn-sm btn-primary",
2711
3068
  disabled: !a.canGoNext,
2712
3069
  onClick: t[1] ||= (...e) => a.goNext && a.goNext(...e)
2713
- }, [t[4] ||= C(" Suivant ", -1), w(s, {
3070
+ }, [t[4] ||= T(" Suivant ", -1), E(s, {
2714
3071
  icon: "chevron-right",
2715
3072
  class: "ms-1"
2716
- })], 8, Ui)) : (O(), x("button", {
3073
+ })], 8, Ea)) : (A(), C("button", {
2717
3074
  key: 3,
2718
3075
  class: "btn btn-sm btn-success",
2719
3076
  disabled: !a.canCreer || n.creating,
2720
3077
  onClick: t[2] ||= (t) => e.$emit("submit")
2721
- }, [w(s, {
3078
+ }, [E(s, {
2722
3079
  icon: "check",
2723
3080
  class: "me-1"
2724
- }), t[5] ||= C(" Créer la sollicitation ", -1)], 8, Wi))])
3081
+ }), t[5] ||= T(" Créer la sollicitation ", -1)], 8, Da))])
2725
3082
  ])]),
2726
3083
  _: 3
2727
3084
  }, 8, ["loading"]);
2728
3085
  }
2729
- var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n } = {}) => it("/v2/cresol/creer_sollicitation", e, {
3086
+ var ka = /*#__PURE__*/ G(ba, [["render", Oa]]), Aa = (e, { signal: t, baseUrl: n } = {}) => yt("/v2/cresol/creer_sollicitation", e, {
2730
3087
  signal: t,
2731
3088
  baseUrl: n
2732
- }), Ji = ({ idSollicitation: e, pj: t }, { signal: n, baseUrl: r } = {}) => it("/v2/cresol/upload_sollicitation_ged", {
3089
+ }), ja = ({ idSollicitation: e, pj: t }, { signal: n, baseUrl: r } = {}) => yt("/v2/cresol/upload_sollicitation_ged", {
2733
3090
  idSollicitation: e,
2734
3091
  pj: t
2735
3092
  }, {
2736
3093
  signal: n,
2737
3094
  baseUrl: r
2738
- }), Yi = {
3095
+ }), Ma = {
2739
3096
  modelValue: {
2740
3097
  type: Object,
2741
3098
  default: null
@@ -2751,7 +3108,21 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2751
3108
  "select",
2752
3109
  "switch",
2753
3110
  "autocomplete",
2754
- "step"
3111
+ "recherche"
3112
+ ].includes(e)
3113
+ },
3114
+ motifSelectionMode: {
3115
+ type: String,
3116
+ default: "bubble",
3117
+ validator: (e) => ["bubble", "columns"].includes(e)
3118
+ },
3119
+ motifNonProposeMode: {
3120
+ type: String,
3121
+ default: "clear",
3122
+ validator: (e) => [
3123
+ "clear",
3124
+ "block",
3125
+ "ignore"
2755
3126
  ].includes(e)
2756
3127
  },
2757
3128
  typesReclamant: {
@@ -2766,7 +3137,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2766
3137
  },
2767
3138
  provenances: {
2768
3139
  type: Array,
2769
- default: () => [...Te]
3140
+ default: () => [...we]
2770
3141
  },
2771
3142
  provenancesExclues: {
2772
3143
  type: Array,
@@ -2801,7 +3172,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2801
3172
  type: String,
2802
3173
  default: null
2803
3174
  }
2804
- }, Xi = Object.keys(Yi), Zi = [
3175
+ }, Na = Object.keys(Ma), Pa = [
2805
3176
  "update:modelValue",
2806
3177
  "reclamantChange",
2807
3178
  "motifChange",
@@ -2810,35 +3181,50 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2810
3181
  "created",
2811
3182
  "createError",
2812
3183
  "error"
2813
- ], Qi = {
3184
+ ], Fa = {
2814
3185
  name: "CreerSollicitationForm",
2815
3186
  components: {
2816
3187
  AsideBlock: Xe,
2817
- StepperBlock: Ki
3188
+ StepperBlock: ka
2818
3189
  },
2819
- props: { ...Yi },
2820
- emits: [...Zi],
3190
+ props: { ...Ma },
3191
+ emits: [...Pa],
2821
3192
  setup(e, { emit: t }) {
2822
- let n = (e) => t("error", e), r = { baseUrl: F(e, "baseUrl") }, i = kt(Ot({
3193
+ let n = (e) => t("error", e), r = { baseUrl: L(e, "baseUrl") }, i = Wt(Ut({
2823
3194
  onError: n,
2824
3195
  ...r
2825
- })), a = A(null), o = A(!1), s = v(() => a.value ?? e.modules ?? []), c = Ue(He({
2826
- reclamants: v(() => e.reclamantMode === "step" ? [] : e.reclamants),
3196
+ })), a = M(null), o = M(!1), s = b(() => a.value ?? e.modules ?? []), c = b(() => e.reclamantMode === "recherche"), l = Ue(He({
3197
+ reclamants: b(() => c.value ? [] : e.reclamants),
2827
3198
  modules: s,
2828
- idModulePrefere: F(e, "idModule"),
2829
- readonly: F(e, "readonly")
2830
- }));
2831
- return It(k({
2832
- nomenclatureFilter: F(e, "nomenclatureFilter"),
2833
- reclamantMode: F(e, "reclamantMode"),
2834
- typesReclamant: v(() => (e.typesReclamant ?? H).filter((t) => !e.typesReclamantExclus.includes(t))),
2835
- provenances: v(() => {
3199
+ idModulePrefere: L(e, "idModule"),
3200
+ readonly: L(e, "readonly")
3201
+ })), u = (t) => {
3202
+ if (!t || t.estDesactive) return !1;
3203
+ let n = e.nomenclatureFilter;
3204
+ return typeof n != "function" || n(t, { reclamant: l.reclamantSelectionne });
3205
+ }, d = b(() => {
3206
+ let e = l.lignePrincipale.idMotif;
3207
+ if (e == null || l.isReadonly("motif")) return !0;
3208
+ let t = i.cache.motifs?.find((t) => t.id === e);
3209
+ return !i.cache.motifs || u(t);
3210
+ }), f = M(null);
3211
+ return Kt(j({
3212
+ nomenclatureFilter: L(e, "nomenclatureFilter"),
3213
+ estMotifPropose: u,
3214
+ motifPrincipalPropose: d,
3215
+ motifNonProposeMode: L(e, "motifNonProposeMode"),
3216
+ motifRetire: f,
3217
+ reclamantMode: L(e, "reclamantMode"),
3218
+ rechercheReclamant: c,
3219
+ motifSelectionMode: L(e, "motifSelectionMode"),
3220
+ typesReclamant: b(() => (e.typesReclamant ?? H).filter((t) => !e.typesReclamantExclus.includes(t))),
3221
+ provenances: b(() => {
2836
3222
  let t = i.cache.provenances ?? [];
2837
3223
  return (e.provenances ?? t.map((e) => e.id)).filter((t) => !e.provenancesExclues.includes(t)).flatMap((e) => {
2838
3224
  let n = t.find((t) => t.id === e);
2839
3225
  return n ? [{
2840
3226
  ...n,
2841
- icon: we(e)
3227
+ icon: Ce(e)
2842
3228
  }] : [];
2843
3229
  });
2844
3230
  }),
@@ -2847,9 +3233,12 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2847
3233
  ...r
2848
3234
  })), {
2849
3235
  data: i,
2850
- draft: c,
3236
+ draft: l,
2851
3237
  modulesCharges: a,
2852
3238
  repriseReclamant: o,
3239
+ rechercheReclamant: c,
3240
+ motifPrincipalPropose: d,
3241
+ motifRetire: f,
2853
3242
  onError: n
2854
3243
  };
2855
3244
  },
@@ -2881,17 +3270,27 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2881
3270
  }
2882
3271
  } },
2883
3272
  async created() {
2884
- this.data.loadNomenclature(), this.data.loadProvenances(), this.draft.reset(this.modelValue), this.reclamantMode === "step" && await this.reprendreReclamantFourni(), this.draft.syncReclamant();
3273
+ this.data.loadNomenclature(), this.data.loadProvenances(), this.draft.reset(this.modelValue), this.rechercheReclamant && await this.reprendreReclamantFourni(), this.draft.syncReclamant();
2885
3274
  let e = this.draft.reclamantSelectionne;
2886
3275
  this.$watch("draft.reclamantSelectionne", async (t) => {
2887
3276
  this.$emit("reclamantChange", t), await this.chargerModulesReclamant(t, e) && this.draft.syncReclamant();
2888
- }), this.$watch(() => JSON.stringify(this.motifChoisi), () => this.$emit("motifChange", this.motifChoisi)), await this.chargerModulesReclamant(e, e) && this.draft.prefillCiblePrincipale();
3277
+ }), this.$watch("motifPrincipalPropose", this.retirerMotifNonPropose, { immediate: !0 }), this.$watch(() => this.draft.lignePrincipale.idMotif, (e) => {
3278
+ e != null && (this.motifRetire = null);
3279
+ }), this.$watch(() => JSON.stringify(this.motifChoisi), () => this.$emit("motifChange", this.motifChoisi)), await this.chargerModulesReclamant(e, e) && this.draft.prefillCiblePrincipale(), this.draft.libererCibleFournie();
2889
3280
  },
2890
3281
  methods: {
3282
+ retirerMotifNonPropose(e) {
3283
+ if (e || this.motifNonProposeMode !== "clear") return;
3284
+ let t = this.draft.lignePrincipale.idMotif, n = {
3285
+ libelle: this.data.motifLibelle(t),
3286
+ associes: this.draft.lignesAssociees.map((e) => e.libelle ?? this.data.motifLibelle(e.idMotif))
3287
+ };
3288
+ this.draft.setCategorie(null), this.motifRetire = n;
3289
+ },
2891
3290
  async reprendreReclamantFourni() {
2892
3291
  let { type: e, id: t } = this.draft.draft.reclamant;
2893
3292
  if (!e || t == null) return;
2894
- let n = (n) => n.type === e && String(n.id) === String(t), [r] = ke([e]), i = null;
3293
+ let n = (n) => n.type === e && String(n.id) === String(t), [r] = Oe([e]), i = null;
2895
3294
  if (r) {
2896
3295
  this.repriseReclamant = !0;
2897
3296
  try {
@@ -2923,10 +3322,10 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2923
3322
  if (!await this.autoriserCreation(e)) return;
2924
3323
  let t;
2925
3324
  try {
2926
- t = await qi(e, this.requestOptions) ?? [];
3325
+ t = await Aa(e, this.requestOptions) ?? [];
2927
3326
  } catch (t) {
2928
- if (xt(t)) return;
2929
- let n = bt(t);
3327
+ if (It(t)) return;
3328
+ let n = Ft(t);
2930
3329
  this.$emit("createError", {
2931
3330
  error: t,
2932
3331
  message: n,
@@ -2976,7 +3375,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2976
3375
  message: t
2977
3376
  };
2978
3377
  };
2979
- return a?.id ? Ji({
3378
+ return a?.id ? ja({
2980
3379
  idSollicitation: a.id,
2981
3380
  pj: {
2982
3381
  name: n.name,
@@ -2987,34 +3386,34 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2987
3386
  ...o,
2988
3387
  ok: !0,
2989
3388
  message: null
2990
- })).catch((e) => s(bt(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
3389
+ })).catch((e) => s(Ft(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
2991
3390
  });
2992
3391
  return Promise.all(n);
2993
3392
  }
2994
3393
  }
2995
- }, $i = { class: "row g-3" }, ea = {
3394
+ }, Ia = { class: "row g-3" }, La = {
2996
3395
  key: 0,
2997
3396
  class: "col-12 col-lg-4"
2998
3397
  };
2999
- function ta(e, t, n, r, i, a) {
3000
- let o = N("aside-block"), s = N("stepper-block");
3001
- return O(), x("div", $i, [e.aside ? (O(), x("div", ea, [M(e.$slots, "aside", {}, () => [w(o, { "nb-similaires": e.nbSimilaires }, de({ _: 2 }, [e.$slots["aside-similaires"] ? {
3398
+ function Ra(e, t, n, r, i, a) {
3399
+ let o = F("aside-block"), s = F("stepper-block");
3400
+ return A(), C("div", Ia, [e.aside ? (A(), C("div", La, [P(e.$slots, "aside", {}, () => [E(o, { "nb-similaires": e.nbSimilaires }, le({ _: 2 }, [e.$slots["aside-similaires"] ? {
3002
3401
  name: "similaires",
3003
- fn: L((t) => [M(e.$slots, "aside-similaires", D(T(t)))]),
3402
+ fn: z((t) => [P(e.$slots, "aside-similaires", k(D(t)))]),
3004
3403
  key: "0"
3005
3404
  } : void 0, e.$slots["aside-evenements"] ? {
3006
3405
  name: "evenements",
3007
- fn: L(() => [M(e.$slots, "aside-evenements")]),
3406
+ fn: z(() => [P(e.$slots, "aside-evenements")]),
3008
3407
  key: "1"
3009
- } : void 0]), 1032, ["nb-similaires"])])])) : b("", !0), S("div", { class: E(["col-12", e.aside ? "col-lg-8" : ""]) }, [w(s, {
3408
+ } : void 0]), 1032, ["nb-similaires"])])])) : S("", !0), w("div", { class: O(["col-12", e.aside ? "col-lg-8" : ""]) }, [E(s, {
3010
3409
  step: i.currentStep,
3011
3410
  "onUpdate:step": t[0] ||= (e) => i.currentStep = e,
3012
3411
  creating: i.creating,
3013
3412
  onStepChange: t[1] ||= (t) => e.$emit("stepChange", t),
3014
3413
  onSubmit: a.creer
3015
- }, de({ _: 2 }, [e.$slots.reclamant ? {
3414
+ }, le({ _: 2 }, [e.$slots.reclamant ? {
3016
3415
  name: "reclamant",
3017
- fn: L((t) => [M(e.$slots, "reclamant", D(T(t)))]),
3416
+ fn: z((t) => [P(e.$slots, "reclamant", k(D(t)))]),
3018
3417
  key: "0"
3019
3418
  } : void 0]), 1032, [
3020
3419
  "step",
@@ -3022,14 +3421,14 @@ function ta(e, t, n, r, i, a) {
3022
3421
  "onSubmit"
3023
3422
  ])], 2)]);
3024
3423
  }
3025
- var na = /*#__PURE__*/ K(Qi, [["render", ta]]), ra = {
3424
+ var za = /*#__PURE__*/ G(Fa, [["render", Ra]]), Ba = {
3026
3425
  name: "CreerSollicitationModal",
3027
3426
  components: {
3028
- AmsomModal: ue,
3029
- CreerSollicitationForm: na
3427
+ AmsomModal: ce,
3428
+ CreerSollicitationForm: za
3030
3429
  },
3031
3430
  props: {
3032
- ...Yi,
3431
+ ...Ma,
3033
3432
  titre: {
3034
3433
  type: String,
3035
3434
  default: "Nouvelle sollicitation"
@@ -3039,35 +3438,35 @@ var na = /*#__PURE__*/ K(Qi, [["render", ta]]), ra = {
3039
3438
  default: !0
3040
3439
  }
3041
3440
  },
3042
- emits: [...Zi, "close"],
3441
+ emits: [...Pa, "close"],
3043
3442
  computed: {
3044
3443
  formProps() {
3045
- return Object.fromEntries(Xi.map((e) => [e, this[e]]));
3444
+ return Object.fromEntries(Na.map((e) => [e, this[e]]));
3046
3445
  },
3047
3446
  formListeners() {
3048
- return Object.fromEntries(Zi.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
3447
+ return Object.fromEntries(Pa.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
3049
3448
  }
3050
3449
  },
3051
3450
  methods: { onCreated(...e) {
3052
3451
  this.$emit("created", ...e), this.closeOnCreated && this.$emit("close");
3053
3452
  } }
3054
- }, ia = { class: "fw-medium fs-5" };
3055
- function aa(e, t, n, r, i, a) {
3056
- let o = N("creer-sollicitation-form"), s = N("amsom-modal");
3057
- return O(), y(s, {
3453
+ }, Va = { class: "fw-medium fs-5" };
3454
+ function Ha(e, t, n, r, i, a) {
3455
+ let o = F("creer-sollicitation-form"), s = F("amsom-modal");
3456
+ return A(), x(s, {
3058
3457
  "close-option": "",
3059
3458
  size: "xl",
3060
3459
  onClose: t[0] ||= (t) => e.$emit("close")
3061
3460
  }, {
3062
- default: L(() => [S("span", ia, P(n.titre), 1), w(o, pe({ class: "pt-3" }, a.formProps, he(a.formListeners), { onCreated: a.onCreated }), de({ _: 2 }, [j(e.$slots, (t, n) => ({
3461
+ default: z(() => [w("span", Va, I(n.titre), 1), E(o, de({ class: "pt-3" }, a.formProps, pe(a.formListeners), { onCreated: a.onCreated }), le({ _: 2 }, [N(e.$slots, (t, n) => ({
3063
3462
  name: n,
3064
- fn: L((t) => [M(e.$slots, n, D(T(t ?? {})))])
3463
+ fn: z((t) => [P(e.$slots, n, k(D(t ?? {})))])
3065
3464
  }))]), 1040, ["onCreated"])]),
3066
3465
  _: 3
3067
3466
  });
3068
3467
  }
3069
- var oa = /*#__PURE__*/ K(ra, [["render", aa]]), sa = {
3070
- CreerSollicitationModal: oa,
3071
- CreerSollicitationForm: na
3468
+ var Ua = /*#__PURE__*/ G(Ba, [["render", Ha]]), Wa = {
3469
+ CreerSollicitationModal: Ua,
3470
+ CreerSollicitationForm: za
3072
3471
  };
3073
- export { na as CreerSollicitationForm, oa as CreerSollicitationModal, Ee as DEFAULT_PROVENANCE_CONTACT, Te as PROVENANCES_CONTACT_DEFAUT, B as PROVENANCE_CONTACT_ICONS, Ne as READONLY_FIELDS, Qe as configureCresol, sa as default, Pe as getDefaultDraft, W as getDefaultLigne, U as getDefaultPatrimoine, Et as resetCresolCache };
3472
+ export { za as CreerSollicitationForm, Ua as CreerSollicitationModal, Te as DEFAULT_PROVENANCE_CONTACT, we as PROVENANCES_CONTACT_DEFAUT, Se as PROVENANCE_CONTACT_ICONS, Ne as READONLY_FIELDS, pt as configureCresol, Wa as default, Pe as getDefaultDraft, Me as getDefaultLigne, U as getDefaultPatrimoine, Vt as resetCresolCache };