@tricoteuses/tisseuse 0.12.3 → 0.12.5

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/index.js CHANGED
@@ -1,74 +1,74 @@
1
- import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bt as o, C as s, Cn as c, Ct as l, D as u, Dn as d, Dt as f, E as p, En as m, Et as h, F as g, Fn as _, Ft as ee, G as te, Gt as ne, H as re, Ht as ie, I as ae, In as v, It as oe, J as se, Jt as ce, K as le, Kt as ue, L as de, Lt as y, M as fe, Mn as pe, Mt as b, N as me, Nn as he, Nt as ge, O as _e, On as ve, Ot as ye, P as be, Pn as xe, Pt as Se, Q as Ce, Qt as we, R as Te, Rt as Ee, S as De, Sn as x, St as Oe, T as ke, Tn as Ae, Tt as je, U as Me, Ut as Ne, V as Pe, Vt as S, W as Fe, Wt as Ie, X as Le, Xt as Re, Y as ze, Yt as Be, Z as Ve, Zt as He, _ as C, _n as w, _t as Ue, a as We, an as Ge, at as Ke, b as qe, bn as T, bt as Je, c as Ye, cn as Xe, ct as Ze, d as Qe, dn as $e, dt as et, en as tt, et as nt, f as rt, fn as it, ft as at, g as ot, gn as E, gt as st, h as ct, hn as lt, ht as ut, i as D, in as dt, it as ft, j as O, jn as pt, jt as mt, k as ht, kn as k, kt as gt, l as _t, ln as vt, lt as yt, m as bt, mn as xt, mt as St, n as Ct, nn as wt, nt as Tt, o as Et, on as Dt, ot as Ot, p as kt, pn as At, pt as jt, q as Mt, qt as Nt, r as Pt, rn as Ft, rt as It, s as Lt, sn as Rt, st as zt, t as Bt, tn as Vt, tt as Ht, u as Ut, un as Wt, ut as Gt, v as Kt, vn as A, vt as qt, w as Jt, wn as Yt, wt as Xt, x as Zt, xn as Qt, xt as $t, y as en, yn as tn, yt as nn, z as rn, zt as an } from "./html-Ds2IZ1nn.js";
1
+ import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bt as o, C as s, Cn as c, Ct as l, D as u, Dn as d, Dt as f, E as p, En as m, Et as h, F as g, Fn as ee, Ft as te, G as ne, Gt as re, H as ie, Ht as ae, I as oe, In as _, It as se, J as ce, Jt as le, K as ue, Kt as de, L as fe, Lt as v, M as pe, Mn as me, Mt as y, N as he, Nn as ge, Nt as b, O as _e, On as ve, Ot as ye, P as be, Pn as xe, Pt as Se, Q as Ce, Qt as we, R as Te, Rt as Ee, S as De, Sn as x, St as Oe, T as ke, Tn as Ae, Tt as je, U as Me, Ut as Ne, V as Pe, Vt as S, W as Fe, Wt as Ie, X as Le, Xt as Re, Y as ze, Yt as Be, Z as Ve, Zt as He, _ as Ue, _n as C, _t as We, a as Ge, an as Ke, at as qe, b as Je, bn as Ye, bt as Xe, c as Ze, cn as Qe, ct as $e, d as et, dn as tt, dt as nt, en as rt, et as it, f as at, fn as ot, ft as st, g as ct, gn as w, gt as lt, h as ut, hn as dt, ht as ft, i as T, in as pt, it as mt, j as E, jn as ht, jt as gt, k as _t, kn as D, kt as vt, l as yt, ln as bt, lt as xt, m as St, mn as Ct, mt as wt, n as Tt, nn as Et, nt as Dt, o as Ot, on as kt, ot as At, p as jt, pn as Mt, pt as Nt, q as Pt, qt as Ft, r as It, rn as Lt, rt as Rt, s as zt, sn as Bt, st as Vt, t as Ht, tn as Ut, tt as Wt, u as Gt, un as Kt, ut as qt, v as Jt, vn as O, vt as Yt, w as Xt, wn as Zt, wt as Qt, x as $t, xn as en, xt as tn, y as nn, yn as rn, yt as an, z as on, zt as sn } from "./html-BkTs7pPl.js";
2
2
  //#region ../../node_modules/@tricoteuses/legifrance/dist/legal/index.js
3
- function on(e, t) {
3
+ function cn(e, t) {
4
4
  if (e != null) {
5
5
  if (!Array.isArray(e)) return e;
6
6
  for (let n of e) if (n["@debut"] <= t && t <= n["@fin"]) return n;
7
7
  return e[0];
8
8
  }
9
9
  }
10
- function* j(e) {
11
- yield e, e.TM !== void 0 && (yield* j(e.TM));
10
+ function* k(e) {
11
+ yield e, e.TM !== void 0 && (yield* k(e.TM));
12
12
  }
13
13
  //#endregion
14
14
  //#region src/lib/articles.ts
15
- var M = ["2222-02-22", "2999-01-01"], sn = (e) => {
15
+ var A = ["2222-02-22", "2999-01-01"], ln = (e) => {
16
16
  if (e !== void 0) for (let t = 0; t < e.length; ++t) {
17
- let n = tt(new E(e, t));
17
+ let n = rt(new w(e, t));
18
18
  if (typeof n == "string") return n;
19
19
  }
20
- }, cn = (e) => (e === void 0 ? [] : Array.isArray(e) ? e : [e]).map((e) => sn(e["#text"])).find((e) => e !== void 0), ln = (e) => {
20
+ }, un = (e) => (e === void 0 ? [] : Array.isArray(e) ? e : [e]).map((e) => ln(e["#text"])).find((e) => e !== void 0), dn = (e) => {
21
21
  let t = e.META.META_SPEC.META_ARTICLE.DATE_DEBUT;
22
- if (t !== void 0 && !M.includes(t)) return t;
23
- let n = e.CONTEXTE.TEXTE, r = n.TITRE_TXT, i = [...r === void 0 ? [] : (Array.isArray(r) ? r : [r]).map((e) => e["@debut"]), ...n.TM === void 0 ? [] : j(n.TM).map((e) => (Array.isArray(e.TITRE_TM) ? e.TITRE_TM : [e.TITRE_TM]).map((e) => e["@debut"])).toArray().flat()].filter((e) => !M.includes(e));
22
+ if (t !== void 0 && !A.includes(t)) return t;
23
+ let n = e.CONTEXTE.TEXTE, r = n.TITRE_TXT, i = [...r === void 0 ? [] : (Array.isArray(r) ? r : [r]).map((e) => e["@debut"]), ...n.TM === void 0 ? [] : k(n.TM).map((e) => (Array.isArray(e.TITRE_TM) ? e.TITRE_TM : [e.TITRE_TM]).map((e) => e["@debut"])).toArray().flat()].filter((e) => !A.includes(e));
24
24
  if (i.length > 0) return i.sort().at(-1);
25
25
  let a = n["@date_publi"];
26
- if (a !== void 0 && !M.includes(a)) return a;
26
+ if (a !== void 0 && !A.includes(a)) return a;
27
27
  let o = n["@date_signature"];
28
- if (o !== void 0 && !M.includes(o)) return o;
28
+ if (o !== void 0 && !A.includes(o)) return o;
29
29
  let s = e.META.META_SPEC.META_ARTICLE.DATE_FIN;
30
- if (s !== void 0 && !M.includes(s)) return s;
31
- let c = cn(r);
30
+ if (s !== void 0 && !A.includes(s)) return s;
31
+ let c = un(r);
32
32
  if (c !== void 0) return c;
33
- if (M.includes(t ?? "")) return t;
33
+ if (A.includes(t ?? "")) return t;
34
34
  throw Error(`Missing date signature in article ${e.META.META_COMMUN.ID}`);
35
- }, N = (e) => {
35
+ }, j = (e) => {
36
36
  let t = e.META.META_SPEC.META_ARTICLE.DATE_DEBUT;
37
- if (t !== void 0 && !M.includes(t)) return t;
37
+ if (t !== void 0 && !A.includes(t)) return t;
38
38
  let n = e.CONTEXTE.TEXTE, r = n["@date_signature"];
39
- if (r !== void 0 && !M.includes(r)) return r;
39
+ if (r !== void 0 && !A.includes(r)) return r;
40
40
  let i = n["@date_publi"];
41
- if (i !== void 0 && !M.includes(i)) return i;
42
- let a = n.TITRE_TXT, o = [...a === void 0 ? [] : (Array.isArray(a) ? a : [a]).map((e) => e["@debut"]), ...n.TM === void 0 ? [] : j(n.TM).map((e) => (Array.isArray(e.TITRE_TM) ? e.TITRE_TM : [e.TITRE_TM]).map((e) => e["@debut"])).toArray().flat()].filter((e) => !M.includes(e));
41
+ if (i !== void 0 && !A.includes(i)) return i;
42
+ let a = n.TITRE_TXT, o = [...a === void 0 ? [] : (Array.isArray(a) ? a : [a]).map((e) => e["@debut"]), ...n.TM === void 0 ? [] : k(n.TM).map((e) => (Array.isArray(e.TITRE_TM) ? e.TITRE_TM : [e.TITRE_TM]).map((e) => e["@debut"])).toArray().flat()].filter((e) => !A.includes(e));
43
43
  if (o.length > 0) return o.sort().at(-1);
44
44
  let s = e.META.META_SPEC.META_ARTICLE.DATE_FIN;
45
- if (s !== void 0 && !M.includes(s)) return s;
46
- let c = cn(a);
45
+ if (s !== void 0 && !A.includes(s)) return s;
46
+ let c = un(a);
47
47
  if (c !== void 0) return c;
48
- if (M.includes(t ?? "")) return t;
48
+ if (A.includes(t ?? "")) return t;
49
49
  throw Error(`Missing date signature in article ${e.META.META_COMMUN.ID}`);
50
50
  };
51
- async function un(e, t, n, r) {
51
+ async function fn(e, t, n, r) {
52
52
  let i = await d(e, t, n);
53
53
  if (i === void 0) return;
54
- let a = N(i), o = i.META.META_COMMUN.ORIGINE, s = i.CONTEXTE.TEXTE;
54
+ let a = j(i), o = i.META.META_COMMUN.ORIGINE, s = i.CONTEXTE.TEXTE;
55
55
  if (s.TM === void 0) return;
56
- let c = j(s.TM).toArray().reverse(), l;
56
+ let c = k(s.TM).toArray().reverse(), l;
57
57
  switch (o) {
58
58
  case "JORF":
59
59
  l = c.map((e) => e.TITRE_TM["@id"]);
60
60
  break;
61
61
  case "LEGI":
62
- l = c.map((e) => on(e.TITRE_TM, a)?.["@id"]);
62
+ l = c.map((e) => cn(e.TITRE_TM, a)?.["@id"]);
63
63
  break;
64
- default: v("getOrLoadArticleSiblingId origine", o);
64
+ default: _("getOrLoadArticleSiblingId origine", o);
65
65
  }
66
- return await (r === -1 ? I : F)(e, t, n, a, i.num, l);
66
+ return await (r === -1 ? N : M)(e, t, n, a, i.num, l);
67
67
  }
68
- async function dn(e, t, n, r, i, a) {
68
+ async function pn(e, t, n, r, i, a) {
69
69
  let o = r[n];
70
70
  if (o === void 0) {
71
- let s = await k(e, t, n);
71
+ let s = await D(e, t, n);
72
72
  if (s === void 0) return;
73
73
  let c = s.STRUCTURE_TA;
74
74
  if (c === void 0) return;
@@ -96,8 +96,8 @@ async function dn(e, t, n, r, i, a) {
96
96
  }
97
97
  return o;
98
98
  }
99
- async function P(e, t, n) {
100
- let r = await k(e, t, n);
99
+ async function mn(e, t, n) {
100
+ let r = await D(e, t, n);
101
101
  if (r === void 0) return;
102
102
  let i = r.STRUCTURE_TA;
103
103
  if (i === void 0) return;
@@ -105,26 +105,26 @@ async function P(e, t, n) {
105
105
  if (a !== void 0) return a[0]["@id"];
106
106
  let o = i.LIEN_SECTION_TA;
107
107
  if (o !== void 0) for (let n of o) {
108
- let r = await P(e, t, n["@id"]);
108
+ let r = await mn(e, t, n["@id"]);
109
109
  if (r !== void 0) return r;
110
110
  }
111
111
  }
112
- async function fn(e, t, n) {
113
- let r = await k(e, t, n);
112
+ async function hn(e, t, n) {
113
+ let r = await D(e, t, n);
114
114
  if (r === void 0) return;
115
115
  let i = r.STRUCTURE_TA;
116
116
  if (i === void 0) return;
117
117
  let a = i.LIEN_SECTION_TA;
118
118
  if (a !== void 0) for (let n of a.toReversed()) {
119
- let r = await fn(e, t, n["@id"]);
119
+ let r = await hn(e, t, n["@id"]);
120
120
  if (r !== void 0) return r;
121
121
  }
122
122
  return i.LIEN_ART?.at(-1)?.["@id"];
123
123
  }
124
- async function F(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
124
+ async function M(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
125
125
  let l = a[o];
126
126
  if (l === void 0) return;
127
- let u = await dn(e, t, l, s, n, c);
127
+ let u = await pn(e, t, l, s, n, c);
128
128
  if (u === void 0) return;
129
129
  let { area: f, index: p, sectionTa: m } = u, h = m.STRUCTURE_TA;
130
130
  switch (f) {
@@ -134,31 +134,31 @@ async function F(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
134
134
  let a = c[n];
135
135
  if (a["@num"] !== i) {
136
136
  let n = await d(e, t, a["@id"]);
137
- if (n !== void 0 && N(n) <= r) return a["@id"];
137
+ if (n !== void 0 && j(n) <= r) return a["@id"];
138
138
  }
139
139
  }
140
140
  let u = h.LIEN_SECTION_TA;
141
141
  if (u !== void 0) for (let n of u) {
142
- let r = await P(e, t, n["@id"]);
142
+ let r = await mn(e, t, n["@id"]);
143
143
  if (r !== void 0) return r;
144
144
  }
145
- return await F(e, t, n, r, i, a, o + 1, s, l);
145
+ return await M(e, t, n, r, i, a, o + 1, s, l);
146
146
  }
147
147
  case "LIEN_SECTION_TA": {
148
148
  let c = h.LIEN_SECTION_TA;
149
149
  for (let n = p + 1; n < c.length; n++) {
150
- let r = await P(e, t, c[n]["@id"]);
150
+ let r = await mn(e, t, c[n]["@id"]);
151
151
  if (r !== void 0) return r;
152
152
  }
153
- return await F(e, t, n, r, i, a, o + 1, s, l);
153
+ return await M(e, t, n, r, i, a, o + 1, s, l);
154
154
  }
155
- default: v("moveToNextArticleId area", f);
155
+ default: _("moveToNextArticleId area", f);
156
156
  }
157
157
  }
158
- async function I(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
158
+ async function N(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
159
159
  let l = a[o];
160
160
  if (l === void 0) return;
161
- let u = await dn(e, t, l, s, n, c);
161
+ let u = await pn(e, t, l, s, n, c);
162
162
  if (u === void 0) return;
163
163
  let { area: f, index: p, sectionTa: m } = u, h = m.STRUCTURE_TA;
164
164
  switch (f) {
@@ -168,23 +168,23 @@ async function I(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
168
168
  let a = c[n];
169
169
  if (a["@num"] !== i) {
170
170
  let n = await d(e, t, a["@id"]);
171
- if (n !== void 0 && N(n) <= r) return a["@id"];
171
+ if (n !== void 0 && j(n) <= r) return a["@id"];
172
172
  }
173
173
  }
174
- return await I(e, t, n, r, i, a, o + 1, s, l);
174
+ return await N(e, t, n, r, i, a, o + 1, s, l);
175
175
  }
176
176
  case "LIEN_SECTION_TA": {
177
177
  for (let n = p - 1; n >= 0; n--) {
178
- let r = await fn(e, t, h.LIEN_SECTION_TA[n]["@id"]);
178
+ let r = await hn(e, t, h.LIEN_SECTION_TA[n]["@id"]);
179
179
  if (r !== void 0) return r;
180
180
  }
181
181
  let c = h.LIEN_ART;
182
- return c === void 0 ? await I(e, t, n, r, i, a, o + 1, s, l) : (u.area = "LIEN_ART", u.index = c.length, await I(e, t, n, r, i, a, o, s));
182
+ return c === void 0 ? await N(e, t, n, r, i, a, o + 1, s, l) : (u.area = "LIEN_ART", u.index = c.length, await N(e, t, n, r, i, a, o, s));
183
183
  }
184
- default: v("moveToPreviousArticleId area", f);
184
+ default: _("moveToPreviousArticleId area", f);
185
185
  }
186
186
  }
187
- var pn = (e) => (t, n) => {
187
+ var gn = (e) => (t, n) => {
188
188
  let r = e(t), i = e(n);
189
189
  if (r !== i) return r.localeCompare(i);
190
190
  let a = t.META.META_COMMUN, o = a.ORIGINE, s = n.META.META_COMMUN, c = s.ORIGINE;
@@ -203,13 +203,13 @@ var pn = (e) => (t, n) => {
203
203
  if (m <= i) return 1;
204
204
  }
205
205
  throw Error(`TODO: Unable to sort articles ${a.ID} & ${s.ID} by date.`);
206
- }, mn = new Intl.DateTimeFormat("fr-FR", { dateStyle: "long" });
207
- function hn(e) {
208
- return mn.format(new Date(e)).replace(/^1 /, "1er ");
206
+ }, _n = new Intl.DateTimeFormat("fr-FR", { dateStyle: "long" });
207
+ function vn(e) {
208
+ return _n.format(new Date(e)).replace(/^1 /, "1er ");
209
209
  }
210
210
  //#endregion
211
211
  //#region src/lib/extractors/article_portions.ts
212
- var L = new RegExp(String.raw`^\s*([IVXLCDM]+|[A-Z]|[a-z]|\d+)(?:\s+(?:${Ge}))?(?:\s*(?:°|\.|\)|-|–|—))+(?:\s+(?:${Ge}))?(?:\s+|(?=[\p{L}\p{N}]))`, "iu"), gn = /^\s*(partie|livre|titre|sous-titre|chapitre|section|sous-section|paragraphe|sous-paragraphe|sous-sous-paragraphe)\s+([IVXLCDM]+|[A-Z]|\d+)(?:\s*(?:°|\.|\)|-))?\s*/iu, _n = /^(partie|livre|titre|sous-titre|chapitre|section|sous-section|paragraphe|sous-paragraphe|sous-sous-paragraphe)\b/i, vn = {
212
+ var P = new RegExp(String.raw`^\s*([IVXLCDM]+|[A-Z]|[a-z]|\d+)(?:\s+(?:${Ke}))?(?:\s*(?:°|\.|\)|-|–|—))+(?:\s+(?:${Ke}))?(?:\s+|(?=[\p{L}\p{N}]))`, "iu"), yn = /^\s*-\s*/u, bn = /^\s*(partie|livre|titre|sous-titre|chapitre|section|sous-section|paragraphe|sous-paragraphe|sous-sous-paragraphe)\s+([IVXLCDM]+|[A-Z]|\d+)(?:\s*(?:°|\.|\)|-))?\s*/iu, xn = /^(partie|livre|titre|sous-titre|chapitre|section|sous-section|paragraphe|sous-paragraphe|sous-sous-paragraphe)\b/i, Sn = {
213
213
  partie: 0,
214
214
  livre: 1,
215
215
  titre: 2,
@@ -221,17 +221,17 @@ var L = new RegExp(String.raw`^\s*([IVXLCDM]+|[A-Z]|[a-z]|\d+)(?:\s+(?:${Ge}))?(
221
221
  "sous-paragraphe": 8,
222
222
  "sous-sous-paragraphe": 9
223
223
  };
224
- function R(e) {
224
+ function Cn(e) {
225
225
  return /^[IVXLCDM]+$/i.test(e);
226
226
  }
227
- function yn(e) {
228
- let t = Qt(e, Ue);
227
+ function wn(e) {
228
+ let t = en(e, We);
229
229
  return t && typeof t == "object" && t.type === "item" && typeof t.index == "number" && typeof t.num == "string" ? {
230
230
  num: t.num,
231
231
  index: t.index
232
232
  } : null;
233
233
  }
234
- function bn(e) {
234
+ function Tn(e) {
235
235
  let t = {
236
236
  I: 1,
237
237
  V: 5,
@@ -248,29 +248,29 @@ function bn(e) {
248
248
  }
249
249
  return n || void 0;
250
250
  }
251
- function z(e) {
251
+ function En(e) {
252
252
  let t = e.trim(), n = t.split(/\s+/), r = n[0] ? n[0].replace(/[^\p{L}\p{N}]+/gu, "") : t, i = n.length > 1 ? n.slice(1).join(" ") : void 0, a = (() => {
253
253
  if (/^\d+$/.test(r)) return Number(r);
254
254
  if (/^[A-Z]$/i.test(r)) return r.toLowerCase().charCodeAt(0) - 97 + 1;
255
- if (R(r)) return bn(r);
255
+ if (Cn(r)) return Tn(r);
256
256
  })();
257
257
  if (a === void 0) return;
258
258
  if (!i) return a;
259
- let o = Qt(i, dt);
259
+ let o = en(i, pt);
260
260
  if (o && typeof o == "object" && "value" in o) {
261
261
  let e = o.value;
262
262
  if (typeof e == "number") return a + e / 1e3;
263
263
  }
264
264
  return a;
265
265
  }
266
- function xn(e) {
266
+ function Dn(e) {
267
267
  let t = e.trim().split(/\s+/)[0] ?? e, n = t.replace(/[^\p{L}\p{N}]+/gu, "");
268
- return /^[ivxlcdm]+$/.test(n) && (n.length > 1 || /^[ivx]$/.test(n)) ? 105 : /^[A-Z]$/.test(n) ? 101 : /^\d+$/.test(n) && /°/.test(t) ? 103 : /^\d+$/.test(n) ? 102 : /^[a-z]$/.test(n) ? 104 : R(n) ? 100 : 105;
268
+ return /^[ivxlcdm]+$/.test(n) && (n.length > 1 || /^[ivx]$/.test(n)) ? 105 : /^[A-Z]$/.test(n) ? 101 : /^\d+$/.test(n) && /°/.test(t) ? 103 : /^\d+$/.test(n) ? 102 : /^[a-z]$/.test(n) ? 104 : Cn(n) ? 100 : 105;
269
269
  }
270
- function B(e) {
270
+ function F(e) {
271
271
  return e.children.filter((e) => e.type === "alinéa").length + 1;
272
272
  }
273
- function Sn(t) {
273
+ function On(t) {
274
274
  let n = e(t), r = {
275
275
  type: "article",
276
276
  children: []
@@ -301,36 +301,36 @@ function Sn(t) {
301
301
  let l = (e, n, r) => {
302
302
  let a = e, o = n;
303
303
  for (;;) {
304
- let e = o.match(L);
304
+ let e = o.match(P);
305
305
  if (!e) break;
306
- let t = yn(e[0]), n = t?.num ?? e[1], r = {
306
+ let t = wn(e[0]), n = t?.num ?? e[1], r = {
307
307
  type: "item",
308
- index: t?.index ?? z(n),
308
+ index: t?.index ?? En(n),
309
309
  num: n,
310
310
  label: void 0,
311
311
  children: []
312
312
  };
313
313
  a.children.push(r), i.push({
314
- level: xn(n),
314
+ level: Dn(n),
315
315
  node: r
316
316
  }), a = r, o = o.slice(e[0].length).trim();
317
317
  }
318
318
  o && a.children.push({
319
319
  type: "alinéa",
320
- index: B(a),
320
+ index: F(a),
321
321
  text: o,
322
322
  html: r,
323
323
  paragraphIndex: t
324
324
  });
325
325
  };
326
326
  for (let e of c) {
327
- let n = e.text, a = n.match(gn);
327
+ let n = e.text, a = n.match(bn);
328
328
  if (a) {
329
- let o = a[1].toLowerCase(), s = a[2], c = vn[o];
329
+ let o = a[1].toLowerCase(), s = a[2], c = Sn[o];
330
330
  for (; i.length > 0 && i[i.length - 1].level >= c;) i.pop();
331
331
  let u = i[i.length - 1]?.node ?? r, d = {
332
332
  type: o,
333
- index: z(s),
333
+ index: En(s),
334
334
  num: s,
335
335
  label: void 0,
336
336
  children: []
@@ -340,22 +340,22 @@ function Sn(t) {
340
340
  node: d
341
341
  });
342
342
  let f = n.slice(a[0].length).trim();
343
- f && (_n.test(f) ? d.label = f : L.test(f) ? l(d, f, e.html) : d.children.push({
343
+ f && (xn.test(f) ? d.label = f : P.test(f) ? l(d, f, e.html) : d.children.push({
344
344
  type: "alinéa",
345
- index: B(d),
345
+ index: F(d),
346
346
  text: f,
347
347
  html: e.html,
348
348
  paragraphIndex: t
349
349
  }));
350
350
  continue;
351
351
  }
352
- let o = n.match(L);
352
+ let o = n.match(P);
353
353
  if (o) {
354
- let a = yn(o[0]), s = a?.num ?? o[1], c = xn(s);
354
+ let a = wn(o[0]), s = a?.num ?? o[1], c = Dn(s);
355
355
  for (; i.length > 0 && i[i.length - 1].level >= c;) i.pop();
356
356
  let u = i[i.length - 1]?.node ?? r, d = {
357
357
  type: "item",
358
- index: a?.index ?? z(s),
358
+ index: a?.index ?? En(s),
359
359
  num: s,
360
360
  label: void 0,
361
361
  children: []
@@ -365,9 +365,9 @@ function Sn(t) {
365
365
  node: d
366
366
  });
367
367
  let f = n.slice(o[0].length).trim();
368
- f && (_n.test(f) ? d.label = f : L.test(f) ? l(d, f, e.html) : d.children.push({
368
+ f && (xn.test(f) ? d.label = f : P.test(f) ? l(d, f, e.html) : d.children.push({
369
369
  type: "alinéa",
370
- index: B(d),
370
+ index: F(d),
371
371
  text: f,
372
372
  html: e.html,
373
373
  paragraphIndex: t
@@ -377,7 +377,7 @@ function Sn(t) {
377
377
  let s = i[i.length - 1]?.node ?? r;
378
378
  s.children.push({
379
379
  type: "alinéa",
380
- index: B(s),
380
+ index: F(s),
381
381
  text: n,
382
382
  html: e.html,
383
383
  paragraphIndex: t
@@ -385,8 +385,8 @@ function Sn(t) {
385
385
  }
386
386
  }), r;
387
387
  }
388
- function V(e) {
389
- return e.type === "parent-enfant" ? [...V(e.parent), ...V(e.child)] : ne(e) && (ue(e) || Nt(e)) ? [{
388
+ function I(e) {
389
+ return e.type === "parent-enfant" ? [...I(e.parent), ...I(e.child)] : re(e) && (de(e) || Ft(e)) ? [{
390
390
  type: e.type,
391
391
  index: e.index,
392
392
  num: e.num,
@@ -394,10 +394,10 @@ function V(e) {
394
394
  present: e.present
395
395
  }] : [];
396
396
  }
397
- function H(e) {
398
- if (e.type === "reference_et_action") return H(e.reference);
397
+ function L(e) {
398
+ if (e.type === "reference_et_action") return L(e.reference);
399
399
  if (e.type === "parent-enfant") {
400
- let t = H(e.parent), n = H(e.child);
400
+ let t = L(e.parent), n = L(e.child);
401
401
  if (t.length === 0) return n;
402
402
  if (n.length === 0) return t;
403
403
  let r = [];
@@ -428,7 +428,7 @@ function H(e) {
428
428
  return r;
429
429
  }
430
430
  if (e.type === "bounded-interval") {
431
- let t = V(e.first), n = V(e.last);
431
+ let t = I(e.first), n = I(e.last);
432
432
  return t.length === 0 || n.length === 0 ? [] : [{
433
433
  kind: "range",
434
434
  first: t,
@@ -436,7 +436,7 @@ function H(e) {
436
436
  }];
437
437
  }
438
438
  if (e.type === "counted-interval") {
439
- let t = V(e.first);
439
+ let t = I(e.first);
440
440
  return t.length === 0 ? [] : [{
441
441
  kind: "range",
442
442
  first: t,
@@ -444,16 +444,16 @@ function H(e) {
444
444
  count: e.count
445
445
  }];
446
446
  }
447
- if (e.type === "enumeration") return [...H(e.left), ...H(e.right)];
448
- if (e.type === "exclusion") return H(e.left);
449
- let t = V(e);
447
+ if (e.type === "enumeration") return [...L(e.left), ...L(e.right)];
448
+ if (e.type === "exclusion") return L(e.left);
449
+ let t = I(e);
450
450
  return t.length === 0 ? [] : [{
451
451
  kind: "single",
452
452
  steps: t
453
453
  }];
454
454
  }
455
- function Cn(e) {
456
- let t = H(e);
455
+ function kn(e) {
456
+ let t = L(e);
457
457
  if (t.length === 0) return t;
458
458
  let n = t[0];
459
459
  if (n?.kind === "single" && n.steps.length > 1) {
@@ -465,18 +465,18 @@ function Cn(e) {
465
465
  }
466
466
  return t;
467
467
  }
468
- function wn(e, t) {
468
+ function An(e, t) {
469
469
  if (t.num !== void 0 && e.num !== void 0) {
470
470
  let n = (e) => e.toLowerCase().replace(/[.)]/g, "").trim();
471
471
  if (n(t.num) !== n(e.num)) return !1;
472
472
  }
473
473
  return t.index !== void 0 && e.index !== void 0 ? t.index === e.index : t.num !== void 0 && e.num !== void 0;
474
474
  }
475
- function Tn(e, t) {
475
+ function jn(e, t) {
476
476
  let n = (e) => "children" in e && (e.type === "article" || e.type === "item" || S.includes(e.type)) ? e.children : [], r = (e) => e.type === "alinéa" ? [e] : e.type === "article" || e.type === "item" || S.includes(e.type) ? e.children.flatMap(r) : [];
477
477
  if (S.includes(t.type)) {
478
478
  let r = n(e);
479
- for (let e of r) if (S.includes(e.type) && e.type === t.type && wn(e, t)) return {
479
+ for (let e of r) if (S.includes(e.type) && e.type === t.type && An(e, t)) return {
480
480
  node: e,
481
481
  path: [e]
482
482
  };
@@ -484,13 +484,13 @@ function Tn(e, t) {
484
484
  }
485
485
  if (t.type === "item") {
486
486
  let r = n(e);
487
- for (let e of r) if (e.type === "item" && wn(e, t)) return {
487
+ for (let e of r) if (e.type === "item" && An(e, t)) return {
488
488
  node: e,
489
489
  path: [e]
490
490
  };
491
491
  for (let e of r) {
492
492
  if (e.type === "alinéa") continue;
493
- let n = Tn(e, t);
493
+ let n = jn(e, t);
494
494
  if (n) return {
495
495
  node: n.node,
496
496
  path: [e, ...n.path]
@@ -502,14 +502,14 @@ function Tn(e, t) {
502
502
  let i = n(e).filter((e) => e.type === "alinéa");
503
503
  if (i.length === 0) return null;
504
504
  if (t.index !== void 0) {
505
- let n = t.index, a = n < 0 ? r(e) : i;
506
- if (a.length === 0) return null;
507
- let o = n < 0 ? a.length + n + 1 : n;
508
- if (o < 1 || o > a.length) return null;
509
- let s = a[o - 1];
505
+ let n = t.index, a = r(e), o = n < 0 || n > i.length && n <= a.length ? a : i;
506
+ if (o.length === 0) return null;
507
+ let s = n < 0 ? o.length + n + 1 : n;
508
+ if (s < 1 || s > o.length) return null;
509
+ let c = o[s - 1];
510
510
  return {
511
- node: s,
512
- path: [s]
511
+ node: c,
512
+ path: [c]
513
513
  };
514
514
  }
515
515
  return null;
@@ -537,12 +537,12 @@ function Tn(e, t) {
537
537
  }
538
538
  return null;
539
539
  }
540
- function U(e, t) {
540
+ function Mn(e, t) {
541
541
  if (t.kind === "range") {
542
- let n = U(e, {
542
+ let n = Mn(e, {
543
543
  kind: "single",
544
544
  steps: t.first
545
- }), r = U(e, {
545
+ }), r = Mn(e, {
546
546
  kind: "single",
547
547
  steps: t.last
548
548
  });
@@ -556,7 +556,7 @@ function U(e, t) {
556
556
  }
557
557
  let n = e, r = [];
558
558
  for (let e of t.steps) {
559
- let t = Tn(n, e);
559
+ let t = jn(n, e);
560
560
  if (!t) return null;
561
561
  n = t.node, r.push(...t.path);
562
562
  }
@@ -568,13 +568,17 @@ function U(e, t) {
568
568
  }
569
569
  //#endregion
570
570
  //#region src/lib/extractors/action_directives.ts
571
- function W(e) {
571
+ function R(e) {
572
572
  return e.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
573
573
  }
574
- function G(e) {
575
- return e.replace(L, "");
574
+ function z(e) {
575
+ return e.replace(P, "");
576
576
  }
577
- function En(e) {
577
+ function Nn(e) {
578
+ let t = z(e);
579
+ return t === e ? e.replace(yn, "") : t;
580
+ }
581
+ function Pn(e) {
578
582
  let t = e.split("\n"), n = [], r = 0;
579
583
  for (let e of t) {
580
584
  let t = r, i = t + e.length;
@@ -586,11 +590,15 @@ function En(e) {
586
590
  }
587
591
  return n;
588
592
  }
589
- function Dn(e) {
590
- return L.test(e);
593
+ function Fn(e) {
594
+ return P.test(e) || yn.test(e);
591
595
  }
592
- function On(e) {
593
- let t = L.exec(e);
596
+ function In(e) {
597
+ if (yn.test(e)) return {
598
+ marker: "-",
599
+ level: 5
600
+ };
601
+ let t = P.exec(e);
594
602
  if (!t) return null;
595
603
  let n = t[1] ?? "";
596
604
  return n ? /^\d+$/.test(n) ? {
@@ -602,7 +610,7 @@ function On(e) {
602
610
  } : /^[a-z]$/.test(n) ? {
603
611
  marker: n,
604
612
  level: 3
605
- } : R(n) || /^[A-Z]$/.test(n) ? {
613
+ } : Cn(n) || /^[A-Z]$/.test(n) ? {
606
614
  marker: n,
607
615
  level: 1
608
616
  } : {
@@ -610,59 +618,63 @@ function On(e) {
610
618
  level: 2
611
619
  } : null;
612
620
  }
613
- function kn(e) {
614
- let t = W(e), n = /(?:^|[^\p{L}])(insere(?:e|es|s)?|ajoute(?:e|es|s)?|remplace(?:e|es|s)?|supprime(?:e|es|s)?|abroge(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)(?=$|[^\p{L}])/u.exec(t);
615
- return n ? (n.index ?? 0) + (n[0].length - n[1].length) : null;
621
+ function B(e) {
622
+ for (let t = 0; t < e.length; t += 1) {
623
+ let n = new w(e.slice(t));
624
+ if (ce(n) && n.offset > 0) return t;
625
+ }
626
+ return null;
616
627
  }
617
- function An(e) {
628
+ function V(e) {
618
629
  return e.type === "reference_et_action" ? e.reference : e;
619
630
  }
620
- function jn(e) {
621
- return s(new E(e)).map(An).find((e) => b(e) === "article") || (lr(e)?.reference ?? null);
631
+ function Ln(e) {
632
+ return s(new w(e)).map(V).find((e) => y(e) === "article") || (Y(e)?.reference ?? null);
622
633
  }
623
- function Mn(e) {
624
- let t = kn(e) ?? e.length, n = $n(e), r = s(new E(e)).map(An).filter((e) => !er(e.position, n) && b(e) !== "article" && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0));
625
- if (r[0]) return r[0];
626
- let i = e.slice(0, t).trimEnd();
627
- return J(i, 0) ?? J(i.replace(/\b(?:est|sont)\s*$/iu, "").trimEnd(), 0);
634
+ function Rn(e) {
635
+ let t = B(e) ?? e.length, n = dr(e), r = s(new w(e)), i = r.flatMap((e) => Array.from(v(V(e)))).filter((e) => e.type === "article" && e.position).map((e) => ({
636
+ start: e.position.start,
637
+ end: e.position.stop
638
+ })), a = r.map(V).filter((e) => !fr(e.position, n) && !ur(e.position, i) && y(e) !== "article" && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0)), o = e.slice(0, t).trimEnd(), c = K(o, 0) ?? K(o.replace(/\b(?:est|sont)\s*$/iu, "").trimEnd(), 0), l = c && !ur(c.position, i) ? c : null, u = a[0];
639
+ return !u || l && q(l) > q(u) ? l : u;
628
640
  }
629
- function Nn(e) {
630
- let t = kn(e) ?? e.length, n = $n(e), r = s(new E(e)).map(An).filter((e) => !er(e.position, n) && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0));
631
- return r.length === 0 ? null : r.find((e) => b(e) !== "article") ?? null ?? r[0] ?? null;
641
+ function zn(e) {
642
+ let t = B(e) ?? e.length, n = dr(e), r = s(new w(e)).map(V).filter((e) => !fr(e.position, n) && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0));
643
+ return r.length === 0 ? null : r.find((e) => y(e) !== "article") ?? null ?? r[0] ?? null;
632
644
  }
633
- function Pn(e) {
634
- let t = [e, G(e)].map((e) => e.trim()).filter((e, t, n) => e && n.indexOf(e) === t);
645
+ function Bn(e) {
646
+ let t = [e, z(e)].map((e) => e.trim()).filter((e, t, n) => e && n.indexOf(e) === t);
635
647
  for (let e of t) {
636
- let t = J(e, 0) ?? sr(e) ?? Nn(e) ?? jn(e);
648
+ let t = yr(e, 0) ?? Sr(e) ?? zn(e) ?? Ln(e);
637
649
  if (t) return t;
638
650
  }
639
651
  return null;
640
652
  }
641
- function Fn(e) {
653
+ function Vn(e) {
642
654
  return e?.toLowerCase().replace(/[.)]/g, "").trim();
643
655
  }
644
- function In(e, t) {
645
- return !(e.type !== t.type || e.index !== void 0 && t.index !== void 0 && e.index !== t.index || e.num !== void 0 && t.num !== void 0 && Fn(e.num) !== Fn(t.num));
656
+ function Hn(e, t) {
657
+ return !(e.type !== t.type || e.index !== void 0 && t.index !== void 0 && e.index !== t.index || e.num !== void 0 && t.num !== void 0 && Vn(e.num) !== Vn(t.num));
646
658
  }
647
- function Ln(e) {
659
+ function Un(e) {
648
660
  let t = null;
649
- for (let n of y(e)) t = n;
661
+ for (let n of v(e)) t = n;
650
662
  return t;
651
663
  }
652
- function Rn(e, t) {
653
- return t && e.type === "parent-enfant" && In(e.parent, t) ? e.child : e;
664
+ function Wn(e, t) {
665
+ return t && e.type === "parent-enfant" && Hn(e.parent, t) ? e.child : e;
654
666
  }
655
- function zn(e, t) {
667
+ function Gn(e, t) {
656
668
  let n = null;
657
- for (let r of y(e)) r.type === t && r.relative === void 0 && (r.index === void 0 && r.num === void 0 || (n = r));
669
+ for (let r of v(e)) r.type === t && r.relative === void 0 && (r.index === void 0 && r.num === void 0 || (n = r));
658
670
  return n;
659
671
  }
660
- function Bn(e, t) {
672
+ function Kn(e, t) {
661
673
  if (!t) return e;
662
674
  let n = structuredClone(e), r = (e) => {
663
675
  if (e.type !== "parent-enfant" && e.type !== "bounded-interval" && e.type !== "counted-interval" && e.type !== "enumeration" && e.type !== "exclusion" && e.type !== "reference_et_action") {
664
676
  if (e.relative === 0) {
665
- let n = zn(t, e.type);
677
+ let n = Gn(t, e.type);
666
678
  n && (e.index = n.index, e.num = n.num, delete e.relative);
667
679
  }
668
680
  return;
@@ -688,7 +700,7 @@ function Bn(e, t) {
688
700
  };
689
701
  return r(n), n;
690
702
  }
691
- function Vn(e) {
703
+ function qn(e) {
692
704
  let t = (e) => {
693
705
  if (e.type !== "parent-enfant" && e.type !== "bounded-interval" && e.type !== "counted-interval" && e.type !== "enumeration" && e.type !== "exclusion" && e.type !== "reference_et_action") return e.relative !== void 0;
694
706
  switch (e.type) {
@@ -702,14 +714,14 @@ function Vn(e) {
702
714
  };
703
715
  return t(e);
704
716
  }
705
- function Hn(e) {
717
+ function Jn(e) {
706
718
  let t = [], n = [];
707
719
  for (let r of e) {
708
- if (!Dn(r.text)) {
720
+ if (!Fn(r.text)) {
709
721
  n[n.length - 1]?.body.push(r);
710
722
  continue;
711
723
  }
712
- let e = On(r.text)?.level ?? 0, i = {
724
+ let e = In(r.text)?.level ?? 0, i = {
713
725
  body: [],
714
726
  children: [],
715
727
  level: e,
@@ -720,75 +732,90 @@ function Hn(e) {
720
732
  }
721
733
  return t;
722
734
  }
723
- function Un(e, t) {
735
+ function Yn(e, t) {
724
736
  if (!e) return t;
725
737
  if (!t) return e;
726
- let n = Rn(t, Ln(e));
727
- return n.type === "article" || b(n), ge(e, n);
738
+ let n = Wn(t, Un(e));
739
+ return n.type === "article" || y(n), b(e, n);
728
740
  }
729
- function Wn(e) {
730
- return [G(e.line.text), ...e.body.map((e) => e.text)].join("\n").trim();
741
+ function Xn(e) {
742
+ return [Nn(e.line.text), ...e.body.map((e) => e.text)].join("\n").trim();
731
743
  }
732
- function Gn(e) {
744
+ function Zn(e) {
733
745
  return e.body[e.body.length - 1]?.end ?? e.line.end;
734
746
  }
735
- function Kn(e, t) {
736
- let n = [], r = t;
737
- for (let i of e) {
738
- let e = G(i.line.text), a = Wn(i);
739
- if (!a) continue;
740
- let o = Pn(e), s = Un(t, o), c = kn(a) !== null;
741
- if (i.children.length > 0) {
742
- let e = s ?? t, a = Kn(i.children, e);
743
- a.length > 0 && (n.push(...a), r = a[a.length - 1]?.reference ?? r);
747
+ function Qn(e, t) {
748
+ if (!e) return t;
749
+ if (!t) return e;
750
+ let n = t.rowIndex ?? e.rowIndex, r = t.columnIndex ?? e.columnIndex;
751
+ return {
752
+ type: "table",
753
+ ...n ? { rowIndex: n } : {},
754
+ ...r ? { columnIndex: r } : {}
755
+ };
756
+ }
757
+ function H(e) {
758
+ return e !== void 0 && (e.rowIndex !== void 0 || e.columnIndex !== void 0);
759
+ }
760
+ function $n(e, t, n, r) {
761
+ let i = [], a = t;
762
+ for (let o of e) {
763
+ let e = Nn(o.line.text), s = Xn(o);
764
+ if (!s) continue;
765
+ let c = Qn(r, U(s, r !== void 0)), l = Bn(e), u = Yn(t, l), d = B(s) !== null;
766
+ if (o.children.length > 0) {
767
+ let e = u ?? t, r = $n(o.children, e, n, c);
768
+ r.length > 0 && (i.push(...r), a = r[r.length - 1]?.reference ?? a);
744
769
  continue;
745
770
  }
746
- if (!c) {
747
- r = s ?? r;
771
+ if (!d) {
772
+ a = u ?? a;
748
773
  continue;
749
774
  }
750
- let l = jn(a), u = Un(t, Mn(a) ?? l ?? o) ?? l ?? s;
751
- if (!u) continue;
752
- u = Bn(u, Vn(u) ? r ?? t : t);
753
- let d = Y({
775
+ let f = Ln(s), p = Yn(t, Rn(s) ?? f ?? l) ?? f ?? u;
776
+ if (!p) continue;
777
+ p = Kn(p, qn(p) ? a ?? t : t);
778
+ let m = J({
754
779
  action: { action: "modifier" },
755
- reference: u,
780
+ reference: p,
756
781
  sourcePosition: {
757
- start: i.line.start,
758
- stop: Gn(i)
782
+ start: o.line.start,
783
+ stop: Zn(o)
759
784
  },
760
- sourceText: a
785
+ sourceText: s,
786
+ fullText: n,
787
+ tableTarget: c
761
788
  });
762
- if (!d) {
763
- r = u;
789
+ if (!m) {
790
+ a = p;
764
791
  continue;
765
792
  }
766
- Array.isArray(d) ? n.push(...d) : n.push(d), r = u;
793
+ Array.isArray(m) ? i.push(...m) : i.push(m), a = p;
767
794
  }
768
- return n;
795
+ return i;
769
796
  }
770
- function qn(e) {
771
- let t = En(e), n = t.findIndex((e) => Dn(e.text));
797
+ function er(e) {
798
+ let t = Pn(e), n = t.findIndex((e) => Fn(e.text));
772
799
  if (n === -1) return null;
773
- let r = t.slice(0, n).reverse().map((e) => Pn(e.text)).find((e) => e !== null) ?? null, i = Kn(Hn(t.slice(n)), r);
800
+ let r = t.slice(0, n).reverse().map((e) => Bn(e.text)).find((e) => e !== null) ?? null, i = $n(Jn(t.slice(n)), r, e);
774
801
  return i.length > 0 ? i : null;
775
802
  }
776
- function Jn(e) {
803
+ function tr(e) {
777
804
  return e.split(/\n+/).map((e) => e.replace(/^\s*[«“"]\s*/u, "").trim()).filter((e) => e.length > 0).join("\n").replace(/[»”"]\s*$/u, "").trim();
778
805
  }
779
- function Yn(e) {
806
+ function nr(e) {
780
807
  let t = [], n = 0;
781
808
  for (; n < e.length;) {
782
809
  let r = e.indexOf("«", n);
783
810
  if (r === -1) break;
784
- let i = new E(e);
811
+ let i = new w(e);
785
812
  i.offset = r;
786
813
  let a = ze(i);
787
814
  if (!a) {
788
815
  n = r + 1;
789
816
  continue;
790
817
  }
791
- let o = Jn(Ce(i, a).output), s = a.position ?? {
818
+ let o = tr(Ce(i, a).output), s = a.position ?? {
792
819
  start: r,
793
820
  stop: r + 1
794
821
  };
@@ -802,7 +829,38 @@ function Yn(e) {
802
829
  }
803
830
  return t;
804
831
  }
805
- function Xn(e, t) {
832
+ function rr(e, t) {
833
+ let n = e.indexOf("«");
834
+ if (n === -1) return;
835
+ let r = e.indexOf("»", n + 1);
836
+ if (r === -1) return;
837
+ let i = e.slice(n + 1, r);
838
+ if (i.trim()) return {
839
+ type: "citation",
840
+ text: i,
841
+ sourcePosition: {
842
+ start: t + n + 1,
843
+ stop: t + r
844
+ }
845
+ };
846
+ }
847
+ function ir(e) {
848
+ let t = R(e);
849
+ return /\btableau\b/.test(t) && /\b(?:tableau|celui)\s+(?:suivant|ainsi\s+redigee?|ainsi\s+rediges|ainsi\s+redigees)\b/.test(t);
850
+ }
851
+ function ar(e) {
852
+ for (let t of Pn(e)) {
853
+ if (!ir(t.text)) continue;
854
+ let e = t.text.indexOf(":");
855
+ return e === -1 ? t.end : t.start + e + 1;
856
+ }
857
+ return null;
858
+ }
859
+ function or(e, t) {
860
+ let n = ar(e);
861
+ return n === null ? rr(e, t) : rr(e.slice(n), t + n);
862
+ }
863
+ function sr(e, t) {
806
864
  if (t.length === 0) return e;
807
865
  let n = 0, r = [];
808
866
  for (let { start: i, end: a } of t) {
@@ -811,30 +869,57 @@ function Xn(e, t) {
811
869
  }
812
870
  return n < e.length && r.push(e.slice(n)), r.join("");
813
871
  }
814
- function Zn(e) {
872
+ function cr(e) {
815
873
  let t = e.trim();
816
874
  if (!t) return null;
817
- let n = wt(new E(t));
875
+ let n = Et(new w(t));
818
876
  if (typeof n == "number") return n;
819
877
  if (n && typeof n == "object" && "value" in n) {
820
878
  let e = n.value;
821
879
  return Number.isFinite(e) ? e : null;
822
880
  }
823
- let r = Dt(new E(t));
881
+ let r = kt(new w(t));
824
882
  if (r && typeof r == "object" && "value" in r) {
825
883
  let e = r.value;
826
884
  return Number.isFinite(e) ? e : null;
827
885
  }
828
886
  return typeof r == "number" ? r : null;
829
887
  }
830
- function Qn(e, t) {
888
+ function lr(e, t) {
831
889
  let n = e.slice(0, t), r = /([0-9A-Za-zÀ-ÖØ-öø-ÿ'’.-]+)\s+occurrence\b/giu, i = null, a;
832
890
  for (; (a = r.exec(n)) !== null;) i = a;
833
891
  if (!i) return null;
834
- let o = i[1], s = Zn(o);
892
+ let o = i[1], s = cr(o);
835
893
  return !s || s < 1 ? null : s;
836
894
  }
837
- function $n(e) {
895
+ function U(e, t = !1) {
896
+ let n = sr(e, nr(e)), r = R(n), i = /\btableau\b/.test(r);
897
+ if (!i && !t) return;
898
+ let a = (e) => {
899
+ if (!e) return;
900
+ let t = cr(e.replace(/^(?:a|à)\s+la\s+/iu, ""));
901
+ return t && t > 0 ? t : void 0;
902
+ }, o = (e, t) => e || t ? {
903
+ type: "table",
904
+ ...e ? { rowIndex: e } : {},
905
+ ...t ? { columnIndex: t } : {}
906
+ } : void 0, s = /(?:^|[^\p{L}\p{N}_])(?:a|à)\s+la\s+(.+?)\s+ligne\s+de\s+la\s+(.+?)\s+colonne\b/iu.exec(n);
907
+ if (s) {
908
+ let e = o(a(s[1]), a(s[2]));
909
+ if (e) return e;
910
+ }
911
+ let c = /(?:^|[^\p{L}\p{N}_])(?:a|à)\s+la\s+(.+?)\s+colonne\s+de\s+la\s+(.+?)\s+ligne\b/iu.exec(n);
912
+ if (c) {
913
+ let e = a(c[1]), t = o(a(c[2]), e);
914
+ if (t) return t;
915
+ }
916
+ let l = /\bla\s+(.+?)\s+ligne\b/iu.exec(n), u = /\bla\s+(.+?)\s+colonne\b/iu.exec(n);
917
+ return o(a(l?.[1]), a(u?.[1])) || (i ? { type: "table" } : void 0);
918
+ }
919
+ function ur(e, t) {
920
+ return e ? t.some((t) => e.start >= t.start && e.stop <= t.end) : !1;
921
+ }
922
+ function dr(e) {
838
923
  let t = [], n = 0;
839
924
  for (; n < e.length;) {
840
925
  let r = e.indexOf("«", n);
@@ -854,10 +939,10 @@ function $n(e) {
854
939
  }
855
940
  return t;
856
941
  }
857
- function er(e, t) {
858
- return e ? t.some((t) => e.start >= t.start && e.stop <= t.end) : !1;
942
+ function fr(e, t) {
943
+ return ur(e, t);
859
944
  }
860
- function tr(e) {
945
+ function pr(e) {
861
946
  if (!e.includes("«")) return e;
862
947
  let t = e.split(""), n = !1;
863
948
  for (let e = 0; e < t.length; e++) {
@@ -874,133 +959,207 @@ function tr(e) {
874
959
  }
875
960
  return t.join("");
876
961
  }
877
- function K(e, t) {
962
+ function W(e, t) {
878
963
  e && (e.start += t, e.stop += t);
879
964
  }
880
- function q(e, t) {
965
+ function G(e, t) {
881
966
  if (e.type === "parent-enfant") {
882
- q(e.parent, t), q(e.child, t), K(e.position, t);
967
+ G(e.parent, t), G(e.child, t), W(e.position, t);
883
968
  return;
884
969
  }
885
970
  if (e.type === "bounded-interval") {
886
- q(e.first, t), q(e.last, t), K(e.position, t);
971
+ G(e.first, t), G(e.last, t), W(e.position, t);
887
972
  return;
888
973
  }
889
974
  if (e.type === "counted-interval") {
890
- q(e.first, t), K(e.position, t);
975
+ G(e.first, t), W(e.position, t);
891
976
  return;
892
977
  }
893
978
  if (e.type === "enumeration" || e.type === "exclusion") {
894
- q(e.left, t), q(e.right, t), K(e.position, t);
979
+ G(e.left, t), G(e.right, t), W(e.position, t);
895
980
  return;
896
981
  }
897
982
  if (e.type === "reference_et_action") {
898
- q(e.reference, t), K(e.position, t);
983
+ G(e.reference, t), W(e.position, t);
899
984
  return;
900
985
  }
901
- K(e.position, t);
986
+ W(e.position, t);
902
987
  }
903
- function nr(e) {
988
+ function mr(e) {
904
989
  return e.replace(/\b(de\s+l['’]?|de\s+la|de\s+le|du|des)\s*$/i, "");
905
990
  }
906
- function rr(e) {
907
- let t = W(e);
991
+ function hr(e) {
992
+ let t = R(e);
908
993
  return t.startsWith("alinea") ? "alinéa" : t.startsWith("phrase") ? "phrase" : null;
909
994
  }
910
- function ir(e) {
995
+ function gr(e) {
911
996
  let t = /^(?:(?:[aà]\s+)?l['’]|(?:[aà]\s+)?la\b|(?:[aà]\s+)?le\b|les\b|des\b|aux\b|du\b)\s*/iu.exec(e)?.[0].length ?? 0, n = e.slice(t > 0 ? t : 0).trim();
912
997
  return n ? {
913
998
  text: n,
914
999
  offset: t
915
1000
  } : null;
916
1001
  }
917
- function ar(e) {
918
- let t = new E(e), n = qt(t);
1002
+ function _r(e) {
1003
+ return [...e.matchAll(/(?:^|\P{L})(\p{L})/gu)].map((e) => (e.index ?? 0) + e[0].length - (e[1]?.length ?? 0));
1004
+ }
1005
+ function vr(e) {
1006
+ let t = new w(e), n = Yt(t);
919
1007
  return !n || t.remaining().trim().length !== 0 ? null : n;
920
1008
  }
921
- function J(e, t) {
922
- let n = e.trim().replace(/[;:,]\s*$/u, "").trim();
1009
+ function yr(e, t) {
1010
+ let n = e.trim().replace(/[;:,]\s*$/u, "").replace(/\b(?:est|sont)\s*$/iu, "").trim();
923
1011
  if (!n) return null;
924
- let r = [...n.matchAll(/\p{L}/gu)];
925
- for (let e of r) {
926
- let r = e.index ?? 0, i = n.slice(r).trim(), a = /\b(alinéas?|phrases?)\b\s*$/iu.exec(i);
927
- if (!a || a.index === void 0) continue;
928
- let o = rr(a[1] ?? "");
1012
+ for (let e of _r(n)) {
1013
+ let r = n.slice(e).trim(), i = /\b(alinéas?|phrases?)\b\s*$/iu.exec(r);
1014
+ if (!i || i.index === void 0) continue;
1015
+ let a = hr(i[1] ?? "");
1016
+ if (!a) continue;
1017
+ let o = r.slice(0, i.index).trim();
929
1018
  if (!o) continue;
930
- let s = i.slice(0, a.index).trim();
931
- if (!s) continue;
932
- let c = /\s*(,|\bet\b|\bou\b)\s*/giu, l = [], u = 0, d;
933
- for (; (d = c.exec(s)) !== null;) {
934
- let e = W(d[1] ?? "");
935
- l.push({
936
- separator: e === "ou" ? "ou" : e === "," ? "," : "et",
937
- start: u,
938
- text: s.slice(u, d.index)
939
- }), u = c.lastIndex;
1019
+ let s = /\s*(,|\bet\b|\bou\b|(?<!\p{L})[aà](?!\p{L}))\s*/giu, c = [], l = 0, u;
1020
+ for (; (u = s.exec(o)) !== null;) {
1021
+ let e = R(u[1] ?? "");
1022
+ c.push({
1023
+ separator: e === "ou" ? "ou" : e === "," ? "," : e === "a" ? "à" : "et",
1024
+ start: l,
1025
+ text: o.slice(l, u.index)
1026
+ }), l = s.lastIndex;
940
1027
  }
941
- if (l.push({
942
- start: u,
943
- text: s.slice(u)
944
- }), l.length < 2) continue;
945
- let f = [], p = [], m = !0, h;
946
- for (let [e, n] of l.entries()) {
947
- let i = ir(n.text);
1028
+ if (c.push({
1029
+ start: l,
1030
+ text: o.slice(l)
1031
+ }), c.length < 2) continue;
1032
+ let d = c.some((e) => e.separator === "à"), f = [], p = [], m = !0, h;
1033
+ for (let [n, r] of c.entries()) {
1034
+ let i = gr(r.text);
948
1035
  if (!i) {
949
1036
  f.length = 0;
950
1037
  break;
951
1038
  }
952
- let a = ar(`${i.text} ${o}`);
953
- if (!a) {
1039
+ let o = vr(`${i.text} ${a}`);
1040
+ if (!o) {
954
1041
  f.length = 0;
955
1042
  break;
956
1043
  }
957
- q(a, t + r + n.start + i.offset), f.push(a), a.type !== o || a.index === void 0 || a.index < 1 || h !== void 0 && a.index !== h + 1 ? m = !1 : h = a.index, e < l.length - 1 && (p.push(n.separator ?? "et"), (n.separator ?? "et") === "ou" && (m = !1));
1044
+ G(o, t + e + r.start + i.offset), f.push(o), o.type !== a || o.index === void 0 || o.index < 1 ? m = !1 : (h !== void 0 && !d && o.index !== h + 1 && (m = !1), h = o.index), n < c.length - 1 && (p.push(r.separator ?? "et"), (r.separator ?? "et") === "ou" && (m = !1));
958
1045
  }
959
- let [g, ..._] = f;
960
- if (!g || _.length === 0) continue;
961
- let ee = {
962
- start: t + r + l[0].start,
963
- stop: t + r + i.length
1046
+ let [g, ...ee] = f;
1047
+ if (!g || ee.length === 0) continue;
1048
+ let te = {
1049
+ start: t + e + c[0].start,
1050
+ stop: t + e + r.length
964
1051
  };
965
1052
  return m ? {
966
1053
  first: g,
967
1054
  last: f[f.length - 1],
968
- position: ee,
1055
+ position: te,
969
1056
  type: "bounded-interval"
970
- } : Se(g, _.map((e, t) => [p[t] ?? "et", e]), ee);
1057
+ } : Se(g, ee.map((e, t) => [p[t] ?? "et", e]), te);
971
1058
  }
972
1059
  return null;
973
1060
  }
974
- function or(e, t) {
975
- let n = nr(e);
1061
+ function br(e, t) {
1062
+ let n = e.trim().replace(/[;:,]\s*$/u, "").replace(/\b(?:est|sont)\s*$/iu, "").trim();
1063
+ if (!n) return null;
1064
+ for (let e of _r(n)) {
1065
+ let r = n.slice(e);
1066
+ if (!r) continue;
1067
+ let a = new w(r), o = Yt(a);
1068
+ if (!o || a.offset === 0 || !i(a)) continue;
1069
+ let s = a.offset, c = yr(r.slice(s), t + e + s);
1070
+ if (c) return G(o, t + e), {
1071
+ ...b(c, o),
1072
+ position: {
1073
+ start: o.position.start,
1074
+ stop: c.position.stop
1075
+ }
1076
+ };
1077
+ }
1078
+ return null;
1079
+ }
1080
+ function K(e, t) {
1081
+ let n = mr(e);
976
1082
  if (!n) return null;
977
- let r = J(n, t);
1083
+ let r = br(n, t);
978
1084
  if (r) return r;
979
- let i = [...n.matchAll(/\p{L}/gu)];
980
- for (let e of i) {
981
- let r = e.index ?? 0, i = n.slice(r);
982
- if (!i) continue;
983
- let a = new E(i), o = qt(a);
984
- if (!(!o || a.offset === 0) && i.slice(a.offset).trim().length === 0) return q(o, t + r), o;
1085
+ let i = yr(n, t);
1086
+ if (i) return i;
1087
+ for (let e of _r(n)) {
1088
+ let r = n.slice(e);
1089
+ if (!r) continue;
1090
+ let i = new w(r), a = Yt(i);
1091
+ if (!(!a || i.offset === 0) && r.slice(i.offset).trim().length === 0) return G(a, t + e), a;
985
1092
  }
986
1093
  return null;
987
1094
  }
988
- function sr(e) {
1095
+ function q(e) {
1096
+ return Math.max(0, ...kn(e).map((e) => e.kind === "single" ? e.steps.length : Math.max(e.first.length, e.last.length)));
1097
+ }
1098
+ function xr(e) {
1099
+ return s(new w(e)).map(V).map((e) => ({
1100
+ reference: e,
1101
+ specificity: q(e)
1102
+ })).filter((e) => e.specificity > 0).sort((e, t) => t.specificity - e.specificity)[0]?.reference ?? null;
1103
+ }
1104
+ function Sr(e) {
989
1105
  let t = /\barticle\b/i.exec(e);
990
1106
  if (!t || t.index === void 0) return null;
991
- let n = t.index, r = zt(new E(e.slice(n)));
992
- if (!r) return null;
993
- q(r, n);
994
- let i = or(e.slice(0, n), 0);
995
- return i ? ge(r, i) : null;
996
- }
997
- function cr(e, t, n, r, i) {
998
- let a = W(e), o = W(Xn(e, r)), s = /\bredige\b|\bredigee\b|\bredigees\b|\brediges\b|\bainsi\b/.test(a) || /\bdispositions suivantes\b/.test(a), c = /\bapres\b/.test(o) || /\bapres (la|les) reference\b|\bapres (le|les) mots\b|\bapres la mention\b/.test(o), l = /\bavant\b/.test(o) || /\bavant (la|les) reference\b|\bavant (le|les) mots\b|\bavant la mention\b/.test(o), u = t.action === "rétablir" || /\bretabl/.test(a), d = /\binsere(?:e|es|s)?\b|\bajoute\b|\bajoutee\b|\bajoutes\b|\bajoutees\b|\bcomplete\b/.test(a) || u, f = /\bremplace\b|\bremplacee\b|\bremplaces\b|\bremplacees\b/.test(a), p = /\bsupprime\b|\bsupprimee\b|\bsupprimes\b|\bsupprimees\b|\babroge\b|\babrogee\b|\babroges\b|\babrogees\b/.test(a);
1107
+ let n = t.index, r = new w(e.slice(n)), i = Vt(r);
1108
+ if (!i) return null;
1109
+ G(i, n);
1110
+ let a = e.slice(0, n), o = n + r.offset, s = B(e) ?? e.length, c = e.slice(o, s), l = xr(a) ?? K(a, 0) ?? xr(c) ?? K(c, o);
1111
+ return l ? b(i, l) : null;
1112
+ }
1113
+ function Cr(e, t, n, r, i) {
1114
+ let a = R(e), o = R(sr(e, r)), s = /\bredige\b|\bredigee\b|\bredigees\b|\brediges\b|\bainsi\b/.test(a) || /\bdispositions suivantes\b/.test(a), c = /\bapres\b/.test(o) || /\bapres (la|les) reference\b|\bapres (le|les) mots\b|\bapres la mention\b/.test(o), l = /\bavant\b/.test(o) || /\bavant (la|les) reference\b|\bavant (le|les) mots\b|\bavant la mention\b/.test(o), u = t.action === "rétablir" || /\bretabl/.test(a), d = /\binsere(?:e|es|s)?\b|\bajoute\b|\bajoutee\b|\bajoutes\b|\bajoutees\b|\bcomplete(?:e|es|s)?\b/.test(a) || u, f = /\bremplace\b|\bremplacee\b|\bremplaces\b|\bremplacees\b/.test(a), p = /\bsupprime\b|\bsupprimee\b|\bsupprimes\b|\bsupprimees\b|\babroge\b|\babrogee\b|\babroges\b|\babrogees\b/.test(a), m = ir(e), h = l ? "insert_before" : "insert_after";
1115
+ if ((c || l) && d && p && i.length >= 3) {
1116
+ let e = i.slice(0, -2), t = i.at(-2), n = i.at(-1);
1117
+ if (e.length > 0 && t && n) return [{
1118
+ kind: "delete",
1119
+ targetText: e[0],
1120
+ extraTargetTexts: e.slice(1)
1121
+ }, {
1122
+ kind: h,
1123
+ targetText: t,
1124
+ insertText: n,
1125
+ expectsFollowingTable: m
1126
+ }];
1127
+ }
1128
+ if (!c && !l && d && p && i.length >= 2 && /\best ajoutee?\s+une phrase\b|\bune phrase ainsi redigee\b/.test(a)) {
1129
+ let e = i.slice(0, -1), t = i.at(-1);
1130
+ if (e.length > 0 && t) return [{
1131
+ kind: "delete",
1132
+ targetText: e[0],
1133
+ extraTargetTexts: e.slice(1)
1134
+ }, {
1135
+ kind: "insert_after",
1136
+ targetText: "",
1137
+ insertText: t,
1138
+ expectsFollowingTable: m
1139
+ }];
1140
+ }
1141
+ if ((c || l) && d && f && i.length >= 4) {
1142
+ let e = i.at(-2), t = i.at(-1);
1143
+ if (e && t) return [{
1144
+ kind: "replace",
1145
+ targetText: i[0],
1146
+ replacementText: i[1]
1147
+ }, {
1148
+ kind: h,
1149
+ targetText: e,
1150
+ insertText: t,
1151
+ expectsFollowingTable: m
1152
+ }];
1153
+ }
999
1154
  if (t.action === "supprimer" || p) return n === "article" && i.length === 0 ? { kind: "delete_article" } : i.length >= 1 ? {
1000
1155
  kind: "delete",
1001
1156
  targetText: i[0],
1002
1157
  extraTargetTexts: i.slice(1)
1003
1158
  } : { kind: "delete_portion" };
1159
+ if (f && /\bpar\s+(?:le|un)\s+tableau\s+(?:suivant|ainsi\s+redigee?|ainsi\s+rediges|ainsi\s+redigees)\b/.test(a)) return {
1160
+ kind: "replace_portion",
1161
+ replacement: { type: "following_table" }
1162
+ };
1004
1163
  if (f && i.length >= 2) return {
1005
1164
  kind: "replace",
1006
1165
  targetText: i[0],
@@ -1008,112 +1167,155 @@ function cr(e, t, n, r, i) {
1008
1167
  };
1009
1168
  if (f && i.length === 1 && s) return {
1010
1169
  kind: "replace_portion",
1011
- replacementText: i[0]
1170
+ replacement: {
1171
+ type: "text",
1172
+ text: i[0]
1173
+ }
1174
+ };
1175
+ if (d && m) return l ? {
1176
+ kind: "insert_before",
1177
+ targetText: "",
1178
+ insertText: "",
1179
+ expectsFollowingTable: !0
1180
+ } : {
1181
+ kind: "insert_after",
1182
+ targetText: "",
1183
+ insertText: "",
1184
+ expectsFollowingTable: !0
1012
1185
  };
1013
1186
  if (d && i.length >= 2) {
1014
1187
  if (c) return {
1015
1188
  kind: "insert_after",
1016
1189
  targetText: i[0],
1017
- insertText: i[1]
1190
+ insertText: i[1],
1191
+ expectsFollowingTable: m
1018
1192
  };
1019
1193
  if (l) return {
1020
1194
  kind: "insert_before",
1021
1195
  targetText: i[0],
1022
- insertText: i[1]
1196
+ insertText: i[1],
1197
+ expectsFollowingTable: m
1023
1198
  };
1024
1199
  }
1025
1200
  return d && i.length === 1 ? c ? {
1026
1201
  kind: "insert_after",
1027
1202
  targetText: "",
1028
- insertText: i[0]
1203
+ insertText: i[0],
1204
+ expectsFollowingTable: m
1029
1205
  } : l ? {
1030
1206
  kind: "insert_before",
1031
1207
  targetText: "",
1032
- insertText: i[0]
1208
+ insertText: i[0],
1209
+ expectsFollowingTable: m
1033
1210
  } : {
1034
1211
  kind: "insert_after",
1035
1212
  targetText: "",
1036
- insertText: i[0]
1213
+ insertText: i[0],
1214
+ expectsFollowingTable: m
1037
1215
  } : null;
1038
1216
  }
1039
- function Y({ action: e, reference: t, sourcePosition: n, sourceText: r, fullText: i }) {
1040
- let a = e.target ?? b(t), o = Cn(t), s = i && n.start < i.length ? i.slice(n.start) : r, c = Yn(s), l = cr(r, e, a, c, c.map((e) => e.text));
1041
- if (!l) return null;
1042
- switch (l.kind) {
1043
- case "insert_after":
1044
- case "insert_before": return {
1045
- kind: l.kind,
1046
- targetType: a,
1047
- reference: t,
1048
- portionSelectors: o,
1049
- targetText: l.targetText,
1050
- insertText: l.insertText,
1051
- sourcePosition: n,
1052
- sourceText: r
1053
- };
1054
- case "replace": return {
1055
- kind: "replace",
1056
- targetType: a,
1057
- reference: t,
1058
- portionSelectors: o,
1059
- targetText: l.targetText,
1060
- replacementText: l.replacementText,
1061
- sourcePosition: n,
1062
- sourceText: r
1063
- };
1064
- case "replace_portion": return {
1065
- kind: "replace_portion",
1066
- targetType: a,
1067
- reference: t,
1068
- portionSelectors: o,
1069
- replacementText: l.replacementText,
1070
- sourcePosition: n,
1071
- sourceText: r
1072
- };
1073
- case "delete": {
1074
- let e = c.map((e) => Qn(s, e.start)), i = /* @__PURE__ */ new Map();
1075
- for (let [t, n] of c.entries()) i.has(n.text) || i.set(n.text, e[t] ?? null);
1076
- let u = [l.targetText, ...l.extraTargetTexts ?? []].filter((e) => e && e.trim().length > 0).filter((e, t, n) => n.indexOf(e) === t);
1077
- return u.length > 1 ? u.map((e) => ({
1078
- kind: "delete",
1079
- targetType: a,
1217
+ function J({ action: e, reference: t, sourcePosition: n, sourceText: r, fullText: i, tableTarget: a }) {
1218
+ let o = e.target ?? y(t), s = kn(t), c = i && n.start < i.length ? i.slice(n.start) : r, l = i && n.start < i.length ? n.start : 0, u = i === r && n.start < r.length ? r.slice(n.start) : r, d = nr(u), f = Cr(r, e, o, d, d.map((e) => e.text));
1219
+ if (!f) return null;
1220
+ let p = or(c, l), m = (e) => {
1221
+ switch (e.kind) {
1222
+ case "insert_after":
1223
+ case "insert_before": return e.expectsFollowingTable && !p ? null : {
1224
+ kind: e.kind,
1225
+ targetType: o,
1080
1226
  reference: t,
1081
- portionSelectors: o,
1082
- targetText: e,
1083
- occurrenceIndex: i.get(e) ?? void 0,
1227
+ portionSelectors: s,
1228
+ targetText: e.targetText,
1229
+ insertText: e.insertText,
1230
+ ...e.expectsFollowingTable && p ? { citation: p } : {},
1231
+ ...H(a) ? { tableTarget: a } : {},
1084
1232
  sourcePosition: n,
1085
1233
  sourceText: r
1086
- })) : {
1087
- kind: "delete",
1088
- targetType: a,
1234
+ };
1235
+ case "replace": return {
1236
+ kind: "replace",
1237
+ targetType: o,
1238
+ reference: t,
1239
+ portionSelectors: s,
1240
+ targetText: e.targetText,
1241
+ replacementText: e.replacementText,
1242
+ replacement: {
1243
+ type: "text",
1244
+ text: e.replacementText
1245
+ },
1246
+ ...H(a) ? { tableTarget: a } : {},
1247
+ sourcePosition: n,
1248
+ sourceText: r
1249
+ };
1250
+ case "replace_portion": return e.replacement.type === "following_table" && !p ? null : {
1251
+ kind: "replace_portion",
1252
+ targetType: o,
1089
1253
  reference: t,
1090
- portionSelectors: o,
1091
- targetText: l.targetText,
1092
- occurrenceIndex: i.get(l.targetText) ?? void 0,
1254
+ portionSelectors: s,
1255
+ replacementText: e.replacement.type === "text" ? e.replacement.text : "",
1256
+ replacement: e.replacement,
1257
+ ...e.replacement.type === "following_table" && p ? { citation: p } : {},
1258
+ ...H(a) ? { tableTarget: a } : {},
1093
1259
  sourcePosition: n,
1094
1260
  sourceText: r
1095
1261
  };
1262
+ case "delete": {
1263
+ let i = d.map((e) => lr(u, e.start)), c = /* @__PURE__ */ new Map();
1264
+ for (let [e, t] of d.entries()) c.has(t.text) || c.set(t.text, i[e] ?? null);
1265
+ let l = [e.targetText, ...e.extraTargetTexts ?? []].filter((e) => e && e.trim().length > 0).filter((e, t, n) => n.indexOf(e) === t);
1266
+ return l.length > 1 ? l.map((e) => ({
1267
+ kind: "delete",
1268
+ targetType: o,
1269
+ reference: t,
1270
+ portionSelectors: s,
1271
+ targetText: e,
1272
+ occurrenceIndex: c.get(e) ?? void 0,
1273
+ ...H(a) ? { tableTarget: a } : {},
1274
+ sourcePosition: n,
1275
+ sourceText: r
1276
+ })) : {
1277
+ kind: "delete",
1278
+ targetType: o,
1279
+ reference: t,
1280
+ portionSelectors: s,
1281
+ targetText: e.targetText,
1282
+ occurrenceIndex: c.get(e.targetText) ?? void 0,
1283
+ ...H(a) ? { tableTarget: a } : {},
1284
+ sourcePosition: n,
1285
+ sourceText: r
1286
+ };
1287
+ }
1288
+ case "delete_portion": return {
1289
+ kind: "delete_portion",
1290
+ targetType: o,
1291
+ reference: t,
1292
+ portionSelectors: s,
1293
+ ...H(a) ? { tableTarget: a } : {},
1294
+ sourcePosition: n,
1295
+ sourceText: r
1296
+ };
1297
+ case "delete_article": return o === "article" ? {
1298
+ kind: "delete_article",
1299
+ targetType: o,
1300
+ reference: t,
1301
+ portionSelectors: s,
1302
+ sourcePosition: n,
1303
+ sourceText: r
1304
+ } : null;
1305
+ default: return null;
1096
1306
  }
1097
- case "delete_portion": return {
1098
- kind: "delete_portion",
1099
- targetType: a,
1100
- reference: t,
1101
- portionSelectors: o,
1102
- sourcePosition: n,
1103
- sourceText: r
1104
- };
1105
- case "delete_article": return a === "article" ? {
1106
- kind: "delete_article",
1107
- targetType: a,
1108
- reference: t,
1109
- portionSelectors: o,
1110
- sourcePosition: n,
1111
- sourceText: r
1112
- } : null;
1113
- default: return null;
1307
+ };
1308
+ if (Array.isArray(f)) {
1309
+ let e = [];
1310
+ for (let t of f) {
1311
+ let n = m(t);
1312
+ n && (Array.isArray(n) ? e.push(...n) : e.push(n));
1313
+ }
1314
+ return e.length > 0 ? e : null;
1114
1315
  }
1316
+ return m(f);
1115
1317
  }
1116
- function lr(e) {
1318
+ function Y(e) {
1117
1319
  let t = /\barticle\s+([0-9]+(?:-[0-9]+)?(?:\s*[A-Z])?(?:\s+[a-z]+)?)\b/i.exec(e);
1118
1320
  if (!t || t.index === void 0) return null;
1119
1321
  let n = t.index, r = t.index + t[0].length;
@@ -1132,41 +1334,47 @@ function lr(e) {
1132
1334
  }
1133
1335
  };
1134
1336
  }
1135
- function ur(e, t) {
1136
- let n = C(e).output;
1337
+ function wr(e, t) {
1338
+ let n = Ue(e).output;
1137
1339
  if (t.allowListExtraction) {
1138
- let e = qn(n);
1340
+ let e = er(n);
1139
1341
  if (e) return e;
1140
1342
  }
1141
- let r = $n(n), i = tr(n), a = s(new E(n));
1142
- if (r.length > 0 && (a = a.filter((e) => !er(e.position, r))), a.length === 0 && (a = s(new E(i.split(",")[0] ?? i))), a.length === 0) {
1143
- let e = lr(i);
1343
+ let r = dr(n), i = pr(n), a = s(new w(n));
1344
+ if (r.length > 0 && (a = a.filter((e) => !fr(e.position, r))), a.length === 0 && (a = s(new w(i.split(",")[0] ?? i))), a.length === 0) {
1345
+ let e = Y(i);
1144
1346
  e && (a = [{
1145
1347
  ...e.reference,
1146
1348
  position: e.position
1147
1349
  }]);
1148
1350
  }
1149
1351
  if (a.length === 1 && a[0]?.type === "article") {
1150
- let e = sr(i);
1352
+ let e = Sr(i);
1151
1353
  e && (a = [e]);
1152
1354
  }
1153
- let o = [];
1355
+ let o = B(i);
1356
+ if (o !== null) {
1357
+ let e = a.some((e) => y(V(e)) === "article"), t = K(i.slice(0, o), 0), n = t ? q(t) : 0, r = Math.max(0, ...a.map((e) => q(V(e))));
1358
+ !e && t && n > r && (a = [t]);
1359
+ }
1360
+ let c = [];
1154
1361
  for (let e of a) {
1155
1362
  if (e.type === "reference_et_action") {
1156
1363
  let t = e.position?.start ?? 0, r = {
1157
1364
  start: t,
1158
1365
  stop: n.length
1159
- }, i = n.slice(t), a = Y({
1366
+ }, i = n.slice(t), a = J({
1160
1367
  action: e.action,
1161
1368
  reference: e.reference,
1162
1369
  sourcePosition: r,
1163
1370
  sourceText: i,
1164
- fullText: n
1371
+ fullText: n,
1372
+ tableTarget: U(i)
1165
1373
  });
1166
- a && (Array.isArray(a) ? o.push(...a) : o.push(a));
1374
+ a && (Array.isArray(a) ? c.push(...a) : c.push(a));
1167
1375
  continue;
1168
1376
  }
1169
- let t = Y({
1377
+ let t = J({
1170
1378
  action: { action: "modifier" },
1171
1379
  reference: e,
1172
1380
  sourcePosition: e.position ?? {
@@ -1174,68 +1382,70 @@ function ur(e, t) {
1174
1382
  stop: n.length
1175
1383
  },
1176
1384
  sourceText: n,
1177
- fullText: n
1385
+ fullText: n,
1386
+ tableTarget: U(n)
1178
1387
  });
1179
- t && (Array.isArray(t) ? o.push(...t) : o.push(t));
1388
+ t && (Array.isArray(t) ? c.push(...t) : c.push(t));
1180
1389
  }
1181
- if (o.length === 0) {
1182
- let e = lr(i);
1390
+ if (c.length === 0) {
1391
+ let e = Y(i);
1183
1392
  if (e) {
1184
- let t = Y({
1393
+ let t = J({
1185
1394
  action: { action: "modifier" },
1186
1395
  reference: e.reference,
1187
1396
  sourcePosition: e.position,
1188
1397
  sourceText: n,
1189
- fullText: n
1398
+ fullText: n,
1399
+ tableTarget: U(n)
1190
1400
  });
1191
- t && (Array.isArray(t) ? o.push(...t) : o.push(t));
1401
+ t && (Array.isArray(t) ? c.push(...t) : c.push(t));
1192
1402
  }
1193
1403
  }
1194
- return o;
1404
+ return c;
1195
1405
  }
1196
- function dr(e) {
1197
- return ur(e, { allowListExtraction: !0 });
1406
+ function Tr(e) {
1407
+ return wr(e, { allowListExtraction: !0 });
1198
1408
  }
1199
- function fr(e) {
1200
- let t = W(e);
1409
+ function Er(e) {
1410
+ let t = R(e);
1201
1411
  return t.includes("«") || t.includes("»") || !e.trim().endsWith(":") ? !1 : /\b(remplace|modifie|redige|rediges|redigee|redigees)\b/.test(t);
1202
1412
  }
1203
- function pr(e, t) {
1413
+ function Dr(e, t) {
1204
1414
  let n = [], r = !1, i = t + 1;
1205
1415
  for (; i < e.length;) {
1206
- let t = e[i], a = G(t);
1416
+ let t = e[i], a = z(t);
1207
1417
  if (!r && a.includes("«") && (r = !0), r) {
1208
1418
  if (n.push(a), a.includes("»")) break;
1209
1419
  } else if (a.trim().length > 0) break;
1210
1420
  i += 1;
1211
1421
  }
1212
1422
  return !r || n.length === 0 ? null : {
1213
- combinedText: [G(e[t]), ...n].join("\n"),
1423
+ combinedText: [z(e[t]), ...n].join("\n"),
1214
1424
  endIndex: i
1215
1425
  };
1216
1426
  }
1217
- function mr(e) {
1218
- let t = ot()(e).output.split("\n").map((e) => e.trim()).filter((e) => e.length > 0), n = [];
1427
+ function Or(e) {
1428
+ let t = ct()(e).output.split("\n").map((e) => e.trim()).filter((e) => e.length > 0), n = [];
1219
1429
  for (let e = 0; e < t.length; e += 1) {
1220
1430
  let r = t[e];
1221
- if (fr(r)) {
1222
- let r = pr(t, e);
1431
+ if (Er(r)) {
1432
+ let r = Dr(t, e);
1223
1433
  if (r) {
1224
- let t = dr(r.combinedText);
1434
+ let t = Tr(r.combinedText);
1225
1435
  if (t.length > 0) {
1226
1436
  n.push(...t), e = r.endIndex;
1227
1437
  continue;
1228
1438
  }
1229
1439
  }
1230
1440
  }
1231
- let i = ur(r, { allowListExtraction: !1 });
1441
+ let i = wr(r, { allowListExtraction: !1 });
1232
1442
  i.length > 0 && n.push(...i);
1233
1443
  }
1234
1444
  return n;
1235
1445
  }
1236
1446
  //#endregion
1237
1447
  //#region src/lib/json.ts
1238
- var hr = (e, t) => t instanceof Object && !Array.isArray(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t;
1448
+ var kr = (e, t) => t instanceof Object && !Array.isArray(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t;
1239
1449
  //#endregion
1240
1450
  //#region src/lib/markdown.ts
1241
1451
  function X(e) {
@@ -1243,11 +1453,11 @@ function X(e) {
1243
1453
  }
1244
1454
  //#endregion
1245
1455
  //#region src/lib/linkers/markdown.ts
1246
- async function gr({ canutesDb: e, date: t, linkBaseUrl: r, linkType: i, previousContext: a, text: o }) {
1247
- let s = C(o), c = new E(s.output);
1456
+ async function Ar({ canutesDb: e, date: t, linkBaseUrl: r, linkType: i, previousContext: a, text: o }) {
1457
+ let s = Ue(o), c = new w(s.output);
1248
1458
  c.currentArticle = a?.currentArticle, c.currentText = a?.currentText;
1249
1459
  let l = o, u = 0;
1250
- for await (let a of Ye({
1460
+ for await (let a of Ze({
1251
1461
  canutesDb: e,
1252
1462
  context: c,
1253
1463
  date: t,
@@ -1258,7 +1468,7 @@ async function gr({ canutesDb: e, date: t, linkBaseUrl: r, linkType: i, previous
1258
1468
  let { articleId: e, originalTransformation: t } = a;
1259
1469
  if (e !== void 0) {
1260
1470
  if (t === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(a, null, 2)}`);
1261
- let o = O(t, `[${X(n(l, t, u))}](${D(i, r, e)})`);
1471
+ let o = E(t, `[${X(n(l, t, u))}](${T(i, r, e)})`);
1262
1472
  l = l.slice(0, t.position.start + u) + o + l.slice(t.position.stop + u), u += o.length - (t.position.stop - t.position.start);
1263
1473
  }
1264
1474
  break;
@@ -1267,7 +1477,7 @@ async function gr({ canutesDb: e, date: t, linkBaseUrl: r, linkType: i, previous
1267
1477
  let { originalTransformation: e, sectionTaId: t } = a;
1268
1478
  if (t !== void 0) {
1269
1479
  if (e === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(a, null, 2)}`);
1270
- let o = O(e, `[${X(n(l, e, u))}](${D(i, r, t)})`);
1480
+ let o = E(e, `[${X(n(l, e, u))}](${T(i, r, t)})`);
1271
1481
  l = l.slice(0, e.position.start + u) + o + l.slice(e.position.stop + u), u += o.length - (e.position.stop - e.position.start);
1272
1482
  }
1273
1483
  break;
@@ -1279,14 +1489,14 @@ async function gr({ canutesDb: e, date: t, linkBaseUrl: r, linkType: i, previous
1279
1489
  continue;
1280
1490
  }
1281
1491
  if (e === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(a, null, 2)}`);
1282
- let o = O(e, `[${X(n(l, e, u))}](${D(i, r, t.cid)})`);
1492
+ let o = E(e, `[${X(n(l, e, u))}](${T(i, r, t.cid)})`);
1283
1493
  l = l.slice(0, e.position.start + u) + o + l.slice(e.position.stop + u), u += o.length - (e.position.stop - e.position.start);
1284
1494
  break;
1285
1495
  }
1286
1496
  case "internal_article": {
1287
1497
  let { definition: e, originalTransformation: t } = a;
1288
1498
  if (t === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(a, null, 2)}`);
1289
- let r = O(t, `[${X(n(l, t, u))}](#definition_article_${e.textId}_${e.article.num.replaceAll(" ", "_")})`);
1499
+ let r = E(t, `[${X(n(l, t, u))}](#definition_article_${e.textId}_${e.article.num.replaceAll(" ", "_")})`);
1290
1500
  l = l.slice(0, t.position.start + u) + r + l.slice(t.position.stop + u), u += r.length - (t.position.stop - t.position.start);
1291
1501
  break;
1292
1502
  }
@@ -1294,11 +1504,11 @@ async function gr({ canutesDb: e, date: t, linkBaseUrl: r, linkType: i, previous
1294
1504
  let { url: e, originalTransformation: t } = a;
1295
1505
  if (e === void 0) continue;
1296
1506
  if (t === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(a, null, 2)}`);
1297
- let r = O(t, `<a class="lien_texte_european" href="${e}" target="_blank">${n(l, t, u)}</a>`);
1507
+ let r = E(t, `<a class="lien_texte_european" href="${e}" target="_blank">${n(l, t, u)}</a>`);
1298
1508
  l = l.slice(0, t.position.start + u) + r + l.slice(t.position.stop + u), u += r.length - (t.position.stop - t.position.start);
1299
1509
  break;
1300
1510
  }
1301
- default: v("Link", a);
1511
+ default: _("Link", a);
1302
1512
  }
1303
1513
  return {
1304
1514
  context: c,
@@ -1307,7 +1517,7 @@ async function gr({ canutesDb: e, date: t, linkBaseUrl: r, linkType: i, previous
1307
1517
  }
1308
1518
  //#endregion
1309
1519
  //#region src/lib/loaders/assemblee.ts
1310
- async function _r(e, t, n) {
1520
+ async function jr(e, t, n) {
1311
1521
  let r = t.get("Document");
1312
1522
  r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("Document", r));
1313
1523
  let i = r.get(n);
@@ -1317,7 +1527,7 @@ async function _r(e, t, n) {
1317
1527
  WHERE uid = ${n}
1318
1528
  `)[0]?.data, r.set(n, i ?? null)), i ?? void 0;
1319
1529
  }
1320
- async function vr(e, t, n) {
1530
+ async function Mr(e, t, n) {
1321
1531
  let r = t.get("Document");
1322
1532
  return r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("Document", r)), (await e`
1323
1533
  SELECT data, uid
@@ -1325,7 +1535,7 @@ async function vr(e, t, n) {
1325
1535
  WHERE dossier_uid = ${n}
1326
1536
  `).map(({ data: e, uid: t }) => (r.set(t, e ?? null), e));
1327
1537
  }
1328
- async function yr(e, t, n) {
1538
+ async function Nr(e, t, n) {
1329
1539
  let r = t.get("DossierParlementaire");
1330
1540
  r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("DossierParlementaire", r));
1331
1541
  let i = r.get(n);
@@ -1337,15 +1547,15 @@ async function yr(e, t, n) {
1337
1547
  }
1338
1548
  //#endregion
1339
1549
  //#region src/lib/text_parsers/search_queries.ts
1340
- var br = x("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i" }), Z = A([
1341
- br,
1342
- T($e, { default: "" }),
1343
- w(jt, St)
1550
+ var Pr = x("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i" }), Z = O([
1551
+ Pr,
1552
+ Ye(tt, { default: "" }),
1553
+ C(Nt, wt)
1344
1554
  ], { value: (e, t) => ({
1345
1555
  num: e[2],
1346
1556
  position: t.position(),
1347
1557
  type: "article"
1348
- }) }), xr = w(x("c(?:ode|\\.)? ?civ(?:il)?", {
1558
+ }) }), Fr = C(x("c(?:ode|\\.)? ?civ(?:il)?", {
1349
1559
  flags: "i",
1350
1560
  value: (e, t) => ({
1351
1561
  cid: "LEGITEXT000006070721",
@@ -1453,27 +1663,27 @@ var br = x("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i
1453
1663
  title: "Code de commerce",
1454
1664
  type: "texte"
1455
1665
  })
1456
- })), Q = w(xr, tn(le, { value: (e, t) => e === void 0 ? void 0 : {
1666
+ })), Q = C(Fr, rn(ue, { value: (e, t) => e === void 0 ? void 0 : {
1457
1667
  ...e,
1458
1668
  position: t.position()
1459
- } }), tn(te, { value: (e, t) => ({
1669
+ } }), rn(ne, { value: (e, t) => ({
1460
1670
  ...e,
1461
1671
  position: t.position()
1462
- }) })), $ = T(x(" (?:du |de la |de l'|des |de |d')?", { flags: "i" }), { default: "" }), Sr = x(".+?(?=\\s*(?:du |de la |de l'|des |de |d')?\\s*(?:art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?))", {
1672
+ }) })), $ = Ye(x(" (?:du |de la |de l'|des |de |d')?", { flags: "i" }), { default: "" }), Ir = x(".+?(?=\\s*(?:du |de la |de l'|des |de |d')?\\s*(?:art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?))", {
1463
1673
  flags: "i",
1464
1674
  value: (e, t) => ({
1465
1675
  type: "texte",
1466
1676
  title: e[0].trim(),
1467
1677
  position: t.position()
1468
1678
  })
1469
- }), Cr = x(".+", {
1679
+ }), Lr = x(".+", {
1470
1680
  flags: "i",
1471
1681
  value: (e, t) => ({
1472
1682
  type: "texte",
1473
1683
  title: e[0].trim(),
1474
1684
  position: t.position()
1475
1685
  })
1476
- }), wr = w(A([
1686
+ }), Rr = C(O([
1477
1687
  Q,
1478
1688
  $,
1479
1689
  Z
@@ -1485,7 +1695,7 @@ var br = x("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i
1485
1695
  position: t.position(),
1486
1696
  type: "parent-enfant"
1487
1697
  };
1488
- } }), A([
1698
+ } }), O([
1489
1699
  Z,
1490
1700
  $,
1491
1701
  Q
@@ -1494,8 +1704,8 @@ var br = x("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i
1494
1704
  parent: e[2],
1495
1705
  position: t.position(),
1496
1706
  type: "parent-enfant"
1497
- }) }), A([
1498
- Sr,
1707
+ }) }), O([
1708
+ Ir,
1499
1709
  $,
1500
1710
  Z
1501
1711
  ], { value: (e, t) => {
@@ -1506,25 +1716,25 @@ var br = x("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i
1506
1716
  position: t.position(),
1507
1717
  type: "parent-enfant"
1508
1718
  };
1509
- } }), A([
1719
+ } }), O([
1510
1720
  Z,
1511
1721
  $,
1512
- Cr
1722
+ Lr
1513
1723
  ], { value: (e, t) => ({
1514
1724
  child: e[0],
1515
1725
  parent: e[2],
1516
1726
  position: t.position(),
1517
1727
  type: "parent-enfant"
1518
- }) }), Z, Q, Cr), Tr = (e) => e?.replace(/\n/g, " ").replace(/ {2,}/g, " ").replace(/ \(\d+\)\.?$/, "").replace(/\.$/, ""), Er = (e) => {
1728
+ }) }), Z, Q, Lr), zr = (e) => e?.replace(/\n/g, " ").replace(/ {2,}/g, " ").replace(/ \(\d+\)\.?$/, "").replace(/\.$/, ""), Br = (e) => {
1519
1729
  let t = e.META.META_SPEC.META_TEXTE_VERSION.DATE_DEBUT;
1520
1730
  return t === void 0 || ["2222-02-22", "2999-01-01"].includes(t) ? e.META.META_SPEC.META_TEXTE_CHRONICLE.DATE_PUBLI : t;
1521
- }, Dr = (e) => {
1731
+ }, Vr = (e) => {
1522
1732
  let t = e.META.META_SPEC.META_TEXTE_CHRONICLE.DATE_TEXTE;
1523
1733
  if (!["2222-02-22", "2999-01-01"].includes(t)) return t;
1524
1734
  let n = e.META.META_SPEC.META_TEXTE_VERSION.DATE_DEBUT;
1525
1735
  if (n !== void 0 && !["2222-02-22", "2999-01-01"].includes(n)) return n;
1526
1736
  throw Error(`Missing date signature in text ${e.META.META_COMMUN.ID}`);
1527
- }, Or = (e) => (t, n) => {
1737
+ }, Hr = (e) => (t, n) => {
1528
1738
  let r = e(t), i = e(n);
1529
1739
  if (r !== i) return r.localeCompare(i);
1530
1740
  let a = t.META.META_COMMUN, o = a.ORIGINE, s = n.META.META_COMMUN, c = s.ORIGINE;
@@ -1533,6 +1743,6 @@ var br = x("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i
1533
1743
  if (c === "JORF") return 1;
1534
1744
  }
1535
1745
  throw Error(`TODO: Unable to sort texts ${a.ID} & ${s.ID} by date.`);
1536
- }, kr = gr;
1746
+ }, Ur = Ar;
1537
1747
  //#endregion
1538
- export { E as TextParserContext, se as action, an as actionTargets, ge as addChildLeftToLastChild, Bt as addLinksOrReferencesToHtmlPage, Ct as addLinksToHtml, gr as addLinksToMarkdown, kr as addLinksToText, We as addPositionsToTableOfContentsItems, Ft as adjectifNumeralOrdinalCourt, je as adjectifTemporelSingulier, dt as adverbeMultiplicatifLatin, $t as adverbeRelatif, w as alternatives, zt as article, Ze as articles, v as assertNever, ut as auPortion, st as auxPortions, Sn as buildArticlePortionTreeFromHtml, A as chain, ke as chainTransformers, ze as citation, Le as citationLigne, Ve as citationSimple, Tr as cleanTexteTitle, o as compoundReferencesSeparators, tn as convert, Ut as convertHtmlElementsToText, Se as createEnumerationOrBoundedInterval, ee as createParentChildTreeFromReferences, tt as date, Qe as decodeNamedHtmlEntities, rt as decodeNumericHtmlEntities, yt as definitionArticleDansCitation, Gt as definitionArticleDansProjetOuPropositionLoi, Ht as definitionDivision, de as definitionTexteFrancais, et as designationArticle, Tt as designationDivision, h as ditPluriel, f as ditSingulier, It as division, S as divisionTypes, ft as divisions, Vt as duDate, $e as espace, Oe as espaceAdverbeRelatif, ie as europeanLawNatures, m as extendLoadedArticle, mr as extractActionDirectivesFromHtml, dr as extractActionDirectivesFromText, nt as extractBillDefinitions, qe as extractCitationReferences, Cn as extractPortionSelectors, Zt as extractReferences, De as extractReferencesWithOriginalTransformations, Ye as extractTextLinks, hn as formatLongDate, Ne as frenchLawNatures, ln as getArticleDateDebut, N as getArticleDateSignature, s as getExtractedReferences, Jt as getExtractedReferencesWithOriginalTransformations, Et as getExtractedTableOfContentsFromTextBill, d as getOrLoadArticle, un as getOrLoadArticleSiblingId, _r as getOrLoadDocument, vr as getOrLoadDocumentsByDossierParlementaireUid, yr as getOrLoadDossierParlementaire, ve as getOrLoadJo, k as getOrLoadSectionTa, r as getOrLoadSectionsTa, pt as getOrLoadTexteVersion, pe as getOrLoadTextelr, he as getOrLoadTextesVersions, xe as getOrLoadTexteslr, Er as getTexteVersionDateDebut, Dr as getTexteVersionDateSignature, Te as identificationTexteEuropeen, Ie as internationalLawNatures, ye as introPluriel, gt as introSingulier, ne as isTextAstAtomicReference, ue as isTextAstDivision, Nt as isTextAstPortion, oe as iterAtomicFirstParentReferences, y as iterAtomicReferences, Ee as iterIncludedReferences, _t as iterReferenceLinks, hr as jsonReplacer, ce as lawNatures, it as lettreAscii, i as liaisonPluriel, mt as liaisonSingulier, Pt as linkTypes, at as listeArticles, fe as listeReferencesSeules, _ as loadArticles, Be as localizationAdverbs, Ke as natureDivisionSingulier, rn as natureTexteFrancais, He as newAssembleeObjectCache, we as newLegifranceObjectCache, t as newObjectCache, p as newReverseTransformationsMergedFromPositionsIterator, jt as nomArticle, St as nomSpecialArticle, Dt as nombreAsTextAstNumber, Rt as nombreCardinal, Xe as nombreRomainCardinal, vt as nombreRomainOrdinal, Wt as nombreRomainOu0iAsTextAstNumber, At as nonLettre, xt as numero, Ot as numeroDivision, a as numeroEtOuDateTexteFrancais, Ue as numeroPortion, Pe as numeroTexteEuropeen, re as numeroTexteFrancais, T as optional, Me as optionalEspaceDuTerritoire, Qt as parseText, Re as portionTypes, nn as portions, me as reference, be as referenceSeule, x as regExp, l as relatifPlurielPrepose, Xt as relatifSingulierPrepose, c as repeat, kt as replaceHtmlPatterns, bt as replacePattern, ct as replaceTextPatterns, U as resolvePortionSelector, u as reversePositionsSplitFromPositions, _e as reverseTransformationFromPosition, ht as reverseTransformationsMergedFromPositions, n as reverseTransformedInnerFragment, O as reverseTransformedReplacement, Z as searchArticle, br as searchArticleKeyword, wr as searchQueryReference, Q as searchTexte, xr as searchTexteAbbreviations, ot as simplifyHtml, C as simplifyPlainText, Kt as simplifyText, en as simplifyUnicodeCharacters, pn as sortArticlesByDate, Or as sortTextesVersionsByDate, Fe as texte, te as texteEuropeen, le as texteFrancais, Mt as texteInternational, Je as unePortion, g as uniteBasePreciseeSingulier, ae as uniteBaseSingulier, D as urlFromLegalId, Yt as variable, lt as virguleOuEspace, Lt as walkTableOfContents, Ae as wordsTree };
1748
+ export { w as TextParserContext, ce as action, sn as actionTargets, b as addChildLeftToLastChild, Ht as addLinksOrReferencesToHtmlPage, Tt as addLinksToHtml, Ar as addLinksToMarkdown, Ur as addLinksToText, Ge as addPositionsToTableOfContentsItems, Lt as adjectifNumeralOrdinalCourt, je as adjectifTemporelSingulier, pt as adverbeMultiplicatifLatin, tn as adverbeRelatif, C as alternatives, Vt as article, $e as articles, _ as assertNever, ft as auPortion, lt as auxPortions, On as buildArticlePortionTreeFromHtml, O as chain, ke as chainTransformers, ze as citation, Le as citationLigne, Ve as citationSimple, zr as cleanTexteTitle, o as compoundReferencesSeparators, rn as convert, Gt as convertHtmlElementsToText, Se as createEnumerationOrBoundedInterval, te as createParentChildTreeFromReferences, rt as date, et as decodeNamedHtmlEntities, at as decodeNumericHtmlEntities, xt as definitionArticleDansCitation, qt as definitionArticleDansProjetOuPropositionLoi, Wt as definitionDivision, fe as definitionTexteFrancais, nt as designationArticle, Dt as designationDivision, h as ditPluriel, f as ditSingulier, Rt as division, S as divisionTypes, mt as divisions, Ut as duDate, tt as espace, Oe as espaceAdverbeRelatif, ae as europeanLawNatures, m as extendLoadedArticle, Or as extractActionDirectivesFromHtml, Tr as extractActionDirectivesFromText, it as extractBillDefinitions, Je as extractCitationReferences, kn as extractPortionSelectors, $t as extractReferences, De as extractReferencesWithOriginalTransformations, Ze as extractTextLinks, vn as formatLongDate, Ne as frenchLawNatures, dn as getArticleDateDebut, j as getArticleDateSignature, s as getExtractedReferences, Xt as getExtractedReferencesWithOriginalTransformations, Ot as getExtractedTableOfContentsFromTextBill, d as getOrLoadArticle, fn as getOrLoadArticleSiblingId, jr as getOrLoadDocument, Mr as getOrLoadDocumentsByDossierParlementaireUid, Nr as getOrLoadDossierParlementaire, ve as getOrLoadJo, D as getOrLoadSectionTa, r as getOrLoadSectionsTa, ht as getOrLoadTexteVersion, me as getOrLoadTextelr, ge as getOrLoadTextesVersions, xe as getOrLoadTexteslr, Br as getTexteVersionDateDebut, Vr as getTexteVersionDateSignature, Te as identificationTexteEuropeen, Ie as internationalLawNatures, ye as introPluriel, vt as introSingulier, re as isTextAstAtomicReference, de as isTextAstDivision, Ft as isTextAstPortion, se as iterAtomicFirstParentReferences, v as iterAtomicReferences, Ee as iterIncludedReferences, yt as iterReferenceLinks, kr as jsonReplacer, le as lawNatures, ot as lettreAscii, i as liaisonPluriel, gt as liaisonSingulier, It as linkTypes, st as listeArticles, pe as listeReferencesSeules, ee as loadArticles, Be as localizationAdverbs, qe as natureDivisionSingulier, on as natureTexteFrancais, He as newAssembleeObjectCache, we as newLegifranceObjectCache, t as newObjectCache, p as newReverseTransformationsMergedFromPositionsIterator, Nt as nomArticle, wt as nomSpecialArticle, kt as nombreAsTextAstNumber, Bt as nombreCardinal, Qe as nombreRomainCardinal, bt as nombreRomainOrdinal, Kt as nombreRomainOu0iAsTextAstNumber, Mt as nonLettre, Ct as numero, At as numeroDivision, a as numeroEtOuDateTexteFrancais, We as numeroPortion, Pe as numeroTexteEuropeen, ie as numeroTexteFrancais, Ye as optional, Me as optionalEspaceDuTerritoire, en as parseText, Re as portionTypes, an as portions, he as reference, be as referenceSeule, x as regExp, l as relatifPlurielPrepose, Qt as relatifSingulierPrepose, c as repeat, jt as replaceHtmlPatterns, St as replacePattern, ut as replaceTextPatterns, Mn as resolvePortionSelector, u as reversePositionsSplitFromPositions, _e as reverseTransformationFromPosition, _t as reverseTransformationsMergedFromPositions, n as reverseTransformedInnerFragment, E as reverseTransformedReplacement, Z as searchArticle, Pr as searchArticleKeyword, Rr as searchQueryReference, Q as searchTexte, Fr as searchTexteAbbreviations, ct as simplifyHtml, Ue as simplifyPlainText, Jt as simplifyText, nn as simplifyUnicodeCharacters, gn as sortArticlesByDate, Hr as sortTextesVersionsByDate, Fe as texte, ne as texteEuropeen, ue as texteFrancais, Pt as texteInternational, Xe as unePortion, g as uniteBasePreciseeSingulier, oe as uniteBaseSingulier, T as urlFromLegalId, Zt as variable, dt as virguleOuEspace, zt as walkTableOfContents, Ae as wordsTree };