@amsom-habitat/cresol 0.2.8 → 0.3.1

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
+ }, Oe = Object.keys(De), ke = (e) => [...new Set(e.map((e) => De[e]))], Ae = (e) => e ? V[e.categorie] ? e.categorie : De[e.type] ?? "inconnu" : null, je = (e) => V[Ae(e)] ?? null, Me = Symbol("cresol:draft"), H = () => ({
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
+ }), U = () => ({
81
81
  idMotif: null,
82
82
  idCategorie: null,
83
83
  idType: null,
@@ -96,6 +96,17 @@ var B = {
96
96
  dateFaitsOverride: !1,
97
97
  fichier: null
98
98
  }), Ne = [
99
+ "cibleOverride",
100
+ "cibleMode",
101
+ "contratReclamant",
102
+ "contratCible",
103
+ "reprendreLocataireActuel",
104
+ "modulePrecis",
105
+ "patrimoine"
106
+ ], Pe = (e) => Object.fromEntries(Ne.map((t) => {
107
+ let n = e?.[t] ?? U()[t];
108
+ return [t, n && typeof n == "object" ? { ...n } : n];
109
+ })), Fe = [
99
110
  "reclamant",
100
111
  "provenance",
101
112
  "motif",
@@ -104,19 +115,19 @@ var B = {
104
115
  "dateFaits",
105
116
  "responsable",
106
117
  "fichier"
107
- ], Pe = (e = "T") => ({
118
+ ], Ie = (e = "T") => ({
108
119
  reclamant: {
109
120
  type: null,
110
121
  id: null
111
122
  },
112
123
  provenance: e,
113
124
  lignes: [{
114
- ...W(),
125
+ ...U(),
115
126
  cibleMode: "contrat",
116
- patrimoine: U(),
127
+ patrimoine: H(),
117
128
  description: ""
118
129
  }]
119
- }), Fe = (e) => e?.id ?? e ?? null, Ie = (e) => {
130
+ }), Le = (e) => e?.id ?? e ?? null, Re = (e) => {
120
131
  if (!e) return "Cible non définie";
121
132
  let t = [
122
133
  e.commune,
@@ -124,17 +135,17 @@ var B = {
124
135
  e.libelleModule
125
136
  ].filter(Boolean);
126
137
  return e.etage != null && !e.libelleModule && t.push(`Étage ${e.etage}`), t.length ? t.join(" — ") : "Cible non définie";
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 = {}) => {
138
+ }, ze = (e) => !!e && (e.idModule != null || e.idEntree != null), Be = (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 : ze(e.patrimoine), Ve = (e, t) => e.description == null ? !t : e.description.trim().length > 0, He = (e = {}) => {
128
139
  let t = {
129
- ...W(),
140
+ ...U(),
130
141
  ...e
131
142
  };
132
143
  return e.patrimoine && (t.patrimoine = {
133
- ...U(),
144
+ ...H(),
134
145
  ...e.patrimoine
135
146
  }), t;
136
- }, Ve = (e) => {
137
- let t = Pe();
147
+ }, Ue = (e) => {
148
+ let t = Ie();
138
149
  if (!e) return t;
139
150
  let n = Array.isArray(e.lignes) && e.lignes.length ? e.lignes : null;
140
151
  return {
@@ -147,21 +158,21 @@ var B = {
147
158
  provenance: e.provenance ?? t.provenance,
148
159
  lignes: n ? n.map((e, n) => n === 0 ? {
149
160
  ...t.lignes[0],
150
- ...Be(e)
151
- } : Be(e)) : t.lignes
161
+ ...He(e)
162
+ } : He(e)) : t.lignes
152
163
  };
153
164
  };
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);
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(() => {
165
+ function We({ reclamants: e, modules: t, idModulePrefere: n = M(null), readonly: r = M(!1) } = {}) {
166
+ let i = j(Ie()), a = b(() => {
167
+ let e = R(r);
168
+ return e === !0 ? Fe : Array.isArray(e) ? e : [];
169
+ }), 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
170
  let e = u.value;
160
171
  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);
172
+ }), p = b(() => f.value.find((e) => d(e, i.reclamant)) ?? f.value[0] ?? null), m = M(!1), h = M(0), ee = b(() => {
173
+ let e = R(t) ?? [], r = R(n);
163
174
  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 = {
175
+ }), g = b(() => !!p.value && Ee.includes(p.value.type)), _ = {
165
176
  draft: i,
166
177
  lignePrincipale: s,
167
178
  lignesAssociees: c,
@@ -169,66 +180,90 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
169
180
  reclamantsDisponibles: f,
170
181
  reclamantSelectionne: p,
171
182
  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))),
183
+ reclamantEstContrat: g,
184
+ ciblesValid: b(() => i.lignes.every((e) => Be(e, g.value))),
185
+ detailsValid: b(() => i.lignes.every((e, t) => Ve(e, t === 0))),
175
186
  isReadonly: o,
187
+ ciblesAssocieesReinitialisees: h,
188
+ ligneCibleValid(e) {
189
+ let t = i.lignes[e];
190
+ return !!t && Be(t, g.value);
191
+ },
176
192
  reset(e = null) {
177
- let t = Ve(e);
178
- Object.assign(i, t), i.lignes = t.lignes;
193
+ let t = e?.lignes?.[0];
194
+ m.value = !!t && [
195
+ "cibleMode",
196
+ "patrimoine",
197
+ "contratCible"
198
+ ].some((e) => t[e] != null), h.value = 0;
199
+ let n = Ue(e);
200
+ Object.assign(i, n), i.lignes = n.lignes;
179
201
  },
180
202
  setProvenance(e) {
181
203
  i.provenance = e;
182
204
  },
205
+ libererCibleFournie() {
206
+ m.value = !1;
207
+ },
183
208
  syncReclamant() {
184
209
  let e = p.value;
185
- h.setReclamant({
210
+ _.setReclamant({
186
211
  type: e?.type ?? null,
187
212
  id: e?.id ?? null
188
213
  });
189
214
  },
190
215
  selectReclamant(e) {
191
- e && (l.value.some((t) => d(t, e)) || (u.value = e), h.setReclamant(e));
216
+ e && (d(e, i.reclamant) || (m.value = !1), l.value.some((t) => d(t, e)) || (u.value = e), _.setReclamant(e));
192
217
  },
193
218
  setReclamant({ type: e, id: t }) {
219
+ let n = !d({
220
+ type: e,
221
+ id: t
222
+ }, i.reclamant);
194
223
  if (i.reclamant = {
195
224
  type: e ?? null,
196
225
  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());
226
+ }, o("cible") || m.value) return;
227
+ let r = i.lignes[0];
228
+ if (n) {
229
+ let e = i.lignes.filter((e, t) => t > 0 && e.cibleOverride);
230
+ i.lignes.forEach((e, t) => {
231
+ t > 0 && e.cibleOverride && _.toggleCibleOverride(t);
232
+ }), e.length && (h.value = e.length);
233
+ }
234
+ 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 = H(), _.prefillCiblePrincipale());
200
235
  },
201
236
  prefillCiblePrincipale() {
202
- if (o("cible")) return;
237
+ if (o("cible") || m.value) return;
203
238
  let e = ee.value;
204
- e && h.prefillFromModule(0, e);
239
+ e && _.prefillFromModule(0, e);
205
240
  },
206
241
  _resetAfterNomenclature() {
207
- i.lignes[0].responsable = null, i.lignes.splice(1);
242
+ h.value = 0, i.lignes[0].responsable = null, i.lignes.splice(1);
208
243
  },
209
244
  setCategorie(e) {
210
245
  let t = i.lignes[0];
211
- t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null, h._resetAfterNomenclature();
246
+ t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
212
247
  },
213
248
  setType(e) {
214
249
  let t = i.lignes[0];
215
- t.idType = e, t.idNature = null, t.idMotif = null, h._resetAfterNomenclature();
250
+ t.idType = e, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
216
251
  },
217
252
  setNature(e) {
218
253
  let t = i.lignes[0];
219
- t.idNature = e, t.idMotif = null, h._resetAfterNomenclature();
254
+ t.idNature = e, t.idMotif = null, _._resetAfterNomenclature();
220
255
  },
221
256
  setMotif(e) {
222
- i.lignes[0].idMotif = e, h._resetAfterNomenclature();
257
+ i.lignes[0].idMotif = e, _._resetAfterNomenclature();
223
258
  },
224
259
  selectMotifChain(e) {
225
260
  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();
261
+ t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null, _._resetAfterNomenclature();
227
262
  },
228
263
  toggleLigneAssociee(e, t = {}) {
229
264
  let n = i.lignes.findIndex((t, n) => n > 0 && t.idMotif === e);
230
265
  n === -1 ? i.lignes.push({
231
- ...W(),
266
+ ...U(),
232
267
  idMotif: e,
233
268
  ...t
234
269
  }) : i.lignes.splice(n, 1);
@@ -238,15 +273,15 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
238
273
  },
239
274
  setCibleMode(e, t) {
240
275
  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());
276
+ 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 ??= H());
242
277
  },
243
278
  setModulePrecis(e, t) {
244
279
  let n = i.lignes[e];
245
- n && (n.modulePrecis = !!t, n.modulePrecis || h.setPatrimoineModule(e, null));
280
+ n && (n.modulePrecis = !!t, n.modulePrecis || _.setPatrimoineModule(e, null));
246
281
  },
247
282
  toggleContratReclamant(e, t) {
248
283
  let n = i.lignes[e];
249
- n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine && h.setPatrimoineModule(e, null));
284
+ n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine && _.setPatrimoineModule(e, null));
250
285
  },
251
286
  setContratCible(e, t) {
252
287
  let n = i.lignes[e];
@@ -254,31 +289,32 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
254
289
  typeContrat: t.typeContrat,
255
290
  idContrat: t.idContrat,
256
291
  libelle: t.libelle ?? null
257
- } : null, h.setPatrimoineModule(e, null));
292
+ } : null, _.setPatrimoineModule(e, null));
258
293
  },
259
294
  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));
295
+ let n = _._patrimoine(e);
296
+ n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null, _.setPatrimoineEntree(e, null));
262
297
  },
263
298
  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));
299
+ let n = _._patrimoine(e);
300
+ 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
301
  },
267
302
  setPatrimoineEtage(e, t) {
268
- let n = h._patrimoine(e);
269
- n && (n.etage = t, h.setPatrimoineModule(e, null));
303
+ let n = _._patrimoine(e);
304
+ n && (n.etage = t, _.setPatrimoineModule(e, null));
270
305
  },
271
306
  setPatrimoineModule(e, t) {
272
- let n = h._patrimoine(e);
307
+ let n = _._patrimoine(e);
273
308
  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
309
  },
275
310
  prefillFromModule(e, t) {
276
- let n = h._patrimoine(e);
311
+ let n = _._patrimoine(e);
277
312
  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
313
  },
279
314
  toggleCibleOverride(e) {
280
315
  let t = i.lignes[e];
281
316
  if (!t) return;
317
+ h.value = 0;
282
318
  let n = i.lignes[0];
283
319
  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
320
  },
@@ -327,7 +363,7 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
327
363
  motif: e.idMotif,
328
364
  description: a,
329
365
  dateFaits: o,
330
- responsable: Fe(e.responsable)
366
+ responsable: Le(e.responsable)
331
367
  };
332
368
  if (r.cibleMode === "demande") return {
333
369
  ...c,
@@ -335,9 +371,9 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
335
371
  idCible: i.reclamant.id,
336
372
  deduireCible: !1
337
373
  };
338
- let l = h._patrimoinePayload(r.patrimoine);
374
+ let l = _._patrimoinePayload(r.patrimoine);
339
375
  if (r.cibleMode === "contrat" && !r.reprendreLocataireActuel) {
340
- let e = r.contratReclamant && m.value ? {
376
+ let e = r.contratReclamant && g.value ? {
341
377
  typeContrat: i.reclamant.type,
342
378
  idContrat: i.reclamant.id
343
379
  } : r.contratCible;
@@ -360,11 +396,11 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
360
396
  cibleResume(e) {
361
397
  let t = i.lignes[0], n = e !== t && !e.cibleOverride ? t : e;
362
398
  if (n.cibleMode === "demande") return "La demande";
363
- let r = Ie(n.patrimoine);
399
+ let r = Re(n.patrimoine);
364
400
  if (n.cibleMode === "patrimoine" && !n.modulePrecis) return `Parties communes — ${r}`;
365
401
  if (n.cibleMode !== "contrat") return r;
366
402
  let a = "Contrat non défini";
367
- if (n.contratReclamant && m.value) a = "Contrat du réclamant";
403
+ if (n.contratReclamant && g.value) a = "Contrat du réclamant";
368
404
  else if (n.contratCible) {
369
405
  let e = n.contratCible;
370
406
  a = `${e.libelle ?? "Contrat"} (${e.typeContrat}/${e.idContrat})`;
@@ -372,42 +408,42 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
372
408
  return `${a} — ${r}`;
373
409
  },
374
410
  lignesPayload() {
375
- return i.lignes.map((e, t) => h._lignePayload(e, t));
411
+ return i.lignes.map((e, t) => _._lignePayload(e, t));
376
412
  },
377
413
  creationPayload() {
378
414
  let e = p.value;
379
415
  return {
380
416
  typeReclamant: e?.type ?? null,
381
417
  reclamant: e?.id ?? null,
382
- lignes: h.lignesPayload(),
418
+ lignes: _.lignesPayload(),
383
419
  provenance: i.provenance
384
420
  };
385
421
  }
386
422
  };
387
- return k(h);
423
+ return j(_);
388
424
  }
389
- function Ue(e) {
390
- return me(Me, e), e;
425
+ function Ge(e) {
426
+ return fe(Me, e), e;
391
427
  }
392
- function G() {
393
- let e = fe(Me, null);
428
+ function W() {
429
+ let e = ue(Me, null);
394
430
  if (!e) throw Error("useSollicitationDraft() hors de <creer-sollicitation-form>");
395
431
  return e;
396
432
  }
397
433
  // \0plugin-vue:export-helper
398
- var K = (e, t) => {
434
+ var G = (e, t) => {
399
435
  let n = e.__vccOpts || e;
400
436
  for (let [e, r] of t) n[e] = r;
401
437
  return n;
402
- }, We = {
438
+ }, Ke = {
403
439
  name: "AsideBlock",
404
- components: { AmsomNavTabsHorizontal: ve },
440
+ components: { AmsomNavTabsHorizontal: ge },
405
441
  props: { nbSimilaires: {
406
442
  type: Number,
407
443
  default: 0
408
444
  } },
409
445
  setup() {
410
- return { draft: G() };
446
+ return { draft: W() };
411
447
  },
412
448
  data() {
413
449
  return { activeTab: null };
@@ -443,13 +479,13 @@ var K = (e, t) => {
443
479
  e.some((e) => e.id === this.activeTab) || (this.activeTab = e[0]?.id ?? null);
444
480
  }
445
481
  } }
446
- }, Ge = {
482
+ }, qe = {
447
483
  key: 0,
448
484
  class: "badge bg-danger ms-1"
449
- }, Ke = { style: { "min-height": "320px" } }, qe = { key: 0 }, Je = { key: 1 };
450
- 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, {
485
+ }, Je = { style: { "min-height": "320px" } }, Ye = { key: 0 }, Xe = { key: 1 };
486
+ function Ze(e, t, n, r, i, a) {
487
+ let o = F("font-awesome-icon"), s = F("amsom-nav-tabs-horizontal");
488
+ return a.tabs.length ? (A(), x(s, {
453
489
  key: 0,
454
490
  modelValue: i.activeTab,
455
491
  "onUpdate:modelValue": t[0] ||= (e) => i.activeTab = e,
@@ -457,29 +493,145 @@ function Ye(e, t, n, r, i, a) {
457
493
  "item-key": "id",
458
494
  "tab-spacing": 1
459
495
  }, {
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)
496
+ libelle: z(({ item: e }) => [
497
+ E(o, { icon: e.icon }, null, 8, ["icon"]),
498
+ w("span", null, I(e.label), 1),
499
+ e.id === "similarite" && n.nbSimilaires > 0 ? (A(), C("span", qe, I(n.nbSimilaires), 1)) : S("", !0)
464
500
  ]),
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)])]),
501
+ content: z(() => [w("div", Je, [e.$slots.similaires ? he((A(), C("div", Ye, [P(e.$slots, "similaires", k(D(a.scope)))], 512)), [[me, i.activeTab === "similarite"]]) : S("", !0), e.$slots.evenements ? he((A(), C("div", Xe, [P(e.$slots, "evenements")], 512)), [[me, i.activeTab === "evenements"]]) : S("", !0)])]),
466
502
  _: 3
467
- }, 8, ["modelValue", "items"])) : b("", !0);
503
+ }, 8, ["modelValue", "items"])) : S("", !0);
504
+ }
505
+ var Qe = /*#__PURE__*/ G(Ke, [["render", Ze]]), $e = {
506
+ name: "SectionComponent",
507
+ props: {
508
+ titre: {
509
+ type: String,
510
+ required: !0
511
+ },
512
+ aide: {
513
+ type: String,
514
+ default: null
515
+ }
516
+ }
517
+ }, et = { class: "d-flex flex-column gap-2" }, tt = { class: "d-flex flex-wrap align-items-center justify-content-between gap-2" }, nt = { class: "fs-6 fw-semibold" }, rt = {
518
+ key: 0,
519
+ class: "text-muted d-flex align-items-center gap-1"
520
+ };
521
+ function it(e, t, n, r, i, a) {
522
+ let o = F("font-awesome-icon");
523
+ return A(), C("section", et, [w("div", null, [w("div", tt, [w("span", nt, I(n.titre), 1), P(e.$slots, "actions")]), n.aide ? (A(), C("small", rt, [E(o, { icon: "circle-info" }), T(" " + I(n.aide), 1)])) : S("", !0)]), P(e.$slots, "default")]);
524
+ }
525
+ var at = /*#__PURE__*/ G($e, [["render", it]]), ot = (e) => "fa" + e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
526
+ async function st(t) {
527
+ let n = await import("@fortawesome/free-solid-svg-icons");
528
+ [...new Set(t.filter(Boolean))].forEach((t) => {
529
+ let r = n[ot(t)];
530
+ r && e.add(r);
531
+ });
532
+ }
533
+ // src/utils/text.js
534
+ function K(e, t = !0) {
535
+ if (!e) return null;
536
+ let n = e.toString().normalize("NFD").replace(/[̀-ͯ]/g, "");
537
+ return t ? n.toLowerCase() : n;
538
+ }
539
+ // src/components/IconSelectComponent.vue
540
+ var ct = {
541
+ name: "IconSelectComponent",
542
+ components: { AmsomAutocomplete: B },
543
+ props: {
544
+ modelValue: {
545
+ type: [String, Number],
546
+ default: null
547
+ },
548
+ items: {
549
+ type: Array,
550
+ default: () => []
551
+ },
552
+ label: {
553
+ type: String,
554
+ required: !0
555
+ },
556
+ required: {
557
+ type: Boolean,
558
+ default: !1
559
+ },
560
+ disabled: {
561
+ type: Boolean,
562
+ default: !1
563
+ },
564
+ placeholder: {
565
+ type: String,
566
+ default: "Choisir…"
567
+ }
568
+ },
569
+ emits: ["update:modelValue"],
570
+ data() {
571
+ return { iconsReady: !1 };
572
+ },
573
+ computed: { selected() {
574
+ return this.items.find((e) => e.id === this.modelValue) ?? null;
575
+ } },
576
+ watch: { items: {
577
+ immediate: !0,
578
+ async handler(e) {
579
+ await st(e.map((e) => e.icon)), this.iconsReady = !0;
580
+ }
581
+ } },
582
+ methods: { filtrer({ search: e, items: t }) {
583
+ let n = (K(e) ?? "").trim();
584
+ return n ? t.filter((e) => (K(e?.libelle) ?? "").includes(n)) : t;
585
+ } }
586
+ }, lt = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, ut = {
587
+ key: 0,
588
+ class: "ms-1 text-danger"
589
+ }, dt = { class: "d-inline-flex align-items-center gap-2" };
590
+ function ft(e, t, n, r, i, a) {
591
+ let o = F("font-awesome-icon"), s = F("amsom-autocomplete");
592
+ return A(), C("div", null, [w("label", lt, [T(I(n.label), 1), n.required ? (A(), C("span", ut, "*")) : S("", !0)]), i.iconsReady ? (A(), x(s, {
593
+ key: 0,
594
+ "model-value": a.selected,
595
+ items: n.items,
596
+ "get-id": (e) => e?.id ?? null,
597
+ "get-input-libelle": (e) => e?.libelle ?? "",
598
+ "filtering-function": a.filtrer,
599
+ disabled: n.disabled,
600
+ placeholder: n.placeholder,
601
+ required: "",
602
+ "input-size": "sm",
603
+ "onUpdate:modelValue": t[0] ||= (t) => e.$emit("update:modelValue", t?.id ?? null)
604
+ }, {
605
+ options: z((e) => [w("span", dt, [e?.icon ? (A(), x(o, {
606
+ key: 0,
607
+ icon: e.icon,
608
+ "fixed-width": ""
609
+ }, null, 8, ["icon"])) : S("", !0), T(" " + I(e?.libelle), 1)])]),
610
+ _: 1
611
+ }, 8, [
612
+ "model-value",
613
+ "items",
614
+ "get-id",
615
+ "get-input-libelle",
616
+ "filtering-function",
617
+ "disabled",
618
+ "placeholder"
619
+ ])) : S("", !0)]);
468
620
  }
469
- var Xe = /*#__PURE__*/ K(We, [["render", Ye]]), Ze = {
621
+ var pt = /*#__PURE__*/ G(ct, [["render", ft]]), mt = {
470
622
  baseUrl: "",
471
- getToken: () => z.getToken(),
472
- setToken: (e) => z.setToken(e),
473
- logout: () => z.logout(),
474
- goToLoginPage: () => z.goToLoginPage()
623
+ getToken: () => ye.getToken(),
624
+ setToken: (e) => ye.setToken(e),
625
+ logout: () => ye.logout(),
626
+ goToLoginPage: () => ye.goToLoginPage()
475
627
  };
476
- function Qe(e = {}) {
477
- Object.assign(Ze, e);
628
+ function ht(e = {}) {
629
+ Object.assign(mt, e);
478
630
  }
479
- var $e = () => Ze;
631
+ var gt = () => mt;
480
632
  // src/api/transport/axiosOverlayConnector.js
481
- function et(e, t = {}) {
482
- let n = $e(), r = {
633
+ function _t(e, t = {}) {
634
+ let n = gt(), r = {
483
635
  getToken: () => n.getToken?.() ?? null,
484
636
  setToken: (e) => n.setToken?.(e),
485
637
  logout: () => n.logout?.(),
@@ -501,73 +653,73 @@ function et(e, t = {}) {
501
653
  }, t.functions.errorsHandlers = {
502
654
  ...r.errorsHandlers,
503
655
  ...t.functions.errorsHandlers ?? {}
504
- }, be(e, t);
656
+ }, ve(e, t);
505
657
  }
506
658
  // src/api/transport/httpClient.js
507
- var tt = (e, t) => {
508
- let n = t || $e().baseUrl;
659
+ var vt = (e, t) => {
660
+ let n = t || gt().baseUrl;
509
661
  if (!n) throw Error("Cresol : baseUrl non renseignée (configureCresol ou prop baseUrl)");
510
662
  return `${n}${e}`;
511
- }, nt = (e = {}) => {
663
+ }, yt = (e = {}) => {
512
664
  let t = new URLSearchParams();
513
665
  Object.entries(e).forEach(([e, n]) => {
514
666
  n != null && n !== "" && t.append(e, typeof n == "object" ? JSON.stringify(n) : n);
515
667
  });
516
668
  let n = t.toString();
517
669
  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),
670
+ }, bt = ({ method: e, path: t, params: n, data: r, signal: i, baseUrl: a }, o = {}) => _t({
671
+ url: vt(`${t}${yt(n)}`, a),
520
672
  method: e,
521
673
  ...r === void 0 ? {} : { data: r },
522
674
  ...i ? { signal: i } : {}
523
- }, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) => rt({
675
+ }, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) => bt({
524
676
  method: "GET",
525
677
  path: e,
526
678
  params: t,
527
679
  signal: n,
528
680
  baseUrl: i
529
- }, r).then((e) => e.data), it = (e, t, { params: n, signal: r, overlay: i, baseUrl: a } = {}) => rt({
681
+ }, r).then((e) => e.data), xt = (e, t, { params: n, signal: r, overlay: i, baseUrl: a } = {}) => bt({
530
682
  method: "POST",
531
683
  path: e,
532
684
  params: n,
533
685
  data: t,
534
686
  signal: r,
535
687
  baseUrl: a
536
- }, i).then((e) => e.data), at = { mustBeAuthenticated: !1 }, J = (e, { signal: t, baseUrl: n } = {}) => q(e, {
688
+ }, i).then((e) => e.data), St = { mustBeAuthenticated: !1 }, J = (e, { signal: t, baseUrl: n } = {}) => q(e, {
537
689
  signal: t,
538
690
  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", {
691
+ overlay: St
692
+ }), Ct = (e) => J("/v2/sollicitation/motifs", e), wt = (e) => J("/v2/sollicitation/categories", e), Tt = (e) => J("/v2/sollicitation/types", e), Et = (e) => J("/v2/sollicitation/natures", e), Dt = (e) => J("/v2/sollicitation/etats", e), Ot = ({ signal: e, baseUrl: t } = {}) => q("/v2/sollicitation/provenances", {
541
693
  params: { estDesactive: !1 },
542
694
  signal: e,
543
695
  baseUrl: t,
544
- overlay: at
545
- }), ft = ({ signal: e, baseUrl: t } = {}) => q("/collaborateurs", {
696
+ overlay: St
697
+ }), kt = ({ signal: e, baseUrl: t } = {}) => q("/collaborateurs", {
546
698
  params: { actif: !0 },
547
699
  signal: e,
548
700
  baseUrl: t
549
- }), pt = async ({ signal: e, baseUrl: t } = {}) => (await q("/v2/patrimoine/communes", {
701
+ }), At = async ({ signal: e, baseUrl: t } = {}) => (await q("/v2/patrimoine/communes", {
550
702
  signal: e,
551
703
  baseUrl: t
552
704
  }) ?? []).map((e) => ({
553
705
  idCommune: e.id,
554
706
  commune: e.libelle
555
- })), mt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/entrees", {
707
+ })), jt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/entrees", {
556
708
  params: { idCommune: e },
557
709
  signal: t,
558
710
  baseUrl: n
559
- }), ht = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/modules", {
711
+ }), Mt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/modules", {
560
712
  params: { codeProgramme: e },
561
713
  signal: t,
562
714
  baseUrl: n
563
- }), gt = ({ idContrat: e, typeContrat: t }, { signal: n, baseUrl: r } = {}) => q("/v2/patrimoine/contrat_modules", {
715
+ }), Nt = ({ idContrat: e, typeContrat: t }, { signal: n, baseUrl: r } = {}) => q("/v2/patrimoine/contrat_modules", {
564
716
  params: {
565
717
  idContrat: e,
566
718
  typeContrat: t
567
719
  },
568
720
  signal: n,
569
721
  baseUrl: r
570
- }), _t = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, baseUrl: a } = {}) => q("/v2/sollicitation/responsables", {
722
+ }), Pt = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, baseUrl: a } = {}) => q("/v2/sollicitation/responsables", {
571
723
  params: {
572
724
  motif: e,
573
725
  categorie: t,
@@ -576,11 +728,11 @@ var tt = (e, t) => {
576
728
  },
577
729
  signal: i,
578
730
  baseUrl: a
579
- }), vt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/contrat_module_rechercher", {
731
+ }), Ft = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/contrat_module_rechercher", {
580
732
  params: { recherche: e },
581
733
  signal: t,
582
734
  baseUrl: n
583
- }), yt = ({ categorie: e, recherche: t }, { signal: n, baseUrl: r } = {}) => q("/v2/cresol/reclamant_rechercher", {
735
+ }), It = ({ categorie: e, recherche: t }, { signal: n, baseUrl: r } = {}) => q("/v2/cresol/reclamant_rechercher", {
584
736
  params: {
585
737
  categorie: e,
586
738
  recherche: t
@@ -589,11 +741,11 @@ var tt = (e, t) => {
589
741
  baseUrl: r
590
742
  });
591
743
  // src/utils/apiError.js
592
- function bt(e) {
744
+ function Lt(e) {
593
745
  let t = e?.response?.data;
594
746
  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
747
  }
596
- var xt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", St = Symbol("cresol:data"), Ct = () => ({
748
+ var Rt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", zt = Symbol("cresol:data"), Bt = () => ({
597
749
  motifs: null,
598
750
  categories: null,
599
751
  types: null,
@@ -606,17 +758,17 @@ var xt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", St = Sy
606
758
  modulesByProgramme: {},
607
759
  modulesByContrat: {},
608
760
  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();
761
+ }), Vt = /* @__PURE__ */ new Map(), Ht = (e) => (Vt.has(e) || Vt.set(e, j(Bt())), Vt.get(e)), Y = /* @__PURE__ */ new Map();
762
+ function Ut() {
763
+ Vt.clear(), Y.clear();
612
764
  }
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) => {
765
+ var X = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n, Wt = (e, t, n) => e?.find((e) => e[t] === n)?.icon ?? null;
766
+ function Gt({ onError: e, baseUrl: t } = {}) {
767
+ let n = M(0), r = () => ({ baseUrl: R(t) || null }), i = () => R(t) || gt().baseUrl || "", a = () => Ht(i()), o = (t, r) => {
616
768
  let a = `${i()}|${t}`;
617
769
  if (Y.has(a)) return Y.get(a);
618
770
  n.value += 1;
619
- let o = Promise.resolve().then(r).catch((t) => (xt(t) || e?.(bt(t)), null)).finally(() => {
771
+ let o = Promise.resolve().then(r).catch((t) => (Rt(t) || e?.(Lt(t)), null)).finally(() => {
620
772
  --n.value, Y.delete(a);
621
773
  });
622
774
  return Y.set(a, o), o;
@@ -625,30 +777,30 @@ function Ot({ onError: e, baseUrl: t } = {}) {
625
777
  return a();
626
778
  },
627
779
  loading: n,
628
- isLoading: v(() => n.value > 0),
780
+ isLoading: b(() => n.value > 0),
629
781
  loadNomenclature() {
630
782
  return Promise.all([
631
- s("motifs", ot),
632
- s("categories", st),
633
- s("types", ct),
634
- s("natures", lt),
635
- s("etats", ut)
783
+ s("motifs", Ct),
784
+ s("categories", wt),
785
+ s("types", Tt),
786
+ s("natures", Et),
787
+ s("etats", Dt)
636
788
  ]);
637
789
  },
638
- loadCollaborateurs: () => s("collaborateurs", ft),
639
- loadProvenances: () => s("provenances", dt),
790
+ loadCollaborateurs: () => s("collaborateurs", kt),
791
+ loadProvenances: () => s("provenances", Ot),
640
792
  loadCommunes() {
641
- return a().communes?.length ? Promise.resolve(a().communes) : o("communes", async () => (a().communes = await pt(r()), a().communes));
793
+ return a().communes?.length ? Promise.resolve(a().communes) : o("communes", async () => (a().communes = await At(r()), a().communes));
642
794
  },
643
795
  loadAdresses(e) {
644
796
  return e == null ? Promise.resolve([]) : a().adressesByCommune[e] ? Promise.resolve(a().adressesByCommune[e]) : o(`adresses:${e}`, async () => {
645
- let t = await mt(e, r());
797
+ let t = await jt(e, r());
646
798
  return a().adressesByCommune[e] = t ?? [], t;
647
799
  });
648
800
  },
649
801
  loadModulesOfProgramme(e) {
650
802
  return e == null ? Promise.resolve([]) : a().modulesByProgramme[e] ? Promise.resolve(a().modulesByProgramme[e]) : o(`modules:${e}`, async () => {
651
- let t = await ht(e, r());
803
+ let t = await Mt(e, r());
652
804
  return a().modulesByProgramme[e] = t ?? [], t;
653
805
  });
654
806
  },
@@ -656,7 +808,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
656
808
  if (e == null) return Promise.resolve([]);
657
809
  let n = `${t ?? ""}|${e}`;
658
810
  return a().modulesByContrat[n] ? Promise.resolve(a().modulesByContrat[n]) : o(`contratModules:${n}`, async () => {
659
- let i = await gt({
811
+ let i = await Nt({
660
812
  idContrat: e,
661
813
  typeContrat: t
662
814
  }, r());
@@ -666,7 +818,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
666
818
  async searchContrats(e, { signal: t } = {}) {
667
819
  let n = (e ?? "").trim();
668
820
  if (!n) return [];
669
- let i = await vt(n, {
821
+ let i = await Ft(n, {
670
822
  ...r(),
671
823
  signal: t
672
824
  }), a = /* @__PURE__ */ new Map();
@@ -688,7 +840,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
688
840
  async searchReclamants(e, t, { signal: n } = {}) {
689
841
  let i = (t ?? "").trim();
690
842
  if (!i) return [];
691
- let a = await yt({
843
+ let a = await It({
692
844
  categorie: e,
693
845
  recherche: i
694
846
  }, {
@@ -724,7 +876,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
724
876
  },
725
877
  loadResponsables({ motif: e, categorie: t, type: n, nature: i }) {
726
878
  return e == null ? Promise.resolve([]) : a().responsablesByMotif[e] ? Promise.resolve(a().responsablesByMotif[e]) : o(`responsables:${e}`, async () => {
727
- let o = await _t({
879
+ let o = await Pt({
728
880
  motif: e,
729
881
  categorie: t,
730
882
  type: n,
@@ -753,46 +905,84 @@ function Ot({ onError: e, baseUrl: t } = {}) {
753
905
  typeLibelle: (e) => X(a().types, "id", e),
754
906
  natureLibelle: (e) => X(a().natures, "id", e),
755
907
  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)
908
+ motifIcon: (e) => Wt(a().motifs, "id", e),
909
+ categorieIcon: (e) => Wt(a().categories, "id", e),
910
+ typeIcon: (e) => Wt(a().types, "id", e),
911
+ natureIcon: (e) => Wt(a().natures, "id", e)
760
912
  };
761
- return k(c);
913
+ return j(c);
762
914
  }
763
- function kt(e) {
764
- return me(St, e), e;
915
+ function Kt(e) {
916
+ return fe(zt, e), e;
765
917
  }
766
918
  function Z() {
767
- let e = fe(St, null);
919
+ let e = ue(zt, null);
768
920
  if (!e) throw Error("useCresolData() hors de <creer-sollicitation-form>");
769
921
  return e;
770
922
  }
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
- });
923
+ // src/composables/useCresolContext.js
924
+ var qt = Symbol("cresol:options"), Jt = (e) => fe(qt, e), Q = () => ue(qt, {}), Yt = {
925
+ name: "ProvenanceSelecteurBlock",
926
+ components: { IconSelectComponent: pt },
927
+ setup() {
928
+ return {
929
+ draft: W(),
930
+ data: Z(),
931
+ options: Q()
932
+ };
933
+ },
934
+ computed: {
935
+ provenances() {
936
+ return this.options.provenances;
937
+ },
938
+ loaded() {
939
+ return this.data.cache.provenances != null;
940
+ },
941
+ selected() {
942
+ return this.draft.draft.provenance;
943
+ },
944
+ libelleFige() {
945
+ return this.data.cache.provenances?.find((e) => e.id === this.selected)?.libelle ?? this.selected ?? "—";
946
+ },
947
+ provenanceChoisie() {
948
+ return this.provenances.find((e) => e.id === this.selected) ?? null;
949
+ }
950
+ }
951
+ }, Xt = { key: 0 }, Zt = ["value"], Qt = { key: 1 }, $t = {
952
+ key: 0,
953
+ class: "fs-7 text-danger mt-1"
954
+ };
955
+ function en(e, t, n, r, i, a) {
956
+ let o = F("icon-select-component");
957
+ return r.draft.isReadonly("provenance") ? (A(), C("div", Xt, [t[1] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Provenance", -1), w("input", {
958
+ class: "form-control form-control-sm",
959
+ disabled: "",
960
+ value: a.libelleFige
961
+ }, null, 8, Zt)])) : (A(), C("div", Qt, [E(o, {
962
+ "model-value": a.provenanceChoisie?.id ?? null,
963
+ items: a.provenances,
964
+ label: "Provenance",
965
+ required: "",
966
+ "onUpdate:modelValue": t[0] ||= (e) => r.draft.setProvenance(e)
967
+ }, null, 8, ["model-value", "items"]), a.loaded && !a.provenanceChoisie ? (A(), C("div", $t, " Sélectionnez par quel canal la sollicitation vous est parvenue. ")) : S("", !0)]));
779
968
  }
969
+ var tn = /*#__PURE__*/ G(Yt, [["render", en]]);
780
970
  // src/utils/date.js
781
- function Mt(e) {
971
+ function nn(e) {
782
972
  return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toISOString().slice(0, 10);
783
973
  }
784
- function Nt(e) {
974
+ function rn(e) {
785
975
  return e ? Math.floor(new Date(e).getTime() / 1e3) : null;
786
976
  }
787
- function Pt(e) {
977
+ function an(e) {
788
978
  return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("fr-FR");
789
979
  }
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;
980
+ // src/components/ReclamantTypeBadgeComponent.vue
981
+ var on = M(!1);
982
+ st(Object.values(V).map((e) => e.icon)).then(() => {
983
+ on.value = !0;
794
984
  });
795
- var Rt = {
985
+ var sn = {
796
986
  name: "ReclamantTypeBadgeComponent",
797
987
  props: {
798
988
  reclamant: {
@@ -805,25 +995,25 @@ var Rt = {
805
995
  }
806
996
  },
807
997
  setup() {
808
- return { iconsReady: Lt };
998
+ return { iconsReady: on };
809
999
  },
810
1000
  computed: { type() {
811
1001
  return je(this.reclamant);
812
1002
  } }
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", {
1003
+ }, cn = ["title"], ln = { key: 1 };
1004
+ function un(e, t, n, r, i, a) {
1005
+ let o = F("font-awesome-icon");
1006
+ return a.type ? (A(), C("span", {
817
1007
  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`]),
1008
+ 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
1009
  title: a.type.libelle
820
- }, [r.iconsReady ? (O(), y(o, {
1010
+ }, [r.iconsReady ? (A(), x(o, {
821
1011
  key: 0,
822
1012
  icon: a.type.icon,
823
1013
  "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);
1014
+ }, null, 8, ["icon"])) : S("", !0), n.iconOnly ? S("", !0) : (A(), C("span", ln, I(a.type.libelle), 1))], 10, cn)) : S("", !0);
825
1015
  }
826
- var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
1016
+ var dn = /*#__PURE__*/ G(sn, [["render", un]]), fn = [
827
1017
  {
828
1018
  key: "locataire",
829
1019
  label: "Locataire",
@@ -880,20 +1070,21 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
880
1070
  aucun: "Aucun réclamant trouvé.",
881
1071
  placeholder: "Nom, prénom, n° de contrat, de module ou de demande, adresse, téléphone ou mail…"
882
1072
  }
883
- ], Wt = {
1073
+ ], pn = {
884
1074
  signataire: "Signataire",
885
1075
  occupant: "Occupant",
886
1076
  demandeur: "Demandeur"
887
- }, Gt = {
1077
+ }, mn = {
888
1078
  name: "ReclamantRechercheBlock",
889
1079
  components: {
890
- AmsomAutocomplete: R,
891
- AmsomOverlay: g,
892
- ReclamantTypeBadgeComponent: Ht
1080
+ AmsomAutocomplete: B,
1081
+ AmsomOverlay: v,
1082
+ IconSelectComponent: pt,
1083
+ ReclamantTypeBadgeComponent: dn
893
1084
  },
894
1085
  setup() {
895
1086
  return {
896
- draft: G(),
1087
+ draft: W(),
897
1088
  data: Z(),
898
1089
  options: Q()
899
1090
  };
@@ -909,20 +1100,30 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
909
1100
  },
910
1101
  computed: {
911
1102
  typesAutorises() {
912
- return this.options.typesReclamant ?? H;
1103
+ return this.options.typesReclamant ?? Oe;
913
1104
  },
914
1105
  autorisees() {
915
1106
  return ke(this.typesAutorises);
916
1107
  },
917
1108
  categories() {
918
- return Ut.filter((e) => e.key === "tout" ? this.autorisees.length > 1 : this.autorisees.includes(e.key));
1109
+ return fn.filter((e) => e.key === "tout" ? this.autorisees.length > 1 : this.autorisees.includes(e.key));
1110
+ },
1111
+ categoriesItems() {
1112
+ return this.categories.map((e) => ({
1113
+ id: e.key,
1114
+ libelle: e.label,
1115
+ icon: e.icon
1116
+ }));
919
1117
  },
920
1118
  categorieCourante() {
921
- return Ut.find((e) => e.key === this.categorie);
1119
+ return fn.find((e) => e.key === this.categorie);
922
1120
  },
923
1121
  selectionne() {
924
1122
  return this.draft.reclamantSelectionne;
925
1123
  },
1124
+ estFige() {
1125
+ return this.draft.isReadonly("reclamant");
1126
+ },
926
1127
  selectedTrouve: {
927
1128
  get() {
928
1129
  return this.categorie === "tout" || this.categorieOf(this.selectionne) === this.categorie ? this.selectionne : null;
@@ -936,17 +1137,17 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
936
1137
  this.categorie !== "tout" && (this.categorie = this.categorieOf(e) ?? this.categorie);
937
1138
  } },
938
1139
  async created() {
939
- this.categorie = this.categorieOf(this.selectionne) ?? this.categories[0]?.key ?? null, await jt(Ut.map((e) => e.icon)), this.iconsReady = !0;
1140
+ this.categorie = this.categorieOf(this.selectionne) ?? this.categories[0]?.key ?? null, await st(fn.map((e) => e.icon)), this.iconsReady = !0;
940
1141
  },
941
1142
  beforeUnmount() {
942
1143
  clearTimeout(this.rechercheTimeout), this.controller?.abort();
943
1144
  },
944
1145
  methods: {
945
1146
  select(e) {
946
- e && this.draft.selectReclamant(e);
1147
+ e && !this.estFige && this.draft.selectReclamant(e);
947
1148
  },
948
1149
  setCategorie(e) {
949
- e !== this.categorie && (this.categorie = e, clearTimeout(this.rechercheTimeout), this.controller?.abort(), this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1);
1150
+ e && e !== this.categorie && !this.estFige && (this.categorie = e, clearTimeout(this.rechercheTimeout), this.controller?.abort(), this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1);
950
1151
  },
951
1152
  rechercherPlusTard(e) {
952
1153
  clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercher(e), 400);
@@ -967,7 +1168,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
967
1168
  return this.autorisees.includes(t) ? t : null;
968
1169
  },
969
1170
  sortiLibelle(e) {
970
- return e?.dateSortie == null ? "sorti" : `sorti le ${Pt(e.dateSortie)}`;
1171
+ return e?.dateSortie == null ? "sorti" : `sorti le ${an(e.dateSortie)}`;
971
1172
  },
972
1173
  nomsOf(e) {
973
1174
  return (e?.individus ?? []).map((e) => [e.nom, e.prenom].filter(Boolean).join(" ")).filter(Boolean).join(", ");
@@ -989,193 +1190,108 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
989
1190
  return e ? [e.telephone, e.mail].filter(Boolean).join(" — ") : "";
990
1191
  }
991
1192
  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(", ");
1193
+ let n = [t.nom, t.prenom].filter(Boolean).join(" "), r = e.estActif && t.dateSortie != null && t.dateSortie * 1e3 < Date.now() ? `sorti le ${an(t.dateSortie)}` : null, i = [pn[t.role]?.toLowerCase(), r].filter(Boolean).join(", ");
993
1194
  return i ? `${n} (${i})` : n;
994
1195
  }).join(", ");
995
1196
  }
996
1197
  }
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 = {
1198
+ }, hn = { class: "row g-3" }, gn = {
1199
+ key: 0,
1200
+ class: "col-12 col-md-6"
1201
+ }, _n = { class: "col-12" }, vn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, yn = {
1202
+ key: 0,
1203
+ class: "ms-1 text-danger"
1204
+ }, bn = { class: "min-w-0" }, xn = {
998
1205
  key: 0,
999
1206
  class: "badge bg-warning-subtle text-warning-emphasis ms-1"
1000
- }, Qt = { class: "text-muted d-block text-truncate" }, $t = { key: 0 }, en = {
1207
+ }, Sn = { class: "text-muted d-block text-truncate" }, Cn = { key: 0 }, wn = {
1001
1208
  key: 0,
1002
1209
  class: "text-muted d-block text-truncate"
1003
- }, tn = {
1210
+ }, Tn = {
1004
1211
  key: 0,
1005
1212
  class: "text-muted"
1006
1213
  };
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, {
1214
+ function En(e, t, n, r, i, a) {
1215
+ let o = F("icon-select-component"), s = F("reclamant-type-badge-component"), c = F("amsom-autocomplete"), l = F("amsom-overlay");
1216
+ return i.iconsReady ? (A(), x(l, {
1010
1217
  key: 0,
1011
1218
  loading: r.options.repriseReclamant
1012
1219
  }, {
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",
1220
+ default: z(() => [w("div", hn, [
1221
+ e.$slots["avant-categorie"] ? (A(), C("div", gn, [P(e.$slots, "avant-categorie")])) : S("", !0),
1222
+ w("div", { class: O(["col-12", { "col-md-6": e.$slots["avant-categorie"] }]) }, [E(o, {
1223
+ "model-value": i.categorie,
1224
+ items: a.categoriesItems,
1225
+ label: "Le réclamant est…",
1226
+ disabled: a.estFige,
1227
+ "onUpdate:modelValue": t[0] ||= (e) => a.setCategorie(e)
1228
+ }, null, 8, [
1229
+ "model-value",
1054
1230
  "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;
1231
+ "disabled"
1232
+ ])], 2),
1233
+ w("div", _n, [
1234
+ w("label", vn, [T(I(a.categorieCourante.recherche), 1), a.estFige ? S("", !0) : (A(), C("span", yn, "*"))]),
1235
+ (A(), x(c, {
1236
+ key: i.categorie,
1237
+ modelValue: a.selectedTrouve,
1238
+ "onUpdate:modelValue": t[1] ||= (e) => a.selectedTrouve = e,
1239
+ items: i.trouves,
1240
+ "filtering-function": ({ items: e }) => e,
1241
+ loading: i.rechercheEnCours,
1242
+ "get-id": a.cleReclamant,
1243
+ "get-input-libelle": (e) => e?.libelle ?? "",
1244
+ placeholder: a.categorieCourante.placeholder,
1245
+ "input-size": "sm",
1246
+ disabled: a.estFige,
1247
+ "hide-choices": "",
1248
+ "debounce-delay": 0,
1249
+ onSearch: a.rechercherPlusTard
1250
+ }, {
1251
+ options: z((e) => [w("div", bn, [
1252
+ w("div", { class: O(["fw-medium text-truncate", e?.estActif ? "" : "text-muted"]) }, [
1253
+ E(s, {
1254
+ reclamant: e,
1255
+ "icon-only": "",
1256
+ class: "me-1"
1257
+ }, null, 8, ["reclamant"]),
1258
+ T(" " + I(a.titreOf(e)) + " ", 1),
1259
+ e?.estActif ? S("", !0) : (A(), C("span", xn, I(a.categorieOf(e) === "demandeur" ? "inactive" : a.sortiLibelle(e)), 1))
1260
+ ], 2),
1261
+ w("small", Sn, [T(I(a.referenceOf(e)) + " ", 1), e?.adresse ? (A(), C("span", Cn, " — " + I(e.adresse), 1)) : S("", !0)]),
1262
+ a.detailOf(e) ? (A(), C("small", wn, I(a.detailOf(e)), 1)) : S("", !0)
1263
+ ])]),
1264
+ _: 1
1265
+ }, 8, [
1266
+ "modelValue",
1267
+ "items",
1268
+ "filtering-function",
1269
+ "loading",
1270
+ "get-id",
1271
+ "get-input-libelle",
1272
+ "placeholder",
1273
+ "disabled",
1274
+ "onSearch"
1275
+ ])),
1276
+ i.rechercheFaite && !i.rechercheEnCours && !i.trouves.length ? (A(), C("small", Tn, I(a.categorieCourante.aucun), 1)) : S("", !0)
1277
+ ])
1278
+ ])]),
1279
+ _: 3
1280
+ }, 8, ["loading"])) : S("", !0);
1158
1281
  }
1159
- // src/components/ReclamantSelecteurBlock.vue
1160
- var yn = {
1282
+ var Dn = /*#__PURE__*/ G(mn, [["render", En]]), On = {
1161
1283
  name: "ReclamantSelecteurBlock",
1162
1284
  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
- }
1285
+ AmsomAutocomplete: B,
1286
+ ReclamantTypeBadgeComponent: dn
1175
1287
  },
1288
+ props: { mode: {
1289
+ type: String,
1290
+ default: null
1291
+ } },
1176
1292
  setup() {
1177
1293
  return {
1178
- draft: G(),
1294
+ draft: W(),
1179
1295
  options: Q()
1180
1296
  };
1181
1297
  },
@@ -1202,30 +1318,32 @@ var yn = {
1202
1318
  this.draft.selectReclamant(e);
1203
1319
  },
1204
1320
  filterReclamants({ search: e, items: t }) {
1205
- let n = ($(e) ?? "").trim();
1206
- return n ? t.filter((e) => ($(e?.libelle) ?? "").includes(n)) : t;
1321
+ let n = (K(e) ?? "").trim();
1322
+ return n ? t.filter((e) => (K(e?.libelle) ?? "").includes(n)) : t;
1207
1323
  }
1208
1324
  }
1209
- }, bn = {
1210
- key: 0,
1211
- class: "fs-7 text-muted"
1212
- }, xn = { class: "fw-medium" }, Sn = {
1325
+ }, kn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, An = {
1213
1326
  key: 0,
1214
- class: "btn-group btn-group-sm",
1327
+ class: "ms-1 text-danger"
1328
+ }, jn = ["value"], Mn = {
1329
+ key: 1,
1330
+ class: "btn-group btn-group-sm w-100",
1215
1331
  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", {
1332
+ }, Nn = ["onClick"], Pn = ["value"], Fn = ["value"];
1333
+ function In(e, t, n, r, i, a) {
1334
+ let o = F("reclamant-type-badge-component"), s = F("amsom-autocomplete");
1335
+ return A(), C("div", null, [w("label", kn, [t[2] ||= T(" Réclamant", -1), a.estFige ? S("", !0) : (A(), C("span", An, "*"))]), a.estFige ? (A(), C("input", {
1336
+ key: 0,
1337
+ class: "form-control form-control-sm",
1338
+ disabled: "",
1339
+ value: a.reclamantSelectionne?.libelle ?? "—"
1340
+ }, null, 8, jn)) : a.presentation === "switch" ? (A(), C("div", Mn, [(A(!0), C(y, null, N(a.reclamants, (e, t) => (A(), C("button", {
1223
1341
  key: t,
1224
1342
  type: "button",
1225
- class: E(["btn btn-sm py-0", e === a.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
1343
+ class: O(["btn d-inline-flex align-items-center justify-content-center", e === a.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
1226
1344
  onClick: (t) => a.select(e)
1227
- }, P(e.libelle), 11, Cn))), 128))])) : a.presentation === "autocomplete" ? (O(), y(s, {
1228
- key: 1,
1345
+ }, I(e.libelle), 11, Nn))), 128))])) : a.presentation === "autocomplete" ? (A(), x(s, {
1346
+ key: 2,
1229
1347
  "model-value": a.reclamantSelectionne,
1230
1348
  items: a.reclamants,
1231
1349
  "get-id": a.reclamantId,
@@ -1233,354 +1351,63 @@ function En(e, t, n, r, i, a) {
1233
1351
  "filtering-function": a.filterReclamants,
1234
1352
  placeholder: "Rechercher un réclamant…",
1235
1353
  "input-size": "sm",
1236
- "hide-choices": "",
1237
- class: E(n.inline ? "" : "w-100"),
1354
+ required: "",
1238
1355
  "onUpdate:modelValue": t[0] ||= (e) => a.select(e)
1239
1356
  }, {
1240
- options: L((e) => [w(o, {
1357
+ options: z((e) => [E(o, {
1241
1358
  reclamant: e,
1242
1359
  "icon-only": "",
1243
1360
  class: "me-1"
1244
- }, null, 8, ["reclamant"]), C(" " + P(e?.libelle), 1)]),
1361
+ }, null, 8, ["reclamant"]), T(" " + I(e?.libelle), 1)]),
1245
1362
  _: 1
1246
1363
  }, 8, [
1247
1364
  "model-value",
1248
1365
  "items",
1249
1366
  "get-id",
1250
1367
  "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" : ""]),
1368
+ "filtering-function"
1369
+ ])) : (A(), C("select", {
1370
+ key: 3,
1371
+ class: "form-select form-select-sm",
1256
1372
  value: a.reclamants.indexOf(a.reclamantSelectionne),
1257
1373
  onChange: t[1] ||= (e) => a.select(a.reclamants[e.target.value])
1258
- }, [(O(!0), x(_, null, j(a.reclamants, (e, t) => (O(), x("option", {
1374
+ }, [(A(!0), C(y, null, N(a.reclamants, (e, t) => (A(), C("option", {
1259
1375
  key: t,
1260
1376
  value: t
1261
- }, P(e.libelle), 9, Tn))), 128))], 42, wn))], 2));
1377
+ }, I(e.libelle), 9, Fn))), 128))], 40, Pn))]);
1262
1378
  }
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;
1379
+ var Ln = /*#__PURE__*/ G(On, [["render", In]]), Rn = {
1380
+ B: "briefcase",
1381
+ M: "store",
1382
+ W: "dungeon",
1383
+ E: "user-graduate",
1384
+ K: "building-shield",
1385
+ F: "person-shelter",
1386
+ S: "square-parking",
1387
+ V: "hands-holding"
1388
+ };
1389
+ function zn(e, t = !1, n = "circle-question") {
1390
+ return e === "L" ? t ? "building" : "house" : Rn[e] ?? n;
1391
+ }
1392
+ function Bn(e) {
1393
+ return e ? e.idCategorieModule === "L" ? e.estCollectif ? "Appartement" : "Maison" : e.categorieModule ?? "" : "";
1394
+ }
1395
+ // src/components/CiblePickerBlock.vue
1396
+ var Vn = 0, Hn = {
1397
+ name: "CiblePickerBlock",
1398
+ components: { AmsomAutocomplete: B },
1399
+ props: {
1400
+ patrimoine: {
1401
+ type: Object,
1402
+ default: null
1289
1403
  },
1290
- motifFige() {
1291
- return this.draft.isReadonly("motif");
1404
+ cibleMode: {
1405
+ type: String,
1406
+ default: "contrat"
1292
1407
  },
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 ?? ""));
1295
- },
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 }));
1301
- },
1302
- categoriesList() {
1303
- return this.distinct(this.allowedMotifs, "idCategorie", "categorie", (e) => this.data.categorieIcon(e));
1304
- },
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: () => []
1408
+ reclamantModules: {
1409
+ type: Array,
1410
+ default: () => []
1584
1411
  },
1585
1412
  reclamantType: {
1586
1413
  type: String,
@@ -1623,7 +1450,7 @@ var $n = 0, er = {
1623
1450
  },
1624
1451
  data() {
1625
1452
  return {
1626
- uid: ++$n,
1453
+ uid: ++Vn,
1627
1454
  rechercheContrat: "",
1628
1455
  contratsTrouves: [],
1629
1456
  rechercheEnCours: !1,
@@ -1770,7 +1597,7 @@ var $n = 0, er = {
1770
1597
  clearTimeout(this.rechercheTimeout), this.controller?.abort();
1771
1598
  },
1772
1599
  methods: {
1773
- formatDate: Pt,
1600
+ formatDate: an,
1774
1601
  rechercherPlusTard(e) {
1775
1602
  clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercherContrat(e), 400);
1776
1603
  },
@@ -1790,16 +1617,16 @@ var $n = 0, er = {
1790
1617
  },
1791
1618
  filterOn(e) {
1792
1619
  return ({ search: t, items: n }) => {
1793
- let r = ($(t) ?? "").trim();
1794
- return r ? n.filter((t) => ($(t?.[e]) ?? "").includes(r)) : n;
1620
+ let r = (K(t) ?? "").trim();
1621
+ return r ? n.filter((t) => (K(t?.[e]) ?? "").includes(r)) : n;
1795
1622
  };
1796
1623
  },
1797
1624
  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;
1625
+ let n = (K(e) ?? "").trim();
1626
+ return n ? t.filter((e) => String(e?.idModule ?? "").includes(n) || (K(this.moduleInputLibelle(e)) ?? "").includes(n) || (K(e?._autreLibelle) ?? "").includes(n)) : t;
1800
1627
  },
1801
- getCategorieModuleIcon: Zn,
1802
- categorieLibelle: Qn,
1628
+ getCategorieModuleIcon: zn,
1629
+ categorieLibelle: Bn,
1803
1630
  moduleLibelle(e) {
1804
1631
  return e ? e.libelleModule ?? e.adresse ?? `Module ${e.idModule}` : "";
1805
1632
  },
@@ -1811,63 +1638,63 @@ var $n = 0, er = {
1811
1638
  return !!e?.dateFin && e.dateFin < Math.floor(Date.now() / 1e3);
1812
1639
  }
1813
1640
  }
1814
- }, tr = { class: "d-flex flex-column gap-3" }, nr = {
1641
+ }, Un = { class: "d-flex flex-column gap-3" }, Wn = {
1815
1642
  class: "btn-group w-100",
1816
1643
  role: "group"
1817
- }, rr = ["onClick"], ir = { class: "text-muted d-block mt-1" }, ar = {
1644
+ }, Gn = ["onClick"], Kn = { class: "text-muted d-block mt-1" }, qn = {
1818
1645
  key: 0,
1819
1646
  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 = {
1647
+ }, Jn = ["id", "checked"], Yn = ["for"], Xn = { key: 1 }, Zn = { class: "min-w-0" }, Qn = { class: "fw-medium text-truncate text-capitalize" }, $n = { class: "d-flex flex-wrap align-items-center gap-1" }, er = { class: "text-muted" }, tr = {
1821
1648
  key: 0,
1822
1649
  class: "badge bg-info"
1823
- }, mr = {
1650
+ }, nr = {
1824
1651
  key: 1,
1825
1652
  class: "badge bg-warning"
1826
- }, hr = {
1653
+ }, rr = {
1827
1654
  key: 0,
1828
1655
  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 = {
1656
+ }, ir = { key: 1 }, ar = { class: "row g-2" }, or = ["aria-pressed", "onClick"], sr = { class: "min-w-0" }, cr = { class: "d-block fw-semibold fs-6" }, lr = { class: "d-block text-muted" }, ur = {
1830
1657
  key: 2,
1831
1658
  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 = {
1659
+ }, dr = { class: "min-w-0" }, fr = { class: "fw-medium text-truncate" }, pr = { class: "text-muted d-block text-truncate" }, mr = ["value"], hr = ["value"], gr = ["value"], _r = {
1833
1660
  key: 0,
1834
1661
  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 = {
1662
+ }, vr = { class: "d-flex flex-wrap align-items-center gap-1" }, yr = ["title"], br = { class: "text-muted" }, xr = {
1836
1663
  key: 1,
1837
1664
  class: "d-block text-truncate"
1838
- }, Pr = {
1665
+ }, Sr = {
1839
1666
  key: 2,
1840
1667
  class: "text-muted d-block"
1841
- }, Fr = {
1668
+ }, Cr = {
1842
1669
  key: 0,
1843
1670
  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", {
1671
+ }, wr = { class: "form-check mb-0 ms-3" }, Tr = ["id", "checked"], Er = ["for"];
1672
+ function Dr(e, t, n, r, i, a) {
1673
+ let o = F("font-awesome-icon"), s = F("amsom-autocomplete");
1674
+ return A(), C("div", Un, [
1675
+ w("div", null, [
1676
+ t[7] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " La sollicitation concerne… ", -1),
1677
+ w("div", Wn, [(A(!0), C(y, null, N(a.availableModes, (t) => (A(), C("button", {
1851
1678
  key: t.key,
1852
1679
  type: "button",
1853
- class: E(["btn btn-sm", n.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
1680
+ class: O(["btn btn-sm", n.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
1854
1681
  onClick: (n) => e.$emit("change-mode", t.key)
1855
- }, [w(o, {
1682
+ }, [E(o, {
1856
1683
  icon: t.icon,
1857
1684
  class: "me-1"
1858
- }, null, 8, ["icon"]), C(" " + P(t.label), 1)], 10, rr))), 128))]),
1859
- S("small", ir, P(a.currentMode?.aide), 1)
1685
+ }, null, 8, ["icon"]), T(" " + I(t.label), 1)], 10, Gn))), 128))]),
1686
+ w("small", Kn, I(a.currentMode?.aide), 1)
1860
1687
  ]),
1861
- n.cibleMode === "contrat" ? (O(), x(_, { key: 0 }, [n.afficheCaseContratReclamant ? (O(), x("div", ar, [S("input", {
1688
+ n.cibleMode === "contrat" ? (A(), C(y, { key: 0 }, [n.afficheCaseContratReclamant ? (A(), C("div", qn, [w("input", {
1862
1689
  id: `contrat-reclamant-${i.uid}`,
1863
1690
  class: "form-check-input",
1864
1691
  type: "checkbox",
1865
1692
  checked: n.contratReclamant,
1866
1693
  onChange: t[0] ||= (t) => e.$emit("toggle-contrat-reclamant", t.target.checked)
1867
- }, null, 40, or), S("label", {
1694
+ }, null, 40, Jn), w("label", {
1868
1695
  class: "form-check-label fs-7",
1869
1696
  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, {
1697
+ }, " Contrat du réclamant ", 8, Yn)])) : S("", !0), n.contratReclamant ? S("", !0) : (A(), C("div", Xn, [t[8] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Contrat ciblé ", -1), E(s, {
1871
1698
  modelValue: a.selectedContrat,
1872
1699
  "onUpdate:modelValue": t[1] ||= (e) => a.selectedContrat = e,
1873
1700
  items: i.contratsTrouves,
@@ -1881,14 +1708,14 @@ function zr(e, t, n, r, i, a) {
1881
1708
  "debounce-delay": 0,
1882
1709
  onSearch: a.rechercherPlusTard
1883
1710
  }, {
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)
1711
+ options: z((e) => [w("div", Zn, [
1712
+ w("div", Qn, I(e?.libelle ?? `Contrat ${e?.idContrat}`), 1),
1713
+ w("div", $n, [
1714
+ w("small", er, "N° " + I(e?.typeContrat) + "/" + I(e?.idContrat), 1),
1715
+ e?.nbModules > 1 ? (A(), C("span", tr, I(e.nbModules) + " modules", 1)) : S("", !0),
1716
+ e?.estSorti ? (A(), C("span", nr, I(e.dateSortie ? `Sorti le ${a.formatDate(e.dateSortie)}` : "Sorti"), 1)) : S("", !0)
1890
1717
  ]),
1891
- a.contratAdresse(e) ? (O(), x("small", hr, P(a.contratAdresse(e)), 1)) : b("", !0)
1718
+ a.contratAdresse(e) ? (A(), C("small", rr, I(a.contratAdresse(e)), 1)) : S("", !0)
1892
1719
  ])]),
1893
1720
  _: 1
1894
1721
  }, 8, [
@@ -1899,22 +1726,22 @@ function zr(e, t, n, r, i, a) {
1899
1726
  "get-id",
1900
1727
  "get-input-libelle",
1901
1728
  "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", {
1729
+ ])]))], 64)) : S("", !0),
1730
+ n.cibleMode === "patrimoine" ? (A(), C("div", ir, [t[9] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le problème concerne… ", -1), w("div", ar, [(A(!0), C(y, null, N(a.portees, (t) => (A(), C("div", {
1904
1731
  key: t.titre,
1905
1732
  class: "col-12 col-md-6"
1906
- }, [S("button", {
1733
+ }, [w("button", {
1907
1734
  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"]),
1735
+ 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
1736
  "aria-pressed": t.modulePrecis === n.modulePrecis,
1910
1737
  onClick: (n) => e.$emit("set-module-precis", t.modulePrecis)
1911
- }, [w(o, {
1738
+ }, [E(o, {
1912
1739
  icon: t.icon,
1913
1740
  class: "fs-4",
1914
1741
  "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, {
1742
+ }, null, 8, ["icon"]), w("span", sr, [w("span", cr, I(t.titre), 1), w("small", lr, I(t.aide), 1)])], 10, or)]))), 128))])])) : S("", !0),
1743
+ n.cibleMode === "contrat" || n.cibleMode === "patrimoine" ? (A(), C("div", ur, [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 }, [
1744
+ 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
1745
  modelValue: a.selectedCommune,
1919
1746
  "onUpdate:modelValue": t[2] ||= (e) => a.selectedCommune = e,
1920
1747
  items: r.data.cache.communes || [],
@@ -1931,7 +1758,7 @@ function zr(e, t, n, r, i, a) {
1931
1758
  "get-input-libelle",
1932
1759
  "filtering-function"
1933
1760
  ])]),
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, {
1761
+ 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
1762
  modelValue: a.selectedAdresse,
1936
1763
  "onUpdate:modelValue": t[3] ||= (e) => a.selectedAdresse = e,
1937
1764
  items: a.adresses,
@@ -1943,7 +1770,7 @@ function zr(e, t, n, r, i, a) {
1943
1770
  "input-size": "sm",
1944
1771
  "hide-choices": ""
1945
1772
  }, {
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)])]),
1773
+ options: z((e) => [w("div", dr, [w("div", fr, I(e?.entree), 1), w("small", pr, I(e?.commune) + " — Programme " + I(e?.codeProgramme), 1)])]),
1947
1774
  _: 1
1948
1775
  }, 8, [
1949
1776
  "modelValue",
@@ -1953,7 +1780,7 @@ function zr(e, t, n, r, i, a) {
1953
1780
  "filtering-function",
1954
1781
  "disabled"
1955
1782
  ])]),
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, {
1783
+ 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
1784
  modelValue: a.selectedEtage,
1958
1785
  "onUpdate:modelValue": t[4] ||= (e) => a.selectedEtage = e,
1959
1786
  items: a.etages,
@@ -1970,25 +1797,25 @@ function zr(e, t, n, r, i, a) {
1970
1797
  "get-input-libelle",
1971
1798
  "disabled"
1972
1799
  ])])
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", {
1800
+ ], 64)) : (A(), C(y, { key: 1 }, [
1801
+ 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
1802
  class: "form-control form-control-sm",
1976
1803
  disabled: "",
1977
1804
  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", {
1805
+ }, null, 8, mr)]),
1806
+ 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
1807
  class: "form-control form-control-sm",
1981
1808
  disabled: "",
1982
1809
  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", {
1810
+ }, null, 8, hr)]),
1811
+ 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
1812
  class: "form-control form-control-sm",
1986
1813
  disabled: "",
1987
1814
  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, {
1815
+ }, null, 8, gr)])
1816
+ ], 64))], 2), a.afficheModule ? (A(), C("div", _r, [
1817
+ t[16] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Module", -1),
1818
+ E(s, {
1992
1819
  modelValue: a.selectedModule,
1993
1820
  "onUpdate:modelValue": t[5] ||= (e) => a.selectedModule = e,
1994
1821
  items: a.modules,
@@ -2000,20 +1827,20 @@ function zr(e, t, n, r, i, a) {
2000
1827
  "input-size": "sm",
2001
1828
  "hide-choices": ""
2002
1829
  }, {
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, {
1830
+ options: z((e) => [w("div", { class: O(["min-w-0 w-100 rounded position-relative", e?._autreLibelle ? "bg-yellow-subtle p-2" : ""]) }, [
1831
+ e?._autreLibelle ? (A(), x(o, {
2005
1832
  key: 0,
2006
1833
  icon: "building",
2007
1834
  class: "position-absolute top-0 end-0 m-1 text-muted",
2008
1835
  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", {
1836
+ })) : S("", !0),
1837
+ w("div", { class: O(["fw-medium text-truncate", [e?._autreLibelle ? "text-muted" : "", a.isExit(e) ? "text-decoration-line-through" : ""]]) }, I(a.moduleLibelle(e)), 3),
1838
+ w("div", vr, [a.categorieLibelle(e) ? (A(), C("span", {
2012
1839
  key: 0,
2013
1840
  class: "badge bg-info",
2014
1841
  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))
1842
+ }, [E(o, { icon: a.getCategorieModuleIcon(e?.idCategorieModule, e?.estCollectif) }, null, 8, ["icon"])], 8, yr)) : S("", !0), w("small", br, "N° " + I(e?.idModule), 1)]),
1843
+ e?._autreLibelle ? (A(), C("small", xr, I(e._autreLibelle), 1)) : e?.etage == null ? S("", !0) : (A(), C("small", Sr, " Étage " + I(e.etage), 1))
2017
1844
  ], 2)]),
2018
1845
  _: 1
2019
1846
  }, 8, [
@@ -2024,42 +1851,51 @@ function zr(e, t, n, r, i, a) {
2024
1851
  "filtering-function",
2025
1852
  "disabled"
2026
1853
  ]),
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, {
1854
+ n.locataireActuelOption ? (A(), C("div", Cr, [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
1855
  icon: "circle-info",
2029
1856
  class: "mt-1"
2030
- }), S("span", null, P(n.locataireActuelOption.hint), 1)], 2), S("div", Ir, [S("input", {
1857
+ }), w("span", null, I(n.locataireActuelOption.hint), 1)], 2), w("div", wr, [w("input", {
2031
1858
  id: `locataire-actuel-${i.uid}`,
2032
1859
  class: "form-check-input",
2033
1860
  type: "checkbox",
2034
1861
  checked: n.locataireActuelOption.reprendre,
2035
1862
  onChange: t[6] ||= (t) => e.$emit("toggle-reprendre-locataire-actuel", t.target.checked)
2036
- }, null, 40, Lr), S("label", {
1863
+ }, null, 40, Tr), w("label", {
2037
1864
  class: "form-check-label fs-7",
2038
1865
  for: `locataire-actuel-${i.uid}`
2039
- }, " Rattacher au locataire actuel du module ", 8, Rr)])])) : b("", !0)
2040
- ])) : b("", !0)])) : b("", !0)
1866
+ }, " Rattacher au locataire actuel du module ", 8, Er)])])) : S("", !0)
1867
+ ])) : S("", !0)])) : S("", !0)
2041
1868
  ]);
2042
1869
  }
2043
- // src/components/EtapeCibleBlock.vue
2044
- var Br = {
2045
- name: "EtapeCibleBlock",
1870
+ var Or = /*#__PURE__*/ G(Hn, [["render", Dr]]), kr = 0, Ar = {
1871
+ name: "LigneCibleBlock",
2046
1872
  components: {
2047
- AmsomOverlay: g,
2048
- CiblePickerBlock: /* @__PURE__ */ K(er, [["render", zr]])
1873
+ AmsomOverlay: v,
1874
+ CiblePickerBlock: Or
2049
1875
  },
1876
+ props: { index: {
1877
+ type: Number,
1878
+ required: !0
1879
+ } },
2050
1880
  setup() {
2051
1881
  return {
2052
- draft: G(),
1882
+ draft: W(),
2053
1883
  data: Z(),
2054
1884
  options: Q()
2055
1885
  };
2056
1886
  },
1887
+ data() {
1888
+ return { uid: ++kr };
1889
+ },
2057
1890
  computed: {
2058
- lignePrincipale() {
2059
- return this.draft.lignePrincipale;
1891
+ isPrincipale() {
1892
+ return this.index === 0;
2060
1893
  },
2061
- lignesAssociees() {
2062
- return this.draft.lignesAssociees;
1894
+ ligne() {
1895
+ return this.draft.draft.lignes[this.index];
1896
+ },
1897
+ cibleFigee() {
1898
+ return this.draft.isReadonly("cible");
2063
1899
  },
2064
1900
  reclamantModules() {
2065
1901
  return this.options.modulesReclamant ?? [];
@@ -2067,68 +1903,18 @@ var Br = {
2067
1903
  mainModule() {
2068
1904
  return this.draft.moduleReclamantPrincipal;
2069
1905
  },
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) {
1906
+ localisation() {
1907
+ let e = this.ligne?.patrimoine;
2089
1908
  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)
1909
+ actif: !this.cibleFigee && !!e && this.ligne.cibleMode !== "demande",
1910
+ idCommune: e?.idCommune ?? null,
1911
+ codeProgramme: this.ligne?.cibleMode === "patrimoine" ? e?.codeProgramme ?? null : null
2099
1912
  };
2100
1913
  },
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) {
1914
+ locataireActuelOption() {
1915
+ let e = this.ligne;
2130
1916
  if (e?.cibleMode !== "contrat") return null;
2131
- let t = e?.patrimoine;
1917
+ let t = e.patrimoine;
2132
1918
  if (!t || t.idModule == null) return null;
2133
1919
  let n = e.contratReclamant && this.draft.reclamantEstContrat, r = n ? {
2134
1920
  typeContrat: this.draft.draft.reclamant.type,
@@ -2146,101 +1932,722 @@ var Br = {
2146
1932
  reprendre: i,
2147
1933
  hint: a
2148
1934
  };
1935
+ }
1936
+ },
1937
+ watch: { localisation: {
1938
+ immediate: !0,
1939
+ deep: !0,
1940
+ handler({ actif: e, idCommune: t, codeProgramme: n }) {
1941
+ e && (this.data.loadCommunes(), this.data.loadAdresses(t), this.data.loadModulesOfProgramme(n));
1942
+ }
1943
+ } },
1944
+ created() {
1945
+ this.isPrincipale && !this.cibleFigee && !this.draft.reclamantEstContrat && this.ligne.cibleMode === "contrat" && this.draft.setCibleMode(0, "patrimoine");
1946
+ },
1947
+ methods: {
1948
+ onChangeMode(e) {
1949
+ this.draft.setCibleMode(this.index, e), e !== "demande" && this.draft.prefillFromModule(this.index, this.mainModule);
1950
+ },
1951
+ onSelectModule(e) {
1952
+ e && this.ligne.cibleMode === "contrat" ? this.draft.prefillFromModule(this.index, e) : this.draft.setPatrimoineModule(this.index, e ?? null);
2149
1953
  },
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));
1954
+ onToggleContratReclamant(e) {
1955
+ this.draft.toggleContratReclamant(this.index, e), e && this.draft.prefillFromModule(this.index, this.mainModule);
1956
+ },
1957
+ onSelectContrat(e) {
1958
+ this.draft.setContratCible(this.index, e), e && this.data.loadModulesOfContrat({
1959
+ idContrat: e.idContrat,
1960
+ typeContrat: e.typeContrat
1961
+ });
2152
1962
  }
2153
1963
  }
2154
- }, Vr = { class: "d-flex flex-column gap-3" }, Hr = {
1964
+ }, jr = {
2155
1965
  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 = {
1966
+ class: "d-flex flex-wrap align-items-center gap-2"
1967
+ }, Mr = { class: "fw-medium fs-7" }, Nr = {
2161
1968
  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 = [
1969
+ class: "form-check form-switch mb-0"
1970
+ }, Pr = ["id", "checked"], Fr = ["for"];
1971
+ function Ir(e, t, n, r, i, a) {
1972
+ let o = F("font-awesome-icon"), s = F("cible-picker-block"), c = F("amsom-overlay");
1973
+ return A(), C("div", { class: O({ "border rounded p-2": !a.isPrincipale }) }, [a.isPrincipale ? S("", !0) : (A(), C("div", jr, [w("span", Mr, I(a.ligne.libelle), 1), a.cibleFigee ? S("", !0) : (A(), C("div", Nr, [w("input", {
1974
+ id: `memecible-${i.uid}`,
1975
+ class: "form-check-input",
1976
+ type: "checkbox",
1977
+ checked: !a.ligne.cibleOverride,
1978
+ onChange: t[0] ||= (e) => r.draft.toggleCibleOverride(n.index)
1979
+ }, null, 40, Pr), w("label", {
1980
+ class: "form-check-label fs-7",
1981
+ for: `memecible-${i.uid}`
1982
+ }, " Même cible que la ligne principale ", 8, Fr)]))])), a.cibleFigee ? (A(), C("div", {
1983
+ key: 1,
1984
+ class: O(["fs-7", { "mt-1": !a.isPrincipale }])
1985
+ }, [E(o, {
1986
+ icon: "location-dot",
1987
+ class: "text-primary me-2"
1988
+ }), T(" " + I(r.draft.cibleResume(a.ligne)), 1)], 2)) : a.isPrincipale || a.ligne.cibleOverride ? (A(), x(c, {
1989
+ key: 2,
1990
+ loading: r.data.isLoading && !r.data.cache.communes?.length
1991
+ }, {
1992
+ default: z(() => [E(s, {
1993
+ class: O({ "mt-2": !a.isPrincipale }),
1994
+ patrimoine: a.ligne.patrimoine,
1995
+ "cible-mode": a.ligne.cibleMode,
1996
+ "reclamant-modules": a.reclamantModules,
1997
+ "reclamant-type": r.draft.draft.reclamant.type,
1998
+ "contrat-reclamant": a.ligne.contratReclamant,
1999
+ "contrat-cible": a.ligne.contratCible,
2000
+ "module-precis": a.ligne.modulePrecis,
2001
+ "affiche-case-contrat-reclamant": r.draft.reclamantEstContrat,
2002
+ "locataire-actuel-option": a.locataireActuelOption,
2003
+ onChangeMode: a.onChangeMode,
2004
+ onSelectCommune: t[1] ||= (e) => r.draft.setPatrimoineCommune(n.index, e ?? null),
2005
+ onSelectAdresse: t[2] ||= (e) => r.draft.setPatrimoineEntree(n.index, e ?? null),
2006
+ onSelectEtage: t[3] ||= (e) => r.draft.setPatrimoineEtage(n.index, e ?? null),
2007
+ onSelectModule: a.onSelectModule,
2008
+ onSelectContrat: a.onSelectContrat,
2009
+ onToggleContratReclamant: a.onToggleContratReclamant,
2010
+ onToggleReprendreLocataireActuel: t[4] ||= (e) => r.draft.setReprendreLocataireActuel(n.index, e),
2011
+ onSetModulePrecis: t[5] ||= (e) => r.draft.setModulePrecis(n.index, e)
2012
+ }, null, 8, [
2013
+ "class",
2014
+ "patrimoine",
2015
+ "cible-mode",
2016
+ "reclamant-modules",
2017
+ "reclamant-type",
2018
+ "contrat-reclamant",
2019
+ "contrat-cible",
2020
+ "module-precis",
2021
+ "affiche-case-contrat-reclamant",
2022
+ "locataire-actuel-option",
2023
+ "onChangeMode",
2024
+ "onSelectModule",
2025
+ "onSelectContrat",
2026
+ "onToggleContratReclamant"
2027
+ ])]),
2028
+ _: 1
2029
+ }, 8, ["loading"])) : S("", !0)], 2);
2030
+ }
2031
+ var Lr = /*#__PURE__*/ G(Ar, [["render", Ir]]), Rr = {
2032
+ name: "EtapeReclamantCibleBlock",
2033
+ components: {
2034
+ SectionComponent: at,
2035
+ ProvenanceSelecteurBlock: tn,
2036
+ ReclamantRechercheBlock: Dn,
2037
+ ReclamantSelecteurBlock: Ln,
2038
+ LigneCibleBlock: Lr
2039
+ },
2040
+ setup() {
2041
+ return {
2042
+ draft: W(),
2043
+ options: Q()
2044
+ };
2045
+ }
2046
+ }, zr = { class: "d-flex flex-column gap-4" }, Br = {
2047
+ key: 2,
2048
+ class: "row g-3"
2049
+ }, Vr = { class: "col-12 col-md-6" }, Hr = { class: "col-12 col-md-6" };
2050
+ function Ur(e, t, n, r, i, a) {
2051
+ 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");
2052
+ return A(), C("div", zr, [E(l, {
2053
+ titre: "Réclamant",
2054
+ aide: "La personne à l’origine de la sollicitation : locataire, tiers, fournisseur…"
2055
+ }, {
2056
+ default: z(() => [e.$slots.reclamant ? (A(), C(y, { key: 0 }, [E(o), P(e.$slots, "reclamant", {
2057
+ reclamant: r.draft.reclamantSelectionne,
2058
+ select: r.draft.selectReclamant
2059
+ })], 64)) : r.options.rechercheReclamant ? (A(), x(s, { key: 1 }, {
2060
+ "avant-categorie": z(() => [E(o)]),
2061
+ _: 1
2062
+ })) : (A(), C("div", Br, [w("div", Vr, [E(o)]), w("div", Hr, [E(c)])]))]),
2063
+ _: 3
2064
+ }), r.draft.reclamantSelectionne ? (A(), x(l, {
2065
+ key: 0,
2066
+ titre: "Cible",
2067
+ 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"
2068
+ }, {
2069
+ default: z(() => [E(u, { index: 0 })]),
2070
+ _: 1
2071
+ }, 8, ["aide"])) : S("", !0)]);
2072
+ }
2073
+ var Wr = /*#__PURE__*/ G(Rr, [["render", Ur]]), Gr = {
2074
+ name: "SeparateurComponent",
2075
+ props: { texte: {
2076
+ type: String,
2077
+ required: !0
2078
+ } }
2079
+ }, Kr = { class: "d-flex align-items-center gap-2 text-muted fs-7" };
2080
+ function qr(e, t, n, r, i, a) {
2081
+ return A(), C("div", Kr, [
2082
+ t[0] ||= w("hr", { class: "flex-grow-1 my-0" }, null, -1),
2083
+ w("span", null, I(n.texte), 1),
2084
+ t[1] ||= w("hr", { class: "flex-grow-1 my-0" }, null, -1)
2085
+ ]);
2086
+ }
2087
+ var Jr = /*#__PURE__*/ G(Gr, [["render", qr]]), Yr = {
2088
+ reclamant: {
2089
+ icon: "user",
2090
+ label: "Réclamant"
2091
+ },
2092
+ cible: {
2093
+ icon: "location-dot",
2094
+ label: "Cible"
2095
+ },
2096
+ motif: {
2097
+ icon: "tag",
2098
+ label: "Motif"
2099
+ }
2100
+ }, Xr = {
2101
+ name: "RecapBlock",
2102
+ props: {
2103
+ index: {
2104
+ type: Number,
2105
+ default: 0
2106
+ },
2107
+ champs: {
2108
+ type: Array,
2109
+ default: () => [
2110
+ "reclamant",
2111
+ "cible",
2112
+ "motif"
2113
+ ],
2114
+ validator: (e) => e.every((e) => Yr[e])
2115
+ }
2116
+ },
2117
+ setup() {
2118
+ return {
2119
+ draft: W(),
2120
+ data: Z()
2121
+ };
2122
+ },
2123
+ computed: {
2124
+ ligne() {
2125
+ return this.draft.draft.lignes[this.index];
2126
+ },
2127
+ valeurs() {
2128
+ return {
2129
+ reclamant: this.reclamant,
2130
+ cible: this.ligne ? this.draft.cibleResume(this.ligne) : null,
2131
+ motif: this.motif
2132
+ };
2133
+ },
2134
+ reclamant() {
2135
+ let e = this.draft.reclamantSelectionne?.libelle;
2136
+ if (!e) return null;
2137
+ let t = this.data.cache.provenances?.find((e) => e.id === this.draft.draft.provenance)?.libelle;
2138
+ return t ? `${e} · via ${t}` : e;
2139
+ },
2140
+ motif() {
2141
+ let e = this.ligne;
2142
+ return e?.idMotif ? this.index > 0 ? e.libelle ?? this.data.motifLibelle(e.idMotif) : [
2143
+ this.data.categorieLibelle(e.idCategorie),
2144
+ this.data.typeLibelle(e.idType),
2145
+ this.data.natureLibelle(e.idNature),
2146
+ this.data.motifLibelle(e.idMotif)
2147
+ ].filter(Boolean).join(" › ") : null;
2148
+ },
2149
+ items() {
2150
+ return this.champs.map((e) => ({
2151
+ champ: e,
2152
+ ...Yr[e],
2153
+ valeur: this.valeurs[e]
2154
+ })).filter((e) => e.valeur);
2155
+ }
2156
+ }
2157
+ }, Zr = { class: "alert alert-light border py-2 px-3 mb-0 d-flex flex-column gap-1" }, Qr = { class: "text-muted text-uppercase fw-semibold text-nowrap" }, $r = { class: "min-w-0" };
2158
+ function ei(e, t, n, r, i, a) {
2159
+ let o = F("font-awesome-icon");
2160
+ return A(), C("div", Zr, [(A(!0), C(y, null, N(a.items, (e) => (A(), C("span", {
2161
+ key: e.champ,
2162
+ class: "fs-7 d-flex align-items-start gap-2"
2163
+ }, [
2164
+ E(o, {
2165
+ icon: e.icon,
2166
+ class: "text-primary mt-1",
2167
+ "fixed-width": ""
2168
+ }, null, 8, ["icon"]),
2169
+ w("span", Qr, I(e.label), 1),
2170
+ w("span", $r, I(e.valeur), 1)
2171
+ ]))), 128))]);
2172
+ }
2173
+ var ti = /*#__PURE__*/ G(Xr, [["render", ei]]), ni = {
2174
+ name: "MotifChaineComponent",
2175
+ props: {
2176
+ chaine: {
2177
+ type: Array,
2178
+ default: () => []
2179
+ },
2180
+ readonly: {
2181
+ type: Boolean,
2182
+ default: !1
2183
+ }
2184
+ },
2185
+ emits: ["retirer"]
2186
+ }, ri = { class: "d-flex flex-wrap align-items-center gap-2" }, ii = ["onClick"], ai = {
2187
+ key: 2,
2188
+ class: "badge rounded-pill bg-primary d-inline-flex align-items-center gap-2"
2189
+ };
2190
+ function oi(e, t, n, r, i, a) {
2191
+ let o = F("font-awesome-icon");
2192
+ return A(), C("div", ri, [(A(!0), C(y, null, N(n.chaine, (t, r) => (A(), C(y, { key: t.key }, [r > 0 ? (A(), x(o, {
2193
+ key: 0,
2194
+ icon: "chevron-right",
2195
+ class: "text-muted fs-7"
2196
+ })) : S("", !0), n.readonly ? (A(), C("span", ai, [t.icon ? (A(), x(o, {
2197
+ key: 0,
2198
+ icon: t.icon,
2199
+ "fixed-width": ""
2200
+ }, null, 8, ["icon"])) : S("", !0), T(" " + I(t.libelle), 1)])) : (A(), C("button", {
2201
+ key: 1,
2202
+ type: "button",
2203
+ class: "btn btn-sm btn-primary rounded-pill d-inline-flex align-items-center gap-2",
2204
+ onClick: (n) => e.$emit("retirer", t.key)
2205
+ }, [
2206
+ t.icon ? (A(), x(o, {
2207
+ key: 0,
2208
+ icon: t.icon,
2209
+ "fixed-width": ""
2210
+ }, null, 8, ["icon"])) : S("", !0),
2211
+ w("span", null, I(t.libelle), 1),
2212
+ E(o, {
2213
+ icon: "xmark",
2214
+ class: "fs-7 opacity-75"
2215
+ })
2216
+ ], 8, ii))], 64))), 128))]);
2217
+ }
2218
+ var si = /*#__PURE__*/ G(ni, [["render", oi]]), $ = [
2219
+ {
2220
+ key: "categorie",
2221
+ titre: "Catégorie",
2222
+ idKey: "idCategorie",
2223
+ libelleKey: "categorie"
2224
+ },
2225
+ {
2226
+ key: "type",
2227
+ titre: "Type",
2228
+ idKey: "idType",
2229
+ libelleKey: "type"
2230
+ },
2231
+ {
2232
+ key: "nature",
2233
+ titre: "Nature",
2234
+ idKey: "idNature",
2235
+ libelleKey: "nature"
2236
+ },
2237
+ {
2238
+ key: "motif",
2239
+ titre: "Motif",
2240
+ idKey: "idMotif",
2241
+ libelleKey: "libelle"
2242
+ }
2243
+ ], ci = (e) => e.filter((e) => e.selectedId != null).map((e) => {
2244
+ let t = e.options.find((t) => t.id === e.selectedId);
2245
+ return {
2246
+ key: e.key,
2247
+ libelle: t?.libelle ?? e.selectedId,
2248
+ icon: t?.icon ?? null
2249
+ };
2250
+ }), li = {
2251
+ name: "MotifBubbleBlock",
2252
+ components: { MotifChaineComponent: si },
2253
+ props: { niveaux: {
2254
+ type: Array,
2255
+ required: !0
2256
+ } },
2257
+ emits: ["choisir", "retirer"],
2258
+ computed: {
2259
+ chaine() {
2260
+ return ci(this.niveaux);
2261
+ },
2262
+ courant() {
2263
+ return this.niveaux.find((e) => e.selectedId == null) ?? null;
2264
+ }
2265
+ }
2266
+ }, ui = { class: "d-flex flex-column gap-3" }, di = { key: 1 }, fi = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-2" }, pi = { class: "row justify-content-around g-3" }, mi = ["title", "onClick"], hi = { class: "fs-7 mt-1 lh-sm" }, gi = {
2267
+ key: 0,
2268
+ class: "col-12 text-muted fs-7"
2269
+ };
2270
+ function _i(e, t, n, r, i, a) {
2271
+ let o = F("motif-chaine-component"), s = F("font-awesome-icon");
2272
+ return A(), C("div", ui, [a.chaine.length ? (A(), x(o, {
2273
+ key: 0,
2274
+ chaine: a.chaine,
2275
+ onRetirer: t[0] ||= (t) => e.$emit("retirer", t)
2276
+ }, null, 8, ["chaine"])) : S("", !0), a.courant ? (A(), C("div", di, [w("label", fi, I(a.courant.titre), 1), w("div", pi, [(A(!0), C(y, null, N(a.courant.options, (t) => (A(), C("div", {
2277
+ key: t.id,
2278
+ class: "col-3 text-center"
2279
+ }, [w("button", {
2280
+ type: "button",
2281
+ class: "btn btn-lg btn-outline-primary btn-circle d-flex align-items-center justify-content-center mx-auto",
2282
+ title: t.libelle,
2283
+ onClick: (n) => e.$emit("choisir", {
2284
+ key: a.courant.key,
2285
+ id: t.id
2286
+ })
2287
+ }, [t.icon ? (A(), x(s, {
2288
+ key: 0,
2289
+ icon: t.icon,
2290
+ size: "lg"
2291
+ }, null, 8, ["icon"])) : S("", !0)], 8, mi), w("div", hi, I(t.libelle), 1)]))), 128)), a.courant.options.length ? S("", !0) : (A(), C("div", gi, " Aucun choix disponible "))])])) : S("", !0)]);
2292
+ }
2293
+ var vi = /*#__PURE__*/ G(li, [["render", _i]]), yi = {
2294
+ categorie: "une catégorie",
2295
+ type: "un type",
2296
+ nature: "une nature"
2297
+ }, bi = {
2298
+ name: "MotifColonnesBlock",
2299
+ props: { niveaux: {
2300
+ type: Array,
2301
+ required: !0
2302
+ } },
2303
+ emits: ["choisir"],
2304
+ methods: { article(e) {
2305
+ return yi[e.key] ?? e.titre.toLowerCase();
2306
+ } }
2307
+ }, xi = { class: "row g-0 border rounded overflow-hidden" }, Si = { class: "d-flex align-items-center justify-content-between bg-light border-bottom px-2 py-1" }, Ci = { class: "fs-7 fw-semibold text-muted text-uppercase" }, wi = {
2308
+ key: 0,
2309
+ class: "badge bg-secondary"
2310
+ }, Ti = {
2311
+ class: "list-group list-group-flush overflow-auto",
2312
+ style: { "max-height": "260px" }
2313
+ }, Ei = ["aria-pressed", "onClick"], Di = { class: "flex-grow-1 lh-sm text-start" }, Oi = {
2314
+ key: 0,
2315
+ class: "text-muted fst-italic p-2"
2316
+ };
2317
+ function ki(e, t, n, r, i, a) {
2318
+ let o = F("font-awesome-icon");
2319
+ return A(), C("div", xi, [(A(!0), C(y, null, N(n.niveaux, (t, r) => (A(), C("div", {
2320
+ key: t.key,
2321
+ class: O(["col-6 col-md-3 d-flex flex-column", { "border-start": r > 0 }])
2322
+ }, [
2323
+ w("div", Si, [w("span", Ci, I(t.titre), 1), t.options.length ? (A(), C("span", wi, I(t.options.length), 1)) : S("", !0)]),
2324
+ w("div", Ti, [(A(!0), C(y, null, N(t.options, (i) => (A(), C("button", {
2325
+ key: i.id,
2326
+ type: "button",
2327
+ 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 }]),
2328
+ "aria-pressed": i.id === t.selectedId,
2329
+ onClick: (n) => e.$emit("choisir", {
2330
+ key: t.key,
2331
+ id: i.id
2332
+ })
2333
+ }, [
2334
+ i.icon ? (A(), x(o, {
2335
+ key: 0,
2336
+ icon: i.icon,
2337
+ "fixed-width": ""
2338
+ }, null, 8, ["icon"])) : S("", !0),
2339
+ w("span", Di, I(i.libelle), 1),
2340
+ r < n.niveaux.length - 1 ? (A(), x(o, {
2341
+ key: 1,
2342
+ icon: "chevron-right",
2343
+ class: "opacity-50"
2344
+ })) : i.id === t.selectedId ? (A(), x(o, {
2345
+ key: 2,
2346
+ icon: "check"
2347
+ })) : S("", !0)
2348
+ ], 10, Ei))), 128))]),
2349
+ t.options.length ? S("", !0) : (A(), C("small", Oi, I(r > 0 ? `← Choisir ${a.article(n.niveaux[r - 1])}` : "Aucun choix disponible"), 1))
2350
+ ], 2))), 128))]);
2351
+ }
2352
+ // src/components/EtapeMotifBlock.vue
2353
+ var Ai = {
2354
+ name: "EtapeMotifBlock",
2355
+ components: {
2356
+ AmsomOverlay: v,
2357
+ AmsomAutocomplete: B,
2358
+ SectionComponent: at,
2359
+ SeparateurComponent: Jr,
2360
+ RecapBlock: ti,
2361
+ MotifChaineComponent: si,
2362
+ MotifBubbleBlock: vi,
2363
+ MotifColonnesBlock: /* @__PURE__ */ G(bi, [["render", ki]]),
2364
+ LigneCibleBlock: Lr
2365
+ },
2366
+ setup() {
2367
+ return {
2368
+ draft: W(),
2369
+ data: Z(),
2370
+ options: Q()
2371
+ };
2372
+ },
2373
+ data() {
2374
+ return { iconsReady: !1 };
2375
+ },
2376
+ computed: {
2377
+ mainLigne() {
2378
+ return this.draft.lignePrincipale;
2379
+ },
2380
+ lignesAssociees() {
2381
+ return this.draft.lignesAssociees;
2382
+ },
2383
+ motifFige() {
2384
+ return this.draft.isReadonly("motif");
2385
+ },
2386
+ activeMotifs() {
2387
+ 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 ?? ""));
2388
+ },
2389
+ allowedMotifs() {
2390
+ return this.activeMotifs.filter((e) => this.options.estMotifPropose(e));
2391
+ },
2392
+ motifBloque() {
2393
+ return this.options.motifNonProposeMode === "block" && !this.options.motifPrincipalPropose;
2394
+ },
2395
+ niveaux() {
2396
+ let e = {
2397
+ categorie: this.data.categorieIcon,
2398
+ type: this.data.typeIcon,
2399
+ nature: this.data.natureIcon
2400
+ }, t = this.allowedMotifs;
2401
+ return $.map((n, r) => {
2402
+ let i = $[r - 1], a = !i || this.mainLigne[i.idKey] != null ? t : [], o = n.key === "motif" ? a.map((e) => ({
2403
+ id: e.id,
2404
+ libelle: e.libelle,
2405
+ icon: e.icon
2406
+ })) : this.distinct(a, n.idKey, n.libelleKey, e[n.key]), s = this.mainLigne[n.idKey];
2407
+ return s != null && (t = t.filter((e) => e[n.idKey] === s)), {
2408
+ key: n.key,
2409
+ titre: n.titre,
2410
+ options: o,
2411
+ selectedId: s
2412
+ };
2413
+ });
2414
+ },
2415
+ chaine() {
2416
+ let e = this.mainLigne, t = {
2417
+ categorie: this.data.categorieLibelle,
2418
+ type: this.data.typeLibelle,
2419
+ nature: this.data.natureLibelle,
2420
+ motif: this.data.motifLibelle
2421
+ }, n = {
2422
+ categorie: this.data.categorieIcon,
2423
+ type: this.data.typeIcon,
2424
+ nature: this.data.natureIcon,
2425
+ motif: this.data.motifIcon
2426
+ };
2427
+ return ci($.map((r) => {
2428
+ let i = e[r.idKey];
2429
+ return {
2430
+ key: r.key,
2431
+ selectedId: i,
2432
+ options: i == null ? [] : [{
2433
+ id: i,
2434
+ libelle: t[r.key](i),
2435
+ icon: n[r.key](i)
2436
+ }]
2437
+ };
2438
+ }));
2439
+ },
2440
+ selectedMotif() {
2441
+ return this.mainLigne.idMotif ? this.activeMotifs.find((e) => e.id === this.mainLigne.idMotif) ?? null : null;
2442
+ },
2443
+ motifsAssocies() {
2444
+ let e = this.selectedMotif?.association;
2445
+ return e ? Object.entries(e).map(([e, t]) => ({
2446
+ libelle: e,
2447
+ idMotif: t
2448
+ })) : [];
2449
+ },
2450
+ motifRecherche: {
2451
+ get() {
2452
+ return this.selectedMotif;
2453
+ },
2454
+ set(e) {
2455
+ let t = e && typeof e == "object" ? e : e ? this.activeMotifs.find((t) => t.id === e) : null;
2456
+ t ? this.draft.selectMotifChain(t) : this.draft.setCategorie(null);
2457
+ }
2458
+ }
2459
+ },
2460
+ async created() {
2461
+ await this.data.loadNomenclature(), await this.registerIcons(), this.iconsReady = !0;
2462
+ },
2463
+ methods: {
2464
+ setNiveau(e, t) {
2465
+ ({
2466
+ categorie: this.draft.setCategorie,
2467
+ type: this.draft.setType,
2468
+ nature: this.draft.setNature,
2469
+ motif: this.draft.setMotif
2470
+ })[e](t);
2471
+ },
2472
+ choisir({ key: e, id: t }) {
2473
+ if (this.setNiveau(e, t), this.options.motifSelectionMode !== "columns") return;
2474
+ let n = $.findIndex((t) => t.key === e) + 1;
2475
+ for (; n < $.length;) {
2476
+ let e = this.niveaux[n];
2477
+ if (e.selectedId != null || e.options.length !== 1) break;
2478
+ this.setNiveau(e.key, e.options[0].id), n += 1;
2479
+ }
2480
+ },
2481
+ retirer(e) {
2482
+ this.setNiveau(e, null);
2483
+ },
2484
+ isActive(e) {
2485
+ return this.lignesAssociees.some((t) => t.idMotif === e);
2486
+ },
2487
+ toggleMotifAssocie(e) {
2488
+ let t = this.activeMotifs.find((t) => t.id === e.idMotif);
2489
+ this.draft.toggleLigneAssociee(e.idMotif, {
2490
+ libelle: e.libelle,
2491
+ idCategorie: t?.idCategorie ?? null,
2492
+ idType: t?.idType ?? null,
2493
+ idNature: t?.idNature ?? null
2494
+ });
2495
+ },
2496
+ registerIcons() {
2497
+ return st([
2498
+ ...this.data.cache.categories ?? [],
2499
+ ...this.data.cache.types ?? [],
2500
+ ...this.data.cache.natures ?? [],
2501
+ ...this.activeMotifs
2502
+ ].map((e) => e.icon));
2503
+ },
2504
+ filterMotifs({ search: e, items: t }) {
2505
+ let n = (K(e) ?? "").trim();
2506
+ if (!n) return t;
2507
+ let r = n.split(/\s+/);
2508
+ return t.filter((e) => {
2509
+ let t = K(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
2510
+ return r.every((e) => t.includes(e));
2511
+ });
2512
+ },
2513
+ distinct(e, t, n, r) {
2514
+ let i = /* @__PURE__ */ new Map();
2515
+ for (let a of e) a[t] != null && !i.has(a[t]) && i.set(a[t], {
2516
+ id: a[t],
2517
+ libelle: a[n] ?? a[t],
2518
+ icon: r ? r(a[t]) : null
2519
+ });
2520
+ return [...i.values()].sort((e, t) => (e.libelle ?? "").localeCompare(t.libelle ?? ""));
2521
+ },
2522
+ motifLibelleFromId(e) {
2523
+ return this.activeMotifs.find((t) => t.id === e)?.libelle ?? e;
2524
+ }
2525
+ }
2526
+ }, ji = {
2527
+ key: 0,
2528
+ class: "d-flex flex-column gap-4"
2529
+ }, Mi = {
2530
+ key: 0,
2531
+ class: "alert alert-info d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
2532
+ }, Ni = {
2533
+ key: 1,
2534
+ class: "alert alert-warning d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
2535
+ }, Pi = { class: "d-flex align-items-center gap-2" }, Fi = { class: "min-w-0" }, Ii = { class: "fw-medium text-truncate" }, Li = { class: "text-muted d-block text-truncate" }, Ri = [
2164
2536
  "id",
2165
2537
  "checked",
2538
+ "disabled",
2166
2539
  "onChange"
2167
- ], Xr = ["for"], Zr = {
2540
+ ], zi = ["for"], Bi = {
2168
2541
  key: 0,
2169
- class: "mt-2"
2542
+ class: "alert alert-warning d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
2170
2543
  };
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
- ])]),
2544
+ function Vi(e, t, n, r, i, a) {
2545
+ 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");
2546
+ return A(), x(h, { loading: r.data.isLoading && !r.data.cache.motifs || !i.iconsReady }, {
2547
+ default: z(() => [i.iconsReady ? (A(), C("div", ji, [
2548
+ E(o, { champs: ["reclamant", "cible"] }),
2549
+ E(p, { titre: "Motif" }, {
2550
+ default: z(() => [
2551
+ r.options.motifRetire ? (A(), C("div", Mi, [E(s, {
2552
+ icon: "circle-info",
2553
+ class: "mt-1"
2554
+ }), w("span", null, [
2555
+ T(" Le motif « " + I(r.options.motifRetire.libelle) + " » a été retiré ", 1),
2556
+ 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),
2557
+ t[1] ||= T(" : il n’est pas proposé pour ce réclamant. ", -1)
2558
+ ])])) : S("", !0),
2559
+ a.motifBloque ? (A(), C("div", Ni, [E(s, {
2560
+ icon: "circle-exclamation",
2561
+ class: "mt-1"
2562
+ }), 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),
2563
+ a.motifFige ? (A(), x(c, {
2564
+ key: 2,
2565
+ chaine: a.chaine,
2566
+ readonly: ""
2567
+ }, null, 8, ["chaine"])) : (A(), C(y, { key: 3 }, [
2568
+ 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, {
2569
+ modelValue: a.motifRecherche,
2570
+ "onUpdate:modelValue": t[0] ||= (e) => a.motifRecherche = e,
2571
+ items: a.allowedMotifs,
2572
+ "get-id": (e) => e?.id ?? null,
2573
+ "get-input-libelle": (e) => e?.libelle ?? "",
2574
+ "get-input-libelle-from-id": a.motifLibelleFromId,
2575
+ "filtering-function": a.filterMotifs,
2576
+ placeholder: "Rechercher (motif, catégorie, type, nature)…",
2577
+ "input-size": "sm",
2578
+ "hide-choices": ""
2579
+ }, {
2580
+ options: z((e) => [w("div", Pi, [e?.icon ? (A(), x(s, {
2581
+ key: 0,
2582
+ icon: e.icon,
2583
+ class: "text-primary",
2584
+ "fixed-width": ""
2585
+ }, null, 8, ["icon"])) : S("", !0), w("div", Fi, [w("div", Ii, I(e?.libelle), 1), w("small", Li, I(e?.categorie) + " › " + I(e?.type) + " › " + I(e?.nature), 1)])])]),
2586
+ _: 1
2587
+ }, 8, [
2588
+ "modelValue",
2589
+ "items",
2590
+ "get-id",
2591
+ "get-input-libelle",
2592
+ "get-input-libelle-from-id",
2593
+ "filtering-function"
2594
+ ])]),
2595
+ E(u, { texte: "ou sélection guidée" }),
2596
+ r.options.motifSelectionMode === "columns" ? (A(), x(d, {
2597
+ key: 0,
2598
+ niveaux: a.niveaux,
2599
+ onChoisir: a.choisir
2600
+ }, null, 8, ["niveaux", "onChoisir"])) : (A(), x(f, {
2601
+ key: 1,
2602
+ niveaux: a.niveaux,
2603
+ onChoisir: a.choisir,
2604
+ onRetirer: a.retirer
2605
+ }, null, 8, [
2606
+ "niveaux",
2607
+ "onChoisir",
2608
+ "onRetirer"
2609
+ ]))
2610
+ ], 64))
2611
+ ]),
2612
+ _: 1
2613
+ }),
2614
+ a.motifsAssocies.length ? (A(), x(p, {
2615
+ key: 0,
2616
+ titre: "Motifs complémentaires"
2617
+ }, {
2618
+ default: z(() => [
2619
+ (A(!0), C(y, null, N(a.motifsAssocies, (e) => (A(), C("div", {
2620
+ key: e.idMotif,
2621
+ class: "form-check form-switch"
2622
+ }, [w("input", {
2623
+ id: `assoc-${e.idMotif}`,
2624
+ class: "form-check-input",
2625
+ type: "checkbox",
2626
+ checked: a.isActive(e.idMotif),
2627
+ disabled: a.motifFige,
2628
+ onChange: (t) => a.toggleMotifAssocie(e)
2629
+ }, null, 40, Ri), w("label", {
2630
+ class: "form-check-label fs-7",
2631
+ for: `assoc-${e.idMotif}`
2632
+ }, I(e.libelle) + " ? ", 9, zi)]))), 128)),
2633
+ r.draft.ciblesAssocieesReinitialisees && r.draft.draft.reclamant.type !== "D" ? (A(), C("div", Bi, [E(s, {
2634
+ icon: "circle-exclamation",
2635
+ class: "mt-1"
2636
+ }), 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),
2637
+ 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, {
2638
+ key: e.idMotif,
2639
+ index: t + 1
2640
+ }, null, 8, ["index"]))), 128))], 64)) : S("", !0)
2641
+ ]),
2642
+ _: 1
2643
+ })) : S("", !0)
2644
+ ])) : S("", !0)]),
2238
2645
  _: 1
2239
2646
  }, 8, ["loading"]);
2240
2647
  }
2241
- var $r = /*#__PURE__*/ K(Br, [["render", Qr]]), ei = {
2648
+ var Hi = /*#__PURE__*/ G(Ai, [["render", Vi]]), Ui = {
2242
2649
  name: "LigneDocumentBlock",
2243
- components: { AmsomUploadFile: Se },
2650
+ components: { AmsomUploadFile: xe },
2244
2651
  props: {
2245
2652
  index: {
2246
2653
  type: Number,
@@ -2257,9 +2664,9 @@ var $r = /*#__PURE__*/ K(Br, [["render", Qr]]), ei = {
2257
2664
  },
2258
2665
  emits: ["update"]
2259
2666
  };
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, {
2667
+ function Wi(e, t, n, r, i, a) {
2668
+ let o = F("amsom-upload-file");
2669
+ 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
2670
  "model-value": n.fichier,
2264
2671
  renameable: "",
2265
2672
  "output-format": "object",
@@ -2273,12 +2680,12 @@ function ti(e, t, n, r, i, a) {
2273
2680
  "read-only"
2274
2681
  ])]);
2275
2682
  }
2276
- var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
2683
+ var Gi = /*#__PURE__*/ G(Ui, [["render", Wi]]), Ki = 4e3, qi = {
2277
2684
  name: "LigneDetailBlock",
2278
2685
  components: {
2279
- AmsomAutocomplete: R,
2280
- AmsomTextarea: xe,
2281
- LigneDocumentBlock: ni
2686
+ AmsomAutocomplete: B,
2687
+ AmsomTextarea: be,
2688
+ LigneDocumentBlock: Gi
2282
2689
  },
2283
2690
  props: { index: {
2284
2691
  type: Number,
@@ -2286,12 +2693,12 @@ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
2286
2693
  } },
2287
2694
  setup() {
2288
2695
  return {
2289
- draft: G(),
2696
+ draft: W(),
2290
2697
  data: Z()
2291
2698
  };
2292
2699
  },
2293
2700
  computed: {
2294
- descriptionMaxLength: () => ri,
2701
+ descriptionMaxLength: () => Ki,
2295
2702
  isPrincipale() {
2296
2703
  return this.index === 0;
2297
2704
  },
@@ -2312,64 +2719,54 @@ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
2312
2719
  this.isPrincipale && this.$refs.description?.$el.querySelector("textarea")?.focus();
2313
2720
  },
2314
2721
  methods: {
2315
- timestampToDateInput: Mt,
2316
- dateInputToTimestamp: Nt,
2722
+ timestampToDateInput: nn,
2723
+ dateInputToTimestamp: rn,
2317
2724
  responsableLibelle(e) {
2318
2725
  let t = e && typeof e != "object" ? this.collaborateurs.find((t) => String(t.id) === String(e)) : e;
2319
2726
  return t ? `${t.prenom} ${t.nom}` : "";
2320
2727
  },
2321
2728
  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;
2729
+ let n = (K(e) ?? "").trim();
2730
+ return n ? t.filter((e) => (K(`${e.prenom} ${e.nom} ${e.service}`) ?? "").includes(n)) : t;
2324
2731
  }
2325
2732
  }
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 = {
2733
+ }, Ji = { class: "d-flex flex-column gap-2" }, Yi = { class: "d-flex align-items-center gap-2 mb-1" }, Xi = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, Zi = {
2327
2734
  key: 0,
2328
2735
  class: "ms-1 text-danger"
2329
- }, li = {
2736
+ }, Qi = {
2330
2737
  key: 0,
2331
2738
  class: "form-check form-switch mb-0"
2332
- }, ui = [
2739
+ }, $i = [
2333
2740
  "id",
2334
2741
  "checked",
2335
2742
  "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 = {
2743
+ ], ea = ["for"], ta = ["rows", "value"], na = { class: "row g-3" }, ra = { class: "col-6" }, ia = { class: "d-flex align-items-center gap-2 mb-1" }, aa = {
2341
2744
  key: 0,
2342
2745
  class: "form-check form-switch mb-0"
2343
- }, _i = [
2746
+ }, oa = [
2344
2747
  "id",
2345
2748
  "checked",
2346
2749
  "disabled"
2347
- ], vi = ["for"], yi = ["value"], bi = {
2348
- key: 1,
2349
- class: "text-muted d-block"
2350
- }, xi = {
2750
+ ], sa = ["for"], ca = ["value"], la = ["value"], ua = ["value"], da = { class: "min-w-0" }, fa = { class: "fw-medium text-truncate" }, pa = {
2351
2751
  key: 0,
2352
2752
  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 = {
2753
+ }, ma = {
2357
2754
  key: 2,
2358
2755
  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", {
2756
+ }, ha = { class: "col-12 col-md-6" };
2757
+ function ga(e, t, n, r, i, a) {
2758
+ let o = F("amsom-textarea"), s = F("amsom-autocomplete"), c = F("ligne-document-block");
2759
+ return A(), C("div", Ji, [w("div", null, [w("div", Yi, [w("label", Xi, [t[6] ||= T(" Description", -1), a.isPrincipale ? (A(), C("span", Zi, "*")) : S("", !0)]), a.isPrincipale ? S("", !0) : (A(), C("div", Qi, [w("input", {
2363
2760
  id: `memedetail-${a.ligne.idMotif}`,
2364
2761
  class: "form-check-input",
2365
2762
  type: "checkbox",
2366
2763
  checked: a.ligne.description == null,
2367
2764
  disabled: r.draft.isReadonly("description"),
2368
2765
  onChange: t[0] ||= (e) => r.draft.toggleDescriptionOverride(n.index)
2369
- }, null, 40, ui), S("label", {
2766
+ }, null, 40, $i), w("label", {
2370
2767
  class: "form-check-label fs-7",
2371
2768
  for: `memedetail-${a.ligne.idMotif}`
2372
- }, " Même description ", 8, di)]))]), !r.draft.isReadonly("description") && (a.isPrincipale || a.ligne.description != null) ? (O(), y(o, {
2769
+ }, " Même description ", 8, ea)]))]), !r.draft.isReadonly("description") && (a.isPrincipale || a.ligne.description != null) ? (A(), x(o, {
2373
2770
  key: 0,
2374
2771
  ref: "description",
2375
2772
  "model-value": a.ligne.description,
@@ -2383,25 +2780,42 @@ function Di(e, t, n, r, i, a) {
2383
2780
  "rows",
2384
2781
  "maxlength",
2385
2782
  "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", {
2783
+ ])) : (A(), C("textarea", {
2784
+ key: 1,
2785
+ class: "form-control form-control-sm",
2786
+ disabled: "",
2787
+ rows: a.isPrincipale ? 7 : 5,
2788
+ value: (a.ligne.description ?? a.lignePrincipale.description) || ""
2789
+ }, null, 8, ta))]), w("div", na, [w("div", ra, [w("div", null, [w("div", ia, [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", aa, [w("input", {
2387
2790
  id: `memedate-${a.ligne.idMotif}`,
2388
2791
  class: "form-check-input",
2389
2792
  type: "checkbox",
2390
2793
  checked: !a.ligne.dateFaitsOverride,
2391
2794
  disabled: r.draft.isReadonly("dateFaits"),
2392
2795
  onChange: t[2] ||= (e) => r.draft.toggleDateFaitsOverride(n.index)
2393
- }, null, 40, _i), S("label", {
2796
+ }, null, 40, oa), w("label", {
2394
2797
  class: "form-check-label fs-7",
2395
2798
  for: `memedate-${a.ligne.idMotif}`
2396
- }, " Même date ", 8, vi)]))]), !r.draft.isReadonly("dateFaits") && (a.isPrincipale || a.ligne.dateFaitsOverride) ? (O(), x("input", {
2799
+ }, " Même date ", 8, sa)]))]), !r.draft.isReadonly("dateFaits") && (a.isPrincipale || a.ligne.dateFaitsOverride) ? (A(), C("input", {
2397
2800
  key: 0,
2398
2801
  value: a.timestampToDateInput(a.ligne.dateFaits),
2399
2802
  type: "date",
2400
2803
  class: "form-control form-control-sm",
2401
2804
  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, {
2805
+ }, null, 40, ca)) : (A(), C("input", {
2806
+ key: 1,
2807
+ value: a.timestampToDateInput(a.dateFaits),
2808
+ type: "date",
2809
+ class: "form-control form-control-sm",
2810
+ disabled: ""
2811
+ }, null, 8, la))]), w("div", null, [
2812
+ t[8] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Responsable ", -1),
2813
+ r.draft.isReadonly("responsable") ? (A(), C("input", {
2814
+ key: 0,
2815
+ class: "form-control form-control-sm",
2816
+ disabled: "",
2817
+ value: a.responsableLibelle(a.ligne.responsable) || "Déterminé automatiquement"
2818
+ }, null, 8, ua)) : (A(), x(s, {
2405
2819
  key: 1,
2406
2820
  "model-value": a.ligne.responsable,
2407
2821
  items: a.collaborateurs,
@@ -2413,7 +2827,7 @@ function Di(e, t, n, r, i, a) {
2413
2827
  "hide-choices": "",
2414
2828
  "onUpdate:modelValue": t[4] ||= (e) => r.draft.setResponsable(n.index, e ?? null)
2415
2829
  }, {
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)])]),
2830
+ options: z((e) => [w("div", da, [w("div", fa, I(e?.prenom) + " " + I(e?.nom), 1), e?.service ? (A(), C("small", pa, I(e.service), 1)) : S("", !0)])]),
2417
2831
  _: 1
2418
2832
  }, 8, [
2419
2833
  "model-value",
@@ -2422,8 +2836,8 @@ function Di(e, t, n, r, i, a) {
2422
2836
  "get-input-libelle",
2423
2837
  "filtering-function"
2424
2838
  ])),
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, {
2839
+ a.isPrincipale && !a.ligne.responsable && !r.draft.isReadonly("responsable") ? (A(), C("small", ma, " Aucun paramétrage trouvé : le responsable sera déterminé automatiquement. ")) : S("", !0)
2840
+ ])]), w("div", ha, [E(c, {
2427
2841
  index: n.index,
2428
2842
  fichier: a.ligne.fichier,
2429
2843
  readonly: r.draft.isReadonly("fichier"),
@@ -2435,15 +2849,17 @@ function Di(e, t, n, r, i, a) {
2435
2849
  ])])])]);
2436
2850
  }
2437
2851
  // src/components/EtapeDetailsBlock.vue
2438
- var Oi = {
2852
+ var _a = {
2439
2853
  name: "EtapeDetailsBlock",
2440
2854
  components: {
2441
- AmsomOverlay: g,
2442
- LigneDetailBlock: /* @__PURE__ */ K(ii, [["render", Di]])
2855
+ AmsomOverlay: v,
2856
+ LigneDetailBlock: /* @__PURE__ */ G(qi, [["render", ga]]),
2857
+ RecapBlock: ti,
2858
+ SectionComponent: at
2443
2859
  },
2444
2860
  setup() {
2445
2861
  return {
2446
- draft: G(),
2862
+ draft: W(),
2447
2863
  data: Z()
2448
2864
  };
2449
2865
  },
@@ -2456,10 +2872,6 @@ var Oi = {
2456
2872
  },
2457
2873
  collaborateurs() {
2458
2874
  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
2875
  }
2464
2876
  },
2465
2877
  async created() {
@@ -2495,66 +2907,61 @@ var Oi = {
2495
2907
  }
2496
2908
  }
2497
2909
  }
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)
2910
+ }, va = { class: "d-flex flex-column gap-4" }, ya = { class: "text-muted d-flex align-items-start gap-2" };
2911
+ function ba(e, t, n, r, i, a) {
2912
+ let o = F("recap-block"), s = F("font-awesome-icon"), c = F("ligne-detail-block"), l = F("section-component"), u = F("amsom-overlay");
2913
+ return A(), x(u, { loading: r.data.isLoading && !r.data.cache.collaborateurs }, {
2914
+ default: z(() => [w("div", va, [
2915
+ E(o),
2916
+ w("small", ya, [E(s, {
2917
+ icon: "circle-info",
2918
+ class: "mt-1"
2919
+ }), 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)]),
2920
+ E(l, { titre: a.lignesAssociees.length ? "Motif principal" : "Détails" }, {
2921
+ default: z(() => [E(c, { index: 0 })]),
2922
+ _: 1
2923
+ }, 8, ["titre"]),
2924
+ a.lignesAssociees.length ? (A(), x(l, {
2925
+ key: 0,
2926
+ titre: "Détail des autres motifs"
2927
+ }, {
2928
+ default: z(() => [(A(!0), C(y, null, N(a.lignesAssociees, (e, t) => (A(), C("div", {
2929
+ key: e.idMotif,
2930
+ class: "border rounded p-2 d-flex flex-column gap-2"
2931
+ }, [E(o, {
2932
+ index: t + 1,
2933
+ champs: ["motif", "cible"]
2934
+ }, null, 8, ["index"]), E(c, { index: t + 1 }, null, 8, ["index"])]))), 128))]),
2935
+ _: 1
2936
+ })) : S("", !0)
2544
2937
  ])]),
2545
2938
  _: 1
2546
2939
  }, 8, ["loading"]);
2547
2940
  }
2548
- // src/components/StepperBlock.vue
2549
- var Li = {
2941
+ var xa = /*#__PURE__*/ G(_a, [["render", ba]]), Sa = [
2942
+ {
2943
+ key: "reclamantCible",
2944
+ label: "Réclamant et cible",
2945
+ icon: "user"
2946
+ },
2947
+ {
2948
+ key: "motif",
2949
+ label: "Motif",
2950
+ icon: "tag"
2951
+ },
2952
+ {
2953
+ key: "details",
2954
+ label: "Détails",
2955
+ icon: "info"
2956
+ }
2957
+ ], Ca = {
2550
2958
  name: "StepperBlock",
2551
2959
  components: {
2552
- AmsomHorizontalStepper: ye,
2553
- AmsomOverlay: g,
2554
- EtapeReclamantBlock: vn,
2555
- EtapeCategorieBlock: Yn,
2556
- EtapeCibleBlock: $r,
2557
- EtapeDetailsBlock: /* @__PURE__ */ K(Oi, [["render", Ii]])
2960
+ AmsomHorizontalStepper: _e,
2961
+ AmsomOverlay: v,
2962
+ EtapeReclamantCibleBlock: Wr,
2963
+ EtapeMotifBlock: Hi,
2964
+ EtapeDetailsBlock: xa
2558
2965
  },
2559
2966
  props: {
2560
2967
  step: {
@@ -2573,36 +2980,13 @@ var Li = {
2573
2980
  ],
2574
2981
  setup() {
2575
2982
  return {
2576
- draft: G(),
2983
+ draft: W(),
2577
2984
  data: Z(),
2578
2985
  options: Q()
2579
2986
  };
2580
2987
  },
2581
2988
  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
- },
2989
+ steps: () => Sa,
2606
2990
  currentKey() {
2607
2991
  return this.steps[this.step - 1]?.key ?? null;
2608
2992
  },
@@ -2616,11 +3000,14 @@ var Li = {
2616
3000
  provenanceValid() {
2617
3001
  return this.options.provenances.some((e) => e.id === this.draft.draft.provenance);
2618
3002
  },
3003
+ motifPropose() {
3004
+ return this.options.motifNonProposeMode !== "block" || this.options.motifPrincipalPropose;
3005
+ },
2619
3006
  canGoNext() {
2620
3007
  return this.gatePassed(this.currentKey);
2621
3008
  },
2622
3009
  canCreer() {
2623
- return !!this.lignePrincipale.idMotif && this.provenanceValid && this.draft.ciblesValid && this.draft.detailsValid && this.draft.reclamantSelectionne != null;
3010
+ return !!this.lignePrincipale.idMotif && this.motifPropose && this.provenanceValid && this.draft.ciblesValid && this.draft.detailsValid && this.draft.reclamantSelectionne != null;
2624
3011
  },
2625
3012
  stepperSteps() {
2626
3013
  return this.steps.map((e, t) => {
@@ -2649,7 +3036,7 @@ var Li = {
2649
3036
  } },
2650
3037
  methods: {
2651
3038
  gatePassed(e) {
2652
- return e === "reclamant" ? this.draft.reclamantSelectionne != null && this.provenanceValid : e === "categorie" ? !!this.lignePrincipale.idMotif && this.provenanceValid : e !== "cible" || this.draft.ciblesValid;
3039
+ return e === "reclamantCible" ? this.draft.reclamantSelectionne != null && this.provenanceValid && this.draft.ligneCibleValid(0) : e !== "motif" || !!this.lignePrincipale.idMotif && this.motifPropose && this.draft.ciblesValid;
2653
3040
  },
2654
3041
  onStepClick(e) {
2655
3042
  e < this.step && this.$emit("update:step", e);
@@ -2658,7 +3045,7 @@ var Li = {
2658
3045
  this.step > 1 && this.$emit("update:step", this.step - 1);
2659
3046
  },
2660
3047
  goNext() {
2661
- this.step >= this.steps.length || !this.canGoNext || (this.currentKey === "categorie" && this.preloadResponsables(), this.$emit("update:step", this.step + 1));
3048
+ this.step >= this.steps.length || !this.canGoNext || (this.currentKey === "motif" && this.preloadResponsables(), this.$emit("update:step", this.step + 1));
2662
3049
  },
2663
3050
  preloadResponsables() {
2664
3051
  this.draft.draft.lignes.forEach((e) => this.data.loadResponsables({
@@ -2669,73 +3056,67 @@ var Li = {
2669
3056
  }));
2670
3057
  }
2671
3058
  }
2672
- }, Ri = { class: "d-flex flex-column gap-3" }, zi = {
3059
+ }, wa = { class: "d-flex flex-column gap-3" }, Ta = {
2673
3060
  key: 0,
2674
3061
  class: "w-100 fs-6 fw-medium my-3 alert alert-info",
2675
3062
  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, {
3063
+ }, Ea = { style: { "min-height": "260px" } }, Da = { class: "d-flex justify-content-between" }, Oa = { key: 1 }, ka = ["disabled"], Aa = ["disabled"];
3064
+ function ja(e, t, n, r, i, a) {
3065
+ 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");
3066
+ return A(), x(d, { loading: n.creating }, {
3067
+ default: z(() => [w("div", wa, [
3068
+ E(o, {
2682
3069
  steps: a.stepperSteps,
2683
3070
  size: "md",
2684
3071
  onStepClick: a.onStepClick
2685
3072
  }, null, 8, ["steps", "onStepClick"]),
2686
- a.aideMotif ? (O(), x("div", zi, [w(s, {
3073
+ a.aideMotif ? (A(), C("div", Ta, [E(s, {
2687
3074
  icon: "circle-info",
2688
3075
  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 ? {
3076
+ }), w("span", null, I(a.aideMotif), 1)])) : S("", !0),
3077
+ w("div", Ea, [a.currentKey === "reclamantCible" ? (A(), x(c, { key: 0 }, le({ _: 2 }, [e.$slots.reclamant ? {
2694
3078
  name: "reclamant",
2695
- fn: L((t) => [M(e.$slots, "reclamant", D(T(t)))]),
3079
+ fn: z((t) => [P(e.$slots, "reclamant", k(D(t)))]),
2696
3080
  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", {
3081
+ } : void 0]), 1024)) : a.currentKey === "motif" ? (A(), x(l, { key: 1 })) : a.currentKey === "details" ? (A(), x(u, { key: 2 })) : S("", !0)]),
3082
+ w("div", Da, [n.step > 1 ? (A(), C("button", {
2702
3083
  key: 0,
2703
3084
  class: "btn btn-sm btn-outline-secondary",
2704
3085
  onClick: t[0] ||= (...e) => a.goPrevious && a.goPrevious(...e)
2705
- }, [w(s, {
3086
+ }, [E(s, {
2706
3087
  icon: "chevron-left",
2707
3088
  class: "me-1"
2708
- }), t[3] ||= C(" Précédent ", -1)])) : (O(), x("span", Hi)), n.step < a.steps.length ? (O(), x("button", {
3089
+ }), t[3] ||= T(" Précédent ", -1)])) : (A(), C("span", Oa)), n.step < a.steps.length ? (A(), C("button", {
2709
3090
  key: 2,
2710
3091
  class: "btn btn-sm btn-primary",
2711
3092
  disabled: !a.canGoNext,
2712
3093
  onClick: t[1] ||= (...e) => a.goNext && a.goNext(...e)
2713
- }, [t[4] ||= C(" Suivant ", -1), w(s, {
3094
+ }, [t[4] ||= T(" Suivant ", -1), E(s, {
2714
3095
  icon: "chevron-right",
2715
3096
  class: "ms-1"
2716
- })], 8, Ui)) : (O(), x("button", {
3097
+ })], 8, ka)) : (A(), C("button", {
2717
3098
  key: 3,
2718
3099
  class: "btn btn-sm btn-success",
2719
3100
  disabled: !a.canCreer || n.creating,
2720
3101
  onClick: t[2] ||= (t) => e.$emit("submit")
2721
- }, [w(s, {
3102
+ }, [E(s, {
2722
3103
  icon: "check",
2723
3104
  class: "me-1"
2724
- }), t[5] ||= C(" Créer la sollicitation ", -1)], 8, Wi))])
3105
+ }), t[5] ||= T(" Créer la sollicitation ", -1)], 8, Aa))])
2725
3106
  ])]),
2726
3107
  _: 3
2727
3108
  }, 8, ["loading"]);
2728
3109
  }
2729
- var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n } = {}) => it("/v2/cresol/creer_sollicitation", e, {
3110
+ var Ma = /*#__PURE__*/ G(Ca, [["render", ja]]), Na = (e, { signal: t, baseUrl: n } = {}) => xt("/v2/cresol/creer_sollicitation", e, {
2730
3111
  signal: t,
2731
3112
  baseUrl: n
2732
- }), Ji = ({ idSollicitation: e, pj: t }, { signal: n, baseUrl: r } = {}) => it("/v2/cresol/upload_sollicitation_ged", {
3113
+ }), Pa = ({ idSollicitation: e, pj: t }, { signal: n, baseUrl: r } = {}) => xt("/v2/cresol/upload_sollicitation_ged", {
2733
3114
  idSollicitation: e,
2734
3115
  pj: t
2735
3116
  }, {
2736
3117
  signal: n,
2737
3118
  baseUrl: r
2738
- }), Yi = {
3119
+ }), Fa = {
2739
3120
  modelValue: {
2740
3121
  type: Object,
2741
3122
  default: null
@@ -2751,22 +3132,36 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2751
3132
  "select",
2752
3133
  "switch",
2753
3134
  "autocomplete",
2754
- "step"
3135
+ "recherche"
3136
+ ].includes(e)
3137
+ },
3138
+ motifSelectionMode: {
3139
+ type: String,
3140
+ default: "bubble",
3141
+ validator: (e) => ["bubble", "columns"].includes(e)
3142
+ },
3143
+ motifNonProposeMode: {
3144
+ type: String,
3145
+ default: "clear",
3146
+ validator: (e) => [
3147
+ "clear",
3148
+ "block",
3149
+ "ignore"
2755
3150
  ].includes(e)
2756
3151
  },
2757
3152
  typesReclamant: {
2758
3153
  type: Array,
2759
3154
  default: null,
2760
- validator: (e) => e.every((e) => H.includes(e))
3155
+ validator: (e) => e.every((e) => Oe.includes(e))
2761
3156
  },
2762
3157
  typesReclamantExclus: {
2763
3158
  type: Array,
2764
3159
  default: () => [],
2765
- validator: (e) => e.every((e) => H.includes(e))
3160
+ validator: (e) => e.every((e) => Oe.includes(e))
2766
3161
  },
2767
3162
  provenances: {
2768
3163
  type: Array,
2769
- default: () => [...Te]
3164
+ default: () => [...we]
2770
3165
  },
2771
3166
  provenancesExclues: {
2772
3167
  type: Array,
@@ -2775,12 +3170,16 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2775
3170
  readonly: {
2776
3171
  type: [Boolean, Array],
2777
3172
  default: !1,
2778
- validator: (e) => typeof e == "boolean" || e.every((e) => Ne.includes(e))
3173
+ validator: (e) => typeof e == "boolean" || e.every((e) => Fe.includes(e))
2779
3174
  },
2780
3175
  modules: {
2781
3176
  type: Array,
2782
3177
  default: null
2783
3178
  },
3179
+ idModuleCibleDefaut: {
3180
+ type: [String, Number],
3181
+ default: null
3182
+ },
2784
3183
  idModule: {
2785
3184
  type: [String, Number],
2786
3185
  default: null
@@ -2801,7 +3200,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2801
3200
  type: String,
2802
3201
  default: null
2803
3202
  }
2804
- }, Xi = Object.keys(Yi), Zi = [
3203
+ }, Ia = Object.keys(Fa), La = [
2805
3204
  "update:modelValue",
2806
3205
  "reclamantChange",
2807
3206
  "motifChange",
@@ -2810,35 +3209,50 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2810
3209
  "created",
2811
3210
  "createError",
2812
3211
  "error"
2813
- ], Qi = {
3212
+ ], Ra = {
2814
3213
  name: "CreerSollicitationForm",
2815
3214
  components: {
2816
- AsideBlock: Xe,
2817
- StepperBlock: Ki
3215
+ AsideBlock: Qe,
3216
+ StepperBlock: Ma
2818
3217
  },
2819
- props: { ...Yi },
2820
- emits: [...Zi],
3218
+ props: { ...Fa },
3219
+ emits: [...La],
2821
3220
  setup(e, { emit: t }) {
2822
- let n = (e) => t("error", e), r = { baseUrl: F(e, "baseUrl") }, i = kt(Ot({
3221
+ let n = (e) => t("error", e), r = { baseUrl: L(e, "baseUrl") }, i = Kt(Gt({
2823
3222
  onError: n,
2824
3223
  ...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),
3224
+ })), a = M(null), o = M(!1), s = b(() => a.value ?? e.modules ?? []), c = b(() => e.reclamantMode === "recherche"), l = Ge(We({
3225
+ reclamants: b(() => c.value ? [] : e.reclamants),
2827
3226
  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(() => {
3227
+ idModulePrefere: b(() => e.idModuleCibleDefaut ?? e.idModule),
3228
+ readonly: L(e, "readonly")
3229
+ })), u = (t) => {
3230
+ if (!t || t.estDesactive) return !1;
3231
+ let n = e.nomenclatureFilter;
3232
+ return typeof n != "function" || n(t, { reclamant: l.reclamantSelectionne });
3233
+ }, d = b(() => {
3234
+ let e = l.lignePrincipale.idMotif;
3235
+ if (e == null || l.isReadonly("motif")) return !0;
3236
+ let t = i.cache.motifs?.find((t) => t.id === e);
3237
+ return !i.cache.motifs || u(t);
3238
+ }), f = M(null);
3239
+ return Jt(j({
3240
+ nomenclatureFilter: L(e, "nomenclatureFilter"),
3241
+ estMotifPropose: u,
3242
+ motifPrincipalPropose: d,
3243
+ motifNonProposeMode: L(e, "motifNonProposeMode"),
3244
+ motifRetire: f,
3245
+ reclamantMode: L(e, "reclamantMode"),
3246
+ rechercheReclamant: c,
3247
+ motifSelectionMode: L(e, "motifSelectionMode"),
3248
+ typesReclamant: b(() => (e.typesReclamant ?? Oe).filter((t) => !e.typesReclamantExclus.includes(t))),
3249
+ provenances: b(() => {
2836
3250
  let t = i.cache.provenances ?? [];
2837
3251
  return (e.provenances ?? t.map((e) => e.id)).filter((t) => !e.provenancesExclues.includes(t)).flatMap((e) => {
2838
3252
  let n = t.find((t) => t.id === e);
2839
3253
  return n ? [{
2840
3254
  ...n,
2841
- icon: we(e)
3255
+ icon: Ce(e)
2842
3256
  }] : [];
2843
3257
  });
2844
3258
  }),
@@ -2847,9 +3261,12 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2847
3261
  ...r
2848
3262
  })), {
2849
3263
  data: i,
2850
- draft: c,
3264
+ draft: l,
2851
3265
  modulesCharges: a,
2852
3266
  repriseReclamant: o,
3267
+ rechercheReclamant: c,
3268
+ motifPrincipalPropose: d,
3269
+ motifRetire: f,
2853
3270
  onError: n
2854
3271
  };
2855
3272
  },
@@ -2881,13 +3298,23 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2881
3298
  }
2882
3299
  } },
2883
3300
  async created() {
2884
- this.data.loadNomenclature(), this.data.loadProvenances(), this.draft.reset(this.modelValue), this.reclamantMode === "step" && await this.reprendreReclamantFourni(), this.draft.syncReclamant();
3301
+ this.data.loadNomenclature(), this.data.loadProvenances(), this.draft.reset(this.modelValue), this.rechercheReclamant && await this.reprendreReclamantFourni(), this.draft.syncReclamant();
2885
3302
  let e = this.draft.reclamantSelectionne;
2886
3303
  this.$watch("draft.reclamantSelectionne", async (t) => {
2887
3304
  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();
3305
+ }), this.$watch("motifPrincipalPropose", this.retirerMotifNonPropose, { immediate: !0 }), this.$watch(() => this.draft.lignePrincipale.idMotif, (e) => {
3306
+ e != null && (this.motifRetire = null);
3307
+ }), this.$watch(() => JSON.stringify(this.motifChoisi), () => this.$emit("motifChange", this.motifChoisi)), await this.chargerModulesReclamant(e, e) && this.draft.prefillCiblePrincipale(), this.draft.libererCibleFournie();
2889
3308
  },
2890
3309
  methods: {
3310
+ retirerMotifNonPropose(e) {
3311
+ if (e || this.motifNonProposeMode !== "clear") return;
3312
+ let t = this.draft.lignePrincipale.idMotif, n = {
3313
+ libelle: this.data.motifLibelle(t),
3314
+ associes: this.draft.lignesAssociees.map((e) => e.libelle ?? this.data.motifLibelle(e.idMotif))
3315
+ };
3316
+ this.draft.setCategorie(null), this.motifRetire = n;
3317
+ },
2891
3318
  async reprendreReclamantFourni() {
2892
3319
  let { type: e, id: t } = this.draft.draft.reclamant;
2893
3320
  if (!e || t == null) return;
@@ -2923,10 +3350,10 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2923
3350
  if (!await this.autoriserCreation(e)) return;
2924
3351
  let t;
2925
3352
  try {
2926
- t = await qi(e, this.requestOptions) ?? [];
3353
+ t = await Na(e, this.requestOptions) ?? [];
2927
3354
  } catch (t) {
2928
- if (xt(t)) return;
2929
- let n = bt(t);
3355
+ if (Rt(t)) return;
3356
+ let n = Lt(t);
2930
3357
  this.$emit("createError", {
2931
3358
  error: t,
2932
3359
  message: n,
@@ -2976,7 +3403,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2976
3403
  message: t
2977
3404
  };
2978
3405
  };
2979
- return a?.id ? Ji({
3406
+ return a?.id ? Pa({
2980
3407
  idSollicitation: a.id,
2981
3408
  pj: {
2982
3409
  name: n.name,
@@ -2987,34 +3414,34 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
2987
3414
  ...o,
2988
3415
  ok: !0,
2989
3416
  message: null
2990
- })).catch((e) => s(bt(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
3417
+ })).catch((e) => s(Lt(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
2991
3418
  });
2992
3419
  return Promise.all(n);
2993
3420
  }
2994
3421
  }
2995
- }, $i = { class: "row g-3" }, ea = {
3422
+ }, za = { class: "row g-3" }, Ba = {
2996
3423
  key: 0,
2997
3424
  class: "col-12 col-lg-4"
2998
3425
  };
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"] ? {
3426
+ function Va(e, t, n, r, i, a) {
3427
+ let o = F("aside-block"), s = F("stepper-block");
3428
+ return A(), C("div", za, [e.aside ? (A(), C("div", Ba, [P(e.$slots, "aside", {}, () => [E(o, { "nb-similaires": e.nbSimilaires }, le({ _: 2 }, [e.$slots["aside-similaires"] ? {
3002
3429
  name: "similaires",
3003
- fn: L((t) => [M(e.$slots, "aside-similaires", D(T(t)))]),
3430
+ fn: z((t) => [P(e.$slots, "aside-similaires", k(D(t)))]),
3004
3431
  key: "0"
3005
3432
  } : void 0, e.$slots["aside-evenements"] ? {
3006
3433
  name: "evenements",
3007
- fn: L(() => [M(e.$slots, "aside-evenements")]),
3434
+ fn: z(() => [P(e.$slots, "aside-evenements")]),
3008
3435
  key: "1"
3009
- } : void 0]), 1032, ["nb-similaires"])])])) : b("", !0), S("div", { class: E(["col-12", e.aside ? "col-lg-8" : ""]) }, [w(s, {
3436
+ } : void 0]), 1032, ["nb-similaires"])])])) : S("", !0), w("div", { class: O(["col-12", e.aside ? "col-lg-8" : ""]) }, [E(s, {
3010
3437
  step: i.currentStep,
3011
3438
  "onUpdate:step": t[0] ||= (e) => i.currentStep = e,
3012
3439
  creating: i.creating,
3013
3440
  onStepChange: t[1] ||= (t) => e.$emit("stepChange", t),
3014
3441
  onSubmit: a.creer
3015
- }, de({ _: 2 }, [e.$slots.reclamant ? {
3442
+ }, le({ _: 2 }, [e.$slots.reclamant ? {
3016
3443
  name: "reclamant",
3017
- fn: L((t) => [M(e.$slots, "reclamant", D(T(t)))]),
3444
+ fn: z((t) => [P(e.$slots, "reclamant", k(D(t)))]),
3018
3445
  key: "0"
3019
3446
  } : void 0]), 1032, [
3020
3447
  "step",
@@ -3022,14 +3449,14 @@ function ta(e, t, n, r, i, a) {
3022
3449
  "onSubmit"
3023
3450
  ])], 2)]);
3024
3451
  }
3025
- var na = /*#__PURE__*/ K(Qi, [["render", ta]]), ra = {
3452
+ var Ha = /*#__PURE__*/ G(Ra, [["render", Va]]), Ua = {
3026
3453
  name: "CreerSollicitationModal",
3027
3454
  components: {
3028
- AmsomModal: ue,
3029
- CreerSollicitationForm: na
3455
+ AmsomModal: ce,
3456
+ CreerSollicitationForm: Ha
3030
3457
  },
3031
3458
  props: {
3032
- ...Yi,
3459
+ ...Fa,
3033
3460
  titre: {
3034
3461
  type: String,
3035
3462
  default: "Nouvelle sollicitation"
@@ -3039,35 +3466,35 @@ var na = /*#__PURE__*/ K(Qi, [["render", ta]]), ra = {
3039
3466
  default: !0
3040
3467
  }
3041
3468
  },
3042
- emits: [...Zi, "close"],
3469
+ emits: [...La, "close"],
3043
3470
  computed: {
3044
3471
  formProps() {
3045
- return Object.fromEntries(Xi.map((e) => [e, this[e]]));
3472
+ return Object.fromEntries(Ia.map((e) => [e, this[e]]));
3046
3473
  },
3047
3474
  formListeners() {
3048
- return Object.fromEntries(Zi.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
3475
+ return Object.fromEntries(La.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
3049
3476
  }
3050
3477
  },
3051
3478
  methods: { onCreated(...e) {
3052
3479
  this.$emit("created", ...e), this.closeOnCreated && this.$emit("close");
3053
3480
  } }
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, {
3481
+ }, Wa = { class: "fw-medium fs-5" };
3482
+ function Ga(e, t, n, r, i, a) {
3483
+ let o = F("creer-sollicitation-form"), s = F("amsom-modal");
3484
+ return A(), x(s, {
3058
3485
  "close-option": "",
3059
3486
  size: "xl",
3060
3487
  onClose: t[0] ||= (t) => e.$emit("close")
3061
3488
  }, {
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) => ({
3489
+ default: z(() => [w("span", Wa, 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
3490
  name: n,
3064
- fn: L((t) => [M(e.$slots, n, D(T(t ?? {})))])
3491
+ fn: z((t) => [P(e.$slots, n, k(D(t ?? {})))])
3065
3492
  }))]), 1040, ["onCreated"])]),
3066
3493
  _: 3
3067
3494
  });
3068
3495
  }
3069
- var oa = /*#__PURE__*/ K(ra, [["render", aa]]), sa = {
3070
- CreerSollicitationModal: oa,
3071
- CreerSollicitationForm: na
3496
+ var Ka = /*#__PURE__*/ G(Ua, [["render", Ga]]), qa = {
3497
+ CreerSollicitationModal: Ka,
3498
+ CreerSollicitationForm: Ha
3072
3499
  };
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 };
3500
+ export { Ne as CIBLE_FIELDS, Ha as CreerSollicitationForm, Ka as CreerSollicitationModal, Te as DEFAULT_PROVENANCE_CONTACT, we as PROVENANCES_CONTACT_DEFAUT, Se as PROVENANCE_CONTACT_ICONS, Fe as READONLY_FIELDS, Pe as cibleOfLigne, ht as configureCresol, qa as default, Ie as getDefaultDraft, U as getDefaultLigne, H as getDefaultPatrimoine, Ut as resetCresolCache };